Ir para conteúdo

Addon System [PDE]


Refe

Posts Recomendados

  • 1 month later...
[19/03/2016 12:11:50] [Error - LuaScriptInterface::loadFile] data/actions/scripts/addon.lua:3: ']' expected near 'DO'

[19/03/2016 12:11:50] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/addon.lua)

[19/03/2016 12:11:50] data/actions/scripts/addon.lua:3: ']' expected near 'DO'

[19/03/2016 12:11:52] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/login.lua:1: '=' expected near 'config'

[19/03/2016 12:11:52] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/login.lua)

[19/03/2016 12:11:52] data/creaturescripts/scripts/login.lua:1: '=' expected near 'config'


Poderia me ajudar????

Link para o comentário
Compartilhar em outros sites

 

[19/03/2016 12:11:50] [Error - LuaScriptInterface::loadFile] data/actions/scripts/addon.lua:3: ']' expected near 'DO'

[19/03/2016 12:11:50] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/addon.lua)

[19/03/2016 12:11:50] data/actions/scripts/addon.lua:3: ']' expected near 'DO'

[19/03/2016 12:11:52] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/login.lua:1: '=' expected near 'config'

[19/03/2016 12:11:52] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/login.lua)

[19/03/2016 12:11:52] data/creaturescripts/scripts/login.lua:1: '=' expected near 'config'

 

Poderia me ajudar????

Me manda o addon e login
Link para o comentário
Compartilhar em outros sites

Desculpe caro amigo.

Tal erro foi ocasionado por falha minha, ou melhor BURRICE KK.

o erro do addon foi na parte ID "DO" ADDON.

O do login uma letra que faltava mas muito obrigado.

Link para o comentário
Compartilhar em outros sites

  • 3 months later...

Complicado d++ esse code '-'

 

Eu consegui fazer um melhorzin com + funcionalidades e usando apenas 1 atributo.

 

Mas já que você postou toma aí seu rep ^^

Link para o comentário
Compartilhar em outros sites

Parabéns cara, belo sistema!

 

Mas achei algumas correções que podem ser feitas, já tentei mas até agora nada.

 

Quando um pokemon está usando outfit e recebe a spell de sleeping, ao voltar do sleeping ele perde a outfit.

 

Ao usar spell "ExtremeSpeed" do arcanine, que no caso faz com que o Summon desapareça, ao aparecer novamente ele perde a outfit também, scyther a mesma coisa.

 

Caso você consiga concertar, favor, postar que irei dar REP++. 

 

Grato desde já.

 

Editado por lucasmourahere
Link para o comentário
Compartilhar em outros sites

  • 11 months later...

Desculpe reviver o tópico mas caso alguém for usar modifique o surf.lua na parte em que faz duas verificações, onde uma é caso ele não há addon e a outra caso ele há addon, super desnecessário e bugou o script. só funcionando o surf com addon.

 

em baixo de : 

 

Spoiler

if getPlayerStorageValue(cid, 6598754) == 1 or getPlayerStorageValue(cid, 6598755) == 1 then
doPlayerSendCancel(cid, "You can't do it while in the PVP Zone!")   --alterado v2.7
doTeleportThing(cid, fromPosition, false)
return true
end

 

Substitua a função em baixo por: 

 

Spoiler

local addonsurf = getPlayerSlotItem(cid, 8).uid
local addosurf = getItemAttribute(addonsurf,"addonsurf")
if addosurf > 0 then
doSetCreatureOutfit(cid, {lookType = addosurf}, -1)
end
doSetCreatureOutfit(cid, {lookType = surfs[getPokemonName(getCreatureSummons(cid)[1])].lookType + 351}, -1)
doCreatureSay(cid, ""..getPokeName(getCreatureSummons(cid)[1])..", lets surf!", 1)
doChangeSpeed(cid, -(getCreatureSpeed(cid)))

 

caso não consiga só mude para esse surf.lua: 

 

Spoiler

local function doSendMagicEffecte(pos, effect)
  addEvent(doSendMagicEffect, 50, pos, effect)
end
local waters = {11756, 4614, 4615, 4616, 4617, 4618, 4619, 4608, 4609, 4610, 4611, 4612, 4613, 7236, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825}
--alterado v2.5
local flie = {'11756', '4614', '4615', '4616', '4617', '4618', '4619', '4608', '4609', '4610', '4611', '4612', '4613', '7236', '4614', '4615', '4616', '4617', '4618', '4619', '4620', '4621', '4622', '4623', '4624', '4625', '4665', '4666', '4820', '4821', '4822', '4823', '4824', '4825'}
--alterado v2.6 tabela agora em configuration.lua!
local premium = false
function onStepIn(cid, item, position, fromPosition)
  if not isPlayer(cid) or isInArray({5, 6}, getPlayerGroupId(cid)) then --alterado v2.9
  return true
end
if getPlayerStorageValue(cid, 75846) >= 1 then return true end   --alterado v2.9
if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV
if isPlayer(cid) and not isPremium(cid) and premium == true then
  doTeleportThing(cid, fromPosition, true)
  doPlayerSendCancel(cid, "Only premium members are allowed to surf.")
  return true
end
if getCreatureOutfit(cid).lookType == 316 or getCreatureOutfit(cid).lookType == 648 then
  doSendMagicEffect(fromPosition, 136)
end
if (getPlayerStorageValue(cid, 63215) >= 1 or getPlayerStorageValue(cid, 17000) >= 1) then
  return true
end
if #getCreatureSummons(cid) == 0 then
  doPlayerSendCancel(cid, "You need a pokemon to surf.")
  doTeleportThing(cid, fromPosition, false)
  return true
end
if (not isInArray(specialabilities["surf"], getPokemonName(getCreatureSummons(cid)[1]))) then  --alterado v2.6
doPlayerSendCancel(cid, "This pokemon cannot surf.")
doTeleportThing(cid, fromPosition, false)
return true
end
if getPlayerStorageValue(cid, 5700) == 1 then
doPlayerSendCancel(cid, "You can't do that while is mount in a bike!")
doTeleportThing(cid, fromPosition, false)
return true
end
if getPlayerStorageValue(cid, 212124) >= 1 then         --alterado v2.6
doPlayerSendCancel(cid, "You can't do it with a pokemon with mind controlled!")
doTeleportThing(cid, fromPosition, false)
return true
end
if getPlayerStorageValue(cid, 52480) >= 1 then
doPlayerSendCancel(cid, "You can't do it while a duel!")  --alterado v2.6
doTeleportThing(cid, fromPosition, false)
return true
end
if getPlayerStorageValue(cid, 6598754) == 1 or getPlayerStorageValue(cid, 6598755) == 1 then
doPlayerSendCancel(cid, "You can't do it while in the PVP Zone!")   --alterado v2.7
doTeleportThing(cid, fromPosition, false)
return true
end
local addonsurf = getPlayerSlotItem(cid, 8).uid
local addosurf = getItemAttribute(addonsurf,"addonsurf")
doSetCreatureOutfit(cid, {lookType = surfs[getPokemonName(getCreatureSummons(cid)[1])].lookType + 351}, -1)

if addosurf > 0 then
doSetCreatureOutfit(cid, {lookType = addosurf}, -1)

end
doCreatureSay(cid, ""..getPokeName(getCreatureSummons(cid)[1])..", lets surf!", 1)
doChangeSpeed(cid, -(getCreatureSpeed(cid)))
local speed = 75 + PlayerSpeed + getSpeed(getCreatureSummons(cid)[1]) * 8 * speedRate
setPlayerStorageValue(cid, 54844, speed)
doChangeSpeed(cid, speed)
local pct = getCreatureHealth(getCreatureSummons(cid)[1]) / getCreatureMaxHealth(getCreatureSummons(cid)[1])
local item = getPlayerSlotItem(cid, 8)  --alterado v2.8
doItemSetAttribute(item.uid, "hp", pct)
doRemoveCreature(getCreatureSummons(cid)[1])
if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) <= 0 then
addEvent(sendAuraEffect, 120, cid, auraSyst[getItemAttribute(item.uid, "aura")])    --alterado v2.8
end
if useOTClient then
doPlayerSendCancel(cid, '12//,hide') --alterado v1.8
end

addEvent(setPlayerStorageValue, 100, cid, 63215, 1)
return true
end
local direffects = {30, 49, 9, 51}
function onStepOut(cid, item, position, fromPosition)
if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end
local checkpos = fromPosition
checkpos.stackpos = 0
if isInArray(waters, getTileInfo(checkpos).itemid) then
if getPlayerStorageValue(cid, 63215) >= 1 or getPlayerStorageValue(cid, 17000) >= 1 then
doSendMagicEffecte(fromPosition, direffects[getCreatureLookDir(cid) + 1])
end
end
if not isInArray(waters, getTileInfo(getThingPos(cid)).itemid) then
if getPlayerStorageValue(cid, 17000) >= 1 then return true end
if getPlayerStorageValue(cid, 63215) <= 0 then return true end
doRemoveCondition(cid, CONDITION_OUTFIT)
setPlayerStorageValue(cid, 63215, -1)
local item = getPlayerSlotItem(cid, 8)
local pokemon = getItemAttribute(item.uid, "poke")
local x = pokes[pokemon]
if not x then return true end
if getItemAttribute(item.uid, "nick") then
doCreatureSay(cid, getItemAttribute(item.uid, "nick")..", I'm tired of surfing!", 1)
else
doCreatureSay(cid, getItemAttribute(item.uid, "poke")..", I'm tired of surfing!", 1)
end
doSummonMonster(cid, pokemon)
local pk = getCreatureSummons(cid)[1]
local balla = getPlayerSlotItem(cid, 8).uid
local balladdon = getItemAttribute(balla,"addon")
if not balladdon then
doSetItemAttribute(balla,"addon",0)
end
if balladdon > 0 then
doSetCreatureOutfit(pk, {lookType = balladdon}, -1)
end
local pk = getCreatureSummons(cid)[1]
if not isCreature(pk) then
pk = doCreateMonster(pokemon, backupPos)
if not isCreature(pk) then
  doPlayerSendCancel(cid, "You can't stop surfing here.")
  doTeleportThing(cid, fromPosition, false)
  return true
end
doConvinceCreature(cid, pk)
end
doChangeSpeed(pk, getCreatureSpeed(cid))
doChangeSpeed(cid, -getCreatureSpeed(cid))
doRegainSpeed(cid)      --alterado v2.6
doTeleportThing(pk, fromPosition, false)
doTeleportThing(pk, getThingPos(cid), true)
doCreatureSetLookDir(pk, getCreatureLookDir(cid))
adjustStatus(pk, item.uid, true, false, true)
if useOTClient then
doPlayerSendCancel(cid, '12//,show') --alterado v2.8
end
end
return true
end

 

agora no fly tem o mesmo bug por conta da verificação ao deslogar sem o addon ele buga você no fly mas com o addon tudo ocorre perfeitamente. 

 

correção Login.lua

Spoiler

local config = {
  loginMessage = getConfigValue('loginMessage'),
  useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

--alterado v2.6 tabelas soh em lib/configuration.lua;

function onLogin(cid)

  if getPlayerLevel(cid) >= 1 and getPlayerLevel(cid) <= 10 then   --alterado v2.8
  doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)
else
  doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, (getPlayerLevel(cid) >= 200 and 100 or math.floor(getPlayerLevel(cid)/2)) )
end
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_CONSOLE_ORANGE, 'Bem vindo ao pokemon Hp, Treinador! .')


  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, 7)
  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, "experience")
registerCreatureEvent(cid, "dropStone")  
registerCreatureEvent(cid, "Player_Logout")
registerCreatureEvent(cid, "ShowPokedex") 
registerCreatureEvent(cid, "ClosePokedex")
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, "reward")
registerCreatureEvent(cid, "GeneralConfiguration")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "LookSystem")
registerCreatureEvent(cid, "T1")
registerCreatureEvent(cid, "T2")
registerCreatureEvent(cid, "ll1")
registerCreatureEvent(cid, "task_count")
registerCreatureEvent(cid, "ctff")
registerCreatureEvent(cid, "ctfd")
registerCreatureEvent(cid, "task")
registerCreatureEvent(cid, "dota")
registerCreatureEvent(cid, "atk")
registerCreatureEvent(cid, "balance")

registerCreatureEvent(cid, "aloot_kill")
if getPlayerStorageValue(cid, 99284) == 1 then
  setPlayerStorageValue(cid, 99284, -1)
end

if getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then
  setPlayerStorageValue(cid, 6598754, -1)
  setPlayerStorageValue(cid, 6598755, -1)
  doRemoveCondition(cid, CONDITION_OUTFIT)             --alterado v2.9 \/
  doTeleportThing(cid, posBackPVP, false)
  doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
end

doChangeSpeed(cid, -(getCreatureSpeed(cid)))

--///////////////////////////////////////////////////////////////////////////--
local storages = {17000, 63215, 17001, 13008, 5700}
for s = 1, #storages do
  if not tonumber(getPlayerStorageValue(cid, storages)) then
    if s == 3 then
      setPlayerStorageValue(cid, storages, 1)
    elseif s == 4 then
      setPlayerStorageValue(cid, storages, -1)
    else
      if isBeingUsed(getPlayerSlotItem(cid, 8).itemid) then
        setPlayerStorageValue(cid, storages, 1)                 --alterado v2.6
      else
        setPlayerStorageValue(cid, storages, -1)
      end
    end
    doPlayerSendTextMessage(cid, 27, "Sorry, but a problem occurred on the server, but now it's alright")
  end
end
--/////////////////////////////////////////////////////////////////////////--

if getPlayerStorageValue(cid, 17000) >= 1 then -- fly

local item = getPlayerSlotItem(cid, 8)
if item.itemid <= 0 then
  setPlayerStorageValue(cid, 17000, -1)
  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
  return true
end
local poke = getItemAttribute(item.uid, "poke")
doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
doRemoveCondition(cid, CONDITION_OUTFIT)
local addonfly = getPlayerSlotItem(cid, 8).uid
local addofly = getItemAttribute(addonfly,"addonfly")
if not addofly then
  doSetItemAttribute(addonfly,"addonfly",0)
  doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1)

end
doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1)
if addofly > 0 then
  doSetCreatureOutfit(cid, {lookType = addofly}, -1)
end
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)
if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then
  sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")])                     --alterado v2.8
end

local posicao = getTownTemplePosition(getPlayerTown(cid))
markFlyingPos(cid, posicao)

elseif getPlayerStorageValue(cid, 63215) >= 1 then -- surf

local item = getPlayerSlotItem(cid, 8)
if item.itemid <= 0 then
  setPlayerStorageValue(cid, 63215, -1)
  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
  return true
end
local poke = getItemAttribute(item.uid, "poke")
local addonsurf = getPlayerSlotItem(cid, 8).uid
local addosurf = getItemAttribute(addonsurf,"addonsurf")
if not addosurf then
  doSetItemAttribute(addonsurf,"addonsurf",0)
  doSetCreatureOutfit(cid, {lookType = surfs[poke].lookType + 351}, -1)

end
if addosurf > 0 then
  doSetCreatureOutfit(cid, {lookType = addosurf}, -1)

end
doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then
  sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")])                     --alterado v2.8
end

elseif getPlayerStorageValue(cid, 17001) >= 1 then -- ride

local item = getPlayerSlotItem(cid, 8)
if item.itemid <= 0 then
  setPlayerStorageValue(cid, 17001, -1)
  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
  return true
end
local poke = getItemAttribute(item.uid, "poke")


if rides[poke] then
  doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
  doRemoveCondition(cid, CONDITION_OUTFIT)
  local addonride = getPlayerSlotItem(cid, 8).uid
  local addoride = getItemAttribute(addonride,"addonride")
  if not addofly then
    doSetItemAttribute(addonride,"addonride",0)
    doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1)

  end
  if addoride > 0 then
    doSetCreatureOutfit(cid, {lookType = addoride}, -1)

  end
  if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then
    sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")])                     --alterado v2.8
  end
else
  setPlayerStorageValue(cid, 17001, -1)
  doRegainSpeed(cid)   --alterado v2.6
end

local posicao2 = getTownTemplePosition(getPlayerTown(cid))
markFlyingPos(cid, posicao2)

elseif getPlayerStorageValue(cid, 13008) >= 1 then -- dive
if not isInArray({5405, 5406, 5407, 5408, 5409, 5410}, getTileInfo(getThingPos(cid)).itemid) then
  setPlayerStorageValue(cid, 13008, 0)
  doRegainSpeed(cid)              --alterado v2.6
  doRemoveCondition(cid, CONDITION_OUTFIT)
  return true
end

