Skip to content

Commit f292bae

Browse files
committed
Combat script for kurasks, turoths, and basilisks requiring specific items to do damage
1 parent b040a5f commit f292bae

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package game.combat.npcHooks
2+
3+
import api.combat.npc.NpcCombatHandler.combat
4+
import api.predef.*
5+
import io.luna.Luna
6+
import io.luna.game.model.mob.Player
7+
import io.luna.game.model.mob.combat.AmmoType
8+
9+
if (Luna.settings().skills().slayerEquipmentNeeded()) {
10+
val TUROTH = setOf(1626, 1627, 1628, 1629, 1630, 1631, 1632)
11+
val BASILISK = setOf(1616, 1617)
12+
val KURASK = setOf(1608, 1609)
13+
14+
val ALLOWED_WEAPONS = setOf(
15+
4158, // Leaf-bladed spear
16+
)
17+
18+
fun usingBroadArrows(plr: Player) = // TODO Implement broad arrow data.
19+
plr.combat.ranged.ammo.type == AmmoType.BROAD_ARROW && plr.combat.weapon.isRanged
20+
21+
for (id in TUROTH + BASILISK + KURASK) {
22+
combat(id) {
23+
defend {
24+
if (other is Player && other.equipment.weapon?.id !in ALLOWED_WEAPONS && !usingBroadArrows(other)) {
25+
damage = null
26+
other.sendMessage("Your attack seems to have no effect...")
27+
}
28+
}
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)