Guitar Freak
_LüA_n☺b_
Hello, Ive been inactive these past months due to lack of time but when I get the chance I try not to lose practice on this and now I have a problem that I just cant seem to be able to solve.
This is the spell script for a normal spell:
Now, in constant.lua we got this:
In my case, none of these work.
Lets say I have an extra stat on all my players lets call it "whatever stat" and it is defined by a Storage Value.
So I want to know how can I make it so the spell hits based on THAT stat and not the common level/maglvl/skill/etc.
If you still dont understand, this is pretty much it ideally:
(this is ofc an example and it doesnt work this way)
So thats pretty much it, I have tried many things and I just cant understand how to do that TARGET part on a spell..
(It doesnt even have to be a spell if you know how to do it somehow else simulating it)
Ill be +repping helpful answers.
Thanks in advance.
This is the spell script for a normal spell:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, x, x, x, x)
local area = createCombatArea(AREA_CIRCLE3X3)
setCombatArea(combat, area)
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
Now, in constant.lua we got this:
Lua:
COMBAT_FORMULA_UNDEFINED = 0
COMBAT_FORMULA_LEVELMAGIC = 1
COMBAT_FORMULA_SKILL = 2
COMBAT_FORMULA_DAMAGE = 3
In my case, none of these work.
Lets say I have an extra stat on all my players lets call it "whatever stat" and it is defined by a Storage Value.
So I want to know how can I make it so the spell hits based on THAT stat and not the common level/maglvl/skill/etc.
If you still dont understand, this is pretty much it ideally:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
local area = createCombatArea(AREA_CIRCLE3X3)
setCombatArea(combat, area)
function onCastSpell(cid, var)
doCreatureAddHealth(TARGET, -(getPlayerStorageValue(cid, whatever_stat_storage) * whatever_formula))
return doCombat(cid, combat, var)
end
(this is ofc an example and it doesnt work this way)
So thats pretty much it, I have tried many things and I just cant understand how to do that TARGET part on a spell..
(It doesnt even have to be a spell if you know how to do it somehow else simulating it)
Ill be +repping helpful answers.
Thanks in advance.