Removed inauthentic pets
Removed option to obtain inauthentic TzRek-Jad pet
This commit is contained in:
@@ -1,103 +0,0 @@
|
||||
package content.data.skill;
|
||||
|
||||
import core.game.node.entity.skill.Skills;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.item.Item;
|
||||
import core.game.world.repository.Repository;
|
||||
|
||||
/**
|
||||
* Represents the skilling pets obtained randomly.
|
||||
* @author Empathy
|
||||
*
|
||||
*/
|
||||
public enum SkillingPets {
|
||||
|
||||
BABY_RED_CHINCHOMPA(new Item(14823), "Baby Chinchompa", Skills.HUNTER),
|
||||
BABY_GREY_CHINCHOMPA(new Item(14824), "Baby Chinchompa", Skills.HUNTER),
|
||||
BEAVER(new Item(14821), "Beaver", Skills.WOODCUTTING),
|
||||
GOLEM(new Item(14822), "Rock Golem", Skills.MINING),
|
||||
HERON(new Item(14827), "Heron", Skills.FISHING);
|
||||
|
||||
/**
|
||||
* The pet item drop.
|
||||
*/
|
||||
private final Item pet;
|
||||
|
||||
/**
|
||||
* The name.
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
/**
|
||||
* The skill.
|
||||
*/
|
||||
private final int skill;
|
||||
|
||||
/**
|
||||
* Constructs a new {@code SkillingPets} object.
|
||||
* @param skill The skill id.
|
||||
* @param pet The pet item.
|
||||
*/
|
||||
SkillingPets(Item pet, String name, int skill) {
|
||||
this.pet = pet;
|
||||
this.name = name;
|
||||
this.skill = skill;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the pet drop.
|
||||
* @param player The player.
|
||||
* @param pet The pet drop to check.
|
||||
*/
|
||||
public static void checkPetDrop(Player player, SkillingPets pet) {
|
||||
if (pet == null) {
|
||||
return;
|
||||
}
|
||||
int defaultChance = 15000;
|
||||
int newChance = (defaultChance / player.getSkills().getStaticLevel(pet.getSkill()) * 55);
|
||||
int outOf = (newChance > defaultChance ? defaultChance : newChance);
|
||||
int getChance = outOf;
|
||||
if (getChance != 1) {
|
||||
return;
|
||||
}
|
||||
if (player.hasItem(pet.getPet())) {
|
||||
return;
|
||||
}
|
||||
if (player.getFamiliarManager().hasFamiliar() && player.getInventory().isFull()) {
|
||||
return;
|
||||
}
|
||||
if (player.getFamiliarManager().hasFamiliar()) {
|
||||
if (player.getFamiliarManager().getFamiliar().getName().equalsIgnoreCase(pet.getName())) {
|
||||
return;
|
||||
}
|
||||
player.getInventory().add(pet.getPet());
|
||||
player.sendNotificationMessage("You feel something weird sneaking into your backpack.");
|
||||
} else {
|
||||
player.getFamiliarManager().summon(pet.getPet(), true);
|
||||
player.sendNotificationMessage("You have a funny feeling like you're being followed.");
|
||||
}
|
||||
Repository.sendNews(player.getUsername() + " has found a " + pet.getPet().getName() + "!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the pet
|
||||
*/
|
||||
public Item getPet() {
|
||||
return pet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the pet name.
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the skill.
|
||||
*/
|
||||
public int getSkill() {
|
||||
return skill;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package content.global.skill.gather.fishing
|
||||
|
||||
import content.data.skill.SkillingPets
|
||||
import content.global.skill.fishing.Fish
|
||||
import content.global.skill.fishing.FishingOption
|
||||
import content.global.skill.skillcapeperks.SkillcapePerks
|
||||
@@ -124,7 +123,6 @@ class FishingPulse(player: Player?, npc: NPC, private val option: FishingOption?
|
||||
updateSkillTask()
|
||||
}
|
||||
player.dispatch(ResourceProducedEvent(fish!!.id, 1, node!!))
|
||||
SkillingPets.checkPetDrop(player, SkillingPets.HERON)
|
||||
val item = fish!!
|
||||
if (isActive(SkillcapePerks.GREAT_AIM, player) && RandomFunction.random(100) <= 5) {
|
||||
addItemOrDrop(player, item.id)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package content.global.skill.gather.mining
|
||||
|
||||
import content.data.skill.SkillingPets
|
||||
import content.data.skill.SkillingTool
|
||||
import content.global.skill.skillcapeperks.SkillcapePerks
|
||||
import content.global.activity.shootingstar.StarBonus
|
||||
@@ -67,7 +66,6 @@ class MiningListener : InteractionListener {
|
||||
rewardAmount = calculateRewardAmount(player, isEssence, reward) // calculate amount
|
||||
|
||||
player.dispatch(ResourceProducedEvent(reward, rewardAmount, node))
|
||||
SkillingPets.checkPetDrop(player, SkillingPets.GOLEM) // roll for pet
|
||||
|
||||
// Reward mining experience
|
||||
val experience = resource!!.experience * rewardAmount
|
||||
|
||||
@@ -3,7 +3,6 @@ package content.global.skill.gather.mining
|
||||
import core.api.*
|
||||
import core.game.event.ResourceProducedEvent
|
||||
import core.cache.def.impl.ItemDefinition
|
||||
import content.data.skill.SkillingPets
|
||||
import core.game.node.Node
|
||||
import core.game.node.entity.impl.Animator
|
||||
import core.game.node.entity.npc.drop.DropFrequency
|
||||
@@ -132,7 +131,6 @@ class MiningSkillPulse(private val player: Player, private val node: Node) : Pul
|
||||
rewardAmount = calculateRewardAmount(reward) // calculate amount
|
||||
|
||||
player.dispatch(ResourceProducedEvent(reward, rewardAmount, node))
|
||||
SkillingPets.checkPetDrop(player, SkillingPets.GOLEM) // roll for pet
|
||||
|
||||
// Reward mining experience
|
||||
val experience = resource!!.experience * rewardAmount
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package content.global.skill.gather.woodcutting
|
||||
|
||||
import content.data.skill.SkillingPets
|
||||
import content.data.skill.SkillingTool
|
||||
import content.data.tables.BirdNest
|
||||
import content.global.skill.farming.FarmingPatch.Companion.forObject
|
||||
@@ -109,7 +108,6 @@ class WoodcuttingListener : InteractionListener {
|
||||
|
||||
if (reward > 0) {
|
||||
rewardAmount = calculateRewardAmount(player, reward) // calculate amount
|
||||
SkillingPets.checkPetDrop(player, SkillingPets.BEAVER) // roll for pet
|
||||
|
||||
//add experience
|
||||
val experience: Double = calculateExperience(player, resource, rewardAmount)
|
||||
|
||||
@@ -8,7 +8,6 @@ import core.game.event.ResourceProducedEvent;
|
||||
import core.cache.def.impl.ItemDefinition;
|
||||
import core.game.container.impl.EquipmentContainer;
|
||||
import core.game.dialogue.FacialExpression;
|
||||
import content.data.skill.SkillingPets;
|
||||
import core.game.node.entity.impl.Animator;
|
||||
import core.game.node.entity.impl.Projectile;
|
||||
import core.game.node.entity.player.Player;
|
||||
@@ -157,7 +156,6 @@ public class WoodcuttingSkillPulse extends Pulse {
|
||||
if (reward > 0) {
|
||||
reward = calculateReward(reward); // calculate rewards
|
||||
rewardAmount = calculateRewardAmount(reward); // calculate amount
|
||||
SkillingPets.checkPetDrop(player, SkillingPets.BEAVER); // roll for pet
|
||||
|
||||
//add experience
|
||||
double experience = calculateExperience(resource.reward, rewardAmount);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package content.global.skill.hunter;
|
||||
|
||||
import content.data.skill.SkillingPets;
|
||||
import core.game.node.entity.skill.SkillPulse;
|
||||
import core.game.node.entity.skill.Skills;
|
||||
import core.game.node.entity.player.Player;
|
||||
@@ -95,13 +94,6 @@ public final class TrapDismantlePulse extends SkillPulse<Scenery> {
|
||||
if (wrapper.getType().getSettings().clear(wrapper, 1)) {
|
||||
instance.deregister(wrapper);
|
||||
if (wrapper.isCaught()) {
|
||||
if (wrapper.getType().equals(Traps.BOX_TRAP)) {
|
||||
for (int i : wrapper.getReward().getNpcIds()) {
|
||||
if (i == 5080 || i == 5079) {
|
||||
SkillingPets.checkPetDrop(player, i == 5080 ? SkillingPets.BABY_RED_CHINCHOMPA : SkillingPets.BABY_GREY_CHINCHOMPA);
|
||||
}
|
||||
}
|
||||
}
|
||||
player.getSkills().addExperience(Skills.HUNTER, wrapper.getReward().getExperience(), true);
|
||||
}
|
||||
player.getPacketDispatch().sendMessage("You dismantle the trap.");
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package content.global.skill.hunter;
|
||||
|
||||
import content.data.skill.SkillingPets;
|
||||
import core.game.node.entity.npc.NPC;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.entity.skill.Skills;
|
||||
@@ -123,8 +122,4 @@ public class TrapNode {
|
||||
return objectIds;
|
||||
}
|
||||
|
||||
public SkillingPets getPet() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -55,31 +55,6 @@ public enum Pets {
|
||||
*/
|
||||
TERRIER(12512, 12513, -1, 6958, 6959, -1, 0.0033333333333333, 4, 2132, 2134, 2136, 2138, 10816, 9986, 9978, 526), TERRIER_1(12700, 12701, -1, 7237, 7238, -1, 0.0033333333333333, 4, 2132, 2134, 2136, 2138, 10816, 9986, 9978, 526), TERRIER_2(12702, 12703, -1, 7239, 7240, -1, 0.0033333333333333, 4, 2132, 2134, 2136, 2138, 10816, 9986, 9978, 526),
|
||||
|
||||
/**
|
||||
* A creeping hand pet.
|
||||
*/
|
||||
//CREEPING_HAND(14652, -1, -1, 8619, -1, -1, 0.0033333333333333, 4, 1059),
|
||||
|
||||
/**
|
||||
* Minitrice pet.
|
||||
*/
|
||||
//MINITRICE(14653, -1, -1, 8620, -1, -1, 0.0033333333333333, 4, 225),
|
||||
|
||||
/**
|
||||
* Baby basilisk pet.
|
||||
*/
|
||||
//BABY_BASILISK(14654, -1, -1, 8621, -1, -1, 0.0033333333333333, 4, 221),
|
||||
|
||||
/**
|
||||
* Baby kurask pet.
|
||||
*/
|
||||
//BABY_KURASK(14655, -1, -1, 8622, -1, -1, 0.0033333333333333, 4, 526),
|
||||
|
||||
/**
|
||||
* Abyssal minion pet.
|
||||
*/
|
||||
//ABYSSAL_MINION(14651, -1, -1, 8624, -1, -1, 0.0033333333333333, 4, 592),
|
||||
|
||||
/**
|
||||
* Gecko pet.
|
||||
*/
|
||||
|
||||
@@ -1,313 +0,0 @@
|
||||
package content.region.karamja.tzhaar.handlers;
|
||||
|
||||
import core.game.dialogue.DialogueInterpreter;
|
||||
import core.game.dialogue.DialoguePlugin;
|
||||
import core.game.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 core.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() {
|
||||
|
||||
}
|
||||
|
||||
public TzHaarMejJah(Player player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DialoguePlugin newInstance(Player player) {
|
||||
|
||||
return new TzHaarMejJah(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
npc = (NPC) args[0];
|
||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "You want help JalYt-Ket-" + player.getUsername() + "?");
|
||||
stage = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(int interfaceId, int buttonId) {
|
||||
switch (stage) {
|
||||
case 0:
|
||||
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:
|
||||
switch (buttonId) {
|
||||
case 1:
|
||||
if (player.getInventory().containItems(6570)) {
|
||||
interpreter.open(DialogueInterpreter.getDialogueKey("firecape-exchange"), npc);
|
||||
break;
|
||||
}
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "What is this place?");
|
||||
stage = 10;
|
||||
break;
|
||||
case 2:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "What did you call me?");
|
||||
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:
|
||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "This is the fight caves, TzHaar-Xil made it for practice,", "but many JalYt come here to fight too.", "Just enter the cave and make sure you're prepared.");
|
||||
stage = 11;
|
||||
break;
|
||||
case 11:
|
||||
interpreter.sendOptions("Select an Option", "Are there any rules?", "Ok thanks.");
|
||||
stage = 12;
|
||||
break;
|
||||
case 12:
|
||||
switch (buttonId) {
|
||||
case 1:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Are there any rules?");
|
||||
stage = 14;
|
||||
break;
|
||||
case 2:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Ok thanks.");
|
||||
stage = 13;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
end();
|
||||
break;
|
||||
case 14:
|
||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Rules? Survival is the only rule in there.");
|
||||
stage = 15;
|
||||
break;
|
||||
case 15:
|
||||
interpreter.sendOptions("Select an Option", "Do I win anything?", "Sounds good.");
|
||||
stage = 16;
|
||||
break;
|
||||
case 16:
|
||||
switch (buttonId) {
|
||||
case 1:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Do I win anything?");
|
||||
stage = 17;
|
||||
break;
|
||||
case 2:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Sounds good.");
|
||||
stage = 13;
|
||||
break;
|
||||
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "You ask a lot of questions.", "Might give you TokKul if you last long enough.");
|
||||
stage = 18;
|
||||
break;
|
||||
case 18:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "...");
|
||||
stage = 19;
|
||||
break;
|
||||
case 19:
|
||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Before you ask, TokKul is like your Coins.");
|
||||
stage = 500;
|
||||
break;
|
||||
case 500:
|
||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Gold is like you JalYt, soft and easily broken, we use", "hard rock forged in fire like TzHaar!");
|
||||
stage = 501;
|
||||
break;
|
||||
case 501:
|
||||
end();
|
||||
break;
|
||||
case 20:
|
||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Are you not JalYt-Ket?");
|
||||
stage = 21;
|
||||
break;
|
||||
case 21:
|
||||
interpreter.sendOptions("Select an Option", "What's a 'JalYt-Ket'?", "I guess so...", "No I'm not!");
|
||||
stage = 22;
|
||||
break;
|
||||
case 22:
|
||||
switch (buttonId) {
|
||||
case 1:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "What's a 'JalYt-Ket'?");
|
||||
stage = 100;
|
||||
break;
|
||||
case 2:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "I guess so...");
|
||||
stage = 200;
|
||||
break;
|
||||
case 3:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "No I'm not!");
|
||||
stage = 300;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 100:
|
||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "That what you are... you tough and strong no?");
|
||||
stage = 101;
|
||||
break;
|
||||
case 101:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Well yes I suppose I am...");
|
||||
stage = 102;
|
||||
break;
|
||||
case 102:
|
||||
end();
|
||||
break;
|
||||
case 200:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "I guess so....");
|
||||
stage = 201;
|
||||
break;
|
||||
case 201:
|
||||
end();
|
||||
break;
|
||||
case 300:
|
||||
end();
|
||||
break;
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIds() {
|
||||
return new int[] { DialogueInterpreter.getDialogueKey("tzhaar-mej"), 2617 };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
package content.region.karamja.tzhaar.handlers
|
||||
|
||||
import core.api.*
|
||||
import core.game.dialogue.*
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.item.Item
|
||||
import core.game.world.GameWorld.settings
|
||||
import core.plugin.Initializable
|
||||
import core.tools.END_DIALOGUE
|
||||
import org.rs09.consts.Items
|
||||
import org.rs09.consts.NPCs
|
||||
|
||||
/**
|
||||
* Handles the TzHaarMejJal dialogue.
|
||||
* @author 'Vexia
|
||||
* @author Empathy
|
||||
* @author Logg
|
||||
*/
|
||||
@Initializable
|
||||
class TzHaarMejJal(player: Player? = null) : DialoguePlugin(player){
|
||||
|
||||
override fun open(vararg args: Any): Boolean {
|
||||
npc = args[0] as NPC
|
||||
npcl(FacialExpression.HALF_GUILTY, "You want help JalYt-Ket-${player.username}?").also { stage = 0 }
|
||||
return true
|
||||
}
|
||||
|
||||
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||
when (stage) {
|
||||
0 -> showTopics(
|
||||
if (inInventory(player, Items.FIRE_CAPE_6570)) {
|
||||
Topic(FacialExpression.HALF_GUILTY, "I have a fire cape here.", 100)
|
||||
} else {
|
||||
Topic(FacialExpression.HALF_GUILTY, "What is this place?", 10)
|
||||
},
|
||||
Topic(FacialExpression.HALF_GUILTY, "What did you call me?", 20),
|
||||
IfTopic(FacialExpression.HALF_GUILTY, "About my challenge...", 50, getAttribute(player, "fc_practice_jad", false) && settings!!.jad_practice_enabled),
|
||||
IfTopic("I want to challenge Jad directly.", 30, !getAttribute(player, "fc_practice_jad", false) && settings!!.jad_practice_enabled, skipPlayer = true),
|
||||
Topic(FacialExpression.HALF_GUILTY, "No I'm fine thanks.", END_DIALOGUE)
|
||||
)
|
||||
|
||||
10 -> npc(FacialExpression.HALF_GUILTY,
|
||||
"This is the fight caves, TzHaar-Xil made it for practice,",
|
||||
"but many JalYt come here to fight too.",
|
||||
"Just enter the cave and make sure you're prepared."
|
||||
).also { stage++ }
|
||||
|
||||
11 -> showTopics(
|
||||
Topic(FacialExpression.HALF_GUILTY, "Are there any rules?", 12),
|
||||
Topic(FacialExpression.HALF_GUILTY, "Ok thanks.", END_DIALOGUE)
|
||||
)
|
||||
|
||||
12 -> npcl(FacialExpression.HALF_GUILTY, "Rules? Survival is the only rule in there.").also { stage++ }
|
||||
13 -> showTopics(
|
||||
Topic(FacialExpression.HALF_GUILTY, "Do I win anything?", 14),
|
||||
Topic(FacialExpression.HALF_GUILTY, "Sounds good.", END_DIALOGUE)
|
||||
)
|
||||
|
||||
14 -> npc(FacialExpression.HALF_GUILTY,
|
||||
"You ask a lot of questions.",
|
||||
"Might give you TokKul if you last long enough."
|
||||
).also { stage++ }
|
||||
15 -> playerl(FacialExpression.HALF_GUILTY, "...").also { stage ++ }
|
||||
16 -> npcl(FacialExpression.HALF_GUILTY, "Before you ask, TokKul is like your Coins.").also { stage++ }
|
||||
17 -> npc(FacialExpression.HALF_GUILTY,
|
||||
"Gold is like you JalYt, soft and easily broken, we use",
|
||||
"hard rock forged in fire like TzHaar!"
|
||||
).also{ stage = END_DIALOGUE }
|
||||
|
||||
20 -> npcl(FacialExpression.HALF_GUILTY, "Are you not JalYt-Ket?").also { stage++ }
|
||||
21 -> showTopics(
|
||||
Topic(FacialExpression.HALF_GUILTY, "What's a 'JalYt-Ket'?", 22),
|
||||
Topic(FacialExpression.HALF_GUILTY, "I guess so...", END_DIALOGUE),
|
||||
Topic(FacialExpression.HALF_GUILTY, "No I'm not!", END_DIALOGUE)
|
||||
)
|
||||
|
||||
22 -> npcl(FacialExpression.HALF_GUILTY, "That what you are... you tough and strong no?").also { stage++ }
|
||||
23 -> playerl(FacialExpression.HALF_GUILTY, "Well yes I suppose I am...").also { stage = END_DIALOGUE }
|
||||
|
||||
30 -> player(FacialExpression.HALF_GUILTY,
|
||||
"The challenge is too long.",
|
||||
"I want to challenge Jad directly."
|
||||
).also { stage++ }
|
||||
31 -> npc(FacialExpression.DISGUSTED_HEAD_SHAKE,
|
||||
"I thought you strong and tough",
|
||||
"but you want skip endurance training?"
|
||||
).also { stage++ }
|
||||
32 -> npcl(FacialExpression.NEUTRAL, "Maybe you not JalYt-Ket afterall.").also { stage++ }
|
||||
33 -> showTopics(
|
||||
Topic(FacialExpression.HALF_GUILTY, "I don't have time for it, man.", 35),
|
||||
Topic("No, I'm JalYt-Ket!", 34, skipPlayer = true)
|
||||
)
|
||||
|
||||
34 -> player(FacialExpression.HALF_GUILTY,
|
||||
"No, I'm JalYt-Ket! I swear!",
|
||||
"I'll do the training properly."
|
||||
).also { stage = END_DIALOGUE }
|
||||
|
||||
35 -> npc(FacialExpression.DISGUSTED_HEAD_SHAKE,
|
||||
"JalYt, you know you not get reward",
|
||||
"if you not do training properly, ok?"
|
||||
).also { stage++ }
|
||||
36 -> showTopics(
|
||||
Topic(FacialExpression.HALF_GUILTY, "That's okay, I don't need a reward.", 37),
|
||||
Topic(FacialExpression.HALF_GUILTY, "Oh, nevermind then.", END_DIALOGUE)
|
||||
)
|
||||
|
||||
37 -> playerl(FacialExpression.NEUTRAL, "I just wanna fight the big guy.").also { stage++ }
|
||||
38 -> npc(FacialExpression.NEUTRAL,
|
||||
"Okay JalYt.",
|
||||
"TzTok-Jad not show up for just anyone."
|
||||
).also { stage++ }
|
||||
39 -> npc(FacialExpression.NEUTRAL,
|
||||
"You give 8000 TokKul, TzTok-Jad know you serious.",
|
||||
"You get it back if you victorious."
|
||||
).also { stage++ }
|
||||
40 -> showTopics(
|
||||
Topic(FacialExpression.HALF_GUILTY, "That's fair, here's 8000 TokKul.", 41),
|
||||
Topic(FacialExpression.HALF_GUILTY, "I don't have that much on me, but I'll go get it.", END_DIALOGUE),
|
||||
Topic("TzTok-Jad must be old and tired to not just accept my challenge.", 42, skipPlayer = true)
|
||||
)
|
||||
|
||||
41 -> if (removeItem(player, Item(Items.TOKKUL_6529, 8000))) {
|
||||
npc(FacialExpression.NEUTRAL,
|
||||
"Okay JalYt. Enter cave when you are prepared.",
|
||||
"You find TzTok-Jad waiting for JalYt challenger."
|
||||
)
|
||||
.also { setAttribute(player, "fc_practice_jad", true) }
|
||||
.also { stage = END_DIALOGUE }
|
||||
} else npc(FacialExpression.NEUTRAL,
|
||||
"JalYt, you not have the TokKul.",
|
||||
"You come back when you are serious."
|
||||
).also { stage = END_DIALOGUE }
|
||||
|
||||
42 -> player(FacialExpression.HALF_GUILTY,
|
||||
"TzTok-Jad must be old and tired",
|
||||
"to not just accept my challenge."
|
||||
).also { stage++ }
|
||||
43 -> npc(FacialExpression.ANGRY,
|
||||
"JalYt-Mor, you the old and tired one.",
|
||||
"You the one not want to do proper training."
|
||||
).also { stage = END_DIALOGUE }
|
||||
|
||||
50 -> npc(FacialExpression.NEUTRAL,
|
||||
"TzTok-Jad is waiting for you.",
|
||||
"Do not make TzTok-Jad wait long."
|
||||
).also { stage = END_DIALOGUE }
|
||||
|
||||
100 -> sendDialogueOptions(player, "Sell your fire cape?", "Yes, sell it for 8,000 TokKul.", "No, keep it.").also { stage++ }
|
||||
101 -> when (buttonId) {
|
||||
1 -> npcl(FacialExpression.OLD_NORMAL, "Hand your cape here, young JalYte.").also { stage++ }
|
||||
2 -> end()
|
||||
}
|
||||
102 -> end().also { if (removeItem(player, Items.FIRE_CAPE_6570)) addItem(player, Items.TOKKUL_6529, 8000) }
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun newInstance(player: Player): DialoguePlugin {
|
||||
return TzHaarMejJal(player)
|
||||
}
|
||||
|
||||
override fun getIds(): IntArray {
|
||||
return intArrayOf(NPCs.TZHAAR_MEJ_JAL_2617)
|
||||
}
|
||||
}
|
||||
@@ -1,263 +0,0 @@
|
||||
package content.region.karamja.tzhaar.handlers;
|
||||
|
||||
import core.cache.def.impl.NPCDefinition;
|
||||
import core.game.dialogue.DialogueInterpreter;
|
||||
import core.game.dialogue.DialoguePlugin;
|
||||
import core.game.dialogue.FacialExpression;
|
||||
import core.game.interaction.OptionHandler;
|
||||
import core.game.node.Node;
|
||||
import core.game.node.entity.npc.NPC;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.item.Item;
|
||||
import core.game.world.repository.Repository;
|
||||
import core.plugin.Plugin;
|
||||
import core.plugin.ClassScanner;
|
||||
import core.plugin.Initializable;
|
||||
import core.tools.RandomFunction;
|
||||
|
||||
/**
|
||||
* Handles everything in regards to jad pet.
|
||||
* @author Empathy
|
||||
*
|
||||
*/
|
||||
@Initializable
|
||||
public class TzRekJadNPC extends OptionHandler {
|
||||
|
||||
/**
|
||||
* The tzhaar mej id.
|
||||
*/
|
||||
private static final int TZHAAR_MEJ_ID = 2617;
|
||||
|
||||
/**
|
||||
* The firecape item.
|
||||
*/
|
||||
private static final Item FIRECAPE = new Item(6570);
|
||||
|
||||
/**
|
||||
* The tokkul item.
|
||||
*/
|
||||
private static final Item TOKKUL = new Item(6529);
|
||||
|
||||
/**
|
||||
* The jad item.
|
||||
*/
|
||||
private static final Item JAD_PET = new Item(14828);
|
||||
|
||||
@Override
|
||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
||||
NPCDefinition.forId(TZHAAR_MEJ_ID).getHandlers().put("option:exchange fire cape", this);
|
||||
ClassScanner.definePlugins(new TzhaarMejJalDialogue(), new TzRekJadDialogue());
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(Player player, Node node, String option) {
|
||||
switch (option) {
|
||||
case "exchange fire cape":
|
||||
player.getDialogueInterpreter().open(DialogueInterpreter.getDialogueKey(player.getInventory().containsItem(FIRECAPE) ? "firecape-exchange" : "tzhaar-mej"), node.asNpc());
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the TzhaarMejJal Dialogue to gamble for jad pet.
|
||||
* @author Empathy
|
||||
*
|
||||
*/
|
||||
public final class TzhaarMejJalDialogue extends DialoguePlugin {
|
||||
|
||||
/**
|
||||
* Constructs a new {@code TzhaarMejJalDialogue} {@code Object}.
|
||||
*/
|
||||
public TzhaarMejJalDialogue() {
|
||||
/**
|
||||
* empty.
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new {@code TzhaarMejJalDialogue} {@code Object}.
|
||||
*
|
||||
* @param player the player.
|
||||
*/
|
||||
public TzhaarMejJalDialogue(Player player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DialoguePlugin newInstance(Player player) {
|
||||
return new TzhaarMejJalDialogue(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
npc = (NPC) args[0];
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "I have a fire cape here.");
|
||||
stage = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(int interfaceId, int buttonId) {
|
||||
switch (stage) {
|
||||
case 0:
|
||||
interpreter.sendOptions("Sell your fire cape?", "Yes, sell it for 8,000 TokKul.", "No, keep it.", "Bargain for TzRek-Jad.");
|
||||
stage = 1;
|
||||
break;
|
||||
case 1:
|
||||
switch(buttonId) {
|
||||
case 1:
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, player.getInventory().containsItems(FIRECAPE) ? "Hand your cape here, young JalYte." : "You not have firecape, JalYt.");
|
||||
stage = 10;
|
||||
break;
|
||||
case 2:
|
||||
end();
|
||||
break;
|
||||
case 3:
|
||||
interpreter.sendOptions("Sacrifice your firecape?", "Yes, I know I won't get my cape back.", "No, I like my cape!");
|
||||
stage = 20;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
if (player.getInventory().containsItem(FIRECAPE)) {
|
||||
if (player.getInventory().remove(FIRECAPE)) {
|
||||
TOKKUL.setAmount(8000);
|
||||
player.getInventory().add(TOKKUL);
|
||||
TOKKUL.setAmount(1);
|
||||
}
|
||||
}
|
||||
end();
|
||||
break;
|
||||
case 20:
|
||||
switch (buttonId) {
|
||||
case 1:
|
||||
if (player.hasItem(JAD_PET)) {
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "Best you train one TzRek-Jad only.");
|
||||
stage = 21;
|
||||
break;
|
||||
}
|
||||
if (player.getFamiliarManager().hasFamiliar()) {
|
||||
if (player.getFamiliarManager().getFamiliar().getId() == 8650) {
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "Best you train one TzRek-Jad only.");
|
||||
stage = 21;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (player.getInventory().remove(FIRECAPE)) {
|
||||
int r = RandomFunction.getRandom(200);
|
||||
if (r == 1) {
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "You lucky. Better train him good else TzTok-Jad find", "you, JalYt.");
|
||||
if (!player.getFamiliarManager().hasFamiliar()) {
|
||||
player.getFamiliarManager().summon(JAD_PET, true);
|
||||
player.sendNotificationMessage("You have a funny feeling like you're being followed.");
|
||||
} else if (player.getInventory().freeSlots() > 0) {
|
||||
player.getInventory().add(JAD_PET);
|
||||
player.sendNotificationMessage("You feel something weird sneaking into your backpack.");
|
||||
}
|
||||
Repository.sendNews(player.getUsername() + " now commands a miniature TzTok-Jad!");
|
||||
} else {
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "You not lucky. Maybe next time, JalYt.");
|
||||
}
|
||||
}
|
||||
stage = 21;
|
||||
break;
|
||||
case 2:
|
||||
end();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 21:
|
||||
end();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIds() {
|
||||
return new int[] { DialogueInterpreter.getDialogueKey("firecape-exchange") };
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the TzRekJad dialogue.
|
||||
* @author Empathy
|
||||
*
|
||||
*/
|
||||
public final class TzRekJadDialogue extends DialoguePlugin {
|
||||
|
||||
/**
|
||||
* Constructs a new {@code TzRekJadDialogue} {@code Object}.
|
||||
*/
|
||||
public TzRekJadDialogue() {
|
||||
/**
|
||||
* empty.
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new {@code TzRekJadDialogue} {@code Object}.
|
||||
*
|
||||
* @param player the player.
|
||||
*/
|
||||
public TzRekJadDialogue(Player player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DialoguePlugin newInstance(Player player) {
|
||||
return new TzRekJadDialogue(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
npc = (NPC) args[0];
|
||||
int i = RandomFunction.getRandom(1);
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, i == 1 ? "Do you miss your people?" : "Are you hungry?");
|
||||
stage = (i == 1 ? 0 : 5);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(int interfaceId, int buttonId) {
|
||||
switch (stage) {
|
||||
case 0:
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "Mej-TzTok-Jad Kot-Kl!");
|
||||
stage = 1;
|
||||
break;
|
||||
case 1:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "No.. I don't think so.");
|
||||
stage = 2;
|
||||
break;
|
||||
case 2:
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "Jal-Zek Kl?");
|
||||
stage = 3;
|
||||
break;
|
||||
case 3:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "No, no, I wouldn't hurt you.");
|
||||
stage = 4;
|
||||
break;
|
||||
case 4:
|
||||
end();
|
||||
break;
|
||||
case 5:
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "Kl-Kra!");
|
||||
stage = 6;
|
||||
break;
|
||||
case 6:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Ooookay...");
|
||||
stage = 4;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIds() {
|
||||
return new int[] { 8650 };
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user