No meu Ot quando dá ride,fly ou surf dá um bug que os jogadores quando deslogam usando ride,fly ou surf não dão mais para entrar.
Login.lua :
local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}
function onLogin(cid)
registerCreatureEvent(cid, "PlayerAttack")
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)
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 .. " Have fun! "
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(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end
local flys = {
[265] = {229, 2300, 350}, -- moltres
[283] = {230, 2100, 350}, -- artic
[199] = {224, 2600, 350}, -- zapdos
[9] = {232, 2200, 525}, -- 1000
[34] = {233, 2200, 525},-- two
[210] = {221, 1300, 410},-- nite
[80] = {222, 900, 375}, -- geot
[17] = {226, 800, 400}, -- fearow
[10] = {227, 1100, 410}, -- aero
[67] = {216, 1000, 410}, -- chari
[97] = {316, 600, 440}, -- porygon
[593] = {679, 900, 440}, -- porygon2
[604] = {682, 900, 440}, -- skarmory
[544] = {662, 800, 420}, -- crobat
[563] = {784, 800, 420}, -- ho oh
[766] = {854, 800, 420}, -- deoxys
[1007] = {1127, 2600, 350}, -- shaymin-sky
[294] = {295, 800, 420}, -- elder charizard
[824] = {1164, 800, 420}, -- shiny nite
[919] = {1165, 800, 420}, -- shiny pory
[921] = {1167, 800, 420}, -- shiny aero
[922] = {1168, 800, 420}, -- shiny arti
[801] = {1169, 800, 420}, -- shiny fear
[805] = {1170, 800, 420}, -- shiny 1000
[806] = {1171, 800, 420}, -- shiny two
[990] = {1172, 800, 420}, -- staraptor
[1017] = {1173, 800, 420}, -- tropius
[1124] = {1174, 800, 420}, -- shiny zap
[586] = {884, 800, 420}, -- nocto
[481] = {482, 800, 420}, -- shiny ot
[1058] = {330, 800, 420}, -- altaria
[962] = {331, 800, 420}, -- flygon
[796] = {332, 800, 420}, -- sala
[371] = {334, 800, 420}, -- swel
[539] = {1207, 800, 420}, -- celebi
[399] = {333, 800, 420}, -- pelipe
[15] = {415, 1800, 420}, -- scyther
[244] = {410, 1800, 420}, -- gengar
[561] = {411, 1800, 420}, -- heracross
[1067] = {412, 1800, 420}, -- shiny gengar
[658] = {446, 1800, 420}, -- xatu
}
local rides = {
[93] = {128, 780, 400}, -- tauros
[114] = {129, 800, 375}, -- ninetales
[220] = {130, 800, 395}, -- rapid
[16] = {131, 410, 500}, -- ponyta
[77] = {132, 400, 510}, -- rhyhorn
[88] = {12, 900, 390}, -- arcan
[493] = {492, 1000, 360}, -- shiny arca
[496] = {494, 420, 420}, -- shiny venu
[292] = {293, 480, 430}, -- cristal onix
[248] = {126, 450, 450}, -- onix
[22] = {134, 390, 450}, -- venu
[120] = {133, 750, 380}, -- dodrio
[26] = {135, 420, 500}, -- doduo
[558] = {667, 1000, 360}, -- girafarig
[581] = {674, 1000, 360}, -- meganium
[613] = {684, 1000, 360}, -- stantler
[590] = {677, 900, 440}, -- piloswine
[579] = {672, 900, 440}, -- mareep
[61] = {665, 900, 440}, -- dragonair
[566] = {669, 900, 440}, -- houndoom
[552] = {793, 900, 440}, -- entei
[616] = {795, 900, 440}, -- suicune
[599] = {794, 900, 440}, -- raikou
[61] = {775, 900, 440}, -- dragonair
[839] = {1175, 900, 440}, -- absol
[1083] = {1176, 900, 440}, -- luxray
[871] = {1177, 900, 440}, -- mamosw
[808] = {1179, 900, 440}, -- shiny nine
[928] = {1180, 900, 440}, -- shiny pony
[929] = {1181, 900, 440}, -- shiny rapi
[534] = {883, 900, 440}, -- ariados
[788] = {353, 800, 420}, -- lai
[1123] = {354, 800, 420}, -- mane
[1118] = {355, 800, 420}, -- came
[797] = {356, 800, 420}, -- she
}
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},
["Red Gyarados"] = {lookType=529, speed = 1500},
["Shiny Blastoise"] = {lookType=523, speed = 1350},
["Shiny Tentacool"] = {lookType=503, speed = 840},
["Shiny Tentacruel"] = {lookType=490, speed = 1440},
["Wooper"] = {lookType=686, speed = 350},
["Totodile"] = {lookType=685, speed = 365},
["Quaqsire"] = {lookType=680, speed = 600},
["Octillery"] = {lookType=676, speed = 605},
["Marill"] = {lookType=673, speed = 320},
["Kingdra"] = {lookType=670, speed = 610},
["Feraligatr"] = {lookType=666, speed = 848},
["Croconaw"] = {lookType=663, speed = 607},
["Azumarill"] = {lookType=660, speed = 604},
["Marshtomp"] = {lookType=1183, speed = 604},
["Best Red Gyarados"] = {lookType=1184, speed = 2000},
["Floatzel"] = {lookType=1185, speed = 800},
["Luvdisc"] = {lookType=363, speed = 200},
["Gorebyss"] = {lookType=364, speed = 600},
["Huntail"] = {lookType=365, speed = 600},
["Linoone"] = {lookType=366, speed = 220},
["Mudkip"] = {lookType=367, speed = 100},
["Relicanth"] = {lookType=368, speed = 400},
["Walmer"] = {lookType=369, speed = 600},
["Whiscash"] = {lookType=370, speed = 400},
["Ludicolo"] = {lookType=370, speed = 403},
}
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "PlayerPokeDeath")
registerCreatureEvent(cid, "LogoutPoke")
registerCreatureEvent(cid, "WildAttack")
registerCreatureEvent(cid, "Idle")
registerCreatureEvent(cid, "Tele")
registerCreatureEvent(cid, "Exp")
registerCreatureEvent(cid, "Alook")
if getPlayerStorageValue(cid, 61207) >= 1 then
setPlayerStorageValue(cid, 61207, 0)
if getPlayerSlotItem(cid, 8).itemid == 2223 or getPlayerSlotItem(cid, 8).itemid == 2221 or getPlayerSlotItem(cid, 8).itemid == 2652 or getPlayerSlotItem(cid, 8).itemid == 2654 or getPlayerSlotItem(cid, 8).itemid == 2656 or getPlayerSlotItem(cid, 8).itemid == 11625 or getPlayerSlotItem(cid, 8).itemid == 11622 or getPlayerSlotItem(cid, 8).itemid == 11628 or getPlayerSlotItem(cid, 8).itemid == 11619 then
doTransformItem(getPlayerSlotItem(cid, 8).uid, getPlayerSlotItem(cid, 8).itemid-1)
end
local item = getPlayerSlotItem(cid, 8)
doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
end
if getPlayerItemCount(cid, pokeout) >= 1 and getPlayerStorageValue(cid, 61207) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
local item = getPlayerItemById(cid, TRUE, pokeout)
doTransformItem(item.uid, pokein)
doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
end
if getPlayerItemCount(cid, ultrapokeout) >= 1 and getPlayerStorageValue(cid, 61207) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
local item = getPlayerItemById(cid, TRUE, ultrapokeout)
doTransformItem(item.uid, ultrapokein)
doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
end
if getPlayerItemCount(cid, greatout) >= 1 and getPlayerStorageValue(cid, 61207) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
local item = getPlayerItemById(cid, TRUE, greatout)
doTransformItem(item.uid, greatin)
doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
end
if getPlayerItemCount(cid, superout) >= 1 and getPlayerStorageValue(cid, 61207) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
local item = getPlayerItemById(cid, TRUE, superout)
doTransformItem(item.uid, superin)
doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
end
if getPlayerItemCount(cid, saffariout) >= 1 and getPlayerStorageValue(cid, 61207) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
local item = getPlayerItemById(cid, TRUE, saffariout)
doTransformItem(item.uid, saffariin)
doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
end
doChangeSpeed(cid, -(getCreatureSpeed(cid)))
if getPlayerStorageValue(cid, 17000) >= 1 then
item = getPlayerSlotItem(cid, 8)
poke = getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")
doChangeSpeed(cid, flys[poke][2])
registerCreatureEvent(cid, "Flying")
doRemoveCondition(cid, CONDITION_OUTFIT)
doSetCreatureOutfit(cid, {lookType = flys[poke][1], lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
elseif getPlayerStorageValue(cid, 63215) >= 1 then
item = getPlayerSlotItem(cid, 8)
poke = getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")
doSetCreatureOutfit(cid, surf[poke], -1)
doChangeSpeed(cid, surf[poke].speed)
elseif getPlayerStorageValue(cid, 17001) >= 1 then
item = getPlayerSlotItem(cid, 8)
poke = getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")
doChangeSpeed(cid, rides[poke][2])
doRemoveCondition(cid, CONDITION_OUTFIT)
doSetCreatureOutfit(cid, {lookType = rides[poke][1], lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
else
if getPlayerGroupId(cid) >= 2 and getPlayerGroupId(cid) <= 7 then
doChangeSpeed(cid, 400*getPlayerGroupId(cid))
else
doChangeSpeed(cid, 250)
end
end
if getPlayerVocation(cid) == 0 then
doPlayerSetVocation(cid, 1)
setCreatureMaxMana(cid, 6)
doPlayerAddSoul(cid, -getPlayerSoul(cid))
setPlayerStorageValue(cid, 19898, 0)
end
if getCreatureOutfit(cid).lookType == 128 then
outfit = {lookType = 159}
doCreatureChangeOutfit(cid, outfit)
elseif getCreatureOutfit(cid).lookType == 136 then
outfit = {lookType = 160}
doCreatureChangeOutfit(cid, outfit)
end
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "NPC")
return true
end