Quick scripting question.
Posted: Thu Sep 17, 2015 3:25 am
EDIT: I just looked in my updated sourcecode and saw this isn't how spells are done anymore. I'm stuck a few revisions back (5kb/sec download with frequent interrupts from satelites hitting these damn redwoods that surround my house, so I'll be out of date for a bit) so ignore, unless someone cares.
Settings.lua contains a variable stat, SPELL_POWER (along with others, ITEM_POWER, etc.) I copied the style in which hi_potion+3 worked, and came out with this to have spells reflect the SPELL_POWER setting.
My question is this: will mobs that cast Banishga II now absolutely rape? I'm asking beforehand because I started doing every spell before I took that in mind. If the way I'm doing it will result in overpowered mob casters giving me a taste of my own medicine, then could anyone provide an example of how to add SPELL_POWER to a spell, so that I can fix the rest?
Settings.lua contains a variable stat, SPELL_POWER (along with others, ITEM_POWER, etc.) I copied the style in which hi_potion+3 worked, and came out with this to have spells reflect the SPELL_POWER setting.
Code: Select all
-----------------------------------------
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)
--doDivineBanishNuke(V,M,caster,spell,target,hasMultipleTargetReduction,resistBonus)
local dmg = doDivineBanishNuke(180*SPELL_POWER,1,caster,spell,target,false,1.0);
return dmg;
end;