Helliot1
Owner of Empire Online
- Joined
- Jul 26, 2017
- Messages
- 315
- Solutions
- 1
- Reaction score
- 58
Hello,
I'm trying to modify a script from a spell, which when it throws a spell, would take a while before executing the spell, like this:
"function onCastSpell(creature, variant)
WAIT 2 SECONDS
return combat:execute(creature, variant)
end"
and I'm using OTX Server, I found this formulas below on Lib, and would to put it inside the "WAIT 2 SECONDS", I think this is the most correct way or is there anything better?
Formulas on Lib
This is my Script
I'm trying to modify a script from a spell, which when it throws a spell, would take a while before executing the spell, like this:
"function onCastSpell(creature, variant)
WAIT 2 SECONDS
return combat:execute(creature, variant)
end"
and I'm using OTX Server, I found this formulas below on Lib, and would to put it inside the "WAIT 2 SECONDS", I think this is the most correct way or is there anything better?
Formulas on Lib
Lua:
function Player.setExhaustion(self, value, time)
return self:setStorageValue(value, time + os.time())
end
function Player.getExhaustion(self, value)
local storage = self:getStorageValue(value)
if storage <= 0 then
return 0
end
return storage - os.time()
end
This is my Script
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, 6)
combat:setArea(createCombatArea(AREA_SOULFIRE))
function onGetFormulaValues(player, skill, attack, factor)
local min = (player:getLevel() / 5) + (skill * attack * 0.03) + 7
local max = (player:getLevel() / 5) + (skill * attack * 0.05) + 11
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(creature, variant)
return combat:execute(creature, variant)
end