Fixed river troll random event failing to spawn for skillers and other low combat levels
This commit is contained in:
@@ -1,17 +1,10 @@
|
||||
package rs09.game.content.ame.events.rivertroll
|
||||
|
||||
import api.addItemOrDrop
|
||||
import api.getWorldTicks
|
||||
import api.produceGroundItem
|
||||
import core.game.node.entity.Entity
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.item.GroundItemManager
|
||||
import core.game.node.item.Item
|
||||
import core.tools.RandomFunction
|
||||
import org.rs09.consts.Items
|
||||
import rs09.game.content.ame.RandomEventNPC
|
||||
import rs09.game.content.global.WeightBasedTable
|
||||
import rs09.game.content.global.WeightedItem
|
||||
import java.lang.Integer.max
|
||||
|
||||
|
||||
val ids = 391..396
|
||||
@@ -20,7 +13,7 @@ class RiverTrollRENPC(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)
|
||||
|
||||
Reference in New Issue
Block a user