• 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 how to? - Spell, effect only on hit

Szafi

www.rookwar.pl
Joined
Mar 2, 2009
Messages
165
Reaction score
10
Location
Poland
TFS 0.4

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 6)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

local area = createCombatArea{
{1, 1, 1},
{1, 2, 1},
{1, 1, 1}
}
setCombatArea(combat, area)

function onGetFormulaValues(cid, level, skill, attack, element, factor)
    local levelTotal, formula = level / 5, 0.0496
    local normal, elemental = -(skill * attack * formula + levelTotal), math.ceil((skill * element * formula + levelTotal))
    return normal/2, normal, -math.random(elemental/2, elemental)
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
 
Back
Top