Ir para conteúdo

Pedido


BrunooMaciell

Posts Recomendados

Estou aqui pra pedir uma coisa relacionado a minha script ^^

 

SCRIPT

local fishing = {

[-1] = { segs = 2, pokes = {{"Magikarp", 1}} },

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

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

[12854] = { segs = 5, pokes = {{"Seel", 1}, {"Chinchou", 1}, {"Slowpoke", 1}, {"Staryu", 2}, {"Psyduck", 1}, {"Wooper", 1}} },

[12858] = { segs = 5, pokes = {{"Seaking", 1}, {"Seadra", 1}, {"Poliwhirl", 1}, {"Squirtle", 1}, {"Totodile", 1}} },

[12857] = { segs = 5, pokes = {{"Starmie", 1}, {"Kingler", 1}, {"Corsola", 1}, {"Qwilfish", 1}} }, -- pega no client da pxg

[12860] = { segs = 3, pokes = {{"Lanturn", 1}, {"Dewgong", 1}, {"Slowbro", 1}, {"Azumarill", 1}} },

[12859] = { segs = 3, pokes = {{"Cloyster", 1}, {"Poliwrath", 1}, {"Politoed", 1}, {"Octillery", 1}} },

[12856] = { segs = 3, pokes = {{"Dratini", 2}, {"Quagsire", 1}, {"Dragonair", 1}, {"Politoed", 2}, {"Lapras", 1}} },

[12853] = { segs = 3, pokes = {{"Gyarados", 1}, {"Mantine", 1}, {"Tentacruel", 1}, {"Kingdra", 1}, {"Giant Magikarp", 1}, {"Feraligatr", 1}, {"Blastoise", 1}} },
}

local storageP = 154585
local sto_iscas = 5648454 --muda aki pra sto q ta no script da isca
local bonus = 15
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

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)
doRemoveCondition(cid, CONDITION_OUTFIT)
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]), 0)
doChallengeCreature(getCreatureSummons(cid)[1], peixe)
else
doSendMagicEffect(getThingPos(cid), 0)
doChallengeCreature(cid, peixe)
end
end
setPlayerStorageValue(cid, storageP, -1)
doRemoveCondition(cid, CONDITION_OUTFIT)
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 isInArray({520, 521}, getCreatureOutfit(cid).lookType) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need fisher outfit for fishing.")
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

local outfit = getCreatureOutfit(cid)
local out = getPlayerSex(cid) == 0 and 1467 or 1468

doSetCreatureOutfit(cid, {lookType = out, lookHead = outfit.lookHead, lookBody = outfit.lookBody, lookLegs = outfit.lookLegs, lookFeet = outfit.lookFeet}, -1)
setPlayerStorageValue(cid, storageP, 1) --alterei looktype
doCreatureSetNoMove(cid, true)

doFish(cid, toPos, getThingPos(cid), math.random(5, delay))

return true
end

 

 

podem ver que esta script na parte de pesca ali em cima ta por isca com o id do lado eu queria muda por level invez de isca coloca level ^^

 

Curti++

Link para o comentário
Compartilhar em outros sites

você quer que continue no modo pxg, mais sem isca?


não esqueça de colocar o id da outfit com a vara de pesca na mão ...

 

local storage = 15458
local storageP = 154580
local bonus = 1
local limite = 80

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 = ""

--alterado!!
if getPlayerSkillLevel(cid, 6) < limite then
doPlayerAddSkillTry(cid, 6, 20)
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)
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
setPlayerStorageValue(cid, storageP, -1)
doCreatureSetNoMove(cid, false)
doRemoveCondition(cid, CONDITION_OUTFIT)
return true
end
addEvent(doFish, interval, cid, pos, ppos, chance, interval, number)
setPlayerStorageValue(cid, storageP, 1)
doCreatureSetNoMove(cid, true)
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 getPlayerStorageValue(cid, storageP) > 0 then
doPlayerSendTextMessage(cid, 27, "You are already fishing.")
return true
end
if getPlayerSex(cid) == 1 then
if getCreatureOutfit(cid).lookType ~= 520 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need fisher outfit for fishing.")
return false
end
else
if getCreatureOutfit(cid).lookType ~= 521 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need fisher outfit for fishing.")
return false
end
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 = 3500 - getPlayerSkillLevel(cid, 6) * 25
local chance = 10 + getPlayerSkillLevel(cid, 6) / 2.5
outfit = getCreatureOutfit(cid)
if getPlayerSex(cid) == 0 then
out = 1467 --- Outfit de Pesca FEMININA
else
out = 1468 --- Outfit de Pesca MASCULINA
end
doSetCreatureOutfit(cid, {lookType = out, lookHead = outfit.lookHead, lookBody = outfit.lookBody, lookLegs = outfit.lookLegs, lookFeet = outfit.lookFeet}, -1)
doFish(cid, toPos, getThingPos(cid), chance, delay, getPlayerStorageValue(cid, storage))

