mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-10 10:20:41 -07:00
Adds 4 Varrock diary tasks and fixes Romily Weaklax pie task
This commit is contained in:
parent
8bdfc43fba
commit
ef7ed6ed12
3 changed files with 195 additions and 128 deletions
|
|
@ -78,14 +78,23 @@ public class RomilyWeaklaxDialogue extends DialoguePlugin {
|
|||
pieAmt = player.getAttribute(keyAmt, 0);
|
||||
pieReward = PieReward.forId(pieId);
|
||||
|
||||
// Check if wild pie was used on NPC or is in inventory; partial source here https://www.youtube.com/watch?v=FjlLZnDxofY
|
||||
boolean hasWildPie = false;
|
||||
|
||||
if (args.length > 1) {
|
||||
Item usedWith = (Item) args[1];
|
||||
if (usedWith.getId() == Items.WILD_PIE_7208) {
|
||||
npc("Is that a wild pie for me?"); // TODO not accurate dialogue, unfortunately offscreen in this video https://www.youtube.com/watch?v=FjlLZnDxofY
|
||||
hasWildPie = true;
|
||||
}
|
||||
} else if (player.getInventory().contains(Items.WILD_PIE_7208, 1)) {
|
||||
hasWildPie = true;
|
||||
}
|
||||
|
||||
if (hasWildPie) {
|
||||
npc("Hello and welcome to my pie shop. My word! That's a nice", "smelling pie you have. Is it for me?");
|
||||
stage = 100;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
npc("Hello and welcome to my pie shop, how can I help you?");
|
||||
if (pieId != 0 && pieAmt != 0) {
|
||||
|
|
@ -125,10 +134,9 @@ public class RomilyWeaklaxDialogue extends DialoguePlugin {
|
|||
break;
|
||||
case 2:
|
||||
options("I'd like to buy some pies.", "I've got those pies you wanted.", "I'm good thanks.");
|
||||
stage = 1;
|
||||
stage = 3;
|
||||
break;
|
||||
case 3:
|
||||
|
||||
switch (buttonId) {
|
||||
case 1:
|
||||
player("I'd like to buy some pies.");
|
||||
|
|
@ -153,7 +161,7 @@ public class RomilyWeaklaxDialogue extends DialoguePlugin {
|
|||
npc.openShop(player);
|
||||
break;
|
||||
case 20:
|
||||
npc("Actually I could, you see I'm running out of stock and I", "don't have tme to bake any more pies. would you be", "willing to bake me some pies? I'll pay you well for them.");
|
||||
npc("Actually I could, you see I'm running out of stock and I", "don't have time to bake any more pies. Would you be", "willing to bake me some pies? I'll pay you well for them.");
|
||||
stage = 21;
|
||||
break;
|
||||
case 21:
|
||||
|
|
@ -178,9 +186,12 @@ public class RomilyWeaklaxDialogue extends DialoguePlugin {
|
|||
break;
|
||||
case 50:
|
||||
final int piesInInventory = player.getInventory().getAmount(pieId);
|
||||
final int deficit = pieAmt - piesInInventory;
|
||||
final int piesNeeded = pieAmt; // How many he still needs
|
||||
final int piesToGive = Math.min(piesInInventory, piesNeeded); // Don't give more than needed
|
||||
final int deficit = piesNeeded - piesToGive;
|
||||
|
||||
if (piesInInventory == 0) {
|
||||
npc("Doesn't look like you have any of the", pieAmt + " " + new Item(pieId).getName() + "s I requested.");
|
||||
npc("Doesn't look like you have any of the", piesNeeded + " " + new Item(pieId).getName() + "s I requested.");
|
||||
stage = 999;
|
||||
break;
|
||||
} else if (deficit == 0) {
|
||||
|
|
@ -191,8 +202,8 @@ public class RomilyWeaklaxDialogue extends DialoguePlugin {
|
|||
npc("Thank you, if you could bring me the other " + deficit + " that'd", "be great!");
|
||||
player.setAttribute("/save:" + keyAmt, deficit);
|
||||
}
|
||||
player.getInventory().remove(new Item(pieId, piesInInventory));
|
||||
player.getInventory().add(new Item(995, pieReward.reward * piesInInventory));
|
||||
player.getInventory().remove(new Item(pieId, piesToGive)); // Only remove what we need
|
||||
player.getInventory().add(new Item(995, pieReward.reward * piesToGive)); // Only pay for what we took
|
||||
stage = 999;
|
||||
break;
|
||||
case 60:
|
||||
|
|
@ -205,16 +216,36 @@ public class RomilyWeaklaxDialogue extends DialoguePlugin {
|
|||
break;
|
||||
|
||||
case 100:
|
||||
player("Yes, it is.");
|
||||
options("Yes, it is.", "No, it's for...someone else.");
|
||||
stage++;
|
||||
break;
|
||||
case 101:
|
||||
switch (buttonId) {
|
||||
case 1:
|
||||
player("Yes, it is.");
|
||||
stage = 102;
|
||||
break;
|
||||
case 2:
|
||||
player("No, it's for...someone else.");
|
||||
stage = 103;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 102:
|
||||
npc("Oh, how splendid! Let me take that from you then.");
|
||||
player.getInventory().remove(new Item(Items.WILD_PIE_7208));
|
||||
player.getAchievementDiaryManager().finishTask(player, DiaryType.VARROCK, 2, 5);
|
||||
stage++;
|
||||
break;
|
||||
case 102:
|
||||
case 103:
|
||||
npc("Oh, I see. Was there something else you needed?");
|
||||
if (pieId != 0 && pieAmt != 0) {
|
||||
stage = 2;
|
||||
} else {
|
||||
stage = 0;
|
||||
}
|
||||
break;
|
||||
case 104:
|
||||
npc("Now, was there anything else you needed?");
|
||||
if (pieId != 0 && pieAmt != 0) {
|
||||
stage = 2;
|
||||
|
|
@ -246,9 +277,7 @@ public class RomilyWeaklaxDialogue extends DialoguePlugin {
|
|||
|
||||
@Override
|
||||
public boolean handle(NodeUsageEvent event) {
|
||||
if (!event.getPlayer().getAchievementDiaryManager().getDiary(DiaryType.VARROCK).isComplete(2,5)) {
|
||||
event.getPlayer().getDialogueInterpreter().open(3205, event.getUsedItem());
|
||||
}
|
||||
event.getPlayer().getDialogueInterpreter().open(3205, event.getUsedWith(), event.getUsedItem());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package content.region.misthalin.varrock.diary
|
|||
import content.global.skill.prayer.Bones
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.item.Item
|
||||
import core.game.node.entity.player.link.diary.DiaryType
|
||||
import core.game.world.map.zone.ZoneBorders
|
||||
import org.rs09.consts.Components
|
||||
|
|
@ -36,6 +37,14 @@ class VarrockAchivementDiary : DiaryEventHookBase(DiaryType.VARROCK) {
|
|||
NPCs.STRAY_DOG_5917, NPCs.STRAY_DOG_5918
|
||||
)
|
||||
|
||||
private val DIGSITE_PENDANTS = arrayOf(
|
||||
Items.DIGSITE_PENDANT_1_11190,
|
||||
Items.DIGSITE_PENDANT_2_11191,
|
||||
Items.DIGSITE_PENDANT_3_11192,
|
||||
Items.DIGSITE_PENDANT_4_11193,
|
||||
Items.DIGSITE_PENDANT_5_11194
|
||||
)
|
||||
|
||||
object EasyTasks {
|
||||
const val THESSALIA_BROWSE_CLOTHES = 0
|
||||
const val AUBURY_TELEPORT_ESSENCE_MINE = 1
|
||||
|
|
@ -168,6 +177,13 @@ class VarrockAchivementDiary : DiaryEventHookBase(DiaryType.VARROCK) {
|
|||
EasyTasks.AUBURY_TELEPORT_ESSENCE_MINE
|
||||
)
|
||||
}
|
||||
is Item -> if (event.source.id in DIGSITE_PENDANTS) {
|
||||
finishTask(
|
||||
player,
|
||||
DiaryLevel.MEDIUM,
|
||||
MediumTasks.DIGSITE_PENDANT_TELEPORT
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -229,6 +245,21 @@ class VarrockAchivementDiary : DiaryEventHookBase(DiaryType.VARROCK) {
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
13109 -> {
|
||||
// Fancy Dress Shop - buying spottier cape with furs
|
||||
if (event.iface == 477 && event.buttonId == 26) {
|
||||
// Verify they have the required items to make the purchase
|
||||
if (player.inventory.contains(Items.DASHING_KEBBIT_FUR_10127, 2) &&
|
||||
player.inventory.contains(Items.COINS_995, 800)) {
|
||||
finishTask(
|
||||
player,
|
||||
DiaryLevel.HARD,
|
||||
HardTasks.FANCY_DRESS_SELLER_TRADE_FURS
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ package content.region.misthalin.varrock.quest.familycrest
|
|||
import core.api.*
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.player.link.diary.DiaryType
|
||||
import core.plugin.Initializable
|
||||
import org.rs09.consts.Items
|
||||
import content.data.Quests
|
||||
|
|
@ -11,9 +12,9 @@ import content.data.Quests
|
|||
|
||||
@Initializable
|
||||
/**
|
||||
* Handles DimintheisDialogue Dialogue
|
||||
* @author Plex
|
||||
*/
|
||||
* Handles DimintheisDialogue Dialogue
|
||||
* @author Plex
|
||||
*/
|
||||
class DimintheisDialogue(player: Player? = null): core.game.dialogue.DialoguePlugin(player) {
|
||||
override fun newInstance(player: Player?): core.game.dialogue.DialoguePlugin {
|
||||
return DimintheisDialogue(player)
|
||||
|
|
@ -173,6 +174,12 @@ class DimintheisDialogue(player: Player? = null): core.game.dialogue.DialoguePlu
|
|||
6000 -> npc("Not to worry, here they are").also {
|
||||
stage = 1000
|
||||
addItem(player, getAttribute(player, "family-crest:gauntlets", Items.FAMILY_GAUNTLETS_778))
|
||||
player.achievementDiaryManager.finishTask(
|
||||
player,
|
||||
core.game.node.entity.player.link.diary.DiaryType.VARROCK,
|
||||
2, // Hard tier (0=Easy, 1=Medium, 2=Hard)
|
||||
9 // HardTasks.OBTAIN_NEW_SET_OF_FAMILY_CREST_GAUNTLETS
|
||||
)
|
||||
}
|
||||
|
||||
1000 -> end()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue