summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-04-29 08:40:09 -0300
committerJesusaves <cpntb1@ymail.com>2019-04-29 08:40:09 -0300
commitdf24e30846bba3398a1f4a635523155b0ad49cdc (patch)
tree089c40c63df36aa4f6aadaafb4ddda00f50365d1
parent96e3f4212f361a02b4c6d0330fc41b9b0dea5daf (diff)
downloadserverdata-df24e30846bba3398a1f4a635523155b0ad49cdc.tar.gz
serverdata-df24e30846bba3398a1f4a635523155b0ad49cdc.tar.bz2
serverdata-df24e30846bba3398a1f4a635523155b0ad49cdc.tar.xz
serverdata-df24e30846bba3398a1f4a635523155b0ad49cdc.zip
Experiment - Deprecate areamonster and use siege_spawn
-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",