diff options
-rw-r--r-- | conf/magic.conf | 102 | ||||
-rw-r--r-- | npc/002-1_Sandstorm/rogue.txt | 33 |
2 files changed, 72 insertions, 63 deletions
diff --git a/conf/magic.conf b/conf/magic.conf index bfe56741..390df589 100644 --- a/conf/magic.conf +++ b/conf/magic.conf @@ -29,7 +29,23 @@ CONST SC_MBARRIER = 197 CONST SC_HASTE = 198 CONST SC_PHYS_SHIELD = 199 +# Special effects +CONST SFX_DEFAULT = 10 +CONST SFX_SUMMON_START = 21 +CONST SFX_SUMMON_FIRE = 22 CONST SFX_TELEPORT = 24 +CONST SFX_BARRIER = 10 +CONST SFX_UNBARRIER = 10 +CONST SFX_HEAL = 3 + +CONST MAX_RAIN_SPELL_RADIUS = 20 + +# Default sfx on caster +PROCEDURE default_effect() = + sfx(caster, school - MAGIC + 2, 0); + +PROCEDURE sfx_generic(target) = + sfx(target, SFX_DEFAULT, 0); # Increase spellpower by school and general magic skill PROCEDURE adjust_spellpower(school) = @@ -38,18 +54,18 @@ PROCEDURE adjust_spellpower(school) = THEN spellpower = spellpower + 200; # Do something for wedding rings, too? PROCEDURE heal(target, max_heal) = - sfx(caster, 4, 0); + CALL default_effect(); IF caster <> target - THEN sfx(target, 4, 0); + 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) = - sfx(caster, 4, 0); + CALL default_effect(); IF caster <> target - THEN sfx(target, 4, 0); + THEN sfx(target, SFX_HEAL, 0); instaheal(target, power, 0); # Can attack the target? Imports attack_range from dynamic environment @@ -77,7 +93,7 @@ PROCEDURE melee_damage(target, damage, dmgplus) = PROCEDURE install_attack_spell(charges, base_delay, range, attack_animation) = - sfx(caster, 5, 0); + CALL default_effect(); attack_range = range; override_attack(caster, charges, ((200 - agi(caster)) * base_delay) / 200, range, 0, attack_animation); @@ -86,14 +102,15 @@ 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) = - sfx(caster, 2, 0); - sfx(location, 21, 0); + CALL default_effect(); + sfx(location, SFX_SUMMON_START, 0); WAIT delay; - sfx(location, 22, 0); + sfx(location, SFX_SUMMON_FIRE, 0); spawn(rbox(location, 2), caster, mob_id, if_then_else(skill(caster, ASTRAL) >= control_level, 2, 1), # pets when level is high enough count, lifetime); + #-------------------------------------------------------------------------------- # Level 0 spells #-------------------------------------------------------------------------------- @@ -129,7 +146,7 @@ SPELL flare-dart : "#fla" = REQUIRE skill(caster, MAGIC) > level, (REQUIRE skill(caster, school) > 2 OR COMPONENTS ["SulphurPowder"])) => EFFECT CALL adjust_spellpower(school); - sfx(caster, 5, 0); + CALL default_effect(); damage = min(40 + skill(caster, school) * 20, 10 + spellpower); damage_bonus = 5 + level(caster) / 3; @@ -147,12 +164,12 @@ SPELL magic-blade : "#mbl" = REQUIRE skill(caster, MAGIC) > level) => ( COMPONENTS ["SharpKnife"] => EFFECT CALL adjust_spellpower(WAR); - sfx(caster, 5, 0); + CALL default_effect(); CALL install_melee_spell(10 + spellpower / 10, 900, 30); ATTRIGGER CALL melee_damage(target, 60 + spellpower / 20, 5 + str(caster)); | COMPONENTS ["Knife"] => EFFECT CALL adjust_spellpower(WAR); - sfx(caster, 5, 0); + CALL default_effect(); CALL install_melee_spell(10 + spellpower / 10, 900, 30); ATTRIGGER CALL melee_damage(target, 40 + spellpower / 20, 5 + str(caster)); ) @@ -162,10 +179,10 @@ SPELL aggravate : "#qaw" = school = NATURE IN (MANA 5, CASTTIME 300, REQUIRE skill(caster, MAGIC) > level) - => EFFECT CALL adjust_spellpower(school); - sfx(caster, 2, 0); + => EFFECT CALL adjust_spellpower(school); + CALL default_effect(); FOREACH MOB target IN rbox(location(caster), 1 + spellpower / 20) DO - (sfx(target, 2, 0); + (CALL sfx_generic(target); aggravate(target, 0, caster);) @@ -191,7 +208,7 @@ SPELL make-arrows : "#mkarrows" = REQUIRE skill(caster, school) > level, COMPONENTS ["RawLog"]) => EFFECT CALL adjust_spellpower(school); - sfx(caster, 2, 0); + CALL default_effect(); create_item(caster, "Arrow", 1 + spellpower / 15); SPELL make-shirt : "#mkshirt" = @@ -202,7 +219,7 @@ SPELL make-shirt : "#mkshirt" = REQUIRE skill(caster, school) > level, COMPONENTS [5 * "CottonCloth"]) => EFFECT CALL adjust_spellpower(school); - sfx(caster, 2, 0); + CALL default_effect(); create_item(caster, "CottonShirt", 1); SPELL make-tanktop : "#mktanktop" = @@ -213,7 +230,7 @@ SPELL make-tanktop : "#mktanktop" = REQUIRE skill(caster, school) > level, COMPONENTS [4 * "CottonCloth"]) => EFFECT CALL adjust_spellpower(school); - sfx(caster, 2, 0); + CALL default_effect(); create_item(caster, "TanktopWhite", 1); SPELL make-short-tanktop : "#mkshorttanktop" = @@ -224,7 +241,7 @@ SPELL make-short-tanktop : "#mkshorttanktop" = REQUIRE skill(caster, school) > level, COMPONENTS [3 * "CottonCloth"]) => EFFECT CALL adjust_spellpower(school); - sfx(caster, 2, 0); + CALL default_effect(); create_item(caster, "ShortTanktopWhite", 1); SPELL lightning-strike : "#kig" = @@ -242,6 +259,29 @@ SPELL lightning-strike : "#kig" = 3000, 8, 31); ATTRIGGER CALL attack_check(target); + in_rain = 0; + area = location(caster); + FOREACH SPELL s IN rbox(location(caster), MAX_RAIN_SPELL_RADIUS + 1) DO + IF name_of(s) = "rain" THEN ( +# message(caster, "found-rain at " + s.area + " vs. " + location(caster) + " inside: " + is_in(location(caster), s.area)); + IF is_in (location(caster), s.area) + THEN (in_rain = in_rain | 1; + area = area + s.area;); + IF is_in (location(target), s.area) + THEN in_rain = in_rain | 2; + ); +# message(caster, "in-rain : " + in_rain); + IF in_rain & 1 + THEN (# caster standing in the rain? This is going to be fun. + used = 0; + FOREACH TARGET t IN area DO + IF (random(200) + luk(caster) > 175) + THEN (used = used + 1; + CALL elt_damage (t, damage / 6, 1 + (damage_bonus / 3), ELT_EARTH, ELT_WIND, 17 + random(3));); + IF (not(used) || (random(200) + luk(caster) < 150)) + THEN (sfx(caster, 17 + random(3), 0); + itemheal(caster, 0 - damage - (random(damage_bonus)), 0);); + ) ELSE CALL elt_damage (target, damage, damage_bonus, ELT_EARTH, ELT_WIND, 17 + random(3)); SPELL fire-ball : "#pof" = @@ -290,7 +330,7 @@ SPELL flying-backpack (target : PC) : "#uuy" = REQUIRE skill(caster, school) > level, REQUIRE rdistance(location(target), location(caster)) < 2 + spellpower / 30) => EFFECT CALL adjust_spellpower(school); - sfx(target, 3, 0); + CALL default_effect(); IF (caster <> target) THEN sfx(caster, 2, 0); status_change(target, SC_FLYING_BACKPACK, 0, 0, 0, 0, 5000 + (spellpower * 500)); @@ -310,7 +350,7 @@ SPELL protect (target : PC) : "#ism" = => EFFECT CALL adjust_spellpower(school); sfx(target, 11, 0); IF (caster <> target) - THEN sfx(caster, 2, 0); + THEN CALL default_effect(); status_change(target, SC_PHYS_SHIELD, 5 + max(15, spellpower / 12), 0, 0, 0, 5000 + (spellpower * 500)); message (target, "You feel more protected."); ATEND message (target, "You feel less protected."); @@ -325,8 +365,9 @@ LOCAL SPELL rain : "#flosh" = REQUIRE skill(caster, school) > level, (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["BottleOfWater"])) => EFFECT CALL adjust_spellpower(school); - sfx(caster, 2, 0); - area = rbox(location(caster), 3 + spellpower / 30); + CALL default_effect(); + range = min(MAX_RAIN_SPELL_RADIUS, 3 + spellpower / 30); + area = rbox(location(caster), range); FOR i = 0 TO spellpower DO ( FOR j = 0 TO spellpower / 100 DO ( location = random_location(area); @@ -347,6 +388,7 @@ SPELL happy-curse (target : PC) : "#happy" = (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["WhiteFur"]), REQUIRE rdistance(location(target), location(caster)) < 1 + spellpower / 100) => EFFECT CALL adjust_spellpower(school); + CALL default_effect(); FOR i = 0 TO (spellpower / 10) DO (emote(target, 3); WAIT 500;); SPELL barrier (target : PC) : "#iso" = @@ -358,13 +400,13 @@ SPELL barrier (target : PC) : "#iso" = (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["HardSpike"]), REQUIRE rdistance(location(target), location(caster)) < 2 + spellpower / 30) => EFFECT CALL adjust_spellpower(school); - sfx(target, 3, 0); + sfx(target, SFX_BARRIER, 0); IF (caster <> target) - THEN sfx(caster, 2, 0); + THEN CALL default_effect(); status_change(target, SC_MBARRIER, 30 + max(30, spellpower / 8), 0, 0, 0, 2000 + (spellpower * 200)); message (target, "You are surrounded by a magical barrier."); ATEND message (target, "Your magical barrier disspiates."); - sfx(target, 2, 0); + sfx(target, SFX_UNBARRIER, 0); LOCAL SPELL summon-scorps : "#kbms" = @@ -375,7 +417,7 @@ LOCAL SPELL summon-scorps : "#kbms" = REQUIRE skill(caster, school) > level, COMPONENTS ["ScorpionStinger"]) => EFFECT CALL adjust_spellpower(school); - sfx(target, 2, 0); + CALL default_effect(); CALL summon_spell(1003, 1 + spellpower / 30, 5000 - (spellpower * 9), spellpower * 400, 2); LOCAL SPELL summon-red-scorps : "#kbmq" = @@ -386,7 +428,7 @@ LOCAL SPELL summon-red-scorps : "#kbmq" = REQUIRE skill(caster, school) > level, COMPONENTS ["RedScorpionStinger"]) => EFFECT CALL adjust_spellpower(school); - sfx(target, 2, 0); + CALL default_effect(); CALL summon_spell(1004, 1 + spellpower / 40, 5000 - (spellpower * 8), spellpower * 350, 3); @@ -397,7 +439,7 @@ SPELL detect-players : "#ewm" = REQUIRE skill(caster, MAGIC) > level, REQUIRE skill(caster, school) > level) => EFFECT CALL adjust_spellpower(school); - sfx(target, 2, 0); + CALL default_effect(); message = ""; FOREACH PC target IN rbox(location(caster), spellpower / 2) DO IF target <> caster @@ -455,7 +497,7 @@ SPELL summon-partner : "#aid" = REQUIRE skill(caster, school) > level, REQUIRE is_married(caster)) => EFFECT CALL adjust_spellpower(school); - sfx(caster, 2, 0); + 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))) + "."); @@ -483,7 +525,7 @@ SPELL shroud : "#aw" = IN (MANA 40, CASTTIME 400, REQUIRE skill(caster, MAGIC) > level, REQUIRE skill(caster, school) > level) - => EFFECT sfx(caster, 2, 0); + => EFFECT CALL default_effect(); shroud(caster, 0x04); #-------------------------------------------------------------------------------- diff --git a/npc/002-1_Sandstorm/rogue.txt b/npc/002-1_Sandstorm/rogue.txt index 7169e446..9d6a555f 100644 --- a/npc/002-1_Sandstorm/rogue.txt +++ b/npc/002-1_Sandstorm/rogue.txt @@ -30,39 +30,6 @@ L_Reset: resetstatus; - // even though statusup2 takes a number, it does not - // decrease chars statspoint, hence the repeating. - - statusup bStr; - statusup bStr; - statusup bStr; - statusup bStr; - - statusup bvit; - statusup bvit; - statusup bvit; - statusup bvit; - - statusup bInt; - statusup bInt; - statusup bInt; - statusup bInt; - - statusup bAgi; - statusup bAgi; - statusup bAgi; - statusup bAgi; - - statusup bDex; - statusup bDex; - statusup bDex; - statusup bDex; - - statusup bLuk; - statusup bLuk; - statusup bLuk; - statusup bLuk; - mes "[Rogue Mage]"; mes "\"There you are."; mes ""; |