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:
Danewolf
2023-08-07 03:26:55 +00:00
committed by Ryan
parent dd6909908c
commit d14b2c7d09
2 changed files with 45 additions and 1 deletions
@@ -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
}
}
}
@@ -1,15 +1,21 @@
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.node.entity.npc.NPC;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.quest.Quest;
import core.game.node.item.Item;
import core.game.system.task.Pulse;
import core.game.world.GameWorld;
import core.game.world.map.Location;
import core.game.world.update.flag.context.Animation;
import org.rs09.consts.Items;
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.
@@ -475,6 +481,9 @@ public class SirPyrsinDialogue extends DialoguePlugin {
private final void handleDefault(int buttonId) {
switch (stage) {
case 0:
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;
break;
@@ -488,6 +497,9 @@ public class SirPyrsinDialogue extends DialoguePlugin {
player("I'm not sure, I was hoping you could tell me.");
stage = 20;
break;
case 3:
npc("I can sell you another one for 500GP");
stage = 30;
}
break;
case 10:
@@ -504,6 +516,18 @@ public class SirPyrsinDialogue extends DialoguePlugin {
case 21:
end();
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;
}
}