Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Primeiramente obrigado por está lendo esse tópico, Sistema de pesca !

 

Fala galerinha do TK vim aqui hoje pedi uma ajuda a vocês, já faz algum tempo que venho tentando fazer um script de fishing meio complicado tentei fazer vários tópicos aqui mais ninguém me ajudou então, tentei manda mensagens para alguns membros pedindo ajuda o único que me respondeu e me ajudou foi o xWhiteWolf. Ele me ajudou o problema e que eu não sei nada de script, ele conseguiu passa os algoritmos do script tipo aquilo que eu tava pedindo pra ele só que ele não fez o script em si ele só o começou, gostaria que alguém terminasse ele pra me ajudar porfavor nunca achei ele e sempre quis colocar ele no meu servidor.

 

Oq é esse script?

 

É um sistema de pescar monstro de acordo com o Level e com o fishing, Por exemplo  se vc tiver lvl 800 mais so que ta com 105 de fishing vc so vai poder pescar Massive Water Elemental e Water elemental. Quando vc upar o fishing por exemplo pro 110 ae vc vai poder pescar Blood Crab, Massive Water Elemental, Water Elemental.
Espero que tenha alguma porcetagem para pescar os monstro por exemplo para pegar Water Elemental no lvl 400 e com 100 de fishing vc tera 5% de chance quando vc upar para o lvl 500 e estiver com 105 de fishing vc tera 10% de chance de  pegar Water Elemental e 5% de chance de pegar Massive Water Elemental, quando vc tiver level 600 e com 110 de fishing vc tera 15% de chance de pegar Water Elemental e 10% Massive Water Elemental e 5% de pegar Blood Crab quando vc tiver com lvl 700 e 120 fishing vc tera 20% de chance de pegar Water Elemental 15% de chance de pegar Massive Water Elemental 10% de chance de pegar Blood Crab e 5% de chance de pegar Quara Constrictor com lvl 800 e 130 de fishing vc tera 25% de chance de pescar Water Elemental e 20% Massive Water Elemental 15% Blood Constrictor 10% Quara Constrictor e 5% Quara Predator Scout.
Para poder upar o fishing vai ter que ficar muito tempo treinando tipo  vai ser bem dificil para o fishing subir, você tbm nao poderia pescar em aréas pz, caso o player não tivesse apareceria uma mensagem avisando que ele precisa estar em pz se o player tiver o fishing 100 mais nao tiver no minimo lvl 400 ele não poderia pescar monstros, enquanto o player tivesse pescando normal para subir seu fishing ele poderia pegar peixe tbm para dar mais rpg. Qualquer duvida so me perguntar 

 

Já tenho um script ele só pesca monstro e não precisa de level e nem de level de fishing para poder pegar o script é esse

 

-- My Fat Doll improvisando nos otserver ;~
-- Fishing v 1.0 05/04/2013
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
--Config--
local Bait = 2671 -- ID da isca
local needBait = false -- Precisa de isca? TRUE/FALSE
local FishRate = 1.0 -- Rate de fish
local time = 1 -- Tempo pra pescar denovo (em segundos)
local fishable = {"Water Elemental", "Massive Water Elemental", "Blood Crab", "Quara Constrictor", "Quara Predator Scout", "Quara Predator", "Quara Pincher Scout", "Quara Pincher", "Quara Mantassin Scout", "Quara Mantassin", "Quara Hydromancer Scout", "Quara Constrictor Scout", "Quara Hydromancer"} --Pescados
local message1 = "You need "..getItemNameById(Bait).."s to fish!" -- Mensagem se não tiver iscas!
local message2 = "You must wait few seconds!"  --Mensagem se tiver pescando muito rapido
--Config End--
 
-- Não mecha --
local storage = 5560
local waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625}
 
