summaryrefslogtreecommitdiff
path: root/world/map/npc/029-2
diff options
context:
space:
mode:
Diffstat (limited to 'world/map/npc/029-2')
-rw-r--r--world/map/npc/029-2/_import.txt3
-rw-r--r--world/map/npc/029-2/_mobs.txt13
-rw-r--r--world/map/npc/029-2/_nodes.txt16
-rw-r--r--world/map/npc/029-2/alchemy.txt48
4 files changed, 53 insertions, 27 deletions
diff --git a/world/map/npc/029-2/_import.txt b/world/map/npc/029-2/_import.txt
index 6d67f2f7..b87b6dc1 100644
--- a/world/map/npc/029-2/_import.txt
+++ b/world/map/npc/029-2/_import.txt
@@ -2,7 +2,9 @@
// This file is generated automatically. All manually added changes will be removed when running the Converter.
map: 029-2
npc: npc/029-2/_mobs.txt
+npc: npc/029-2/_nodes.txt
npc: npc/029-2/_warps.txt
+npc: npc/029-2/alchemy.txt
npc: npc/029-2/bankroom.txt
npc: npc/029-2/barrels.txt
npc: npc/029-2/barrels_config.txt
@@ -14,4 +16,3 @@ npc: npc/029-2/sorfina.txt
npc: npc/029-2/stat_reset.txt
npc: npc/029-2/tanisha.txt
npc: npc/029-2/two_arms.txt
-npc: npc/029-2/alchemy.txt
diff --git a/world/map/npc/029-2/_mobs.txt b/world/map/npc/029-2/_mobs.txt
index 02d3fbd9..a63fae65 100644
--- a/world/map/npc/029-2/_mobs.txt
+++ b/world/map/npc/029-2/_mobs.txt
@@ -1,15 +1,4 @@
// This file is generated automatically. All manually added changes will be removed when running the Converter.
// Candor Island Indoor mobs
-029-2,33,57,24,7|monster|HouseMaggot|1050,7,100000ms,30000ms,Mob029-2::On1050
-
-
-029-2,0,0,0|script|Mob029-2|32767
-{
- end;
-
-On1050:
- set @mobID, 1050;
- callfunc "MobPoints";
- end;
-}
+029-2,33,57,24,7|monster|HouseMaggot|1050,7,100000ms,30000ms
diff --git a/world/map/npc/029-2/_nodes.txt b/world/map/npc/029-2/_nodes.txt
new file mode 100644
index 00000000..9e38e0e1
--- /dev/null
+++ b/world/map/npc/029-2/_nodes.txt
@@ -0,0 +1,16 @@
+// This file is generated automatically. All manually added changes will be removed when running the Converter.
+// Candor Island Indoor nodes
+
+029-2,0,0,0|script|Node029-2|32767
+{
+ end;
+OnInit:
+ setarray .m$, "_N-Alchemy", "029-2";
+ setarray .x1, "_N-Alchemy", 113;
+ setarray .y1, "_N-Alchemy", 57;
+ setarray .x2, "_N-Alchemy", 0;
+ setarray .y2, "_N-Alchemy", 0;
+ setarray .id, "_N-Alchemy", 0;
+ donpcevent "_N-Alchemy::OnMaybeStart";
+ destroy;
+}
diff --git a/world/map/npc/029-2/alchemy.txt b/world/map/npc/029-2/alchemy.txt
index d0d2909a..3d49d5ae 100644
--- a/world/map/npc/029-2/alchemy.txt
+++ b/world/map/npc/029-2/alchemy.txt
@@ -1,11 +1,16 @@
-029-2,113,57,0|script|#alchemylab|400
+-|script|_N-Alchemy|32767
{
+ set @npc_distance, 1;
+ callfunc "PCtoNPCRange";
+ if (@npc_check) end;
+
title "Alchemy Lab";
mes "This is an alchemy lab.";
mes "With it, you can combine reagents together to create powerful potions.";
next;
clear;
mes "##BDrag & drop 2 items from your inventory. All items used will be lost.##b";
+ cleararray @alchlab_items$[0], "", 2; // since we're not using a scoped (.@) array, we need to clean it
requestitem @alchlab_items$[0], 2; // TODO: add a craft builtin (npc action 12)
clear;
if (@alchlab_items$[0] == "" || @alchlab_items$[1] == "")
@@ -35,13 +40,13 @@ L_Proceed:
L_CheckRecipes:
set .@n, .@n+3;
- if (.@n == get(.rsize, "#alchemylab"))
+ if (.@n == get(.rsize, "_N-Alchemy"))
goto L_Failed;
- if (!(get(.recipes$[.@n], "#alchemylab") == @alchlab_items$[0] && get(.recipes$[.@n+1], "#alchemylab") == @alchlab_items$[1]) &&
- !(get(.recipes$[.@n], "#alchemylab") == @alchlab_items$[1] && get(.recipes$[.@n+1], "#alchemylab") == @alchlab_items$[0]))
+ if (!(get(.recipes$[.@n], "_N-Alchemy") == @alchlab_items$[0] && get(.recipes$[.@n+1], "_N-Alchemy") == @alchlab_items$[1]) &&
+ !(get(.recipes$[.@n], "_N-Alchemy") == @alchlab_items$[1] && get(.recipes$[.@n+1], "_N-Alchemy") == @alchlab_items$[0]))
goto L_CheckRecipes;
- getitem get(.recipes$[.@n+2], "#alchemylab"), 1; // XXX: here we could also make it fail sometimes depending on your expertise
+ getitem get(.recipes$[.@n+2], "_N-Alchemy"), 1; // XXX: here we could also make it fail sometimes depending on your expertise
// XXX: here we could make it give profession/crafting exp
clear;
@@ -50,7 +55,7 @@ L_CheckRecipes:
mes " ["+ getitemlink(@alchlab_items$[1]) +"]";
mes;
mes "You obtained:";
- mes " ["+ getitemlink(get(.recipes$[.@n+2], "#alchemylab")) +"]";
+ mes " ["+ getitemlink(get(.recipes$[.@n+2], "_N-Alchemy")) +"]";
close;
L_NoItems:
@@ -64,15 +69,30 @@ L_Failed:
L_Abort:
close;
-OnInit:
- void // the first alchemy lab doesn't need a puppet, it's already on a map
- puppet("027-2", 51, 100, strnpcinfo(0)+0, 400), // TODO: make a npc like npc 400 but with hoverCursor="action" => looks better for things like crafting
- puppet("001-2", 92, 76, strnpcinfo(0)+1, 400),
- puppet("001-2", 98, 76, strnpcinfo(0)+2, 400),
- puppet("001-2", 92, 89, strnpcinfo(0)+3, 400),
- puppet("001-2", 98, 89, strnpcinfo(0)+4, 400);
+S_Spawn:
+ set .@s, getarraysize(.x1);
+ if (.spawned == 0)
+ set .spawned, 1; // FIXME: in tmwa (getarraysize2, setarray) allow to set array index 0 when setting in another npc
+ 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
+ set .spawned, .spawned + 1;
+ if (.spawned < .@s)
+ goto S_Spawn;
+ return;
+
+S_Return:
+ return;
+
+OnMaybeStart:
+ callsub S_Spawn;
+ if (.started == 0)
+ goto L_InitVars;
+ end;
- setarray .recipes$[0],
+L_InitVars:
+ setarray .recipes$[0], 0,
"DilutedConcentrationPot", "DarkConcentrationPotion", "ConcentrationPotion",
"CactusDrink", "CactusDrink", "CactusPotion",
"PinkPetal", "BottleOfWater", "ConcentrationPotion";