Ir para conteúdo
  • Cadastre-se

Derivado Ajuda getThingPos TFS 0.3.6 [ PokeTibia ]


Posts Recomendados

No sistema de pesca do meu ot , o poke pescado aparece onde o player está , porém gostaria que aparecesse onde o meu pokemon [ Summon ] está , mas não sei como.

local playerpos = getClosestFreeTile(cid, getThingPos(cid))

Link para o post
Compartilhar em outros sites

Mostre todo script do fishing, por favor.

Programador PHP, Lua, Java, database administrator.

 

"Nada é verdade, tudo é permitido."

Requiescat in pace.

Link para o post
Compartilhar em outros sites
Spoiler

local fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}} },

[3976] = { segs = 5, pokes = {{"Horsea", 5}, {"Goldeen", 3}, {"Poliwag", 2}} },  -- pega no client da pxg

[12855] = { segs = 5, pokes = {{"Tentacool", 3}, {"Staryu", 2}, {"Krabby", 3}, {"Shellder", 2} } },

[12854] = { segs = 5, pokes = {{"Seel", 2}, {"squirtle", 2} } },

[12858] = { segs = 5, pokes = {{"Seaking", 2}, {"Seadra", 2}, {"Poliwhirl", 2}} },

[12857] = { segs = 5, pokes = {{"Starmie", 2}, {"Kingler", 2}, {"Wartortle", 2}, {"Slowbro", 2}} },  -- pega no client da pxg

[12860] = { segs = 5, pokes = {{"Starmie", 3}, {"Dewgong", 3}}},

[12859] = { segs = 5, pokes = {{"Cloyster", 2}, {"Poliwrath", 2}, {"Dewgong", 4}, {"Golduck", 1}} },

[12856] = { segs = 5, pokes = {{"Dratini", 3}, {"Dragonair", 2} }},

[12853] = { segs = 5, pokes = {{"Gyarados", 1}, {"Blastoise", 1}, {"Tentacruel", 1}, {"Lapras", 1}} },
}

local storageP = 154585
local sto_iscas = 5648454 --muda aki pra sto q ta no script da isca
local bonus = 30
local limite = 100


