Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado
  • Autor

 

Aaaa, esqueci disso, pera aí... 

--By: Gabriel Stocco(Wolf) Improvised Version--  pescar peixe vivo/morto/lixo/levar dano/ quebrar vara
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},
level = 1,
skill = SKILL_FISHING,
skillReq = 1,
effect = CONST_ME_BLOCKHIT,
addTries = 10,
msgType = MESSAGE_EVENT_ADVANCE,
soul = 0,
}
local t = {
[{1, 50}] = {msg = "You found %A %N.", item = 5951},  --- fins
[{51, 90}] = {msg = "You found %A %N.", item = 2226},   --- fishbone
[{91, 110}] = {msg = "You found %A %N.", item = 2009},    --- bottle
[{111, 130}] = {msg = "You found %A %N.", item = 2237},      --- cap
[{131, 140}] = {msg = "You found %A %N.", item = 2670},        --- camarão
[{161, 170}] = {msg = "You found %A %N.", item = 2669},                  ---grande
[{170, 175}] = {msg = "Sua vara de pesca caiu dentro da água!", destroy = true},
[{176, 180}] = {msg = "O peixe era muito forte e quebrou a vara de pesca!", destroy = true},
[{181, 4800}] = {msg = "Não pescou nada!"},
[{4801, 7200}] = {msg = "Você pescou um peixe!", summon = "Peixe"},
[{7201, 7600}] = {msg = "Você pescou um Atum!", summon = "Atum"},
[{7601, 8000}] = {msg = "Você pescou uma Truta Vermelha!", summon = "Truta Vermelha"},
[{8001, 8400}] = {msg = "Você pescou uma Truta Verde!", summon = "Truta Verde"},
[{8401, 8700}] = {msg = "Perdeu %D hitpoints porque um peixe infectado te mordeu!", damage = {550, 2800}},
[{8701, 9000}] = {msg = "Perdeu %D hitpoints porque está exausto!", damage = {550, 1800}}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

if getPlayerStorageValue(cid, 9394) - os.time() <= 0 then 
setPlayerStorageValue(cid, 9394, os.time() + 2)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end

if getPlayerItemCount(cid, 11416) >= 1 then
doPlayerRemoveItem(cid, 11416, 1)
else
doPlayerSendCancel(cid, "You need a ".. getItemName(11416) .." To do this.")
doSendMagicEffect(fromPosition, CONST_ME_POFF)
end


if isInArray(config.waters, itemEx.itemid) and config.level <= getPlayerLevel(cid) and config.skillReq <= getPlayerSkill(cid, config.skill) and config.soul <= getPlayerSoul(cid) then
local v, amount, damage = math.random(9000), 1, nil

for i, k in pairs(t) do
if v >= i[1] and v <= i[2] then

if k.destroy then
doRemoveItem(item.uid)
end
if k.summon then
doCreateMonster(k.summon, toPosition)
end
if k.damage then
damage = math.random(k.damage[1], k.damage[2])
doCreatureAddHealth(cid, - damage)
doSendMagicEffect(getThingPos(cid), CONST_ME_DRAWBLOOD)
doSendAnimatedText(getThingPos(cid), damage, TEXTCOLOR_RED)

end
if k.item then
if k.amountmax then
amount = math.random(k.amountmax)
end
doPlayerAddItem(cid, k.item, amount)
end
if k.msg then
local msg = k.msg
if msg:find("%%") then
if msg:find("%%A") and k.item then
msg = msg:gsub("%%A", amount > 1 and amount or getItemDescriptionsById(k.item).article)
end
if msg:find("%%N") and k.item then
msg = msg:gsub("%%N", amount > 1 and getItemDescriptionsById(k.item).plural or getItemNameById(k.item))
end
if msg:find("%%D") and damage then
msg = msg:gsub("%%D", damage)
end
end
doPlayerSendTextMessage(cid, config.msgType, msg)
end
doTransformItem(itemEx.uid, config.debris)
doPlayerAddSoul(cid, -config.soul)
doSendMagicEffect(toPosition, k.destroy and CONST_ME_HITAREA or config.effect)
return doPlayerAddSkillTry(cid, config.skill, config.addTries)
end
end
end
return doPlayerSendCancel(cid, "Você não pode pescar aqui.")
end

 

 

 

Funcionando está manin, mas as mensagens estão bugadas, não consegui resolver também

 

if getPlayerStorageValue(cid, 9394) - os.time() <= 0 then
setPlayerStorageValue(cid, 9394, os.time() + 2)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end

if getPlayerItemCount(cid, 11416) >= 1 then
doPlayerRemoveItem(cid, 11416, 1)
else
doPlayerSendCancel(cid, "You need a ".. getItemName(11416) .." To do this.")
doSendMagicEffect(fromPosition, CONST_ME_POFF)
end

 

 

Essas aqui:

doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
doPlayerSendCancel(cid, "You need a ".. getItemName(11416) .." To do this.")

 

 

pode resolver pra mim, pfvr?

  • Respostas 15
  • Visualizações 507
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Aaaa, esqueci disso, pera aí...  --By: Gabriel Stocco(Wolf) Improvised Version-- pescar peixe vivo/morto/lixo/levar dano/ quebrar vara local config = { waters = {4614, 4615, 4616, 4617, 4618, 4619

  • --By: Gabriel Stocco(Wolf) Improvised Version-- pescar peixe vivo/morto/lixo/levar dano/ quebrar vara local config = { waters = {4614, 4615, 4616, 4617, 4618, 4619, 4608, 4609, 4610, 4611, 4612, 4613

Postado

Qual que está ?  

não aparece ? 

 

ambas estão ?

Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado).

 

Tópicos:


 

yNlhRVC.png

 

55px-Judo_yellow_belt.svg.png

Postado

sim, ambas

 

Lol, o que tem de errado ? 

Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado).

 

Tópicos:


 

yNlhRVC.png

 

55px-Judo_yellow_belt.svg.png

Postado
  • Autor

Lol, o que tem de errado ? 

 

 

Pensando bem, deixa os doPlayerSendCancel do jeito que tá.. só ta dando esse problema

[04/06/2015 16:50:17] [Error - Action Interface]
[04/06/2015 16:50:17] data/actions/scripts/tools/fishing.lua:onUse
[04/06/2015 16:50:17] Description:
[04/06/2015 16:50:18] data/lib/050-function.lua:273: attempt to index a boolean value
[04/06/2015 16:50:18] stack traceback:
[04/06/2015 16:50:18]     data/lib/050-function.lua:273: in function 'getItemName'
[04/06/2015 16:50:18]     data/actions/scripts/tools/fishing.lua:42: in function <data/actions/scripts/tools/fishing.lua:30>

ps: se tirar o getItemName, da pra pescar mesmo sem minhocas

Editado por biel.stocco (veja o histórico de edições)

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo