summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconf/build-magic.sh21
-rw-r--r--conf/magic.conf646
-rw-r--r--conf/magic.conf.template1188
-rw-r--r--data/test.wlkbin0 -> 19042 bytes
-rw-r--r--db/const.txt31
-rw-r--r--db/item_db.txt31
-rw-r--r--db/mob_db.txt10
-rw-r--r--npc/001-1_Tulimshar/bard.txt105
-rw-r--r--npc/001-1_Tulimshar/children.txt47
-rw-r--r--npc/001-1_Tulimshar/elanore.txt338
-rw-r--r--npc/001-1_Tulimshar/guide.txt4
-rw-r--r--npc/001-1_Tulimshar/rewards_master.txt8
-rw-r--r--npc/001-1_Tulimshar/sandra.txt14
-rw-r--r--npc/001-1_Tulimshar/vincent.txt4
-rw-r--r--npc/001-2_Tulimshar/casino.txt14
-rw-r--r--npc/001-2_Tulimshar/troupe_leader.txt2
-rw-r--r--npc/002-3_Desert_mines/miners.txt8
-rw-r--r--npc/002-4_Desert_mines/chest.txt8
-rw-r--r--npc/005-1_Snake_desert/_import.txt2
-rw-r--r--npc/005-1_Snake_desert/spirit.txt301
-rw-r--r--npc/005-1_Snake_desert/tree.txt166
-rw-r--r--npc/006-1_Desert_mountains/pachua.txt39
-rw-r--r--npc/008-1_Hurnscald_outskirts/hinnak.txt140
-rw-r--r--npc/009-1_Hurnscald/jack.txt8
-rw-r--r--npc/009-2_Hurnscald/_import.txt1
-rw-r--r--npc/009-2_Hurnscald/alan.txt4
-rw-r--r--npc/009-2_Hurnscald/kfahr.txt62
-rw-r--r--npc/009-2_Hurnscald/misc.txt50
-rw-r--r--npc/009-2_Hurnscald/nicholas.txt68
-rw-r--r--npc/009-2_Hurnscald/shops.txt2
-rw-r--r--npc/009-2_Hurnscald/waitress.txt16
-rw-r--r--npc/009-2_Hurnscald/wyara.txt550
-rw-r--r--npc/009-3_Cave_beneath_Hurnscald/_import.txt1
-rw-r--r--npc/009-3_Cave_beneath_Hurnscald/sword.txt189
-rw-r--r--npc/010-2_Dimonds_Cove/doug.txt8
-rw-r--r--npc/010-2_Dimonds_Cove/loratay.txt52
-rw-r--r--npc/011-1_Woodland/_import.txt1
-rw-r--r--npc/011-1_Woodland/alchemist.txt384
-rw-r--r--npc/011-1_Woodland/auldsbel.txt1186
-rw-r--r--npc/012-1_Woodland_Hills/_import.txt2
-rw-r--r--npc/012-1_Woodland_Hills/amrak.txt10
-rw-r--r--npc/012-1_Woodland_Hills/injured-mouboo.txt231
-rw-r--r--npc/012-3_Cave/_import.txt1
-rw-r--r--npc/012-3_Cave/mana-seed.txt263
-rw-r--r--npc/013-1_Woodland_hills/_import.txt1
-rw-r--r--npc/013-1_Woodland_hills/sagatha.txt393
-rw-r--r--npc/013-2_Magic_house/apprentice.txt8
-rw-r--r--npc/013-2_Magic_house/wizard.txt69
-rw-r--r--npc/013-3_Cave/barrier.txt4
-rw-r--r--npc/013-3_Cave/mask_chest.txt129
-rw-r--r--npc/013-3_Cave/sword_chest.txt8
-rw-r--r--npc/014-1_Woodland/wedding-officiator.txt4
-rw-r--r--npc/015-1_Woodland/_import.txt1
-rw-r--r--npc/015-1_Woodland/sword.txt356
-rw-r--r--npc/015-3/katze.txt58
-rw-r--r--npc/015-3/pot.txt20
-rw-r--r--npc/018-1_Woodland_mining_camp/_import.txt1
-rw-r--r--npc/018-1_Woodland_mining_camp/sword.txt12
-rw-r--r--npc/018-2_Woodland_mining_camp/caul.txt65
-rw-r--r--npc/018-3_Cave/_import.txt1
-rw-r--r--npc/018-3_Cave/sword.txt12
-rw-r--r--npc/019-1_Snow_field/santa_helper.txt20
-rw-r--r--npc/019-1_Snow_field/snowman.txt21
-rw-r--r--npc/020-1_Nivalis/_import.txt1
-rw-r--r--npc/020-1_Nivalis/amrak.txt17
-rw-r--r--npc/020-2_Nivalis/furquest.txt52
-rw-r--r--npc/functions/magic.txt138
-rw-r--r--npc/functions/mob_points.txt35
-rw-r--r--npc/functions/slot_machine.txt6
-rw-r--r--npc/items/purification_potion.txt30
-rw-r--r--npc/scripts.conf4
-rw-r--r--npc/test_Tulimshar/_import.txt3
-rw-r--r--npc/test_Tulimshar/_mobs.txt47
-rw-r--r--npc/test_Tulimshar/_warps.txt5
74 files changed, 6553 insertions, 1184 deletions
diff --git a/conf/build-magic.sh b/conf/build-magic.sh
new file mode 100755
index 00000000..94d1a01f
--- /dev/null
+++ b/conf/build-magic.sh
@@ -0,0 +1,21 @@
+#! /bin/sh
+
+RSCRIPT="spells-build.sh"
+
+if [ -a $RSCRIPT ]; then printf ""; else
+ echo '#! /bin/sh' > $RSCRIPT;
+ echo 'cat \' >> $RSCRIPT;
+ chmod a+x $RSCRIPT
+fi
+
+for n in `grep -o '"#..."' magic.conf.template`; do
+ if grep $n $RSCRIPT; then printf ""; else
+ CHANGES=1
+ echo "|sed 's/${n}/${n}/' \\" >> $RSCRIPT;
+ fi
+done
+
+if [ x$CHANGES == x1 ]
+then echo "spells-build.sh has been updated; please provide invocations for spells and/or teleport anchors.";
+else cat magic.conf.template | ./$RSCRIPT > magic.conf;
+fi \ No newline at end of file
diff --git a/conf/magic.conf b/conf/magic.conf
deleted file mode 100644
index e0fb308c..00000000
--- a/conf/magic.conf
+++ /dev/null
@@ -1,646 +0,0 @@
-# Special-purpose globals
-obscure_chance = 95
-min_casttime = 200
-
-# Schools of magic
-CONST MAGIC = 340
-CONST LIFE = 341
-CONST WAR = 342
-CONST TRANSMUTE = 343
-CONST NATURE = 344
-CONST ASTRAL = 345
-
-# Elements
-CONST ELT_NEUTRAL = 0
-CONST ELT_WATER = 1
-CONST ELT_EARTH = 2
-CONST ELT_FIRE = 3
-CONST ELT_WIND = 4
-CONST ELT_POISON = 5
-CONST ELT_SHADOW = 6
-CONST ELT_HOLY = 7
-CONST ELT_GHOST = 8
-CONST ELT_UNDEAD = 9
-
-# Schools of magic
-CONST SC_HALT_REGENERATE = 195
-CONST SC_FLYING_BACKPACK = 196
-CONST SC_MBARRIER = 197
-CONST SC_HASTE = 198
-CONST SC_PHYS_SHIELD = 199
-
-# Special effects
-CONST SFX_DEFAULT = 10
-CONST SFX_SUMMON_START = 21
-CONST SFX_SUMMON_FIRE = 22
-CONST SFX_TELEPORT = 24
-CONST SFX_BARRIER = 10
-CONST SFX_UNBARRIER = 10
-CONST SFX_HEAL = 3
-
-CONST MAX_RAIN_SPELL_RADIUS = 20
-
-# Default sfx on caster
-PROCEDURE default_effect() =
- sfx(caster, school - MAGIC + 2, 0);
-
-PROCEDURE sfx_generic(target) =
- sfx(target, SFX_DEFAULT, 0);
-
-# Increase spellpower by school and general magic skill
-PROCEDURE adjust_spellpower(school) =
- spellpower = spellpower + (skill(caster, MAGIC) + skill(caster, school)) * 10;
- IF ((school = LIFE) && (target = partner(caster)))
- THEN spellpower = spellpower + 200; # Do something for wedding rings, too?
-
-PROCEDURE heal(target, max_heal) =
- CALL default_effect();
- IF caster <> target
- THEN sfx(target, SFX_HEAL, 0);
- power = spellpower + vit(caster);
- power = min(max_heal, (max_heal * power) / 250);
- itemheal(target, power, 0);
-
-# Goes through instaheal instead of itemheal
-PROCEDURE quickheal(target, power) =
- CALL default_effect();
- IF caster <> target
- THEN sfx(target, SFX_HEAL, 0);
- instaheal(target, power, 0);
-
-# Can attack the target? Imports attack_range from dynamic environment
-PROCEDURE attack_check(target) =
- IF (not (line_of_sight(location(caster), location(target))))
- THEN ABORT;
- IF (not (rdistance(location(caster), location(target)) <= attack_range))
- THEN ABORT;
-
-# Cause elemental damage. bonus_elt grants an attack bonus, malus_elt reduces the attack. `effect' is the sfx ID.
-PROCEDURE elt_damage(target, damage, dmgplus, bonus_elt, malus_elt, effect) =
- d = damage + random(dmgplus);
- IF (element(target) = malus_elt)
- THEN d = d / 3;
- IF (element(target) = bonus_elt)
- THEN d = (d * (4 + element_level(target))) / 4;
- #message(caster, "bonus=" + (element(target) = bonus_elt) + " malus=" + (element(target) = malus_elt) + " damage=" + damage + " + r(" + dmgplus + ") -> " + d);
- sfx(target, effect, 0);
- injure(caster, target, d, 0);
-
-PROCEDURE melee_damage(target, damage, dmgplus) =
- CALL attack_check(target);
- d = damage + random(dmgplus);
- injure(caster, target, d, 0);
-
-
-PROCEDURE install_attack_spell(charges, base_delay, range, attack_animation) =
- CALL default_effect();
- attack_range = range;
- override_attack(caster, charges, ((200 - agi(caster)) * base_delay) / 200,
- range, 0, attack_animation);
-
-PROCEDURE install_melee_spell(charges, base_delay, attack_animation) =
- CALL install_attack_spell(charges, base_delay, 1, attack_animation);
-
-PROCEDURE summon_spell(mob_id, count, delay, lifetime, control_level) =
- CALL default_effect();
- sfx(location, SFX_SUMMON_START, 0);
- WAIT delay;
- sfx(location, SFX_SUMMON_FIRE, 0);
- spawn(rbox(location, 2), caster, mob_id,
- if_then_else(skill(caster, ASTRAL) >= control_level, 2, 1), # pets when level is high enough
- count, lifetime);
-
-
-#--------------------------------------------------------------------------------
-# Level 0 spells
-#--------------------------------------------------------------------------------
-
-#SPELL reset : "#reset" =
-# EFFECT { skill 340, 0;
-# skill 341, 0;
-# skill 342, 0;
-# skill 343, 0;
-# skill 344, 0;
-# skill 345, 0;
-# }
-
-SPELL lesser-heal (target : STRING) : "#imx" =
- LET level = 0
- school = LIFE
- IN (MANA 5, CASTTIME 400,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE if_then_else(failed(pc(target)), 1,
- rdistance(location(caster), location(pc(target))) < 2 + (spellpower / 50)),
- (COMPONENTS ["MaggotSlime"] OR COMPONENTS ["BugLeg"]))
- => EFFECT CALL adjust_spellpower(school);
- IF failed(pc(target))
- THEN target = caster; # quest handling goes here
- ELSE target = pc(target);
- CALL heal(target, 200);
-
-
-SPELL flare-dart : "#fla" =
- LET level = 0
- school = WAR
- IN (MANA 15, CASTTIME 500,
- REQUIRE skill(caster, MAGIC) > level,
- (REQUIRE skill(caster, school) > 2 OR COMPONENTS ["SulphurPowder"]))
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- damage = min(40 + skill(caster, school) * 20,
- 10 + spellpower);
- damage_bonus = 5 + level(caster) / 3;
- CALL install_attack_spell(3 + spellpower / 30,
- 1200,
- 4, 31);
-
- ATTRIGGER CALL attack_check(target);
- CALL elt_damage (target, damage, damage_bonus, ELT_WATER, ELT_FIRE, 15);
-
-SPELL magic-blade : "#mbl" =
- LET level = 0
- school = WAR
- IN (MANA 12, CASTTIME 500,
- REQUIRE skill(caster, MAGIC) > level)
- => ( COMPONENTS ["SharpKnife"] =>
- EFFECT CALL adjust_spellpower(WAR);
- CALL default_effect();
- CALL install_melee_spell(10 + spellpower / 10, 900, 30);
- ATTRIGGER CALL melee_damage(target, 60 + spellpower / 20, 5 + str(caster));
- | COMPONENTS ["Knife"] =>
- EFFECT CALL adjust_spellpower(WAR);
- CALL default_effect();
- CALL install_melee_spell(10 + spellpower / 10, 900, 30);
- ATTRIGGER CALL melee_damage(target, 40 + spellpower / 20, 5 + str(caster));
- )
-
-SPELL aggravate : "#qaw" =
- LET level = 0
- school = NATURE
- IN (MANA 5, CASTTIME 300,
- REQUIRE skill(caster, MAGIC) > level)
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- FOREACH MOB target IN rbox(location(caster), 1 + spellpower / 20) DO
- (CALL sfx_generic(target);
- aggravate(target, 0, caster);)
-
-
-LOCAL SPELL summon-maggots : "#kbm" =
- LET level = 0
- school = ASTRAL
- IN (MANA 20, CASTTIME 3000,
- REQUIRE skill(caster, MAGIC) > level,
- COMPONENTS ["MaggotSlime"])
- => EFFECT CALL adjust_spellpower(school);
- CALL summon_spell(1002, 3 + spellpower / 15, 5000 - (spellpower * 10), spellpower * 500, 1);
-
-
-#--------------------------------------------------------------------------------
-# Level 1 spells
-#--------------------------------------------------------------------------------
-
-SPELL make-arrows : "#mkarrows" =
- LET level = 1
- school = TRANSMUTE
- IN (MANA 20, CASTTIME 2000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- COMPONENTS ["RawLog"])
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- create_item(caster, "Arrow", 1 + spellpower / 15);
-
-SPELL make-shirt : "#mkshirt" =
- LET level = 1
- school = TRANSMUTE
- IN (MANA 20, CASTTIME 2000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- COMPONENTS [5 * "CottonCloth"])
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- create_item(caster, "CottonShirt", 1);
-
-SPELL make-tanktop : "#mktanktop" =
- LET level = 1
- school = TRANSMUTE
- IN (MANA 20, CASTTIME 2000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- COMPONENTS [4 * "CottonCloth"])
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- create_item(caster, "TanktopWhite", 1);
-
-SPELL make-short-tanktop : "#mkshorttanktop" =
- LET level = 1
- school = TRANSMUTE
- IN (MANA 20, CASTTIME 2000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- COMPONENTS [3 * "CottonCloth"])
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- create_item(caster, "ShortTanktopWhite", 1);
-
-SPELL lightning-strike : "#kig" =
- LET level = 1
- school = WAR
- IN (MANA 25, CASTTIME 1000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["IronPowder"]))
- => EFFECT CALL adjust_spellpower(school);
- damage = min(100 + skill(caster, school) * 50,
- 50 + spellpower * 2);
- damage_bonus = level(caster) + spellpower;
- CALL install_attack_spell(1 + spellpower / 60,
- 3000,
- 8, 31);
- ATTRIGGER CALL attack_check(target);
- in_rain = 0;
- area = location(caster);
- FOREACH SPELL s IN rbox(location(caster), MAX_RAIN_SPELL_RADIUS + 1) DO
- IF name_of(s) = "rain" THEN (
-# message(caster, "found-rain at " + s.area + " vs. " + location(caster) + " inside: " + is_in(location(caster), s.area));
- IF is_in (location(caster), s.area)
- THEN (in_rain = in_rain | 1;
- area = area + s.area;);
- IF is_in (location(target), s.area)
- THEN in_rain = in_rain | 2;
- );
-# message(caster, "in-rain : " + in_rain);
- IF in_rain & 1
- THEN (# caster standing in the rain? This is going to be fun.
- used = 0;
- FOREACH TARGET t IN area DO
- IF (random(200) + luk(caster) > 175)
- THEN (used = used + 1;
- CALL elt_damage (t, damage / 6, 1 + (damage_bonus / 3), ELT_EARTH, ELT_WIND, 17 + random(3)););
- IF (not(used) || (random(200) + luk(caster) < 150))
- THEN (sfx(caster, 17 + random(3), 0);
- itemheal(caster, 0 - damage - (random(damage_bonus)), 0););
- ) ELSE
- CALL elt_damage (target, damage, damage_bonus, ELT_EARTH, ELT_WIND, 17 + random(3));
-
-SPELL fire-ball : "#pof" =
- LET level = 1
- school = WAR
- IN (MANA 30, CASTTIME 1000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["PileOfAsh"]))
- => EFFECT CALL adjust_spellpower(school);
- damage = min(50 + skill(caster, school) * 40,
- 30 + ((spellpower * 3) / 2));
- damage_bonus = level(caster) + spellpower * 2;
- radius = 2 + spellpower / 50;
- CALL install_attack_spell(1 + spellpower / 60,
- 5000,
- 10, 31);
- ATTRIGGER CALL attack_check(target);
- loc = location(target);
- #WAIT 500;
- sfx(loc, 16, 0);
- FOREACH TARGET target IN rbox(loc, radius)
- DO IF line_of_sight(loc, location(target))
- THEN (divisor = (3 + rdistance(loc, location(target)));
- CALL elt_damage (target, (damage * 3) / divisor, (damage_bonus * 3) / divisor, ELT_WATER, ELT_FIRE, 15);
- )
-
-SPELL magic-knuckles (target : PC) : "#iom" =
- LET level = 1
- school = WAR
- IN (MANA 20, CASTTIME 500,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["Beer"]))
- =>
- EFFECT CALL adjust_spellpower(WAR);
- str = str(target);
- CALL install_melee_spell(10 + spellpower / 12, 1000, 0);
- ATTRIGGER CALL melee_damage(target, 40 + (str / 2) + spellpower / 20, 5 + str);
-
-SPELL flying-backpack (target : PC) : "#uuy" =
- LET level = 1
- school = NATURE
- IN (MANA 12, CASTTIME 1000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- REQUIRE rdistance(location(target), location(caster)) < 2 + spellpower / 30)
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- IF (caster <> target)
- THEN sfx(caster, 2, 0);
- status_change(target, SC_FLYING_BACKPACK, 0, 0, 0, 0, 5000 + (spellpower * 500));
- message (target, "Your backpack is lifted by a mystical force; you no longer feel it pressing on your back.");
- ATEND message (target, "Your backpack is no longer levitating.");
- sfx(target, 2, 0);
-
-
-SPELL protect (target : PC) : "#ism" =
- LET level = 1
- school = NATURE
- IN (MANA 18, CASTTIME 1000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["HardSpike"]),
- REQUIRE rdistance(location(target), location(caster)) < 2 + spellpower / 30)
- => EFFECT CALL adjust_spellpower(school);
- sfx(target, 11, 0);
- IF (caster <> target)
- THEN CALL default_effect();
- status_change(target, SC_PHYS_SHIELD, 5 + max(15, spellpower / 12), 0, 0, 0, 5000 + (spellpower * 500));
- message (target, "You feel more protected.");
- ATEND message (target, "You feel less protected.");
- sfx(target, 111, 0);
-
-
-LOCAL SPELL rain : "#flosh" =
- LET level = 1
- school = NATURE
- IN (MANA 20, CASTTIME 3000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["BottleOfWater"]))
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- range = min(MAX_RAIN_SPELL_RADIUS, 3 + spellpower / 30);
- area = rbox(location(caster), range);
- FOR i = 0 TO spellpower DO (
- FOR j = 0 TO spellpower / 100 DO (
- location = random_location(area);
- sfx(location, 25, 0);
- FOREACH TARGET target IN rbox(location, 1) DO
- IF element(target) = ELT_FIRE
- THEN injure(caster, target, 5 + random(5 + spellpower / 10), 0);
- )
- WAIT 300 - min(spellpower, 200) + random(100);
- );
-
-SPELL happy-curse (target : PC) : "#happy" =
- LET level = 1
- school = NATURE
- IN (MANA 10, CASTTIME 1000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["WhiteFur"]),
- REQUIRE rdistance(location(target), location(caster)) < 1 + spellpower / 100)
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- FOR i = 0 TO (spellpower / 10) DO (emote(target, 3); WAIT 500;);
-
-SPELL barrier (target : PC) : "#iso" =
- LET level = 1
- school = NATURE
- IN (MANA 18, CASTTIME 1000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["HardSpike"]),
- REQUIRE rdistance(location(target), location(caster)) < 2 + spellpower / 30)
- => EFFECT CALL adjust_spellpower(school);
- sfx(target, SFX_BARRIER, 0);
- IF (caster <> target)
- THEN CALL default_effect();
- status_change(target, SC_MBARRIER, 30 + max(30, spellpower / 8), 0, 0, 0, 2000 + (spellpower * 200));
- message (target, "You are surrounded by a magical barrier.");
- ATEND message (target, "Your magical barrier disspiates.");
- sfx(target, SFX_UNBARRIER, 0);
-
-
-LOCAL SPELL summon-scorps : "#kbms" =
- LET level = 1
- school = ASTRAL
- IN (MANA 25, CASTTIME 3000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- COMPONENTS ["ScorpionStinger"])
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- CALL summon_spell(1003, 1 + spellpower / 30, 5000 - (spellpower * 9), spellpower * 400, 2);
-
-LOCAL SPELL summon-red-scorps : "#kbmq" =
- LET level = 1
- school = ASTRAL
- IN (MANA 30, CASTTIME 3000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- COMPONENTS ["RedScorpionStinger"])
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- CALL summon_spell(1004, 1 + spellpower / 40, 5000 - (spellpower * 8), spellpower * 350, 3);
-
-
-SPELL detect-players : "#ewm" =
- LET level = 1
- school = MAGIC
- IN (MANA 10, CASTTIME 300,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level)
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- message = "";
- FOREACH PC target IN rbox(location(caster), spellpower / 2)
- DO IF target <> caster
- THEN (IF message <> ""
- THEN message = message + ", ";
- message = message + name_of (target);
- IF spellpower > 99
- THEN message = message + "(" + level(target) + ")";
- )
- IF message = ""
- THEN message(caster, "You sense no-one else nearby.");
- ELSE message(caster, "You sense the following: " + message);
-
-
-
-SPELL lay-on-hands (target : STRING) : "#loh" =
- LET level = 1
- school = LIFE
- IN (MANA 8, CASTTIME 400,
- REQUIRE hp(caster) > max_hp(caster) / 20,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE if_then_else(failed(pc(target)), 1,
- (rdistance(location(caster),
- location(pc(target))) < 2 + (spellpower / 50))
- && not (running_status_update(pc(target), SC_HALT_REGENERATE))
- ))
- => EFFECT CALL adjust_spellpower(school);
- IF failed(pc(target))
- THEN target = caster; # quest handling goes here
- ELSE target = pc(target);
- needed = max_hp(target) - hp(target);
- pay_fraction = max(80, 200 - (vit(caster) + (spellpower / 10))); # Pay at least 40%
- payment = (needed * pay_fraction) / 200;
- available = hp(caster) - (max_hp(caster) / 20);
-
- IF payment < available
- THEN power = needed;
- ELSE (payment = available;
- power = (available * 200) / pay_fraction;
- )
-
- instaheal(caster, 0 - payment, 0);
- CALL quickheal(target, power);
- status_change(caster, SC_HALT_REGENERATE, 0, 0, 0, 0, 10000);
-
-#--------------------------------------------------------------------------------
-# Level 2 spells
-#--------------------------------------------------------------------------------
-
-SPELL summon-partner : "#aid" =
- LET level = 2
- school = ASTRAL
- IN (MANA 30, CASTTIME 2000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- REQUIRE is_married(caster))
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- IF (failed (partner (caster)))
- THEN message (caster, "You call out for your partner, but there is no response.");
- ELSE (message (caster, "You call out for " + (name_of (partner (caster))) + ".");
- message (partner(caster), name_of(caster) + " is calling for your aid!");
- sfx(partner(caster), 2, 0);
- WAIT (max (5000, 30000 - (spellpower * 60)));
- IF (failed (partner (caster)))
- THEN message (caster, "Your partner has abandoned you.");
- ELSE (sfx(location(partner(caster)), SFX_TELEPORT, 0);
- dest = awayfrom(location(caster), random_dir(1), 1);
- warp(partner(caster), dest);
- sfx(dest, SFX_TELEPORT, 0);
- )
- )
-
-
-
-#--------------------------------------------------------------------------------
-# Level 4 spells
-#--------------------------------------------------------------------------------
-
-SPELL shroud : "#aw" =
- LET level = 4
- school = ASTRAL
- IN (MANA 40, CASTTIME 400,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level)
- => EFFECT CALL default_effect();
- shroud(caster, 0x04);
-
-#--------------------------------------------------------------------------------
-# Special-purpose quasispells
-#--------------------------------------------------------------------------------
-
-CONST MIN_MARRY_LEVEL = 32;
-
-NONMAGIC SILENT SPELL marriage (target : PC) : "marry" =
- (REQUIRE is_in(location(caster), @("014-1.gat", 28,39) @+ (8, 6)))=>
- EFFECT IF target == caster # no valid target or tried to marry self?
- THEN ABORT;
-
- IF (level(caster) < MIN_MARRY_LEVEL)
- THEN (message(caster, "You must be level " + MIN_MARRY_LEVEL + " or higher to marry!"); ABORT;)
-
- IF (level(target) < MIN_MARRY_LEVEL)
- THEN (message(caster, "Your partner must be level " + MIN_MARRY_LEVEL + " or higher to marry!"); ABORT;)
-
- IF partner(caster) = target
- THEN (message(caster, "You and " + name_of(target) + " are already married."); ABORT;)
-
- IF is_married(caster)
- THEN (message(caster, "You are already married!"); ABORT;)
-
- IF is_married(target)
- THEN (message(caster, name_of(target) + " is already married."); ABORT;);
-
- IF distance(location(caster), location(target)) <> 1
- THEN (message(caster, "You have to stand next to each other."); ABORT;);
-
- IF (count_item(caster, "WeddingRing") == 0 || count_item(target, "WeddingRing") == 0)
- THEN (message(caster, "You must both be wearing your wedding rings!"); ABORT;)
-
- script_target = target;
- {
- announce @caster_name$ + " is asking " + strcharinfo(0) + " for marriage.", 2;
- mes @caster_name$ + " wishes to marry you.";
- mes "Do you accept?";
- next;
- menu "Yes, I do!", L_yes,
- "No.", -;
- close;
-
- L_yes:
- if marriage(@caster_name$)
- announce @caster_name$ + " and " + strcharinfo(0) + " are now married!", 0;
- close;
- }
-
- IF not (is_married(caster))
- THEN message(caster, name_of(target) + " turned down your marriage offer.");
-
-# SPELL change-hair-colour (colour : STRING) : "trapa" =
-# (MANA 20) => EFFECT IF colour = "nworbl"
-# THEN x = 0; # light brown
-# ELSE IF colour = "der"
-# THEN x = 1; # red
-# ELSE IF colour = "neerg"
-# THEN x = 2; # green
-# ELSE IF colour = "elprup"
-# THEN x = 3; # purple
-# ELSE IF colour = "yerg"
-# THEN x = 4; # grey
-# ELSE IF colour = "wolley"
-# THEN x = 5; # yellow
-# ELSE IF colour = "eulb"
-# THEN x = 6; # blue
-# ELSE IF colour = "nwrob"
-# THEN x = 7; # brown
-# ELSE IF colour = "elpropl"
-# THEN x = 8; # light purple
-# ELSE IF colour = "elpropd"
-# THEN x = 9; # dark purple
-# ELSE x = random(10);
-# sfx(caster, 2, 0);
-# set_hair_colour(caster, x);
-
-
-# SPELL trick-or-treat : "trick-or-treat" =
-# (CASTTIME 30000, MANA 20,
-# COMPONENTS [ "BugLeg" ]) => EFFECT IF (random(2))
-# THEN (sfx(caster, 2, 0);
-# FOR i = 0 TO random(10) DO
-# drop_item_for (random_location(rbox(location(caster), 5)),
-# "Candy", 1, 10000 + random(10000), caster, 3000);
-# FOR i = 0 TO random(10) DO
-# drop_item_for (random_location(rbox(location(caster), 5)),
-# "ChocolateBar", 1, 10000 + random(10000), caster, 3000);
-# )
-# ELSE (sfx(caster, 5, 0);
-# message(caster, "No treat for you!");
-# spawn(rbox(location(caster), 3), caster, 1010, 0, 1 + random(3), 10000 + random(20000));
-# FOREACH MOB target IN rbox(location(caster), 5) DO
-# (sfx(target, 5, 0);
-# aggravate(target, 0, caster);))
-
-
-LOCAL SPELL mouboo-groan : "#g" =
- (MANA 1,
- REQUIRE name_of(caster) = "MOUBOOTAUR") =>
- EFFECT FOREACH PC p IN rbox(location(caster), 200) DO
- distance = rdistance(location(caster), location(p));
- IF (distance < 15)
- THEN message(p, "The moubootaur's groaning rings in your ears!");
- ELSE IF (distance < 70)
- THEN message(p, "You hear a loud groaning noise, not far away...");
- ELSE message(p, "You hear an odd groaning noise in the distance...");
-
-
-LOCAL SPELL mouboo-smell : "#s" =
- (MANA 1,
- REQUIRE name_of(caster) = "MOUBOOTAUR") =>
- EFFECT WAIT 30000;
- FOREACH PC p IN rbox(location(caster), 30) DO
- message(p, "You notice a strange smell all around you.");
-
-
diff --git a/conf/magic.conf.template b/conf/magic.conf.template
new file mode 100644
index 00000000..db43e989
--- /dev/null
+++ b/conf/magic.conf.template
@@ -0,0 +1,1188 @@
+# Special-purpose globals
+obscure_chance = 95
+min_casttime = 200
+
+# Schools of magic
+CONST MAGIC = 340
+CONST LIFE = 341
+CONST WAR = 342
+CONST TRANSMUTE = 343
+CONST NATURE = 344
+CONST ASTRAL = 345
+
+# Elements
+CONST ELT_NEUTRAL = 0
+CONST ELT_WATER = 1
+CONST ELT_EARTH = 2
+CONST ELT_FIRE = 3
+CONST ELT_WIND = 4
+CONST ELT_POISON = 5
+CONST ELT_SHADOW = 6
+CONST ELT_HOLY = 7
+CONST ELT_GHOST = 8
+CONST ELT_UNDEAD = 9
+
+# Schools of magic
+CONST SC_SHEARED = 194 # This is the same as SC_HIDE, since mobs can't hide and shearing is only used for mobs. Feel free to fix!
+CONST SC_HIDE = 194
+CONST SC_HALT_REGENERATE = 195
+CONST SC_FLYING_BACKPACK = 196
+CONST SC_MBARRIER = 197
+CONST SC_HASTE = 198
+CONST SC_PHYS_SHIELD = 199
+
+# Special effects
+CONST SFX_DEFAULT = 10
+CONST SFX_SUMMON_START = 21
+CONST SFX_SUMMON_FIRE = 22
+CONST SFX_TELEPORT = 24
+CONST SFX_RAIN = 25
+CONST SFX_HIT = 25
+CONST SFX_ARROW_HAIL = 27
+CONST SFX_BARRIER = 10
+CONST SFX_UNBARRIER = 10
+CONST SFX_HEAL = 3
+
+CONST MAX_RAIN_SPELL_RADIUS = 20
+
+CONST SCRIPT_XP = "MAGIC_EXPERIENCE"
+CONST SCRIPT_XP_MASK = 0xffff
+CONST SCRIPT_XP_SHIFT = 0
+CONST SCRIPT_LASTSPELL_MASK = 0xff
+CONST SCRIPT_LASTSPELL_SHIFT = 16
+CONST SCRIPT_HEALSPELL_MASK = 0xff
+CONST SCRIPT_HEALSPELL_SHIFT = 24
+CONST DEBUG = 0
+
+CONST ATTACK_ICON_GENERIC = 2000
+CONST ATTACK_ICON_SHEARING = 2001
+
+# Default sfx on caster
+PROCEDURE default_effect() =
+ sfx(caster, school - MAGIC + 2, 0);
+
+PROCEDURE sfx_generic(target) =
+ sfx(target, SFX_DEFAULT, 0);
+
+PROCEDURE set_var(name, mask, shift, value) =
+ set_script_variable(caster, name, script_int(caster, name) & (neg (mask << shift)) | ((value & mask) << shift));
+
+PROCEDURE gain_heal_xp(value, # How many HP we healed
+ gain, # how many life magic experience points we can potentially gain
+ heal_xp_value_divisor, # 1 for instaheal, 2 for slow heal
+ base_exp_factor) = # factor for how many base experience points (max) the player should be allowed to gain
+ last_heal_xp = (script_int(caster, SCRIPT_XP) >> SCRIPT_HEALSPELL_SHIFT) & SCRIPT_HEALSPELL_MASK;
+ IF (target <> caster
+ && (value / heal_xp_value_divisor) > (10 + last_heal_xp + random(last_heal_xp + 1) + random(last_heal_xp + 1)))
+ THEN (
+ heal_xp = last_heal_xp + gain;
+ IF (heal_xp > SCRIPT_HEALSPELL_MASK)
+ THEN heal_xp = SCRIPT_HEALSPELL_MASK;
+ CALL set_var(SCRIPT_XP, SCRIPT_HEALSPELL_MASK, SCRIPT_HEALSPELL_SHIFT, heal_xp);
+ )
+ IF target <> caster
+ THEN gain_experience(caster, base_exp_factor * extract_healer_experience(target, value), 0, 1);
+
+PROCEDURE gain_xp(gain) =
+ IF (level + 3 > skill(caster, MAGIC)) # Level 4 and 5 magic users don't gain anything from spell levels 0 resp. 0+1
+ THEN (
+ index = spell_index(self_spell);
+ last_index = (script_int(caster, SCRIPT_XP) >> SCRIPT_LASTSPELL_SHIFT) & SCRIPT_LASTSPELL_MASK;
+ last_xp = (script_int(caster, SCRIPT_XP) >> SCRIPT_XP_SHIFT) & SCRIPT_XP_MASK;
+ IF (index != last_index)
+ THEN ( # Some variation observed
+ xp = last_xp + gain;
+ IF (xp > SCRIPT_XP_MASK)
+ THEN xp = SCRIPT_XP_MASK;
+ CALL set_var(SCRIPT_XP, SCRIPT_XP_MASK, SCRIPT_XP_SHIFT, xp);
+ CALL set_var(SCRIPT_XP, SCRIPT_LASTSPELL_MASK, SCRIPT_LASTSPELL_SHIFT, index);
+ IF DEBUG THEN message(caster, "Spell xp = " + xp);
+ ) ELSE IF DEBUG THEN message(caster, "Re-cast same spell, xp remain at " + last_xp);
+ )
+
+PROCEDURE create_item(good_item, count, bad_item, difficulty) =
+ score = experience + random(min(spellpower, (experience / 3) + 1));
+ IF (score >= difficulty)
+ THEN create_item(caster, good_item, count);
+ ELSE (
+ score = score + random(luk(caster)) + random(luk(caster));
+ IF (score < difficulty / 3)
+ THEN (
+ message(caster, "Your spell backfires!");
+ IF (random(110) < (luk(caster)))
+ THEN itemheal(caster, 0 - ((level + 1) * (level + 2) * (3 + random(28))), 0);
+ ELSE itemheal(caster, 0 - (level + 1), 0);
+ ) ELSE IF (score < (difficulty * 2) / 3)
+ THEN (
+ IF random(5) = 0
+ THEN (message(caster, "Your spell solidifies into the shape of a mysterious object!");
+ create_item(caster, "Iten", 1);)
+ ELSE message(caster, "Your spell escapes!");
+ ) ELSE (
+ message(caster, "Your spell takes on a mind of its own!");
+ IF random(3) = 0
+ THEN create_item(caster, bad_item, 1);
+ )
+ )
+
+# Increase spellpower by school and general magic skill
+PROCEDURE adjust_spellpower(school) =
+ experience = (script_int(caster, SCRIPT_XP) >> SCRIPT_XP_SHIFT) & SCRIPT_XP_MASK;
+ spellpower = spellpower + (skill(caster, MAGIC) + skill(caster, school)) * 10;
+ # Below, we adjust by special items
+ IF (not(failed(target)) && (school = LIFE || school = NATURE))
+ THEN IF (target)
+ THEN IF (pc(target) = partner(caster))
+ THEN (spellpower = spellpower + 200;
+ IF is_equipped(caster, "WeddingRing")
+ THEN spellpower = spellpower + 50;
+ IF is_equipped(pc(target), "WeddingRing")
+ THEN spellpower = spellpower + 50;)
+
+PROCEDURE heal(target, max_heal) =
+ CALL default_effect();
+ IF caster <> target
+ THEN sfx(target, SFX_HEAL, 0);
+ power = spellpower + vit(caster);
+ power = min(max_heal, (max_heal * power) / 250);
+ itemheal(target, power, 0);
+
+# Goes through instaheal instead of itemheal
+PROCEDURE quickheal(target, power) =
+ CALL default_effect();
+ IF caster <> target
+ THEN sfx(target, SFX_HEAL, 0);
+ instaheal(target, power, 0);
+
+# Can attack the target? Imports attack_range from dynamic environment
+PROCEDURE attack_check(target) =
+ IF (not (line_of_sight(location(caster), location(target))))
+ THEN ABORT;
+ IF (not (rdistance(location(caster), location(target)) <= attack_range))
+ THEN ABORT;
+
+# Cause elemental damage. bonus_elt grants an attack bonus, malus_elt reduces the attack. `effect' is the sfx ID.
+PROCEDURE elt_damage(target, damage, dmgplus, bonus_elt, malus_elt, effect) =
+ d = damage + random(dmgplus);
+ IF (element(target) = malus_elt)
+ THEN d = d / 3;
+ IF (element(target) = bonus_elt)
+ THEN d = (d * (4 + element_level(target))) / 4;
+ #message(caster, "bonus=" + (element(target) = bonus_elt) + " malus=" + (element(target) = malus_elt) + " damage=" + damage + " + r(" + dmgplus + ") -> " + d);
+ sfx(target, effect, 0);
+ injure(caster, target, d, 0);
+
+PROCEDURE melee_damage(target, damage, dmgplus) =
+ CALL attack_check(target);
+ d = damage + random(dmgplus);
+ evade = level(target) + mdef(target);
+ IF (spellpower - random(100) < evade)
+ THEN d = 0;
+ injure(caster, target, d, 0);
+
+
+PROCEDURE install_attack_spell(charges, base_delay, range, attack_animation) =
+ CALL default_effect();
+ attack_range = range;
+ override_attack(caster, charges, ((200 - agi(caster)) * base_delay) / 200,
+ range, ATTACK_ICON_GENERIC, attack_animation, 0);
+
+PROCEDURE install_melee_spell(charges, base_delay, attack_animation) =
+ CALL install_attack_spell(charges, base_delay, 1, attack_animation);
+
+PROCEDURE summon_spell(mob_id, count, delay, lifetime, control_level) =
+ CALL default_effect();
+ sfx(location, SFX_SUMMON_START, 0);
+ WAIT delay;
+ sfx(location, SFX_SUMMON_FIRE, 0);
+ spawn(rbox(location, 2), caster, mob_id,
+ if_then_else(skill(caster, ASTRAL) >= control_level, 2, 1), # pets when level is high enough
+ count, lifetime);
+
+
+#--------------------------------------------------------------------------------
+# Level 0 spells
+#--------------------------------------------------------------------------------
+
+SPELL transmute-wood-to-mouboo : "#T00" =
+ LET level = 0
+ school = TRANSMUTE
+ IN (MANA 5, CASTTIME 4000,
+ REQUIRE skill(caster, MAGIC) > level,
+ COMPONENTS ["RawLog"])
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ CALL create_item("MoubooFigurine", 1, "WarpedLog", 40);
+ CALL gain_xp(1);
+
+SPELL make-sulphur : "#T01" =
+ LET level = 0
+ school = TRANSMUTE
+ IN (MANA 4, CASTTIME 4000,
+ REQUIRE skill(caster, MAGIC) > level,
+ COMPONENTS ["PileOfAsh"])
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ CALL create_item("SulphurPowder", 1 + spellpower / 100 + (random(max(1, 800 - spellpower)) / 180), "PileOfAsh", 50);
+ CALL gain_xp(1);
+
+SPELL lesser-heal (target : STRING) : "#L00" =
+ LET level = 0
+ school = LIFE
+ IN (MANA 6, CASTTIME 500,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE if_then_else(failed(pc(target)), 1,
+ rdistance(location(caster), location(pc(target))) < 2 + (spellpower / 100)),
+ (COMPONENTS ["LifeStone"]))
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ IF failed(pc(target))
+ THEN (IF ((target = "mouboo" || target = "Mouboo")
+ && rdistance(location(caster), location(npc("Mouboo"))) < 2 + (spellpower / 100))
+ THEN { mes "Your spell seems to have no effect on the mouboo."; next; close; }
+ ELSE target = caster;)
+ ELSE (target = pc(target);
+ IF is_dead(target)
+ THEN ABORT;)
+ CALL gain_heal_xp(min(200, max_hp(target) - hp(target)), 1, 2, 2); # report half values for non-instaheal
+ CALL heal(target, 200);
+ CALL gain_xp(1);
+
+
+SPELL flare-dart : "#W00" =
+ LET level = 0
+ school = WAR
+ IN (MANA 10, CASTTIME 500,
+ REQUIRE skill(caster, MAGIC) > level,
+ (REQUIRE skill(caster, school) > 2 OR COMPONENTS ["SulphurPowder"]))
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ damage = 5 * sqrt(spellpower);
+ damage_bonus = 5 + level(caster) / 3;
+ CALL install_attack_spell(3 + spellpower / 50,
+ 1200,
+ 4, 31);
+ CALL gain_xp(1);
+ ATTRIGGER CALL attack_check(target);
+ CALL elt_damage (target, damage, damage_bonus, ELT_WATER, ELT_FIRE, 15);
+
+
+SPELL magic-blade : "#W01" =
+ LET level = 0
+ school = WAR
+ IN (MANA 9, CASTTIME 500,
+ REQUIRE skill(caster, MAGIC) > level)
+ => ( COMPONENTS ["SharpKnife"] =>
+ EFFECT CALL adjust_spellpower(WAR);
+ CALL default_effect();
+ CALL install_melee_spell(10 + spellpower / 15, 1200, 30);
+ CALL gain_xp(1);
+ ATTRIGGER CALL melee_damage(target, 60, 5 + str(caster));
+ | COMPONENTS ["Knife"] =>
+ EFFECT CALL adjust_spellpower(WAR);
+ CALL default_effect();
+ CALL install_melee_spell(10 + spellpower / 15, 1200, 30);
+ CALL gain_xp(1);
+ ATTRIGGER CALL melee_damage(target, 40, 5 + str(caster));
+ )
+
+SPELL aggravate : "#N00" =
+ LET level = 0
+ school = NATURE
+ IN (MANA 3, CASTTIME 1000,
+ REQUIRE skill(caster, MAGIC) > level)
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ FOREACH MOB target IN rbox(location(caster), 2 + spellpower / 50) DO
+ IF line_of_sight(location(caster), location(target))
+ THEN (CALL sfx_generic(target);
+ aggravate(target, 0, caster);)
+
+SPELL grow-mauve : "#N01" =
+ LET level = 0
+ school = NATURE
+ IN (MANA 4, CASTTIME 2000,
+ REQUIRE skill(caster, MAGIC) > level,
+ COMPONENTS ["MauveHerb"])
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ CALL gain_xp(1);
+ spawn(rbox(location, 2), caster, 1029, 1, if_then_else(skill(caster, NATURE) < 3, 1, if_then_else(skill(caster, NATURE) < 5, 2, 3)), 10000);
+
+SPELL grow-alizarin : "#N02" =
+ LET level = 0
+ school = NATURE
+ IN (MANA 4, CASTTIME 2000,
+ REQUIRE skill(caster, MAGIC) > level,
+ COMPONENTS ["AlizarinHerb"])
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ CALL gain_xp(1);
+ spawn(rbox(location, 2), caster, 1032, 1, if_then_else(skill(caster, NATURE) < 3, 1, if_then_else(skill(caster, NATURE) < 5, 2, 3)), 10000);
+
+SPELL grow-gamboge : "#N03" =
+ LET level = 0
+ school = NATURE
+ IN (MANA 4, CASTTIME 2000,
+ REQUIRE skill(caster, MAGIC) > level,
+ COMPONENTS ["GambogeHerb"])
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ CALL gain_xp(1);
+ spawn(rbox(location, 2), caster, 1031, 1, if_then_else(skill(caster, NATURE) < 3, 1, if_then_else(skill(caster, NATURE) < 5, 2, 3)), 10000);
+
+SPELL grow-cobalt : "#N04" =
+ LET level = 0
+ school = NATURE
+ IN (MANA 4, CASTTIME 2000,
+ REQUIRE skill(caster, MAGIC) > level,
+ COMPONENTS ["CobaltHerb"])
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ CALL gain_xp(1);
+ spawn(rbox(location, 2), caster, 1030, 1, if_then_else(skill(caster, NATURE) < 3, 1, if_then_else(skill(caster, NATURE) < 5, 2, 3)), 10000);
+
+
+LOCAL SPELL summon-maggots : "#A00" =
+ LET level = 0
+ school = ASTRAL
+ IN (MANA 21, CASTTIME 20000,
+ REQUIRE skill(caster, MAGIC) > level,
+ COMPONENTS ["MaggotSlime"])
+ => EFFECT CALL adjust_spellpower(school);
+ CALL gain_xp(1);
+ CALL summon_spell(1002,
+ 1 + ((sqrt(spellpower) + (spellpower / 15)) / 5),
+ 5000 - (spellpower * 5),
+ 10000 + (spellpower * 50), 1);
+
+SPELL detect-magic : "#G00" =
+ LET level = 0
+ school = MAGIC
+ IN (MANA 3, CASTTIME 6000,
+ REQUIRE skill(caster, MAGIC) > level)
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ range = 1 + spellpower / 50;
+ FOREACH NPC n IN rbox(location(caster), range)
+ DO IF (contains_string(name_of(n), "#MAGIC") || contains_string(name_of(n), "#_M"))
+ THEN sfx(n, SFX_DEFAULT, 0);
+ FOREACH SPELL s IN rbox(location(caster), range)
+ DO IF (s <> self_invocation)
+ THEN sfx(s, SFX_DEFAULT, 0);
+
+
+#--------------------------------------------------------------------------------
+# Level 1 spells
+#--------------------------------------------------------------------------------
+
+SPELL make-arrows : "#T10" =
+ LET level = 1
+ school = TRANSMUTE
+ IN (MANA 8, CASTTIME 5000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ COMPONENTS ["RawLog"])
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ CALL create_item("Arrow", 1 + spellpower / 40 + (random(max(1, 800 - spellpower)) / 80), "WarpedLog", 500);
+ CALL gain_xp(1);
+
+SPELL make-shirt : "#T11" =
+ LET level = 1
+ school = TRANSMUTE
+ IN (MANA 25, CASTTIME 5000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ COMPONENTS [5 * "CottonCloth"])
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ CALL create_item("CottonShirt", 1, "CottonCloth", 425);
+ CALL gain_xp(2);
+
+SPELL make-tanktop : "#T12" =
+ LET level = 1
+ school = TRANSMUTE
+ IN (MANA 25, CASTTIME 5000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ COMPONENTS [4 * "CottonCloth"])
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ CALL create_item("WhiteTankTop", 1, "CottonCloth", 350);
+ CALL gain_xp(2);
+
+SPELL make-short-tanktop : "#T13" =
+ LET level = 1
+ school = TRANSMUTE
+ IN (MANA 25, CASTTIME 5000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ COMPONENTS [3 * "CottonCloth"])
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ CALL create_item("WhiteShortTankTop", 1, "CottonCloth", 250);
+ CALL gain_xp(2);
+
+SPELL make-iron-powder : "#T14" =
+ LET level = 1
+ school = TRANSMUTE
+ IN (MANA 8, CASTTIME 5000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ COMPONENTS ["IronOre"])
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ CALL create_item("IronPowder", 1 + spellpower / 140 + (random(max(1, 900 - spellpower)) / 220), "IronOre", 700);
+ CALL gain_xp(3);
+
+SPELL lay-on-hands (target : STRING) : "#L10" =
+ LET level = 1
+ school = LIFE
+ IN (MANA 10, CASTTIME 500,
+ REQUIRE hp(caster) > max_hp(caster) / 20,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ REQUIRE if_then_else(failed(pc(target)), 1,
+ (rdistance(location(caster),
+ location(pc(target))) < 2 + (spellpower / 50))
+ && not (running_status_update(pc(target), SC_HALT_REGENERATE))
+ ))
+ => EFFECT CALL adjust_spellpower(school);
+ IF (pc (target) == caster) THEN ABORT;
+ IF failed(pc(target))
+ THEN (IF ((target = "mouboo" || target = "Mouboo")
+ && rdistance(location(caster), location(npc("Mouboo"))) < 2 + (spellpower / 100))
+ THEN (needed = 1000;
+ {
+ set @spell, 1;
+ callfunc "QuestMoubooHeal";
+ })
+ ELSE (target = caster;
+ needed = max_hp(target) - hp(target);
+ ))
+ ELSE (target = pc(target);
+ needed = max_hp(target) - hp(target);)
+
+ pay_fraction = max(80, 200 - (vit(caster) + (spellpower / 10))); # Pay at least 40%
+ payment = (needed * pay_fraction) / 200;
+ available = hp(caster) - (max_hp(caster) / 20);
+
+ IF payment < available
+ THEN power = needed;
+ ELSE (payment = available;
+ power = (available * 200) / pay_fraction;
+ )
+ CALL gain_heal_xp(power, 1, 1, 3);
+ CALL quickheal(target, power);
+ status_change(caster, SC_HALT_REGENERATE, 0, 0, 0, 0, 10000);
+ IF ((caster <> target) && (payment >= 100))
+ THEN CALL gain_xp(min(4, payment / 100));
+
+SPELL lightning-strike : "#W10" =
+ LET level = 1
+ school = WAR
+ IN (MANA 20, CASTTIME 1000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["IronPowder"]))
+ => EFFECT CALL adjust_spellpower(school);
+ damage = spellpower;
+ damage_bonus = 1 + spellpower / 2;
+ CALL install_attack_spell(1 + spellpower / 90,
+ 3000,
+ 8, 31);
+ CALL gain_xp(2);
+ ATTRIGGER CALL attack_check(target);
+ in_rain = 0;
+ area = location(caster);
+ FOREACH SPELL s IN rbox(location(caster), MAX_RAIN_SPELL_RADIUS + 1) DO
+ IF name_of(s) = "rain" THEN (
+ IF is_in (location(caster), s.area)
+ THEN (in_rain = in_rain | 1;
+ area = area + s.area;);
+ IF is_in (location(target), s.area)
+ THEN in_rain = in_rain | 2;
+ );
+ IF in_rain & 1
+ THEN (# caster standing in the rain? This is going to be fun.
+ used = 0;
+ FOREACH TARGET t IN area DO
+ IF (random(200) + luk(caster) > 175)
+ THEN (used = used + 1;
+ CALL elt_damage (t, damage / 6, 1 + (damage_bonus / 3), ELT_EARTH, ELT_WIND, 17 + random(3)););
+ IF (not(used) || (random(200) + luk(caster) < 150))
+ THEN (sfx(caster, 17 + random(3), 0);
+ itemheal(caster, 0 - damage - (random(damage_bonus)), 0););
+ ) ELSE
+ CALL elt_damage (target, damage, damage_bonus, ELT_EARTH, ELT_WIND, 17 + random(3));
+
+LOCAL SPELL arrow-hail : "#W11" =
+ LET level = 1
+ school = WAR
+ IN (MANA 25, CASTTIME 5000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ REQUIRE is_exterior(location(caster)),
+ (COMPONENTS [20 * "Arrow"] OR COMPONENTS [20 * "IronArrow"]),
+ (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["SulphurPowder"]))
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ range = 7;
+ area = rbox(awayfrom(location(caster), dir(caster), 1 + range), range);
+ damage = 100;
+ damage_bonus = spellpower / 5;
+ CALL gain_xp(2);
+ FOR i = 0 TO spellpower / 8 DO (
+ FOR j = 0 TO 3 DO (
+ location = random_location(area);
+ sfx(location, SFX_ARROW_HAIL, 0);
+ done = 0;
+ FOREACH TARGET target IN rbox(location, 0) DO (
+ injure(caster, target, damage + random(damage_bonus) + random(damage_bonus), 0);
+ done = 1;
+ BREAK;
+ )
+ IF location(caster) = location && not(done)
+ THEN (itemheal(caster, 0 - (damage + random(damage_bonus) + random(damage_bonus)), 0);
+ sfx(caster, SFX_HIT, 0);
+ )
+ );
+ WAIT (250 - min(spellpower / 3, 180)) + random(50) + random(50);
+ );
+
+SPELL magic-knuckles : "#W12" =
+ LET level = 1
+ school = WAR
+ IN (MANA 20, CASTTIME 500,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["Beer"]))
+ =>
+ EFFECT CALL adjust_spellpower(WAR);
+ str = str(caster);
+ CALL install_melee_spell(10 + spellpower / 10, 1300, 34);
+ ATTRIGGER CALL melee_damage(target, 30, 5 + (str * 2));
+
+SPELL flying-backpack (target : PC) : "#N10" =
+ LET level = 1
+ school = NATURE
+ IN (MANA 12, CASTTIME 1000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["SilkCocoon"]),
+ REQUIRE rdistance(location(target), location(caster)) < 2 + spellpower / 30)
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ IF (caster <> target)
+ THEN sfx(caster, 2, 0);
+ status_change(target, SC_FLYING_BACKPACK, 0, 0, 0, 0, 5000 + (spellpower * 500));
+ message (target, "Your backpack is lifted by a mystical force; you no longer feel it pressing on your back.");
+ CALL gain_xp(1);
+ ATEND message (target, "Your backpack is no longer levitating.");
+ sfx(target, 2, 0);
+
+SPELL protect (target : PC) : "#N11" =
+ LET level = 1
+ school = NATURE
+ IN (MANA 14, CASTTIME 1500,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["HardSpike"]),
+ REQUIRE rdistance(location(target), location(caster)) < 2 + spellpower / 30)
+ => EFFECT CALL adjust_spellpower(school);
+ sfx(target, 11, 0);
+ IF (caster <> target)
+ THEN CALL default_effect();
+ status_change(target, SC_PHYS_SHIELD, 5 + max(15, spellpower / 20), 0, 0, 0, 5000 + (spellpower * 400));
+ message (target, "You feel more protected.");
+ CALL gain_xp(2);
+ ATEND message (target, "You feel less protected.");
+ sfx(target, 111, 0);
+
+SPELL happy-curse (target : PC) : "#N12" =
+ LET level = 1
+ school = NATURE
+ IN (MANA 13, CASTTIME 1000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["GingerBreadMan"]),
+ REQUIRE rdistance(location(target), location(caster)) < 1 + spellpower / 100)
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ FOR i = 0 TO (spellpower / 10) DO (emote(target, 3); WAIT 500;);
+ CALL gain_xp(1);
+
+LOCAL SPELL rain : "#N13" =
+ LET level = 1
+ school = NATURE
+ IN (MANA 17, CASTTIME 3000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ REQUIRE is_exterior(location(caster)),
+ (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["BottleOfWater"]))
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ CALL gain_xp(1);
+ range = min(MAX_RAIN_SPELL_RADIUS, 3 + spellpower / 30);
+ area = rbox(location(caster), range);
+ IF (is_in(location(npc("#DruidTree0#_M")), area)
+ || is_in(location(npc("#DruidTree1#_M")), area))
+ THEN {
+ set @flag, 1;
+ callfunc "QuestTreeTrigger";
+ };
+ FOR i = 0 TO spellpower DO (
+ FOR j = 0 TO spellpower / 100 DO (
+ location = random_location(area);
+ sfx(location, SFX_RAIN, 0);
+ FOREACH TARGET target IN rbox(location, 1) DO
+ IF element(target) = ELT_FIRE
+ THEN injure(caster, target, 2 + random(5 + spellpower / 15), 0);
+ )
+ WAIT 300 - min(spellpower, 200) + random(100);
+ );
+
+PROCEDURE shear-drop(target, target2, item, prob) =
+ IF (target = name || target2 = name)
+ THEN (IF (score < prob)
+ THEN drop_item_for(place, item, 1, 60000, caster, 5000);)
+
+PROCEDURE shear-drop2(target, target2, item, prob, item2, prob2) =
+ IF (target = name || target2 = name)
+ THEN (IF (score < prob)
+ THEN drop_item_for(place, item, 1, 60000, caster, 5000);
+ ELSE CALL shear-drop(target, target2, item2, prob2 + prob);)
+
+PROCEDURE shear-drop3(target, target2, item, prob, item2, prob2, item3, prob3) =
+ IF (target = name || target2 = name)
+ THEN (IF (score < prob)
+ THEN drop_item_for(place, item, 1, 60000, caster, 5000);
+ ELSE CALL shear-drop2(target, target2, item2, prob2 + prob, item3, prob3 + prob);)
+
+
+SPELL shear : "#N14" =
+ LET level = 1
+ school = NATURE
+ IN (MANA 23, CASTTIME 1000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level)
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ override_attack (caster, 1, 2000, 1, ATTACK_ICON_SHEARING, 30, 0);
+ ATTRIGGER IF not(is_pc(target))
+ THEN (score = random (1000 - (random (spellpower))); # lower score -> more valuable item
+ name = name_of(target);
+ place = random_location(rbox(location(target), 1));
+ IF running_status_update(target, SC_SHEARED)
+ THEN ABORT;
+ status_change(target, SC_SHEARED, 1, 1, 1, 1, 600000); # 10 minutes
+ CALL shear-drop("Fluffy", "Fluffy", "WhiteFur", 300);
+ CALL shear-drop("SpikyMushroom", "Spiky Mushroom", "HardSpike", 250);
+ CALL shear-drop("Mouboo", "Mouboo", "CottonCloth", 175);
+ CALL shear-drop("Cobalt", "CobaltPlant", "CobaltHerb", 700);
+ CALL shear-drop("Alizarin", "AlizarinPlant", "AlizarinHerb", 700);
+ CALL shear-drop("Gamboge", "GambogePlant", "GambogeHerb", 700);
+ CALL shear-drop("Mauve", "MauvePlant", "MauveHerb", 700);
+ CALL shear-drop("SilkWorm", "Silkworm", "SilkCocoon", 300);
+ IF ((name = "Fluffy" || name = "Mouboo") && random(2))
+ THEN { set @value, 1; callfunc "QuestSagathaHappy"; };
+ )
+
+
+
+SPELL barrier (target : PC) : "#A10" =
+ LET level = 1
+ school = ASTRAL
+ IN (MANA 16, CASTTIME 1000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["SmallMushroom"]),
+ REQUIRE rdistance(location(target), location(caster)) < 2 + spellpower / 30)
+ => EFFECT CALL adjust_spellpower(school);
+ sfx(target, SFX_BARRIER, 0);
+ IF (caster <> target)
+ THEN CALL default_effect();
+ status_change(target, SC_MBARRIER, 20 + max(30, spellpower / 8), 0, 0, 0, 2000 + (spellpower * 200));
+ message (target, "You are surrounded by a magical barrier.");
+ CALL gain_xp(3);
+ ATEND message (target, "Your magical barrier disspiates.");
+ sfx(target, SFX_UNBARRIER, 0);
+
+
+LOCAL SPELL summon-spiky-mushrooms : "#A11" =
+ LET level = 1
+ school = ASTRAL
+ IN (MANA 33, CASTTIME 20000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ COMPONENTS ["HardSpike"])
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ CALL gain_xp(1);
+ CALL summon_spell(1019, 1 + spellpower / 120, 5000 - (spellpower * 9), spellpower * 400, 2);
+
+LOCAL SPELL summon-fluffies : "#A12" =
+ LET level = 1
+ school = ASTRAL
+ IN (MANA 39, CASTTIME 20000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ COMPONENTS ["WhiteFur"])
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ CALL gain_xp(1);
+ CALL summon_spell(1020, 1 + spellpower / 170 + spellpower / 430, 5000 - (spellpower * 8), spellpower * 350, 3);
+
+
+SPELL detect-players : "#G10" =
+ LET level = 1
+ school = MAGIC
+ IN (MANA 7, CASTTIME 300,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level)
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ message = "";
+ FOREACH PC target IN rbox(location(caster), spellpower / 2)
+ DO IF ((target <> caster)
+ && not (running_status_update(pc(target), SC_HIDE)))
+ THEN (IF message <> ""
+ THEN message = message + ", ";
+ message = message + name_of (target);
+ IF spellpower > 99
+ THEN message = message + "(" + level(target) + ")";
+ )
+ IF message = ""
+ THEN message(caster, "You sense no-one else nearby.");
+ ELSE message(caster, "You sense the following: " + message);
+
+SPELL reveal : "#G11" =
+ LET level = 1
+ school = MAGIC
+ IN (MANA 18, CASTTIME 3000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level)
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ FOREACH PC target IN rbox(location(caster), 1 + spellpower / 100)
+ DO IF has_shroud(target) && level(caster) * 2 > level(target)
+ THEN (unshroud(target);
+ sfx(target, SFX_DEFAULT, 500);)
+
+
+SPELL enchant-lifestone : "#G12" =
+ LET level = 1
+ school = MAGIC
+ IN (MANA 15, CASTTIME 4000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ (COMPONENTS ["MaggotSlime"] OR COMPONENTS["BugLeg"]
+ OR COMPONENTS ["MauveHerb", "AlizarinHerb", "CobaltHerb", "GambogeHerb"]))
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ create_item(caster, "LifeStone", 1);
+ CALL gain_xp(1);
+
+SPELL sense-spouse : "#G13" =
+ LET level = 1
+ school = MAGIC
+ IN (MANA 7, CASTTIME 400,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ REQUIRE is_married(caster),
+ REQUIRE is_equipped(caster, "WeddingRing"))
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ IF (failed(partner(caster)) || not(is_equipped(partner(caster), "WeddingRing")))
+ THEN (message(caster, "You cannot sense your partner.");
+ ABORT;)
+ partner = partner(caster);
+ name = name_of(partner);
+ IF (is_dead(partner) || (map_nr(location(partner)) <> map_nr(location(caster))))
+ THEN (message(caster, "You cannot sense " + name + " nearby.");
+ ABORT;)
+ IF (map_level(location(partner)) > 2 && map_level(location(caster)) < map_level(location(partner)))
+ THEN (message(caster, "You sense " + name + " somewhere below.");
+ ABORT;)
+ IF (map_level(location(caster)) > 2 && map_level(location(partner)) < map_level(location(caster)))
+ THEN (message(caster, "You sense " + name + " somewhere above.");
+ ABORT;)
+ IF (map_level(location(caster)) <> map_level(location(partner)))
+ THEN message(caster, "You sense " + name + " somewhere in the vincinity.");
+ ELSE (distance = rdistance(location(caster), location(partner));
+ dir = dir_towards(location(caster), location(partner), 1);
+ IF (distance < 3)
+ THEN message(caster, "You sense " + name + " right next to you.");
+ ELSE IF (distance < 30)
+ THEN message(caster, "You sense " + name + " close by, towards the " + dir + ".");
+ ELSE IF (distance < 200)
+ THEN message(caster, "You sense " + name + " nearby, towards the " + dir + ".");
+ ELSE message(caster, "You sense " + name + " in the " + dir + ".");
+ )
+
+SPELL hide (target : PC) : "#A13" =
+ LET level = 1
+ school = ASTRAL
+ IN (MANA 11, CASTTIME 1000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["CottonCloth"]),
+ REQUIRE rdistance(location(target), location(caster)) < 2 + spellpower / 30)
+ => EFFECT CALL adjust_spellpower(school);
+ sfx(target, SFX_DEFAULT, 0);
+ IF (caster <> target)
+ THEN CALL default_effect();
+ status_change(target, SC_HIDE, 0, 0, 0, 0, 5000 + (spellpower * 2500));
+ CALL gain_xp(2);
+ message(target, "You are hidden!");
+ IF (caster <> target) THEN message(caster, "You hid someone!");
+ ATEND message(target, "You are no longer hidden.");
+
+#--------------------------------------------------------------------------------
+# Level 2 spells
+#--------------------------------------------------------------------------------
+
+SPELL fire-ball : "#W22" =
+ LET level = 2
+ school = WAR
+ IN (MANA 30, CASTTIME 1000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ COMPONENTS ["PileOfAsh"])
+ => EFFECT CALL adjust_spellpower(school);
+ damage = min(50 + skill(caster, school) * 40,
+ 30 + ((spellpower * 3) / 2));
+ damage_bonus = level(caster) + spellpower * 2;
+ radius = 2 + spellpower / 50;
+ CALL install_attack_spell(1 + spellpower / 60,
+ 5000,
+ 10, 31);
+ ATTRIGGER CALL attack_check(target);
+ loc = location(target);
+ #WAIT 500;
+ sfx(loc, 16, 0);
+ FOREACH TARGET target IN rbox(loc, radius)
+ DO IF line_of_sight(loc, location(target))
+ THEN (divisor = (3 + rdistance(loc, location(target)));
+ CALL elt_damage (target, (damage * 3) / divisor, (damage_bonus * 3) / divisor, ELT_WATER, ELT_FIRE, 15);
+ )
+
+SPELL summon-partner : "#A23" =
+ LET level = 2
+ school = ASTRAL
+ IN (MANA 30, CASTTIME 2000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ REQUIRE is_married(caster))
+ => EFFECT CALL adjust_spellpower(school);
+ CALL default_effect();
+ IF (failed (partner (caster)))
+ THEN message (caster, "You call out for your partner, but there is no response.");
+ ELSE (message (caster, "You call out for " + (name_of (partner (caster))) + ".");
+ message (partner(caster), name_of(caster) + " is calling for your aid!");
+ sfx(partner(caster), 2, 0);
+ WAIT (max (5000, 30000 - (spellpower * 60)));
+ IF (failed (partner (caster)))
+ THEN message (caster, "Your partner has abandoned you.");
+ ELSE IF (is_dead (partner (caster)))
+ THEN message (caster, "Something seems to have happened to " + (name_of(partner(caster))) + ".");
+ ELSE (sfx(location(partner(caster)), SFX_TELEPORT, 0);
+ dest = awayfrom(location(caster), random_dir(1), 1);
+ warp(partner(caster), dest);
+ sfx(dest, SFX_TELEPORT, 0);
+ )
+ )
+
+
+
+#--------------------------------------------------------------------------------
+# Level 4 spells
+#--------------------------------------------------------------------------------
+
+SPELL shroud : "#N40" =
+ LET level = 4
+ school = NATURE
+ IN (MANA 40, CASTTIME 400,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level)
+ => EFFECT CALL default_effect();
+ shroud(caster, 0x04);
+
+SPELL teleport (destination : STRING) : "#A40" =
+ LET level = 4
+ school = ASTRAL
+ IN (MANA 80, CASTTIME 400,
+ # COMPONENT ["EtherEssence"],
+ # CATALYST ["TeleportCrystal"],
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level)
+ => EFFECT CALL default_effect();
+ WAIT 1000 + (200000 / (spellpower + 10));
+ sfx(location(caster), SFX_TELEPORT, 1);
+ warp(caster, random_location(anchor(destination)));
+ sfx(location(caster), SFX_TELEPORT, 100);
+
+#--------------------------------------------------------------------------------
+# Debug keywords
+#--------------------------------------------------------------------------------
+
+SPELL debug : "debug" =
+ REQUIRE DEBUG
+ => EFFECT message (caster, "FLAGS: "
+ + "drank=" + ((script_int(caster, "MAGIC_FLAGS") & 1) > 0) + ", "
+ + "Kmseed=" + ((script_int(caster, "MAGIC_FLAGS") & 2) > 0) + ", "
+ + "touched-mseed=" + ((script_int(caster, "MAGIC_FLAGS") & 4) > 0) + ", "
+ + "mseed-max=" + ((script_int(caster, "MAGIC_FLAGS") & 8) > 0) + ", "
+ + "Kauldsbel=" + ((script_int(caster, "MAGIC_FLAGS") & 16) > 0) + ", "
+ + "Kwyara=" + ((script_int(caster, "MAGIC_FLAGS") & 32) > 0) + ", "
+ + "Ksagatha=" + ((script_int(caster, "MAGIC_FLAGS") & 64) > 0) + ", "
+ + "Kmpotion=" + ((script_int(caster, "MAGIC_FLAGS") & 128) > 0) + ", "
+ + "mseed-rumour=" + ((script_int(caster, "MAGIC_FLAGS") & 256) > 0) + ", "
+ + "Kcuttree=" + ((script_int(caster, "MAGIC_FLAGS") & 512) > 0) + ", "
+ + "cut=" + ((script_int(caster, "MAGIC_FLAGS") & 1024) > 0) + ", "
+ + "Kdruidtree=" + ((script_int(caster, "MAGIC_FLAGS") & 2048) > 0) + ", "
+ + "Kimp=" + ((script_int(caster, "MAGIC_FLAGS") & 4096) > 0) + ", "
+ + "Koldwiz=" + ((script_int(caster, "MAGIC_FLAGS") & 8192) > 0));
+ message (caster, "EXP: " + (script_int(caster, "MAGIC_EXPERIENCE") & 0xffff)
+ + ", lastspell=" + ((script_int(caster, "MAGIC_EXPERIENCE") >> 16) & 0xff)
+ + ", healexp=" + ((script_int(caster, "MAGIC_EXPERIENCE") >> 24) & 0xff));
+ message (caster, "STATUS: "
+ + "auldsbel:" + (script_int(caster, "QUEST_MAGIC") & 0x1f) + "," + ((script_int(caster, "QUEST_MAGIC") >> 5) & 0x7) + ", "
+ + "dt/mb:" + ((script_int(caster, "QUEST_MAGIC") >> 8) & 0xf) + ", "
+ + "s-unhappy:" + ((script_int(caster, "QUEST_MAGIC") >> 12) & 0xf) + ", "
+ + "sagatha:" + ((script_int(caster, "QUEST_MAGIC") >> 16) & 0xff) + ", "
+ + "swords:" + ((script_int(caster, "QUEST_MAGIC") >> 24) & 0xff) + ", "
+ + "imp:" + ((script_int(caster, "QUEST_MAGIC2") >> 0) & 0xf) + ", "
+ + "elanore:" + ((script_int(caster, "QUEST_MAGIC2") >> 4) & 0xf) + ", "
+ + "wyara:" + ((script_int(caster, "QUEST_MAGIC2") >> 8) & 0xf));
+
+PROCEDURE debug_xmod(name, mask, shift, gain) =
+ value = ((script_int(caster, name) >> shift) & mask) + gain;
+ IF (value < 0)
+ THEN value = 0;
+ IF (value > mask)
+ THEN value = mask;
+ CALL set_var(name, mask, shift, value);
+
+PROCEDURE debug_mod(name, delta) =
+ IF (name = "mexp") THEN CALL debug_xmod("MAGIC_EXPERIENCE", 0xffff, 0, delta);
+ ELSE IF (name = "lastspell") THEN CALL debug_xmod("MAGIC_EXPERIENCE", 0xff, 16, delta);
+ ELSE IF (name = "healexp") THEN CALL debug_xmod("MAGIC_EXPERIENCE", 0xff, 24, delta);
+ ELSE IF (name = "drank") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 0, delta);
+ ELSE IF (name = "Kmseed") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 1, delta);
+ ELSE IF (name = "touched-mseed") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 2, delta);
+ ELSE IF (name = "mseed-max") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 3, delta);
+ ELSE IF (name = "Kauldsbel") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 4, delta);
+ ELSE IF (name = "Kwyara") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 5, delta);
+ ELSE IF (name = "Ksagatha") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 6, delta);
+ ELSE IF (name = "Kmpotion") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 7, delta);
+ ELSE IF (name = "mseed-rumour") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 8, delta);
+ ELSE IF (name = "Kcuttree") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 9, delta);
+ ELSE IF (name = "cut") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 10, delta);
+ ELSE IF (name = "Kdruidtree") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 11, delta);
+ ELSE IF (name = "Kimp") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 12, delta);
+ ELSE IF (name = "oldwiz") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 13, delta);
+ ELSE IF (name = "auldsbel") THEN CALL debug_xmod("QUEST_MAGIC", 0x1f, 0, delta);
+ ELSE IF (name = "Qauldsbel") THEN CALL debug_xmod("QUEST_MAGIC", 0x7, 5, delta);
+ ELSE IF (name = "dt") THEN CALL debug_xmod("QUEST_MAGIC", 0x3, 10, delta);
+ ELSE IF (name = "mb") THEN CALL debug_xmod("QUEST_MAGIC", 0x3, 8, delta);
+ ELSE IF (name = "s-unhappy") THEN CALL debug_xmod("QUEST_MAGIC", 0xff, 12, delta);
+ ELSE IF (name = "sagatha") THEN CALL debug_xmod("QUEST_MAGIC", 0xff, 16, delta);
+ ELSE IF (name = "swords") THEN CALL debug_xmod("QUEST_MAGIC", 0xff, 24, delta);
+ ELSE IF (name = "imp") THEN CALL debug_xmod("QUEST_MAGIC2", 0xf, 0, delta);
+ ELSE IF (name = "elanore") THEN CALL debug_xmod("QUEST_MAGIC2", 0xf, 4, delta);
+ ELSE IF (name = "wyara") THEN CALL debug_xmod("QUEST_MAGIC2", 0xf, 8, delta);
+ ELSE message(caster, "Unknown");
+
+SPELL debug-up1 (name : STRING) : "debug+1" =
+ REQUIRE DEBUG
+ => EFFECT CALL debug_mod(name, 1);
+
+SPELL debug-down1 (name : STRING) : "debug-1" =
+ REQUIRE DEBUG
+ => EFFECT CALL debug_mod(name, 0 - 1);
+
+SPELL debug-up16 (name : STRING) : "debug+16" =
+ REQUIRE DEBUG
+ => EFFECT CALL debug_mod(name, 16);
+
+SPELL debug-down16 (name : STRING) : "debug-16" =
+ REQUIRE DEBUG
+ => EFFECT CALL debug_mod(name, 0 - 16);
+
+SPELL debug-reset : "debug-reset" =
+ REQUIRE DEBUG
+ => EFFECT set_script_variable(caster, "QUEST_MAGIC", 0);
+ set_script_variable(caster, "QUEST_MAGIC2", 0);
+ set_script_variable(caster, "MAGIC_FLAGS", 0);
+ set_script_variable(caster, "MAGIC_EXP", 0);
+
+
+#--------------------------------------------------------------------------------
+# Special-purpose quasispells
+#--------------------------------------------------------------------------------
+
+CONST MIN_MARRY_LEVEL = 32;
+
+NONMAGIC SILENT SPELL marriage (target : PC) : "marry" =
+ (REQUIRE is_in(location(caster), @("014-1.gat", 28,39) @+ (8, 6)))=>
+ EFFECT IF target == caster # no valid target or tried to marry self?
+ THEN ABORT;
+
+ IF (level(caster) < MIN_MARRY_LEVEL)
+ THEN (message(caster, "You must be level " + MIN_MARRY_LEVEL + " or higher to marry!"); ABORT;)
+
+ IF (level(target) < MIN_MARRY_LEVEL)
+ THEN (message(caster, "Your partner must be level " + MIN_MARRY_LEVEL + " or higher to marry!"); ABORT;)
+
+ IF partner(caster) = target
+ THEN (message(caster, "You and " + name_of(target) + " are already married."); ABORT;)
+
+ IF is_married(caster)
+ THEN (message(caster, "You are already married!"); ABORT;)
+
+ IF is_married(target)
+ THEN (message(caster, name_of(target) + " is already married."); ABORT;);
+
+ IF distance(location(caster), location(target)) <> 1
+ THEN (message(caster, "You have to stand next to each other."); ABORT;);
+
+ IF (count_item(caster, "WeddingRing") == 0 || count_item(target, "WeddingRing") == 0)
+ THEN (message(caster, "You must both be wearing your wedding rings!"); ABORT;)
+
+ script_target = target;
+ {
+ announce @caster_name$ + " is asking " + strcharinfo(0) + " for marriage.", 2;
+ mes @caster_name$ + " wishes to marry you.";
+ mes "Do you accept?";
+ next;
+ menu "Yes, I do!", L_yes,
+ "No.", -;
+ close;
+
+ L_yes:
+ if marriage(@caster_name$)
+ announce @caster_name$ + " and " + strcharinfo(0) + " are now married!", 0;
+ }
+
+ IF not (is_married(caster))
+ THEN message(caster, name_of(target) + " turned down your marriage offer.");
+
+# SPELL change-hair-colour (colour : STRING) : "trapa" =
+# (MANA 20) => EFFECT IF colour = "nworbl"
+# THEN x = 0; # light brown
+# ELSE IF colour = "der"
+# THEN x = 1; # red
+# ELSE IF colour = "neerg"
+# THEN x = 2; # green
+# ELSE IF colour = "elprup"
+# THEN x = 3; # purple
+# ELSE IF colour = "yerg"
+# THEN x = 4; # grey
+# ELSE IF colour = "wolley"
+# THEN x = 5; # yellow
+# ELSE IF colour = "eulb"
+# THEN x = 6; # blue
+# ELSE IF colour = "nwrob"
+# THEN x = 7; # brown
+# ELSE IF colour = "elpropl"
+# THEN x = 8; # light purple
+# ELSE IF colour = "elpropd"
+# THEN x = 9; # dark purple
+# ELSE x = random(10);
+# sfx(caster, 2, 0);
+# set_hair_colour(caster, x);
+
+
+# SPELL trick-or-treat : "trick-or-treat" =
+# (CASTTIME 30000, MANA 20,
+# COMPONENTS [ "BugLeg" ]) => EFFECT IF (random(2))
+# THEN (sfx(caster, 2, 0);
+# FOR i = 0 TO random(10) DO
+# drop_item_for (random_location(rbox(location(caster), 5)),
+# "Candy", 1, 10000 + random(10000), caster, 3000);
+# FOR i = 0 TO random(10) DO
+# drop_item_for (random_location(rbox(location(caster), 5)),
+# "ChocolateBar", 1, 10000 + random(10000), caster, 3000);
+# )
+# ELSE (sfx(caster, 5, 0);
+# message(caster, "No treat for you!");
+# spawn(rbox(location(caster), 3), caster, 1010, 0, 1 + random(3), 10000 + random(20000));
+# FOREACH MOB target IN rbox(location(caster), 5) DO
+# (sfx(target, 5, 0);
+# aggravate(target, 0, caster);))
+
+
+LOCAL SPELL mouboo-groan : "#g" =
+ (MANA 1,
+ REQUIRE name_of(caster) = "MOUBOOTAUR") =>
+ EFFECT FOREACH PC p IN rbox(location(caster), 200) DO
+ distance = rdistance(location(caster), location(p));
+ IF (distance < 15)
+ THEN message(p, "The moubootaur's groaning rings in your ears!");
+ ELSE IF (distance < 70)
+ THEN message(p, "You hear a loud groaning noise, not far away...");
+ ELSE message(p, "You hear an odd groaning noise in the distance...");
+
+
+LOCAL SPELL mouboo-smell : "#s" =
+ (MANA 1,
+ REQUIRE name_of(caster) = "MOUBOOTAUR") =>
+ EFFECT WAIT 30000;
+ FOREACH PC p IN rbox(location(caster), 30) DO
+ message(p, "You notice a strange smell all around you.");
+
+
+
+PROCEDURE hug_tree(target) =
+ IF (target = ""
+ || target = "tree" || target = "tree*"
+ || target = "Tree" || target = "Tree*"
+ || target = "druid" || target = "druid*"
+ || target = "Druid" || target = "Druid*")
+ THEN {
+ set @flag, 2;
+ callfunc "QuestTreeTrigger";
+ };
+
+NONMAGIC SPELL hug0 (target : STRING) : "hug" = REQUIRE ((rdistance(location(caster), location(npc("#DruidTree0#_M"))) <= 1
+ || rdistance(location(caster), location(npc("#DruidTree1#_M"))) <= 1))
+ => EFFECT CALL hug_tree(target);
+
+NONMAGIC SPELL hug1 (target : STRING) : "*hug*" = REQUIRE ((rdistance(location(caster), location(npc("#DruidTree0#_M"))) <= 1
+ || rdistance(location(caster), location(npc("#DruidTree1#_M"))) <= 1))
+ => EFFECT CALL hug_tree(target);
+
+NONMAGIC SPELL hug2 (target : STRING) : "*hug" = REQUIRE ((rdistance(location(caster), location(npc("#DruidTree0#_M"))) <= 1
+ || rdistance(location(caster), location(npc("#DruidTree1#_M"))) <= 1))
+ => EFFECT CALL hug_tree(target);
+
+NONMAGIC SPELL hug3 (target : STRING) : "hugs" = REQUIRE ((rdistance(location(caster), location(npc("#DruidTree0#_M"))) <= 1
+ || rdistance(location(caster), location(npc("#DruidTree1#_M"))) <= 1))
+ => EFFECT CALL hug_tree(target);
+
+NONMAGIC SPELL hug4 (target : STRING) : "*hugs*" = REQUIRE ((rdistance(location(caster), location(npc("#DruidTree0#_M"))) <= 1
+ || rdistance(location(caster), location(npc("#DruidTree1#_M"))) <= 1))
+ => EFFECT CALL hug_tree(target);
+
+NONMAGIC SPELL hug5 (target : STRING) : "*hugs" = REQUIRE ((rdistance(location(caster), location(npc("#DruidTree0#_M"))) <= 1
+ || rdistance(location(caster), location(npc("#DruidTree1#_M"))) <= 1))
+ => EFFECT CALL hug_tree(target);
+
+
+#--------------------------------------------------------------------------------
+# Teleport anchors
+#--------------------------------------------------------------------------------
+
+TELEPORT-ANCHOR tulimshar : "tulimshar" = @("001-1.gat", 43, 66) @+ (3, 3);
+TELEPORT-ANCHOR hurnscald : "hurnscald" = @("009-1.gat", 55, 37) @+ (3, 3);
+TELEPORT-ANCHOR nivalis : "nivalis" = @("020-1.gat", 75, 63) @+ (19, 12);
+TELEPORT-ANCHOR wizardhut : "##00" = @("013-1.gat", 41, 92) @+ (3, 3);
+TELEPORT-ANCHOR pachua : "##01" = @("006-1.gat", 22, 101) @+ (3, 3);
+TELEPORT-ANCHOR desert : "##02" = @("005-1.gat", 160, 64) @+ (5, 5);
+TELEPORT-ANCHOR forest : "##03" = @("015-1.gat", 35, 35) @+ (40, 40);
+TELEPORT-ANCHOR snakecave : "##04" = @("011-4.gat", 50, 75) @+ (3, 3);
+TELEPORT-ANCHOR dimondscove : "##05" = @("010-2.gat", 23, 79) @+ (3, 3);
+
+
diff --git a/data/test.wlk b/data/test.wlk
new file mode 100644
index 00000000..cf612ae7
--- /dev/null
+++ b/data/test.wlk
Binary files differ
diff --git a/db/const.txt b/db/const.txt
index 73e60c04..c5d06c7a 100644
--- a/db/const.txt
+++ b/db/const.txt
@@ -172,5 +172,32 @@ NIBBLE_5_MASK 15728640
NIBBLE_6_SHIFT 24
NIBBLE_6_MASK 251658240
-NIBBLE_7_SHIFT 28
-NIBBLE_7_MASK 4026531840
+NIBBLE_7_SHIFT 28 // Only three bits available in this one
+NIBBLE_7_MASK 1879048192 // should be 4026531840
+
+// Magic skills
+SKILL_MAGIC 340
+SKILL_MAGIC_LIFE 341
+SKILL_MAGIC_WAR 342
+SKILL_MAGIC_TRANSMUTE 343
+SKILL_MAGIC_NATURE 344
+SKILL_MAGIC_ASTRAL 345
+
+// Flags for the magic quests
+MFLAG_DRANK_POTION 1 // Character drank at least one magic potion as prerequisite for the mana seed quest
+MFLAG_KNOWS_MANASEED 2 // Character has found the Mana Seed
+MFLAG_TOUCHED_MANASEED 4 // Character has touched the Mana Seed
+MFLAG_MANASEED_MAXEDOUT 8 // Character has touched the Mana Seed while maxed out on magic
+
+MFLAG_KNOWS_AULDSBEL 16 // Character has met Auldsbel
+MFLAG_KNOWS_WYARA 32 // Character has met Wyara
+MFLAG_KNOWS_SAGATHA 64 // Character has met Sagatha
+MFLAG_KNOWS_MANAPOTION 128 // Has heard about the mana potion
+
+MFLAG_MANASEED_RUMOUR 256 // Has heard rumour about mana seed
+MFLAG_KNOWS_CUTTREE 512 // Knows about the `cut the tree' quest
+MFLAG_DID_CUTTREE 1024 // Did cut off a branch from the druid tree
+MFLAG_KNOWS_DRUIDTREE 2048 // Knows about the druid tree quest
+
+MFLAG_KNOWS_IMP 4096 // Knows about the imprisoned forest spirit
+MFLAG_KNOWS_OLD_WIZARD 8192 // Knows Bjorn's old wizard
diff --git a/db/item_db.txt b/db/item_db.txt
index c34a7eda..d05eac62 100644
--- a/db/item_db.txt
+++ b/db/item_db.txt
@@ -1,7 +1,7 @@
#ID, Name, Label, Type, Price, Sell, Weight, ATK, DEF, Range, Mbonus, Slot, Job, Gender, Loc, wLV, eLV, View, {UseScript}, {EquipScript}
0, DEFAULT, Default, 0, 20, 10, 10, , , , , , 10477567, 2, , , , , {}, {}
501, CactusDrink, Cactus Drink, 0, 50, 25, 70, , , , , , 10477567, 2, , , 0, , { itemheal 15,0; }, {}
-502, CactusPotion, Cactus Potion, 0, 70, 35, 70, , , , , , 10477567, 2, , , 0, , { itemheal 25,10; }, {}
+502, CactusPotion, Cactus Potion, 0, 70, 35, 70, , , , , , 10477567, 2, , , 0, , { itemheal 25,0; }, {}
503, CasinoCoins, Casino Coins, 3, 20, 10, 1, , , , , , , , , , , , {}, {}
504, DecorCandy, Decor Candy, 3, 25, 10, 10, , , , , , , , , , , , {}, {}
505, MaggotSlime, Maggot Slime, 3, 8, 4, 10, , , , , , , , , , , , {}, {}
@@ -33,7 +33,7 @@
531, MinerGloves, Miner Gloves, 5, 3000, 1000, 20, , 2, , -10, 0, 10477567, 2, 4, , 0, 0, {}, {}
532, LeatherGloves, Leather Gloves, 5, 6000, 2000, 30, , 4, , -20, 0, 10477567, 2, 4, , 0, 0, {}, {}
533, RoastedMaggot, Roasted Maggot, 0, 110, 55, 5, , , , , , 10477567, 2, , , 0, , { itemheal 150,0; }, {}
-534, OrangeCupcake, Orange Cupcake, 0, 90, 45, 5, , , , , , 10477567, 2, , , 0, , { itemheal 100,10; }, {}
+534, OrangeCupcake, Orange Cupcake, 0, 90, 45, 5, , , , , , 10477567, 2, , , 0, , { itemheal 100,0; }, {}
535, Apple, Apple, 0, 10, 5, 5, , , , , , 10477567, 2, , , 0, , { itemheal 50,0; }, {}
536, ShortSword, Short Sword, 4, 8000, 4000, 100, 100, , 1, , 0, 10477567, 2, 2, 1, 1, 1, {}, {}
537, TreasureKey, Treasure Key, 3, 100, 50, 5, , , , , , , , , , , , {}, {}
@@ -63,13 +63,13 @@
559, Hint9, Hint, 3, 20, 0, 10, , , , , , , , , , , , {}, {}
560, Hint10, Hint, 3, 20, 0, 10, , , , , , , , , , , , {}, {}
561, Sabre, Sabre, 4, 10000, 5000, 100, 100, , 1, , 0, 10477567, 2, 2, 1, 1, 1, {}, {}
-562, ChickenLeg, Chicken Leg, 0, 250, 125, 10, , , , , , 10477567, 2, , , 0, , { itemheal 500,5; }, {}
+562, ChickenLeg, Chicken Leg, 0, 250, 125, 10, , , , , , 10477567, 2, , , 0, , { itemheal 500,0; }, {}
563, WinterGloves, Winter Gloves, 5, 6000, 3000, 20, , 3, , -15, 0, 10477567, 2, 4, , 0, 0, {}, {}
564, TurtleneckSweater, Turtleneck Sweater, 5, 2000, 1000, 10, , 6, , -18, 0, 10477567, 2, 512, , 0, 0, {}, {}
-565, Petal, Petal, 0, 50, 25, 10, , , , , , 10477567, 2, , , 0, , { itemheal 50,5; }, {}
-566, SmallMushroom, Small Mushroom, 0, 50, 25, 10, , , , , , 10477567, 2, , , 0, , { itemheal 50,5; }, {}
-567, IronPotion, Iron Potion, 0, 500, 250, 10, , , , , , 10477567, 2, , , 0, , { sc_start 185, 90, 60; }, {}
-568, ConcentrationPotion, Concentration Potion, 0, 500, 250, 10, , , , , , 10477567, 2, , , 0, , { sc_start 37, 90, 30; }, {}
+565, Petal, Petal, 0, 50, 25, 10, , , , , , 10477567, 2, , , 0, , { itemheal 50,0; }, {}
+566, SmallMushroom, Small Mushroom, 0, 50, 25, 10, , , , , , 10477567, 2, , , 0, , { itemheal 50,0; }, {}
+567, IronPotion, Iron Potion, 0, 500, 250, 10, , , , , , 10477567, 2, , , 0, , { sc_start 185, 60, 60; }, {}
+568, ConcentrationPotion, Concentration Potion, 0, 500, 250, 10, , , , , , 10477567, 2, , , 0, , { sc_start 37, 60, 30; }, {}
569, RawLog, Raw Log, 3, 20, 10, 10, , , , , , , , , , , , {}, {}
570, BoneKnife, Bone Knife, 4, 10000, 6000, 120, 115, , 1, , 0, 10477567, 2, 2, 1, 1, 1, {}, {}
571, Setzer, Setzer, 4, 20000, 8000, 80, 110, , 1, , 0, 10477567, 2, 2, 1, 1, 3, {}, {}
@@ -194,7 +194,7 @@
702, WeddingRing, Wedding Ring, 5, 1000, 1, 1, , 0, , 1, 0, 10477567, 2, 128, , 0, 0, {}, {}
703, SulphurPowder, Sulphur Powder, 3, 1000, 100, 2, , , , , , 10477567, 2, , , 0, , {}, {}
704, IronPowder, Iron Powder, 3, 800, 80, 3, , , , , , 10477567, 2, , , 0, , {}, {}
-// RESERVED
+705, ManaPotion, Mana Potion, 0, 2000, 300, 50, , , , , , 10477567, 2, , , 0, , { itemheal 0, 10; callfunc "MagicGainBasic"; }, {}
706, GoldenScorpionStinger, Golden Scorpion Stinger, 3, 2000, 500, 2, , , , , , , , , , , , {}, {}
707, MonsterOilPotion, Monster Oil Potion, 3, 10000, 2000, 50, , , , , , , , , , , , {}, {}
708, LeatherPatch, Leather Patch, 3, 300, 150, 18, , , , , , , , , , , , {}, {}
@@ -203,10 +203,10 @@
711, MountainSnakeTongue, Mountain Snake Tongue, 3, 80, 40, 1, , , , , , , , , , , , {}, {}
712, GrassSnakeTongue, Grass Snake Tongue, 3, 160, 80, 1, , , , , , , , , , , , {}, {}
713, CaveSnakeTongue, Cave Snake Tongue, 3, 120, 60, 1, , , , , , , , , , , , {}, {}
-714, SnakeEgg, Snake Egg, 0, 50, 25, 4, , , , , , 10477567, 2, , , 0, , { itemheal 30,5; }, {}
-715, MountainSnakeEgg, Mountain Snake Egg, 0, 80, 40, 4, , , , , , 10477567, 2, , , 0, , { itemheal 40,5; }, {}
-716, GrassSnakeEgg, Grass Snake Egg, 0, 100, 50, 4, , , , , , 10477567, 2, , , 0, , { itemheal 50,5; }, {}
-717, CaveSnakeEgg, Cave Snake Egg, 0, 60, 30, 4, , , , , , 10477567, 2, , , 0, , { itemheal 20,5; }, {}
+714, SnakeEgg, Snake Egg, 0, 50, 25, 4, , , , , , 10477567, 2, , , 0, , { itemheal 30,0; }, {}
+715, MountainSnakeEgg, Mountain Snake Egg, 0, 80, 40, 4, , , , , , 10477567, 2, , , 0, , { itemheal 40,0; }, {}
+716, GrassSnakeEgg, Grass Snake Egg, 0, 100, 50, 4, , , , , , 10477567, 2, , , 0, , { itemheal 50,0; }, {}
+717, CaveSnakeEgg, Cave Snake Egg, 0, 60, 30, 4, , , , , , 10477567, 2, , , 0, , { itemheal 20,0; }, {}
718, SilkCocoon, Silk Cocoon, 3, 200, 3, 1, , , , , , , , , , , , {}, {}
// RESERVED
720, SilkRobe, Silk Robe, 5, 8000, 4000, 5, , 5, , 0, 0, 10477567, 2, 512, , 0, 0, {}, {}
@@ -217,9 +217,12 @@
725, GMCap, GM Cap, 5, 2000, 500, 10, , 5, , 5, 0, 10477567, 2, 256, , 0, 0, {}, {}
726, GMRobe, GM Robe, 5, 8000, 4000, 5, , 5, , 0, 0, 10477567, 2, 512, , 0, 0, {}, {}
727, Iten, Iten, 3, 0, 0, 100, , , , , , , , , , , , {}, {}
-// RESERVED
+728, MoubooFigurine, Mouboo Figurine, 3, 0, 0, 1, , , , , , , , , , , , {}, {}
+729, WarpedLog, Warped Log, 3, 0, 0, 2, , , , , , , , , , , , {}, {}
+730, Lifestone, Lifestone, 3, 0, 0, 1, , , , , , , , , , , , {}, {}
731, AssassinPants, Assassin Pants, 5, 10000, 3000, 10, , 5, , -5, 0, 10477567, 2, 1, , 0, 0, {}, {}
-// RESERVED
+732, DruidTreeBranch, Druid Tree Branch, 3, 0, 0, 2, , , , , , 10477567, , , , , , {}, {}
+733, PurificationPotion, Purification Potion, 0, 0, 0, 5, , , , , , 10477567, 2, , , , , { callfunc "usePurificationPotion"; }, {}
734, BlackBoots, Black Boots, 5, 20000, 3000, 35, , 4, , -10, 0, 10477567, 2, 64, , 0, 0, {}, {}
735, CottonBoots, Cotton Boots, 5, 2000, 500, 10, , 1, , 1, 0, 10477567, 2, 64, , 0, 0, {}, {}
736, WhiteCake, White Cake, 0, 500, 100, 10, , , , , , 10477567, 2, , , 0, , { itemheal 10,0; }, {}
diff --git a/db/mob_db.txt b/db/mob_db.txt
index fccbf0b7..f8d17d12 100644
--- a/db/mob_db.txt
+++ b/db/mob_db.txt
@@ -26,10 +26,10 @@
1026,MountainSnake,Mountain Snake,130,900,0,0,100,1,80,125,4,6,20,40,10,10,35,45,1,1,1,0,20,133,1000,1500,672,480,532,20,641,150,715,400,715,400,711,500,0,0,0,0,0,0,0,0,0,0,,,,,,,1,30
1027,EasterFluffy,Easter Fluffy,30,500,0,0,3,1,10,12,0,5,1,1,1,0,20,25,1,1,1,3,20,129,800,1872,672,480,1208,2000,1209,2000,1210,2000,1211,1000,1212,1000,1213,200,0,0,0,0,0,0,0,0,,,,,,,1,40
1028,Mouboo,Mouboo,85,1200,0,0,40,2,30,75,65,5,15,5,15,0,40,10,2,2,1,3,20,129,600,1872,672,480,660,200,660,100,541,750,660,10,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,1,30
-1029,MauvePlant,Mauve Plant,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,3,22,0,800,800,672,480,680,3000,680,3000,680,3000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,1,60
-1030,CobaltPlant,Cobalt Plant,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,3,22,0,800,800,672,480,681,3000,681,3000,681,3000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,0,0
-1031,GambogePlant,Gamboge Plant,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,3,22,0,800,800,672,480,682,3000,682,3000,682,3000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,0,0
-1032,AlizarinPlant,Alizarin Plant,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,3,22,0,800,800,672,480,683,3000,683,3000,683,3000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,0,0
+1029,MauvePlant,Mauve Plant,1,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,1,1,1,3,22,0,800,800,672,480,680,3000,680,3000,680,3000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,1,60
+1030,CobaltPlant,Cobalt Plant,1,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,1,1,1,3,22,0,800,800,672,480,681,3000,681,3000,681,3000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,0,0
+1031,GambogePlant,Gamboge Plant,1,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,1,1,1,3,22,0,800,800,672,480,682,3000,682,3000,682,3000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,0,0
+1032,AlizarinPlant,Alizarin Plant,1,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,1,1,1,3,22,0,800,800,672,480,683,3000,683,3000,683,3000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,0,0
1033,SeaSlime,Sea Slime,70,600,0,0,9,1,30,50,3,7,1,25,1,0,30,30,1,1,1,0,41,131,1500,1872,672,480,535,800,657,800,518,500,510,1000,700,100,1199,5000,568,100,541,50,0,0,0,0,,,,,,,0,0
1034,GrassSnake,Grass Snake,140,1000,0,0,100,1,80,120,2,10,20,40,10,10,40,50,1,1,1,0,20,133,500,1100,672,480,716,400,716,400,712,500,676,500,660,350,0,0,0,0,0,0,0,0,0,0,,,,,,,1,40
-1035,Silkworm,Silkworm,20,1,0,0,1,1,0,0,2,10,20,11,10,10,40,10,1,1,1,0,20,129,1300,1100,672,480,718,5000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,2,40
+1035,Silkworm,Silkworm,20,1,0,0,1,1,0,0,2,0,0,0,0,0,0,0,1,1,1,0,20,129,1300,1100,672,480,718,5000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,2,40
diff --git a/npc/001-1_Tulimshar/bard.txt b/npc/001-1_Tulimshar/bard.txt
index 8d53fc72..8b416ec5 100644
--- a/npc/001-1_Tulimshar/bard.txt
+++ b/npc/001-1_Tulimshar/bard.txt
@@ -1,9 +1,112 @@
//
-001-1.gat,50,44,0 script Bard 152,{
+001-1.gat,37,73,0 script Bard 152,{
setarray @songs$, "\"There once was a bard, who had it hard, because a man in dark green, was very mean.\"",
"\"At Hurnscald inn, there was a person of fairest skin, declining wedding bands from quite a many hands.\"",
"\"As the Sun sets down in the forest's brown, she whom the fragrance holds counts her gold.\"";
+ set @name$, "Bill Ballshaker the Bard";
+ mes "[" + @name$ + "]";
+ if (Sex)
+ mes "\"Greetings, traveler! Have you come to listen to my stories?\"";
+ if (!Sex)
+ mes "\"Greetings, fair lady! Well met, on such a lovely day! Might I entertain you with a tale or two?\"";
+ next;
+
+L_Main:
+ menu "Sing me a song, lute man!", L_Song,
+ "Have you heard any news?", L_News,
+ "What do you know about...", L_Question,
+ "Farewell!", -;
+ close;
+
+L_News:
+ mes "[" + @name$ + "]";
+ mes "\"News I have for you indeed, lest you have already overheard (for then it would no longer be news to you!)\"";
+ next;
+ mes "[" + @name$ + "]";
+ mes "\"Rumor has it that an ancient source of magic, a Mana Seed, has been sighted in the west, beyond the fair town of Hurnscald.\"";
+ next;
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_MANASEED_RUMOUR;
+ mes "[" + @name$ + "]";
+ mes "\"Whence it came, nobody knows... but they say that sometimes such Mana Seeds may choose a powerful individual to impart some of its mystic power to!\"";
+ next;
+ mes "[" + @name$ + "]";
+ mes "\"I wonder who might be qualified?\"";
+ next;
+ goto L_Main;
+
+L_Question:
+ callfunc "MagicTalkOptionsSetup";
+ set @ignore, 0;
+ callfunc "MagicTalkMenu";
+
+ if (@c == 0) goto L_Main;
+ if (@c == @QQ_ELANORE) goto L_Q_elanore;
+ if (@c == @QQ_MANASEED) goto L_Q_manaseed;
+ if (@c == @QQ_WYARA) goto L_Q_wyara;
+ if (@c == @QQ_SAGATHA) goto L_Q_sagatha;
+ if (@c == @QQ_AULDSBEL) goto L_Q_auldsbel;
+ if (@c == @QQ_OLDWIZ) goto L_Q_oldwiz;
+
+ mes "[" + @name$ + "]";
+ mes "\"Alas, I know very little about this matter.\"";
+ next;
+ goto L_Main;
+
+L_Q_oldwiz:
+ mes "[" + @name$ + "]";
+ mes "\"The old wizard has been an old man for as long as I remember, living near the mountains in his magic hut-- a hut that is bigger on the inside, just like in the old tales of Gyer Filla the Wise....\"";
+ next;
+ mes "[" + @name$ + "]";
+ mes "\"I doubt that they are the same person, though. For one, I have never seen his hut fly. For another, Gyer never took apprentices.\"";
+ next;
+ goto L_Main;
+
+L_Q_elanore:
+ mes "[" + @name$ + "]";
+ mes "\"Elanore is this town's healer. Rumor has it that she traveled far and wide when she was younger, to learn the deepest secrets of healing magic, after her brother caught a mysterious illness.\"";
+ next;
+ goto L_Main;
+
+L_Q_manaseed:
+ mes "[" + @name$ + "]";
+ mes "\"The Mana Seed is said to be a source of great magic. Perhaps some witch or wizard might know more about it?\"";
+ next;
+ goto L_Main;
+
+L_Q_wyara:
+ mes "[" + @name$ + "]";
+ mes "\"Wyara is not actually from Hurnscald. As a young witch, she decided to settle down there to help the people of Hurnscald. She is kind and gentle, except towards the Doctor, who seems to have little respect for her potions.\"";
+ next;
+ goto L_Main;
+
+L_Q_sagatha:
+ mes "[" + @name$ + "]";
+ mes "\"Sagatha! Ah, such a wonderful and mysterious being; the center of many a tale...\"";
+ next;
+ mes "[" + @name$ + "]";
+ mes "\"Some say that she is the most powerful witch in all of Argaes. I don't know whether that is true, but I am quite certain that the is the most beautiful of all the witches! Alas, she will let no man touch her...\"";
+ mes "He sighs.";
+ next;
+ mes "[" + @name$ + "]";
+ mes "\"I met her only twice, back in my traveling days, but there are two pieces of advice I can give you:\"";
+ next;
+ mes "[" + @name$ + "]";
+ mes "\"First, she will suffer no fool easily, particularly no man.\"";
+ next;
+ mes "[" + @name$ + "]";
+ mes "\"Second, the creatures of the forest mean everything to her. Harm them, and you may find her an enemy-- and a powerful one at that...\"";
+ next;
+ goto L_Main;
+
+L_Q_auldsbel:
+ mes "[" + @name$ + "]";
+ mes "\"Auldsbel is some wizard from further north, from what I have gathered. He bought a hut near Hurnscald some years back and often comes here to experiment on things, probably because he is not allowed to do these experiments where he comes from.\"";
+ next;
+ goto L_Main;
+
+L_Song:
+ mes "[" + @name$ + "]";
set @id, rand(3);
mes @songs$[@id];
close;
diff --git a/npc/001-1_Tulimshar/children.txt b/npc/001-1_Tulimshar/children.txt
index a3ab8e07..1b62953d 100644
--- a/npc/001-1_Tulimshar/children.txt
+++ b/npc/001-1_Tulimshar/children.txt
@@ -54,7 +54,8 @@ L_8:
}
001-1.gat,39,67,0 script Nina 103,{
- set @TEMP,rand(8);
+ mes "[Nina]";
+ set @TEMP,rand(10);
if(@TEMP == 0) goto L_1;
if(@TEMP == 1) goto L_1;
if(@TEMP == 2) goto L_2;
@@ -64,44 +65,72 @@ L_8:
if(@TEMP == 6) goto L_6;
if(@TEMP == 7) goto L_7;
if(@TEMP == 8) goto L_8;
+ goto L_9;
L_1:
- mes "[Nina]";
mes "\"If I learned anything from school, Grenxen founded Tulimshar.\"";
close;
L_2:
- mes "[Nina]";
mes "\"When I was picking rocks from the field, I saw a red scorpion.\"";
close;
L_3:
- mes "[Nina]";
mes "\"Its polite to state your name before talking to anyone.\"";
close;
L_4:
- mes "[Nina]";
+
mes "\"I have a Scorpion Doll!\"";
close;
L_5:
- mes "[Nina]";
mes "\"I always take some spare Cactus Juices with me on the field. They are heavy, though.\"";
close;
L_6:
- mes "[Nina]";
mes "\"When you are feeling bad, eating something can usually help you heal faster.\"";
close;
L_7:
- mes "[Nina]";
mes "\"Grenxen is the Demon that founded Tulimshar.\"";
close;
L_8:
+ mes "\"That volcano eruption was scary; much of Tulimshar was destroyed. But the mayor had everything rebuilt quickly.\"";
+ close;
+
+L_9:
+ mes "\"I know a very bad word. But I must not say it, because monsters will come and get me if I do!\"";
+ next;
+ menu
+ "A bad word?", L_tell,
+ "Oh, you better keep it for yourself then.", -;
+ close;
+
+L_tell:
+ mes "[Nina]";
+ mes "\"Yes, I heard my mother say it once. And she made me promise her to never say it. Never.\"";
+ next;
+ menu "If I promise to never tell anyone, can you tell me the word?", L_keepword,
+ "I understand, you do not need to tell...", L_giveword,
+ "Goodbye!", -;
+ close;
+
+L_keepword:
mes "[Nina]";
- mes "That volcano eruption was terrifying; much of Tulimshar was destroyed. Fortunately the mayor had everything rebuilt quickly.";
+ mes "\"No.\"";
close;
+
+L_giveword:
+ mes "[Nina]";
+ mes "Nina looks around as she hushes you to silence. After a few seconds she whispers to you.";
+ mes "\"I like you! So I will tell you the bad word. But you can't tell anyone else about it! The bad word is '" + getspellinvocation("aggravate") + "'.\"";
+ next;
+
+ mes "[Nina]";
+ mes "Terrified, she looks around once more.";
+ mes "\"But you mustn't tell anyone!\"";
+ next;
+ close;
}
diff --git a/npc/001-1_Tulimshar/elanore.txt b/npc/001-1_Tulimshar/elanore.txt
index 68f0676b..f75e154b 100644
--- a/npc/001-1_Tulimshar/elanore.txt
+++ b/npc/001-1_Tulimshar/elanore.txt
@@ -1,6 +1,20 @@
//
-001-1.gat,58,68,0 script Elanore 108,{
+001-1.gat,58,68,0 script Elanore#_M 108,{
+
+ set @has_magic, getskilllv(SKILL_MAGIC);
+
+ set @Q_MASK, NIBBLE_1_MASK;
+ set @Q_SHIFT, NIBBLE_1_SHIFT;
+
+ set @Q_status, (QUEST_MAGIC2 & @Q_MASK) >> @Q_SHIFT;
+ set @Q_heal_exp, MAGIC_EXPERIENCE >> 24;
+
+ set @STATUS_INITIAL, 0;
+ set @STATUS_LEARNED_LIGHT_HEAL, 1;
+ set @STATUS_MASTERED_LIGHT_HEAL, 2;
+ set @STATUS_LEARNED_LAY_ON_HANDS, 3;
+
if (baselevel > 10) goto L_NoHeal;
@@ -78,11 +92,333 @@ Heal_4:
close;
L_NoHeal:
+ if (MAGIC_FLAGS)
+ goto L_Chat;
+L_NoHealMessage:
mes "[Elanore the Healer]";
mes "\"I'm sorry but unless you are young and in need, I can't help you, and your level is already higher than ten.";
mes "With so many people still injured from the earthquake, I really have no time to help.";
mes "You can get some rest in the inn near here.\"";
close;
+
+L_Chat:
+ mes "[Elanore the Healer]";
+ mes "\"Hello! Can I help you?\"";
+ next;
+L_Main:
+ if (@has_magic && (@Q_status == @STATUS_INITIAL))
+ menu
+ "Can you heal me?", L_NoHealMessage,
+ "Can you teach me magic?", L_Teach,
+ "What do you know about...", L_Question;
+
+ if (@has_magic && (@Q_status > @STATUS_INITIAL))
+ menu
+ "Can you heal me?", L_NoHealMessage,
+ "Can you teach me more?", L_Teach,
+ "Where can I get more lifestones?", L_Lifestones,
+ "What do you know about...", L_Question;
+
+ if (!@has_magic)
+ menu
+ "Can you heal me?", L_NoHealMessage,
+ "What do you know about...", L_Question;
+ close;
+
+OnPCKillEvent:
+ attachrid(@killerrid);
+ set @Q_heal_exp, MAGIC_EXPERIENCE >> 24;
+ if (@Q_heal_exp < 8)
+ goto L_OnPcKillWipe;
+ set @Q_heal_exp, @Q_heal_exp - 8;
+ goto L_OnPcKillFinish;
+L_OnPcKillWipe:
+ set @Q_heal_exp, 0;
+L_OnPcKillFinish:
+ set MAGIC_EXPERIENCE, (MAGIC_EXPERIENCE & ~(255 << 24)) | (@Q_heal_exp << 24);
+ close;
+
+L_Lifestones:
+ mes "[Elanore the Healer]";
+ mes "\"I always need components for my own healing spells. If you bring me ten gamboge leaves, ten alizarin leaves, ten mauve leaves and ten cobalt leaves, I can make ten lifestones; I will give you half of them.\"";
+ next;
+
+ menu
+ "OK, I will get them.", -,
+ "No way!", -,
+ "Here you are!", L_Lifestones_Trade,
+ "Can I make them myself?", L_Lifestones_MakeSelf;
+ close;
+
+L_Lifestones_Trade:
+ if (countitem("MauveHerb") < 10) goto L_Lifestones_Trade_Missing;
+ if (countitem("GambogeHerb") < 10) goto L_Lifestones_Trade_Missing;
+ if (countitem("AlizarinHerb") < 10) goto L_Lifestones_Trade_Missing;
+ if (countitem("CobaltHerb") < 10) goto L_Lifestones_Trade_Missing;
+ getinventorylist;
+ if (@inventorylist_count == 100 && countitem("Lifestone") == 0
+ && countitem("MauveHerb") > 10
+ && countitem("GambogeHerb") > 10
+ && countitem("AlizarinHerb") > 10
+ && countitem("CobaltHerb") > 10) goto L_Lifestones_NoRoom;
+
+ delitem "MauveHerb", 10;
+ delitem "GambogeHerb", 10;
+ delitem "AlizarinHerb", 10;
+ delitem "CobaltHerb", 10;
+ getitem "LifeStone", 5;
+ getexp 200, 1;
+ mes "[Elanore the Healer]";
+ mes "Elanore carefully goes over your leaves, then smiles.";
+ mes "\"These will do just fine.\"";
+ mes "She picks up all fourty and presses them together in her hands, then whispers something.";
+ next;
+ mes "[Elanore the Healer]";
+ mes "As she opens her hands again, the leaves have turned into ten golden crystals.";
+ mes "\"Five for you and five for me.\"";
+ mes "She smiles.";
+ mes "[200 experience points]";
+ next;
+ close;
+
+L_Lifestones_NoRoom:
+ mes "[Elanore the Healer]";
+ mes "\"Oh... it seems that you have no room for the lifestones. But please do come back later when you have made a little space.\"";
+ next;
+ close;
+
+L_Lifestones_Trade_Missing:
+ mes "[Elanore the Healer]";
+ mes "Elanore counts the leaves you show her.";
+ mes "\"No, I am sorry. Please bring me ten leaves each of gamboge, alizarin, mauve, and cobalt.\"";
+ next;
+ close;
+
+L_Lifestones_MakeSelf:
+ mes "[Elanore the Healer]";
+ if (@has_magic < 2)
+ goto L_Lifestones_MakeSelf_no;
+
+L_Lifestones_MakeSelf_yes:
+ mes "\"Oh, but of course! You are powerful enough to make your own lifestones, using the enchantment '" + getspellinvocation("enchant-lifestone") + "'. This will consume a bug leg or a maggot slime or one of each of the four healing herbs, though.\"";
+ next;
+ mes "[Elanore the Healer]";
+ mes "\"You will have to make sure that your powers are pure, though, either by wearing a white robe or some other special magical item that does this for you.\"";
+ next;
+ close;
+
+L_Lifestones_MakeSelf_no:
+ mes "\"No, you are not powerful enough yet. Please come back and ask me again when you have learned to control more powerful magic, though!\"";
+ next;
+ close;
+
+L_Teach:
+ if (@Q_status == @STATUS_INITIAL) goto L_Teach_Initial;
+ if (@Q_status == @STATUS_LEARNED_LIGHT_HEAL) goto L_Teach_CheckAdvanceTo2;
+ if (@Q_status == @STATUS_MASTERED_LIGHT_HEAL) goto L_Teach_CheckAdvanceToLOH;
+ //if (@Q_status == @STATUS_LEARNED_LAY_ON_HANDS) goto L_Teach_CheckAdvanceTo3; // not done yet. :-)
+
+ mes "[Elanore the Healer]";
+ mes "\"You have made good progress, but you lack the magical power to advance further. Also, I would like to observe you some more to be certain that you will make a good healer.\"";
+ next;
+ close;
+
+L_Teach_Initial:
+ mes "[Elanore the Healer]";
+ mes "\"I will only teach you magic of the school of Life, and that only if you prove yourself to be a good healer-- that is, if you use your powers to help others.\"";
+ mes "She hesistates.";
+ next;
+ mes "[Elanore the Healer]";
+ mes "\"I don't know you very well, but I don't think that there is any harm in teaching you a simple spell.\"";
+ mes "She reaches inside her satchel and pulls out a piece of crystal, glittering in the sun.";
+ mes "\"This here is a lifestone, life energy encased in a crystal shell. You will need it for most healing magic.\"";
+ next;
+ mes "[Elanore the Healer]";
+ mes "\"To heal someone, first locate the injury. As a beginner, you have to touch the wound; with practice, it will be enough to think about it. Hold the lifestone in one hand, touching the wound with the other.\"";
+ mes "\"Then say, '" + getspellinvocation("lesser-heal") + "', followed by the name of the one you wish to heal.\"";
+ next;
+ mes "[Elanore the Healer]";
+ mes "\"You might want to write that down, actually. In fact, you might want to make sure to keep notes of all spells you hear, for you never now if you will hear them again!\"";
+ mes "\"The invocation was '" + getspellinvocation("lesser-heal") + "'.\"";
+ next;
+ mes "[Elanore the Healer]";
+ mes "\"This will only cure cuts and bruises, though, and it will take some time to take effect. It will be useless to mend broken bones or more severe injuries!\"";
+ mes "\"To heal yourself, it's enough to just say '" + getspellinvocation("lesser-heal") + "' by itself.\"";
+ next;
+ mes "[Elanore the Healer]";
+ mes "\"Let me give you a lifestone to get started with.\"";
+ next;
+
+ getinventorylist;
+ if ((@inventorylist_count == 100) && (countitem("LifeStone") == 0))
+ goto L_Teach_Initial_Noroom;
+
+ getitem "LifeStone", 1;
+ set @Q_status, @STATUS_LEARNED_LIGHT_HEAL;
+ callsub S_update_var;
+
+ mes "[Elanore the Healer]";
+ mes "Elanore hands you the crystal.";
+ mes "\"Here you are. I hope that it will allow you to do good!\"";
+ next;
+ close;
+
+L_Teach_Initial_Noroom:
+ mes "[Elanore the Healer]";
+ mes "\"Oh... you managed to put things into every little nook and pocket, haven't you? Well, come back later, I will give it to you then.\"";
+ close;
+
+L_Teach_CheckAdvanceTo2:
+ mes "[Elanore the Healer]";
+ if (@Q_heal_exp < 20)
+ goto L_Teach_CheckAdvanceTo2_fail;
+ mes "Elanore smiles at you.";
+ mes "\"From what I have been hearing, you seem to be doing well on your way to becoming a healer. I have decided to accept you as a student of the School of Life Magic.\"";
+ next;
+
+ if (getskilllv(SKILL_MAGIC) < 2)
+ goto L_Teach_AdvanceTo2_warn;
+
+ goto L_Teach_AdvanceTo2_skip;
+L_Teach_AdvanceTo2_warn:
+ mes "[Elanore the Healer]";
+ mes "\"But be warned: you won't be able to use advanced healing magic until you are more capable in your regular magic usage.\"";
+ next;
+L_Teach_AdvanceTo2_skip:
+
+ mes "[Elanore the Healer]";
+ mes "\"Please stand still.\"";
+ mes "She walks up to you, holds your shoulders, and smiles at you.";
+ next;
+
+ mes "[Elanore the Healer]";
+ mes "Then, she rises up on her tiptoes and kisses you on your forehead.";
+ next;
+
+ mes "[Elanore the Healer]";
+ mes "You feel a strange, tingling kind of warmth spread through your body.";
+ mes "[5000 experience points]";
+ mes "[Level 2 in Life Magic]";
+
+ set @Q_status, @STATUS_MASTERED_LIGHT_HEAL;
+ callsub S_update_var;
+ getexp 5000, 0;
+ if (getskilllv(SKILL_MAGIC_LIFE) < 2)
+ setskill SKILL_MAGIC_LIFE, 2;
+ close;
+
+L_Teach_CheckAdvanceTo2_fail:
+ mes "\"I think I would like to observe you for a little longer to see if you would make a good healer.\"";
+ if (@Q_heal_exp < 5)
+ mes "\"You are still at the beginning of your path, but do keep practicing.\"";
+ if ((@Q_heal_exp >= 5) && (@Q_heal_exp < 15))
+ mes "\"You are making progress, but you still need more practice.\"";
+ if (@Q_heal_exp >= 15)
+ mes "\"You have made good progress, but please do continue in your efforts.\"";
+ close;
+
+L_Teach_CheckAdvanceToLOH:
+ if (getskilllv(SKILL_MAGIC) < 2)
+ goto L_Teach_LOH_advance_abort0;
+ if (@Q_heal_exp < 30)
+ goto L_Teach_LOH_advance_abort1;
+
+ mes "[Elanore the Healer]";
+ mes "\"I will now teach you how to heal by laying on your hands. The technique is similar to the spell I taught you at the beginning, but this time you transfer your own health instead of drawing health from a lifestone.\"";
+ next;
+
+ mes "[Elanore the Healer]";
+ mes "\"First, lay your hand on the person you wish to heal. You needn't touch the injury itself, though you have to touch the skin until you are a little more experienced. Then, medidate on the word '" + getspellinvocation("lay-on-hands") + "'\"";
+ next;
+
+ mes "[Elanore the Healer]";
+ mes "\"This will let your own life force flow into the person you are healing. If you are badly injured yourself, you will not be able to do this.\"";
+ mes "[1000 experience points]";
+ getexp 1000, 0;
+ set @Q_status, @STATUS_LEARNED_LAY_ON_HANDS;
+ callsub S_update_var;
+ next;
+ close;
+
+L_Teach_LOH_advance_abort0:
+ mes "[Elanore the Healer]";
+ mes "\"You don't have enough magical power to learn the next healing spell yet.\"";
+ close;
+
+L_Teach_LOH_advance_abort1:
+ mes "[Elanore the Healer]";
+ mes "\"I'm sorry, but I am not yet convinced that you are a good enough healer. Please continue in your endeavours.\"";
+ close;
+
+L_NoMagicNoTeach:
+ mes "[Elanore the Healer]";
+ mes "Elanore shakes her head.";
+ mes "\"I am sorry, but you don't have any magical abilities. I can only teach those who already have the power to do magic.\"";
+ next;
+ goto L_Main;
+
+L_Question:
+ callfunc "MagicTalkOptionsSetup";
+ set @ignore, @QQ_ELANORE;
+ callfunc "MagicTalkMenu";
+
+ if (@c == 0) goto L_Main;
+ if (@c == @QQ_MANASEED) goto L_Q_manaseed;
+ if (@c == @QQ_MANAPOTION) goto L_Q_manapotion;
+ if (@c == @QQ_WYARA) goto L_Q_wyara;
+ if (@c == @QQ_SAGATHA) goto L_Q_sagatha;
+ if (@c == @QQ_AULDSBEL) goto L_Q_auldsbel;
+ if (@c == @QQ_OLDWIZ) goto L_Q_oldwiz;
+
+ mes "[Elanore the Healer]";
+ mes "Elanore shakes her head.";
+ mes "\"I am sorry, but I don't think that I know anything that would help you.\"";
+ next;
+ goto L_Main;
+
+L_Q_oldwiz:
+ mes "[Elanore the Healer]";
+ mes "\"He is a kind old man. He stays mostly with his books and his apprentice, though we have chatted a few times.\"";
+ next;
+ goto L_Main;
+
+L_Q_manaseed:
+ mes "[Elanore the Healer]";
+ mes "She smiles.";
+ mes "\"If the rumors are true and there really is a Mana Seed, then that would be wonderful news-- perhaps we will have a few more healers soon!\"";
+ next;
+ goto L_Main;
+
+L_Q_manapotion:
+ mes "[Elanore the Healer]";
+ mes "\"I'm sorry, but I can't help you with that.\"";
+ next;
+ goto L_Main;
+
+L_Q_wyara:
+ mes "[Elanore the Healer]";
+ mes "\"Wyara is the Hurnscald town witch. She was also the town healer before the Doctor moved there.\"";
+ next;
+ goto L_Main;
+
+L_Q_sagatha:
+ mes "[Elanore the Healer]";
+ mes "\"Oh, I have only met Sagatha once or twice, while collecting herbs. She is a warm and gentle person, but she tries to hide it.\"";
+ next;
+ goto L_Main;
+
+L_Q_auldsbel:
+ mes "[Elanore the Healer]";
+ mes "\"Oh, sorry-- I don't really know him very well.\"";
+ next;
+ goto L_Main;
+
+
+S_update_var:
+ set QUEST_MAGIC2,
+ (QUEST_MAGIC2 & ~(@Q_MASK)
+ | (@Q_status << @Q_SHIFT));
+ return;
}
diff --git a/npc/001-1_Tulimshar/guide.txt b/npc/001-1_Tulimshar/guide.txt
index 75b4dcc3..16be310b 100644
--- a/npc/001-1_Tulimshar/guide.txt
+++ b/npc/001-1_Tulimshar/guide.txt
@@ -128,7 +128,7 @@ L_Stats:
L_Magic:
mes "[Ian the Guide]";
mes "\"In decades past, there was a Mana Seed south of Tulimshar, from which people could draw magical energies. Unfortunately, the seed is gone.";
- mes "Until we find a new Mana Seed, there will be no magic, except for those who already possess magical powers.\"";
+ mes "However, I've overheard the bard mentioning something about this recently... if you are interested in magic, try talking to him!\"";
next;
goto L_Menu_A;
@@ -153,7 +153,7 @@ S_Grad:
mes "[Ian the Guide]";
mes "\"Hey, you've been doing good, let me give you this.\"";
- getitem 675, 1;
+ getitem "GraduationCap", 1;
set TUT_var, TUT_var | 2;
next;
diff --git a/npc/001-1_Tulimshar/rewards_master.txt b/npc/001-1_Tulimshar/rewards_master.txt
index 657b82f4..cc64da8c 100644
--- a/npc/001-1_Tulimshar/rewards_master.txt
+++ b/npc/001-1_Tulimshar/rewards_master.txt
@@ -5,7 +5,7 @@
if (tvis == 0) set tvis, 1;
if (Mobpt < tvis) goto L_NotEnough;
- setarray @Items, 502, 502, 503, 504, 505, 506, 507, 508, 509, 510, 586, 512, 513, 514, 515, 516, 517, 518, 519, 520;
+ setarray @Items$, "CactusPotion", "CactusPotion", "CasinoCoins", "DecorCandy", "MaggotSlime", "CandyCane", "ScorpionStinger", "XmasCake", "ChocolateBar", "Candy", "GingerBreadMan", "Cake", "XmasCandyCane", "PurplePresentBox", "BluePresentBox", "RedScorpionStinger", "BugLeg", "CherryCake", "EasterEgg", "CottonShirt", "CottonShorts";
mes "[Ishi the Rewards Master]";
mes "\"Welcome! I see you have " + Mobpt + " Monster Points. Would you like to exchange some of those for items?\"";
@@ -79,11 +79,11 @@ L_Menu_Done:
SUB_give_item:
set Mobpt, Mobpt - tvis;
set tvis, tvis + 1;
- set @ID, @Items[rand(getarraysize(@Items))];
+ set @item$, @Items$[rand(getarraysize(@Items$))];
- getitem @ID, 1;
+ getitem @item$, 1;
- mes "You received one " + getitemname(@ID) + "!";
+ mes "You received one " + getitemname(@item$) + "!";
return;
}
diff --git a/npc/001-1_Tulimshar/sandra.txt b/npc/001-1_Tulimshar/sandra.txt
index f49c849b..a2762181 100644
--- a/npc/001-1_Tulimshar/sandra.txt
+++ b/npc/001-1_Tulimshar/sandra.txt
@@ -70,17 +70,17 @@ L_Set:
close;
L_Progress:
- if (countitem(507) < 5) goto L_NotEnough;
- if (countitem(517) < 1) goto L_NotEnough;
+ if (countitem("ScorpionStinger") < 5) goto L_NotEnough;
+ if (countitem("RedScorpionStinger") < 1) goto L_NotEnough;
mes "[Sandra]";
mes "\"Excellent!";
mes "You brought me 5 [Scorpion Stingers] and 1 [Red Scoprion Stinger]!\"";
getinventorylist;
- if ((@inventorylist_count - (countitem(507) == 5) - (countitem(517) == 1)) > 99 - (countitem(1199) == 0)) goto L_TooMany;
- delitem 507, 5;
- delitem 517, 1;
- getitem 1200, 1;
- getitem 1199, 100;
+ if ((@inventorylist_count - (countitem("ScorpionStinger") == 5) - (countitem("RedScorpionStinger") == 1)) > 99 - (countitem("Arrow") == 0)) goto L_TooMany;
+ delitem "ScorpionStinger", 5;
+ delitem "RedScorpionStinger", 1;
+ getitem "Bow", 1;
+ getitem "Arrow", 100;
set Scorp, 2;
close;
diff --git a/npc/001-1_Tulimshar/vincent.txt b/npc/001-1_Tulimshar/vincent.txt
index 2ab79e4f..af6f4b55 100644
--- a/npc/001-1_Tulimshar/vincent.txt
+++ b/npc/001-1_Tulimshar/vincent.txt
@@ -80,13 +80,13 @@ L_Wait:
close;
L_Progress:
- if(countitem(518) >= 30) goto L_Have;
+ if(countitem("BugLeg") >= 30) goto L_Have;
mes "[Vincent]";
mes "\"Please help me collect 30 [Bug Legs]!\"";
close;
L_Have:
- delitem 518, 30;
+ delitem "BugLeg", 30;
mes "[Vincent]";
mes "\"Excellent! Finally I can complete the model!!\"";
next;
diff --git a/npc/001-2_Tulimshar/casino.txt b/npc/001-2_Tulimshar/casino.txt
index bc07cab8..d0d0c5f9 100644
--- a/npc/001-2_Tulimshar/casino.txt
+++ b/npc/001-2_Tulimshar/casino.txt
@@ -36,8 +36,8 @@
close;
L_Begin:
- if(countitem(503) < 15) goto L_NoCoin;
- delitem 503, 15;
+ if(countitem("CasinoCoins") < 15) goto L_NoCoin;
+ delitem "CasinoCoins", 15;
set @croupier, rand(0, 4);
set @croupier, @croupier + 17;
set @player, rand(4, 21);
@@ -68,7 +68,7 @@ L_End:
mes "\"Congratulations, you won!";
mes "I had " + @croupier + ".";
mes "You get 45 casino coins.\"";
- getitem 503, 45;
+ getitem "CasinoCoins", 45;
close;
L_NoCoin:
@@ -132,8 +132,8 @@ L_b100:
goto L_Check;
L_Check:
- if(countitem(503) < @bet) goto L_NoCoin;
- delitem 503, @bet;
+ if(countitem("CasinoCoins") < @bet) goto L_NoCoin;
+ delitem "CasinoCoins", @bet;
menu
"Choose a color", -,
"Choose a number", L_Number;
@@ -143,7 +143,7 @@ L_Check:
set @color,rand(2);
if(@color == 1) goto L_Lost;
mes "You won!";
- getitem 503, @bet * 2;
+ getitem "CasinoCoins", @bet * 2;
close;
L_Number:
@@ -162,7 +162,7 @@ L_Number:
if (@roulette < 37) mes "The ball stopped on " + @roulette;
if (@number != @roulette) goto L_Lost;
mes "\"You won!\"";
- getitem 503, @bet * 10;
+ getitem "CasinoCoins", @bet * 10;
close;
L_NoCoin:
diff --git a/npc/001-2_Tulimshar/troupe_leader.txt b/npc/001-2_Tulimshar/troupe_leader.txt
index 92ab46ef..e7b0486e 100644
--- a/npc/001-2_Tulimshar/troupe_leader.txt
+++ b/npc/001-2_Tulimshar/troupe_leader.txt
@@ -37,7 +37,7 @@ L_NohMask_Found:
mes "[1500 experience points]";
getexp 1500, 0;
set Inspector, 14;
- getitem 678, 1;
+ getitem "NohMask", 1;
next;
mes "[Troupe Leader]";
mes "\"We don't need it anymore. We're doing different shows here.\"";
diff --git a/npc/002-3_Desert_mines/miners.txt b/npc/002-3_Desert_mines/miners.txt
index 9c7d0eca..8f69c47d 100644
--- a/npc/002-3_Desert_mines/miners.txt
+++ b/npc/002-3_Desert_mines/miners.txt
@@ -2,11 +2,19 @@
002-3.gat,35,35,6 script Nathan 109,{
mes "[Nathan the Miner]";
+
+ if (getskilllv(SKILL_MAGIC))
+ goto L_message;
+
mes "\"It's very dangerous in here.";
mes "We had a big earthquake here";
mes "just recently, too... so be";
mes "careful!\"";
close;
+
+L_message:
+ mes "\"We found a good way to carry our ores out of here safely: one of us always runs ahead shouting '" + getspellinvocation("aggravate") + "'. Somehow this seems to distract the monsters.\"";
+ close;
}
002-3.gat,85,97,6 script Naem 109,{
diff --git a/npc/002-4_Desert_mines/chest.txt b/npc/002-4_Desert_mines/chest.txt
index e76332fd..e1825d0f 100644
--- a/npc/002-4_Desert_mines/chest.txt
+++ b/npc/002-4_Desert_mines/chest.txt
@@ -12,13 +12,13 @@
close;
L_Yes:
- if(countitem(537) < 3) goto L_Not_Enough;
+ if(countitem("TreasureKey") < 3) goto L_Not_Enough;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(537) > 3) goto L_TooMany;
+ if (@inventorylist_count == 100 && countitem("TreasureKey") > 3) goto L_TooMany;
mes "[Chest]";
mes "You opened it and found a short sword!";
- delitem 537, 3;
- getitem 536, 1;
+ delitem "TreasureKey", 3;
+ getitem "ShortSword", 1;
set ChestQuest, ChestQuest | 1;
close;
diff --git a/npc/005-1_Snake_desert/_import.txt b/npc/005-1_Snake_desert/_import.txt
index 3174cc31..997fde69 100644
--- a/npc/005-1_Snake_desert/_import.txt
+++ b/npc/005-1_Snake_desert/_import.txt
@@ -2,3 +2,5 @@ map: 005-1.gat
npc: npc/005-1_Snake_desert/_mobs.txt
npc: npc/005-1_Snake_desert/_warps.txt
npc: npc/005-1_Snake_desert/npcs.txt
+npc: npc/005-1_Snake_desert/spirit.txt
+npc: npc/005-1_Snake_desert/tree.txt
diff --git a/npc/005-1_Snake_desert/spirit.txt b/npc/005-1_Snake_desert/spirit.txt
new file mode 100644
index 00000000..ad835121
--- /dev/null
+++ b/npc/005-1_Snake_desert/spirit.txt
@@ -0,0 +1,301 @@
+function script EarthImpTouch {
+ if (getskilllv(SKILL_MAGIC))
+ goto L_message;
+ close;
+
+L_message:
+ set @Q_MASK, NIBBLE_0_MASK;
+ set @Q_SHIFT, NIBBLE_0_SHIFT;
+ set @Q_status, (QUEST_MAGIC2 & @Q_MASK) >> @Q_SHIFT;
+
+ set @Q_STATUS_INITIAL, 0;
+ set @Q_STATUS_ONQUEST, 1;
+ set @Q_STATUS_STUDENT0, 2;
+ set @Q_STATUS_STUDENT1, 3;
+ set @Q_STATUS_STUDENT2, 4;
+ set @Q_STATUS_STUDENT3, 5;
+
+ set @s$, "girl";
+ if (Sex)
+ set @s$, "boy";
+
+ if (MAGIC_FLAGS & MFLAG_KNOWS_IMP)
+ goto L_wb;
+
+ mes "[Well]";
+ mes "Something is inside that well, and now that you have turned your attention towards it, it seems to be talking to you!";
+ next;
+
+ mes "[Well]";
+ mes "\"Hey! You there! Yes, I'm talking to you!\"";
+ mes "That strange voice seems to be coming from inside your head!";
+ next;
+
+ menu
+ "Who, me?", -,
+ "Leave me alone!", L_close,
+ "Aaah! I'm hearing voices!", L_silly_close;
+
+ mes "[Well]";
+ mes "\"I'm in here, in the well, talking to you! If I'm not very mistaken, you are a powerful wizard-to-be, except that nobody has showed you how to properly do magic yet!\"";
+ next;
+
+ menu
+ "Who are you?", -,
+ "Aaaah! The voices are after me!", L_silly_close,
+ "Whatever it is, I'm not interested.", L_close;
+
+ mes "[Earth Spirit]";
+ mes "\"I'm an earth spirit; my name isn't important... all that matters is that I like you, and that I will help you become a powerful wizard if you help me. Just a fair deal, no more than that...\"";
+ next;
+
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_IMP;
+
+ goto L_main;
+L_wb:
+ mes "[Earth Spirit]";
+ mes "\"It's excellent to see you again!\"";
+ next;
+
+L_main:
+ menu
+ "How did you get trapped?", L_Q_trapped,
+ "Can you teach me magic and spells?", L_Q_magic,
+ "What do you know about...", L_Q,
+ "Goodbye!", -;
+ close;
+
+L_Q_trapped:
+ mes "[Earth Spirit]";
+ mes "\"Oh, a wicked witch grew jealous of my power and locked me up in this well.\"";
+ next;
+ goto L_main;
+
+L_Q:
+ mes "[Earth Spirit]";
+ mes "\"Stop bothering me with your questions, will you? I'm trying to make you a powerful wizard, after all!\"";
+ next;
+ goto L_main;
+
+L_Q_magic:
+ if (@Q_status == @Q_STATUS_ONQUEST)
+ goto L_Q_magic_1;
+ if (@Q_status == @Q_STATUS_STUDENT0)
+ goto L_Q_magic_2;
+ if (@Q_status == @Q_STATUS_STUDENT1)
+ goto L_Q_magic_3;
+ if (@Q_status == @Q_STATUS_STUDENT2)
+ goto L_Q_magic_4;
+
+ mes "[Earth Spirit]";
+ mes "\"Good, good... that's the right attitude! Yes, I can teach you magic, but first you must prove that you are worthy to be my student!\"";
+ next;
+
+ mes "[Earth Spirit]";
+ mes "\"North-west of here sits and old, dead tree. Well, not completely dead, not yet, but almost. It's nothing special. Well, maybe a little, but not really. I want you to cut off one of its branches.\"";
+ next;
+
+ menu
+ "No way.", L_silly_close,
+ "Sure.", L_Q_tree_ok,
+ "Why that particular tree?", -;
+
+ mes "[Earth Spirit]";
+ mes "\"Oh, you and your questions! Well, that tree was a druid once, so the branches contain a bit of its lifeforce. And that's useful.\"";
+ next;
+
+ menu
+ "Yuck.", L_silly_close,
+ "Sure, whatever.", L_Q_tree_ok,
+ "Isn't that like cutting off someone's arm?", -;
+
+ mes "[Earth Spirit]";
+ mes "\"Oooh... now come on! Don't be so sentimental. He turned himself into a tree, he can hardly expect everyone to leave him alone.\"";
+ next;
+
+ mes "[Earth Spirit]";
+ mes "\"Who knows if he can even feel anything anymore? I'm sure he can't, being wooden and all. Besides, it's only a measly tree. Not like I'm asking you to cut him down!.\"";
+ next;
+
+ menu
+ "No way.", L_silly_close,
+ "Alright, that makes sense.", L_Q_tree_ok;
+
+L_Q_tree_ok:
+ mes "[Earth Spirit]";
+ mes "\"Good, good, good! Yes, that will be very good! So, come back when you have the branch. Oh, and bring 100,000 GP, too, as an enrollment fee.\"";
+ set @Q_status, @Q_STATUS_ONQUEST;
+ callsub S_update_var;
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_CUTTREE;
+ next;
+ goto L_main;
+
+L_Q_magic_1:
+ mes "[Earth Spirit]";
+ mes "\"Yes, yes, if you bring me the branch and the money, then I will!\"";
+ next;
+ menu
+ "Here are the branch and the money.", -,
+ "How much money did you want again?", L_Q_tree_howmuch,
+ "How can I cut it?", L_Q_tree_how,
+ "Where was the tree again?", L_Q_tree_where,
+ "What is that tree?", L_Q_tree_what;
+
+ if (countitem("DruidTreeBranch") < 1)
+ goto L_Q_tree_none;
+ if (!(MAGIC_FLAGS & MFLAG_DID_CUTTREE))
+ goto L_Q_tree_dry;
+ if (zeny < 100000)
+ goto L_Q_tree_nomoney;
+
+ set zeny, zeny - 100000;
+ delitem "DruidTreeBranch", 1;
+
+ mes "[Earth Spirit]";
+ mes "Following the earth sprite's instructions, you throw branch and GP into the well.";
+ next;
+
+ mes "[Earth Spirit]";
+ mes "\"Well done, very well done! Consider yourself my student now.\"";
+
+ mes "[5000 experience points]";
+ if (getskilllv(SKILL_MAGIC_NATURE) < 2)
+ mes "[Level 2 in Nature Magic]";
+ getexp 5000, 0;
+ if (getskilllv(SKILL_MAGIC_NATURE) < 2)
+ setskill SKILL_MAGIC_NATURE, 2;
+ next;
+
+ set @Q_status, @Q_STATUS_STUDENT0;
+ callsub S_update_var;
+ goto L_main;
+
+L_Q_magic_finish:
+ mes "[1000 experience points]";
+ set @Q_status, @Q_status + 1;
+ callsub S_update_var;
+ getexp 1000,0;
+ next;
+ goto L_main;
+
+L_Q_magic_2:
+ mes "[Earth Spirit]";
+ mes "\"Yes, of course! For just 20,000 GP I will teach you your first spell!\"";
+ next;
+
+ menu
+ "Here you are.", -,
+ "No.", L_main;
+
+ if (zeny < 20000)
+ goto L_no20k;
+
+ set zeny, zeny - 20000;
+
+ mes "[Earth Spirit]";
+ mes "\"Kekeke... excellent! Yes, here goes your first spell, the flying backpack! If you are overloaded, it will take the load off your shoulders.\"";
+ next;
+
+ mes "[Earth Spirit]";
+ mes "\"Take a cocoon, living or dead, and suffuse it in magic. Whisper '" + getspellinvocation("flying-backpack") + "', and feel it float!\"";
+ goto L_Q_magic_finish;
+
+L_Q_magic_3:
+ mes "[Earth Spirit]";
+ mes "\"But yes, yes! Only 20,000 GP, once again, and I will teach you a far more useful spell!\"";
+ next;
+
+ menu
+ "Here you are.", -,
+ "No.", L_main;
+
+ if (zeny < 20000)
+ goto L_no20k;
+
+ set zeny, zeny - 20000;
+
+ mes "[Earth Spirit]";
+ mes "\"Yeees, good! This one is a protection spell, making your skin harder. You need a hard spike for it, though. Hold that spike in your hands, and focus on it.\"";
+ next;
+
+ mes "[Earth Spirit]";
+ mes "\"Next, say '" + getspellinvocation("protect") + "', and feel your skin grow rigid! Very useful against stings and stabs and pokes and pricks and that sort of stuff.\"";
+ goto L_Q_magic_finish;
+
+L_Q_magic_4:
+ mes "[Earth Spirit]";
+ mes "\"Naah, you're too weak now! Come back later when you have grown!\"";
+ next;
+ goto L_main;
+
+L_no20k:
+ mes "[Earth Spirit]";
+ mes "\"You can't pay me 20,000 if you don't have that much!\"";
+ next;
+ goto L_main;
+
+L_Q_tree_none:
+ mes "[Earth Spirit]";
+ mes "\"Where is your branch?\"";
+ next;
+ goto L_main;
+
+L_Q_tree_dry:
+ mes "[Earth Spirit]";
+ mes "\"That won't do. This branch is completely dead; you'll have to get another.\"";
+ next;
+ goto L_main;
+
+L_Q_tree_nomoney:
+ mes "[Earth Spirit]";
+ mes "\"No, you don't have enough money! Come back when you have 100,000.\"";
+ next;
+ goto L_main;
+
+L_Q_tree_howmuch:
+ mes "[Earth Spirit]";
+ mes "\"It's only 100,000 GP to become my student.\"";
+ next;
+ goto L_main;
+
+L_Q_tree_how:
+ mes "[Earth Spirit]";
+ mes "\"Oh... right, the tree might be protected. Only a bone knife will cut that. No idea where you can find one, but I'm sure you will manage!\"";
+ next;
+ goto L_main;
+
+L_Q_tree_where:
+ mes "[Earth Spirit]";
+ mes "\"North-west of here.\"";
+ next;
+ goto L_main;
+
+L_Q_tree_what:
+ mes "[Earth Spirit]";
+ mes "\"Just some silly druid who turned himself into a tree; nothing important.\"";
+ next;
+ goto L_main;
+
+L_silly_close:
+ if (MAGIC_FLAGS & MFLAG_KNOWS_IMP)
+ mes "[Earth Spirit]";
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_IMP))
+ mes "[Well]";
+ mes "\"Silly " + @s$ + ".\"";
+L_close:
+ close;
+
+S_update_var:
+ set QUEST_MAGIC2,
+ (QUEST_MAGIC & ~(@Q_MASK)
+ | (@Q_status << @Q_SHIFT));
+ return;
+}
+
+005-1.gat,118,70,0 script #EarthImp0#_M 127,{
+ callfunc "EarthImpTouch";
+}
+
+005-1.gat,119,70,0 script #EarthImp1#_M 127,{
+ callfunc "EarthImpTouch";
+}
diff --git a/npc/005-1_Snake_desert/tree.txt b/npc/005-1_Snake_desert/tree.txt
new file mode 100644
index 00000000..093cbe1e
--- /dev/null
+++ b/npc/005-1_Snake_desert/tree.txt
@@ -0,0 +1,166 @@
+function script QuestTreeTrigger {
+ set @Q_MASK, NIBBLE_2_MASK;
+ set @Q_SHIFT, NIBBLE_2_SHIFT;
+
+ set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
+ set @Q_status_lower, @Q_status & 3;
+ set @Q_status, (@Q_status & 12) >> 2;
+
+ if (@Q_status & @flag)
+ close; // already did that
+
+ if (@flag == 2)
+ goto L_hug;
+
+L_cont:
+ set @Q_status, @Q_status | @flag;
+ callsub S_update_var;
+
+ if (@Q_status != 3)
+ close;
+
+ if (MAGIC_FLAGS & MFLAG_DID_CUTTREE)
+ close;
+
+ mes "Maybe it is just a trick of the light, but you can't help but think that the tree looks different... healthier, almost younger.";
+ mes "[20000 experience points]";
+ getexp 20000, 0;
+ set @value, 15;
+ callfunc "QuestSagathaHappy";
+ next;
+ close;
+
+L_hug:
+ mes "You hug the tree.";
+ next;
+ goto L_cont;
+
+S_update_var:
+ set @Q_wr_status, (@Q_status << 2) | @Q_status_lower;
+ set QUEST_MAGIC,
+ (QUEST_MAGIC & ~(@Q_MASK)
+ | (@Q_wr_status << @Q_SHIFT));
+ return;
+}
+
+function script QuestTreeTouch {
+ set @Q_MASK, NIBBLE_2_MASK;
+ set @Q_SHIFT, NIBBLE_2_SHIFT;
+
+ set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
+ set @Q_status, (@Q_status & 12) >> 2;
+
+ if (@Q_status == 3)
+ goto L_happy;
+
+ if ((MAGIC_FLAGS & (MFLAG_KNOWS_DRUIDTREE | MFLAG_KNOWS_CUTTREE)) == MFLAG_KNOWS_CUTTREE)
+ goto L_cut;
+
+ if ((MAGIC_FLAGS & (MFLAG_KNOWS_DRUIDTREE | MFLAG_KNOWS_CUTTREE)) == MFLAG_KNOWS_DRUIDTREE)
+ goto L_water;
+
+ if ((MAGIC_FLAGS & (MFLAG_KNOWS_DRUIDTREE | MFLAG_KNOWS_CUTTREE)) > 0) //i.e., both are set
+ goto L_both;
+
+ close;
+
+L_cut:
+ mes "[Dying Tree]";
+ mes "This must be the tree that the earth spirit was referring to.";
+ next;
+ menu
+ "Cut off a branch", L_do_cut,
+ "Leave it alone", -;
+ close;
+
+L_water:
+ mes "[Dying Tree]";
+ mes "This must be the druid tree.";
+ next;
+ menu
+ "Water the tree", L_givewater,
+ "Kiss tree", L_kiss,
+ "Leave it alone", -;
+ close;
+
+L_both:
+ mes "[Dying Tree]";
+ mes "This must be the druid tree that Wyara and the earth spirit were talking about.";
+ next;
+ menu
+ "Water the tree", L_givewater,
+ "Kiss tree", L_kiss,
+ "Cut off a branch", L_do_cut,
+ "Leave it alone", -;
+ close;
+
+L_givewater:
+ set @BOTTLE, 540;
+
+ if (countitem("BottleOfWater") < 1)
+ goto L_no_water;
+ delitem "BottleOfWater", 1;
+ getitem "EmptyBottle", 1;
+
+ mes "[Dying Tree]";
+ mes "You pour a bottle of water into the sand. The water dissipates quickly, without any effect.";
+ next;
+ close;
+
+L_no_water:
+ mes "[Dying Tree]";
+ mes "You don't have any water.";
+ next;
+ close;
+
+L_kiss:
+ mes "[Dying Tree]";
+ mes "You pluck out a splinter from your lip.";
+ mes "Somehow, you don't think that this helped.";
+ next;
+ close;
+
+L_do_cut:
+ if (countitem(570) < 1)
+ goto L_no_boneknife;
+
+ if (MAGIC_FLAGS & MFLAG_DID_CUTTREE)
+ goto L_really_cut;
+
+ mes "[Dying Tree]";
+ mes "You find a suitable branch and put your bone knife in position.";
+ mes "Holding the branch, you have an uneasy feeling-- as if something inside the tree were trying to resist you...";
+ mes "Do you want to continue cutting?";
+ next;
+
+ menu
+ "Nah... better not.", -,
+ "Yes, let's cut!", L_really_cut;
+ close;
+
+L_really_cut:
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_DID_CUTTREE;
+ getitem "DruidTreeBranch", 1;
+ mes "[Dying Tree]";
+ mes "You cut off a branch from the tree.";
+ mes "For an instant, you have an uneasy feeling, as if the branch were writhing in your hand...";
+ next;
+ close;
+
+L_no_boneknife:
+ mes "[Dying Tree]";
+ mes "Try as you might, you can't seem to find a way to cut off a branch. Perhaps you need a different tool for cutting?";
+ next;
+ close;
+
+L_happy:
+ close;
+}
+
+005-1.gat,79,41,0 script #DruidTree0#_M 127,{
+ callfunc "QuestTreeTouch";
+}
+
+005-1.gat,80,41,0 script #DruidTree1#_M 127,{
+ callfunc "QuestTreeTouch";
+}
diff --git a/npc/006-1_Desert_mountains/pachua.txt b/npc/006-1_Desert_mountains/pachua.txt
index 3c63cb27..8fff2b52 100644
--- a/npc/006-1_Desert_mountains/pachua.txt
+++ b/npc/006-1_Desert_mountains/pachua.txt
@@ -1,8 +1,5 @@
006-1.gat,23,100,0 script Pachua 143,{
- set @LEATHER_PATCH, 708;
- set @SNAKE_SKIN, 641;
-
set @LEATHER_PATCH_PRICE, 300;
set @wants_leather_patch, QUEST_Forestbow_state & NIBBLE_4_MASK;
@@ -19,9 +16,9 @@
next;
L_Check_Shops:
- if((countitem(610) > 0 && countitem(@SNAKE_SKIN) > 9) && (countitem(524) > 0 && countitem(@SNAKE_SKIN) > 1)) goto L_Super_store;
- if(countitem(610) > 0 && countitem(@SNAKE_SKIN) > 9) goto L_Chaps_store;
- if(countitem(524) > 0 && countitem(@SNAKE_SKIN) > 1) goto L_Cowboy_store;
+ if((countitem("JeansShorts") > 0 && countitem("SnakeSkin") > 9) && (countitem("FancyHat") > 0 && countitem("SnakeSkin") > 1)) goto L_Super_store;
+ if(countitem("JeansShorts") > 0 && countitem("SnakeSkin") > 9) goto L_Chaps_store;
+ if(countitem("FancyHat") > 0 && countitem("SnakeSkin") > 1) goto L_Cowboy_store;
mes "[Chief Pachua]";
mes "\"Maybe if you bring me the right materials I can make something for you.\"";
@@ -101,31 +98,31 @@ L_Chaps_store:
L_BuyChaps:
if (zeny < 10000) goto L_NoMoney;
- if (countitem(610) < 1) goto L_NoJeans;
- if (countitem(@SNAKE_SKIN) < 10) goto L_NoSkin;
+ if (countitem("JeansShorts") < 1) goto L_NoJeans;
+ if (countitem("SnakeSkin") < 10) goto L_NoSkin;
set zeny, zeny - 10000;
- delitem @SNAKE_SKIN, 10;
- delitem 610, 1;
- getitem 642, 1;
+ delitem "SnakeSkin", 10;
+ delitem "JeansShorts", 1;
+ getitem "JeansChaps", 1;
goto L_DealDone;
L_BuyCowboy:
if (zeny < 5000) goto L_NoMoney;
- if (countitem(524) < 1) goto L_NoFancy;
- if (countitem(@SNAKE_SKIN) < 2) goto L_NoSkin;
+ if (countitem("FancyHat") < 1) goto L_NoFancy;
+ if (countitem("SnakeSkin") < 2) goto L_NoSkin;
set zeny, zeny - 5000;
- delitem @SNAKE_SKIN, 2;
- delitem 524, 1;
+ delitem "SnakeSkin", 2;
+ delitem "FancyHat", 1;
set @temp,rand(2);
if(@temp == 0) goto L_Cowboy_white;
goto L_Cowboy_black;
L_Cowboy_white:
- getitem 643, 1;
+ getitem "CowboyWhite", 1;
goto L_DealDone;
L_Cowboy_black:
- getitem 644, 1;
+ getitem "CowboyBlack", 1;
goto L_DealDone;
L_leather_patch:
@@ -137,14 +134,14 @@ L_leather_patch:
"OK, I'll be back later.", L_End,
"That's too expensive!.", L_NoDeal;
- if (countitem(@SNAKE_SKIN) < 1) goto L_NoSkins;
+ if (countitem("SnakeSkin") < 1) goto L_NoSkins;
if (zeny < @LEATHER_PATCH_PRICE) goto L_NoMoney;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(@SNAKE_SKIN) > 1) goto L_TooMany;
+ if (@inventorylist_count == 100 && countitem("SnakeSkin") > 1) goto L_TooMany;
set zeny, zeny - @LEATHER_PATCH_PRICE;
- delitem @SNAKE_SKIN, 1;
- getitem @LEATHER_PATCH, 1;
+ delitem "SnakeSkin", 1;
+ getitem "LeatherPatch", 1;
goto L_DealDone;
L_DealDone:
diff --git a/npc/008-1_Hurnscald_outskirts/hinnak.txt b/npc/008-1_Hurnscald_outskirts/hinnak.txt
index ce0af655..0aa10570 100644
--- a/npc/008-1_Hurnscald_outskirts/hinnak.txt
+++ b/npc/008-1_Hurnscald_outskirts/hinnak.txt
@@ -56,19 +56,17 @@ L_Exchange:
mes "\"Have you got the 10 antennae?\"";
next;
- if (countitem(614) < 10) goto L_Exchange_Notenough;
-
menu
"Not yet, but I am working on it.", -,
"Sure, here they are!", L_Exchange_Exchange;
close;
L_Exchange_Exchange:
- if (countitem(614) < 10) goto L_Exchange_Notenough;
+ if (countitem("PinkAntenna") < 10) goto L_Exchange_Notenough;
getinventorylist;
- if (@inventorylist_count == 100) goto L_Exchange_TooMany;
- delitem 614, 10;
- getitem 623, 1;
+ if (@inventorylist_count == 100 && countitem("PinkAntenna") > 10) goto L_Exchange_TooMany;
+ delitem "PinkAntenna", 10;
+ getitem "Scythe", 1;
set QUEST_Scythe_state, 2;
mes "[Farmer Hinnak]";
mes "\"Thank you very much. I've got something for you. My old scythe. Maybe you can use it as a weapon. It is a bit cumbersome but its strikes are deadly.\"";
@@ -86,8 +84,134 @@ L_Exchange_TooMany:
L_ThanksAgain:
mes "[Farmer Hinnak]";
- mes "\"Thanks again for helping me with the pinkies.\"";
- close;
+ mes "\"Good to see you again, and thanks again for helping me with the pinkies!\"";
+
+ next;
+
+ menu
+ "Sure, any time!", -,
+ "Anything else you want me to do?", -,
+ "You're welcome. Bye!", L_Bye;
+
+ mes "[Farmer Hinnak]";
+ mes "\"Actually, it's been a long day. If it's no trouble, could you get me a beer?\"";
+ next;
+
+ menu
+ "Here you are.", L_GiveBeer,
+ "Sure, I'll go get one. Bye!", L_Bye,
+ "You shouldn't drink while working!", -;
+
+ mes "[Farmer Hinnak]";
+ mes "\"Well, I'm done for the day, and I'm quite old enough to decide when I can have a beer, thank you!\"";
+ next;
+
+ menu
+ "Sorry... here you are.", L_GiveBeer,
+ "I don't have any.", L_NoBeer;
+
+L_GiveBeer:
+ if (countitem("Beer") < 1) goto L_NoBeer;
+ delitem "Beer", 1;
+ mes "[Farmer Hinnak]";
+ mes "Hinnak takes a sip.";
+ mes "\"Aaah! Nothing like a well-deserved beer after a long day of tending the crops!\"";
+ mes "\"Thanks, that was very kind of you!\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "He takes another sip.";
+ mes "\"Thanks! You know, I had the strangest thing happen to me. I had this patch of ground that was really clumpy; lots of clay, you see.\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"Right over there.\"";
+ mes "He points to a stretch of soft, raked ground.";
+ mes "\"Looks much better now, doesn't it? But how I got there is kind-a scary...\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"I'd been trying to break it up for a while, but that kind of work is a pain. So my wife said that I should go and see the witch, just in case she knows something.\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"And sure enough I ask the witch, and she has a look at it. 'Nothing I can do', she says, 'but I can ask a friend'.\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"So the next day another witch shows up. Gorgeous woman, but when she looked at me, the scares went scuttling down my spine....\"";
+ mes "\"First thing she asked was if I'm a farmer. Said her friend had told her that I needed help.\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"I show her what the problem is, and she tells me to go inside and wait.\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"Hinnak drains his beer in one long sip, then hesitates.";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"So I go inside. I'm barely in when it starts raining outside, pouring cats and mouboos!\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"Not so weird, perhaps, except that it was been bright and sunny just a second before! So I rush out, my wife telling me to leave the witch alone, and I see her standing there in the middle of the rain...\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"None of the raindrops touched her, as if they was afraid!\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"Then she yells out some gobbledygook word, and out of the ground there comes a swarm of maggots, crawling and digging and climbing over each other's backs...\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"And then she turns to me! Seeing her stare, for a moment there I think that she'll turn me into a pinkie, for sure...\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"But all she says is, 'if you'd stayed inside, you wouldn't be wet now'.\"";
+ next;
+
+ menu
+ "Hahaha!", L_Sagatha_hahaha,
+ "Whoah, scary...", L_Sagatha_scary,
+ "What was that gobbledygook word?", L_Sagatha_word,
+ "I better go now.", -;
+ goto L_Bye;
+
+L_Sagatha_hahaha:
+ mes "[Farmer Hinnak]";
+ mes "\"Yeah, funny now... But you should've seen that stare! Ah, well, never mind.\"";
+ next;
+ close;
+
+L_Sagatha_scary:
+ mes "[Farmer Hinnak]";
+ mes "\"Yeah, you could say that...\"";
+ mes "He stares into his empty beer jug, as if wishing it weren't empty yet.";
+ next;
+ close;
+
+L_Sagatha_word:
+ mes "[Farmer Hinnak]";
+ mes "\"Oh, I can be sure... but something like '" + getspellinvocation("summon-maggots") + "', I think.\"";
+ next;
+ close;
+
+L_NoBeer:
+ mes "[Farmer Hinnak]";
+ mes "\"Ah... no beer? Oh well.\"";
+ next;
+ close;
+
+L_Bye:
+ mes "[Farmer Hinnak]";
+ mes "\"Bye!\"";
+ next;
+ close;
L_NohMask:
menu
diff --git a/npc/009-1_Hurnscald/jack.txt b/npc/009-1_Hurnscald/jack.txt
index 02381aa7..de78e37a 100644
--- a/npc/009-1_Hurnscald/jack.txt
+++ b/npc/009-1_Hurnscald/jack.txt
@@ -15,9 +15,7 @@
// Lumberjack
009-1.gat,40,45,0 script Jack 141, {
- set @RAWLOG, 569;
set @RAWLOGS_AMOUNT, 40;
- set @WOODENSHIELD, 602;
set @SHIELD_COST, 5000;
set @QUEST_SHIELD_EXP, 2500;
@@ -181,15 +179,15 @@ L_Shield_state_2:
mes "\"Let's see if you have enough of everything.\"";
next;
- if (countitem(@RAWLOG) < @RAWLOGS_AMOUNT) goto L_Not_enough_logs;
+ if (countitem("RawLog") < @RAWLOGS_AMOUNT) goto L_Not_enough_logs;
if (zeny < @SHIELD_COST) goto L_Not_enough_money;
getinventorylist;
if (@inventorylist_count == 100) goto L_TooMany;
- delitem @RAWLOG, @RAWLOGS_AMOUNT;
+ delitem "RawLog", @RAWLOGS_AMOUNT;
set zeny, zeny - @SHIELD_COST;
getexp @QUEST_SHIELD_EXP, 0;
- getitem @WOODENSHIELD, 1;
+ getitem "WoodenShield", 1;
set @Q_Woodenshield, 3;
callsub S_Update_Mask;
diff --git a/npc/009-2_Hurnscald/_import.txt b/npc/009-2_Hurnscald/_import.txt
index d2badb7b..773191c7 100644
--- a/npc/009-2_Hurnscald/_import.txt
+++ b/npc/009-2_Hurnscald/_import.txt
@@ -13,3 +13,4 @@ npc: npc/009-2_Hurnscald/richard.txt
npc: npc/009-2_Hurnscald/selim.txt
npc: npc/009-2_Hurnscald/shops.txt
npc: npc/009-2_Hurnscald/waitress.txt
+npc: npc/009-2_Hurnscald/wyara.txt
diff --git a/npc/009-2_Hurnscald/alan.txt b/npc/009-2_Hurnscald/alan.txt
index 6d8a1770..6dc9da67 100644
--- a/npc/009-2_Hurnscald/alan.txt
+++ b/npc/009-2_Hurnscald/alan.txt
@@ -134,7 +134,7 @@ L_State_3_try:
mes "\"Hmmm... looks ok, but is it strong enough?\"";
mes "Alan bends the log over his knee.";
next;
- delitem 569, 1;
+ delitem "RawLog", 1;
set @Temp1, rand(20);
if (@Temp1 == 0) goto L_State_3_success;
mes "The log breaks with a loud crack";
@@ -177,7 +177,7 @@ L_State_4_pay:
getinventorylist;
if (@inventorylist_count == 100) goto L_State_4_TooMany;
set zeny, zeny - 10000;
- getitem 545, 1;
+ getitem "ForestBow", 1;
set @Q_status, 5;
callsub S_Update_Var;
mes "[Alan]";
diff --git a/npc/009-2_Hurnscald/kfahr.txt b/npc/009-2_Hurnscald/kfahr.txt
index f24d2071..ba6cc02b 100644
--- a/npc/009-2_Hurnscald/kfahr.txt
+++ b/npc/009-2_Hurnscald/kfahr.txt
@@ -24,21 +24,13 @@
set @QS_STINGER_QUEST, 6;
set @QS_STINGER_QUEST_DONE, 7;
- set @BEER, 539;
-
- set @BLACK_STINGER, 709;
set @BLACK_STINGERS_NR, 10;
- set @MUSHROOM, 566;
set @MUSHROOMS_NR, 10;
- set @SNAKE_SKIN, 641;
set @SNAKE_SKINS_NR, 10;
set @KNIFE_QUEST_XP, 50000;
set @STINGER_QUEST_XP, 80000;
- set @BONE_KNIFE, 570;
- set @GOLDEN_STINGER, 706;
-
set @Q_MASK, NIBBLE_2_MASK;
set @Q_SHIFT, NIBBLE_2_SHIFT;
@@ -783,10 +775,10 @@ L_knife_quest_check:
close;
L_knife_quest_completecheck:
- if (countitem(@BLACK_STINGER) < @BLACK_STINGERS_NR)
+ if (countitem("BlackScorpionStinger") < @BLACK_STINGERS_NR)
goto L_knife_quest_missing_stingers;
- if (countitem(@MUSHROOM) < @MUSHROOMS_NR)
+ if (countitem("SmallMushroom") < @MUSHROOMS_NR)
goto L_knife_quest_missing_mushrooms;
@@ -810,10 +802,10 @@ L_knife_quest_completecheck:
mes "I had the nomads make me a few of them, and I hardly use them nowadays, so I think I can part with this one.";
next;
- if (countitem(@BLACK_STINGER) < @BLACK_STINGERS_NR)
+ if (countitem("BlackScorpionStinger") < @BLACK_STINGERS_NR)
goto L_knife_quest_missing_stingers_2;
- if (countitem(@MUSHROOM) < @MUSHROOMS_NR)
+ if (countitem("SmallMushroom") < @MUSHROOMS_NR)
goto L_knife_quest_missing_mushrooms_2;
getinventorylist;
if (@inventorylist_count == 100) goto L_Knife_TooMany;
@@ -827,10 +819,10 @@ L_knife_quest_completecheck:
set @Q_status, @QS_KNIFE_QUEST_DONE;
callsub L_Update_Var;
- delitem @BLACK_STINGER, @BLACK_STINGERS_NR;
- delitem @MUSHROOM, @MUSHROOMS_NR;
+ delitem "BlackScorpionStinger", @BLACK_STINGERS_NR;
+ delitem "SmallMushroom", @MUSHROOMS_NR;
getexp @KNIFE_QUEST_XP, 0;
- getitem @BONE_KNIFE, 1;
+ getitem "BoneKnife", 1;
next;
goto L_main_menu;
@@ -843,9 +835,9 @@ L_Knife_TooMany:
L_knife_quest_missing_stingers:
mes "[Kfahr the Warrior]";
mes "\"No, no... I said " + @BLACK_STINGERS_NR + " black scorpion stingers.";
- if (countitem(@BLACK_STINGER))
- mes "You will need " + (@BLACK_STINGERS_NR - (countitem (@BLACK_STINGER))) + " more of those.\"";
- if (countitem(@BLACK_STINGER) == 0)
+ if (countitem("BlackScorpionStinger"))
+ mes "You will need " + (@BLACK_STINGERS_NR - (countitem ("BlackScorpionStinger"))) + " more of those.\"";
+ if (countitem("BlackScorpionStinger") == 0)
mes "You didn't bring even a single one!\"";
next;
close;
@@ -853,9 +845,9 @@ L_knife_quest_missing_stingers:
L_knife_quest_missing_stingers_2:
mes "[Kfahr the Warrior]";
mes "\"You just had " + @BLACK_STINGERS_NR + " black scorpion stingers. What happened to them?";
- if (countitem(@BLACK_STINGER))
- mes "You will need " + (@BLACK_STINGERS_NR - (countitem (@BLACK_STINGER))) + " more of those.\"";
- if (countitem(@BLACK_STINGER) == 0)
+ if (countitem("BlackScorpionStinger"))
+ mes "You will need " + (@BLACK_STINGERS_NR - (countitem ("BlackScorpionStinger"))) + " more of those.\"";
+ if (countitem("BlackScorpionStinger") == 0)
mes "You didn't bring even a single one!\"";
next;
close;
@@ -863,9 +855,9 @@ L_knife_quest_missing_stingers_2:
L_knife_quest_missing_mushrooms:
mes "[Kfahr the Warrior]";
mes "\"No, no... I said " + @MUSHROOMS_NR + " small mushrooms.";
- if (countitem(@MUSHROOM))
- mes "You will need " + (@MUSHROOMS_NR - (countitem (@MUSHROOM))) + " more of those.\"";
- if (countitem(@MUSHROOM) == 0)
+ if (countitem("SmallMushroom"))
+ mes "You will need " + (@MUSHROOMS_NR - (countitem ("SmallMushroom"))) + " more of those.\"";
+ if (countitem("SmallMushroom") == 0)
mes "You didn't bring me even a single little mushroom!\"";
next;
close;
@@ -873,9 +865,9 @@ L_knife_quest_missing_mushrooms:
L_knife_quest_missing_mushrooms_2:
mes "[Kfahr the Warrior]";
mes "\"You just had " + @MUSHROOMS_NR + " small mushrooms. What happened to them?";
- if (countitem(@MUSHROOM))
- mes "You will need " + (@MUSHROOMS_NR - (countitem (@MUSHROOM))) + " more of those.\"";
- if (countitem(@MUSHROOM) == 0)
+ if (countitem("SmallMushroom"))
+ mes "You will need " + (@MUSHROOMS_NR - (countitem ("SmallMushroom"))) + " more of those.\"";
+ if (countitem("SmallMushroom") == 0)
mes "You didn't bring me even a single little mushroom!\"";
next;
close;
@@ -893,13 +885,13 @@ L_stinger_quest_check:
L_snakeskins_completecheck:
- if (countitem(@SNAKE_SKIN) < @SNAKE_SKINS_NR)
+ if (countitem("SnakeSkin") < @SNAKE_SKINS_NR)
goto L_snakeskins_missing;
getinventorylist;
if (@inventorylist_count == 100) goto L_SnakeSkins_TooMany;
- delitem @SNAKE_SKIN, @SNAKE_SKINS_NR;
- getitem @GOLDEN_STINGER, 1;
+ delitem "SnakeSkin", @SNAKE_SKINS_NR;
+ getitem "GoldenScorpionStinger", 1;
set @Q_status, @QS_STINGER_QUEST_DONE;
callsub L_Update_Var;
@@ -917,9 +909,9 @@ L_snakeskins_completecheck:
L_snakeskins_missing:
mes "[Kfahr the Warrior]";
mes "\"No, no... I said " + @SNAKE_SKINS_NR + " snake skins.";
- if (countitem(@SNAKE_SKIN))
- mes "You will need " + (@SNAKE_SKINS_NR - (countitem (@SNAKE_SKIN))) + " more of those.\"";
- if (countitem(@SNAKE_SKIN) == 0)
+ if (countitem("SnakeSkin"))
+ mes "You will need " + (@SNAKE_SKINS_NR - (countitem ("SnakeSkin"))) + " more of those.\"";
+ if (countitem("SnakeSkin") == 0)
mes "You didn't bring even a single skin!\"";
next;
close;
@@ -930,7 +922,7 @@ L_SnakeSkins_TooMany:
close;
L_give_beer:
- if (countitem(@BEER) < 1)
+ if (countitem("Beer") < 1)
goto L_player_out_of_beer;
if (@has_beer)
@@ -948,7 +940,7 @@ L_give_beer:
set @mesg$, @beermessages$[@beer_count];
- delitem @BEER, 1;
+ delitem "Beer", 1;
set @has_beer, 1;
set @beer_count, @beer_count + 1;
diff --git a/npc/009-2_Hurnscald/misc.txt b/npc/009-2_Hurnscald/misc.txt
index 56d02bf9..9a929203 100644
--- a/npc/009-2_Hurnscald/misc.txt
+++ b/npc/009-2_Hurnscald/misc.txt
@@ -9,3 +9,53 @@
close;
// In case you don't get the joke - it's a parody on Illutia.
}
+
+//Bookshelf
+009-2.gat,109,44,0 script #Book 127, {
+ if (getskilllv(SKILL_MAGIC))
+ goto L_magic;
+ mes "[Bookshelf]";
+ mes "This bookshelf seems to have a selection of diaries and manuscripts, though you can't make out anything that strikes you as being particularly interesting.";
+ close;
+
+L_magic:
+ mes "[Bookshelf]";
+ mes "Browsing through the books, you come across a manuscript entitled 'Notes of Potaffe, On Transmutation'.";
+ next;
+
+ if (getskilllv(SKILL_MAGIC_TRANSMUTE) < 2)
+ goto L_magic_boring;
+
+ mes "[Bookshelf]";
+ mes "Leafing through the manuscript, you find that you can read little of the tiny handwriting, and understand only a fraction of what is said.";
+ next;
+
+ mes "[Bookshelf]";
+ mes "After a while, you stumble across a section that appears to be in more careful handwriting. The author notes that he (or she?) is describing a completely new transmutation there.";
+ next;
+
+ mes "[Bookshelf]";
+ mes "Excitedly, you turn the page-- only to find that it is stuck to the next, and won't get unstuck!";
+ next;
+
+ mes "[Bookshelf]";
+ mes "The page after that is more scribbly again, with many crossed-out words and sections, and side remarks such as 'It almost worked' or 'Worked fine yesterday.'";
+ next;
+
+ mes "[Bookshelf]";
+ mes "The last word on that page is '" + getspellinvocation("make-iron-powder") + "', underlined twice, with a comment saying 'finally got it right'.";
+ next;
+
+ mes "[Bookshelf]";
+ mes "Unfortunately, you can't make out from the text what the transmutation is for or whether it requires any material components...";
+ next;
+
+ mes "[Bookshelf]";
+ mes "You can't make out anything else of value, so you place the manuscript back in the bookshelf.";
+ next;
+ close;
+
+L_magic_boring:
+ mes "[Bookshelf]";
+ mes "Leafing through the manuscript, you find that you understand too little of what is said there to make any sense of it.";
+}
diff --git a/npc/009-2_Hurnscald/nicholas.txt b/npc/009-2_Hurnscald/nicholas.txt
index b9c8a36d..0ee1053f 100644
--- a/npc/009-2_Hurnscald/nicholas.txt
+++ b/npc/009-2_Hurnscald/nicholas.txt
@@ -13,14 +13,6 @@
009-2.gat,185,55,0 script Nicholas 135,{
- set @IRON_ORE, 640;
- set @INFANTRY, 638;
- set @LEATHER_PATCH, 708;
- set @SHORT_SWORD, 536;
- set @MONSTER_OIL, 707;
- set @SETZER, 571;
- set @STEEL_SHIELD, 601;
-
set @SETZER_XP, 100000;
set @SHIELD_XP, 20000;
@@ -59,9 +51,9 @@ L_Check:
mes "[Nicholas]";
mes "\"Let me take at look at how much you have...\"";
next;
- if(countitem(@IRON_ORE)<5) goto L_NoItem;
- if(countitem(@IRON_ORE)<10) goto L_StageA;
- if(countitem(@IRON_ORE)<15) goto L_StageB;
+ if(countitem("IronOre")<5) goto L_NoItem;
+ if(countitem("IronOre")<10) goto L_StageA;
+ if(countitem("IronOre")<15) goto L_StageB;
goto L_StageC;
L_Info:
@@ -120,19 +112,19 @@ L_main_menu:
set @choices_nr, 0;
setarray @choice_idx, 0, 0, 0, 0, 0;
- if (countitem(@SHORT_SWORD) < 1) goto L_main_menu_post_setzer;
+ if (countitem("ShortSword") < 1) goto L_main_menu_post_setzer;
set @choice$[@choices_nr], "Can you make my short sword better?";
set @choice_idx[@choices_nr], @CHOICE_SETZER;
set @choices_nr, 1 + @choices_nr;
L_main_menu_post_setzer:
- if (countitem(@IRON_ORE)<5) goto L_no_more_helmets;
+ if (countitem("IronOre")<5) goto L_no_more_helmets;
set @choice$[@choices_nr], "Knight's Helmet. (5 Iron Ores)";
set @choice_idx[@choices_nr], @CHOICE_KNIGHT;
set @choices_nr, 1 + @choices_nr;
- if (countitem(@IRON_ORE)<10) goto L_no_more_helmets;
+ if (countitem("IronOre")<10) goto L_no_more_helmets;
set @choice$[@choices_nr], "Crusade Helmet. (10 Iron Ores)";
set @choice_idx[@choices_nr], @CHOICE_CRUSADE;
@@ -142,7 +134,7 @@ L_main_menu_post_setzer:
set @choice_idx[@choices_nr], @CHOICE_SHIELD;
set @choices_nr, 1 + @choices_nr;
- if (countitem(@IRON_ORE)<15) goto L_no_more_helmets;
+ if (countitem("IronOre")<15) goto L_no_more_helmets;
set @choice$[@choices_nr], "Warlord Helmet. (15 Iron Ores)";
set @choice_idx[@choices_nr], @CHOICE_WARLORD;
@@ -192,8 +184,8 @@ L_YesKnight:
getinventorylist;
if (@inventorylist_count == 100) goto L_TooMany;
set zeny, zeny - 10000;
- delitem @IRON_ORE, 5;
- getitem 637, 1;
+ delitem "IronOre", 5;
+ getitem "KnightsHelmet", 1;
goto L_Done;
L_YesCrusade:
@@ -201,8 +193,8 @@ L_YesCrusade:
getinventorylist;
if (@inventorylist_count == 100) goto L_TooMany;
set zeny, zeny-10000;
- delitem @IRON_ORE,10;
- getitem 639,1;
+ delitem "IronOre", 10;
+ getitem "CrusadeHelmet", 1;
goto L_Done;
L_YesWarlord:
@@ -210,8 +202,8 @@ L_YesWarlord:
getinventorylist;
if (@inventorylist_count == 100) goto L_TooMany;
set zeny, zeny-10000;
- delitem @IRON_ORE,15;
- getitem 636,1;
+ delitem "IronOre", 15;
+ getitem "WarlordHelmet", 1;
goto L_Done;
L_YesShield:
@@ -223,8 +215,8 @@ L_YesShield:
menu "Sure, have a look!", -,
"No.", L_Pass;
- if (countitem(@INFANTRY) == 1) goto L_MoreInfantry;
- if (countitem(@INFANTRY) == 0) goto L_NoInfantry;
+ if (countitem("InfantryHelmet") == 1) goto L_MoreInfantry;
+ if (countitem("InfantryHelmet") == 0) goto L_NoInfantry;
mes "[Nicholas]";
mes "Nicholas pulls out two of your infantry helmets.";
@@ -241,9 +233,9 @@ L_YesShield:
"No way.", L_Pass;
if (zeny < 20000) goto L_ShieldNoZeny;
- if (countitem(@INFANTRY) < 2) goto L_ShieldNoInfantry;
- if (countitem(@IRON_ORE) < 10) goto L_ShieldNoOre;
- if (countitem(@LEATHER_PATCH) < 1) goto L_ShieldNoLeatherPatch;
+ if (countitem("InfantryHelmet") < 2) goto L_ShieldNoInfantry;
+ if (countitem("IronOre") < 10) goto L_ShieldNoOre;
+ if (countitem("LeatherPatch") < 1) goto L_ShieldNoLeatherPatch;
// No inventory check needed, as infantry helms are removed, opening two slots
mes "[Nicholas]";
@@ -251,10 +243,10 @@ L_YesShield:
mes "You watch Nicholas melt the ore and helmets and form a shield out of the resulting iron. He then cuts your leather patch apart and adds it to the handles.";
mes "\"Here is your shield!\"";
- delitem @INFANTRY, 1;
- delitem @INFANTRY, 1;
- delitem @LEATHER_PATCH, 1;
- delitem @IRON_ORE, 10;
+ delitem "InfantryHelmet", 1;
+ delitem "InfantryHelmet", 1;
+ delitem "LeatherPatch", 1;
+ delitem "IronOre", 10;
set zeny, zeny - 20000;
if (@Q_SHIELD_status < @SHIELD_COMPLETED)
@@ -265,7 +257,7 @@ L_YesShield:
set @Q_SHIELD_status, @SHIELD_COMPLETED; // get XP only once
callsub L_Update_Var;
- getitem @STEEL_SHIELD, 1;
+ getitem "SteelShield", 1;
next;
close;
@@ -330,20 +322,20 @@ L_SetzerQuest:
"HOW much? Never mind.", L_Pass;
if (zeny < 50000) goto L_SetzerNoZeny;
- if (countitem(@IRON_ORE) < 5) goto L_SetzerNoOre;
- if (countitem(@MONSTER_OIL) < 1) goto L_SetzerNoMonsterOil;
- if (countitem(@SHORT_SWORD) < 1) goto L_SetzerNoSword;
+ if (countitem("IronOre") < 5) goto L_SetzerNoOre;
+ if (countitem("MonsterOilPotion") < 1) goto L_SetzerNoMonsterOil;
+ if (countitem("ShortSword") < 1) goto L_SetzerNoSword;
// No inventory check needed, as the short sword is removed, opening a slot
mes "[Nicholas]";
mes "Nicholas takes the items, heats up your sword and pounds it with a heavy hammer. Before your eyes it turns thinner and flatter. Finally he pours the monster oil over it, heats it up again and douses it in water.";
set zeny, zeny - 50000;
- delitem @IRON_ORE, 5;
- delitem @MONSTER_OIL, 1;
- delitem @SHORT_SWORD, 1;
+ delitem "IronOre", 5;
+ delitem "MonsterOilPotion", 1;
+ delitem "ShortSword", 1;
- getitem @SETZER, 1;
+ getitem "Setzer", 1;
if (!(@Q_SETZER_status & @SETZER_FLAG_MADE_SETZER))
mes "[" + @SETZER_XP + " experience points]";
if (!(@Q_SETZER_status & @SETZER_FLAG_MADE_SETZER))
diff --git a/npc/009-2_Hurnscald/shops.txt b/npc/009-2_Hurnscald/shops.txt
index 3cd1e8f0..f357074c 100644
--- a/npc/009-2_Hurnscald/shops.txt
+++ b/npc/009-2_Hurnscald/shops.txt
@@ -22,7 +22,7 @@
// Potion Shop
// sells cactus drink, cactus potion, iron potion and concentration potion
-009-2.gat,121,26,0 shop Witch 103,501:50,502:70,567:500,568:500
+009-2.gat,123,22,0 shop Potions#_M 127,501:50,502:70,567:500,568:500
// Blacksmith
// Sells all knives, chainmail armor, light platemail
diff --git a/npc/009-2_Hurnscald/waitress.txt b/npc/009-2_Hurnscald/waitress.txt
index bcf2f434..4bf018ee 100644
--- a/npc/009-2_Hurnscald/waitress.txt
+++ b/npc/009-2_Hurnscald/waitress.txt
@@ -3,8 +3,8 @@
009-2.gat,60,52,0 script Melinda 140,{
if (zeny < 180) goto L_NoMoney;
getinventorylist;
- set @beerCount, countitem(539);
- if (@inventorylist_count == 100 && beerCount < 0) goto L_TooMany;
+ set @beerCount, countitem("Beer");
+ if (@inventorylist_count == 100 && beerCount == 0) goto L_TooMany;
mes "[Melinda]";
mes "\"Hi sweety! Want a fresh beer for 170gp?\"";
@@ -19,24 +19,24 @@
mes "[Melinda]";
mes "Pff... nickel nurser!";
next;
- set zeny,zeny-170;
- getitem 539,1;
+ set zeny, zeny - 170;
+ getitem "Beer", 1;
close;
L_5Tip:
mes "[Melinda]";
mes "\"Here you go, sweethearth!\"";
next;
- set zeny,zeny-175;
- getitem 539,1;
+ set zeny, zeny - 175;
+ getitem "Beer", 1;
close;
L_10Tip:
mes "[Melinda]";
mes "\"Thank you, sweety! Want me to hear a secret?\"";
next;
- set zeny,zeny-180;
- getitem 539,1;
+ set zeny, zeny - 180;
+ getitem "Beer", 1;
menu
"What's it, darling?", -,
"Nah, I don't feel like chatting.", L_No;
diff --git a/npc/009-2_Hurnscald/wyara.txt b/npc/009-2_Hurnscald/wyara.txt
new file mode 100644
index 00000000..f79cb733
--- /dev/null
+++ b/npc/009-2_Hurnscald/wyara.txt
@@ -0,0 +1,550 @@
+// ----------------------------------------
+// Wyara the Hurnscald witch
+// ----------------------------------------
+009-2.gat,121,26,0 script Wyara#_M 103,{
+ set @Q_MASK, NIBBLE_2_MASK;
+ set @Q_SHIFT, NIBBLE_2_SHIFT;
+ set @Q_status, (QUEST_MAGIC2 & @Q_MASK) >> @Q_SHIFT;
+
+ set @STATUS_INITIAL, 0;
+ set @STATUS_PURIFY_EXPLAINED, 1;
+ set @STATUS_PURIFY_ONCE, 2;
+ set @STATUS_PURIFY_TWICE, 3;
+ set @STATUS_PURIFY_OVER, 4;
+
+ set @has_magic, getskilllv(SKILL_MAGIC);
+
+ if (@Q_status == @STATUS_PURIFY_ONCE)
+ goto L_Magic_purify_once;
+ if (@Q_status == @STATUS_PURIFY_TWICE)
+ goto L_Magic_purify_done;
+
+ mes "[Wyara the witch]";
+ if (!Sex)
+ mes "\"Greetings, fair traveller! What can I do for you?\"";
+ if (Sex)
+ mes "\"Hello! What brings you here?\"";
+ next;
+
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_WYARA;
+L_Main:
+ if (!@has_magic && (MAGIC_FLAGS & MFLAG_TOUCHED_MANASEED))
+ menu "What do you know about...", L_Question,
+ "Can you help me use the mana seed?", L_Q_manaseed_unabsorbed,
+ "Can you help me learn magic?", L_Magic,
+ "I would like to buy potions.", L_Shop,
+ "Bye!", -;
+ if (!(!@has_magic && (MAGIC_FLAGS & MFLAG_TOUCHED_MANASEED)))
+ menu "What do you know about...", L_Question,
+ "Can you help me learn magic?", L_Magic,
+ "I would like to buy potions.", L_Shop,
+ "Bye!", -;
+ close;
+
+L_Shop:
+ mes "[Wyara the Witch]";
+ mes "\"Please have a look at the shelf behind me.\"";
+ next;
+ close;
+
+L_Question:
+ callfunc "MagicTalkOptionsSetup";
+ set @ignore, @QQ_WYARA;
+ callfunc "MagicTalkMenu";
+
+ if (@c == 0) goto L_Main;
+ if (@c == @QQ_ELANORE) goto L_Q_elanore;
+ if (@c == @QQ_MANASEED) goto L_Q_manaseed;
+ if (@c == @QQ_MANAPOTION) goto L_Q_manapotion;
+ if (@c == @QQ_SAGATHA) goto L_Q_sagatha;
+ if (@c == @QQ_AULDSBEL) goto L_Q_auldsbel;
+ if (@c == @QQ_IMP) goto L_Q_imp;
+ if (@c == @QQ_OLDWIZ) goto L_Q_old_wizard;
+
+ mes "[Wyara the Witch]";
+ mes "\"I fear that I can't help you with that.\"";
+ next;
+ goto L_Main;
+
+
+L_Q_old_wizard:
+ mes "[Wyara the Witch]";
+ mes "\"I don't know his name, but I do know that he has been living in the mountains since I first came here. He is a master of many schools of magic, I believe.\"";
+ next;
+ mes "[Wyara the Witch]";
+ mes "She smiles.";
+ mes "\"He is also a nice and friendly person to talk to, and quite knowledgeable about the teas of this area.\"";
+ next;
+ goto L_Main;
+
+
+L_Q_elanore:
+ mes "[Wyara the Witch]";
+ mes "\"Elanore is the Tulimshar healer. She is a very kind person and an outstanding healer.\"";
+ next;
+ goto L_Main;
+
+L_Q_manaseed:
+ if (!@has_magic && (MAGIC_FLAGS & MFLAG_TOUCHED_MANASEED))
+ goto L_Q_manaseed_unabsorbed;
+ mes "[Wyara the Witch]";
+ mes "\"A mana seed? I'm afraid that I can't help you with that.\"";
+ next;
+ goto L_Main;
+
+L_Q_manaseed_unabsorbed:
+ mes "[Wyara the Witch]";
+ mes "\"So you touched the mana seed but weren't able to absorb its powers? That means that you're lacking a natural magical ability. Still, there are ways around that.\"";
+ next;
+ mes "[Wyara the Witch]";
+ mes "\"If you drink a mana potion, you should be able to retain this magical power and slowly build up a magical skill.\"";
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_MANAPOTION;
+ next;
+ goto L_Main;
+
+L_Q_manapotion:
+ mes "[Wyara the Witch]";
+ mes "\"I have a simple recipe for making mana potions, but I don't have one ready right now. Can you bring me 40 mauve leaves and a bottle of water? I can make one from those quite easily.\"";
+ next;
+ menu "Sure!", L_make_manapotion,
+ "No.", L_Main;
+ goto L_Main;
+
+L_manapotion_toomany:
+ mes "[Wyara the Witch]";
+ mes "\"Hmm... looking at you, I don't think that you would be able to carry it.\"";
+ next;
+ goto L_Main;
+
+L_make_manapotion:
+ if(countitem("MauveHerb") < 40) goto L_make_manapotion_lack;
+ if(countitem("BottleOfWater") < 1) goto L_make_manapotion_lack;
+ getinventorylist;
+ if ((@inventorylist_count == 100)
+ && (countitem("MauveHerb") > 40)
+ && (countitem("BottleOfWater") > 100)
+ && (countitem("ManaPotion") < 1))
+ goto L_manapotion_toomany;
+
+ delitem "MauveHerb", 40;
+ delitem "BottleOfWater", 1;
+ getitem "ManaPotion", 1;
+
+ mes "[Wyara the Witch]";
+ mes "Wyara takes your mauve leaves, grinds them, and pours some of the resultant paste into her cauldron. She then takes your bottle and sticks it into her brew, head-first.";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "The water in the bottle takes on a strange golden hue, but doesn't flow out.";
+ mes "After a while, she retrieves the bottle, fills some of the liquid into a smaller, clay bottle, mixes in the rest of the paste, plugs the bottle and shakes it.";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "\"I shall keep the rest of your water and the bottle as a payment, if you don't mind. But here is the potion; let it rest for a minute before you use it for maximum effect.\"";
+ next;
+
+ goto L_Main;
+
+L_make_manapotion_lack:
+ mes "[Wyara the Witch]";
+ mes "\"No, we need forty mauve leaves and a bottle of water.\"";
+ next;
+
+ goto L_Main;
+
+L_Q_imp:
+ mes "[Wyara the Witch]";
+ mes "\"Sagatha told me that she imprisoned an evil earth spirit in a dried-up well. She wants it to stay there until it has mended its ways, or forever, if it doesn't.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_sagatha:
+ mes "[Wyara the Witch]";
+ mes "Wyara smiles.";
+ mes "\"You have met Sagatha? She's a wonderful person, isn't she? Well, she does hold back a little towards humans, but deep down she feels for them, too.\"";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "\"She does hold all plants and animals very dear, though. Well, the peaceful ones more than the aggressive ones, I suppose, and scorpions not very much at all.\"";
+ next;
+
+ goto L_Main;
+
+L_Q_auldsbel:
+ mes "[Wyara the Witch]";
+ mes "\"Auldsbel... the guild wizard? I don't know him very well; as far as I know, he is only visiting.\"";
+ next;
+
+ goto L_Main;
+
+L_Magic_no:
+ mes "[Wyara the Witch]";
+ mes "\"I am sorry, but you don't seem to be able to control any magic. That means that I really can't help you with that.\"";
+ next;
+ goto L_Main;
+
+L_Magic:
+ if (!@has_magic)
+ goto L_Magic_no;
+ mes "[Wyara the Witch]";
+ mes "\"Perhaps I can help you a little, but I am not a master of any school of magic.\"";
+ next;
+
+L_Magic_main:
+ menu
+ "Can you explain magic to me?", L_Magic_explain,
+ "Can you teach me a spell?", L_Magic_spell,
+ "Can you train me?", L_Magic_train,
+ "Never mind.", -;
+
+ goto L_Main;
+
+L_Magic_explain:
+ mes "[Wyara the Witch]";
+ mes "\"Magic is just a name for the force that lives in all plants and animals and emenates from there into all things, living or dead.\"";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "\"Some things it finds easier to pass through-- natural things, living things-- but dead things, such as rock or metal, can slow it down.\"";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "\"There are different kinds of magic, too; nature, astral, and so on, but if this interests you, you should talk to a scholar.\"";
+ next;
+
+ goto L_Magic_main;
+
+L_Magic_spell:
+ if (getskilllv(SKILL_MAGIC_NATURE) > 1)
+ goto L_Magic_spell3;
+ if (getskilllv(SKILL_MAGIC) > 1)
+ goto L_Magic_spell2;
+ mes "[Wyara the Witch]";
+ mes "\"No... I don't think that you are ready yet. But please ask me again when you have some more control over your magical powers.\"";
+ next;
+
+ goto L_Magic_main;
+
+L_Magic_spell3:
+ mes "[Wyara the Witch]";
+ mes "\"Now that you know the basics of nature magic, here is one of my favourites: '" + getspellinvocation("rain") + "' will summon rain, whereever you are standing. It will consume a bottle of water, though.\"";
+ if (getskilllv(SKILL_MAGIC) < 2)
+ mes "\"You are not powerful enough to use it yet, though; you will first have to absorb more magic from the mana seed.\"";
+ next;
+
+L_Magic_spell2:
+ mes "[Wyara the Witch]";
+ mes "\"Here is an easy and useful one: '" + getspellinvocation("detect-players") + "'. It will tell you the names of everyone nearby, but beware that there are ways to protect against it.\"";
+ next;
+
+ if (!(getpartnerid2(0)))
+ goto L_Magic_main;
+
+ mes "[Wyara the Witch]";
+ mes "\"Married partners can find each other even more easily. Use the '" + getspellinvocation("sense-spouse") + "' spell instead.\"";
+ next;
+ goto L_Magic_main;
+
+L_Magic_train:
+ if (getskilllv(SKILL_MAGIC_NATURE) > 1)
+ goto L_Magic_train_no;
+ mes "[Wyara the Witch]";
+ mes "\"Train you? No... you should talk to Sagatha.\"";
+ mes "She hesitates.";
+ next;
+
+ callfunc "SagathaStatus";
+
+ mes "[Wyara the Witch]";
+ mes "\"It would be difficult to ask her to accept you unless you understand some of the basics already, though.\"";
+ if (@evil)
+ mes "\"However, I have heard that you have done something unforgiveable; I doubt that she will train you now, and I refuse to do so, too.\"";
+ next;
+ if (@evil)
+ goto L_Magic_main;
+
+ if (@Q_status == @STATUS_PURIFY_TWICE)
+ goto L_Magic_purify_done;
+ if (@Q_status == @STATUS_PURIFY_ONCE)
+ goto L_Magic_purify_once;
+ if (@Q_status == @STATUS_PURIFY_EXPLAINED)
+ goto L_Magic_purify_explained;
+
+ mes "[Wyara the Witch]";
+ mes "\"Well, let me help you get started, then! But first, to make sure that you are serious, I have a small task for you.\"";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "\"There is a pond west of Hurnscald, a very small one, almost square in shape, with a rock on its southern ledge leading to its center. This pond is close to dying.\"";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "\"I want to save it; for that, someone will have to pour a purification potion into it.\"";
+ next;
+
+ set @Q_status, @STATUS_PURIFY_EXPLAINED;
+ callsub S_update_var;
+L_Magic_purify_explained:
+ if (countitem("PurificationPotion"))
+ goto L_Magic_purify_doit;
+
+ mes "[Wyara the Witch]";
+ mes "\"To make the purification potion, I will need twenty maggot slimes and twenty leaves of mauve.\"";
+ next;
+
+ menu
+ "I shall get them later.", L_Magic_main,
+ "Booring.", L_Magic_main,
+ "Here they are.", -;
+
+ getinventorylist;
+ if ((@inventorylist_count == 100) && (countitem("MauveHerb") > 20) && (countitem("MaggotSlime") > 20))
+ goto L_Magic_purify_nospace;
+
+ if (countitem("MauveHerb") < 20)
+ goto L_Magic_purify_lacking;
+ if (countitem("MaggotSlime") < 20)
+ goto L_Magic_purify_lacking;
+
+ delitem "MauveHerb", 20;
+ delitem "MaggotSlime", 20;
+ getitem "PurificationPotion", 1;
+ mes "[Wyara the Witch]";
+ mes "\"Wyara grinds the leaves and mixes them with the slime, boils them, then speaks a brief incantation over them and hands you the result.\"";
+ next;
+
+L_Magic_purify_doit:
+ mes "[Wyara the Witch]";
+ mes "\"Take your purification potion to the pond, right next to its center, and pour the potion in.\"";
+ next;
+ close;
+
+L_Magic_purify_nospace:
+ mes "[Wyara the Witch]";
+ mes "\"You don't have enough space to carry the potion. Please come back later.\"";
+ next;
+ goto L_Magic_main;
+
+L_Magic_purify_lacking:
+ mes "[Wyara the Witch]";
+ mes "\"You'll need twenty mauve leaves and twenty maggot slimes for the potion.\"";
+ next;
+ goto L_Magic_main;
+
+L_Magic_purify_once:
+ mes "[Wyara the Witch]";
+ mes "Wyara nods.";
+ mes "\"You have purified the pond a little, but not enough, I think. We'll need another potion.\"";
+ next;
+
+ if (countitem("PurificationPotion"))
+ goto L_Magic_purify_doit2;
+
+ mes "[Wyara the Witch]";
+ mes "\"I'll need twenty more maggot slimes and leaves of mauve.\"";
+ next;
+
+ menu
+ "I'll do that later.", L_Main,
+ "No way.", L_Main,
+ "Here you are.", -;
+ getinventorylist;
+ if ((@inventorylist_count == 100) && (countitem("MauveHerb") > 20) && (countitem("MaggotSlime") > 20))
+ goto L_Magic_purify_nospace;
+
+ if (countitem("MauveHerb") < 20)
+ goto L_Magic_purify_lacking;
+ if (countitem("MaggotSlime") < 20)
+ goto L_Magic_purify_lacking;
+
+ delitem "MauveHerb", 20;
+ delitem "MaggotSlime", 20;
+ getitem "PurificationPotion", 1;
+ mes "[Wyara the Witch]";
+ mes "\"Wyara brews another purification potion.\"";
+ next;
+L_Magic_purify_doit2:
+ mes "[Wyara the Witch]";
+ mes "\"Please apply this one quickly, again.\"";
+ next;
+ close;
+
+L_Magic_purify_done:
+ mes "[Wyara the Witch]";
+ mes "Wyara smiles at you.";
+ mes "\"A friend told me... you have saved the pond for now. Perhaps it will need some more attention later, but I'll ask others for this.\"";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "\"Please sit down and touch the ground.\"";
+ next;
+
+ menu
+ "Very well.", -,
+ "No way!", L_Magic_purify_abort;
+
+ mes "[Wyara the Witch]";
+ mes "You sit down and touch the ground, and so does Wyara.";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "You sense the earth, through the floor boards, and begin to feel one with it, as if you were a plant or rock.";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "The gentle breeze coming in through the window begins to take on a very different quality, as if it were the gentle caress of a mother soothing her child.";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "You can sense the water within the ground, and from it you sense your sisters and brothers, plants, animals, people...";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "Slowly, the sensation recedes, but you feel changed.";
+ mes "[5000 experience points]";
+ mes "[Level 2 in Nature Magic]";
+
+ getexp 5000, 0;
+ if (getskilllv(SKILL_MAGIC_NATURE) < 2)
+ setskill SKILL_MAGIC_NATURE, 2;
+ set @Q_status, @STATUS_PURIFY_OVER;
+ callsub S_update_var;
+ close;
+
+L_Magic_purify_abort:
+ mes "[Wyara the Witch]";
+ mes "\"I can't help you if you don't subject yourself to the ritual.\"";
+ next;
+ close;
+
+L_Magic_train_no:
+ mes "[Wyara the Witch]";
+ mes "\"I can't teach you anything at this time. Perhaps Sagatha can help you, but I'm not sure if she will accept you as a student.\"";
+ next;
+
+L_Magic_train_sagatha:
+ menu
+ "OK.", L_Magic_main,
+ "How can I convince her to accept me?", -;
+
+ callfunc "SagathaStatus";
+ mes "[Wyara the Witch]";
+ if (@evil)
+ L_Magic_train_sagatha_fail;
+
+ if (getskilllv(SKILL_MAGIC) < 2)
+ goto L_Magic_train_sagatha_lvl1;
+
+ if (@good > 1)
+ mes "\"Come to think of it, I have heard good things about you. Perhaps she will be willing to accept you as a student now?\"";
+ if (@good == 1)
+ mes "\"I have heard some good things about you, but I'm not sure if it will be enough to sway her-- she is hesitant to accept students.\"";
+ if (@good == 0)
+ mes "\"Sagatha cares greatly about all living creatures, but particularly about the creatures of the forest. If you are kind to them, she will be more likely to be kind to you.\"";
+ next;
+
+ if (@druid == 3)
+ goto L_Magic_main;
+
+ mes "[Wyara the Witch]";
+ mes "She smiles.";
+ mes "\"Actually, I think I know of a good thing you could do. There is a very special tree in the desert south-east of Tulimshar, a tree that has been there for a very long time.\"";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "\"The tree is slowly dying-- and has been for a long time-- but it is there because of a wonderful thing that happened long ago. Tend to it, and I am sure that she will learn about this.\"";
+ next;
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_DRUIDTREE;
+
+ menu
+ "What is that tree?", L_Magic_train_tree_backgd,
+ "How should I tend to it?", -,
+ "Nah.", L_Magic_main;
+
+ mes "[Wyara the Witch]";
+ mes "\"The tree has been there alone and unattended for a long time; what he needs most is water and affection. Give him both.\"";
+ next;
+ goto L_Magic_main;
+
+L_Magic_train_tree_backgd:
+ mes "[Wyara the Witch]";
+ mes "\"Many generations ago, there was a lush, green oasis in the desert south-east of Tulimshar. Plants of all kinds grew there, and many animals, including mouboos, made this place their home.\"";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "\"Then there came war, and some people pleaded to the demon Grenxen. He founded Tulimshar, and to provide it with water he changed the underground waterflow. The oasis began to dry out quickly.\"";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "\"But the oasis, like many such places back in the old days, had a druid watching over it. The druid refused to accept what Grenxen had done, but he was powerless to revert or change it.\"";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "\"All he could do was to delay the inevitable, to give the animals and nomads some time to adapt.\"";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "\"But to do so, he had to reach the water streams deep underground. Thus, he turned himself into a tree, a deep-rooted fyrad, so that his roots could reach underground.\"";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "\"He had to exert himself tremendously; he had to grow deep, quickly; I believe that no druid or witch has summoned such magic before or since. But he succeeded, and for a while he saved the oasis.\"";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "\"Many generations he remained the only one ever to have successfully defied Grenxen, but this came at a price: he had to remain a tree, and he never turned back.\"";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "\"I believe that he has not forgotten his old magic, because even though a tree remembers many things for a very long time, trees are not keen to change things, not even themselves.\"";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "\"Now he stands alone in the desert, dried-up and forgotten, with no-one remembering him.\"";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "\"Please give him water, for he is always in need of it, and thank him for his sacrifice. It is all we can do for him now.\"";
+ next;
+
+L_Magic_tree_menu:
+ menu
+ "How should I give him water?", L_Magic_tree_water,
+ "How should I thank him?", L_Magic_tree_remind,
+ "I will.", -,
+ "No.", -;
+ goto L_Magic_main;
+
+L_Magic_tree_water:
+ mes "[Wyara the Witch]";
+ mes "\"A bottle of water would probably not be enough. No, you would have to water the ground all around... that's too many bottles. You will have to get water from elsewhere.\"";
+ next;
+ goto L_Magic_tree_menu;
+
+L_Magic_tree_remind:
+ mes "[Wyara the Witch]";
+ mes "\"Give him a sign of affection. Something that works with a tree, but also something that humans might do to each other, to remind him of his days as a human.\"";
+ next;
+
+ mes "[Wyara the Witch]";
+ mes "\"Yes... that would be important. Show your affection in the same way that you might towards a human.\"";
+ next;
+ goto L_Magic_tree_menu;
+
+L_Magic_train_sagatha_fail:
+ mes "She shakes her head.";
+ mes "\"No... from what I have heard, you have done something unforgivable. I very much doubt that you can be her student now, and I won't teach you any further either.\"";
+ next;
+ goto L_Magic_main;
+
+L_Magic_train_sagatha_lvl1:
+ mes "\"Well, you're still a bit of a beginner, so I don't think she will accept you yet. Maybe you can absorb some more power from the mana seed? If you can grow your magical powers a little, I might be able to help you.\"";
+ next;
+ goto L_Magic_main;
+
+S_update_var:
+ set QUEST_MAGIC2,
+ (QUEST_MAGIC2 & ~(@Q_MASK)
+ | (@Q_status << @Q_SHIFT));
+ return;
+}
diff --git a/npc/009-3_Cave_beneath_Hurnscald/_import.txt b/npc/009-3_Cave_beneath_Hurnscald/_import.txt
index 0297260b..6a2a2a8e 100644
--- a/npc/009-3_Cave_beneath_Hurnscald/_import.txt
+++ b/npc/009-3_Cave_beneath_Hurnscald/_import.txt
@@ -2,3 +2,4 @@ map: 009-3.gat
npc: npc/009-3_Cave_beneath_Hurnscald/_mobs.txt
npc: npc/009-3_Cave_beneath_Hurnscald/_warps.txt
npc: npc/009-3_Cave_beneath_Hurnscald/monsters.txt
+npc: npc/009-3_Cave_beneath_Hurnscald/sword.txt
diff --git a/npc/009-3_Cave_beneath_Hurnscald/sword.txt b/npc/009-3_Cave_beneath_Hurnscald/sword.txt
new file mode 100644
index 00000000..2b5c5f75
--- /dev/null
+++ b/npc/009-3_Cave_beneath_Hurnscald/sword.txt
@@ -0,0 +1,189 @@
+009-3.gat,26,100,0 script #MysticSword#_M 127,{
+ if (getskilllv(SKILL_MAGIC))
+ goto L_message;
+ close;
+
+L_message:
+ set @Q_MASK, NIBBLE_6_MASK;
+ set @Q_SHIFT, NIBBLE_6_SHIFT;
+ set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
+
+ set @STATUS_INITIAL, 0;
+ set @STATUS_LEARNED_FLAREDART, 1;
+ set @STATUS_LEARNED_MAGICBLADE, 2;
+ set @STATUS_LEVEL2, 3;
+ set @STATUS_W11, 4;
+ set @STATUS_W12, 5;
+ set @STATUS_W11_12, 6;
+ set @STATUS_L2_ALLSPELLS, 7;
+
+ if (@Q_status == @STATUS_INITIAL) goto L_Initial;
+ if (@Q_status == @STATUS_LEARNED_FLAREDART) goto L_PostFlareDart;
+ if (@Q_status == @STATUS_LEARNED_MAGICBLADE) goto L_PostFlareDart_teach2;
+ if (@Q_status == @STATUS_LEVEL2) goto L_L2_W11;
+ if (@Q_status == @STATUS_W12) goto L_L2_W11;
+ if (@Q_status == @STATUS_W11) goto L_L2_almost_done;
+ if (@Q_status == @STATUS_W11_12) goto L_L2_almost_done;
+
+ mes "[Magic Sword]";
+ mes "\"Come back when thou art stronger.\"";
+ next;
+ close;
+
+L_Initial:
+ mes "[Magic Sword]";
+ mes "As you look at the sword, you suddenly hear a voice in your head!";
+ mes "\"Welcome to my prison, mortal!\"";
+ next;
+
+ mes "[Magic Sword]";
+ mes "Well, either you are going mad, or that sword in the stone is talking to you.";
+ next;
+
+ mes "[Magic Sword]";
+ mes "Or, well, both.";
+ next;
+
+ mes "[Magic Sword]";
+ mes "The deep basso voice continues.";
+ mes "\"I know not what brought thee hither, but I kindly ask that thou leavest me alone in my sorrow.\"";
+ next;
+
+ menu
+ "Leave", L_Close,
+ "Sorry.", -,
+ "Who or what are you?", -,
+ "What sorrow?", -,
+ "Can I help?", -,
+ "Can you teach me magic?", -;
+
+ mes "[Magic Sword]";
+ mes "There is no answer.";
+ next;
+ close;
+
+L_PostFlareDart:
+ mes "[Magic Sword]";
+ mes "As you look at the sword, you hear a deep voice resounding in your head.";
+ mes "\"Welcome, mortal!\"";
+ next;
+
+ menu
+ "Hi! How are you?", L_PostFlareDart_hi,
+ "Can you teach me magic?", L_PostFlareDart_teach,
+ "Your sister sent me.", L_PostFlareDart_sister,
+ "Bye!", -;
+ close;
+
+L_PostFlareDart_hi:
+ mes "[Magic Sword]";
+ mes "\"Mortal... I have seen pain and death beyond thine reckoning! Mock me not with thine idle questions!\"";
+ next;
+ close;
+
+L_PostFlareDart_sister:
+ mes "[Magic Sword]";
+ mes "\"My sister...? Alas! I remember now; abandoned she was, just as I; buried in stone, never to be wielded again.\"";
+ mes "\"Wherefore did she send thee?\"";
+ next;
+
+ menu "She asked me to ask you to teach me a spell.", -;
+
+L_PostFlareDart_teach:
+ mes "[Magic Sword]";
+ mes "\"Beware, mortal... the only spells I can teach thee are those of the school of war. Dark and dreary spells, that lot! Pain and misery is all they bring...\"";
+ next;
+
+ mes "[Magic Sword]";
+ mes "The sword's voice is growing apprehensive.";
+ mes "\"Once a spell has been learned, it cannot be taken back, no more than a death can be undone. So be careful, mortal... dost thou truly wish to know the secrets of thus destructive power?\"";
+ next;
+
+ menu
+ "Yes.", -,
+ "No.", L_Close;
+
+ mes "[Magic Sword]";
+ mes "\"So thou art bound to the path of War, as am I, as is my sister...\"";
+ next;
+
+ mes "[Magic Sword]";
+ mes "\"So be it, fellow warrior. Hear the incantation for the blade spell: '" + getspellinvocation("magic-blade") + "'\"";
+ mes "\"Hold a knife, sharp or regular, when thou speakest it.\"";
+ set @Q_status, @STATUS_LEARNED_MAGICBLADE;
+ callsub S_update_var;
+ next;
+
+ mes "[Magic Sword]";
+ mes "\"But beware... the path of war that thou hast embarked upon is one from which few return. May luck be on thy side...\"";
+ next;
+ close;
+
+L_PostFlareDart_teach2:
+ mes "[Magic Sword]";
+ mes "\"Seek out my sister, and leave me alone in my sorrows.\"";
+ next;
+
+L_Close:
+ close;
+
+L_L2_W11:
+ mes "[Magic Sword]";
+ mes "\"Thou hast returned. That must mean that thy wish to learn the magic of war is still alive?\"";
+ next;
+ menu
+ "No, I just wanted to say `hi'.", L_sayhi,
+ "Yes, teach me more!", -;
+
+ mes "[Magic Sword]";
+ mes "\"If that is thou wishest, I shall not stop thee. But do not expect to find merriment down this road.\"";
+ mes "\"I must ask that thou sacrificest five thousand monster points for this, however.\"";
+ menu
+ "No, I don't want that.", L_farewell,
+ "Very well.", -;
+
+ if (Mobpt < 5000) goto L_lacking_mobpoints;
+
+ mes "[Magic Sword]";
+ mes "\"So be it, then.\"";
+ mes "[1000 experience points]";
+ set Mobpt, Mobpt - 5000;
+ getexp 1000, 0;
+ set @Q_status, @Q_status + 1;
+ callsub S_update_var;
+ next;
+
+ mes "[Magic Sword]";
+ mes "\"The spell I shall teach thee is the hail of arrows spell. It will make arrows fall down from the heavens unto thy enemies.\"";
+ next;
+
+ mes "[Magic Sword]";
+ mes "\"Take twenty arrows, sprinkle sulphur powder over them, and then speak '" + getspellinvocation("arrow-hail") + "'. Throw them high up in the air, and watch the hail unfold before thy feet.\"";
+ next;
+ close;
+
+
+L_L2_almost_done:
+ mes "[Magic Sword]";
+ mes "\"Return to my sister now. I expect that she shall teach thee one more spell.\"";
+ next;
+ close;
+
+L_lacking_mobpoints:
+ mes "[Magic Sword]";
+ mes "\"Thou lackest the monster points needed to prove thy worthiness. I shall not reveal more to thee until thou hast slain more monsters.\"";
+ next;
+ close;
+
+L_sayhi:
+ mes "[Magic Sword]";
+ mes "\"Please leave me in peace.\"";
+ next;
+ close;
+
+S_update_var:
+ set QUEST_MAGIC,
+ (QUEST_MAGIC & ~(@Q_MASK)
+ | (@Q_status << @Q_SHIFT));
+ return;
+}
diff --git a/npc/010-2_Dimonds_Cove/doug.txt b/npc/010-2_Dimonds_Cove/doug.txt
index 34dbb609..0caa0da0 100644
--- a/npc/010-2_Dimonds_Cove/doug.txt
+++ b/npc/010-2_Dimonds_Cove/doug.txt
@@ -3,7 +3,7 @@
010-2.gat,68,87,0 script Doug 113,{
if(CaveSnakeLamp == 1) goto L_State2;
if(CaveSnakeLamp == 2) goto L_Done;
- set @TEMP,rand(4);
+ set @TEMP, rand(4);
if(@TEMP == 0) goto L_0;
if(@TEMP == 1) goto L_1;
if(@TEMP == 2) goto L_2;
@@ -40,7 +40,7 @@ L_Question:
L_Sure:
set CaveSnakeLamp, 1;
- set @TEMP,rand(4);
+ set @TEMP, rand(4);
if(@TEMP == 0) goto J_0;
if(@TEMP == 1) goto J_1;
if(@TEMP == 2) goto J_2;
@@ -76,13 +76,13 @@ L_Go:
close;
L_State2:
- if(countitem(612) >= 40) goto L_Have;
+ if(countitem("CaveSnakeLamp") >= 40) goto L_Have;
mes "[Doug]";
mes "\"Please help me collect 40 [Cave Snake Lamps]!\"";
close;
L_Have:
- delitem 612, 40;
+ delitem "CaveSnakeLamp", 40;
mes "[Doug]";
mes "\"Cool! Now I can make this light!\"";
next;
diff --git a/npc/010-2_Dimonds_Cove/loratay.txt b/npc/010-2_Dimonds_Cove/loratay.txt
index 77336fb6..f2350a4c 100644
--- a/npc/010-2_Dimonds_Cove/loratay.txt
+++ b/npc/010-2_Dimonds_Cove/loratay.txt
@@ -1,9 +1,5 @@
010-2.gat,85,85,0 script Lora Tay 151,{
- set @COTTON, 660;
- set @SILK_COCOON, 718;
-
- set @SILK_ROBE, 720;
set @ROBE_COCOONS_NR, 150; // must be multiple of ten
set @ROBE_ZENY, 10000;
@@ -244,7 +240,7 @@ L_main_menu:
L_desert_hat:
mes "[Lora Tay the Seamstress]";
mes "The seamstress sighs.";
- mes "\"One of these days it would be nice to have an actual challenge... yes, of course I can make a desert hat. A cotton headband, three pieces of cotton cloth. Hmm. And let's add 300 GP to that.\"";
+ mes "\"One of these days it would be nice to have an actual challenge... yes, of course I can make a desert hat. A [Cotton headband], three pieces of [cotton cloth]. Hmm. And let's add 300 GP to that.\"";
next;
set @default_choice$, "Never mind.";
@@ -262,13 +258,13 @@ L_desert_hat:
if (countitem(@item) < 1)
goto L_desert_hat_noheadband;
- if (countitem(@COTTON) < 3)
+ if (countitem("CottonCloth") < 3)
goto L_desert_hat_nocotton;
if (zeny < 300)
goto L_desert_hat_nogp;
delitem @item, 1;
- delitem @COTTON, 3;
+ delitem "CottonCloth", 3;
set zeny, zeny - 300;
getitem @genitem, 1;
mes "[Lora Tay the Seamstress]";
@@ -350,7 +346,7 @@ L_trim_nozeny:
L_lengthen:
mes "[Lora Tay the Seamstress]";
- mes "\"Naturally, I will need a piece of cotton to sew onto it; I must also charge you some... hmm... does 500 GP sound reasonable? Yes, I think I shall charge that.\"";
+ mes "\"Naturally, I will need a piece of [cotton cloth] to sew onto it; I must also charge you some... hmm... does 500 GP sound reasonable? Yes, I think I shall charge that.\"";
mes "\"Now, let me see. What is it that you want lengthened?\"";
next;
@@ -372,10 +368,10 @@ L_lengthen:
if (@genitem == 0) goto L_lengthen_impossible;
if (zeny < 500) goto L_lengthen_nozeny;
- if (countitem (@COTTON) < 1) goto L_lengthen_nocotton;
+ if (countitem ("CottonCloth") < 1) goto L_lengthen_nocotton;
delitem @delitem, 1;
- delitem @COTTON, 1;
+ delitem "CottonCloth", 1;
getitem @genitem, 1;
set zeny, zeny - 500;
mes "[Lora Tay the Seamstress]";
@@ -422,18 +418,18 @@ L_tanktop:
L_tanktop_menu:
menu "I think I would like something else.", L_main_menu,
- "A tank top, please (6 cotton)", L_tanktop_long,
- "A short tank top, please (5 cotton)", L_tanktop_short,
+ "A tank top, please (6 [cotton cloth])", L_tanktop_long,
+ "A short tank top, please (5 [cotton cloth])", L_tanktop_short,
"Goodbye for now.", L_end;
L_tanktop_short:
- if (countitem (@COTTON) < 5) goto L_tanktop_insufficient_cloth;
+ if (countitem ("CottonCloth") < 5) goto L_tanktop_insufficient_cloth;
if (zeny < 1000) goto L_tanktop_insufficient_zeny;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(@COTTON) > 5) goto L_TooMany;
+ if (@inventorylist_count == 100 && countitem("CottonCloth") > 5) goto L_TooMany;
set zeny, zeny - 1000;
- delitem @COTTON, 5;
- getitem 689, 1;
+ delitem "CottonCloth", 5;
+ getitem "WhiteShortTankTop", 1;
mes "[Lora Tay the Seamstress]";
mes "You watch as Lora sews the pieces of cloth together, then flattens the seams and ends with some odd liquid.";
mes "Amazingly, the result looks like a single piece of cloth.";
@@ -443,13 +439,13 @@ L_tanktop_short:
goto L_tanktop_menu;
L_tanktop_long:
- if (countitem (@COTTON) < 6) goto L_tanktop_insufficient_cloth;
+ if (countitem ("CottonCloth") < 6) goto L_tanktop_insufficient_cloth;
if (zeny < 1000) goto L_tanktop_insufficient_zeny;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(@COTTON) > 6) goto L_TooMany;
+ if (@inventorylist_count == 100 && countitem("CottonCloth") > 6) goto L_TooMany;
set zeny, zeny - 1000;
- delitem @COTTON, 6;
- getitem 688, 1;
+ delitem "CottonCloth", 6;
+ getitem "WhiteTankTop", 1;
mes "[Lora Tay the Seamstress]";
mes "After combining your pieces of cloth into one-- miraculously making the seams and stitches vanish-- the seamstress cuts out all that doesn't belong into a tank top, then folds and stabilises the edges with additional seam lines.";
mes "\"There you are. Don't worry, I have trimmed it to match your size perfectly.\"";
@@ -458,7 +454,7 @@ L_tanktop_long:
L_tanktop_insufficient_cloth:
mes "[Lora Tay the Seamstress]";
- mes "\"No, no, no, count again-- how much cloth did I say I needed? That's not enough.\"";
+ mes "\"No, no, no, count again-- how much [cotton cloth] did I say I needed? That's not enough.\"";
next;
goto L_tanktop_menu;
@@ -482,7 +478,7 @@ L_robe:
mes "\"A robe? Well, as long as you're not asking me to make it out of cotton...\"";
next;
- if (countitem(@SILK_COCOON) == 0)
+ if (countitem("SilkCocoon") == 0)
goto L_robe_nosilk;
L_robe_menu:
@@ -494,7 +490,7 @@ L_robe_menu:
mes "[Lora Tay the Seamstress]";
mes "The seamstress stares at you as if you had gone out of your mind.";
- mes "\"And what precisely do you expect me to do with silk cocoons? String them together in some baubly chain? Somehow remove the thread and spin and weave it so that some random person can have their robe?\"";
+ mes "\"And what precisely do you expect me to do with [silk cocoons]? String them together in some baubly chain? Somehow remove the thread and spin and weave it so that some random person can have their robe?\"";
next;
menu "Will you trade cocoons for sheets?", -,
@@ -517,18 +513,18 @@ L_robe_menu:
menu "I'm not interested.", L_main_menu,
"Very well then, here you are.", -;
- if (countitem(@SILK_COCOON) < @ROBE_COCOONS_NR)
+ if (countitem("SilkCocoon") < @ROBE_COCOONS_NR)
goto L_robe_missing_cocoons;
if (zeny < @ROBE_ZENY)
goto L_robe_missing_zeny;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(@SILK_COCOON) > @ROBE_COCOONS_NR) goto L_TooMany;
+ if (@inventorylist_count == 100 && countitem("SilkCocoon") > @ROBE_COCOONS_NR) goto L_TooMany;
set zeny, zeny - @ROBE_ZENY;
- delitem @SILK_COCOON, @ROBE_COCOONS_NR;
- getitem @SILK_ROBE, 1;
+ delitem "SilkCocoon", @ROBE_COCOONS_NR;
+ getitem "SilkRobe", 1;
mes "[Lora Tay the Seamstress]";
mes "The seamstress puts your cocoons and GP away, takes your measurements and pulls out several silk sheets. She asks you to stretch out your arms, then pins the silk sheets in place all over your body.";
next;
@@ -551,7 +547,7 @@ L_robe_menu:
L_robe_missing_cocoons:
mes "[Lora Tay the Seamstress]";
- mes "\"" + @ROBE_COCOONS_NR + " cocoons is what I said, not " + countitem(@SILK_COCOON) + ".";
+ mes "\"" + @ROBE_COCOONS_NR + " cocoons is what I said, not " + countitem("SilkCocoon") + ".";
mes @ROBE_COCOONS_NR + " is " + (@ROBE_COCOONS_NR / 10) + " as many times as you have fingers, in case that helps.\"";
next;
goto L_main_menu;
diff --git a/npc/011-1_Woodland/_import.txt b/npc/011-1_Woodland/_import.txt
index ce529acf..3e18f94e 100644
--- a/npc/011-1_Woodland/_import.txt
+++ b/npc/011-1_Woodland/_import.txt
@@ -2,5 +2,6 @@ map: 011-1.gat
npc: npc/011-1_Woodland/_mobs.txt
npc: npc/011-1_Woodland/_warps.txt
npc: npc/011-1_Woodland/alchemist.txt
+npc: npc/011-1_Woodland/auldsbel.txt
npc: npc/011-1_Woodland/monsters.txt
npc: npc/011-1_Woodland/oscar.txt
diff --git a/npc/011-1_Woodland/alchemist.txt b/npc/011-1_Woodland/alchemist.txt
index e66ec84d..6564a3df 100644
--- a/npc/011-1_Woodland/alchemist.txt
+++ b/npc/011-1_Woodland/alchemist.txt
@@ -9,18 +9,11 @@
set @Q_MASK, NIBBLE_3_MASK;
set @Q_SHIFT, NIBBLE_3_SHIFT;
+ set @wants_sulphur, (QUEST_MAGIC & (NIBBLE_6_MASK | NIBBLE_7_MASK));
+ set @wants_ironpowder, (((QUEST_MAGIC & (NIBBLE_6_MASK | NIBBLE_7_MASK)) >> NIBBLE_6_SHIFT) >= 7);
set @Q_status, (QUEST_Forestbow_state & @Q_MASK) >> @Q_SHIFT;
// End of Setzer quest/monster oil quest participation
- set @RED, 683;
- set @YELLOW, 682;
- set @BLUE, 681;
- set @MAUVE, 680;
- set @PETAL, 565;
- set @PEARL, 700;
- set @ORE, 640;
- set @MAGGOTSLIME, 505;
-
set @QUEST_CAN_GET_DYE_HERE, 2;
set @QUEST_HAS_SOLVED_DYE_PUZZLE, 3;
set @QUEST_GUESS_BASE, 4;
@@ -30,9 +23,12 @@
set @CHOICE_DYEING_INTRO, 2;
set @CHOICE_DYE, 3;
set @CHOICE_MONSTER_OIL, 4;
- set @CHOICE_ABORT, 5;
+ set @CHOICE_MANA_POTION, 5;
+ set @CHOICE_SULPHUR_POWDER, 6;
+ set @CHOICE_IRON_POWDER, 7;
+ set @CHOICE_ABORT, 8;
- setarray @menuitems$, "", "", "", "", "";
+ setarray @menuitems$, "", "", "", "", "", "", "", "";
set @c, 0;
set @menuitems$[@c], "Iron potion.";
@@ -43,6 +39,13 @@
set @menuID[@c], @CHOICE_CONCENTRATION;
set @c, @c + 1;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_MANAPOTION))
+ goto L_post_mana_potion_c;
+ set @menuitems$[@c], "Mana potion.";
+ set @menuID[@c], @CHOICE_MANA_POTION;
+ set @c, @c + 1;
+L_post_mana_potion_c:
+
if (QUEST_clothdyer_knowsdye >= @QUEST_CAN_GET_DYE_HERE)
goto L_skip_introducing;
@@ -70,30 +73,49 @@ L_skip_introducing:
set @c, @c + 1;
goto L_certain_condition;
-
L_pre_dyeing:
+
set @menuitems$[@c], "Actually, can you make dye?";
set @menuID[@c], @CHOICE_DYEING_INTRO;
set @c, @c + 1;
-
L_certain_condition:
+
+ if (!@wants_sulphur)
+ goto L_post_sulphur_option;
+ set @menuitems$[@c], "Can you make sulphur powder?";
+ set @menuID[@c], @CHOICE_SULPHUR_POWDER;
+ set @c, @c + 1;
+L_post_sulphur_option:
+
+ if (!@wants_ironpowder)
+ goto L_post_ironpowder_option;
+ set @menuitems$[@c], "Can you make iron powder?";
+ set @menuID[@c], @CHOICE_IRON_POWDER;
+ set @c, @c + 1;
+L_post_ironpowder_option:
+
if (@Q_status == @SETZER_INITIAL)
- goto L_main_menu;
+ goto L_post_monster_oil;
set @menuitems$[@c], "Can you make monster oil?";
set @menuID[@c], @CHOICE_MONSTER_OIL;
set @c, @c + 1;
-L_main_menu:
+L_post_monster_oil:
set @menuitems$[@c], "No thanks.";
set @menuID[@c], @CHOICE_ABORT;
set @c, @c + 1;
+L_main_menu:
+
menu
@menuitems$[0], -,
@menuitems$[1], -,
@menuitems$[2], -,
@menuitems$[3], -,
- @menuitems$[4], -;
+ @menuitems$[4], -,
+ @menuitems$[5], -,
+ @menuitems$[6], -,
+ @menuitems$[7], -;
set @menu, @menu - 1;
@@ -103,36 +125,202 @@ L_main_menu:
if (@menuID[@menu] == @CHOICE_DYEING_INTRO) goto L_dyeing_intro;
if (@menuID[@menu] == @CHOICE_DYE) goto L_pick_colour;
if (@menuID[@menu] == @CHOICE_MONSTER_OIL) goto L_monster_oil;
+ if (@menuID[@menu] == @CHOICE_MANA_POTION) goto L_mana_potion;
+ if (@menuID[@menu] == @CHOICE_SULPHUR_POWDER) goto L_sulphur;
+ if (@menuID[@menu] == @CHOICE_IRON_POWDER) goto L_iron_powder;
if (@menuID[@menu] == @CHOICE_ABORT) goto L_abort;
+ goto L_abort;
+
+L_iron_powder:
+ mes "[Rauk the Alchemist]";
+ mes "\"Iron powder? Hmm, I can extract some iron powder out of a chunk of iron ore, but that will require me to dissolve it. If you give me a chunk of iron ore and 100 GP for the acid, I can do it.\"";
+ next;
+ menu
+ "Never mind.", L_abort,
+ "Here you are!", -;
+
+ if (countitem("IronOre") < 1)
+ goto L_iron_powder_noore;
+ if (zeny < 100)
+ goto L_iron_powder_nozeny;
+ getinventorylist;
+ if (@inventorylist_count == 100
+ && countitem("IronOre") > 1
+ && countitem("IronPowder") < 1)
+ goto L_iron_powder_full;
+ delitem "IronOre", 1;
+ set zeny, zeny - 100;
+ getitem "IronPowder", 4;
+ mes "[Rauk the Alchemist]";
+ mes "Rauk places your chunk of ore in a strange glass container, then pours a steaming yellow liquid over it. Before your eyes, the ore dissolves.";
+ next;
+
+ mes "[Rauk the Alchemist]";
+ mes "Rauk pours another liquid over the resultant mixture, then pours the result through a piece of cloth placed in a funnel, followed by a cup of water. He removes the residual metal powder from the cloth and hands it to you.";
+ mes "\"This is about as fine as I can make it without mechanical help.\"";
+ next;
+
+ close;
+
+L_iron_powder_noore:
+ mes "[Rauk the Alchemist]";
+ mes "\"I do need a chunk of iron ore. Please return when you have one.\"";
+ next;
+ close;
+
+L_iron_powder_nozeny:
+ mes "[Rauk the Alchemist]";
+ mes "\"I'm sorry, but I must ask that you pay 100 GP-- the acid I use is not cheap.\"";
+ next;
+ close;
+
+L_iron_powder_full:
+ mes "[Rauk the Alchemist]";
+ mes "\"I don't think that you have room to carry this. Please come back later.\"";
+ next;
+ close;
+
+L_sulphur:
+ mes "[Rauk the Alchemist]";
+ mes "\"Oh, that is easy. Bring me three piles of volcanic ash and three mauve leaves, and I will extract twelve piles of sulphur ash for you.\"";
+ next;
+ menu
+ "I will be back.", L_abort,
+ "No, I won't!", L_abort,
+ "Here you are!", -;
+
+ if (countitem("PileOfAsh") < 3) goto L_sulphur_noash;
+ if (countitem("MauveHerb") < 3) goto L_sulphur_nomauve;
+ getinventorylist;
+ if (@inventorylist_count == 100
+ && countitem("SulphurPowder") == 0
+ && countitem("PileOfAsh") > 3
+ && countitem("MauveHerb") > 3)
+ goto L_sulphur_nospace;
+
+ delitem "PileOfAsh", 3;
+ delitem "MauveHerb", 3;
+ getitem "SulphurPowder", 12;
+ mes "[Rauk the Alchemist]";
+ mes "You watch Rauk burn the mauve leaves in the midst of the ashes. He then dissolves the result and pours it through a filter, finally heating up the residual liquid.";
+ next;
+ mes "[Rauk the Alchemist]";
+ mes "The water having evaporated, only some yellow powder is left over. Rauk carefully pours it into your hand.";
+ mes "\"This should be precisely twelve half-ounces of sulphur powder.\"";
+ next;
+ close;
+
+L_sulphur_noash:
+ mes "[Rauk the Alchemist]";
+ mes "\"You don't seem to have all three piles of volcanic ash.\"";
+ next;
+ close;
+
+L_sulphur_nomauve:
+ mes "[Rauk the Alchemist]";
+ mes "\"You don't seem to have the three mauve leaves I asked for.\"";
+ next;
+ close;
+
+L_sulphur_nospace:
+ mes "[Rauk the Alchemist]";
+ mes "\"Oh dear. You don't seem to be able to carry the sulphur powder.\"";
+ next;
+ close;
+
+L_mana_potion:
+ mes "[Rauk the Alchemist]";
+ mes "\"Humh... I do believe that I have a recipe somewhere. One moment...\"";
+ mes "Rauk pulls a small book out of his sleeve and leafs through it.";
+ mes "\"Aha, here we are. Hmm, I'm not convinced that this is the best possible recipe...\"";
+ next;
+ mes "[Rauk the Alchemist]";
+ mes "\"I shall need one pearl, one bottle of water, thirty mauve leaves, twenty gamboge leaves, and five piles of volcanic ash.\"";
+ next;
+
+ menu "Here you are!", L_get_mana_potion,
+ "Never mind.", L_main_menu;
+
+ goto L_main_menu;
+
+L_get_mana_potion:
+ if(countitem("MauveHerb") < 30) goto L_mana_potion_lacking;
+ if(countitem("GambogeHerb") < 20) goto L_mana_potion_lacking;
+ if(countitem("PileOfAsh") < 5) goto L_mana_potion_lacking;
+ if(countitem("Pearl") < 1) goto L_mana_potion_lacking;
+ if(countitem("BottleOfWater") < 1) goto L_mana_potion_lacking;
+ getinventorylist;
+ if ((@inventorylist_count == 100)
+ && (countitem("MauveHerb") > 30)
+ && (countitem("PileOfAsh") > 5)
+ && (countitem("Pearl") > 1)
+ && (countitem("BottleOfWater") > 1)
+ && (countitem("ManaPotion") < 1))
+ goto L_mana_potion_toomuch;
+
+ delitem "MauveHerb", 30;
+ delitem "GambogeHerb", 20;
+ delitem "PileOfAsh", 5;
+ delitem "Pearl", 1;
+ delitem "BottleOfWater", 1;
+ getitem "ManaPotion", 1;
+
+ mes "[Rauk the Alchemist]";
+ mes "Rauk grinds the leaves, then crushes the pearl. Taking out a small charcoal oven, he heats up your water bottle and dissolves first the pearl powder, then the ashes.";
+ mes "The brew begins to bubble violently.";
+ next;
+
+ mes "[Rauk the Alchemist]";
+ mes "Taking the bottle with a pair of tongs, he pours the liquid through a fine sieve, discarding the liquid.";
+ mes "He then mixes the residual paste with the leaves, stirs in a little water from the pond and fills the result into a separate bottle.";
+ next;
+
+ mes "[Rauk the Alchemist]";
+ mes "\"Here you are. I hope that this is what you wanted.\"";
+ next;
+
+ goto L_main_menu;
+
+L_mana_potion_toomuch:
+ mes "[Rauk the Alchemist]";
+ mes "\"You look quite burdened already. Why don't you drop off a few things first, and come back later?\"";
+ next;
+ goto L_main_menu;
+
+L_mana_potion_lacking:
+ mes "[Rauk the Alchemist]";
+ mes "\"Sorry, but I need one [pearl], one [bottle of water], 30 [mauve leaves], 20 [gamboge leaves], and five piles of [volcanic ash].\"";
+ next;
+ goto L_main_menu;
L_iron:
- if(countitem(566) < 20) goto L_no_iron;
+ if(countitem("SmallMushroom") < 20) goto L_no_iron;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(566) > 20) goto L_TooMany;
+ if (@inventorylist_count == 100 && countitem("SmallMushroom") > 20) goto L_TooMany;
mes "[Rauk the Alchemist]";
mes "\"Great! You brought me exactly what I need!";
mes "Here is your Iron potion.\"";
- delitem 566,20;
- getitem 567,1;
+ delitem "SmallMushroom", 20;
+ getitem "IronPotion", 1;
close;
L_concentration:
- if(countitem(565) < 20) goto L_no_concentration;
+ if(countitem("Petal") < 20) goto L_no_concentration;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(565) > 20) goto L_TooMany;
+ if (@inventorylist_count == 100 && countitem("Petal") > 20) goto L_TooMany;
mes "[Rauk the Alchemist]";
mes "\"Great! You brought me exactly what I need!";
mes "Here is your Concentration potion.\"";
- delitem 565,20;
- getitem 568,1;
+ delitem "Petal", 20;
+ getitem "ConcentrationPotion", 1;
close;
L_no_iron:
- mes "\"You have to bring me 20 small mushrooms.\"";
+ mes "\"You have to bring me 20 [small mushrooms].\"";
close;
L_no_concentration:
- mes "\"You have to bring me 20 petals.\"";
+ mes "\"You have to bring me 20 [petals].\"";
close;
L_dyeing_intro:
@@ -262,11 +450,11 @@ L_ok:
goto L_pick_colour;
L_red:
- if (countitem(@RED) < 10) goto L_red_fail;
+ if (countitem("AlizarinHerb") < 10) goto L_red_fail;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(@RED) > 10) goto L_TooMany;
- delitem @RED, 10;
- getitem 690, 1;
+ if (@inventorylist_count == 100 && countitem("AlizarinHerb") > 10) goto L_TooMany;
+ delitem "AlizarinHerb", 10;
+ getitem "RedDye", 1;
goto L_ok;
L_red_fail:
@@ -282,11 +470,11 @@ L_d_red:
goto L_intermediate;
L_yellow:
- if (countitem(@YELLOW) < 10) goto L_yellow_fail;
+ if (countitem("GambogeHerb") < 10) goto L_yellow_fail;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(@YELLOW) > 10) goto L_TooMany;
- delitem @YELLOW, 10;
- getitem 693, 1;
+ if (@inventorylist_count == 100 && countitem("GambogeHerb") > 10) goto L_TooMany;
+ delitem "GambogeHerb", 10;
+ getitem "YellowDye", 1;
goto L_ok;
L_yellow_fail:
@@ -302,11 +490,11 @@ L_d_yellow:
goto L_intermediate;
L_light_blue:
- if (countitem(@BLUE) < 10) goto L_light_blue_fail;
+ if (countitem("CobaltHerb") < 10) goto L_light_blue_fail;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(@BLUE) > 10) goto L_TooMany;
- delitem @BLUE, 10;
- getitem 694, 1;
+ if (@inventorylist_count == 100 && countitem("CobaltHerb") > 10) goto L_TooMany;
+ delitem "CobaltHerb", 10;
+ getitem "LightBlueDye", 1;
goto L_ok;
L_light_blue_fail:
@@ -322,15 +510,15 @@ L_d_light_blue:
goto L_intermediate;
L_green:
- if (countitem(@BLUE) < 20) goto L_green_fail;
- if (countitem(@YELLOW) < 20) goto L_green_fail;
+ if (countitem("CobaltHerb") < 20) goto L_green_fail;
+ if (countitem("GambogeHerb") < 20) goto L_green_fail;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(@BLUE) > 20 && countitem(@YELLOW) > 20) goto L_TooMany;
+ if (@inventorylist_count == 100 && countitem("CobaltHerb") > 20 && countitem("GambogeHerb") > 20) goto L_TooMany;
if (zeny < 1000) goto L_green_fail;
- delitem @BLUE, 20;
- delitem @YELLOW, 20;
+ delitem "CobaltHerb", 20;
+ delitem "GambogeHerb", 20;
set zeny, zeny - 1000;
- getitem 691, 1;
+ getitem "GreenDye", 1;
goto L_ok;
L_green_fail:
@@ -351,17 +539,17 @@ L_d_green:
goto L_intermediate;
L_orange:
- if (countitem(@RED) < 10) goto L_orange_fail;
- if (countitem(@YELLOW) < 10) goto L_orange_fail;
- if (countitem(@ORE) < 2) goto L_orange_fail;
+ if (countitem("AlizarinHerb") < 10) goto L_orange_fail;
+ if (countitem("GambogeHerb") < 10) goto L_orange_fail;
+ if (countitem("IronOre") < 2) goto L_orange_fail;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(@RED) > 10 && countitem(@YELLOW) > 10 && countitem(@ORE) > 2) goto L_TooMany;
+ if (@inventorylist_count == 100 && countitem("AlizarinHerb") > 10 && countitem("GambogeHerb") > 10 && countitem("IronOre") > 2) goto L_TooMany;
if (zeny < 1000) goto L_orange_fail;
- delitem @RED, 10;
- delitem @YELLOW, 10;
- delitem @ORE, 2;
+ delitem "AlizarinHerb", 10;
+ delitem "GambogeHerb", 10;
+ delitem "IronOre", 2;
set zeny, zeny - 1000;
- getitem 697, 1;
+ getitem "OrangeDye", 1;
goto L_ok;
L_orange_fail:
@@ -378,15 +566,15 @@ L_d_orange:
goto L_intermediate;
L_pink:
- if (countitem(@RED) < 10) goto L_pink_fail;
- if (countitem(@PETAL) < 6) goto L_pink_fail;
+ if (countitem("AlizarinHerb") < 10) goto L_pink_fail;
+ if (countitem("Petal") < 6) goto L_pink_fail;
if (zeny < 1000) goto L_pink_fail;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(@RED) > 10 && countitem(@PETAL) > 6) goto L_TooMany;
- delitem @RED, 10;
- delitem @PETAL, 6;
+ if (@inventorylist_count == 100 && countitem("AlizarinHerb") > 10 && countitem("Petal") > 6) goto L_TooMany;
+ delitem "AlizarinHerb", 10;
+ delitem "Petal", 6;
set zeny, zeny - 1000;
- getitem 695, 1;
+ getitem "PinkDye", 1;
goto L_ok;
L_pink_fail:
@@ -403,17 +591,17 @@ L_d_pink:
goto L_intermediate;
L_dark_blue:
- if (countitem(@BLUE) < 100) goto L_dark_blue_fail;
- if (countitem(@MAUVE) < 50) goto L_dark_blue_fail;
- if (countitem(@PEARL) < 1) goto L_dark_blue_fail;
+ if (countitem("CobaltHerb") < 100) goto L_dark_blue_fail;
+ if (countitem("MauveHerb") < 50) goto L_dark_blue_fail;
+ if (countitem("Pearl") < 1) goto L_dark_blue_fail;
if (zeny < 10000) goto L_dark_blue_fail;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(@BLUE) > 100 && countitem(@MAUVE) > 50 && countitem(@PEARL) > 1) goto L_TooMany;
- delitem @BLUE, 100;
- delitem @MAUVE, 50;
- delitem @PEARL, 1;
+ if (@inventorylist_count == 100 && countitem("CobaltHerb") > 100 && countitem("MauveHerb") > 50 && countitem("Pearl") > 1) goto L_TooMany;
+ delitem "CobaltHerb", 100;
+ delitem "MauveHerb", 50;
+ delitem "Pearl", 1;
set zeny, zeny - 10000;
- getitem 692, 1;
+ getitem "DarkBlueDye", 1;
goto L_ok;
L_dark_blue_fail:
@@ -431,19 +619,19 @@ L_d_dark_blue:
goto L_intermediate;
L_purple:
- if (countitem(@BLUE) < 100) goto L_purple_fail;
- if (countitem(@RED) < 100) goto L_purple_fail;
- if (countitem(@MAUVE) < 20) goto L_purple_fail;
- if (countitem(@PEARL) < 1) goto L_purple_fail;
+ if (countitem("CobaltHerb") < 100) goto L_purple_fail;
+ if (countitem("AlizarinHerb") < 100) goto L_purple_fail;
+ if (countitem("MauveHerb") < 20) goto L_purple_fail;
+ if (countitem("Pearl") < 1) goto L_purple_fail;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(@BLUE) > 100 && countitem(@RED) > 100 && countitem(@MAUVE) > 20 && countitem(@PEARL) > 1) goto L_TooMany;
+ if (@inventorylist_count == 100 && countitem("CobaltHerb") > 100 && countitem("AlizarinHerb") > 100 && countitem("MauveHerb") > 20 && countitem("Pearl") > 1) goto L_TooMany;
if (zeny < 40000) goto L_purple_fail;
- delitem @BLUE, 100;
- delitem @RED, 100;
- delitem @MAUVE, 20;
- delitem @PEARL, 1;
+ delitem "CobaltHerb", 100;
+ delitem "AlizarinHerb", 100;
+ delitem "MauveHerb", 20;
+ delitem "Pearl", 1;
set zeny, zeny - 40000;
- getitem 698, 1;
+ getitem "PurpleDye", 1;
goto L_ok;
L_purple_fail:
@@ -464,19 +652,19 @@ L_d_purple:
goto L_intermediate;
L_black:
- if (countitem(@BLUE) < 40) goto L_black_fail;
- if (countitem(@RED) < 40) goto L_black_fail;
- if (countitem(@YELLOW) < 40) goto L_black_fail;
- if (countitem(@MAUVE) < 40) goto L_black_fail;
+ if (countitem("CobaltHerb") < 40) goto L_black_fail;
+ if (countitem("AlizarinHerb") < 40) goto L_black_fail;
+ if (countitem("GambogeHerb") < 40) goto L_black_fail;
+ if (countitem("MauveHerb") < 40) goto L_black_fail;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(@BLUE) > 40 && countitem(@RED) > 40 && countitem(@YELLOW) > 40 && countitem(@MAUVE) > 40) goto L_TooMany;
+ if (@inventorylist_count == 100 && countitem("CobaltHerb") > 40 && countitem("AlizarinHerb") > 40 && countitem("GambogeHerb") > 40 && countitem("MauveHerb") > 40) goto L_TooMany;
if (zeny < 20000) goto L_black_fail;
- delitem @BLUE, 40;
- delitem @RED, 40;
- delitem @YELLOW, 40;
- delitem @MAUVE, 40;
+ delitem "CobaltHerb", 40;
+ delitem "AlizarinHerb", 40;
+ delitem "GambogeHerb", 40;
+ delitem "MauveHerb", 40;
set zeny, zeny - 20000;
- getitem 696, 1;
+ getitem "BlackDye", 1;
goto L_ok;
L_black_fail:
@@ -498,19 +686,19 @@ L_d_black:
L_dark_green:
if (QUEST_clothdyer_knowsdye != @QUEST_HAS_SOLVED_DYE_PUZZLE)
goto L_d_dark_green;
- if (countitem(@BLUE) < 10) goto L_dark_green_fail;
- if (countitem(@YELLOW) < 10) goto L_dark_green_fail;
- if (countitem(@MAUVE) < 10) goto L_dark_green_fail;
- if (countitem(@MAGGOTSLIME) < 1) goto L_dark_green_fail;
+ if (countitem("CobaltHerb") < 10) goto L_dark_green_fail;
+ if (countitem("GambogeHerb") < 10) goto L_dark_green_fail;
+ if (countitem("MauveHerb") < 10) goto L_dark_green_fail;
+ if (countitem("MaggotSlime") < 1) goto L_dark_green_fail;
if (zeny < 1000) goto L_dark_green_fail;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(@BLUE) > 10 && countitem(@YELLOW) > 10 && countitem(@MAUVE) > 10 && countitem(@MAGGOTSLIME) > 1) goto L_TooMany;
- delitem @BLUE, 10;
- delitem @MAUVE, 10;
- delitem @YELLOW, 10;
- delitem @MAGGOTSLIME, 1;
+ if (@inventorylist_count == 100 && countitem("CobaltHerb") > 10 && countitem("GambogeHerb") > 10 && countitem("MauveHerb") > 10 && countitem("MaggotSlime") > 1) goto L_TooMany;
+ delitem "CobaltHerb", 10;
+ delitem "MauveHerb", 10;
+ delitem "GambogeHerb", 10;
+ delitem "MaggotSlime", 1;
set zeny, zeny - 1000;
- getitem 699, 1;
+ getitem "DarkGreenDye", 1;
goto L_ok;
L_dark_green_fail:
@@ -589,9 +777,9 @@ L_dark_green_q_explain:
"I don't have time for this.", L_intermediate;
L_dark_green_q_guess_0:
- if (countitem(@MAGGOTSLIME) < 1)
+ if (countitem("MaggotSlime") < 1)
goto L_dark_green_q_noslime;
- delitem @MAGGOTSLIME, 1;
+ delitem "MaggotSlime", 1;
mes "[Rauk the Alchemist]";
mes "Rauk fills your maggot slime into a small bottle and picks a glass bottle from within his robe.";
diff --git a/npc/011-1_Woodland/auldsbel.txt b/npc/011-1_Woodland/auldsbel.txt
new file mode 100644
index 00000000..c7589543
--- /dev/null
+++ b/npc/011-1_Woodland/auldsbel.txt
@@ -0,0 +1,1186 @@
+// Auldsbel the Wizard
+// Transmutation Magic expert
+
+011-1.gat,50,68,0 script Auldsbel#_M 168,{
+
+ set @mexp, MAGIC_EXPERIENCE & 65535;
+
+ set @Q_STATUS_INITIAL, 0;
+ set @Q_STATUS_POSTINTRO, 1;
+ set @Q_STATUS_INITIATION, 2; // quest for being able to cast `create mouboo figurine'
+ set @Q_STATUS_STUDENT, 3; // accepted as student
+ set @Q_STATUS_STUDENT0, 4; // accepted as student
+ set @Q_STATUS_STUDENT1, 5;
+ set @Q_STATUS_STUDENT2, 6;
+ set @Q_STATUS_STUDENT3, 7;
+ set @Q_STATUS_STUDENT4, 8;
+
+ set @wants_sulphur, (QUEST_MAGIC & (NIBBLE_6_MASK | NIBBLE_7_MASK));
+ set @wants_ironpowder, (((QUEST_MAGIC & (NIBBLE_6_MASK | NIBBLE_7_MASK)) >> NIBBLE_6_SHIFT) >= 7);
+
+ set @Q_MASK, NIBBLE_0_MASK | NIBBLE_1_MASK;
+ set @Q_SHIFT, NIBBLE_0_SHIFT;
+
+ set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
+
+ set @Q_main_status, @Q_status & 31;
+ set @Q_component_quest, @Q_status >> 5;
+
+ set @has_magic, getskilllv(SKILL_MAGIC);
+
+ set @address$, "chap";
+ if (Sex == 0)
+ set @address$, "girl";
+
+ if (@Q_main_status >= @Q_STATUS_POSTINTRO)
+ goto L_short_intro;
+
+ mes "[Robed Man]";
+ mes "You notice a middle-aged man in expensive-looking robes.";
+ mes "\"Ah, splendid, you finally came!\"";
+ mes "He motions you to come closer.";
+ next;
+
+ mes "[Robed Man]";
+ mes "The man is visibly excited.";
+ mes "\"Here, I found a silk cocoon. Now if you can just give me the obsidian salt, we can see whether it works!\"";
+ next;
+
+ menu "Whether what works?", L_intro_explain,
+ "What are you talking about?", L_intro_explain,
+ "I don't have any obsidian salt.", L_intro_nopowder,
+ "Do I know you?", L_intro_identity,
+ "Goodbye.", -;
+ close;
+
+ set @name_complaint, 0;
+
+L_intro_explain:
+ mes "[Robed Man]";
+ mes "He frowns.";
+ mes "\"The transmutation experiment, of course! You can't have forgotten already...?\"";
+ next;
+ goto L_intro_identity;
+
+L_intro_nopowder:
+ mes "[Robed Man]";
+ mes "\"What!? You traveled all this way without any obsidian...\"";
+ next;
+ goto L_intro_identity;
+
+L_intro_identity:
+ mes "[Robed Man]";
+ mes "He eyes you more carefully.";
+ if (Sex == 0)
+ mes "\"How odd. I could have sworn that you were a man the last time we met. Not that I mind...\"";
+
+ mes "\"Wait. You're not Padric.\"";
+ next;
+
+ set @xmsg$, "Right... my name is " + strcharinfo(0) + ".";
+ if (strcharinfo(0) == "Padric")
+ set @xmsg$, "Actually, I am, but I don't know you...?";
+
+ menu @xmsg$, L_intro_wrongperson,
+ "You're not very good with faces, are you?", L_intro_nogood,
+ "Who are you?", L_intro_who_are_you,
+ "Goodbye.", -;
+ close;
+
+L_intro_wrongperson:
+ mes "[Robed Man]";
+ mes "He laughs.";
+ mes "\"Ah, I knew it... you're not the first one today, either. I should apologize, I am horrible with faces. Well, if you don't mind, please hurry along, I should go back to my experiments.\"";
+ next;
+
+L_intro_primary_menu:
+ menu "Who are you?", L_intro_who_are_you,
+ "Goodbye.", -;
+ close;
+
+L_intro_nogood:
+ mes "[Robed Man]";
+ mes "He laughs.";
+ mes "\"Yes, you could say that. Well, I shall get back to my experiments, then; I think I shall manage something that requires no obsidian salt instead.\"";
+ next;
+
+ menu "Who are you?", L_intro_who_are_you,
+ "What is obsidian salt, anyway?", L_intro_obsidian_salt,
+ "Goodbye.", -;
+ close;
+
+L_intro_obsidian_salt:
+ mes "[Robed Man]";
+ mes "\"Oh, obsidian salt is a catalyst... or rather a theoretical catalyst. We know that it has to have an application somewhere, and I do have the strong suspicion that it may be linked to natural transmogrification...\"";
+ next;
+ goto L_intro_primary_menu;
+
+L_intro_who_are_you:
+ mes "[Robed Man]";
+ mes "\"Oh, oh my... of course you wouldn't know me, being from the countryside and all.\"";
+ mes "He laughs.";
+ mes "\"Well, my young friend, I am none other than Auldsbel the Graying, of the Council of Transmuters!\"";
+ next;
+
+ set @Q_main_status, @Q_STATUS_POSTINTRO;
+ callsub S_update_var;
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_AULDSBEL;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"That means that I'm a wizard, in case you were wondering.\"";
+ next;
+ goto L_main_menu;
+
+L_short_intro:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Welcome back, Padric!\"";
+ next;
+ goto L_main_menu;
+
+L_main_menu:
+ if (@has_magic)
+ goto L_main_menu_magic;
+
+ menu "How does this 'magic' work?", L_about_magic,
+ "I want to become a wizard!", L_learn_magic,
+ "Where are you from?", L_about_auldsbel,
+ "Do you need help with your experiments?", L_quest,
+ "What do you know about...", L_question,
+ "Goodbye.", -;
+ close;
+
+L_main_menu_magic:
+ if (@wants_sulphur && @wants_ironpowder)
+ menu "How does magic work?", L_about_magic,
+ "Can you teach me a spell?", L_learn_spell,
+ "Where are you from?", L_about_auldsbel,
+ "Do you need help with your experiments?", L_quest,
+ "What do you know about...", L_question,
+ "Can you make sulphur powder?", L_sulphur,
+ "Can you make iron powder?", L_ironpowder,
+ "Goodbye.", -;
+ if (@wants_sulphur)
+ menu "How does magic work?", L_about_magic,
+ "Can you teach me a spell?", L_learn_spell,
+ "Where are you from?", L_about_auldsbel,
+ "Do you need help with your experiments?", L_quest,
+ "What do you know about...", L_question,
+ "Can you make sulphur powder?", L_sulphur,
+ "Goodbye.", -;
+ if (!@wants_sulphur)
+ menu "How does magic work?", L_about_magic,
+ "Can you teach me a spell?", L_learn_spell,
+ "Where are you from?", L_about_auldsbel,
+ "Do you need help with your experiments?", L_quest,
+ "What do you know about...", L_question,
+ "Goodbye.", -;
+ close;
+
+L_ironpowder:
+ mes "[Auldsbel the Wizard]";
+ mes "\"No, I do not know the spell for this. I expect that it shouldn't be too hard an invocation, but I'm too busy to work it out.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"I know that they used to make iron ore around here, though, many years ago. Perhaps the secret is still hidden somewhere?\"";
+ next;
+ goto L_main_menu;
+
+L_sulphur:
+ mes "[Auldsbel the Wizard]";
+ set @cost, 400 - (@Q_component_quest * 30);
+ mes "\"Sulphur powder? Ah, so we have picked up a little offensive magic, haven't we? Good thinking, good thinking. And yes, of course I can transmute volcanic ashes into sulphur powder at a ratio of 1:5, for " + @cost + " GP.\"";
+ next;
+ if (@Q_main_status >= @Q_STATUS_STUDENT)
+ menu
+ "No, thank you.", -,
+ "I will see what I can find.", -,
+ "Can you teach me how to make it myself?", L_sulphur_teach_spell,
+ "Here you are.", L_sulphur_buy;
+ if (@Q_main_status < @Q_STATUS_STUDENT)
+ menu
+ "No, thank you.", -,
+ "I will see what I can find.", -,
+ "Here you are.", L_sulphur_buy;
+ close;
+
+L_sulphur_buy:
+ if (zeny < @cost)
+ goto L_sulphur_nozeny;
+ if (countitem("PileOfAsh") < 1)
+ goto L_sulphur_noash;
+ getinventorylist;
+ if (@inventorylist_count == 100
+ && countitem("SulphurPowder") > 1
+ && countitem("PileOfAsh") == 0)
+ goto L_sulphur_noroom;
+
+ set zeny, zeny - @cost;
+ delitem "PileOfAsh", 1;
+ getitem "SulphurPowder", 5;
+ mes "[Auldsbel the Wizard]";
+ mes "\"I shall transmute it later. Here, have five half-ounces from my own stock.\"";
+ next;
+ goto L_main_menu;
+
+L_sulphur_nozeny:
+ mes "[Auldsbel the Wizard]";
+ mes "\"No GP, no service.\"";
+ next;
+ goto L_main_menu;
+
+L_sulphur_noash:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Without volcanic ash, I can't give you any sulphur powder. Try hunting some fire goblins, or somesuch.\"";
+ next;
+ goto L_main_menu;
+
+L_sulphur_noroom:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Hmm, you really managed to squeeze something into every little place you had that we could have stored the powder in... you might want to return once you have resolved this matter.\"";
+ next;
+ goto L_main_menu;
+
+L_sulphur_teach_spell:
+ if (@Q_component_quest <= 4)
+ goto L_sulphur_teach_spell_no;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Very well, then. You have been quite helpful with my experiments, after all. As you may have noticed, the spell takes a pile of volcanic ashes. Close your hands around it, then whisper the invocation.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"That invocation is '" + getspellinvocation("make-sulphur") + "'.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"You may find that you can transmute the powder more effectively after a while; that is perfectly natural.\"";
+ next;
+ goto L_main_menu;
+
+L_sulphur_teach_spell_no:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Hmm... how about this: you help me with a few of my experiments, and I tell you?\"";
+ next;
+ menu
+ "Very well, I will help you.", L_quest,
+ "No.", -;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"Then I fear that I shall not reveal the spell to you either.\"";
+ next;
+ goto L_main_menu;
+
+L_about_magic:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Magic is a universal force that comes from within; only few individuals have the power to channel and manipulate it. Most magic users resort to spells-- prefabricated invocations-- to access and control their magical power.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Most spells are claimed by one of the five schools of magic. To properly use them, a magic user need not only have sufficient prowess in magic overall, but also in the specifics of that particular school.\"";
+ next;
+
+L_about_magic_minimenu:
+ menu
+ "What are the five schools?", L_about_magic_schools,
+ "How can I advance in magic?", L_about_magic_advance,
+ "How do spells work?", L_about_magic_spells,
+ "Where can I learn spells?", L_about_magic_learn,
+ "Never mind.", -;
+ goto L_main_menu;
+
+L_about_magic_schools:
+ mes "[Auldsbel the Wizard]";
+ mes "\"With few exceptions, all spells belong to one of the five schools of magic: Transmutation, War, Astral, Life, and Nature.\"";
+ next;
+
+L_about_schools_minimenu:
+ menu
+ "What's Transmutation magic?", L_about_transmutation,
+ "What's War magic?", L_about_war,
+ "What's Astral magic?", L_about_astral,
+ "What's Life magic?", L_about_life,
+ "What's Nature magic?", L_about_nature,
+ "Are there other spells?", L_about_other_spells,
+ "Thank you.", -;
+ goto L_about_magic_minimenu;
+
+L_about_transmutation:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Transmutation magic deals with forming matter into a new shape. Some advanced transmutation magic can also expose special properties of the material in question.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "He smiles.";
+ mes "\"Transmutation magic is the engine of human civilization. By allowing us to shape buildings, tools, and other items according to the power of our imagination, it gives us mastery over nature.\"";
+ next;
+ goto L_about_schools_minimenu;
+
+L_about_astral:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Astral magic comprises a family of spells that connect the caster to the Astral World. This connection can be used to pull the caster 'through'-- effectively teleporting them-- or to 'pull others through'-- summoning creatures.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"There are also some more direct uses of powers of the Astral World; mainly spells that affect other spells.\"";
+ next;
+ goto L_about_schools_minimenu;
+
+L_about_war:
+ mes "[Auldsbel the Wizard]";
+ mes "\"War magic deals with the inevitable necessity of struggle against other creatures, and sometimes even against other humans. War magic exclusively focusses on dealing damage and destruction.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"If you use War magic, You better have a Transmuter around for the aftermath, to clear up your collateral damage.\"";
+ next;
+ goto L_about_schools_minimenu;
+
+L_about_life:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Life magic deals with healing. Not much of a surprise there.\"";
+ next;
+ goto L_about_schools_minimenu;
+
+L_about_nature:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Nature magic is a rather subtle (and, in my eyes, rather weak) kind of magic that deals with manipulating nature as it is. Think of it as Transmutation magic without being able to actually shape things the way you want.\"";
+ next;
+ goto L_about_schools_minimenu;
+
+L_about_other_spells:
+ mes "[Auldsbel the Wizard]";
+ mes "\"A few spells are not claimed by any particular school of magic. In practice, this means that anyone can cast them if they just have sufficient magical power. The most prominent example is the 'detect magic' spell, '" + getspellinvocation("detect-magic") + "'.\"";
+ next;
+ goto L_about_schools_minimenu;
+
+
+
+L_about_magic_advance:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Advancing in your magical powers must come from two sources: from within and from a person who can guide you in whichever school of magic you wish to advance.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"For advancing in your general magic power, you must practice magical spells. Make sure to vary them; you will learn little if you cast the same spell over and over. Also, spells that consume no components seem not to be very instructive in practice.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Once you have gathered enough spellcasting experience, you should be able to advance to the next level of magic. If you received your magic from a sponsor, you may have to seek out the sponsor again to advance.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Similarly, to advance in a particular school of magic, you should seek out someone sufficiently competent in that school. Each school has a different rite for advancing its students, so make sure to talk to the right person.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"I myself am a Transmutation Wizard. Of course I know some spells from the other schools, but my focus is on Transmutation. Theoretically speaking, I can advance you in this school.\"";
+ next;
+ goto L_about_magic_minimenu;
+
+L_about_magic_learn:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Finding and learning new spells is of course important in a magic user's quest towards becoming a full-fledged wizard.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Some wizards will be willing to share their knowledge, usually for a price. But they are not the only sources of magical spells: many magical books contain spells, and you can occasionally find them written down in the most unusual of places.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Some are even hiding as part of folklore or gossip. Of course, for those it can sometimes be hard to determine just what their prerequisites are...\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"If you decide to hunt for spells, make sure to keep a journal with you. Some spell invocations may only cross your path once in your lifetime; you must not allow them to get away!\"";
+ next;
+ goto L_about_magic_minimenu;
+
+L_about_magic_spells:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Magical spells are shortcuts, true magic bound to a word. No-one today remembers how they were created at the beginning of time, though many have tried to find it out, and failed...\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"These magical words are the spells' invocations. Spoken by someone who can't use magic, or by someone who doesn't satisfy the prerequisites, the word stands just for itself.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"But when spoken by a competent magic user, the word may unleash its effect-- consuming any components it may require, draining the caster's mana, changing the world around it.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Some spells require catalysts on top of components, others vary in power depending on whom they are cast on or under what conditions. However, all spells are affected by the caster's astral power.\"";
+ next;
+
+L_about_spells_minimenu:
+ menu
+ "What is this 'astral power'?", L_about_astral_power,
+ "What is a catalyst?", L_about_catalysts,
+ "What is a component?", L_about_components,
+ "What other prerequisites are there?", L_about_other_prerequisites,
+ "Where can I learn spells?", L_about_magic_learn,
+ "How often can I cast spells?", L_about_speed,
+ "Never mind.", L_about_magic_minimenu;
+ close;
+
+L_about_astral_power:
+ mes "[Auldsbel the Wizard]";
+ mes "\"A person's astral power is determined by several factors: overall experience, intelligence, and any and all equipment the person may be wearing at a given time.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Greater astral power mans more powerful spells. Since equipment can greatly decrease astral power, most magic users tend to be careful about what they wear-- it takes a while to recover astral power even after armour is unequipped.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"The worst offenders are metal items, particularly shields and body armour. Helmets and gloves get in the way, too. Still, a few special or enchanted items may even increase magical power.\"";
+ next;
+ goto L_about_spells_minimenu;
+
+L_about_catalysts:
+ mes "[Auldsbel the Wizard]";
+ mes "\"A catalyst is a material prerequisite to a spell that is not consumed as part of the spell. For example, the Transmuter's Tablet is required to properly perform many of the more powerful transmutation spells, but it is never consumed.\"";
+ next;
+ goto L_about_spells_minimenu;
+
+L_about_components:
+ mes "[Auldsbel the Wizard]";
+ mes "\"A material component is an item that is consumed as part of the spell's magic. For example, when transmuting wood into arrows, you must consume a raw log to shape the arrows out of it.\"";
+ next;
+ goto L_about_spells_minimenu;
+
+L_about_other_prerequisites:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Some spells have additional requirements-- they can only be cast underground, or when you are standing very close to the person you are casting them on, or only when you are wearing a particular enchanted item. Spells are quirky, so read their descriptions carefully-- if you do find a description.\"";
+ next;
+ goto L_about_spells_minimenu;
+
+L_about_speed:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Most spells are effective immediately, unless they require some complex astral connectoin-- summoning or teleporting can take a while to take effect, for example. Still, after casting a spell you usually need a moment to recover before casting the next.\"";
+ next;
+ goto L_about_spells_minimenu;
+
+
+L_about_auldsbel:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Well, there is no harm in giving you the general picture, I suppose.\"";
+ mes "He sighs, as if he had been forced to repeat something one time too many.";
+ mes "\"I am from the Council of Transmuters, the head organ of organized Transmutation magic in the known world.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"The council oversees recruitment, education, accreditation, and, if necessary, disciplining of Transmuters.";
+ mes "It ensures that Transmuter conduct is according to its statutes and acts as representative and point of contact towards other entities.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Of all the schools of magic, the School of Transmutation the most organised by far, and held in high esteem by rulers all across the world. Of course this is not only due to the outstanding and rigid structure of the school, but also because of the exceptional services that its members provide.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"The Council, presently overseen by Lord Transmogrifier Pontorias the Plaid (May His Shape Reflect His Soul Forever), consists of fourty-nine members and is situated in the citadel of Dorngard, in the northern mountains near the Crimson Cascade.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"The Council is souvereign over three hundred acres of land and nearby farming communities and has been ever since Yorick the Younger shaped Dorngard out of a mountain by sheer power of will, to build a home for the school his father had founded.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"The Council has held peaceful relations with nearby realms for almost two centruries now and is widely regarded as a reliable partner in shaping civilization to allow it to evolve towards its next stage.\"";
+ next;
+
+ menu
+ "All right, but what about you?.", L_about_auldsbel_2,
+ "Never mind.", -;
+ goto L_main_menu;
+
+L_about_auldsbel_2:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Oh, myself? I am just vacationing in the area. Very relaxed and peaceful place, the Hurnscald area. And plenty of splendid specimen for experimentation.\"";
+ next;
+ goto L_main_menu;
+
+L_learn_magic:
+ mes "[Auldsbel the Wizard]";
+ mes "Auldsbel laughs heartily.";
+ mes "\"Hah, if only it were so easy! No, my young friend, I fear that 'learning magic' here is not an option. Either you are born with it, or without.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Sure, there are a few entities that may grant you magic-- Ether Spirits or Mana Seeds or Great Dragons-- but those are the stuff of legends, so I suggest that you don't waste your life trying to find one of them.\"";
+ next;
+ goto L_main_menu;
+
+L_question:
+ callfunc "MagicTalkOptionsSetup";
+ set @ignore, @QQ_AULDSBEL;
+ callfunc "MagicTalkMenu";
+
+ if (@c == 0) goto L_main_menu;
+ if (@c == @QQ_ELANORE) goto L_Q_elanore;
+ if (@c == @QQ_MANASEED) goto L_Q_manaseed;
+ if (@c == @QQ_MANAPOTION) goto L_make_mana_potion;
+ if (@c == @QQ_WYARA) goto L_Q_wyara;
+ if (@c == @QQ_SAGATHA) goto L_Q_sagatha;
+ if (@c == @QQ_IMP) goto L_Q_imp;
+ if (@c == @QQ_OLDWIZ) goto L_Q_old_wizard;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"Let us talk about something else.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_old_wizard:
+ mes "[Auldsbel the Wizard]";
+ mes "\"I'm still not sure what exactly to make of him. At first appearance, he seems like a senile old man, but there can be no doubt that he has-- or at least had, at some point-- a very deep understanding of magic.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"I have not had the opportunity to talk to him too much, though.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_imp:
+ mes "[Auldsbel the Wizard]";
+ mes "\"There are many different kinds of spirits in the world. Some are good-natured, others evil; some are weak, others very powerful. I don't know the particular one you have encountered, though I urge caution.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_elanore:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Ah, Elanore. A kind little woman. Also a very proficient healer, from what I have been told, though we have interacted little. If you are interested in Life magic, you might want to talk to her.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_wyara:
+ mes "[Auldsbel the Wizard]";
+ mes "\"The village witch? Not exactly the brightest person, but she has managed to figure out how to brew potions. I doubt that she can do any real magic, though.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_sagatha:
+ mes "[Auldsbel the Wizard]";
+ mes "Auldsbel frowns.";
+ mes "\"That witch, hmm? She's a well-known trouble-maker, and quite a clever one at that; she once prevented us from cutting down a forest near Dorngaard that the villages wanted to use for farming, using some ingenious magic.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"That woman has spent too much time alone in the forests... I have the strong suspicion that she is more loyal towards her animals than towards us humans! I recommend that you stay away from her, if you value your well-being.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_manaseed_rumour:
+ mes "\"A mana seed? Around here? Nah, they've been pulling your leg. Those things are extremely rare, after all.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_manaseed:
+ mes "[Auldsbel the Wizard]";
+ if (@has_magic)
+ goto L_Q_manaseed_withmagic;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_MANASEED)) // rumour only?
+ goto L_Q_manaseed_rumour;
+ if (MAGIC_FLAGS & MFLAG_DRANK_POTION)
+ goto L_Q_manaseed_prepared;
+ if (MAGIC_FLAGS & MFLAG_TOUCHED_MANASEED)
+ goto L_Q_manaseed_touched;
+ mes "\"You have found an acual Mana Seed? That's impossible! Well, very unlikely... Then again, some others have told me similar rumours. I find it hard to believe that...\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Well, if it's true, then try touching it. That should do you no harm, but if you are very, very lucky, it just might grant you some minuscule amount of magical power.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_manaseed_touched:
+ if (MAGIC_FLAGS & MFLAG_DRANK_POTION)
+ goto L_Q_manaseed_prepared;
+ mes "\"So you touched the Mana Seed, and its power flowed right through you? You are lucky-- it is willing to share-- but you are also unlucky, in that you lack the discipline and control needed to contain this power.\"";
+ next;
+
+ if (MAGIC_FLAGS & MFLAG_KNOWS_MANAPOTION)
+ goto L_Q_manaseed_touched_short;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"Legend has it that you can substitute for such control by imbibing a Mana Potion. I am not sure whether that legend is true, but for you it might be worth trying it out.\"";
+ next;
+
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_MANAPOTION;
+L_Q_manaseed_touched_short:
+ menu
+ "Where can I get a Mana Potion?", L_where_mana_potion,
+ "Can you make a Mana Potion?", L_make_mana_potion,
+ "Thank you.", -;
+ goto L_main_menu;
+
+L_where_mana_potion:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Well, quite a few alchemists should be able to brew one for you. Or maybe the village witch, even, though I personally would recommend seeing an alchemist.\"";
+ next;
+ goto L_Q_manaseed_touched_short;
+
+L_make_mana_potion:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Well, I can transmute some components into a Mana Potion for you. Let's see... I will need one pearl, 10,000 GP, about twenty Mauve leaves, and some Gamboge ones... ten should do, I think. Oh, and a bottle of water, of course.\"";
+ next;
+ menu
+ "Here you are.", -,
+ "I will look for those items.", L_main_menu,
+ "I'm not interested.", L_Q_manaseed_touched_short;
+
+ if (zeny < 10000)
+ goto L_make_mana_potion_missing;
+ if (countitem("GambogeHerb") < 10)
+ goto L_make_mana_potion_missing;
+ if (countitem("MauveHerb") < 20)
+ goto L_make_mana_potion_missing;
+ if (countitem("Pearl") < 1)
+ goto L_make_mana_potion_missing;
+ if (countitem("BottleOfWater") < 1)
+ goto L_make_mana_potion_missing;
+ getinventorylist;
+ if (@inventorylist_count == 100
+ && countitem("GambogeHerb") > 10
+ && countitem("MauveHerb") > 20
+ && countitem("Pearl") > 1
+ && countitem("BottleOfWater") > 1
+ && countitem("ManaPotion") < 1)
+ goto L_mana_potion_toomuch;
+
+ set zeny, zeny - 10000;
+ delitem "GambogeHerb", 10;
+ delitem "MauveHerb", 20;
+ delitem "Pearl", 1;
+ delitem "BottleOfWater", 1;
+ getitem "ManaPotion", 1;
+
+ mes "[Auldsbel the Wizard]";
+ mes "Auldsbel pockets your GP and the pearl, then stuffs the leaves into the bottle. Holding the bottle between his hands, he focusses briefly. The water and leaves flash bright red, then the leaves dissolve.";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "The wizard pours the resultant mixture into a different bottle. \"It will lose its power quickly if left in a glass bottle\", he explains.";
+ mes "He hands you the final result, which feels surprisingly heavy.";
+ next;
+
+ menu
+ "Thank you!", L_main_menu,
+ "What about the pearl and GP?", -;
+
+ mes "[Auldsbel the Wizard]";
+ mes "Auldsbel raises his eyebrows in surprise.";
+ mes "\"Those were payment. You don't expect me to work for free, now do you?\"";
+ next;
+
+ goto L_main_menu;
+
+L_mana_potion_toomuch:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Burndened as you are, I doubt you could carry it. Get rid of some of your old things first, will you?\"";
+ next;
+ goto L_main_menu;
+
+L_make_mana_potion_missing:
+ mes "[Auldsbel the Wizard]";
+ mes "\"No, I need one pearl, 10,000 GP, 20 Mauve leaves, 10 Gamboge leaves, and one bottle of water.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_manaseed_prepared:
+ mes "\"So you found a Mana Seed and preprared yourself by drinking a mana potion? I recommend that you visit the seed again and see if that actually works...\"";
+ next;
+ goto L_main_menu;
+
+L_Q_manaseed_withmagic:
+ if (MAGIC_FLAGS & MFLAG_MANASEED_MAXEDOUT)
+ goto L_Q_manaseed_maxedout;
+ mes "\"I still find it hard to believe that you have found an actual Mana Seed here, in the middle of nowhere... Well, I suggest that you keep visiting it. As your control over magic grows, it may grant you additional power.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_manaseed_maxedout:
+ mes "\"So the mana seed isn't giving you any more power? You might want to try again later; normally those seeds grow in power, over time.\"";
+ next;
+ goto L_main_menu;
+
+L_quest:
+ if (@Q_component_quest == 0)
+ goto L_component_quest_0;
+ if (@Q_component_quest == 1)
+ goto L_component_quest_1;
+ if (@Q_component_quest == 2)
+ goto L_component_quest_2;
+ if (@Q_component_quest == 3)
+ goto L_component_quest_3;
+ if (@Q_component_quest == 4)
+ goto L_component_quest_4;
+ if (@Q_component_quest == 5)
+ goto L_component_quest_5;
+ mes "[Auldsbel the Wizard]";
+ mes "\"You have been very helpful, but at this point I have everything I need. Except perhaps for a Wumpus Egg, though I have no idea where you could find one... If you ever come across one, I will give you a special reward for it, though.\"";
+ next;
+ goto L_main_menu;
+
+L_component_quest_0:
+ mes "[Auldsbel the Wizard]";
+ mes "Auldsbel is visibly delighted.";
+ mes "\"Ah, indeed, indeed! I can often use help with my experiments, and you just happen to be arriving at a particularly opportune time. See, I found this...\"";
+ mes "He pulls something from his pocket and shows it to you.";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"It's a silk cocoon. This area has been virtually infested with silkworms, from what I have seen. This is splendid! I will try to... do something very special with this one. But for that I will need twenty Mauve leaves.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"There are plenty of Mauve plants around, so I'm sure that you won't have a hard time finding the leaves.\"";
+ next;
+ menu
+ "I have them here.", -,
+ "Sure, I will look for them.", L_main_menu;
+
+ if (countitem ("MauveHerb") < 20)
+ goto L_component_quest_missing;
+
+ delitem "MauveHerb", 20;
+ set zeny, zeny + 2500;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Well done, my young friend! Here are 2,500 GP to compensate you for your efforts.\"";
+ mes "[You gain 250 experience points]";
+ getexp 250, 0;
+ set @Q_component_quest, 1;
+ callsub S_update_var;
+ next;
+
+ goto L_main_menu;
+
+L_component_quest_1:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Good, good... I am trying to come up with a way to best use the Mauve leaves you brought me, but it seems that I will need further components. I am not sure about the exact composition yet, but I will need a few potions.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Please be a good " + @address$ + " and get me an iron potion, a concentration potion, and three small and three medium healing potions.\"";
+ next;
+ menu
+ "Here you are.", -,
+ "I'm not your 'good " + @address$ + "'!", L_main_menu,
+ "I'll see what I can do.", L_main_menu;
+
+ if (countitem ("SmallHealingPotion") < 3)
+ goto L_component_quest_missing;
+ if (countitem ("MediumHealingPotion") < 3)
+ goto L_component_quest_missing;
+ if (countitem ("IronPotion") < 1)
+ goto L_component_quest_missing;
+ if (countitem ("ConcentrationPotion") < 1)
+ goto L_component_quest_missing;
+
+ delitem "SmallHealingPotion", 3;
+ delitem "MediumHealingPotion", 3;
+ delitem "IronPotion", 1;
+ delitem "ConcentrationPotion", 1;
+ set zeny, zeny + 2500;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Ah, excellent, excellent! These are precisely what I needed. Here are another 2,500 GP to compensate you for your efforts.\"";
+ mes "[You gain 500 experience points]";
+ getexp 500, 0;
+ set @Q_component_quest, 2;
+ callsub S_update_var;
+ next;
+
+ goto L_main_menu;
+
+
+L_component_quest_2:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Ah! Excellent! Yes, yes, indeed I need help. I have managed to transmute the components you brought me into a liquid that I believe to be a demetamorphosis stock, but it seems that the details still need some fine-tuning, and I am out of silk cocoons...\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"I would like to run the next batch of experiments on a larger scale, though. Would you be so kind as to fetch me some one hundred silk cocoons, please?\"";
+ next;
+
+ menu
+ "One hundred cocoons, here you are.", -,
+ "That's a lot; I'll see what I can do.", L_main_menu;
+
+ if (countitem ("SilkCocoon") < 100)
+ goto L_component_quest_missing;
+
+ delitem "SilkCocoon", 20;
+ set zeny, zeny + 5000;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Splendid, splendid! Here are 5,000 GP for you.\"";
+ mes "Auldsbel attempts to cram the cocoons into his pockets, with little success. Finally he gives up and takes them into his hut.";
+ mes "[You gain 2,000 experience points]";
+ getexp 2000, 0;
+ set @Q_component_quest, 3;
+ callsub S_update_var;
+ next;
+
+ goto L_main_menu;
+
+L_component_quest_3:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Yes... I'm actually not certain that my demetamorphosis stock will not drain the life out of these little creatures. Perhaps an alchemical revitalization tincture would be called for. Fortunately this one is easy, I can make it myself.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"I'm still not sure how to integrate it into the spell... but leave that to me. Can you get me twenty-five red scorpion stingers and twenty-five lumps of maggot slime? Those should be just what I need.\"";
+ next;
+ menu
+ "Here are your stingers and slimes.", -,
+ "I will get back to you once I have them.", L_main_menu;
+
+ if (countitem ("RedScorpionStinger") < 25)
+ goto L_component_quest_missing;
+ if (countitem ("MaggotSlime") < 25)
+ goto L_component_quest_missing;
+
+ delitem "RedScorpionStinger", 25;
+ delitem "MaggotSlime", 25;
+ set zeny, zeny + 5000;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Good " + @address$ + "! Another 5,000 GP for you.\"";
+ mes "\"I believe that I have figured out one possible way to integrate the tincture into the spell... I will let you know how that goes.\"";
+ mes "[You gain 10,000 experience points]";
+ getexp 10000, 0;
+ set @Q_component_quest, 4;
+ callsub S_update_var;
+ next;
+
+ goto L_main_menu;
+
+L_component_quest_4:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Hmmyes... See, the thing is that transmuting living beings is not normally something that transmutation magic can do. It seems that the beings' life force must be overcome to transmute them, but that in turn kills them.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"But I was wondering whether creatures that already can auto-transmute-- or metamorphose, as some people call it-- might not allow themselves to be subjected to magical transmutation more easily... Still, all of my demetamorphosis attempts so far have failed.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"I am thinking of injecting the life force of another creature, perhaps using some astral channelling. Snakes sound most promising, as they have a similar physical shape but a strong life force.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Could you get me twenty regular, cave, and mountain snake tongues, please? So a total of sixty tongues. This is where most of their life force is concentrated, incidentally.\"";
+ next;
+ menu
+ "Here are your tongues.", -,
+ "I will hunt some snakes for you.", L_main_menu;
+
+ if (countitem ("SnakeTongue") < 20)
+ goto L_component_quest_missing;
+ if (countitem ("CaveSnakeTongue") < 20)
+ goto L_component_quest_missing;
+ if (countitem ("MountainSnakeTongue") < 20)
+ goto L_component_quest_missing;
+
+ delitem "SnakeTongue", 20;
+ delitem "CaveSnakeTongue", 20;
+ delitem "MountainSnakeTongue", 20;
+ set zeny, zeny + 8000;
+ mes "[Auldsbel the Wizard]";
+ mes "\"8,000 GP should cover your efforts, I think.\"";
+ mes "\"Now let's see if this works...\"";
+ mes "[You gain 40,000 experience points]";
+ getexp 40000, 0;
+ set @Q_component_quest, 5;
+ callsub S_update_var;
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "Auldsbel focuses on the bundle of snake tongues, which begin to assume a bright red colour, then start to glow. Yellow sparks drop to the ground, as Auldsbel rolls the tongues into a ball.";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "He tosses in a cocoon, then squeezes everything together. A bright red flash blinds you momentarily.";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "As Auldsbel opens his hands, there is nothing there.";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "He frowns. \"Their life force was still not strong enough. Hmm.\"";
+ next;
+
+ goto L_main_menu;
+
+L_component_quest_5:
+ mes "[Auldsbel the Wizard]";
+ mes "\"I do have another assignment for you, but this one will be tricky. I will need fifty grass snake tongues. I believe that this may be just enough life force to return the silkworm back to its original shape.\"";
+ next;
+ menu
+ "Here they are.", -,
+ "That's quite a challenge.", L_main_menu;
+
+ if (countitem ("GrassSnakeTongue") < 50)
+ goto L_component_quest_missing;
+
+ delitem "GrassSnakeTongue", 50;
+ set zeny, zeny + 10000;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Excellent! Here are 10,000 GP for you, and now let's see how this goes.\"";
+ mes "[You gain 100,000 experience points]";
+ getexp 100000, 0;
+ set @Q_component_quest, 6;
+ callsub S_update_var;
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "Auldsbel rolls the snake tongues into a ball again, whilst chanting some words that you fail to discern. As the ball begins to glow, he tosses in a silkworm cocoon.";
+ mes "He then presses his hands together; you are blinded by a blue flash.";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "The wizard steps back in horror.";
+ mes "\"Oh my... I should have known. I have stepped into Astral spell territory here. This is bad...\"";
+ mes "He mumbles a brief spell invocation.";
+ mes "\"I suggest that you run.\"";
+ next;
+
+ monster "this", 50, 68, "Grass Snake", 1034, 4;
+ close;
+
+L_component_quest_missing:
+ mes "[Auldsbel the Wizard]";
+ mes "\"No, you are missing some items. Come back later when you have everything!\"";
+ next;
+ goto L_main_menu;
+
+L_learn_spell:
+ if (@Q_main_status == @Q_STATUS_INITIATION) goto LL_initiation;
+ if (@Q_main_status == @Q_STATUS_STUDENT) goto LL_student_start;
+ if (@Q_main_status == @Q_STATUS_STUDENT0) goto LL_student_0;
+ if (@Q_main_status == @Q_STATUS_STUDENT1) goto LL_student_1;
+ if (@Q_main_status == @Q_STATUS_STUDENT2) goto LL_student_2;
+ if (@Q_main_status == @Q_STATUS_STUDENT3) goto LL_student_3;
+ if (@Q_main_status == @Q_STATUS_STUDENT4) goto LL_student_4;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"Wellll.... you do seem to have some magical abilities. But do you possess the talent and diligence needed for a true wizard?\"";
+ mes "He raises an eyebrow at you, then grins.";
+ mes "\"Only one way to find out! Let me teach you a first spell.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"This spell is a simple transmutation invocation. All it takes is a clean wooden log. Hold it in your hand, focus your powers, and say the magic invocation.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"You can turn the log into a wooden figurine by saying " + getspellinvocation("transmute-wood-to-mouboo") + " followed by the last syllable of the name of the creature you want to shape it as. And mind you, that syllable has to be from the Old-Tritan name...\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Oh, actually, make sure to write that down. You should keep track of all spells and spell fragments, really. I always keep a notebook handy, in fact.\"";
+ next;
+ set @Q_main_status, @Q_STATUS_INITIATION;
+ callsub S_update_var;
+ goto L_main_menu;
+
+LL_repeat_spell:
+ mes "[Auldsbel the Wizard]";
+ mes "\"The invocation is 'kular', followed by the last syllable of the name of the creature you want to shape the log into. But this only works if you know the old Tritan name of the creature.\"";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"And make sure to keep notes of your spells! In the future, I will only tell you once.\"";
+ next;
+
+ goto L_main_menu;
+
+LL_initiation:
+ mes "[Auldsbel the Wizard]";
+ mes "\"So, have you managed to transmute something?\"";
+ next;
+
+ if (countitem("MoubooFigurine"))
+ menu
+ "Not yet.", -,
+ "How about this mouboo figurine?", LL_initiation_check;
+
+ if (!(countitem("MoubooFigurine")))
+ menu
+ "Not yet.", -,
+ "What was the spell again?", LL_repeat_spell;
+
+ goto L_main_menu;
+
+LL_initiation_fail:
+ mes "[Auldsbel the Wizard]";
+ mes "\"No, no, no. This is no good-- too many imperfections.\"";
+ mes "He throws it away.";
+ mes "\"Keep practicing-- and make sure to vary the spells you cast a little; that will make it easier to learn.\"";
+ next;
+ goto L_main_menu;
+
+LL_initiation_check:
+ if (!(countitem("MoubooFigurine")))
+ goto L_main_menu;
+ delitem "MoubooFigurine", 1;
+
+ mes "[Auldsbel the Wizard]";
+ mes "Auldsbel inspects your figurine.";
+ next;
+
+ if (@mexp < 40)
+ goto LL_initiation_fail;
+
+ mes "[Auldsbel the Wizard]";
+ mes "Auldsbel nods.";
+ mes "\"This looks good.\"";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "He pockets the figurine.";
+ mes "\"Very well, then. I shall accept you as my student.\"";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "Auldsbel presses his index and middle finger against your forehead.";
+ mes "\"Accept my blessing!\"";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "You feel new powers flowing into your body!";
+ mes "[5000 experience points]";
+ mes "[Level 2 in Transmutation Magic]";
+
+ set @Q_main_status, @Q_STATUS_STUDENT;
+ callsub S_update_var;
+ getexp 5000, 0;
+ if (getskilllv(SKILL_MAGIC_TRANSMUTE) < 2)
+ setskill SKILL_MAGIC_TRANSMUTE, 2;
+ next;
+ goto L_main_menu;
+
+LL_student_start:
+ if (@mexp < 200) goto LL_notready;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Next, I shall teach you a higher-level transmutation spell.\"";
+ if (getskilllv(SKILL_MAGIC) < 2)
+ mes "\"Beware, for you will not be able to use it yet.\"";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"Bring me ten bug legs, and I will reveal its invocation to you.\"";
+ next;
+
+ menu
+ "Here you are.", -,
+ "I'll be back with them.", L_main_menu;
+
+ if (countitem("BugLeg") < 10)
+ goto L_component_quest_missing;
+
+ delitem "BugLeg", 10;
+ getexp 1000, 0;
+ set @Q_main_status, @Q_STATUS_STUDENT0;
+ callsub S_update_var;
+
+ mes "[Auldsbel the Wizard]";
+ mes "He picks up the bug legs.";
+ mes "\"Good. These will come in handy later...\"";
+ mes "He grins.";
+ mes "[1000 experience points]";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"Now, listen carefully: to make a short tank top out of three pieces of cloth, you must use the invocation '" + getspellinvocation("make-short-tanktop") + "'.\"";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"But be careful; transmutations can go wrong, and that can injure you. When you have some more overall spellcasting practice, come back to me.\"";
+ next;
+ goto L_main_menu;
+
+LL_notready:
+ mes "[Auldsbel the Wizard]";
+ mes "\"You still need more practice with spellcasting; I won't give you another spell until you are ready.\"";
+ next;
+ goto L_main_menu;
+
+LL_student_0:
+ if (@mexp < 350) goto LL_notready;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"The next transmutation spell is a little harder than the last one I taught you, but you should be able to manage.\"";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"Bring me twenty mauve leaves, and I will reveal its invocation.\"";
+ next;
+
+ menu
+ "Here you are.", -,
+ "I'll be back with them.", L_main_menu;
+
+ if (countitem("MauveHerb") < 20)
+ goto L_component_quest_missing;
+
+ delitem "MauveHerb", 20;
+ getexp 1000, 0;
+ set @Q_main_status, @Q_STATUS_STUDENT1;
+ callsub S_update_var;
+
+ mes "[Auldsbel the Wizard]";
+ mes "He pockets your mauve leaves.";
+ mes "\"Those should go very well with the salmon.\"";
+ mes "[1000 experience points]";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"The next spell I have will make a normal tank top out of four pieces of cloth. The invocation is '" + getspellinvocation("make-tanktop") + "', make sure to write this down.\"";
+ next;
+
+ goto L_main_menu;
+
+LL_student_1:
+ if (@mexp < 425) goto LL_notready;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"Up next is the transmutation spell for regular shirts.\"";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"For this, I would like ten scorpion stingers.\"";
+ next;
+
+ menu
+ "Here you are.", -,
+ "I'll be back with them.", L_main_menu;
+
+ if (countitem("ScorpionStinger") < 10)
+ goto L_component_quest_missing;
+
+ delitem "ScorpionStinger", 10;
+ getexp 1000, 0;
+ set @Q_main_status, @Q_STATUS_STUDENT2;
+ callsub S_update_var;
+
+ mes "[Auldsbel the Wizard]";
+ mes "He carefully takes the stingers.";
+ mes "\"You are being quite helpful. If my experiments go well, I will make sure to acknowledge you in a footnote somewhere.\"";
+ mes "[1000 experience points]";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"To make a shirt, use the invocation '" + getspellinvocation("make-shirt") + "'. This will require five pieces of cloth.\"";
+ next;
+
+ goto L_main_menu;
+
+LL_student_2:
+ if (@mexp < 500) goto LL_notready;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"You may find the next spell particularly useful.\"";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"Bring me twenty wooden logs, and I will teach you.\"";
+ next;
+
+ menu
+ "Here you are.", -,
+ "I'll be back with them.", L_main_menu;
+
+ if (countitem("RawLog") < 20)
+ goto L_component_quest_missing;
+
+ delitem "RawLog", 20;
+ getexp 1000, 0;
+ set @Q_main_status, @Q_STATUS_STUDENT3;
+ callsub S_update_var;
+
+ mes "[Auldsbel the Wizard]";
+ mes "Auldsbel places the logs next to his hut.";
+ mes "\"I'm hoping to animate them into the shape of one of those odd log heads.\"";
+ mes "[1000 experience points]";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"This spell makes arrows out of a single wooden log. Its invocation is '" + getspellinvocation("make-arrows") + "'.\"";
+ next;
+
+ goto L_main_menu;
+
+LL_student_3:
+ // Future extensions go here
+ mes "[Auldsbel the Wizard]";
+ mes "\"No, not at this time. You will have to advance in your overall magic skill before I can teach you more.\"";
+ next;
+
+ goto L_main_menu;
+
+
+S_update_var:
+ set @Q_status, @Q_main_status | (@Q_component_quest << 5);
+ set QUEST_MAGIC,
+ (QUEST_MAGIC & ~(@Q_MASK)
+ | (@Q_status << @Q_SHIFT));
+ return;
+}
diff --git a/npc/012-1_Woodland_Hills/_import.txt b/npc/012-1_Woodland_Hills/_import.txt
index 851f97fc..8876b855 100644
--- a/npc/012-1_Woodland_Hills/_import.txt
+++ b/npc/012-1_Woodland_Hills/_import.txt
@@ -1,5 +1,7 @@
map: 012-1.gat
npc: npc/012-1_Woodland_Hills/_mobs.txt
npc: npc/012-1_Woodland_Hills/_warps.txt
+npc: npc/012-1_Woodland_Hills/amrak.txt
npc: npc/012-1_Woodland_Hills/monsters.txt
+npc: npc/012-1_Woodland_Hills/injured-mouboo.txt
npc: npc/012-1_Woodland_Hills/shops.txt
diff --git a/npc/012-1_Woodland_Hills/amrak.txt b/npc/012-1_Woodland_Hills/amrak.txt
new file mode 100644
index 00000000..5a2a547a
--- /dev/null
+++ b/npc/012-1_Woodland_Hills/amrak.txt
@@ -0,0 +1,10 @@
+//
+
+012-1.gat,137,104,0 script Amrak 103, {
+ mes "[Amrak]";
+ mes "\"I'm studying this waterfall. The water seems to flow from it like magic.\"";
+ next;
+ mes "[Amrak]";
+ mes "\"Unfortunately, I've had trouble getting up there. The monsters in these caves scare me.\"";
+ close;
+}
diff --git a/npc/012-1_Woodland_Hills/injured-mouboo.txt b/npc/012-1_Woodland_Hills/injured-mouboo.txt
new file mode 100644
index 00000000..efa68ad5
--- /dev/null
+++ b/npc/012-1_Woodland_Hills/injured-mouboo.txt
@@ -0,0 +1,231 @@
+// The following auxiliary function is used both by appropriate magic and within the regular script:
+
+function script QuestMoubooHeal {
+ set @Q_MASK, NIBBLE_2_MASK;
+ set @Q_SHIFT, NIBBLE_2_SHIFT;
+
+ set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
+ set @Q_status_upper, @Q_status & 12;
+ set @Q_status, @Q_status & 3;
+
+ set @STATE_INITIAL, 0;
+ set @STATE_HEALED_MOUBOO, 3;
+
+ if (@Q_status != @STATE_INITIAL)
+ goto L_nothing;
+
+ set @Q_status, @STATE_HEALED_MOUBOO;
+ callsub S_update_var;
+ mes "[Injured Mouboo]";
+ mes "A soft white glow surrounds the mouboo's leg, which slowly shifts back into place.";
+ mes "As the glow subsides, the mouboo gets up, carefully, and takes a few steps. It seems to be fully healed!";
+ mes "[5000 experience points]";
+ getexp 5000, 0;
+ next;
+
+ mes "[Injured Mouboo]";
+ mes "Visibly happy, the mouboo lies down on the ground and snuggles with a black piece of cloth it had been lying on.";
+ mes "The healing process must have been exhausting, for it is asleep in an instant.";
+ next;
+ set @value, 15;
+ callfunc "QuestSagathaHappy";
+ close;
+
+L_nothing:
+ mes "Your spell has no effect.";
+ next;
+ close;
+
+S_update_var:
+ set @Q_wr_status, @Q_status | @Q_status_upper;
+ set QUEST_MAGIC,
+ (QUEST_MAGIC & ~(@Q_MASK)
+ | (@Q_wr_status << @Q_SHIFT));
+ return;
+}
+
+
+
+012-1.gat,57,153,0 script Mouboo 171,{
+ set @Q_MASK, NIBBLE_2_MASK;
+ set @Q_SHIFT, NIBBLE_2_SHIFT;
+
+ set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
+ set @Q_status_upper, @Q_status & 12;
+ set @Q_status, @Q_status & 3;
+
+ set @STATE_INITIAL, 0;
+ set @STATE_KILLED_MOUBOO, 1;
+ set @STATE_TOOK_KILL_REWARD, 2;
+ set @STATE_HEALED_MOUBOO, 3;
+
+ if (@Q_status == @STATE_KILLED_MOUBOO)
+ goto L_dead;
+ if (@Q_status == @STATE_TOOK_KILL_REWARD)
+ goto L_took_reward;
+ if (@Q_status == @STATE_HEALED_MOUBOO)
+ goto L_healed;
+
+ mes "[Injured Mouboo]";
+ mes "You notice a mouboo lying on the ground, groaning, as if in pain.";
+ next;
+
+L_menu:
+ menu
+ "Examine the mouboo", L_examine,
+ "Give the mouboo something", L_give,
+ "Kill the mouboo", L_kill,
+ "Leave", -;
+ close;
+
+L_examine:
+ mes "[Injured Mouboo]";
+ mes "Looking closer, you notice that the mouboo's left hind leg is bent in a very unnatural angle-- that seems to be the cause for its pain.";
+ next;
+ mes "[Injured Mouboo]";
+ mes "You also notice that the mouboo is lying on top of what appears to be a black turtleneck sweater.";
+ mes "Do you want to pick up the sweater?";
+ next;
+ menu
+ "Yes.", L_pickup_alive,
+ "No.", L_menu;
+ goto L_menu;
+
+L_pickup_alive:
+ mes "[Injured Mouboo]";
+ mes "The Mouboo groans and pushes your hand away. It seems to be rather fond of the sweater.";
+ next;
+ goto L_menu;
+
+L_give:
+ set @items_nr, 12;
+ setarray @items$, "CactusDrink", "CactusPotion", "ChocolateBar", "Milk", "OrangeCupcake", "Apple", "Beer", "BottleOfWater", "TinyHealingPotion", "SmallHealingPotion", "MediumHealingPotion", "LargeHealingPotion";
+ setarray @itemeat, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0;
+
+ setarray @menuItems$, "", "", "", "", "", "", "", "", "", "", "", "";
+ set @choices_nr, 0;
+ setarray @menuNames$, "", "", "", "", "", "", "", "", "", "", "", "";
+ setarray @choice_eat, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
+
+ set @n, 0;
+ set @ct, 0;
+L_nloop:
+ set @k$, @items$[@n];
+ if (countitem(@k$) == 0)
+ goto L_nloop_skip;
+
+ set @name$, getitemname(@k$);
+ set @menuItems$[@ct], @name$;
+ set @menuNames$[@ct], @k$;
+ set @choice_eat[@ct], @itemeat[@n];
+ set @ct, @ct + 1;
+
+L_nloop_skip:
+
+ set @n, @n+1;
+ if (@n < @items_nr)
+ goto L_nloop;
+
+ menu @menuItems$[0], -,
+ @menuItems$[1], -,
+ @menuItems$[2], -,
+ @menuItems$[3], -,
+ @menuItems$[4], -,
+ @menuItems$[5], -,
+ @menuItems$[6], -,
+ @menuItems$[7], -,
+ @menuItems$[8], -,
+ @menuItems$[9], -,
+ @menuItems$[10], -,
+ @menuItems$[11], -;
+
+ set @menu, @menu - 1;
+ set @choice$, @menuNames$[@menu];
+ set @verb$, "drinks";
+ if (@choice_eat[@menu])
+ set @verb$, "eats";
+
+ if (@choice$ != "" && countitem(@choice$))
+ goto L_consume;
+
+ goto L_menu;
+
+L_consume:
+ mes "[Injured Mouboo]";
+ mes "The mouboo " + @verb$ + " your " + getitemname(@choice$) + ".";
+ delitem @choice$, 1;
+ next;
+
+ if (@choice$ == "LargeHealingPotion")
+ goto L_do_heal;
+
+
+ mes "[Injured Mouboo]";
+ mes "Unfortunately, it seems to have had no effect.";
+ next;
+ goto L_menu;
+
+L_do_heal:
+ callfunc "QuestMoubooHeal";
+
+L_kill:
+ mes "[Injured Mouboo]";
+ if (BaseLevel > 44)
+ goto L_kill_success;
+ mes "The mouboo deflects your attack and counterattacks!";
+ mes "It misses you only barely.";
+ mes "Injured though it may be, this mouboo is still more than a match for you!";
+ next;
+ goto L_menu;
+
+L_kill_success:
+ mes "After some wrestling, the mouboo succumbs to your attacks.";
+ mes "[100 experience points]";
+ getexp 100, 0;
+
+ set @Q_status, @STATE_KILLED_MOUBOO;
+ callsub S_update_var;
+
+ next;
+
+L_dead:
+ mes "[Dead Mouboo]";
+ mes "The dead mouboo is lying on top of a black T-neck sweater.";
+
+ getinventorylist;
+ if (@inventorylist_count == 100)
+ goto L_nopickup;
+
+ getitem "BlackTNeckSweater", 1;
+ mes "You pull out the sweater and stuff it into your backpack.";
+
+ set @Q_status, @STATE_TOOK_KILL_REWARD;
+ callsub S_update_var;
+
+ next;
+ close;
+
+L_took_reward:
+ mes "[Dead Mouboo]";
+ mes "You see a dead mouboo.";
+ next;
+ close;
+
+L_nopickup:
+ mes "Unfortunately, you can't carry any more.";
+ next;
+ close;
+
+L_healed:
+ mes "[Mouboo]";
+ mes "The mouboo is sleeping soundly, smiling in its dreams.";
+ next;
+ close;
+
+S_update_var:
+ set @Q_wr_status, @Q_status | @Q_status_upper;
+ set QUEST_MAGIC,
+ (QUEST_MAGIC & ~(@Q_MASK)
+ | (@Q_wr_status << @Q_SHIFT));
+ return;
+}
diff --git a/npc/012-3_Cave/_import.txt b/npc/012-3_Cave/_import.txt
index 92995992..7d427ad8 100644
--- a/npc/012-3_Cave/_import.txt
+++ b/npc/012-3_Cave/_import.txt
@@ -1,4 +1,5 @@
map: 012-3.gat
npc: npc/012-3_Cave/_mobs.txt
npc: npc/012-3_Cave/_warps.txt
+npc: npc/012-3_Cave/mana-seed.txt
npc: npc/012-3_Cave/monsters.txt
diff --git a/npc/012-3_Cave/mana-seed.txt b/npc/012-3_Cave/mana-seed.txt
new file mode 100644
index 00000000..e1804e19
--- /dev/null
+++ b/npc/012-3_Cave/mana-seed.txt
@@ -0,0 +1,263 @@
+012-3.gat,62,130,0 script Mana Seed#MAGIC 166,{
+
+ setarray @magic_exp_needed,
+ 0, // level 0
+ 0,
+ 100,
+ 1200,
+ 8000,
+ 40000; // level 5
+
+ setarray @exp_bonus,
+ 0,
+ 1000, // level 1
+ 10000,
+ 100000,
+ 400000,
+ 2000000; // level 5
+
+ setarray @min_level,
+ 0,
+ 10,
+ 30,
+ 50,
+ 65,
+ 80; // level 5
+
+ set @visions_nr, 13;
+ setarray @visions$,
+ "You see a dark underground temple; you are kneeling, praying for the safety of the planet. You smile as a friend joins you in the dark-- but suddenly a shadow falls over you from above, and a stabbing pain...",
+ "It is midnight; you are in an underground cavern deep inside the desert ruins. Slowly, as if half-asleep, you wander up the spiral pathway, towards the ancient vase at its center. As you reach out to touch it...",
+ "The old castle smells of mildew and swamp gas. It has not been used in centuries, but you were here before, when the world was young. You turn to face your companions-- but something is wrong with all three; an ancient force has possessed them...",
+ "As you put the horn to your lips, you feel winds flowing, gathering, condensing in your chest. Soon, you can no longer contain it; the storm unleashes through your mouth, into a deafening fanfare. The black dome around you begins to crack...",
+ "You are alone inside your head, confined by the laughing man's circlet. Powerless, you witness how your hands shoot out flame after flame, incinerating innocents for that man's experiments...",
+ "The village may be in ruins, but it must have been where you grew up. The engravings on the walls-- images of powerful beasts-- look strangely familiar, and you can make out writing, words about you, wishes and prayers for you... You are at home...",
+ "Deep underneath the city, the rocky cavern maze turns into an opulent palace. This must be where the beast of the many eyes resides. Nervously you grip the wand; will the power to repel it be sufficient to defeat it and its magic?",
+ "At the bottom of the abyss, infinity opens before you. You have proven yourself worthy, and the ancient finally reveals its wisdom...",
+ "You may only be children, but you recognize that it is this man only who can save the world. As the walls rush towards you to crush your small group, you exchange a glance with your twin sister-- there is no doubt what you must do...",
+ "The sacred place is surrounded by nothingness; were it not for your magic, you would have no hope of returning. The old and young man stands nearby; he has been waiting for you, for centuries. He has all the time in the world, after all...",
+ "Nothing remains behind. The underground castle is empty now, its chambers plundered, its throne destroyed. Shivering, you climb down the stairs, towards the wailing of the underworld that is waiting beneath...",
+ "You feel soft, fluffy fur brushing against your skin and are filled with happines. Somehow, the word `" + getspellinvocation("happy-curse") + "' comes to mind...";
+
+ set @max_magic, 2;
+
+ set @has_magic, getskilllv(SKILL_MAGIC);
+ set @drank_potion, MAGIC_FLAGS & MFLAG_DRANK_POTION;
+ set @knows_seed, MAGIC_FLAGS & MFLAG_KNOWS_MANASEED;
+
+ if (@has_magic)
+ goto L_magic_start;
+
+ if (@knows_seed)
+ goto L_quick_nomagic;
+
+ // first time here
+
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_MANASEED;
+
+ mes "[Mana Seed]";
+ mes "You see a glowing orb, swimming in the water like a sea rose.";
+ mes "An unearthly glow is emanating from within, lighting up the water and filling the cave with an eerie light.";
+ next;
+
+ mes "[Mana Seed]";
+ if (@drank_potion)
+ mes "Slowly, the tingling sensation you felt before begins to spread through your body again.";
+ mes "What would you like to do?";
+ next;
+ goto L_nomagic_mainmenu;
+
+L_quick_nomagic:
+ mes "[Mana Seed]";
+ mes "Again you stand before the orb.";
+ if (@drank_potion)
+ mes "Slowly, the tingling sensation you felt before begins to spread through your body again.";
+ mes "What would you like to do?";
+ next;
+
+ goto L_nomagic_mainmenu;
+
+// Non-Magic main menu ------------------------------------------------------------
+L_nomagic_mainmenu:
+ menu "Examine it more closely", L_nomagic_examine,
+ "Take it with you", L_nomagic_touch,
+ "Touch it", L_nomagic_touch,
+ "Throw a rock at it", L_nomagic_throwrock,
+ "Destroy it", L_nomagic_destroy,
+ "Leave it alone", L_end;
+ close;
+
+L_nomagic_examine:
+ mes "[Mana Seed]";
+ mes "The orb seems to be perfectly round and emitting a steady glow. It appears to be floating in the water.";
+ next;
+ goto L_nomagic_mainmenu;
+
+L_nomagic_throwrock:
+ mes "[Mana Seed]";
+ mes "Your rock makes hardly a sound as it strikes the orb and glances off into the water, leaving neither scratch nor impression.";
+ mes "The orb budges slightly, but then floats back into its old position, as if it were tethered into place.";
+ next;
+ goto L_nomagic_mainmenu;
+
+L_nomagic_touch:
+ mes "[Mana Seed]";
+ if (@drank_potion)
+ goto L_magic_level_1;
+ mes "As you touch the orb, you feel a terrible force within, separated from you by only the thinnest of membranes-- like a tempest, all packed up in one tiny waterskin.";
+ next;
+ mes "[Mana Seed]";
+ mes "For one instant you feel that force rushing past your hands, through your body, as if you had unleashed this tempest upon yourself. Unable to contain the power, you stumble backwards, away from the orb.";
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_TOUCHED_MANASEED;
+ next;
+ goto L_nomagic_mainmenu;
+
+L_magic_level_1:
+ if (getskilllv(SKILL_MAGIC))
+ goto L_end; // shouldn't be happening
+
+ mes "Again you feel the tempest rushing through the Mana Seed's membrane, into your body. You only manage to hold on to it for an instant and find yourself forced to pull your hands away again quickly.";
+ next;
+
+ mes "[Mana Seed]";
+ mes "But this time something is different-- that tingling sensation is back, and stronger than before. It is spreading through your body, head to toes, and you feel yourself brimming with energy.";
+ next;
+
+ mes "[Mana Seed]";
+ mes "It is a light-headed feeling, and you find yourself forced to sit down for a few seconds to recover.";
+ mes "Something is different. A new power has grown within you and is waiting to be understood.";
+ mes "[1000 experience points]";
+ setskill SKILL_MAGIC, 1;
+ getexp 1000, 0;
+ next;
+
+ goto L_end;
+
+L_nomagic_destroy:
+ mes "[Mana Seed]";
+ mes "Try as you might, the orb seems impervious to all forms of attack you can fathom. You are forced to abandon your efforts.";
+ next;
+ goto L_nomagic_mainmenu;
+
+// Magic main menu ------------------------------------------------------------
+L_magic_start:
+ mes "[Mana Seed]";
+ mes "The Mana Seed is still in the same place as during your last visit, spreading its light throughout the cavern.";
+ mes "What would you like to do?";
+ next;
+
+L_magic_mainmenu:
+ menu "Touch it", L_magic_touch,
+ "Destroy it", L_magic_destroy,
+ "Leave it alone", L_end;
+ close;
+
+L_magic_touch:
+ mes "[Mana Seed]";
+ mes "You touch the Mana Seed again.";
+
+ if (getskilllv(SKILL_MAGIC) >= @max_magic)
+ goto L_magic_maxed_out;
+
+ set @exp_needed, @magic_exp_needed[getskilllv(SKILL_MAGIC) + 1];
+ set @magic_exp, MAGIC_EXPERIENCE & 65535;
+ if (@magic_exp >= @exp_needed)
+ goto L_magic_levelup;
+
+ set @prev_exp_needed, @magic_exp_needed[getskilllv(SKILL_MAGIC)];
+ set @exp_diff, @exp_needed - @prev_exp_needed;
+ set @index, ((@magic_exp - @prev_exp_needed) * 5) / @exp_diff;
+ setarray @messages$,
+ "The orb's energy effortlessly rushes through you, ignoring your feeble attempts at containing it. You will need considerably more practice with your magical skills before you can hope to contain it.",
+ "You only barely manage to hang on to some strands of the orb's energy, but not enough to contain it. You still need noticeably more practice with your magical skills.",
+ "The orb's powers are still no match for you; you will need more practice to contain more of its powers.",
+ "You feel close to being able to contain the orb's powers. Still, some more practice is needed.",
+ "The orb's energy only barely evades your attempts at containing it. Soon you will be able to extract more power from it.";
+
+ mes @messages$[@index];
+ next;
+ goto L_magic_mainmenu;
+
+L_magic_levelup:
+ set @baselevel_needed, @min_level[getskilllv(SKILL_MAGIC) + 1];
+ if (BaseLevel < @baselevel_needed)
+ goto L_insufficient_baselevel;
+ mes "Its energy permeates you, surrounds you. You are suddenly uncertain if it is you who is containing the orb's powers or if it is the orb who is seeking out yours.";
+ next;
+
+ mes "[Mana Seed]";
+ mes "The Seed's tempest is calming beneath your hands, and its energies resonate with yours.";
+ next;
+
+ mes "[Mana Seed]";
+ mes "A feeling of harmony is spreading through your body, and the tingling sensation is back, within and without.";
+ next;
+
+ mes "[Mana Seed]";
+ mes "As the tingling increases, you feel light-headed, weightless.";
+ mes "Everything fades...";
+ next;
+
+ mes "Both the tingling and the sense of harmony have vanished, making room for darkness. You can't feel the Mana Seed anymore...";
+ next;
+
+ mes "... you can't feel anything.";
+ next;
+
+ mes "You are floating...";
+ next;
+
+ mes "The darkness is no longer complete. You begin to make out stars in the distance, circling each other, dancing a cosmic dance.";
+ next;
+
+ mes "Images rush past you, shadows of thoughts and dreams. Some touch you, filling you with powerful emotions-- despair, extasy; sometimes loss, sometimes hope; hate, love.";
+ next;
+
+ mes "Someone else's thoughts pass through your mind...";
+ next;
+
+ set @nr, rand(@visions_nr);
+ mes @visions$[@nr];
+ next;
+
+ mes "The image fades.";
+ next;
+
+ mes "[Mana Seed]";
+ mes "You awaken, lying on the ground.";
+ next;
+
+ mes "[Mana Seed]";
+ mes "Something has changed... you feel more confident in your magical abilities.";
+
+ setskill SKILL_MAGIC, 1 + getskilllv(SKILL_MAGIC);
+ set @exp, @exp_bonus[getskilllv(SKILL_MAGIC)];
+ itemheal 0, 10000;
+ getexp @exp, 0;
+ mes "[" + @exp + " experience points]";
+ next;
+
+ goto L_magic_end;
+
+L_magic_maxed_out:
+ mes "Strangely, you feel nothing, as if its membrane had closed towards you.";
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_MANASEED_MAXEDOUT;
+ next;
+
+ goto L_magic_mainmenu;
+
+L_insufficient_baselevel:
+ mes "Its energies rush through you. You fight to keep them under control, to contain them in your body. Alas, your body is too frail-- you have to let go.";
+ mes "Frustrated, you give up. You have the skill needed to control this power, but you will have to grow up some more before your body can handle it.";
+ next;
+ goto L_magic_mainmenu;
+
+L_magic_destroy:
+ mes "[Mana Seed]";
+ mes "Try as you might, you cannot find a way, magical or physical, to destroy the seed. Frustrated, you give up.";
+ next;
+ goto L_magic_mainmenu;
+
+L_end:
+ close;
+}
diff --git a/npc/013-1_Woodland_hills/_import.txt b/npc/013-1_Woodland_hills/_import.txt
index c4c325bc..899d3d7e 100644
--- a/npc/013-1_Woodland_hills/_import.txt
+++ b/npc/013-1_Woodland_hills/_import.txt
@@ -2,3 +2,4 @@ map: 013-1.gat
npc: npc/013-1_Woodland_hills/_mobs.txt
npc: npc/013-1_Woodland_hills/_warps.txt
npc: npc/013-1_Woodland_hills/monsters.txt
+npc: npc/013-1_Woodland_hills/sagatha.txt
diff --git a/npc/013-1_Woodland_hills/sagatha.txt b/npc/013-1_Woodland_hills/sagatha.txt
new file mode 100644
index 00000000..f1429789
--- /dev/null
+++ b/npc/013-1_Woodland_hills/sagatha.txt
@@ -0,0 +1,393 @@
+// Sagatha the witch, expert for nature and astral magic
+//----------------------------------------
+
+function script QuestSagathaHappy {
+ set @unhappiness, (QUEST_MAGIC & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT;
+ if (@unhappiness < @value)
+ goto L_zero;
+
+ set @unhappiness, @unhappiness - @value;
+ goto L_write;
+
+L_zero:
+ set @unhappiness, 0;
+
+L_write:
+ set QUEST_MAGIC, (QUEST_MAGIC & ~NIBBLE_3_MASK) | (@unhappiness << NIBBLE_3_SHIFT);
+ return;
+}
+
+//----------------------------------------
+function script QuestSagathaAnnoy {
+ set @unhappiness, (QUEST_MAGIC & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT;
+ if ((@unhappiness + @value) > 15)
+ goto L_max;
+
+ set @unhappiness, @unhappiness + @value;
+ goto L_write;
+
+L_max:
+ set @unhappiness, 15;
+
+L_write:
+ set QUEST_MAGIC, (QUEST_MAGIC & ~NIBBLE_3_MASK) | (@unhappiness << NIBBLE_3_SHIFT);
+ return;
+}
+
+function script SagathaStatus {
+ set @mexp, MAGIC_EXPERIENCE & 65535;
+ set @has_magic, getskilllv(SKILL_MAGIC);
+ set @evil, 0;
+ set @good, 0;
+ set @unhappy, (QUEST_MAGIC & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT;
+ set @mouboo, ((QUEST_MAGIC & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT) & 3;
+
+ if (@mouboo == 3)
+ set @good, @good + 1;
+ if (@mouboo == 2)
+ set @evil, 1;
+ if (@mouboo == 1)
+ set @evil, 1;
+
+ if (MAGIC_FLAGS & MFLAG_DID_CUTTREE)
+ set @evil, 1;
+
+ set @druid, (((QUEST_MAGIC & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT) & 12) >> 2;
+ if (@druid == 3)
+ set @good, @good + 1;
+ return;
+}
+
+//----------------------------------------
+013-1.gat,131,24,0 script Sagatha#_M 167,{
+ callfunc "SagathaStatus";
+
+ set @Q_MASK, NIBBLE_4_MASK | NIBBLE_5_MASK;
+ set @Q_SHIFT, NIBBLE_4_SHIFT;
+
+ set @STATUS_INITIAL, 0;
+ set @STATUS_STUDENT, 1; // N14
+ set @STATUS_STUDENT_N10, 2;
+ set @STATUS_STUDENT_A10, 3;
+ set @STATUS_STUDENT_A11, 4;
+ set @STATUS_STUDENT_A12, 5;
+ set @STATUS_STUDENT_N11, 6;
+ set @STATUS_STUDENT_LEVEL_3, 7;
+
+ set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
+
+ if (MAGIC_FLAGS & MFLAG_KNOWS_SAGATHA)
+ mes "[Sagatha the Witch]";
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_SAGATHA))
+ mes "[Witch]";
+
+ if (@evil)
+ goto L_evil;
+
+ if (@unhappy > 10)
+ goto L_unhappy;
+
+ if (MAGIC_FLAGS & MFLAG_KNOWS_SAGATHA)
+ goto L_wb;
+
+ mes "Before you stands a beautiful woman, dressed in dark purple robes and wearing a witch's hat.";
+
+ if (Sex)
+ mes "She looks at you suspiciously.";
+ if (!Sex)
+ mes "She looks at you impassively.";
+ next;
+
+ menu
+ "Who are you?", -,
+ "What's your name?", L_intro_name,
+ "Hello! My name is " + strcharinfo(0) + ".", L_intro_givename,
+ "Goodbye.", L_close;
+
+ mes "[Witch]";
+ mes "\"I am what you humans call a witch. I am a human who has chosen all living creatures as what you call family.\"";
+ next;
+
+ menu
+ "No, I mean... what's your name?", L_intro_name,
+ "Hello! My name is " + strcharinfo(0) + ".", L_intro_givename,
+ "Uh.... goodbye.", L_close;
+
+ close;
+
+L_intro_name:
+ mes "[Sagatha the Witch]";
+ mes "\"They call me Sagatha.\"";
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_SAGATHA;
+ next;
+ goto L_main;
+
+L_intro_givename:
+ mes "[Witch]";
+ mes "\"Ah.\"";
+ next;
+
+ menu
+ "What's yours?", L_intro_name,
+ "Uhm... bye.", -;
+ close;
+
+L_evil:
+ mes "The witch's eyes flare up in anger as she notices you, and she turns away from you.";
+ mes "Whatever the reason, she doesn't seem to like you.";
+ next;
+ close;
+
+L_unhappy:
+ mes "The witch glares at you in anger.";
+ mes "\"I wonder if you can still sleep after killing those innocent forest creatures!";
+ mes "I am sure that they will come back to haunt you in your dreams!\"";
+ next;
+ close;
+
+L_wb:
+ if (@good > 1)
+ mes "Sagatha nods as she notices you.";
+ if (@good == 1)
+ mes "Sagatha raises an eyebrow as you address her.";
+ if (@good == 0)
+ mes "Sagatha glances at you, suspicion evident in her eyes.";
+ next;
+
+L_main:
+ if (@Q_status)
+ menu
+ "Can you explain magic to me?", L_explain_magic,
+ "Can you teach me more magic?", L_teach,
+ "What do you know about...", L_Question;
+ if (!@Q_status)
+ menu
+ "Can you explain magic to me?", L_explain_magic,
+ "Can you teach me magic?", L_teach_initial,
+ "What do you know about...", L_Question;
+ close;
+
+L_teach_initial:
+ if (@good < 2)
+ goto L_teach_initial_nogood;
+ if (getskilllv(SKILL_MAGIC_NATURE) < 2)
+ goto L_teach_initial_nonature;
+
+ mes "[Sagatha the Witch]";
+ mes "She nods.";
+ mes "\"For now, yes. But you will have to prove that you really care about more than yourself.\"";
+ next;
+
+ mes "[Sagatha the Witch]";
+ mes "She snaps her fingers, and without warning you begin to acutely sense the magical energies around you, for a brief instant!";
+ mes "[5000 experience points]";
+ mes "[Level 2 in Astral Magic]";
+
+ set @Q_status, @STATUS_STUDENT;
+ callsub S_update_var;
+ getexp 5000, 0;
+ if (getskilllv(SKILL_MAGIC_ASTRAL) < 2)
+ setskill SKILL_MAGIC_ASTRAL, 2;
+ next;
+
+ mes "[Sagatha the Witch]";
+ mes "\"In the future, I will teach you nature and astral magic. For the other schools there are better teachers around.\"";
+ next;
+
+ goto L_main;
+
+
+L_teach_initial_nogood:
+ mes "[Sagatha the Witch]";
+ mes "\"I don't take strangers as students.\"";
+ next;
+ goto L_main;
+
+L_teach_initial_nonature:
+ mes "[Sagatha the Witch]";
+ mes "\"I might, but you don't even understand the basics of nature magic.\"";
+ next;
+ goto L_main;
+
+L_explain_magic:
+ mes "[Sagatha the Witch]";
+ mes "\"No.\"";
+ next;
+ goto L_main;
+
+L_teach:
+ if (@Q_status == @STATUS_STUDENT)
+ goto L_teach_N14;
+ if (@Q_status == @STATUS_STUDENT_N10)
+ goto L_teach_N10;
+ if (@Q_status == @STATUS_STUDENT_A10)
+ goto L_teach_A10;
+ if (@Q_status == @STATUS_STUDENT_A11)
+ goto L_teach_A11;
+ if (@Q_status == @STATUS_STUDENT_A12)
+ goto L_teach_A12;
+ if (@Q_status == @STATUS_STUDENT_N11)
+ goto L_teach_N11;
+
+ mes "[Sagatha the Witch]";
+ mes "\"Not yet. You have to ask the mana seed to give you more power.\"";
+ next;
+ goto L_main;
+
+L_practice:
+ mes "[1000 experience points]";
+ set @Q_status, @Q_status + 1;
+ callsub S_update_var;
+ getexp 1000,0;
+ next;
+ mes "[Sagatha the Witch]";
+ mes "\"Now go and practice.\"";
+ next;
+ goto L_main;
+
+L_teach_N14:
+ if (@mexp < 125) goto L_teach_noexp;
+ mes "[Sagatha the Witch]";
+ mes "\"Some forest creatures sometimes overgrow their fur or hide. That makes them uncomfortable.\"";
+ next;
+ mes "[Sagatha the Witch]";
+ mes "\"You can help them with shearing magic. Press your hands together and say '" + getspellinvocation("shear") + "'. Then touch them with your hands, and brush off any excess.\"";
+ next;
+ mes "[Sagatha the Witch]";
+ mes "\"The spell is strong, so you only need to do this once. Be careful not to cut them. Some things they shed are useful. Often they will leave them to you as a thank-you.\"";
+ goto L_practice;
+
+L_teach_N10:
+ if (@mexp < 150) goto L_teach_noexp;
+ mes "[Sagatha the Witch]";
+ mes "\"Next, a nature spell. Take a cocoon shell. Hold it in your hand. Feel its lightness.\"";
+ next;
+ mes "[Sagatha the Witch]";
+ mes "\"Now whisper '" + getspellinvocation("flying-backpack") + "', and if your backpack was pressing on you you should no longer feel it now.\"";
+ goto L_practice;
+
+L_teach_A10:
+ if (@mexp < 180) goto L_teach_noexp;
+ mes "[Sagatha the Witch]";
+ mes "\"To protect against others' magic, take a small mushroom from a shady place. Mushrooms draw things out of the earth. Rub your mushroom into pieces between your hands.\"";
+ next;
+ mes "[Sagatha the Witch]";
+ mes "\"Then say '" + getspellinvocation("barrier") + "' and let the mushroom's power take over.\"";
+ goto L_practice;
+
+L_teach_A11:
+ if (@mexp < 200) goto L_teach_noexp;
+ mes "[Sagatha the Witch]";
+ mes "\"If you must fight, call allies. You can call spiky mushrooms out of the ground with a mushroom spike. Hold up the spike and call out to them: '" + getspellinvocation("summon-spiky-mushrooms") + "'.\"";
+ next;
+ mes "[Sagatha the Witch]";
+ mes "\"Spiky mushrooms often grow too many spikes, so you can shear the spikes off of some.\"";
+ next;
+ goto L_practice;
+
+L_teach_A12:
+ if (@mexp < 220) goto L_teach_noexp;
+ mes "[Sagatha the Witch]";
+ mes "\"You can call fluffies, too. But for them you must call out '" + getspellinvocation("summon-fluffies") + "' instead, with white fluffy fur.\"";
+ goto L_practice;
+
+L_teach_N11:
+ if (@mexp < 250) goto L_teach_noexp;
+ mes "[Sagatha the Witch]";
+ mes "\"You can harden your skin with a hard spike. Hold it in your hands and speak '" + getspellinvocation("protect") + "', then draw its hardness into your skin.\"";
+ next;
+ mes "[Sagatha the Witch]";
+ mes "\"Or call it into someone else's skin, by saying that someone's name right after the '" + getspellinvocation("protect") + "'.\"";
+ goto L_practice;
+
+L_teach_noexp:
+ mes "[Sagatha the Witch]";
+ mes "\"You must practice more first.\"";
+ next;
+ goto L_main;
+
+L_Question:
+ callfunc "MagicTalkOptionsSetup";
+ set @ignore, @QQ_SAGATHA;
+ callfunc "MagicTalkMenu";
+
+ if (@c == 0) goto L_main;
+ if (@c == @QQ_ELANORE) goto L_Q_elanore;
+ if (@c == @QQ_MANASEED) goto L_Q_manaseed;
+ if (@c == @QQ_MANAPOTION) goto L_Q_manapotion;
+ if (@c == @QQ_WYARA) goto L_Q_wyara;
+ if (@c == @QQ_AULDSBEL) goto L_Q_auldsbel;
+ if (@c == @QQ_IMP) goto L_Q_imp;
+ if (@c == @QQ_OLDWIZ) goto L_Q_old_wizard;
+
+ mes "[Sagatha the Witch]";
+ mes "\"That doesn't concern you.\"";
+ next;
+ goto L_main;
+
+L_Q_old_wizard:
+ mes "[Sagatha the Witch]";
+ mes "\"A kind and wise wizard.\"";
+ next;
+ goto L_main;
+
+L_Q_imp:
+ mes "[Sagatha the Witch]";
+ mes "\"He is an evil and cruel one. He lies and cheats and will try to take advantage of you. Stay away from him.\"";
+ next;
+ goto L_main;
+
+L_Q_elanore:
+ mes "[Sagatha the Witch]";
+ mes "\"Elanore is the Tulimshar town healer.\"";
+ next;
+ goto L_main;
+
+L_Q_manaseed:
+ mes "[Sagatha the Witch]";
+ if (!@has_magic && (MAGIC_FLAGS & MFLAG_TOUCHED_MANASEED))
+ goto L_Q_manaseed_unabsorbed;
+ if (@has_magic)
+ goto L_Q_manaseed_m;
+ mes "\"There is a mana seed around here, but I don't see how this concerns you.\"";
+ next;
+ goto L_main;
+
+L_Q_manaseed_unabsorbed:
+ mes "\"If the mana seed didn't pass its magic to you, you clearly aren't attuned to magic.\"";
+ next;
+ goto L_main;
+
+L_Q_manaseed_m:
+ mes "\"You were lucky that the mana seed gave you its magic. I hope that you will use this power for something good now.\"";
+ next;
+ goto L_main;
+
+L_Q_manapotion:
+ mes "[Sagatha the Witch]";
+ mes "\"I won't make one without a cauldron, that would be wasteful. And I'm not going to start carrying a cauldron around.\"";
+ next;
+ goto L_main;
+
+L_Q_wyara:
+ mes "[Sagatha the Witch]";
+ mes "\"Wyara decided to live with humans, in Hurnscald. She tries to make the world a better place in her own way. Please be kind to her, she is a very good person.\"";
+ next;
+ goto L_main;
+
+L_Q_auldsbel:
+ mes "[Sagatha the Witch]";
+ mes "She frowns.";
+ mes "\"He's a transmutation wizard, member of the northern council. Reasonably competent wizard, too.\"";
+ next;
+ goto L_main;
+
+L_close:
+ close;
+
+S_update_var:
+ set QUEST_MAGIC,
+ (QUEST_MAGIC & ~(@Q_MASK)
+ | (@Q_status << @Q_SHIFT));
+ return;
+}
diff --git a/npc/013-2_Magic_house/apprentice.txt b/npc/013-2_Magic_house/apprentice.txt
index b0f32116..830b5171 100644
--- a/npc/013-2_Magic_house/apprentice.txt
+++ b/npc/013-2_Magic_house/apprentice.txt
@@ -41,9 +41,9 @@ L_Beer:
L_Beer_yes:
if (zeny < 175) goto L_Low_money;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(539) == 0) goto L_TooMany;
+ if (@inventorylist_count == 100 && countitem("Beer") == 0) goto L_TooMany;
- getitem 539, 1;
+ getitem "Beer", 1;
set zeny, zeny - 175;
goto L_Finish;
@@ -64,8 +64,8 @@ L_Milk:
L_Milk_yes:
if (zeny < 300) goto L_Low_money;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(527) == 0) goto L_TooMany;
- getitem 527, 1;
+ if (@inventorylist_count == 100 && countitem("Milk") == 0) goto L_TooMany;
+ getitem "Milk", 1;
set zeny, zeny - 300;
goto L_Finish;
diff --git a/npc/013-2_Magic_house/wizard.txt b/npc/013-2_Magic_house/wizard.txt
index 25f30122..d1e18f00 100644
--- a/npc/013-2_Magic_house/wizard.txt
+++ b/npc/013-2_Magic_house/wizard.txt
@@ -1,22 +1,79 @@
-013-2.gat,66,39,0 script Old Wizard 116,{
+013-2.gat,66,39,0 script Old Wizard#_W 116,{
+ set @has_magic, getskilllv(SKILL_MAGIC);
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_OLD_WIZARD;
+
+ mes "[Old Wizard]";
mes "\"Welcome, dear wanderer! Come into my humble home. Take a rest, eat and drink.\"";
next;
+
menu
- "Thanks, that's very kind of you!",thanks,
- "Oh, shut up!",shutup;
+ "Thanks, that's very kind of you!",thanks,
+ "Can you teach me magic?", L_teach_rude,
+ "Oh, shut up!",shutup;
+ close;
+
+L_teach_rude:
+ mes "[Old Wizard]";
+ mes "\"I certainly could, but I already have an apprentice.\"";
+ close;
+
shutup:
+ mes "[Old Wizard]";
mes "\"That attitude isn't going to get you very far, my dear.\"";
close;
thanks:
+ mes "[Old Wizard]";
mes "\"Behind this door, my apprentice will serve you.\"";
next;
- menu
- "Alright.",ok,
- "Your apprentice? ... No thanks.",nothx;
+ if (@has_magic)
+ menu
+ "Alright.",ok,
+ "I am studying magic, can you help?", L_new_student,
+ "Your apprentice? ... No thanks.",nothx;
+ if (!@has_magic)
+ menu
+ "Alright.",ok,
+ "Your apprentice? ... No thanks.",nothx;
nothx:
+ mes "[Old Wizard]";
mes "\"Goodbye, then!\"";
close;
+
+L_new_student:
+ mes "[Old Wizard]";
+ mes "\"Studying is always an excellent use of one's mind! I fear that I can't offer too much assistance to you, however. But if you are interested, I could perhaps teach you a simple spell?\"";
+ next;
+
+ menu
+ "That would be very kind of you!", -,
+ "No, but thank you!", nothx;
+
+ mes "[Old Wizard]";
+ mes "\"This one may not seem too powerful, but it can be quite handy; it's the 'hide' spell. It will shield you from some forms of detection magic.\"";
+ next;
+
+ mes "[Old Wizard]";
+ mes "\"Put a piece of cotton cloth on your head, and speak out '" + getspellinvocation("hide") + "', loudly and clearly. The protection lasts quite long, but you may have to renew it on occasion.\"";
+ next;
+
+ mes "[Old Wizard]";
+ mes "\"You can also cast it on others, of course. Just speak their name after you prononuce the invocation.\"";
+ next;
+
+ mes "[Old Wizard]";
+ mes "\"You may find it useful for getting a little peace and quiet at times, but it can also get in the way of friends trying to find you, so use it with care.\"";
+ next;
+
+ if (getskilllv(SKILL_MAGIC_ASTRAL) >= 2)
+ close;
+
+ mes "[Old Wizard]";
+ mes "\"I'm not sure if you are experienced enough to cast it yet, though. You may need to first learn astral magic.\"";
+ next;
+ close;
+
ok:
+ mes "[Old Wizard]";
mes "\"Beware the flying notes though, some of them are really dangerous. I haven't been able to persuade them to get back into their book. And avoid the mirror, it's been acting strange lately.\"";
next;
mes "\"Oh, and please don't take my apprentice too seriously. He still has a lot to learn.\"";
diff --git a/npc/013-3_Cave/barrier.txt b/npc/013-3_Cave/barrier.txt
index 16f78946..95fb6383 100644
--- a/npc/013-3_Cave/barrier.txt
+++ b/npc/013-3_Cave/barrier.txt
@@ -1,6 +1,6 @@
//
-013-3.gat,71,21,0 script #DemonMineBarrier1 127,1,1,{
+013-3.gat,71,21,0 script #DemonMineBarrier1#_M 127,1,1,{
if (QUEST_demon_mines >= 2) close;
if (QUEST_demon_mines == 1 && countitem(1198) >= 1) goto L_Has_Jack_O_Soul;
@@ -13,6 +13,6 @@
L_Has_Jack_O_Soul:
mes "The barrier around the opening allows you passage.";
set QUEST_demon_mines, 2;
- delitem 1198, 1;
+ delitem "JackOSoul", 1;
close;
}
diff --git a/npc/013-3_Cave/mask_chest.txt b/npc/013-3_Cave/mask_chest.txt
index 0da8bab9..2e292e50 100644
--- a/npc/013-3_Cave/mask_chest.txt
+++ b/npc/013-3_Cave/mask_chest.txt
@@ -4,80 +4,81 @@
if (QUEST_demon_mines < 2) goto L_This_shouldn_t_happen;
if (QUEST_demon_mines == 3) goto L_Finished;
- if (countitem(505) == 0) goto L_No_maggot_slime;
- if (countitem(566) == 0) goto L_No_mushroom;
- if (countitem(565) == 0) goto L_No_petal;
+ if (countitem("MaggotSlime") == 0) goto L_No_maggot_slime;
+ if (countitem("SmallMushroom") == 0) goto L_No_mushroom;
+ if (countitem("Petal") == 0) goto L_No_petal;
- if (countitem(700) == 0) goto L_No_pearl;
- if (countitem(613) == 0) goto L_No_hard_spike;
- if (countitem(569) == 0) goto L_No_raw_log;
+ if (countitem("Pearl") == 0) goto L_No_pearl;
+ if (countitem("HardSpike") == 0) goto L_No_hard_spike;
+ if (countitem("RawLog") == 0) goto L_No_raw_log;
- if (countitem(614) == 0) goto L_No_pink_antenna;
- if (countitem(710) == 0 || countitem(711) == 0 || countitem(712) == 0 || countitem(713) == 0) goto L_No_tongues;
- if (countitem(537) == 0) goto L_No_treasure_key;
+ if (countitem("PinkAntenna") == 0) goto L_No_pink_antenna;
+ if (countitem("SnakeTongue") == 0 || countitem("MountainSnakeTongue") == 0 || countitem("GrassSnakeTongue") == 0 || countitem("CaveSnakeTongue") == 0) goto L_No_tongues;
+ if (countitem("TreasureKey") == 0) goto L_No_treasure_key;
- if (countitem(701) == 0) goto L_No_ash;
- if (countitem(680) == 0 || countitem(681) == 0 || countitem(682) == 0 || countitem(683) == 0) goto L_No_herbs;
- if (countitem(518) == 0) goto L_No_bug_leg;
+ if (countitem("PileOfAsh") == 0) goto L_No_ash;
+ if (countitem("MauveHerb") == 0 || countitem("CobaltHerb") == 0 || countitem("GambogeHerb") == 0 || countitem("AlizarinHerb") == 0) goto L_No_herbs;
+ if (countitem("BugLeg") == 0) goto L_No_bug_leg;
- if (countitem(612) == 0) goto L_No_lamp;
- if (countitem(640) == 0) goto L_No_iron_ore;
- if (countitem(507) == 0 || countitem(517) == 0 || countitem(709) == 0) goto L_No_stingers;
+ if (countitem("CaveSnakeLamp") == 0) goto L_No_lamp;
+ if (countitem("IronOre") == 0) goto L_No_iron_ore;
+ if (countitem("ScorpionStinger") == 0 || countitem("RedScorpionStinger") == 0 || countitem("BlackScorpionStinger") == 0) goto L_No_stingers;
- if (countitem(718) == 0) goto L_No_silk;
- if (countitem(611) == 0) goto L_No_fur;
- if (countitem(631) == 0) goto L_No_dark_crystal;
+ if (countitem("SilkCocoon") == 0) goto L_No_silk;
+ if (countitem("WhiteFur") == 0) goto L_No_fur;
+ if (countitem("DarkCrystal") == 0) goto L_No_dark_crystal;
- if (countitem(541) == 0) goto L_No_water;
+ if (countitem("BottleOfWater") == 0) goto L_No_water;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(505) > 1 && countitem(518) > 1 && countitem(718) > 1
- && countitem(566) > 1 && countitem(565) > 1 && countitem(700) > 1
- && countitem(613) > 1 && countitem(569) > 1 && countitem(614) > 1
- && countitem(631) > 1 && countitem(640) > 1 && countitem(507) > 1
- && countitem(517) > 1 && countitem(709) > 1 && countitem(710) > 1
- && countitem(711) > 1 && countitem(712) > 1 && countitem(713) > 1
- && countitem(680) > 1 && countitem(681) > 1 && countitem(682) > 1
- && countitem(683) > 1 && countitem(537) > 1 && countitem(612) > 1
- && countitem(701) > 1 && countitem(541) > 1) goto L_TooMany;
-
- delitem 505, 1;
- delitem 518, 1;
- delitem 718, 1;
-
- delitem 566, 1;
- delitem 565, 1;
- delitem 700, 1;
-
- delitem 613, 1;
- delitem 569, 1;
- delitem 614, 1;
-
- delitem 631, 1;
- delitem 640, 1;
- delitem 507, 1;
-
- delitem 517, 1;
- delitem 709, 1;
- delitem 710, 1;
-
- delitem 711, 1;
- delitem 712, 1;
- delitem 713, 1;
-
- delitem 680, 1;
- delitem 681, 1;
- delitem 682, 1;
-
- delitem 683, 1;
- delitem 537, 1;
- delitem 612, 1;
-
- delitem 701, 1;
- delitem 541, 1;
+ if (@inventorylist_count == 100 && countitem("MaggotSlime") > 1 && countitem("BugLeg") > 1 && countitem("SilkCocoon") > 1
+ && countitem("SmallMushroom") > 1 && countitem("Petal") > 1 && countitem("Pearl") > 1
+ && countitem("HardSpike") > 1 && countitem("RawLog") > 1 && countitem("PinkAntenna") > 1
+ && countitem("DarkCrystal") > 1 && countitem("IronOre") > 1 && countitem("ScorpionStinger") > 1
+ && countitem("RedScorpionStinger") > 1 && countitem("BlackScorpionStinger") > 1 && countitem("SnakeTongue") > 1
+ && countitem("MountainSnakeTongue") > 1 && countitem("GrassSnakeTongue") > 1 && countitem("CaveSnakeTongue") > 1
+ && countitem("MauveHerb") > 1 && countitem("CobaltHerb") > 1 && countitem("GambogeHerb") > 1
+ && countitem("AlizarinHerb") > 1 && countitem("TreasureKey") > 1 && countitem("CaveSnakeLamp") > 1
+ && countitem("PileOfAsh") > 1 && countitem("WhiteFur") > 1 && countitem("BottleOfWater") > 1) goto L_TooMany;
+
+ delitem "MaggotSlime", 1;
+ delitem "BugLeg", 1;
+ delitem "SilkCocoon", 1;
+
+ delitem "SmallMushroom", 1;
+ delitem "Petal", 1;
+ delitem "Pearl", 1;
+
+ delitem "HardSpike", 1;
+ delitem "RawLog", 1;
+ delitem "PinkAntenna", 1;
+
+ delitem "DarkCrystal", 1;
+ delitem "IronOre", 1;
+ delitem "ScorpionStinger", 1;
+
+ delitem "RedScorpionStinger", 1;
+ delitem "BlackScorpionStinger", 1;
+ delitem "SnakeTongue", 1;
+
+ delitem "MountainSnakeTongue", 1;
+ delitem "GrassSnakeTongue", 1;
+ delitem "CaveSnakeTongue", 1;
+
+ delitem "MauveHerb", 1;
+ delitem "CobaltHerb", 1;
+ delitem "GambogeHerb", 1;
+
+ delitem "AlizarinHerb", 1;
+ delitem "TreasureKey", 1;
+ delitem "CaveSnakeLamp", 1;
+
+ delitem "WhiteFur", 1;
+ delitem "PileOfAsh", 1;
+ delitem "BottleOfWater", 1;
mes "You managed to preform the ritual and open the chest.";
- getitem 679, 1;
+ getitem "DemonMask", 1;
mes "You found a demon mask inside.";
set QUEST_demon_mines, 3;
close;
diff --git a/npc/013-3_Cave/sword_chest.txt b/npc/013-3_Cave/sword_chest.txt
index c570bfcd..5d2c97b7 100644
--- a/npc/013-3_Cave/sword_chest.txt
+++ b/npc/013-3_Cave/sword_chest.txt
@@ -12,11 +12,11 @@
close;
L_Yes:
- if(countitem(537) < 10) goto L_Not_Enough;
+ if(countitem("TreasureKey") < 10) goto L_Not_Enough;
getinventorylist;
- if (@inventorylist_count == 100 && countitem(537) > 10) goto L_TooMany;
- delitem 537, 10;
- getitem 536, 1;
+ if (@inventorylist_count == 100 && countitem("TreasureKey") > 10) goto L_TooMany;
+ delitem "TreasureKey", 10;
+ getitem "ShortSword", 1;
mes "[Chest]";
mes "You opened it and found a short sword!";
set ChestQuest, ChestQuest | 2;
diff --git a/npc/014-1_Woodland/wedding-officiator.txt b/npc/014-1_Woodland/wedding-officiator.txt
index 20c7297e..6e09af99 100644
--- a/npc/014-1_Woodland/wedding-officiator.txt
+++ b/npc/014-1_Woodland/wedding-officiator.txt
@@ -99,8 +99,8 @@ L_get_married:
if (@inventorylist_count > 98) goto L_No_Room_For_Rings;
set zeny, zeny - @WEDDING_FEE;
- getitem 702, 1;
- getitem 702, 1;
+ getitem "WeddingRing", 1;
+ getitem "WeddingRing", 1;
mes "[Wedding Officiator]";
mes "Wendy collects the fee.";
diff --git a/npc/015-1_Woodland/_import.txt b/npc/015-1_Woodland/_import.txt
index b7b63b22..4879bd5a 100644
--- a/npc/015-1_Woodland/_import.txt
+++ b/npc/015-1_Woodland/_import.txt
@@ -4,3 +4,4 @@ npc: npc/015-1_Woodland/_warps.txt
npc: npc/015-1_Woodland/alice.txt
npc: npc/015-1_Woodland/barrier.txt
npc: npc/015-1_Woodland/monsters.txt
+npc: npc/015-1_Woodland/sword.txt
diff --git a/npc/015-1_Woodland/sword.txt b/npc/015-1_Woodland/sword.txt
new file mode 100644
index 00000000..75142de3
--- /dev/null
+++ b/npc/015-1_Woodland/sword.txt
@@ -0,0 +1,356 @@
+015-1.gat,97,97,0 script #MagicSword#_M 127,{
+ if (getskilllv(SKILL_MAGIC))
+ goto L_message;
+ close;
+
+L_message:
+ set @Q_MASK, (NIBBLE_6_MASK | NIBBLE_7_MASK);
+ set @Q_SHIFT, NIBBLE_6_SHIFT;
+ set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
+
+ set @STATUS_INITIAL, 0;
+ set @STATUS_LEARNED_FLAREDART, 1;
+ set @STATUS_LEARNED_MAGICBLADE, 2;
+ set @STATUS_LEVEL2, 3;
+ set @STATUS_W11, 4;
+ set @STATUS_W12, 5;
+ set @STATUS_W11_12, 6;
+ set @STATUS_L2_ALLSPELLS, 7;
+
+ if (@Q_status == @STATUS_INITIAL) goto L_Initial;
+ if (@Q_status == @STATUS_LEARNED_FLAREDART) goto L_FlareStage;
+ if (@Q_status == @STATUS_LEARNED_MAGICBLADE) goto L_MagicBladeStage;
+ if (@Q_status == @STATUS_LEVEL2) goto L_L2_W12;
+ if (@Q_status == @STATUS_W11) goto L_L2_W12;
+ if (@Q_status == @STATUS_W12) goto L_L2_almost_done;
+ if (@Q_status == @STATUS_W11_12) goto L_L2_W10;
+
+ mes "[Mystic Sword]";
+ mes "\"I have taught thee all I can teach for now.\"";
+ next;
+ close;
+
+L_Initial:
+ mes "[Mystic Sword]";
+ mes "At this point, the river deepens, slowing down to a leisurely pace. In its center you notice an unusual stone, waves breaking around it.";
+ mes "Sticking out of the rock is a sword hilt.";
+ next;
+
+ mes "[Mystic Sword]";
+ mes "Suddenly, you hear a strange, metallic voice in your head, the voice of a woman.";
+ mes "\"A blissful day to thee, mortal!\"";
+ next;
+
+ mes "[Mystic Sword]";
+ mes "\"What is it is that brings thee to this place?\"";
+ next;
+
+ menu
+ "Who are you?", L_noq,
+ "Nothing in particular.", L_Initial_nothing,
+ "I was just exploring...", L_Initial_nothing,
+ "I am trying to learn magic!", L_Initial_learn;
+ close;
+
+L_noq:
+ mes "[Mystic Sword]";
+ mes "The voice sounds slightly amused.";
+ mes "\"How sad to hear how manners have degenerated in recent centuries. Farewell for now, dear mortal.\"";
+ next;
+ close;
+
+L_Initial_nothing:
+ mes "[Mystic Sword]";
+ mes "\"Then I wish thee well in thy travels, wanderer!\"";
+ next;
+ close;
+
+L_Initial_learn:
+ mes "[Mystic Sword]";
+ mes "\"Magic? Unless I am very mistaken thou already possessest some magic. Yet perhaps I can grant thee some slight aid by providing a magical invocation?\"";
+ next;
+
+ mes "[Mystic Sword]";
+ mes "\"Alas, my nature is not quite conductive for spells of healing or protection, though I can bestow upon thee the powers for a rather more martial kind of power.\"";
+ next;
+
+ menu
+ "I am not interested in that.", L_Farewell,
+ "It might be good for me to learn that.", -,
+ "I am quite interested.", -;
+
+ mes "[Mystic Sword]";
+ mes "\"Why is it that thou seekest this power?\"";
+ next;
+
+ menu
+ "Never mind.", L_Farewell,
+ "To become stronger!", L_Initial_selfish,
+ "To kill!", L_Initial_selfish,
+ "I don't know yet...", L_Initial_dontknow,
+ "To protect the ones I love!", L_Initial_protect;
+ close;
+
+L_Initial_selfish:
+ mes "[Mystic Sword]";
+ mes "\"Please return when thou art taking thy quest for magic a little more seriously.\"";
+ next;
+ close;
+
+L_Initial_dontknow:
+ mes "[Mystic Sword]";
+ mes "\"A fair and honest thought at so early a point in thine quest.\"";
+ goto L_Initial_ok;
+
+L_Initial_protect:
+ mes "[Mystic Sword]";
+ mes "\"Quite a high and laundable goal thou hast chosen for thyself! I do hope that thou canst live up to it.\"";
+
+L_Initial_ok:
+ mes "\"Hark, then, mortal! For I shall bestow upon thee the secret of the flare dart spell!\"";
+ next;
+
+ mes "[Mystic Sword]";
+ mes "\"Oh, my apologies-- that was a little overly dramatic. But I do not get to talk to thy kin anymore all that often.\"";
+ next;
+
+ mes "[Mystic Sword]";
+ mes "\"For the flare dart spell throw a handful of sulphur powder up into the air, and say, '" + getspellinvocation("flare-dart") + "'.\"";
+ set @Q_status, @STATUS_LEARNED_FLAREDART;
+ callsub S_update_var;
+ next;
+
+ mes "[Mystic Sword]";
+ mes "\"From then on, thou canst shoot fiery missiles from thy fingers, for a limited time.\"";
+ next;
+
+ mes "[Mystic Sword]";
+ mes "\"Use it wisely, mortal!.\"";
+ next;
+
+ goto L_Farewell;
+
+L_FlareStage:
+ menu
+ "Uhm... Hello, Sword?", L_FlareStage_hello,
+ "Can you teach me more magic?", L_FlareStage_impolite,
+ "Where can I get sulphur powder?", L_FlareStage_impolite;
+ close;
+
+L_FlareStage_impolite:
+ mes "[Mystic Sword]";
+ mes "You hear a metallic chime in your head. After a second, you come to the conclusion that it was probably the sword sighing.";
+ mes "\"Greetings to thee, too, mortal, and farewell until thou hast learned some proper manners.\"";
+ next;
+ close;
+
+L_FlareStage_hello:
+ mes "[Mystic Sword]";
+ mes "\"Well met once more, mortal! What brings thee here?\"";
+ next;
+
+ menu
+ "Can you teach me more magic?", L_FlareStage_moremagic,
+ "Where can I find sulphur powder?", L_FlareStage_sulphur,
+ "Farewell!", L_Farewell;
+ close;
+
+L_FlareStage_moremagic:
+ mes "[Mystic Sword]";
+ mes "\"I can indeed! But first I must see if thou art worthy. Find my brother, and talk to him! If thou canst find him, he shall teach thee another spell.\"";
+ next;
+ goto L_Farewell;
+
+L_FlareStage_sulphur:
+ mes "[Mystic Sword]";
+ mes "\"I do not know, though I suggest to seek out a local alchemist, if there is any.\"";
+ next;
+ goto L_Farewell;
+
+L_MagicBladeStage:
+ mes "[Mystic Sword]";
+ mes "\"Welcome back! Thou hast now learned two basic spells of War magic.\"";
+ next;
+
+ mes "[Mystic Sword]";
+ mes "\"Dost thou wish to continue thy pursuits of this school of magic?\"";
+ next;
+
+ menu
+ "No.", -,
+ "Yes.", L_Levelup2_yes;
+
+ goto L_Farewell;
+
+L_Levelup2_yes:
+ mes "[Mystic Sword]";
+ mes "\"Beware of what thou wishest for, mortal...\"";
+ next;
+
+ if (!MPQUEST) goto L_Levelup2_must_reg;
+ if (MPQUEST && (Mobpt < 1000)) goto L_Levelup2_must_practice;
+
+ mes "[Mystic Sword]";
+ mes "\"Thou hast collected " + Mobpt + " Monster Points. For one thousand of them, I shall admit thee to the school of war magic.\"";
+ next;
+
+ menu
+ "OK!", -,
+ "No... never mind.", L_Farewell;
+
+ set Mobpt, Mobpt - 1000;
+
+ mes "[Mystic Sword]";
+ mes "The sword begins to chant in your head!";
+ mes "\"Lords of Thunder, Fire, Rage!\"";
+ mes "\"Grant thy powers to this mage,\"";
+ mes "\"Rising with thy dreadful roar,\"";
+ if (Sex)
+ mes "\"Answer to his call to War!\"";
+ if (!Sex)
+ mes "\"Answer to her call to War!\"";
+ next;
+
+ mes "[Mystic Sword]";
+ mes "Your heart starts pounding, and suddenly you can hear the sound of drums in your head.";
+ mes "You smell something metallic...";
+ next;
+
+ mes "[Mystic Sword]";
+ mes "The sensation and the noises vanish as quickly as they came.";
+ mes "[5000 experience points]";
+ mes "[Level 2 in War Magic]";
+
+ set @Q_status, @STATUS_LEVEL2;
+ callsub S_update_var;
+ getexp 5000, 0;
+ if (getskilllv(SKILL_MAGIC_WAR) < 2)
+ setskill SKILL_MAGIC_WAR, 2;
+ next;
+
+ mes "[Mystic Sword]";
+ mes "\"Thou hast now taken thy first true step down the path of war magic.\"";
+ next;
+ goto L_Farewell;
+
+
+L_Levelup2_must_reg:
+ mes "[Mystic Sword]";
+ mes "\"To learn further magic, thou must advance in the school of war magic. I shall grant thee this advance if thou provest thy worthiness as a warrior.\"";
+ next;
+ mes "[Mystic Sword]";
+ mes "\"Travel to the city of Tulimshar, and talk to Aidan. Then, collect one thousand Monster Points and return to me.\"";
+ next;
+ goto L_Farewell;
+
+L_Levelup2_must_practice:
+ mes "[Mystic Sword]";
+ mes "\"To advance thy magical powers, I must admit thee to the school of war magic. Prove to me that thou art a worthy warrior by collecting one thousand Monster Points, and return.\"";
+ next;
+ goto L_Farewell;
+
+L_Farewell:
+ mes "[Mystic Sword]";
+ mes "\"Farewell for now!\"";
+ next;
+ close;
+
+L_L2_W12:
+ mes "[Mystic Sword]";
+ mes "\"Welcome back, traveler! Hast thou returned to advance in thy quest for magic?\"";
+ next;
+ menu
+ "No.", L_farewell,
+ "Yes.", -;
+
+ mes "[Mystic Sword]";
+ mes "\"Very well. I shall teach thee another spell, if thou provest thy progress by sacrificing another five thousand monster points.\"";
+ next;
+ menu
+ "No, I don't want that.", L_farewell,
+ "So be it.", -;
+
+ if (Mobpt < 5000) goto L_lacking_mobpoints;
+
+ mes "[Mystic Sword]";
+ mes "\"Indeed thou art worthy. The next spell I shall teach thee will enchant thy knuckles to turn them into powerful weapons; the component is a mere beer.\"";
+ mes "[1000 experience points]";
+ set Mobpt, Mobpt - 5000;
+ getexp 1000, 0;
+ set @Q_status, @Q_status + 2;
+ callsub S_update_var;
+ next;
+
+ mes "[Mystic Sword]";
+ mes "\"Speak '" + getspellinvocation("magic-knuckles") + "' and take a glass of beer and drink it, without ever taking it off thy lips. This will harden and enchant thy fists, turning them into powerful weapons.\"";
+ next;
+ close;
+
+L_L2_almost_done:
+ mes "[Mystic Sword]";
+ mes "\"Greetings once more, traveler! I have another spell I wish to teach thee, but first thou must learn my brother's arrow spell.\"";
+ next;
+ close;
+
+L_L2_W10:
+ mes "[Mystic Sword]";
+ mes "\"Welcome back!\"";
+ next;
+
+ mes "[Mystic Sword]";
+ mes "\"I shall now teach thee the final spell of this level of war magic. For further spells thou wilt have to increase thy magical powers more.\"";
+ next;
+
+ mes "[Mystic Sword]";
+ mes "\"For this spell, I ask that thou bringest a lump of iron ore. Thou must also sacrifice ten thousand monster points.\"";
+ next;
+
+ menu
+ "OK.", -,
+ "No way.", L_farewell;
+
+ if (countitem("IronOre") < 1)
+ goto L_no_ore;
+ if (MPQUEST && (Mobpt < 10000)) goto L_lacking_mobpoints;
+
+ mes "[Mystic Sword]";
+ mes "\"Raise up the ore, mortal!\"";
+ mes "As you do so, the ore begins to crumble, leaving only iron powder behind.";
+ mes "[1000 experience points]";
+ set Mobpt, Mobpt - 10000;
+ getexp 1000, 0;
+ delitem "IronOre", 1;
+ getitem "IronPowder", 5;
+ set @Q_status, @STATUS_L2_ALLSPELLS;
+ callsub S_update_var;
+ next;
+
+ mes "[Mystic Sword]";
+ mes "\"This powder thou shalst need to cast the lightning spell. Throw it up into the air and shout '" + getspellinvocation("lightning-strike") + "', and smite thine enemies with lightning.\"";
+ next;
+ goto L_farewell;
+
+L_no_ore:
+ mes "[Mystic Sword]";
+ mes "\"Thou dost appear to lack ore. We cannot continue; please fare well and return swiftly!\"";
+ next;
+ close;
+
+L_farewell:
+ mes "[Mystic Sword]";
+ mes "\"Then I bid thee farewell for now!\"";
+ next;
+ close;
+
+L_lacking_mobpoints:
+ mes "[Mystic Sword]";
+ mes "\"Thou dost not have enough monster points to prove thy worthiness. Return when thou hast slain more monsters!\"";
+ next;
+ close;
+
+S_update_var:
+ set QUEST_MAGIC,
+ (QUEST_MAGIC & ~(@Q_MASK)
+ | (@Q_status << @Q_SHIFT));
+ return;
+}
diff --git a/npc/015-3/katze.txt b/npc/015-3/katze.txt
index 19611e93..1654542c 100644
--- a/npc/015-3/katze.txt
+++ b/npc/015-3/katze.txt
@@ -69,17 +69,17 @@ L_NeedsFur:
mes "\"Prrr. Meow, prrr...\"";
next;
- if (countitem(611) > 0) // White Fur
+ if (countitem("WhiteFur") > 0)
menu "Make funny movements with the fur near the ground", L_MoveFur,
"Throw a stone at the cat", L_ThrowStone,
"Leave the cat alone", -;
- if (countitem(611) == 0)
+ if (countitem("WhiteFur") == 0)
menu "Throw a stone at the cat", L_ThrowStone,
"Leave the cat alone", -;
close;
L_MoveFur:
- delitem 611, 1; // Cat takes the white fur
+ delitem "WhiteFur", 1;
set Katze, 3;
mes "The cat jumps at the fur! You quickly let go of it. The cat happily returns to its spot, carrying the fur in its mouth.";
next;
@@ -91,7 +91,7 @@ L_NeedsWood:
mes "\"Prrrr, now I'd like something to sharpen my claws on.\"";
next;
- if (countitem(569) > 0) // Raw log
+ if (countitem("RawLog") > 0)
menu "Want this piece of wood?", L_GiveWood,
"Ok, see you later", -;
close;
@@ -109,12 +109,12 @@ L_NeedsStuff:
set Katze, 5;
mes "[Katze]";
mes "\"You've been really kind to me. I can make you something nice, but I will need";
- mes "2 snake skins,";
- mes "2 snake tongues,";
- mes "2 maggot slimes,";
- mes "2 white furs,";
- mes "2 hard spikes and";
- mes "2 tiny healing potions.\"";
+ mes "2 [snake skin]s,";
+ mes "2 [snake tongue]s,";
+ mes "2 [maggot slime]s,";
+ mes "2 [white fur]s,";
+ mes "2 [hard spike]s and";
+ mes "2 [tiny healing potion]s.\"";
close;
L_NeedsStuff2:
@@ -137,33 +137,33 @@ L_WhatsNeeded:
L_Please:
mes "[Katze]";
mes "\"Alright... [the cat glares at you] it was";
- mes "2 snake skins,";
- mes "2 snake tongues,";
- mes "2 maggot slimes,";
- mes "2 white furs,";
- mes "2 hard spikes and";
- mes "2 tiny healing potions.\"";
+ mes "2 [snake skin]s,";
+ mes "2 [snake tongue]s,";
+ mes "2 [maggot slime]s,";
+ mes "2 [white fur]s,";
+ mes "2 [hard spike]s and";
+ mes "2 [tiny healing potion]s.\"";
close;
L_CatChecksStuff:
- if (countitem(641) > 1 && // Snake skin
- countitem(710) > 1 && // Snake tongue
- countitem(505) > 1 && // Maggot slime
- countitem(611) > 1 && // White fur
- countitem(613) > 1 && // Hard spike
- countitem(684) > 1) // Tiny healing potion
+ if (countitem("SnakeSkin") > 1 &&
+ countitem("SnakeTongue") > 1 &&
+ countitem("MaggotSlime") > 1 &&
+ countitem("WhiteFur") > 1 &&
+ countitem("HardSpike") > 1 &&
+ countitem("TinyHealingPotion") > 1)
goto L_GiveStuff;
mes "[Katze]";
mes "\"You don't seem to have everything yet. Come back later when you do.\"";
close;
L_GiveStuff:
- delitem 641, 2;
- delitem 710, 2;
- delitem 505, 2;
- delitem 611, 2;
- delitem 613, 2;
- delitem 684, 2;
+ delitem "SnakeSkin", 2;
+ delitem "SnakeTongue", 2;
+ delitem "MaggotSlime", 2;
+ delitem "WhiteFur", 2;
+ delitem "HardSpike", 2;
+ delitem "TinyHealingPotion", 2;
set Katze, 6;
set KatzeBeenOutside, 0;
mes "[Katze]";
@@ -176,7 +176,7 @@ L_PreGainEars:
close;
L_GainEars:
- getitem 1217, 1; // Cat ears
+ getitem "CatEars", 1;
set @xpval, 5000;
getexp @xpval, 0;
set Katze, 7;
diff --git a/npc/015-3/pot.txt b/npc/015-3/pot.txt
index 94039990..a965223d 100644
--- a/npc/015-3/pot.txt
+++ b/npc/015-3/pot.txt
@@ -20,14 +20,14 @@
if (Katze >= 4) goto L_Finished;
L_NeedsMilk:
- if (countitem(527) > 0)
+ if (countitem("Milk") > 0)
menu
"Pour in some milk", L_GiveMilk,
"Leave it alone", -;
close;
L_GiveMilk:
- delitem 527, 1;
+ delitem "Milk", 1;
set Katze, 1;
set KatzeBeenOutside, 0;
close;
@@ -40,29 +40,29 @@ L_NeedsFood:
mes "The milk is gone!";
next;
- if (countitem(562) > 0 && countitem(676) > 0)
+ if (countitem("ChickenLeg") > 0 && countitem("Steak") > 0)
menu
"Put in a chicken leg", L_GiveChicken,
"Put in a steak", L_GiveSteak,
"Leave it alone", -;
- if (countitem(562) > 0 && countitem(676) == 0)
+ if (countitem("ChickenLeg") > 0 && countitem("Steak") == 0)
menu
"Put in a chicken leg", L_GiveChicken,
"Leave it alone", -;
- if (countitem(562) == 0 && countitem(676) > 0)
+ if (countitem("ChickenLeg") == 0 && countitem("Steak") > 0)
menu
"Put in a steak", L_GiveSteak,
"Leave it alone", -;
close;
L_GiveChicken:
- delitem 562, 1;
+ delitem "ChickenLeg", 1;
set Katze, 2;
set KatzeBeenOutside, 0;
close;
L_GiveSteak:
- delitem 676, 1;
+ delitem "Steak", 1;
set Katze, 2;
set KatzeBeenOutside, 0;
close;
@@ -75,7 +75,7 @@ L_NeedsFur:
mes "And it's empty!";
next;
- if (countitem(611) > 0) // White Fur
+ if (countitem("WhiteFur") > 0)
menu "Put a white fur next to the pot", L_GiveFur,
"Leave it alone", -;
close;
@@ -85,13 +85,13 @@ L_GiveFur:
close;
L_NeedsWood:
- if (countitem(569) > 0) // Raw log
+ if (countitem("RawLog") > 0)
menu "Put a wooden log next to the pot", L_GiveWood,
"Leave it alone", -;
close;
L_GiveWood:
- delitem 569, 1;
+ delitem "RawLog", 1;
set Katze, 4;
set KatzeBeenOutside, 0;
mes "You put the wooden log next to the pot. The cat eyes it suspiciously, but remains on her spot.";
diff --git a/npc/018-1_Woodland_mining_camp/_import.txt b/npc/018-1_Woodland_mining_camp/_import.txt
index 9be2065c..06c8a307 100644
--- a/npc/018-1_Woodland_mining_camp/_import.txt
+++ b/npc/018-1_Woodland_mining_camp/_import.txt
@@ -2,3 +2,4 @@ map: 018-1.gat
npc: npc/018-1_Woodland_mining_camp/_mobs.txt
npc: npc/018-1_Woodland_mining_camp/_warps.txt
npc: npc/018-1_Woodland_mining_camp/miners.txt
+npc: npc/018-1_Woodland_mining_camp/sword.txt
diff --git a/npc/018-1_Woodland_mining_camp/sword.txt b/npc/018-1_Woodland_mining_camp/sword.txt
new file mode 100644
index 00000000..7352384d
--- /dev/null
+++ b/npc/018-1_Woodland_mining_camp/sword.txt
@@ -0,0 +1,12 @@
+018-1.gat,110,43,0 script #IceSword#_M 127,{
+ if (getskilllv(SKILL_MAGIC))
+ goto L_message;
+
+ close;
+
+L_message:
+ mes "[Sword in Pond]";
+ mes "\"Zzzzzz.....\"";
+ next;
+ close;
+}
diff --git a/npc/018-2_Woodland_mining_camp/caul.txt b/npc/018-2_Woodland_mining_camp/caul.txt
index a4d22ea7..f03aeff5 100644
--- a/npc/018-2_Woodland_mining_camp/caul.txt
+++ b/npc/018-2_Woodland_mining_camp/caul.txt
@@ -13,22 +13,11 @@
set @SETZER_KNOWS_STINGER, 2;
set @SETZER_FLAG_MADE_OIL, 4;
- set @PEARL, 700;
- set @SNAKE_SKIN, 641;
- set @BLACK_STINGER, 709;
- set @ASH_PILE, 701;
- set @GOLDEN_STINGER, 706;
- set @MONSTER_OIL, 707;
set @MONSTER_OIL_XP, 100000;
set @Q_MASK, NIBBLE_3_MASK;
set @Q_SHIFT, NIBBLE_3_SHIFT;
- set @MAUVE, 680;
- set @COBALT, 681;
- set @GAMBOGE, 682;
- set @ALIZARIN, 683;
-
set @Q_status, (QUEST_Forestbow_state & @Q_MASK) >> @Q_SHIFT;
mes "[Caul]";
@@ -92,10 +81,10 @@ L_brew:
mes "\"Now put " + @num + " herbs of each kind into the cauldron, stir, and concentrate all your mental energy on it.\"";
next;
- if (countitem(@MAUVE) < @num) goto L_NotEnough;
- if (countitem(@COBALT) < @num) goto L_NotEnough;
- if (countitem(@GAMBOGE) < @num) goto L_NotEnough;
- if (countitem(@ALIZARIN) < @num) goto L_NotEnough;
+ if (countitem("MauveHerb") < @num) goto L_NotEnough;
+ if (countitem("CobaltHerb") < @num) goto L_NotEnough;
+ if (countitem("GambogeHerb") < @num) goto L_NotEnough;
+ if (countitem("AlizarinHerb") < @num) goto L_NotEnough;
set @a, @num;
set @result1, 0;
@@ -118,10 +107,10 @@ L_CraftLoop:
set @a, @a - 1;
if (@a > 0) goto L_CraftLoop;
- delitem @MAUVE, @num;
- delitem @COBALT, @num;
- delitem @GAMBOGE, @num;
- delitem @ALIZARIN, @num;
+ delitem "MauveHerb", @num;
+ delitem "CobaltHerb", @num;
+ delitem "GambogeHerb", @num;
+ delitem "AlizarinHerb", @num;
getitem 684, @result1;
getitem 685, @result2;
@@ -221,16 +210,16 @@ L_monster_oil_where_gold:
L_monster_oil_start_brew:
set @main_menu, 0;
- if (countitem (@PEARL) < 1) goto L_monster_oil_missing;
- if (countitem (@SNAKE_SKIN) < 2) goto L_monster_oil_missing;
- if (countitem (@BLACK_STINGER) < 3) goto L_monster_oil_missing;
- if (countitem (@ASH_PILE) < 2) goto L_monster_oil_missing;
- if (countitem (@GOLDEN_STINGER) < 1) goto L_monster_oil_missing_gold;
+ if (countitem ("Pearl") < 1) goto L_monster_oil_missing;
+ if (countitem ("SnakeSkin") < 2) goto L_monster_oil_missing;
+ if (countitem ("BlackScorpionStinger") < 3) goto L_monster_oil_missing;
+ if (countitem ("PileOfAsh") < 2) goto L_monster_oil_missing;
+ if (countitem ("GoldenScorpionStinger") < 1) goto L_monster_oil_missing_gold;
- delitem @PEARL, 1;
- delitem @SNAKE_SKIN, 2;
- delitem @BLACK_STINGER, 3;
- delitem @ASH_PILE, 2;
+ delitem "Pearl", 1;
+ delitem "SnakeSkin", 2;
+ delitem "BlackScorpionStinger", 3;
+ delitem "PileOfAsh", 2;
set @bubble_mode, 0;
setarray @bubble_modes$,
@@ -301,35 +290,35 @@ L_monster_oil_out_of_leaves:
goto L_monster_oil_loop;
L_monster_oil_alizarin:
- set @use_leaf, @ALIZARIN;
+ set @use_leaf$, "AlizarinHerb";
set @use_color, 1;
goto L_monster_oil_leaf_color;
L_monster_oil_gamboge:
- set @use_leaf, @GAMBOGE;
+ set @use_leaf$, "GambogeHerb";
set @use_color, 2;
goto L_monster_oil_leaf_color;
L_monster_oil_cobalt:
- set @use_leaf, @COBALT;
+ set @use_leaf$, "CobaltHerb";
set @use_color, 4;
goto L_monster_oil_leaf_color;
L_monster_oil_leaf_color:
- if (countitem (@use_leaf) < 1) goto L_monster_oil_out_of_leaves;
+ if (countitem (@use_leaf$) < 1) goto L_monster_oil_out_of_leaves;
callsub S_monster_oil_random_move;
if (@color & @use_color) goto L_monster_oil_pc_bad;
set @color, @color | @use_color;
- delitem @use_leaf, 1;
+ delitem @use_leaf$, 1;
mes "The brew changes its hue as your leaf dissolves.";
next;
goto L_monster_oil_loop;
L_monster_oil_mauve:
- if (countitem(@MAUVE) < 1) goto L_monster_oil_out_of_leaves;
- delitem @MAUVE, 1;
+ if (countitem("MauveHerb") < 1) goto L_monster_oil_out_of_leaves;
+ delitem "MauveHerb", 1;
callsub S_monster_oil_random_move;
if (@intensity == 2 && @color == 7) goto L_monster_oil_done;
@@ -432,12 +421,12 @@ L_monster_oil_done:
mes "[Brewing monster oil]";
mes "As instructed, you toss in your golden scorpion stinger.";
- if (countitem (@GOLDEN_STINGER) < 1) goto L_monster_oil_no_gold_end;
+ if (countitem ("GoldenScorpionStinger") < 1) goto L_monster_oil_no_gold_end;
mes "The brew bubbles once more, then calms completely.";
- delitem @GOLDEN_STINGER, 1;
- getitem @MONSTER_OIL, 1;
+ delitem "GoldenScorpionStinger", 1;
+ getitem "MonsterOilPotion", 1;
if (!(@Q_status & @SETZER_FLAG_MADE_OIL))
getexp @MONSTER_OIL_XP, 0;
diff --git a/npc/018-3_Cave/_import.txt b/npc/018-3_Cave/_import.txt
index cf5a8562..2f30ca7c 100644
--- a/npc/018-3_Cave/_import.txt
+++ b/npc/018-3_Cave/_import.txt
@@ -2,3 +2,4 @@ map: 018-3.gat
npc: npc/018-3_Cave/_mobs.txt
npc: npc/018-3_Cave/_warps.txt
npc: npc/018-3_Cave/bookcase.txt
+npc: npc/018-3_Cave/sword.txt
diff --git a/npc/018-3_Cave/sword.txt b/npc/018-3_Cave/sword.txt
new file mode 100644
index 00000000..c4a62a8a
--- /dev/null
+++ b/npc/018-3_Cave/sword.txt
@@ -0,0 +1,12 @@
+018-3.gat,71,127,0 script #DemonSword#_M 127,{
+ if (getskilllv(SKILL_MAGIC))
+ goto L_message;
+
+ close;
+
+L_message:
+ mes "[Sword in Rock]";
+ mes "\"Ouch... my head...\"";
+ next;
+ close;
+}
diff --git a/npc/019-1_Snow_field/santa_helper.txt b/npc/019-1_Snow_field/santa_helper.txt
index a8a86af6..e9c0772d 100644
--- a/npc/019-1_Snow_field/santa_helper.txt
+++ b/npc/019-1_Snow_field/santa_helper.txt
@@ -19,26 +19,26 @@ L_Y:
mes "[Santa's Helper]";
mes "\"Hmm, let me check what you have.\"";
next;
- if (countitem(515) < 25) goto L_NoItem;
- if (countitem(516) < 20) goto L_NoItem;
- if (countitem(538) < 5) goto L_NoItem;
+ if (countitem("PurplePresentBox") < 25) goto L_NoItem;
+ if (countitem("BluePresentBox") < 20) goto L_NoItem;
+ if (countitem("GreenPresentBox") < 5) goto L_NoItem;
getinventorylist;
if (@inventorylist_count > 99) goto L_TooMany;
mes "[Santa's Helper]";
mes "\"Great! Here is something for you\"";
- delitem 515, 25;
- delitem 516, 20;
- delitem 538, 5;
- getitem 564, 1;
+ delitem "PurplePresentBox", 25;
+ delitem "BluePresentBox", 20;
+ delitem "GreenPresentBox", 5;
+ getitem "TurtleneckSweater", 1;
set ChristmasQuest2,1;
close;
L_R:
mes "[Santa's Helper]";
mes "\"I need:";
- mes "25 purple present boxes";
- mes "20 blue present boxes";
- mes "5 green present boxes\"";
+ mes "25 [purple present box]es";
+ mes "20 [blue present box]es";
+ mes "5 [green present box]es\"";
next;
goto L_M;
diff --git a/npc/019-1_Snow_field/snowman.txt b/npc/019-1_Snow_field/snowman.txt
index ca8c1f09..72b40a13 100644
--- a/npc/019-1_Snow_field/snowman.txt
+++ b/npc/019-1_Snow_field/snowman.txt
@@ -21,16 +21,17 @@ L_Sure:
mes "[Snowman]";
mes "\"Hmm, let me see what you have.\"";
next;
- if(countitem(510) < 15) goto L_NoItem;
- if(countitem(509) < 10) goto L_NoItem;
- if(countitem(502) < 5) goto L_NoItem;
+ if(countitem("Candy") < 15) goto L_NoItem;
+ if(countitem("ChocolateBar") < 10) goto L_NoItem;
+ if(countitem("CactusPotion") < 5) goto L_NoItem;
getinventorylist;
if (@inventorylist_count > 99) goto L_TooMany;
- delitem 510, 15;
- delitem 509, 10;
- delitem 502, 5;
+ delitem "Candy", 15;
+ delitem "ChocolateBar", 10;
+ delitem "CactusPotion", 5;
+ mes "[Snowman]";
mes "\"Here you go, enjoy your new hat!\"";
- getitem 511, 1;
+ getitem "SantaHat", 1;
set ChristmasQuest, 1;
close;
@@ -38,9 +39,9 @@ L_Need:
mes "[Snowman]";
mes "\"For this special hat, I need a pint of magic and a little help.";
mes "Just kidding. I would like to get some food:";
- mes "15 Candies";
- mes "10 Chocolate bars";
- mes "5 Cactus potions\"";
+ mes "15 pieces of [Candy]";
+ mes "10 [Chocolate bar]s";
+ mes "5 [Cactus potion]s\"";
next;
goto L_Menu;
diff --git a/npc/020-1_Nivalis/_import.txt b/npc/020-1_Nivalis/_import.txt
index cda51aa5..89ef0a63 100644
--- a/npc/020-1_Nivalis/_import.txt
+++ b/npc/020-1_Nivalis/_import.txt
@@ -1,6 +1,5 @@
map: 020-1.gat
npc: npc/020-1_Nivalis/_mobs.txt
npc: npc/020-1_Nivalis/_warps.txt
-npc: npc/020-1_Nivalis/amrak.txt
npc: npc/020-1_Nivalis/soul-menhir.txt
npc: npc/020-1_Nivalis/startrek.txt
diff --git a/npc/020-1_Nivalis/amrak.txt b/npc/020-1_Nivalis/amrak.txt
deleted file mode 100644
index 19979ca0..00000000
--- a/npc/020-1_Nivalis/amrak.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-
-020-1.gat,66,90,0 script Amrak 103, {
- mes "[Amrak]";
- mes "\"This... stone...";
- mes "I have never seen a mineral like this";
- mes "before.";
- mes "And some strange... aura... seems to";
- mes "emit from it.\"";
- next;
- mes "[Amrak]";
- mes "\"Where did it come from?";
- mes "How did it got here?";
- mes "What's its purpose?";
- mes "I will solve its riddle for sure.\"";
- close;
-}
diff --git a/npc/020-2_Nivalis/furquest.txt b/npc/020-2_Nivalis/furquest.txt
index afcb5221..2d988f75 100644
--- a/npc/020-2_Nivalis/furquest.txt
+++ b/npc/020-2_Nivalis/furquest.txt
@@ -74,59 +74,59 @@ L_State_0_3:
L_State_0_4:
mes "[Agostine, The Legendary Tailor]";
mes "\"So, a Cactus Drink?\"";
- if (countitem(501) < 1) goto L_State_neg;
+ if (countitem("CactusDrink") < 1) goto L_State_neg;
next;
- delitem 501, 1;
+ delitem "CactusDrink", 1;
goto L_State_bad;
close;
L_State_0_5:
mes "[Agostine, The Legendary Tailor]";
mes "\"So, a Cactus Potion?\"";
- if (countitem(502) < 1) goto L_State_neg;
+ if (countitem("CactusPotion") < 1) goto L_State_neg;
next;
- delitem 502, 1;
+ delitem "CactusPotion", 1;
goto L_State_bad;
close;
L_State_0_6:
mes "[Agostine, The Legendary Tailor]";
mes "\"So, some milk for me?\"";
- if (countitem(527) < 1) goto L_State_neg;
- delitem 527, 1;
+ if (countitem("Milk") < 1) goto L_State_neg;
+ delitem "Milk", 1;
goto L_State_bad;
close;
L_State_0_7:
mes "[Agostine, The Legendary Tailor]";
mes "\"So, a beer?\"";
- if (countitem(539) < 1) goto L_State_neg;
+ if (countitem("Beer") < 1) goto L_State_neg;
next;
- delitem 539, 1;
+ delitem "Beer", 1;
goto L_State_bad;
close;
L_State_0_8:
mes "[Agostine, The Legendary Tailor]";
mes "\"So, a Concentration Potion?\"";
- if (countitem(568) < 1) goto L_State_neg;
+ if (countitem("ConcentrationPotion") < 1) goto L_State_neg;
next;
- delitem 568, 1;
+ delitem "ConcentrationPotion", 1;
goto L_State_bad;
close;
L_State_0_9:
mes "[Agostine, The Legendary Tailor]";
mes "\"So, an Iron Potion?\"";
- if (countitem(567) < 1) goto L_State_neg;
+ if (countitem("IronPotion") < 1) goto L_State_neg;
next;
- delitem 567, 1;
+ delitem "IronPotion", 1;
mes "Agostine looks pleased as he drinks the potion.";
next;
mes "[Agostine, The Legendary Tailor]";
mes "\"Oh! This is damn good! I feel a new man, my friend!\"";
next;
- set zeny, zeny+500;
+ set zeny, zeny + 500;
mes "[Agostine, The Legendary Tailor]";
mes "\"This is a little reward for your help. Take 500 GP, my friend!\"";
set QUEST_WG_state, 2;
@@ -176,7 +176,7 @@ L_State_3:
L_State_4:
mes "[Agostine, The Legendary Tailor]";
mes "\"Oh, my friend! Have you brought me some good furs?\"";
- if (countitem(611) < 1) close;
+ if (countitem("WhiteFur") < 1) close;
next;
menu
"Here, take a look!", L_State_4_try,
@@ -188,14 +188,14 @@ L_State_4_try:
mes "\"Let me see, my friend! It needs to be perfect for my gloves!\"";
mes "Agostine examines the patch of fur.";
next;
- delitem 611, 1;
+ delitem "WhiteFur", 1;
set @Temp1,rand(30);
if (@Temp1 == 0) goto L_State_4_success;
mes "Agostine throws away the white fur.";
next;
mes "[Agostine, The Legendary Tailor]";
mes "\"It was awfully cut! You should pay more attention when you kill fluffies!\"";
- if (countitem(611) < 1) close;
+ if (countitem("WhiteFur") < 1) close;
next;
menu
"Here I have another one!", L_State_4_try,
@@ -224,8 +224,8 @@ L_State_5_pay:
if (zeny < 15000) goto L_State_5_nocash;
getinventorylist;
if (@inventorylist_count == 100) goto L_TooMany;
- set zeny, zeny-15000;
- getitem 563, 1;
+ set zeny, zeny - 15000;
+ getitem "WinterGloves", 1;
set QUEST_WG_state, 6;
mes "[Agostine, The Legendary Tailor]";
mes "\"Here they are. You will have the more fashionable hands in the world!\"";
@@ -260,7 +260,7 @@ L_State_10:
L_State_11:
mes "[Agostine, The Legendary Tailor]";
mes "\"So, my friend, have you brought me the right Fur?\"";
- if (countitem(611) < 1) close;
+ if (countitem("WhiteFur") < 1) close;
next;
menu
"Sure, I'm a fluffy hunter!", L_State_11_try,
@@ -273,14 +273,14 @@ L_State_11_try:
next;
mes "Agostine examines the patch of fur.";
next;
- delitem 611, 1;
+ delitem "WhiteFur", 1;
set @Temp2,rand(30);
if (@Temp2 == 0) goto L_State_11_success;
mes "Agostine rips the white fur.";
next;
mes "[Agostine, The Legendary Tailor]";
mes "\"That fur was terrible. I won't work with it!\"";
- if (countitem(611) < 1) close;
+ if (countitem("WhiteFur") < 1) close;
next;
menu
"Well, maybe this is better!", L_State_11_try,
@@ -292,7 +292,7 @@ L_State_11_success:
next;
mes "[Agostine, The Legendary Tailor]";
mes "\"This one is good enough, my friend. Good job.\"";
- delitem 611, 1;
+ delitem "WhiteFur", 1;
set QUEST_WG_state, 8;
goto L_State_12;
@@ -308,11 +308,11 @@ L_State_12:
L_State_12_pay:
if (zeny < 15000) goto L_State_12_missing;
- if (countitem(528) < 1) goto L_State_12_missing;
+ if (countitem("Boots") < 1) goto L_State_12_missing;
// No inventory check needed, as boots are removed, opening a slot
- set zeny, zeny-15000;
- delitem 528, 1;
- getitem 655, 1;
+ set zeny, zeny - 15000;
+ delitem "Boots", 1;
+ getitem "FurBoots", 1;
set QUEST_WG_state, 9;
mes "[Agostine, The Legendary Tailor]";
mes "\"Enjoy your new boots, my friend!\"";
diff --git a/npc/functions/magic.txt b/npc/functions/magic.txt
new file mode 100644
index 00000000..0094e94a
--- /dev/null
+++ b/npc/functions/magic.txt
@@ -0,0 +1,138 @@
+// Basic magic functionality
+
+// Magic system uses:
+// - MAGIC_EXP (magic experience points, gained for spellcasting)
+// - MAGIC_FLAGS
+// Magic quests use:
+// - QUEST_MAGIC
+// - QUEST_MAGIC2
+
+// ------------------------------------------------------------
+// Gain initial magic skill
+// ------------------------------------------------------------
+function script MagicGainBasic {
+
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_DRANK_POTION;
+ close;
+
+}
+
+// ------------------------------------------------------------
+// Initialise Menu for selecting a choice of things to ask about
+// ------------------------------------------------------------
+function script MagicTalkOptionsSetup {
+ set @QQ_ELANORE, 1;
+ set @QQ_MANASEED, 2;
+ set @QQ_MANAPOTION, 3;
+ set @QQ_WYARA, 4;
+ set @QQ_SAGATHA, 5;
+ set @QQ_AULDSBEL, 6;
+ set @QQ_IMP, 7;
+ set @QQ_OLDWIZ, 8;
+ return;
+}
+
+// ------------------------------------------------------------
+// Print and run menu for choice of things to ask about
+// Ignores the entry in @ignore
+// Returns the result in @c, or returns 0 if there is no result
+// ------------------------------------------------------------
+
+
+function script MagicTalkMenu {
+ setarray @choice$, "", "", "", "", "", "", "", "", "";
+ set @choices_nr, 0;
+ setarray @choice_idx, 0, 0, 0, 0, 0, 0, 0, 0, 0;
+
+ if (@ignore == @QQ_ELANORE)
+ goto L_Q_post_elanore;
+ set @choice$[@choices_nr], "...Elanore the Healer?";
+ set @choice_idx[@choices_nr], @QQ_ELANORE;
+ set @choices_nr, @choices_nr + 1;
+L_Q_post_elanore:
+
+ if (@ignore == @QQ_MANASEED)
+ goto L_Q_post_manaseed;
+ if (!(MAGIC_FLAGS & (MFLAG_KNOWS_MANASEED | MFLAG_MANASEED_RUMOUR)))
+ goto L_Q_post_manaseed;
+ set @choice$[@choices_nr], "...the Mana Seed?";
+ set @choice_idx[@choices_nr], @QQ_MANASEED;
+ set @choices_nr, @choices_nr + 1;
+L_Q_post_manaseed:
+
+ if (@ignore == @QQ_MANAPOTION)
+ goto L_Q_post_manapotion;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_MANAPOTION))
+ goto L_Q_post_manapotion;
+ set @choice$[@choices_nr], "...Mana Potions?";
+ set @choice_idx[@choices_nr], @QQ_MANAPOTION;
+ set @choices_nr, @choices_nr + 1;
+L_Q_post_manapotion:
+
+ if (@ignore == @QQ_WYARA)
+ goto L_Q_post_wyara;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_WYARA))
+ goto L_Q_post_wyara;
+ set @choice$[@choices_nr], "...Wyara the Witch?";
+ set @choice_idx[@choices_nr], @QQ_WYARA;
+ set @choices_nr, @choices_nr + 1;
+L_Q_post_wyara:
+
+ if (@ignore == @QQ_SAGATHA)
+ goto L_Q_post_sagatha;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_SAGATHA))
+ goto L_Q_post_sagatha;
+ set @choice$[@choices_nr], "...Sagatha the Witch?";
+ set @choice_idx[@choices_nr], @QQ_SAGATHA;
+ set @choices_nr, @choices_nr + 1;
+L_Q_post_sagatha:
+
+ if (@ignore == @QQ_AULDSBEL)
+ goto L_Q_post_auldsbel;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_AULDSBEL))
+ goto L_Q_post_auldsbel;
+ set @choice$[@choices_nr], "...Auldsbel the Wizard?";
+ set @choice_idx[@choices_nr], @QQ_AULDSBEL;
+ set @choices_nr, @choices_nr + 1;
+L_Q_post_auldsbel:
+
+ if (@ignore == @QQ_OLDWIZ)
+ goto L_Q_post_oldwiz;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_OLD_WIZARD))
+ goto L_Q_post_oldwiz;
+ set @choice$[@choices_nr], "...the Old Wizard?";
+ set @choice_idx[@choices_nr], @QQ_OLDWIZ;
+ set @choices_nr, @choices_nr + 1;
+L_Q_post_oldwiz:
+
+ if (@ignore == @QQ_IMP)
+ goto L_Q_post_imp;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_IMP))
+ goto L_Q_post_imp;
+ set @choice$[@choices_nr], "...the Earth Spirit in the desert well?";
+ set @choice_idx[@choices_nr], @QQ_IMP;
+ set @choices_nr, @choices_nr + 1;
+L_Q_post_imp:
+
+ set @choice$[@choices_nr], "...never mind.";
+ set @choice_idx[@choices_nr], 0;
+ set @choices_nr, @choices_nr + 1;
+
+ menu @choice$[0], -,
+ @choice$[1], -,
+ @choice$[2], -,
+ @choice$[3], -,
+ @choice$[4], -,
+ @choice$[5], -,
+ @choice$[6], -,
+ @choice$[7], -,
+ @choice$[8], -;
+
+ set @menu, @menu - 1;
+
+ if (@menu >= @choices_nr)
+ set @menu, 0;
+
+ set @c, @choice_idx[@menu];
+ return @c;
+}
diff --git a/npc/functions/mob_points.txt b/npc/functions/mob_points.txt
index 9e8dad92..ede2d474 100644
--- a/npc/functions/mob_points.txt
+++ b/npc/functions/mob_points.txt
@@ -5,13 +5,13 @@ function script MobPoints {
setarray @points,
1, // Maggot
- 2, // Scorpion
- 20, // Red Scorpion
+ 2, // Scorpion [1003]
+ 20, // Red Scorpion [1004]
10, // Green Slime
30, // Giant Maggot
15, // Yellow Slime
25, // Red Slime
- 45, // Black Scorpion
+ 45, // Black Scorpion [1009]
50, // Snake
4, // Fire Goblin
55, // Spider
@@ -22,7 +22,7 @@ function script MobPoints {
2, // Bat
16, // Pinkie
17, // Shroom
- 14, // Fluffy
+ 14, // Fluffy [1020]
25, // Cave Snake
100, // Jack-O
80, // Fire Skull
@@ -30,7 +30,7 @@ function script MobPoints {
20, // Stumpy
70, // Mountain Snake
15, // Easter Fluffy
- 40, // Mouboo
+ 40, // Mouboo [1028]
0, // Mauve Plant
0, // Gamboge Plant
0, // Cobalt Plant
@@ -38,5 +38,30 @@ function script MobPoints {
20, // Sea Slime
0; // Silk Worm
+
if (MPQUEST == 1) set Mobpt, Mobpt + @points[@mobID - 1002];
+
+ if ((@mobID == 1003) || (@mobID == 1004) || (@mobID == 1009))
+ goto L_good;
+
+
+ // Attitude adjustment for the witch (can we refactor this to another function? Not sure about max. recursion depth)
+
+ set @value, 0;
+ if (@mobID == 1028)
+ set @value, 4;
+ if (@mobID == 1020)
+ set @value, 3;
+
+ if (@value == 0)
+ goto L_end;
+
+ callfunc "QuestSagathaAnnoy";
+ goto L_end;
+
+L_good:
+ set @value, 1;
+ callfunc "QuestSagathaHappy";
+L_end:
+ set @value, 0;
}
diff --git a/npc/functions/slot_machine.txt b/npc/functions/slot_machine.txt
index 024a2e8a..8f4482cc 100644
--- a/npc/functions/slot_machine.txt
+++ b/npc/functions/slot_machine.txt
@@ -9,8 +9,8 @@ function script SlotMachine {
close;
L_Play:
- if(countitem(503) < 1) goto L_NoCoin;
- delitem 503, 1;
+ if(countitem("CasinoCoins") < 1) goto L_NoCoin;
+ delitem "CasinoCoins", 1;
set @Temp1,rand(7);
set @Temp2,rand(7);
set @Temp3,rand(7);
@@ -22,7 +22,7 @@ L_Play:
if(@Temp1 != @Temp3) goto L_Lost;
mes "Congratulations! You won!";
mes "You get 10 casino coins";
- getitem 503, 10;
+ getitem "CasinoCoins", 10;
close;
L_Lost:
diff --git a/npc/items/purification_potion.txt b/npc/items/purification_potion.txt
new file mode 100644
index 00000000..85b07010
--- /dev/null
+++ b/npc/items/purification_potion.txt
@@ -0,0 +1,30 @@
+// THis is the function to use the PurificationPotion
+
+function script usePurificationPotion {
+ if (isat("011-1.gat", 88,67))
+ goto L_Wyara_Pond;
+
+L_NoUse:
+ message strcharinfo(0), "You don't know what to do with this.";
+ getitem "PurificationPotion", 1;
+ return;
+
+L_Wyara_Pond:
+ set @Q_MASK, NIBBLE_2_MASK;
+ set @Q_SHIFT, NIBBLE_2_SHIFT;
+ set @Q_status, (QUEST_MAGIC2 & @Q_MASK) >> @Q_SHIFT;
+
+ if (@Q_status < 1)
+ goto L_NoUse;
+ if (@Q_status == 2)
+ set @Q_status, 3;
+ if (@Q_status < 2)
+ set @Q_status, 3;
+
+ message strcharinfo(0), "You pour the potion into the pond.";
+
+ set QUEST_MAGIC2,
+ (QUEST_MAGIC2 & ~(@Q_MASK)
+ | (@Q_status << @Q_SHIFT));
+ return;
+}
diff --git a/npc/scripts.conf b/npc/scripts.conf
index 01cc93eb..f7cede08 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -5,11 +5,15 @@ npc: npc/functions/banker.txt
npc: npc/functions/barber.txt
npc: npc/functions/game_rules.txt
npc: npc/functions/inn.txt
+npc: npc/functions/magic.txt
npc: npc/functions/mob_points.txt
npc: npc/functions/process_equip.txt
npc: npc/functions/slot_machine.txt
npc: npc/functions/soul_menhir.txt
+// Item Functions
+npc: npc/items/purification_potion.txt
+
import: npc/_import.txt
// Christmas 2006
diff --git a/npc/test_Tulimshar/_import.txt b/npc/test_Tulimshar/_import.txt
new file mode 100644
index 00000000..d1091f7d
--- /dev/null
+++ b/npc/test_Tulimshar/_import.txt
@@ -0,0 +1,3 @@
+map: test.gat
+npc: npc/test_Tulimshar/_mobs.txt
+npc: npc/test_Tulimshar/_warps.txt
diff --git a/npc/test_Tulimshar/_mobs.txt b/npc/test_Tulimshar/_mobs.txt
new file mode 100644
index 00000000..2589b562
--- /dev/null
+++ b/npc/test_Tulimshar/_mobs.txt
@@ -0,0 +1,47 @@
+// test Tulimshar mobs
+
+test.gat,44,87,2,1 monster Scorpion 1003,1,30000,0,Mobtest::On1003
+test.gat,44,87,2,1 monster Scorpion 1003,1,60000,0,Mobtest::On1003
+test.gat,44,87,2,1 monster Scorpion 1003,1,90000,0,Mobtest::On1003
+test.gat,44,87,2,1 monster Scorpion 1003,1,180000,0,Mobtest::On1003
+test.gat,44,87,2,1 monster Scorpion 1003,1,270000,0,Mobtest::On1003
+test.gat,44,87,2,1 monster Scorpion 1003,1,360000,0,Mobtest::On1003
+test.gat,82,30,9,8 monster Maggot 1002,5,0,0,Mobtest::On1002
+test.gat,115,25,8,4 monster Maggot 1002,3,0,0,Mobtest::On1002
+test.gat,124,53,15,13 monster Maggot 1002,10,0,0,Mobtest::On1002
+test.gat,120,64,15,13 monster Maggot 1002,11,0,0,Mobtest::On1002
+test.gat,63,24,3,2 monster Maggot 1002,2,0,0,Mobtest::On1002
+test.gat,72,64,3,2 monster Maggots 1002,2,0,0,Mobtest::On1002
+test.gat,97,80,3,2 monster Maggot 1002,2,0,0,Mobtest::On1002
+test.gat,134,61,3,2 monster Maggots 1002,2,0,0,Mobtest::On1002
+test.gat,112,47,3,2 monster Maggot 1002,2,0,0,Mobtest::On1002
+test.gat,129,37,3,2 monster Maggot 1002,2,0,0,Mobtest::On1002
+test.gat,89,31,3,2 monster Maggot 1002,2,0,0,Mobtest::On1002
+test.gat,19,78,3,2 monster Maggot 1002,2,0,0,Mobtest::On1002
+test.gat,122,59,17,22 monster Giant Maggot 1006,1,0,0,Mobtest::On1006
+test.gat,130,22,1,1 monster Fire Goblin 1011,1,61000,60000,Mobtest::On1011
+
+
+test.gat,0,0,0 script Mobtest -1,{
+On1002:
+ set @mobID, 1002;
+ callfunc "MobPoints";
+ break;
+
+On1003:
+ set @mobID, 1003;
+ callfunc "MobPoints";
+ break;
+
+On1006:
+ set @mobID, 1006;
+ callfunc "MobPoints";
+ break;
+
+On1011:
+ set @mobID, 1011;
+ callfunc "MobPoints";
+ break;
+
+ end;
+}
diff --git a/npc/test_Tulimshar/_warps.txt b/npc/test_Tulimshar/_warps.txt
new file mode 100644
index 00000000..fe07c49e
--- /dev/null
+++ b/npc/test_Tulimshar/_warps.txt
@@ -0,0 +1,5 @@
+// test Tulimshar warps
+
+test.gat,44,88 warp ToSandstorm 3,-1,002-1.gat,58,17
+test.gat,32,71 warp ToInn -1,-1,001-2.gat,25,34
+test.gat,75,41 warp ToHouse -1,-1,001-2.gat,71,72