From cd36a91d4484f973e4f63bf1a7bacaea700a7d46 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 17:31:28 -0400 Subject: add puppet checks for tulim castle wizards --- world/map/npc/001-2/wizards.txt | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/world/map/npc/001-2/wizards.txt b/world/map/npc/001-2/wizards.txt index 3c7d6ecf..e51e7a66 100644 --- a/world/map/npc/001-2/wizards.txt +++ b/world/map/npc/001-2/wizards.txt @@ -11,16 +11,15 @@ close; OnInit: - void - puppet("001-2", 104, 19, "Desert Mana Seed#_M", 166), - puppet("001-2", 99, 22, "Wizard#1", 355), - puppet("001-2", 92, 24, "Wizard#2", 356), - puppet("001-2", 92, 30, "Wizard#3", 357), - puppet("001-2", 99, 32, "Wizard#4", 358), - puppet("001-2", 110, 22, "Wizard#5", 359), - puppet("001-2", 117, 24, "Wizard#6", 360), - puppet("001-2", 117, 30, "Wizard#7", 361), - puppet("001-2", 110, 32, "Wizard#8", 362), - puppet("001-2", 104, 27, "Arch-Wizard#9", 354); + if (puppet("001-2", 104, 19, "Desert Mana Seed#_M", 166) < 1) mapexit; + if (puppet("001-2", 99, 22, "Wizard#1", 355) < 1) mapexit; + if (puppet("001-2", 92, 24, "Wizard#2", 356) < 1) mapexit; + if (puppet("001-2", 92, 30, "Wizard#3", 357) < 1) mapexit; + if (puppet("001-2", 99, 32, "Wizard#4", 358) < 1) mapexit; + if (puppet("001-2", 110, 22, "Wizard#5", 359) < 1) mapexit; + if (puppet("001-2", 117, 24, "Wizard#6", 360) < 1) mapexit; + if (puppet("001-2", 117, 30, "Wizard#7", 361) < 1) mapexit; + if (puppet("001-2", 110, 32, "Wizard#8", 362) < 1) mapexit; + if (puppet("001-2", 104, 27, "Arch-Wizard#9", 354) < 1) mapexit; end; } -- cgit v1.2.3-70-g09d2 From 78d7c322b8eb4125a66d31fdab833e58b35f01ec Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 17:37:56 -0400 Subject: add puppet check into easter annual quest --- world/map/npc/008-1/annualeaster.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/world/map/npc/008-1/annualeaster.txt b/world/map/npc/008-1/annualeaster.txt index 1ec95cbe..23d7611a 100644 --- a/world/map/npc/008-1/annualeaster.txt +++ b/world/map/npc/008-1/annualeaster.txt @@ -129,10 +129,14 @@ OnSpawn: set .@y, .loc[(.@e-1)+.loc[1]]; set .eID, .eID + 1; // give the egg an id set .@name$, "#--Ee"+chr(3)+.eID; - void puppet(strnpcinfo(3), .@x, .@y, .@name$, 375); // spawn the egg - initnpctimer .@name$; // init puppeteer check timer if (.eID == 2147483647) set .eID, 0; // start over if id = 0x7FFFFFFF + if (puppet(strnpcinfo(3), .@x, .@y, .@name$, 375) < 1) goto L_RetrySpawn; // spawn the egg + initnpctimer .@name$; // init puppeteer check timer + end; + +L_RetrySpawn: + addnpctimer 0, strnpcinfo(0) + "::OnSpawn"; // schedule a spawn end; S_Spawn: -- cgit v1.2.3-70-g09d2 From 81e1202d23bf0dc5a1c8f63eccf8f307ab9ca19c Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 17:40:39 -0400 Subject: add puppet check to alchemy node controller --- world/map/npc/029-2/alchemy.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/world/map/npc/029-2/alchemy.txt b/world/map/npc/029-2/alchemy.txt index b5e4732c..98ca845b 100644 --- a/world/map/npc/029-2/alchemy.txt +++ b/world/map/npc/029-2/alchemy.txt @@ -74,7 +74,7 @@ S_Spawn: if (.spawned >= .@s) goto S_Return; set .@n$, "#_Al-lab"+chr(3)+.spawned; - void puppet(.m$[.spawned], .x1[.spawned], .y1[.spawned], .@n$, 400); // TODO: make a npc like npc 400 but with hoverCursor="action" => looks better for things like crafting + if (puppet(.m$[.spawned], .x1[.spawned], .y1[.spawned], .@n$, 400) < 1) mapexit; // TODO: make a npc like npc 400 but with hoverCursor="action" => looks better for things like crafting set .spawned, .spawned + 1; if (.spawned < .@s) goto S_Spawn; -- cgit v1.2.3-70-g09d2 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(-) 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 From c30bc8dbcd7e7f089eeb06b7cebbc7d7d514ad42 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 18:27:25 -0400 Subject: add puppet check for numa (superdebug) --- world/map/npc/commands/numa.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/world/map/npc/commands/numa.txt b/world/map/npc/commands/numa.txt index e8e8cabd..78746a26 100644 --- a/world/map/npc/commands/numa.txt +++ b/world/map/npc/commands/numa.txt @@ -90,7 +90,7 @@ L_Close: OnInit: registercmd chr(ATCMD_SYMBOL) + "numa", strnpcinfo(0); registercmd chr(ATCMD_SYMBOL) + "superdebug", strnpcinfo(0); - void puppet("017-9", 30, 28, "Numa", 393); + if (puppet("017-9", 30, 28, "Numa", 393) < 1) mapexit; end; } -- cgit v1.2.3-70-g09d2 From 52f673df3f3cb64d4a32ffe5775cbe8c8783688d Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 18:32:57 -0400 Subject: add puppet check to `helorp` summon spell --- world/map/npc/magic/level2-summon-wickedmushroom.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/world/map/npc/magic/level2-summon-wickedmushroom.txt b/world/map/npc/magic/level2-summon-wickedmushroom.txt index df17742f..02442c6b 100644 --- a/world/map/npc/magic/level2-summon-wickedmushroom.txt +++ b/world/map/npc/magic/level2-summon-wickedmushroom.txt @@ -3,7 +3,7 @@ end; OnCast: - if(call("magic_checks")) end; + if(call("magic_checks")) end; if (Sp < 35) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (getskilllv(.school) < .level) end; @@ -20,6 +20,7 @@ OnCast: callfunc "magic_exp"; set .@puppet$, "#"+strnpcinfo(0)+"#"+BL_ID; set .@puppet, puppet(getmap(), POS_X, POS_Y, .@puppet$, 127); + if (.@puppet < 1) end; set .count, (@spellpower/250)+1, .@puppet; set .master, BL_ID, .@puppet; set .lifetime, @spellpower*80, .@puppet; -- cgit v1.2.3-70-g09d2 From 5a2b40ae8c5ad44349872760b60aadc620e6a6b9 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 18:33:32 -0400 Subject: add puppet check to `kalrenk` summon spell --- world/map/npc/magic/level2-summon-spiky-mushroom.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/world/map/npc/magic/level2-summon-spiky-mushroom.txt b/world/map/npc/magic/level2-summon-spiky-mushroom.txt index 39ad9ecd..5659fc32 100644 --- a/world/map/npc/magic/level2-summon-spiky-mushroom.txt +++ b/world/map/npc/magic/level2-summon-spiky-mushroom.txt @@ -3,7 +3,7 @@ end; OnCast: - if(call("magic_checks")) end; + if(call("magic_checks")) end; if (Sp < 33) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (getskilllv(.school) < .level) end; @@ -19,6 +19,7 @@ OnCast: callfunc "magic_exp"; set .@puppet$, "#"+strnpcinfo(0)+"#"+BL_ID; set .@puppet, puppet(getmap(), POS_X, POS_Y, .@puppet$, 127); + if (.@puppet < 1) end; set .count, (@spellpower/120)+1, .@puppet; set .master, BL_ID, .@puppet; set .lifetime, @spellpower*400, .@puppet; -- cgit v1.2.3-70-g09d2 From fdbf26f3203d1298314c1ecdc2fd6942b1f12d17 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 18:34:07 -0400 Subject: add puppet check to `halhiss` summon spell --- world/map/npc/magic/level2-summon-snakes.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/world/map/npc/magic/level2-summon-snakes.txt b/world/map/npc/magic/level2-summon-snakes.txt index 7490c506..2c46f28b 100644 --- a/world/map/npc/magic/level2-summon-snakes.txt +++ b/world/map/npc/magic/level2-summon-snakes.txt @@ -3,7 +3,7 @@ end; OnCast: - if(call("magic_checks")) end; + if(call("magic_checks")) end; if (Sp < 40) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (getskilllv(.school) < .level) end; @@ -20,6 +20,7 @@ OnCast: callfunc "magic_exp"; set .@puppet$, "#"+strnpcinfo(0)+"#"+BL_ID; set .@puppet, puppet(getmap(), POS_X, POS_Y, .@puppet$, 127); + if (.@puppet < 1) end; set .count, (@spellpower/300)+1, .@puppet; set .master, BL_ID, .@puppet; set .lifetime, @spellpower*80, .@puppet; -- cgit v1.2.3-70-g09d2 From 5c3108a608e85e7534eeb0e282143ab530a6674e Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 18:34:26 -0400 Subject: add puppet check to `kalgina` summon spell --- world/map/npc/magic/level2-summon-pinkie.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/world/map/npc/magic/level2-summon-pinkie.txt b/world/map/npc/magic/level2-summon-pinkie.txt index b91ec1d9..785c8364 100644 --- a/world/map/npc/magic/level2-summon-pinkie.txt +++ b/world/map/npc/magic/level2-summon-pinkie.txt @@ -3,7 +3,7 @@ end; OnCast: - if(call("magic_checks")) end; + if(call("magic_checks")) end; if (Sp < 35) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (getskilllv(.school) < .level) end; @@ -19,6 +19,7 @@ OnCast: callfunc "magic_exp"; set .@puppet$, "#"+strnpcinfo(0)+"#"+BL_ID; set .@puppet, puppet(getmap(), POS_X, POS_Y, .@puppet$, 127); + if (.@puppet < 1) end; set .count, (@spellpower/120)+1, .@puppet; set .master, BL_ID, .@puppet; set .lifetime, @spellpower*150, .@puppet; -- cgit v1.2.3-70-g09d2 From 6b59dd5455ac2af31badba6c7c71aac775f54430 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 18:34:48 -0400 Subject: add puppet check to `kalboo` summon spell --- world/map/npc/magic/level2-summon-mouboo.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/world/map/npc/magic/level2-summon-mouboo.txt b/world/map/npc/magic/level2-summon-mouboo.txt index 8eb074c6..f6a68fcf 100644 --- a/world/map/npc/magic/level2-summon-mouboo.txt +++ b/world/map/npc/magic/level2-summon-mouboo.txt @@ -3,7 +3,7 @@ end; OnCast: - if(call("magic_checks")) end; + if(call("magic_checks")) end; if (Sp < 35) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (getskilllv(.school) < .level) end; @@ -19,6 +19,7 @@ OnCast: callfunc "magic_exp"; set .@puppet$, "#"+strnpcinfo(0)+"#"+BL_ID; set .@puppet, puppet(getmap(), POS_X, POS_Y, .@puppet$, 127); + if (.@puppet < 1) end; set .count, (@spellpower/270)+1, .@puppet; set .master, BL_ID, .@puppet; set .lifetime, @spellpower*100, .@puppet; -- cgit v1.2.3-70-g09d2 From bfb9fd865b2e299c828bc7441376a891005b31a5 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 18:35:17 -0400 Subject: add puppet check to `kalakarenk` summon spell --- world/map/npc/magic/level2-summon-fluffies.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/world/map/npc/magic/level2-summon-fluffies.txt b/world/map/npc/magic/level2-summon-fluffies.txt index cd754e33..2ca630ed 100644 --- a/world/map/npc/magic/level2-summon-fluffies.txt +++ b/world/map/npc/magic/level2-summon-fluffies.txt @@ -3,7 +3,7 @@ end; OnCast: - if(call("magic_checks")) end; + if(call("magic_checks")) end; if (Sp < 39) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (getskilllv(.school) < .level) end; @@ -19,6 +19,7 @@ OnCast: callfunc "magic_exp"; set .@puppet$, "#"+strnpcinfo(0)+"#"+BL_ID; set .@puppet, puppet(getmap(), POS_X, POS_Y, .@puppet$, 127); + if (.@puppet < 1) end; set .count, (@spellpower/170)+1+(@spellpower/430), .@puppet; set .master, BL_ID, .@puppet; set .lifetime, @spellpower*350, .@puppet; -- cgit v1.2.3-70-g09d2 From aa92963e97d1c1fcb632b081be485dfe1aa7ba72 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 18:37:13 -0400 Subject: add puppet check to `frillyar` spell --- world/map/npc/magic/level2-arrow-hail.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/world/map/npc/magic/level2-arrow-hail.txt b/world/map/npc/magic/level2-arrow-hail.txt index c7deb852..35cd584e 100644 --- a/world/map/npc/magic/level2-arrow-hail.txt +++ b/world/map/npc/magic/level2-arrow-hail.txt @@ -32,6 +32,7 @@ OnCast: callfunc "magic_exp"; misceffect FX_MAGIC_BLACK, strcharinfo(0); set @spell_npc, puppet(getmap(), POS_X, POS_Y, @new_npc_name$, 127); // clone npc => get puppet id + if (@spell_npc < 1) end; set .max_hit, (@spellpower / 8), @spell_npc; // set .max_hit in the puppet set .caster, getcharid(3), @spell_npc; // tell the puppet who controls it set .damage, 125, @spell_npc; -- cgit v1.2.3-70-g09d2 From f26426d583414ff8c334ce2d1147c28e262d1b21 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 18:37:23 -0400 Subject: add puppet check to `kaflosh` spell --- world/map/npc/magic/level2-rain.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/world/map/npc/magic/level2-rain.txt b/world/map/npc/magic/level2-rain.txt index 9a498c08..9e62782d 100644 --- a/world/map/npc/magic/level2-rain.txt +++ b/world/map/npc/magic/level2-rain.txt @@ -29,6 +29,7 @@ OnCast: callfunc "magic_exp"; misceffect FX_MAGIC_GREEN, strcharinfo(0); set @spell_npc, puppet(getmap(), POS_X, POS_Y, @new_npc_name$, 127); // clone npc => get puppet id + if (@spell_npc < 1) end; set .caster, getcharid(3), @spell_npc; // tell the puppet who controls it set .radius, @krad, @spell_npc; // this is also used by ingrav, don't rename set .initial_x, POS_X, @spell_npc; -- cgit v1.2.3-70-g09d2 From 3ad45c53e32f0700f68c429fd818372d9892c6d8 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 18:37:55 -0400 Subject: add puppet check to `kalmurk` summon spell --- world/map/npc/magic/level1-summon-maggots.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/world/map/npc/magic/level1-summon-maggots.txt b/world/map/npc/magic/level1-summon-maggots.txt index aa4e646f..49022635 100644 --- a/world/map/npc/magic/level1-summon-maggots.txt +++ b/world/map/npc/magic/level1-summon-maggots.txt @@ -18,6 +18,7 @@ OnCast: callfunc "magic_exp"; set .@puppet$, "#"+strnpcinfo(0)+"#"+BL_ID; set .@puppet, puppet(getmap(), POS_X, POS_Y, .@puppet$, 127); + if (.@puppet < 1) end; set .count, ((sqrt(@spellpower)+(@spellpower/15))/5)+1, .@puppet; set .master, BL_ID, .@puppet; set .lifetime, (@spellpower*50)+10000, .@puppet; -- cgit v1.2.3-70-g09d2