if getPlayerSex(cid) == 1 then
  doSetCreatureOutfit(cid, {lookType = 1034, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
else
  doSetCreatureOutfit(cid, {lookType = 1035, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
end
doChangeSpeed(cid, 800)

elseif getPlayerStorageValue(cid, 5700) > 0 then   --bike
doChangeSpeed(cid, -getCreatureSpeed(cid))
doChangeSpeed(cid, getPlayerStorageValue(cid, 5700))  --alterado v2.8
if getPlayerSex(cid) == 1 then
  doSetCreatureOutfit(cid, {lookType = 1394}, -1)
else
  doSetCreatureOutfit(cid, {lookType = 1393}, -1)
end
elseif getPlayerStorageValue(cid, 75846) >= 1 then     --alterado v2.9 \/
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
setPlayerStorageValue(cid, 75846, -1)
sendMsgToPlayer(cid, 20, "You have been moved to your town!")
else
doRegainSpeed(cid)  --alterado v2.6
end

if getPlayerStorageValue(cid, 22545) >= 1 then   --golden arena
setPlayerStorageValue(cid, 22545, -1)              --alterado v2.4
doTeleportThing(cid, getClosestFreeTile(cid, posBackGolden), false)
setPlayerRecordWaves(cid)     --alterado v2.7
end

return true
end

 

Atenciosamente: Kevick

 

Dolly @Ceetros atualiza o tópico com a correção se possível.

Editado por Jair Kevick
post bugando com varias linhas no texto
Link para o comentário
Compartilhar em outros sites

Em 2017-6-26 at 04:32, Jair Kevick disse:

Desculpe reviver o tópico mas caso alguém for usar modifique o surf.lua na parte em que faz duas verificações, onde uma é caso ele não há addon e a outra caso ele há addon, super desnecessário e bugou o script. só funcionando o surf com addon.

 

em baixo de : 

 

  Mostrar conteúdo oculto

if getPlayerStorageValue(cid, 6598754) == 1 or getPlayerStorageValue(cid, 6598755) == 1 then

doPlayerSendCancel(cid, "You can't do it while in the PVP Zone!")   --alterado v2.7

doTeleportThing(cid, fromPosition, false)

return true

end

 

Substitua a função em baixo por: 

 

  Mostrar conteúdo oculto

local addonsurf = getPlayerSlotItem(cid, 8).uid

local addosurf = getItemAttribute(addonsurf,"addonsurf")

if addosurf > 0 then

doSetCreatureOutfit(cid, {lookType = addosurf}, -1)

end

doSetCreatureOutfit(cid, {lookType = surfs[getPokemonName(getCreatureSummons(cid)[1])].lookType + 351}, -1)

doCreatureSay(cid, ""..getPokeName(getCreatureSummons(cid)[1])..", lets surf!", 1)

doChangeSpeed(cid, -(getCreatureSpeed(cid)))

 

caso não consiga só mude para esse surf.lua: 

 

  Mostrar conteúdo oculto

local function doSendMagicEffecte(pos, effect)

  addEvent(doSendMagicEffect, 50, pos, effect)

end

local waters = {11756, 4614, 4615, 4616, 4617, 4618, 4619, 4608, 4609, 4610, 4611, 4612, 4613, 7236, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825}

--alterado v2.5

local flie = {'11756', '4614', '4615', '4616', '4617', '4618', '4619', '4608', '4609', '4610', '4611', '4612', '4613', '7236', '4614', '4615', '4616', '4617', '4618', '4619', '4620', '4621', '4622', '4623', '4624', '4625', '4665', '4666', '4820', '4821', '4822', '4823', '4824', '4825'}

--alterado v2.6 tabela agora em configuration.lua!

local premium = false

function onStepIn(cid, item, position, fromPosition)

  if not isPlayer(cid) or isInArray({5, 6}, getPlayerGroupId(cid)) then --alterado v2.9

  return true

end

if getPlayerStorageValue(cid, 75846) >= 1 then return true end   --alterado v2.9

if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV

if isPlayer(cid) and not isPremium(cid) and premium == true then

  doTeleportThing(cid, fromPosition, true)

  doPlayerSendCancel(cid, "Only premium members are allowed to surf.")

  return true

end

if getCreatureOutfit(cid).lookType == 316 or getCreatureOutfit(cid).lookType == 648 then

  doSendMagicEffect(fromPosition, 136)

end

if (getPlayerStorageValue(cid, 63215) >= 1 or getPlayerStorageValue(cid, 17000) >= 1) then

  return true

end

if #getCreatureSummons(cid) == 0 then

  doPlayerSendCancel(cid, "You need a pokemon to surf.")

  doTeleportThing(cid, fromPosition, false)

  return true

end

if (not isInArray(specialabilities["surf"], getPokemonName(getCreatureSummons(cid)[1]))) then  --alterado v2.6

doPlayerSendCancel(cid, "This pokemon cannot surf.")

doTeleportThing(cid, fromPosition, false)

return true

end

if getPlayerStorageValue(cid, 5700) == 1 then

doPlayerSendCancel(cid, "You can't do that while is mount in a bike!")

doTeleportThing(cid, fromPosition, false)

return true

end

if getPlayerStorageValue(cid, 212124) >= 1 then         --alterado v2.6

doPlayerSendCancel(cid, "You can't do it with a pokemon with mind controlled!")

doTeleportThing(cid, fromPosition, false)

return true

end

if getPlayerStorageValue(cid, 52480) >= 1 then

doPlayerSendCancel(cid, "You can't do it while a duel!")  --alterado v2.6

doTeleportThing(cid, fromPosition, false)

return true

end

if getPlayerStorageValue(cid, 6598754) == 1 or getPlayerStorageValue(cid, 6598755) == 1 then

doPlayerSendCancel(cid, "You can't do it while in the PVP Zone!")   --alterado v2.7

doTeleportThing(cid, fromPosition, false)

return true

end

local addonsurf = getPlayerSlotItem(cid, 8).uid

local addosurf = getItemAttribute(addonsurf,"addonsurf")

if addosurf > 0 then

doSetCreatureOutfit(cid, {lookType = addosurf}, -1)

end

doSetCreatureOutfit(cid, {lookType = surfs[getPokemonName(getCreatureSummons(cid)[1])].lookType + 351}, -1)

doCreatureSay(cid, ""..getPokeName(getCreatureSummons(cid)[1])..", lets surf!", 1)

doChangeSpeed(cid, -(getCreatureSpeed(cid)))

local speed = 75 + PlayerSpeed + getSpeed(getCreatureSummons(cid)[1]) * 8 * speedRate

setPlayerStorageValue(cid, 54844, speed)

doChangeSpeed(cid, speed)

local pct = getCreatureHealth(getCreatureSummons(cid)[1]) / getCreatureMaxHealth(getCreatureSummons(cid)[1])

local item = getPlayerSlotItem(cid, 8)  --alterado v2.8

doItemSetAttribute(item.uid, "hp", pct)

doRemoveCreature(getCreatureSummons(cid)[1])

if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) <= 0 then

addEvent(sendAuraEffect, 120, cid, auraSyst[getItemAttribute(item.uid, "aura")])    --alterado v2.8

end

if useOTClient then

   doPlayerSendCancel(cid, '12//,hide') --alterado v1.8

end

 

addEvent(setPlayerStorageValue, 100, cid, 63215, 1)

return true

end

local direffects = {30, 49, 9, 51}

function onStepOut(cid, item, position, fromPosition)

if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end

local checkpos = fromPosition

checkpos.stackpos = 0

if isInArray(waters, getTileInfo(checkpos).itemid) then

if getPlayerStorageValue(cid, 63215) >= 1 or getPlayerStorageValue(cid, 17000) >= 1 then

doSendMagicEffecte(fromPosition, direffects[getCreatureLookDir(cid) + 1])

end

end

if not isInArray(waters, getTileInfo(getThingPos(cid)).itemid) then

if getPlayerStorageValue(cid, 17000) >= 1 then return true end

if getPlayerStorageValue(cid, 63215) <= 0 then return true end

doRemoveCondition(cid, CONDITION_OUTFIT)

setPlayerStorageValue(cid, 63215, -1)

local item = getPlayerSlotItem(cid, 8)

local pokemon = getItemAttribute(item.uid, "poke")

local x = pokes[pokemon]

if not x then return true end

if getItemAttribute(item.uid, "nick") then

doCreatureSay(cid, getItemAttribute(item.uid, "nick")..", I'm tired of surfing!", 1)

else

doCreatureSay(cid, getItemAttribute(item.uid, "poke")..", I'm tired of surfing!", 1)

end

doSummonMonster(cid, pokemon)

local pk = getCreatureSummons(cid)[1]

local balla = getPlayerSlotItem(cid, 8).uid

local balladdon = getItemAttribute(balla,"addon")

if not balladdon then

doSetItemAttribute(balla,"addon",0)

end

if balladdon > 0 then

doSetCreatureOutfit(pk, {lookType = balladdon}, -1)

end

local pk = getCreatureSummons(cid)[1]

if not isCreature(pk) then

pk = doCreateMonster(pokemon, backupPos)

if not isCreature(pk) then

  doPlayerSendCancel(cid, "You can't stop surfing here.")

  doTeleportThing(cid, fromPosition, false)

  return true

end

doConvinceCreature(cid, pk)

end

doChangeSpeed(pk, getCreatureSpeed(cid))

doChangeSpeed(cid, -getCreatureSpeed(cid))

doRegainSpeed(cid)      --alterado v2.6

doTeleportThing(pk, fromPosition, false)

doTeleportThing(pk, getThingPos(cid), true)

doCreatureSetLookDir(pk, getCreatureLookDir(cid))

adjustStatus(pk, item.uid, true, false, true)

if useOTClient then

doPlayerSendCancel(cid, '12//,show') --alterado v2.8

end

end

return true

end

 

agora no fly tem o mesmo bug por conta da verificação ao deslogar sem o addon ele buga você no fly mas com o addon tudo ocorre perfeitamente. 

 

correção Login.lua

  Mostrar conteúdo oculto

local config = {

  loginMessage = getConfigValue('loginMessage'),

  useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))

}

--alterado v2.6 tabelas soh em lib/configuration.lua;

function onLogin(cid)

  if getPlayerLevel(cid) >= 1 and getPlayerLevel(cid) <= 10 then   --alterado v2.8

  doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)

