• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua SD bug

adrenysny

Member
Joined
Feb 17, 2021
Messages
140
Reaction score
14
Does anyone know why the SD looks like this? I have not done anything wrong
Use OTbr tfs 1.3

Sin título.png

In the monster it looks good but the players are hit like this

CHECK.png
 
Last edited:
Solution
E
Lua:
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 script data/spells/scripts/attack/sudden death.lua
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
Post automatically merged:

Show your script data/spells/scripts/attack/sudden death.lua
In the monster it looks good but the players are hit like this
CHECK.png
 
what do you mean?
when hitting a character the effect of the SD when hitting him is not like that, but when hitting a monster it appears fine
Post automatically merged:

what do you mean?
I realized that it was this scripts, it comes by default in ot, what's wrong? I had changed fire for death


Lua:
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()
 
Last edited:
Lua:
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()
 
Solution
Back
Top