wow, vai ajudar muita gente, muito bom ^^
- Fórum
- xTibia - Notícias e Suporte
- Tutoriais para Iniciantes
- Price System - Pokemons (PDA by Slicer)
Price System - Pokemons (PDA by Slicer)
Por Noninhouh, 23 de ago. de 2013 em Tutoriais para Iniciantes
info
Grupo: Visconde
Registrado: 25/05/11
Posts: 310
Reputação: +123
Char no Tibia: Dark Alissow

Muito Bom , Reputado , isso vai ajudar muita gente...
info
Grupo: Campones
Registrado: 22/08/12
Posts: 95
Reputação: +18
Char no Tibia: NoNick

Otimo system, reputado ;s
info
Grupo: Campones
Registrado: 16/08/13
Posts: 35
Reputação: +7
Char no Tibia: Bebunda

Otimo systema Rep++
info
Grupo: Infante
Registrado: 06/03/13
Posts: 1.6k
Reputação: +319
Gênero: Masculino
Char no Tibia: Lord Sorte

bom manin estragou meu sistema ashusahu eu tinha feito com base no do zeref cm tu mais ta de boa leva uma curtida +
info
Grupo: Barão
Registrado: 16/11/10
Posts: 203
Reputação: +78
Char no Tibia: Lerv

Boa Danone xD
info
Grupo: Herói
Registrado: 12/06/12
Posts: 2.2k
Reputação: +739
Gênero: Masculino
Char no Tibia: Supreme Player

Boa Danone. Cuida do meu like ai xD
info
Grupo: Visconde
Registrado: 07/01/12
Posts: 495
Reputação: +48
Gênero: Masculino
Char no Tibia: Nem Tenho

Boa, REP+
info
Grupo: Visconde
Registrado: 22/11/12
Posts: 267
Reputação: +26
Gênero: Masculino
Char no Tibia: ADM Kabo

Nao -.- teno afff
function onLook(cid, thing, position, lookDistance)
local str = ""
if not isPokeball(thing.itemid) then
if priceList[getItemInfo(thing.itemid).name] then
price = priceList[getItemInfo(thing.itemid).name].price
if thing.type > 1 then
str = "You see "..thing.type.." "..getItemInfo(thing.itemid).plural.."."
price = price * thing.type
else
str = "You see "..getItemInfo(thing.itemid).article.." "..getItemInfo(thing.itemid).name.."."
end
str = str.." Price: $"..price.."."
if getItemAttribute(thing.uid, "description") then
str = str.."\n"..getItemAttribute(thing.uid, "description").."."
end
if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
str = str.."\nItemID: ["..thing.itemid.."]." --alterado v1.7
local pos = getThingPos(thing.uid)
str = str.."\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]"
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
end
end
if not isCreature(thing.uid) then
local iname = getItemInfo(thing.itemid)
if isPokeball(thing.itemid) then
unLock(thing.uid)
local lock = getItemAttribute(thing.uid, "lock") --alterado v1.8
local pokename = getItemAttribute(thing.uid, "poke")
local item = getItemInfo(thing.itemid)
str = "You see "..item.article.." "..item.name.."."
if getItemAttribute(thing.uid, "unique") then --alterado v1.8
str = str.." It's an unique item."
end
str = str.."\nIt contains "..getArticle(pokename).." "..pokename..".\n" --alterado v1.6
if lock and lock > 0 then
str = str.."It will unlock in ".. os.date("%d/%m/%y %X", lock)..".\n" --alterado v1.8
end
local boost = getItemAttribute(thing.uid, "boost") or 0
if boost > 0 then
str = str.."Boost level: +"..boost..".\n"
end
if getItemAttribute(thing.uid, "nick") then
str = str.."It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n"
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then --corpses
str = "You see a "..string.lower(iname.name)..". " --alterado v1.8 \/
if isContainer(thing.uid) then
str = str.."(Vol: "..getContainerCap(thing.uid)..")"
end
str = str.."\n"
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
elseif isContainer(thing.uid) then --containers
local info = getItemInfo(thing.itemid) --alterado v1.7
if info.name == "dead human" and getItemAttribute(thing.uid, "pName") then
str = "You see a dead human (Vol:"..getContainerCap(thing.uid).."). "
str = str.."You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a "
str = str.."".. getItemAttribute(thing.uid, "attacker").."."
else
str = "You see "..info.article.." "..info.name..". (Vol:"..getContainerCap(thing.uid)..")."
end
if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
str = str.."\nItemID: ["..thing.itemid.."]" --alterado v1.8
local pos = getThingPos(thing.uid)
str = str.."\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]" --alterado v1.8
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
elseif getItemAttribute(thing.uid, "unique") then --alterado v1.8 \/
local info = getItemInfo(thing.itemid)
local p = getThingPos(thing.uid)
local str = "You see "
if thing.type > 0 then
str = str..thing.type.." "..info.plural.."."
else
str = str..info.article.." "..info.name.."."
end
str = str.." It's an unique item.\n"
str = str..info.description.."\nItemID: ["..thing.itemid.."]"
str = str.."\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]"
sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, str)
return false
else
return true
end
end
local NPCBattle = {
["Brock"] = {artig = "He is", cidbat = "Pewter"},
["Misty"] = {artig = "She is", cidbat = "Cerulean"},
["Blaine"] = {artig = "He is", cidbat = "Cinnabar"},
["Sabrina"] = {artig = "She is", cidbat = "Saffron"}, --alterado v1.7
["Kira"] = {artig = "She is", cidbat = "Viridian"},
["Koga"] = {artig = "He is", cidbat = "Fushcia"},
["Erika"] = {artig = "She is", cidbat = "Celadon"},
["Surge"] = {artig = "He is", cidbat = "Vermilion"},
}
local npcname = getCreatureName(thing.uid)
if ehNPC(thing.uid) and NPCBattle[npcname] then --npcs duel
str = "You see "..npcname..". "..NPCBattle[npcname].artig.." leader of the gym from "..NPCBattle[npcname].cidbat.."." --alterado v1.7
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
elseif ehNPC(thing.uid) and getPlayerStorageValue(thing.uid, 697548) ~= -1 then --npcs de TV
local str = getPlayerStorageValue(thing.uid, 697548) --alterado v1.7
local pos = getThingPos(thing.uid)
str = youAre[getPlayerGroupId(cid)] and str.."\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]" or str
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
end
if not isPlayer(thing.uid) and not isMonster(thing.uid) then --outros npcs
str = "You see "..getCreatureName(thing.uid).."."
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
end
if isPlayer(thing.uid) then --player
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getPlayerDesc(cid, thing.uid, false)) --alterado v1.7
return false
end
if getCreatureName(thing.uid) == "Evolution" then return false end
if not isSummon(thing.uid) then --monstros
local str = "You see a "..string.lower(getCreatureName(thing.uid))..".\n"
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
elseif isSummon(thing.uid) and not isPlayer(thing.uid) then --summons
local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
if getCreatureMaster(thing.uid) == cid then
local myball = getPlayerSlotItem(cid, 8).uid
local string = "You see your "..string.lower(getCreatureName(thing.uid)).."."
if boostlevel > 0 then
string = string.."\nBoost level: +"..boostlevel.."."
end
string = string.."\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid).."."
string = string.."\n"..getPokemonHappinessDescription(thing.uid)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid))..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")
end
return false
end
return true
end
info
Grupo: Visconde
Registrado: 26/08/12
Posts: 318
Reputação: +118
Gênero: Masculino

