summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
m---------tools0
-rw-r--r--world/map/conf/magic-base.conf1472
-rw-r--r--world/map/conf/magic-base.sex38
-rw-r--r--world/map/conf/magic-conf-ifnew.conf4
-rw-r--r--world/map/conf/magic-conf-ifold.conf4
-rw-r--r--world/map/conf/magic-secrets.conf.template86
-rw-r--r--world/map/conf/tmwa-map.conf4
-rw-r--r--world/map/data/041-1.wlkbin18754 -> 18754 bytes
-rw-r--r--world/map/data/042-1.wlkbin22564 -> 22564 bytes
-rw-r--r--world/map/data/042-2.wlkbin7704 -> 15404 bytes
-rw-r--r--world/map/data/042-3.wlkbin0 -> 5604 bytes
-rw-r--r--world/map/data/resnametable.txt1
-rw-r--r--world/map/db/0_19_mob_db.txt2
-rw-r--r--world/map/db/const.txt1
-rw-r--r--world/map/db/over_100_mob_db.txt1
-rw-r--r--world/map/db/weapon_item_db.txt4
-rw-r--r--world/map/news.php2
-rw-r--r--world/map/npc/006-1/pachua.txt2
-rw-r--r--world/map/npc/017-9/_import.txt1
-rw-r--r--world/map/npc/017-9/announcements.txt (renamed from world/map/npc/botcheck/announcements.txt)2
-rw-r--r--world/map/npc/022-1/_warps.txt1
-rw-r--r--world/map/npc/022-1/tutorial.txt53
-rw-r--r--world/map/npc/024-1/_warps.txt1
-rw-r--r--world/map/npc/024-2/barrier.txt11
-rw-r--r--world/map/npc/024-2/tyer.txt2
-rw-r--r--world/map/npc/024-2/tyer_trigger.txt18
-rw-r--r--world/map/npc/041-1/_import.txt1
-rw-r--r--world/map/npc/041-1/_mobs.txt14
-rw-r--r--world/map/npc/041-1/_warps.txt1
-rw-r--r--world/map/npc/041-1/tutorial.txt11
-rw-r--r--world/map/npc/042-1/_import.txt4
-rw-r--r--world/map/npc/042-1/_mobs.txt8
-rw-r--r--world/map/npc/042-1/_warps.txt8
-rw-r--r--world/map/npc/042-1/hasan.txt170
-rw-r--r--world/map/npc/042-1/kaan.txt24
-rw-r--r--world/map/npc/042-1/liana.txt (renamed from world/map/npc/042-1/npcs.txt)0
-rw-r--r--world/map/npc/042-1/tutorial.txt10
-rw-r--r--world/map/npc/042-1/valon.txt171
-rw-r--r--world/map/npc/042-1/zegas.txt106
-rw-r--r--world/map/npc/042-2/_import.txt5
-rw-r--r--world/map/npc/042-2/_mobs.txt6
-rw-r--r--world/map/npc/042-2/_warps.txt4
-rw-r--r--world/map/npc/042-2/barrels.txt48
-rw-r--r--world/map/npc/042-2/barrels_config.txt109
-rw-r--r--world/map/npc/042-2/magic_basement.txt21
-rw-r--r--world/map/npc/042-2/morgan.txt142
-rw-r--r--world/map/npc/042-2/sorfina.txt72
-rw-r--r--world/map/npc/042-2/stat_reset.txt42
-rw-r--r--world/map/npc/042-2/tanisha.txt85
-rw-r--r--world/map/npc/042-3/_import.txt5
-rw-r--r--world/map/npc/042-3/_mobs.txt9
-rw-r--r--world/map/npc/042-3/_warps.txt5
-rw-r--r--world/map/npc/_import.txt1
-rw-r--r--world/map/npc/annuals/fathertime.txt2
-rw-r--r--world/map/npc/annuals/xmas/debug.txt2
-rw-r--r--world/map/npc/botcheck/_import.txt1
-rw-r--r--world/map/npc/botcheck/mapflags.txt1
-rw-r--r--world/map/npc/functions/clear_vars.txt2
-rwxr-xr-xworld/map/npc/functions/debug.txt2
-rw-r--r--world/map/npc/functions/default_npc_checks.txt74
-rw-r--r--world/map/npc/functions/ferry.txt2
-rw-r--r--world/map/npc/functions/mob_points.txt11
-rw-r--r--world/map/npc/functions/travelers.txt2
-rw-r--r--world/map/npc/items/check_wand.txt65
-rw-r--r--world/map/npc/items/unequipcb.txt2
-rw-r--r--world/map/npc/scripts.conf1
66 files changed, 1117 insertions, 1842 deletions
diff --git a/tools b/tools
-Subproject c6f51d80a42f0002fa71617c64952747f8fba28
+Subproject 8c8927900dcee15d4b3b507b863574b8f70c730
diff --git a/world/map/conf/magic-base.conf b/world/map/conf/magic-base.conf
deleted file mode 100644
index 5faf0f89..00000000
--- a/world/map/conf/magic-base.conf
+++ /dev/null
@@ -1,1472 +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
-CONST DARK = 346
-
-# 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
-
-# Status effects
-CONST SC_POISON = 132
-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
-
-CONST SO_GMINVISIBLE = 4096
-
-# 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 SFX_LIGHTNING = 18
-
-CONST MAX_RAIN_SPELL_RADIUS = 15
-
-CONST MAX_MAGIC_LEVEL = 2 # Increase up to 5 as each new magic level is completed.
-
-CONST MAGIC_FLAGS = "MAGIC_FLAGS"
-CONST MFLAG_MADE_CONC_POTION = 16384
-CONST MFLAG_MADE_CONC_POTION_SHIFT = 14
-
-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 sfx_lightning(target) =
- sfx(target, SFX_LIGHTNING, 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, index) =
- IF (level + 3 > skill(caster, MAGIC)) # Level 4 and 5 magic users don't gain anything from spell levels 0 resp. 0+1
- THEN (
- 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) =
- success = 1;
- score = experience + random(min(spellpower, (experience / 3) + 1));
- IF (score >= difficulty)
- THEN create_item(caster, good_item, count);
- ELSE (
- success = 0;
- 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);
-
-PROCEDURE summon_dark_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, DARK) >= control_level, 2, 1), # pets when level is high enough
- count, lifetime);
-
-PROCEDURE abort_on_area_shield(pos) =
- IF (is_exterior(pos) = 1 && (map_nr(pos) = 1 # Tulimshar
- ||map_nr(pos) = 9 # Hurnscald
- ||map_nr(pos) = 20)) # Nivalis
- THEN (message(caster, "A powerful magic drains your spell just as it is beginning to take shape!");
- ABORT;)
-
-
-#--------------------------------------------------------------------------------
-# Level 0 spells
-#--------------------------------------------------------------------------------
-
-SPELL ask-magic-exp : "#abizit" =
- LET level = 0
- school = MAGIC
- IN (MANA 1, CASTTIME 1000,
- REQUIRE skill(caster, MAGIC) > level)
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- level = skill (caster, MAGIC);
- experience = (script_int(caster, SCRIPT_XP) >> SCRIPT_XP_SHIFT) & SCRIPT_XP_MASK;
- IF (experience == SCRIPT_XP_MASK && level > 4)
- THEN message (caster, "You are as proficient at magic as you can possibly be.");
- ELSE (
- # This duplicates the table in mana-seed.txt
- IF level > 4
- THEN max_experience = SCRIPT_XP_MASK;
- ELSE IF level = 4
- THEN max_experience = 40000;
- ELSE IF level = 3
- THEN max_experience = 8000;
- ELSE IF level = 2
- THEN max_experience = 1200;
- ELSE max_experience = 100;
-
- ratio = (10 * experience - random(max_experience / 30)) / max_experience; #Randomness: jitter a bit at the transitions to give more precise information if used frequently
-
- IF ratio >= 45
- THEN message(caster, "Magic flows naturally from you, readily and with ease. Your understanding of what you can currently control at present is flawless, far beyond your requirements to cast magic at this level." + if_then_else(level >= MAX_MAGIC_LEVEL,""," Surely the Mana Seed will more than readily offer more magic for such a proficient user."));
- ELSE IF ratio >= 20
- THEN message(caster, "You have perfect control of what you understand now, but there is now a distinct sensation of something more, something indescribable. If only the Mana Seed would give more magic to you...");
- ELSE IF ratio >= 10
- THEN message(caster, "You feel in perfect control of your magic" + if_then_else(level >= MAX_MAGIC_LEVEL,".",", and seem on the verge of something more... perhaps you should see the Mana Seed to ask for more magic?"));
- ELSE IF ratio >= 9
- THEN message(caster, "You feel in almost perfect control of your magic.");
- ELSE IF ratio >= 8
- THEN message(caster, "You feel that you have very good control of your magic.");
- ELSE IF ratio >= 7
- THEN message(caster, "You feel quite in control of your magic.");
- ELSE IF ratio >= 6
- THEN message(caster, "You feel mostly in control of your magic.");
- ELSE IF ratio >= 5
- THEN message(caster, "You feel somewhat in control of your magic.");
- ELSE IF ratio >= 4
- THEN message(caster, "You feel you still have a few difficulties in controlling your magic.");
- ELSE IF ratio >= 3
- THEN message(caster, "Trying to control your magic is still rather troublesome.");
- ELSE IF ratio >= 2
- THEN message(caster, "You feel that you have only the bare minimum of control over your magic.");
- ELSE IF ratio >= 1
- THEN message(caster, "You feel quite overwhelmed by your magic, but are beginning to see patterns.");
- ELSE message (caster, "You feel completely overwhelmed by your magic.");
- )
-
-SPELL transmute-wood-to-figurine (name : STRING) : "#parum" =
- LET level = 0
- school = TRANSMUTE
- IN (MANA 5, CASTTIME 4000,
- REQUIRE skill(caster, MAGIC) > level,
- COMPONENTS ["RawLog"])
- => ( REQUIRE name = "boo" =>
- EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- CALL create_item("MoubooFigurine", 1, "WarpedLog", 40);
- CALL gain_xp(1, 0);
- | REQUIRE name = "lurk" =>
- EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- CALL create_item("WarpedLog", 1, "WarpedLog", 40);
- message (caster, "You have no idea what a Skrytlurk looks like.");
- )
-
-
-SPELL make-sulphur : "#gole" =
- 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, 1);
-
-SPELL lesser-heal (target : STRING) : "#lum" =
- 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."; 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);
- IF skill(caster, DARK) > 1
- THEN status_change(caster, SC_HALT_REGENERATE, 0, 0, 0, 0, 2000);
- CALL gain_xp(1, 2);
-
-
-SPELL flare-dart : "#flar" =
- 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, 3);
- ATTRIGGER CALL attack_check(target);
- CALL elt_damage (target, damage, damage_bonus, ELT_WATER, ELT_FIRE, 15);
-
-
-SPELL magic-blade : "#chiza" =
- 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, 4);
- 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, 5);
- ATTRIGGER CALL melee_damage(target, 40, 5 + str(caster));
- )
-
-SPELL aggravate : "#itenplz" =
- 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 : "#modrilax" =
- LET level = 0
- school = NATURE
- IN (MANA 4, CASTTIME 2000,
- REQUIRE skill(caster, MAGIC) > level,
- COMPONENTS ["MauveHerb", "Root"])
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- CALL gain_xp(1, 6);
- spawn(rbox(location, 2), caster, 1029, 1, skill(caster, school) / 2 + 1, 10000);
-
-SPELL grow-alizarin : "#modriphoo" =
- LET level = 0
- school = NATURE
- IN (MANA 4, CASTTIME 2000,
- REQUIRE skill(caster, MAGIC) > level,
- COMPONENTS ["AlizarinHerb", "Root"])
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- CALL gain_xp(1, 7);
- spawn(rbox(location, 2), caster, 1032, 1, skill(caster, school) / 2 + 1, 10000);
-
-SPELL grow-gamboge : "#modriyikam" =
- LET level = 0
- school = NATURE
- IN (MANA 4, CASTTIME 2000,
- REQUIRE skill(caster, MAGIC) > level,
- COMPONENTS ["GambogeHerb", "Root"])
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- CALL gain_xp(1, 8);
- spawn(rbox(location, 2), caster, 1031, 1, skill(caster, school) / 2 + 1, 10000);
-
-SPELL grow-cobalt : "#modrisump" =
- LET level = 0
- school = NATURE
- IN (MANA 4, CASTTIME 2000,
- REQUIRE skill(caster, MAGIC) > level,
- COMPONENTS ["CobaltHerb", "Root"])
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- CALL gain_xp(1, 9);
- spawn(rbox(location, 2), caster, 1030, 1, skill(caster, school) / 2 + 1, 10000);
-
-
-LOCAL SPELL summon-maggots : "#kalmurk" =
- LET level = 0
- school = ASTRAL
- IN (MANA 21, CASTTIME 20000,
- REQUIRE skill(caster, MAGIC) > level,
- COMPONENTS ["MaggotSlime", "Root"])
- => EFFECT CALL adjust_spellpower(school);
- CALL gain_xp(1, 10);
- CALL summon_spell(1002,
- 1 + ((sqrt(spellpower) + (spellpower / 15)) / 5),
- 5000 - (spellpower * 5),
- 10000 + (spellpower * 50), 1);
-
-SPELL detect-magic : "#miteyo" =
- 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 : "#kularzufrill" =
- 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, 11);
-
-SPELL make-shirt : "#patmuploo" =
- 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, 12);
-
-SPELL make-tanktop : "#patloree" =
- 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("TankTop", 1, "CottonCloth", 350);
- CALL gain_xp(2, 13);
-
-SPELL make-short-tanktop : "#patviloree" =
- 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("ShortTankTop", 1, "CottonCloth", 250);
- CALL gain_xp(2, 14);
-
-SPELL make-iron-powder : "#zukminbirf" =
- 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, 15);
-
-SPELL make-concentration-potion : "#loshira" =
- LET level = 1
- school = TRANSMUTE
- IN (MANA 8, CASTTIME 5000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- COMPONENTS ["BottleOfWater", 2 * "CobaltHerb", 2 * "PinkPetal"])
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- CALL create_item( if_then_else(random(2000 + experience) < experience, "ConcentrationPotion", "DarkConcentrationPotion"), 1,
- if_then_else(random(2), "DilutedConcentrationPot", "DarkConcentrationPotion"),
- 2000);
- IF (success)
- THEN CALL set_var(MAGIC_FLAGS, 1, MFLAG_MADE_CONC_POTION_SHIFT, 1);
- CALL gain_xp(4, 16);
-
-SPELL merge-concentration-potions : "#skrimp" =
- LET level = 1
- school = TRANSMUTE
- IN (MANA 8, CASTTIME 5000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- COMPONENTS ["DarkConcentrationPotion", "DilutedConcentrationPot"])
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- CALL create_item("ConcentrationPotion", 1, "DilutedConcentrationPot", 1000);
- message (caster, "success = " + success);
- IF (success)
- THEN CALL set_var(MAGIC_FLAGS, 1, MFLAG_MADE_CONC_POTION_SHIFT, 1);
- CALL gain_xp(4, 17);
-
-
-SPELL lay-on-hands (target : STRING) : "#inma" =
- 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,
- (pc(target) <> caster)
- && (rdistance(location(caster), location(pc(target)))
- < 2 + (12 * sqrt(spellpower) + spellpower) / 100)
- && not (running_status_update(pc(target), SC_HALT_REGENERATE))
- && not (is_equipped(pc(target), "MagicGMTopHat"))
- ))
- => EFFECT CALL adjust_spellpower(school);
- IF (not (target)) 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 ABORT;
- )
- 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);
- t = 5000; # with dark magic skill you pay 1/20 of max hp but the regenerate cooldown is cut in half
- school = DARK;
- h = (max_hp(caster) / 20) * -1;
- IF skill(caster, school) > level
- THEN itemheal(caster, h, 0);
- IF skill(caster, school) > level
- THEN t = 10000;
- status_change(caster, SC_HALT_REGENERATE, 0, 0, 0, 0, t);
- CALL gain_xp(min(4, payment / 100), 18);
-
-SPELL lightning-strike : "#ingrav" =
- 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, 19);
- 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 : "#frillyar" =
- 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();
- CALL abort_on_area_shield(location(caster));
-
- range = 7;
- area = rbox(awayfrom(location(caster), dir(caster), 1 + range), range);
-
- FOREACH SPELL s IN rbox(awayfrom(location(caster), dir(caster), 1 + range), range * 2) DO
- IF (s <> self_invocation) && (name_of(s) = "arrow-hail")
- THEN (message (caster, "A nearby arrow hail spell absorbs your magic!");
- ABORT;)
-
- damage = 125;
- damage_bonus = spellpower / 5;
- CALL gain_xp(2, 20);
- FOR i = 0 TO spellpower / 8 DO (
- FOR j = 0 TO 2 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 + random(50) + random(50);
- );
-
-SPELL magic-knuckles : "#upmarmu" =
- 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));
-
-LOCAL SPELL summon-snakes : "#halhiss" =
- LET level = 1
- school = DARK
- IN (MANA 40, CASTTIME 15000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- REQUIRE (script_int(caster, "OrumQuest") > 40),
- COMPONENTS ["DarkCrystal", "SnakeEgg"])
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- CALL gain_xp(3, 31);
- CALL summon_dark_spell(1010, 1 + spellpower / 300, 4000 - (spellpower * 9), spellpower * 80, 2);
-
-SPELL toxic-dart : "#phlex" =
- LET level = 1
- school = DARK
- IN (MANA 15, CASTTIME 500,
- REQUIRE (script_int(caster, "OrumQuest") > 37),
- REQUIRE skill(caster, MAGIC) > level,
- (REQUIRE skill(caster, school) > 2 OR COMPONENTS [2 * "Root"]))
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- damage = 5 * sqrt(spellpower);
- damage_bonus = 5 + level(caster) / 3;
- CALL install_attack_spell(3 + spellpower / 75,
- 1200,
- 4, 31);
- CALL gain_xp(3, 35);
- ATTRIGGER CALL attack_check(target);
- CALL elt_damage (target, damage, damage_bonus, ELT_NEUTRAL, ELT_POISON, 15);
- IF (is_pc(target) && caster <> target)
- THEN status_change(target, SC_POISON, 5 + max(15, spellpower / 15), 0, 0, 0, 5000 + (spellpower * 1200));
-
-LOCAL SPELL summon-wickedmushroom : "#helorp" =
- LET level = 1
- school = DARK
- IN (MANA 35, CASTTIME 15000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE (script_int(caster, "OrumQuest") > 36),
- REQUIRE skill(caster, school) > level,
- COMPONENTS ["SmallMushroom", "DarkCrystal"])
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- CALL gain_xp(3, 36);
- CALL summon_dark_spell(1106, 1 + spellpower / 250 , 4000 - (spellpower * 9), spellpower * 80, 2);
-
-SPELL flying-backpack (target : PC) : "#plugh" =
- 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, 21);
- ATEND message (target, "Your backpack is no longer levitating.");
- sfx(target, 2, 0);
-
-SPELL protect (target : PC) : "#betsanc" =
- LET level = 1
- school = NATURE
- IN (MANA 14, CASTTIME 1500,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- REQUIRE not(is_equipped(pc(target), "MagicGMTopHat")),
- (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 * 1000));
- message (target, "You feel more protected.");
- CALL gain_xp(2, 22);
- ATEND message (target, "You feel less protected.");
- sfx(target, 111, 0);
-
-SPELL happy-curse (target : PC) : "#joyplim" =
- 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();
- IF (skill(caster, DARK) > 1)
- THEN FOR i = 0 TO (spellpower / 10) DO (emote(target, 5); WAIT 500;)
- ELSE FOR i = 0 TO (spellpower / 10) DO (emote(target, 3); WAIT 500;);
- CALL gain_xp(1, 23);
-
-LOCAL SPELL rain : "#kaflosh" =
- 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 abort_on_area_shield(location(caster));
- FOREACH SPELL s IN rbox(location(caster), MAX_RAIN_SPELL_RADIUS + 1) DO
- IF (s <> self_invocation) && (name_of(s) = "rain")
- THEN (message (caster, "A nearby raincloud absorbs your magic.");
- ABORT;)
-
- CALL gain_xp(1, 24);
- range = min(MAX_RAIN_SPELL_RADIUS, 3 + min(spellpower, 200) / 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";
- };
- // Halloween quest
- IF ( is_in(location(caster), @("011-1.gat", 94, 38) @+ (9, 7)) )
- THEN {
- callfunc "HalloweenQuestWaterPumpkins";
- };
- FOR i = 0 TO (spellpower / 3) DO (
- FOR j = 0 TO min(spellpower / 2, 200) / 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 400 + 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 : "#chipchip" =
- 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, 0, 0, 0, 0, 600000); # 10 minutes
- CALL shear-drop("Fluffy", "Fluffy", "WhiteFur", 300);
- CALL shear-drop("EasterFluffy", "Easter 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);
- CALL shear-drop("Pinkie", "Pinkie", "PinkAntenna", 180);
- IF ((name = "Fluffy" || name = "Mouboo" || name = "Pinkie") && random(2))
- THEN { set @value, 1; callfunc "QuestSagathaHappy"; };
- )
-
-
-
-SPELL barrier (target : PC) : "#asorm" =
- LET level = 1
- school = ASTRAL
- IN (MANA 16, CASTTIME 1000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- REQUIRE not(is_equipped(pc(target), "MagicGMTopHat")),
- (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, 25);
- ATEND message (target, "Your magical barrier dissipates.");
- sfx(target, SFX_UNBARRIER, 0);
-
-
-LOCAL SPELL summon-spiky-mushrooms : "#kalrenk" =
- LET level = 1
- school = ASTRAL
- IN (MANA 33, CASTTIME 20000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- COMPONENTS ["HardSpike", "Root"])
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- CALL gain_xp(1, 26);
- CALL summon_spell(1019, 1 + spellpower / 120, 5000 - (spellpower * 9), spellpower * 400, 2);
-
-LOCAL SPELL summon-fluffies : "#kalakarenk" =
- LET level = 1
- school = ASTRAL
- IN (MANA 39, CASTTIME 20000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- COMPONENTS ["WhiteFur", "Root"])
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- CALL gain_xp(1, 27);
- CALL summon_spell(1020, 1 + spellpower / 170 + spellpower / 430, 5000 - (spellpower * 8), spellpower * 350, 2);
-
-LOCAL SPELL summon-mouboo : "#kalboo" =
- LET level = 1
- school = ASTRAL
- IN (MANA 35, CASTTIME 20000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- COMPONENTS ["MoubooFigurine", "Root"])
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- CALL gain_xp(2, 37);
- CALL summon_spell(1028, 1 + spellpower / 270 , 4000 - (spellpower * 9), spellpower * 100, 2);
-
-LOCAL SPELL summon-pinkie : "#kalgina" =
- LET level = 1
- school = ASTRAL
- IN (MANA 35, CASTTIME 20000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- COMPONENTS ["PinkAntenna", "Root"])
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- CALL gain_xp(2, 38);
- CALL summon_spell(1018, 1 + spellpower / 120, 5000 - (spellpower * 9), spellpower * 150, 2);
-
-SPELL detect-players : "#inwilt" =
- 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))
- && not (status_option(target, SO_GMINVISIBLE)))
- 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 enchant-lifestone : "#manpahil" =
- LET level = 1
- school = MAGIC
- IN (MANA 15, CASTTIME 4000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- (COMPONENTS["BugLeg"] OR COMPONENTS ["MaggotSlime"]
- OR COMPONENTS ["MauveHerb", "AlizarinHerb", "CobaltHerb", "GambogeHerb"]))
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- create_item(caster, "Lifestone", 1);
- CALL gain_xp(1, 28);
-
-SPELL sense-spouse : "#inzuwilt" =
- 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) : "#anwiltyp" =
- 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, 29);
- 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 cure-poison (target : PC) : "#anju" =
- LET level = 2
- school = LIFE
- IN (MANA 15, CASTTIME 1000,
- REQUIRE skill(caster, MAGIC) > level,
- REQUIRE skill(caster, school) > level,
- REQUIRE (rdistance(location(caster),
- location(pc(target))) < 1 + (spellpower / 60)),
- COMPONENTS ["GambogeHerb"])
- => EFFECT CALL adjust_spellpower(school);
- CALL default_effect();
- IF (running_status_update (target, SC_POISON))
- THEN (CALL gain_heal_xp(40, 1, 2, 2);
- stop_status_change (target, SC_POISON);
- CALL gain_xp(2, 30);
- IF caster <> target
- THEN sfx(target, SFX_HEAL, 0););
-
-
-SPELL fire-ball : "#flarfol" =
- 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 : "#kalzumin" =
- LET level = 2
- school = ASTRAL
- IN (MANA 30, CASTTIME 2000,
- 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)))
- 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 : "#anwilvimar" =
- 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) : "#vorp" =
- 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, 200);
- warp(caster, random_location(anchor(destination)));
- sfx(caster, SFX_TELEPORT, 200);
-
-#--------------------------------------------------------------------------------
-# 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) + ", "
- + "made-conc=" + ((script_int(caster, "MAGIC_FLAGS") & 16384) > 0) + ", "
- + "elanore-omar=" + ((script_int(caster, "MAGIC_FLAGS") & 32768) > 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) + ", "
- + "elanore-sub:" + ((script_int(caster, "QUEST_MAGIC2") >> 12) & 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 = "made-conc") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 14, delta);
- ELSE IF (name = "elanore-omar") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 15, 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 IF (name = "elanore-sub") THEN CALL debug_xmod("QUEST_MAGIC2", 0xf, 12, 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-up256 (name : STRING) : "debug+256" =
- REQUIRE DEBUG
- => EFFECT CALL debug_mod(name, 256);
-
-SPELL debug-down256 (name : STRING) : "debug-256" =
- REQUIRE DEBUG
- => EFFECT CALL debug_mod(name, 0 - 256);
-
-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)) || is_in(location(caster), @("021-2.gat", 20,25) @+ (4, 4)) ))=>
- 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 need 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.");
-
-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.");
-
-
-CONST E10_FLAG_USED_FREE_WARP_SHIFT = 17
-
-NONMAGIC SILENT SPELL world-shift : "#alonzialonzo" =
- (REQUIRE (script_int(caster, "Easter_2010_QuestState") >> 16) & 1 == 1 && (script_int(caster, "Easter_2010_QuestState") >> 7) & 3 == 2) => # Travel only works when you have both helped the doctor at least thrice and have defeated the invader - top level requirement.
- ( (REQUIRE (count_item(caster, "DarkPetal")) && # Allow unlimited travel with the petal
- (map_nr(location(caster)) != 52) && # Do not allow if player is in Illia island
- (map_nr(location(caster)) != 5698) # Do not allow if player is in botcheck area
- )
- => ((REQUIRE rdistance(location(caster), @("028-1.gat", 69, 70)) < 5) =>
- EFFECT sfx(location(caster), SFX_TELEPORT, 200);
- WAIT 8000;
- { savepoint "009-1", 52, 39; };
- warp(caster, @("009-1.gat", 55, 37));
- sfx(location(caster), SFX_TELEPORT, 200);
- |
- (REQUIRE map_nr(location(caster)) != 28) =>
- EFFECT inithp = hp(caster); // Store this value.
- sfx(location(caster), SFX_TELEPORT, 200);
- IF (map_nr(location(caster)) == 9 || map_nr(location(caster)) == 1 || map_nr(location(caster)) == 21 || map_nr(location(caster)) == 20) THEN WAIT 8000;
- ELSE WAIT 20000;
- IF (hp(caster) < inithp) THEN ABORT; // Cancel teleport if the player took damage during channel time (hacky, but for most purposes should work.)
- { savepoint "028-1", 69, 71; };
- warp(caster, @("028-1.gat", 69, 70));
- sfx(location(caster), SFX_TELEPORT, 200);
- )
- | (REQUIRE (rdistance(location(caster), @("028-1.gat", 69, 70)) < 5 )
- => EFFECT set_script_variable(caster, "Easter_2010_QuestState", script_int(caster, "Easter_2010_QuestState") | (1 << 17));
- sfx(location(caster), SFX_TELEPORT, 200);
- WAIT 8000;
- { savepoint "009-1", 52, 39; };
- warp(caster, @("009-1.gat", 55, 37));
- sfx(location(caster), SFX_TELEPORT, 200);
- | (REQUIRE map_nr(location(caster)) != 28 && (script_int(caster, "Easter_2010_QuestState") >> 17) & 1 == 0) # Allow for one free warp home without the petal
- => EFFECT inithp = hp(caster); // Store this value.
- sfx(location(caster), SFX_TELEPORT, 200);
- IF (map_nr(location(caster)) == 9 || map_nr(location(caster)) == 1 || map_nr(location(caster)) == 21 || map_nr(location(caster)) == 20) THEN WAIT 8000;
- ELSE WAIT 20000;
- IF (hp(caster) < inithp) THEN ABORT; // Cancel teleport if the player took damage during channel time (hacky, but for most purposes should work.)
- set_script_variable(caster, "Easter_2010_QuestState", script_int(caster, "Easter_2010_QuestState") | (1 << 17));
- { savepoint "028-1", 69, 70; };
- warp(caster, @("028-1.gat", 69, 70));
- sfx(location(caster), SFX_TELEPORT, 200);
- )
- )
-
-NONMAGIC SILENT SPELL easter-get-debug (p : PC) : "#e" =
- (REQUIRE name_of(caster) == "Freeyorp" || name_of(caster) == "Xakelbael the Dark") =>
- EFFECT { message strcharinfo(0), "Global state egg1: " + $Easter_2010_Egg_Loc_State1;
- message strcharinfo(0), "Global state egg2: " + $Easter_2010_Egg_Loc_State2;
- message strcharinfo(0), "Global state egg3: " + $Easter_2010_Egg_Loc_State3;
- message strcharinfo(0), "Global state egg4: " + $Easter_2010_Egg_Loc_State4;
- message strcharinfo(0), "Global state egg5: " + $Easter_2010_Egg_Loc_State5;
- message strcharinfo(0), "Global npc state1: " + $Easter_2010_Npc_State1;
- message strcharinfo(0), "Global npc state2: " + $Easter_2010_Npc_State2;
- };
- message(caster, "Local state egg1: " + script_int(p, "Easter_2010_EggState1"));
- message(caster, "Local state egg2: " + script_int(p, "Easter_2010_EggState2"));
- message(caster, "Local state egg3: " + script_int(p, "Easter_2010_EggState3"));
- message(caster, "Local state egg4: " + script_int(p, "Easter_2010_EggState4"));
- message(caster, "Local state egg5: " + script_int(p, "Easter_2010_EggState5"));
- message(caster, "Local state quest: " + script_int(p, "Easter_2010_QuestState"));
-
-
-
-
-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);
-
-
-#--------------------------------------------------------------------------------
-# Illia spell
-#--------------------------------------------------------------------------------
-
-NONMAGIC SPELL illia0 : "#catalazuli" = REQUIRE ((rdistance(location(caster), location(npc("#Power Circle"))) == 0))
- => EFFECT {
- callfunc "StartChannelling";
- };
-
-#--------------------------------------------------------------------------------
-# Kill the GM event spell
-#--------------------------------------------------------------------------------
-
-NONMAGIC SPELL killgm0 : "#pullrabbit" = REQUIRE (is_equipped(caster, "MagicGMTopHat"))
- => EFFECT {
- callfunc "ActivateMagicGMTophat";
- };
diff --git a/world/map/conf/magic-base.sex b/world/map/conf/magic-base.sex
index 986e2ce1..25c05f1e 100644
--- a/world/map/conf/magic-base.sex
+++ b/world/map/conf/magic-base.sex
@@ -407,6 +407,44 @@
"--------------------------------------------------------------------------------"
"Level 0 spells"
"--------------------------------------------------------------------------------"
+(SPELL () wand "#confringo" ()
+ (LET school MAGIC)
+ (=>
+ (GUARD
+ (CASTTIME 500))
+ (EFFECT
+ (SCRIPT "{callfunc \"CheckWand\";}")
+ (IF (==
+ (script_int caster "@Wand")
+ 0)
+ (ABORT))
+ (CALL adjust_spellpower school)
+ (CALL default_effect)
+ (SET damage
+ (* (script_int caster "@Wand")
+ (/ spellpower
+ 3)))
+ (SET damage_bonus
+ (* (script_int caster "@Wand")
+ (/ spellpower
+ 3)))
+ (CALL install_attack_spell
+ (+ (script_int caster "@Wand")
+ (/ spellpower 10))
+ 1200
+ 3
+ 33)
+ (CALL gain_xp 1 3)
+ (ATTRIGGER
+ (CALL attack_check target)
+ (SCRIPT "{callfunc \"WandMana\";}")
+ (IF (==
+ (script_int caster "@WandAttack")
+ 0)
+ (ABORT))
+ (CALL elt_damage target damage damage_bonus ELT_NEUTRAL ELT_NEUTRAL 5))
+)))
+
(SPELL () ask-magic-exp "#abizit" ()
(LET level 0)
(LET school MAGIC)
diff --git a/world/map/conf/magic-conf-ifnew.conf b/world/map/conf/magic-conf-ifnew.conf
deleted file mode 100644
index 1c80f584..00000000
--- a/world/map/conf/magic-conf-ifnew.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-version-gt: 14.1.27
-
-magic_conf: conf/magic-base.sex
-magic_conf: conf/magic-secrets.sex
diff --git a/world/map/conf/magic-conf-ifold.conf b/world/map/conf/magic-conf-ifold.conf
deleted file mode 100644
index bd1b5a3c..00000000
--- a/world/map/conf/magic-conf-ifold.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-version-le: 14.1.27
-
-magic_conf: conf/magic-base.conf
-magic_conf: conf/magic-secrets.conf
diff --git a/world/map/conf/magic-secrets.conf.template b/world/map/conf/magic-secrets.conf.template
deleted file mode 100644
index c53ee8a8..00000000
--- a/world/map/conf/magic-secrets.conf.template
+++ /dev/null
@@ -1,86 +0,0 @@
-# coding of generic spellinvocations
-# #[indicates difficulty level][indicates questionnumber][indicates answerpossibility]
-# X = easy; Y = medium; Z = hard
-# each question have a number of possible answers (mostly using capital letters or not)
-
-NONMAGIC SPELL towelanswer00a : "#X00" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer00b : "#X01" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer01a : "#X10" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer01b : "#X11" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer02a : "#X20" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer02b : "#X21" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer03a : "#X30" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer03b : "#X31" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer04a : "#X40" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer04b : "#X41" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer05a : "#X50" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer05b : "#X51" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer05c : "#X52" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer05d : "#X53" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer06a : "#X60" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer06b : "#X61" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer06c : "#X62" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer06d : "#X63" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer07a : "#X70" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer07b : "#X71" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer08a : "#X80" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer08b : "#X81" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer08c : "#X82" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer08d : "#X83" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer09a : "#X90" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer09b : "#X91" = EFFECT { message strcharinfo(0), ""; };
-
-NONMAGIC SPELL towelanswer10a : "#Y00" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer10b : "#Y01" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer11a : "#Y10" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer11b : "#Y11" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer12a : "#Y20" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer12b : "#Y21" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer13a : "#Y30" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer13b : "#Y31" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer14a : "#Y40" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer14b : "#Y41" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer15a : "#Y50" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer15b : "#Y51" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer15c : "#Y52" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer16a : "#Y60" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer16b : "#Y61" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer17a : "#Y70" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer17b : "#Y71" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer18a : "#Y80" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer18b : "#Y81" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer18c : "#Y82" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer18d : "#Y83" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer19a : "#Y90" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer19b : "#Y91" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer19c : "#Y92" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer19d : "#Y93" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer110a : "#YA0" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer110b : "#YA1" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer111a : "#YB0" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer111b : "#YB1" = EFFECT { message strcharinfo(0), ""; };
-
-NONMAGIC SPELL towelanswer20a : "#Z00" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer20b : "#Z01" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer20c : "#Z02" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer20d : "#Z03" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer21a : "#Z10" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer21b : "#Z11" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer22a : "#Z20" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer22b : "#Z21" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer23a : "#Z30" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer23b : "#Z31" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer24a : "#Z40" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer24b : "#Z41" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer25a : "#Z50" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer25b : "#Z51" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer26a : "#Z60" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer26b : "#Z61" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer27a : "#Z62" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer27b : "#Z63" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer27c : "#Z70" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer27d : "#Z71" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer28a : "#Z72" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer28b : "#Z73" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer29a : "#Z80" = EFFECT { message strcharinfo(0), ""; };
-NONMAGIC SPELL towelanswer29b : "#Z81" = EFFECT { message strcharinfo(0), ""; };
diff --git a/world/map/conf/tmwa-map.conf b/world/map/conf/tmwa-map.conf
index df94acd4..2a52dd74 100644
--- a/world/map/conf/tmwa-map.conf
+++ b/world/map/conf/tmwa-map.conf
@@ -33,7 +33,7 @@ mob_db: db/over_100_mob_db.txt
mob_skill_db: db/mob_skill_db.txt
skill_db: db/skill_db.txt
-import: conf/magic-conf-ifold.conf
-import: conf/magic-conf-ifnew.conf
+magic_conf: conf/magic-base.sex
+magic_conf: conf/magic-secrets.sex
resnametable: data/resnametable.txt
diff --git a/world/map/data/041-1.wlk b/world/map/data/041-1.wlk
index e32e4713..908a9977 100644
--- a/world/map/data/041-1.wlk
+++ b/world/map/data/041-1.wlk
Binary files differ
diff --git a/world/map/data/042-1.wlk b/world/map/data/042-1.wlk
index 85c5ced3..ccd506c8 100644
--- a/world/map/data/042-1.wlk
+++ b/world/map/data/042-1.wlk
Binary files differ
diff --git a/world/map/data/042-2.wlk b/world/map/data/042-2.wlk
index 35db011b..77f96ce9 100644
--- a/world/map/data/042-2.wlk
+++ b/world/map/data/042-2.wlk
Binary files differ
diff --git a/world/map/data/042-3.wlk b/world/map/data/042-3.wlk
new file mode 100644
index 00000000..a57e8126
--- /dev/null
+++ b/world/map/data/042-3.wlk
Binary files differ
diff --git a/world/map/data/resnametable.txt b/world/map/data/resnametable.txt
index 4d305886..9284d5e9 100644
--- a/world/map/data/resnametable.txt
+++ b/world/map/data/resnametable.txt
@@ -103,6 +103,7 @@
041-1.gat#041-1.wlk#
042-1.gat#042-1.wlk#
042-2.gat#042-2.wlk#
+042-3.gat#042-3.wlk#
043-1.gat#043-1.wlk#
043-3.gat#043-3.wlk#
043-4.gat#043-4.wlk#
diff --git a/world/map/db/0_19_mob_db.txt b/world/map/db/0_19_mob_db.txt
index f570fce1..36169593 100644
--- a/world/map/db/0_19_mob_db.txt
+++ b/world/map/db/0_19_mob_db.txt
@@ -1,5 +1,7 @@
//ID, Name, Jname, LV, HP, SP, EXP, JEXP, Range1, ATK1, ATK2, DEF, MDEF, STR, AGI, VIT, INT, DEX, LUK, Range2, Range3, Scale, Race, Element,Mode, Speed, Adelay, Amotion,Dmotion,Drop1id,Drop1per,Drop2id,Drop2%, Drop3id,Drop3%, Drop4id,Drop4%, Drop5id,Drop5%, Drop6id,Drop6%, Drop7id,Drop7%, Drop8id,Drop8%, Item1, Item2, MEXP, ExpPer, MVP1id, MVP1per,MVP2id, MVP2per,MVP3id, MVP3per,mutationcount,mutationstrength
1002, Maggot, Maggot, 5, 50, 0, 0, 1, 1, 5, 10, 0, 5, 1, 1, 1, 0, 6, 5, 1, 1, 1, 3, 21, 129, 800, 1872, 672, 480, 505, 800, 501, 150, 518, 400, 533, 150, 502, 70, 522, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+1046, TameScorpion, TameScorpion, 5, 50, 0, 0, 2, 1, 7, 10, 0, 5, 1, 1, 1, 0, 15, 5, 1, 1, 1, 3, 20, 129, 2000, 1872, 672, 480, 507, 700, 510, 100, 509, 50, 518, 700, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+1050, HouseMaggot, HouseMaggot, 5, 50, 0, 0, 3, 1, 7, 7, 0, 5, 5, 5, 1, 0, 6, 5, 1, 1, 1, 3, 21, 133, 700, 1872, 672, 480, 505, 800, 501, 150, 518, 400, 533, 150, 502, 70, 522, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
1003, Scorpion, Scorpion, 10, 100, 0, 0, 2, 1, 10, 15, 0, 5, 1, 1, 1, 0, 15, 5, 1, 1, 1, 3, 20, 129, 2000, 1872, 672, 480, 507, 700, 510, 100, 509, 50, 518, 700, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
1029, MauvePlant, MauvePlant, 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, 0, 0, 0, 0, 0, 0, 1, 60
1030, CobaltPlant, CobaltPlant, 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, 0, 0, 0, 0, 0, 0
diff --git a/world/map/db/const.txt b/world/map/db/const.txt
index 8203174f..5c8d4ffa 100644
--- a/world/map/db/const.txt
+++ b/world/map/db/const.txt
@@ -643,3 +643,4 @@ MAX_HIGH_SCORES 4
AMMO_NONE 0
AMMO_BOW 1
AMMO_SLING 2
+AMMO_WAND 3
diff --git a/world/map/db/over_100_mob_db.txt b/world/map/db/over_100_mob_db.txt
index 1eff6439..da2edaff 100644
--- a/world/map/db/over_100_mob_db.txt
+++ b/world/map/db/over_100_mob_db.txt
@@ -13,7 +13,6 @@
1036, Zombie, Zombie, 110, 12000, 0, 0, 1393, 2, 275, 355, 20, 15, 30, 15, 30, 3, 60, 40, 1, 1, 1, 0, 29, 133, 480, 1872, 672, 900, 631, 1000, 777, 700, 778, 500, 779, 200, 780, 150, 1198, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 30
1042, Spectre, Spectre, 140, 6500, 0, 3978, 359, 3, 160, 220, 40, 0, 35, 70, 22, 15, 20, 70, 1, 1, 1, 0, 49, 137, 650, 1700, 800, 500, 773, 1000, 703, 150, 703, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 20
1045, Fallen, Fallen, 120, 10000, 0, 7812, 1663, 2, 180, 430, 5, 20, 40, 3, 25, 5, 80, 45, 1, 1, 1, 0, 49, 133, 300, 1200, 672, 300, 775, 210, 775, 210, 776, 300, 631, 1000, 636, 3, 658, 2, 532, 35, 778, 500, 1198, 500, 0, 0, 0, 0, 0, 0, 0, 0, 4, 50
-1046, SnakeLord, SnakeLord, 300, 40000, 0, 0, 4321, 2, 80, 120, 10, 10, 20, 40, 10, 10, 40, 10, 1, 1, 1, 0, 20, 132, 200, 1500, 672, 480, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
1062, Terranite, Terranite, 110, 6000, 0, 0, 889, 1, 200, 300, 20, 40, 60, 40, 40, 30, 60, 40, 1, 1, 1, 0, 29, 133, 400, 872, 672, 900, 4001, 600, 4004, 20, 4005, 20, 4007, 20, 763, 500, 640, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 30
1068, Reaper, Reaper, 140, 80000, 0, 0, 156, 7, 200, 350, 30, 80, 100, 120, 70, 120, 100, 75, 1, 50, 1, 1, 89, 165, 500, 1200, 800, 300, 777, 1000, 775, 500, 776, 100, 1221, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
1071, IceElement, IceElement, 100, 5000, 0, 0, 689, 3, 60, 200, 5, 20, 15, 25, 40, 15, 45, 30, 1, 1, 1, 0, 41, 135, 330, 740, 672, 400, 4026, 900, 537, 750, 568, 400, 543, 900, 544, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 20
diff --git a/world/map/db/weapon_item_db.txt b/world/map/db/weapon_item_db.txt
index 1dad6e64..58d215f6 100644
--- a/world/map/db/weapon_item_db.txt
+++ b/world/map/db/weapon_item_db.txt
@@ -47,7 +47,9 @@
//608, RESERVED, BladeShield, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}
//609, RESERVED, Club, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}
623, Scythe, Scythe, 4, 100, 50, 1200, 75, 0, 1, 0, 0, 2, 34, 1, 1, 3, {}, {}
-758, WoodenStaff, Wooden Staff, 4, 4000, 2000, 1000, 50, 0, 1, 5, 0, 2, 34, 1, 1, 10, {}, {}
+758, WoodenStaff, Wooden Staff, 4, 4000, 2000, 1000, 50, 0, 1, 10, 0, 2, 34, 1, 1, 10, {}, {set @bStat, bInt;set @minbStatVal, 60;callfunc "RequireStat";}
+//ID, Name___________________, Label__________________, Type, Price, Sell, Weight, ATK, DEF, Range, Mbonus, Slot, Gender, Loc, wLV, eLV, View, {UseScript}, {EquipScript}
+1171, Wand, Wand, 4, 400, 200, 100, 1, 0, 1, 5, 0, 2, 2, 1, 1, 1, {}, {set @bStat, bInt;set @minbStatVal, 5;callfunc "RequireStat";}
762, TerraniteArrow, Terranite Arrow, 10, 80, 20, 1, 50, 0, 0, 0, 0, 2, 32768, 0, 0, 0, {}, {bonus bCritical, 10;set @AmmoType, AMMO_BOW; callfunc "CheckAmmo";}
867, IceGladius, Ice Gladius, 4, 2000, 1000, 1000, 110, 0, 1, 0, 0, 2, 2, 1, 1, 1, {}, {bonus bLuk, 1;}
878, BansheeBow, Banshee Bow, 4, 101000, 40000, 900, 90, 0, 6, 0, 0, 2, 34, 1, 90, 11, {}, {set @bStat, bDex;set @minbStatVal, 80;callfunc "RequireStat"; bonus2 bHPDrainRate, 100, -4; bonus bAspdRate, 20; bonus bCritical, 70; bonus bMaxHP, -150; bonus bDefRate, -40; bonus bDef2Rate, -35;set @LauncherType, AMMO_BOW; callfunc "CheckLauncher";}
diff --git a/world/map/news.php b/world/map/news.php
index 22e5b100..d9f4d2e5 100644
--- a/world/map/news.php
+++ b/world/map/news.php
@@ -1,7 +1,7 @@
<?php
// configuration variables
-$min_manaplus = '1.1.2.20';
+$min_manaplus = '1.3.6.9';
// utility functions
function failure_headers()
diff --git a/world/map/npc/006-1/pachua.txt b/world/map/npc/006-1/pachua.txt
index 41375411..d2f193dd 100644
--- a/world/map/npc/006-1/pachua.txt
+++ b/world/map/npc/006-1/pachua.txt
@@ -1,6 +1,6 @@
006-1.gat,24,113,0|script|Pachua|143,
{
- setarray $@npc_loc, 24, 113, 4;
+ setarray @npc_loc, 24, 113, 4;
callfunc "PCtoNPCRange";
if (@npc_check)
goto L_Close;
diff --git a/world/map/npc/017-9/_import.txt b/world/map/npc/017-9/_import.txt
index 69c67d6f..4e650df8 100644
--- a/world/map/npc/017-9/_import.txt
+++ b/world/map/npc/017-9/_import.txt
@@ -3,4 +3,5 @@
map: 017-9.gat
npc: npc/017-9/_mobs.txt
npc: npc/017-9/_warps.txt
+npc: npc/017-9/announcements.txt
npc: npc/017-9/mapflags.txt
diff --git a/world/map/npc/botcheck/announcements.txt b/world/map/npc/017-9/announcements.txt
index cb7a5f8f..585fbc28 100644
--- a/world/map/npc/botcheck/announcements.txt
+++ b/world/map/npc/017-9/announcements.txt
@@ -13,7 +13,7 @@
// $@GMSA_TICK: broadcast the message every $@GMSA_TICK hours
// $@GMSA_CURRENT_TICK: internal counter incremented every hour
-botcheck.gat,49,29,0|script|Stone Board|348,
+017-9.gat,26,24,0|script|Stone Board|145,
{
if (getgmlevel() < 60)
goto L_Close;
diff --git a/world/map/npc/022-1/_warps.txt b/world/map/npc/022-1/_warps.txt
index eab0a4e6..45899c50 100644
--- a/world/map/npc/022-1/_warps.txt
+++ b/world/map/npc/022-1/_warps.txt
@@ -5,3 +5,4 @@
022-1.gat,30,20|warp|To Lighthouse Beach|0,-1,023-1.gat,107,146
022-1.gat,73,110|warp|To North Tulimshar|3,-1,021-1.gat,73,23
022-1.gat,113,110|warp|To North Tulimshar|3,-1,021-1.gat,113,23
+022-1.gat,46,82|warp|To Tulimshar Suburbs|-1,-1,042-1.gat,115,85
diff --git a/world/map/npc/022-1/tutorial.txt b/world/map/npc/022-1/tutorial.txt
index 93f1700a..c249d79d 100644
--- a/world/map/npc/022-1/tutorial.txt
+++ b/world/map/npc/022-1/tutorial.txt
@@ -4,14 +4,46 @@
// Tutorial
// Nibble 0
// 1-4: Sorfina
-
-022-1.gat,46,82,0|script|#tutorial-outside1|45,2,1
-{
- callfunc "TutorialCompleted";
- warp "042-1.gat", 115, 85;
- end;
-}
-
+// 5-7: Tanisha
+// 8-13: Kaan & Hasan
+// 14: Hasan Complete
+// 15: Open
+// Nibble 1
+// 4: Sorfina Bit
+// 5: Tanisha Bit
+// 6: Valon Start
+// 7: Valon Done
+// Nibble 2
+// 1: Maggots
+// 2: House Maggots
+// 3: TameScorpion
+// 4: Scorpion
+// 5-15: Open
+// Nibble 3
+// 1-15: Count
+// Nibble 4
+// 16: Start
+// 17: Barrel
+// 18: Barrel
+// 19: Barrel
+// Nibble 5
+// 20: Barrel
+// 21: Barrel
+// 22: Barrel
+// 23: Found
+// Nibble 6
+// 1: Seen
+// 2: Started
+// 3:
+// 24: Magic
+// 25:
+// 26:
+// 27:
+// Nibble 7
+// 28: Magic Start
+// 29: Magic End
+// 30: Zegas Met
+// 31: Hasan Complete
-|script|#TutorialConfig|-1,
{
end;
@@ -22,25 +54,24 @@ OnInit:
set $@ScorpDeath, 0;
set $@SorfinaHasanBit, (1 << 4);
set $@TanishaHasanBit, (1 << 5);
+ set $@HasanCompleteBit, (1 << 31);
end;
}
-
function|script|TutorialState|,
{
callfunc "ClearVariables";
set @tutorial, ((TUTORIAL & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT);
set @sorfina_hasan, (TUTORIAL & $@SorfinaHasanBit);
set @tanisha_hasan, (TUTORIAL & $@TanishaHasanBit);
+ set @hasan_complete, (TUTORIAL & $@HasanCompleteBit);
return;
}
-
function|script|SetTutorialMask|,
{
set TUTORIAL, (TUTORIAL & ~(NIBBLE_0_MASK) | (@tutorial_tmp << NIBBLE_0_SHIFT));
set @tutorial_tmp, 0;
return;
}
-
function|script|TutorialCompleted|,
{
set FLAGS, FLAGS | FLAG_TUTORIAL_DONE;
diff --git a/world/map/npc/024-1/_warps.txt b/world/map/npc/024-1/_warps.txt
index b2c4babf..7b7d0545 100644
--- a/world/map/npc/024-1/_warps.txt
+++ b/world/map/npc/024-1/_warps.txt
@@ -4,3 +4,4 @@
024-1.gat,86,74|warp|To North Tulimshar|3,-1,021-1.gat,49,65
024-1.gat,80,48|warp|To Tulimshar Magic School|0,-1,024-2.gat,26,26
024-1.gat,86,48|warp|To Tulimshar Magic School|-1,-1,024-2.gat,42,27
+024-1.gat,80,30|warp|To Magic Passage|-1,-1,042-3.gat,56,45
diff --git a/world/map/npc/024-2/barrier.txt b/world/map/npc/024-2/barrier.txt
index 6b971d1f..4894dad8 100644
--- a/world/map/npc/024-2/barrier.txt
+++ b/world/map/npc/024-2/barrier.txt
@@ -2,10 +2,15 @@
024-2.gat,31,24,0|script|#MagicSchoolBarrier1#M|0,1,1,
{
- if (BaseLevel < 40) goto L_PushBack;
- close;
+ callfunc "MorganState";
+ if (@morgan >= 4)
+ goto L_End;
+ goto L_PushBack;
L_PushBack:
warp "024-2.gat", 34, 24;
- close;
+ goto L_End;
+
+L_End:
+ end;
}
diff --git a/world/map/npc/024-2/tyer.txt b/world/map/npc/024-2/tyer.txt
index 334c62ad..2b4f8674 100644
--- a/world/map/npc/024-2/tyer.txt
+++ b/world/map/npc/024-2/tyer.txt
@@ -3,6 +3,6 @@
024-2.gat,36,21,0|script|Tyer|157,
{
mes "[Tyer]";
- mes "\"Hello.\"";
+ mes "\"Hello. Welcome to the Magic Insitute of Tulimshar.\"";
close;
}
diff --git a/world/map/npc/024-2/tyer_trigger.txt b/world/map/npc/024-2/tyer_trigger.txt
index 353dea16..45218430 100644
--- a/world/map/npc/024-2/tyer_trigger.txt
+++ b/world/map/npc/024-2/tyer_trigger.txt
@@ -1,24 +1,22 @@
// A man in the magic school
-024-2.gat,33,24,0|script|#Tyer_Trigger|0,1,1,
+024-2.gat,33,24,0|script|#Tyer_Trigger|0,0,1,
{
- if (BaseLevel >= 40) end;
+ callfunc "MorganState";
+ if (@morgan >= 4)
+ goto L_Close;
mes "[Tyer]";
- mes "\"You're still too young to go in there.\"";
- next;
-
+ mes "\"You're not allowed to go in there.\"";
menu
- "What do you mean I'm too young to go in there?", L_Explain,
+ "What do you mean I'm not allowed to go in there?", L_Explain,
"Ah, right.", L_Close;
L_Explain:
mes "[Tyer]";
- mes "\"The canyon is a dangerous place, so only more experienced people are allowed there.\"";
+ mes "\"Access to those areas are for students of magic only.\"";
next;
-
- mes "[Tyer]";
- mes "\"That barrier was made to keep those that are too young out.\"";
+ mes "\"That barrier was made to keep those that are not students out.\"";
goto L_Close;
L_Close:
diff --git a/world/map/npc/041-1/_import.txt b/world/map/npc/041-1/_import.txt
index 957b1b29..f7ba8d9e 100644
--- a/world/map/npc/041-1/_import.txt
+++ b/world/map/npc/041-1/_import.txt
@@ -4,4 +4,3 @@ map: 041-1.gat
npc: npc/041-1/_mobs.txt
npc: npc/041-1/_warps.txt
npc: npc/041-1/mapflags.txt
-npc: npc/041-1/tutorial.txt
diff --git a/world/map/npc/041-1/_mobs.txt b/world/map/npc/041-1/_mobs.txt
index de93bfab..5b74c6bb 100644
--- a/world/map/npc/041-1/_mobs.txt
+++ b/world/map/npc/041-1/_mobs.txt
@@ -7,9 +7,9 @@
041-1.gat,61,34,13,20|monster|Scorpion|1003,3,100000,30000,Mob041-1::On1003
041-1.gat,55,30,10,48|monster|SeaSlime|1033,3,100000,30000,Mob041-1::On1033
041-1.gat,59,13,10,9|monster|Scorpion|1003,3,100000,30000,Mob041-1::On1003
-041-1.gat,60,7,3,2|monster|BlackScorpion|1009,1,100000,30000,Mob041-1::On1009
-041-1.gat,66,49,3,2|monster|BlackScorpion|1009,1,100000,30000,Mob041-1::On1009
-041-1.gat,95,75,21,9|monster|BlackScorpion|1009,1,100000,30000,Mob041-1::On1009
+041-1.gat,60,7,3,2|monster|TameScorpion|1046,1,100000,30000,Mob041-1::On1046
+041-1.gat,66,49,3,2|monster|TameScorpion|1046,1,100000,30000,Mob041-1::On1046
+041-1.gat,95,75,21,9|monster|TameScorpion|1046,1,100000,30000,Mob041-1::On1046
041-1.gat,100,57,18,9|monster|RedScorpion|1004,3,100000,30000,Mob041-1::On1004
041-1.gat,83,64,18,9|monster|RedScorpion|1004,3,100000,30000,Mob041-1::On1004
@@ -28,13 +28,13 @@ On1004:
callfunc "MobPoints";
end;
-On1009:
- set @mobID, 1009;
+On1033:
+ set @mobID, 1033;
callfunc "MobPoints";
end;
-On1033:
- set @mobID, 1033;
+On1046:
+ set @mobID, 1046;
callfunc "MobPoints";
end;
}
diff --git a/world/map/npc/041-1/_warps.txt b/world/map/npc/041-1/_warps.txt
index dff4558e..736486dc 100644
--- a/world/map/npc/041-1/_warps.txt
+++ b/world/map/npc/041-1/_warps.txt
@@ -2,3 +2,4 @@
// Beach warps
041-1.gat,101,95|warp|To Beach|1,-1,004-1.gat,68,20
+041-1.gat,58,4|warp|To Tulimshar Suburbs|1,-1,042-1.gat,44,113
diff --git a/world/map/npc/041-1/tutorial.txt b/world/map/npc/041-1/tutorial.txt
deleted file mode 100644
index 5c024e1f..00000000
--- a/world/map/npc/041-1/tutorial.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-// This file is part of the Tutorial
-// Author: Jenalya
-// if you enter the tutorial area, it is set to be already done
-
-041-1.gat,58,5,0|script|#tutorial-outside2|45,1,0
-{
- set FLAGS, FLAGS | FLAG_TUTORIAL_DONE;
- callfunc "ClearVariables";
- warp "042-1.gat", 44, 113;
- end;
-}
diff --git a/world/map/npc/042-1/_import.txt b/world/map/npc/042-1/_import.txt
index b3bfbae5..0c712a7c 100644
--- a/world/map/npc/042-1/_import.txt
+++ b/world/map/npc/042-1/_import.txt
@@ -5,6 +5,8 @@ npc: npc/042-1/_mobs.txt
npc: npc/042-1/_warps.txt
npc: npc/042-1/hasan.txt
npc: npc/042-1/kaan.txt
+npc: npc/042-1/liana.txt
npc: npc/042-1/mapflags.txt
-npc: npc/042-1/npcs.txt
+npc: npc/042-1/tutorial.txt
npc: npc/042-1/valon.txt
+npc: npc/042-1/zegas.txt
diff --git a/world/map/npc/042-1/_mobs.txt b/world/map/npc/042-1/_mobs.txt
index 75ea7407..a8175a1f 100644
--- a/world/map/npc/042-1/_mobs.txt
+++ b/world/map/npc/042-1/_mobs.txt
@@ -1,11 +1,11 @@
// This file is generated automatically. All manually changes will be removed when running the Converter.
// Tulimshar Suburbs mobs
-042-1.gat,100,68,31,15|monster|Maggot|1002,5,100000,30000,Mob042-1::On1002
+042-1.gat,101,69,31,15|monster|Maggot|1002,5,100000,30000,Mob042-1::On1002
042-1.gat,65,59,27,15|monster|Maggot|1002,7,100000,30000,Mob042-1::On1002
042-1.gat,68,102,7,8|monster|BlackScorpion|1009,5,100000,30000,Mob042-1::On1009
042-1.gat,98,88,5,8|monster|Scorpion|1003,4,100000,30000,Mob042-1::On1003
-042-1.gat,58,61,42,42|monster|FireGoblin|1011,2,100000,30000,Mob042-1::On1011
+042-1.gat,63,63,37,30|monster|TameScorpion|1046,6,100000,30000,Mob042-1::On1046
042-1.gat,85,102,5,8|monster|Scorpion|1003,5,100000,30000,Mob042-1::On1003
042-1.gat,98,99,5,5|monster|Scorpion|1003,3,100000,30000,Mob042-1::On1003
042-1.gat,82,87,6,3|monster|Scorpion|1003,2,100000,30000,Mob042-1::On1003
@@ -32,8 +32,8 @@ On1009:
callfunc "MobPoints";
end;
-On1011:
- set @mobID, 1011;
+On1046:
+ set @mobID, 1046;
callfunc "MobPoints";
end;
}
diff --git a/world/map/npc/042-1/_warps.txt b/world/map/npc/042-1/_warps.txt
index 565ed1ae..8c1043ea 100644
--- a/world/map/npc/042-1/_warps.txt
+++ b/world/map/npc/042-1/_warps.txt
@@ -3,7 +3,13 @@
042-1.gat,97,41|warp|To Tulismhar Docks|-1,2,022-1.gat,21,37
042-1.gat,65,20|warp|To Lighthouse Beach|0,-1,023-1.gat,64,143
-042-1.gat,63,47|warp|To Sorfina's House|-1,-1,042-2.gat,44,30
042-1.gat,91,73|warp|To Store House|-1,-1,042-2.gat,22,92
042-1.gat,104,73|warp|To Store House|-1,-1,042-2.gat,44,92
042-1.gat,65,75|warp|To Tulimshar Suburbs House|-1,-1,042-2.gat,29,61
+042-1.gat,62,42|warp|To Sorfina's Dinner|-1,-1,042-2.gat,112,85
+042-1.gat,51,43|warp|To Sorfina's House|-1,-1,042-2.gat,44,30
+042-1.gat,117,102|warp|To Magic School Research|-1,-1,042-2.gat,103,62
+042-1.gat,112,95|warp|To Magic School Research|-1,-1,042-2.gat,94,54
+042-1.gat,120,95|warp|To Magic School Research|-1,-1,042-2.gat,112,54
+042-1.gat,117,85|warp|To Tulismhar Docks|-1,-1,022-1.gat,49,82
+042-1.gat,44,115|warp|To Tulismhar Outskirts|1,-1,041-1.gat,58,6
diff --git a/world/map/npc/042-1/hasan.txt b/world/map/npc/042-1/hasan.txt
index 25f7ff86..722c8f62 100644
--- a/world/map/npc/042-1/hasan.txt
+++ b/world/map/npc/042-1/hasan.txt
@@ -1,67 +1,79 @@
// This file is part of the Tutorial
// Authors: Jenalya, alastrim
+// Hasan should be threatening someone else you come to help
+// Going to throw someone off a cliff
+// npctalk 2 NPCs Hasan talks about giving someone a short trip to Docks
+// They respond by asking play for help
+// Hasan tells them to but out of it.
-042-1.gat,116,84,0|script|Hasan|189,0,2,
+042-1.gat,104,49,0|script|Scared Man|160,
+{
+ if ((@hasan_complete) && ((@tutorial == 12) || (@tutorial == 14)))
+ goto L_TutDone;
+ message strcharinfo(0), "He looks too afraid to say anything.";
+ end;
+
+L_TutDone:
+ message strcharinfo(0), "Thanks. Kaan's been much nicer to me now";
+ end;
+}
+042-1.gat,102,49,0|script|Hasan|189,2,2,
{
goto L_Main;
L_Main:
- if (FLAGS & FLAG_TUTORIAL_DONE)
- goto L_Tut_Done;
-
- set @toll, 10000;
callfunc "TutorialState";
- // implicitly, $@ScorpionFighter is nonzero
- if (@tutorial == 13)
- goto L_Thank;
if ((getcharid(3) == $@ScorpionFighter) || ($@ScorpionFighter && $@ScorpionFighter != getcharid(3)))
goto L_Afraid;
- if (@tutorial == 12)
+ if ((@hasan_complete) && ((@tutorial == 12) || (@tutorial == 14)))
+ goto L_TutDone;
+ // implicitly, $@ScorpionFighter is nonzero
+ if ((@hasan_complete) && (@tutorial == 13))
+ goto L_Thank;
+ if (@tutorial == 12)
goto L_Trick;
if ((@tutorial == 10) || (@tutorial == 11))
- goto L_Toll;
+ goto L_FightAgain;
+ mes "You over hear some people nearby.";
mes "[Unfriendly Guy]";
- mes "\"Hey! You can't pass here.\"";
- menu
- "Why not?",L_Next,
- "Who says that?",L_Next;
-
-L_Next:
+ mes "\"I told you if you didn't get the money, I'd give you flying lessons, Haha!\"";
+ next;
+ mes "[Scared Man]";
+ mes "\"But the only person I need protection from is you.\"";
+ next;
+ mes "[Unfriendly Guy]";
+ mes "\"Thats why the price is so high.\"";
+ next;
+ mes "\"Because I'm the toughest person in all of Tulimshar\"";
+ next;
+ mes "[Scared Man]";
+ mes "\"No, your just a mean bully. Wait till I tell the gaurds about this!\"";
+ next;
mes "[Unfriendly Guy]";
- mes "\"I, Hasan the Mighty, have decided to put a toll on this path.\"";
+ mes "\"You do that and the next flying lesson will be from the beach cliffs.\"";
+ next;
+ mes "[Scared Man]";
+ mes "\"No, please don't. *sob*\"";
+ next;
+ mes "Sounds like this person is in trouble.\"";
+ next;
set @tutorial_tmp, 10;
callfunc "SetTutorialMask";
- next;
- goto L_Toll;
-
-L_Toll:
- mes "[Hasan]";
- mes "\"Give me " + @toll + "GP, and I may let you pass.\"";
- if (Zeny >= @toll)
- goto L_HasToll;
- goto L_NoToll;
-
-L_HasToll:
- menu
- "Ok, here you go.",L_Pay,
- "What? I don't have that much money!",L_NoPay,
- "We'll see if you can stop me!",L_Fight;
-
-L_NoToll:
+ mes "[Unfriendly Guy]";
+ mes "\"What are you looking at?\"";
menu
- "What? I don't have that much money!",L_NoPay,
- "We'll see if you can stop me!",L_Fight;
+ "What ever you call maggot slime scrapped off a boat after a walk through the sewers.\"", L_Fight,
+ "Who me? I saw nothing, just passing by.", L_Close;
-L_NoPay:
+L_FightAgain:
mes "[Hasan]";
- mes "\"That's not my problem. You have to stay here then.\"";
- next;
- mes "This is annoying. Maybe Kaan can help?";
- goto L_Close;
+ mes "\"Have you come back for a thrashing?\"";
+ menu
+ "No.", L_Close,
+ "Yes.", L_Fight;
L_Fight:
- mes "He laughs derisively.";
mes "[Hasan]";
mes "\"Do you really think you can beat me?\"";
mes "He pulls out a nasty looking dagger and stabs it in your direction.";
@@ -71,51 +83,38 @@ L_Fight:
mes "Maybe Kaan can help?";
goto L_Close;
-L_Pay:
- if (Zeny < @toll)
- goto L_Cheat;
- set Zeny, Zeny - @toll;
- mes "He grins gloatingly.";
- mes "[Hasan]";
- mes "\"Very well. You may pass.\"";
- callfunc "TutorialCompleted";
- goto L_Close;
-
-L_Cheat:
- mes "[Hasan]";
- mes "\"Don't you dare try to cheat me!\"";
- goto L_Close;
-
L_Trick:
mes "[Hasan]";
- mes "\"Are you going to pay now? " + @toll + "GP, and I may let you pass.\"";
+ mes "\"Have you come back for another thrashing?\"";
menu
- "I don't have that much money!",L_NoPay,
- "No. (Scratch your head.)",L_ScratchHead;
+ "No.",L_Close,
+ "Yes, yours! (Scratch your head.)",L_ScratchHead;
L_ScratchHead:
if ($@ScorpionFighter)
goto L_Wait;
+ set TUTORIAL, TUTORIAL | $@HasanCompleteBit;
set $@ScorpionTimer, 0;
set $@ScorpionFighter, getcharid(3);
set $@ScorpDeath, PC_DIE_COUNTER;
cmdothernpc "#ScorpionTrigger", "HasanSpawn";
- mes "While you're scratching your head, you see Kaan approaching behind Hasan.";
+ mes "While you're scratching your head, you see Kaan approaching the fence.";
close;
L_Thank:
mes "[Hasan]";
mes "\"You - you saved me!";
- mes "I tried to take your money and you saved me!\"";
+ mes "I was mean to people, but you still saved me!\"";
next;
mes "\"Hey, you're a really cool person.";
mes "I mean, the way you finished that ghastly scorpion!";
mes "Amazing!\"";
next;
- mes "\"Let me tell you a secret: Cool persons are allowed to pass for free.";
+ mes "\"Let me tell you something, I will no longer bully people.";
mes "And you can have my Sharp Knife.\"";
getitem "SharpKnife", 1;
- callfunc "TutorialCompleted";
+ set @tutorial_tmp, 14;
+ callfunc "SetTutorialMask";
next;
mes "\"You want to go to the bazaar, right? Shall I tell you how to get there?\"";
menu
@@ -136,12 +135,14 @@ L_Explore:
mes "\"Alright. Take care!\"";
goto L_Close;
-L_Tut_Done:
+L_TutDone:
mes "[Hasan]";
- if (BaseLevel >= 40)
- mes "\"Welcome to the suburbs of Tulimshar. I wonder what an experienced adventurer like you is doing here.\"";
- if (BaseLevel < 40)
- mes "\"Bah, nothing interesting is happening here.\"";
+ mes "\"You didn't see anything. I tell you what I'll be nicer if you don't tell anyone?\"";
+ menu
+ "As long as you learned your lesson.", L_TutCont;
+
+L_TutCont:
+ mes "\"I have, I promise not to bully people anymore. It's not fun being scared.\"";
goto L_Close;
L_Wait:
@@ -153,15 +154,13 @@ L_Afraid:
end;
L_Close:
- set @toll, 0;
close;
OnTouch:
- if (FLAGS & FLAG_TUTORIAL_DONE)
- goto L_Close;
+ if ((@hasan_complete) && ((@tutorial == 12) || (@tutorial == 14)))
+ end;
goto L_Main;
}
-
042-1.gat,0,0,0|script|#ScorpionTrigger|35,
{
end;
@@ -170,14 +169,13 @@ OnCommandHasanSpawn:
goto L_Summon;
L_Summon:
- monster "042-1.gat",115,85,"Scorpion",1003,1, "#ScorpionTrigger::OnScorpionDeath";
+ monster "042-1.gat",102,49,"WeakScorpion",1046,1, "#ScorpionTrigger::OnScorpionDeath";
initnpctimer;
end;
L_SummonAgain:
- message strcharinfo(0), "Kaan is mad at you for your interference! He walks over to the edge of the cliff and throws a rock on top of your head, then lets another scorpion run just near Hasan!";
+ message strcharinfo(0), "Kaan is mad at you for your interference! He walks over to the edge of the fence and throws a rock on top of your head, then lets another scorpion run just near Hasan!";
percentheal -100, 0;
- message strcharinfo(0), "Kaan: \"Just go while he is distracted and no one is interfering!\"";
goto L_Summon;
OnTimer5000:
@@ -202,9 +200,7 @@ OnScorpionDeath:
goto L_Clean;
L_TimeOut:
- message strcharinfo(0), "Hasan, with his eyes almost closed, trembling with fear, runs toward the scorpion and stabs it with all his strength! Seems like you took too long and the plan didn't work this time.";
- warp "042-1.gat", 114, 85;
- message strcharinfo(0), "Hasan: \"Hey you! I told you you cannot pass!\"";
+ message strcharinfo(0), "Hasan, with his eyes almost closed, trembling with fear, runs toward the scorpion and stabs it with all his strength!";
goto L_Clean;
L_MessageDeath:
@@ -219,19 +215,3 @@ L_Clean:
stopnpctimer;
end;
}
-
-042-1.gat,117,85,0|script|#warp|45,0,0,
-{
- if (FLAGS & FLAG_TUTORIAL_DONE)
- goto L_Tut;
- goto L_SendBack;
-
-L_SendBack:
- message strcharinfo(0), "Hasan: I can do this all day.";
- warp "042-1.gat", 114, 85;
- end;
-
-L_Tut:
- warp "022-1.gat", 49, 82;
- end;
-}
diff --git a/world/map/npc/042-1/kaan.txt b/world/map/npc/042-1/kaan.txt
index d2ba5877..0d71cee3 100644
--- a/world/map/npc/042-1/kaan.txt
+++ b/world/map/npc/042-1/kaan.txt
@@ -1,12 +1,11 @@
// This file is part of the Tutorial
// Author: Jenalya
-042-1.gat,103,92,0|script|Kaan|160,
+042-1.gat,109,87,0|script|Kaan|160,
{
- if (FLAGS & FLAG_TUTORIAL_DONE) goto L_Tut_Done;
callfunc "TutorialState";
- if (@tutorial == 13) goto L_Hasan_Saved;
- if ($@ScorpionFighter == getcharid(3)) goto L_Run;
+ if ((@hasan_complete) && (@tutorial == 13)) goto L_Hasan_Saved;
+ if (@hasan_complete) goto L_TutDone;
if (@tutorial == 12) goto L_Plan;
if ((@tutorial == 11) && ((@sorfina_hasan) || (@tanisha_hasan))) goto L_TrickKnown;
if (@tutorial == 11) goto L_Trick;
@@ -68,7 +67,7 @@ L_Next:
callfunc "SetTutorialMask";
if (hasan)
menu
- "A guy named Hasan won't let me enter Tulimshar.",L_Hasan,
+ "A guy named Hasan is bullying someone.",L_Hasan,
"Thanks for the advice.",L_Close;
goto L_Out;
@@ -82,7 +81,7 @@ L_Hasan:
mes "[Kaan]";
mes "\"Hello! How are you? Did you already visit Tulimshar?\"";
menu
- "A guy named Hasan won't let me enter Tulimshar.",L_Next1,
+ "A guy named Hasan is bullying someone.",L_Next1,
"Not yet.",L_Close;
L_Next1:
@@ -130,7 +129,7 @@ L_Explain:
mes "I'll watch you from this point.\"";
next;
mes "\"When you give me the sign, I'll throw the scorpion on him.";
- mes "While he's distracted with the scorpion, you can pass.\"";
+ mes "I bet that will show him for the coward he really is.\"";
next;
mes "\"How's that? We can start as soon as you're ready.\"";
goto L_Close;
@@ -145,23 +144,18 @@ L_Plan:
L_Hasan_Saved:
mes "[Kaan]";
- mes "\"I told you to pass when he's distracted, not to fight the scorpion!";
- mes "But maybe Hasan is thankful now?\"";
+ mes "\"You did not to fight the scorpion.";
+ mes "But maybe Hasan is more thankful now?\"";
next;
mes "\"Why don't you talk to him again and see what he says.\"";
goto L_Close;
-L_Tut_Done:
+L_TutDone:
mes "[Kaan]";
mes "\"Hi there. I hope you enjoy your time in Tulimshar.";
mes "Hasan can be a real troublemaker, but it seems like he has calmed down for now.\"";
goto L_Close;
-L_Run:
- mes "[Kaan]";
- mes "\"He's distracted! What are you waiting for?\"";
- goto L_Close;
-
L_Close:
close;
}
diff --git a/world/map/npc/042-1/npcs.txt b/world/map/npc/042-1/liana.txt
index 6eb9972b..6eb9972b 100644
--- a/world/map/npc/042-1/npcs.txt
+++ b/world/map/npc/042-1/liana.txt
diff --git a/world/map/npc/042-1/tutorial.txt b/world/map/npc/042-1/tutorial.txt
new file mode 100644
index 00000000..3129faaa
--- /dev/null
+++ b/world/map/npc/042-1/tutorial.txt
@@ -0,0 +1,10 @@
+// This file is part of the Tutorial
+// Author: Jenalya
+// if you enter the tutorial area, it is set to be already done
+
+042-1.gat,63,47,0|script|#tutorialoutside|45,0,0
+{
+ callfunc "TutorialCompleted";
+ warp "042-2.gat", 114, 92;
+ end;
+}
diff --git a/world/map/npc/042-1/valon.txt b/world/map/npc/042-1/valon.txt
index 35636f94..ab14ad7c 100644
--- a/world/map/npc/042-1/valon.txt
+++ b/world/map/npc/042-1/valon.txt
@@ -1,39 +1,168 @@
// This file is part of the Tutorial
-// Author: Jenalya
+// Author: Jenalya, Wushin
+-|script|#ValonConfig|-1,
+{
+ end;
-042-1.gat,44,115,0|script|Valon|156,1,0
+OnInit:
+ set $@ValonStartBit, (1 << 6);
+ set $@ValonEndBit, (1 << 7);
+ setarray $@ValonMob, 1002,1050,1046,1003;
+ setarray $@ValonMobName$, "Maggots","House Maggots","Tame Scorpions","Scorpion";
+ setarray $@ValonMobCnt, 10,5,3,1;
+ end;
+}
+function|script|ValonState|,
+{
+ set @valon_mob, ((TUTORIAL & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT);
+ set @valon_count, ((TUTORIAL & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);
+ set @valon_start, (TUTORIAL & $@ValonStartBit);
+ set @valon_end, (TUTORIAL & $@ValonEndBit);
+ return;
+}
+function|script|AddValonMobMask|,
+{
+ set @valon_tmp, (@valon_mob + 1);
+ if (@valon_tmp > 15)
+ set @valon_tmp, 15;
+ set TUTORIAL, (TUTORIAL & ~(NIBBLE_2_MASK) | (@valon_tmp << NIBBLE_2_SHIFT));
+ set @valon_tmp, 0;
+ return;
+}
+function|script|ResetValonCntMask|,
+{
+ set TUTORIAL, (TUTORIAL & ~(NIBBLE_3_MASK) | (0 << NIBBLE_3_SHIFT));
+ return;
+}
+function|script|AddValonCntMask|,
+{
+ set @valon_tmp, (@valon_count + 1);
+ if (@valon_tmp > 15)
+ set @valon_tmp, 15;
+ set TUTORIAL, (TUTORIAL & ~(NIBBLE_3_MASK) | (@valon_tmp << NIBBLE_3_SHIFT));
+ set @valon_tmp, 0;
+ callfunc "ValonProgress";
+ return;
+}
+function|script|ValonProgress|,
+{
+ callfunc "ValonState";
+ if ((@valon_start) && (!(@valon_end)))
+ message strcharinfo(0), $@ValonMobName$[@valon_mob] + ": " + @valon_count + "/" + $@ValonMobCnt[@valon_mob];
+ return;
+}
+042-1.gat,51,111,0|script|ValonDebug|156,
+{
+ mes "[Valon Debug]";
+ mes "Reset?";
+ menu
+ "Yes.", L_Reset,
+ "No.", L_End;
+
+L_Reset:
+ set TUTORIAL, (TUTORIAL & ~(NIBBLE_2_MASK) | (0 << NIBBLE_2_SHIFT));
+ set TUTORIAL, (TUTORIAL & ~(NIBBLE_3_MASK) | (0 << NIBBLE_3_SHIFT));
+ set TUTORIAL, TUTORIAL &~ $@ValonStartBit;
+ set TUTORIAL, TUTORIAL &~ $@ValonEndBit;
+ mes "Reset!";
+ goto L_End;
+
+L_End:
+ end;
+
+OnInit:
+ if (!debug)
+ disablenpc "ValonDebug";
+ end;
+}
+042-1.gat,48,111,0|script|Valon|156,
{
- if (FLAGS & FLAG_TUTORIAL_DONE) goto L_Tut_Done;
+ callfunc "ValonState";
+ if (@valon_end)
+ goto L_QuestComplete;
+ if (!(@valon_start) && (@valon_count))
+ goto L_QuestAskAgain;
+ if (((@valon_start) && (!(@valon_end))) && (@valon_count >= $@ValonMobCnt[@valon_mob]))
+ goto L_NextMob;
+ if ((@valon_start) && (!(@valon_end)))
+ goto L_QuestStarted;
+ goto L_QuestAsk;
+L_QuestAskAgain:
+ mes "[Valon]";
+ mes "\"Hello, Adventurer! Have you come back to help?\"";
+ menu
+ "Yes. I will help with the desert beasts.", L_Accept,
+ "Maybe some other time.", L_NoThanks;
+
+L_QuestAsk:
mes "[Valon]";
mes "\"Hello!";
mes "You're looking for adventures, right?\"";
next;
mes "\"But you shouldn't underestimate this desert, it is dangerous.\"";
next;
- mes "\"It's crawling with scorpions, and the heat has overcome men tougher than you are.\"";
+ mes "\"It's crawling with scorpions, and the heat has overcome adventurers tougher than you are.\"";
next;
- mes "\"If you really want to challenge the desert go to Tulimshar first to prepare yourself.\"";
- close;
+ mes "\"I should know I gaurd this gate from all manner of desert beasts.\"";
+ next;
+ mes "\"Maybe you would like help and earn your stripes?\"";
+ next;
+ mes "\"The Council of Wizard's does offer a reward for helping...\"";
+ menu
+ "YES!!! let me at them!", L_Accept,
+ "Maybe some other time.", L_NoThanks;
+
+L_NoThanks:
+ callfunc "AddValonCntMask";
+ goto L_Close;
+
+L_Accept:
+ callfunc "ResetValonCntMask";
+ set TUTORIAL, TUTORIAL | $@ValonStartBit;
+ goto L_NewMob;
+
+L_NextMob:
+ getexp 40, 0;
+ mes "\"I see you killed all the " + $@ValonMobName$[@valon_mob] + " needed.\"";
+ next;
+ mes "\"The Wizard's thank thee as well.\"";
+ set Zeny, Zeny + 25;
+ next;
+ callfunc "ResetValonCntMask";
+ callfunc "AddValonMobMask";
+ callfunc "ValonState";
+ if (@valon_mob == getarraysize($@ValonMob))
+ goto L_QuestOver;
+ goto L_NewMob;
-L_Tut_Done:
+L_NewMob:
+ mes "\"Let's see whats on the list. Ah ok, I need you to kill me " + $@ValonMobCnt[@valon_mob] + " " + $@ValonMobName$[@valon_mob] + "\"";
+ next;
+ mes "\"I'll be waiting here, come back and see after you've kulled those mobs.\"";
+ goto L_Close;
+
+L_QuestStarted:
mes "[Valon]";
- mes "\"Hello!";
- mes "You're an adventurer, right?\"";
+ mes "Hail adventurer! You are well on your way to mastering the beasts of the desert.\"";
next;
- mes "\"Be careful in the desert.\"";
- close;
+ mes "\"You need to kill " + $@ValonMobName$[@valon_mob] + ": " + @valon_count + "/" + $@ValonMobCnt[@valon_mob] + "\"";
+ next;
+ mes "\"Come back and see me when the job is done.\"";
+ goto L_Close;
-OnTouch:
- if (FLAGS & FLAG_TUTORIAL_DONE)
- goto L_Tut;
- warp "042-1.gat", 44, 110;
+L_QuestOver:
mes "[Valon]";
- mes "\"The desert is merciless.";
- mes "I can't let you leave like this.\"";
- close;
+ mes "\"Thanks once again for helping with the monsters in the desert.\"";
+ getexp 50, 0;
+ set TUTORIAL, TUTORIAL | $@ValonEndBit;
+ goto L_Close;
-L_Tut:
- warp "041-1.gat", 58, 6;
- end;
+L_QuestComplete:
+ mes "[Valon]";
+ mes "\"Thanks once again for helping with the monsters in the desert.\"";
+ goto L_Close;
+
+L_Close:
+ close;
}
diff --git a/world/map/npc/042-1/zegas.txt b/world/map/npc/042-1/zegas.txt
new file mode 100644
index 00000000..d3dc118c
--- /dev/null
+++ b/world/map/npc/042-1/zegas.txt
@@ -0,0 +1,106 @@
+// Barrels
+// Author: Wushin
+// Npc
+042-1.gat,97,75,0|script|Zegas|165,
+{
+ setarray @npc_loc, 97, 75, 2;
+ callfunc "PCtoNPCRange";
+ if (@npc_check)
+ goto L_Range;
+
+ callfunc "CheckBarrelQuest";
+ if (@barrel_quest == 1)
+ goto L_Find;
+ if (@barrel_quest == 2)
+ goto L_Looking;
+ if (@barrel_quest == 3)
+ goto L_QuestEnd;
+ if (@barrel_quest == 4)
+ goto L_Thanks;
+ goto L_Meet;
+
+L_Range:
+ message strcharinfo(0), "Whats that? Come closer I can't hear you.";
+ goto L_Close;
+
+L_Meet:
+ mes "[Zegas]";
+ mes "\"Hey do you have a second?\"";
+ next;
+ mes "\"The storehouse here is over run with house maggots.\"";
+ next;
+ mes "\"Wouldn't you know it, the bug bomb Eomie gave us is in one of the store room barrels.\"";
+ next;
+ mes "\"Can you search the barrels for the bug bomb and set it off when you find it?\"";
+ set TUTORIAL, TUTORIAL | $@ZegasMetBit;
+ menu
+ "Sure.",L_Start,
+ "Maybe some other time.",L_Close;
+
+L_Find:
+ mes "[Zegas]";
+ mes "\"The storehouse is still over run with house maggots.\"";
+ next;
+ mes "\"Please help me find the bug bomb Eomie gave us is in one of the store room barrels?\"";
+ menu
+ "Sure.",L_Start,
+ "Maybe some other time.",L_Close;
+
+L_Start:
+ mes "[Zegas]";
+ set TUTORIAL, TUTORIAL | $@BarrelStartBit;
+ mes "\"Thanks, come back and see me once you found the bug bomb and set it off.\"";
+ goto L_Close;
+
+L_Looking:
+ mes "[Zegas]";
+ mes "\"Still haven't found it? Well keep looking I know it's in there some where.\"";
+ goto L_Close;
+
+L_QuestEnd:
+ mes "[Zegas]";
+ mes "\"From the smell I can see you found the bug bomb!\"";
+ getexp 50, 0;
+ next;
+ mes "\"Thanks once again, I know it's not much but here is 50 GP for your troubles.\"";
+ set Zeny, (Zeny + 50);
+ set TUTORIAL, TUTORIAL | $@BarrelEndBit;
+ goto L_Close;
+
+L_Thanks:
+ mes "[Zegas]";
+ mes "\"Thanks for Helping with clear out the store room!\"";
+ goto L_Close;
+
+L_Close:
+ close;
+}
+042-1.gat,100,75,0|script|ZegasDebug|165,
+{
+ mes "[Zegas Debug]";
+ mes "Reset ?";
+ menu
+ "Yes.", L_Reset,
+ "No.", L_End;
+
+L_Reset:
+ set TUTORIAL, TUTORIAL &~ $@BarrelStartBit;
+ set TUTORIAL, TUTORIAL &~ $@BarrelEndBit;
+ set TUTORIAL, TUTORIAL &~ (1 << 17);
+ set TUTORIAL, TUTORIAL &~ (1 << 18);
+ set TUTORIAL, TUTORIAL &~ (1 << 19);
+ set TUTORIAL, TUTORIAL &~ (1 << 20);
+ set TUTORIAL, TUTORIAL &~ (1 << 21);
+ set TUTORIAL, TUTORIAL &~ (1 << 22);
+ set TUTORIAL, TUTORIAL &~ (1 << 30);
+ mes "Reset!";
+ goto L_End;
+
+L_End:
+ end;
+
+OnInit:
+ if (!debug)
+ disablenpc "ZegasDebug";
+ end;
+}
diff --git a/world/map/npc/042-2/_import.txt b/world/map/npc/042-2/_import.txt
index 45f7ea62..7522e5e2 100644
--- a/world/map/npc/042-2/_import.txt
+++ b/world/map/npc/042-2/_import.txt
@@ -3,6 +3,11 @@
map: 042-2.gat
npc: npc/042-2/_mobs.txt
npc: npc/042-2/_warps.txt
+npc: npc/042-2/barrels.txt
+npc: npc/042-2/barrels_config.txt
+npc: npc/042-2/magic_basement.txt
npc: npc/042-2/mapflags.txt
+npc: npc/042-2/morgan.txt
npc: npc/042-2/sorfina.txt
+npc: npc/042-2/stat_reset.txt
npc: npc/042-2/tanisha.txt
diff --git a/world/map/npc/042-2/_mobs.txt b/world/map/npc/042-2/_mobs.txt
index a423b87a..60ac26d6 100644
--- a/world/map/npc/042-2/_mobs.txt
+++ b/world/map/npc/042-2/_mobs.txt
@@ -1,9 +1,15 @@
// This file is generated automatically. All manually changes will be removed when running the Converter.
// Tulimshar Suburbs Indoor mobs
+042-2.gat,33,57,24,7|monster|HouseMaggot|1050,7,100000,30000,Mob042-2::On1050
042-2.gat,0,0,0|script|Mob042-2|-1,
{
end;
+
+On1050:
+ set @mobID, 1050;
+ callfunc "MobPoints";
+ end;
}
diff --git a/world/map/npc/042-2/_warps.txt b/world/map/npc/042-2/_warps.txt
index 117a0f15..3fa81e27 100644
--- a/world/map/npc/042-2/_warps.txt
+++ b/world/map/npc/042-2/_warps.txt
@@ -4,3 +4,7 @@
042-2.gat,29,62|warp|To Outside|-1,-1,042-1.gat,65,76
042-2.gat,22,93|warp|To Outside|-1,-1,042-1.gat,91,74
042-2.gat,44,93|warp|To Outside|-1,-1,042-1.gat,104,74
+042-2.gat,112,84|warp|To Outside|-1,-1,042-1.gat,62,41
+042-2.gat,94,53|warp|To Outside|-1,-1,042-1.gat,112,94
+042-2.gat,112,53|warp|To Outside|-1,-1,042-1.gat,120,94
+042-2.gat,103,62|warp|To Outside|-1,-1,042-1.gat,117,103
diff --git a/world/map/npc/042-2/barrels.txt b/world/map/npc/042-2/barrels.txt
new file mode 100644
index 00000000..43d4444e
--- /dev/null
+++ b/world/map/npc/042-2/barrels.txt
@@ -0,0 +1,48 @@
+// Barrels
+// Author: Wushin
+// Barrels
+042-2.gat,23,86,0|script|Barrel#0|400,
+{
+ setarray @npc_loc, 23, 86, 2;
+ set @barrel, 0;
+ callfunc "CheckBarrel";
+ end;
+
+OnMaggotDeath:
+ end;
+}
+042-2.gat,28,86,0|script|Barrel#1|400,
+{
+ setarray @npc_loc, 28, 86, 2;
+ set @barrel, 1;
+ callfunc "CheckBarrel";
+ end;
+}
+042-2.gat,31,91,0|script|Barrel#2|400,
+{
+ setarray @npc_loc, 31, 91, 2;
+ set @barrel, 2;
+ callfunc "CheckBarrel";
+ end;
+}
+042-2.gat,36,85,0|script|Barrel#3|400,
+{
+ setarray @npc_loc, 36, 85, 2;
+ set @barrel, 3;
+ callfunc "CheckBarrel";
+ end;
+}
+042-2.gat,40,89,0|script|Barrel#4|400,
+{
+ setarray @npc_loc, 40, 89, 2;
+ set @barrel, 4;
+ callfunc "CheckBarrel";
+ end;
+}
+042-2.gat,38,91,0|script|Barrel#5|400,
+{
+ setarray @npc_loc, 38, 91, 2;
+ set @barrel, 5;
+ callfunc "CheckBarrel";
+ end;
+}
diff --git a/world/map/npc/042-2/barrels_config.txt b/world/map/npc/042-2/barrels_config.txt
new file mode 100644
index 00000000..85c78e41
--- /dev/null
+++ b/world/map/npc/042-2/barrels_config.txt
@@ -0,0 +1,109 @@
+// Barrels
+// Author: Wushin
+042-2.gat,33,88,24,7|monster|HouseMaggot|1050,2,100000,30000,Barrel#0::OnMaggotDeath
+-|script|#BarrelConfig|-1,
+{
+ end;
+
+OnInit:
+ set $@BarrelStartBit, (1 << 16);
+ set $@BarrelEndBit, (1 << 23);
+ set $@ZegasMetBit, (1 << 30);
+ setarray $@BarrelBits, (1 << 17), (1 << 18), (1 << 19), (1 << 20), (1 << 21), (1 << 22);
+ setarray $@BarrelRewards, 533, 507, 505, 518, 537, 526;
+ set $@BarrelSpawnCnt, 1;
+ set $@BarrelSpawnId, 1050;
+ set $@BarrelSpawnName$, "House Maggot";
+ set $@BarrelMax, getarraysize($@BarrelBits);
+ end;
+
+}
+function|script|CheckBarrelQuest|,
+{
+ callfunc "CountBarrels";
+ set @barrel_quest, 0;
+ if (TUTORIAL & $@ZegasMetBit)
+ set @barrel_quest, 1;
+ if (TUTORIAL & $@BarrelStartBit)
+ set @barrel_quest, 2;
+ if (!(TUTORIAL & $@BarrelStartBit) && (@barrel_count))
+ set @barrel_quest, 3;
+ if (TUTORIAL & $@BarrelEndBit)
+ set @barrel_quest, 4;
+ return;
+}
+function|script|CountBarrels|,
+{
+ set @barrel_count, 0;
+ set @barrel_tmp, 0;
+ goto L_Loop;
+
+L_Loop:
+ if (TUTORIAL & $@BarrelBits[@barrel_tmp])
+ goto L_AddOne;
+ goto L_LoopAgain;
+
+L_AddOne:
+ set @barrel_count, (@barrel_count + 1);
+ goto L_LoopAgain;
+
+L_LoopAgain:
+ set @barrel_tmp, (@barrel_tmp + 1);
+ if (@barrel_tmp == getarraysize($@BarrelBits))
+ goto L_BarrelTally;
+ goto L_Loop;
+
+L_BarrelTally:
+ return;
+}
+function|script|CheckBarrel|,
+{
+ callfunc "PCtoNPCRange";
+ if (@npc_check)
+ goto L_Range;
+ callfunc "CheckBarrelQuest";
+ if (!(@barrel_quest))
+ goto L_NoI;
+ if (TUTORIAL & $@BarrelBits[@barrel])
+ goto L_Empty;
+ set TUTORIAL, TUTORIAL | $@BarrelBits[@barrel];
+
+ callfunc "CountBarrels";
+ if (@barrel_count == $@BarrelMax)
+ goto L_QuestReward;
+ set @player_random, rand(@barrel_count * 10);
+ set @barrel_random, rand(@barrel_count * $@BarrelMax);
+ if (@barrel_random > @player_random)
+ goto L_Spawn;
+ goto L_Reward;
+
+L_Range:
+ message strcharinfo(0), "You'll need to get closer.";
+ goto L_Return;
+
+L_NoI:
+ message strcharinfo(0), "Nothing interesting here.";
+ goto L_Return;
+
+L_Empty:
+ message strcharinfo(0), "You've already searched this barrel.";
+ goto L_Return;
+
+L_QuestReward:
+ message strcharinfo(0), "You found the bug bomb.";
+ misceffect 33;
+ set TUTORIAL, TUTORIAL &~ $@BarrelStartBit;
+ killmonster getmap() + ".gat", "Barrel#0::OnMaggotDeath";
+ goto L_Return;
+
+L_Spawn:
+ areamonster getmap() + ".gat", @npc_loc[0], @npc_loc[1], (@npc_loc[0] + 1), (@npc_loc[1] + 1), $@BarrelSpawnName$, $@BarrelSpawnId, $@BarrelSpawnCnt, "Barrel#0::OnMaggotDeath";
+ goto L_Return;
+
+L_Reward:
+ getitem $@BarrelRewards[rand(getarraysize($@BarrelRewards))], 1;
+ goto L_Return;
+
+L_Return:
+ return;
+}
diff --git a/world/map/npc/042-2/magic_basement.txt b/world/map/npc/042-2/magic_basement.txt
new file mode 100644
index 00000000..2f278a5a
--- /dev/null
+++ b/world/map/npc/042-2/magic_basement.txt
@@ -0,0 +1,21 @@
+//
+// Author: Wushin
+
+042-2.gat,103,56,0|script|#MagicBasement|400,0,0,
+{
+ callfunc "MorganState";
+ if (@morgan < 4)
+ goto L_Close;
+ mes "Descend into the basement?";
+ next;
+ menu
+ "Yes.", L_MagicBase,
+ "Nevermind.", L_Close;
+
+L_MagicBase:
+ warp "042-3",24,21;
+ goto L_Close;
+
+L_Close:
+ close;
+}
diff --git a/world/map/npc/042-2/morgan.txt b/world/map/npc/042-2/morgan.txt
new file mode 100644
index 00000000..3ea1a2e8
--- /dev/null
+++ b/world/map/npc/042-2/morgan.txt
@@ -0,0 +1,142 @@
+// Tut mage
+// Author: Wushin
+// Gains Access to Magic School
+// See 024-2 clean that shit up
+// Morgan, liana
+function|script|MorganState|,
+{
+ callfunc "ClearVariables";
+ set @morgan, ((TUTORIAL & NIBBLE_6_MASK) >> NIBBLE_6_SHIFT);
+ return;
+}
+function|script|SetMorganMask|,
+{
+ set TUTORIAL, (TUTORIAL & ~(NIBBLE_6_MASK) | (@morgan_tmp << NIBBLE_6_SHIFT));
+ set @morgan_tmp, 0;
+ return;
+}
+042-2,105,57,0|script|MorganDebug|355,
+{
+ mes "[Morgan Debug]";
+ mes "Reset?";
+ menu
+ "Yes.", L_Reset,
+ "No.", L_End;
+L_Reset:
+ set TUTORIAL, (TUTORIAL & ~(NIBBLE_6_MASK) | (0 << NIBBLE_6_SHIFT));
+ mes "Reset!";
+ goto L_End;
+
+L_End:
+ end;
+
+OnInit:
+ if (!debug)
+ disablenpc "MorganDebug";
+ end;
+}
+042-2,101,57,0|script|Morgan|355,
+{
+ callfunc "MorganState";
+ if (readparam(bInt) >= 5)
+ goto L_Learn;
+ goto L_NotMagic;
+
+L_Learn:
+ if (@morgan == 0)
+ goto L_NotSeen;
+ if (@morgan == 1)
+ goto L_Seen;
+ if (@morgan == 2)
+ goto L_Started;
+ if (@morgan == 3)
+ goto L_CastOnce;
+ if (@morgan == 4)
+ goto L_LearningDone;
+ goto L_Close;
+
+L_NotSeen:
+ set @morgan_tmp, 1;
+ callfunc "SetMorganMask";
+ mes "[Morgan]";
+ mes "\"Welcome to the Magic Insitute of Tulimshar!\"";
+ next;
+ mes "\"My name is Morgan, I'm the Dean of Wizardry.\"";
+ next;
+ mes "\"You appear to have the markings to use magic.\"";
+ next;
+ mes "\"Granted you are still to young to cast spells.\"";
+ next;
+ mes "\"But we can teach you to use simple magic devices.\"";
+ next;
+ mes "\"Would you like to learn some apprentice skills?\"";
+ menu
+ "Yes.", L_Start,
+ "Maybe later", L_Close;
+
+L_Seen:
+ mes "[Morgan]";
+ mes "\"Have you returned to learn some magic?\"";
+ menu
+ "Yes.", L_Start,
+ "Maybe later", L_Close;
+
+L_NotMagic:
+ mes "[Morgan]";
+ mes "\"Hrmm you don't appear to posses enough magical talent to teach.\"";
+ goto L_Close;
+
+L_Start:
+ set @morgan_tmp, 2;
+ callfunc "SetMorganMask";
+ mes "\"Great, lets begin your first lesson.\"";
+ next;
+ getitem 1171, 1;
+ mes "\"This is a wand, there are many like it but this one is now yours.\"";
+ next;
+ mes "\"Various wands and staffs are found throughout the land with many different strengths and weaknesses.\"";
+ next;
+ mes "\"To use the wand you need to have it equipped and speak the incantation to let it tap into your mana.\"";
+ next;
+ mes "\"As the power of your magic grows so will the spells you can cast.\"";
+ next;
+ mes "\"Lets start with a basic wand attack. " + getspellinvocation("wand") + "\"";
+ next;
+ mes "\"Equip the wand and lets try out that spell.\"";
+ next;
+ mes "\"Speak to me again once you've cast the spell.\"";
+ goto L_Close;
+
+L_Started:
+ mes "[Morgan]";
+ mes "\"Lets start with a basic wand attack. " + getspellinvocation("wand") + "\"";
+ next;
+ mes "\"Equip the wand and lets try out that spell.\"";
+ next;
+ mes "\"Speak to me again once you've cast the spell.\"";
+ goto L_Close;
+
+L_CastOnce:
+ mes "[Morgan]";
+ mes "\"Ok, good job! Looks like you have good mana flow.\"";
+ next;
+ mes "\"Onto the next lesson. Now that you have " + getspellinvocation("wand") + " cast,\"";
+ next;
+ mes "\"Each time you attack the wand will convert a bit of you mana into a magic bolt.\"";
+ next;
+ mes "\"After so many attacks, you will need to recast the invocation to stay attuned to the wand.\"";
+ next;
+ mes "\"(Logging out will also cancel any spell effects currently active in-game.).\"";
+ next;
+ set @morgan_tmp, 4;
+ callfunc "SetMorganMask";
+ goto L_Close;
+
+L_LearningDone:
+ mes "[Morgan]";
+ mes "\"I've taught you all I can for now. Come back later.\"";
+ goto L_Close;
+
+L_Close:
+ close;
+}
diff --git a/world/map/npc/042-2/sorfina.txt b/world/map/npc/042-2/sorfina.txt
index 841a667a..4301d124 100644
--- a/world/map/npc/042-2/sorfina.txt
+++ b/world/map/npc/042-2/sorfina.txt
@@ -1,7 +1,33 @@
// This file is part of the Tutorial
// Author: Jenalya
+042-2.gat,21,26,0|script|TutDebug|154,
+{
+ mes "[TutDebug]";
+ mes "Reset?";
+ menu
+ "Yes.",L_Reset,
+ "No.",L_End;
+
+L_Reset:
+ set TUT_var, 0;
+ set @tutorial_tmp, 0;
+ set TUTORIAL, (TUTORIAL & ~(NIBBLE_0_MASK) | (@tutorial_tmp << NIBBLE_0_SHIFT));
+ set TUTORIAL, TUTORIAL &~ $@SorfinaHasanBit;
+ set TUTORIAL, TUTORIAL &~ $@TanishaHasanBit;
+ set TUTORIAL, TUTORIAL &~ $@HasanCompleteBit;
+ set FLAGS, FLAGS &~ FLAG_TUTORIAL_DONE;
+ mes "Reset!";
+ goto L_End;
+
+L_End:
+ end;
-042-2.gat,28,26,0|script|Sorfina|154,4,4
+OnInit:
+ if(!debug)
+ disablenpc "TutDebug";
+ end;
+}
+042-2.gat,28,26,0|script|Sorfina|154,1,4
{
callfunc "TutorialState";
@@ -17,8 +43,8 @@ L_Heal:
goto L_Main;
L_Main:
- if (FLAGS & FLAG_TUTORIAL_DONE) goto L_Again;
if ((@tutorial == 11) && !(@sorfina_hasan)) goto L_Hasan;
+ if (FLAGS & FLAG_TUTORIAL_DONE) goto L_Again;
if (@tutorial >= 4) goto L_Again;
if (@tutorial == 3) goto L_Clothes;
if (@tutorial == 2) goto L_Chest;
@@ -66,7 +92,9 @@ L_Tut:
L_Carpet:
mes "[Sorfina]";
mes "\"Try to take a few steps and walk to that red carpet over there.";
- mes "Just use the arrow keys or click on the place you want to go to.\"";
+ mes "Just use the ###keyMoveUp; to move up, ###keyMoveDown; to move down, ";
+ mes " ###keyMoveLeft; to move left, ###keyMoveRight; to move right ";
+ mes " or click on the place you want to go to.\"";
set @tutorial_tmp, 1;
callfunc "SetTutorialMask";
goto L_Close;
@@ -75,18 +103,18 @@ L_Chest:
mes "[Sorfina]";
mes "\"In that chest there are some clothes you can take.\"";
next;
- mes "\"To interact with things in your environment or talk to NPCs you can either click on it or press N to focus and T to talk/activate.\"";
+ mes "\"To interact with things in your environment or talk to NPCs you can either click on it or press ###keyTargetNPC; to focus and ###keyTalk; to talk/activate.\"";
next;
mes "\"Now get the clothes out of the chest.\"";
goto L_Close;
L_Naked:
mes "[Sorfina]";
- mes "\"Press F3 or click on the Inventory button in the bar at the upper right corner to open your bag.\"";
+ mes "\"Press ###keyWindowInventory; or click on the Inventory button in the bar at the upper right corner to open your bag.\"";
next;
- mes "\"Once we stop talking, click on the clothes and press the equip button.\"";
+ mes "\"Once we stop talking, double-click on the clothes to equip.\"";
next;
- mes "\"Talk to me again after you get dressed. You can either click on me, or press N to focus on me and T to talk.\"";
+ mes "\"Talk to me again after you get dressed. You can either click on me, or press ###keyTargetNPC; to focus on me and ###keyTalk; to talk.\"";
goto L_Close;
L_Clothes:
@@ -136,23 +164,25 @@ L_Explain:
L_Walk:
mes "[Sorfina]";
mes "\"You can use the arrow keys to walk around.";
- mes "Or just click on the place you want to go to.";
- mes "But this only works if that place is reachable and walkable.\"";
+ mes "Just use the ###keyMoveUp; to move up, ###keyMoveDown; to move down, ";
+ mes " ###keyMoveLeft; to move left, ###keyMoveRight; to move right ";
+ mes " or click on the place you want to go to.\"";
+ mes "This only works if that place is reachable and walkable.\"";
goto L_Close;
L_Talk:
mes "[Sorfina]";
mes "\"If you want to talk to a normal person, you can click at him or her.";
- mes "Or you can press N to focus on the nearest person and then press T to talk.\"";
+ mes "Or you can press ###keyTargetNPC; to focus on the nearest person and then press ###keyTalk; to talk.\"";
next;
- mes "\"If you want to talk to other adventurers, press Enter to open your chat window.";
+ mes "\"If you want to talk to other adventurers, press ###keyChat; to open your chat window.";
mes "Then type your message and press Enter to send.\"";
next;
mes "\"You may want to talk privately to another adventurer sometimes. In that case you can whisper.";
- mes "After pressing Enter type '/whisper [name] [message]'.";
+ mes "After pressing ###keyChat; type '/whisper [name] [message]'.";
mes "Or you can right click on someone and choose the whisper option.\"";
next;
- mes "\"Press F7 to show and hide your chat window.\"";
+ mes "\"Press ###keyWindowChat; to show and hide your chat window.\"";
goto L_Close;
L_Items:
@@ -171,16 +201,16 @@ L_Items:
mes "\"Your HitchHikers Towel will return you to your last set soul menhir or here if not set.\"";
mes "\"It can't be used constantly as the magic needs time to power the jump.\"";
next;
- mes "\"Press F3 to open your inventory.";
+ mes "\"Press ###keyWindowInventory; to open your inventory.";
mes "When placing your cursor over an item there, you can see a box with some information about that item.\"";
next;
- mes "\"To use or equip an item, select it by clicking on it.";
- mes "Then press Use or Equip.\"";
+ mes "\"To use or equip an item, select it by double-clicking on it.";
+ mes "Selecting the item then pressing Use or Equip also works.\"";
goto L_Close;
L_Shortcut:
mes "[Sorfina]";
- mes "\"Press F8 or click the Shortcut button in the bar at the upper right to open your shortcut window.\"";
+ mes "\"Press ###keyOutfitShortcut1; or click the Shortcut button in the bar at the upper right to open your shortcut window.\"";
next;
mes "\"You can select the item you want to put on a shortcut with your mouse and then click on the position in the shortcut window you want to place it.\"";
next;
@@ -207,7 +237,7 @@ L_Hasan:
mes "[Sorfina]";
mes "\"Make yourself at home! Do you have any questions?\"";
menu
- "A guy named Hasan won't let me enter Tulimshar.",L_Next,
+ "A guy named Hasan is bullying people.",L_Next,
"Yes, could you explain again about...",L_Explain,
"No, thanks.",L_Close;
@@ -291,7 +321,7 @@ OnTouch:
close;
}
-042-2.gat,27,23,0|script|Chest#tutorial|111,
+042-2.gat,29,23,0|script|Chest#tutorial|111,
{
callfunc "TutorialState";
if (@tutorial > 2) goto L_Empty;
@@ -320,7 +350,7 @@ L_Empty:
close;
}
-042-2.gat,44,31,0|script|#DoorOut-@tutorial|45,0,0
+042-2.gat,44,31,0|script|#DoorOutTut1|45,0,0
{
end;
@@ -328,7 +358,7 @@ OnTouch:
callfunc "TutorialState";
if ((@tutorial < 4) && !(FLAGS & FLAG_TUTORIAL_DONE))
goto L_Block;
- warp "042-1.gat", 63, 49;
+ warp "042-1.gat", 51, 44;
end;
L_Block:
diff --git a/world/map/npc/042-2/stat_reset.txt b/world/map/npc/042-2/stat_reset.txt
new file mode 100644
index 00000000..c033fcb2
--- /dev/null
+++ b/world/map/npc/042-2/stat_reset.txt
@@ -0,0 +1,42 @@
+//
+
+042-2.gat,98,91,0|script|Jessie|159,
+{
+ if (BaseLevel >= 10)
+ goto L_Sorry;
+
+ mes "[Jessie]";
+ mes "\"I know a spell that will";
+ mes "reset status points on the youngings.";
+ next;
+ menu
+ "Reset my stats",L_Reset,
+ "Forget about it",L_Pass;
+
+L_Reset:
+ resetstatus;
+
+ mes "[Jessie]";
+ mes "\"There you are.";
+ mes "";
+ mes "Good as new!\"";
+ goto L_Close;
+
+L_Pass:
+ mes "[Jessie]";
+ mes "\"Very well then, see you.\"";
+ goto L_Close;
+
+L_Sorry:
+ mes "[Jessie]";
+ mes "\"My spell only works on the very young, sorry.\"";
+ next;
+ mes "\"You can always try Mailvox in the Noble Quarter.\"";
+ next;
+ mes "\"Head east through the docks, then south into North Tulimshar,";
+ mes "Then go north east into the Noble Quarter, sitting behind a stall in the east.\"";
+ goto L_Close;
+
+L_Close:
+ close;
+}
diff --git a/world/map/npc/042-2/tanisha.txt b/world/map/npc/042-2/tanisha.txt
index 482224f0..fb67989d 100644
--- a/world/map/npc/042-2/tanisha.txt
+++ b/world/map/npc/042-2/tanisha.txt
@@ -2,15 +2,15 @@
// Authors: Jenalya, alastrim
// Cleanup: o11c
-042-2.gat,37,90,0|script|Tanisha|114,
+042-2.gat,110,88,0|script|Tanisha|114,
{
- if (isin("042-2.gat", 30, 85, 36, 89))
+ if (isin("042-2.gat", 98, 84, 106, 89))
goto L_Fighting;
- if (FLAGS & FLAG_TUTORIAL_DONE) goto L_Tut_Done;
callfunc "TutorialState";
if ((@tutorial == 11) && !(@tanisha_hasan)) goto L_Hasan;
+ if (FLAGS & FLAG_TUTORIAL_DONE) goto L_Tut_Done;
if (@tutorial >= 8) goto L_Again;
if (@tutorial == 7) goto L_Stats;
if (@tutorial == 6) goto L_Fail;
@@ -42,8 +42,7 @@ L_Maggots:
mes "\"If you kill them, I'll give you my knife.";
mes "What do you say?\"";
menu
- "Sure!",L_Next1,
- "That's your job.",L_Close;
+ "I guess it's the least I can do.",L_Next1;
L_Next1:
mes "[Tanisha]";
@@ -51,7 +50,7 @@ L_Next1:
// since the check happens here, it is actually possible to have
// more than $@Maggot_MaxHunters in the area at one time
// but that's not a BIG problem
- if (getareausers("042-2.gat", 30, 85, 36, 89) >= $@Maggot_MaxHunters)
+ if (getareausers("042-2.gat", 98, 84, 106, 89) >= $@Maggot_MaxHunters)
goto L_Crowded;
next;
goto L_Fight_Again;
@@ -60,14 +59,14 @@ L_Fight_Again:
mes "\"Ok, listen what to do.";
mes "Equip a weapon and kill the maggots.\"";
next;
- mes "\"Press A to focus on a monster. With X you can focus and start attacking the same time.";
+ mes "\"Press A to focus on a monster. With ###keyTargetAttack; you can focus and start attacking the same time.";
mes "But it also works to click on the monster with your mouse.\"";
next;
- mes "\"If you press the left Shift button, you can abort your attack.\"";
+ mes "\"If you press the ###keyTarget;, you can abort your attack.\"";
next;
mes "\"Maggots aren't aggressive, so they won't harm you until you attack them first. Take them out one by one.\"";
next;
- mes "\"Sometimes dead monsters leave some useful things. You can pick them up by pressing Z or clicking on the items with your mouse.\"";
+ mes "\"Sometimes dead monsters leave some useful things. You can pick them up by pressing ###keyPickup; or clicking on the items with your mouse.\"";
close2;
// The getitem must be in the same place as set @tutorial, 2;
// since it was moved to after L_Fight_Again, add it conditionally
@@ -87,13 +86,13 @@ L_ContinueFight:
callfunc "SetTutorialMask";
set @Maggot_Kills, 0;
set @time, 0;
- if (getareausers("042-2.gat", 30, 85, 36, 89) == 0)
+ if (getareausers("042-2.gat", 98, 84, 106, 89) == 0)
initnpctimer;
- warp "042-2.gat", 33, 87;
+ warp "042-2.gat", 101, 87;
goto L_Summon;
L_Summon:
- areamonster "042-2.gat", 30, 85, 36, 89, "", 1002, 1, "Tanisha::OnMaggotDeath";
+ areamonster "042-2.gat", 98, 84, 106, 89, "", 1002, 1, "Tanisha::OnMaggotDeath";
end;
L_Stats:
@@ -103,7 +102,13 @@ L_Stats:
mes "\"And it seems you became stronger and more experienced.";
mes "That means you got some status points which you can use to increase your abilities.\"";
next;
- mes "\"Press F2 or click the Status button in the bar at the upper right to see your status window. There you can distribute your points on six different properties.\"";
+ mes "\"Press ###keyWindowStatus; or click the Status button in the bar at the upper right to see your status window. There you can distribute your points on six different properties.\"";
+ next;
+ mes "\"My Uncle sitting at the counter knows a spell to help the younglings reset their stats.\"";
+ next;
+ mes "\"He also knows of mages with even more powerful reset spells.\"";
+ next;
+ mes "\"Some strange wizard lurking around in the Tulimshar Noble Quarter.\"";
next;
goto L_StatsRe;
@@ -123,7 +128,12 @@ L_StatsRe:
next;
mes "\"Think about how you want to play before assigning the points.\"";
next;
- mes "\"Also I heard rumors about a strange guy lurking around in the desert south of Tulimshar who can help you to forget your abilities!\"";
+ mes "\"My Uncle sitting at the counter knows a spell to help the younglings reset their stats.\"";
+ next;
+ mes "\"He also knows of mages with even more powerful reset spells.\"";
+ next;
+ mes "\"Some strange wizard lurking around in the Tulimshar Noble Quarter.\"";
+ next;
mes "Tanisha looks at you with wide opened eyes.";
next;
mes "[Tanisha]";
@@ -153,6 +163,7 @@ L_Advice:
L_SetTutorial:
set @tutorial_tmp, 8;
callfunc "SetTutorialMask";
+ callfunc "TutorialCompleted";
goto L_Close;
L_Again:
@@ -172,14 +183,14 @@ L_Explain:
L_Fight:
mes "[Tanisha]";
- mes "\"Press A to focus on a monster. With X you can focus and attack.";
+ mes "\"Press ###keyTargetMonster; to focus on a monster. With ###keyTargetAttack; you can focus and attack.";
mes "But it also works to click on the monster with your mouse.\"";
next;
- mes "\"If you press the left Shift button, you can abort your attack.\"";
+ mes "\"If you press the ###keyTarget; button, you can abort your attack.\"";
next;
- mes "\"Sometimes dead monsters leave some useful things. You can pick them up with pressing Z or clicking on the items with your mouse.\"";
+ mes "\"Sometimes dead monsters leave some useful things. You can pick them up with pressing ###keyPickup; or clicking on the items with your mouse.\"";
next;
- mes "\"If you feel exhausted from battle you can sit down by pressing S to recover faster.\"";
+ mes "\"If you feel exhausted from battle you can sit down by pressing ###keyBeingSit; to recover faster.\"";
goto L_Close;
L_Mob:
@@ -198,7 +209,7 @@ L_Hasan:
mes "[Tanisha]";
mes "\"Hi there! Is everything alright? Do you have questions?\"";
menu
- "A guy named Hasan won't let me enter Tulimshar.",L_Next3,
+ "A guy named Hasan is being mean.",L_Next3,
"Yes, could you explain again about...",L_Explain,
"No, thanks.",L_Close;
@@ -233,7 +244,7 @@ L_Crowded:
goto L_Close;
L_Sleep:
- warp "042-2.gat", 36, 90;
+ warp "042-2.gat", 101, 87;
mes "[Tanisha]";
mes "\"What are you doing in there?";
mes "Sleeping?";
@@ -241,7 +252,7 @@ L_Sleep:
set @Maggot_Kills, 0;
set @time, 0;
close2;
- if (getareausers("042-2.gat", 30, 85, 36, 89) == 0)
+ if (getareausers("042-2.gat", 98, 84, 106, 89) == 0)
goto L_CleanUp;
end;
@@ -259,7 +270,7 @@ L_Fail:
"No, I need a rest.", L_Close;
L_Next2:
- if (getareausers("042-2.gat", 30, 85, 36, 89) >= $@Maggot_MaxHunters)
+ if (getareausers("042-2.gat", 98, 84, 106, 89) >= $@Maggot_MaxHunters)
goto L_Crowded;
goto L_Fight_Again;
@@ -269,17 +280,17 @@ L_Fighting:
OnTimer1000:
setnpctimer 0;
- if (getareausers("042-2.gat", 30, 85, 36, 89) == 0)
+ if (getareausers("042-2.gat", 98, 84, 106, 89) == 0)
goto L_CleanUp;
// This is needed because multiple players can be in the area at once
- areatimer "042-2.gat", 30, 85, 36, 89, 0, "Tanisha::OnTick";
+ areatimer "042-2.gat", 98, 84, 106, 89, 0, "Tanisha::OnTick";
end;
L_CleanUp:
killmonster "042-2.gat", "Tanisha::OnMaggotDeath";
set $@Maggot_Hunters, 0;
stopnpctimer;
- areamonster "042-2.gat", 30, 85, 36, 89, "", 1002, 1, "Tanisha::OnMaggotDeath";
+ areamonster "042-2.gat", 98, 84, 106, 89, "", 1002, 1, "Tanisha::OnMaggotDeath";
end;
OnTick:
@@ -301,17 +312,17 @@ OnMaggotDeath:
message strcharinfo(0), "Tanisha: Ohh... Irrhk... Eeeeww... They just appear from nowhere!";
if (@Maggot_Kills == 3)
message strcharinfo(0), "Tanisha: Yuck... I think I am getting sick.";
- if (isin("042-2.gat", 30, 85, 36, 89))
+ if (isin("042-2.gat", 98, 84, 106, 89))
set @Maggot_Kills, @Maggot_Kills + 1;
if (@Maggot_Kills < 5)
goto L_Summon;
// else, complete
- warp "042-2.gat", 36, 90;
+ warp "042-2.gat", 110, 88;
set @tutorial_tmp, 7;
callfunc "SetTutorialMask";
set @Maggot_Kills, 0;
set @time, 0;
- if (getareausers("042-2.gat", 30, 85, 36, 89) == 0)
+ if (getareausers("042-2.gat", 98, 84, 106, 89) == 0)
goto L_CleanUp;
end;
@@ -321,6 +332,22 @@ L_Close:
OnInit:
set $@Maggot_MaxHunters, 4;
- areamonster "042-2.gat", 30, 85, 36, 89, "", 1002, 1, "Tanisha::OnMaggotDeath";
+ areamonster "042-2.gat", 98, 84, 106, 89, "", 1002, 1, "Tanisha::OnMaggotDeath";
end;
}
+042-2.gat,114,93,0|script|#DoorOutTut2|45,0,0
+{
+ end;
+
+OnTouch:
+ callfunc "TutorialState";
+ if (!(FLAGS & FLAG_TUTORIAL_DONE))
+ goto L_Block;
+ warp "042-1.gat", 63, 48;
+ end;
+
+L_Block:
+ message strcharinfo(0), "Tanisha: Please come here. I'd like some help!";
+ end;
+}
+
diff --git a/world/map/npc/042-3/_import.txt b/world/map/npc/042-3/_import.txt
new file mode 100644
index 00000000..2bc1c9d9
--- /dev/null
+++ b/world/map/npc/042-3/_import.txt
@@ -0,0 +1,5 @@
+// Map 042-3: Mages Passage
+// This file is generated automatically. All manually changes will be removed when running the Converter.
+map: 042-3.gat
+npc: npc/042-3/_mobs.txt
+npc: npc/042-3/_warps.txt
diff --git a/world/map/npc/042-3/_mobs.txt b/world/map/npc/042-3/_mobs.txt
new file mode 100644
index 00000000..391df0f2
--- /dev/null
+++ b/world/map/npc/042-3/_mobs.txt
@@ -0,0 +1,9 @@
+// This file is generated automatically. All manually changes will be removed when running the Converter.
+// Mages Passage mobs
+
+
+
+042-3.gat,0,0,0|script|Mob042-3|-1,
+{
+ end;
+}
diff --git a/world/map/npc/042-3/_warps.txt b/world/map/npc/042-3/_warps.txt
new file mode 100644
index 00000000..30b4e137
--- /dev/null
+++ b/world/map/npc/042-3/_warps.txt
@@ -0,0 +1,5 @@
+// This file is generated automatically. All manually changes will be removed when running the Converter.
+// Mages Passage warps
+
+042-3.gat,57,46|warp|To Tulimshar Canyon|2,-1,024-1.gat,80,31
+042-3.gat,24,20|warp|To Magic Insitute of Tulimshar|-1,-1,042-2.gat,103,55
diff --git a/world/map/npc/_import.txt b/world/map/npc/_import.txt
index 0972b191..dc144a18 100644
--- a/world/map/npc/_import.txt
+++ b/world/map/npc/_import.txt
@@ -105,6 +105,7 @@ import: npc/036-2/_import.txt
import: npc/041-1/_import.txt
import: npc/042-1/_import.txt
import: npc/042-2/_import.txt
+import: npc/042-3/_import.txt
import: npc/043-1/_import.txt
import: npc/043-3/_import.txt
import: npc/043-4/_import.txt
diff --git a/world/map/npc/annuals/fathertime.txt b/world/map/npc/annuals/fathertime.txt
index bedf23f6..40af55ff 100644
--- a/world/map/npc/annuals/fathertime.txt
+++ b/world/map/npc/annuals/fathertime.txt
@@ -1,7 +1,7 @@
// Annual Timer
// One timer to check to enable all holiday events
-botcheck.gat,26,28,0|script|#HolidayConfig|-1,
+017-9.gat,26,28,0|script|#HolidayConfig|-1,
{
end;
diff --git a/world/map/npc/annuals/xmas/debug.txt b/world/map/npc/annuals/xmas/debug.txt
index d51f57ac..38bbdf15 100644
--- a/world/map/npc/annuals/xmas/debug.txt
+++ b/world/map/npc/annuals/xmas/debug.txt
@@ -228,7 +228,7 @@ L_End:
}
-botcheck.gat,26,28,0|script|XmasDebug#5|105,
+017-9.gat,31,24,0|script|XmasDebug#5|105,
{
if(getgmlevel() < 40)
goto L_End;
diff --git a/world/map/npc/botcheck/_import.txt b/world/map/npc/botcheck/_import.txt
index affc86ce..d2a6a9e1 100644
--- a/world/map/npc/botcheck/_import.txt
+++ b/world/map/npc/botcheck/_import.txt
@@ -3,5 +3,4 @@
map: botcheck.gat
npc: npc/botcheck/_mobs.txt
npc: npc/botcheck/_warps.txt
-npc: npc/botcheck/announcements.txt
npc: npc/botcheck/mapflags.txt
diff --git a/world/map/npc/botcheck/mapflags.txt b/world/map/npc/botcheck/mapflags.txt
index b4dbac8a..cce971d6 100644
--- a/world/map/npc/botcheck/mapflags.txt
+++ b/world/map/npc/botcheck/mapflags.txt
@@ -1 +1,2 @@
botcheck.gat|mapflag|resave|botcheck.gat,37,37
+botcheck.gat|mapflag|nosave|botcheck.gat,37,37
diff --git a/world/map/npc/functions/clear_vars.txt b/world/map/npc/functions/clear_vars.txt
index b83ea630..a0c5e787 100644
--- a/world/map/npc/functions/clear_vars.txt
+++ b/world/map/npc/functions/clear_vars.txt
@@ -10,6 +10,8 @@ function|script|ClearVariables|,
L_SetAllTut:
if (FLAGS & FLAG_TUTORIAL_DONE)
goto L_ResetAllTut;
+ if ((FLAGS & FLAG_TUTORIAL_DONE) && (!(TUTORIAL & $@HasanCompleteBit)))
+ set TUTORIAL, TUTORIAL | $@HasanCompleteBit;
set @tutorial_tmp, (sorfina + tanisha + hasan + kaan);
set TUTORIAL, (TUTORIAL & ~(NIBBLE_0_MASK) | (@tutorial_tmp << NIBBLE_0_SHIFT));
set @tutorial_tmp, 0;
diff --git a/world/map/npc/functions/debug.txt b/world/map/npc/functions/debug.txt
index 9918cbaf..b4a66314 100755
--- a/world/map/npc/functions/debug.txt
+++ b/world/map/npc/functions/debug.txt
@@ -956,7 +956,7 @@ OnInit:
end;
}
-botcheck.gat,50,28,0|script|Debug4|154,
+017-9.gat,21,24,0|script|Debug4|154,
{
callfunc "Debug";
end;
diff --git a/world/map/npc/functions/default_npc_checks.txt b/world/map/npc/functions/default_npc_checks.txt
index 4ddd00ca..efe8818b 100644
--- a/world/map/npc/functions/default_npc_checks.txt
+++ b/world/map/npc/functions/default_npc_checks.txt
@@ -3,16 +3,16 @@
// Range
// Map, X, Y, Distance in Tiles
-// setarray $@npc_loc, 24, 113, 4;
+// setarray @npc_loc, 24, 113, 4;
function|script|PCtoNPCRange|,
{
set @npc_check, 0;
- set $@Nmap$, getmap() + ".gat";
- set $@Nx1, ($@npc_loc[0] - $@npc_loc[2]);
- set $@Ny1, ($@npc_loc[1] - $@npc_loc[2]);
- set $@Nx2, ($@npc_loc[0] + $@npc_loc[2]);
- set $@Ny2, ($@npc_loc[1] + $@npc_loc[2]);
- if (isin($@Nmap$, $@Nx1, $@Ny1, $@Nx2, $@Ny2))
+ set @Nmap$, getmap() + ".gat";
+ set @Nx1, (@npc_loc[0] - @npc_loc[2]);
+ set @Ny1, (@npc_loc[1] - @npc_loc[2]);
+ set @Nx2, (@npc_loc[0] + @npc_loc[2]);
+ set @Ny2, (@npc_loc[1] + @npc_loc[2]);
+ if (isin(@Nmap$, @Nx1, @Ny1, @Nx2, @Ny2))
goto L_Return;
set @npc_check, 1;
goto L_Return;
@@ -22,9 +22,9 @@ L_Return:
}
// Inventory & Weight
-// setarray @delitem_names$ Items to delete
+// @delitem_ids Items to delete
// @delitem_counts Counts of Items to delete
-// @getitem_names$ Items to get
+// @getitem_ids Items to get
// @getitem_counts Counts of Items to get
function|script|CheckInventory|,
{
@@ -33,78 +33,90 @@ function|script|CheckInventory|,
set @delitem_loop, 0;
set @getitem_loop, 0;
set @check_fail, 0;
+ set @msg_loop, 0;
- if (getarraysize(@delitem_names$))
+ if (getarraysize(@delitem_ids))
goto L_DelItemsLoop;
goto L_CheckGet;
L_DelItemsLoop:
- if(countitem(@delitem_names$[@delitem_loop]) >= @delitem_counts[@delitem_loop])
+ if(countitem(@delitem_ids[@delitem_loop]) >= @delitem_counts[@delitem_loop])
goto L_DelLoopAgain;
goto L_ReturnMissing;
L_DelLoopAgain:
- if((@delitems_loop + 1) == getarraysize(@delitems_names$))
+ set @delitem_loop, (@delitem_loop + 1);
+ if(@delitem_loop == getarraysize(@delitem_ids))
goto L_CheckGet;
- set @delitems_loop, (@delitems_loop + 1);
goto L_DelItemsLoop;
L_CheckGet:
- if (getarraysize(@getitem_names$))
+ if (getarraysize(@getitem_ids))
goto L_CheckWeight;
goto L_DelCheck;
L_CheckWeight:
getinventorylist;
- if (@inventorylist_count < (101 - getarraysize(@getitem_names$)))
+ if (100 < (@inventorylist_count + getarraysize(@getitem_ids)))
goto L_ReturnSpace;
goto L_GetItemsLoop;
L_GetItemsLoop:
- if (checkweight(@getitem_names$, 1) == 0)
+ if (checkweight(@getitem_ids[@getitem_loop], @getitem_counts[@getitem_loop]))
goto L_GetLoopAgain;
goto L_ReturnWeight;
L_GetLoopAgain:
- if((@getitems_loop + 1) == getarraysize(@getitems_names$))
+ set @getitem_loop, (@getitem_loop + 1);
+ if(@getitem_loop == getarraysize(@getitem_ids))
goto L_DelCheck;
- set @getitems_loop, (@getitems_loop + 1);
goto L_GetItemsLoop;
L_DelCheck:
- if (getarraysize(@delitem_names$))
+ if (getarraysize(@delitem_ids))
goto L_DelLoop;
goto L_CheckGet2;
L_DelLoop:
- delitem @delitem_names$[@del_loop], @delitem_counts[@del_loop];
+ delitem @delitem_ids[@del_loop], @delitem_counts[@del_loop];
goto L_DelAgain;
L_DelAgain:
- if((@del_loop + 1) == getarraysize(@delitems_names$))
- goto L_GetLoop;
set @del_loop, (@del_loop + 1);
+ if(@del_loop == getarraysize(@delitem_ids))
+ goto L_GetLoop;
goto L_DelLoop;
L_CheckGet2:
- if (getarraysize(@getitem_names$))
+ if (getarraysize(@getitem_ids))
goto L_GetLoop;
goto L_Return;
L_GetLoop:
- getitem @getitem_names$[@get_loop], @getitem_counts[@get_loop];
+ misceffect FX_GETITEM, strcharinfo(0);
+ getitem @getitem_ids[@get_loop], @getitem_counts[@get_loop];
goto L_GetAgain;
L_GetAgain:
- if((@get_loop + 1) == getarraysize(@getitems_names$))
- goto L_Return;
set @get_loop, (@get_loop + 1);
+ if(@get_loop == getarraysize(@getitem_ids))
+ goto L_Return;
goto L_GetLoop;
L_ReturnMissing:
- mes "\"You are missing required items.\"";
set @check_fail, 1;
- goto L_Return;
+ mes "\"You are missing required items.\"";
+ goto L_MissingMsg;
+
+L_MissingMsg:
+ mes "[@@"+@delitem_ids[@msg_loop]+"|"+getitemname(@delitem_ids[@msg_loop])+"@@] "+countitem(getitemname(@delitem_ids[@msg_loop]))+"/"+@delitem_counts[@msg_loop];
+ goto L_NextMsgCheck;
+
+L_NextMsgCheck:
+ set @msg_loop, (@msg_loop + 1);
+ if(@msg_loop == getarraysize(@delitem_ids))
+ goto L_Return;
+ goto L_MissingMsg;
L_ReturnWeight:
mes "\"You need to be carrying less weight.\"";
@@ -119,7 +131,9 @@ L_ReturnSpace:
goto L_Return;
L_Return:
- cleararray @delitem_names$, "", getarraysize(@delitem_names$);
- cleararray @getitem_names$, "", getarraysize(@getitem_names$);
+ cleararray @delitem_ids, "", getarraysize(@delitem_ids);
+ cleararray @delitem_counts, "", getarraysize(@delitem_counts);
+ cleararray @getitem_ids, "", getarraysize(@getitem_ids);
+ cleararray @getitem_counts, "", getarraysize(@getitem_counts);
return;
}
diff --git a/world/map/npc/functions/ferry.txt b/world/map/npc/functions/ferry.txt
index 271a2e39..c2e92271 100644
--- a/world/map/npc/functions/ferry.txt
+++ b/world/map/npc/functions/ferry.txt
@@ -1,6 +1,6 @@
// The ferry system
-botcheck.gat,27,28,0|script|#FerryConfig|-1,
+017-9.gat,27,28,0|script|#FerryConfig|-1,
{
end;
diff --git a/world/map/npc/functions/mob_points.txt b/world/map/npc/functions/mob_points.txt
index fd9729de..eb5aeff7 100644
--- a/world/map/npc/functions/mob_points.txt
+++ b/world/map/npc/functions/mob_points.txt
@@ -137,13 +137,22 @@ function|script|MobPoints|,
if (MPQUEST == 1)
set Mobpt, Mobpt + @points[@mobID - 1002];
+ callfunc "ValonState";
+ if (((@valon_start) && (!(@valon_end))) && (@mobID == $@ValonMob[@valon_mob]))
+ goto L_ValonMobKill;
+ goto L_NatureKarma;
+
+L_ValonMobKill:
+ callfunc "AddValonCntMask";
+ goto L_NatureKarma;
+
+L_NatureKarma:
// Scorpion, Red Scorpion, Black Scorpion, Angry Scorpion
// DemonicMouboo, ViciousSquirrel, WickedMushroom, Bluepar
if ((@mobID == 1003) || (@mobID == 1004) || (@mobID == 1009) || (@mobID == 1057)
|| (@mobID == 1104) || (@mobID == 1105) || (@mobID == 1106) || (@mobID == 1107))
goto L_good;
-
// Attitude adjustment for the witch (can we refactor this to another function? Not sure about max. recursion depth)
set @value, 0;
diff --git a/world/map/npc/functions/travelers.txt b/world/map/npc/functions/travelers.txt
index 7aa0d4b1..e455eb74 100644
--- a/world/map/npc/functions/travelers.txt
+++ b/world/map/npc/functions/travelers.txt
@@ -6,7 +6,7 @@
// Costs Zeny
// Contains all warp points to find
-botcheck.gat,27,28,0|script|#TravelConfig|-1,
+017-9.gat,27,28,0|script|#TravelConfig|-1,
{
end;
diff --git a/world/map/npc/items/check_wand.txt b/world/map/npc/items/check_wand.txt
new file mode 100644
index 00000000..1b11dfc2
--- /dev/null
+++ b/world/map/npc/items/check_wand.txt
@@ -0,0 +1,65 @@
+// Wands
+// Author: Wushin
+function|script|WandMana|,
+{
+ callfunc "CheckWand";
+ set @WandCost, (@Wand * ((MaxSp / 10) + 2));
+ set @WandAttack, 0;
+ if (!(@Wand))
+ goto L_NoWand;
+ if (Sp >= @WandCost)
+ goto L_Attack;
+ goto L_LowSp;
+
+L_Attack:
+ set Sp, (Sp - @WandCost);
+ set @WandAttack, 1;
+ goto L_Return;
+
+L_NoWand:
+ message strcharinfo(0), "You need a wand Equipped!";
+ set @WandAttack, 0;
+ goto L_Return;
+
+L_LowSp:
+ message strcharinfo(0), "Out of Mana";
+ set @WandAttack, 0;
+ goto L_Return;
+
+L_Return:
+ return;
+}
+function|script|CheckWand|,
+{
+ setarray $@Wands, 758, 1171;
+ setarray $@WandsPwr, 2, 1;
+ set @Wand, 0;
+ set @wand_loop, 0;
+ goto L_Loop;
+
+L_Loop:
+ if ((getequipid(equip_hand1) == $@Wands[@wand_loop]) || (getequipid(equip_hand2) == $@Wands[@wand_loop]))
+ goto L_SetWand;
+ goto L_LoopAgain;
+
+L_SetWand:
+ set @Wand, $@WandsPwr[@wand_loop];
+ callfunc "MorganState";
+ if (@morgan == 2)
+ goto L_SetCastOnce;
+ goto L_Return;
+
+L_LoopAgain:
+ set @wand_loop, (@wand_loop + 1);
+ if (@wand_loop >= getarraysize($@Wands))
+ goto L_Return;
+ goto L_Loop;
+
+L_SetCastOnce:
+ set @morgan_tmp, 3;
+ callfunc "SetMorganMask";
+ goto L_Return;
+
+L_Return:
+ return;
+}
diff --git a/world/map/npc/items/unequipcb.txt b/world/map/npc/items/unequipcb.txt
index 10080990..5db24bd4 100644
--- a/world/map/npc/items/unequipcb.txt
+++ b/world/map/npc/items/unequipcb.txt
@@ -2,7 +2,7 @@
// on any map because of the -1s at the end.
// Note: the client (I think) has a display bug if this is called
// during the intial connection's equip hook
-botcheck.gat,0,0,0|script|UnequipCB|-1,-1,-1
+017-9.gat,0,0,0|script|UnequipCB|-1,-1,-1
{
end;
diff --git a/world/map/npc/scripts.conf b/world/map/npc/scripts.conf
index 254f1357..8aa774e0 100644
--- a/world/map/npc/scripts.conf
+++ b/world/map/npc/scripts.conf
@@ -34,6 +34,7 @@ npc: npc/items/restricted_item.txt
npc: npc/items/warpTowels.txt
npc: npc/items/unequipcb.txt
npc: npc/items/launcher_ammo.txt
+npc: npc/items/check_wand.txt
import: npc/_import.txt
// GM Events