summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/003-1/lieutenantdausen.txt3
-rw-r--r--npc/009-1/guards.txt1
-rw-r--r--npc/012-1/guards.txt1
-rw-r--r--npc/020-1/guards.txt1
-rw-r--r--npc/functions/siege.txt54
5 files changed, 38 insertions, 22 deletions
diff --git a/npc/003-1/lieutenantdausen.txt b/npc/003-1/lieutenantdausen.txt
index f4f6bfca9..9c7ebe81e 100644
--- a/npc/003-1/lieutenantdausen.txt
+++ b/npc/003-1/lieutenantdausen.txt
@@ -132,9 +132,6 @@ OnGuardDeath:
end;
OnMKSiege:
- $@SIEGE_TULIM=rand(1,10);
- // Reduce difficulty here so it ranges from 1~6 instead of 1~10, with higher chances at 2~5 range.
- $@SIEGE_TULIM=($@SIEGE_TULIM/2)+1;
OnStartSiege:
kamibroadcast(col("WARNING! WARNING! Monster Army marching towards Tulimshar!!",1));
do_siege("003-1", "004-3", "TULIM", TP_TULIM, .name$, .siegetime);
diff --git a/npc/009-1/guards.txt b/npc/009-1/guards.txt
index 1e42f0f88..7803e32e4 100644
--- a/npc/009-1/guards.txt
+++ b/npc/009-1/guards.txt
@@ -60,7 +60,6 @@ L_MKControl:
close;
OnMKSiege:
- $@SIEGE_HALIN=rand(1,10);
OnStartSiege:
kamibroadcast(col("WARNING! WARNING! Monster Army marching towards Halinarzo!!",1));
do_siege("009-1", "010-2", "HALIN", TP_TULIM, .name$, .siegetime);
diff --git a/npc/012-1/guards.txt b/npc/012-1/guards.txt
index 8b3052edd..e0b4f693d 100644
--- a/npc/012-1/guards.txt
+++ b/npc/012-1/guards.txt
@@ -600,7 +600,6 @@ OnInit:
// Begin Siege
OnMKSiege:
- $@SIEGE_HURNS=rand(1,10);
OnStartSiege:
kamibroadcast(col("WARNING! WARNING! Monster Army marching towards Hurnscald!!",1));
do_siege("012-1", "014-3", "HURNS", TP_HURNS, .name$, .siegetime);
diff --git a/npc/020-1/guards.txt b/npc/020-1/guards.txt
index 0f9ad9d02..2d9d820ff 100644
--- a/npc/020-1/guards.txt
+++ b/npc/020-1/guards.txt
@@ -32,7 +32,6 @@ L_MKControl:
OnMKSiege:
- $@SIEGE_NIVAL=rand(1,10);
OnStartSiege:
kamibroadcast(col("WARNING! WARNING! Monster Army marching towards Nivalis!!",1));
do_siege("020-1", "019-2", "NIVAL", TP_NIVAL, .name$, .siegetime);
diff --git a/npc/functions/siege.txt b/npc/functions/siege.txt
index a8e2721de..06a250267 100644
--- a/npc/functions/siege.txt
+++ b/npc/functions/siege.txt
@@ -179,8 +179,13 @@ function script siege_check {
// Players failed, so reduce score in 1
if (.@mb) {
- $MK_TEMPVAR-=1;
- kamibroadcast("Players failed to defend the city!!"+.@mb);
+ if ($GAME_STORYLINE == 2)
+ $MK_TEMPVAR-=1;
+ kamibroadcast("Players failed to defend the city!!");
+ debugmes "Number of boss grade monsters found: %d", .@mb;
+ $SIEGE_DIFFICULTY-=1;
+ } else {
+ $SIEGE_DIFFICULTY+=1;
}
return;
}
@@ -355,13 +360,25 @@ function script do_siege {
.@n$=getarg(4);
.@t=getarg(5);
+ // In past, we had a $@SIEGE_<town> to determine difficulty
+ // This behavior is now deprecated, we use a global $SIEGE_DIFFICULTY
+ // Which raises in 1 every victory and lowers in 1 every defeat (capped at 1)
+ if (!getd("$@SIEGE_"+.@c$)) {
+ .@difc=max(1, getd("$SIEGE_DIFFICULTY"));
+
+ // And then, we reset $@SIEGE_<town> so it can be manipulated
+ // And set .@difc to this value
+ setd("$@SIEGE_"+.@c$, .@difc);
+ .@difc=getd("$@SIEGE_"+.@c$);
+ }
+
switch (.@t) {
// Warmup
case 70:
case 95:
- siege_cast(.@m$, .@n$, getd("$@SIEGE_"+.@c$), .@tp);
+ siege_cast(.@m$, .@n$, .@difc, .@tp);
case 35:
- siege_cast(.@o$, .@n$, getd("$@SIEGE_"+.@c$), .@tp);
+ siege_cast(.@o$, .@n$, .@difc, .@tp);
break;
// Setup and casts
case 0:
@@ -374,19 +391,19 @@ function script do_siege {
mapannounce(.@m$, "##2Message to all NPCs in town: Take shelter!", bc_map);
break;
case 90:
- siege_cast(.@m$, .@n$, getd("$@SIEGE_"+.@c$), .@tp);
- siege_cast(.@o$, .@n$, getd("$@SIEGE_"+.@c$), .@tp);
+ siege_cast(.@m$, .@n$, .@difc, .@tp);
+ siege_cast(.@o$, .@n$, .@difc, .@tp);
break;
// Boss stage
case 280:
- siege_boss(.@m$, getd("$@SIEGE_"+.@c$));
- siege_cast(.@m$, .@n$, getd("$@SIEGE_"+.@c$), .@tp);
+ siege_boss(.@m$, .@difc);
+ siege_cast(.@m$, .@n$, .@difc, .@tp);
break;
// Difficulty Raisers
case 310:
case 520:
case 640:
- .@varsig=getd("$@SIEGE_"+.@c$);
+ .@varsig=.@difc;
setd("$@SIEGE_"+.@c$, .@varsig+1);
// Regular flow
case 195:
@@ -404,13 +421,13 @@ function script do_siege {
case 625:
//case 640: difficulty raiser
case 670:
- siege_cast(.@m$, .@n$, getd("$@SIEGE_"+.@c$), .@tp);
+ siege_cast(.@m$, .@n$, .@difc, .@tp);
break;
// Ending flow
// TODO: It would be better to make these values relative to MK_SIEGE_DURATION
case 700:
mapannounce("012-1", "##1The Monster Army is planning to retreat soon!", bc_map);
- siege_cast(.@m$, .@n$, getd("$@SIEGE_"+.@c$), .@tp);
+ siege_cast(.@m$, .@n$, .@difc, .@tp);
break;
case 760:
mapannounce("012-1", "##1The Monster Army is withdrawing within 30 seconds!", bc_map);
@@ -444,32 +461,37 @@ OnRespawn:
// Boss Death Labels
OnSergeantDeath:
- $MK_TEMPVAR+=1;
+ if ($GAME_STORYLINE == 2)
+ $MK_TEMPVAR+=1;
getitem StrangeCoin, rand(1,5);
announce("##2The Monster Sergeant was defeated by "+strcharinfo(0)+"!", bc_all);
end;
OnLieutenantDeath:
- $MK_TEMPVAR+=3;
+ if ($GAME_STORYLINE == 2)
+ $MK_TEMPVAR+=3;
getitem StrangeCoin, rand(5,10);
announce("##2The Monster Lieutenant was defeated by "+strcharinfo(0)+"!", bc_all);
end;
OnCaptainDeath:
- $MK_TEMPVAR+=5;
+ if ($GAME_STORYLINE == 2)
+ $MK_TEMPVAR+=5;
getitem StrangeCoin, rand(10,15);
announce("##2The Monster Captain was defeated by "+strcharinfo(0)+"!", bc_all);
end;
OnColonelDeath:
- $MK_TEMPVAR+=7;
+ if ($GAME_STORYLINE == 2)
+ $MK_TEMPVAR+=7;
getitem StrangeCoin, rand(15,20);
$MOST_HEROIC$=strcharinfo(0);
announce("##2The Monster Colonel was defeated by "+strcharinfo(0)+"!", bc_all);
end;
OnGeneralDeath:
- $MK_TEMPVAR+=9;
+ if ($GAME_STORYLINE == 2)
+ $MK_TEMPVAR+=9;
getitem StrangeCoin, rand(20,25);
$MOST_HEROIC$=strcharinfo(0);
announce("##2The Monster General was defeated by "+strcharinfo(0)+"!", bc_all);