RE

[Encerrado] [Dúvida] Unique Item

Por renansdc, 24 de jan. de 2013 em Tópicos Sem Resposta

script
5
842
renansdcR
24 de janeiro de 2013 às 14:48

Olá

 

Não estou conseguindo colocar nenhum Unique Item no PDA pelo sistema que já vem no servidor, seja pokebola, potions ou outra coisa.

 

Não sei se estou fazendo certo... Queria um script de quest, cada uma para um baú com 3 pokémons e que já viesse unique...

 

Uso o método ACC/Char por site e ele copia dos Samples, alguém sabe o que fazer para dar certo?

 

 

Obrigado.

SlicerS
24 de janeiro de 2013 às 16:54

assim.. o sistema de unique tem uma limitaçao... n funciona com itens Stackables... tirando isso...

pokeballs eh soh por..

doSetItemAttribute(item.uid, "unique", getCreatureName(cid))

 

outros itens tem q por aquilo ali /\ e tb tens q ir em movements/movements.xml e achar isso..

<movevent type="AddItem" itemid="11826-11837;11737-11748;12325-12329;12332;12580;2391;10975-10977" event="script" value="UniqueItem.lua"/>
<movevent type="RemoveItem" itemid="11826-11837;11737-11748;12325-12329;12332;12580;2391;10975-10977" event="script" value="UniqueItem.lua"/>

 

e adicionar os IDs dos itens q tu quer por unique...

 

e sobre os baus..

 

function addPokemonToPlayer(cid, pokemon, ball, unique)
if not cid or not isCreature(cid) then return false end

local pokemon = doCorrectString(pokemon)

if not pokes[pokemon] then return false end

  local gender = getRandomGenderByName(pokemon)
  local btype = (ball and pokeballs[ball]) and ball or "normal"
  local happy = 250

  if getPlayerFreeCap(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then
  item = doCreateItemEx(11826)
  else
  item = addItemInFreeBag(getPlayerSlotItem(cid, 3).uid, 11826, 1)  
  end
  if not item then return false end

  doItemSetAttribute(item, "poke", pokemon)
  doItemSetAttribute(item, "hp", 1)
  doItemSetAttribute(item, "happy", happy)
  doItemSetAttribute(item, "gender", gender)
  doSetItemAttribute(item, "hands", 0)
  doItemSetAttribute(item, "description", "Contains a "..pokemon..".")
  doItemSetAttribute(item, "fakedesc", "Contains a "..pokemon..".")
  if unique then
  doItemSetAttribute(item, "unique", getCreatureName(cid))
  end

  if getPlayerFreeCap(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then
  doPlayerSendMailByName(getCreatureName(cid), item, 1)
  end
  doTransformItem(item, pokeballs[btype].on)
return true
end

local pokes = {
--[action dos baus] = poke q vai ganhar,
[1111] = "Bulbasaur",
[2222] = "Squirtle",
[3333] = "Charmander",
}
local sto = 587899  --storage dos baus...

function onUse(cid, item, frompos, item2, topos)

local pokemon = pokes[item.actionid]
if not pokemon then return true end

if getPlayerStorageValue(cid, sto) >= 1 then
  return doPlayerSendTextMessage(cid, 27, "You already get the pokemon!")
end

setPlayerStorageValue(cid, sto, 1)
addPokemonToPlayer(cid, pokemon, "normal", true)
doPlayerSendTextMessage(cid, 27, "Coungradulations you have received ".. getArticle(pokemon) .." "..pokemon..".")

return true
end

 

 

tag:

<action actionid="xxxx" event="script" value="yyyy.lua"/>

Editado Janeiro 24 por Slicer

renansdcR
26 de janeiro de 2013 às 02:48

Deu certo.

Obrigado.

SlicerS
26 de janeiro de 2013 às 11:22

sanado, movido

5 anos depois...
StigalS
20 de abril de 2018 às 00:52
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.