É só com você que ocorre isso? Ou com todos os players?
- Fórum
- OTServ
- Suporte
- Tópicos Sem Resposta
- [Encerrado] Servidor Abre, Account List Aparece Mas Character Não Entra!
[Encerrado] Servidor Abre, Account List Aparece Mas Character Não Entra!
Por Prezyoso, 08 de dez. de 2012 em Tópicos Sem Resposta
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

info
Grupo: Lorde
Registrado: 17/01/09
Posts: 2.1k
Reputação: +395
Char no Tibia: Adra Sata

Isso ai geralmente está relacionado ao:
1- Script, geralmente é creaturescript, algum script no onLogin que não está deixando eles logare.
2- Servidor OFF-LINE mesmo, pode ter mudado o ip da sua internet, e esqueceu de trocar o ip no ipfixo
3- Seu firewall está bloqueando o acesso das outras pessoas ao seu servidor, ou mesmo do seu próprio pc.
um dessas 3 coisas é relacionado a seu problema
info
Grupo: Infante
Registrado: 27/08/11
Posts: 1.9k
Reputação: +85
Gênero: Masculino
Char no Tibia: Bruno Maciel

o meu ja conteseu issu ums dias atras
o problema era \/
Servidor OFF-LINE mesmo, pode ter mudado o ip da sua internet, e esqueceu de trocar o ip no ipfixo
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

Oque o SkyDangerous falou está correto, pode nos mostrar seu arquivo login.lua em spoiler? Ele está na pasta data/creaturescripts/scripts! Bença
)
@EDIT
Aah, e se quanto a eles falarem que o servidor está Offline, não creio nisso, pois se não a account list não apareceria. Confirme se as duas portas então abertas> 7171, e 7172 no Firewall e se for internet compartilhada no roteador!
Editado Dezembro 8 por Roksas
info
Grupo: Lorde
Registrado: 17/01/09
Posts: 2.1k
Reputação: +395
Char no Tibia: Adra Sata

Oque o SkyDangerous falou está correto, pode nos mostrar seu arquivo login.lua em spoiler? Ele está na pasta data/creaturescripts/scripts! Bença
)
@EDIT
Aah, e se quanto a eles falarem que o servidor está Offline, não creio nisso, pois se não a account list não apareceria. Confirme se as duas portas então abertas> 7171, e 7172 no Firewall e se for internet compartilhada no roteador!
pode ser isso sim, mais se ja tava on-line.. provavelmente seja um script que ele pois que dá esse erro, vamos ver o que ele fala.
info
Grupo: Conde
Registrado: 13/12/11
Posts: 619
Reputação: +44