else

  doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, (getPlayerLevel(cid) >= 200 and 100 or math.floor(getPlayerLevel(cid)/2)) )

end

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_CONSOLE_ORANGE, 'Bem vindo ao pokemon Hp, Treinador! .')

 

  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, 7)

  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, "experience")

registerCreatureEvent(cid, "dropStone")  

registerCreatureEvent(cid, "Player_Logout")

registerCreatureEvent(cid, "ShowPokedex") 

registerCreatureEvent(cid, "ClosePokedex")

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, "reward")

registerCreatureEvent(cid, "GeneralConfiguration")

registerCreatureEvent(cid, "ReportBug")

registerCreatureEvent(cid, "LookSystem")

registerCreatureEvent(cid, "T1")

registerCreatureEvent(cid, "T2")

registerCreatureEvent(cid, "ll1")

registerCreatureEvent(cid, "task_count")

registerCreatureEvent(cid, "ctff")

registerCreatureEvent(cid, "ctfd")

registerCreatureEvent(cid, "task")

registerCreatureEvent(cid, "dota")

registerCreatureEvent(cid, "atk")

registerCreatureEvent(cid, "balance")

registerCreatureEvent(cid, "aloot_kill")

if getPlayerStorageValue(cid, 99284) == 1 then

  setPlayerStorageValue(cid, 99284, -1)

end

if getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then

  setPlayerStorageValue(cid, 6598754, -1)

  setPlayerStorageValue(cid, 6598755, -1)

  doRemoveCondition(cid, CONDITION_OUTFIT)             --alterado v2.9 \/

  doTeleportThing(cid, posBackPVP, false)

  doCreatureAddHealth(cid, getCreatureMaxHealth(cid))

end

doChangeSpeed(cid, -(getCreatureSpeed(cid)))

--///////////////////////////////////////////////////////////////////////////--

local storages = {17000, 63215, 17001, 13008, 5700}

for s = 1, #storages do

  if not tonumber(getPlayerStorageValue(cid, storages)) then

    if s == 3 then

      setPlayerStorageValue(cid, storages, 1)

    elseif s == 4 then

      setPlayerStorageValue(cid, storages, -1)

    else

      if isBeingUsed(getPlayerSlotItem(cid, 8).itemid) then

        setPlayerStorageValue(cid, storages, 1)                 --alterado v2.6

      else

        setPlayerStorageValue(cid, storages, -1)

      end

    end

    doPlayerSendTextMessage(cid, 27, "Sorry, but a problem occurred on the server, but now it's alright")

  end

end

--/////////////////////////////////////////////////////////////////////////--

if getPlayerStorageValue(cid, 17000) >= 1 then -- fly

local item = getPlayerSlotItem(cid, 8)

if item.itemid <= 0 then

  setPlayerStorageValue(cid, 17000, -1)

  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

  return true

end

local poke = getItemAttribute(item.uid, "poke")

doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))

doRemoveCondition(cid, CONDITION_OUTFIT)

local addonfly = getPlayerSlotItem(cid, 8).uid

local addofly = getItemAttribute(addonfly,"addonfly")

if not addofly then

  doSetItemAttribute(addonfly,"addonfly",0)

  doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1)

end

doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1)

if addofly > 0 then

  doSetCreatureOutfit(cid, {lookType = addofly}, -1)

end

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)

if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then

  sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")])                     --alterado v2.8

end

local posicao = getTownTemplePosition(getPlayerTown(cid))

markFlyingPos(cid, posicao)

elseif getPlayerStorageValue(cid, 63215) >= 1 then -- surf

local item = getPlayerSlotItem(cid, 8)

if item.itemid <= 0 then

  setPlayerStorageValue(cid, 63215, -1)

  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

  return true

end

local poke = getItemAttribute(item.uid, "poke")

local addonsurf = getPlayerSlotItem(cid, 8).uid

local addosurf = getItemAttribute(addonsurf,"addonsurf")

if not addosurf then

  doSetItemAttribute(addonsurf,"addonsurf",0)

  doSetCreatureOutfit(cid, {lookType = surfs[poke].lookType + 351}, -1)

end

if addosurf > 0 then

  doSetCreatureOutfit(cid, {lookType = addosurf}, -1)

end

doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))

if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then

  sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")])                     --alterado v2.8

end

elseif getPlayerStorageValue(cid, 17001) >= 1 then -- ride

local item = getPlayerSlotItem(cid, 8)

if item.itemid <= 0 then

  setPlayerStorageValue(cid, 17001, -1)

  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

  return true

end

local poke = getItemAttribute(item.uid, "poke")

 

if rides[poke] then

  doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))

  doRemoveCondition(cid, CONDITION_OUTFIT)

  local addonride = getPlayerSlotItem(cid, 8).uid

  local addoride = getItemAttribute(addonride,"addonride")

  if not addofly then

    doSetItemAttribute(addonride,"addonride",0)

    doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1)

  end

  if addoride > 0 then

    doSetCreatureOutfit(cid, {lookType = addoride}, -1)

  end

  if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then

    sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")])                     --alterado v2.8

  end

else

  setPlayerStorageValue(cid, 17001, -1)

  doRegainSpeed(cid)   --alterado v2.6

end

local posicao2 = getTownTemplePosition(getPlayerTown(cid))

markFlyingPos(cid, posicao2)

elseif getPlayerStorageValue(cid, 13008) >= 1 then -- dive

