mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-09 16:45:44 -07:00
Fixed river troll random event failing to spawn for skillers and other low combat levels
This commit is contained in:
parent
67339cfd7e
commit
28d9a58a6e
1 changed files with 2 additions and 9 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue