EduardoQuintela
New Member
- Joined
- Mar 10, 2014
- Messages
- 27
- Reaction score
- 1
Hello community, I'm having trouble adding a code to return to the previous outifit. because when cast this spell the player changes the outfit and need to go back to the outfit he was using previously.
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_WATER)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 61)
function onGetFormulaValues(player, level, magicLevel)
local min = (level / 5) + (magicLevel * 1.4) + 8
local max = (level / 5) + (magicLevel * 2.2) + 14
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local outfitConfig = { newOutfit = 65 }
function onCastSpell(creature, variant)
creature:getPosition(cid):sendMagicEffect(180)
creature:setOutfit({lookType = outfitConfig.newOutfit})
return combat:execute(creature, variant)
end
Last edited: