Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
3559ab4d2f | |||
![]() |
3a0db52215 | ||
![]() |
a895a09822 | ||
![]() |
265f93fff3 | ||
954f0c9319 | |||
![]() |
4edcccee71 | ||
![]() |
dd256b9fde | ||
![]() |
7312753e35 | ||
![]() |
3eb18586e4 | ||
![]() |
268a15c788 | ||
![]() |
9139e39397 | ||
![]() |
f94c4aec2e | ||
c7db36d9b6 |
@ -43,5 +43,5 @@ I would strongly recommend contributing code to the [2009Scape project](https://
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Like 2009Scape, this is AGPLv3. This is, in my opinion, the only proper license for an open source RSPS. The key term of the license being if you wish to use this code, you must also offer the source code for people to inspect and use! (eg no private, for profit RSPS).
|
Like 2009Scape, this is AGPLv3. This is, in my opinion, the only proper license for an open source RSPS. The key term of the license being if you wish to use this code to host your own server, you must also offer the source code for people to inspect and use, and allow them to make modifications to it as I did with 2009Scape's code.
|
||||||
|
|
||||||
|
@ -46,23 +46,23 @@ enum class RandomEvents(val npc: RandomEventNPC, val loot: WeightBasedTable? = n
|
|||||||
WeightedItem(Items.TOOTH_HALF_OF_A_KEY_985,1,1,0.1),
|
WeightedItem(Items.TOOTH_HALF_OF_A_KEY_985,1,1,0.1),
|
||||||
WeightedItem(Items.LOOP_HALF_OF_A_KEY_987,1,1,0.1)
|
WeightedItem(Items.LOOP_HALF_OF_A_KEY_987,1,1,0.1)
|
||||||
)),
|
)),
|
||||||
MAZE(npc = MazeNPC()),
|
// MAZE(npc = MazeNPC()),
|
||||||
DRILL_DEMON(npc = SergeantDamienNPC()),
|
DRILL_DEMON(npc = SergeantDamienNPC()),
|
||||||
EVIL_CHICKEN(npc = EvilChickenNPC()),
|
EVIL_CHICKEN(npc = EvilChickenNPC()),
|
||||||
STRANGE_PLANT(npc = StrangePlantNPC()),
|
// STRANGE_PLANT(npc = StrangePlantNPC()),
|
||||||
SWARM(npc = SwarmNPC()),
|
// SWARM(npc = SwarmNPC()),
|
||||||
EVIL_BOB(npc = EvilBobNPC(), skillIds = intArrayOf(Skills.FISHING, Skills.MAGIC)),
|
// EVIL_BOB(npc = EvilBobNPC(), skillIds = intArrayOf(Skills.FISHING, Skills.MAGIC)),
|
||||||
DRUNKEN_DWARF(npc = DrunkenDwarfNPC()),
|
DRUNKEN_DWARF(npc = DrunkenDwarfNPC()),
|
||||||
RICK_TURPENTINE(npc = RickTurpentineNPC(), loot = CERTER.loot),
|
RICK_TURPENTINE(npc = RickTurpentineNPC(), loot = CERTER.loot),
|
||||||
SURPRISE_EXAM(npc = MysteriousOldManNPC(), type = "sexam"),
|
SURPRISE_EXAM(npc = MysteriousOldManNPC(), type = "sexam"),
|
||||||
FREAKY_FORESTER(npc = FreakyForesterNPC(), skillIds = intArrayOf(Skills.WOODCUTTING)),
|
FREAKY_FORESTER(npc = FreakyForesterNPC(), skillIds = intArrayOf(Skills.WOODCUTTING)),
|
||||||
PILLORY(npc = PilloryNPC(), skillIds = intArrayOf(Skills.THIEVING)),
|
// PILLORY(npc = PilloryNPC(), skillIds = intArrayOf(Skills.THIEVING)),
|
||||||
TREE_SPIRIT(npc = TreeSpiritRENPC(), skillIds = intArrayOf(Skills.WOODCUTTING)),
|
TREE_SPIRIT(npc = TreeSpiritRENPC(), skillIds = intArrayOf(Skills.WOODCUTTING)),
|
||||||
QUIZ_MASTER(npc = QuizMasterNPC()),
|
QUIZ_MASTER(npc = QuizMasterNPC()),
|
||||||
RIVER_TROLL(RiverTrollRENPC(), skillIds = intArrayOf(Skills.FISHING)),
|
RIVER_TROLL(RiverTrollRENPC(), skillIds = intArrayOf(Skills.FISHING)),
|
||||||
ROCK_GOLEM(RockGolemRENPC(), skillIds = intArrayOf(Skills.MINING)),
|
// ROCK_GOLEM(RockGolemRENPC(), skillIds = intArrayOf(Skills.MINING)),
|
||||||
SHADE(ShadeRENPC(), skillIds = intArrayOf(Skills.PRAYER)),
|
SHADE(ShadeRENPC(), skillIds = intArrayOf(Skills.PRAYER));
|
||||||
ZOMBIE(ZombieRENPC(), skillIds = intArrayOf(Skills.PRAYER));
|
// ZOMBIE(ZombieRENPC(), skillIds = intArrayOf(Skills.PRAYER));
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@JvmField
|
@JvmField
|
||||||
|
@ -128,7 +128,12 @@ public final class FamiliarManager {
|
|||||||
}
|
}
|
||||||
if (currentPet != -1) {
|
if (currentPet != -1) {
|
||||||
int last = this.petDetails.get(currentPet).size() - 1;
|
int last = this.petDetails.get(currentPet).size() - 1;
|
||||||
PetDetails details = this.petDetails.get(currentPet).get(last);
|
PetDetails details;
|
||||||
|
if (last < 0) { //missing data in save due to historical bug (see GL !2077)
|
||||||
|
details = new PetDetails(0);
|
||||||
|
} else {
|
||||||
|
details = this.petDetails.get(currentPet).get(last);
|
||||||
|
}
|
||||||
Pets pets = Pets.forId(currentPet);
|
Pets pets = Pets.forId(currentPet);
|
||||||
familiar = new Pet(player, details, currentPet, pets.getNpcId(currentPet));
|
familiar = new Pet(player, details, currentPet, pets.getNpcId(currentPet));
|
||||||
} else if (familiarData.containsKey("familiar")) {
|
} else if (familiarData.containsKey("familiar")) {
|
||||||
@ -414,6 +419,9 @@ public final class FamiliarManager {
|
|||||||
* @param details The new pet details.
|
* @param details The new pet details.
|
||||||
*/
|
*/
|
||||||
public void addDetails(int itemId, PetDetails details) {
|
public void addDetails(int itemId, PetDetails details) {
|
||||||
|
if (petDetails.get(itemId) == null) {
|
||||||
|
petDetails.put(itemId, new ArrayList<>());
|
||||||
|
}
|
||||||
petDetails.get(itemId).add(details);
|
petDetails.get(itemId).add(details);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,8 +129,8 @@ public final class Pet extends Familiar {
|
|||||||
if (pet.isKitten(itemId)) {
|
if (pet.isKitten(itemId)) {
|
||||||
owner.incrementAttribute("/save:stats_manager:cats_raised");
|
owner.incrementAttribute("/save:stats_manager:cats_raised");
|
||||||
}
|
}
|
||||||
owner.getFamiliarManager().removeDetails(getItemId());
|
|
||||||
owner.getFamiliarManager().addDetails(newItemId, details);
|
owner.getFamiliarManager().addDetails(newItemId, details);
|
||||||
|
owner.getFamiliarManager().removeDetails(getItemId());
|
||||||
owner.getFamiliarManager().morphPet(new Item(newItemId), false, location, details.getHunger(), 0);
|
owner.getFamiliarManager().morphPet(new Item(newItemId), false, location, details.getHunger(), 0);
|
||||||
owner.getPacketDispatch().sendMessage("<col=ff0000>Your pet has grown larger.</col>");
|
owner.getPacketDispatch().sendMessage("<col=ff0000>Your pet has grown larger.</col>");
|
||||||
}
|
}
|
||||||
|
@ -10,9 +10,14 @@ import core.game.node.entity.player.Player
|
|||||||
import core.plugin.Initializable
|
import core.plugin.Initializable
|
||||||
import org.rs09.consts.Items
|
import org.rs09.consts.Items
|
||||||
import org.rs09.consts.NPCs
|
import org.rs09.consts.NPCs
|
||||||
|
import core.game.node.item.Item
|
||||||
|
|
||||||
@Initializable
|
@Initializable
|
||||||
class AchiettiesDialogue(player: Player? = null) : DialoguePlugin(player){
|
class AchiettiesDialogue(player: Player? = null) : DialoguePlugin(player) {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val BRIBE_PRICE = 1_000_000
|
||||||
|
}
|
||||||
|
|
||||||
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||||
openDialogue(player, AchiettiesDialogueFile(), npc)
|
openDialogue(player, AchiettiesDialogueFile(), npc)
|
||||||
@ -32,149 +37,238 @@ class AchiettiesDialogueFile : DialogueBuilderFile() {
|
|||||||
|
|
||||||
override fun create(b: DialogueBuilder) {
|
override fun create(b: DialogueBuilder) {
|
||||||
|
|
||||||
b.onQuestStages(Quests.HEROES_QUEST, 0,1)
|
b.onQuestStages(Quests.HEROES_QUEST, 0, 1)
|
||||||
.branch { player ->
|
.branch { player ->
|
||||||
return@branch getQuestStage(player, Quests.HEROES_QUEST)
|
// Return the current quest stage.
|
||||||
}.let{ branch ->
|
getQuestStage(player, Quests.HEROES_QUEST)
|
||||||
branch.onValue(0)
|
}
|
||||||
.npcl(FacialExpression.FRIENDLY, "Greetings. Welcome to the Heroes' Guild.")
|
.let { branch ->
|
||||||
.npcl("Only the greatest heroes of this land may gain entrance to this guild.")
|
branch.onValue(0)
|
||||||
// - If the player's skill levels are lower than the quest requirements. (I think this is after 2009)
|
.npcl(FacialExpression.FRIENDLY, "Greetings. Welcome to the Heroes' Guild.")
|
||||||
// linel("Before starting this quest, be aware that one or more of your skill levels are lower than what is required to fully complete it.")
|
.npcl("Only the greatest heroes of this land may gain entrance to this guild.")
|
||||||
.options()
|
.options()
|
||||||
.let { optionBuilder ->
|
.let { optionBuilder ->
|
||||||
optionBuilder.option("I'm a hero, may I apply to join?")
|
optionBuilder.option("I'm a hero, may I apply to join?")
|
||||||
.playerl("I'm a hero. May I apply to join?")
|
.playerl("I'm a hero. May I apply to join?")
|
||||||
.branch { player ->
|
.branch { player ->
|
||||||
return@branch if (HeroesQuest.hasRequirements(player)) {
|
if (HeroesQuest.hasRequirements(player)) 1 else 0
|
||||||
1
|
|
||||||
} else {
|
|
||||||
0
|
|
||||||
}
|
|
||||||
}.let { branch ->
|
|
||||||
branch.onValue(0)
|
|
||||||
.npcl("You're a hero? I've never heard of YOU. You are required to possess at least 55 quest points to file an application.")
|
|
||||||
.npcl("Additionally you must have completed the Shield of Arrav, Lost City, Merlin's Crystal and Dragon Slayer quests.")
|
|
||||||
.end()
|
|
||||||
return@let branch
|
|
||||||
}.onValue(1)
|
|
||||||
.betweenStage { df, player, _, _ ->
|
|
||||||
if(getQuestStage(player, Quests.HEROES_QUEST) == 0) {
|
|
||||||
setQuestStage(player, Quests.HEROES_QUEST, 1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.npcl("Well you seem to meet our initial requirements, so you may now begin the tasks to earn membership in the Heroes' Guild.")
|
|
||||||
.npcl("The three items required for entrance are: An Entranan Firebird feather, a Master Thieves' armband, and a cooked Lava Eel.")
|
|
||||||
.options()
|
|
||||||
.let { optionBuilder2 ->
|
|
||||||
optionBuilder2.option_playerl("Any hints on getting the thieves armband?")
|
|
||||||
.npcl("I'm sure you have the relevant contacts to find out about that.")
|
|
||||||
.end()
|
|
||||||
optionBuilder2.option_playerl("Any hints on getting the feather?")
|
|
||||||
.npcl("Not really - other than Entranan firebirds tend to live on Entrana.")
|
|
||||||
.end()
|
|
||||||
optionBuilder2.option_playerl("Any hints on getting the eel?")
|
|
||||||
.npcl("Maybe go and find someone who knows a lot about fishing?")
|
|
||||||
.end()
|
|
||||||
optionBuilder2.option_playerl("I'll start looking for all those things then.")
|
|
||||||
.npcl("Good luck with that.")
|
|
||||||
.end()
|
|
||||||
}
|
|
||||||
|
|
||||||
optionBuilder.option_playerl("Good for the foremost heroes of the land.")
|
|
||||||
.npcl("Yes. Yes it is.")
|
|
||||||
.end()
|
|
||||||
}
|
}
|
||||||
branch.onValue(1)
|
.let { branch ->
|
||||||
.npcl("Greetings. Welcome to the Heroes' Guild.")
|
branch.onValue(0)
|
||||||
.npcl("How goes thy quest adventurer?")
|
.npcl("You're a hero? I've never heard of YOU. You are required to possess at least 55 quest points to file an application.")
|
||||||
.playerl("It's tough. I've not done it yet.")
|
.npcl("Additionally you must have completed the Shield of Arrav, Lost City, Merlin's Crystal and Dragon Slayer quests.")
|
||||||
.npcl("Remember, the items you need to enter are:")
|
.end()
|
||||||
.npcl("An Entranan Firebirds' feather, A Master Thieves armband, and a cooked Lava Eel.")
|
branch
|
||||||
.options()
|
|
||||||
.let { optionBuilder2 ->
|
|
||||||
optionBuilder2.option_playerl("Any hints on getting the thieves armband?")
|
|
||||||
.npcl("I'm sure you have the relevant contacts to find out about that.")
|
|
||||||
.end()
|
|
||||||
optionBuilder2.option_playerl("Any hints on getting the feather?")
|
|
||||||
.npcl("Not really - other than Entranan firebirds tend to live on Entrana.")
|
|
||||||
.end()
|
|
||||||
optionBuilder2.option_playerl("Any hints on getting the eel?")
|
|
||||||
.npcl("Maybe go and find someone who knows a lot about fishing?")
|
|
||||||
.end()
|
|
||||||
optionBuilder2.option_playerl("I'll start looking for all those things then.")
|
|
||||||
.npcl("Good luck with that.")
|
|
||||||
.end()
|
|
||||||
}
|
}
|
||||||
}
|
.onValue(1)
|
||||||
|
.betweenStage { df, player, _, _ ->
|
||||||
b.onQuestStages(Quests.HEROES_QUEST, 2, 3, 4)
|
if (getQuestStage(player, Quests.HEROES_QUEST) == 0) {
|
||||||
.npcl("Greetings. Welcome to the Heroes' Guild.")
|
setQuestStage(player, Quests.HEROES_QUEST, 1)
|
||||||
.npcl("How goes thy quest adventurer?")
|
|
||||||
.playerl("It's tough. I've not done it yet.")
|
|
||||||
.npcl("Remember, the items you need to enter are:")
|
|
||||||
.npcl("An Entranan Firebirds' feather, A Master Thieves armband, and a cooked Lava Eel.")
|
|
||||||
.options()
|
|
||||||
.let { optionBuilder2 ->
|
|
||||||
optionBuilder2.option_playerl("Any hints on getting the thieves armband?")
|
|
||||||
.npcl("I'm sure you have the relevant contacts to find out about that.")
|
|
||||||
.end()
|
|
||||||
optionBuilder2.option_playerl("Any hints on getting the feather?")
|
|
||||||
.npcl("Not really - other than Entranan firebirds tend to live on Entrana.")
|
|
||||||
.end()
|
|
||||||
optionBuilder2.option_playerl("Any hints on getting the eel?")
|
|
||||||
.npcl("Maybe go and find someone who knows a lot about fishing?")
|
|
||||||
.end()
|
|
||||||
optionBuilder2.option_playerl("I'll start looking for all those things then.")
|
|
||||||
.npcl("Good luck with that.")
|
|
||||||
.end()
|
|
||||||
}
|
|
||||||
|
|
||||||
b.onQuestStages(Quests.HEROES_QUEST, 6)
|
|
||||||
.npcl("Greetings. Welcome to the Heroes' Guild.")
|
|
||||||
.npcl("How goes thy quest adventurer?")
|
|
||||||
.branch { player ->
|
|
||||||
return@branch if (HeroesQuest.allItemsInInventory(player)) { 1 } else { 0 }
|
|
||||||
}.let { branch ->
|
|
||||||
branch.onValue(0)
|
|
||||||
.playerl("It's tough. I've not done it yet.")
|
|
||||||
.npcl("Remember, the items you need to enter are:")
|
|
||||||
.npcl("An Entranan Firebirds' feather, A Master Thieves armband, and a cooked Lava Eel.")
|
|
||||||
.options()
|
|
||||||
.let { optionBuilder2 ->
|
|
||||||
optionBuilder2.option_playerl("Any hints on getting the thieves armband?")
|
|
||||||
.npcl("I'm sure you have the relevant contacts to find out about that.")
|
|
||||||
.end()
|
|
||||||
optionBuilder2.option_playerl("Any hints on getting the feather?")
|
|
||||||
.npcl("Not really - other than Entranan firebirds tend to live on Entrana.")
|
|
||||||
.end()
|
|
||||||
optionBuilder2.option_playerl("Any hints on getting the eel?")
|
|
||||||
.npcl("Maybe go and find someone who knows a lot about fishing?")
|
|
||||||
.end()
|
|
||||||
optionBuilder2.option_playerl("I'll start looking for all those things then.")
|
|
||||||
.npcl("Good luck with that.")
|
|
||||||
.end()
|
|
||||||
}
|
|
||||||
|
|
||||||
branch.onValue(1)
|
|
||||||
.playerl("I have all the required items.")
|
|
||||||
.npcl("I see that you have. Well done. Now, to complete the quest, and gain entry to the Heroes' Guild in your final task all that you have to do is...")
|
|
||||||
.playerl("W-what? What do you mean? There's MORE?")
|
|
||||||
.npcl("I'm sorry, I was just having a little fun with you. Just a little Heroes' Guild humour there. What I really meant was")
|
|
||||||
.npcl("Congratulations! You have completed the Heroes' Guild entry requirements! You will find the door now open for you! Enter, Hero! And take this reward!")
|
|
||||||
.endWith { _, player ->
|
|
||||||
if (HeroesQuest.allItemsInInventory(player)) {
|
|
||||||
removeItem(player, Items.FIRE_FEATHER_1583)
|
|
||||||
removeItem(player, Items.LAVA_EEL_2149)
|
|
||||||
removeItem(player, Items.THIEVES_ARMBAND_1579)
|
|
||||||
if (getQuestStage(player, Quests.HEROES_QUEST) == 6) {
|
|
||||||
finishQuest(player, Quests.HEROES_QUEST)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
.npcl("Well you seem to meet our initial requirements, so you may now begin the tasks to earn membership in the Heroes' Guild.")
|
||||||
|
.npcl("The three items required for entrance are: An Entranan Firebird feather, a Master Thieves' armband, and a cooked Lava Eel.")
|
||||||
|
.options()
|
||||||
|
.let { optionBuilder2 ->
|
||||||
|
optionBuilder2.option_playerl("Any hints on getting the thieves armband?")
|
||||||
|
.npcl("I'm sure you have the relevant contacts to find out about that.")
|
||||||
|
.end()
|
||||||
|
optionBuilder2.option_playerl("Any hints on getting the feather?")
|
||||||
|
.npcl("Not really - other than Entranan firebirds tend to live on Entrana.")
|
||||||
|
.end()
|
||||||
|
optionBuilder2.option_playerl("Any hints on getting the eel?")
|
||||||
|
.npcl("Maybe go and find someone who knows a lot about fishing?")
|
||||||
|
.end()
|
||||||
|
optionBuilder2.option_playerl("I'll start looking for all those things then.")
|
||||||
|
.npcl("Good luck with that.")
|
||||||
|
.end()
|
||||||
|
optionBuilder2.option_playerl("Or perhaps the guild needs a bit of financing?")
|
||||||
|
.npcl("Perhaps a small 'Loan' of 1 million coins?")
|
||||||
|
// Bribery branch
|
||||||
|
.options()
|
||||||
|
.let { optionBuilder3 ->
|
||||||
|
optionBuilder3.option_playerl("That sounds good")
|
||||||
|
.branch { player ->
|
||||||
|
if (inInventory(player!!, 995, AchiettiesDialogue.BRIBE_PRICE)) 1 else 0
|
||||||
|
}
|
||||||
|
.let { branch ->
|
||||||
|
branch.onValue(1)
|
||||||
|
.playerl(FacialExpression.FRIENDLY, "Here you go!")
|
||||||
|
.endWith { _, player ->
|
||||||
|
removeItem(player, Item(995, AchiettiesDialogue.BRIBE_PRICE), Container.INVENTORY)
|
||||||
|
finishQuest(player, Quests.HEROES_QUEST)
|
||||||
|
}
|
||||||
|
branch.onValue(0)
|
||||||
|
.playerl(FacialExpression.HALF_GUILTY, "Actually, I don't have that much.")
|
||||||
|
.end()
|
||||||
|
}
|
||||||
|
optionBuilder3.option_playerl("1 million coins for this dump? No way")
|
||||||
|
.end()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
optionBuilder.option_playerl("Good for the foremost heroes of the land.")
|
||||||
|
.npcl("Yes. Yes it is.")
|
||||||
|
.end()
|
||||||
|
}
|
||||||
|
branch.onValue(1)
|
||||||
|
.npcl("Greetings. Welcome to the Heroes' Guild.")
|
||||||
|
.npcl("How goes thy quest adventurer?")
|
||||||
|
.playerl("It's tough. I've not done it yet.")
|
||||||
|
.npcl("Remember, the items you need to enter are:")
|
||||||
|
.npcl("An Entranan Firebird's feather, A Master Thieves' armband, and a cooked Lava Eel.")
|
||||||
|
.options()
|
||||||
|
.let { optionBuilder2 ->
|
||||||
|
optionBuilder2.option_playerl("Any hints on getting the thieves armband?")
|
||||||
|
.npcl("I'm sure you have the relevant contacts to find out about that.")
|
||||||
|
.end()
|
||||||
|
optionBuilder2.option_playerl("Any hints on getting the feather?")
|
||||||
|
.npcl("Not really - other than Entranan firebirds tend to live on Entrana.")
|
||||||
|
.end()
|
||||||
|
optionBuilder2.option_playerl("Any hints on getting the eel?")
|
||||||
|
.npcl("Maybe go and find someone who knows a lot about fishing?")
|
||||||
|
.end()
|
||||||
|
optionBuilder2.option_playerl("I'll start looking for all those things then.")
|
||||||
|
.npcl("Good luck with that.")
|
||||||
|
.end()
|
||||||
|
optionBuilder2.option_playerl("Or perhaps the guild needs a bit of financing?")
|
||||||
|
.npcl("Perhaps a small 'Loan' of 1 million coins?")
|
||||||
|
// Bribery branch
|
||||||
|
.options()
|
||||||
|
.let { optionBuilder3 ->
|
||||||
|
optionBuilder3.option_playerl("That sounds good")
|
||||||
|
.branch { player ->
|
||||||
|
if (inInventory(player!!, 995, AchiettiesDialogue.BRIBE_PRICE)) 1 else 0
|
||||||
|
}
|
||||||
|
.let { branch ->
|
||||||
|
branch.onValue(1)
|
||||||
|
.playerl(FacialExpression.FRIENDLY, "Here you go!")
|
||||||
|
.endWith { _, player ->
|
||||||
|
removeItem(player, Item(995, AchiettiesDialogue.BRIBE_PRICE), Container.INVENTORY)
|
||||||
|
finishQuest(player, Quests.HEROES_QUEST)
|
||||||
|
}
|
||||||
|
branch.onValue(0)
|
||||||
|
.playerl(FacialExpression.HALF_GUILTY, "Actually, I don't have that much.")
|
||||||
|
.end()
|
||||||
|
}
|
||||||
|
optionBuilder3.option_playerl("1 million coins for this dump? No way")
|
||||||
|
.end()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
b.onQuestStages(Quests.HEROES_QUEST, 2, 3, 4)
|
||||||
|
.npcl("Greetings. Welcome to the Heroes' Guild.")
|
||||||
|
.npcl("How goes thy quest adventurer?")
|
||||||
|
.playerl("It's tough. I've not done it yet.")
|
||||||
|
.npcl("Remember, the items you need to enter are:")
|
||||||
|
.npcl("An Entranan Firebird's feather, A Master Thieves' armband, and a cooked Lava Eel.")
|
||||||
|
.options()
|
||||||
|
.let { optionBuilder2 ->
|
||||||
|
optionBuilder2.option_playerl("Any hints on getting the thieves armband?")
|
||||||
|
.npcl("I'm sure you have the relevant contacts to find out about that.")
|
||||||
|
.end()
|
||||||
|
optionBuilder2.option_playerl("Any hints on getting the feather?")
|
||||||
|
.npcl("Not really - other than Entranan Firebirds tend to live on Entrana.")
|
||||||
|
.end()
|
||||||
|
optionBuilder2.option_playerl("Any hints on getting the eel?")
|
||||||
|
.npcl("Maybe go and find someone who knows a lot about fishing?")
|
||||||
|
.end()
|
||||||
|
optionBuilder2.option_playerl("I'll start looking for all those things then.")
|
||||||
|
.npcl("Good luck with that.")
|
||||||
|
.end()
|
||||||
|
optionBuilder2.option_playerl("Or perhaps the guild needs a bit of financing?")
|
||||||
|
.npcl("Perhaps a small 'Loan' of 1 million coins?")
|
||||||
|
// Bribery branch
|
||||||
|
.options()
|
||||||
|
.let { optionBuilder3 ->
|
||||||
|
optionBuilder3.option_playerl("That sounds good")
|
||||||
|
.branch { player ->
|
||||||
|
if (inInventory(player!!, 995, AchiettiesDialogue.BRIBE_PRICE)) 1 else 0
|
||||||
|
}
|
||||||
|
.let { branch ->
|
||||||
|
branch.onValue(1)
|
||||||
|
.playerl(FacialExpression.FRIENDLY, "Here you go!")
|
||||||
|
.endWith { _, player ->
|
||||||
|
removeItem(player, Item(995, AchiettiesDialogue.BRIBE_PRICE), Container.INVENTORY)
|
||||||
|
finishQuest(player, Quests.HEROES_QUEST)
|
||||||
|
}
|
||||||
|
branch.onValue(0)
|
||||||
|
.playerl(FacialExpression.HALF_GUILTY, "Actually, I don't have that much.")
|
||||||
|
.end()
|
||||||
|
}
|
||||||
|
optionBuilder3.option_playerl("1 million coins for this dump? No way")
|
||||||
|
.end()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
b.onQuestStages(Quests.HEROES_QUEST, 6)
|
||||||
|
.npcl("Greetings. Welcome to the Heroes' Guild.")
|
||||||
|
.npcl("How goes thy quest adventurer?")
|
||||||
|
.branch { player ->
|
||||||
|
if (HeroesQuest.allItemsInInventory(player)) 1 else 0
|
||||||
|
}
|
||||||
|
.let { branch ->
|
||||||
|
branch.onValue(0)
|
||||||
|
.playerl("It's tough. I've not done it yet.")
|
||||||
|
.npcl("Remember, the items you need to enter are:")
|
||||||
|
.npcl("An Entranan Firebird's feather, A Master Thieves' armband, and a cooked Lava Eel.")
|
||||||
|
.options()
|
||||||
|
.let { optionBuilder2 ->
|
||||||
|
optionBuilder2.option_playerl("Any hints on getting the thieves armband?")
|
||||||
|
.npcl("I'm sure you have the relevant contacts to find out about that.")
|
||||||
|
.end()
|
||||||
|
optionBuilder2.option_playerl("Any hints on getting the feather?")
|
||||||
|
.npcl("Not really - other than Entranan Firebirds tend to live on Entrana.")
|
||||||
|
.end()
|
||||||
|
optionBuilder2.option_playerl("Any hints on getting the eel?")
|
||||||
|
.npcl("Maybe go and find someone who knows a lot about fishing?")
|
||||||
|
.end()
|
||||||
|
optionBuilder2.option_playerl("I'll start looking for all those things then.")
|
||||||
|
.npcl("Good luck with that.")
|
||||||
|
.end()
|
||||||
|
optionBuilder2.option_playerl("Or perhaps the guild needs a bit of financing?")
|
||||||
|
.npcl("Perhaps a small 'Loan' of 1 million coins?")
|
||||||
|
// Bribery branch
|
||||||
|
.options()
|
||||||
|
.let { optionBuilder3 ->
|
||||||
|
optionBuilder3.option_playerl("That sounds good")
|
||||||
|
.branch { player ->
|
||||||
|
if (inInventory(player!!, 995, AchiettiesDialogue.BRIBE_PRICE)) 1 else 0
|
||||||
|
}
|
||||||
|
.let { branch ->
|
||||||
|
branch.onValue(1)
|
||||||
|
.playerl(FacialExpression.FRIENDLY, "Here you go!")
|
||||||
|
.endWith { _, player ->
|
||||||
|
removeItem(player, Item(995, AchiettiesDialogue.BRIBE_PRICE), Container.INVENTORY)
|
||||||
|
finishQuest(player, Quests.HEROES_QUEST)
|
||||||
|
}
|
||||||
|
branch.onValue(0)
|
||||||
|
.playerl(FacialExpression.HALF_GUILTY, "Actually, I don't have that much.")
|
||||||
|
.end()
|
||||||
|
}
|
||||||
|
optionBuilder3.option_playerl("1 million coins for this dump? No way")
|
||||||
|
.end()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
branch.onValue(1)
|
||||||
|
.playerl("I have all the required items.")
|
||||||
|
.npcl("I see that you have. Well done. Now, to complete the quest, and gain entry to the Heroes' Guild in your final task all that you have to do is...")
|
||||||
|
.playerl("W-what? What do you mean? There's MORE?")
|
||||||
|
.npcl("I'm sorry, I was just having a little fun with you. Just a little Heroes' Guild humour there. What I really meant was")
|
||||||
|
.npcl("Congratulations! You have completed the Heroes' Guild entry requirements! You will find the door now open for you! Enter, Hero! And take this reward!")
|
||||||
|
.endWith { _, player ->
|
||||||
|
if (HeroesQuest.allItemsInInventory(player)) {
|
||||||
|
removeItem(player, Items.FIRE_FEATHER_1583)
|
||||||
|
removeItem(player, Items.LAVA_EEL_2149)
|
||||||
|
removeItem(player, Items.THIEVES_ARMBAND_1579)
|
||||||
|
if (getQuestStage(player, Quests.HEROES_QUEST) == 6) {
|
||||||
|
finishQuest(player, Quests.HEROES_QUEST)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
b.onQuestStages(Quests.HEROES_QUEST, 100)
|
b.onQuestStages(Quests.HEROES_QUEST, 100)
|
||||||
.npcl("Greetings. Welcome to the Heroes' Guild.")
|
.npcl("Greetings. Welcome to the Heroes' Guild.")
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -124,6 +124,7 @@ class CivilianDialogue(player: Player? = null) : DialoguePlugin(player) {
|
|||||||
if (removeItem(player, cat)){
|
if (removeItem(player, cat)){
|
||||||
player.familiarManager.removeDetails(cat)
|
player.familiarManager.removeDetails(cat)
|
||||||
addItem(player, Items.DEATH_RUNE_560, 100)
|
addItem(player, Items.DEATH_RUNE_560, 100)
|
||||||
|
player.incrementAttribute("/save:stats_manager:cats_sold");
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -172,6 +173,7 @@ class CatTrade : InteractionListener{
|
|||||||
// Remove the cat
|
// Remove the cat
|
||||||
player.familiarManager.removeDetails(used.id)
|
player.familiarManager.removeDetails(used.id)
|
||||||
addItem(player, Items.DEATH_RUNE_560, 100)
|
addItem(player, Items.DEATH_RUNE_560, 100)
|
||||||
|
player.incrementAttribute("/save:stats_manager:cats_sold");
|
||||||
openDialogue(player, dialogue, with as NPC)
|
openDialogue(player, dialogue, with as NPC)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ class KingRoaldDialogue(player: Player? = null) : DialoguePlugin(player) {
|
|||||||
addOption("Priest in Peril", KingRoaldPIPDialogue(player.questRepository.getStage(Quests.PRIEST_IN_PERIL)))
|
addOption("Priest in Peril", KingRoaldPIPDialogue(player.questRepository.getStage(Quests.PRIEST_IN_PERIL)))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.questRepository.getQuest(Quests.SHIELD_OF_ARRAV).isStarted(player) && !player.questRepository.getQuest(Quests.SHIELD_OF_ARRAV).isCompleted(player)) {
|
if (!player.questRepository.getQuest(Quests.SHIELD_OF_ARRAV).isCompleted(player)) {
|
||||||
addOption("Shield of Arrav", KingRoaldArravDialogue())
|
addOption("Shield of Arrav", KingRoaldArravDialogue())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,12 +6,20 @@ import core.game.dialogue.DialogueFile
|
|||||||
import core.tools.END_DIALOGUE
|
import core.tools.END_DIALOGUE
|
||||||
import core.tools.START_DIALOGUE
|
import core.tools.START_DIALOGUE
|
||||||
import content.data.Quests
|
import content.data.Quests
|
||||||
|
import core.game.dialogue.FacialExpression
|
||||||
|
import core.api.Container
|
||||||
|
import core.api.inInventory
|
||||||
|
import core.api.removeItem
|
||||||
|
import core.game.dialogue.DialoguePlugin
|
||||||
|
|
||||||
|
|
||||||
private val CERTIFICATE = Item(769)
|
private val CERTIFICATE = Item(769)
|
||||||
|
|
||||||
|
|
||||||
class KingRoaldArravDialogue() : DialogueFile() {
|
class KingRoaldArravDialogue() : DialogueFile() {
|
||||||
|
companion object {
|
||||||
|
const val BRIBE_PRICE = 6000
|
||||||
|
}
|
||||||
override fun handle(componentID: Int, buttonID: Int) {
|
override fun handle(componentID: Int, buttonID: Int) {
|
||||||
|
|
||||||
if (player!!.inventory.containsItem(ShieldofArrav.PHOENIX_SHIELD) || player!!.inventory.containsItem(ShieldofArrav.BLACKARM_SHIELD)) {
|
if (player!!.inventory.containsItem(ShieldofArrav.PHOENIX_SHIELD) || player!!.inventory.containsItem(ShieldofArrav.BLACKARM_SHIELD)) {
|
||||||
@ -54,7 +62,29 @@ class KingRoaldArravDialogue() : DialogueFile() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
abandonFile()
|
when (stage) {
|
||||||
|
START_DIALOGUE -> player("I would like to contribute to one of", "your Political Action Committees").also{ stage++ }
|
||||||
|
1 -> npcl("Which one?").also { stage++ }
|
||||||
|
2 -> playerl("The Citizens Who Can't Be Bothered To Do Shield of Arrav").also { stage++ }
|
||||||
|
3 -> npcl(FacialExpression.HALF_THINKING, "I see... that will be 6,000 coins").also { stage++ }
|
||||||
|
4 -> options("Here you go!", "Nevermind.").also { stage++ }
|
||||||
|
5 -> when (buttonID) {
|
||||||
|
1 -> {
|
||||||
|
if (inInventory(player!!, 995, BRIBE_PRICE))
|
||||||
|
playerl(FacialExpression.FRIENDLY, "Here you go!").also { stage = 20 }
|
||||||
|
else
|
||||||
|
playerl(FacialExpression.HALF_GUILTY, "Actually, I don't have that much.").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
2 -> playerl(FacialExpression.FRIENDLY, "On second thought, never mind.").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
20 -> {
|
||||||
|
npcl("Thank you so much, dear donor. The government of Varrock now has higher priorities than the Shield of Arrav.")
|
||||||
|
if (removeItem(player!!, Item(995, BRIBE_PRICE), Container.INVENTORY)) {
|
||||||
|
player!!.questRepository.getQuest(Quests.SHIELD_OF_ARRAV).finish(player)
|
||||||
|
}
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -9,6 +9,7 @@ const val STATS_ROCKS = "rocks_mined"
|
|||||||
const val STATS_RC = "essence_crafted"
|
const val STATS_RC = "essence_crafted"
|
||||||
const val STATS_FOOD_COOKED = "food_cooked"
|
const val STATS_FOOD_COOKED = "food_cooked"
|
||||||
const val STATS_CATS_RAISED = "cats_raised"
|
const val STATS_CATS_RAISED = "cats_raised"
|
||||||
|
const val STATS_CATS_SOLD = "cats_sold"
|
||||||
const val STATS_PK_KILLS = "player_kills"
|
const val STATS_PK_KILLS = "player_kills"
|
||||||
const val STATS_PK_DEATHS = "player_deaths"
|
const val STATS_PK_DEATHS = "player_deaths"
|
||||||
const val STATS_ALKHARID_GATE = "alkharid_gate"
|
const val STATS_ALKHARID_GATE = "alkharid_gate"
|
||||||
|
@ -62,7 +62,7 @@ class StatsCommandSet : CommandSet(Privilege.STANDARD) {
|
|||||||
72 -> sendLine(player,"Quest Points: ${queryPlayer.questRepository.points}",i)
|
72 -> sendLine(player,"Quest Points: ${queryPlayer.questRepository.points}",i)
|
||||||
73 -> sendLine(player,"Ironman Mode: ${queryPlayer.ironmanManager.mode.name.lowercase(Locale.getDefault())}",i)
|
73 -> sendLine(player,"Ironman Mode: ${queryPlayer.ironmanManager.mode.name.lowercase(Locale.getDefault())}",i)
|
||||||
74 -> sendLine(player,"Deaths: ${queryPlayer.getAttribute("$STATS_BASE:$STATS_DEATHS",0)}",i)
|
74 -> sendLine(player,"Deaths: ${queryPlayer.getAttribute("$STATS_BASE:$STATS_DEATHS",0)}",i)
|
||||||
75 -> sendLine(player, SPACER,i)
|
75 -> sendLine(player, "Cats Sold: ${queryPlayer.getAttribute("$STATS_BASE:$STATS_CATS_SOLD", 0)}", i)
|
||||||
76 -> sendLine(player,"Logs Chopped: ${queryPlayer.getAttribute("$STATS_BASE:$STATS_LOGS",0)}",i)
|
76 -> sendLine(player,"Logs Chopped: ${queryPlayer.getAttribute("$STATS_BASE:$STATS_LOGS",0)}",i)
|
||||||
77 -> sendLine(player,"Rocks Mined: ${queryPlayer.getAttribute("$STATS_BASE:$STATS_ROCKS",0)}",i)
|
77 -> sendLine(player,"Rocks Mined: ${queryPlayer.getAttribute("$STATS_BASE:$STATS_ROCKS",0)}",i)
|
||||||
78 -> sendLine(player,"Fish Caught: ${queryPlayer.getAttribute("$STATS_BASE:$STATS_FISH",0)}",i)
|
78 -> sendLine(player,"Fish Caught: ${queryPlayer.getAttribute("$STATS_BASE:$STATS_FISH",0)}",i)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user