tu nao pego o lib/configuration.lua da atualizaçao --' e tb n leu q caso n fosse pegar tinha q usar o writeTable.lua... sem+
- Fórum
- OTServ
- Suporte
- Tópicos Sem Resposta
- [Encerrado] Erro Spawn.lua
[Encerrado] Erro Spawn.lua
Por Gabrieltxu, 02 de fev. de 2013 em Tópicos Sem Resposta
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

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

Ta fmmz eu arrumei aki mals Não prestei atenção mais quando eu fui Soltar um Poke olha oq deu Oo!
[02/02/2013 17:26:28] [Error - Action Interface] [02/02/2013 17:26:28] data/actions/scripts/goback.lua:onUse [02/02/2013 17:26:28] Description: [02/02/2013 17:26:28] data/actions/scripts/goback.lua:194: attempt to perform arithmetic on a nil value [02/02/2013 17:26:28] stack traceback: [02/02/2013 17:26:28] data/actions/scripts/goback.lua:194: in function <data/actions/scripts/goback.lua:10>
o Script do goback.lua
local EFFECTS = {
--[OutfitID] = {Effect}
["Magmar"] = 35,
["Jynx"] = 17, --alterado v2.5
["Shiny Jynx"] = 17,
["Piloswine"] = 205,
["Swinub"] = 205,
}
function onUse(cid, item, frompos, item2, topos)
if exhaustion.get(cid, 6666) and exhaustion.get(cid, 6666) > 0 then return true end
--alterado v2.6 sistema de firstpoke retirado
if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 then
return true
end
-------------------------------------------------------
ballName = getItemAttribute(item.uid, "poke")
btype = getPokeballType(item.itemid)
usando = pokeballs[btype].use
local effect = pokeballs[btype].effect
if not effect then
effect = 21
end
----------------------------------------------------------
if item.itemid == usando then
if getPlayerStorageValue(cid, 990) == 1 then -- GYM
doPlayerSendCancel(cid, "You can't return your pokemon during gym battles.")
return true
end
---------------------------------------------------------------------------------------
if #getCreatureSummons(cid) > 1 and getPlayerStorageValue(cid, 212124) <= 0 then --alterado v2.6
if getPlayerStorageValue(cid, 637501) == -2 or getPlayerStorageValue(cid, 637501) >= 1 then
BackTeam(cid)
end
end
-----------------------------------------------------------------------------------------
if #getCreatureSummons(cid) == 2 and getPlayerStorageValue(cid, 212124) >= 1 then
doPlayerSendCancel(cid, "You can't do that while is controling a mind")
return true --alterado v2.5
end
---------------------------------------------------------------------------------------
---------------------------Promotion Especiais-------------------------------
local nat = { "Exeggutor", "Exeggcute", "Oddish", "Gloom", "Vileplume", "Shiny Oddish", "Shiny Vileplume", "Bulbasaur", "Ivysaur", "Venusaur", "Shiny Venusaur", "Bellsprout", "Weepinbell", "Victreebel", "Scyther", "Shiny Scyther", "Nidoking", "Shiny Nidoking", "Nidoran Male", "Nidoran Female", "Nidorino", "Nidorina", "Nidoqueen", "Shiny Nidoqueen", "Paras", "Shiny Paras", "Parasect", "Shiny Parascet", "Ekans", "Arbok", "Venonat", "Shiny Venonat", "Venomoth", "Shiny Venomoth", "Weezing", "Koffing", "Weedle", "Kakuna", "Beedrill", "Shiny Beedrill", "Caterpie", "Metapod", "Butterfree", "Zubat", "Shiny Zubat", "Golbat", "Shiny Golbat", "Grimer", "Shiny Grimer", "Muk", "Shiny Muk", "Pinsir", "Shiny Pinsir"}
local vol = { "Growlithe", "Shiny Growlithe", "Arcanine", "Shiny Arcanine", "Charmander", "Charmeleon", "Charizard", "Shiny Charizard", "Magmar", "Shiny Magmar", "Flareon", "Shiny Flareon", "Ponyta", "Rapidash", "Vulpix", "Ninetales", "Shiny Ninetales", "Moltres"}
local gar = { "Machop", "Machoke", "Machamp", "Snorlax", "Big Snorlax", "Chansey", "Clefairy", "Clefable", "Jigglypuff", "Wigglytuff", "Tauros", "Ditto", "Dodrio", "Eevee", "Farfetch'd", "Shiny Farfetch'd", "Hitmonchan", "Shiny Hitmonchan", "Hitmonlee", "Shiny Hitmonlee", "Kangaskhan", "Lickitung", "Mankey", "Primeape", "Meowth", "Persian", "Rattata", "Shiny Rattata", "Raticate", "Shiny Raticate"}
local mal = { "Gastly", "Haunter", "Gengar", "Shiny Gengar", "Dark Abra"}
local win = { "Dratini", "Dragonair", "Dragonite", "Shiny Dratini", "Shiny Dragonair", "Shiny Dragonite", "Pidgey", "Pidgeotto", "Pidgeot", "Shiny Pidgeot", "Gyarados", "Shiny Gyarados", "Spearow", "Fearow", "Shiny Fearow", "Dodrio", "Doduo", "Farfetch'd", "Shiny Farfetch'd", "Golbat", "Shiny Golbat", "Zapdos", "Moltres", "Articuno", "Aerodactyl"}
local rai = { "Magnemite", "Magnetom", "Voltorb", "Electrode", "Pikachu", "Raichu", "Shiny Raichu", "Electabuzz", "Shiny Electabuzz", "Zapdos", "Jolteon", "Shiny Jolteon"}
local psy = { "Porygon", "Slowbro", "Slowpoke", "Psyduck", "Golduck", "Exeggcute", "Exeggutor", "Alakazam", "Kadabra", "Abra", "Drowzee", "Hypno", "Dark Abra", "Shiny Alakazam", "Shiny Hypno", "Mr. Mime", "Mew", "Mewtwo"}
local sea = { "Poliwag", "Poliwhirl", "Poliwhrat", "Lapras", "Seel", "Dewgong", "Jynx", "Shellder", "Cloyster", "Shiny Jynx", "Squirtle", "Wartortle", "Blastoise", "Shiny Blastoise", "Vaporeon", "Shiny Vaporeon", "Articuno", "Krabby", "Shiny Krabby", "Kingler", "Shiny Kingler", "Goldeen", "Seaking", "Horsea", "Seadra", "Shiny Horsea", "Shiny Seadra", "Psyduck", "Golduck", "Gyarados", "Shiny Gyarados", "Magikarp", "Shiny Magikarp", "Omastar", "Omanyte", "Kabuto", "Kabutops", "Slowbro", "Slowpoke", "Staryu", "Starmie", "Tentacool", "Shiny Tentacool", "Tentacruel", "Shiny Tentacruel"}
local ore = { "Geodude", "Graveler", "Golem", "Shiny Golem", "Onix", "Crystal Onix", "Aerodatcyl", "Rhyhorn", "Rhydon", "Sandshrew", "Sandslash", "Diglett", "Dugtrio", "Cubone", "Marowak", "Shiny Marowak"}
local pokeball = getPlayerSlotItem(cid, 8)
local name = getItemAttribute(pokeball.uid, "poke")
for j = 1, #nat do
for k = 1, #vol do
for l = 1, #gar do
for m = 1, #mal do
if getPlayerStorageValue(cid, 181612) >= 1 then -- Naturian
if name == nat[j] then
doItemSetAttribute(pokeball.uid, "offense", getItemAttribute(pokeball.uid, "offense") - 0.020)
doItemSetAttribute(pokeball.uid, "defense", getItemAttribute(pokeball.uid, "defense") - 0.020)
doItemSetAttribute(pokeball.uid, "specialattack", getItemAttribute(pokeball.uid, "specialattack") - 0.050)
end
elseif getPlayerStorageValue(cid, 181613) >= 1 then -- Volcanic
if name == vol[k] then
doItemSetAttribute(pokeball.uid, "offense", getItemAttribute(pokeball.uid, "offense") - 0.020)
doItemSetAttribute(pokeball.uid, "defense", getItemAttribute(pokeball.uid, "defense") - 0.020)
doItemSetAttribute(pokeball.uid, "specialattack", getItemAttribute(pokeball.uid, "specialattack") - 0.050)
end
elseif getPlayerStorageValue(cid, 181614) >= 1 then -- Gardestrike
if name == gar[l] then
doItemSetAttribute(pokeball.uid, "offense", getItemAttribute(pokeball.uid, "offense") - 0.020)
doItemSetAttribute(pokeball.uid, "defense", getItemAttribute(pokeball.uid, "defense") - 0.020)
doItemSetAttribute(pokeball.uid, "specialattack", getItemAttribute(pokeball.uid, "specialattack") - 0.050)
end
elseif getPlayerStorageValue(cid, 181615) >= 1 then -- Malefic
if name == mal[m] then
doItemSetAttribute(pokeball.uid, "offense", getItemAttribute(pokeball.uid, "offense") - 0.020)
doItemSetAttribute(pokeball.uid, "defense", getItemAttribute(pokeball.uid, "defense") - 0.020)
doItemSetAttribute(pokeball.uid, "specialattack", getItemAttribute(pokeball.uid, "specialattack") - 0.050)
end
end
end
end
end
end
---------------------------Promotion Especiais-------------------------------
---------------------------Torneio-------------------------------
local storage = 20501
x = getPlayerStorageValue(cid, storage)
if getPlayerStorageValue(cid, 80950) == 1 then -- Storage do Torneio PETMON
doSendAnimatedText(getThingPos(cid), "POKEDOWN: "..x.."", 71)
setPlayerStorageValue(cid, storage, x + 1)
end
---------------------------Torneio-------------------------------
if getPlayerStorageValue(cid, 990) == 1 then -- GYM
doPlayerSendCancel(cid, "You can't return your pokemon during gym battles.")
return true
end
---------------------------------------------------------------------------------------
if #getCreatureSummons(cid) > 1 and getPlayerStorageValue(cid, 637501) >= 1 then
BackTeam(cid, getCreatureSummons(cid), effect) --<<-- Edited Team Slice system
end
---------------------------------------------------------------------------------------
if #getCreatureSummons(cid) <= 0 then
if isInArray(pokeballs[btype].all, item.itemid) then
doTransformItem(item.uid, pokeballs[btype].off)
doItemSetAttribute(item.uid, "hp", 0)
doPlayerSendCancel(cid, "This pokemon is fainted.")
return true
end
end
local cd = getCD(item.uid, "blink", 30)
if cd > 0 then
setCD(item.uid, "blink", 0)
end
local z = getCreatureSummons(cid)[1]
if getCreatureCondition(z, CONDITION_INVISIBLE) and not isGhostPokemon(z) then
return true
end
doReturnPokemon(cid, z, item, effect)
elseif item.itemid == pokeballs[btype].on then
if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then
doPlayerSendCancel(cid, "You must put your pokeball in the correct place!")
return TRUE
end
local thishp = getItemAttribute(item.uid, "hp")
if thishp <= 0 then
if isInArray(pokeballs[btype].all, item.itemid) then
doTransformItem(item.uid, pokeballs[btype].off)
doItemSetAttribute(item.uid, "hp", 0)
doPlayerSendCancel(cid, "This pokemon is fainted.")
return true
end
end
local pokemon = getItemAttribute(item.uid, "poke")
if not pokes[pokemon] then
return true
end
----------------------- Sistema de nao poder carregar mais que 3 pokes lvl baixo e + q 1 poke de lvl medio/alto ---------------------------------
if not isInArray({5, 6}, getPlayerGroupId(cid)) then
local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)
local lowPokes = {"Rattata", "Caterpie", "Weedle", "Oddish", "Pidgey", "Paras", "Poliwag", "Bellsprout", "Magikarp", "Hoppip", "Sunkern"}
local low = {}
local lw = 1
for e, f in pairs(pokeballs) do
for times = 1, 3 do
local items = getItemsInContainerById(bp.uid, pokeballs[e].all[times])
if #items >= 1 then --alterado v2.6
for _, uid in pairs(items) do
local nome1 = getItemAttribute(uid, "poke")
if not isInArray(lowPokes, pokemon) and nome1 == pokemon then
return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry two pokemons equals!")
elseif isInArray(lowPokes, pokemon) then
if nome1 == pokemon then
table.insert(low, lw, nome1)
lw = lw +1
end
end
end
end
end
end
if #low >= 3 then
return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry more than three pokemons equals of low level!")
end
end
---------------------------------------------------------------------------------------------------------------------------------------------------
local x = pokes[pokemon]
local boosts = getItemAttribute(item.uid, "boost") or 0
if getPlayerLevel(cid) + pokemonMaxLevelAbovePlayer < getItemAttribute(item.uid, "level") + boosts then
doPlayerSendCancel(cid, "Your pokemon's level is much higher than yours, you can't use him.")
return true
end
--------------------------------------------------------------------------------------
shinysClan = {
["Shiny Fearow"] = {4, "Wingeon"},
["Shiny Flareon"] = {1, "Volcanic"},
["Shiny Vaporeon"] = {2, "Seavel"},
["Shiny Jolteon"] = {9, "Raibolt"},
["Shiny Hypno"] = {7, "Psycraft"},
["Shiny Golem"] = {3, "Orebound"},
["Shiny Vileplume"] = {8, "Naturia"},
["Shiny Nidoking"] = {5, "Malefic"},
["Shiny Hitmontop"] = {6, "Gardestrike"}, --alterado v2.4
}
if shinysClan[pokemon] and (getPlayerGroupId(cid) < 3 or getPlayerGroupId(cid) > 6) then
if getPlayerStorageValue(cid, 86228) ~= shinysClan[pokemon][1] then
doPlayerSendCancel(cid, "You need be a member of the clan "..shinysClan[pokemon][2].." to use this pokemon!")
return true
elseif getPlayerStorageValue(cid, 862281) ~= 5 then
doPlayerSendCancel(cid, "You need be atleast rank 5 to use this pokemon!")
return true
end
end
--------------------------------------------------------------------------------------
doSummonMonster(cid, pokemon)
local pk = getCreatureSummons(cid)[1]
if not isCreature(pk) then return true end
------------------------passiva hitmonchan------------------------------
if isSummon(pk) then --alterado v2.8 \/
if pokemon == "Shiny Hitmonchan" or pokemon == "Hitmonchan" then
if not getItemAttribute(item.uid, "hands") then
doSetItemAttribute(item.uid, "hands", 0)
end
local hands = getItemAttribute(item.uid, "hands")
doSetCreatureOutfit(pk, {lookType = hitmonchans[pokemon][hands].out}, -1)
end
end
-------------------------------------------------------------------------
---------movement magmar, jynx-------------
if EFFECTS[getCreatureName(pk)] then
markPosEff(pk, getThingPos(pk))
sendMovementEffect(pk, EFFECTS[getCreatureName(pk)], getThingPos(pk)) --alterado v2.5
end
--------------------------------------------------------------------------
if getCreatureName(pk) == "Ditto" then
local left = getItemAttribute(item.uid, "transLeft")
local name = getItemAttribute(item.uid, "transName")
if left and left > 0 then
setPlayerStorageValue(pk, 1010, name)
doSetCreatureOutfit(pk, {lookType = getItemAttribute(item.uid, "transOutfit")}, -1)
addEvent(deTransform, left * 1000, pk, getItemAttribute(item.uid, "transTurn"))
doItemSetAttribute(item.uid, "transBegin", os.clock())
else
setPlayerStorageValue(pk, 1010, "Ditto")
end
end
if isGhostPokemon(pk) then doTeleportThing(pk, getPosByDir(getThingPos(cid), math.random(0, 7)), false) end
doCreatureSetLookDir(pk, 2)
adjustStatus(pk, item.uid, true, false, true)
doAddPokemonInOwnList(cid, pokemon)
doTransformItem(item.uid, item.itemid+1)
local pokename = getPokeName(pk) --alterado v2.7
local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)
doCreatureSay(cid, mgo, TALKTYPE_SAY)
doSendMagicEffect(getCreaturePosition(pk), effect)
if useOTClient then
doPlayerSendCancel(cid, '12//,show') --alterado v2.7
end
else
doPlayerSendCancel(cid, "This pokemon is fainted.")
end
if useKpdoDlls then
doUpdateMoves(cid)
end
return true
end
e do Look.lua!
[02/02/2013 17:28:07] [Error - CreatureScript Interface] [02/02/2013 17:28:07] data/creaturescripts/scripts/look.lua:onLook [02/02/2013 17:28:07] Description: [02/02/2013 17:28:07] data/creaturescripts/scripts/look.lua:14: attempt to concatenate a nil value [02/02/2013 17:28:07] stack traceback: [02/02/2013 17:28:07] data/creaturescripts/scripts/look.lua:14: in function <data/creaturescripts/scripts/look.lua:1>
Script dele!
function onLook(cid, thing, position, lookDistance)
local str = ""
if not isCreature(thing.uid) then
local iname = getItemInfo(thing.itemid)
if isPokeball(thing.itemid) then
local lock = getItemAttribute(thing.uid, "lock") --alterado v2.8
local pokename = getItemAttribute(thing.uid, "poke")
local item = getItemInfo(thing.itemid)
str = "You see "..item.article.." "..item.name.."." --alterado v2.6
if getItemAttribute(thing.uid, "unique") then --alterado v2.8
str = str.." It's an unique item." --alterado v2.6
end
str = str.."\nIt contains "..getArticle(pokename).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n" --alterado v2.6
if lock and lock > 0 then
str = str.."It will unlock in ".. os.date("%d/%m/%y %X", lock)..".\n" --alterado v2.8
end
local boost = getItemAttribute(thing.uid, "boost") or 0
local boostshow = ""
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
if getItemAttribute(thing.uid, "gender") == SEX_MALE then
str = str.."It is male."
elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
str = str.."It is female."
else
str = str.."It is genderless."
end
str = str.."\n--- Status ---"
str = str.."\nOffense: "..math.floor(getItemAttribute(thing.uid, "offense")).." Defense: "..math.floor(getItemAttribute(thing.uid, "defense")).."\n"
str = str.."Agility: "..math.floor(getItemAttribute(thing.uid, "speed")).." Sp. Attack: "..math.floor(getItemAttribute(thing.uid, "specialattack")).."\n"
str = str.."Vitality: "..math.floor(getItemAttribute(thing.uid, "vitality"))..""
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then
str = "You see a "..string.lower(iname.name).." ["..getItemAttribute(thing.uid, "level").."]. " --alterado v2.8 \/
if isContainer(thing.uid) then
str = str.."(Vol: "..getContainerCap(thing.uid)..")"
end
str = str.."\n"
if getItemAttribute(thing.uid, "gender") == SEX_MALE then
str = str.."It is male."
elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
str = str.."It is female."
else
str = str.."It is genderless."
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
elseif isContainer(thing.uid) then --containers
local info = getItemInfo(thing.itemid) --alterado v2.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 v2.8
local pos = getThingPos(thing.uid)
str = str.."\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]" --alterado v2.8
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
elseif getItemAttribute(thing.uid, "unique") then --alterado v2.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 v2.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 v2.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 v2.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
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 v2.7
return false
end
if getCreatureName(thing.uid) == "Evolution" then return false end
if not isSummon(thing.uid) then
local str = "You see a wild "..string.lower(getCreatureName(thing.uid)).." [level "..getPokemonLevel(thing.uid).."].\n"
if getPokemonGender(thing.uid) == SEX_MALE then
str = str.."It is male."
elseif getPokemonGender(thing.uid) == SEX_FEMALE then
str = str.."It is female."
else
str = str.."It is genderless."
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
elseif isSummon(thing.uid) and not isPlayer(thing.uid) then
local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
local boostshow = " + "..boostlevel.."]"
if showBoostSeparated then
boostshow = "] [+"..boostlevel.."]"
end
local levelinfo = "["..getPokemonLevel(thing.uid)..""..boostshow..""
if getCreatureMaster(thing.uid) == cid then
local myball = getPlayerSlotItem(cid, 8).uid
local nexp = getItemAttribute(myball, "nextlevelexp")
local string = "You see your "..string.lower(getCreatureName(thing.uid)).." "..levelinfo.."."
string = string.."\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid).."."
string = string.."\n"..getPokemonHappinessDescription(thing.uid)
if getItemAttribute(myball, "level") <= 99 then
string = string.."\nExperience needed to level up: "..nexp.."."
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")
end
return false
end
return true
end
Editado Fevereiro 2 por Gabrieltxu
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

