diff options
Diffstat (limited to 'conf/magic.conf')
-rw-r--r-- | conf/magic.conf | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/conf/magic.conf b/conf/magic.conf index 83fe031d..a46055b5 100644 --- a/conf/magic.conf +++ b/conf/magic.conf @@ -23,6 +23,7 @@ CONST ELT_GHOST = 8 CONST ELT_UNDEAD = 9 # Schools of magic +CONST SC_HIDE = 194 CONST SC_HALT_REGENERATE = 195 CONST SC_FLYING_BACKPACK = 196 CONST SC_MBARRIER = 197 @@ -65,11 +66,12 @@ PROCEDURE set_var(name, mask, shift, value) = PROCEDURE gain_heal_xp(value, gain) = # `gain' influences the likelihood of an increase last_heal_xp = (script_int(caster, SCRIPT_XP) >> SCRIPT_HEALSPELL_SHIFT) & SCRIPT_HEALSPELL_MASK; IF (target <> caster - && value > (20 + last_heal_xp + random(last_heal_xp + 1) + random(last_heal_xp + 1))) ( + && value > (20 + 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) - heal_xp = SCRIPT_HEALSPELL_MASK; - set_var(SCRIPT_XP, SCRIPT_HEALSPELL_MASK, SCRIPT_HEALSPELL_SHIFT, heal_xp); + THEN heal_xp = SCRIPT_HEALSPELL_MASK; + CALL set_var(SCRIPT_XP, SCRIPT_HEALSPELL_MASK, SCRIPT_HEALSPELL_SHIFT, heal_xp); ) PROCEDURE gain_xp(gain) = @@ -162,6 +164,9 @@ PROCEDURE elt_damage(target, damage, dmgplus, bonus_elt, malus_elt, effect) = 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); @@ -324,7 +329,7 @@ SPELL make-arrows : "#T10" = COMPONENTS ["RawLog"]) => EFFECT CALL adjust_spellpower(school); CALL default_effect(); - CALL create_item("Arrow", 1 + spellpower / 40 + (random(max(1, 800 - spellpower)) / 80), "WarpedLog", 250); + CALL create_item("Arrow", 1 + spellpower / 40 + (random(max(1, 800 - spellpower)) / 80), "WarpedLog", 500); CALL gain_xp(1); SPELL make-shirt : "#T11" = @@ -336,7 +341,7 @@ SPELL make-shirt : "#T11" = COMPONENTS [5 * "CottonCloth"]) => EFFECT CALL adjust_spellpower(school); CALL default_effect(); - CALL create_item("CottonShirt", 1, "CottonCloth", 400); + CALL create_item("CottonShirt", 1, "CottonCloth", 425); CALL gain_xp(2); SPELL make-tanktop : "#T12" = @@ -348,7 +353,7 @@ SPELL make-tanktop : "#T12" = COMPONENTS [4 * "CottonCloth"]) => EFFECT CALL adjust_spellpower(school); CALL default_effect(); - CALL create_item("WhiteTankTop", 1, "CottonCloth", 500); + CALL create_item("WhiteTankTop", 1, "CottonCloth", 350); CALL gain_xp(2); SPELL make-short-tanktop : "#T13" = @@ -360,7 +365,7 @@ SPELL make-short-tanktop : "#T13" = COMPONENTS [3 * "CottonCloth"]) => EFFECT CALL adjust_spellpower(school); CALL default_effect(); - CALL create_item("WhiteShortTankTop", 1, "CottonCloth", 550); + CALL create_item("WhiteShortTankTop", 1, "CottonCloth", 250); CALL gain_xp(2); SPELL make-iron-powder : "#T14" = @@ -562,8 +567,9 @@ LOCAL SPELL rain : "#N13" = CALL gain_xp(1); range = min(MAX_RAIN_SPELL_RADIUS, 3 + spellpower / 30); area = rbox(location(caster), range); - IF (is_in(location(npc("#DruidTree0#_M", area))) - || is_in(location(npc("#DruidTree1#_M", area)))) { + IF (is_in(location(npc("#DruidTree0#_M")), area) + || is_in(location(npc("#DruidTree1#_M")), area)) + THEN { set @flag, 1; callfunc "QuestTreeTrigger"; }; @@ -632,7 +638,8 @@ SPELL detect-players : "#G10" = CALL default_effect(); message = ""; FOREACH PC target IN rbox(location(caster), spellpower / 2) - DO IF target <> caster + DO IF ((target <> caster) + && not (running_status_update(pc(target), SC_HIDE))) THEN (IF message <> "" THEN message = message + ", "; message = message + name_of (target); @@ -707,6 +714,20 @@ SPELL sense-spouse : "#G13" = ELSE message(caster, "You sense " + name + " in the " + dir + "."); ) +SPELL hide (target : PC) : "#A13" = + LET level = 1 + school = ASTRAL + IN (MANA 11, CASTTIME 1000, + REQUIRE skill(caster, MAGIC) > level, + REQUIRE skill(caster, school) > level, + (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["CottonCloth"]), + REQUIRE rdistance(location(target), location(caster)) < 2 + spellpower / 30) + => EFFECT CALL adjust_spellpower(school); + sfx(target, SFX_DEFAULT, 0); + IF (caster <> target) + THEN CALL default_effect(); + status_change(target, SC_HIDE, 0, 0, 0, 0, 5000 + (spellpower * 2500)); + CALL gain_xp(2); #-------------------------------------------------------------------------------- # Level 2 spells @@ -899,7 +920,8 @@ PROCEDURE hug_tree(target) = || target = "tree" || target = "tree*" || target = "Tree" || target = "Tree*" || target = "druid" || target = "druid*" - || target = "Druid" || target = "Druid*") { + || target = "Druid" || target = "Druid*") + THEN { set @flag, 2; callfunc "QuestTreeTrigger"; }; |