doExoriFrigo(player, player:getPosition() + Position(-2, 0, 0))
doExoriFrigo(player, Creature("Monk"):getId())
doExoriFrigo(player, player:getPosition() + Position(-2, 0, 0))
doExoriFrigo(player, Creature("Monk"):getId())
If you only need it for a minimum number of spells, you can embed a global function in the file of the spell you want to execute and then call this function
example
View attachment 60729
and then you call this function to execute the power, for example:
You can pass as a variant, a position or a creature ID
View attachment 60730Lua:doExoriFrigo(player, player:getPosition() + Position(-2, 0, 0)) doExoriFrigo(player, Creature("Monk"):getId())
But if you are looking to execute many spells this is not the most organized and perfect way to do it, you will have to modify the sources, but I give you this option to get out of a problem quickly
Lua:local wandOfDragonbreath = Action() local combat = {} arr = { { {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 2, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0} }, { {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0, 0}, {0, 1, 1, 2, 0, 0, 0}, {0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0} }, { {0, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 1, 1, 0, 0}, {0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 2, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0} }, { {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0}, {0, 0, 0, 2, 1, 1, 0}, {0, 0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0} }} for i = 1, #arr do combat[i] = Combat() combat[i]:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) combat[i]:setParameter(COMBAT_PARAM_EFFECT, 16) combat[i]:setFormula(COMBAT_FORMULA_SKILL, 1, 1, 1, 1) combat[i]:setArea(createCombatArea(arr[i])) end local config = { time = 4, storage = 2000001, } function wandOfDragonbreath.onUse(player, item, fromPosition, target, toPosition, isHotkey) local slot = 6 local getslot = Item(getPlayerSlotItem(player, slot).uid) if player:getStorageValue(config.storage) - os.time() > 0 then return player:sendCancelMessage("você só pode usar o item depois de "..(player:getStorageValue(config.storage) - os.time()).." segundos.") end if getslot ~= nil then if getslot:getId() == 2191 then for i = 1, 4 do if player:getDirection() == (i - 1) then combat[i]:execute(player, Variant(player:getPosition())) player:setStorageValue(config.storage, os.time() + config.time) end end end else player:sendCancelMessage("Item precisa está equipado para usar.") end return true end wandOfDragonbreath:id(2191) wandOfDragonbreath:register()
local wandOfDragonbreath = Action()
local combats = {}
local arr = {
{
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 2, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 0}
},
{
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 1, 0, 0, 0, 0, 0},
{0, 1, 1, 2, 0, 0, 0},
{0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0}
},
{
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 2, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0}
},
{
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0},
{0, 0, 0, 2, 1, 1, 0},
{0, 0, 0, 0, 0, 1, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0}
}}
for i = 1, #arr do
combats[i] = Combat()
combats[i]:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combats[i]:setParameter(COMBAT_PARAM_EFFECT, 16)
combats[i]:setFormula(COMBAT_FORMULA_SKILL, 1, 1, 1, 1)
combats[i]:setArea(createCombatArea(arr[i]))
end
local config = {
time = 4,
storage = 2000001,
}
function wandOfDragonbreath.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getStorageValue(config.storage) - os.time() > 0 then
return player:sendCancelMessage("você só pode usar o item depois de "..(player:getStorageValue(config.storage) - os.time()).." segundos.")
end
local slotItem = player:getSlotItem(CONST_SLOT_LEFT)
if slotItem and item == slotItem then
combats[player:getDirection() +1]:execute(player, Variant(player:getPosition()))
player:setStorageValue(config.storage, os.time() + config.time)
else
player:sendCancelMessage("Item precisa está equipado para usar.")
end
return true
end
wandOfDragonbreath:id(2191)
wandOfDragonbreath:register()