From f4010eb378293cba260eabee1c7c4951dd7774ae Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 18:26:25 -0400 Subject: add puppet check to pumpkin node controller --- world/map/npc/055-1/pumpkins.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'world/map/npc') 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; -- cgit v1.2.3-70-g09d2