diff --git a/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListener.kt b/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt similarity index 75% rename from Server/src/main/content/global/skill/construction/decoration/workshop/EaselListener.kt rename to Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt index 3c442a659..18240f419 100644 --- a/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListener.kt +++ b/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt @@ -4,6 +4,7 @@ import content.global.skill.crafting.HeraldicProduct import core.api.* import core.game.interaction.InteractionListener import core.game.node.entity.skill.Skills +import org.rs09.consts.Items import org.rs09.consts.Scenery /** @@ -14,7 +15,7 @@ import org.rs09.consts.Scenery class EaselListener : InteractionListener { private val easels = intArrayOf(Scenery.HELMET_PLUMING_STAND_13716, Scenery.PAINTING_STAND_13717, Scenery.BANNER_MAKING_STAND_13718) - private val heraldryAnimation = 0 // PLACEHOLDER + private val heraldryAnimation = 3654 override fun defineListeners() { on(easels, SCENERY, "use") { player, node -> @@ -50,7 +51,7 @@ class EaselListener : InteractionListener { sendMessage(player, "You make a helmet in your colours.") return@addDialogueAction } else { - sendDialogue(player, "PLACEHOLDER") + sendDialogue(player, "You need a steel full helm in order to do this.") return@addDialogueAction } } @@ -62,7 +63,7 @@ class EaselListener : InteractionListener { sendMessage(player, "You make a helmet in your colours.") return@addDialogueAction } else { - sendDialogue(player, "PLACEHOLDER") + sendDialogue(player, "You need a rune full helm in order to do this.") return@addDialogueAction } } @@ -86,7 +87,7 @@ class EaselListener : InteractionListener { sendMessage(player, "You make a shield with your symbol on.") return@addDialogueAction } else { - sendDialogue(player, "PLACEHOLDER") + sendDialogue(player, "You need a steel kiteshield in order to do this.") return@addDialogueAction } } @@ -98,7 +99,7 @@ class EaselListener : InteractionListener { sendMessage(player, "You make a shield with your symbol on.") return@addDialogueAction } else { - sendDialogue(player, "PLACEHOLDER") + sendDialogue(player, "You need a rune kiteshield in order to do this.") return@addDialogueAction } } @@ -115,19 +116,16 @@ class EaselListener : InteractionListener { return@addDialogueAction } (!inInventory(player, HeraldicProduct.BANNER.primaryMaterialId) || !inInventory(player, HeraldicProduct.BANNER.secondaryMaterialId!!)) -> { - sendDialogue(player, "PLACEHOLDER") + sendDialogue(player, "You need a bolt of cloth and a plank in order to do this.") } else -> { if (removeItem(player, HeraldicProduct.BANNER.primaryMaterialId) && removeItem(player, HeraldicProduct.BANNER.secondaryMaterialId)) { addItemOrDrop(player, HeraldicProduct.BANNER.productForCrest(crest)) rewardXP(player, Skills.CRAFTING, HeraldicProduct.BANNER.craftingXp) animate(player, heraldryAnimation) - sendMessage(player, "PLACEHOLDER") - return@addDialogueAction - } else { - sendDialogue(player, "PLACEHOLDER") - return@addDialogueAction + sendMessage(player, "You make a banner with your symbol on.") } + return@addDialogueAction } } } @@ -135,5 +133,33 @@ class EaselListener : InteractionListener { } return@on true } + onUseWith(SCENERY, Items.BOLT_OF_CLOTH_8790, Scenery.BANNER_MAKING_STAND_13718) { player, _, _ -> + val crest = player.houseManager.crest + when { + (!hasLevelDyn(player, Skills.CONSTRUCTION, HeraldicProduct.BANNER.constructionReq)) -> { + sendDialogue(player, "You need a Construction level of ${HeraldicProduct.BANNER.constructionReq} to make this.") + return@onUseWith false + } + (!hasLevelDyn(player, Skills.CRAFTING, HeraldicProduct.BANNER.craftingReq)) -> { + sendDialogue(player, "You need a Crafting level of ${HeraldicProduct.BANNER.craftingReq} to make this.") + return@onUseWith false + } + (!inInventory(player, HeraldicProduct.BANNER.primaryMaterialId) || !inInventory(player, HeraldicProduct.BANNER.secondaryMaterialId!!)) -> { + sendDialogue(player, "You need a bolt of cloth and a plank in order to do this.") + } + else -> { + if (removeItem(player, HeraldicProduct.BANNER.primaryMaterialId) && removeItem(player, HeraldicProduct.BANNER.secondaryMaterialId)) { + addItemOrDrop(player, HeraldicProduct.BANNER.productForCrest(crest)) + rewardXP(player, Skills.CRAFTING, HeraldicProduct.BANNER.craftingXp) + animate(player, heraldryAnimation) + sendMessage(player, "You make a banner with your symbol on.") + return@onUseWith true + } else { + return@onUseWith false + } + } + } + return@onUseWith true + } } } \ No newline at end of file