local function doFish(cid, pos, ppos, interval)
      if not isCreature(cid) then return false end
      if getThingPos(cid).x ~= ppos.x or getThingPos(cid).y ~= ppos.y then
         return false 
      end
     
      if getPlayerSkillLevel(cid, 6) < 10 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 3}, {"Poliwag", 2}} },
}
      elseif getPlayerSkillLevel(cid, 6) < 15 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 3}, {"Poliwag", 2}, {"Tentacool", 3}, {"Staryu", 2}, {"Krabby", 3}, {"Shellder", 2}} },
}
      elseif getPlayerSkillLevel(cid, 6) < 20 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 3}, {"Poliwag", 2}, {"Tentacool", 3}, {"Staryu", 2}, {"Krabby", 3}, {"Shellder", 2}, {"Seel", 2}, {"squirtle", 2}} },
}
      elseif getPlayerSkillLevel(cid, 6) < 25 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 3}, {"Poliwag", 2}, {"Tentacool", 3}, {"Staryu", 2}, {"Krabby", 3}, {"Shellder", 2}, {"Seel", 2}, {"squirtle", 2},
{"Seaking", 2}, {"Seadra", 2}, {"Poliwhirl", 2}} },
}
      elseif getPlayerSkillLevel(cid, 6) < 30 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 3}, {"Poliwag", 2}, {"Tentacool", 3}, {"Staryu", 2}, {"Krabby", 3}, {"Shellder", 2}, {"Seel", 2}, {"squirtle", 2},
{"Seaking", 2}, {"Seadra", 2}, {"Poliwhirl", 2}, {"Starmie", 2}, {"Kingler", 2}, {"Wartortle", 2}, {"Slowbro", 2}} },
}
      elseif getPlayerSkillLevel(cid, 6) < 35 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 3}, {"Poliwag", 2}, {"Tentacool", 3}, {"Staryu", 2}, {"Krabby", 3}, {"Shellder", 2}, {"Seel", 2}, {"squirtle", 2},
{"Seaking", 2}, {"Seadra", 2}, {"Poliwhirl", 2}, {"Starmie", 2}, {"Kingler", 2}, {"Wartortle", 2}, {"Slowbro", 2}, {"Starmie", 3}, {"Dewgong", 3}} },
}
      elseif getPlayerSkillLevel(cid, 6) < 40 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 3}, {"Poliwag", 2}, {"Tentacool", 3}, {"Staryu", 2}, {"Krabby", 3}, {"Shellder", 2}, {"Seel", 2}, {"squirtle", 2},
{"Seaking", 2}, {"Seadra", 2}, {"Poliwhirl", 2}, {"Starmie", 2}, {"Kingler", 2}, {"Wartortle", 2}, {"Slowbro", 2}, {"Starmie", 3}, {"Dewgong", 3}, {"Cloyster", 2}, {"Poliwrath", 2}, {"Dewgong", 4}, {"Golduck", 1}} },
}
      elseif getPlayerSkillLevel(cid, 6) < 45 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 3}, {"Poliwag", 2}, {"Tentacool", 3}, {"Staryu", 2}, {"Krabby", 3}, {"Shellder", 2}, {"Seel", 2}, {"squirtle", 2},
{"Seaking", 2}, {"Seadra", 2}, {"Poliwhirl", 2}, {"Starmie", 2}, {"Kingler", 2}, {"Wartortle", 2}, {"Slowbro", 2}, {"Starmie", 3}, {"Dewgong", 3}, {"Cloyster", 2}, {"Poliwrath", 2}, {"Dewgong", 4}, {"Golduck", 1},
{"Dratini", 3}, {"Dragonair", 2}} },
}
      elseif getPlayerSkillLevel(cid, 6) < 50 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Starmie", 3}, {"Dewgong", 3}, {"Cloyster", 3}, {"Poliwrath", 3}, {"Dewgong", 4}, {"Golduck", 3},
{"Dratini", 3}, {"Dragonair", 3}, {"Gyarados", 2}, {"Blastoise", 2}, {"Tentacruel", 2}, {"Lapras", 2}} },
}
      elseif getPlayerSkillLevel(cid, 6) < 55 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}} },
}
      elseif getPlayerSkillLevel(cid, 6) < 60 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 3}, {"Totodile", 3}, {"Chinchou", 3}, {"Marill", 3}} },
}
      elseif getPlayerSkillLevel(cid, 6) < 65 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 3}, {"Totodile", 3}, {"Chinchou", 3}, {"Marill", 3}, {"Qwilfish", 3}, {"Croconaw", 3}} },
}
      elseif getPlayerSkillLevel(cid, 6) < 70 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 3}, {"Totodile", 3}, {"Chinchou", 3}, {"Marill", 3}, {"Qwilfish", 3}, {"Croconaw", 3},
{"wooper", 5}, {"Azumarill", 3}, {"Corsola", 3}} },
}
      elseif getPlayerSkillLevel(cid, 6) < 75 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 3}, {"Totodile", 3}, {"Chinchou", 3}, {"Marill", 3}, {"Qwilfish", 3}, {"Croconaw", 3},
{"wooper", 5}, {"Azumarill", 3}, {"Corsola", 3}, {"Octillery", 3}, {"Politoed", 3}, {"Quagsire", 3}, {"Lanturn", 3}} },
}
 elseif getPlayerSkillLevel(cid, 6) < 80 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 3}, {"Totodile", 3}, {"Chinchou", 3}, {"Marill", 3}, {"Qwilfish", 3}, {"Croconaw", 3},
{"wooper", 5}, {"Azumarill", 3}, {"Corsola", 3}, {"Octillery", 3}, {"Politoed", 3}, {"Quagsire", 3}, {"Lanturn", 3}, {"Feraligatr", 3}, {"Vaporeon", 3}, {"Kingdra", 3}, {"Mantine", 3}} },
}
 elseif getPlayerSkillLevel(cid, 6) < 85 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 5}, {"Totodile", 5}, {"Chinchou", 5}, {"Marill", 5}, {"Qwilfish", 5}, {"Croconaw", 5},
{"wooper", 5}, {"Azumarill", 3}, {"Corsola", 3}, {"Octillery", 3}, {"Politoed", 3}, {"Quagsire", 3}, {"Lanturn", 3}, {"Feraligatr", 3}, {"Vaporeon", 3}, {"Kingdra", 3}, {"Mantine", 3}, {"Slowking", 3}} },
}
 elseif getPlayerSkillLevel(cid, 6) < 90 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 5}, {"Totodile", 5}, {"Chinchou", 5}, {"Marill", 5}, {"Qwilfish", 5}, {"Croconaw", 5},
{"wooper", 5}, {"Azumarill", 5}, {"Corsola", 5}, {"Octillery", 5}, {"Politoed", 5}, {"Quagsire", 5}, {"Lanturn", 5}, {"Feraligatr", 5}, {"Vaporeon", 5}, {"Kingdra", 3}, {"Mantine", 3}, {"Slowking", 3}} },
}
 elseif getPlayerSkillLevel(cid, 6) < 95 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 5}, {"Totodile", 5}, {"Chinchou", 5}, {"Marill", 5}, {"Qwilfish", 5}, {"Croconaw", 5},
{"wooper", 5}, {"Azumarill", 5}, {"Corsola", 5}, {"Octillery", 5}, {"Politoed", 5}, {"Quagsire", 5}, {"Lanturn", 5}, {"Feraligatr", 5}, {"Vaporeon", 5}, {"Kingdra", 5}, {"Mantine", 5}, {"Slowking", 5}} },
}
 elseif getPlayerSkillLevel(cid, 6) < 100 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 5}, {"Totodile", 5}, {"Chinchou", 5}, {"Marill", 5}, {"Qwilfish", 5}, {"Croconaw", 5},
{"wooper", 5}, {"Azumarill", 5}, {"Corsola", 5}, {"Octillery", 5}, {"Politoed", 5}, {"Quagsire", 5}, {"Lanturn", 5}, {"Feraligatr", 5}, {"Vaporeon", 5}, {"Kingdra", 5}, {"Mantine", 5}, {"Slowking", 5},
{"Carvanha", 3}, {"Barboach", 3}, {"Clamperl", 3}, {"Spheal", 3}, {"Corphish", 3}} },
}
 elseif getPlayerSkillLevel(cid, 6) < 105 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 5}, {"Totodile", 5}, {"Chinchou", 5}, {"Marill", 5}, {"Qwilfish", 5}, {"Croconaw", 5},
{"wooper", 5}, {"Azumarill", 5}, {"Corsola", 5}, {"Octillery", 5}, {"Politoed", 5}, {"Quagsire", 5}, {"Lanturn", 5}, {"Feraligatr", 5}, {"Vaporeon", 5}, {"Kingdra", 5}, {"Mantine", 5}, {"Slowking", 5},
{"Carvanha", 3}, {"Barboach", 3}, {"Clamperl", 3}, {"Spheal", 3}, {"Corphish", 3}, {"Sharpedo", 2}, {"Whiscash", 2}, {"Huntail", 2}, {"Gorebyss", 2}, {"Huntail", 2}} },
}
 elseif getPlayerSkillLevel(cid) >= 110 then
      fishing = {
[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 5}, {"Totodile", 5}, {"Chinchou", 5}, {"Marill", 5}, {"Qwilfish", 5}, {"Croconaw", 5},
{"wooper", 5}, {"Azumarill", 5}, {"Corsola", 5}, {"Octillery", 5}, {"Politoed", 5}, {"Quagsire", 5}, {"Lanturn", 5}, {"Feraligatr", 5}, {"Vaporeon", 5}, {"Kingdra", 5}, {"Mantine", 5}, {"Slowking", 5},
{"Carvanha", 5}, {"Barboach", 5}, {"Clamperl", 5}, {"Spheal", 5}, {"Corphish", 5}, {"Sharpedo", 5}, {"Whiscash", 5}, {"Huntail", 5}, {"Gorebyss", 5}, {"Huntail", 5}} },
}
end
    
      
      doSendMagicEffect(pos, CONST_ME_LOSEENERGY)
      
      if interval > 0 then
         addEvent(doFish, 1000, cid, pos, ppos, interval-1)
         return true
      end   

      local peixe = 0
      local playerpos = getClosestFreeTile(cid, getThingPos(cid))
      local fishes = fishing[getPlayerStorageValue(cid, sto_iscas)]
      local random = {}   

      if getPlayerSkillLevel(cid, 6) < limite then 
         doPlayerAddSkillTry(cid, 6, bonus * 5)
      end
      
         --[[if math.random(1, 100) <= chance then
        if getPlayerSkillLevel(cid, 6) < limite then
        doPlayerAddSkillTry(cid, 6, bonus * 5)
        end]]
      
      random = fishes.pokes[math.random(#fishes.pokes)]
      
      for i = 1, math.random(random[2]) do
          peixe = doSummonCreature(random[1], playerpos)
          if not isCreature(peixe) then
             setPlayerStorageValue(cid, storageP, -1)
             return true
          end
          setPokemonPassive(peixe, true)
          doSetPokemonAgressiveToPlayer(peixe, cid)
          setPlayerStorageValue(peixe, storageP, 1)
          if #getCreatureSummons(cid) >= 1 then
             doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 0)
             doChallengeCreature(getCreatureSummons(cid)[1], peixe)
          else    
             doSendMagicEffect(getThingPos(cid), 0)
             doChallengeCreature(cid, peixe)
          end
       end
       setPlayerStorageValue(cid, storageP, -1)
       doCreatureSetNoMove(cid, false)
return true
end

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

function onUse(cid, item, fromPos, itemEx, toPos)

if isWatchingTv(cid) then
return true
end

local checkPos = toPos
checkPos.stackpos = 0

if getTileThingByPos(checkPos).itemid <= 0 then
   return true
end

if not isInArray(waters, getTileInfo(toPos).itemid) then
   return true
end

if getPlayerStorageValue(cid, storageP) == 1 then 
    doSendMsg(cid, "Aguarde! Você já está pescando.")
    return true
end

if isRiderOrFlyOrSurf(cid) and not canFishWhileSurfingOrFlying then
   doPlayerSendCancel(cid, "You can't fish while surfing/flying.")
   return true
end

if getTileInfo(getThingPos(getCreatureSummons(cid)[1] or cid)).protection then
    doPlayerSendCancel(cid, "You can't fish pokémons if you or your pokémon is in protection zone.")
return true
end

local delay = fishing[getPlayerStorageValue(cid, sto_iscas)].segs

if getPlayerStorageValue(cid, sto_iscas) ~= -1 then
   if getPlayerItemCount(cid, getPlayerStorageValue(cid, sto_iscas)) >= 1 then
      doPlayerRemoveItem(cid, getPlayerStorageValue(cid, sto_iscas), 1)
   else
      setPlayerStorageValue(cid, sto_iscas, -1)
   end
end

setPlayerStorageValue(cid, storageP, 1)     --alterei looktype
doCreatureSetNoMove(cid, true)
local pos2 = getThingPos(itemEx.uid)
doCreatureSetLookDir(cid, getLookToFish(getThingPos(cid), pos2))  --alterado ver depois
doFish(cid, toPos, getThingPos(cid), math.random(5, delay))

return true
end

function getLookToFish(pos, pos2)
local x1, y1 = pos.x, pos.y
local x2, y2 = pos2.x, pos2.y

if x1-x2 <= 0 and  y1-y2 > 0 then
    return NORTH
elseif x1-x2 < 0 and  y1-y2 == 0 then
    return EAST
elseif x1-x2 < 0 and  y1-y2 < 0 then
    return EAST
elseif x1-x2 > 0 and  y1-y2 < 0 then
    return SOUTH
elseif x1-x2 > 0 and  y1-y2 <= 0 then
    return WEST
elseif x1-x2 > 0 and  y1-y2 >= 0 then
    return WEST
elseif x1-x2 < 0 and  y1-y2 < 0 then
    return EAST
elseif x1-x2 == 0 and  y1-y2 < 0 then
    return SOUTH
end
return WEST
end

 

Editado por victor0707 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

@victor0707, testa aí meu chapa:

local fishing = {
	[-1] = { segs = 5, pokes = {{"Magikarp", 5}} },
	
	[3976] = { segs = 5, pokes = {{"Horsea", 5}, {"Goldeen", 3}, {"Poliwag", 2}} }, -- pega no client da pxg
	
	[12855] = { segs = 5, pokes = {{"Tentacool", 3}, {"Staryu", 2}, {"Krabby", 3}, {"Shellder", 2} } },
	
	[12854] = { segs = 5, pokes = {{"Seel", 2}, {"squirtle", 2} } },
	
	[12858] = { segs = 5, pokes = {{"Seaking", 2}, {"Seadra", 2}, {"Poliwhirl", 2}} },
	
	[12857] = { segs = 5, pokes = {{"Starmie", 2}, {"Kingler", 2}, {"Wartortle", 2}, {"Slowbro", 2}} }, -- pega no client da pxg
	
	[12860] = { segs = 5, pokes = {{"Starmie", 3}, {"Dewgong", 3}}},
	
	[12859] = { segs = 5, pokes = {{"Cloyster", 2}, {"Poliwrath", 2}, {"Dewgong", 4}, {"Golduck", 1}} },
	
	[12856] = { segs = 5, pokes = {{"Dratini", 3}, {"Dragonair", 2} }},
	
	[12853] = { segs = 5, pokes = {{"Gyarados", 1}, {"Blastoise", 1}, {"Tentacruel", 1}, {"Lapras", 1}} },
}

local storageP = 154585
local sto_iscas = 5648454 --muda aki pra sto q ta no script da isca
local bonus = 30
local limite = 100


local function doFish(cid, pos, ppos, interval)
	if not isCreature(cid) then return false end
	
	if(getCreatureSummons(cid)[1]) then
		if getCreatureSummons(cid)[1].x ~= getCreatureSummons(cid)[1].x or getCreatureSummons(cid)[1].y ~= getCreatureSummons(cid)[1].y then
			return false 
		end
	else
		if getThingPos(cid).x ~= ppos.x or getThingPos(cid).y ~= ppos.y then
			return false 
		end
	end
		
	if getThingPos(cid).x ~= ppos.x or getThingPos(cid).y ~= ppos.y then
		return false 
	end
	
	if getPlayerSkillLevel(cid, 6) < 10 then
		fishing = {
			[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 3}, {"Poliwag", 2}} },
		}
	elseif getPlayerSkillLevel(cid, 6) < 15 then
		fishing = {
			[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 3}, {"Poliwag", 2}, {"Tentacool", 3}, {"Staryu", 2}, {"Krabby", 3}, {"Shellder", 2}} },
		}
	elseif getPlayerSkillLevel(cid, 6) < 20 then
		fishing = {
			[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 3}, {"Poliwag", 2}, {"Tentacool", 3}, {"Staryu", 2}, {"Krabby", 3}, {"Shellder", 2}, {"Seel", 2}, {"squirtle", 2}} },
		}
	elseif getPlayerSkillLevel(cid, 6) < 25 then
		fishing = {
					[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 3}, {"Poliwag", 2}, {"Tentacool", 3}, {"Staryu", 2}, {"Krabby", 3}, {"Shellder", 2}, {"Seel", 2}, {"squirtle", 2},
			{"Seaking", 2}, {"Seadra", 2}, {"Poliwhirl", 2}} },
		}
	elseif getPlayerSkillLevel(cid, 6) < 30 then
		fishing = {
					[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 3}, {"Poliwag", 2}, {"Tentacool", 3}, {"Staryu", 2}, {"Krabby", 3}, {"Shellder", 2}, {"Seel", 2}, {"squirtle", 2},
			{"Seaking", 2}, {"Seadra", 2}, {"Poliwhirl", 2}, {"Starmie", 2}, {"Kingler", 2}, {"Wartortle", 2}, {"Slowbro", 2}} },
		}
	elseif getPlayerSkillLevel(cid, 6) < 35 then
		fishing = {
					[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 3}, {"Poliwag", 2}, {"Tentacool", 3}, {"Staryu", 2}, {"Krabby", 3}, {"Shellder", 2}, {"Seel", 2}, {"squirtle", 2},
			{"Seaking", 2}, {"Seadra", 2}, {"Poliwhirl", 2}, {"Starmie", 2}, {"Kingler", 2}, {"Wartortle", 2}, {"Slowbro", 2}, {"Starmie", 3}, {"Dewgong", 3}} },
		}
	elseif getPlayerSkillLevel(cid, 6) < 40 then
		fishing = {
					[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 3}, {"Poliwag", 2}, {"Tentacool", 3}, {"Staryu", 2}, {"Krabby", 3}, {"Shellder", 2}, {"Seel", 2}, {"squirtle", 2},
			{"Seaking", 2}, {"Seadra", 2}, {"Poliwhirl", 2}, {"Starmie", 2}, {"Kingler", 2}, {"Wartortle", 2}, {"Slowbro", 2}, {"Starmie", 3}, {"Dewgong", 3}, {"Cloyster", 2}, {"Poliwrath", 2}, {"Dewgong", 4}, {"Golduck", 1}} },
		}
	elseif getPlayerSkillLevel(cid, 6) < 45 then
		fishing = {
					[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 3}, {"Poliwag", 2}, {"Tentacool", 3}, {"Staryu", 2}, {"Krabby", 3}, {"Shellder", 2}, {"Seel", 2}, {"squirtle", 2},
					{"Seaking", 2}, {"Seadra", 2}, {"Poliwhirl", 2}, {"Starmie", 2}, {"Kingler", 2}, {"Wartortle", 2}, {"Slowbro", 2}, {"Starmie", 3}, {"Dewgong", 3}, {"Cloyster", 2}, {"Poliwrath", 2}, {"Dewgong", 4}, {"Golduck", 1},
			{"Dratini", 3}, {"Dragonair", 2}} },
		}
	elseif getPlayerSkillLevel(cid, 6) < 50 then
		fishing = {
					[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
					{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Starmie", 3}, {"Dewgong", 3}, {"Cloyster", 3}, {"Poliwrath", 3}, {"Dewgong", 4}, {"Golduck", 3},
			{"Dratini", 3}, {"Dragonair", 3}, {"Gyarados", 2}, {"Blastoise", 2}, {"Tentacruel", 2}, {"Lapras", 2}} },
		}
	elseif getPlayerSkillLevel(cid, 6) < 55 then
		fishing = {
					[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
					{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
			{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}} },
		}
	elseif getPlayerSkillLevel(cid, 6) < 60 then
		fishing = {
					[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
					{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
			{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 3}, {"Totodile", 3}, {"Chinchou", 3}, {"Marill", 3}} },
		}
	elseif getPlayerSkillLevel(cid, 6) < 65 then
		fishing = {
					[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
					{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
			{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 3}, {"Totodile", 3}, {"Chinchou", 3}, {"Marill", 3}, {"Qwilfish", 3}, {"Croconaw", 3}} },
		}
	elseif getPlayerSkillLevel(cid, 6) < 70 then
		fishing = {
					[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
					{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
					{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 3}, {"Totodile", 3}, {"Chinchou", 3}, {"Marill", 3}, {"Qwilfish", 3}, {"Croconaw", 3},
			{"wooper", 5}, {"Azumarill", 3}, {"Corsola", 3}} },
		}
	elseif getPlayerSkillLevel(cid, 6) < 75 then
		fishing = {
					[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
					{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
					{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 3}, {"Totodile", 3}, {"Chinchou", 3}, {"Marill", 3}, {"Qwilfish", 3}, {"Croconaw", 3},
			{"wooper", 5}, {"Azumarill", 3}, {"Corsola", 3}, {"Octillery", 3}, {"Politoed", 3}, {"Quagsire", 3}, {"Lanturn", 3}} },
		}
	elseif getPlayerSkillLevel(cid, 6) < 80 then
		fishing = {
					[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
					{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
					{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 3}, {"Totodile", 3}, {"Chinchou", 3}, {"Marill", 3}, {"Qwilfish", 3}, {"Croconaw", 3},
			{"wooper", 5}, {"Azumarill", 3}, {"Corsola", 3}, {"Octillery", 3}, {"Politoed", 3}, {"Quagsire", 3}, {"Lanturn", 3}, {"Feraligatr", 3}, {"Vaporeon", 3}, {"Kingdra", 3}, {"Mantine", 3}} },
		}
	elseif getPlayerSkillLevel(cid, 6) < 85 then
		fishing = {
					[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
					{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
					{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 5}, {"Totodile", 5}, {"Chinchou", 5}, {"Marill", 5}, {"Qwilfish", 5}, {"Croconaw", 5},
			{"wooper", 5}, {"Azumarill", 3}, {"Corsola", 3}, {"Octillery", 3}, {"Politoed", 3}, {"Quagsire", 3}, {"Lanturn", 3}, {"Feraligatr", 3}, {"Vaporeon", 3}, {"Kingdra", 3}, {"Mantine", 3}, {"Slowking", 3}} },
		}
	elseif getPlayerSkillLevel(cid, 6) < 90 then
		fishing = {
					[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
					{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
					{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 5}, {"Totodile", 5}, {"Chinchou", 5}, {"Marill", 5}, {"Qwilfish", 5}, {"Croconaw", 5},
			{"wooper", 5}, {"Azumarill", 5}, {"Corsola", 5}, {"Octillery", 5}, {"Politoed", 5}, {"Quagsire", 5}, {"Lanturn", 5}, {"Feraligatr", 5}, {"Vaporeon", 5}, {"Kingdra", 3}, {"Mantine", 3}, {"Slowking", 3}} },
		}
	elseif getPlayerSkillLevel(cid, 6) < 95 then
		fishing = {
					[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
					{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
					{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 5}, {"Totodile", 5}, {"Chinchou", 5}, {"Marill", 5}, {"Qwilfish", 5}, {"Croconaw", 5},
			{"wooper", 5}, {"Azumarill", 5}, {"Corsola", 5}, {"Octillery", 5}, {"Politoed", 5}, {"Quagsire", 5}, {"Lanturn", 5}, {"Feraligatr", 5}, {"Vaporeon", 5}, {"Kingdra", 5}, {"Mantine", 5}, {"Slowking", 5}} },
		}
	elseif getPlayerSkillLevel(cid, 6) < 100 then
		fishing = {
					[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
					{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
					{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 5}, {"Totodile", 5}, {"Chinchou", 5}, {"Marill", 5}, {"Qwilfish", 5}, {"Croconaw", 5},
					{"wooper", 5}, {"Azumarill", 5}, {"Corsola", 5}, {"Octillery", 5}, {"Politoed", 5}, {"Quagsire", 5}, {"Lanturn", 5}, {"Feraligatr", 5}, {"Vaporeon", 5}, {"Kingdra", 5}, {"Mantine", 5}, {"Slowking", 5},
			{"Carvanha", 3}, {"Barboach", 3}, {"Clamperl", 3}, {"Spheal", 3}, {"Corphish", 3}} },
		}
	elseif getPlayerSkillLevel(cid, 6) < 105 then
		fishing = {
					[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
					{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
					{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 5}, {"Totodile", 5}, {"Chinchou", 5}, {"Marill", 5}, {"Qwilfish", 5}, {"Croconaw", 5},
					{"wooper", 5}, {"Azumarill", 5}, {"Corsola", 5}, {"Octillery", 5}, {"Politoed", 5}, {"Quagsire", 5}, {"Lanturn", 5}, {"Feraligatr", 5}, {"Vaporeon", 5}, {"Kingdra", 5}, {"Mantine", 5}, {"Slowking", 5},
			{"Carvanha", 3}, {"Barboach", 3}, {"Clamperl", 3}, {"Spheal", 3}, {"Corphish", 3}, {"Sharpedo", 2}, {"Whiscash", 2}, {"Huntail", 2}, {"Gorebyss", 2}, {"Huntail", 2}} },
		}
	elseif getPlayerSkillLevel(cid) >= 110 then
		fishing = {
					[-1] = { segs = 5, pokes = {{"Magikarp", 5}, {"Horsea", 5}, {"Goldeen", 5}, {"Poliwag", 5}, {"Tentacool", 5}, {"Staryu", 5}, {"Krabby", 5}, {"Shellder", 5}, {"Seel", 5}, {"squirtle", 5},
					{"Seaking", 5}, {"Seadra", 5}, {"Poliwhirl", 5}, {"Starmie", 5}, {"Kingler", 5}, {"Wartortle", 5}, {"Slowbro", 5}, {"Dewgong", 5}, {"Cloyster", 5}, {"Poliwrath", 5}, {"Golduck", 5},
					{"Dratini", 5}, {"Dragonair", 5}, {"Gyarados", 5}, {"Blastoise", 5}, {"Tentacruel", 5}, {"Lapras", 5}, {"Remoraid", 5}, {"Totodile", 5}, {"Chinchou", 5}, {"Marill", 5}, {"Qwilfish", 5}, {"Croconaw", 5},
					{"wooper", 5}, {"Azumarill", 5}, {"Corsola", 5}, {"Octillery", 5}, {"Politoed", 5}, {"Quagsire", 5}, {"Lanturn", 5}, {"Feraligatr", 5}, {"Vaporeon", 5}, {"Kingdra", 5}, {"Mantine", 5}, {"Slowking", 5},
			{"Carvanha", 5}, {"Barboach", 5}, {"Clamperl", 5}, {"Spheal", 5}, {"Corphish", 5}, {"Sharpedo", 5}, {"Whiscash", 5}, {"Huntail", 5}, {"Gorebyss", 5}, {"Huntail", 5}} },
		}
	end
	
	
	doSendMagicEffect(pos, CONST_ME_LOSEENERGY)
	
	if interval > 0 then
		addEvent(doFish, 1000, cid, pos, ppos, interval-1)
		return true
	end 
	
	local peixe = 0
	local playerpos = getClosestFreeTile(cid, getThingPos(cid))
	local pokepos = getClosestFreeTile(getCreatureSummons(cid)[1], getThingPos(getCreatureSummons(cid)[1]))
	local fishes = fishing[getPlayerStorageValue(cid, sto_iscas)]
	local random = {} 
	
	if getPlayerSkillLevel(cid, 6) < limite then 
		doPlayerAddSkillTry(cid, 6, bonus * 5)
	end
	
	--[[if math.random(1, 100) <= chance then
	if getPlayerSkillLevel(cid, 6) < limite then
		doPlayerAddSkillTry(cid, 6, bonus * 5)
	end]]
	
	random = fishes.pokes[math.random(#fishes.pokes)]
	
	for i = 1, math.random(random[2]) do
		if(getCreatureSummons(cid)[1]) then
			peixe = doSummonCreature(random[1], playerpos)
		else
			peixe = doSummonCreature(random[1], pokepos)
		end
		if not isCreature(peixe) then
			setPlayerStorageValue(cid, storageP, -1)
			return true
		end
		setPokemonPassive(peixe, true)
		doSetPokemonAgressiveToPlayer(peixe, cid)
		setPlayerStorageValue(peixe, storageP, 1)
		if #getCreatureSummons(cid) >= 1 then
			doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 0)
			doChallengeCreature(getCreatureSummons(cid)[1], peixe)
		else 
			doSendMagicEffect(getThingPos(cid), 0)
			doChallengeCreature(cid, peixe)
		end
	end
	setPlayerStorageValue(cid, storageP, -1)
	doCreatureSetNoMove(cid, false)
	return true
end

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

function onUse(cid, item, fromPos, itemEx, toPos)
	
	if isWatchingTv(cid) then
		return true
	end
	
	local checkPos = toPos
	checkPos.stackpos = 0
	
	if getTileThingByPos(checkPos).itemid <= 0 then
		return true
	end
	
	if not isInArray(waters, getTileInfo(toPos).itemid) then
		return true
	end
	
	if getPlayerStorageValue(cid, storageP) == 1 then 
		doSendMsg(cid, "Aguarde! Você já está pescando.")
		return true
	end
	
	if isRiderOrFlyOrSurf(cid) and not canFishWhileSurfingOrFlying then
		doPlayerSendCancel(cid, "You can't fish while surfing/flying.")
		return true
	end
	
	if getTileInfo(getThingPos(getCreatureSummons(cid)[1] or cid)).protection then
		doPlayerSendCancel(cid, "You can't fish pokémons if you or your pokémon is in protection zone.")
		return true
	end
	
	local delay = fishing[getPlayerStorageValue(cid, sto_iscas)].segs
	
	if getPlayerStorageValue(cid, sto_iscas) ~= -1 then
		if getPlayerItemCount(cid, getPlayerStorageValue(cid, sto_iscas)) >= 1 then
			doPlayerRemoveItem(cid, getPlayerStorageValue(cid, sto_iscas), 1)
		else
			setPlayerStorageValue(cid, sto_iscas, -1)
		end
	end
	
	setPlayerStorageValue(cid, storageP, 1) --alterei looktype
	doCreatureSetNoMove(cid, true)
	local pos2 = getThingPos(itemEx.uid)
	doCreatureSetLookDir(cid, getLookToFish(getThingPos(cid), pos2)) --alterado ver depois
	doFish(cid, toPos, getThingPos(cid), math.random(5, delay))
	
	return true
end

function getLookToFish(pos, pos2)
	local x1, y1 = pos.x, pos.y
	local x2, y2 = pos2.x, pos2.y
	
	if x1-x2 <= 0 and y1-y2 > 0 then
		return NORTH
	elseif x1-x2 < 0 and y1-y2 == 0 then
		return EAST
	elseif x1-x2 < 0 and y1-y2 < 0 then
		return EAST
	elseif x1-x2 > 0 and y1-y2 < 0 then
		return SOUTH
	elseif x1-x2 > 0 and y1-y2 <= 0 then
		return WEST
	elseif x1-x2 > 0 and y1-y2 >= 0 then
		return WEST
	elseif x1-x2 < 0 and y1-y2 < 0 then
		return EAST
	elseif x1-x2 == 0 and y1-y2 < 0 then
		return SOUTH
	end
	return WEST
end

 

Programador PHP, Lua, Java, database administrator.

 

"Nada é verdade, tudo é permitido."

Requiescat in pace.

Link para o post
Compartilhar em outros sites

@Nazo Nao funcionou :/ , os pokemons pescados perto do player alguns aparecem na agua e da o erro : 

[24/01/2018 20:48:55] [Error - MoveEvent::executeStep] Call stack overflow.

Por causa o surf.lua que contém:

doTeleportThing(cid, fromPosition, false)

Causando um loop infinito e ocorre o risco do server cair.

Queria que os pokemons pescados aparecessem perto do meu pokemon para amenizar os casos desse bug.

 

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por LeoTK
      Salve galera neste tópico irei postar algumas prints do mapa do servidor para quem queira acompanhar e quem sabe até utilizar de inspiração para mapear o seu NTO.
       
      #Att 11/08/2022

       
       
       
       
      Konoha (Em Desenvolvimento)
       
       
       
       
    • Por DiigooMix
      Como o título já diz, será que alguém possui sprite do hitto e se possível as transformações dele?
    • Por OmegaZero
      Olá gostaria que alguém me ajudasse com uma "scripting" não sei se é pela mesma, seria o seguinte uma determinada arma teria a chance de dar double hit e não sei oque fazer alguem poderia ajudar?

      OBS:não sei se é o local correto se não for mova, desculpe
    • Por Madarasenju
      Olá galera do Tibia King, queria por uns npc's no meu server que não tem função de trade nem nada do tipo, queria que eles só andassem como enfeite, Rep+ Pra quem me ajudar... grato desde já.
    • Por SilenceRoot
      A magia é assim o você usa a a magia e ela ficará ativado por 10 segundos, até que o inimigo lance a primeira magia ou todos de uma vez, quando ele lançar a primeira magia, ele não lhe acertará ou seja esquivando dela, e logo em seguida será teletransportado aleatoriamente ao redor do inimigo que usou.
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo