mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-23 03:15:10 -06:00
Easel done
This commit is contained in:
parent
cf8e90651b
commit
09bde242d5
1 changed files with 37 additions and 11 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue