Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package content.area.karamja.shilo_village

import content.entity.npc.shop.openShop
import content.entity.player.dialogue.Happy
import content.entity.player.dialogue.Neutral
import content.entity.player.dialogue.Shifty
import content.entity.player.dialogue.type.choice
import content.entity.player.dialogue.type.npc
import world.gregs.voidps.engine.Script
import world.gregs.voidps.engine.entity.character.player.equip.equipped
import world.gregs.voidps.network.login.protocol.visual.update.player.EquipSlot


class Fernahei : Script {

init {
npcOperate("Talk-to", "fernahei_shilo_village") {
npc<Happy>("Welcome to Fernahei's Fishing Shop Bwana! Would you like to see my items?")
choice {
option<Neutral>("Yes please!") {
openShop("fernaheis_fishing_hut")
}
option("No, but thanks for the offer.") {
npc<Happy>("That's fine and thanks for your interest.")
}
}
npcOperate("Trade", "fernahei_shilo_village") {
val amulet = equipped(EquipSlot.Amulet)
if (amulet.id == "monkeyspeak_amulet") {
openShop("dagas_scimitar_smithy")
} else {
npc<Shifty>("Ook! Ah Uh Ah! Ook Ook! Ah!")
}
}
}
}
}
64 changes: 64 additions & 0 deletions game/src/main/kotlin/content/area/karamja/shilo_village/Yohnus.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package content.area.karamja.shilo_village

import content.entity.obj.door.enterDoor
import content.entity.player.dialogue.Happy
import content.entity.player.dialogue.Neutral
import content.entity.player.dialogue.Quiz
import content.entity.player.dialogue.type.choice
import content.entity.player.dialogue.type.npc
import content.entity.player.dialogue.type.player
import world.gregs.voidps.engine.Script
import world.gregs.voidps.engine.inv.inventory
import world.gregs.voidps.engine.inv.transact.TransactionError
import world.gregs.voidps.engine.inv.transact.operation.RemoveItem.remove

class Yohnus : Script {

init {
npcOperate("Talk-to", "yohnus_shilo_village") {
npc<Neutral>("Sorry but the blacksmiths is closed. But I can let you use the furnace at the cost of 20 gold pieces.")
choice {
option<Neutral>("Use Furnace - 20 Gold") {
inventory.transaction {
remove("coins", 20)
}
when (inventory.transaction.error) {
TransactionError.None -> {
npc<Happy>("Thanks Bwana! Enjoy the facilities!")
}
else -> npc<Neutral>("Sorry, you don't have enough coins.")
}
}
option<Neutral>("No thanks!") {
player<Neutral>("No thanks!")
npc<Neutral>("Very well Bwana, have a nice day.")
}
}
}
objectOperate("Open", "blacksmiths_door_closed") { (target) ->
if (tile.y > target.tile.y) {
enterDoor(target)
return@objectOperate
}
if (!inventory.contains("coins", 20)) {
npc<Quiz>(
"yohnus_shilo_village",
"Sorry but the blacksmiths is closed. But I can let you use the furnace at the cost of 20 gold pieces."
)
return@objectOperate
}
inventory.transaction {
remove("coins", 20)
}
when (inventory.transaction.error) {
TransactionError.None -> {
npc<Quiz>("yohnus_shilo_village", "Thanks Bwana! Enjoy the facilities!")
enterDoor(target)
}
else -> {
npc<Quiz>("yohnus_shilo_village", "Sorry, you don't have enough coins.")
}
}
}
}
}