-- ANIHI --
anihi_reformulada.lua
local t = { lvl = 100, entrada = { {x = 710, y = 1420, z = 5}, -- pos players {x = 709, y = 1420, z = 5}, {x = 708, y = 1420, z = 5}, {x = 707, y = 1420, z = 5} }, saida = { {x = 710, y = 1420, z = 6}, -- pos para onde eles irão {x = 709, y = 1420, z = 6}, {x = 708, y = 1420, z = 6}, {x = 707, y = 1420, z = 6} }, monstros = { {{x = 707, y = 1418, z = 6}, "Demon"}, -- defina pos dos montros e nomes {{x = 709, y = 1418, z = 6}, "Demon"}, {{x = 708, y = 1422, z = 6}, "Demon"}, {{x = 710, y = 1422, z = 6}, "Demon"}, {{x = 712, y = 1420, z = 6}, "Hellfire Fighter"}, {{x = 713, y = 1420, z = 6}, "Hellfire Fighter"}, {{x = 711, y = 1420, z = 6}, "Ghazbaran"} } } function onUse(cid, item, fromPosition, itemEx, toPosition) local check = {} for _, k in ipairs(t.entrada) do local x = getTopCreature(k).uid if(x == 0 or not isPlayer(x) or getPlayerLevel(x) < t.lvl) then doPlayerSendCancel(cid, 'Está faltando player ou alguém não possui level '..t.lvl..' ou mais.') return true end table.insert(check, x) end for _, summon in pairs(t.monstros) do local creature = getTopCreature(summon[1]).uid if(creature > 0 and not isPlayer(creature)) then doRemoveCreature(creature) end doCleanTile(summon[1]) doCreateMonster(summon[2], summon[1]) end for i, tid in ipairs(check) do doSendMagicEffect(t.entrada[i], CONST_ME_POFF) doTeleportThing(tid, t.saida[i], false) doSendMagicEffect(t.saida[i], CONST_ME_ENERGYAREA) end doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end
TAG
<action actionid="7778" script="anihi_reformulada.lua"/>
-- DESERT QUEST --
desert_reformulada.lua
local lvl = 20 local t = { {vocations = {1, 5},Pos = {{x=182, y=56, z=7},{x=187, y=55, z=7}},item= {2175,{x=183, y=56, z=7}}}, {vocations = {2, 6},Pos = {{x=188, y=59, z=7},{x=188, y=55, z=7}},item= {2674,{x=189, y=59, z=7}}}, {vocations = {3, 7},Pos = {{x=172, y=52, z=7},{x=189, y=54, z=7}},item= {2455,{x=183, y=52, z=7}}}, {vocations = {4, 8},Pos = {{x=190, y=48, z=7},{x=190, y=54, z=7}},item= {2376,{x=191, y=48, z=7}}} } function onUse(cid, item, fromPosition, itemEx, toPosition) local check = {} local items = {} for _, k in ipairs(t) do local x = getTopCreature(k.Pos[1]).uid local v = getTileItemById(k.item[2], k.item[1]) if(x == 0 or not isPlayer(x) or getPlayerLevel(x) < lvl or isInArray(k.vocations, getPlayerVocation(x)) == FALSE) then doPlayerSendCancel(cid, 'Está faltando player ou alguém não possui level '..lvl..' ou mais ou não tem a vocação.') return true elseif v.uid == 0 then doPlayerSendCancel(cid, "Todos os itens precisão estar na posição.") return true end table.insert(check, x) table.insert(items, v) end for k, tid in ipairs(check) do doSendMagicEffect(getCreaturePosition(tid), CONST_ME_POFF) doTeleportThing(tid, t[k].Pos[2]) doSendMagicEffect(getCreaturePosition(tid), CONST_ME_TELEPORT) end for _, remove in ipairs(items) do doRemoveItem(remove.uid) end doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end
Como configurar
vocations = {1, 5} -- id das vocations que precisam ser
Pos = {{x=182, y=56, z=7},{x=187, y=55, z=7}} -- tem 2 pos, primeira pos é onde o jogador tem que estar e a segunda para onde ele vai ser teleportado
item= {2175,{x=181, y=56, z=7}} -- id do item, e a pos onde o item precisa estar
TAG
<action actionid="7779" script="desert_reformulada.lua"/>
Por enquanto são essas
Qualquer sugestão de lever será bem vinda, só postar.