Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Dei recompensa inicial de 100 pokeballs, mudei o atributo delas pra unique, mas ao separar uma pokeball das 100, ela deixa de ser unique. Queria saber se tem como ajeitar isso sem mexer nas sources (que ninguém tem do PDA ç.ç)

Uniqueitem.lua em movements tá assim

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
----------------------------------
if not isCreature(cid) or getPlayerFreeCap(cid) >= 6 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, "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      



 tumblr_mwfeg45FIV1qk4cb3o4_500.gif

  • Respostas 7
  • Visualizações 707
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Autor

Vê se seu server já tem.. Coloca na função OnUse de algum baú:

local test = doPlayerAddItem(cid, IDDOITEM, 1)
doItemSetAttribute(test, "unique", cid)

Põe a id do item que quer que venha como unique.

Editado por Danves (veja o histórico de edições)



 tumblr_mwfeg45FIV1qk4cb3o4_500.gif

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo