Added a practice mode on Jad, so that Noobs can practice Jad without being in the cave for an hour. Costs 8000 TokKul + supplies. 8000 TokKul is given back if the Noob is successful at defeating Jad. Video of dialogue/functionality: https://www.youtube.com/watch?v=ZESnT0278gI
This commit is contained in:
+42
-14
@@ -95,7 +95,8 @@ public final class TzhaarFightCavesPlugin extends ActivityPlugin {
|
|||||||
player.removeAttribute("fc_offset");
|
player.removeAttribute("fc_offset");
|
||||||
player.getProperties().setTeleportLocation(getBase().transform(offsetX, offsetY, 0));
|
player.getProperties().setTeleportLocation(getBase().transform(offsetX, offsetY, 0));
|
||||||
Pulse pulse;
|
Pulse pulse;
|
||||||
if (!login) {
|
boolean practice = player.getAttribute("fc_practice_jad", false);
|
||||||
|
if (!login && !practice) {
|
||||||
final int wave = 0;
|
final int wave = 0;
|
||||||
player.setAttribute("fc_wave", wave);
|
player.setAttribute("fc_wave", wave);
|
||||||
player.getWalkingQueue().reset();
|
player.getWalkingQueue().reset();
|
||||||
@@ -117,6 +118,9 @@ public final class TzhaarFightCavesPlugin extends ActivityPlugin {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
if (practice) {
|
||||||
|
player.setAttribute("fc_wave", 62);
|
||||||
|
}
|
||||||
if (player.getAttribute("fc_wave", 0) == 62) {
|
if (player.getAttribute("fc_wave", 0) == 62) {
|
||||||
player.getDialogueInterpreter().sendDialogues(2617, null, "Look out, here comes TzTok-Jad!");
|
player.getDialogueInterpreter().sendDialogues(2617, null, "Look out, here comes TzTok-Jad!");
|
||||||
}
|
}
|
||||||
@@ -142,28 +146,50 @@ public final class TzhaarFightCavesPlugin extends ActivityPlugin {
|
|||||||
activeNPCs.clear();
|
activeNPCs.clear();
|
||||||
player.getProperties().setTeleportLocation(getSpawnLocation());
|
player.getProperties().setTeleportLocation(getSpawnLocation());
|
||||||
player.getSkills().restore();
|
player.getSkills().restore();
|
||||||
|
boolean practice = player.getAttribute("fc_practice_jad", false);
|
||||||
if (wave == 63) {
|
if (wave == 63) {
|
||||||
if (!player.getInventory().add(new Item(6570))) {
|
if (!practice) {
|
||||||
GroundItemManager.create(new Item(6570), getSpawnLocation(), player);
|
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!");
|
player.getPacketDispatch().sendMessage("You were victorious!");
|
||||||
BossKillCounter.addtoKillcount(player, 2745);
|
|
||||||
if (player.getSlayer().getTask() == Tasks.JAD) {
|
if (!practice) {
|
||||||
player.getSkills().addExperience(Skills.SLAYER, 25000);
|
BossKillCounter.addtoKillcount(player, 2745);
|
||||||
player.getSlayer().clear();
|
if (player.getSlayer().getTask() == Tasks.JAD) {
|
||||||
player.sendMessage("You receive 25,000 slayer experience for defeating TzTok-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) {
|
} else if (wave <= 1) {
|
||||||
player.getDialogueInterpreter().sendDialogues(2617, null, "Well I suppose you tried... better luck next time.");
|
player.getDialogueInterpreter().sendDialogues(2617, null, "Well I suppose you tried... better luck next time.");
|
||||||
} else {
|
} 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))) {
|
if (!practice) {
|
||||||
GroundItemManager.create(new Item(6529, amount), getSpawnLocation(), player);
|
int amount = wave << 7;
|
||||||
|
if (amount > 0 && !player.getInventory().add(new Item(6529, amount))) {
|
||||||
|
GroundItemManager.create(new Item(6529, amount), getSpawnLocation(), player);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -181,6 +207,7 @@ public final class TzhaarFightCavesPlugin extends ActivityPlugin {
|
|||||||
} else {
|
} else {
|
||||||
player.removeAttribute("fc_offset");
|
player.removeAttribute("fc_offset");
|
||||||
player.removeAttribute("fc_wave");
|
player.removeAttribute("fc_wave");
|
||||||
|
player.removeAttribute("fc_practice_jad");
|
||||||
player.removeAttribute("fc_safe_logout");
|
player.removeAttribute("fc_safe_logout");
|
||||||
Pulse pulse = player.getAttribute("fc:pulse");
|
Pulse pulse = player.getAttribute("fc:pulse");
|
||||||
if (pulse != null) {
|
if (pulse != null) {
|
||||||
@@ -272,6 +299,7 @@ public final class TzhaarFightCavesPlugin extends ActivityPlugin {
|
|||||||
leave((Player) e, e.getAttribute("fc_wave", 0));
|
leave((Player) e, e.getAttribute("fc_wave", 0));
|
||||||
player.removeAttribute("fc_wave");
|
player.removeAttribute("fc_wave");
|
||||||
player.removeAttribute("fc_offset");
|
player.removeAttribute("fc_offset");
|
||||||
|
player.removeAttribute("fc_practice_jad");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -4,16 +4,20 @@ import core.game.content.dialogue.DialogueInterpreter;
|
|||||||
import core.game.content.dialogue.DialoguePlugin;
|
import core.game.content.dialogue.DialoguePlugin;
|
||||||
import core.game.content.dialogue.FacialExpression;
|
import core.game.content.dialogue.FacialExpression;
|
||||||
import core.game.node.entity.npc.NPC;
|
import core.game.node.entity.npc.NPC;
|
||||||
|
import core.game.node.item.Item;
|
||||||
import core.plugin.Initializable;
|
import core.plugin.Initializable;
|
||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
|
import rs09.game.world.GameWorld;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the TzHaarMejJal dialogue.
|
* Handles the TzHaarMejJal dialogue.
|
||||||
* @author 'Vexia
|
* @author 'Vexia
|
||||||
* @author Empathy
|
* @author Empathy
|
||||||
|
* @author Logg
|
||||||
*/
|
*/
|
||||||
@Initializable
|
@Initializable
|
||||||
public class TzHaarMejJah extends DialoguePlugin {
|
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() {
|
public TzHaarMejJah() {
|
||||||
|
|
||||||
@@ -41,7 +45,15 @@ public class TzHaarMejJah extends DialoguePlugin {
|
|||||||
public boolean handle(int interfaceId, int buttonId) {
|
public boolean handle(int interfaceId, int buttonId) {
|
||||||
switch (stage) {
|
switch (stage) {
|
||||||
case 0:
|
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;
|
stage = 1;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
@@ -59,10 +71,23 @@ public class TzHaarMejJah extends DialoguePlugin {
|
|||||||
stage = 20;
|
stage = 20;
|
||||||
break;
|
break;
|
||||||
case 3:
|
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.");
|
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "No I'm fine thanks.");
|
||||||
stage = 30;
|
stage = 30;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
@@ -133,7 +158,7 @@ public class TzHaarMejJah extends DialoguePlugin {
|
|||||||
stage = 21;
|
stage = 21;
|
||||||
break;
|
break;
|
||||||
case 21:
|
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;
|
stage = 22;
|
||||||
break;
|
break;
|
||||||
case 22:
|
case 22:
|
||||||
@@ -176,6 +201,107 @@ public class TzHaarMejJah extends DialoguePlugin {
|
|||||||
case 30:
|
case 30:
|
||||||
end();
|
end();
|
||||||
break;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ object ServerConfigParser {
|
|||||||
enabled_botting = data.getBoolean("world.enable_botting"),
|
enabled_botting = data.getBoolean("world.enable_botting"),
|
||||||
max_adv_bots = data.getLong("world.max_adv_bots").toInt(),
|
max_adv_bots = data.getLong("world.max_adv_bots").toInt(),
|
||||||
wild_pvp_enabled = data.getBoolean("world.wild_pvp_enabled"),
|
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_model = data.getString("world.motw_identifier").toInt(),
|
||||||
message_string = data.getString("world.motw_text").replace("@name",ServerConstants.SERVER_NAME)
|
message_string = data.getString("world.motw_text").replace("@name",ServerConstants.SERVER_NAME)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ class GameSettings
|
|||||||
var enabled_botting : Boolean,
|
var enabled_botting : Boolean,
|
||||||
var max_adv_bots: Int,
|
var max_adv_bots: Int,
|
||||||
var wild_pvp_enabled: Boolean,
|
var wild_pvp_enabled: Boolean,
|
||||||
|
var jad_practice_enabled: Boolean,
|
||||||
|
|
||||||
/**"Lobby" interface
|
/**"Lobby" interface
|
||||||
* The message of the week models to display
|
* 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 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 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 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 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_identifier = data["message_of_the_week_identifier"].toString().toInt()
|
||||||
val message_of_the_week_text = data["message_of_the_week_text"].toString()
|
val message_of_the_week_text = data["message_of_the_week_text"].toString()
|
||||||
@@ -159,6 +161,7 @@ class GameSettings
|
|||||||
enable_botting,
|
enable_botting,
|
||||||
max_adv_bots,
|
max_adv_bots,
|
||||||
wild_pvp_enabled,
|
wild_pvp_enabled,
|
||||||
|
jad_practice_enabled,
|
||||||
message_of_the_week_identifier,
|
message_of_the_week_identifier,
|
||||||
message_of_the_week_text
|
message_of_the_week_text
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ increased_door_time = false
|
|||||||
enable_botting = false
|
enable_botting = false
|
||||||
max_adv_bots = 100
|
max_adv_bots = 100
|
||||||
wild_pvp_enabled = false
|
wild_pvp_enabled = false
|
||||||
|
jad_practice_enabled = true
|
||||||
|
|
||||||
[paths]
|
[paths]
|
||||||
#path to the data folder, which contains the cache subfolder and such
|
#path to the data folder, which contains the cache subfolder and such
|
||||||
|
|||||||
Reference in New Issue
Block a user