1º pedido:
local function getRecorderPlayer(pos, cid)
local ret = 0
if cid and isPosEqual(getThingPos(cid), pos) then
return cid
end
local s = {}
s.x = pos.x
s.y = pos.y
s.z = pos.z
for a = 0, 255 do
s.stackpos = a
local b = getTileThingByPos(s).uid
if b > 1 and isPlayer(b) and getCreatureOutfit(b).lookType ~= 814 then
ret = b
end
end
return ret
end
------------[[ Configurações. ]]------------
local cfg = {
{1, {x = 1056, y = 1056, z = 7}, {x = 1056, y = 1057, z = 7}}, --{valor da storage do clan, posição que o jogador deve ficar, posição para qual o mesmo será teleportado},
{2, {x = 1057, y = 1056, z = 7}, {x = 1056, y = 1058, z = 7}},
{3, {x = 1058, y = 1056, z = 7}, {x = 1056, y = 1059, z = 7}},
{4, {x = 1059, y = 1056, z = 7}, {x = 1056, y = 1060, z = 7}},
{5, {x = 1060, y = 1056, z = 7}, {x = 1056, y = 1061, z = 7}},
{6, {x = 1061, y = 1056, z = 7}, {x = 1056, y = 1062, z = 7}},
{7, {x = 1062, y = 1056, z = 7}, {x = 1056, y = 1063, z = 7}},
{8, {x = 1063, y = 1056, z = 7}, {x = 1056, y = 1064, z = 7}},
{9, {x = 1064, y = 1056, z = 7}, {x = 1056, y = 1065, z = 7}},
}
local rank = {
need = true, --Precisará estar em x rank? [true/sim] [false/não]
what_rank = 5, --Se colocar true acima, configure aqui o rank necessário.
}
-----------[[ Fim das configurações. ]]---------
function onUse(cid, item, frompos, item2, topos)
for a, b in pairs(cfg) do
local pos = getRecorderPlayer(b[2])
if not isPlayer(pos) then
return doPlayerSendCancel(cid, "One or more players aren't in the correct clan's place.")
elseif rank.need == true then
if getPlayerStorageValue(pos, 862281) <= (rank.what_rank - 1) then
return doPlayerSendCancel(cid, "One or more players aren't at rank "..rank.what_rank..".")
end
end
end
for c, d in pairs(cfg) do
local pos = getRecorderPlayer(d[2])
doTeleportThing(pos, d[3])
doPlayerSendTextMessage(pos, 27, "Good luck!")
doSendMagicEffect(getThingPos(pos), 14)
end
return true
end
Tabela com valor das storages, e seus respectivos clans:
[1] = Volcanic
[2] = Seavell
[3] = Orebound
[4] = Wingeon
[5] = Malefic
[6] = Gardestrike
[7] = Psycraft
[8] = Naturia
[9] = Raibolt
2º pedido:
Em exp2.0.lua, abaixo de:
if valor >= getCreatureHealth(cid) then
if isInArray(cannotKill, combat) and isPlayer(cid) then
valor = getCreatureHealth(cid) - 1
else
valor = getCreatureHealth(cid)
Adicione:
local nome = "rattata" --Nome do pokémon (tanto faz colocar em letra minúscula ou maiúscula).
if getCreatureName(cid):lower() == nome:lower() then
local cfg = {
id = 2708, --ID da parede.
pos = {x = 1056, y = 1058, z = 7}, --Posição da parede.
recreate = true, --A parede será recriada? [true/sim] [false/não]
tempo = 5, --Se colocar true acima, configure aqui o tempo (em segundos).
}
local wall = getTileItemById(cfg.pos, cfg.id).uid
if wall > 0 then
doRemoveItem(wall, 1)
doSendMagicEffect(cfg.pos, 15)
if cfg.recreate == true then
addEvent(function()
doCreateItem(cfg.id, 1, cfg.pos)
doSendMagicEffect(cfg.pos, 14)
end, cfg.tempo * 1000)
end
end
end
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.