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

burn spell

how i can make spell like exori flam
have chance to burn target for 5 sec

tfs 0.4
You can try this out, it's untested.
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREATTACK)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

local burn = createConditionObject(CONDITION_FIRE)
setConditionParam(burn, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(burn, 5, 1000, -10) -- condition, rounds, time, value

local percent_chance = 5

function onCastSpell(cid, var)
    if doCombat(cid, combat, var) then
        if math.random(100) <= percent_chance then
            local var_id = variantToNumber(var)
            doTargetCombatCondition(cid, var_id, burn, CONST_ME_NONE)
            doPlayerSendTextMessage(var_id, MESSAGE_INFO_DESCR, "You have been burned.")
        end
        return true
    end
    return false
end
 
Back
Top