forked from 2009Scape/Server
Fixed tree spirit random event not spawning for some players
This commit is contained in:
parent
385a04a5b9
commit
01c8072e9b
1 changed files with 2 additions and 1 deletions
|
|
@ -12,6 +12,7 @@ import org.rs09.consts.Items
|
|||
import rs09.game.content.ame.RandomEventNPC
|
||||
import rs09.game.content.global.WeightBasedTable
|
||||
import rs09.game.content.global.WeightedItem
|
||||
import kotlin.math.max
|
||||
|
||||
|
||||
val ids = 438..443
|
||||
|
|
@ -20,7 +21,7 @@ class TreeSpiritRENPC(override var loot: WeightBasedTable? = null) : RandomEvent
|
|||
override fun talkTo(npc: NPC) {}
|
||||
override fun init() {
|
||||
super.init()
|
||||
val index = (player.properties.combatLevel / 20) - 1
|
||||
val index = max(0,(player.properties.combatLevel / 20) - 1)
|
||||
val id = ids.toList()[index]
|
||||
this.transform(id)
|
||||
this.attack(player)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue