summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/012-1/guards.txt26
-rw-r--r--npc/functions/siege.txt19
-rw-r--r--npc/scripts.conf1
3 files changed, 33 insertions, 13 deletions
diff --git a/npc/012-1/guards.txt b/npc/012-1/guards.txt
index f6b3e1ef4..bd9937d01 100644
--- a/npc/012-1/guards.txt
+++ b/npc/012-1/guards.txt
@@ -593,35 +593,35 @@ OnInit:
012-1,0,0,0 script #HurnscaldSiege NPC_HIDDEN,{
end;
OnBlackScorpionDeath:
- areamonster("014-3", 20, 20, getmapinfo(MAPINFO_SIZE_X)-20, getmapinfo(MAPINFO_SIZE_Y)-20, strmobinfo(1, BlackScorpion), BlackScorpion, 1, "#HurnscaldSiege::OnBlackScorpionDeath");
+ siege_spawn("014-3", BlackScorpion, 1, "#HurnscaldSiege::OnBlackScorpionDeath");
getmapxy(.@m$,.@x,.@y,3);
if (rand(10000) <= 90+($@SIEGE_HURNS*100))
makeitem StrangeCoin, 1, .@m$, .@x, .@y;
end;
OnBlackScorpion2Death:
- areamonster("012-1", 20, 20, getmapinfo(MAPINFO_SIZE_X)-20, getmapinfo(MAPINFO_SIZE_Y)-20, strmobinfo(1, BlackScorpion), BlackScorpion, 1, "#HurnscaldSiege::OnBlackScorpion2Death");
+ siege_spawn("012-1", BlackScorpion, 1, "#HurnscaldSiege::OnBlackScorpion2Death");
getmapxy(.@m$,.@x,.@y,3);
if (rand(10000) <= 850+($@SIEGE_HURNS*100))
makeitem StrangeCoin, 1, .@m$, .@x, .@y;
end;
OnGreenSlimeDeath:
- areamonster("012-1", 20, 20, getmapinfo(MAPINFO_SIZE_X)-20, getmapinfo(MAPINFO_SIZE_Y)-20, strmobinfo(1, GreenSlime), GreenSlime, 1, "#HurnscaldSiege::OnGreenSlimeDeath");
+ siege_spawn("012-1", GreenSlime, 1, "#HurnscaldSiege::OnGreenSlimeDeath");
getmapxy(.@m$,.@x,.@y,3);
if (rand(10000) <= 200+($@SIEGE_HURNS*100))
makeitem StrangeCoin, 1, .@m$, .@x, .@y;
end;
OnCandiedSlimeDeath:
- areamonster("012-1", 20, 20, getmapinfo(MAPINFO_SIZE_X)-20, getmapinfo(MAPINFO_SIZE_Y)-20, strmobinfo(1, CandiedSlime), CandiedSlime, 1, "#HurnscaldSiege::OnCandiedSlimeDeath");
+ siege_spawn("012-1", CandiedSlime, 1, "#HurnscaldSiege::OnCandiedSlimeDeath");
getmapxy(.@m$,.@x,.@y,3);
if (rand(10000) <= 150+($@SIEGE_HURNS*100))
makeitem StrangeCoin, 1, .@m$, .@x, .@y;
end;
OnManaGhostDeath:
- areamonster("012-1", 20, 20, getmapinfo(MAPINFO_SIZE_X)-20, getmapinfo(MAPINFO_SIZE_Y)-20, strmobinfo(1, ManaGhost), ManaGhost, 1, "#HurnscaldSiege::OnManaGhostDeath");
+ siege_spawn("012-1", ManaGhost, 1, "#HurnscaldSiege::OnManaGhostDeath");
getmapxy(.@m$,.@x,.@y,3);
if (rand(10000) <= 900+($@SIEGE_HURNS*100))
makeitem StrangeCoin, 1, .@m$, .@x, .@y;
@@ -651,14 +651,14 @@ OnMKSiege:
pvpon("012-1");
pvpon("014-3");
announce(("##1WARNING! WARNING! Siege starting at Hurnscald!!"), bc_all);
- areamonster("014-3", 20, 20, getmapinfo(MAPINFO_SIZE_X, "014-3")-20, getmapinfo(MAPINFO_SIZE_Y, "014-3")-20, strmobinfo(1, BlackScorpion), BlackScorpion, 10, "#HurnscaldSiege::OnBlackScorpionDeath");
+ siege_spawn("014-3", BlackScorpion, 10, "#HurnscaldSiege::OnBlackScorpionDeath");
initnpctimer;
end;
// Timers
OnTimer5000:
- areamonster("014-3", 20, 20, getmapinfo(MAPINFO_SIZE_X, "014-3")-20, getmapinfo(MAPINFO_SIZE_Y, "014-3")-20, "Black Scorpion", BlackScorpion, 5+$@SIEGE_HURNS, "#HurnscaldSiege::OnBlackScorpionDeath");
- areamonster("012-1", 20, 20, getmapinfo(MAPINFO_SIZE_X)-20, getmapinfo(MAPINFO_SIZE_Y)-20, "Black Scorpion", BlackScorpion, 5+$@SIEGE_HURNS, "#HurnscaldSiege::OnBlackScorpion2Death");
+ siege_spawn("014-3", BlackScorpion, 5+$@SIEGE_HURNS, "#HurnscaldSiege::OnBlackScorpionDeath");
+ siege_spawn("012-1", BlackScorpion, 5+$@SIEGE_HURNS, "#HurnscaldSiege::OnBlackScorpion2Death");
mapannounce("012-1", "##2Message to all Hurnscald NPCs: Take shelter!", bc_map);
disablenpc "Gwendolyn";
disablenpc "Milly";
@@ -675,8 +675,8 @@ OnTimer5000:
end;
OnTimer15000:
- areamonster("014-3", 20, 20, getmapinfo(MAPINFO_SIZE_X, "014-3")-20, getmapinfo(MAPINFO_SIZE_Y, "014-3")-20, "Black Scorpion", BlackScorpion, 5+$@SIEGE_HURNS, "#HurnscaldSiege::OnBlackScorpionDeath");
- areamonster("012-1", 20, 20, getmapinfo(MAPINFO_SIZE_X)-20, getmapinfo(MAPINFO_SIZE_Y)-20, "Black Scorpion", BlackScorpion, 5+$@SIEGE_HURNS, "#HurnscaldSiege::OnBlackScorpion2Death");
+ siege_spawn("014-3", BlackScorpion, 5+$@SIEGE_HURNS, "#HurnscaldSiege::OnBlackScorpionDeath");
+ siege_spawn("012-1", BlackScorpion, 5+$@SIEGE_HURNS, "#HurnscaldSiege::OnBlackScorpion2Death");
disablenpc "Shoppa Kep";
disablenpc "Richard";
@@ -692,9 +692,9 @@ OnTimer15000:
end;
OnTimer60000:
- areamonster("012-1", 20, 20, getmapinfo(MAPINFO_SIZE_X)-20, getmapinfo(MAPINFO_SIZE_Y)-20, ("Black Scorpion"), BlackScorpion, 3, "#HurnscaldSiege::OnBlackScorpion2Death");
- areamonster("012-1", 20, 20, getmapinfo(MAPINFO_SIZE_X)-20, getmapinfo(MAPINFO_SIZE_Y)-20, strmobinfo(1, GreenSlime), 1085, 10+$@SIEGE_HURNS, "#HurnscaldSiege::OnGreenSlimeDeath");
- areamonster("012-1", 20, 20, getmapinfo(MAPINFO_SIZE_X)-20, getmapinfo(MAPINFO_SIZE_Y)-20, strmobinfo(1, CandiedSlime), 1089, 1+$@SIEGE_HURNS, "#HurnscaldSiege::OnCandiedSlimeDeath");
+ siege_spawn("012-1", BlackScorpion, 3, "#HurnscaldSiege::OnBlackScorpion2Death");
+ siege_spawn("012-1", GreenSlime, 10+$@SIEGE_HURNS, "#HurnscaldSiege::OnGreenSlimeDeath");
+ siege_spawn("012-1", CandiedSlime, 1+$@SIEGE_HURNS, "#HurnscaldSiege::OnCandiedSlimeDeath");
end;
OnTimer120000:
diff --git a/npc/functions/siege.txt b/npc/functions/siege.txt
new file mode 100644
index 000000000..010ef0da3
--- /dev/null
+++ b/npc/functions/siege.txt
@@ -0,0 +1,19 @@
+// TMW2 scripts.
+// Authors:
+// Jesusalva
+// Description:
+// Town Siege utilities
+
+// Siege Spawn
+// Can be used anywhere to spawn on the whole map, margins respected.
+// siege_spawn( map, mobID, Amount, eventID )
+function script siege_spawn {
+ .@mp$=getarg(0);
+ .@mid=getarg(1);
+ .@qnt=getarg(2);
+ .@ev$=getarg(3);
+
+ areamonster(.@mp$, 20, 20, getmapinfo(MAPINFO_SIZE_X, .@mp$)-20, getmapinfo(MAPINFO_SIZE_Y, .@mp$)-20, strmobinfo(1, .@mid), .@mid, .@qnt, .@ev$);
+ return;
+}
+
diff --git a/npc/scripts.conf b/npc/scripts.conf
index 05a55604c..a4b89d05c 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -59,6 +59,7 @@
"npc/functions/savepoint.txt",
"npc/functions/shake.txt",
"npc/functions/shops.txt",
+"npc/functions/siege.txt",
"npc/functions/soul_menhir.txt",
"npc/functions/treasure.txt",