diff --git a/Server/src/main/kotlin/rs09/game/node/entity/npc/other/HonourGuardGFI.kt b/Server/src/main/kotlin/rs09/game/node/entity/npc/other/HonourGuardGFI.kt new file mode 100644 index 000000000..deba6ad9e --- /dev/null +++ b/Server/src/main/kotlin/rs09/game/node/entity/npc/other/HonourGuardGFI.kt @@ -0,0 +1,40 @@ +package rs09.game.node.entity.npc.other + +import api.ContentAPI +import core.game.node.entity.npc.AbstractNPC +import core.game.world.map.Location +import core.plugin.Initializable +import core.tools.RandomFunction +import org.rs09.consts.NPCs + +@Initializable +class HonourGuardGFI : AbstractNPC { + //Constructor spaghetti because Arios I guess + constructor() : super(NPCs.HONOUR_GUARD_5514, null, true) {} + private constructor(id: Int, location: Location) : super(id, location) {} + + override fun construct(id: Int, location: Location, vararg objects: Any?): AbstractNPC { + return HonourGuardGFI(id, location) + } + + override fun getIds(): IntArray { + return intArrayOf(NPCs.HONOUR_GUARD_5514,NPCs.HONOUR_GUARD_5515,NPCs.HONOUR_GUARD_5516,NPCs.HONOUR_GUARD_5517) + } + + override fun tick() { + if(isActive && !inCombat() && RandomFunction.roll(10)){ + val localTrolls = ContentAPI.findLocalNPCs(this, intArrayOf(NPCs.ICE_TROLL_FEMALE_5523, NPCs.ICE_TROLL_MALE_5522, NPCs.ICE_TROLL_RUNT_5521, NPCs.ICE_TROLL_GRUNT_5524)) + localTrolls.forEach{troll -> + if(troll.location.withinDistance(location,6)) { + attack(troll) + return super.tick() + } + } + } + if(!isActive){ + properties.combatPulse.stop() + } + return super.tick() + } + +} \ No newline at end of file diff --git a/Server/src/main/kotlin/rs09/game/node/entity/npc/other/IceTrollGFI.kt b/Server/src/main/kotlin/rs09/game/node/entity/npc/other/IceTrollGFI.kt deleted file mode 100644 index 39b5e0783..000000000 --- a/Server/src/main/kotlin/rs09/game/node/entity/npc/other/IceTrollGFI.kt +++ /dev/null @@ -1,39 +0,0 @@ -package rs09.game.node.entity.npc.other - -import api.ContentAPI -import core.game.node.entity.npc.AbstractNPC -import core.game.world.map.Location -import core.plugin.Initializable -import core.tools.RandomFunction -import org.rs09.consts.NPCs -import rs09.game.system.SystemLogger - -@Initializable -class IceTrollGFI : AbstractNPC { - //Constructor spaghetti because Arios I guess - constructor() : super(NPCs.ICE_TROLL_MALE_5522, null, true) {} - private constructor(id: Int, location: Location) : super(id, location) {} - - override fun construct(id: Int, location: Location, vararg objects: Any?): AbstractNPC { - return IceTrollGFI(id, location) - } - - override fun getIds(): IntArray { - return intArrayOf(NPCs.ICE_TROLL_FEMALE_5523, NPCs.ICE_TROLL_MALE_5522, NPCs.ICE_TROLL_RUNT_5521, NPCs.ICE_TROLL_GRUNT_5524) - } - - override fun tick() { - if(isActive && !inCombat() && RandomFunction.roll(20)){ - val localGuards = ContentAPI.findLocalNPCs(this, intArrayOf(NPCs.HONOUR_GUARD_5514,NPCs.HONOUR_GUARD_5515,NPCs.HONOUR_GUARD_5516,NPCs.HONOUR_GUARD_5517)) - localGuards.forEach{guard -> - SystemLogger.logInfo("Looping guards...") - if(guard.location.withinDistance(location,6)) { - attack(guard) - return super.tick() - } - } - } - return super.tick() - } - -} \ No newline at end of file