Ir para conteúdo

Featured Replies

Postado
  • Solução
--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 ".. getItemNameById(11416) .." To do this.")
doSendMagicEffect(fromPosition, CONST_ME_POFF)
return true
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

Editado por Caronte (veja o histórico de edições)

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

  • Respostas 15
  • Visualizações 514
  • 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
  • Autor
--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 ".. getItemNameById(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

 

 

 

Continua pescando, mesmo sem ter minhocas

Postado

Affe esqueci de um negocio, tenta de novo no último que postei, eu editei...

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

Affe esqueci de um negocio, tenta de novo no último que postei, eu editei...

 

 

certinho agora manin!

Pode me fazer só mais um ajuste que acabei de pensar, para evitar abusos tipo 2 players pescarem com a mesma vara de pesca(jogando ela no chão e dando use na agua).. colocar para a vara só funcionar se estiver equipada no Ammo_Slot

Já te dou + rep uehueh

Postado

--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 getPlayerSlotItem(cid, CONST_SLOT_AMMO) ~= item.itemid  then 
return doPlayerSendCancel(cid, " You should put this item on your ammo slot !") and doSendMagicEffect(fromPosition, CONST_ME_POFF) and true
end

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 ".. getItemNameById(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

Assim, ele só poderá usar caso tenha uma no slot, e poderá usar do chão, mas só se tiver no slot ammo...

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

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.7k

Informação Importante

Confirmação de Termo