diff --git a/Server/src/main/java/core/game/content/activity/tzhaar/TzhaarFightCavesPlugin.java b/Server/src/main/java/core/game/content/activity/tzhaar/TzhaarFightCavesPlugin.java index 55d058535..15ca50acd 100644 --- a/Server/src/main/java/core/game/content/activity/tzhaar/TzhaarFightCavesPlugin.java +++ b/Server/src/main/java/core/game/content/activity/tzhaar/TzhaarFightCavesPlugin.java @@ -95,7 +95,8 @@ public final class TzhaarFightCavesPlugin extends ActivityPlugin { player.removeAttribute("fc_offset"); player.getProperties().setTeleportLocation(getBase().transform(offsetX, offsetY, 0)); Pulse pulse; - if (!login) { + boolean practice = player.getAttribute("fc_practice_jad", false); + if (!login && !practice) { final int wave = 0; player.setAttribute("fc_wave", wave); player.getWalkingQueue().reset(); @@ -117,6 +118,9 @@ public final class TzhaarFightCavesPlugin extends ActivityPlugin { } }; } else { + if (practice) { + player.setAttribute("fc_wave", 62); + } if (player.getAttribute("fc_wave", 0) == 62) { player.getDialogueInterpreter().sendDialogues(2617, null, "Look out, here comes TzTok-Jad!"); } @@ -142,28 +146,50 @@ public final class TzhaarFightCavesPlugin extends ActivityPlugin { activeNPCs.clear(); player.getProperties().setTeleportLocation(getSpawnLocation()); player.getSkills().restore(); + boolean practice = player.getAttribute("fc_practice_jad", false); if (wave == 63) { - if (!player.getInventory().add(new Item(6570))) { - GroundItemManager.create(new Item(6570), getSpawnLocation(), player); + if (!practice) { + if (!player.getInventory().add(new Item(6570))) { + GroundItemManager.create(new Item(6570), getSpawnLocation(), player); + } + } else { + // give player the appearance fee back + int amount = 8000; + if (!player.getInventory().add(new Item(6529, amount))) { + GroundItemManager.create(new Item(6529, amount), getSpawnLocation(), player); + } } player.getPacketDispatch().sendMessage("You were victorious!"); - BossKillCounter.addtoKillcount(player, 2745); - if (player.getSlayer().getTask() == Tasks.JAD) { - player.getSkills().addExperience(Skills.SLAYER, 25000); - player.getSlayer().clear(); - player.sendMessage("You receive 25,000 slayer experience for defeating TzTok-Jad."); + + if (!practice) { + BossKillCounter.addtoKillcount(player, 2745); + if (player.getSlayer().getTask() == Tasks.JAD) { + player.getSkills().addExperience(Skills.SLAYER, 25000); + player.getSlayer().clear(); + player.sendMessage("You receive 25,000 slayer experience for defeating TzTok-Jad."); + } + player.getDialogueInterpreter().sendDialogues(2617, null, "You even defeated TzTok-Jad, I am most impressed!", "Please accept this gift as a reward."); + Repository.sendNews(player.getUsername() + " has been victorious in defeating TzTok-Jad for a firecape!"); + } else { + player.getDialogueInterpreter().sendDialogues(2617, null, "You defeated TzTok-Jad. I am most impressed!", "Here is you TokKul back.", "Maybe next time you do all training, and get real reward..."); } - player.getDialogueInterpreter().sendDialogues(2617, null, "You even defeated TzTok-Jad, I am most impressed!", "Please accept this gift as a reward."); - Repository.sendNews(player.getUsername() + " has been victorious in defeating TzTok-Jad for a firecape!"); } else if (wave <= 1) { player.getDialogueInterpreter().sendDialogues(2617, null, "Well I suppose you tried... better luck next time."); } else { - player.getDialogueInterpreter().sendDialogues(2617, null, "Well done in the cave, here, take TokKul as reward."); + if (!practice) { + player.getDialogueInterpreter().sendDialogues(2617, null, "Well done in the cave, here, take TokKul as reward."); + } else { + player.getDialogueInterpreter().sendDialogues(2617, null, "You both impatient and also failure.", "Better luck next time."); + } } - int amount = wave << 7; - if (amount > 0 && !player.getInventory().add(new Item(6529, amount))) { - GroundItemManager.create(new Item(6529, amount), getSpawnLocation(), player); + + if (!practice) { + int amount = wave << 7; + if (amount > 0 && !player.getInventory().add(new Item(6529, amount))) { + GroundItemManager.create(new Item(6529, amount), getSpawnLocation(), player); + } } + } @Override @@ -181,6 +207,7 @@ public final class TzhaarFightCavesPlugin extends ActivityPlugin { } else { player.removeAttribute("fc_offset"); player.removeAttribute("fc_wave"); + player.removeAttribute("fc_practice_jad"); player.removeAttribute("fc_safe_logout"); Pulse pulse = player.getAttribute("fc:pulse"); if (pulse != null) { @@ -272,6 +299,7 @@ public final class TzhaarFightCavesPlugin extends ActivityPlugin { leave((Player) e, e.getAttribute("fc_wave", 0)); player.removeAttribute("fc_wave"); player.removeAttribute("fc_offset"); + player.removeAttribute("fc_practice_jad"); return true; } return false; diff --git a/Server/src/main/java/core/game/node/entity/npc/city/tzhaar/TzHaarMejJah.java b/Server/src/main/java/core/game/node/entity/npc/city/tzhaar/TzHaarMejJah.java index 497bd1bfe..91148bde0 100644 --- a/Server/src/main/java/core/game/node/entity/npc/city/tzhaar/TzHaarMejJah.java +++ b/Server/src/main/java/core/game/node/entity/npc/city/tzhaar/TzHaarMejJah.java @@ -4,16 +4,20 @@ import core.game.content.dialogue.DialogueInterpreter; import core.game.content.dialogue.DialoguePlugin; import core.game.content.dialogue.FacialExpression; import core.game.node.entity.npc.NPC; +import core.game.node.item.Item; import core.plugin.Initializable; import core.game.node.entity.player.Player; +import rs09.game.world.GameWorld; /** * Handles the TzHaarMejJal dialogue. * @author 'Vexia * @author Empathy + * @author Logg */ @Initializable public class TzHaarMejJah extends DialoguePlugin { + private static final Item APPEARANCE_FEE = new Item(6529, 8000); // 8000 tokkul, about the same as you get from failing jad public TzHaarMejJah() { @@ -41,7 +45,15 @@ public class TzHaarMejJah extends DialoguePlugin { public boolean handle(int interfaceId, int buttonId) { switch (stage) { case 0: - interpreter.sendOptions("Select an Option", player.getInventory().containItems(6570) ? "I have a fire cape here." : "What is this place?", "What did you call me?", "No I'm fine thanks."); + if (GameWorld.getSettings().getJad_practice_enabled()) { + if (player.getAttribute("fc_practice_jad", false)) { + interpreter.sendOptions("Select an Option", player.getInventory().containItems(6570) ? "I have a fire cape here." : "What is this place?", "What did you call me?", "About my challenge...", "No I'm fine thanks."); + } else { + interpreter.sendOptions("Select an Option", player.getInventory().containItems(6570) ? "I have a fire cape here." : "What is this place?", "What did you call me?", "I want to challenge Jad directly.", "No I'm fine thanks."); + } + } else { + interpreter.sendOptions("Select an Option", player.getInventory().containItems(6570) ? "I have a fire cape here." : "What is this place?", "What did you call me?", "No I'm fine thanks."); + } stage = 1; break; case 1: @@ -59,10 +71,23 @@ public class TzHaarMejJah extends DialoguePlugin { stage = 20; break; case 3: + if (GameWorld.getSettings().getJad_practice_enabled()) { + if (player.getAttribute("fc_practice_jad", false)) { + interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "About my challenge..."); + stage = 64; + } else { + interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "The challenge is too long.", "I want to challenge Jad directly."); + stage = 50; + } + } else { + interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "No I'm fine thanks."); + stage = 30; + } + break; + case 4: interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "No I'm fine thanks."); stage = 30; break; - } break; case 10: @@ -133,7 +158,7 @@ public class TzHaarMejJah extends DialoguePlugin { stage = 21; break; case 21: - interpreter.sendOptions("Selec an Option", "What's a 'JalYt-Key'?", "I guess so...", "No I'm not!"); + interpreter.sendOptions("Select an Option", "What's a 'JalYt-Ket'?", "I guess so...", "No I'm not!"); stage = 22; break; case 22: @@ -176,6 +201,107 @@ public class TzHaarMejJah extends DialoguePlugin { case 30: end(); break; + + case 50: + interpreter.sendDialogues(npc, FacialExpression.DISGUSTED_HEAD_SHAKE, "I thought you strong and tough", "but you want skip endurance training?"); + stage = 57; + break; + case 57: + interpreter.sendDialogues(npc, FacialExpression.NEUTRAL, "Maybe you not JalYt-Ket afterall."); + stage = 58; + break; + case 58: + interpreter.sendOptions("Select an Option", "I don't have time for it, man.", "No, I'm JalYt-Ket!"); + stage = 51; + break; + case 51: + switch (buttonId) { + case 1: + interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "I don't have time for it, man."); + stage = 52; + break; + case 2: + interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "No, I'm JalYt-Ket! I swear!", "I'll do the training properly."); + stage = 30; + break; + } + break; + case 52: + interpreter.sendDialogues(npc, FacialExpression.DISGUSTED_HEAD_SHAKE, "JalYt, you know you not get reward","if you not do training properly, ok?"); + stage = 56; + break; + case 56: + interpreter.sendOptions("Select an Option", "That's okay, I don't need a reward.", "Oh, nevermind then."); + stage = 53; + break; + case 53: + switch (buttonId) { + case 1: + interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "That's okay, I don't need a reward."); + stage = 54; + break; + case 2: + interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Oh, nevermind then."); + stage = 30; + break; + } + break; + case 54: + interpreter.sendDialogues(player, FacialExpression.NEUTRAL, "I just wanna fight the big guy."); + stage = 55; + break; + case 55: + interpreter.sendDialogues(npc, FacialExpression.NEUTRAL, "Okay JalYt.","TzTok-Jad not show up for just anyone."); + stage = 59; + break; + case 59: + interpreter.sendDialogues(npc, FacialExpression.NEUTRAL, "You give 8000 TokKul, TzTok-Jad know you serious.", "You get it back if you victorious."); + stage = 60; + break; + case 60: + interpreter.sendOptions("Select an Option", "That's fair, here's 8000 TokKul.", "I don't have that much on me, but I'll go get it.", "TzTok-Jad must be old and tired to not just accept my challenge."); + stage = 61; + case 61: + switch (buttonId) { + case 1: + interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "That's fair, here's 8000 TokKul."); + if (!player.getInventory().containsItem(APPEARANCE_FEE)) { + stage = 62; + break; + } + if (player.getInventory().remove(APPEARANCE_FEE)) { + stage = 69; + } else { + stage = 62; + } + break; + case 2: + interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "I don't have that much on me, but I'll go get it."); + stage = 30; + break; + case 3: + interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "TzTok-Jad must be old and tired", "to not just accept my challenge."); + stage = 63; + break; + } + break; + case 62: + interpreter.sendDialogues(npc, FacialExpression.NEUTRAL, "JalYt, you not have the TokKul.", "You come back when you are serious."); + stage = 30; + break; + case 63: + interpreter.sendDialogues(npc, FacialExpression.ANGRY, "JalYt-Mor, you the old and tired one.", "You the one not want to do proper training."); + stage = 30; + break; + case 64: + interpreter.sendDialogues(npc, FacialExpression.NEUTRAL, "TzTok-Jad is waiting for you.", "Do not make TzTok-Jad wait long."); + stage = 30; + break; + case 69: + interpreter.sendDialogues(npc, FacialExpression.NEUTRAL, "Okay JalYt. Enter cave when you are prepared.", "You find TzTok-Jad waiting for JalYt challenger."); + player.setAttribute("fc_practice_jad", true); + stage = 30; + break; } return true; } diff --git a/Server/src/main/kotlin/rs09/game/system/config/ServerConfigParser.kt b/Server/src/main/kotlin/rs09/game/system/config/ServerConfigParser.kt index d1bed5335..ecb286e4a 100644 --- a/Server/src/main/kotlin/rs09/game/system/config/ServerConfigParser.kt +++ b/Server/src/main/kotlin/rs09/game/system/config/ServerConfigParser.kt @@ -68,6 +68,7 @@ object ServerConfigParser { enabled_botting = data.getBoolean("world.enable_botting"), max_adv_bots = data.getLong("world.max_adv_bots").toInt(), wild_pvp_enabled = data.getBoolean("world.wild_pvp_enabled"), + jad_practice_enabled = data.getBoolean("world.jad_practice_enabled"), message_model = data.getString("world.motw_identifier").toInt(), message_string = data.getString("world.motw_text").replace("@name",ServerConstants.SERVER_NAME) ) diff --git a/Server/src/main/kotlin/rs09/game/world/GameSettings.kt b/Server/src/main/kotlin/rs09/game/world/GameSettings.kt index b3c2d9b82..0edf09e6f 100644 --- a/Server/src/main/kotlin/rs09/game/world/GameSettings.kt +++ b/Server/src/main/kotlin/rs09/game/world/GameSettings.kt @@ -80,6 +80,7 @@ class GameSettings var enabled_botting : Boolean, var max_adv_bots: Int, var wild_pvp_enabled: Boolean, + var jad_practice_enabled: Boolean, /**"Lobby" interface * The message of the week models to display @@ -132,6 +133,7 @@ class GameSettings val enable_botting = if(data.containsKey("botting_enabled")) data["botting_enabled"] as Boolean else false val max_adv_bots = if(data.containsKey("max_adv_bots")) data["max_adv_bots"].toString().toInt() else 100 val wild_pvp_enabled = if(data.containsKey("wild_pvp_enabled")) data["wild_pvp_enabled"] as Boolean else true + val jad_practice_enabled = if(data.containsKey("jad_practice_enabled")) data["jad_practice_enabled"] as Boolean else true val allow_token_purchase = data["allow_token_purchase"] as Boolean val message_of_the_week_identifier = data["message_of_the_week_identifier"].toString().toInt() val message_of_the_week_text = data["message_of_the_week_text"].toString() @@ -159,6 +161,7 @@ class GameSettings enable_botting, max_adv_bots, wild_pvp_enabled, + jad_practice_enabled, message_of_the_week_identifier, message_of_the_week_text ) diff --git a/Server/worldprops/default.conf b/Server/worldprops/default.conf index 932c45714..56771d5ab 100644 --- a/Server/worldprops/default.conf +++ b/Server/worldprops/default.conf @@ -46,6 +46,7 @@ increased_door_time = false enable_botting = false max_adv_bots = 100 wild_pvp_enabled = false +jad_practice_enabled = true [paths] #path to the data folder, which contains the cache subfolder and such