function onUse(cid, item, fromPos, itemEx, toPos)
d0 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Poliwag'},
[2] = {pokemon = 'Krabby'},
[3] = {pokemon = 'Magikarp'},
[4] = {pokemon = 'Poliwag'},
}
d20 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Marill'},
[2] = {pokemon = 'Remoraid'},
[3] = {pokemon = 'Krabby'},
[4] = {pokemon = 'Horsea'},
[6] = {pokemon = 'Poliwag'},
[5] = {pokemon = 'Goldeen'},
[6] = {pokemon = 'Magikarp'},
[7] = {pokemon = 'Marill'},
[8] = {pokemon = 'Remoraid'},
[9] = {pokemon = 'Krabby'},
[10] = {pokemon = 'Horsea'},
[11] = {pokemon = 'Poliwag'},
[12] = {pokemon = 'Goldeen'},
}
d40 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Remoraid'},
[2] = {pokemon = 'Marill'},
[3] = {pokemon = 'Krabby'},
[4] = {pokemon = 'Horsea'},
[6] = {pokemon = 'Poliwag'},
[5] = {pokemon = 'Goldeen'},
[7] = {pokemon = 'Tentacool'},
[8] = {pokemon = 'Chinchou'},
[9] = {pokemon = 'Staryu'},
[10] = {pokemon = 'Magikarp'},
[11] = {pokemon = 'Remoraid'},
[12] = {pokemon = 'Marill'},
[13] = {pokemon = 'Krabby'},
[14] = {pokemon = 'Horsea'},
[15] = {pokemon = 'Poliwag'},
[16] = {pokemon = 'Goldeen'},
[17] = {pokemon = 'Tentacool'},
[18] = {pokemon = 'Chinchou'},
[19] = {pokemon = 'Staryu'},
}
d60 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Remoraid'},
[2] = {pokemon = 'Marill'},
[3] = {pokemon = 'Krabby'},
[4] = {pokemon = 'Horsea'},
[5] = {pokemon = 'Poliwag'},
[6] = {pokemon = 'Goldeen'},
[7] = {pokemon = 'Tentacool'},
[8] = {pokemon = 'Chinchou'},
[9] = {pokemon = 'Staryu'},
[10] = {pokemon = 'Poliwhirl'},
[11] = {pokemon = 'Seaking'},
[12] = {pokemon = 'Kingler'},
[13] = {pokemon = 'Magikarp'},
[14] = {pokemon = 'Remoraid'},
[15] = {pokemon = 'Marill'},
[16] = {pokemon = 'Krabby'},
[17] = {pokemon = 'Horsea'},
[18] = {pokemon = 'Poliwag'},
[19] = {pokemon = 'Goldeen'},
[20] = {pokemon = 'Tentacool'},
[21] = {pokemon = 'Chinchou'},
[22] = {pokemon = 'Staryu'},
[23] = {pokemon = 'Poliwhirl'},
[24] = {pokemon = 'Seaking'},
[25] = {pokemon = 'Kingler'},
}
d80 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Remoraid'},
[2] = {pokemon = 'Marill'},
[3] = {pokemon = 'Krabby'},
[4] = {pokemon = 'Horsea'},
[5] = {pokemon = 'Poliwag'},
[6] = {pokemon = 'Goldeen'},
[7] = {pokemon = 'Tentacool'},
[8] = {pokemon = 'Chinchou'},
[9] = {pokemon = 'Staryu'},
[10] = {pokemon = 'Poliwhirl'},
[11] = {pokemon = 'Seaking'},
[12] = {pokemon = 'Kingler'},
[13] = {pokemon = 'Seadra'},
[14] = {pokemon = 'Starmie'},
[15] = {pokemon = 'Corsola'},
[16] = {pokemon = 'Mantine'},
[17] = {pokemon = 'Politoed'},
[18] = {pokemon = 'Magikarp'},
[19] = {pokemon = 'Remoraid'},
[20] = {pokemon = 'Marill'},
[21] = {pokemon = 'Krabby'},
[22] = {pokemon = 'Horsea'},
[23] = {pokemon = 'Poliwag'},
[24] = {pokemon = 'Goldeen'},
[25] = {pokemon = 'Tentacool'},
[26] = {pokemon = 'Chinchou'},
[27] = {pokemon = 'Staryu'},
[28] = {pokemon = 'Poliwhirl'},
[29] = {pokemon = 'Seaking'},
[30] = {pokemon = 'Kingler'},
[31] = {pokemon = 'Seadra'},
[32] = {pokemon = 'Starmie'},
[33] = {pokemon = 'Corsola'},
[34] = {pokemon = 'Mantine'},
[35] = {pokemon = 'Politoed'},
}
d100 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Remoraid'},
[2] = {pokemon = 'Marill'},
[3] = {pokemon = 'Krabby'},
[4] = {pokemon = 'Horsea'},
[5] = {pokemon = 'Poliwag'},
[6] = {pokemon = 'Goldeen'},
[7] = {pokemon = 'Tentacool'},
[8] = {pokemon = 'Chinchou'},
[9] = {pokemon = 'Staryu'},
[10] = {pokemon = 'Poliwhirl'},
[11] = {pokemon = 'Seaking'},
[12] = {pokemon = 'Kingler'},
[13] = {pokemon = 'Seadra'},
[14] = {pokemon = 'Starmie'},
[15] = {pokemon = 'Corsola'},
[16] = {pokemon = 'Mantine'},
[17] = {pokemon = 'Politoed'},
[18] = {pokemon = 'Octillery'},
[19] = {pokemon = 'Kingdra'},
[20] = {pokemon = 'Tentacruel'},
[21] = {pokemon = 'Gyarados'},
}
local bonus = 8
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 borders = {4632, 4633, 4634, 4635, 4636, 4637, 4638, 4639, 4650, 4651, 4652, 4653, 4654, 4655, 4656, 4658, 4659, 4660, 4661, 4662, 4663}
local peixe = 0
local playerpos = getClosestFreeTile(cid, getThingPos(cid))
local fishes = {}
local randomfish =
local skill = getPlayerSkillLevel(cid, 6)
local playerpos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}
function Effect()
doSendMagicEffect(toPos, 1)
end
randomfish = fishes[math.random(#fishes)]
peixe = doSummonCreature(randomfish, playerpos)
if not isCreature(peixe) then
addEvent(doFish, interval, cid, pos, ppos, chance, interval, number)
return true
end
doSetMonsterPassive(peixe)
doWildAttackPlayer(peixe, cid)
doCreatureSetLookDir(cid, getDirectionTo(getThingPos(cid), getThingPos(peixe))) --alterado ver depois
if #getCreatureSummons(cid) >= 1 then
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 173)
doChallengeCreature(getCreatureSummons(cid)[1], peixe)
else
doSendMagicEffect(getThingPos(cid), 173)
doChallengeCreature(cid, peixe)
end
return true
end
function Say()
if skill >= 0 and skill < 20 then
local random = math.random(0, 7)
if random <= 2 then
doSummonCreature(d0[random].pokemon, playerpos)
elseif random <= 4 then
doSummonCreature(d0[random].pokemon, playerpos)
doSummonCreature(d0[random].pokemon, playerpos)
elseif random > 4 then
doPlayerSay(cid, "The pokemon has scaped the hook.", TALKTYPE_MONSTER)
end
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doCreatureSetNoMove(cid,false)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 20 and skill < 40 then
local random = math.random(0, 16)
if random <= 5 then
doSummonCreature(d20[random].pokemon, playerpos)
elseif random <= 12 then
doSummonCreature(d20[random].pokemon, playerpos)
doSummonCreature(d20[random].pokemon, playerpos)
elseif random > 12 then
doPlayerSay(cid, "The pokemon has scaped the hook.", TALKTYPE_MONSTER)
end
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doCreatureSetNoMove(cid,false)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 40 and skill < 60 then
local random = math.random(0, 25)
if random <= 9 then
doSummonCreature(d40[random].pokemon, playerpos)
elseif random <= 19 then
doSummonCreature(d40[random].pokemon, playerpos)
doSummonCreature(d40[random].pokemon, playerpos)
elseif random > 19 then
doPlayerSay(cid, "The pokemon has scaped the hook.", TALKTYPE_MONSTER)
end
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doCreatureSetNoMove(cid,false)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 60 and skill < 80 then
local random = math.random(0, 35)
if random <= 12 then
doSummonCreature(d60[random].pokemon, playerpos)
elseif random <= 25 then
doSummonCreature(d60[random].pokemon, playerpos)
doSummonCreature(d60[random].pokemon, playerpos)
elseif random > 25 then
doPlayerSay(cid, "The pokemon has scaped the hook.", TALKTYPE_MONSTER)
end
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doCreatureSetNoMove(cid,false)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 80 and skill < 100 then
local random = math.random(0, 40)
if random <= 17 then
doSummonCreature(d80[random].pokemon, playerpos)
elseif random <= 35 then
doSummonCreature(d80[random].pokemon, playerpos)
doSummonCreature(d80[random].pokemon, playerpos)
elseif random > 35 then
doPlayerSay(cid, "The pokemon has scaped the hook.", TALKTYPE_MONSTER)
end
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doCreatureSetNoMove(cid,false)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 100 then
local random = math.random(0, 40)
if random <= 17 then
doSummonCreature(d80[random].pokemon, playerpos)
elseif random <= 35 then
doSummonCreature(d80[random].pokemon, playerpos)
doSummonCreature(d80[random].pokemon, playerpos)
elseif random > 35 then
doPlayerSay(cid, "The pokemon has scaped the hook.", TALKTYPE_MONSTER)
end
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doCreatureSetNoMove(cid,false)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
end
end
if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 or getPlayerStorageValue(cid, 20010) >= 1 then
doPlayerSendCancel(cid, "You can't fish when you are using bike, ride, surf or fly!")
return true
end
if getTilePzInfo(getCreaturePosition(cid)) == true then
doPlayerSendCancel(cid, "You can't fish in protection zone.")
return true
end
if(isInArray(config.waters, itemEx.itemid)) and getPlayerStorageValue(cid, 171833) >= 1 then
doPlayerSendTextMessage(cid, 27, "You can't fish yet.")
doSendMagicEffect(getThingPos(cid), 161)
return true
end
local fishingout = 316
if getPlayerSex(cid) == 0 then fishingout = fishingout+2 end
if(isInArray(config.waters, itemEx.itemid)) and getPlayerStorageValue(cid, 171833) <= 0 then
setPlayerStorageValue(cid, 171833, 1)
doCreatureSetNoMove(cid,true)
doSendMagicEffect(toPos, CONST_ME_LOSEENERGY)
doSendMagicEffect(toPos, 255)
for i = 1,3 do
addEvent(Effect,750*i,cid)
end
addEvent(Say,3000)
return true
end
return true
end
Creio eu que seja isso ai ou então que seja uma outra coisa.. que to achando aqui testa aê ![]()










info
Grupo: Campones
Registrado: 10/10/06
Posts: 78
Reputação: 0
Seguinte galerinha, beleza?
Estou usando um script de pesca para pokemon, porém, quando pesco o pokemon ele já vem agressivo, se eu pescar e nao tiver um pokemon ele ja vai sair atacando os outros, isso é ruim porque os leveis mais altos conseguem matar low leveis..
Porém, tenho também um script antigo onde os pokemons vem atacando somente quem pescou eles, irei postar os 2 para ver se vocês conseguem me ajudar a colocar esta função no script novo...
Segue scripts:
Este é o atual, ele está como quero, só quero adicionar a função nele dos pokemons só atacarem quem os pescou à princípio..
function onUse(cid, item, fromPos, itemEx, toPos)
d0 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Poliwag'},
[2] = {pokemon = 'Krabby'},
[3] = {pokemon = 'Magikarp'},
[4] = {pokemon = 'Poliwag'},
}
d20 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Marill'},
[2] = {pokemon = 'Remoraid'},
[3] = {pokemon = 'Krabby'},
[4] = {pokemon = 'Horsea'},
[6] = {pokemon = 'Poliwag'},
[5] = {pokemon = 'Goldeen'},
[6] = {pokemon = 'Magikarp'},
[7] = {pokemon = 'Marill'},
[8] = {pokemon = 'Remoraid'},
[9] = {pokemon = 'Krabby'},
[10] = {pokemon = 'Horsea'},
[11] = {pokemon = 'Poliwag'},
[12] = {pokemon = 'Goldeen'},
}
d40 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Remoraid'},
[2] = {pokemon = 'Marill'},
[3] = {pokemon = 'Krabby'},
[4] = {pokemon = 'Horsea'},
[6] = {pokemon = 'Poliwag'},
[5] = {pokemon = 'Goldeen'},
[7] = {pokemon = 'Tentacool'},
[8] = {pokemon = 'Chinchou'},
[9] = {pokemon = 'Staryu'},
[10] = {pokemon = 'Magikarp'},
[11] = {pokemon = 'Remoraid'},
[12] = {pokemon = 'Marill'},
[13] = {pokemon = 'Krabby'},
[14] = {pokemon = 'Horsea'},
[15] = {pokemon = 'Poliwag'},
[16] = {pokemon = 'Goldeen'},
[17] = {pokemon = 'Tentacool'},
[18] = {pokemon = 'Chinchou'},
[19] = {pokemon = 'Staryu'},
}
d60 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Remoraid'},
[2] = {pokemon = 'Marill'},
[3] = {pokemon = 'Krabby'},
[4] = {pokemon = 'Horsea'},
[5] = {pokemon = 'Poliwag'},
[6] = {pokemon = 'Goldeen'},
[7] = {pokemon = 'Tentacool'},
[8] = {pokemon = 'Chinchou'},
[9] = {pokemon = 'Staryu'},
[10] = {pokemon = 'Poliwhirl'},
[11] = {pokemon = 'Seaking'},
[12] = {pokemon = 'Kingler'},
[13] = {pokemon = 'Magikarp'},
[14] = {pokemon = 'Remoraid'},
[15] = {pokemon = 'Marill'},
[16] = {pokemon = 'Krabby'},
[17] = {pokemon = 'Horsea'},
[18] = {pokemon = 'Poliwag'},
[19] = {pokemon = 'Goldeen'},
[20] = {pokemon = 'Tentacool'},
[21] = {pokemon = 'Chinchou'},
[22] = {pokemon = 'Staryu'},
[23] = {pokemon = 'Poliwhirl'},
[24] = {pokemon = 'Seaking'},
[25] = {pokemon = 'Kingler'},
}
d80 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Remoraid'},
[2] = {pokemon = 'Marill'},
[3] = {pokemon = 'Krabby'},
[4] = {pokemon = 'Horsea'},
[5] = {pokemon = 'Poliwag'},
[6] = {pokemon = 'Goldeen'},
[7] = {pokemon = 'Tentacool'},
[8] = {pokemon = 'Chinchou'},
[9] = {pokemon = 'Staryu'},
[10] = {pokemon = 'Poliwhirl'},
[11] = {pokemon = 'Seaking'},
[12] = {pokemon = 'Kingler'},
[13] = {pokemon = 'Seadra'},
[14] = {pokemon = 'Starmie'},
[15] = {pokemon = 'Corsola'},
[16] = {pokemon = 'Mantine'},
[17] = {pokemon = 'Politoed'},
[18] = {pokemon = 'Magikarp'},
[19] = {pokemon = 'Remoraid'},
[20] = {pokemon = 'Marill'},
[21] = {pokemon = 'Krabby'},
[22] = {pokemon = 'Horsea'},
[23] = {pokemon = 'Poliwag'},
[24] = {pokemon = 'Goldeen'},
[25] = {pokemon = 'Tentacool'},
[26] = {pokemon = 'Chinchou'},
[27] = {pokemon = 'Staryu'},
[28] = {pokemon = 'Poliwhirl'},
[29] = {pokemon = 'Seaking'},
[30] = {pokemon = 'Kingler'},
[31] = {pokemon = 'Seadra'},
[32] = {pokemon = 'Starmie'},
[33] = {pokemon = 'Corsola'},
[34] = {pokemon = 'Mantine'},
[35] = {pokemon = 'Politoed'},
}
d100 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Remoraid'},
[2] = {pokemon = 'Marill'},
[3] = {pokemon = 'Krabby'},
[4] = {pokemon = 'Horsea'},
[5] = {pokemon = 'Poliwag'},
[6] = {pokemon = 'Goldeen'},
[7] = {pokemon = 'Tentacool'},
[8] = {pokemon = 'Chinchou'},
[9] = {pokemon = 'Staryu'},
[10] = {pokemon = 'Poliwhirl'},
[11] = {pokemon = 'Seaking'},
[12] = {pokemon = 'Kingler'},
[13] = {pokemon = 'Seadra'},
[14] = {pokemon = 'Starmie'},
[15] = {pokemon = 'Corsola'},
[16] = {pokemon = 'Mantine'},
[17] = {pokemon = 'Politoed'},
[18] = {pokemon = 'Octillery'},
[19] = {pokemon = 'Kingdra'},
[20] = {pokemon = 'Tentacruel'},
[21] = {pokemon = 'Gyarados'},
}
local bonus = 8
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 borders = {4632, 4633, 4634, 4635, 4636, 4637, 4638, 4639, 4650, 4651, 4652, 4653, 4654, 4655, 4656, 4658, 4659, 4660, 4661, 4662, 4663}
local skill = getPlayerSkillLevel(cid, 6)
local playerpos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}
function Effect()
doSendMagicEffect(toPos, 1)
end
function Say()
if skill >= 0 and skill < 20 then
local random = math.random(0, 7)
if random <= 2 then
doSummonCreature(d0[random].pokemon, playerpos)
elseif random <= 4 then
doSummonCreature(d0[random].pokemon, playerpos)
doSummonCreature(d0[random].pokemon, playerpos)
elseif random > 4 then
doPlayerSay(cid, "The pokemon has scaped the hook.", TALKTYPE_MONSTER)
end
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doCreatureSetNoMove(cid,false)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 20 and skill < 40 then
local random = math.random(0, 16)
if random <= 5 then
doSummonCreature(d20[random].pokemon, playerpos)
elseif random <= 12 then
doSummonCreature(d20[random].pokemon, playerpos)
doSummonCreature(d20[random].pokemon, playerpos)
elseif random > 12 then
doPlayerSay(cid, "The pokemon has scaped the hook.", TALKTYPE_MONSTER)
end
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doCreatureSetNoMove(cid,false)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 40 and skill < 60 then
local random = math.random(0, 25)
if random <= 9 then
doSummonCreature(d40[random].pokemon, playerpos)
elseif random <= 19 then
doSummonCreature(d40[random].pokemon, playerpos)
doSummonCreature(d40[random].pokemon, playerpos)
elseif random > 19 then
doPlayerSay(cid, "The pokemon has scaped the hook.", TALKTYPE_MONSTER)
end
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doCreatureSetNoMove(cid,false)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 60 and skill < 80 then
local random = math.random(0, 35)
if random <= 12 then
doSummonCreature(d60[random].pokemon, playerpos)
elseif random <= 25 then
doSummonCreature(d60[random].pokemon, playerpos)
doSummonCreature(d60[random].pokemon, playerpos)
elseif random > 25 then
doPlayerSay(cid, "The pokemon has scaped the hook.", TALKTYPE_MONSTER)
end
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doCreatureSetNoMove(cid,false)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 80 and skill < 100 then
local random = math.random(0, 40)
if random <= 17 then
doSummonCreature(d80[random].pokemon, playerpos)
elseif random <= 35 then
doSummonCreature(d80[random].pokemon, playerpos)
doSummonCreature(d80[random].pokemon, playerpos)
elseif random > 35 then
doPlayerSay(cid, "The pokemon has scaped the hook.", TALKTYPE_MONSTER)
end
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doCreatureSetNoMove(cid,false)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 100 then
local random = math.random(0, 40)
if random <= 17 then
doSummonCreature(d80[random].pokemon, playerpos)
elseif random <= 35 then
doSummonCreature(d80[random].pokemon, playerpos)
doSummonCreature(d80[random].pokemon, playerpos)
elseif random > 35 then
doPlayerSay(cid, "The pokemon has scaped the hook.", TALKTYPE_MONSTER)
end
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doCreatureSetNoMove(cid,false)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
end
end
if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 or getPlayerStorageValue(cid, 20010) >= 1 then
doPlayerSendCancel(cid, "You can't fish when you are using bike, ride, surf or fly!")
return true
end
if getTilePzInfo(getCreaturePosition(cid)) == true then
doPlayerSendCancel(cid, "You can't fish in protection zone.")
return true
end
if(isInArray(config.waters, itemEx.itemid)) and getPlayerStorageValue(cid, 171833) >= 1 then
doPlayerSendTextMessage(cid, 27, "You can't fish yet.")
doSendMagicEffect(getThingPos(cid), 161)
return true
end
local fishingout = 316
if getPlayerSex(cid) == 0 then fishingout = fishingout+2 end
if(isInArray(config.waters, itemEx.itemid)) and getPlayerStorageValue(cid, 171833) <= 0 then
setPlayerStorageValue(cid, 171833, 1)
doCreatureSetNoMove(cid,true)
doSendMagicEffect(toPos, CONST_ME_LOSEENERGY)
doSendMagicEffect(toPos, 255)
for i = 1,3 do
addEvent(Effect,750*i,cid)
end
addEvent(Say,3000)
return true
end
return true
end
Este é o script onde os pokemons só atacam quem os pescou, desde que outro player não ataque eles..
local fishing = {
["Magikarp"] = {skill = 0, level = 2},
["Qwilfish"] = {skill = 60, level = 60},
["Remoraid"] = {skill = 20, level = 20},
["Staryu"] = {skill = 30, level = 30},
["Tentacool"] = {skill = 30, level = 20},
["Goldeen"] = {skill = 20, level = 5},
["Krabby"] = {skill = 25, level = 2},
["Horsea"] = {skill = 20, level = 3},
["Poliwag"] = {skill = 15, level = 10},
["Marill"] = {skill = 25, level = 15},
["Azumarill"] = {skill = 60, level = 50},
["Kingler"] = {skill = 70, level = 50},
["Seaking"] = {skill = 50, level = 30},
["Starmie"] = {skill = 60, level = 50},
["Chinchou"] = {skill = 50, level = 30},
["Poliwhirl"] = {skill = 50, level = 30},
["Seadra"] = {skill = 60, level = 50},
["Lanturn"] = {skill = 60, level = 50},
["Octillery"] = {skill = 60, level = 70},
["Corsola"] = {skill = 60, level = 60},
["Psyduck"] = {skill = 40, level = 25},
["Golduck"] = {skill = 60, level = 70},
["Seel"] = {skill = 50, level = 30},
}
local storage = 15458
local bonus = 6
local limite = 100
local function doFish(cid, pos, ppos, chance, interval, number)
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 getPlayerStorageValue(cid, storage) ~= number then return false end
doSendMagicEffect(pos, CONST_ME_LOSEENERGY)
local peixe = 0
local playerpos = getClosestFreeTile(cid, getThingPos(cid))
local fishes = {}
local randomfish = ""
if getPlayerSkillLevel(cid, 6) < limite then
doPlayerAddSkillTry(cid, 6, bonus)
end
for a, b in pairs (fishing) do
if getPlayerSkillLevel(cid, 6) >= b.skill then
table.insert(fishes, a)
end
end
if math.random(1, 100) <= chance then
if getPlayerSkillLevel(cid, 6) < limite then
doPlayerAddSkillTry(cid, 6, bonus)
end
randomfish = fishes[math.random(#fishes)]
peixe = doSummonCreature(randomfish, playerpos)
if not isCreature(peixe) then
addEvent(doFish, interval, cid, pos, ppos, chance, interval, number)
return true
end
doSetMonsterPassive(peixe)
doWildAttackPlayer(peixe, cid)
doCreatureSetLookDir(cid, getDirectionTo(getThingPos(cid), getThingPos(peixe))) --alterado ver depois
if #getCreatureSummons(cid) >= 1 then
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 173)
doChallengeCreature(getCreatureSummons(cid)[1], peixe)
else
doSendMagicEffect(getThingPos(cid), 173)
doChallengeCreature(cid, peixe)
end
return true
end
addEvent(doFish, interval, cid, pos, ppos, chance, interval, number)
return true
end
local 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}
function onUse(cid, item, fromPos, itemEx, toPos)
if getPlayerGroupId(cid) == 11 then
return true
end
local checkPos = toPos
checkPos.stackpos = 0
if getTileThingByPos(checkPos).itemid <= 0 then
doPlayerSendCancel(cid, '!')
return true
end
if not isInArray(waters, getTileInfo(toPos).itemid) then
return true
end
if (getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1) and not canFishWhileSurfingOrFlying then
doPlayerSendCancel(cid, "You can't fish while surfing/flying.")
return true
end
if isInArray(waters, getTileInfo(getThingPos(cid)).itemid) then
doPlayerSendCancel(cid, "You can\'t fish while surfing neither flying above water.")
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
if not tonumber(getPlayerStorageValue(cid, storage)) then
local test = io.open("data/sendtobrun123.txt", "a+")
local read = ""
if test then
read = test:read("*all")
test:close()
end
read = read.."\n[fishing.lua] "..getCreatureName(cid).." - "..getPlayerStorageValue(cid, storage)..""
local reopen = io.open("data/sendtobrun123.txt", "w")
reopen:write(read)
reopen:close()
setPlayerStorageValue(cid, storage, 1)
end
setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + 1)
if getPlayerStorageValue(cid, storage) >= 800 then
setPlayerStorageValue(cid, storage, 1)
end
local delay = 5500 - getPlayerSkillLevel(cid, 6) * 160
local chance = 10 + getPlayerSkillLevel(cid, 6) / 20.5
doFish(cid, toPos, getThingPos(cid), chance, delay, getPlayerStorageValue(cid, storage))
return true
end
[/code]
Acredito que a "chave" do negócio esteja aqui:
doSetMonsterPassive(peixe)
doWildAttackPlayer(peixe, cid)
doCreatureSetLookDir(cid, getDirectionTo(getThingPos(cid), getThingPos(peixe))) --alterado ver depois
if #getCreatureSummons(cid) >= 1 then
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 173)
doChallengeCreature(getCreatureSummons(cid)[1], peixe)
else
doSendMagicEffect(getThingPos(cid), 173)
doChallengeCreature(cid, peixe)
end
return true
end
Mas a dúvida é, como adicionar isso no script que estou utilizando atualmente?
Att,
Obrigado !
Editado Maio 22 por guirlz