summaryrefslogtreecommitdiff
path: root/world/map/npc/029-2/alchemy.txt
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-03-30 19:52:24 -0400
committermekolat <mekolat@users.noreply.github.com>2016-04-07 06:58:14 -0400
commit40add9a2181ef5cb2d8804eeb01c0a190d6c8ee5 (patch)
treeb2fb2774a570950cb6db582da8a25361e8d70249 /world/map/npc/029-2/alchemy.txt
parentc22162b0a8cd9cceab579548bbc1b68ff67ba4dd (diff)
downloadserverdata-40add9a2181ef5cb2d8804eeb01c0a190d6c8ee5.tar.gz
serverdata-40add9a2181ef5cb2d8804eeb01c0a190d6c8ee5.tar.bz2
serverdata-40add9a2181ef5cb2d8804eeb01c0a190d6c8ee5.tar.xz
serverdata-40add9a2181ef5cb2d8804eeb01c0a190d6c8ee5.zip
slowly getting things done
explain the debug spell is deprecated upmarmu typo cooldown fix make maps with updated converter, make nodes update permissions
Diffstat (limited to 'world/map/npc/029-2/alchemy.txt')
-rw-r--r--world/map/npc/029-2/alchemy.txt48
1 files changed, 34 insertions, 14 deletions
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";