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..26e3c0326e --- /dev/null +++ b/game/src/main/kotlin/content/area/karamja/shilo_village/Fernahei.kt @@ -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("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") { + val amulet = equipped(EquipSlot.Amulet) + if (amulet.id == "monkeyspeak_amulet") { + openShop("dagas_scimitar_smithy") + } else { + npc("Ook! Ah Uh Ah! Ook Ook! Ah!") + } + } + } + } +} \ 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..ee3c33ff81 --- /dev/null +++ b/game/src/main/kotlin/content/area/karamja/shilo_village/Yohnus.kt @@ -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("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 -> { + 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)) { + 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 + } + 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