And one more scripting question (now that I've basically just decided to plow ahead), which one of these luas is better than the other in determining spell damage:
Code: Select all
-----------------------------------------
-- Spell: Quake
-- Deals earth damage to an enemy.
-----------------------------------------
require("scripts/globals/magic");
require("scripts/globals/status");
require("scripts/globals/settings");
-----------------------------------------
-- OnSpellCast
-----------------------------------------
function onMagicCastingCheck(caster,target,spell)
return 0;
end;
function onSpellCast(caster,target,spell)
--calculate raw damage
local dmg = calculateMagicDamage(577*SPELL_POWER,2,caster,spell,target,ELEMENTAL_MAGIC_SKILL,MOD_INT,false);
--get resist multiplier (1x if no resist)
local resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),ELEMENTAL_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,spell:getElement());
--add in final adjustments
dmg = finalMagicAdjustments(caster,target,spell,dmg);
--doElementalNuke(V,M,caster,spell,target,hasMultipleTargetReduction,resistBonus)
local dmg = doElementalNuke(577,2,caster,spell,target,false,1.0);
return dmg;
end;
or this:
Code: Select all
-----------------------------------------
-- Spell: Fire
-- Deals fire damage to an enemy.
-----------------------------------------
require("scripts/globals/magic");
require("scripts/globals/status");
require("scripts/globals/settings");
-----------------------------------------
-- OnSpellCast
-----------------------------------------
function onMagicCastingCheck(caster,target,spell)
return 0;
end;
function onSpellCast(caster,target,spell)
--doElementalNuke(V,M,caster,spell,target,hasMultipleTargetReduction,resistBonus)
local dmg = doElementalNuke(133*SPELL_POWER,1,caster,spell,target,false,1.0);
return dmg;
end;
Is one spell less up to date? I've only seen a few .luas that are in long form, and then the smaller, more compact ones seems to be missing out on stave calculations (unless that is done elsewhere). Anyway, thanks for your time, effort, and energy concerning these two posts.