if not isInArray({5405, 5406, 5407, 5408, 5409, 5410}, getTileInfo(getThingPos(cid)).itemid) then

  setPlayerStorageValue(cid, 13008, 0)

  doRegainSpeed(cid)              --alterado v2.6

  doRemoveCondition(cid, CONDITION_OUTFIT)

  return true

end

if getPlayerSex(cid) == 1 then

  doSetCreatureOutfit(cid, {lookType = 1034, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)

else

  doSetCreatureOutfit(cid, {lookType = 1035, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)

end

doChangeSpeed(cid, 800)

elseif getPlayerStorageValue(cid, 5700) > 0 then   --bike

doChangeSpeed(cid, -getCreatureSpeed(cid))

doChangeSpeed(cid, getPlayerStorageValue(cid, 5700))  --alterado v2.8

if getPlayerSex(cid) == 1 then

  doSetCreatureOutfit(cid, {lookType = 1394}, -1)

else

  doSetCreatureOutfit(cid, {lookType = 1393}, -1)

end

elseif getPlayerStorageValue(cid, 75846) >= 1 then     --alterado v2.9 \/

doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)

setPlayerStorageValue(cid, 75846, -1)

sendMsgToPlayer(cid, 20, "You have been moved to your town!")

else

doRegainSpeed(cid)  --alterado v2.6

end

if getPlayerStorageValue(cid, 22545) >= 1 then   --golden arena

setPlayerStorageValue(cid, 22545, -1)              --alterado v2.4

doTeleportThing(cid, getClosestFreeTile(cid, posBackGolden), false)

setPlayerRecordWaves(cid)     --alterado v2.7

end

return true

end

 

Atenciosamente: Kevick

 

Dolly @Ceetros atualiza o tópico com a correção se possível.

Obrigado pela Correção Amigo :)

Link para o comentário
Compartilhar em outros sites

Em 2016-3-19 at 13:24, Ceetros disse:

 

[19/03/2016 12:11:50] [Error - LuaScriptInterface::loadFile] data/actions/scripts/addon.lua:3: ']' expected near 'DO'

[19/03/2016 12:11:50] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/addon.lua)

[19/03/2016 12:11:50] data/actions/scripts/addon.lua:3: ']' expected near 'DO'

[19/03/2016 12:11:52] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/login.lua:1: '=' expected near 'config'

[19/03/2016 12:11:52] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/login.lua)

[19/03/2016 12:11:52] data/creaturescripts/scripts/login.lua:1: '=' expected near 'config'

 

Poderia me ajudar????

Me manda o addon e login

Man to usando a base do stylo disse que esse system funcionava so que quando solto o poke n sai o addon acho que é no goback pois n existe a linha que vc falo la vo postar meu goback aki se tiver como dar uma ajuda agradeço https://hastebin.com/epazajipes.lua

Link para o comentário
Compartilhar em outros sites

Em 29/06/2017 at 12:08, wougoplex disse:

Man to usando a base do stylo disse que esse system funcionava so que quando solto o poke n sai o addon acho que é no goback pois n existe a linha que vc falo la vo postar meu goback aki se tiver como dar uma ajuda agradeço https://hastebin.com/epazajipes.lua

 

Adiciona antes de 

else    doPlayerSendTextMessage(cid, 27, ""..faintedpk[getPlayerLanguage(cid)].."")end

 

Link para o comentário
Compartilhar em outros sites

2 horas atrás, Ceetros disse:

 

Adiciona antes de 

else    doPlayerSendTextMessage(cid, 27, ""..faintedpk[getPlayerLanguage(cid)].."")end

 

Funcionou man mt obrigado rep+

Link para o comentário
Compartilhar em outros sites

1 hora atrás, wougoplex disse:

Funcionou man mt obrigado rep+

Quaisquer bug :)

Em 26/06/2017 at 04:32, Jair Kevick disse:

Desculpe reviver o tópico mas caso alguém for usar modifique o surf.lua na parte em que faz duas verificações, onde uma é caso ele não há addon e a outra caso ele há addon, super desnecessário e bugou o script. só funcionando o surf com addon.

 

em baixo de : 

 

  Mostrar conteúdo oculto

if getPlayerStorageValue(cid, 6598754) == 1 or getPlayerStorageValue(cid, 6598755) == 1 then

doPlayerSendCancel(cid, "You can't do it while in the PVP Zone!")   --alterado v2.7

doTeleportThing(cid, fromPosition, false)

return true

end

 

Substitua a função em baixo por: 

 

  Mostrar conteúdo oculto

local addonsurf = getPlayerSlotItem(cid, 8).uid

local addosurf = getItemAttribute(addonsurf,"addonsurf")

if addosurf > 0 then

doSetCreatureOutfit(cid, {lookType = addosurf}, -1)

end

doSetCreatureOutfit(cid, {lookType = surfs[getPokemonName(getCreatureSummons(cid)[1])].lookType + 351}, -1)

doCreatureSay(cid, ""..getPokeName(getCreatureSummons(cid)[1])..", lets surf!", 1)

doChangeSpeed(cid, -(getCreatureSpeed(cid)))

 

caso não consiga só mude para esse surf.lua: 

 

  Mostrar conteúdo oculto

local function doSendMagicEffecte(pos, effect)

  addEvent(doSendMagicEffect, 50, pos, effect)

end

local waters = {11756, 4614, 4615, 4616, 4617, 4618, 4619, 4608, 4609, 4610, 4611, 4612, 4613, 7236, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825}

--alterado v2.5

local flie = {'11756', '4614', '4615', '4616', '4617', '4618', '4619', '4608', '4609', '4610', '4611', '4612', '4613', '7236', '4614', '4615', '4616', '4617', '4618', '4619', '4620', '4621', '4622', '4623', '4624', '4625', '4665', '4666', '4820', '4821', '4822', '4823', '4824', '4825'}

--alterado v2.6 tabela agora em configuration.lua!

local premium = false

function onStepIn(cid, item, position, fromPosition)

  if not isPlayer(cid) or isInArray({5, 6}, getPlayerGroupId(cid)) then --alterado v2.9

  return true

end

if getPlayerStorageValue(cid, 75846) >= 1 then return true end   --alterado v2.9

if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV

if isPlayer(cid) and not isPremium(cid) and premium == true then

  doTeleportThing(cid, fromPosition, true)

  doPlayerSendCancel(cid, "Only premium members are allowed to surf.")

  return true

end

if getCreatureOutfit(cid).lookType == 316 or getCreatureOutfit(cid).lookType == 648 then

  doSendMagicEffect(fromPosition, 136)

end

if (getPlayerStorageValue(cid, 63215) >= 1 or getPlayerStorageValue(cid, 17000) >= 1) then

  return true

