diff --git a/game/src/main/kotlin/content/area/karamja/shilo_village/Fernahei.kt b/game/src/main/kotlin/content/area/karamja/shilo_village/Fernahei.kt new file mode 100644 index 0000000000..ce332fae77 --- /dev/null +++ b/game/src/main/kotlin/content/area/karamja/shilo_village/Fernahei.kt @@ -0,0 +1,28 @@ +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.type.choice +import content.entity.player.dialogue.type.npc +import world.gregs.voidps.engine.Script + + +class Fernahei : Script { + init { + npcOperate("Talk-to", "fernahei_shilo_village") { + npc("Welcome to Fernahei's Fishing Shop Bwana! Would you like to see my items?") + choice { + option("Yes please!") { + openShop("fernaheis_fishing_hut") + } + option("No, but thanks for the offer.") { + npc("That's fine and thanks for your interest.") + } + } + } + npcOperate("Trade", "fernahei_shilo_village") { + openShop("fernaheis_fishing_hut") + } + } +} \ No newline at end of file diff --git a/game/src/main/kotlin/content/area/karamja/shilo_village/Yohnus.kt b/game/src/main/kotlin/content/area/karamja/shilo_village/Yohnus.kt new file mode 100644 index 0000000000..4700dd4668 --- /dev/null +++ b/game/src/main/kotlin/content/area/karamja/shilo_village/Yohnus.kt @@ -0,0 +1,70 @@ +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("Sorry but the blacksmiths is closed. But I can let you use the furnace at the cost of 20 gold pieces.") + choice { + option("Use Furnace - 20 Gold") { + inventory.transaction { + remove("coins", 20) + } + when (inventory.transaction.error) { + TransactionError.None -> { + this["yohnus_paid"] = true + npc("Thanks Bwana! Enjoy the facilities!") + } + else -> npc("Sorry, you don't have enough coins.") + } + } + option("No thanks!") { + player("No thanks!") + npc("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) && !this["yohnus_paid", false]) { + npc( + "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 + } + if (this["yohnus_paid", false]) { + clear("yohnus_paid") + enterDoor(target) + return@objectOperate + } + inventory.transaction { + remove("coins", 20) + } + when (inventory.transaction.error) { + TransactionError.None -> { + npc("yohnus_shilo_village", "Thanks Bwana! Enjoy the facilities!") + enterDoor(target) + } + else -> { + npc("yohnus_shilo_village", "Sorry, you don't have enough coins.") + } + } + } + } +} \ No newline at end of file