summaryrefslogtreecommitdiff
path: root/world/map/npc/items
diff options
context:
space:
mode:
authorWushin <pasekei@gmail.com>2014-06-30 18:56:49 -0500
committerWushin <pasekei@gmail.com>2014-06-30 18:56:49 -0500
commit0d8c9a3f43372de8302264207bf7fe4ee3a88579 (patch)
tree88f6b6f353f068e1fcf84b319c7d22a9476bc301 /world/map/npc/items
parenta0cdf3e2821228f570bf339cd675c012ad4fea57 (diff)
parent623f98ef8f4efa72d6ff7355517b0ace7235ef72 (diff)
downloadserverdata-0d8c9a3f43372de8302264207bf7fe4ee3a88579.tar.gz
serverdata-0d8c9a3f43372de8302264207bf7fe4ee3a88579.tar.bz2
serverdata-0d8c9a3f43372de8302264207bf7fe4ee3a88579.tar.xz
serverdata-0d8c9a3f43372de8302264207bf7fe4ee3a88579.zip
Merge pull request #123 from wushin/starting-area-fix
Starting Area Redux
Diffstat (limited to 'world/map/npc/items')
-rw-r--r--world/map/npc/items/check_wand.txt65
1 files changed, 65 insertions, 0 deletions
diff --git a/world/map/npc/items/check_wand.txt b/world/map/npc/items/check_wand.txt
new file mode 100644
index 00000000..1b11dfc2
--- /dev/null
+++ b/world/map/npc/items/check_wand.txt
@@ -0,0 +1,65 @@
+// Wands
+// Author: Wushin
+function|script|WandMana|,
+{
+ callfunc "CheckWand";
+ set @WandCost, (@Wand * ((MaxSp / 10) + 2));
+ set @WandAttack, 0;
+ if (!(@Wand))
+ goto L_NoWand;
+ if (Sp >= @WandCost)
+ goto L_Attack;
+ goto L_LowSp;
+
+L_Attack:
+ set Sp, (Sp - @WandCost);
+ set @WandAttack, 1;
+ goto L_Return;
+
+L_NoWand:
+ message strcharinfo(0), "You need a wand Equipped!";
+ set @WandAttack, 0;
+ goto L_Return;
+
+L_LowSp:
+ message strcharinfo(0), "Out of Mana";
+ set @WandAttack, 0;
+ goto L_Return;
+
+L_Return:
+ return;
+}
+function|script|CheckWand|,
+{
+ setarray $@Wands, 758, 1171;
+ setarray $@WandsPwr, 2, 1;
+ set @Wand, 0;
+ set @wand_loop, 0;
+ goto L_Loop;
+
+L_Loop:
+ if ((getequipid(equip_hand1) == $@Wands[@wand_loop]) || (getequipid(equip_hand2) == $@Wands[@wand_loop]))
+ goto L_SetWand;
+ goto L_LoopAgain;
+
+L_SetWand:
+ set @Wand, $@WandsPwr[@wand_loop];
+ callfunc "MorganState";
+ if (@morgan == 2)
+ goto L_SetCastOnce;
+ goto L_Return;
+
+L_LoopAgain:
+ set @wand_loop, (@wand_loop + 1);
+ if (@wand_loop >= getarraysize($@Wands))
+ goto L_Return;
+ goto L_Loop;
+
+L_SetCastOnce:
+ set @morgan_tmp, 3;
+ callfunc "SetMorganMask";
+ goto L_Return;
+
+L_Return:
+ return;
+}