summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-04-29 11:36:34 -0300
committerJesusaves <cpntb1@ymail.com>2019-04-29 11:36:34 -0300
commit32b98f594ebf693e79946c14637f22fa5f12a9ca (patch)
tree1a6a8c6c29887c9eb0d58b0f7af075d6610e5397
parent3d09c81da1d9940c1682333ee07c293d00a7be24 (diff)
downloadserverdata-32b98f594ebf693e79946c14637f22fa5f12a9ca.tar.gz
serverdata-32b98f594ebf693e79946c14637f22fa5f12a9ca.tar.bz2
serverdata-32b98f594ebf693e79946c14637f22fa5f12a9ca.tar.xz
serverdata-32b98f594ebf693e79946c14637f22fa5f12a9ca.zip
siege_boss() will help me out.
-rw-r--r--npc/012-1/guards.txt41
-rw-r--r--npc/functions/siege.txt48
2 files changed, 50 insertions, 39 deletions
diff --git a/npc/012-1/guards.txt b/npc/012-1/guards.txt
index 4e72678fe..080ea00c6 100644
--- a/npc/012-1/guards.txt
+++ b/npc/012-1/guards.txt
@@ -605,9 +605,8 @@ OnRespawn:
OnMKSiege:
siege_setup("014-3");
siege_setup("012-1", "WARNING! WARNING! Siege starting at Hurnscald!!");
- disablenpc("Mana Stone");
$@SIEGE_HURNS=rand(1,10);
- siege_spawn("014-3", BlackScorpion, 10, "#HurnscaldSiege::OnBlackScorpionDeath");
+ siege_cast("014-3", .name$, 0, TP_HURNS);
initnpctimer;
end;
@@ -652,43 +651,7 @@ OnTimer60000:
end;
OnTimer120000:
- // We will now prepare the boss
- // It must be stronger than players in at least 15 levels, so the mob group
- // is different. The siege difficulty, as usual, gives an extra level to them.
- .@val=siege_calcdiff("012-1")+15;
- .@val+=$@SIEGE_HURNS;
-
- // We must cap this at 100 to prevent running out of monsters
- // Also, .@val can NEVER be less than 50, to prevent cheating :<
- if (.@val > 100)
- .@val=100;
- else if (.@val < 50)
- .@val=50;
-
- // Get their event/designation
- 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);
- if (array_entries($@SIEGE_TMPMOBS) > 0) {
- .@mobId=any_of($@SIEGE_TMPMOBS);
- } else {
- .@mobId=Yetifly;
- debugmes "ERROR, TOO FEW MOBS ON DATABASE, whaaaaaaat";
- }
-
- // Announce and spawn
- siege_spawn("012-1", .@mobId, 1, "#SiegeCtrl::On"+.@ts$+"Death");
- mapannounce("012-1", "##1The Monster "+.@ts$+" arrived! It is a "+strmobinfo(1, .@mobId), bc_map);
-
- // Clear $@SIEGE_TMPMOBS and start casting
+ siege_boss("012-1", $@SIEGE_HURNS);
siege_cast("012-1", .name$, $@SIEGE_HURNS, TP_HURNS);
end;
diff --git a/npc/functions/siege.txt b/npc/functions/siege.txt
index bf8d8ce0b..0ca53f45d 100644
--- a/npc/functions/siege.txt
+++ b/npc/functions/siege.txt
@@ -161,6 +161,54 @@ function script siege_revert {
return;
}
+// Create the Siege Boss for #SiegeCtrl utility, DO NEVER CAST TWICE
+// siege_boss ( map, difficulty )
+function script siege_boss {
+ .@m$=getarg(0);
+ .@s=getarg(1,0);
+
+ // If Difficulty is 0: There is no boss
+ if (!.@s)
+ return;
+
+ // We will now prepare the boss
+ // It must be stronger than players in at least 15 levels, so the mob group
+ // is different. The siege difficulty, as usual, gives an extra level to them.
+ .@val=siege_calcdiff(.@m$)+15;
+ .@val+=.@s;
+
+ // We must cap this at 100 to prevent running out of monsters
+ // Also, .@val can NEVER be less than 50, to prevent cheating :<
+ if (.@val > 100)
+ .@val=100;
+ else if (.@val < 50)
+ .@val=50;
+
+ // Get their event/designation
+ if (.@val >= 80)
+ .@ts$="Colonel";
+ else
+ .@ts$="Lieutenant";
+
+ // Select a type for them (saved as .@mobId)
+ siege_selectmob(siege_calcdiff(.@m$, .@val), .@s);
+ array_remove($@SIEGE_TMPMOBS, Bif);
+ array_remove($@SIEGE_TMPMOBS, CandiedSlime);
+ array_remove($@SIEGE_TMPMOBS, ManaGhost);
+ array_remove($@SIEGE_TMPMOBS, SlimeBlast);
+ if (array_entries($@SIEGE_TMPMOBS) > 0) {
+ .@mobId=any_of($@SIEGE_TMPMOBS);
+ } else {
+ .@mobId=Yetifly;
+ debugmes "ERROR, TOO FEW MOBS ON DATABASE, whaaaaaaat";
+ }
+
+ // Announce and spawn
+ siege_spawn(.@m$, .@mobId, 1, "#SiegeCtrl::On"+.@ts$+"Death");
+ mapannounce(.@m$, "##1The Monster "+.@ts$+" arrived! It is a "+strmobinfo(1, .@mobId), bc_map);
+ return;
+}
+
// Spawn some monsters
// siege_cast ( map, NPCName, {, difficulty{, tpflag}} )
function script siege_cast {