valendo ++Rep
info
Grupo: Marquês
Registrado: 06/11/11
Posts: 1.1k
Reputação: +109
Char no Tibia: Stroked

info
Grupo: Marquês
Registrado: 22/07/12
Posts: 1.1k
Reputação: +400
Gênero: Masculino
Char no Tibia: Luck Oake

Tenta usar esse script de addons:
function onSay(cid, words, param, channel)
local cfg = {
["citizen"] = {
outfit = {
male = 128,
female = 136,
addon = 3,
storage = 11001
},
items = {
{2160,100}
}
},
["hunter"] = {
outfit = {
male = 129,
female = 137,
addon = 3,
storage = 11002
},
items = {
{2160,100}
}
},
["mage"] = {
outfit = {
male = 130,
female = 138,
addon = 3,
storage = 11003
},
items = {
{2160,100}
}
},
["knight"] = {
outfit = {
male = 131,
female = 139,
addon = 3,
storage = 11004
},
items = {
{2160,100}
}
},
["nobleman"] = {
outfit = {
male = 132,
female = 140,
addon = 3,
storage = 11005
},
items = {
{2160,100}
}
},
["summoner"] = {
outfit = {
male = 133,
female = 141,
addon = 3,
storage = 11006
},
items = {
{2160,100}
}
},
["warrior"] = {
outfit = {
male = 134,
female = 142,
addon = 3,
storage = 11007
},
items = {
{2160,100}
}
},
["barbarian"] = {
outfit = {
male = 147,
female = 143,
addon = 3,
storage = 11008
},
items = {
{2160,100}
}
},
["druid"] = {
outfit = {
male = 148,
female = 144,
addon = 3,
storage = 11009
},
items = {
{2160,100}
}
},
["wizard"] = {
outfit = {
male = 149,
female = 145,
addon = 3,
storage = 11010
},
items = {
{2160,100}
}
},
["oriental"] = {
outfit = {
male = 150,
female = 146,
addon = 3,
storage = 11011
},
items = {
{2160,100}
}
},
["pirate"] = {
outfit = {
male = 151,
female = 155,
addon = 3,
storage = 11012
},
items = {
{2160,100}
}
},
["assassin"] = {
outfit = {
male = 152,
female = 156,
addon = 3,
storage = 11013
},
items = {
{2160,100}
}
},
["beggar"] = {
outfit = {
male = 153,
female = 157,
addon = 3,
storage = 11014
},
items = {
{2160,100}
}
},
["shaman"] = {
outfit = {
male = 154,
female = 158,
addon = 3,
storage = 11015
},
items = {
{2160,100}
}
},
["norseman"] = {
outfit = {
male = 251,
female = 252,
addon = 3,
storage = 11016
},
items = {
{2160,100}
}
},
["nightmare"] = {
outfit = {
male = 268,
female = 269,
addon = 3,
storage = 11017
},
items = {
{2160,100}
}
},
["jester"] = {
outfit = {
male = 273,
female = 270,
addon = 3,
storage = 11018
},
items = {
{2160,100}
}
},
["brotherhood"] = {
outfit = {
male = 278,
female = 279,
addon = 3,
storage = 11019
},
items = {
{2160,100}
}
},
["demon hunter"] = {
outfit = {
male = 289,
female = 288,
addon = 3,
storage = 11020
},
items = {
{2160,100}
}
},
["yalaharian"] = {
outfit = {
male = 325,
female = 324,
addon = 3,
storage = 11021
},
items = {
{2160,100}
}
},
["wayfarer"] = {
outfit = {
male = 366,
female = 367,
addon = 3,
storage = 11023
},
items = {
{2160,100}
}
}
}
local v, removeItems = cfg[param], 0, 0
if(param == "") then
doPlayerSendCancel(cid, "Command requires param.")
return true
end
if (not isPremium(cid)) then
doPlayerSendCancel(cid, "Você não é premium account.")
return true
end
if(getPlayerStorageValue(cid, v.outfit.storage) == -1) then
for i = 1, #v.items do
if(getPlayerItemCount(cid, v.items[1]) >= v.items[2]) then
removeItems = removeItems+1
end
end
if(removeItems == #v.items) then
if(getPlayerSex(cid) == 1) then
doPlayerAddOutfit(cid, v.outfit.male, v.outfit.addon)
elseif(getPlayerSex(cid) == 0) then
doPlayerAddOutfit(cid, v.outfit.female, v.outfit.addon)
end
for i = 1, #v.items do
doPlayerRemoveItem(cid, v.items[1], v.items[2])
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você recebeu seus addons!")
doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_YELLOW)
setPlayerStorageValue(cid, v.outfit.storage, 1)
else
for i = 1, #v.items do
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Você precisa de " .. v.items[2] .. "x " .. getItemNameById(v.items[1]) .. " para comprar os addons.")
end
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Você já possui esses addons.")
end
return true
end
Você configura o preço de cada addon nessas linhas:
items = {
{2160,100} -- Id do item / Quantia
Editado Agosto 20 por LuckOake
info
Grupo: Marquês
Registrado: 06/11/11
Posts: 1.1k
Reputação: +109
Char no Tibia: Stroked

não po, n tem nada ve, tipo queria que se vc ja tivesse addon que vc escreveu por exemplo: eu ja tenho o addon citizen, daí se eu pega um addon doll e falar !addon citizen, o addon doll vai sumir e n vou ganhar o addon citizen pq eu ja tinha antes de usar o doll, gostaria q n pudesse usar o doll caso vc ja tivesse o addon falado...
info
Grupo: Marquês
Registrado: 22/07/12
Posts: 1.1k
Reputação: +400
Gênero: Masculino
Char no Tibia: Luck Oake

Pera, seu script é action ou talk? O seu script original é uma talk, mas você diz que é pra usar o addon doll? Me explique, por favor.
info
Grupo: Marquês
Registrado: 06/11/11
Posts: 1.1k
Reputação: +109
Char no Tibia: Stroked

Meu script é uma talk.
Vou tentar explicar o mais claro possivel:
Estou eu dentro do jogo, com meu addon full. Faz de conta que é o addon demonhunter.
Se eu compro um addon doll no site ele vai vir pra minha bag.
Aí eu vou la e escrevo !addon demonhunter
o addon doll vai sumir e não vou receber nenhum addon por ja ter o addon escrito novamente.
Gostaria que qndo vc adquirisse um addon funcionasse como uma storage pro addon doll
assim se vc tentar pedir um addon q vc ja tem, vai apareçer uma mensagem dizendo: Você ja tem este outifit!
info
Grupo: Marquês
Registrado: 22/07/12
Posts: 1.1k
Reputação: +400
Gênero: Masculino
Char no Tibia: Luck Oake

Hm... Rapaz, vou usar seu script de cobaia. Como eu ainda não sei muito sobre scripting, eu faço coisas que não sei se funciona, mas se funcionar, eu aprendo, então arrisquei um método que não garanto que vai funcionar, mas pelo menos vamos tentar, né.
function onSay(cid, words, param)
local femaleOutfits = { ["citizen"]={136}, ["hunter"]={137}, ["mage"]={138}, ["knight"]={139}, ["nobleman"]={140}, ["summoner"]={141}, ["warrior"]={142}, ["barbarian"]={147}, ["druid"]={148}, ["wizard"]={149}, ["oriental"]={150}, ["pirate"]={155}, ["assassin"]={156}, ["beggar"]={157}, ["shaman"]={158}, ["norsewoman"]={252}, ["nightmare"]={269}, ["jester"]={270}, ["brotherhood"]={279}, ["demonhunter"]={288}, ["yalaharian"]={324}, ["warmaster"]={336},["wayfarer"]={366} }
local maleOutfits = { ["citizen"]={128}, ["hunter"]={129}, ["mage"]={130}, ["knight"]={131}, ["nobleman"]={132},["summoner"]={133}, ["warrior"]={134}, ["barbarian"]={143}, ["druid"]={144}, ["wizard"]={145}, ["oriental"]={146}, ["pirate"]={151}, ["assassin"]={152}, ["beggar"]={153}, ["shaman"]={154}, ["norsewoman"]={251}, ["nightmare"]={268}, ["jester"]={273}, ["brotherhood"]={278}, ["demonhunter"]={289}, ["yalaharian"]={325}, ["warmaster"]={335},["wayfarer"]={367} }
local msg = {"Digite o nome correto!", "Você não possui um Addon Doll!", "Bad param!", "Você recebeu seus addons!"}
local param = string.lower(param)
if (not isPremium(cid)) then
doPlayerSendCancel(cid, "Você não possui premium account.")
return TRUE
end
if getPlayerStorageValue(cid, 9000+femaleOutfits[param][1]) == 3 or getPlayerStorageValue(cid, 9000+maleOutfits[param][1]) == 3 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você já possui esse addon.")
return true
end
if(getPlayerItemCount(cid, 9693) > 0) then
if(param ~= "" and maleOutfits[param] and femaleOutfits[param]) then
doPlayerRemoveItem(cid, 9693, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[4])
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
if(getPlayerSex(cid) == 0)then
doPlayerAddOutfit(cid, femaleOutfits[param][1], 3)
setPlayerStorageValue(cid, 9000+femaleOutfits[param][1], 3)
else
doPlayerAddOutfit(cid, maleOutfits[param][1], 3)
setPlayerStorageValue(cid, 9000+maleOutfits[param][1], 3)
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[1])
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[2])
end
return TRUE
end
Editado Agosto 20 por LuckOake
info
Grupo: Marquês
Registrado: 06/11/11
Posts: 1.1k
Reputação: +109
Char no Tibia: Stroked

