Index: scripts/globals/spells/arise.lua =================================================================== --- scripts/globals/spells/arise.lua (revision 0) +++ scripts/globals/spells/arise.lua (working copy) @@ -0,0 +1,15 @@ +----------------------------------------- +-- Spell: Arise +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + target:sendRaise(3); + target:delStatusEffect(EFFECT_RERAISE); + target:addStatusEffect(EFFECT_RERAISE,3,0,3600); --reraise 3, 1 hr duration +end; \ No newline at end of file Index: scripts/globals/spells/aspir_ii.lua =================================================================== --- scripts/globals/spells/aspir_ii.lua (revision 0) +++ scripts/globals/spells/aspir_ii.lua (working copy) @@ -0,0 +1,43 @@ +----------------------------------------- +-- Spell: Aspir II +-- Drain functions only on skill level!! +----------------------------------------- + +require("scripts/globals/magic"); +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + --calculate raw damage (unknown function -> only dark skill though) - using http://www.bluegartr.com/threads/44518-Drain-Calculations + -- also have small constant to account for 0 dark skill + dmg = 5 + 0.6 * (caster:getSkillLevel(DARK_MAGIC_SKILL) + caster:getMod(79 + DARK_MAGIC_SKILL)); + --get resist multiplier (1x if no resist) + resist = applyResistance(caster,spell,target,caster:getMod(MOD_INT)-target:getMod(MOD_INT),DARK_MAGIC_SKILL,1.0); + --get the resisted damage + dmg = dmg*resist; + --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) + dmg = addBonuses(caster,spell,target,dmg); + --add in target adjustment + dmg = adjustForTarget(target,dmg); + --add in final adjustments + + if(target:isUndead()) then + spell:setMsg(75); -- No effect + return; + end + + if(target:getMP() > dmg) then + caster:addMP(dmg); + target:delMP(dmg); + else + dmg = target:getMP(); + caster:addMP(dmg); + target:delMP(dmg); + end + + spell:setMsg(228); --change msg to 'xxx mp drained from the yyyy.' + return dmg; +end; \ No newline at end of file Index: scripts/globals/spells/boost-agi.lua =================================================================== --- scripts/globals/spells/boost-agi.lua (revision 0) +++ scripts/globals/spells/boost-agi.lua (working copy) @@ -0,0 +1,34 @@ +-------------------------------------- +-- Spell: Boost-AGI +-- Boosts targets AGI stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill >300)then + power = 5 + (0.1 * (enchanceSkill - 300)); + else + power = 5; + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_AGI_DOWN) == true) then + target:delStatusEffect(EFFECT_AGI_DOWN); + else + target:addStatusEffect(EFFECT_AGI_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/boost-chr.lua =================================================================== --- scripts/globals/spells/boost-chr.lua (revision 0) +++ scripts/globals/spells/boost-chr.lua (working copy) @@ -0,0 +1,34 @@ +-------------------------------------- +-- Spell: Boost-CHR +-- Boosts targets CHR stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill >300)then + power = 5 + (0.1 * (enchanceSkill - 300)); + else + power = 5; + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_CHR_DOWN) == true) then + target:delStatusEffect(EFFECT_CHR_DOWN); + else + target:addStatusEffect(EFFECT_CHR_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/boost-dex.lua =================================================================== --- scripts/globals/spells/boost-dex.lua (revision 0) +++ scripts/globals/spells/boost-dex.lua (working copy) @@ -0,0 +1,34 @@ +-------------------------------------- +-- Spell: Boost-DEX +-- Boosts targets DEX stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill >300)then + power = 5 + (0.1 * (enchanceSkill - 300)); + else + power = 5; + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_DEX_DOWN) == true) then + target:delStatusEffect(EFFECT_DEX_DOWN); + else + target:addStatusEffect(EFFECT_DEX_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/boost-int.lua =================================================================== --- scripts/globals/spells/boost-int.lua (revision 0) +++ scripts/globals/spells/boost-int.lua (working copy) @@ -0,0 +1,34 @@ +-------------------------------------- +-- Spell: Boost-INT +-- Boosts targets INT stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill >300)then + power = 5 + (0.1 * (enchanceSkill - 300)); + else + power = 5; + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_INT_DOWN) == true) then + target:delStatusEffect(EFFECT_INT_DOWN); + else + target:addStatusEffect(EFFECT_INT_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/boost-mnd.lua =================================================================== --- scripts/globals/spells/boost-mnd.lua (revision 0) +++ scripts/globals/spells/boost-mnd.lua (working copy) @@ -0,0 +1,34 @@ +-------------------------------------- +-- Spell: Boost-MND +-- Boosts targets MND stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill >300)then + power = 5 + (0.1 * (enchanceSkill - 300)); + else + power = 5; + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_MND_DOWN) == true) then + target:delStatusEffect(EFFECT_MND_DOWN); + else + target:addStatusEffect(EFFECT_MND_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/boost-str.lua =================================================================== --- scripts/globals/spells/boost-str.lua (revision 0) +++ scripts/globals/spells/boost-str.lua (working copy) @@ -0,0 +1,34 @@ +-------------------------------------- +-- Spell: Boost-STR +-- Boosts targets STR stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill >300)then + power = 5 + (0.1 * (enchanceSkill - 300)); + else + power = 5; + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_STR_DOWN) == true) then + target:delStatusEffect(EFFECT_STR_DOWN); + else + target:addStatusEffect(EFFECT_STR_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/boost-vit.lua =================================================================== --- scripts/globals/spells/boost-vit.lua (revision 0) +++ scripts/globals/spells/boost-vit.lua (working copy) @@ -0,0 +1,34 @@ +-------------------------------------- +-- Spell: Boost-VIT +-- Boosts targets VIT stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill >300)then + power = 5 + (0.1 * (enchanceSkill - 300)); + else + power = 5; + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_VIT_DOWN) == true) then + target:delStatusEffect(EFFECT_VIT_DOWN); + else + target:addStatusEffect(EFFECT_VIT_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/gain-agi.lua =================================================================== --- scripts/globals/spells/gain-agi.lua (revision 0) +++ scripts/globals/spells/gain-agi.lua (working copy) @@ -0,0 +1,72 @@ +-------------------------------------- +-- Spell: Gain-AGI +-- Boosts targets AGI stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill <309)then + power = 5 + elseif(enchanceSkill >=309 and enchanceSkill <=319)then + power = 6 + elseif(enchanceSkill >=320 and enchanceSkill <=329)then + power = 7 + elseif(enchanceSkill >=330 and enchanceSkill <=339)then + power = 8 + elseif(enchanceSkill >=340 and enchanceSkill <=349)then + power = 9 + elseif(enchanceSkill >=350 and enchanceSkill <=359)then + power = 10 + elseif(enchanceSkill >=360 and enchanceSkill <=369)then + power = 11 + elseif(enchanceSkill >=370 and enchanceSkill <=379)then + power = 12 + elseif(enchanceSkill >=380 and enchanceSkill <=389)then + power = 13 + elseif(enchanceSkill >=390 and enchanceSkill <=399)then + power = 14 + elseif(enchanceSkill >=400 and enchanceSkill <=409)then + power = 15 + elseif(enchanceSkill >=410 and enchanceSkill <=419)then + power = 16 + elseif(enchanceSkill >=420 and enchanceSkill <=429)then + power = 17 + elseif(enchanceSkill >=430 and enchanceSkill <=439)then + power = 18 + elseif(enchanceSkill >=440 and enchanceSkill <=449)then + power = 19 + elseif(enchanceSkill >=450 and enchanceSkill <=459)then + power = 20 + elseif(enchanceSkill >=460 and enchanceSkill <=469)then + power = 21 + elseif(enchanceSkill >=470 and enchanceSkill <=479)then + power = 22 + elseif(enchanceSkill >=480 and enchanceSkill <=489)then + power = 23 + elseif(enchanceSkill >=480 and enchanceSkill <=499)then + power = 24 + else + power = 25 + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_AGI_DOWN) == true) then + target:delStatusEffect(EFFECT_AGI_DOWN); + else + target:addStatusEffect(EFFECT_AGI_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/gain-chr.lua =================================================================== --- scripts/globals/spells/gain-chr.lua (revision 0) +++ scripts/globals/spells/gain-chr.lua (working copy) @@ -0,0 +1,72 @@ +-------------------------------------- +-- Spell: Gain-CHR +-- Boosts targets CHR stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill <309)then + power = 5 + elseif(enchanceSkill >=309 and enchanceSkill <=319)then + power = 6 + elseif(enchanceSkill >=320 and enchanceSkill <=329)then + power = 7 + elseif(enchanceSkill >=330 and enchanceSkill <=339)then + power = 8 + elseif(enchanceSkill >=340 and enchanceSkill <=349)then + power = 9 + elseif(enchanceSkill >=350 and enchanceSkill <=359)then + power = 10 + elseif(enchanceSkill >=360 and enchanceSkill <=369)then + power = 11 + elseif(enchanceSkill >=370 and enchanceSkill <=379)then + power = 12 + elseif(enchanceSkill >=380 and enchanceSkill <=389)then + power = 13 + elseif(enchanceSkill >=390 and enchanceSkill <=399)then + power = 14 + elseif(enchanceSkill >=400 and enchanceSkill <=409)then + power = 15 + elseif(enchanceSkill >=410 and enchanceSkill <=419)then + power = 16 + elseif(enchanceSkill >=420 and enchanceSkill <=429)then + power = 17 + elseif(enchanceSkill >=430 and enchanceSkill <=439)then + power = 18 + elseif(enchanceSkill >=440 and enchanceSkill <=449)then + power = 19 + elseif(enchanceSkill >=450 and enchanceSkill <=459)then + power = 20 + elseif(enchanceSkill >=460 and enchanceSkill <=469)then + power = 21 + elseif(enchanceSkill >=470 and enchanceSkill <=479)then + power = 22 + elseif(enchanceSkill >=480 and enchanceSkill <=489)then + power = 23 + elseif(enchanceSkill >=480 and enchanceSkill <=499)then + power = 24 + else + power = 25 + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_CHR_DOWN) == true) then + target:delStatusEffect(EFFECT_CHR_DOWN); + else + target:addStatusEffect(EFFECT_CHR_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/gain-dex.lua =================================================================== --- scripts/globals/spells/gain-dex.lua (revision 0) +++ scripts/globals/spells/gain-dex.lua (working copy) @@ -0,0 +1,72 @@ +-------------------------------------- +-- Spell: Gain-DEX +-- Boosts targets DEX stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill <309)then + power = 5 + elseif(enchanceSkill >=309 and enchanceSkill <=319)then + power = 6 + elseif(enchanceSkill >=320 and enchanceSkill <=329)then + power = 7 + elseif(enchanceSkill >=330 and enchanceSkill <=339)then + power = 8 + elseif(enchanceSkill >=340 and enchanceSkill <=349)then + power = 9 + elseif(enchanceSkill >=350 and enchanceSkill <=359)then + power = 10 + elseif(enchanceSkill >=360 and enchanceSkill <=369)then + power = 11 + elseif(enchanceSkill >=370 and enchanceSkill <=379)then + power = 12 + elseif(enchanceSkill >=380 and enchanceSkill <=389)then + power = 13 + elseif(enchanceSkill >=390 and enchanceSkill <=399)then + power = 14 + elseif(enchanceSkill >=400 and enchanceSkill <=409)then + power = 15 + elseif(enchanceSkill >=410 and enchanceSkill <=419)then + power = 16 + elseif(enchanceSkill >=420 and enchanceSkill <=429)then + power = 17 + elseif(enchanceSkill >=430 and enchanceSkill <=439)then + power = 18 + elseif(enchanceSkill >=440 and enchanceSkill <=449)then + power = 19 + elseif(enchanceSkill >=450 and enchanceSkill <=459)then + power = 20 + elseif(enchanceSkill >=460 and enchanceSkill <=469)then + power = 21 + elseif(enchanceSkill >=470 and enchanceSkill <=479)then + power = 22 + elseif(enchanceSkill >=480 and enchanceSkill <=489)then + power = 23 + elseif(enchanceSkill >=480 and enchanceSkill <=499)then + power = 24 + else + power = 25 + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_DEX_DOWN) == true) then + target:delStatusEffect(EFFECT_DEX_DOWN); + else + target:addStatusEffect(EFFECT_DEX_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/gain-int.lua =================================================================== --- scripts/globals/spells/gain-int.lua (revision 0) +++ scripts/globals/spells/gain-int.lua (working copy) @@ -0,0 +1,72 @@ +-------------------------------------- +-- Spell: Gain-INT +-- Boosts targets INT stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill <309)then + power = 5 + elseif(enchanceSkill >=309 and enchanceSkill <=319)then + power = 6 + elseif(enchanceSkill >=320 and enchanceSkill <=329)then + power = 7 + elseif(enchanceSkill >=330 and enchanceSkill <=339)then + power = 8 + elseif(enchanceSkill >=340 and enchanceSkill <=349)then + power = 9 + elseif(enchanceSkill >=350 and enchanceSkill <=359)then + power = 10 + elseif(enchanceSkill >=360 and enchanceSkill <=369)then + power = 11 + elseif(enchanceSkill >=370 and enchanceSkill <=379)then + power = 12 + elseif(enchanceSkill >=380 and enchanceSkill <=389)then + power = 13 + elseif(enchanceSkill >=390 and enchanceSkill <=399)then + power = 14 + elseif(enchanceSkill >=400 and enchanceSkill <=409)then + power = 15 + elseif(enchanceSkill >=410 and enchanceSkill <=419)then + power = 16 + elseif(enchanceSkill >=420 and enchanceSkill <=429)then + power = 17 + elseif(enchanceSkill >=430 and enchanceSkill <=439)then + power = 18 + elseif(enchanceSkill >=440 and enchanceSkill <=449)then + power = 19 + elseif(enchanceSkill >=450 and enchanceSkill <=459)then + power = 20 + elseif(enchanceSkill >=460 and enchanceSkill <=469)then + power = 21 + elseif(enchanceSkill >=470 and enchanceSkill <=479)then + power = 22 + elseif(enchanceSkill >=480 and enchanceSkill <=489)then + power = 23 + elseif(enchanceSkill >=480 and enchanceSkill <=499)then + power = 24 + else + power = 25 + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_INT_DOWN) == true) then + target:delStatusEffect(EFFECT_INT_DOWN); + else + target:addStatusEffect(EFFECT_INT_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/gain-mnd.lua =================================================================== --- scripts/globals/spells/gain-mnd.lua (revision 0) +++ scripts/globals/spells/gain-mnd.lua (working copy) @@ -0,0 +1,72 @@ +-------------------------------------- +-- Spell: Gain-MND +-- Boosts targets MND stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill <309)then + power = 5 + elseif(enchanceSkill >=309 and enchanceSkill <=319)then + power = 6 + elseif(enchanceSkill >=320 and enchanceSkill <=329)then + power = 7 + elseif(enchanceSkill >=330 and enchanceSkill <=339)then + power = 8 + elseif(enchanceSkill >=340 and enchanceSkill <=349)then + power = 9 + elseif(enchanceSkill >=350 and enchanceSkill <=359)then + power = 10 + elseif(enchanceSkill >=360 and enchanceSkill <=369)then + power = 11 + elseif(enchanceSkill >=370 and enchanceSkill <=379)then + power = 12 + elseif(enchanceSkill >=380 and enchanceSkill <=389)then + power = 13 + elseif(enchanceSkill >=390 and enchanceSkill <=399)then + power = 14 + elseif(enchanceSkill >=400 and enchanceSkill <=409)then + power = 15 + elseif(enchanceSkill >=410 and enchanceSkill <=419)then + power = 16 + elseif(enchanceSkill >=420 and enchanceSkill <=429)then + power = 17 + elseif(enchanceSkill >=430 and enchanceSkill <=439)then + power = 18 + elseif(enchanceSkill >=440 and enchanceSkill <=449)then + power = 19 + elseif(enchanceSkill >=450 and enchanceSkill <=459)then + power = 20 + elseif(enchanceSkill >=460 and enchanceSkill <=469)then + power = 21 + elseif(enchanceSkill >=470 and enchanceSkill <=479)then + power = 22 + elseif(enchanceSkill >=480 and enchanceSkill <=489)then + power = 23 + elseif(enchanceSkill >=480 and enchanceSkill <=499)then + power = 24 + else + power = 25 + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_MND_DOWN) == true) then + target:delStatusEffect(EFFECT_MND_DOWN); + else + target:addStatusEffect(EFFECT_MND_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/gain-str.lua =================================================================== --- scripts/globals/spells/gain-str.lua (revision 0) +++ scripts/globals/spells/gain-str.lua (working copy) @@ -0,0 +1,72 @@ +-------------------------------------- +-- Spell: Gain-STR +-- Boosts targets STR stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill <309)then + power = 5 + elseif(enchanceSkill >=309 and enchanceSkill <=319)then + power = 6 + elseif(enchanceSkill >=320 and enchanceSkill <=329)then + power = 7 + elseif(enchanceSkill >=330 and enchanceSkill <=339)then + power = 8 + elseif(enchanceSkill >=340 and enchanceSkill <=349)then + power = 9 + elseif(enchanceSkill >=350 and enchanceSkill <=359)then + power = 10 + elseif(enchanceSkill >=360 and enchanceSkill <=369)then + power = 11 + elseif(enchanceSkill >=370 and enchanceSkill <=379)then + power = 12 + elseif(enchanceSkill >=380 and enchanceSkill <=389)then + power = 13 + elseif(enchanceSkill >=390 and enchanceSkill <=399)then + power = 14 + elseif(enchanceSkill >=400 and enchanceSkill <=409)then + power = 15 + elseif(enchanceSkill >=410 and enchanceSkill <=419)then + power = 16 + elseif(enchanceSkill >=420 and enchanceSkill <=429)then + power = 17 + elseif(enchanceSkill >=430 and enchanceSkill <=439)then + power = 18 + elseif(enchanceSkill >=440 and enchanceSkill <=449)then + power = 19 + elseif(enchanceSkill >=450 and enchanceSkill <=459)then + power = 20 + elseif(enchanceSkill >=460 and enchanceSkill <=469)then + power = 21 + elseif(enchanceSkill >=470 and enchanceSkill <=479)then + power = 22 + elseif(enchanceSkill >=480 and enchanceSkill <=489)then + power = 23 + elseif(enchanceSkill >=480 and enchanceSkill <=499)then + power = 24 + else + power = 25 + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_STR_DOWN) == true) then + target:delStatusEffect(EFFECT_STR_DOWN); + else + target:addStatusEffect(EFFECT_STR_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/gain-vit.lua =================================================================== --- scripts/globals/spells/gain-vit.lua (revision 0) +++ scripts/globals/spells/gain-vit.lua (working copy) @@ -0,0 +1,72 @@ +-------------------------------------- +-- Spell: Gain-VIT +-- Boosts targets VIT stat +-------------------------------------- + +require("scripts/globals/settings"); +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + enchanceSkill = caster:getSkillLevel(34); + + duration = 300; + + if(enchanceSkill <309)then + power = 5 + elseif(enchanceSkill >=309 and enchanceSkill <=319)then + power = 6 + elseif(enchanceSkill >=320 and enchanceSkill <=329)then + power = 7 + elseif(enchanceSkill >=330 and enchanceSkill <=339)then + power = 8 + elseif(enchanceSkill >=340 and enchanceSkill <=349)then + power = 9 + elseif(enchanceSkill >=350 and enchanceSkill <=359)then + power = 10 + elseif(enchanceSkill >=360 and enchanceSkill <=369)then + power = 11 + elseif(enchanceSkill >=370 and enchanceSkill <=379)then + power = 12 + elseif(enchanceSkill >=380 and enchanceSkill <=389)then + power = 13 + elseif(enchanceSkill >=390 and enchanceSkill <=399)then + power = 14 + elseif(enchanceSkill >=400 and enchanceSkill <=409)then + power = 15 + elseif(enchanceSkill >=410 and enchanceSkill <=419)then + power = 16 + elseif(enchanceSkill >=420 and enchanceSkill <=429)then + power = 17 + elseif(enchanceSkill >=430 and enchanceSkill <=439)then + power = 18 + elseif(enchanceSkill >=440 and enchanceSkill <=449)then + power = 19 + elseif(enchanceSkill >=450 and enchanceSkill <=459)then + power = 20 + elseif(enchanceSkill >=460 and enchanceSkill <=469)then + power = 21 + elseif(enchanceSkill >=470 and enchanceSkill <=479)then + power = 22 + elseif(enchanceSkill >=480 and enchanceSkill <=489)then + power = 23 + elseif(enchanceSkill >=480 and enchanceSkill <=499)then + power = 24 + else + power = 25 + end + + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(target:hasStatusEffect(EFFECT_VIT_DOWN) == true) then + target:delStatusEffect(EFFECT_VIT_DOWN); + else + target:addStatusEffect(EFFECT_VIT_BOOST,power,0,duration); + end +end; Index: scripts/globals/spells/kakka_ichi.lua =================================================================== --- scripts/globals/spells/kakka_ichi.lua (revision 0) +++ scripts/globals/spells/kakka_ichi.lua (working copy) @@ -0,0 +1,19 @@ +----------------------------------------- +-- Spell: Kakka: Ichi +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + target:delStatusEffect(EFFECT_STORE_TP); + effect = target:getStatusEffect(EFFECT_STORE_TP); + + target:addStatusEffect(EFFECT_STORE_TP,EFFECT_STORE_TP,10,0,180); + spell:setMsg(230); + + return EFFECT_STORE_TP; +end; \ No newline at end of file Index: scripts/globals/spells/migawari_ichi.lua =================================================================== --- scripts/globals/spells/migawari_ichi.lua (revision 0) +++ scripts/globals/spells/migawari_ichi.lua (working copy) @@ -0,0 +1,19 @@ +----------------------------------------- +-- Spell: Migawari: Ichi +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + target:delStatusEffect(EFFECT_MIGAWARI); + effect = target:getStatusEffect(EFFECT_MIGAWARI); + + target:addStatusEffect(EFFECT_MIGAWARI,EFFECT_MIGAWARI,0,0,60); + spell:setMsg(230); + + return EFFECT_MIGAWARI; +end; \ No newline at end of file Index: scripts/globals/spells/myoshui_ichi.lua =================================================================== --- scripts/globals/spells/myoshui_ichi.lua (revision 0) +++ scripts/globals/spells/myoshui_ichi.lua (working copy) @@ -0,0 +1,20 @@ +----------------------------------------- +-- Spell: Myoshui: Ichi +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + target:delStatusEffect(EFFECT_SUBTLE_BLOW_PLUS); + effect = target:getStatusEffect(EFFECT_SUBTLE_BLOW_PLUS); + + -- The power is unknown. + target:addStatusEffect(EFFECT_SUBTLE_BLOW_PLUS,EFFECT_SUBTLE_BLOW_PLUS,10,0,180); + spell:setMsg(230); + + return EFFECT_SUBTLE_BLOW_PLUS; +end; \ No newline at end of file Index: scripts/globals/spells/phalanx_ii.lua =================================================================== --- scripts/globals/spells/phalanx_ii.lua (revision 0) +++ scripts/globals/spells/phalanx_ii.lua (working copy) @@ -0,0 +1,59 @@ +----------------------------------------- +-- Spell: PHALANX II +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + enhskill = caster:getSkillLevel(ENHANCING_MAGIC_SKILL); + final = 0; + duration = 120; + if(caster:getObjType() == TYPE_PC) then + p2merit = target:getMerit(MERIT_PHALANX_II); + if(p2merit == 1) then + duration = 120; + elseif(p2merit == 2) then + duration = 150; + elseif(p2merit == 3) then + duration = 180; + elseif(p2merit == 4) then + duration = 210; + elseif(p2merit == 5) then + duration = 240; + end + end + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + final = (enhskill/25) + (3 * p2merit) + 1; + if(final < 0) then + final = 0; + print("Warning: Unknown enhancing magic skill for phalanx."); + end + + if(final > 35) then + final = 35; + end + + if(target:hasStatusEffect(EFFECT_PHALANX)) then + oldeffect = target:getStatusEffect(EFFECT_PHALANX); + if(oldeffect:getPower()<=final) then --overwrite + target:delStatusEffect(EFFECT_PHALANX); + target:addStatusEffect(EFFECT_PHALANX,final,0,duration); + spell:setMsg(0); + else --no effect + spell:setMsg(75); + end + else + target:addStatusEffect(EFFECT_PHALANX,final,0,duration); + spell:setMsg(0); + end + + return EFFECT_PHALANX; +end; \ No newline at end of file Index: scripts/globals/spells/refresh_ii.lua =================================================================== --- scripts/globals/spells/refresh_ii.lua (revision 0) +++ scripts/globals/spells/refresh_ii.lua (working copy) @@ -0,0 +1,27 @@ +----------------------------------------- +-- Spell: Refresh II +-- Gradually restores target party member's MP +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + + + mp = 6; + duration = 180; + + + if (target:getMainLvl() < 41) then + duration = duration * target:getMainLvl() / 41; + end + + target:delStatusEffect(EFFECT_REFRESH); + target:addStatusEffect(EFFECT_REFRESH,mp,3,duration); + return 0; + +end; \ No newline at end of file Index: scripts/globals/spells/slow_ii.lua =================================================================== --- scripts/globals/spells/slow_ii.lua (revision 0) +++ scripts/globals/spells/slow_ii.lua (working copy) @@ -0,0 +1,94 @@ +----------------------------------------- +-- Spell: Slow II +-- Spell accuracy is most highly affected by Enfeebling Magic Skill, Magic Accuracy, and MND. +-- Slow II's potency is calculated with the formula (230 + dMND*2)/1024, and caps at 350/1024 (~34.2%). +-- And MND of 75 is neccessary to reach the hardcap of Slow. +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + dMND = (caster:getStat(MOD_MND) - target:getStat(MOD_MND)); + bonus = AffinityBonus(caster,spell); + power = 230 + ((dMND * 1.6)/1024); + + if(caster:getObjType() == TYPE_PC) then + local merit; + merit = caster:getMerit(MERIT_SLOW_II) - 1; + if (caster:getMerit(MERIT_SLOW_II) > 1) then + caster:addMod(MOD_MACC, merit); + power = 230 + (caster:getMerit(MERIT_SLOW_II) * 10) + ((dMND * 1.6)/1024); + end + + --Power. + + if(power > 350) then + power = 350; + end + --Duration, including resistance. + duration = 120 * applyResistance(caster,spell,target,dMND,35,bonus); + if(100 * math.random() >= target:getMod(MOD_SLOWRES)) then + if(duration >= 60) then --Do it! + --Try to erase a weaker slow or haste. + slow = target:getStatusEffect(EFFECT_SLOW); + haste = target:getStatusEffect(EFFECT_HASTE); + if(slow ~= nil) then + if(slow:getPower() > power) then + target:delStatusEffect(EFFECT_SLOW); + target:addStatusEffect(EFFECT_SLOW,power,0,duration); +-- if(spell:isAOE() == false) then + spell:setMsg(237); +-- else +-- spell:setMsg(267); +-- end + else + spell:setMsg(75); + end + elseif(haste ~= nil) then + if(haste:getPower() < (-1 * power)) then + target:delStatusEffect(EFFECT_HASTE); + target:addStatusEffect(EFFECT_SLOW,power,0,duration); +-- if(spell:isAOE() == false) then + spell:setMsg(237); +-- else +-- spell:setMsg(267); +-- end + else + spell:setMsg(75); + end + else + target:addStatusEffect(EFFECT_SLOW,power,0,duration); +-- if(spell:isAOE() == false) then + spell:setMsg(237); +-- else +-- spell:setMsg(267); +-- end + end + --print(power); + --print(target:getMod(MOD_HASTE_MAGIC)); + else +-- if(spell:isAOE() == false) then + spell:setMsg(85); +-- else +-- spell:setMsg(284); +-- end + end + else +-- if(spell:isAOE() == false) then + spell:setMsg(85); +-- else +-- spell:setMsg(284); +-- end + end + if (merit > 1) then + caster:delMod(MOD_MACC, merit); + end + + + return EFFECT_SLOW; +end; \ No newline at end of file Index: scripts/globals/spells/temper.lua =================================================================== --- scripts/globals/spells/temper.lua (revision 0) +++ scripts/globals/spells/temper.lua (working copy) @@ -0,0 +1,47 @@ +----------------------------------------- +-- Spell: TEMPER +----------------------------------------- + +require("scripts/globals/status"); +require("scripts/globals/magic"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + enhskill = caster:getSkillLevel(ENHANCING_MAGIC_SKILL); + final = 0; + duration = 180; + if (caster:hasStatusEffect(EFFECT_COMPOSURE) == true and caster:getID() == target:getID()) then + duration = duration * 3; + end + + if(enhskill<=360) then + final = 5; + elseif(enhskill>360) then + final = math.floor((enhskill - 360)/10) + 5; + else + print("Warning: Unknown enhancing magic skill for Temper."); + end + + if(final>20) then + final = 20; + end + + if(target:hasStatusEffect(EFFECT_IFRIT_S_FAVOR)) then + oldeffect = target:getStatusEffect(EFFECT_IFRIT_S_FAVOR); + if(oldeffect:getPower()<=final) then --overwrite + target:delStatusEffect(EFFECT_IFIRIT_S_FAVOR); + target:addStatusEffect(EFFECT_IFRIT_S_FAVOR,final,0,duration); + spell:setMsg(0); + else --no effect + spell:setMsg(75); + end + else + target:addStatusEffect(EFFECT_IFRIT_S_FAVOR,final,0,duration); + spell:setMsg(0); + end + + return EFFECT_IFRIT_S_FAVOR; +end; \ No newline at end of file Index: scripts/globals/spells/yurin_ichi.lua =================================================================== --- scripts/globals/spells/yurin_ichi.lua (revision 0) +++ scripts/globals/spells/yurin_ichi.lua (working copy) @@ -0,0 +1,20 @@ +----------------------------------------- +-- Spell: Yurin: Ichi +----------------------------------------- + +require("scripts/globals/status"); + +----------------------------------------- +-- OnSpellCast +----------------------------------------- + +function onSpellCast(caster,target,spell) + target:delStatusEffect(EFFECT_INHIBIT_TP); + effect = target:getStatusEffect(EFFECT_INHIBIT_TP); + + -- The power is unknown. + target:addStatusEffect(EFFECT_INHIBIT_TP,EFFECT_INHIBIT_TP,10,0,180); + spell:setMsg(230); + + return EFFECT_INHIBIT_TP; +end; \ No newline at end of file