Awesomedudei
Revolutionot.com
So i have a few spells which are adding a damaging condition
But they're not working as i thought it would?
Like the initial Damage works but there's no condition being set.
Something i noticed is. If i for example use utori pox after casting some of the non working spells like above.
It adds those conditions? and kind of queue's them.
This is the utori pox spell
But they're not working as i thought it would?
Like the initial Damage works but there's no condition being set.
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ICEEAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLICE)
local condition = Condition(CONDITION_FREEZING)
condition:setTicks(4000)
condition:setParameter(CONDITION_PARAM_DELAYED, 1)
condition:setParameter(CONDITION_PARAM_SUBID, 1)
condition:setParameter(CONDITION_PARAM_TICKINTERVAL, 1000)
function onGetFormulaValues(player, level, magicLevel)
local min = (level / 5) + (magicLevel * 6.3) + 85
local max = (level / 5) + (magicLevel * 7.8) + 147
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local function CastSpell(cid, var)
local player = Player(cid)
local level = player:getLevel()
local maglevel = player:getMagicLevel()
min = -((level / 5) + (maglevel * 1.48) + 17)
max = -((level / 5) + (maglevel * 1.75) + 30)
condition:setParameter(CONDITION_PARAM_PERIODICDAMAGE, math.random(min,max))
combat:addCondition(condition)
return true
end
function onCastSpell(creature, variant)
return combat:execute(creature, variant)
end
Something i noticed is. If i for example use utori pox after casting some of the non working spells like above.
It adds those conditions? and kind of queue's them.
This is the utori pox spell
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_CARNIPHILA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH)
function onTargetCreature(creature, target)
local min = (creature:getLevel() / 30) + (creature:getMagicLevel() * 0.5) + 15
local max = (creature:getLevel() / 30) + (creature:getMagicLevel() * 0.7) + 25
local rounds = math.random(math.floor(min), math.floor(max))
creature:addDamageCondition(target, CONDITION_ENERGY, DAMAGELIST_VARYING_PERIOD, target:isPlayer() and 13 or 25, {10, 12}, rounds)
end
combat:setCallback(CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
function onCastSpell(creature, variant)
return combat:execute(creature, variant)
end