Ir para conteúdo

New Fishing System


nyuchiha

Posts Recomendados

Eai gente, estarei postando um sistema de pesca que eu usava aqui parecido com o do Pokemon Adventures

Não sei se alguem ja posto, + qualquer coisa já fica pelo menos pra umas pessoas que pediram.



Basta Substituir o seu arquivo Fishing em Actions/Scripts/tools por esse:

( Sempre faça uma copia do seu, caso venha a se arrepender )



V1.0

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

d0 = 
{
[0] = {pokemon = 'Magikarp'}, 
}

d20 = 
{
[0] = {pokemon = 'Magikarp'}, 
[1] = {pokemon = 'Horsea'}, 
[2] = {pokemon = 'Poliwag'}, 
[3] = {pokemon = 'Goldeen'}, 
[4] = {pokemon = 'Krabby'}, 
}

d40 = 
{
[0] = {pokemon = 'Magikarp'}, 
[1] = {pokemon = 'Horsea'}, 
[2] = {pokemon = 'Poliwag'}, 
[3] = {pokemon = 'Goldeen'}, 
[4] = {pokemon = 'Krabby'}, 
[5] = {pokemon = 'Tentacool'}, 
}

d60 = 
{
[0] = {pokemon = 'Magikarp'}, 
[1] = {pokemon = 'Horsea'}, 
[2] = {pokemon = 'Poliwag'}, 
[3] = {pokemon = 'Goldeen'}, 
[4] = {pokemon = 'Krabby'}, 
[5] = {pokemon = 'Tentacool'}, 
[6] = {pokemon = 'Seaking'},
}

d80 = 
{
[0] = {pokemon = 'Magikarp'}, 
[1] = {pokemon = 'Horsea'}, 
[2] = {pokemon = 'Poliwag'}, 
[3] = {pokemon = 'Goldeen'}, 
[4] = {pokemon = 'Krabby'}, 
[5] = {pokemon = 'Tentacool'}, 
[6] = {pokemon = 'Seaking'}, 
[7] = {pokemon = 'Starmie'}, 
[8] = {pokemon = 'Kingler'}, 
[9] = {pokemon = 'Seadra'}, 
}

d100 = 
{
[0] = {pokemon = 'Magikarp'}, 
[1] = {pokemon = 'Horsea'}, 
[2] = {pokemon = 'Poliwag'}, 
[3] = {pokemon = 'Goldeen'}, 
[4] = {pokemon = 'Krabby'}, 
[5] = {pokemon = 'Tentacool'}, 
[6] = {pokemon = 'Seaking'}, 
[7] = {pokemon = 'Starmie'}, 
[8] = {pokemon = 'Kingler'}, 
[9] = {pokemon = 'Seadra'}, 
[10] = {pokemon = 'Starmie'}, 
[11] = {pokemon = 'Kingler'}, 
[12] = {pokemon = 'Seadra'}, 

}
local config = {
waters = {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},
}



local skill = getPlayerSkillLevel(cid, 6)
local playerpos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}


function Effect()
doSendMagicEffect(toPos, CONST_ME_LOSEENERGY)
end

function Say()
if skill >= 0 and skill < 20 then
local random = math.random(0, 0)
doSendMagicEffect(getThingPos(cid), 173)
doSummonCreature(d0[random].pokemon, playerpos)
doCreatureSetNoMove(cid, 0)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)

elseif skill >= 20 and skill < 40 then
local random = math.random(0, 4)
doSendMagicEffect(getThingPos(cid), 173)
doSummonCreature(d20[random].pokemon, playerpos)
doCreatureSetNoMove(cid, 0)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)

elseif skill >= 40 and skill < 60 then
local random = math.random(0, 5)
doSendMagicEffect(getThingPos(cid), 173)
doSummonCreature(d40[random].pokemon, playerpos)
doCreatureSetNoMove(cid, 0)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)

elseif skill >= 60 and skill < 80 then
local random = math.random(0, 6)
doSendMagicEffect(getThingPos(cid), 173)
doSummonCreature(d60[random].pokemon, playerpos)
doCreatureSetNoMove(cid, 0)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)

