• 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+ [TFS 1.3]Is possible added a own exhauste to a spell?

Eduardo170

Well-Known Member
Joined
Jan 7, 2014
Messages
422
Solutions
3
Reaction score
66
Location
Caracas, Venezuela
Is possible added a own exhauste to a spell?
Protocol: 8.6
Example I want to added a own exhauste to
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WEAPONTYPE)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_USECHARGES, true)

function onGetFormulaValues(player, skill, attack, factor)
    local min = (player:getLevel() / 5) + (skill * attack * 0.06) + 13
    local max = (player:getLevel() / 5) + (skill * attack * 0.14) + 34
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
    return combat:execute(creature, variant)
end
 
Yes, use a Player storage, and check against OS time doing some math?
if too soon, use magic effect poof, and send cancel and return false, and use an else clause where on success player storage value is updated with current OS time
 
Back
Top