local theDukeHealFireDamage = CreatureEvent("TheDukeHealFireDamage")
function theDukeHealFireDamage.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if not creature:isPlayer() and primaryType == COMBAT_DEATHDAMAGE then
creature:addHealth(primaryDamage)
primaryDamage = 0
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
theDukeHealFireDamage:register()
Show your scriptdata/spells/scripts/attack/sudden death.lua
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
function onGetFormulaValues(player, level, maglevel)
local min = (level / 5) + (maglevel * 4.605) + 28
local max = (level / 5) + (maglevel * 7.395) + 46
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(creature, var, isHotkey)
return combat:execute(creature, var)
end
In the monster it looks good but the players are hit like thisShow your scriptdata/spells/scripts/attack/sudden death.lua
what do you mean?hit like this
when hitting a character the effect of the SD when hitting him is not like that, but when hitting a monster it appears finewhat do you mean?
I realized that it was this scripts, it comes by default in ot, what's wrong? I had changed fire for deathwhat do you mean?
local theDukeHealFireDamage = CreatureEvent("TheDukeHealFireDamage")
function theDukeHealFireDamage.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if primaryType == COMBAT_DEATHDAMAGE then
creature:addHealth(primaryDamage)
primaryDamage = 0
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
theDukeHealFireDamage:register()
local theDukeHealFireDamage = CreatureEvent("TheDukeHealFireDamage")
function theDukeHealFireDamage.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if not creature:isPlayer() and primaryType == COMBAT_DEATHDAMAGE then
creature:addHealth(primaryDamage)
primaryDamage = 0
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
theDukeHealFireDamage:register()