if not getTilePzInfo(getCreaturePosition(cid)) then
if needBait == TRUE then
if getPlayerItemCount(cid, Bait) > 0 then
if exhaustion.get(cid, storage) == FALSE then
exhaustion.set(cid, storage, time)
doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
if isInArray(waterIds, itemEx.itemid) == TRUE then
doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
if itemEx.itemid ~= 493 then
if math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) <= (getPlayerSkill(cid, SKILL_FISHING)*FishRate) then
doPlayerRemoveItem(cid, Bait, 1)
doCreateMonster(fishable[math.random(#fishable)], getPlayerPosition(cid))
end
end
end
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, message2)
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, message1)
end
return FALSE
end
 
if needBait == FALSE then
if exhaustion.get(cid, storage) == FALSE then
exhaustion.set(cid, storage, time)
doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
 
if isInArray(waterIds, itemEx.itemid) == TRUE then
doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
if itemEx.itemid ~= 493 then
if math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) <= (getPlayerSkill(cid, SKILL_FISHING)*FishRate) then
doCreateMonster(fishable[math.random(#fishable)], getPlayerPosition(cid))
end
end
 
end
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, message2)
end
end
return FALSE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't fish in a protection zone!")
end
end

 

No que o xWhiteWolf me ajudou ?

 

Ele fez os algoritmos do jeito que eu queria só que ele não o adicionou no script e eu como não manjo disso não sei como fazer, mais gostaria mesmo que alguém me ajudasse tem muito tempo que to correndo atras disso e nunca consigo dessa vez consegui uma ajuda ta 50% feito falta só terminar, os os algoritmos do xWhiteWolf abaixo.

 

-- tabela de nivel
-- [nivel] = {level, fishing}
local tablelevel = {
  [1] = {400, 100},
  [2] = {500, 105},
  [3] = {600, 110},
  [4] = {700, 120},
  [5] = {800, 130}
}
-- tabela de monstros
-- [nivel] = monstro adicionado
-- note que se voce for nivel 3 vc tera os monstros do 2 e do 1 tambem.
local tablemonsters = {
  [1] = "Water Elemental",
  [2] = "Massive Water Elemental",
  [3] = "Blood Crab",
  [4] = "Quara Constrictor",
  [5] = "Quara Predator Scout"
}

-- Aqui eu defino valores aleatorios de level e de fishing de um suposto player e printo esses valores
plvl, fishing = math.random(300, 1000), math.random(95, 140)
print("Nivel "..plvl..". Fishing: ".. fishing)
--- isso aqui so serve para testes mas lembre-se de que plvl tem que ser igual a getCreatureLevel(cid) 
-- e que fishing tem que ser getPlayerSkill(cid, SKILL_FISHING)


-- aqui fazemos o algoritmo para definir qual o level de pesca o player sera
local level = 0
for i, lvl in ipairs(tablelevel) do
  if plvl >= lvl[1] and fishing >= lvl[2] then
    level = i
  else break
  end
end
print("Level: ".. level)
-- a partir daqui o level do player pode ser pego atraves da variavel "level"

-- aqui nos retornamos a tabela de monstros pescaveis pelo player
local fishable = {} -- partimos de uma tabela vazia
for i, mob in ipairs(tablemonsters) do
  if level >= i then
    fishable[#fishable + 1] = {chance = 5 * (level - i + 1), monster = mob}
  end
end
-- pra cada monstro temos uma chance associada que vai variar do nivel do player e da dificuldade do monstro


-- printando tudo que tem em fishable
for i = 1, #fishable do 
  print(fishable.chance, fishable.monster)
end
-- isso aqui é só pra testar que funciona


-- retornando oque vai pescar
local get = false -- nao vai pescar nada de inicio
for i = 1, #fishable do
  if fishable.chance >= math.random(1, 100) then
    get = fishable.monster
    break
  end
end

if not get then -- se nao pescou nada, da peixe
  print("pescou peixe")
else -- se pescou algo, falar oque pescou/criar a criatura
  print("pescou ".. get)
end

 

Bom é isso pessoa espero mesmo que alguém possa me ajuda, abraço !!

 

 

A esse video monstra como funciona 

 

 

 


 

 

Mesmo desacreditado e ignorado por todos, não posso desistir, pois para mim, vencer é nunca desistir !

 

                                                     tibiagif.gif

 

                                                    (y)  :trollface: By: Thenebrozo  :HAHAHA:  (y) 

 

Link para o post
Compartilhar em outros sites
  • Respostas 17
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

não é por nada não mas achei que a pessoa que fosse te ajudar seguiria meu modelo de algoritmo. Já que o vod praticamente ignorou meu código eu decidi fazer um script de pesca com base no que eu já ha

testa o do vodkart, se funcionar troca essa linha aqui do meu: doCreateMonster(get, fromPosition) por doCreateMonster(get, getCreaturePosition(cid)) Tecnicamente as duas eram pra dar errado,

@Thenebrozo Sei que o seu problema já foi resolvido, mas o vídeo que você postou é do meu server que nunca abri kk O script que eu usava está postado logo abaixo :   PS : Desculpe reviv

local t = {
	[{100,105}] = {{5,"Water Elemental"}},
	[{106,110}] = {{5,"Massive Water Elemental"}, {10,"Water Elemental"}}, 
	[{111,119}] = {{5,"Blood Crab"},{10,"Massive Water Elemental"},{15,"Water Elemental"}}, 
	[{120,129}] = {{5,"Quara Constrictor"},{10,"Blood Crab"},{15,"Massive Water Elemental"},{20,"Water Elemental"}},
	[{130,math.huge}] = {{5,"Quara Predator Scout"},{10,"Quara Constrictor"},{15,"Blood Crab"}, {20,"Massive Water Elemental"},{25,"Water Elemental"}}
}
local lvl, fish_level = 400, 100
local useWorms = true
local waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isInArray(waterIds, itemEx.itemid) == TRUE then
		if itemEx.itemid ~= 493 then
			if getPlayerLevel(cid) >= lvl and getPlayerSkill(cid, SKILL_FISHING) >= fish_level then
				for v , r in pairs(t) do
					if getPlayerSkill(cid, SKILL_FISHING) >= v[1] and getPlayerSkill(cid, SKILL_FISHING) <= v[2] then
						for _ , var in pairs(r) do
							if var[1] > math.random(1, 100) then 
								doCreateMonster(var[2], getPlayerPosition(cid)) return true
							end
						end
					end
				end
			end
				if math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) <= getPlayerSkill(cid, SKILL_FISHING) then
					if useWorms then
						if getPlayerItemCount(cid, ITEM_WORM) > 0 then
							doPlayerRemoveItem(cid, ITEM_WORM, 1)
							doPlayerAddItem(cid, ITEM_FISH, 1)
						end
					else
						doPlayerAddItem(cid, ITEM_FISH, 1)
					end
				end
				doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
			end
			doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
			return true
		end
	return false
end

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
18 minutos atrás, Vodkart disse:

local t = {
	[{100,105}] = {{5,"Water Elemental"}},
	[{106,110}] = {{5,"Massive Water Elemental"}, {10,"Water Elemental"}}, 
	[{111,119}] = {{5,"Blood Crab"},{10,"Massive Water Elemental"},{15,"Water Elemental"}}, 
	[{120,129}] = {{5,"Quara Constrictor"},{10,"Blood Crab"},{15,"Massive Water Elemental"},{20,"Water Elemental"}},
	[{130,math.huge}] = {{5,"Quara Predator Scout"},{10,"Quara Constrictor"},{15,"Blood Crab"}, {20,"Massive Water Elemental"},{25,"Water Elemental"}}
}
local lvl, fish_level = 400, 100
local useWorms = true
local waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isInArray(waterIds, itemEx.itemid) == TRUE then
		if itemEx.itemid ~= 493 then
			if getPlayerLevel(cid) >= lvl and getPlayerSkill(cid, SKILL_FISHING) >= fish_level then
				for v , r in pairs(t) do
					if getPlayerSkill(cid, SKILL_FISHING) >= v[1] and getPlayerSkill(cid, SKILL_FISHING) <= v[2] then
						for _ , var in pairs(r) do
							if var[1] > math.random(1, 100) then 
								doCreateMonster(var[2], getPlayerPosition(cid)) return true
							end
						end
					end
				end
			end
				if math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) <= getPlayerSkill(cid, SKILL_FISHING) then
					if useWorms then
						if getPlayerItemCount(cid, ITEM_WORM) > 0 then
							doPlayerRemoveItem(cid, ITEM_WORM, 1)
							doPlayerAddItem(cid, ITEM_FISH, 1)
						end
					else
						doPlayerAddItem(cid, ITEM_FISH, 1)
					end
				end
				doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
			end
			doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
			return true
		end
	return false
end

 

irei testar aqui e jaja te falo obrigado !

cara deu certo me Deus não to acreditando se é um Deus muito obrigado msm so tem um problema não tem level para pegar os bichos por exemplo pega tall montro em tall lvl so isso o resto ta tudo certinho 

Mesmo desacreditado e ignorado por todos, não posso desistir, pois para mim, vencer é nunca desistir !

 

                                                     tibiagif.gif

 

                                                    (y)  :trollface: By: Thenebrozo  :HAHAHA:  (y) 

 

Link para o post
Compartilhar em outros sites
18 minutos atrás, Thenebrozo disse:

irei testar aqui e jaja te falo obrigado !

cara deu certo me Deus não to acreditando se é um Deus muito obrigado msm so tem um problema não tem level para pegar os bichos por exemplo pega tall montro em tall lvl so isso o resto ta tudo certinho 

 

como assim não tem level?

 

você não disse que seria tudo acima de level 400 e os monstro só iriam depender do fish skill?

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites

-- tabela de nivel
-- [nivel] = {level, fishing}
local tablelevel = {
  [1] = {400, 100},
  [2] = {500, 105},
  [3] = {600, 110},
  [4] = {700, 120},
  [5] = {800, 130}

 

para cada bicho tem um level e um fishing  por exemplo lvl 400 com 100 de fishing vc pescaria water elemental 

 

lvl 500 com fishing 105 continuaria pescando water elemental e passaria pescar tbm  Massive Water Elemental 

 

Espero que tenha alguma porcetagem para pescar os monstro por exemplo para pegar Water Elemental no lvl 400 e com 100 de fishing vc tera 5% de chance quando vc upar para o lvl 500 e estiver com 105 de fishing vc tera 10% de chance de  pegar Water Elemental e 5% de chance de pegar Massive Water Elemental, quando vc tiver level 600 e com 110 de fishing vc tera 15% de chance de pegar Water Elemental e 10% Massive Water Elemental e 5% de pegar Blood Crab quando vc tiver com lvl 700 e 120 fishing vc tera 20% de chance de pegar Water Elemental 15% de chance de pegar Massive Water Elemental 10% de chance de pegar Blood Crab e 5% de chance de pegar Quara Constrictor com lvl 800 e 130 de fishing vc tera 25% de chance de pescar Water Elemental e 20% Massive Water Elemental 15% Blood Constrictor 10% Quara Constrictor e 5% Quara Predator Scout.

 

aqui eu to explicando como seria apartir do 400 vc pescaria mais os outro bicho para cima pra cima n por exemplo o Massive Water Elemental seria lvl 500 lvl 400 nao poderia pescar

 

 

Mesmo desacreditado e ignorado por todos, não posso desistir, pois para mim, vencer é nunca desistir !

 

                                                     tibiagif.gif

 

                                                    (y)  :trollface: By: Thenebrozo  :HAHAHA:  (y) 

 

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 Lekstar
      Fala galera do TK !
       
      estou utilizando um servidor Frozen-Hell, estou testando todas as actions, quests e etc.. e encontrei um bug. se o player chega ao skills 200 de fishing toda e qualquer fishing rod para de funcionar imediatamente, segue o erro :
       
       e em seguida meu script :
       
       
      Acho que o erro está relacionado ao random.math e ao maxchance2, nao tenho certeza pois nao entendo muito deste assunto. aguardo ajuda, obrigado !
       
       
      PS :  Se alguem tiver um event_shop para me ajudar, o que estou utilizando também está bugado, gostaria de saber como fazer um shop apenas clicando nos items e ao invés de utilizar dinheiro ele utilizara Event tokens, obrigado.
      Segue a imagem do shop :
       

       
       
      PS²: Sou novo no forum, se meu topico estiver irregular por favor me avisem !
       
      Att. Pedro H Chaves
    • Por TsplayerT
      ALO COM QUE EU FALO?
       
      Gente meu Script Fishing System do meu server de PokeTibia com Level System é para fazer com que o Player só possa pescar com a X outfit, porem isso não ocorre ele diz: You are already fishing (Você já está pescando) e nem apareçe animação de pesca ou nada do tipo e com qualquer outfit... pf me ajudem
       
      Arquivo encontrado em: Server\data\actions\scripts\tools\fishing.lua
       



      REP+ E VLW
    • Por Werner
      Acabei de criar o meu OTSERV, mas estou com um problema, o comando /t está me levando para um local errado, o comando me leva para 361, 301, 7, mas deveria levar para 160, 50, 8
      REP+ para quem estar me ajudando com esse problema.
       
      Meu server: infinity-sky.sytes.net
       

    • Por Thenebrozo
      gostaria que alguém me ajuda se com isso, queria colocar para pescar de acordo com level e fishing aqui esta o escript 
       
      -- My Fat Doll improvisando nos otserver ;~
      -- Fishing v 1.0 05/04/2013
       
      function onUse(cid, item, fromPosition, itemEx, toPosition)
      --Config--
      local Bait = 2671 -- ID da isca
      local needBait = false -- Precisa de isca? TRUE/FALSE
      local FishRate = 1.0 -- Rate de fish
      local time = 1 -- Tempo pra pescar denovo (em segundos)
      local fishable = {"Water Elemental", "Massive Water Elemental", "Blood Crab", "Quara Constrictor", "Quara Predator Scout", "Quara Predator", "Quara Pincher Scout", "Quara Pincher", "Quara Mantassin Scout", "Quara Mantassin", "Quara Hydromancer Scout", "Quara Constrictor Scout", "Quara Hydromancer"} --Pescados
      local message1 = "You need "..getItemNameById(Bait).."s to fish!" -- Mensagem se não tiver iscas!
      local message2 = "You must wait few seconds!"  --Mensagem se tiver pescando muito rapido
      --Config End--
       
      -- Não mecha --
      local storage = 5560
      local waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625}
       
      if not getTilePzInfo(getCreaturePosition(cid)) then
      if needBait == TRUE then
      if getPlayerItemCount(cid, Bait) > 0 then
      if exhaustion.get(cid, storage) == FALSE then
      exhaustion.set(cid, storage, time)
      doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
      if isInArray(waterIds, itemEx.itemid) == TRUE then
      doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
      if itemEx.itemid ~= 493 then
      if math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) <= (getPlayerSkill(cid, SKILL_FISHING)*FishRate) then
      doPlayerRemoveItem(cid, Bait, 1)
      doCreateMonster(fishable[math.random(#fishable)], getPlayerPosition(cid))
      end
      end
      end
      return TRUE
      else
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, message2)
      end
      else
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, message1)
      end
      return FALSE
      end
       
      if needBait == FALSE then
      if exhaustion.get(cid, storage) == FALSE then
      exhaustion.set(cid, storage, time)
      doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
       
      if isInArray(waterIds, itemEx.itemid) == TRUE then
      doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
      if itemEx.itemid ~= 493 then
      if math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) <= (getPlayerSkill(cid, SKILL_FISHING)*FishRate) then
      doCreateMonster(fishable[math.random(#fishable)], getPlayerPosition(cid))
      end
      end
       
      end
      return TRUE
      else
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, message2)
      end
      end
      return FALSE
      else
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't fish in a protection zone!")
      end
      end
    • Por noharis
      Olá gostaria da ajuda de vcs, estou com um problema no meu servidor.
      Quando eu tento pescar usando as iscas " Steak - Special Lure - Misty's Special Lure - Big Steak " o char não pesca fica bugado...
      Olhei se achava algum post em relação a este erro, não encontrei...
       
       
       
       
      Se alguém poder me ajudar, fico muito agradecido.

  • Estatísticas dos Fóruns

    96852
    Tópicos
    519617
    Posts



×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo