Idéia de pescar tesouros: root_pk
Formulação da Action: Arkilus
Com esse mod dá pra pegar gps, mapa, ring, pearls, gems e diamonds com fishing.
Usei como base o script de fishing que vem junto com o Yur 0.9.2 e fiz algumas modificações:
function onUse(cid, item, frompos, item2, topos)if (item2.itemid >= 601 and item2.itemid <= 603) or (item2.itemid >= 729 and item2.itemid <= 740) then
skill_level = getPlayerSkill(cid,6)
doPlayerAddSkillTry(cid,6,1)
doSendMagicEffect(topos,1)
fish = math.random(1,(100+skill_level/10)) --Formula by DarthRevan--
if skill_level >= fish then
item = math.random(1,100)
-- *********************************************************
-- *********************************************************
-- Pegando tesouros em fishing
-- Idéia:root_pk
-- Código: Arkilus
if item <= 99 then
doPlayerAddItem(cid,3516,1)
else
gp = math.random(1,101)
if gp <= 100 then
doPlayerAddItem(cid,2969,gp)
gpmsg = "You have found " .. gp .. " gps!"
doPlayerSendTextMessage(cid,22,gpmsg)
else
treasure = math.random(1,5)
if treasure == 1 then -- diamonds
diamonds = math.random (1,10)
doPlayerAddItem(cid,2966,diamonds)
premio = diamonds .. " diamonds"
elseif treasure == 2 then -- gems
gemcolor = math.random(4,9)
gem = 297 .. gemcolor
doPlayerAddItem(cid,gem,1)
premio = "a gem"
elseif treasure == 3 then -- pearls
pearlcount = math.random(1,10)
pearlcolor = math.random (4,5)
pearl = 296 .. pearlcolor
doPlayerAddItem(cid,pearl,pearlcount)
premio = pearlcount .. " pearls"
elseif treasure == 4 then -- map
premio = "a treasure map"
mapid = doPlayerAddItem(cid,3170,1)
doSetItemActionId(mapid,1232)
doSetItemText(mapid,"Conteúdo do mapa aqui")
elseif treasure == 5 then -- ring
premio = "a magic ring"
doPlayerAddItem(cid,3183,1)
end
msg = "You have found " .. premio .. "!"
doPlayerSendTextMessage(cid,22,msg)
end
end
end
-- fim da parte dos tesouros
-- *********************************************************
-- *********************************************************
-- *****************************************
-- adicione isso caso coloque para o mapa vir com algo escrito
elseif item.actionid == 1232 thendoShowTextWindow(item.uid,0,0)
end
-- *****************************************
end
return 1
end
Não se esqueçam de declarar o actionid do map pro script de fishing:
CODE
<action actionid="1232" script="fishing.lua"/>
Lembrando que podem haver erros porque ainda não tive tempo de testá-la
fonte: ######