Script aki:
local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}
local flys = {
["Moltres"] = {229, 2300}, -- moltres
["Articuno"] = {230, 2100}, -- artic
["Zapdos"] = {224, 2600}, -- zapdos
["Mew"] = {232, 2200}, -- 1000
["Mewtwo"] = {233, 2200},-- two
["Dragonite"] = {221, 1300},-- nite
["Pidgeot"] = {222, 900}, -- geot
["Fearow"] = {226, 800}, -- fearow
["Aerodactyl"] = {227, 1100}, -- aero
["Charizard"] = {216, 1000}, -- chari
["Porygon"] = {316, 600}, -- porygon
["Shiny Moltres"] = {229, 2300}, -- Shiny moltres
["Shiny Articuno"] = {1018, 2100}, -- Shiny artic
["Shiny Zapdos"] = {1019, 2600}, -- Shiny zapdos
["Shiny Mew"] = {1022, 2200}, -- Shiny 1000
["Shiny Mewtwo"] = {1021, 2200},-- Shiny two
["Shiny Dragonite"] = {1020, 1300},-- Shiny nite
["Shiny Pidgeot"] = {996, 900}, -- Shiny geot
["Shiny Fearow"] = {997, 800}, -- Shiny fearow
["Shiny Aerodactyl"] = {1017, 1100}, -- Shiny aero
["Shiny Charizard"] = {995, 1000}, -- Shiny chari
["Shiny Porygon"] = {1016, 600}, -- Shiny porygon
["Porygon2"] = {648, 890}, -- 2
["Skarmory"] = {649, 1000}, -- skarmory
["Crobat"] = {652, 1190}, -- crobat
["Staraptor"] = {1142, 985}, -- staraptor
["Shiny Staraptor"] = {1193, 985}, -- staraptor
["Salamence"] = {1373, 1300}, -- salamence
["Swellow"] = {1371, 980}, -- Swellow
["Flygon"] = {1365, 1200}, -- Flygon
["Pelipper"] = {1370, 950}, -- Pelipper
["Altaria"] = {1366, 1000}, -- Altaria
["Tropius"] = {1147, 500}, -- tropius
}
local rides = {
["Tauros"] = {128, 580}, -- tauros
["Ninetales"] = {129, 800}, -- kyuubi
["Rapidash"] = {130, 800}, -- rapid
["Ponyta"] = {131, 410}, -- ponyta
["Rhyhorn"] = {132, 400}, -- rhyhorn
["Arcanine"] = {12, 900}, -- arcan
["Onix"] = {126, 450}, -- onix
["Venusaur"] = {134, 390}, -- venu
["Dodrio"] = {133, 750}, -- dodrio
["Doduo"] = {135, 420}, -- doduo
["Shiny Tauros"] = {1024, 580}, -- tauros
["Shiny Ninetales"] = {999, 800}, -- kyuubi
["Shiny Rapidash"] = {1005, 800}, -- rapid
["Shiny Ponyta"] = {1004, 410}, -- ponyta
["Shiny Rhyhorn"] = {1023, 400}, -- rhyhorn
["Shiny Arcanine"] = {1003, 900}, -- arcan
["Shiny Onix"] = {1008, 450}, -- onix
["Shiny Venusaur"] = {1040, 390}, -- venu
["Shiny Dodrio"] = {1007, 750}, -- dodrio
["Shiny Doduo"] = {1006, 420}, -- doduo
["Crystal Onix"] = {293, 480}, -- cristal onix
["Steelix"] = {646, 750}, -- steelix
["Meganium"] = {685, 720}, -- meganium
["Bayleef"] = {686, 555}, -- bayleef
["Stantler"] = {687, 595}, -- stantler
["Houndoom"] = {647, 820}, -- houndoom
["Piloswine"] = {689, 450}, -- piloswine
["Mareep"] = {688, 400}, -- marip
["Absol"] = {1143, 700}, -- absol
["Camerupt"] = {1144, 690}, -- camerupt
["Mamoswine"] = {1146, 450}, -- mamoswine
["Shiny Absol"] = {1143, 700}, -- absol
["Shiny Camerupt"] = {1191, 690}, -- camerupt
["Shiny Mamoswine"] = {1188, 450}, -- mamoswine
["Shiny Luxray"] = {1192, 450}, -- luxray
["Luxray"] = {1145, 450}, -- luxray
["Luxray"] = {1145, 500}, -- luxray
["Shiny Luxray"] = {1192, 500}, -- luxray
["Shiny Bayleef"] = {1236, 500}, -- bayleef
["Shiny Meganium"] = {1235, 500}, -- meganium
["Lairon"] = {1361, 450}, -- lairon
["Shelgon"] = {1377, 850}, -- Shelgon
["Manectric"] = {1368, 900}, -- Manectric
["Mightyena"] = {1369, 900}, -- Mightyena
["Torkoal"] = {1372, 800}, -- Torkoal
["Shiny Tropius"] = {1867, 500}, -- tropius
}
local surf = {
["Poliwag"] = {lookType=278, speed = 320},
["Poliwhirl"] = {lookType=137, speed = 480},
["Seaking"] = {lookType=269, speed = 520},
["Dewgong"] = {lookType=183, speed = 700},
["Blastoise"] = {lookType=184, speed = 850},
["Tentacruel"] = {lookType=185, speed = 750},
["Lapras"] = {lookType=186, speed = 960},
["Gyarados"] = {lookType=187, speed = 1050},
["Omastar"] = {lookType=188, speed = 680},
["Kabutops"] = {lookType=189, speed = 840},
["Poliwrath"] = {lookType=190, speed = 680},
["Vaporeon"] = {lookType=191, speed = 800},
["Staryu"] = {lookType=266, speed = 385},
["Starmie"] = {lookType=267, speed = 685},
["Goldeen"] = {lookType=268, speed = 355},
["Seadra"] = {lookType=270, speed = 655},
["Golduck"] = {lookType=271, speed = 760},
["Squirtle"] = {lookType=273, speed = 365},
["Wartortle"] = {lookType=275, speed = 605},
["Tentacool"] = {lookType=277, speed = 340},
["Snorlax"] = {lookType=300, speed = 500},
["Shiny Poliwag"] = {lookType=1010, speed = 320},
["Shiny Poliwhirl"] = {lookType=1011, speed = 480},
["Shiny Seaking"] = {lookType=1027, speed = 520},
["Shiny Dewgong"] = {lookType=1015, speed = 700},
["Shiny Blastoise"] = {lookType=1002, speed = 850},
["Shiny Tentacruel"] = {lookType=1014, speed = 750},
["Shiny Lapras"] = {lookType=1031, speed = 960},
["Shiny Gyarados"] = {lookType=1030, speed = 1050},
["Shiny Omastar"] = {lookType=1033, speed = 680},
["Shiny Kabutops"] = {lookType=1034, speed = 840},
["Shiny Poliwrath"] = {lookType=1012, speed = 680},
["Shiny Vaporeon"] = {lookType=1032, speed = 800},
["Shiny Staryu"] = {lookType=1028, speed = 385},
["Shiny Starmie"] = {lookType=1029, speed = 685},
["Shiny Goldeen"] = {lookType=1026, speed = 355},
["Shiny Seadra"] = {lookType=1025, speed = 655},
["Shiny Golduck"] = {lookType=1009, speed = 760},
["Shiny Squirtle"] = {lookType=1000, speed = 365},
["Shiny Wartortle"] = {lookType=1001, speed = 605},
["Shiny Tentacool"] = {lookType=1013, speed = 340},
["Shiny Snorlax"] = {lookType=1035, speed = 500},
["Mantine"] = {lookType=636, speed = 820},
["Totodile"] = {lookType=637, speed = 360},
["Croconaw"] = {lookType=638, speed = 590},
["Feraligatr"] = {lookType=645, speed = 900},
["Marill"] = {lookType=639, speed = 340},
["Azumarill"] = {lookType=642, speed = 680},
["Quagsire"] = {lookType=643, speed = 740},
["Kingdra"] = {lookType=644, speed = 1020},
["Octillery"] = {lookType=641, speed = 600},
["Wooper"] = {lookType=640, speed = 315},
["Sharpedo"] = {lookType=1139, speed = 600},
["Floatzel"] = {lookType=1138, speed = 700},
["Swampert"] = {lookType=1135, speed = 650},
["Marshtomp"] = {lookType=1134, speed = 502},
["Wailord"] = {lookType=1137, speed = 450},
["Milotic"] = {lookType=1136, speed = 780},
["Shiny Sharpedo"] = {lookType=1141, speed = 650},
["Shiny Floatzel"] = {lookType=1140, speed = 750},
["Shiny Totodile"] = {lookType=1239, speed = 360},
["Shiny Croconaw"] = {lookType=1238, speed = 590},
["Shiny Feraligatr"] = {lookType=1237, speed = 900},
["Barboach"] = {lookType=1354, speed = 315},
["Whiscash"] = {lookType=1356, speed = 740},
["Huntail"] = {lookType=1360, speed = 540},
["Gorebyss"] = {lookType=1359, speed = 740},
["Luvdisc"] = {lookType=1355, speed = 440},
["Relicanth"] = {lookType=1364, speed = 500},
["Spheal"] = {lookType=1357, speed = 300},
["Sealeo"] = {lookType=1362, speed = 500},
["Walrein"] = {lookType=1363, speed = 700},
}
function onLogin(cid)
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 100)
doCreatureSetDropLoot(cid, false)
local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
else
str = str
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
elseif(accountManager == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(accountManager == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
end
if getCreatureName(cid) == "Account Manager" then
local outfit = {}
if accountManagerRandomPokemonOutfit then
outfit = {lookType = getPokemonXMLOutfit(oldpokedex[math.random(151)][1])}
else
outfit = accountManagerOutfit
end
doSetCreatureOutfit(cid, outfit, -1)
return true
end
if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end
local outfit = {}
if getPlayerVocation(cid) == 0 then
doPlayerSetMaxCapacity(cid, 0)
doPlayerSetVocation(cid, 1)
setCreatureMaxMana(cid, 6)
doPlayerAddSoul(cid, -getPlayerSoul(cid))
setPlayerStorageValue(cid, 19898, 0)
if getCreatureOutfit(cid).lookType == 128 then
outfit = {lookType = 510, lookHead = math.random(0, 132), lookBody = math.random(0, 132), lookLegs = math.random(0, 132), lookFeet = math.random(0, 132)}
elseif getCreatureOutfit(cid).lookType == 136 then
outfit = {lookType = 511, lookHead = math.random(0, 132), lookBody = math.random(0, 132), lookLegs = math.random(0, 132), lookFeet = math.random(0, 132)}
end
doCreatureChangeOutfit(cid, outfit)
end
registerCreatureEvent(cid, "WatchTv")
registerCreatureEvent(cid, "StopWatchingTv")
registerCreatureEvent(cid, "WalkTv")
registerCreatureEvent(cid, "RecordTv")
--registerCreatureEvent(cid, "Death")
registerCreatureEvent(cid, "PlayerLogout")
registerCreatureEvent(cid, "WildAttack")
registerCreatureEvent(cid, "Idle")
registerCreatureEvent(cid, "PokemonIdle")
registerCreatureEvent(cid, "EffectOnAdvance")
registerCreatureEvent(cid, "GeneralConfiguration")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "LookSystem")
registerCreatureEvent(cid, "T1")
registerCreatureEvent(cid, "T2")
registerCreatureEvent(cid, "AuraBoost")
registerCreatureEvent(cid, "RepLogin")
if getPlayerStorageValue(cid, 99284) == 1 then
setPlayerStorageValue(cid, 99284, -1)
end
doChangeSpeed(cid, -(getCreatureSpeed(cid)))
if getPlayerStorageValue(cid, 17000) >= 1 then -- fly
local item = getPlayerSlotItem(cid, 8)
local poke = getItemAttribute(item.uid, "poke")
doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
doRemoveCondition(cid, CONDITION_OUTFIT)
doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1)
local apos = getFlyingMarkedPos(cid)
apos.stackpos = 0
if getTileThingByPos(apos).itemid <= 2 then
doCombatAreaHealth(cid, FIREDAMAGE, getFlyingMarkedPos(cid), 0, 0, 0, CONST_ME_NONE)
doCreateItem(460, 1, getFlyingMarkedPos(cid))
end
doTeleportThing(cid, apos, false)
elseif getPlayerStorageValue(cid, 63215) >= 1 then -- surf
if not isInArray({4820, 4821, 4822, 4823, 4824, 4825}, getTileInfo(getThingPos(cid)).itemid) then
setPlayerStorageValue(cid, 63215, -1)
doChangeSpeed(cid, PlayerSpeed)
doRemoveCondition(cid, CONDITION_OUTFIT)
return true
end
local item = getPlayerSlotItem(cid, 8)
local poke = getItemAttribute(item.uid, "poke")
doSetCreatureOutfit(cid, {lookType = surf[poke].lookType + 351}, -1)
doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
elseif getPlayerStorageValue(cid, 17001) >= 1 then -- ride
local item = getPlayerSlotItem(cid, 8)
local poke = getItemAttribute(item.uid, "poke")
if rides[poke] then
doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
doRemoveCondition(cid, CONDITION_OUTFIT)
doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1)
else
setPlayerStorageValue(cid, 17001, -1)
doChangeSpeed(cid, PlayerSpeed)
end
elseif getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 7 then
doChangeSpeed(cid, 140*getPlayerGroupId(cid))
else
doChangeSpeed(cid, PlayerSpeed)
end
return true
end
Nao creio que seja sobre ele estar offline pois entro na account list, e o firewall tambem estaria de boa pois ontem estava com 58 on!
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

