Made it possible to get multiple Silverlights after completing Demon Slayer
Made it possible to craft Darklight with black ink after completing The Golem quest
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
package content.region.desert.quest.shadowofthestorm
|
||||||
|
|
||||||
|
import core.api.addItem
|
||||||
|
import core.api.hasRequirement
|
||||||
|
import core.api.removeItem
|
||||||
|
import core.game.interaction.IntType
|
||||||
|
import core.game.interaction.InteractionListener
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
|
||||||
|
class DarklightListener : InteractionListener {
|
||||||
|
override fun defineListeners() {
|
||||||
|
onUseWith(IntType.ITEM, Items.BLACK_MUSHROOM_INK_4622, Items.SILVERLIGHT_2402) { player, used, with ->
|
||||||
|
if (!hasRequirement(player, "Shadow of the Storm") || (!player.inventory.contains(Items.BLACK_MUSHROOM_INK_4622, 1) && (!player.inventory.contains(Items.SILVERLIGHT_2402, 1))))
|
||||||
|
return@onUseWith false
|
||||||
|
if (removeItem(player, used.id) && removeItem(player, with.id))
|
||||||
|
addItem(player, Items.DARKLIGHT_6746)
|
||||||
|
return@onUseWith true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+25
-1
@@ -1,15 +1,21 @@
|
|||||||
package content.region.misthalin.varrock.quest.demonslayer;
|
package content.region.misthalin.varrock.quest.demonslayer;
|
||||||
|
|
||||||
|
import content.region.misthalin.draynor.handlers.DraynorNodePlugin;
|
||||||
|
import core.api.Container;
|
||||||
import core.game.dialogue.DialoguePlugin;
|
import core.game.dialogue.DialoguePlugin;
|
||||||
import core.game.node.entity.npc.NPC;
|
import core.game.node.entity.npc.NPC;
|
||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
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.system.task.Pulse;
|
import core.game.system.task.Pulse;
|
||||||
import core.game.world.GameWorld;
|
import core.game.world.GameWorld;
|
||||||
import core.game.world.map.Location;
|
import core.game.world.map.Location;
|
||||||
import core.game.world.update.flag.context.Animation;
|
import core.game.world.update.flag.context.Animation;
|
||||||
|
import org.rs09.consts.Items;
|
||||||
|
|
||||||
import static core.api.ContentAPIKt.*;
|
import static core.api.ContentAPIKt.*;
|
||||||
|
import static core.tools.DialogueConstKt.END_DIALOGUE;
|
||||||
|
import static core.tools.GlobalsKt.colorize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the dialogue which handles the Sir Prysin NPC.
|
* Represents the dialogue which handles the Sir Prysin NPC.
|
||||||
@@ -475,7 +481,10 @@ public class SirPyrsinDialogue extends DialoguePlugin {
|
|||||||
private final void handleDefault(int buttonId) {
|
private final void handleDefault(int buttonId) {
|
||||||
switch (stage) {
|
switch (stage) {
|
||||||
case 0:
|
case 0:
|
||||||
options("I am a mighty adventurer. Who are you?", "I'm not sure, I was hoping you could tell me.");
|
if(getQuestStage(player, "Demon Slayer") == 100)
|
||||||
|
options("I am a mighty adventurer. Who are you?", "I'm not sure, I was hoping you could tell me.", "Hey can you give me another Silverlight");
|
||||||
|
else
|
||||||
|
options("I am a mighty adventurer. Who are you?", "I'm not sure, I was hoping you could tell me.");
|
||||||
stage = 1;
|
stage = 1;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
@@ -488,6 +497,9 @@ public class SirPyrsinDialogue extends DialoguePlugin {
|
|||||||
player("I'm not sure, I was hoping you could tell me.");
|
player("I'm not sure, I was hoping you could tell me.");
|
||||||
stage = 20;
|
stage = 20;
|
||||||
break;
|
break;
|
||||||
|
case 3:
|
||||||
|
npc("I can sell you another one for 500GP");
|
||||||
|
stage = 30;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
@@ -504,6 +516,18 @@ public class SirPyrsinDialogue extends DialoguePlugin {
|
|||||||
case 21:
|
case 21:
|
||||||
end();
|
end();
|
||||||
break;
|
break;
|
||||||
|
case 30:
|
||||||
|
if(inInventory(player, Items.COINS_995, 500)) {
|
||||||
|
if(removeItem(player, new Item(Items.COINS_995, 500), Container.INVENTORY)) {
|
||||||
|
addItem(player, Items.SILVERLIGHT_2402, 1, Container.INVENTORY);
|
||||||
|
sendItemDialogue(player, Items.SILVERLIGHT_2402, "Sir Prysin gives you another Silverlight");
|
||||||
|
stage = END_DIALOGUE;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
npc(id, "Come back when you have 500GP to buy another one.");
|
||||||
|
stage = END_DIALOGUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user