Added precast function that spells will try to call before actually being cast it will only take the caster and target and it must return true or falseWe should probably also look at adding a function that gets called after the normal error checks, but before a player starts casting a spell as well. Some spells have specific reqs before a spell can be used (they aren't this way anymore, but off the top of my head the shield attacks used to require you have a shield equipped).
Code: Select all
function precast(Caster, Target)
if IsAlive(Target) == true then
return true
end
return false
end
While I agree with scatman that spells need a flag to handle most of these checks in the server core this can be used for stuff not handled by flags like quest steps or spawn id's or to implement stuff before the flags for it are implemented.