Implemented the varrock teleport destination swap reward for easy diary completion

Fixed the bug with accessing ned's achievement dialogue while one of his quests was in progress
This commit is contained in:
Ceikry
2022-04-18 07:55:42 +00:00
committed by Ryan
parent 1b9e330f68
commit e9c23a845b
9 changed files with 292 additions and 286 deletions
@@ -14,6 +14,7 @@ import core.plugin.PluginManifest;
import core.plugin.PluginType; import core.plugin.PluginType;
import rs09.game.content.dialogue.DialogueFile; import rs09.game.content.dialogue.DialogueFile;
import rs09.game.content.dialogue.EmptyPlugin; import rs09.game.content.dialogue.EmptyPlugin;
import rs09.game.content.dialogue.Topic;
import rs09.game.system.SystemLogger; import rs09.game.system.SystemLogger;
import rs09.game.system.config.ItemConfigParser; import rs09.game.system.config.ItemConfigParser;
@@ -31,6 +32,7 @@ import static rs09.tools.DialogueConstKt.END_DIALOGUE;
*/ */
@PluginManifest(type = PluginType.DIALOGUE) @PluginManifest(type = PluginType.DIALOGUE)
public final class DialogueInterpreter { public final class DialogueInterpreter {
public ArrayList<Topic<?>> activeTopics = new ArrayList<>();
/** /**
* The dialogue plugins. * The dialogue plugins.
@@ -136,7 +138,23 @@ public final class DialogueInterpreter {
close(); close();
return; return;
} }
if(player.getDialogueInterpreter().getDialogue().file != null){ DialogueFile file = dialogue.file;
if (!activeTopics.isEmpty()) {
Topic<?> topic = activeTopics.get(buttonId - 2);
sendDialogues(player, topic.getExpr(), topic.getText());
if(topic.getToStage() instanceof DialogueFile) {
DialogueFile topicFile = (DialogueFile) topic.getToStage();
dialogue.loadFile(topicFile);
} else if(topic.getToStage() instanceof Integer) {
int stage = (Integer) topic.getToStage();
if (file == null) dialogue.stage = stage;
else file.setStage(stage);
}
activeTopics.clear();
return;
}
if(file != null){
player.getDialogueInterpreter().getDialogue().file.handle(componentId,buttonId - 1); player.getDialogueInterpreter().getDialogue().file.handle(componentId,buttonId - 1);
return; return;
} }
@@ -160,6 +178,7 @@ public final class DialogueInterpreter {
d.close(); d.close();
} }
} }
activeTopics.clear();
return dialogue == null; return dialogue == null;
} }
@@ -8,6 +8,8 @@ import core.plugin.Plugin;
import core.plugin.PluginManifest; import core.plugin.PluginManifest;
import core.plugin.PluginType; import core.plugin.PluginType;
import rs09.game.content.dialogue.DialogueFile; import rs09.game.content.dialogue.DialogueFile;
import rs09.game.content.dialogue.IfTopic;
import rs09.game.content.dialogue.Topic;
import java.util.ArrayList; import java.util.ArrayList;
@@ -331,4 +333,14 @@ public abstract class DialoguePlugin implements Plugin<Player> {
return player(expr, splitLines(msg)); return player(expr, splitLines(msg));
} }
public void showTopics(Topic<?>... topics) {
ArrayList<String> validTopics = new ArrayList<>();
for(Topic<?> topic : topics)
{
if(topic instanceof IfTopic && !((IfTopic<?>) topic).getShowCondition()) continue;
interpreter.activeTopics.add(topic);
validTopics.add(topic.getText());
}
options(validTopics.toArray(new String[0]));
}
} }
@@ -7,6 +7,7 @@ import core.game.node.entity.player.link.diary.AchievementDiary;
import core.game.node.entity.player.link.diary.DiaryType; import core.game.node.entity.player.link.diary.DiaryType;
import core.game.node.entity.player.link.quest.Quest; import core.game.node.entity.player.link.quest.Quest;
import core.game.node.item.Item; import core.game.node.item.Item;
import rs09.game.node.entity.player.link.diary.dialogues.RatBurgissDiaryDialogue;
/** /**
* The rat burgiss dialogue. * The rat burgiss dialogue.
@@ -66,126 +67,6 @@ public class RatBurgissDialogue extends DialoguePlugin {
@Override @Override
public boolean handle(int interfaceId, int buttonId) { public boolean handle(int interfaceId, int buttonId) {
if (isDiary) {
// https://www.youtube.com/watch?v=j-wvq79hUgU&t=309s
switch (stage) {
case 999:
end();
break;
case -1:
// when available, "Can I change my Varrock teleport point?" is option 2
options("What is the Achievement Diary?", "What are the rewards?", "How do I claim the rewards?", "See you later.");
stage++;
break;
case 0:
if (diary == null) {
diary = player.getAchievementDiaryManager().getDiary(DiaryType.VARROCK);
}
switch (buttonId) {
case 1:
player("What is the Achievement Diary?");
stage = 410;
break;
case 2:
player("What are the rewards?");
stage = 420;
break;
case 3:
player("How do I claim the rewards?");
stage = 430;
break;
case 4:
player("See you later.");
stage = 999;
break;
}
break;
case 440:
npc("You have? Excellent! Well done.");
stage++;
break;
case 441:
player("Thank you. Uh... can I have the reward?");
stage++;
break;
case 442:
npc("Reward? Ah yes! Of course. Your reward, it's right", "here.");
stage = 444;
break;
case 444:
diary.setLevelRewarded(level);
for (Item i : diary.getType().getRewards(level)) {
player.getInventory().add(i, player);
}
npc("Now, this body armour is magically enhanced to help", "you with your Smithing and Mining. There is a", "furnace, not far from here, in Edgeville. Use this", "armour there and, when smelting ores up to and");
stage++;
break;
case 445:
npc("including steel, you will have a chance of making an", "extra bar every time. Also, when you mine with this", "armour on, you will have a chance of Mining extra", "ores from rocks up to and including coal.");
stage++;
break;
case 446:
npc("Bear in mind that you will need to be wearing the", "armour for either of these to work. I will speak to the", "shopkeepers around Varrock who sell armour and", "weapons to get you better prices when you are wearing");
stage++;
break;
case 447:
npc("the Varrock armour.");
stage = 449;
break;
case 449:
npc("I can also change your Varrock Teleport spell so that it", "takes you to the Grand Exchange, if you'd find that more convenient.");
stage++;
break;
case 450:
npc("As an extra reward, you can also have this old magical", "lamp to help you with your skills. I was going to use it", "myself, but I don't really need it.");
stage++;
break;
case 451:
player("Wow, thanks!");
stage++;
break;
case 452:
npc("If you should lose this armour, come back and see me", "for another set.");
stage = -1;
break;
case 460:
player.getInventory().add(diary.getType().getRewards(level)[0], player);
npc("You better be more careful this time.");
stage = 999;
break;
case 410:
npc("It's a diary that helps you keep track of particular", "achievements. Here in Varrock it can help you", "discover some quite useful things. Eventually, with", "enough exploration, the people of Varrock will reward");
stage++;
break;
case 411:
npc("you.");
stage++;
break;
case 412:
npc("You can see what tasks you have listed by clicking on", "the green button in the Quest List.");
stage = 999;
break;
case 420:
npc("Well, there's three different levels of Varrock Armour,", "which match up with the three levels of difficulty. Each", "has the same rewards as the previous level, and an", "additional one too... but I won't spoil your surprise.");
stage++;
break;
case 421:
npc("Rest assured, the people of Varrock are happy to see", "you visiting the land.");
stage = 999;
break;
case 430:
npc("Just complete the tasks so they're all ticked off, then", "you can claim your reward. Most of them are", "straightforward; you might find some require quests to", "be started, if not finished.");
stage++;
break;
case 431:
npc("To claim the different Varrock Armour, speak to Vannaka", "Reldo, and myself.");
stage = 999;
break;
}
return true;
}
if (stage == -1) { if (stage == -1) {
switch (buttonId) { switch (buttonId) {
case 1: case 1:
@@ -194,7 +75,7 @@ public class RatBurgissDialogue extends DialoguePlugin {
break; break;
case 2: case 2:
player("I have a question about my Achievement Diary."); player("I have a question about my Achievement Diary.");
stage = 900; loadFile(new RatBurgissDiaryDialogue());
break; break;
} }
return true; return true;
@@ -134,4 +134,12 @@ abstract class DialogueFile {
player?.dialogueInterpreter?.sendDialogue(*messages) player?.dialogueInterpreter?.sendDialogue(*messages)
} }
fun showTopics(vararg topics: Topic<*>) {
val validTopics = ArrayList<String>()
topics.filter { if(it is IfTopic) it.showCondition else true }.forEach {
topic -> interpreter!!.activeTopics.add(topic)
validTopics.add(topic.text)
}
options(*validTopics.toTypedArray())
}
} }
@@ -0,0 +1,14 @@
package rs09.game.content.dialogue
import core.game.content.dialogue.FacialExpression
/**
* Topic/IfTopic system backported from my personal project
* @author Ceikry
*/
open class Topic<T>(val expr: FacialExpression, val text: String, val toStage: T) {
constructor(text: String, toStage: T) : this(FacialExpression.ASKING, text, toStage)
}
class IfTopic<T>(expr: FacialExpression, text: String, toStage: T, val showCondition: Boolean) : Topic<T>(expr, text, toStage) {
constructor(text: String, toStage: T, showCondition: Boolean) : this(FacialExpression.ASKING, text, toStage, showCondition)
}
@@ -7,7 +7,10 @@ import core.game.node.entity.player.link.diary.AchievementDiary
import core.game.node.entity.player.link.diary.DiaryType import core.game.node.entity.player.link.diary.DiaryType
import core.game.node.item.GroundItemManager import core.game.node.item.GroundItemManager
import core.game.node.item.Item import core.game.node.item.Item
import rs09.game.content.dialogue.IfTopic
import rs09.game.content.dialogue.Topic
import rs09.game.content.quest.free.princealirescue.NedPARDialogue import rs09.game.content.quest.free.princealirescue.NedPARDialogue
import rs09.game.node.entity.player.link.diary.dialogues.NedDiaryDialogue
import rs09.game.world.GameWorld.settings import rs09.game.world.GameWorld.settings
import rs09.tools.DIALOGUE_INITIAL_OPTIONS_HANDLE import rs09.tools.DIALOGUE_INITIAL_OPTIONS_HANDLE
import rs09.tools.END_DIALOGUE import rs09.tools.END_DIALOGUE
@@ -30,60 +33,28 @@ class NedDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun open(vararg args: Any): Boolean { override fun open(vararg args: Any): Boolean {
npc = args[0] as NPC npc = args[0] as NPC
val dSlayerStage = player.questRepository.getStage("Dragon Slayer") npc(
val parStage = player.questRepository.getStage("Prince Ali Rescue") "Why, hello there, lad. Me friends call me Ned. I was a",
"man of the sea, but it's past me now. Could I be",
if (dSlayerStage == 20 || dSlayerStage == 30) { "making or selling you some rope?"
addOption("Dragon Slayer", NedDSDialogue(dSlayerStage)) )
}
if (parStage == 20 || parStage == 30 || parStage == 40 || parStage == 50) {
addOption("Prince Ali Rescue", NedPARDialogue(parStage))
}
if (!sendChoices()) {
npc(
"Why, hello there, lad. Me friends call me Ned. I was a",
"man of the sea, but it's past me now. Could I be",
"making or selling you some rope?"
)
}
return true return true
} }
override fun handle(interfaceId: Int, buttonId: Int): Boolean { override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) { when (stage) {
DIALOGUE_INITIAL_OPTIONS_HANDLE -> {
npc(
"Why, hello there, lad. Me friends call me Ned. I was a",
"man of the sea, but it's past me now. Could I be",
"making or selling you some rope?"
)
loadFile(optionFiles[buttonId - 1])
}
0 -> { 0 -> {
options( val dSlayerStage = player.questRepository.getStage("Dragon Slayer")
"Yes, I would like some rope.", val parStage = player.questRepository.getStage("Prince Ali Rescue")
"No thanks Ned, I don't need any.", showTopics(
"Ask about Achievement Diaries" IfTopic("I'd like to talk about Dragon Slayer.", NedDSDialogue(dSlayerStage), dSlayerStage == 20 || dSlayerStage == 30),
IfTopic("I'd like to talk about Prince Ali Rescue.", NedPARDialogue(parStage), parStage == 20 || parStage == 30 || parStage == 40 || parStage == 50),
Topic("Yes, I would like some rope.", 10),
Topic("No thanks Ned, I don't need any.", END_DIALOGUE),
Topic("I'd like to ask about my Achievement Diary.", NedDiaryDialogue())
) )
stage = 1
}
1 -> when (buttonId) {
1 -> {
player("Yes, I would like some rope.")
stage = 10
}
2 -> {
player("No thanks Ned, I don't need any.")
stage = END_DIALOGUE
}
3 -> {
player("I'd like to talk about Achievement Diaries.")
stage = 900
}
} }
10 -> { 10 -> {
npc( npc(
"Well, I can sell you some rope for 15 coins. Or I can", "Well, I can sell you some rope for 15 coins. Or I can",
@@ -218,123 +189,6 @@ class NedDialogue(player: Player? = null) : DialoguePlugin(player) {
stage = 21 stage = 21
} }
21 -> end() 21 -> end()
900 -> {
if (diary == null) {
diary = player.achievementDiaryManager.getDiary(DiaryType.LUMBRIDGE)
}
if (diary!!.isComplete(level, true) && !diary!!.isLevelRewarded(level)) {
player("I've done all the medium tasks in my Lumbridge", "Achievement Diary.")
stage = 950
}
else if (diary!!.isLevelRewarded(level) && diary!!.isComplete(level, true) && !player.hasItem(diary!!.type.getRewards(level)[0])) {
player("I've seemed to have lost my explorer's ring...")
stage = 960
}
else {
options(
"What is the Achievement Diary?",
"What are the rewards?",
"How do I claim the rewards?",
"See you later."
)
stage = 901
}
}
901 -> when (buttonId) {
1 -> {
player("What is the Achievement Diary?")
stage = 910
}
2 -> {
player("What are the rewards?")
stage = 920
}
3 -> {
player("How do I claim the rewards?")
stage = 930
}
4 -> {
player("See you later!")
stage = 940
}
}
910 -> {
npc(
"Ah, well it's a diary that helps you keep track of",
"particular achievements you've made in the world of",
"2009Scape. In Lumbridge and Draynor i can help you",
"discover some very useful things indeed."
)
stage++
}
911 -> {
npc("Eventually with enough exploration you will be", "rewarded for your explorative efforts.")
stage++
}
912 -> {
npc(
"You can access your Achievement Diary by going to",
"the Quest Journal. When you've opened the Quest",
"Journal click on the green star icon on the top right",
"hand corner. This will open the diary."
)
stage = 900
}
920 -> {
npc(
"Ah, well there are different rewards for each",
"Achievement Diary. For completing the Lumbridge and",
"Draynor diary you are presented with an explorer's",
"ring."
)
stage++
}
921 -> {
npc("This ring will become increasingly useful with each", "section of the diary that you complete.")
stage = 900
}
930 -> {
npc(
"You need to complete the task so that they're all ticked",
"off then you can claim your reward. Most of them are",
"straightforward although you might find some required",
"quests to be started, if not finished."
)
stage++
}
931 -> {
npc(
"To claim the explorer's ring speak to Explorer Jack in ",
"Lumbridge, Bob in Bob's Axes in Lumbridge, or myself."
)
stage = 900
}
940 -> end()
950 -> {
npc("Yes I see that, you'll be wanting your", "reward then I assume?")
stage++
}
951 -> {
player("Yes please.")
stage++
}
952 -> {
diary!!.setLevelRewarded(level)
for (i in diary!!.type.getRewards(level)) {
player.inventory.add(i, player)
}
npc("This ring is a representation of the adventures you", "went on to complete your tasks.")
stage++
}
953 -> {
player("Wow, thanks!")
stage = 900
}
960 -> {
player.inventory.add(diary!!.type.getRewards(level)[0], player)
npc("You better be more careful this time.")
stage = 900
}
} }
return true return true
} }
@@ -0,0 +1,127 @@
package rs09.game.node.entity.player.link.diary.dialogues
import core.game.node.entity.player.link.diary.DiaryType
import rs09.game.content.dialogue.DialogueFile
class NedDiaryDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
val diary = player!!.achievementDiaryManager.getDiary(DiaryType.LUMBRIDGE)
val level = 2
when(stage) {
0 -> {
if (diary.isComplete(level, true) && !diary.isLevelRewarded(level)) {
player("I've done all the medium tasks in my Lumbridge", "Achievement Diary.")
stage = 50
}
else if (diary.isLevelRewarded(level) && diary.isComplete(level, true) && !player!!.hasItem(diary.type.getRewards(level)[0])) {
player("I've seemed to have lost my explorer's ring...")
stage = 60
}
else {
options(
"What is the Achievement Diary?",
"What are the rewards?",
"How do I claim the rewards?",
"See you later."
)
stage = 1
}
}
1 -> when (buttonID) {
1 -> {
player("What is the Achievement Diary?")
stage = 10
}
2 -> {
player("What are the rewards?")
stage = 20
}
3 -> {
player("How do I claim the rewards?")
stage = 30
}
4 -> {
player("See you later!")
stage = 40
}
}
10 -> {
npc(
"Ah, well it's a diary that helps you keep track of",
"particular achievements you've made in the world of",
"2009Scape. In Lumbridge and Draynor i can help you",
"discover some very useful things indeed."
)
stage++
}
11 -> {
npc("Eventually with enough exploration you will be", "rewarded for your explorative efforts.")
stage++
}
12 -> {
npc(
"You can access your Achievement Diary by going to",
"the Quest Journal. When you've opened the Quest",
"Journal click on the green star icon on the top right",
"hand corner. This will open the diary."
)
stage = 0
}
20 -> {
npc(
"Ah, well there are different rewards for each",
"Achievement Diary. For completing the Lumbridge and",
"Draynor diary you are presented with an explorer's",
"ring."
)
stage++
}
21 -> {
npc("This ring will become increasingly useful with each", "section of the diary that you complete.")
stage = 0
}
30 -> {
npc(
"You need to complete the task so that they're all ticked",
"off then you can claim your reward. Most of them are",
"straightforward although you might find some required",
"quests to be started, if not finished."
)
stage++
}
31 -> {
npc(
"To claim the explorer's ring speak to Explorer Jack in ",
"Lumbridge, Bob in Bob's Axes in Lumbridge, or myself."
)
stage = 0
}
40 -> end()
50 -> {
npc("Yes I see that, you'll be wanting your", "reward then I assume?")
stage++
}
51 -> {
player("Yes please.")
stage++
}
52 -> {
diary.setLevelRewarded(level)
for (i in diary.type.getRewards(level)) {
player!!.inventory.add(i, player)
}
npc("This ring is a representation of the adventures you", "went on to complete your tasks.")
stage++
}
53 -> {
player("Wow, thanks!")
stage = 0
}
60 -> {
player!!.inventory.add(diary.type.getRewards(level)[0], player)
npc("You better be more careful this time.")
stage = 0
}
}
}
}
@@ -0,0 +1,88 @@
package rs09.game.node.entity.player.link.diary.dialogues
import api.addItemOrDrop
import api.getAttribute
import api.setAttribute
import core.game.content.dialogue.FacialExpression
import core.game.node.entity.player.link.diary.DiaryType
import rs09.game.content.dialogue.DialogueFile
import rs09.game.content.dialogue.IfTopic
import rs09.game.content.dialogue.Topic
import rs09.tools.END_DIALOGUE
class RatBurgissDiaryDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
val diary = player!!.achievementDiaryManager.getDiary(DiaryType.VARROCK)
val easyDiaryComplete = diary.isComplete(0)
val alternateTeleport = getAttribute(player!!, "diaries:varrock:alttele", false)
when(stage) {
0 -> {
if (easyDiaryComplete && !diary.isLevelRewarded(0)) {
playerl(FacialExpression.FRIENDLY, "I think I've finished all of the tasks in my Varrock Achievement Diary.")
stage = 40
return
}
else if (diary.isLevelRewarded(0) && !player!!.hasItem(diary.type.getRewards(0)[0])) {
playerl(FacialExpression.ANNOYED, "I seem to have lost my armor.")
stage = 50
return
}
showTopics(
Topic("What is the Achievement Diary?", 10),
IfTopic("Can I change my Varrock Teleport point?", 100, easyDiaryComplete),
Topic("What are the rewards?", 20),
Topic("How do I claim the rewards?", 30),
Topic(FacialExpression.NEUTRAL, "See you later.", END_DIALOGUE)
)
}
10 -> npcl(FacialExpression.FRIENDLY, "It's a diary that helps you keep track of particular achievements. Here in Varrock it can help you discover some quite useful things. Eventually, with enough exploration, the people of Varrock will reward").also { stage++ }
11 -> npcl(FacialExpression.FRIENDLY, "you. You can see what tasks you have listed by clicking on the green button in the Quest List.").also { stage = 0 }
20 -> npcl(FacialExpression.FRIENDLY, "Well, there's three different levels of Varrock Armour, which match up with the three levels of difficulty. Each has the same rewards as the previous level, and an additional one too... but I").also { stage++ }
21 -> npcl(FacialExpression.FRIENDLY, "won't spoil your surprise. Rest assured, the people of Varrock are happy to see you visiting the land.").also { stage = 0 }
30 -> npcl(FacialExpression.FRIENDLY, "Just complete the tasks so they're all ticked off, then you can claim your reward. Most of them are straightforward; you might find some require quests to be started, if not finished.").also { stage++ }
31 -> npcl(FacialExpression.FRIENDLY, "To claim the different Varrock Armour, speak to Vannaka, Reldo, and myself.").also { stage = 0 }
40 -> npcl(FacialExpression.FRIENDLY, "You have? Excellent! Well done.").also { stage++ }
41 -> playerl(FacialExpression.FRIENDLY, "Thank you. Uh... can I have the reward?").also { stage++ }
42 -> npcl(FacialExpression.FRIENDLY, "Reward? Ah yes! Of course. Your reward, it's right here.").also { stage++ }
43 -> {
diary.setLevelRewarded(0)
diary.type.getRewards(0).forEach { addItemOrDrop(player!!, it.id, it.amount) }
npcl(FacialExpression.FRIENDLY, "Now, this body armour is magically enhanced to help you with your Smithing and Mining. There is a furnace, not far from here, in Edgeville. Use this armour there and, when smelting ores up to and")
stage++
}
44 -> npcl(FacialExpression.FRIENDLY, "including steel, you will have a chance of making an extra bar every time. Also, when you mine with this armour on, you will have a chance of Mining extra ores from rocks up to and including coal.").also { stage++ }
45 -> npcl(FacialExpression.FRIENDLY, "Bear in mind that you will need to be wearing the armour for either of these to work. I will speak to the shopkeepers around Varrock who sell armour and weapons to get you better prices when you are").also { stage++ }
46 -> npcl(FacialExpression.FRIENDLY, "wearing it. I can also change your Varrock Teleport spell so that it takes you to the Grand Exchange, if you'd find that more convenient.").also { stage++ }
47 -> npcl(FacialExpression.FRIENDLY, "As an extra reward, you can also have this old magical lamp to help you with your skills. I was going to use it myself, but I don't really need it.").also { stage++ }
48 -> playerl(FacialExpression.FRIENDLY, "Wow, thanks!").also { stage++ }
49 -> npcl(FacialExpression.FRIENDLY, "If you should lose this armour, come back and see me for another set.").also { stage = 0 }
50 -> {
addItemOrDrop(player!!, diary.type.getRewards(0)[0].id, 1)
npcl(FacialExpression.ANNOYED, "You better be more careful this time.").also { stage = END_DIALOGUE }
}
100 -> showTopics(
IfTopic("I'd like to teleport to the Grand Exchange.", 101, easyDiaryComplete && !alternateTeleport),
IfTopic("I'd like to teleport to the city square.", 102, easyDiaryComplete && alternateTeleport),
Topic("Nevermind.", END_DIALOGUE)
)
101 -> {
npcl(FacialExpression.FRIENDLY, "There you are, your Varrock teleport will now take you to the Grand Exchange.")
setAttribute(player!!, "/save:diaries:varrock:alttele", true)
stage = 0
}
102 -> {
npcl(FacialExpression.FRIENDLY, "There you are, your Varrock teleport will now take you to the city square.")
setAttribute(player!!, "/save:diaries:varrock:alttele", false)
stage = 0
}
}
}
}
@@ -1,5 +1,6 @@
package rs09.game.node.entity.skill.magic package rs09.game.node.entity.skill.magic
import api.getAttribute
import core.game.content.activity.mta.impl.GraveyardZone import core.game.content.activity.mta.impl.GraveyardZone
import core.game.content.global.Bones import core.game.content.global.Bones
import core.game.node.entity.Entity import core.game.node.entity.Entity
@@ -62,7 +63,9 @@ class ModernListeners : SpellListener("modern"){
onCast(Modern.VARROCK_TELEPORT,NONE){player, _-> onCast(Modern.VARROCK_TELEPORT,NONE){player, _->
requires(player,25, arrayOf(Item(Items.FIRE_RUNE_554),Item(Items.AIR_RUNE_556,3),Item(Items.LAW_RUNE_563))) requires(player,25, arrayOf(Item(Items.FIRE_RUNE_554),Item(Items.AIR_RUNE_556,3),Item(Items.LAW_RUNE_563)))
player.achievementDiaryManager.finishTask(player, DiaryType.VARROCK,1, 13) player.achievementDiaryManager.finishTask(player, DiaryType.VARROCK,1, 13)
sendTeleport(player,35.0,Location.create(3213, 3424, 0)) val alternateTeleport = getAttribute(player, "diaries:varrock:alttele", false)
val dest = if(alternateTeleport) Location.create(3165, 3472, 0) else Location.create(3213, 3424, 0)
sendTeleport(player,35.0, dest)
} }
onCast(Modern.LUMBRIDGE_TELEPORT,NONE){player,_ -> onCast(Modern.LUMBRIDGE_TELEPORT,NONE){player,_ ->