return true
end

 

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

Só passei o olho no código (porque estou de saída), então talvez tenha que alterar mais coisas...

Troque:

local fishes = fishing[getPlayerStorageValue(cid, sto_iscas)]

Por:

local fishes = fishing[getPlayerLevel(cid)]

E troque:

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

Por:

local delay = fishing[getPlayerLevel(cid)].segs
Editado por zipter98
Link para o comentário
Compartilhar em outros sites

-Snix

 

BUG

 

[02/03/2014 20:54:52] [Error - Action Interface]

[02/03/2014 20:54:52] data/actions/scripts/Fishing_System/fishing.lua:onUse

[02/03/2014 20:54:52] Description:

[02/03/2014 20:54:52] data/actions/scripts/Fishing_System/fishing.lua:49: attempt to compare nil with number

[02/03/2014 20:54:52] stack traceback:

[02/03/2014 20:54:52] data/actions/scripts/Fishing_System/fishing.lua:49: in function 'doFish'

[02/03/2014 20:54:52] data/actions/scripts/Fishing_System/fishing.lua:166: in function

 

 

- Zipter98

 

BUG

 

[02/03/2014 21:02:34] [Error - Action Interface]

[02/03/2014 21:02:34] data/actions/scripts/Fishing_System/fishing.lua:onUse

[02/03/2014 21:02:34] Description:

[02/03/2014 21:02:34] data/actions/scripts/Fishing_System/fishing.lua:121: attempt to index field '?' (a nil value)

[02/03/2014 21:02:34] stack traceback:

[02/03/2014 21:02:34] data/actions/scripts/Fishing_System/fishing.lua:121: in function <data/actions/scripts/Fishing_System/fishing.lua:83>

 

Eu ate editei certo a script !!

 

Ex: - zipter98 que foi o ultimo no post ^^

 

SCRIPT

 

local fishing = {

[1] = { segs = 2, pokes = {{"Magikarp", 1}} },

 

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

 

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

 

[30] = { segs = 5, pokes = {{"Seel", 1}, {"Chinchou", 1}, {"Slowpoke", 1}, {"Staryu", 2}, {"Psyduck", 1}, {"Wooper", 1}} },

 

[40] = { segs = 5, pokes = {{"Seaking", 1}, {"Seadra", 1}, {"Poliwhirl", 1}, {"Squirtle", 1}, {"Totodile", 1}} },

 

[50] = { segs = 5, pokes = {{"Starmie", 1}, {"Kingler", 1}, {"Corsola", 1}, {"Qwilfish", 1}} }, -- pega no client da pxg

 

[60] = { segs = 3, pokes = {{"Lanturn", 1}, {"Dewgong", 1}, {"Slowbro", 1}, {"Azumarill", 1}} },

 

[80] = { segs = 3, pokes = {{"Cloyster", 1}, {"Poliwrath", 1}, {"Politoed", 1}, {"Octillery", 1}} },

 

[90] = { segs = 3, pokes = {{"Dratini", 2}, {"Quagsire", 1}, {"Dragonair", 1}, {"Politoed", 2}, {"Lapras", 1}} },

 

[100] = { segs = 3, pokes = {{"Gyarados", 1}, {"Mantine", 1}, {"Tentacruel", 1}, {"Kingdra", 1}, {"Giant Magikarp", 1}, {"Feraligatr", 1}, {"Blastoise", 1}} },

}

 

local storageP = 154585

local sto_iscas = 5648454 --muda aki pra sto q ta no script da isca

local bonus = 1

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

 

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[getPlayerLevel(cid)]

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)

doRemoveCondition(cid, CONDITION_OUTFIT)

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

doChallengeCreature(getCreatureSummons(cid)[1], peixe)

else

doSendMagicEffect(getThingPos(cid), 0)

doChallengeCreature(cid, peixe)

end

end

setPlayerStorageValue(cid, storageP, -1)

doRemoveCondition(cid, CONDITION_OUTFIT)

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 isInArray({520, 521}, getCreatureOutfit(cid).lookType) then

return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need fisher outfit for fishing.")

end

 

local delay = fishing[getPlayerLevel(cid)].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

 

local outfit = getCreatureOutfit(cid)

local out = getPlayerSex(cid) == 0 and 1467 or 1468

 

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

setPlayerStorageValue(cid, storageP, 1) --alterei looktype

doCreatureSetNoMove(cid, true)

 

doFish(cid, toPos, getThingPos(cid), math.random(5, delay))

 

return true

end

 

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

×
×
  • Criar Novo...