summaryrefslogtreecommitdiff
path: root/npc/006-7
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-12-25 12:29:02 -0300
committerJesusaves <cpntb1@ymail.com>2021-12-25 12:29:02 -0300
commitc62b1528b982bdb9d397c393d35ff68ecb7bd88b (patch)
treecb05727b3ed7df4594b59caafd93b8bc2ab05020 /npc/006-7
parent4475fbe47c2ac50706656fc772aae863a6f40932 (diff)
downloadserverdata-c62b1528b982bdb9d397c393d35ff68ecb7bd88b.tar.gz
serverdata-c62b1528b982bdb9d397c393d35ff68ecb7bd88b.tar.bz2
serverdata-c62b1528b982bdb9d397c393d35ff68ecb7bd88b.tar.xz
serverdata-c62b1528b982bdb9d397c393d35ff68ecb7bd88b.zip
Find the tanker and a random target for skills.
Diffstat (limited to 'npc/006-7')
-rw-r--r--npc/006-7/ctrl.txt24
1 files changed, 23 insertions, 1 deletions
diff --git a/npc/006-7/ctrl.txt b/npc/006-7/ctrl.txt
index 3217e432e..a8c58dd89 100644
--- a/npc/006-7/ctrl.txt
+++ b/npc/006-7/ctrl.txt
@@ -104,19 +104,39 @@ OnTimer5000:
/* Prepare some data */
.@hp = getunitdata(.BOSS, UDT_HP) * 100 / getunitdata(.BOSS, UDT_MAXHP);
+ getmapxy(.@m$, .@x, .@y, UNITTYPE_MOB, .BOSS);
+ .@c=getunits(BL_PC, .@pcs, MAX_CYCLE_PC, .@m$);
+ .@mvp=0;.@rnd=0;.@def=0;
+ for (.@i = 0; .@i < .@c; .@i++) {
+ if (!.@rnd || !rand2(.@c))
+ .@rnd=.@pcs[.@i];
+ if (getunitdata(.@pcs[.@i], UDT_DEF) > .@def) {
+ if (getunitdata(.@pcs[.@i], UDT_HP) < 1) continue;
+ .@mvp=.@pcs[.@i];
+ .@def=getunitdata(.@pcs[.@i], UDT_DEF);
+ }
+ }
.beats += 1;
+ /* Everyone is dead, get rid of them */
+ if (!.@mvp || !.@rnd) {
+ mapwarp("006-7", "006-6", 40, 36);
+ initnpctimer;
+ end;
+ }
+
/* Decide the skill to use based on ~5s beats over 3 minutes */
switch (.beats % 18) {
// Summon Reinforcements (every 60s)
case 0:
case 6:
case 12:
- unittalk(.BOSS, "Come forth, snow army, for the Icicle shall live forever!");
+ unittalk(.BOSS, "Come forth, ##Bsnow army##b, for the Icicle shall live forever!");
specialeffect(64, AREA, .BOSS);
sleep(500);
monster("006-7", 44, 22, strmobinfo(1, Snowman), Snowman, max(1, (11 - .@hp) / 10));
break;
+
}
initnpctimer;
@@ -126,6 +146,8 @@ OnInit:
.distance = 4;
.ticks = gettimetick(2);
.beats = 0;
+ .mvp = 0;
+ .def = 0;
end;
}