hã... esse ae nao faz o menor sentido ![]()
if shinysClan[pokemon] and (getPlayerGroupId(cid) < 3 or getPlayerGroupId(cid) > 6) then
ta dizendo q getPlayerGroupId ta retornando nil LOL
info
Grupo: Herói
Registrado: 12/06/12
Posts: 2.2k
Reputação: +739
Gênero: Masculino
Char no Tibia: Supreme Player

hã... esse ae nao faz o menor sentido
if shinysClan[pokemon] and (getPlayerGroupId(cid) < 3 or getPlayerGroupId(cid) > 6) thenta dizendo q getPlayerGroupId ta retornando nil LOL
/\ como asim? Oo Muito loko isso aconteceu quando eu tentei com um char criado do zero ai quando fui soltar meu inicial deu isso
! o Look foi quando fui dar Look na Pokebola!
mais Tudo isso fui tentar com o Good e Não deu erro no distro Só deu com o Char Player
Editado Fevereiro 2 por Gabrieltxu
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

teu XML/groups.xml ta assim?
<?xml version="1.0" encoding="UTF-8"?>
<groups>
<group id="1" name="Player" flags="8304" customFlags="8192"/>
<group id="2" name="Roupas" access="6" flags="176"/>
<group id="3" name="Senior Tutor" flags="68736352256" customFlags="14" access="2" violationReasons="10" nameViolationFlags="2" statementViolationFlags="63" maxVips="200"/>
<group id="4" name="Game Master" flags="3808558964575" customFlags="562911" access="3" violationReasons="19" nameViolationFlags="10" statementViolationFlags="69" depotLimit="3000" maxVips="300"/>
<group id="5" name="Sub" flags="3840774348794" customFlags="562911" access="4" violationReasons="23" nameViolationFlags="42" statementViolationFlags="213" depotLimit="4000" maxVips="400"/>
<group id="6" name="God" flags="338646913753080" customFlags="91805663" access="5" violationReasons="23" nameViolationFlags="426" statementViolationFlags="469" depotLimit="5000" maxVips="500"/>
<group id="8" name="Pokemon" flags="8304" customFlags="8192" violationReasons="4" nameViolationFlags="2"/>
<group id="11" name="Watching TV" flags="13196790358799" customFlags="0"/>
</groups>
info
Grupo: Herói
Registrado: 12/06/12
Posts: 2.2k
Reputação: +739
Gênero: Masculino
Char no Tibia: Supreme Player