elseif skill >= 80 and skill < 100 then
local random = math.random(0, 9)
doSendMagicEffect(getThingPos(cid), 173)
doSummonCreature(d80[random].pokemon, playerpos)
doCreatureSetNoMove(cid, 0)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)

elseif skill >= 100 then
local random = math.random(0, 12)
doSendMagicEffect(getThingPos(cid), 173)
doSummonCreature(d100[random].pokemon, playerpos)
doCreatureSetNoMove(cid, 0)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
end
end

if(isInArray(config.waters, itemEx.itemid)) and getPlayerStorageValue(cid, 171833) >= 1 then
return false
end

if(isInArray(config.waters, itemEx.itemid)) and getPlayerStorageValue(cid, 171833) <= 0 then
setPlayerStorageValue(cid, 171833, 1)
doCreatureSetNoMove(cid, 1)
for i = 1,6 do
addEvent(Effect,500*i,cid)
end
addEvent(Say,3000)
return true
end
return true
end

V2.0


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

d0 = 
{
[0] = {pokemon = 'Magikarp'}, 
}

d20 = 
{
[0] = {pokemon = 'Magikarp'}, 
[1] = {pokemon = 'Horsea'}, 
[2] = {pokemon = 'Poliwag'}, 
[3] = {pokemon = 'Goldeen'}, 
[4] = {pokemon = 'Krabby'}, 
}

d40 = 
{
[0] = {pokemon = 'Magikarp'}, 
[1] = {pokemon = 'Horsea'}, 
[2] = {pokemon = 'Poliwag'}, 
[3] = {pokemon = 'Goldeen'}, 
[4] = {pokemon = 'Krabby'}, 
[5] = {pokemon = 'Tentacool'}, 
}

d60 = 
{
[0] = {pokemon = 'Magikarp'}, 
[1] = {pokemon = 'Horsea'}, 
[2] = {pokemon = 'Poliwag'}, 
[3] = {pokemon = 'Goldeen'}, 
[4] = {pokemon = 'Krabby'}, 
[5] = {pokemon = 'Tentacool'}, 
[6] = {pokemon = 'Seaking'},
}

d80 = 
{
[0] = {pokemon = 'Magikarp'}, 
[1] = {pokemon = 'Horsea'}, 
[2] = {pokemon = 'Poliwag'}, 
[3] = {pokemon = 'Goldeen'}, 
[4] = {pokemon = 'Krabby'}, 
[5] = {pokemon = 'Tentacool'}, 
[6] = {pokemon = 'Seaking'}, 
[7] = {pokemon = 'Starmie'}, 
[8] = {pokemon = 'Kingler'}, 
[9] = {pokemon = 'Seadra'}, 
}

d100 = 
{
[0] = {pokemon = 'Magikarp'}, 
[1] = {pokemon = 'Horsea'}, 
[2] = {pokemon = 'Poliwag'}, 
[3] = {pokemon = 'Goldeen'}, 
[4] = {pokemon = 'Krabby'}, 
[5] = {pokemon = 'Tentacool'}, 
[6] = {pokemon = 'Seaking'}, 
[7] = {pokemon = 'Starmie'}, 
[8] = {pokemon = 'Kingler'}, 
[9] = {pokemon = 'Seadra'}, 
[10] = {pokemon = 'Starmie'}, 
[11] = {pokemon = 'Kingler'}, 
[12] = {pokemon = 'Seadra'}, 

}
local config = {
waters = {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},
}



local skill = getPlayerSkillLevel(cid, 6)
local playerpos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}


function Effect()
doSendMagicEffect(toPos, 214)
end

function Say()
if skill >= 0 and skill < 20 then
local random = math.random(0, 0)
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doSummonCreature(d0[random].pokemon, playerpos)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)

elseif skill >= 20 and skill < 40 then
local random = math.random(0, 4)
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doSummonCreature(d20[random].pokemon, playerpos)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)

elseif skill >= 40 and skill < 60 then
local random = math.random(0, 5)
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doSummonCreature(d40[random].pokemon, playerpos)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)

elseif skill >= 60 and skill < 80 then
local random = math.random(0, 6)
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doSummonCreature(d60[random].pokemon, playerpos)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)

elseif skill >= 80 and skill < 100 then
local random = math.random(0, 9)
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doSummonCreature(d80[random].pokemon, playerpos)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)

elseif skill >= 100 then
local random = math.random(0, 12)
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doSummonCreature(d100[random].pokemon, playerpos)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
end
end

if(isInArray(config.waters, itemEx.itemid)) and getPlayerStorageValue(cid, 171833) >= 1 then
doPlayerSendTextMessage(cid, 27, "You can't fish yet.")
return false
end

if(isInArray(config.waters, itemEx.itemid)) and getPlayerStorageValue(cid, 171833) <= 0 then
setPlayerStorageValue(cid, 171833, 1)
doSendMagicEffect(toPos, CONST_ME_LOSEENERGY)
doSendMagicEffect(toPos, 214)
for i = 1,3 do
addEvent(Effect,750*i,cid)
end
addEvent(Say,3000)
return true
end
return true
end



Oque mudou na v2.0

O Player não fica + parado ao pescar.

Adicionado outros Effects para ficar + parecido com o fishing do PAdventure.

Lembrando que usei a Sprite do PAdventure em forte de Effect ( Lá é 1 Item ).



Uma Opção

Se o Player desligar enquanto a Boia ainda estiver na agua resultara em Erros no servidor.

Para arrumar isso existe 2 Opções simples



1° Arrumar o Arquivo Goback.lua em Creaturescripts para n deixar deslogar enquanto estiver com a storage de pesca.

Algo do tipo:

if getPlayerStorageValue(cid, 171833) >= 1 then

doPlayerSendCancel(cid, "You cant logout during sleeping.")

return false

end

2° seria fazer um CreatureScript para Retirar a Storage 171833 de um Player q a possui quando LOGAR.



Pois se o player sair durante a pesca, a storage não va ser retirada.

Ou seja quando ele logar ele não vai conseguir pescar.



Isso se n tiver um jeito ( eu desconheço um ) de dar Battle pro Player antes de pescar o Pokemon



Não sei se é permitido postar para vcs a sprite do fishing em formato IDC, se alguem precisar me avisa

Ela é necessaria pra 2° versão







Bye Thx



Imagem xD/



semttulobrl.png



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

amigo

caso queira usar esse script em ot sem ser de pokemon

 

basta substituir os nomes pokemons, por monster?

Sim, basta você substituir os nomes dos pokémons pelos nomes dos monstro desejados!

Link para o comentário
Compartilhar em outros sites

  • 3 weeks later...

@DeathAngels

 

Mano me manda o efeito de

pescaria do PAdvenure???

 

Vlw Man

 

EDIT

 

Eu arrumei a V2 (para não "logar" em quanto estiver

pescando e para não pescar na areá de proteção...)

 

Script

 

 

local condition = createConditionObject(CONDITION_INFIGHT)

setConditionParam(condition, CONDITION_PARAM_TICKS, 60000)

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

if getTilePzInfo(getCreaturePosition(cid)) == true then

return doPlayerSendCancel(cid, 'You cannot fish in protection zone')

end

doAddCondition(cid, condition)

 

d0 =

{

[0] = {pokemon = 'Magikarp'},

}

 

d20 =

{

[0] = {pokemon = 'Magikarp'},

[1] = {pokemon = 'Horsea'},

[2] = {pokemon = 'Poliwag'},

[3] = {pokemon = 'Goldeen'},

[4] = {pokemon = 'Krabby'},

}

 

d40 =

{

[0] = {pokemon = 'Magikarp'},

[1] = {pokemon = 'Horsea'},

[2] = {pokemon = 'Poliwag'},

[3] = {pokemon = 'Goldeen'},

[4] = {pokemon = 'Krabby'},

[5] = {pokemon = 'Tentacool'},

}

 

d60 =

{

[0] = {pokemon = 'Magikarp'},

[1] = {pokemon = 'Horsea'},

[2] = {pokemon = 'Poliwag'},

[3] = {pokemon = 'Goldeen'},

[4] = {pokemon = 'Krabby'},

[5] = {pokemon = 'Tentacool'},

[6] = {pokemon = 'Seaking'},

}

 

d80 =

{

[0] = {pokemon = 'Magikarp'},

[1] = {pokemon = 'Horsea'},

[2] = {pokemon = 'Poliwag'},

[3] = {pokemon = 'Goldeen'},

[4] = {pokemon = 'Krabby'},

[5] = {pokemon = 'Tentacool'},

[6] = {pokemon = 'Seaking'},

[7] = {pokemon = 'Starmie'},

[8] = {pokemon = 'Kingler'},

[9] = {pokemon = 'Seadra'},

}

 

d100 =

{

[0] = {pokemon = 'Magikarp'},

[1] = {pokemon = 'Horsea'},

[2] = {pokemon = 'Poliwag'},

[3] = {pokemon = 'Goldeen'},

[4] = {pokemon = 'Krabby'},

[5] = {pokemon = 'Tentacool'},

[6] = {pokemon = 'Seaking'},

[7] = {pokemon = 'Starmie'},

[8] = {pokemon = 'Kingler'},

[9] = {pokemon = 'Seadra'},

[10] = {pokemon = 'Starmie'},

[11] = {pokemon = 'Kingler'},

[12] = {pokemon = 'Seadra'},

 

}

local config = {

waters = {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},

}

 

 

 

local skill = getPlayerSkillLevel(cid, 6)

local playerpos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}

 

 

function Effect()

doSendMagicEffect(toPos, 214)

end

 

function Say()

if skill >= 0 and skill < 20 then

local random = math.random(0, 0)

doSendMagicEffect(getThingPos(cid), 173)

doSendMagicEffect(toPos, 53)

doSummonCreature(d0[random].pokemon, playerpos)

setPlayerStorageValue(cid, 171833, -1)

doPlayerAddSkillTry(cid, 6, 1)

 

elseif skill >= 20 and skill < 40 then

local random = math.random(0, 4)

doSendMagicEffect(getThingPos(cid), 173)

doSendMagicEffect(toPos, 53)

doSummonCreature(d20[random].pokemon, playerpos)

setPlayerStorageValue(cid, 171833, -1)

doPlayerAddSkillTry(cid, 6, 1)

 

elseif skill >= 40 and skill < 60 then

local random = math.random(0, 5)

doSendMagicEffect(getThingPos(cid), 173)

doSendMagicEffect(toPos, 53)

doSummonCreature(d40[random].pokemon, playerpos)

setPlayerStorageValue(cid, 171833, -1)

doPlayerAddSkillTry(cid, 6, 1)

 

elseif skill >= 60 and skill < 80 then

local random = math.random(0, 6)

doSendMagicEffect(getThingPos(cid), 173)

doSendMagicEffect(toPos, 53)

doSummonCreature(d60[random].pokemon, playerpos)

setPlayerStorageValue(cid, 171833, -1)

doPlayerAddSkillTry(cid, 6, 1)

 

elseif skill >= 80 and skill < 100 then

local random = math.random(0, 9)

doSendMagicEffect(getThingPos(cid), 173)

doSendMagicEffect(toPos, 53)

doSummonCreature(d80[random].pokemon, playerpos)

setPlayerStorageValue(cid, 171833, -1)

doPlayerAddSkillTry(cid, 6, 1)

 

elseif skill >= 100 then

local random = math.random(0, 12)

doSendMagicEffect(getThingPos(cid), 173)

doSendMagicEffect(toPos, 53)

doSummonCreature(d100[random].pokemon, playerpos)

setPlayerStorageValue(cid, 171833, -1)

doPlayerAddSkillTry(cid, 6, 1)

end

end

 

if(isInArray(config.waters, itemEx.itemid)) and getPlayerStorageValue(cid, 171833) >= 1 then

doPlayerSendTextMessage(cid, 27, "You can't fish yet.")

return false

end

 

if(isInArray(config.waters, itemEx.itemid)) and getPlayerStorageValue(cid, 171833) <= 0 then

setPlayerStorageValue(cid, 171833, 1)

doSendMagicEffect(toPos, CONST_ME_LOSEENERGY)

doSendMagicEffect(toPos, 214)

for i = 1,3 do

addEvent(Effect,750*i,cid)

end

addEvent(Say,3000)

return true

end

return true

end

 

 

Creditos

 

JeDiAN

 

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

  • 9 months later...
  • 2 months later...
×
×
  • Criar Novo...