summaryrefslogtreecommitdiff
path: root/world/map
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-04-30 18:26:25 -0400
committermekolat <mekolat@users.noreply.github.com>2016-05-02 16:14:55 -0400
commitf4010eb378293cba260eabee1c7c4951dd7774ae (patch)
tree90ebccdc83b137da3f00fceedae2e6774287267e /world/map
parent81e1202d23bf0dc5a1c8f63eccf8f307ab9ca19c (diff)
downloadserverdata-f4010eb378293cba260eabee1c7c4951dd7774ae.tar.gz
serverdata-f4010eb378293cba260eabee1c7c4951dd7774ae.tar.bz2
serverdata-f4010eb378293cba260eabee1c7c4951dd7774ae.tar.xz
serverdata-f4010eb378293cba260eabee1c7c4951dd7774ae.zip
add puppet check to pumpkin node controller
Diffstat (limited to 'world/map')
-rw-r--r--world/map/npc/055-1/pumpkins.txt7
1 files changed, 4 insertions, 3 deletions
diff --git a/world/map/npc/055-1/pumpkins.txt b/world/map/npc/055-1/pumpkins.txt
index 1c2535f7..87dfca4c 100644
--- a/world/map/npc/055-1/pumpkins.txt
+++ b/world/map/npc/055-1/pumpkins.txt
@@ -83,6 +83,8 @@ OnReallyDestroy:
S_MakeNode:
set .nID, .nID + 1; // give the node an id
set .@name$, "#_Pkin" + chr(3) + .nID;
+ if (.nID == 2147483647)
+ set .nID, 0; // start over if id = 0x7FFFFFFF
goto S_FindXY;
S_FindXY:
@@ -94,13 +96,13 @@ S_FindXY:
S_ReallySpawn:
set .@p, puppet(.m$[.i], .@x, .@y, .@name$, 32767); // spawn the node (but not on map, because 32767)
+ if (.@p < 1) goto S_MakeNode; // silently retry
disablenpc .@name$; // make sure it can't be clicked by guessing the being id
set .i, .i, .@p; // tell the puppet what object contains it
set .death_t, rand(.death_t/2, .death_t), .@p; // tell the puppet when to die
set .@timer, if_then_else(.done_initial[.i], rand(.appear_t/2, .appear_t), 0); // timer depends on if first spawn or if respawned after death
addnpctimer .@timer, .@name$+"::OnAppear"; // we spawn the node instantly but it only appears after the timer
- if (.nID == 2147483647)
- set .nID, 0; // start over if id = 0x7FFFFFFF
+ set .nodes[.i], .nodes[.i] + 1;
return;
S_IterateObjects:
@@ -112,7 +114,6 @@ S_IterateObjects:
if (.nodes[.i] >= .max_nodes[.i])
goto S_NextObject;
- set .nodes[.i], .nodes[.i] + 1;
callsub S_MakeNode;
if (.nodes[.i] < if_then_else(.done_initial[.i], .min_nodes[.i], .max_nodes[.i]))
goto S_IterateObjects;