From 506608329b8740b916f6357c4561e10b6854de62 Mon Sep 17 00:00:00 2001 From: ceikry Date: Fri, 25 Jun 2021 17:33:38 -0500 Subject: [PATCH] Remove filthy void knight purchase option --- .../reward/VoidKnightDialogue.java | 52 +------------------ Server/src/main/kotlin/api/ContentAPI.kt | 16 ++++++ 2 files changed, 17 insertions(+), 51 deletions(-) diff --git a/Server/src/main/java/core/game/content/activity/pestcontrol/reward/VoidKnightDialogue.java b/Server/src/main/java/core/game/content/activity/pestcontrol/reward/VoidKnightDialogue.java index 3e46c1813..1675b49c9 100644 --- a/Server/src/main/java/core/game/content/activity/pestcontrol/reward/VoidKnightDialogue.java +++ b/Server/src/main/java/core/game/content/activity/pestcontrol/reward/VoidKnightDialogue.java @@ -61,8 +61,7 @@ public final class VoidKnightDialogue extends DialoguePlugin { public boolean handle(int interfaceId, int buttonId) { switch (stage) { case 0: - options("Who are you?", "What is this place?", - "Ask about Penance gear.", "I'm fine thanks."); + options("Who are you?", "What is this place?", "I'm fine thanks."); stage = 1; break; case 1: @@ -76,10 +75,6 @@ public final class VoidKnightDialogue extends DialoguePlugin { stage = 20; break; case 3: - player("I'd like to see your available Penance gear."); - stage = 40; - break; - case 4: player("I'm fine thanks."); stage = 30; break; @@ -242,51 +237,6 @@ public final class VoidKnightDialogue extends DialoguePlugin { case 30: end(); break; - case 40: - npc("How did you know we were supplying that kind of stuff?", - "*sigh* Well, I suppose I can help you out.", - "Here's what I have in stock."); - stage = 41; - break; - case 41: - interpreter.sendOptions("Select an Option", "Fighter Torso", - "Fighter Hat", "Ranger Hat", "Runner Hat", "Healer Hat"); - stage = 42; - break; - case 42: - switch (buttonId) { - case 1: - npc("You've taken an interest in the Fighter Torso I have", - "in stock. That'll cost one hundred and fifty points."); - reward = new Item(10551); - stage = 43; - break; - case 2: - npc("You've taken an interest in the Fighter Hat I have", - "in stock. That'll cost one hundred and fifty points."); - reward = new Item(10548); - stage = 43; - break; - case 3: - npc("You've taken an interest in the Ranger Hat I have", - "in stock. That'll cost one hundred and fifty points."); - reward = new Item(10550); - stage = 43; - break; - case 4: - npc("You've taken an interest in the Runner Hat I have", - "in stock. That'll cost one hundred and fifty points."); - reward = new Item(10549); - stage = 43; - break; - case 5: - npc("You've taken an interest in the Healer Hat I have", - "in stock. That'll cost one hundred and fifty points."); - reward = new Item(10547); - stage = 43; - break; - } - break; case 43: if (player.getSavedData().getActivityData().getPestPoints() < 150) { player("I don't have that many points at the moment."); diff --git a/Server/src/main/kotlin/api/ContentAPI.kt b/Server/src/main/kotlin/api/ContentAPI.kt index 1ebd8d57d..7a185f1f6 100644 --- a/Server/src/main/kotlin/api/ContentAPI.kt +++ b/Server/src/main/kotlin/api/ContentAPI.kt @@ -944,4 +944,20 @@ object ContentAPI { player.dialogueInterpreter.sendInput(!numeric, prompt) player.setAttribute("runscript",handler) //Handled in RunScriptPacketHandler } + + /** + * Forces an NPC to "flee" from a player or other entity + * @param entity the entity to make flee + * @param from the entity to flee from + */ + @JvmStatic + fun flee(entity: Entity, from: Entity){ + lock(entity, 5) + face(entity, from, 5) + + val diffX = entity.location.x - from.location.x + val diffY = entity.location.y - from.location.y + + forceWalk(entity, entity.location.transform(diffX,diffY,0), "DUMB") + } } \ No newline at end of file