File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed
src/main/kotlin/game/game/combat/npcHooks Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 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.damage.CombatDamageRequest
8+ import io.luna.game.model.mob.combat.damage.CombatDamageType
9+ import kotlin.math.floor
10+
11+ if (Luna .settings().skills().slayerEquipmentNeeded()) {
12+
13+ /* *
14+ * The slayer gloves item id.
15+ */
16+ val SLAYER_GLOVES = 6708
17+
18+ /* *
19+ * Applies the fever spider glove penalty.
20+ *
21+ * If the victim is a player and is not wearing slayer gloves, the spider:
22+ * - Poisons the player if they are not already poisoned
23+ * - Adds bonus damage equal to 12.5% of the player's current hitpoints
24+ * - Forces the hit to use perfect base accuracy
25+ *
26+ * Players wearing slayer gloves use the normal melee damage request unchanged.
27+ */
28+ combat(2850 ) {
29+ attack {
30+ melee {
31+ if (other is Player && other.equipment.hands?.id != SLAYER_GLOVES ) {
32+ if (other.combat.poisonSeverity == 0 ) {
33+ other.combat.poisonSeverity = 20
34+ }
35+
36+ CombatDamageRequest .Builder (attacker, victim, CombatDamageType .MELEE )
37+ .setBaseMaxHit(5 )
38+ .setFlatBonusDamage(floor(0.125 * other.health).toInt())
39+ .setBaseAccuracy(1.0 )
40+ .build().resolve()
41+ } else {
42+ it
43+ }
44+ }
45+ }
46+ }
47+ }
You can’t perform that action at this time.
0 commit comments