Hi, I thought it would be as easy as copying the normal fishing script, just changing some things but it doesn't work. No errors come up but when I use the lava fishing spear it says 'You cannot use this object'.
Can someone help please?
Lava Fishing script:
Actions.xml:
Thank you!
Can someone help please?
Lava Fishing script:
Code:
local config = {
waterIds = {598},
rateSkill = 0.5,
allowFromPz = false,
useWorms = false
}
local t = {
targetId = 0,
SpeakClasses = TALKTYPE_CHANNEL_R,
message = '',
channel = 12
}
local v = {
[{500,120}] = {name = "Blazing Soul", one = 1000000, storage = 36014}
}
function reallyLongReturn(cid, config)
return math.random((100 + (getPlayerSkill(cid, SKILL_FISHING) / 60))) < getPlayerSkill(cid, SKILL_FISHING) and (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
t.targetId = getPlayerGUID(cid)
if not isInArray(config.lavaIds, itemEx.itemid) then
return false
end
if getTilePzInfo(getPlayerPosition(cid)) then
doPlayerSendCancel(cid, "You can't lava fish inside a protection zone.")
return false
end
if itemEx.itemid ~= 598 then
for i, k in pairs(v) do
if getPlayerLevel(cid) >= i[1] and getPlayerSkillLevel(cid, SKILL_FISHING) >= i[2] then
local c = math.random(2110000000)
if c <= k.one then
t.message = getPlayerName(cid).." has been burnt by the super heat of a ".. k.name .." [".. getPlayerLevel(cid) .."]."
doSummonCreature(k.name, getThingPos(cid))
doSendMagicEffect(getThingPos(cid), 4)
setPlayerStorageValue(cid, k.storage, getPlayerStorageValue(cid, k.storage) +1)
for _, pid in ipairs(getPlayersOnline()) do
doPlayerSendChannelMessage(pid, t.targetId, t.message, t.SpeakClasses, t.channel)
end
end
end
if k.broadcast then
doBroadcastMessage(bsMessage:format(getCreatureName(cid), k.name))
break
end
end
end
doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
doSendMagicEffect(toPosition, 6)
end
Actions.xml:
Code:
<action itemid="2580" event="script" value="tools/fishing.lua" allowfaruse="1"/>
<action itemid="10223" event="script" value="tools/upgfishing.lua" allowfaruse="1"/>
<action itemid="3964" event="script" value="tools/lava fishing.lua"/>
Thank you!