Skip to content

Commit bd5e870

Browse files
committed
Fix basiliskAndCockatrice.kts
1 parent ada6379 commit bd5e870

File tree

1 file changed

+27
-17
lines changed

1 file changed

+27
-17
lines changed

src/main/kotlin/game/game/combat/npcHooks/basiliskAndCockatrice.kts

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import api.combat.npc.NpcCombatHandler.combat
44
import api.predef.*
55
import io.luna.Luna
66
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
79
import io.luna.util.RandomUtils
810

911
if (Luna.settings().skills().slayerEquipmentNeeded()) {
@@ -28,30 +30,38 @@ if (Luna.settings().skills().slayerEquipmentNeeded()) {
2830
* Handles basilisk and cockatrice attack effects.
2931
*
3032
* When a player is attacked without a mirror shield equipped, the NPC has a chance to apply stat drains to one
31-
* or more combat skills and notify the player that they have been weakened.
33+
* or more combat skills, notify the player that they have been weakened, and deal a much more accurate attack.
3234
*/
3335
combat(id) {
3436
attack {
3537
melee {
36-
if (other is Player && other.equipment.shield?.id != MIRROR_SHIELD && RandomUtils.random()) {
38+
if (other is Player && other.equipment.shield?.id != MIRROR_SHIELD) {
3739
if (RandomUtils.random()) {
38-
other.attack.adjustLevel(-rand(10, 20))
40+
if (RandomUtils.random()) {
41+
other.attack.adjustLevel(-rand(10, 20))
42+
}
43+
if (RandomUtils.random()) {
44+
other.strength.adjustLevel(-rand(10, 20))
45+
}
46+
if (RandomUtils.random()) {
47+
other.defence.adjustLevel(-rand(10, 20))
48+
}
49+
if (RandomUtils.random()) {
50+
other.ranged.adjustLevel(-rand(10, 20))
51+
}
52+
if (RandomUtils.random()) {
53+
other.magic.adjustLevel(-rand(10, 20))
54+
}
55+
other.sendMessage("You have been weakened.")
3956
}
40-
if (RandomUtils.random()) {
41-
other.strength.adjustLevel(-rand(10, 20))
42-
}
43-
if (RandomUtils.random()) {
44-
other.defence.adjustLevel(-rand(10, 20))
45-
}
46-
if (RandomUtils.random()) {
47-
other.ranged.adjustLevel(-rand(10, 20))
48-
}
49-
if (RandomUtils.random()) {
50-
other.magic.adjustLevel(-rand(10, 20))
51-
}
52-
other.sendMessage("You have been weakened.")
57+
CombatDamageRequest.Builder(attacker, victim, CombatDamageType.MELEE)
58+
.setBaseMaxHit(11)
59+
.setBaseAccuracy(0.9)
60+
.build().resolve()
61+
} else {
62+
it
5363
}
54-
it
64+
5565
}
5666
}
5767
}

0 commit comments

Comments
 (0)