Sim Sim Manow Não sei oq é da erro Só no char criado fui tentar com os Outros Tipo testinho da certo solta o Pokemon da look etc.. eu acho que é erro no Uniq item! mais o estranho eq dei Look nas Pokeball ai Mostra que é Uniq item Oo
Testei com as account que ja veio no Server tipo o ticha testinho etc... neles vai normal Oo Só da erro nos caras iniciais
-----------------------------------------------------
Testei aki joguei um Oddish criado por um god e fui nakela acc para ver se dava certo! ai deu certo Só não deu certo o Pokemon Inicial dele Oo!
Editado Fevereiro 2 por Gabrieltxu
info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: Masculino

Tópico movido para a seção de dúvidas e pedidos resolvidos.
info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: Masculino

+ 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.


info
Grupo: Herói
Registrado: 12/06/12
Posts: 2.2k
Reputação: +739
Gênero: Masculino
Char no Tibia: Supreme Player
Eae Galera eu tava arrumando um Server meu aki e ai ocorreu o seguinte erro!
o Script do Spawn.lua
local shinys = {
"Venusaur", "Charizard", "Blastoise", "Butterfree", "Beedrill", "Pidgeot", "Rattata", "Raticate", "Raichu", "Zubat", "Golbat", "Paras", "Parasect",
"Venonat", "Venomoth", "Growlithe", "Arcanine", "Abra", "Alakazam", "Tentacool", "Tentacruel", "Farfetch'd", "Grimer", "Muk", "Gengar", "Onix", "Krabby",
"Kingler", "Voltorb", "Electrode", "Cubone", "Marowak", "Hitmonlee", "Hitmonchan", "Tangela", "Horsea", "Seadra", "Scyther", "Jynx", "Electabuzz", "Pinsir",
"Magikarp", "Gyarados", "Snorlax", "Dragonair", "Dratini",
}
local raros = {"Dragonite"} --alterado v2.5
local function ShinyName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Shiny") then
local newName = tostring(getCreatureName(cid)):match("Shiny (.*)")
local newNamed = newName.." ["..getPokemonLevel(cid).."]"
doCreatureSetNick(cid, newNamed)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function doPokemonRegisterLevel(cid)
if not isCreature(cid) then return true end
if getWildPokemonLevel(cid) == -1 then
setWildPokemonLevel(cid)
end
end
local function doSetRandomGender(cid)
if not isCreature(cid) then return true end
local gender = 0
local name = getCreatureName(cid)
if not newpokedex[name] then return true end
local rate = newpokedex[name].gender
if rate == 0 then
gender = 3
elseif rate == 1000 then
gender = 4
elseif rate == -1 then
gender = 0
elseif math.random(1, 1000) <= rate then
gender = 4
else
gender = 3
end
doCreatureSetSkullType(cid, gender)
end
local function doShiny(cid)
if isCreature(cid) then
if isSummon(cid) then return true end
if getPlayerStorageValue(cid, 74469) >= 1 then return true end
if getPlayerStorageValue(cid, 22546) >= 1 then return true end --alterado v2.7 -golden-
if isNpcSummon(cid) then return true end
if isInArray(shinys, getCreatureName(cid)) then
transform = math.random(1, 1000) --0.5% chance
elseif isInArray(raros, getCreatureName(cid)) then
transform = math.random(1, 1000) --0.1% chance
elseif not isInArray(raros, getCreatureName(cid)) and not isInArray(shinys, getCreatureName(cid)) then
return true
end
if transform == 10 then
doSendMagicEffect(getThingPos(cid), 18)
local shi = doCreateMonster("Shiny ".. getCreatureName(cid) .."", getThingPos(cid))
setPlayerStorageValue(shi, 74469, 1)
setPlayerStorageValue(cid, 74469, 1)
doRemoveCreature(cid)
else
setPlayerStorageValue(cid, 74469, 1)
end
else
return true
end
end
function onSpawn(cid)
registerCreatureEvent(cid, "Experience")
registerCreatureEvent(cid, "GeneralConfiguration")
registerCreatureEvent(cid, "DirectionSystem")
registerCreatureEvent(cid, "CastSystem")
if isSummon(cid) then
registerCreatureEvent(cid, "SummonDeath")
return true
end
addEvent(doPokemonRegisterLevel, 5, cid)
addEvent(doSetRandomGender, 5, cid)
addEvent(doShiny, 10, cid)
addEvent(ShinyName, 15, cid)
return true
end
Do level system.lua
function getPokemonStatus(name, multiplier)
local a = pokes[name]
local m = 1
if not a then return false end
if not a.offense then return false end
if multiplier then m = multiplier end
local ret = {}
ret.off = a.offense * m
ret.offense = ret.off
ret.def = a.defense * m
ret.defense = ret.def
ret.agi = a.agility * m
ret.agility = ret.agi
ret.spatk = a.specialattack * m
ret.specialattack = ret.spatk
ret.vit = a.vitality * m
ret.vitality = ret.vit
return ret
end
function getPokemonXMLOutfit(name)
local johto = false
for i = 209, 308 do --alterado v2.6
if oldpokedex[1] and oldpokedex[1] == name then
johto = true
end
end
if isShinyName(name) then
a = "data/monster/pokes/Shiny/"..name..".xml"
elseif johto then
a = "data/monster/pokes/geracao 2/"..name..".xml" --edited pra melhorar a pasta monster
else
a = "data/monster/pokes/geracao 1/"..name..".xml"
end
local b = io.open(a, "a+")
local c = b:read("*all")
b:close()
local d, e = c:find('look type="(.-)"')
c = string.sub(c, d + 11, e - 1)
return tonumber©
end
function doEvolutionOutfit(cid, oldout, outfit)
if not isCreature(cid) then return true end
if getCreatureOutfit(cid).lookType == oldout then
doSetCreatureOutfit(cid, {lookType = outfit}, -1)
else
doSetCreatureOutfit(cid, {lookType = oldout}, -1)
end
end
function doStartEvolution(cid, evolution, seconds)
if not isCreature(cid) then return true end
local a = getPlayerStorageValue(cid, 1007)
local b = getCreatureHealth(cid) / getCreatureMaxHealth(cid)
local d = getThingPos(cid)
local e = getCreatureMaster(cid)
if getHappinessRate(cid) < 1 then return true end
local f = getCreatureOutfit(cid).lookType
local g = getItemAttribute(getPlayerSlotItem(e, 8).uid, "nick") or getCreatureName(cid)
local h = getPokemonXMLOutfit(evolution)
doItemSetAttribute(getPlayerSlotItem(e, 8).uid, "hp", b)
doCreatureSay(e, "What? My "..g.." is evolving!", TALKTYPE_SAY)
doSummonMonster(e, "Evolution")
doReturnPokemon(e, cid, getPlayerSlotItem(e, 8), 0, true)
local evo = getCreatureSummons(e)[1]
doEvolutionOutfit(evo, h, f)
doCreatureSetHideHealth(evo, true)
doCreatureSetLookDir(evo, 2)
setPlayerStorageValue(evo, 1007, g)
doTeleportThing(evo, d, false)
addEvent(sendSSJEffect, 250, evo)
doSendAnimatedText(getThingPos(evo), "EVOLUTION", COLOR_GRASS)
doSendEvolutionEffect(evo, getThingPos(evo), evolution, 20, false, false, f, h)
end
function doSendEvolutionEffect(cid, pos, evolution, turn, ssj, evolve, f, h)
if not isCreature(cid) then
doSendAnimatedText(pos, "CANCEL", 215)
return true end
if evolve then
doEvolvePokemon(getCreatureMaster(cid), {uid = cid}, evolution, 0, 0)
return true
end
doSendMagicEffect(pos, 18)
if ssj then
sendSSJEffect(evo)
end
doEvolutionOutfit(cid, f, h)
addEvent(doSendEvolutionEffect, math.pow(1900, turn/20), cid, getThingPos(cid), evolution, turn - 1, turn == 19, turn == 2, f, h)
end
function sendSSJEffect(cid)
if not isCreature(cid) then return true end
local pos1 = getThingPos(cid)
local pos2 = getThingPos(cid)
pos2.x = pos2.x + math.random(-1, 1)
pos2.y = pos2.y - math.random(1, 2)
doSendDistanceShoot(pos1, pos2, 37)
addEvent(sendSSJEffect, 45, cid)
end
function sendFinishEvolutionEffect(cid, alternate)
if not isCreature(cid) then return true end
local pos1 = getThingPos(cid)
if alternate then
local pos = {
[1] = {-2, 0},
[2] = {-1, -1},
[3] = {0, -2},
[4] = {1, -1},
[5] = {2, 0},
[6] = {1, 1},
[7] = {0, 2},
[8] = {-1, 1}}
for a = 1, 8 do
local pos2 = getThingPos(cid)
pos2.x = pos2.x + pos[a][1]
pos2.y = pos2.y + pos[a][2]
local pos = getThingPos(cid)
doSendDistanceShoot(pos2, pos, 37)
addEvent(doSendDistanceShoot, 300, pos, pos2, 37)
end
else
for a = 0, 3 do
doSendDistanceShoot(pos1, getPosByDir(pos1, a), 37)
end
for a = 4, 7 do
addEvent(doSendDistanceShoot, 600, pos1, getPosByDir(pos1, a), 37)
end
end
end
function doEvolvePokemon(cid, item2, theevo, stone1, stone2)
if not isCreature(cid) then return true end
if not pokes[theevo] or not pokes[theevo].offense then
doReturnPokemon(cid, item2.uid, getPlayerSlotItem(cid, 8), pokeballs[getPokeballType(getPlayerSlotItem(cid, 8).itemid)].effect, false, true)
return true
end
local owner = getCreatureMaster(item2.uid)
local pokeball = getPlayerSlotItem(cid, 8)
local description = "Contains a "..theevo.."."
local pct = getCreatureHealth(item2.uid) / getCreatureMaxHealth(item2.uid)
doItemSetAttribute(pokeball.uid, "hp", pct)
doItemSetAttribute(pokeball.uid, "poke", theevo)
doItemSetAttribute(pokeball.uid, "description", "Contains a "..theevo..".")
doPlayerSendTextMessage(cid, 27, "Congratulations! Your "..getPokeName(item2.uid).." evolved into a "..theevo.."!")
doSendMagicEffect(getThingPos(item2.uid), 18)
doTransformItem(getPlayerSlotItem(cid, 7).uid, fotos[theevo])
doSendMagicEffect(getThingPos(cid), 173)
local oldpos = getThingPos(item2.uid)
local oldlod = getCreatureLookDir(item2.uid)
local oldlvl = getPokemonLevel(item2.uid)
doRemoveCreature(item2.uid)
doSummonMonster(cid, theevo)
local pk = getCreatureSummons(cid)[1]
doTeleportThing(pk, oldpos, false)
doCreatureSetLookDir(pk, oldlod)
sendFinishEvolutionEffect(pk, true)
addEvent(sendFinishEvolutionEffect, 550, pk, true)
addEvent(sendFinishEvolutionEffect, 1050, pk)
doPlayerRemoveItem(cid, stone1, 1)
doPlayerRemoveItem(cid, stone2, 1)
doAddPokemonInOwnList(cid, theevo)
local status = getPokemonStatus(getCreatureName(pk))
local off = status.off * 7.5
local def = status.def * 7.5
local agi = status.agi * 7.5
local spatk = status.spatk * 7.5
local vit = status.vit * 7
doItemSetAttribute(pokeball.uid, "offense", getItemAttribute(pokeball.uid, "offense") + off)
doItemSetAttribute(pokeball.uid, "defense", getItemAttribute(pokeball.uid, "defense") + def)
doItemSetAttribute(pokeball.uid, "speed", getItemAttribute(pokeball.uid, "speed") + agi)
doItemSetAttribute(pokeball.uid, "specialattack", getItemAttribute(pokeball.uid, "specialattack") + spatk)
doItemSetAttribute(pokeball.uid, "vitality", getItemAttribute(pokeball.uid, "vitality") + vit)
doPlayerSendTextMessage(cid, 27, "Evolution bonus: • Offense: +"..doMathDecimal(off).." • Defense: +"..doMathDecimal(def).." • Spc. Atk: +"..doMathDecimal(spatk).." • Agility: +"..doMathDecimal(agi).." • Vitality: +"..doMathDecimal(vit).."")
local happy = getItemAttribute(pokeball.uid, "happy")
doItemSetAttribute(pokeball.uid, "happy", happy + happyGainedOnEvolution)
if happy + happyGainedOnEvolution > 255 then
doItemSetAttribute(pokeball.uid, "happy", 255)
end
adjustStatus(pk, pokeball.uid, true, false)
if useKpdoDlls then
doUpdateMoves(cid)
end
end
function givePokemonExp(cid, item, expe, pct, rarecandy)
if expe <= 0 or not isCreature(cid) then return true end
local leveltable = getPokemonExperienceTable(getPokeballName(item.uid, true))
if getItemAttribute(item.uid, "exp") + expe > leveltable[100] then
givePokemonExp(cid, item, leveltable[100] - getItemAttribute(item.uid, "exp"))
return true
end
doItemSetAttribute(item.uid, "exp", getItemAttribute(item.uid, "exp") + expe)
doItemSetAttribute(item.uid, "happy", getItemAttribute(item.uid, "happy") + 1)
doItemSetAttribute(item.uid, "nextlevelexp", getItemAttribute(item.uid, "nextlevelexp") - expe)
if pct then
doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item.uid).." has received "..expe.." experience points ("..pct.."%).")
else
if getItemAttribute(item.uid, "nextlevelexp") > 0 then
doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item.uid).." ["..getItemAttribute(item.uid, "level").."] has received "..expe.." experience points ("..getItemAttribute(item.uid, "nextlevelexp").." to next level).")
else
doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item.uid).." ["..getItemAttribute(item.uid, "level").."] has received "..expe.." experience points and has leveled up!")
end
end
if isBeingUsed(item.itemid) then
doSendAnimatedText(getThingPos(getCreatureSummons(cid)[1]), expe, 215)
end
if getItemAttribute(item.uid, "nextlevelexp") <= 0 then
local summon = getCreatureSummons(cid)[1]
if not isCreature(summon) then return true end
doSendFlareEffect(getThingPos(summon))
doSendAnimatedText(getThingPos(summon), "Level up!", 215)
adjustPokemonLevel(item.uid, cid, item.itemid)
doCreatureAddHealth(summon, getCreatureMaxHealth(summon))
end
end
function givePokemonExpInBp(cid, item, expe, ballid, pct, hidemessage)
if expe <= 0 or not isCreature(cid) then return true end
local leveltable = getPokemonExperienceTable(getPokeballName(item, true))
if getItemAttribute(item, "exp") + expe > leveltable[100] then
givePokemonExpInBp(cid, item, leveltable[100] - getItemAttribute(item, "exp"), ballid)
return true
end
doItemSetAttribute(item, "exp", getItemAttribute(item, "exp") + expe)
doItemSetAttribute(item, "happy", getItemAttribute(item, "happy") + 1)
doItemSetAttribute(item, "nextlevelexp", getItemAttribute(item, "nextlevelexp") - expe)
if not hidemessage then
if pct then
doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item).." has received "..expe.." experience points ("..pct.."%).")
else
if getItemAttribute(item, "nextlevelexp") > 0 then
doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item).." ["..getItemAttribute(item, "level").."] has received "..expe.." experience points inside his pokeball ("..getItemAttribute(item, "nextlevelexp").." to next level).")
else
doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item).." ["..getItemAttribute(item, "level").."] has received "..expe.." experience points and has leveled up inside his pokeball.")
adjustPokemonLevel(item, cid, ballid)
end
end
end
end
function doMathDecimal(number, casas)
if math.floor(number) == number then return number end
local c = casas and casas + 1 or 3
for a = 0, 10 do
if math.floor(number) < math.pow(10, a) then
local str = string.sub(""..number.."", 1, a + c)
return tonumber(str)
end
end
return number
end
function adjustPokemonLevel(item, cid, id, rarecandy)
if not isCreature(cid) then return true end
local exp = getItemAttribute(item, "exp")
local level = getItemAttribute(item, "level")
local leveltable = getPokemonExperienceTable(getPokeballName(item, true))
local newlevel = 1
for x = 1, 100 do
if exp >= leveltable[x] and exp < leveltable[x+1] then
newlevel = x
end
end
if newlevel <= 1 then return true end
local levelsup = (newlevel - level)
local pokemon = getItemAttribute(item, "poke")
local happy = getItemAttribute(item, "happy")
local rate = happy / 100
local newhappiness = happy
if happy >= 250 then
newhappiness = 255
elseif happy >= 230 then
newhappiness = happy + 4
elseif happy >= 210 then
newhappiness = happy + 6
elseif happy >= 180 then
newhappiness = happy + 8
elseif happy >= 140 then
newhappiness = happy + 10
elseif happy >= 110 then
newhappiness = happy + 12
else
newhappiness = happy + 15
end
local status = getPokemonStatus(pokemon)
local off = status.off * rate * levelsup
local def = status.def * rate * levelsup
local agi = status.agi * rate * levelsup
local spatk = status.spatk * rate * levelsup
local vit = status.vit * rate * levelsup
doItemSetAttribute(item, "level", newlevel)
if not rarecandy then
doItemSetAttribute(item, "happy", newhappiness)
end
local nextexp = leveltable[newlevel + 1] - exp
doItemSetAttribute(item, "nextlevelexp", nextexp)
doItemSetAttribute(item, "offense", getItemAttribute(item, "offense") + off)
doItemSetAttribute(item, "defense", getItemAttribute(item, "defense") + def)
doItemSetAttribute(item, "speed", getItemAttribute(item, "speed") + agi)
doItemSetAttribute(item, "specialattack", getItemAttribute(item, "specialattack") + spatk)
doItemSetAttribute(item, "vitality", getItemAttribute(item, "vitality") + vit)
if newlevel > getPlayerLevel(cid) + pokemonMaxLevelAbovePlayer then
addEvent(doPlayerSendTextMessage, 30, cid, 18, "Warning: Your "..getPokeballName(item).."'s ["..newlevel.."] level is much higher than yours, so you will not be able to call him to battles.")
end
if isCreature(cid) and id >= 1 and isBeingUsed(id) then
adjustStatus(getCreatureSummons(cid)[1], item, false, true)
doPlayerSendTextMessage(cid, 27, "• Level: "..newlevel.." (+"..levelsup..") • Offense: +"..doMathDecimal(off).." • Defense: +"..doMathDecimal(def).." • Spc. Atk: +"..doMathDecimal(spatk).." • Agility: +"..doMathDecimal(agi).." • Vitality: +"..doMathDecimal(vit).."")
if happy < minHappyToEvolve then return true end
if pokemonsCanEvolveByLevel then
local summon = getCreatureSummons(cid)[1]
local reqlevel = poevo[getCreatureName(summon)] and poevo[getCreatureName(summon)].level or -1
local level = getItemAttribute(item, "level")
local evolution = "none"
local name = getCreatureName(summon)
if name == "Tyrogue" and level >= 20 then
if getOffense(summon) == getDefense(summon) then
evolution = "Hitmontop"
elseif getOffense(summon) > getDefense(summon) then
evolution = "Hitmonlee"
else
evolution = "Hitmonchan"
end
elseif name == "Eevee" then
if happy >= maxHappyToEvolve then
if isDay() then
evolution = "Espeon"
else
evolution = "Umbreon"
end
end
elseif name == "Slowpoke" and level >= 28 then
evolution = "Slowbro"
elseif name == "Poliwhirl" and level >= 36 then
evolution = "Poliwrath"
elseif reqlevel > 4 and level >= reqlevel then
evolution = poevo[getCreatureName(summon)].evolution
elseif reqlevel == 2 and happy >= maxHappyToEvolve then
evolution = poevo[getCreatureName(summon)] and poevo[getCreatureName(summon)].evolution or "none"
end
if evolution ~= "none" then
doStartEvolution(summon, evolution, 4)
end
end
end
end
function doAdjustWithDelay(cid, pk, health, vit, status)
if isCreature(cid) then --alterado v2.5
if not isCreature(cid) then return true end
adjustStatus(pk, getPlayerSlotItem(cid, 8).uid, health, vir, status)
end
end
function adjustStatus(pk, item, health, vite, conditions)
if not isCreature(pk) then return true end
local bonusoffense = getItemAttribute(item, boffense) or 0
local bonusdefense = getItemAttribute(item, bdefense) or 0
local bonusagility = getItemAttribute(item, bagility) or 0
local bonussattack = getItemAttribute(item, bsattack) or 0
setPlayerStorageValue(pk, 1000, getItemAttribute(item, "level"))
setPlayerStorageValue(pk, 1001, getItemAttribute(item, "offense") + bonusoffense)
setPlayerStorageValue(pk, 1002, getItemAttribute(item, "defense") + bonusdefense)
setPlayerStorageValue(pk, 1003, getItemAttribute(item, "speed") + bonusagility)
setPlayerStorageValue(pk, 1005, getItemAttribute(item, "specialattack") + bonussattack)
local gender = getItemAttribute(item, "gender") and getItemAttribute(item, "gender") or 0
doCreatureSetSkullType(pk, gender)
if vite == true then
local pct = getCreatureHealth(pk) / getCreatureMaxHealth(pk)
local vit = getItemAttribute(item, "vitality") - getPlayerStorageValue(pk, 1004)
setCreatureMaxHealth(pk, getCreatureMaxHealth(pk) + ( vit * HPperVIT ))
doCreatureAddHealth(pk, pct * vit * HPperVIT)
end
setPlayerStorageValue(pk, 1004, getItemAttribute(item, "vitality"))
doRegainSpeed(pk)
local nick = getItemAttribute(item, "poke")
if string.find(tostring(nick), "Shiny") then
nick = tostring(nick):match("Shiny (.*)")
end
if getItemAttribute(item, "nick") then
nick = getItemAttribute(item, "nick")
end
setPlayerStorageValue(pk, 1007, nick)
local boostlevel = getItemAttribute(item, "boost") or 0
local boostshow = hideBoost and "]" or " + "..boostlevel.."]"
local lvlstr = ""
if showBoostSeparated then
boostshow = hideBoost and "]" or "] [+"..boostlevel.."]"
end
if hideSummonsLevel then
if not hideBoost then
nick = nick.." [+"..boostlevel.."]"
end
else
nick = nick.." ["..getItemAttribute(item, "level")..""..boostshow..""
end
doCreatureSetNick(pk, nick)
if not getItemAttribute(item, "happy") then
doItemSetAttribute(item, "happy", 120)
end
if not getItemAttribute(item, "hunger") then
doItemSetAttribute(item, "hunger", 5)
end
local happy = getItemAttribute(item, "happy")
if happy < 0 then
happy = 1
end
setPlayerStorageValue(pk, 1008, happy)
local hunger = getItemAttribute(item, "hunger")
setPlayerStorageValue(pk, 1009, hunger)
if health == true then
local mh = getCreatureMaxHealth(pk) + HPperVIT * getVitality(pk)
local rd = 1 - (tonumber(getItemAttribute(item, "hp")))
setCreatureMaxHealth(pk, mh)
doCreatureAddHealth(pk, getCreatureMaxHealth(pk))
doCreatureAddHealth(pk, -(getCreatureMaxHealth(pk) * rd))
end
if isSummon(pk) and conditions then --alterado v2.5 daki pra baixo!!
local burn = getItemAttribute(item, "burn")
if burn and burn >= 0 then
local ret = {id = pk, cd = burn, check = false, damage = getItemAttribute(item, "burndmg"), cond = "Burn"}
addEvent(doCondition2, 3500, ret)
end
local poison = getItemAttribute(item, "poison")
if poison and poison >= 0 then
local ret = {id = pk, cd = poison, check = false, damage = getItemAttribute(item, "poisondmg"), cond = "Poison"}
addEvent(doCondition2, 1500, ret)
end
local confuse = getItemAttribute(item, "confuse")
if confuse and confuse >= 0 then
local ret = {id = pk, cd = confuse, check = false, cond = "Confusion"}
addEvent(doCondition2, 1200, ret) --alterado v2.5
end
local sleep = getItemAttribute(item, "sleep")
if sleep and sleep >= 0 then
local ret = {id = pk, cd = sleep, check = false, first = true, cond = "Sleep"}
doCondition2(ret)
end
local miss = getItemAttribute(item, "miss")
if miss and miss >= 0 then
local ret = {id = pk, cd = miss, eff = getItemAttribute(item, "missEff"), check = false, spell = getItemAttribute(item, "missSpell"), cond = "Miss"}
doCondition2(ret)
end
local fear = getItemAttribute(item, "fear")
if fear and fear >= 0 then
local ret = {id = pk, cd = fear, check = false, skill = getItemAttribute(item, "fearSkill"), cond = "Fear"}
doCondition2(ret)
end
local silence = getItemAttribute(item, "silence")
if silence and silence >= 0 then
local ret = {id = pk, cd = silence, eff = getItemAttribute(item, "silenceEff"), check = false, cond = "Silence"}
doCondition2(ret)
end
local stun = getItemAttribute(item, "stun")
if stun and stun >= 0 then
local ret = {id = pk, cd = stun, eff = getItemAttribute(item, "stunEff"), check = false, spell = getItemAttribute(item, "stunSpell"), cond = "Stun"}
doCondition2(ret)
end
local paralyze = getItemAttribute(item, "paralyze")
if paralyze and paralyze >= 0 then
local ret = {id = pk, cd = paralyze, eff = getItemAttribute(item, "paralyzeEff"), check = false, first = true, cond = "Paralyze"}
doCondition2(ret)
end
local slow = getItemAttribute(item, "slow")
if slow and slow >= 0 then
local ret = {id = pk, cd = slow, eff = getItemAttribute(item, "slowEff"), check = false, first = true, cond = "Slow"}
doCondition2(ret)
end
local leech = getItemAttribute(item, "leech")
if leech and leech >= 0 then
local ret = {id = pk, cd = leech, attacker = 0, check = false, damage = getItemAttribute(item, "leechdmg"), cond = "Leech"}
doCondition2(ret)
end
for i = 1, 3 do
local buff = getItemAttribute(item, "Buff"..i)
if buff and buff >= 0 then
local ret = {id = pk, cd = buff, eff = getItemAttribute(item, "Buff"..i.."eff"), check = false,
buff = getItemAttribute(item, "Buff"..i.."skill"), first = true, attr = "Buff"..i}
doCondition2(ret)
end
end
end
if getItemAttribute(item, "boost") and getItemAttribute(item, "boost") == 50 and getItemAttribute(item, "aura") then
sendAuraEffect(pk, auraSyst[getItemAttribute(item, "aura")]) --edited aura system
end
if getPlayerStorageValue(getCreatureMaster(pk), 6598754) >= 1 then
setPlayerStorageValue(pk, 6598754, 1) --edited pvp system
elseif getPlayerStorageValue(getCreatureMaster(pk), 6598755) >= 1 then
setPlayerStorageValue(pk, 6598755, 1)
end
return true
end
function setWildPokemonLevel(cid, optionalLevel, optionalStatus, optionalNick, optionalExtraExp)
if not isCreature(cid) then return true end
if not pokes[getCreatureName(cid)] then return true end --alterado v2.6
local levelRange = 0
local off = 0
local def = 0
local agi = 0
local spatk = 0
local vit = 0
local this = getCreatureName(cid)
local ee = 1
if optionalExtraExp then
ee = optionalExtraExp
end
if optionalLevel and tonumber(optionalLevel) >= 1 then --alterado v2.8\/
levelRange = optionalLevel
else
levelRange = math.random(pokes[this].wildLvlMin, pokes[this].wildLvlMax)
end
local status = getPokemonStatus(this)
if status then
off = status.off
def = status.def
agi = status.agi
vit = status.vit
spatk = status.spatk
end
setPlayerStorageValue(cid, 1000, (levelRange > 100 and 100 or levelRange)) --alterado v2.8
if optionalStatus and optionalStatus.off then
setPlayerStorageValue(cid, 1001, optionalStatus.offense)
setPlayerStorageValue(cid, 1002, optionalStatus.defense)
setPlayerStorageValue(cid, 1003, optionalStatus.agility)
setPlayerStorageValue(cid, 1004, optionalStatus.vitality)
setPlayerStorageValue(cid, 1005, optionalStatus.specialattack)
setPlayerStorageValue(cid, 1011, optionalStatus.offense)
setPlayerStorageValue(cid, 1012, optionalStatus.defense)
setPlayerStorageValue(cid, 1013, optionalStatus.agility)
setPlayerStorageValue(cid, 1014, optionalStatus.vitality)
setPlayerStorageValue(cid, 1015, optionalStatus.specialattack)
else
setPlayerStorageValue(cid, 1001, 5 + math.random(off * levelRange * 0.9, off * levelRange * 1.8))
setPlayerStorageValue(cid, 1002, 5 + math.random(def * levelRange * 0.9, def * levelRange * 1.8))
setPlayerStorageValue(cid, 1003, math.random(agi * levelRange * 0.9, agi * levelRange * 1.8))
setPlayerStorageValue(cid, 1004, math.random(vit * levelRange * 0.9, vit * levelRange * 1.8))
setPlayerStorageValue(cid, 1005, 5 + math.random(spatk * levelRange * 0.9, spatk * levelRange * 1.8))
setPlayerStorageValue(cid, 1011, getPlayerStorageValue(cid, 1001))
setPlayerStorageValue(cid, 1012, getPlayerStorageValue(cid, 1002))
setPlayerStorageValue(cid, 1013, getPlayerStorageValue(cid, 1003))
setPlayerStorageValue(cid, 1014, getPlayerStorageValue(cid, 1004))
setPlayerStorageValue(cid, 1015, getPlayerStorageValue(cid, 1005))
end
doRegainSpeed(cid)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + getPlayerStorageValue(cid, 1004) * HPperVIT * vitReductionForWild)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
if pokes[getCreatureName(cid)].exp then
--getMonsterInfo(getCreatureName(cid)).experience
local exp = (50 + pokes[getCreatureName(cid)].exp) * baseExpRate + pokes[getCreatureName(cid)].vitality * levelRange * pokemonExpPerLevelRate
setPlayerStorageValue(cid, 1006, exp * generalExpRate * ee)
if getPlayerStorageValue(cid, 22546) == 1 then
setPlayerStorageValue(cid, 1006, 750)
doSetCreatureDropLoot(cid, false) --edited golden arena
end
end
local wildshow = wildBeforeNames and "Wild " or ""
if optionalNick then
if hideWildsLevel then
doCreatureSetNick(cid, optionalNick)
else
doCreatureSetNick(cid, optionalNick.." ["..getWildPokemonLevel(cid).."]")
end
else
if hideWildsLevel then
doCreatureSetNick(cid, ""..wildshow..""..getCreatureName(cid).."")
else
doCreatureSetNick(cid, ""..wildshow..""..getCreatureName(cid).." ["..getWildPokemonLevel(cid).."]")
end
end
end
function getOffenseInRage(cid) --alterado v2.8
if not isCreature(cid) then return 0 end
if getPlayerStorageValue(cid, 547888) >= 1 then
return tonumber(getPlayerStorageValue(cid, 1001)) / 2
end
return tonumber(getPlayerStorageValue(cid, 1001))
end
function getOffense(cid)
if not isCreature(cid) then return 0 end
--[[if getPlayerStorageValue(cid, 3894) >= 1 then
return tonumber(getPlayerStorageValue(cid, 1001)) / 2
end ]]
return tonumber(getPlayerStorageValue(cid, 1001))
end
function getDefense(cid)
if not isCreature(cid) then return 0 end
--[[ if getPlayerStorageValue(cid, 3894) >= 1 then
return tonumber(getPlayerStorageValue(cid, 1002)) / 2
end ]]
return tonumber(getPlayerStorageValue(cid, 1002))
end
function getSpeed(cid)
if not isCreature(cid) then return 0 end
return tonumber(getPlayerStorageValue(cid, 1003))
end
function getVitality(cid)
if not isCreature(cid) then return 0 end
return tonumber(getPlayerStorageValue(cid, 1004))
end
function getSpecialAttack(cid)
if not isCreature(cid) then return 0 end
return tonumber(getPlayerStorageValue(cid, 1005))
end
function getHappiness(cid)
if not isCreature(cid) then return 0 end
return tonumber(getPlayerStorageValue(cid, 1008))
end
function getSpecialDefense(cid)
if not isCreature(cid) then return 0 end
return getSpecialAttack(cid) * 0.85 + getDefense(cid) * 0.2
end
function getWildPokemonExp(cid)
return getPlayerStorageValue(cid, 1006)
end
function getWildPokemonLevel(cid)
return getPlayerStorageValue(cid, 1000)
end
function getLevel(cid)
if isSummon(cid) then
return getItemAttribute(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "level")
end
return getPlayerStorageValue(cid, 1000)
end
function getPokeName(cid)
if not isSummon(cid) then return getCreatureName(cid) end
if getCreatureName(cid) == "Evolution" then return getPlayerStorageValue(cid, 1007) end
local item = getPlayerSlotItem(getCreatureMaster(cid), 8)
if getItemAttribute(item.uid, "nick") then --alterado v2.7
return getItemAttribute(item.uid, "nick")
end
if string.find(tostring(getCreatureName(cid)), "Shiny") then
local newName = tostring(getCreatureName(cid)):match("Shiny (.*)")
return newName
end
return getCreatureName(cid)
end
function getPokeballName(item, truename)
if not truename and getItemAttribute(item, "nick") then
return getItemAttribute(item, "nick")
end
return getItemAttribute(item, "poke")
end
function getPokemonName(cid)
return getCreatureName(cid)
end
function getMasterLevel(poke)
if not isSummon(poke) then return 0 end
return getPlayerLevel(getCreatureMaster(poke)) --alterado v2.5
end
function getPokeballBoost(ball)
if not isPokeball(ball.itemid) then return 0 end --alterado v2.8
return getItemAttribute(ball.uid, "boost") or 0
end
function getPokemonBoost(poke)
if not isSummon(poke) then return 0 end --alterado v2.5
return getItemAttribute(getPlayerSlotItem(getCreatureMaster(poke), 8).uid, "boost") or 0
end
function getPokemonLevelByName(name)
if tostring(name) then --alterado v2.5
return pokes[name].level
end
return 0
end
function getPokemonLevel(cid)
if not isCreature(cid) then return 0 end
return getPlayerStorageValue(cid, 1000)
end
function getPokemonGender(cid)
return getCreatureSkullType(cid)
end
function setPokemonGender(cid, gender)
if isCreature(cid) and gender then --alterado v2.8
doCreatureSetSkullType(cid, gender)
return true
end
return false
end
Espero que alguem me ajude xD