summaryrefslogtreecommitdiff
path: root/npc/functions/mkbot.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/mkbot.txt')
-rw-r--r--npc/functions/mkbot.txt45
1 files changed, 13 insertions, 32 deletions
diff --git a/npc/functions/mkbot.txt b/npc/functions/mkbot.txt
index 1229dfd60..f396d823a 100644
--- a/npc/functions/mkbot.txt
+++ b/npc/functions/mkbot.txt
@@ -140,7 +140,7 @@ OnTimer90000:
}
// Monster King will not warp around for sightseeing if he is threatened
- if ($GAME_STORYLINE > 2 && $@MK_AGGRO < 250) {
+ if ($GAME_STORYLINE > 2 && $@MK_AGGRO < 150) {
.mp$="boss";.@x=45;.@y=45;
}
@@ -162,9 +162,10 @@ OnTimer90000:
end;
}
- // Siege events (req. 700 aggro, 3 users, and 75% chances to begin)
- if ($@MK_AGGRO >= ($GAME_STORYLINE == 2 ? 700 : 2100) && .users >= 3 && rand2(0,100) < 75 &&
- is_between(1, 4, $GAME_STORYLINE) && $@MK_THROTTLE < gettimetick(2)){
+ // Siege events (req. 300 aggro, 3 users, and 70% chances to begin)
+ if ($@MK_AGGRO >= ($GAME_STORYLINE == 2 ? 300 : 900) && .users >= 3 && rand2(0,100) < 70 &&
+ is_between(1, 4, $GAME_STORYLINE) && $@MK_THROTTLE < gettimetick(2) &&
+ $@MK_TRIGGERED){
// Delta handles the compulsory wait time between waves.
// 7 hours normally, 24 hours if the army is in disarray.
.@delta=7;
@@ -202,8 +203,8 @@ OnTimer90000:
}
// If a player is nearby while the Monster King prepares, event may happen
- // Minimum 90 Aggro
- if (.nearby > 1 && $@MK_AGGRO >= 90 &&
+ // Minimum 80 Aggro
+ if (.nearby > 1 && $@MK_AGGRO >= 80 &&
($GAME_STORYLINE == 1 || ($GAME_STORYLINE >= 3 && $@MK_THROTTLE >= gettimetick(2)) )){
// We should decide event kind, but that's NYI
announce ("Monster King: I smell humans! Humans must die!"), bc_map|bc_npc;
@@ -211,9 +212,11 @@ OnTimer90000:
getmapxy(.@m$, .@x, .@y, UNITTYPE_MOB, $@MK);
// Spawn stuff
- areamonster(.@m$, .@x-20, .@y-20, .@x+20, .@y+20, "Monster", ManaGhost, max(60, ($@MK_AGGRO/20))+.nearby, "Monster King::OnSlaveDie");
- //$@MK_AGGRO=($@MK_AGGRO*$GAME_STORYLINE)/5;
- $@MK_AGGRO-=rand2(30, 80); // Reduce aggro, but do not deplete it
+ areamonster(.@m$, .@x-20, .@y-20, .@x+20, .@y+20, "Monster", ManaGhost, min(60, $@MK_AGGRO/10)+.nearby, "Monster King::OnSlaveDie");
+
+ // Remove some aggro. TODO: Do not remove so much aggro if it was high
+ .@diff=($@MK_AGGRO*$GAME_STORYLINE)/5;
+ $@MK_AGGRO=max(.@diff, 0);
}
// Maybe, just maybe, game storyline must be updated here
@@ -249,30 +252,8 @@ OnTimer90000:
}
// We're done, restart loop timer
+ $@MK_TRIGGERED=false;
initnpctimer;
end;
}
-// MKAggro(mobID) → Monster King aggro
-function script MKAggro {
- // Every 30 levels gives +1 to monster king aggro
- // Monsters below level 30 do not generate aggro
- .@aggro=getarg(0, killedrid);
- .@moblv=strmobinfo(3,.@aggro);
- .@aggro=min(5, .@moblv / 30);
-
- // Cycles of 30 seconds
- if (@mkaggra+30 > gettimetick(2)) {
- .@aggro -= @mkaggrb;
- if (.@aggro <= 0)
- return;
- } else {
- @mkaggrb=0;
- }
- // Increase monster king aggro and update ticks
- $@MK_AGGRO += .@aggro;
- @mkaggra=gettimetick(2);
- @mkaggrb=.@aggro + @mkaggrb;
- return;
-}
-