.Smile
Member
- Joined
- Jan 27, 2019
- Messages
- 29
- Reaction score
- 11
I tried in several ways to make the area follow the player but it stays in the same place where the player used.
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, 5)
combat:setArea(createCombatArea(AREA_CIRCLE2X2))
function onGetFormulaValues(player, level, magicLevel)
local min = (level / 5) + (magicLevel * 0.8) + 5
local max = (level / 5) + (magicLevel * 2) + 12
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(creature, variant)
local position = creature:getPosition()
Position({x = position.x + 3, y = position.y + 3, z = position.z}):sendMagicEffect(110)
combat:execute(creature, variant)
addEvent(function()
Position({x = position.x + 3, y = position.y + 3, z = position.z}):sendMagicEffect(110)
combat:execute(creature, variant)
end, 500)
addEvent(function()
Position({x = position.x + 3, y = position.y + 3, z = position.z}):sendMagicEffect(110)
combat:execute(creature, variant)
end, 1000)
addEvent(function()
Position({x = position.x + 3, y = position.y + 3, z = position.z}):sendMagicEffect(110)
combat:execute(creature, variant)
end, 1500)
addEvent(function()
Position({x = position.x + 3, y = position.y + 3, z = position.z}):sendMagicEffect(110)
combat:execute(creature, variant)
end, 2000)
return true
end
Last edited: