[Encerrado] [Dúvida] Unique Item

renansdc
em Tópicos Sem Resposta

renansdc

(std::string _name (RenanSdc))
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 16/11/07Posts: 200

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.

Abraços.

 

 

 

 

 

 

 

fanbarjj.png











Retired~ s2 all

 



 

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

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"/>

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

renansdc

(std::string _name (RenanSdc))
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 16/11/07Posts: 200

Deu certo.

Obrigado.

Abraços.

 

 

 

 

 

 

 

fanbarjj.png











Retired~ s2 all

 



 

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

sanado, movido

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

Stigal

don't ever stop...
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 28/11/10Posts: 3402Gênero: Masculino
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.

VI6MDIG.png

 

"O fracasso é a oportunidade de se começar de novo inteligentemente"

Minhas Redes Sociais: Youtube | Página & Grupo | Steam  | Discord Xtibia | Skype: @mrooger

 

OTpanel