Implemented ::addxp command (admin), add xp to a skill

Implemented ::charge command (admin), get and set the charge of an item
Implemented ::setslayertask command (admin), set the slayer task npc with optional quantity
This commit is contained in:
RiL
2023-05-09 00:02:51 +00:00
committed by Ryan
parent 69f4f11bc7
commit 52633544ff
12 changed files with 228 additions and 29 deletions
@@ -8,7 +8,7 @@ import core.game.interaction.IntType
class HatStand : InteractionListener {
val hats = ItemDefinition.getDefinitions().values.filter { it.getConfiguration("equipment_slot",0) == EquipmentSlot.HAT.ordinal }.map { it.id }.toIntArray()
val hats = ItemDefinition.getDefinitions().values.filter { it.getConfiguration("equipment_slot",0) == EquipmentSlot.HEAD.ordinal }.map { it.id }.toIntArray()
val hat_stand = 374
override fun defineListeners() {
@@ -112,7 +112,7 @@ class MiningListener : InteractionListener {
chance = (chance / 1.5).toInt()
altered = true
}
val necklace = getItemFromEquipment(player, EquipmentSlot.AMULET)
val necklace = getItemFromEquipment(player, EquipmentSlot.NECK)
if (necklace != null && necklace.id in 1705..1713) {
chance = (chance / 1.5).toInt()
altered = true
@@ -178,7 +178,7 @@ class MiningSkillPulse(private val player: Player, private val node: Node) : Pul
chance = (chance / 1.5).toInt()
altered = true
}
val necklace = getItemFromEquipment(player, EquipmentSlot.AMULET)
val necklace = getItemFromEquipment(player, EquipmentSlot.NECK)
if (necklace != null && necklace.id in 1705..1713) {
chance = (chance / 1.5).toInt()
altered = true
@@ -24,10 +24,10 @@ object SlayerEquipmentFlags {
else if(hasItem(player, Items.NOSE_PEG_4168)) flags = 1
else if(hasItem(player, Items.EARMUFFS_4166)) flags = flags or (1 shl 1)
else if(hasItem(player, Items.FACE_MASK_4164)) flags = flags or (1 shl 2)
else if((getItemFromEquipment(player, EquipmentSlot.HAT)?.id ?: 0) in blackMasks) flags = flags or (1 shl 3)
else if((getItemFromEquipment(player, EquipmentSlot.HEAD)?.id ?: 0) in blackMasks) flags = flags or (1 shl 3)
else if(hasItem(player, Items.SPINY_HELMET_4551)) flags = flags or (1 shl 4)
if((getItemFromEquipment(player, EquipmentSlot.AMULET)?.id ?: 0) == Items.WITCHWOOD_ICON_8923) flags = flags or (1 shl 7)
if((getItemFromEquipment(player, EquipmentSlot.NECK)?.id ?: 0) == Items.WITCHWOOD_ICON_8923) flags = flags or (1 shl 7)
if((getItemFromEquipment(player, EquipmentSlot.SHIELD)?.id ?: 0) == Items.MIRROR_SHIELD_4156) flags = flags or (1 shl 8)
SlayerManager.getInstance(player).flags.equipmentFlags = flags
}
@@ -78,7 +78,7 @@ object SlayerEquipmentFlags {
}
private fun hasItem(player: Player, id: Int): Boolean{
return (getItemFromEquipment(player, EquipmentSlot.HAT)?.id ?: 0) == id
return (getItemFromEquipment(player, EquipmentSlot.HEAD)?.id ?: 0) == id
}
fun isSlayerEq(item: Int): Boolean{