• 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!

TFS 1.X+ Effect spell type damage

Michcol94

Member
Joined
Sep 2, 2021
Messages
108
Reaction score
23
He wants to change the magic effect for the hit effect and that for each spell there was a different effect


sample spell:

LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONAREA)--Changing the effect doesn't work
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 90)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setArea(createCombatArea(AREA_CROSS1X1))

function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 1.6) + 9
    local max = (level / 5) + (magicLevel * 3.2) + 19
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant, isHotkey)
    return combat:execute(creature, variant)
end
 
You mean a random effect for each spell cast?
LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 90)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setArea(createCombatArea(AREA_CROSS1X1))

function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 1.6) + 9
    local max = (level / 5) + (magicLevel * 3.2) + 19
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant, isHotkey)
    combat:setParameter(COMBAT_PARAM_EFFECT, math.random(1, 10))
    return combat:execute(creature, variant)
end
 
Back
Top