diff options
-rw-r--r-- | npc/000-1/exit.txt | 2 | ||||
-rw-r--r-- | npc/012-1/guards.txt | 34 | ||||
-rw-r--r-- | npc/functions/siege.txt | 8 |
3 files changed, 29 insertions, 15 deletions
diff --git a/npc/000-1/exit.txt b/npc/000-1/exit.txt index aaeed2d4e..b32e22548 100644 --- a/npc/000-1/exit.txt +++ b/npc/000-1/exit.txt @@ -29,7 +29,7 @@ OnTalkNearby: end; // Save your location to last visited town for @ucp. I won't hate you for this. -/OnSetLX: +OnSetLX: @lx=array_find(.LOCMASTER_LOC$, LOCATION$); savepoint .LOCMASTER_MAP$[@lx], .LOCMASTER_X[@lx], .LOCMASTER_Y[@lx]; end; diff --git a/npc/012-1/guards.txt b/npc/012-1/guards.txt index 1c1735bbf..8c3cc3f7a 100644 --- a/npc/012-1/guards.txt +++ b/npc/012-1/guards.txt @@ -708,16 +708,28 @@ OnTimer30000: OnTimer60000: debugmes "12k"; - if ($@SIEGE_HURNS >= 5) { - siege_selectmob(siege_calcdiff("012-1", 80), $@SIEGE_HURNS); - siege_spawn("012-1", any_of($@SIEGE_TMPMOBS), 1+$@SIEGE_HURNS, "#HurnscaldSiege::OnColonelDeath"); - mapannounce("012-1", "##1The Monster Colonel arrived!", bc_map); - } - else if ($@SIEGE_HURNS >= 1) { - siege_selectmob(siege_calcdiff("012-1", 40), $@SIEGE_HURNS); - siege_spawn("012-1", any_of($@SIEGE_TMPMOBS), 1+$@SIEGE_HURNS, "#HurnscaldSiege::OnLieutenantDeath"); - mapannounce("012-1", "##1The Monster Lieutenant arrived!", bc_map); - } + + // Setup the lieutenant/colonel level and event/designation + // It'll be 40 + Siege*5, meaning the cap is 90. + .@val=40+($@SIEGE_HURNS*5); + if (.@val > 100) + .@val=100; + if (.@val >= 80) + .@ts$="Colonel"; + else + .@ts$="Lieutenant"; + + // Select a type for them (saved as .@mobId) + siege_selectmob(siege_calcdiff("012-1", .@val), $@SIEGE_HURNS); + array_remove($@SIEGE_TMPMOBS, Bif); + array_remove($@SIEGE_TMPMOBS, CandiedSlime); + array_remove($@SIEGE_TMPMOBS, ManaGhost); + array_remove($@SIEGE_TMPMOBS, SlimeBlast); + .@mobId=any_of($@SIEGE_TMPMOBS); + + // Announce and spawn + siege_spawn("012-1", .@mobId, 1, "#HurnscaldSiege::On"+.@ts$+"Death"); + mapannounce("012-1", "##1The Monster "+.@ts$+" arrived! It is a "+strmobinfo(1, any_of($@SIEGE_TMPMOBS)), bc_map); // Clear $@SIEGE_TMPMOBS siege_selectmob(siege_calcdiff("012-1"), $@SIEGE_HURNS, TP_HURNS); @@ -767,7 +779,7 @@ OnTimer600000: $@MK_AGGRO=$@MK_AGGRO/20; mapannounce("012-1", "##1The Monster King army is preparing to withdraw!", bc_map); end; -OnTimer630000: +OnTimer150000: removemapmask "012-1", MASK_MATTACK; removemapmask "014-3", MASK_MATTACK; changemusic "012-1", "caketown.ogg"; // Restore to default diff --git a/npc/functions/siege.txt b/npc/functions/siege.txt index af6198446..3446efae0 100644 --- a/npc/functions/siege.txt +++ b/npc/functions/siege.txt @@ -31,7 +31,7 @@ function script siege_calcdiff { if (.@b > .@highest) .@highest=.@b; } - debugmes "calcdiff: Total %d Average %d Highest %d", .@bsum, (.@bsum/.@c), .@highest; + //debugmes "calcdiff: Total %d Average %d Highest %d", .@bsum, (.@bsum/.@c), .@highest; if (getarg(1,false)) return .@highest; else @@ -45,8 +45,10 @@ function script siege_push { .@mi=getarg(0); .@lv=getarg(1,0); - if ( is_between(.@lv-15, .@lv+15, strmobinfo(3, .@mi)) ) + if ( is_between(.@lv-15, .@lv+15, strmobinfo(3, .@mi)) ) { + //debugmes "Monster %s (%d) level %d ~= %d", strmobinfo(1, .@mi), .@mi, strmobinfo(3, .@mi), .@lv; array_push($@SIEGE_TMPMOBS, .@mi); + } return; } @@ -64,7 +66,7 @@ function script siege_selectmob { .@tp=getarg(2, 0); // We don't need .@dif, so we convert difficulty to levels - .@blv+=.@dif*3; + .@blv+=.@dif; deletearray $@SIEGE_TMPMOBS; setarray $@SIEGE_TMPMOBS, ManaGhost, CandiedSlime, Bif, SlimeBlast; |