end

if #getCreatureSummons(cid) == 0 then

  doPlayerSendCancel(cid, "You need a pokemon to surf.")

  doTeleportThing(cid, fromPosition, false)

  return true

end

if (not isInArray(specialabilities["surf"], getPokemonName(getCreatureSummons(cid)[1]))) then  --alterado v2.6

doPlayerSendCancel(cid, "This pokemon cannot surf.")

doTeleportThing(cid, fromPosition, false)

return true

end

if getPlayerStorageValue(cid, 5700) == 1 then

doPlayerSendCancel(cid, "You can't do that while is mount in a bike!")

doTeleportThing(cid, fromPosition, false)

return true

end

if getPlayerStorageValue(cid, 212124) >= 1 then         --alterado v2.6

doPlayerSendCancel(cid, "You can't do it with a pokemon with mind controlled!")

doTeleportThing(cid, fromPosition, false)

return true

end

if getPlayerStorageValue(cid, 52480) >= 1 then

doPlayerSendCancel(cid, "You can't do it while a duel!")  --alterado v2.6

doTeleportThing(cid, fromPosition, false)

return true

end

if getPlayerStorageValue(cid, 6598754) == 1 or getPlayerStorageValue(cid, 6598755) == 1 then

doPlayerSendCancel(cid, "You can't do it while in the PVP Zone!")   --alterado v2.7

doTeleportThing(cid, fromPosition, false)

return true

end

local addonsurf = getPlayerSlotItem(cid, 8).uid

local addosurf = getItemAttribute(addonsurf,"addonsurf")

doSetCreatureOutfit(cid, {lookType = surfs[getPokemonName(getCreatureSummons(cid)[1])].lookType + 351}, -1)

if addosurf > 0 then

doSetCreatureOutfit(cid, {lookType = addosurf}, -1)

end

doCreatureSay(cid, ""..getPokeName(getCreatureSummons(cid)[1])..", lets surf!", 1)

doChangeSpeed(cid, -(getCreatureSpeed(cid)))

local speed = 75 + PlayerSpeed + getSpeed(getCreatureSummons(cid)[1]) * 8 * speedRate

setPlayerStorageValue(cid, 54844, speed)

doChangeSpeed(cid, speed)

local pct = getCreatureHealth(getCreatureSummons(cid)[1]) / getCreatureMaxHealth(getCreatureSummons(cid)[1])

local item = getPlayerSlotItem(cid, 8)  --alterado v2.8

doItemSetAttribute(item.uid, "hp", pct)

doRemoveCreature(getCreatureSummons(cid)[1])

if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) <= 0 then

addEvent(sendAuraEffect, 120, cid, auraSyst[getItemAttribute(item.uid, "aura")])    --alterado v2.8

end

if useOTClient then

doPlayerSendCancel(cid, '12//,hide') --alterado v1.8

end

addEvent(setPlayerStorageValue, 100, cid, 63215, 1)

return true

end

local direffects = {30, 49, 9, 51}

function onStepOut(cid, item, position, fromPosition)

if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end

local checkpos = fromPosition

checkpos.stackpos = 0

if isInArray(waters, getTileInfo(checkpos).itemid) then

if getPlayerStorageValue(cid, 63215) >= 1 or getPlayerStorageValue(cid, 17000) >= 1 then

doSendMagicEffecte(fromPosition, direffects[getCreatureLookDir(cid) + 1])

end

end

if not isInArray(waters, getTileInfo(getThingPos(cid)).itemid) then

if getPlayerStorageValue(cid, 17000) >= 1 then return true end

if getPlayerStorageValue(cid, 63215) <= 0 then return true end

doRemoveCondition(cid, CONDITION_OUTFIT)

setPlayerStorageValue(cid, 63215, -1)

local item = getPlayerSlotItem(cid, 8)

local pokemon = getItemAttribute(item.uid, "poke")

local x = pokes[pokemon]

if not x then return true end

if getItemAttribute(item.uid, "nick") then

doCreatureSay(cid, getItemAttribute(item.uid, "nick")..", I'm tired of surfing!", 1)

else

doCreatureSay(cid, getItemAttribute(item.uid, "poke")..", I'm tired of surfing!", 1)

end

doSummonMonster(cid, pokemon)

local pk = getCreatureSummons(cid)[1]

local balla = getPlayerSlotItem(cid, 8).uid

local balladdon = getItemAttribute(balla,"addon")

if not balladdon then

doSetItemAttribute(balla,"addon",0)

end

if balladdon > 0 then

doSetCreatureOutfit(pk, {lookType = balladdon}, -1)

end

local pk = getCreatureSummons(cid)[1]

if not isCreature(pk) then

pk = doCreateMonster(pokemon, backupPos)

if not isCreature(pk) then

  doPlayerSendCancel(cid, "You can't stop surfing here.")

  doTeleportThing(cid, fromPosition, false)

  return true

end

doConvinceCreature(cid, pk)

end

doChangeSpeed(pk, getCreatureSpeed(cid))

doChangeSpeed(cid, -getCreatureSpeed(cid))

doRegainSpeed(cid)      --alterado v2.6

doTeleportThing(pk, fromPosition, false)

doTeleportThing(pk, getThingPos(cid), true)

doCreatureSetLookDir(pk, getCreatureLookDir(cid))

adjustStatus(pk, item.uid, true, false, true)

if useOTClient then

doPlayerSendCancel(cid, '12//,show') --alterado v2.8

end

end

return true

end

 

agora no fly tem o mesmo bug por conta da verificação ao deslogar sem o addon ele buga você no fly mas com o addon tudo ocorre perfeitamente. 

 

correção Login.lua

  Mostrar conteúdo oculto

local config = {

  loginMessage = getConfigValue('loginMessage'),

  useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))

}

--alterado v2.6 tabelas soh em lib/configuration.lua;

function onLogin(cid)

  if getPlayerLevel(cid) >= 1 and getPlayerLevel(cid) <= 10 then   --alterado v2.8

  doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)

else

  doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, (getPlayerLevel(cid) >= 200 and 100 or math.floor(getPlayerLevel(cid)/2)) )

end

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_CONSOLE_ORANGE, 'Bem vindo ao pokemon Hp, Treinador! .')

 

  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, 7)

  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, "experience")

registerCreatureEvent(cid, "dropStone")  

registerCreatureEvent(cid, "Player_Logout")

registerCreatureEvent(cid, "ShowPokedex") 

registerCreatureEvent(cid, "ClosePokedex")

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, "reward")

registerCreatureEvent(cid, "GeneralConfiguration")