Não vi nada de errado no seu script. Me diga uma coisa, seu IP Externo muda todo dia? Ou é compartilhada?
info
Grupo: Conde
Registrado: 13/12/11
Posts: 619
Reputação: +44

Tipo, minha net e compartilhada e talz.... Tenho que ver todo dia se ta certo o ip do cmd la 192.... e verificar no roteador...
O Ip "movel" muda todo dia, ai eu vo no no ip e crio todo dia que vou abrir o ot dnv o ip igual.
info
Grupo: Lorde
Registrado: 05/06/12
Posts: 2.2k
Reputação: +215
Gênero: Masculino

Se você usa client normal, use Hex Editor para mudar o client pelo do No-Ip, se você usa OtClient, é so usar o Ip normalmente do No-Ip, mas você tem que baixar o DUC se vc add seu server no No-Ip, e liga-lo antes do Server.
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

Cara, qual seu roteador? Exclui as portas 7171 e 7172 e abre de novo. Aqui já aconteceu isso no meu próprio server rsrs!
info
Grupo: Conde
Registrado: 13/12/11
Posts: 619
Reputação: +44

Agora que prestei atençao, aqui no console aparece este erro no creaturescripts!
[08/12/2012 13:07:12] [Error - CreatureScript Interface] [08/12/2012 13:07:13] In a timer event called from: [08/12/2012 13:07:13] data/creaturescripts/scripts/spawn.lua:onSpawn [08/12/2012 13:07:13] Description: [08/12/2012 13:07:13] data/lib/level system.lua:590: attempt to index field '?' (a nil value) [08/12/2012 13:07:13] stack traceback: [08/12/2012 13:07:13] data/lib/level system.lua:590: in function 'setWildPokemonLevel' [08/12/2012 13:07:13] data/creaturescripts/scripts/spawn.lua:23: in function <data/creaturescripts/scripts/spawn.lua:20> [08/12/2012 13:07:13] [Error - CreatureScript Interface] [08/12/2012 13:07:13] In a timer event called from: [08/12/2012 13:07:13] data/creaturescripts/scripts/spawn.lua:onSpawn [08/12/2012 13:07:13] Description: [08/12/2012 13:07:13] data/lib/level system.lua:590: attempt to index field '?' (a nil value) [08/12/2012 13:07:13] stack traceback: [08/12/2012 13:07:13] data/lib/level system.lua:590: in function 'setWildPokemonLevel' [08/12/2012 13:07:13] data/creaturescripts/scripts/spawn.lua:23: in function <data/creaturescripts/scripts/spawn.lua:20>
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

