Nokturno
Not a human
- Joined
- Aug 7, 2009
- Messages
- 563
- Solutions
- 2
- Reaction score
- 401
hello ppl, can someone help me with this.
im stuck trying to figure out how to call master's level and magiclevel values within a monster spell (summon)
dont now if is possible or it is better to do this in a creaturescript event?
I did that formula specting to get the values from the player, but when the monster cast it, theres no dmg, no console errors tho
im stuck trying to figure out how to call master's level and magiclevel values within a monster spell (summon)
dont now if is possible or it is better to do this in a creaturescript event?
I did that formula specting to get the values from the player, but when the monster cast it, theres no dmg, no console errors tho
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
function onGetFormulaValues(cid)
local master = creature:getMaster()
local dmg1 = (master:getLevel() / 3) + (master:getMagicLevel() * 0.8)
local dmg2 = (master:getLevel() / 3) + (master:getMagicLevel() * 0.9)
-- local level = player:getLevel()
-- local maglevel = player:getMagicLevel()
min = dmg1
max = dmg2
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(creature, variant)
local target = creature:getTarget()
if(not target) then
return false
end
local endPos = target:getPosition()
combat:execute(creature, Variant(endPos))
return true
end