darkmu
Well-Known Member
I created several special runes on my server, but I would like to leave them not infinite, that is, using it will spend loads, however, using the creature: removeItem (X, 1) function it will only remove the runes if it has in the backpack and if he uses it on the floor it will remain infinite, what can I do?
Example my special rune.
remarks: I do not want to change the config in the config.lua, because the ancient runes remained infinite.
Example my special rune.
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_BIGCLOUDS)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYBALL)
combat:setArea(createCombatArea(AREA_CIRCLE3X3))
function onGetFormulaValues(player, level, maglevel)
local min = (level / 5) + maglevel + 6
local max = (level / 5) + (maglevel * 2.6) + 16
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(creature, variant, isHotkey)
creature:removeItem(2312, 1)
return combat:execute(creature, variant)
end
remarks: I do not want to change the config in the config.lua, because the ancient runes remained infinite.