Abre um spoiler com o arquivo data/creaturescripts/spawn e o arquivo data/lib/ level system, OK?
Editado Dezembro 8 por Roksas
info
Grupo: Conde
Registrado: 13/12/11
Posts: 619
Reputação: +44

Level system
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 a = "data/monster/pokes/"..name..".xml"
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[300] then
givePokemonExp(cid, item, leveltable[300] - 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)
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[300] then
givePokemonExpInBp(cid, item, leveltable[300] - 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, 300 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 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 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 = 0
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
local burn = getItemAttribute(item, "burn")
if burn and burn >= 0 then
addEvent(doAdvancedBurn, 5000, pk, pk, getItemAttribute(item, "burndmg"), burn - 1)
end
local poison = getItemAttribute(item, "poison")
if poison and poison >= 0 then
addEvent(doAdvancedPoison, 2500, pk, pk, getItemAttribute(item, "poisondmg"), poison - 1)
end
if getItemAttribute(item, "confuse") and getItemAttribute(item, "confuse") >= 1 then
addEvent(doAdvancedConfuse, 1200, pk, getItemAttribute(item, "confuse"), getPlayerStorageValue(pk, 3891))
end
if getItemAttribute(item, "blind") and getItemAttribute(item, "blind") >= 1 then
addEvent(doBlind, 300, pk, getItemAttribute(item, "blind"), getItemAttribute(item, "blindef"))
end
if getItemAttribute(item, "sleep") and getItemAttribute(item, "sleep") >= 1 then
doSleep(pk, getItemAttribute(item, "sleep"))
end
end
return true
end
function setWildPokemonLevel(cid, optionalLevel, optionalStatus, optionalNick, optionalExtraExp)
if not isCreature(cid) then return true end
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
if optionalLevel <= 300 then
levelRange = optionalLevel
else
levelRange = 300
end
elseif getCreatureOutfit(cid).lookHead and getCreatureOutfit(cid).lookBody and getCreatureOutfit(cid).lookHead <= getCreatureOutfit(cid).lookBody then
levelRange = math.random(getCreatureOutfit(cid).lookHead, getCreatureOutfit(cid).lookBody)
else
levelRange = math.random(20, 30)
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)
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)
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 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
return getItemAttribute(item.uid, "nick")
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 getPokemonLevel(cid)
if not isCreature(cid) then return 0 end
return getPlayerStorageValue(cid, 1000)
end
function getPokemonGender(cid)
return getCreatureSkullType(cid)
end
spawn.lua
local shinys = {
"Caterpie", "Venusaur", "Charizard", "Blastoise", "Metapod", "Butterfree", "Weedle", "Kakuna", "Beedrill", "Pidgey", "Pidgeotto", "Pidgeot", "Rattata",
"Raticate", "Spearow", "Fearow", "Ekans", "Arbok", "Pikachu", "Raichu", "Sandshrew", "Sandslash", "Nidoran Female",
"Nidorina", "Nidoqueen", "Nidoran Male", "Nidorino", "Nidoking", "Clefairy", "Clefable", "Vulpix", "Ninetales",
"Jigglypuff", "Wigglytuff", "Zubat", "Golbat", "Oddish", "Gloom", "Vileplume", "Paras", "Parasect", "Venonat", "Venomoth",
"Diglett", "Dugtrio", "Meowth", "Persian", "Psyduck", "Golduck", "Mankey", "Primeape", "Growlithe", "Arcanine",
"Poliwhirl", "Poliwrath", "Machop", "Machoke", "Machamp", "Bellsprout", "Weepinbell", "Victreebel",
"Tentacruel", "Geodude", "Graveler", "Golem", "Ponyta", "Rapidash", "Slowpoke", "Slowbro", "Magnemite", "Magneton",
"Farfetch'd", "Doduo", "Dodrio", "Seel", "Dewgong", "Grimer", "Muk", "Shellder", "Cloyster", "Onix", "Drowzee", "Hypno",
"Krabby", "Kingler", "Voltorb", "Electrode", "Exeggcute", "Exeggutor", "Cubone", "Marowak", "Hitmonlee", "Hitmonchan",
"Lickitung", "Koffing", "Weezing", "Rhyhorn", "Rhydon", "Tangela", "Horsea", "Seadra", "Goldeen",
"Seaking", "Staryu", "Starmie", "Mr. Mime", "Pinsir", "Tauros", "Gyarados", "Lapras", "Ditto", "Vaporeon", "Jolteon",
"Flareon", "Porygon", "Kadabra", "Omanyte", "Magikarp", "Jynx", "Poliwag", "Tentacool", "Haunter", "Chansey", "Ivysaur",
"Charmeleon", "Dragonair", "Wartortle", "Snorlax", "Omastar", "Dragonite", "Gengar", "Alakazam", "Electabuzz", "Magmar", "Kabuto", "Kabutops"
}
local raros = {"Bulbasaur", "Charmander", "Squirtle",
"Dratini", "Eevee", "Scyther", "Gastly", "Kangaskhan",
"Abra", "Articuno", "Zapdos", "Moltres", "Mew", "Mewtwo", "Aerodactyl"}
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 isNpcSummon(cid) then return true end
if isInArray(shinys, getCreatureName(cid)) then
transform = math.random(6, 100) --6% chance
elseif isInArray(raros, getCreatureName(cid)) then
transform = math.random(1, 100) --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, "GeneralConfiguration")
registerCreatureEvent(cid, "DirectionSystem")
registerCreatureEvent(cid, "CastSystem")
if isSummon(cid) then
registerCreatureEvent(cid, "SummonDeath")
return true
end
registerCreatureEvent(cid, "Experience")
addEvent(doPokemonRegisterLevel, 5, cid)
addEvent(doSetRandomGender, 5, cid)
addEvent(doShiny, 10, cid)
return true
end
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

Eu não entendo de pokémon. Então não conheço outra função para substituir a "setWildPokemonLevel"! O problema é esse mesmo, você precisa substituir essa função. Mas olhe, se antes você conseguia entrar.. Esse script você colocou hoje então né?




info
Grupo: Conde
Registrado: 13/12/11
Posts: 619
Reputação: +44
Olá galera, ontem fiz um servidor de pokemon... O servidor bombom! Em menos de 2h tinha 58 online, o novo SvPe.
Estava tudo bem, mas hoje quando vou abrir... Entro na account list, mas quando vou entrar no carinha para logar ele nao entra. Da um tempo e depois da failed.
Por favor me ajudem!