str = str.."\nIt contains "..getArticle(pokename).." "..pokename..".\n" --alterado v1.6
substitui por
if pokesPrice[pokename] then str = str.."\nIt contains "..getArticle(pokename).." "..pokename..". Price: $"..pokesPrice[pokename].price..".\n" else str = str.."\nIt contains "..getArticle(pokename).." "..pokename..". Price: unsellable.\n" end
Editado Dezembro 22 por Noninhouh
No meu nao mudou nada, nao aparece preço nenhum ajuda por favor.
info
Grupo: Visconde
Registrado: 08/10/11
Posts: 444
Reputação: +71
Gênero: Feminino
Char no Tibia: No Have.

Amigo poste seu Look.lua e seu Configuration.
info
Grupo: Cavaleiro
Registrado: 24/10/13
Posts: 180
Reputação: +46

Tentei fazer aqui, deu erro, alguem ajuda?
Rep+
[08/02/2014 11:54:34] data/creaturescripts/scripts/look.lua:17: attempt to index global 'pokesPrice' (a nil value) [08/02/2014 11:54:34] stack traceback: [08/02/2014 11:54:34] data/creaturescripts/scripts/look.lua:17: in function <data/creaturescripts/scripts/look.lua:1>










info
Grupo: Visconde
Registrado: 26/08/12
Posts: 318
Reputação: +118
Gênero: Masculino
Bom galera, primeiramente gostaria de dizer logo que eu testei no server do PDA by Slicer
e tb eu ja tinha visto um topico com price system feito pelo ZerefShirou, porem ele so dava o price para itens...
vamos logo aos scripts:
Em /creaturescripts/scripts/look.lua procure por:
substitua por:
if pokesPrice[pokename] then table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..". Price: $"..pokesPrice[pokename].price..".\n") else table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..". Price: unsellable.\n") endagora você so precisa fazer a tabela, va em /lib/configuration.lua e coloque no final, laaaaaa em baixo:
pokesPrice = { ["Bulbasaur"] = {price = 3000}, ["Ivysaur"] = {price = 7500}, ["Venusaur"] = {price = 12000} }ai é so ir colocando, lembrando, se vc n colocar o pokemon vai aparecer "Price: unsellable."
print de como ta ake no meu:
OBS: Se caso achem bugs, porfavor me avisem!!!
OBS²: Se eu postei no lugar errado, desculpa, reportem para moverem para o local correto!!!
Editado Agosto 23 por Noninhouh