Até ajudo, mais vc tem que usar uma vez o addon doll pra cria a especie de storage, por exemplo se vc ja tem um addon, vc ainda pode usar o addon doll mesmo ja tendo o addon, só na segunda vez q n vai poder usar...
info
Grupo: Marquês
Registrado: 22/07/12
Posts: 1.1k
Reputação: +400
Gênero: Masculino
Char no Tibia: Luck Oake

Bom, isso ai é meio complicado de resolver, já que seu server já possui players que tem os addons. Ainda mais que não existe uma função getPlayerAddons.
Bom, pedido atendido ou tem algo mais?
Editado Agosto 21 por LuckOake

info
Grupo: Marquês
Registrado: 06/11/11
Posts: 1.1k
Reputação: +109
Char no Tibia: Stroked
Bom, oq eu gostaria não é nem pode se dizer nem que é um bug, é um leve problemazinho:
Abaixo, vou passar o script do meu addon doll, bom, sempre que ele compra um addon, n considera q ele comprou este addon, vou explicar melhor:
Estou eu com um addon doll e falo !addon citizen, se eu falar !addon citizen de novo (claro que com outro addon doll), ele vai perder o addon doll de novo, mesmo ja tendo o outifit... gostaria que após adquirir uma vez o outifit, ou ja tendo, quando tentar comprar de novo falar: Você já possui este outifit.
Segue a baixo o scrit do 'Addon Doll'