Hello guys, I'm trying to make summons more interesting trying to make their damage vary according to player level and skill. So I've tried this out:
spells/scripts/monster/summon_damage
No erros appear on TFS, I can still summon the creature and everything, but he jusn't doesn't hit. Can somebody help me out?
spells/scripts/monster/summon_damage
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, 7)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 4)
function onCastSpell(creature, variant)
if summon then
summon:setMaster(creature)
local maxHealth = creature:getMaxHealth()
local maxMana = creature:getMaxMana()
local playlvl = creature:getLevel()
local shield = creature:getSkillLevel(SKILL_SHIELD)
local min = ((playlvl < 300 and playlvl or 300) + ((maxHealth + maxMana) / 2) + (attack * 2) + (skill * 4)) * 0,5
local max = ((playlvl < 300 and playlvl or 300) + ((maxHealth + maxMana) / 2) + (attack * 2) + (skill * 4)) * 1,0
local damage = math.random(math.floor(min), math.floor(max))
for _, target in ipairs(combat:getTargets(creature, variant)) do
creature:addDamageCondition(target, CONDITION_FIRE, DAMAGELIST_EXPONENTIAL_DAMAGE, damage)
end
end
return true
end
No erros appear on TFS, I can still summon the creature and everything, but he jusn't doesn't hit. Can somebody help me out?