ATENÇãO: O SCRIPT NãO É SÓ CTRL+C E CTRL+V, VEJA A PARTE DA CONFIGURAÇãO!
data/actions/scripts/laba_ps.lua
--[[
CRIADO POR EITOR LABA
XTIBIA: http://www.xtibia.com/forum/user/335037-20cm/
DÊ CRÉDITOS AO POSTAR EM OUTROS LUGARES
]]
-- PARTE DA CONFIGURAÇãO
local pos = {{x=136,y=66,z=11},{x=137,y=66,z=11}}
local posx = {{x=pos[1].x-1,y=pos[1].y,z=pos[1].z},{x=pos[2].x+1,y=pos[2].y,z=pos[2].z}}
local a = {{{x=pos[1].x,y=pos[1].y-1,z=pos[1].z},ROSA},{{x=pos[2].x,y=pos[2].y-1,z=pos[2].z},AZUL-CLARO}}
local b = {{{x=pos[1].x,y=pos[1].y-1,z=pos[1].z},AMARELO},{{x=pos[2].x,y=pos[2].y-1,z=pos[2].z},AZUL}}
local time = VERDE-BOSTA
local id = 1718
for x = 1,#pos do
pos[x].stackpos = 1
posx[x].stackpos = 1
a[x][1].stackpos = 1
b[x][1].stackpos = 1
end
function createCases()
if getThingFromPos(pos[1]).itemid == id and getThingFromPos(pos[2]).itemid == id+1 then
for i = 1,2 do
doRemoveItem(getThingFromPos(pos[i]).uid)
doSendMagicEffect(pos[i],2)
doCreateItem(id,1,posx[i])
doTransformItem(getThingFromPos(a[i][1]).uid,a[i][2])
end
return true
else
return false
end
end
function removeCases()
if getThingFromPos(posx[1]).itemid == id and getThingFromPos(posx[2]).itemid == id then
local t = 0
for i = 1,2 do
doSendMagicEffect(posx[i],2)
doRemoveItem(getThingFromPos(posx[i]).uid)
doCreateItem(id+t,1,pos[i])
t = 1
doCleanTile(b[i][1])
doCreateItem(b[i][2],1,b[i][1])
end
return true
else
return false
end
end
function doCreatureSayWithDistance(cid, position, text, type)
oldPosX = setPlayerStorageValue(cid, 10000, getCreaturePosition(cid).x)
oldPosY = setPlayerStorageValue(cid, 10001, getCreaturePosition(cid).y)
oldPosZ = setPlayerStorageValue(cid, 10002, getCreaturePosition(cid).z)
oldPos = { x = getPlayerStorageValue(cid, 10000), y = getPlayerStorageValue(cid, 10001), z = getPlayerStorageValue(cid, 10002) }
doTeleportThing(cid, position, 0)
doCreatureSay(cid, text, type)
return doTeleportThing(cid, oldPos, 0)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local global = 29467
if getGlobalStorageValue(global) < 1 then
if createCases() == false then
return false
end
doCreatureSayWithDistance(cid,toPosition, "YOU HAVE "..time.." SECONDS...",TALKTYPE_ORANGE_1)
setGlobalStorageValue(global,1)
addEvent(setGlobalStorageValue,time*1000,global,0)
addEvent(removeCases,time*1000)
else
doPlayerSendCancel(cid,"Já está aberto...")
end
return true
end
info
Grupo: Barão
Registrado: 19/11/11
Posts: 221
Reputação: +70
Versão testada: 8.60
TFS testado: 0.4
Vídeo Demonstrativo
Script
ATENÇãO: O SCRIPT NãO É SÓ CTRL+C E CTRL+V, VEJA A PARTE DA CONFIGURAÇãO!
data/actions/scripts/laba_ps.lua
--[[ CRIADO POR EITOR LABA XTIBIA: http://www.xtibia.com/forum/user/335037-20cm/ DÊ CRÉDITOS AO POSTAR EM OUTROS LUGARES ]] -- PARTE DA CONFIGURAÇãO local pos = {{x=136,y=66,z=11},{x=137,y=66,z=11}} local posx = {{x=pos[1].x-1,y=pos[1].y,z=pos[1].z},{x=pos[2].x+1,y=pos[2].y,z=pos[2].z}} local a = {{{x=pos[1].x,y=pos[1].y-1,z=pos[1].z},ROSA},{{x=pos[2].x,y=pos[2].y-1,z=pos[2].z},AZUL-CLARO}} local b = {{{x=pos[1].x,y=pos[1].y-1,z=pos[1].z},AMARELO},{{x=pos[2].x,y=pos[2].y-1,z=pos[2].z},AZUL}} local time = VERDE-BOSTA local id = 1718 for x = 1,#pos do pos[x].stackpos = 1 posx[x].stackpos = 1 a[x][1].stackpos = 1 b[x][1].stackpos = 1 end function createCases() if getThingFromPos(pos[1]).itemid == id and getThingFromPos(pos[2]).itemid == id+1 then for i = 1,2 do doRemoveItem(getThingFromPos(pos[i]).uid) doSendMagicEffect(pos[i],2) doCreateItem(id,1,posx[i]) doTransformItem(getThingFromPos(a[i][1]).uid,a[i][2]) end return true else return false end end function removeCases() if getThingFromPos(posx[1]).itemid == id and getThingFromPos(posx[2]).itemid == id then local t = 0 for i = 1,2 do doSendMagicEffect(posx[i],2) doRemoveItem(getThingFromPos(posx[i]).uid) doCreateItem(id+t,1,pos[i]) t = 1 doCleanTile(b[i][1]) doCreateItem(b[i][2],1,b[i][1]) end return true else return false end end function doCreatureSayWithDistance(cid, position, text, type) oldPosX = setPlayerStorageValue(cid, 10000, getCreaturePosition(cid).x) oldPosY = setPlayerStorageValue(cid, 10001, getCreaturePosition(cid).y) oldPosZ = setPlayerStorageValue(cid, 10002, getCreaturePosition(cid).z) oldPos = { x = getPlayerStorageValue(cid, 10000), y = getPlayerStorageValue(cid, 10001), z = getPlayerStorageValue(cid, 10002) } doTeleportThing(cid, position, 0) doCreatureSay(cid, text, type) return doTeleportThing(cid, oldPos, 0) end function onUse(cid, item, fromPosition, itemEx, toPosition) local global = 29467 if getGlobalStorageValue(global) < 1 then if createCases() == false then return false end doCreatureSayWithDistance(cid,toPosition, "YOU HAVE "..time.." SECONDS...",TALKTYPE_ORANGE_1) setGlobalStorageValue(global,1) addEvent(setGlobalStorageValue,time*1000,global,0) addEvent(removeCases,time*1000) else doPlayerSendCancel(cid,"Já está aberto...") end return true enddata/actions/actions.xml
Configurando
Localize a linha 7 (-- PARTE DA CONFIGURAÇãO)
local pos = {{x=136,y=66,z=11},{x=137,y=66,z=11}}
local posx = {{x=pos[1].x-1,y=pos[1].y,z=pos[1].z},{x=pos[2].x+1,y=pos[2].y,z=pos[2].z}}
local a = {{{x=pos[1].x,y=pos[1].y-1,z=pos[1].z},ROSA},{{x=pos[2].x,y=pos[2].y-1,z=pos[2].z},AZUL-CLARO}}
local b = {{{x=pos[1].x,y=pos[1].y-1,z=pos[1].z},AMARELO},{{x=pos[2].x,y=pos[2].y-1,z=pos[2].z},AZUL}}
time = VERDE-BOSTA
Vermelho: PosiÇão da estante esquerda
Verde: PosiÇão da estante direita
Rosa: ID do item que a parede esquerda vai se transformar (na foto: 1207)
Azul-claro: ID do item que a parede direita vai se transformar (na foto: 1208)
Amarelo: ID da parede da foto (parede amarela - na foto 1026)
Azul: ID da parede da foto (parade azul - na foto 1026)
Verde-bosta: Tempo em segundos que a passagem fica aberta.
LEMBRANDO QUE O ID NãO É EDITáVEL, É A BOOKCASE E PRONTO!
PS²: LEMBRE-SE DE QUE A BOOKCASE NãO É UM ID, ELA É 1718 NA ESQUERDA E 1719 NA DIREITA
nossa velho, essa criaÇão de posts do xtibia tá muito ruim -.-
Lembrando que caso vocÊ não tenha gostado ou caso vocÊ queira alguma mudanÇa, reclame com Deus.
Gostou? REP+
comedinhas daora
Editado Janeiro 5 por 20cm