ZE

[Encerrado] (Poke)Piso transforme UniqueItem

Por ZeNit91, 20 de mar. de 2013 em Tópicos Sem Resposta

resolvido
script
5
654
ZeNit91Z
20 de março de 2013 às 09:06

Eae Galera.

 

Seguinte, gostaria de uma ajuda para fazer um um piso ou algo auto ativo que quando o player logar, todos os itens dele fiquem unique, mais isso deve ocorrer no instante que ele fizer o primeiro login na conta, apenas o primeiro ou algo que ando ele logar caia encima de um piso que seja ativado e transforme todos os itens do inventario em uniqueitem e o teletransporte para x area,

 

Se eu nao me engane esse é o codigo para UniqueItem,

 

 

function giveBack(item) --alterado v2.8 peguem o script todo!

local cid = getPlayerByName(getItemAttribute(item.uid, "unique"))

local attr = getBallsAttributes(item.uid)

local sendMail = false

---------------------------------- --alterado v2.9.1 \/

if not isCreature(cid) then

doRemoveItem(item.uid, 1)

return true

elseif (getPlayerFreeCap(cid) >= 6 and not isInArray({5, 6}, getPlayerGroupId(cid))) or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then

item2 = doCreateItemEx(item.itemid)

sendMail = true

else

item2 = addItemInFreeBag(getPlayerSlotItem(cid, 3).uid, item.itemid, 1)

end

----------------------------------

for a, b in pairs (attr) do

if b then

doItemSetAttribute(item2, a, b)

else

doItemEraseAttribute(item2, a)

end

end

if sendMail then

doPlayerSendMailByName(getItemAttribute(item2, "unique"), item2, 1)

end

doRemoveItem(item.uid, 1)

end

 

function onAddItem(moveitem, tileitem, position, cid)

 

if isContainer(moveitem.uid) then

local itens = getItensUniquesInContainer(moveitem.uid)

local sendMsg = false

if #itens >= 1 then

for a = 1, #itens do

if unLock(itens[a].uid) then

else

giveBack(itens[a])

sendMsg = true

end

end

if sendMsg then

doPlayerSendTextMessage(cid, 20, "A item in this container is a Unique Item. You can't throw away this item!")

end

end

else

if getItemAttribute(moveitem.uid, "unique") then

if unLock(moveitem.uid) then

return true

end

giveBack(moveitem)

doPlayerSendTextMessage(cid, 20, "It is a Unique Item, you can't throw away this item!")

end

end

 

return true

end

 

function onRemoveItem(moveitem, tileitem, position, cid)

 

if not moveitem or not moveitem.uid then return true end

--alterado v2.6.1

if moveitem.uid ~= 0 and isContainer(moveitem.uid) then

local itens = getItensUniquesInContainer(moveitem.uid)

local sendMsg = false

if #itens >= 1 then

for a = 1, #itens do --alterado v2.8

if not tonumber(getItemAttribute(itens[a].uid, "unique")) and getItemAttribute(itens[a].uid, "unique") ~= getCreatureName(cid) then

if unLock(itens[a].uid) then

else

giveBack(itens[a])

sendMsg = true

end

end

end

if sendMsg then

doPlayerSendTextMessage(cid, 20, "A item in this container is a Unique Item. This item don't belongs to you! It will be sent to this owner!")

end

end

else

if moveitem.uid ~= 0 and getItemAttribute(moveitem.uid, "boosting") and getItemAttribute(moveitem.uid, "boosting") >= 1 then

return true --alterado v2.9.1

end

if moveitem.uid ~= 0 and getItemAttribute(moveitem.uid, "unique") and not tonumber(getItemAttribute(moveitem.uid, "unique")) and getItemAttribute(moveitem.uid, "unique") ~= getCreatureName(cid) then

if unLock(moveitem.uid) then --alterado v2.8

return true

end

giveBack(moveitem)

doPlayerSendTextMessage(cid, 20, "It is a Unique Item! This item don't belongs to you! It will be sent to this owner!")

end

end

return true

end

 

 

Vlw des de ja

SlicerS
20 de março de 2013 às 11:36

tas ligado q o sistema de unique n funciona para itens stackables neh?

e n eh mais facil transformar os itens quando tu da eles pro player?

e achu melhor no caso fazer por onLogin usando talvez o mods/firstitems.xml...

ZeNit91Z
20 de março de 2013 às 11:51

Vlw Slicer, resolvido rs, nao foi do jeito que planejei mais fico lgl.

Quer saber como ficou olhe \/

pokeotgr.sytes.net

RESOLVIDO PODE FEXA

RoksasR
20 de março de 2013 às 17:12

Tópico movido para a seção de dúvidas e pedidos resolvidos.

5 anos depois...
StigalS
21 de abril de 2018 às 02:43
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.