Implemented Desert Treasure quest

This commit is contained in:
Oven Bread
2025-02-16 09:33:56 +00:00
committed by Ryan
parent 104533c11d
commit 486ca4bb19
41 changed files with 5080 additions and 458 deletions
@@ -57,6 +57,15 @@ abstract class Cutscene(val player: Player) {
base = region.baseLocation
}
/**
* Immediately closes the player's overlay.
*/
fun closeOverlay()
{
logCutscene("Close ${player.username}'s overlay.")
player.interfaceManager.closeOverlay()
}
/**
* Fade the player's view to black. This process can be safely assumed to take about 8 ticks to complete.
*/
@@ -37,6 +37,9 @@ public enum SpecialLadders implements LadderAchievementCheck {
ALKHARID_CRAFTING_DOWN(Location.create(3314,3187,1),Location.create(3310,3187,0)),
ALKHARID_SOCRCERESS_UP(Location.create(3325,3142,0),Location.create(3325,3139,1)),
ALKHARID_SOCRCERESS_DOWN(Location.create(3325,3139,1),Location.create(3325,3143,0)),
KHARIDIAN_DESERT_SUMMONING_UP(Location.create(3299,9318,0),Location.create(3303,2897,0)),
KHARIDIAN_DESERT_SUMMONING_DOWN(Location.create(3304,2897,0),Location.create(3299,9317,0)),
SHADOW_DUNGEON_UP(new Location(2629, 5072,0), new Location(2548, 3421,0)),
CLOCKTOWER_HIDDEN_LADDER(Location.create(2572,9631,0),Location.create(2572,3230,0)),
@@ -27,6 +27,25 @@ class AnimationCommandSet : CommandSet(Privilege.ADMIN) {
player.animate(animation)
}
/**
* Force the player to play animation <Animation ID>
*/
define("anims", Privilege.ADMIN, "::anim <lt>Animation ID<gt>", "Plays the animation with the given ID."){ player, args ->
if (args.size < 3) {
reject(player, "Syntax error: ::anim <Animation ID>")
}
val animation = args[1].toInt()
val animationTo = args[2].toInt()
GameWorld.Pulser.submit(object : Pulse(3, player) {
var someId = animation
override fun pulse(): Boolean {
player.animate(Animation.create(someId))
someId += 1
return someId >= animationTo
}
})
}
/**
* Force the player to loop animation <Animation ID>
*/
@@ -411,6 +411,20 @@ class MiscCommandSet : CommandSet(Privilege.ADMIN){
setVarbit(player, index!!, value!!)
}
define("setvarbits", Privilege.ADMIN, "::setvarbits <lt>FROM VARBIT ID<gt> <lt>TO VARBIT ID<gt> <lt>VALUE<gt>", ""){
player,args ->
if(args.size != 4){
reject(player,"Usage: ::setvarbits fromvarbit tovarbit value")
}
val fromIndex = args[1].toIntOrNull()!!
val toIndex = args[2].toIntOrNull()!!
val value = args[3].toIntOrNull()!!
for (index in fromIndex..toIndex) {
setVarbit(player, index, value)
}
}
define("getvarbit", Privilege.ADMIN, "::getvarbit <lt>VARBIT ID<gt>", "") {
player, args ->
if (args.size != 2)
@@ -139,6 +139,30 @@ class TeleportCommandSet : CommandSet(Privilege.ADMIN){
}
}
/**
* Finds a list of objects/sceneries in a region
*/
define("findobjs", Privilege.ADMIN, "::findobjs <lt>REGION ID<gt> <lt>SCENERY ID<gt>", "Finds all locations of scenery objects of id."){player, args ->
if(args.size < 4) reject(player, "Usage: region_id scenery_id")
val regionId = args[1].toInt()
val sceneryId = args[2].toInt()
val sceneryIdEnd = args[3].toInt()
val region = RegionManager.forId(regionId)
GlobalScope.launch {
for (plane in region.planes) {
for (objects in plane.objects.filterNotNull()) {
for (parent in objects.filterNotNull()) {
if (parent.id in sceneryId..sceneryIdEnd) {
println(parent.location)
}
}
}
}
}
}
/**
* Teleport to a specific player
*/