registerCreatureEvent(cid, "ReportBug")

registerCreatureEvent(cid, "LookSystem")

registerCreatureEvent(cid, "T1")

registerCreatureEvent(cid, "T2")

registerCreatureEvent(cid, "ll1")

registerCreatureEvent(cid, "task_count")

registerCreatureEvent(cid, "ctff")

registerCreatureEvent(cid, "ctfd")

registerCreatureEvent(cid, "task")

registerCreatureEvent(cid, "dota")

registerCreatureEvent(cid, "atk")

registerCreatureEvent(cid, "balance")

registerCreatureEvent(cid, "aloot_kill")

if getPlayerStorageValue(cid, 99284) == 1 then

  setPlayerStorageValue(cid, 99284, -1)

end

if getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then

  setPlayerStorageValue(cid, 6598754, -1)

  setPlayerStorageValue(cid, 6598755, -1)

  doRemoveCondition(cid, CONDITION_OUTFIT)             --alterado v2.9 \/

  doTeleportThing(cid, posBackPVP, false)

  doCreatureAddHealth(cid, getCreatureMaxHealth(cid))

end

doChangeSpeed(cid, -(getCreatureSpeed(cid)))

--///////////////////////////////////////////////////////////////////////////--

local storages = {17000, 63215, 17001, 13008, 5700}

for s = 1, #storages do

  if not tonumber(getPlayerStorageValue(cid, storages)) then

    if s == 3 then

      setPlayerStorageValue(cid, storages, 1)

    elseif s == 4 then

      setPlayerStorageValue(cid, storages, -1)

    else

      if isBeingUsed(getPlayerSlotItem(cid, 8).itemid) then

        setPlayerStorageValue(cid, storages, 1)                 --alterado v2.6

      else

        setPlayerStorageValue(cid, storages, -1)

      end

    end

    doPlayerSendTextMessage(cid, 27, "Sorry, but a problem occurred on the server, but now it's alright")

  end

end

--/////////////////////////////////////////////////////////////////////////--

if getPlayerStorageValue(cid, 17000) >= 1 then -- fly

local item = getPlayerSlotItem(cid, 8)

if item.itemid <= 0 then

  setPlayerStorageValue(cid, 17000, -1)

  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

  return true

end

local poke = getItemAttribute(item.uid, "poke")

doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))

doRemoveCondition(cid, CONDITION_OUTFIT)

local addonfly = getPlayerSlotItem(cid, 8).uid

local addofly = getItemAttribute(addonfly,"addonfly")

if not addofly then

  doSetItemAttribute(addonfly,"addonfly",0)

  doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1)

end

doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1)

if addofly > 0 then

  doSetCreatureOutfit(cid, {lookType = addofly}, -1)

end

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)

if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then

  sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")])                     --alterado v2.8

end

local posicao = getTownTemplePosition(getPlayerTown(cid))

markFlyingPos(cid, posicao)

elseif getPlayerStorageValue(cid, 63215) >= 1 then -- surf

local item = getPlayerSlotItem(cid, 8)

if item.itemid <= 0 then

  setPlayerStorageValue(cid, 63215, -1)

  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

  return true

end

local poke = getItemAttribute(item.uid, "poke")

local addonsurf = getPlayerSlotItem(cid, 8).uid

local addosurf = getItemAttribute(addonsurf,"addonsurf")

if not addosurf then

  doSetItemAttribute(addonsurf,"addonsurf",0)

  doSetCreatureOutfit(cid, {lookType = surfs[poke].lookType + 351}, -1)

end

if addosurf > 0 then

  doSetCreatureOutfit(cid, {lookType = addosurf}, -1)

end

doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))

if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then

  sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")])                     --alterado v2.8

end

elseif getPlayerStorageValue(cid, 17001) >= 1 then -- ride

local item = getPlayerSlotItem(cid, 8)

if item.itemid <= 0 then

  setPlayerStorageValue(cid, 17001, -1)

  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

  return true

end

local poke = getItemAttribute(item.uid, "poke")

 

if rides[poke] then

  doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))

  doRemoveCondition(cid, CONDITION_OUTFIT)

  local addonride = getPlayerSlotItem(cid, 8).uid

  local addoride = getItemAttribute(addonride,"addonride")

  if not addofly then

    doSetItemAttribute(addonride,"addonride",0)

    doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1)

  end

  if addoride > 0 then

    doSetCreatureOutfit(cid, {lookType = addoride}, -1)

  end

  if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then

    sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")])                     --alterado v2.8

  end

else

  setPlayerStorageValue(cid, 17001, -1)

  doRegainSpeed(cid)   --alterado v2.6

end

local posicao2 = getTownTemplePosition(getPlayerTown(cid))

markFlyingPos(cid, posicao2)

elseif getPlayerStorageValue(cid, 13008) >= 1 then -- dive

if not isInArray({5405, 5406, 5407, 5408, 5409, 5410}, getTileInfo(getThingPos(cid)).itemid) then

  setPlayerStorageValue(cid, 13008, 0)

  doRegainSpeed(cid)              --alterado v2.6

  doRemoveCondition(cid, CONDITION_OUTFIT)

  return true

end

if getPlayerSex(cid) == 1 then

  doSetCreatureOutfit(cid, {lookType = 1034, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)

else

  doSetCreatureOutfit(cid, {lookType = 1035, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)

end

doChangeSpeed(cid, 800)

elseif getPlayerStorageValue(cid, 5700) > 0 then   --bike

doChangeSpeed(cid, -getCreatureSpeed(cid))

doChangeSpeed(cid, getPlayerStorageValue(cid, 5700))  --alterado v2.8

if getPlayerSex(cid) == 1 then

  doSetCreatureOutfit(cid, {lookType = 1394}, -1)

else

  doSetCreatureOutfit(cid, {lookType = 1393}, -1)

end

elseif getPlayerStorageValue(cid, 75846) >= 1 then     --alterado v2.9 \/

doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)

setPlayerStorageValue(cid, 75846, -1)

sendMsgToPlayer(cid, 20, "You have been moved to your town!")

else

doRegainSpeed(cid)  --alterado v2.6

end

if getPlayerStorageValue(cid, 22545) >= 1 then   --golden arena

setPlayerStorageValue(cid, 22545, -1)              --alterado v2.4

doTeleportThing(cid, getClosestFreeTile(cid, posBackGolden), false)

setPlayerRecordWaves(cid)     --alterado v2.7

end

return true

end

 

Atenciosamente: Kevick

 

Dolly @Ceetros atualiza o tópico com a correção se possível.

Atualizar

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...