Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions data/area/asgarnia/falador/falador.combat.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,14 @@ range = 1
anim = "sword_slash"
target_hit = { offense = "slash", max = 30 }

[gardener]
defend_anim = "human_farmersfork_def"
defend_sound = "man_defend"
death_anim = "human_death"
death_sound = "man_death"

[gardener.melee]
range = 1
anim = "human_farmersfork_stab"
target_sound = "farmer_attack"
target_hit = { offense = "stab", max = 10 }
2 changes: 1 addition & 1 deletion data/area/asgarnia/falador/falador.npcs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ examine = "An old gardener."
id = 1217
hitpoints = 70
def = 7
combat_def = "man"
combat_def = "gardener"
respawn_delay = 50
drop_table = "bones"
examine = "An old gardener."
Expand Down
6 changes: 3 additions & 3 deletions data/area/asgarnia/port_sarim/port_sarim.npc-spawns.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ spawns = [
{ id = "felkrash_rat_pits", x = 3016, y = 3234, members = true },
{ id = "tool_leprechaun", x = 3064, y = 3255 },
{ id = "redbeard_frank_port_sarim", x = 3049, y = 3253 },
{ id = "captain_tobias", x = 3028, y = 3216, members = true },
{ id = "seaman_lorris", x = 3028, y = 3221, members = true },
{ id = "seaman_thresnor", x = 3026, y = 3217, members = true },
{ id = "captain_tobias_1", x = 3028, y = 3216, members = true },
{ id = "seaman_lorris_1", x = 3028, y = 3221, members = true },
{ id = "seaman_thresnor_1", x = 3026, y = 3217, members = true },
{ id = "squire_port_sarim", x = 3041, y = 3202 },
{ id = "woman", x = 3011, y = 3236 },
{ id = "security_guard_port_sarim", x = 3010, y = 3187, level = 1 },
Expand Down
4 changes: 4 additions & 0 deletions data/area/karamja/karamja.areas.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ x = [2752,2752,2979,2979,3007,3007]
y = [2880,3135,3135,3104,3104,2880]
tags = ["penguin_area"]
hint = "deep in the jungle."

[karamja_dungeon]
x = [2827, 2867]
y = [9546, 9599]
6 changes: 6 additions & 0 deletions data/entity/player/human.anims.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ id = 422
[human_block]
id = 422

[human_farmersfork_stab]
id = 433

[human_farmersfork_def]
id = 434

[human_defend]
id = 424

Expand Down
2 changes: 1 addition & 1 deletion data/entity/player/modal/scrolls.ifaces.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ id = 16

[message_scroll_handwriting]
id = 222
type = "wide_screen"
type = "main_screen"

[.line0]
id = "1-11"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[bluemoon_chest]
id = 2079

[bluemoon_chest_open]
id = 2080

[raw_chicken_crate]
id = 15032
examine = "A wooden crate."
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ id = 71
persist = true
format = "map"
default = "unstarted"
values = { unstarted = 0, started = 1 }
values = { unstarted = 0, started = 1, chest_key = 2, read_message = 3, completed = 4 }
19 changes: 19 additions & 0 deletions data/quest/members/pirates_treasure/pirates_treasure.vars.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[pirates_treasure_wydin]
persist = true
format = "boolean"

[pirates_treasure_stashed_rum]
persist = true
format = "boolean"

[pirates_treasure_delivered_rum]
persist = true
format = "boolean"

[pirates_treasure_collected_rum]
persist = true
format = "boolean"

[pirates_treasure_spawned_gardener]
persist = true
format = "boolean"
157 changes: 157 additions & 0 deletions game/src/main/kotlin/content/area/asgarnia/port_sarim/RedbeardFrank.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
package content.area.asgarnia.port_sarim

import content.entity.player.bank.ownsItem
import content.entity.player.dialogue.Happy
import content.entity.player.dialogue.Laugh
import content.entity.player.dialogue.Neutral
import content.entity.player.dialogue.Quiz
import content.entity.player.dialogue.Sad
import content.entity.player.dialogue.Shifty
import content.entity.player.dialogue.Shock
import content.entity.player.dialogue.type.choice
import content.entity.player.dialogue.type.item
import content.entity.player.dialogue.type.npc
import content.entity.player.dialogue.type.player
import content.entity.player.inv.item.addOrDrop
import content.quest.questCompleted
import content.quest.questStage
import world.gregs.voidps.engine.Script
import world.gregs.voidps.engine.client.message
import world.gregs.voidps.engine.entity.character.player.Player
import world.gregs.voidps.engine.entity.character.player.male
import world.gregs.voidps.engine.inv.inventory
import world.gregs.voidps.engine.inv.remove

class RedbeardFrank : Script {

Check warning on line 25 in game/src/main/kotlin/content/area/asgarnia/port_sarim/RedbeardFrank.kt

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Unused symbol

Class "RedbeardFrank" is never used

init {
npcOperate("Talk-to", "redbeard_frank_port_sarim") {
npc<Laugh>("Arr, Matey!")
when (questStage("pirates_treasure")) {
0 -> unstartedMenu()
1 -> broughtRum()
else -> completedMenu()
}
}
}

private suspend fun Player.unstartedMenu() {
choice {
option<Shifty>("I'm in search of treasure.") {
treasureOffer()
}
option<Laugh>("Arr!") {
npc<Laugh>("Arr!")
}
option<Quiz>("Do you have anything for trade?") {
nothingToTrade()
}
}
}

private suspend fun Player.completedMenu() {
if (questStage("pirates_treasure") < 3 && !ownsItem("chest_key_pirates_treasure")) {
player<Sad>("I seem to have lost my chest key...")
npc<Neutral>("Arr, silly you. Fortunately I took the precaution to have another one made.")
addOrDrop("chest_key_pirates_treasure")
item(item = "chest_key_pirates_treasure", text = "Frank hands you a chest key")
}
choice {
option<Laugh>("Arr!") {
npc<Laugh>("Arr!")
}
option<Quiz>("Do you have anything for trade?") {
nothingToTrade()
}
}
}

private suspend fun Player.nothingToTrade() {
npc<Neutral>("Nothin' at the moment, but then again the Customs Agents are on the warpath right now.")
}

private suspend fun Player.treasureOffer() {
npc<Shifty>("Arr, treasure you be after eh? Well I might be able to tell you where to find some... For a price...")
player<Quiz>("What sort of price?")
npc<Neutral>("Well for example if you can get me a bottle of rum... Not just any rum mind...")
npc<Happy>("I'd like some rum made on Karamja Island. There's no rum like Karamja Rum!")
if (questCompleted("rum_deal")) { // TODO
player<Quiz>("Would some Braindeath 'Rum' do?")
npc<Shock>("Gadzooks, that swill! Not a chance!")
npc<Neutral>("It's Karamja Rum or no deal.")
}
choice {
option<Neutral>("Ok, I will bring you some rum.") {
set("pirates_treasure", "started")
npc<Happy>("Yer a saint, although it'll take a miracle to get it off Karamja.")
whyItsHard()
}
option<Neutral>("Not right now.") {
npc<Neutral>("Fair enough. I'll still be here and thirsty whenever you feel like helpin' out.")
}
}
}

private suspend fun Player.whyItsHard() {
player<Quiz>("What do you mean?")
npc<Neutral>(
"The Customs office has been clampin' down on the export of spirits. You seem like a " +
"resourceful young ${if (male) "lad" else "lass"}, I'm sure ye'll be able to find a way to slip the " +
"stuff past them.",
)
player<Neutral>("Well I'll give it a shot.")
if (questStage("pirates_treasure") < 1) {
npc<Happy>("Arr, that's the spirit!")
}
}

private suspend fun Player.broughtRum() {
npc<Quiz>("Have ye brought some rum for yer ol' mate Frank?")
val plainRum = inventory.contains("karamjan_rum")
val slicedRum = inventory.contains("karamjan_rum_sliced_banana")
val bananaRum = inventory.contains("karamjan_rum_banana")
if (!plainRum && !slicedRum && !bananaRum) {
player<Sad>("No, not yet.")
npc<Happy>("Not surprising, tis no easy task to get it off Karamja.")
whyItsHard()
return
}
player<Happy>("Yes, I've got some.")
when {
slicedRum -> rejectRum("karamjan_rum_sliced_banana", "Arr - I don't likes banana in me rum!")
bananaRum -> rejectRum("karamjan_rum_banana", "Arr - this here rum's got a banana stuck in it!")
else -> acceptRum()
}
}

private suspend fun Player.rejectRum(item: String, complaint: String) {
if (!inventory.remove(item)) {
return
}
message("Frank happily takes the rum.")
delay(4)
npc<Neutral>(complaint)
message("Frank hands you back the rum.")
addOrDrop(item)
}

private suspend fun Player.acceptRum() {
npc<Shifty>("Now a deal's a deal, I'll tell ye about the treasure. I used to serve under a pirate captain called One-Eyed Hector.")
npc<Shifty>("Hector were very successful and became very rich. But about a year ago we were boarded by the Customs and Excise Agents.")
npc<Sad>("Hector were killed along with many of the crew, I were one of the few to escape and I escaped with this.")
if (!inventory.remove("karamjan_rum")) {
return
}
set("pirates_treasure", "chest_key")
addOrDrop("chest_key_pirates_treasure")
item(item = "chest_key_pirates_treasure", text = "Frank happily takes the rum... and hands you a key.")
npc<Shifty>("This be Hector's key. I believe it opens his chest in his old room in the Blue Moon Inn in Varrock.")
npc<Neutral>("With any luck his treasure will be in there.")
choice {
option<Happy>("Ok thanks, I'll go and get it.")
option<Quiz>("So why didn't you ever get it?") {
npc<Sad>("I'm not allowed in the Blue Moon Inn. Apparently I'm a drunken trouble maker.")
}
}
}
}
32 changes: 28 additions & 4 deletions game/src/main/kotlin/content/area/asgarnia/port_sarim/Seaman.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@ import content.entity.player.dialogue.Happy
import content.entity.player.dialogue.Neutral
import content.entity.player.dialogue.Quiz
import content.entity.player.dialogue.Sad
import content.entity.player.dialogue.Shifty
import content.entity.player.dialogue.type.choice
import content.entity.player.dialogue.type.npc
import content.entity.player.dialogue.type.player
import content.entity.player.dialogue.type.statement
import content.quest.questCompleted
import world.gregs.voidps.engine.Script
import world.gregs.voidps.engine.client.message
import world.gregs.voidps.engine.entity.character.player.Player
import world.gregs.voidps.engine.entity.character.player.equip.equipped
import world.gregs.voidps.engine.inv.inventory
import world.gregs.voidps.engine.inv.remove
import world.gregs.voidps.network.login.protocol.visual.update.player.EquipSlot
import world.gregs.voidps.type.Tile

class Seaman : Script {
Expand All @@ -28,24 +32,44 @@ class Seaman : Script {
player<Sad>("Oh dear, I don't seem to have enough money.")
return@option
}
travel()
travel("You pay 30 coins and board the ship.")
}
if (charmed) {
option("Or I could pay you nothing at all...") {
player<Shifty>("Or I could pay you nothing at all...")
npc<Quiz>("Mmmm, nothing at all, you say...")
npc<Happy>("Yes, why not - jump aboard then.")
travel("You board the ship.")
}
}
option<Neutral>("No, thank you.")
}
}

npcOperate("Pay-fare", "seaman_lorris*,captain_tobias*,seaman_thresnor*") {
if (!questCompleted("pirates_treasure")) {
return@npcOperate message("You may only use the Pay-fare option after completing Pirate's Treasure.")
}
if (!inventory.remove("coins", 30)) {
message("You do not have enough money for that.")
return@npcOperate
}
travel()
travel("You pay 30 coins and board the ship.")
}
}

private suspend fun Player.travel() {
message("You pay 30 coins and board the ship.")
private suspend fun Player.travel(boarding: String) {
message(boarding)
boatTravel("port_sarim_to_karamja", 7, Tile(2956, 3143, 1))
statement("The ship arrives at Karamja.")
}

private val Player.charmed: Boolean
get() = equipped(EquipSlot.Ring).id == "ring_of_charos_a"
}

// TODO dragon slayer dialog
// I'd rather go to Crandor Isle.
// No I need to stay alive, I have a wife and family to support.

// TODO diary cost
Loading
Loading