From 3fc7df7bdc7b7dfb15b21b455641e5bbebfa474a Mon Sep 17 00:00:00 2001 From: Oven Bread Date: Sun, 15 Sep 2024 00:59:31 -0700 Subject: [PATCH 01/16] Prison Pete initial patching. --- Server/data/configs/npc_spawns.json | 20 ++++++++++ .../events/prisonpete/PrisonPeteListeners.kt | 40 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt diff --git a/Server/data/configs/npc_spawns.json b/Server/data/configs/npc_spawns.json index e152ca446..9aee1f117 100644 --- a/Server/data/configs/npc_spawns.json +++ b/Server/data/configs/npc_spawns.json @@ -6631,6 +6631,26 @@ "npc_id": "3115", "loc_data": "{2439,4444,0,1,3}-" }, + { + "npc_id": "3118", + "loc_data": "{2084,4460,0,0,1}-" + }, + { + "npc_id": "3119", + "loc_data": "{2078,4462,0,1,0}-{2082,4466,0,1,0}-{2087,4470,0,1,0}-{2090,4464,0,1,0}-{2091,4461,0,1,0}-" + }, + { + "npc_id": "3120", + "loc_data": "{2080,4464,0,1,0}-{2082,4472,0,1,0}-{2083,4462,0,1,0}-{2083,4463,0,1,0}-{2084,4468,0,1,0}-{2088,4464,0,1,0}-" + }, + { + "npc_id": "3121", + "loc_data": "{2078,4466,0,1,0}-{2080,4470,0,1,0}-{2085,4463,0,1,0}-{2086,4467,0,1,0}-{2091,4470,0,1,0}-" + }, + { + "npc_id": "3122", + "loc_data": "{2080,4467,0,1,0}-{2084,4465,0,1,0}-{2084,4470,0,1,0}-{2087,4462,0,1,0}-{2089,4466,0,1,0}-" + }, { "npc_id": "3123", "loc_data": "{3344,2827,0,1,5}-" diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt new file mode 100644 index 000000000..3d39607d2 --- /dev/null +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt @@ -0,0 +1,40 @@ +package content.global.ame.events.prisonpete + +import core.api.* +import core.cache.def.impl.SceneryDefinition +import core.game.interaction.IntType +import core.game.interaction.InteractionListener +import core.game.world.map.Location +import org.rs09.consts.Scenery + +class PrisonPeteListeners : InteractionListener { + + /** On server load, override/add these sceneries. */ + init { + // TODO: ALL THESE ARE PATCH WORK. THEY ARE HERE TO FIX WHATEVER SCENERY WAS MISSING. + // There is an unremovable scenery at Location(2094, 4465, 0) which is for a bank deposit. I can't remove it, but its purely cosmetic. + // removeScenery(getScenery(Location(2094, 4465, 0))!!) + // Remove the some bad scenery and replace with the teleport one. + removeScenery(getScenery(Location(2085, 4457, 0))!!) + addScenery(4408, Location(2085, 4457, 0), 0, 22) // This ain't right though. I don't think this exists yet. + // Remove the old lever and replace with the new one. + removeScenery(getScenery(Location(2083, 4460, 0))!!) + addScenery(26191, Location(2083, 4460, 0), 0, 10) + //removeScenery(getScenery(Location(2084, 4459, 0))!!) + addScenery(26184, Location(2084, 4459, 0), 1, 0) + addScenery(26186, Location(2085, 4459, 0), 1, 0) // This is apparently non-interactive, authentic. + addScenery(26188, Location(2086, 4459, 0), 1, 0) + addScenery(26184, Location(2087, 4459, 0), 1, 0) + } + + companion object { + } + + override fun defineListeners() { + on(Scenery.LEVER_26191, IntType.SCENERY, "pull") { player, node -> + val definition = SceneryDefinition.forId((node as core.game.node.scenery.Scenery).id) + println(definition.modelIds[0]) + return@on true + } + } +} From a94cf28a5498ccb1b6170d68b6906a5e746fc927 Mon Sep 17 00:00:00 2001 From: Oven Bread Date: Sun, 15 Sep 2024 16:05:05 -0700 Subject: [PATCH 02/16] Prison Pete final patching. --- .../events/prisonpete/PrisonPeteListeners.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt index 3d39607d2..e21dbc5b3 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt @@ -9,18 +9,19 @@ import org.rs09.consts.Scenery class PrisonPeteListeners : InteractionListener { - /** On server load, override/add these sceneries. */ + /** On server load, override or add these sceneries. */ init { - // TODO: ALL THESE ARE PATCH WORK. THEY ARE HERE TO FIX WHATEVER SCENERY WAS MISSING. - // There is an unremovable scenery at Location(2094, 4465, 0) which is for a bank deposit. I can't remove it, but its purely cosmetic. - // removeScenery(getScenery(Location(2094, 4465, 0))!!) - // Remove the some bad scenery and replace with the teleport one. + /** NOTE: ALL THESE ARE WORKAROUNDS. THEY ARE HERE TO FIX WHATEVER SCENERY WAS MISSING. */ + // Remove these if the map is properly updated. + // ADD BANK DEPOSIT BOX SCENERY REPLACING MISTAKE BONE WALL SCENERY + addScenery(36788, Location(2094, 4465, 0), 1, 10) + // REMOVE WRONG LIGHT SCENERY, ADD CORRECT GREEN PORTAL SCENERY removeScenery(getScenery(Location(2085, 4457, 0))!!) - addScenery(4408, Location(2085, 4457, 0), 0, 22) // This ain't right though. I don't think this exists yet. - // Remove the old lever and replace with the new one. + // addScenery(4408, Location(2085, 4457, 0), 0, 10) // This ain't right though. I don't think this exists yet. + // REMOVE OLD LEVER SCENERY, ADD CORRECT LEVER SCENERY removeScenery(getScenery(Location(2083, 4460, 0))!!) addScenery(26191, Location(2083, 4460, 0), 0, 10) - //removeScenery(getScenery(Location(2084, 4459, 0))!!) + // ADD WINDOW AND DOOR MISSING SCENERY addScenery(26184, Location(2084, 4459, 0), 1, 0) addScenery(26186, Location(2085, 4459, 0), 1, 0) // This is apparently non-interactive, authentic. addScenery(26188, Location(2086, 4459, 0), 1, 0) From 372b1a2d7e42765bc1aa4560d1cba188106d7302 Mon Sep 17 00:00:00 2001 From: Oven Bread Date: Mon, 16 Sep 2024 02:23:15 -0700 Subject: [PATCH 03/16] More shit --- Server/data/configs/npc_configs.json | 52 ++++++++++++++++++- .../events/prisonpete/PrisonPeteListeners.kt | 20 ++++++- 2 files changed, 69 insertions(+), 3 deletions(-) diff --git a/Server/data/configs/npc_configs.json b/Server/data/configs/npc_configs.json index 123422daf..b7aad18ed 100644 --- a/Server/data/configs/npc_configs.json +++ b/Server/data/configs/npc_configs.json @@ -30099,7 +30099,55 @@ "attack_level": "1" }, { - "examine": "Looks after farming tools.", + "examine": "He wants to escape!", + "melee_animation": "0", + "range_animation": "0", + "defence_animation": "0", + "magic_animation": "0", + "death_animation": "0", + "name": "Prison Pete", + "defence_level": "1", + "safespot": null, + "lifepoints": "10", + "strength_level": "1", + "id": "3118", + "range_level": "1", + "attack_level": "1" + }, + { + "examine": "It looks like an animal.", + "melee_animation": "0", + "range_animation": "0", + "defence_animation": "0", + "magic_animation": "0", + "death_animation": "0", + "name": "Balloon Animal", + "defence_level": "1", + "safespot": null, + "lifepoints": "10", + "strength_level": "1", + "id": "3119", + "range_level": "1", + "attack_level": "1" + }, + { + "examine": "It looks like an animal.", + "melee_animation": "0", + "range_animation": "0", + "defence_animation": "0", + "magic_animation": "0", + "death_animation": "0", + "name": "Balloon Animal", + "defence_level": "1", + "safespot": null, + "lifepoints": "10", + "strength_level": "1", + "id": "3120", + "range_level": "1", + "attack_level": "1" + }, + { + "examine": "It looks like an animal.", "melee_animation": "0", "range_animation": "0", "defence_animation": "0", @@ -30115,7 +30163,7 @@ "attack_level": "1" }, { - "examine": "I saw the witchdoctor", + "examine": "It looks like an animal.", "melee_animation": "0", "range_animation": "0", "defence_animation": "0", diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt index e21dbc5b3..50a270d1e 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt @@ -5,8 +5,10 @@ import core.cache.def.impl.SceneryDefinition import core.game.interaction.IntType import core.game.interaction.InteractionListener import core.game.world.map.Location +import org.rs09.consts.NPCs import org.rs09.consts.Scenery +// You have 15 mins, or you will still get teled out anyway. class PrisonPeteListeners : InteractionListener { /** On server load, override or add these sceneries. */ @@ -32,10 +34,26 @@ class PrisonPeteListeners : InteractionListener { } override fun defineListeners() { - on(Scenery.LEVER_26191, IntType.SCENERY, "pull") { player, node -> + on(Scenery.LEVER_26191, SCENERY, "pull") { player, node -> val definition = SceneryDefinition.forId((node as core.game.node.scenery.Scenery).id) println(definition.modelIds[0]) return@on true } + on(intArrayOf(NPCs.BALLOON_ANIMAL_3119,NPCs.BALLOON_ANIMAL_3120,NPCs.BALLOON_ANIMAL_3121,NPCs.BALLOON_ANIMAL_3122), NPC, "pull") { player, node -> + sendMessage(player, "POP") + + //if you have key + // npc(FacialExpression.ANGRY, "Hey, bring me that key you've got!", "I wanna get out of here!") // B6FwlfnRtAo + return@on true + } + + // End of 15 mins: + // SFiAALVHrR8 + // npc(FacialExpression.SAD, "You've served your sentence, so you can walk out now.", "Lucky you!") + // player(FacialExpression.THINKING, "Aren't you coming?") + // npc(FacialExpression.SAD, "No, I've got a life sentence. Maybe if you'd been able", "to get the door open for yourself I could have escaped", "with you.") + // player(FacialExpression.THINKING, "I'm sorry.") + // npc(FacialExpression.SAD, "Oh, don't worry. Someone always rescues me", "eventually. Then Evil Bob drags me back again. It's", "been going on for ages. Now, you'd better get out", "before you're arrested for loitering.") + // walk to door teleport out without any reward. } } From 3e76af34d4ffbac23bce979eed35f508291e7ea1 Mon Sep 17 00:00:00 2001 From: Oven Bread Date: Mon, 16 Sep 2024 03:29:15 -0700 Subject: [PATCH 04/16] Prison Pete dialogue --- .../events/prisonpete/PrisonPeteDialogue.kt | 55 +++++++++++++++++++ .../events/prisonpete/PrisonPeteListeners.kt | 2 +- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt new file mode 100644 index 000000000..08ca4519c --- /dev/null +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt @@ -0,0 +1,55 @@ +package content.global.ame.events.prisonpete + +import core.api.* +import core.game.dialogue.DialogueBuilder +import core.game.dialogue.DialogueBuilderFile +import core.game.dialogue.DialoguePlugin +import core.game.dialogue.FacialExpression +import core.game.node.entity.player.Player +import core.plugin.Initializable +import org.rs09.consts.NPCs + +@Initializable +class PrisonPeteDialogue (player: Player? = null) : DialoguePlugin(player) { + override fun handle(interfaceId: Int, buttonId: Int): Boolean { + openDialogue(player, PrisonPeteDialogueFile(), npc) + return true + } + override fun newInstance(player: Player): DialoguePlugin { + return PrisonPeteDialogue(player) + } + override fun getIds(): IntArray { + return intArrayOf(NPCs.PRISON_PETE_3118) + } +} + +class PrisonPeteDialogueFile : DialogueBuilderFile() { + + override fun create(b: DialogueBuilder) { + b.onPredicate { _ -> true } + .options("What would you like to say?").let { optionBuilder -> + + optionBuilder.option("What is this place?") + .playerl(FacialExpression.THINKING,"What is this place?") + .npc(FacialExpression.SAD, "Don't you remember? This is ScapeRune's prison.", "Evil Bob caught you and brought you here.") + .player(FacialExpression.ANGRY, "What gives him the right to lock me up?", "I demand to see a lawyer! I know my rights!") + .npc(FacialExpression.SAD, "Evil Bob doesn't care about people's rights.", "He's cruel and utterly merciless. He's a cat.") + .player(FacialExpression.ANGRY, "How do I get out of here?", "I can't be held captive by a cat!") + .npc(FacialExpression.SAD, "Some of these balloon animals have keys in them, and if", "you pull the big lever it tells you which shape animal", "contains the correct key, but I can never find it.") + .npc(FacialExpression.SAD, "You need to pull the lever to find out which shape", "animal contains the key, then pop that sort of animal to", "get the key.") + .npc(FacialExpression.SAD, "Bring me any keys you get and", "I'll try them on the doors.") + .playerl(FacialExpression.THINKING,"What happens if I get it wrong?") + .npc(FacialExpression.SAD, "You haven't get a life sentence, so they'll let you out in", "[15] minutes, but you should be able to escape much", "faster if you go pull that lever and pop the right balloon", "animals.") + .end() + + optionBuilder.option("How do I get out of here?") + .player(FacialExpression.ANGRY, "How do I get out of here?", "I can't be held captive by a cat!") + .npc(FacialExpression.SAD, "Some of these balloon animals have keys in them, and if", "you pull the big lever it tells you which shape animal", "contains the correct key, but I can never find it.") + .npc(FacialExpression.SAD, "You need to pull the lever to find out which shape", "animal contains the key, then pop that sort of animal to", "get the key.") + .npc(FacialExpression.SAD, "Bring me any keys you get and", "I'll try them on the doors.") + .playerl(FacialExpression.THINKING,"What happens if I get it wrong?") + .npc(FacialExpression.SAD, "You haven't get a life sentence, so they'll let you out in", "[15] minutes, but you should be able to escape much", "faster if you go pull that lever and pop the right balloon", "animals.") + .end() + } + } +} \ No newline at end of file diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt index 50a270d1e..daded62eb 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt @@ -39,7 +39,7 @@ class PrisonPeteListeners : InteractionListener { println(definition.modelIds[0]) return@on true } - on(intArrayOf(NPCs.BALLOON_ANIMAL_3119,NPCs.BALLOON_ANIMAL_3120,NPCs.BALLOON_ANIMAL_3121,NPCs.BALLOON_ANIMAL_3122), NPC, "pull") { player, node -> + on(intArrayOf(NPCs.BALLOON_ANIMAL_3119,NPCs.BALLOON_ANIMAL_3120,NPCs.BALLOON_ANIMAL_3121,NPCs.BALLOON_ANIMAL_3122), NPC, "pop") { player, node -> sendMessage(player, "POP") //if you have key From d9583ce9aa3d5e1ca707eccdc5d7c761dd907188 Mon Sep 17 00:00:00 2001 From: Oven Bread Date: Fri, 20 Sep 2024 11:44:09 -0700 Subject: [PATCH 05/16] More prison pete stuff --- Server/data/configs/item_configs.json | 9 ++++ .../events/prisonpete/PrisonPeteListeners.kt | 8 +++- .../ame/events/prisonpete/PrisonPeteNPC.kt | 43 +++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 Server/src/main/content/global/ame/events/prisonpete/PrisonPeteNPC.kt diff --git a/Server/data/configs/item_configs.json b/Server/data/configs/item_configs.json index 34d0d7b90..fc95d8682 100644 --- a/Server/data/configs/item_configs.json +++ b/Server/data/configs/item_configs.json @@ -63795,6 +63795,15 @@ "archery_ticket_price": "0", "id": "6965" }, + { + "examine": "A key to the prison.", + "grand_exchange_price": "0", + "durability": null, + "name": "Prison key", + "tradeable": "false", + "archery_ticket_price": "0", + "id": "6966" + }, { "lendable": "true", "examine": "Makes the wearer pretty intimidating.", diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt index daded62eb..d50b69940 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt @@ -4,9 +4,12 @@ import core.api.* import core.cache.def.impl.SceneryDefinition import core.game.interaction.IntType import core.game.interaction.InteractionListener +import core.game.node.entity.Entity +import core.game.node.entity.npc.NPC import core.game.world.map.Location import org.rs09.consts.NPCs import org.rs09.consts.Scenery +import org.rs09.consts.Items // You have 15 mins, or you will still get teled out anyway. class PrisonPeteListeners : InteractionListener { @@ -40,8 +43,11 @@ class PrisonPeteListeners : InteractionListener { return@on true } on(intArrayOf(NPCs.BALLOON_ANIMAL_3119,NPCs.BALLOON_ANIMAL_3120,NPCs.BALLOON_ANIMAL_3121,NPCs.BALLOON_ANIMAL_3122), NPC, "pop") { player, node -> - sendMessage(player, "POP") + sendGraphics(524, node.location) + (node as NPC).finalizeDeath(player) + animate(player, 10017) + // addItem(player, Items.PRISON_KEY_6966) //if you have key // npc(FacialExpression.ANGRY, "Hey, bring me that key you've got!", "I wanna get out of here!") // B6FwlfnRtAo return@on true diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteNPC.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteNPC.kt new file mode 100644 index 000000000..a989f0412 --- /dev/null +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteNPC.kt @@ -0,0 +1,43 @@ +package content.global.ame.events.prisonpete + +import content.global.ame.RandomEventNPC +import content.global.ame.events.evilbob.EvilBobUtils +import core.api.* +import core.api.utils.WeightBasedTable +import core.game.interaction.QueueStrength +import core.game.node.entity.npc.NPC +import core.game.system.timer.impl.AntiMacro +import org.rs09.consts.NPCs +import org.rs09.consts.Sounds + +/** Technically its EvilBobNpc, but theres already another random with him. */ +class PrisonPeteNPC(override var loot: WeightBasedTable? = null) : RandomEventNPC(NPCs.EVIL_BOB_2478) { + + override fun init() { + super.init() + sendChat("meow") + queueScript(player, 4, QueueStrength.SOFT) { stage: Int -> + when (stage) { + 0 -> { + lock(player, 6) + sendChat(player, "No... what? Nooooooooooooo!") + animate(player, EvilBobUtils.teleAnim) + player.graphics(EvilBobUtils.telegfx) + playAudio(player, Sounds.TELEPORT_ALL_200) + return@queueScript delayScript(player, 3) + } + 1 -> { + sendMessage(player, "Welcome to Scape2009.") + openDialogue(player, PrisonPeteDialogue(), NPCs.PRISON_PETE_3118) + AntiMacro.terminateEventNpc(player) + return@queueScript stopExecuting(player) + } + else -> return@queueScript stopExecuting(player) + } + } + } + + override fun talkTo(npc: NPC) { + // The cat doesn't talk. + } +} \ No newline at end of file From 2c00d8add9c2cab84e669a51cc7034ae0560b7c8 Mon Sep 17 00:00:00 2001 From: Oven Bread Date: Tue, 8 Oct 2024 01:52:02 -0700 Subject: [PATCH 06/16] Screw this random in particular. I don't have the animation for the goddamn component. --- Server/data/ObjectParser.xml | 10 +++ .../events/prisonpete/PrisonPeteDialogue.kt | 20 ++++++ .../events/prisonpete/PrisonPeteListeners.kt | 63 ++++++++++++------- .../ame/events/prisonpete/PrisonPeteNPC.kt | 6 +- 4 files changed, 73 insertions(+), 26 deletions(-) diff --git a/Server/data/ObjectParser.xml b/Server/data/ObjectParser.xml index b10a0d445..e8670de77 100644 --- a/Server/data/ObjectParser.xml +++ b/Server/data/ObjectParser.xml @@ -4,6 +4,16 @@ + + + + + + + + + + diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt index 08ca4519c..037edbe77 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt @@ -1,5 +1,6 @@ package content.global.ame.events.prisonpete +import core.ServerConstants import core.api.* import core.game.dialogue.DialogueBuilder import core.game.dialogue.DialogueBuilderFile @@ -7,6 +8,7 @@ import core.game.dialogue.DialoguePlugin import core.game.dialogue.FacialExpression import core.game.node.entity.player.Player import core.plugin.Initializable +import org.rs09.consts.Components import org.rs09.consts.NPCs @Initializable @@ -52,4 +54,22 @@ class PrisonPeteDialogueFile : DialogueBuilderFile() { .end() } } +} + +class PrisonPeteIntroDialogueFile : DialogueBuilderFile() { + + override fun create(b: DialogueBuilder) { + b.onPredicate { _ -> true } + .playerl(FacialExpression.AMAZED, "What on ${ServerConstants.SERVER_NAME} just happened?") + .npc(FacialExpression.SAD, "This isn't ${ServerConstants.SERVER_NAME} anymore, this is ScapeRune.", "So you've been captured, too?") + .playerl(FacialExpression.THINKING, "Captured?") + .npcl(FacialExpression.SAD, "Yes, Evil Bob captured me and stuck me in this prison.") + .player(FacialExpression.ANGRY, "How do I get out of here?", "I can't be held captive by a cat!") + .npcl(FacialExpression.SAD, "Some of these balloon animals have keys in them, and if you pull the big lever it tells you which shape animal contains the correct key, but I can never find it.") + .npcl(FacialExpression.SAD, "You need to pull the lever to find out which shape animal contains the key, then pop that sort of animal to get the key.") + .npc(FacialExpression.SAD, "Bring me any keys you get and", "I'll try them on the doors.") + .playerl(FacialExpression.THINKING,"What happens if I get it wrong?") + .npc(FacialExpression.SAD, "You haven't get a life sentence, so they'll let you out in", "[15] minutes, but you should be able to escape much", "faster if you go pull that lever and pop the right balloon", "animals.") + .end() + } } \ No newline at end of file diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt index d50b69940..8c7b4c642 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt @@ -7,42 +7,59 @@ import core.game.interaction.InteractionListener import core.game.node.entity.Entity import core.game.node.entity.npc.NPC import core.game.world.map.Location +import org.rs09.consts.Components import org.rs09.consts.NPCs import org.rs09.consts.Scenery import org.rs09.consts.Items -// You have 15 mins, or you will still get teled out anyway. +// Model 6474 is interesting +// http://youtu.be/a1R5vdqiBCQ +/** + * + * You have 15 mins, or you will still get teled out anyway. + * Note: On server load, some sceneries are overwritten in ObjectParser.xml file. + */ class PrisonPeteListeners : InteractionListener { - /** On server load, override or add these sceneries. */ - init { - /** NOTE: ALL THESE ARE WORKAROUNDS. THEY ARE HERE TO FIX WHATEVER SCENERY WAS MISSING. */ - // Remove these if the map is properly updated. - // ADD BANK DEPOSIT BOX SCENERY REPLACING MISTAKE BONE WALL SCENERY - addScenery(36788, Location(2094, 4465, 0), 1, 10) - // REMOVE WRONG LIGHT SCENERY, ADD CORRECT GREEN PORTAL SCENERY - removeScenery(getScenery(Location(2085, 4457, 0))!!) - // addScenery(4408, Location(2085, 4457, 0), 0, 10) // This ain't right though. I don't think this exists yet. - // REMOVE OLD LEVER SCENERY, ADD CORRECT LEVER SCENERY - removeScenery(getScenery(Location(2083, 4460, 0))!!) - addScenery(26191, Location(2083, 4460, 0), 0, 10) - // ADD WINDOW AND DOOR MISSING SCENERY - addScenery(26184, Location(2084, 4459, 0), 1, 0) - addScenery(26186, Location(2085, 4459, 0), 1, 0) // This is apparently non-interactive, authentic. - addScenery(26188, Location(2086, 4459, 0), 1, 0) - addScenery(26184, Location(2087, 4459, 0), 1, 0) - } companion object { } - + var count = 1 override fun defineListeners() { on(Scenery.LEVER_26191, SCENERY, "pull") { player, node -> - val definition = SceneryDefinition.forId((node as core.game.node.scenery.Scenery).id) - println(definition.modelIds[0]) - return@on true +// val definition = SceneryDef)inition.forId((node as core.game.node.scenery.Scenery).id) +//// println(definition.modelIds[0] + openInterface(player, Components.PRISONPETE_273) + setComponentVisibility(player, Components.PRISONPETE_273, 1, true) + setComponentVisibility(player, Components.PRISONPETE_273, 2, true) + setComponentVisibility(player, Components.PRISONPETE_273, 3, true) + setComponentVisibility(player, Components.PRISONPETE_273, 4, true) + setComponentVisibility(player, Components.PRISONPETE_273, 5, true) + setComponentVisibility(player, Components.PRISONPETE_273, 6, true) + setComponentVisibility(player, Components.PRISONPETE_273, 7, true) // Dies + println(count) + setComponentVisibility(player, Components.PRISONPETE_273, count, false) + player.packetDispatch.sendModelOnInterface(10750, Components.PRISONPETE_273, count, 0) + sendAnimationOnInterface(player, 3047, Components.PRISONPETE_273, count) + count++ + + // player.packetDispatch.sendNpcOnInterface(3122, Components.PRISONPETE_273, 3) didn't work + // 10734 10750 anim3047 + // player.getPacketDispatch().sendAngleOnInterface(Components.PRISONPETE_273, 3, 500, 0, 0) +// for (i in 1..6) +// player.packetDispatch.sendModelOnInterface(10750, Components.PRISONPETE_273, i, 0) +// player.packetDispatch.sendModelOnInterface(10750, Components.PRISONPETE_273, 4, 0) +// player.packetDispatch.sendModelOnInterface(10750, Components.PRISONPETE_273, 5, 0) +// player.packetDispatch.sendModelOnInterface(10750, Components.PRISONPETE_273, 6, 0) +// sendAnimationOnInterface(player, 3047, Components.PRISONPETE_273, 1) // anim 7162 +// sendAnimationOnInterface(player, 3042 + count, Components.PRISONPETE_273, 4) +// sendAnimationOnInterface(player, 3042 + count, Components.PRISONPETE_273, 5) +// sendAnimationOnInterface(player, 3042 + count, Components.PRISONPETE_273, 6) + return@on true } on(intArrayOf(NPCs.BALLOON_ANIMAL_3119,NPCs.BALLOON_ANIMAL_3120,NPCs.BALLOON_ANIMAL_3121,NPCs.BALLOON_ANIMAL_3122), NPC, "pop") { player, node -> + + sendGraphics(524, node.location) (node as NPC).finalizeDeath(player) diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteNPC.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteNPC.kt index a989f0412..60a983e4d 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteNPC.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteNPC.kt @@ -7,10 +7,11 @@ import core.api.utils.WeightBasedTable import core.game.interaction.QueueStrength import core.game.node.entity.npc.NPC import core.game.system.timer.impl.AntiMacro +import core.game.world.update.flag.context.Graphics import org.rs09.consts.NPCs import org.rs09.consts.Sounds -/** Technically its EvilBobNpc, but theres already another random with him. */ +/** Technically its EvilBobNpc, but there's already another random with him. */ class PrisonPeteNPC(override var loot: WeightBasedTable? = null) : RandomEventNPC(NPCs.EVIL_BOB_2478) { override fun init() { @@ -21,8 +22,7 @@ class PrisonPeteNPC(override var loot: WeightBasedTable? = null) : RandomEventNP 0 -> { lock(player, 6) sendChat(player, "No... what? Nooooooooooooo!") - animate(player, EvilBobUtils.teleAnim) - player.graphics(EvilBobUtils.telegfx) + visualize(player, 714, Graphics(308, 100, 50)) playAudio(player, Sounds.TELEPORT_ALL_200) return@queueScript delayScript(player, 3) } From a3626a56724176bb136a2ff6e3f98ea36da6cc17 Mon Sep 17 00:00:00 2001 From: Oven Bread Date: Tue, 8 Oct 2024 21:29:17 -0700 Subject: [PATCH 07/16] Lots more stupid shit --- .../events/prisonpete/PrisonPeteDialogue.kt | 64 ++++++--- .../events/prisonpete/PrisonPeteListeners.kt | 132 ++++++++++++------ 2 files changed, 131 insertions(+), 65 deletions(-) diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt index 037edbe77..ebd213028 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt @@ -29,30 +29,52 @@ class PrisonPeteDialogueFile : DialogueBuilderFile() { override fun create(b: DialogueBuilder) { b.onPredicate { _ -> true } - .options("What would you like to say?").let { optionBuilder -> + .branch { + player -> if(getAttribute(player, PrisonPeteListeners.attributePoppedBalloon, null) != null) { 1 } else { 0 } } + .let{ branch -> - optionBuilder.option("What is this place?") - .playerl(FacialExpression.THINKING,"What is this place?") - .npc(FacialExpression.SAD, "Don't you remember? This is ScapeRune's prison.", "Evil Bob caught you and brought you here.") - .player(FacialExpression.ANGRY, "What gives him the right to lock me up?", "I demand to see a lawyer! I know my rights!") - .npc(FacialExpression.SAD, "Evil Bob doesn't care about people's rights.", "He's cruel and utterly merciless. He's a cat.") - .player(FacialExpression.ANGRY, "How do I get out of here?", "I can't be held captive by a cat!") - .npc(FacialExpression.SAD, "Some of these balloon animals have keys in them, and if", "you pull the big lever it tells you which shape animal", "contains the correct key, but I can never find it.") - .npc(FacialExpression.SAD, "You need to pull the lever to find out which shape", "animal contains the key, then pop that sort of animal to", "get the key.") - .npc(FacialExpression.SAD, "Bring me any keys you get and", "I'll try them on the doors.") - .playerl(FacialExpression.THINKING,"What happens if I get it wrong?") - .npc(FacialExpression.SAD, "You haven't get a life sentence, so they'll let you out in", "[15] minutes, but you should be able to escape much", "faster if you go pull that lever and pop the right balloon", "animals.") - .end() + branch.onValue(1) + .npc(FacialExpression.FRIENDLY, "Ooh, thanks! I'll see if it's the right one...") + .branch { + player -> if(getAttribute(player, PrisonPeteListeners.attributePoppedBalloon, null) != null) { 1 } else { 0 } } + .let { branch2 -> + branch2.onValue(1) + .npc(FacialExpression.FRIENDLY, "Hooray, you got the right one! Now pull the lever again", "and let's get the next lock unlocked.") + .end() - optionBuilder.option("How do I get out of here?") - .player(FacialExpression.ANGRY, "How do I get out of here?", "I can't be held captive by a cat!") - .npc(FacialExpression.SAD, "Some of these balloon animals have keys in them, and if", "you pull the big lever it tells you which shape animal", "contains the correct key, but I can never find it.") - .npc(FacialExpression.SAD, "You need to pull the lever to find out which shape", "animal contains the key, then pop that sort of animal to", "get the key.") - .npc(FacialExpression.SAD, "Bring me any keys you get and", "I'll try them on the doors.") - .playerl(FacialExpression.THINKING,"What happens if I get it wrong?") - .npc(FacialExpression.SAD, "You haven't get a life sentence, so they'll let you out in", "[15] minutes, but you should be able to escape much", "faster if you go pull that lever and pop the right balloon", "animals.") - .end() + branch2.onValue(0) + .npc(FacialExpression.SAD, "Aww, that was the wrong key! You must have popped", "the wrong sort of animal. Try the big lever again; it'll", "tell you which animal to pop.") + .end() + + } + + branch.onValue(0) + .options("What would you like to say?").let { optionBuilder -> + + optionBuilder.option("What is this place?") + .playerl(FacialExpression.THINKING,"What is this place?") + .npc(FacialExpression.SAD, "Don't you remember? This is ScapeRune's prison.", "Evil Bob caught you and brought you here.") + .player(FacialExpression.ANGRY, "What gives him the right to lock me up?", "I demand to see a lawyer! I know my rights!") + .npc(FacialExpression.SAD, "Evil Bob doesn't care about people's rights.", "He's cruel and utterly merciless. He's a cat.") + .player(FacialExpression.ANGRY, "How do I get out of here?", "I can't be held captive by a cat!") + .npc(FacialExpression.SAD, "Some of these balloon animals have keys in them, and if", "you pull the big lever it tells you which shape animal", "contains the correct key, but I can never find it.") + .npc(FacialExpression.SAD, "You need to pull the lever to find out which shape", "animal contains the key, then pop that sort of animal to", "get the key.") + .npc(FacialExpression.SAD, "Bring me any keys you get and", "I'll try them on the doors.") + .playerl(FacialExpression.THINKING,"What happens if I get it wrong?") + .npc(FacialExpression.SAD, "You haven't get a life sentence, so they'll let you out in", "[15] minutes, but you should be able to escape much", "faster if you go pull that lever and pop the right balloon", "animals.") + .end() + + optionBuilder.option("How do I get out of here?") + .player(FacialExpression.ANGRY, "How do I get out of here?", "I can't be held captive by a cat!") + .npc(FacialExpression.SAD, "Some of these balloon animals have keys in them, and if", "you pull the big lever it tells you which shape animal", "contains the correct key, but I can never find it.") + .npc(FacialExpression.SAD, "You need to pull the lever to find out which shape", "animal contains the key, then pop that sort of animal to", "get the key.") + .npc(FacialExpression.SAD, "Bring me any keys you get and", "I'll try them on the doors.") + .playerl(FacialExpression.THINKING,"What happens if I get it wrong?") + .npc(FacialExpression.SAD, "You haven't get a life sentence, so they'll let you out in", "[15] minutes, but you should be able to escape much", "faster if you go pull that lever and pop the right balloon", "animals.") + .end() + } } + } } diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt index 8c7b4c642..7ae9d0f69 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt @@ -1,72 +1,105 @@ package content.global.ame.events.prisonpete import core.api.* -import core.cache.def.impl.SceneryDefinition -import core.game.interaction.IntType +import core.game.dialogue.FacialExpression import core.game.interaction.InteractionListener -import core.game.node.entity.Entity +import core.game.interaction.InterfaceListener +import core.game.interaction.QueueStrength import core.game.node.entity.npc.NPC -import core.game.world.map.Location +import core.game.node.entity.player.Player import org.rs09.consts.Components +import org.rs09.consts.Items import org.rs09.consts.NPCs import org.rs09.consts.Scenery -import org.rs09.consts.Items // Model 6474 is interesting // http://youtu.be/a1R5vdqiBCQ /** + * Prison Pete Random / Evil Bob 2 + * Do note that this is the most patchwork random ever, due to the map being in transition to a newer one. + * The old one (seen in osrs too) has a corridor on the east with 3 barriers. + * The new one (seen in rs3) came in around Jan 2009 and includes a locked door to the south. + * Due to the shit map and half fucked version of objects, we are following the locked door variation. + * Note that there are a lot of moving parts due to Jigglyflex trying stupid shit. * * You have 15 mins, or you will still get teled out anyway. * Note: On server load, some sceneries are overwritten in ObjectParser.xml file. */ -class PrisonPeteListeners : InteractionListener { - +class PrisonPeteListeners : InteractionListener, InterfaceListener { companion object { + val balloons = intArrayOf(NPCs.BALLOON_ANIMAL_3119,NPCs.BALLOON_ANIMAL_3120,NPCs.BALLOON_ANIMAL_3121,NPCs.BALLOON_ANIMAL_3122) + val models = intArrayOf(10734, 10735, 10736, 10737) + const val attributeTimesUnlocked = "/save:prisonpete:timesUnlocked" + const val attributeCurrentBalloonIndex = "/save:prisonpete:currentballoon" + const val attributePoppedBalloon = "/save:prisonpete:poppedballoon" + + + + fun randomizeBalloon(player: Player) { + setAttribute(player, attributeCurrentBalloonIndex, (0..3).random()) + } } + var count = 1 override fun defineListeners() { + + /** + * Alright, this is the most infuriating component. + * I cannot for the life of me get this goddamn thing to animate. + * So here's some details + * + * Clicking on the lever should open Components.PRISONPETE_273 + * child 1 is the text below + * child 2 is the button overlaying the balloon + * child 3 is the balloon image + * child 4-6 is unknown + * + * There are 2 sets of balloon animal MODELS. + * 10734, 10735, 10736, 10737 - Models used for NPCs 3119, 3120, 3121, 3122 + * 10749, 10750, 10751, 10752 - Models used for the component(PRISONPETE_273) because 10753 is the grill for it. + * + * Animation 3047 is the "old" rotating animation, ([3048, 3049, 3050, 3052] are walking animations for balloons) + * but the first set animates it waaay too tiny, + * and the second set doesn't animate at all. + * + * I've tried a lot of animations, but I can't find it, so the replacment here is to use: + * the first set, with animation 7163 as a workaround + * + * Update: I've determined from a1R5vdqiBCQ that this is a challenging one. + * You can click on the interface, which changes the way the thing spins. + * I'm assuming one of the other childs (4,5,6) are axis controls, that I don't know how to control. + * maybe all that 562_interface_configs.txt and stuff + * player.packetDispatch.sendIfaceSettings(281, 5, Components.PRISONPETE_273, 23, 23) + * + */ on(Scenery.LEVER_26191, SCENERY, "pull") { player, node -> -// val definition = SceneryDef)inition.forId((node as core.game.node.scenery.Scenery).id) -//// println(definition.modelIds[0] openInterface(player, Components.PRISONPETE_273) - setComponentVisibility(player, Components.PRISONPETE_273, 1, true) - setComponentVisibility(player, Components.PRISONPETE_273, 2, true) - setComponentVisibility(player, Components.PRISONPETE_273, 3, true) - setComponentVisibility(player, Components.PRISONPETE_273, 4, true) - setComponentVisibility(player, Components.PRISONPETE_273, 5, true) - setComponentVisibility(player, Components.PRISONPETE_273, 6, true) - setComponentVisibility(player, Components.PRISONPETE_273, 7, true) // Dies - println(count) - setComponentVisibility(player, Components.PRISONPETE_273, count, false) - player.packetDispatch.sendModelOnInterface(10750, Components.PRISONPETE_273, count, 0) - sendAnimationOnInterface(player, 3047, Components.PRISONPETE_273, count) - count++ - - // player.packetDispatch.sendNpcOnInterface(3122, Components.PRISONPETE_273, 3) didn't work - // 10734 10750 anim3047 - // player.getPacketDispatch().sendAngleOnInterface(Components.PRISONPETE_273, 3, 500, 0, 0) -// for (i in 1..6) -// player.packetDispatch.sendModelOnInterface(10750, Components.PRISONPETE_273, i, 0) -// player.packetDispatch.sendModelOnInterface(10750, Components.PRISONPETE_273, 4, 0) -// player.packetDispatch.sendModelOnInterface(10750, Components.PRISONPETE_273, 5, 0) -// player.packetDispatch.sendModelOnInterface(10750, Components.PRISONPETE_273, 6, 0) -// sendAnimationOnInterface(player, 3047, Components.PRISONPETE_273, 1) // anim 7162 -// sendAnimationOnInterface(player, 3042 + count, Components.PRISONPETE_273, 4) -// sendAnimationOnInterface(player, 3042 + count, Components.PRISONPETE_273, 5) -// sendAnimationOnInterface(player, 3042 + count, Components.PRISONPETE_273, 6) - return@on true + randomizeBalloon(player) + player.packetDispatch.sendModelOnInterface(models[getAttribute(player, attributeCurrentBalloonIndex, 0)], Components.PRISONPETE_273, 3, 0) + sendAnimationOnInterface(player,7163, Components.PRISONPETE_273, 3) + return@on true } - on(intArrayOf(NPCs.BALLOON_ANIMAL_3119,NPCs.BALLOON_ANIMAL_3120,NPCs.BALLOON_ANIMAL_3121,NPCs.BALLOON_ANIMAL_3122), NPC, "pop") { player, node -> - - sendGraphics(524, node.location) - (node as NPC).finalizeDeath(player) - - animate(player, 10017) - // addItem(player, Items.PRISON_KEY_6966) - //if you have key - // npc(FacialExpression.ANGRY, "Hey, bring me that key you've got!", "I wanna get out of here!") // B6FwlfnRtAo + // Burst a balloon. + on(intArrayOf(*balloons), NPC, "pop") { player, node -> + if (inInventory(player, Items.PRISON_KEY_6966)){ + sendNPCDialogueLines(player, NPCs.PRISON_PETE_3118, FacialExpression.ANGRY, false,"Hey, bring me that key you've got!", "I wanna get out of here!") // B6FwlfnRtAo + } else if (getAttribute(player, attributeCurrentBalloonIndex, null) != null) { + sendNPCDialogueLines(player, NPCs.PRISON_PETE_3118, FacialExpression.ANGRY, false,"You're meant to pull the lever to find out", "which sort of animal to pop!") // a1R5vdqiBCQ + } else { + animate(player, 10017) + sendGraphics(524, node.location) + (node as NPC).finalizeDeath(player) + queueScript(player, 1, QueueStrength.SOFT) { + animate(player, 7270) + addItemOrDrop(player, Items.PRISON_KEY_6966) + sendNPCDialogueLines(player, NPCs.PRISON_PETE_3118, FacialExpression.FRIENDLY, false,"Great, now you've got a key!", "Bring it to me so I can try it on the door") + setAttribute(player, attributePoppedBalloon, models.indexOf(node.id)) + // Technically, the person autowalks to prison pete, but screw that lmao. + return@queueScript stopExecuting(player) + } + } return@on true } @@ -79,4 +112,15 @@ class PrisonPeteListeners : InteractionListener { // npc(FacialExpression.SAD, "Oh, don't worry. Someone always rescues me", "eventually. Then Evil Bob drags me back again. It's", "been going on for ages. Now, you'd better get out", "before you're arrested for loitering.") // walk to door teleport out without any reward. } + + override fun defineInterfaceListeners() { + on(Components.PRISONPETE_273) { player, _, _, buttonID, _, _ -> + if (buttonID == 2) { + // So this is the new thing that happens. + // On click, this will cause the object to spin in a different direction. + // Unfortunately I don't know how to do this. + } + return@on true + } + } } From f5a35caf20d1ceb5e7ac5c841973f1eaa7955e23 Mon Sep 17 00:00:00 2001 From: Oven Bread Date: Thu, 10 Oct 2024 22:32:50 -0700 Subject: [PATCH 08/16] The main thing should work now. --- .../events/prisonpete/PrisonPeteDialogue.kt | 39 ++++++++++++++++--- .../events/prisonpete/PrisonPeteListeners.kt | 30 +++++++++----- 2 files changed, 55 insertions(+), 14 deletions(-) diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt index ebd213028..256e2871c 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt @@ -8,7 +8,7 @@ import core.game.dialogue.DialoguePlugin import core.game.dialogue.FacialExpression import core.game.node.entity.player.Player import core.plugin.Initializable -import org.rs09.consts.Components +import org.rs09.consts.Items import org.rs09.consts.NPCs @Initializable @@ -30,14 +30,43 @@ class PrisonPeteDialogueFile : DialogueBuilderFile() { override fun create(b: DialogueBuilder) { b.onPredicate { _ -> true } .branch { - player -> if(getAttribute(player, PrisonPeteListeners.attributePoppedBalloon, null) != null) { 1 } else { 0 } } + player -> if (removeItem(player, Items.PRISON_KEY_6966)) { 1 } else { 0 } } .let{ branch -> branch.onValue(1) - .npc(FacialExpression.FRIENDLY, "Ooh, thanks! I'll see if it's the right one...") - .branch { - player -> if(getAttribute(player, PrisonPeteListeners.attributePoppedBalloon, null) != null) { 1 } else { 0 } } + .branch { player -> + if (getAttribute(player, PrisonPeteListeners.attributeTimesUnlocked, 0) >= 3) { + return@branch 1 + } + return@branch 0 + } .let { branch2 -> + branch.onValue(1) + + + return@let branch2.onValue(0) + } + .npc(FacialExpression.FRIENDLY, "Ooh, thanks! I'll see if it's the right one...") + .branch { player -> + val poppedBalloon = getAttribute(player, PrisonPeteListeners.attributePoppedBalloonIndex, 0) + val correctBalloon = getAttribute(player, PrisonPeteListeners.attributeCurrentBalloonIndex, 0) + if (poppedBalloon != 0 && poppedBalloon == correctBalloon) { + setAttribute(player, PrisonPeteListeners.attributeTimesUnlocked, getAttribute(player, PrisonPeteListeners.attributeTimesUnlocked, 0)) + if (getAttribute(player, PrisonPeteListeners.attributeTimesUnlocked, 0) >= 3) { + return@branch 2 + } + setAttribute(player, PrisonPeteListeners.attributeCurrentBalloonIndex, 0) + return@branch 1 + } else { + return@branch 0 + } + } + .let { branch2 -> + branch2.onValue(2) + .npc(FacialExpression.FRIENDLY, "You did it, you got all the keys right!", "Thank you! You're my friend FOREVER!") + .playerl(FacialExpression.FRIENDLY, "Let's get out of here before the cat notices.") + .end() + branch2.onValue(1) .npc(FacialExpression.FRIENDLY, "Hooray, you got the right one! Now pull the lever again", "and let's get the next lock unlocked.") .end() diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt index 7ae9d0f69..852a30288 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt @@ -14,6 +14,7 @@ import org.rs09.consts.Scenery // Model 6474 is interesting // http://youtu.be/a1R5vdqiBCQ +// http://youtu.be/6PKLqIjoR4c /** * Prison Pete Random / Evil Bob 2 * Do note that this is the most patchwork random ever, due to the map being in transition to a newer one. @@ -28,16 +29,14 @@ import org.rs09.consts.Scenery class PrisonPeteListeners : InteractionListener, InterfaceListener { companion object { - val balloons = intArrayOf(NPCs.BALLOON_ANIMAL_3119,NPCs.BALLOON_ANIMAL_3120,NPCs.BALLOON_ANIMAL_3121,NPCs.BALLOON_ANIMAL_3122) - val models = intArrayOf(10734, 10735, 10736, 10737) + val balloons = intArrayOf(0, NPCs.BALLOON_ANIMAL_3119,NPCs.BALLOON_ANIMAL_3120,NPCs.BALLOON_ANIMAL_3121,NPCs.BALLOON_ANIMAL_3122) + val models = intArrayOf(0, 10734, 10735, 10736, 10737) const val attributeTimesUnlocked = "/save:prisonpete:timesUnlocked" const val attributeCurrentBalloonIndex = "/save:prisonpete:currentballoon" - const val attributePoppedBalloon = "/save:prisonpete:poppedballoon" - - + const val attributePoppedBalloonIndex = "/save:prisonpete:poppedballoon" fun randomizeBalloon(player: Player) { - setAttribute(player, attributeCurrentBalloonIndex, (0..3).random()) + setAttribute(player, attributeCurrentBalloonIndex, (1..4).random()) } } @@ -82,10 +81,10 @@ class PrisonPeteListeners : InteractionListener, InterfaceListener { } // Burst a balloon. - on(intArrayOf(*balloons), NPC, "pop") { player, node -> + on(intArrayOf(NPCs.BALLOON_ANIMAL_3119,NPCs.BALLOON_ANIMAL_3120,NPCs.BALLOON_ANIMAL_3121,NPCs.BALLOON_ANIMAL_3122), NPC, "pop") { player, node -> if (inInventory(player, Items.PRISON_KEY_6966)){ sendNPCDialogueLines(player, NPCs.PRISON_PETE_3118, FacialExpression.ANGRY, false,"Hey, bring me that key you've got!", "I wanna get out of here!") // B6FwlfnRtAo - } else if (getAttribute(player, attributeCurrentBalloonIndex, null) != null) { + } else if (getAttribute(player, attributeCurrentBalloonIndex, 0) == 0) { sendNPCDialogueLines(player, NPCs.PRISON_PETE_3118, FacialExpression.ANGRY, false,"You're meant to pull the lever to find out", "which sort of animal to pop!") // a1R5vdqiBCQ } else { animate(player, 10017) @@ -95,7 +94,7 @@ class PrisonPeteListeners : InteractionListener, InterfaceListener { animate(player, 7270) addItemOrDrop(player, Items.PRISON_KEY_6966) sendNPCDialogueLines(player, NPCs.PRISON_PETE_3118, FacialExpression.FRIENDLY, false,"Great, now you've got a key!", "Bring it to me so I can try it on the door") - setAttribute(player, attributePoppedBalloon, models.indexOf(node.id)) + setAttribute(player, attributePoppedBalloonIndex, balloons.indexOf(node.id)) // Technically, the person autowalks to prison pete, but screw that lmao. return@queueScript stopExecuting(player) } @@ -103,6 +102,19 @@ class PrisonPeteListeners : InteractionListener, InterfaceListener { return@on true } + on(Scenery.LOCKED_DOOR_26188, SCENERY, "open") { player, node -> + if (getAttribute(player, attributeTimesUnlocked, 0) >= 3) { + // FINISH! + } else { + if (inInventory(player, Items.PRISON_KEY_6966)){ + sendNPCDialogueLines(player, NPCs.PRISON_PETE_3118, FacialExpression.ANGRY, false,"Hey, bring me that key you've got!", "I wanna get out of here!") // B6FwlfnRtAo + } else if (getAttribute(player, attributeCurrentBalloonIndex, 0) == 0) { + sendNPCDialogueLines(player, NPCs.PRISON_PETE_3118, FacialExpression.ANGRY, false,"You're meant to pull the lever to find out", "which sort of animal to pop!") // a1R5vdqiBCQ + } + } + return@on true + } + // End of 15 mins: // SFiAALVHrR8 // npc(FacialExpression.SAD, "You've served your sentence, so you can walk out now.", "Lucky you!") From c238630ec3f908215beac1e4732eaecdd24f2698 Mon Sep 17 00:00:00 2001 From: Oven Bread Date: Thu, 17 Oct 2024 12:20:37 -0700 Subject: [PATCH 09/16] Added zone for timer and zone restriction. --- .../events/prisonpete/PrisonPeteListeners.kt | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt index 852a30288..ab1cd52a7 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt @@ -5,8 +5,12 @@ import core.game.dialogue.FacialExpression import core.game.interaction.InteractionListener import core.game.interaction.InterfaceListener import core.game.interaction.QueueStrength +import core.game.node.entity.Entity import core.game.node.entity.npc.NPC import core.game.node.entity.player.Player +import core.game.world.map.Location +import core.game.world.map.zone.ZoneBorders +import core.game.world.map.zone.ZoneRestriction import org.rs09.consts.Components import org.rs09.consts.Items import org.rs09.consts.NPCs @@ -26,7 +30,7 @@ import org.rs09.consts.Scenery * You have 15 mins, or you will still get teled out anyway. * Note: On server load, some sceneries are overwritten in ObjectParser.xml file. */ -class PrisonPeteListeners : InteractionListener, InterfaceListener { +class PrisonPeteListeners : InteractionListener, InterfaceListener, MapArea { companion object { val balloons = intArrayOf(0, NPCs.BALLOON_ANIMAL_3119,NPCs.BALLOON_ANIMAL_3120,NPCs.BALLOON_ANIMAL_3121,NPCs.BALLOON_ANIMAL_3122) @@ -135,4 +139,28 @@ class PrisonPeteListeners : InteractionListener, InterfaceListener { return@on true } } + override fun defineAreaBorders(): Array { + return arrayOf(getRegionBorders(8261)) + } + + override fun getRestrictions(): Array { + return arrayOf(ZoneRestriction.RANDOM_EVENTS, ZoneRestriction.CANNON, ZoneRestriction.FOLLOWERS, ZoneRestriction.TELEPORT, ZoneRestriction.OFF_MAP) + } + + override fun areaEnter(entity: Entity) { + if (entity is Player) { + sendMessage(entity, "Head for the center of the maze.") + } + } + + override fun areaLeave(entity: Entity, logout: Boolean) { + if (entity is Player) { + //entity.unhook(this) + } + } + override fun entityStep(entity: Entity, location: Location, lastLocation: Location) { + if (entity is Player) { + //entity.hook(Event.Tick, this) + } + } } From fadfbf44f7f7e84a9b7f2d9a0850f8ca16a34666 Mon Sep 17 00:00:00 2001 From: Oven Bread Date: Thu, 31 Oct 2024 01:34:57 -0700 Subject: [PATCH 10/16] More sources --- .../global/ame/events/prisonpete/PrisonPeteListeners.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt index ab1cd52a7..b8447e6fe 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt @@ -19,6 +19,7 @@ import org.rs09.consts.Scenery // Model 6474 is interesting // http://youtu.be/a1R5vdqiBCQ // http://youtu.be/6PKLqIjoR4c +// http://youtu.be/7eHhptb80WU /** * Prison Pete Random / Evil Bob 2 * Do note that this is the most patchwork random ever, due to the map being in transition to a newer one. @@ -124,7 +125,7 @@ class PrisonPeteListeners : InteractionListener, InterfaceListener, MapArea { // npc(FacialExpression.SAD, "You've served your sentence, so you can walk out now.", "Lucky you!") // player(FacialExpression.THINKING, "Aren't you coming?") // npc(FacialExpression.SAD, "No, I've got a life sentence. Maybe if you'd been able", "to get the door open for yourself I could have escaped", "with you.") - // player(FacialExpression.THINKING, "I'm sorry.") + // player(FacialExpression.SAD, "I'm sorry.") // npc(FacialExpression.SAD, "Oh, don't worry. Someone always rescues me", "eventually. Then Evil Bob drags me back again. It's", "been going on for ages. Now, you'd better get out", "before you're arrested for loitering.") // walk to door teleport out without any reward. } @@ -149,7 +150,7 @@ class PrisonPeteListeners : InteractionListener, InterfaceListener, MapArea { override fun areaEnter(entity: Entity) { if (entity is Player) { - sendMessage(entity, "Head for the center of the maze.") + // sendMessage(entity, "Head for the center of the maze.") } } From 9a5be3352871dee4b4707114b555f1f637b61ba6 Mon Sep 17 00:00:00 2001 From: Oven Bread Date: Sat, 16 Nov 2024 17:17:30 -0800 Subject: [PATCH 11/16] Some updates --- Server/src/main/content/global/ame/RandomEvents.kt | 2 ++ .../global/ame/events/prisonpete/PrisonPeteDialogue.kt | 2 +- .../content/global/ame/events/prisonpete/PrisonPeteNPC.kt | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Server/src/main/content/global/ame/RandomEvents.kt b/Server/src/main/content/global/ame/RandomEvents.kt index 88522b4a0..f306e076b 100644 --- a/Server/src/main/content/global/ame/RandomEvents.kt +++ b/Server/src/main/content/global/ame/RandomEvents.kt @@ -12,6 +12,7 @@ import content.global.ame.events.maze.MazeNPC import content.global.ame.events.genie.GenieNPC import content.global.ame.events.candlelight.PiousPeteNPC import content.global.ame.events.pillory.PilloryNPC +import content.global.ame.events.prisonpete.PrisonPeteNPC import content.global.ame.events.rickturpentine.RickTurpentineNPC import content.global.ame.events.rivertroll.RiverTrollRENPC import content.global.ame.events.rockgolem.RockGolemRENPC @@ -55,6 +56,7 @@ enum class RandomEvents(val npc: RandomEventNPC, val loot: WeightBasedTable? = n STRANGE_PLANT(npc = StrangePlantNPC()), SWARM(npc = SwarmNPC()), EVIL_BOB(npc = EvilBobNPC(), skillIds = intArrayOf(Skills.FISHING, Skills.MAGIC)), + PRISON_PETE(npc= PrisonPeteNPC()), DRUNKEN_DWARF(npc = DrunkenDwarfNPC()), RICK_TURPENTINE(npc = RickTurpentineNPC(), loot = CERTER.loot), SURPRISE_EXAM(npc = MysteriousOldManNPC(), type = "sexam"), diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt index 256e2871c..e83d6015c 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt @@ -112,7 +112,7 @@ class PrisonPeteIntroDialogueFile : DialogueBuilderFile() { override fun create(b: DialogueBuilder) { b.onPredicate { _ -> true } .playerl(FacialExpression.AMAZED, "What on ${ServerConstants.SERVER_NAME} just happened?") - .npc(FacialExpression.SAD, "This isn't ${ServerConstants.SERVER_NAME} anymore, this is ScapeRune.", "So you've been captured, too?") + .npc(FacialExpression.SAD, "This isn't ${ServerConstants.SERVER_NAME} anymore, this is Scape2009.", "So you've been captured, too?") .playerl(FacialExpression.THINKING, "Captured?") .npcl(FacialExpression.SAD, "Yes, Evil Bob captured me and stuck me in this prison.") .player(FacialExpression.ANGRY, "How do I get out of here?", "I can't be held captive by a cat!") diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteNPC.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteNPC.kt index 60a983e4d..d6d30bdf4 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteNPC.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteNPC.kt @@ -7,6 +7,7 @@ import core.api.utils.WeightBasedTable import core.game.interaction.QueueStrength import core.game.node.entity.npc.NPC import core.game.system.timer.impl.AntiMacro +import core.game.world.map.Location import core.game.world.update.flag.context.Graphics import org.rs09.consts.NPCs import org.rs09.consts.Sounds @@ -27,6 +28,10 @@ class PrisonPeteNPC(override var loot: WeightBasedTable? = null) : RandomEventNP return@queueScript delayScript(player, 3) } 1 -> { + if (getAttribute(player, PrisonPeteListeners.attributeReturnLoc, null) == null) { + setAttribute(player, PrisonPeteListeners.attributeReturnLoc, player.location) + } + teleport(player, Location.create(2083, 4461 ,0)) sendMessage(player, "Welcome to Scape2009.") openDialogue(player, PrisonPeteDialogue(), NPCs.PRISON_PETE_3118) AntiMacro.terminateEventNpc(player) From 0758c43f2c9ca8c5657658d5dc48af85be49226a Mon Sep 17 00:00:00 2001 From: Oven Bread Date: Sat, 16 Nov 2024 17:17:56 -0800 Subject: [PATCH 12/16] Some updates --- .../events/prisonpete/PrisonPeteListeners.kt | 39 +++++++++++++++---- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt index b8447e6fe..d254cde99 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt @@ -1,5 +1,6 @@ package content.global.ame.events.prisonpete +import content.global.ame.RandomEvents import core.api.* import core.game.dialogue.FacialExpression import core.game.interaction.InteractionListener @@ -11,10 +12,8 @@ import core.game.node.entity.player.Player import core.game.world.map.Location import core.game.world.map.zone.ZoneBorders import core.game.world.map.zone.ZoneRestriction -import org.rs09.consts.Components -import org.rs09.consts.Items -import org.rs09.consts.NPCs -import org.rs09.consts.Scenery +import core.game.world.update.flag.context.Graphics +import org.rs09.consts.* // Model 6474 is interesting // http://youtu.be/a1R5vdqiBCQ @@ -36,9 +35,10 @@ class PrisonPeteListeners : InteractionListener, InterfaceListener, MapArea { companion object { val balloons = intArrayOf(0, NPCs.BALLOON_ANIMAL_3119,NPCs.BALLOON_ANIMAL_3120,NPCs.BALLOON_ANIMAL_3121,NPCs.BALLOON_ANIMAL_3122) val models = intArrayOf(0, 10734, 10735, 10736, 10737) + const val attributeReturnLoc = "/save:original-loc" const val attributeTimesUnlocked = "/save:prisonpete:timesUnlocked" - const val attributeCurrentBalloonIndex = "/save:prisonpete:currentballoon" - const val attributePoppedBalloonIndex = "/save:prisonpete:poppedballoon" + const val attributeCurrentBalloonIndex = "prisonpete:currentballoon" + const val attributePoppedBalloonIndex = "prisonpete:poppedballoon" fun randomizeBalloon(player: Player) { setAttribute(player, attributeCurrentBalloonIndex, (1..4).random()) @@ -109,7 +109,32 @@ class PrisonPeteListeners : InteractionListener, InterfaceListener, MapArea { on(Scenery.LOCKED_DOOR_26188, SCENERY, "open") { player, node -> if (getAttribute(player, attributeTimesUnlocked, 0) >= 3) { - // FINISH! + sendMessage(player, "You've escaped!") + removeAttribute(player, attributeTimesUnlocked) + closeInterface(player) + queueScript(player, 0, QueueStrength.SOFT) { stage: Int -> + when (stage) { + 0 -> { + lock(player, 6) + sendGraphics(Graphics(1576, 0, 0), player.location) + animate(player,8939) + playAudio(player, Sounds.TELEPORT_ALL_200) + return@queueScript delayScript(player, 3) + } + 1 -> { + val loot = RandomEvents.CERTER.loot!!.roll(player)[0] + addItemOrDrop(player, loot.id, loot.amount) + teleport(player, getAttribute(player, attributeReturnLoc, Location.create(3222, 3218, 0))) + sendGraphics(Graphics(1577, 0, 0), player.location) + animate(player,8941) + removeAttribute(player, attributeReturnLoc) + closeInterface(player) + return@queueScript stopExecuting(player) + } + else -> return@queueScript stopExecuting(player) + } + } + } else { if (inInventory(player, Items.PRISON_KEY_6966)){ sendNPCDialogueLines(player, NPCs.PRISON_PETE_3118, FacialExpression.ANGRY, false,"Hey, bring me that key you've got!", "I wanna get out of here!") // B6FwlfnRtAo From 9dbe624343c9b749f7e9299419a7ae70ebeabbea Mon Sep 17 00:00:00 2001 From: Oven Bread Date: Tue, 25 Feb 2025 16:57:35 -0800 Subject: [PATCH 13/16] Fixed up Prison Pete. Removed the 15 mins dialogue as that isn't this era specific. Made prison pete completable vs when it wasn't. --- Server/data/configs/xteas.json | 4 ---- .../ame/events/prisonpete/PrisonPeteDialogue.kt | 14 +++++++++----- .../ame/events/prisonpete/PrisonPeteListeners.kt | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Server/data/configs/xteas.json b/Server/data/configs/xteas.json index 5b8de21a7..41fdf2610 100644 --- a/Server/data/configs/xteas.json +++ b/Server/data/configs/xteas.json @@ -348,10 +348,6 @@ "regionId": "8260", "keys": "-357122149,-546918388,1659548066,2023267334" }, - { - "regionId": "8261", - "keys": "14881828,-6662814,58238456,146761213" - }, { "regionId": "8262", "keys": "937196178,1968517712,1697292009,-2036678778" diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt index e83d6015c..eb9ecf3b4 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteDialogue.kt @@ -51,7 +51,7 @@ class PrisonPeteDialogueFile : DialogueBuilderFile() { val poppedBalloon = getAttribute(player, PrisonPeteListeners.attributePoppedBalloonIndex, 0) val correctBalloon = getAttribute(player, PrisonPeteListeners.attributeCurrentBalloonIndex, 0) if (poppedBalloon != 0 && poppedBalloon == correctBalloon) { - setAttribute(player, PrisonPeteListeners.attributeTimesUnlocked, getAttribute(player, PrisonPeteListeners.attributeTimesUnlocked, 0)) + setAttribute(player, PrisonPeteListeners.attributeTimesUnlocked, getAttribute(player, PrisonPeteListeners.attributeTimesUnlocked, 0) + 1) if (getAttribute(player, PrisonPeteListeners.attributeTimesUnlocked, 0) >= 3) { return@branch 2 } @@ -89,8 +89,10 @@ class PrisonPeteDialogueFile : DialogueBuilderFile() { .npc(FacialExpression.SAD, "Some of these balloon animals have keys in them, and if", "you pull the big lever it tells you which shape animal", "contains the correct key, but I can never find it.") .npc(FacialExpression.SAD, "You need to pull the lever to find out which shape", "animal contains the key, then pop that sort of animal to", "get the key.") .npc(FacialExpression.SAD, "Bring me any keys you get and", "I'll try them on the doors.") - .playerl(FacialExpression.THINKING,"What happens if I get it wrong?") - .npc(FacialExpression.SAD, "You haven't get a life sentence, so they'll let you out in", "[15] minutes, but you should be able to escape much", "faster if you go pull that lever and pop the right balloon", "animals.") + // This is a future thing. Since this random event is in transition, I would follow other random events of this era and not have the 15 min countdown. +// .playerl(FacialExpression.THINKING,"What happens if I get it wrong?") +// .npc(FacialExpression.SAD, "You haven't get a life sentence, so they'll let you out in", "[15] minutes, but you should be able to escape much", "faster if you go pull that lever and pop the right balloon", "animals.") + // Note the [15] minutes part counts down, Prison pete would say "you have 9 minutes left" and yada .end() optionBuilder.option("How do I get out of here?") @@ -98,8 +100,10 @@ class PrisonPeteDialogueFile : DialogueBuilderFile() { .npc(FacialExpression.SAD, "Some of these balloon animals have keys in them, and if", "you pull the big lever it tells you which shape animal", "contains the correct key, but I can never find it.") .npc(FacialExpression.SAD, "You need to pull the lever to find out which shape", "animal contains the key, then pop that sort of animal to", "get the key.") .npc(FacialExpression.SAD, "Bring me any keys you get and", "I'll try them on the doors.") - .playerl(FacialExpression.THINKING,"What happens if I get it wrong?") - .npc(FacialExpression.SAD, "You haven't get a life sentence, so they'll let you out in", "[15] minutes, but you should be able to escape much", "faster if you go pull that lever and pop the right balloon", "animals.") + // This is a future thing. Since this random event is in transition, I would follow other random events of this era and not have the 15 min countdown. +// .playerl(FacialExpression.THINKING,"What happens if I get it wrong?") +// .npc(FacialExpression.SAD, "You haven't get a life sentence, so they'll let you out in", "[15] minutes, but you should be able to escape much", "faster if you go pull that lever and pop the right balloon", "animals.") + // Note the [15] minutes part counts down, Prison pete would say "you have 9 minutes left" and yada .end() } } diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt index d254cde99..6f4bfe371 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt @@ -26,9 +26,9 @@ import org.rs09.consts.* * The new one (seen in rs3) came in around Jan 2009 and includes a locked door to the south. * Due to the shit map and half fucked version of objects, we are following the locked door variation. * Note that there are a lot of moving parts due to Jigglyflex trying stupid shit. + * There used to be a 15 mins timer, but I think it's later, so I'm here to make you suffer this random event. * - * You have 15 mins, or you will still get teled out anyway. - * Note: On server load, some sceneries are overwritten in ObjectParser.xml file. + * Note: On server load, some sceneries are patched into Prison Pete in ObjectParser.xml file. */ class PrisonPeteListeners : InteractionListener, InterfaceListener, MapArea { @@ -152,7 +152,7 @@ class PrisonPeteListeners : InteractionListener, InterfaceListener, MapArea { // npc(FacialExpression.SAD, "No, I've got a life sentence. Maybe if you'd been able", "to get the door open for yourself I could have escaped", "with you.") // player(FacialExpression.SAD, "I'm sorry.") // npc(FacialExpression.SAD, "Oh, don't worry. Someone always rescues me", "eventually. Then Evil Bob drags me back again. It's", "been going on for ages. Now, you'd better get out", "before you're arrested for loitering.") - // walk to door teleport out without any reward. + // You can now at any point, click the gate and walk out as per normal. } override fun defineInterfaceListeners() { From cd03510111f835e0d4cf189fa06170e4268d3c61 Mon Sep 17 00:00:00 2001 From: Oven Bread Date: Sun, 31 Aug 2025 00:56:07 -0700 Subject: [PATCH 14/16] Update to use KidnapHelper and fix some stuff --- .../ame/events/prisonpete/PrisonPeteListeners.kt | 12 +++++++++--- .../global/ame/events/prisonpete/PrisonPeteNPC.kt | 8 +++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt index 6f4bfe371..e47c17931 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt @@ -1,6 +1,7 @@ package content.global.ame.events.prisonpete import content.global.ame.RandomEvents +import content.global.ame.returnPlayer import core.api.* import core.game.dialogue.FacialExpression import core.game.interaction.InteractionListener @@ -97,6 +98,11 @@ class PrisonPeteListeners : InteractionListener, InterfaceListener, MapArea { (node as NPC).finalizeDeath(player) queueScript(player, 1, QueueStrength.SOFT) { animate(player, 7270) + if(player.inventory.isFull) { + sendDialogue(player, "You don't have room to pick up any keys.") // qqncnqOc_MA + addItemOrDrop(player, Items.PRISON_KEY_6966) + return@queueScript stopExecuting(player) + } addItemOrDrop(player, Items.PRISON_KEY_6966) sendNPCDialogueLines(player, NPCs.PRISON_PETE_3118, FacialExpression.FRIENDLY, false,"Great, now you've got a key!", "Bring it to me so I can try it on the door") setAttribute(player, attributePoppedBalloonIndex, balloons.indexOf(node.id)) @@ -109,7 +115,7 @@ class PrisonPeteListeners : InteractionListener, InterfaceListener, MapArea { on(Scenery.LOCKED_DOOR_26188, SCENERY, "open") { player, node -> if (getAttribute(player, attributeTimesUnlocked, 0) >= 3) { - sendMessage(player, "You've escaped!") + sendMessage(player, "You quickly escape the prison with Pete.") removeAttribute(player, attributeTimesUnlocked) closeInterface(player) queueScript(player, 0, QueueStrength.SOFT) { stage: Int -> @@ -124,10 +130,9 @@ class PrisonPeteListeners : InteractionListener, InterfaceListener, MapArea { 1 -> { val loot = RandomEvents.CERTER.loot!!.roll(player)[0] addItemOrDrop(player, loot.id, loot.amount) - teleport(player, getAttribute(player, attributeReturnLoc, Location.create(3222, 3218, 0))) + returnPlayer(player) sendGraphics(Graphics(1577, 0, 0), player.location) animate(player,8941) - removeAttribute(player, attributeReturnLoc) closeInterface(player) return@queueScript stopExecuting(player) } @@ -136,6 +141,7 @@ class PrisonPeteListeners : InteractionListener, InterfaceListener, MapArea { } } else { + sendMessage(player, "You need 3 more keys to unlock this gate.") // Inauthentic if (inInventory(player, Items.PRISON_KEY_6966)){ sendNPCDialogueLines(player, NPCs.PRISON_PETE_3118, FacialExpression.ANGRY, false,"Hey, bring me that key you've got!", "I wanna get out of here!") // B6FwlfnRtAo } else if (getAttribute(player, attributeCurrentBalloonIndex, 0) == 0) { diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteNPC.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteNPC.kt index d6d30bdf4..58e3fd252 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteNPC.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteNPC.kt @@ -1,11 +1,12 @@ package content.global.ame.events.prisonpete import content.global.ame.RandomEventNPC -import content.global.ame.events.evilbob.EvilBobUtils +import content.global.ame.kidnapPlayer import core.api.* import core.api.utils.WeightBasedTable import core.game.interaction.QueueStrength import core.game.node.entity.npc.NPC +import core.game.node.entity.player.link.TeleportManager import core.game.system.timer.impl.AntiMacro import core.game.world.map.Location import core.game.world.update.flag.context.Graphics @@ -28,10 +29,7 @@ class PrisonPeteNPC(override var loot: WeightBasedTable? = null) : RandomEventNP return@queueScript delayScript(player, 3) } 1 -> { - if (getAttribute(player, PrisonPeteListeners.attributeReturnLoc, null) == null) { - setAttribute(player, PrisonPeteListeners.attributeReturnLoc, player.location) - } - teleport(player, Location.create(2083, 4461 ,0)) + kidnapPlayer(player, Location(2083, 4461 ,0), TeleportManager.TeleportType.INSTANT) sendMessage(player, "Welcome to Scape2009.") openDialogue(player, PrisonPeteDialogue(), NPCs.PRISON_PETE_3118) AntiMacro.terminateEventNpc(player) From 54a01f6efd6d729799e28725e7aa0f1dd9a7e29c Mon Sep 17 00:00:00 2001 From: Oven Bread Date: Wed, 15 Oct 2025 22:57:35 -0700 Subject: [PATCH 15/16] Added key drop text. Also has feature of using key on Prison Pete. --- .../global/ame/events/prisonpete/PrisonPeteListeners.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt index e47c17931..6ae0bc594 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt @@ -113,6 +113,13 @@ class PrisonPeteListeners : InteractionListener, InterfaceListener, MapArea { return@on true } + + on(Items.PRISON_KEY_6966, ITEM, "drop") { player, node -> + // http://youtu.be/c3DJGIVG3MM + sendMessage(player,"The key disappears as it hits the ground.") + return@on true + } + on(Scenery.LOCKED_DOOR_26188, SCENERY, "open") { player, node -> if (getAttribute(player, attributeTimesUnlocked, 0) >= 3) { sendMessage(player, "You quickly escape the prison with Pete.") From b5e48c827f9ac4e8dc03239aeddd2a04bba17ecc Mon Sep 17 00:00:00 2001 From: Oven Bread Date: Wed, 15 Oct 2025 23:56:55 -0700 Subject: [PATCH 16/16] Peete --- .../content/global/ame/events/prisonpete/PrisonPeteListeners.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt index 6ae0bc594..fcd36b0f9 100644 --- a/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt +++ b/Server/src/main/content/global/ame/events/prisonpete/PrisonPeteListeners.kt @@ -20,6 +20,7 @@ import org.rs09.consts.* // http://youtu.be/a1R5vdqiBCQ // http://youtu.be/6PKLqIjoR4c // http://youtu.be/7eHhptb80WU +// http://youtu.be/28Ah8i6PUK0 /** * Prison Pete Random / Evil Bob 2 * Do note that this is the most patchwork random ever, due to the map being in transition to a newer one.