I would like a script that when a player fishes a monster, it displays who caught that monster when someone looks at it. For example, 'You see a water elemental. It was caught by PLAYER NAME.'
I have a script that works for monster fishing, i just dont know how to add this to my script:
I have a script that works for monster fishing, i just dont know how to add this to my script:
Code:
local config = {
waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
rateSkill = 0.5,
allowFromPz = false,
useWorms = false
}
local v = {
[{300,100}] = {name = "Angry Water Elemental", chance = 13000, storage = 36000},
[{400,100}] = {name = "Ophion Slave", chance = 4000, storage = 36001},
[{500,100}] = {name = "Hydras", chance = 2000, storage = 36002},
[{1000,110}] = {name = "Hydrilica", chance = 1300, storage = 36003},
[{2000,110}] = {name = "Blood Crab", chance = 600, storage = 36004},
[{2000,115}] = {name = "Mature Blood Crab", chance = 450, storage = 36005},
[{2000,115}] = {name = "Giant Squid", chance = 250, storage = 36006},
[{2500,120}] = {name = "Ophion", chance = 40, storage = 36007},
[{3000,130}] = {name = "Megladon", chance = 25, storage = 36008},
[{3000,130}] = {name = "Immature Sharkeater", chance = 20, storage = 36009},
[{4000,135}] = {name = "The Lurker", chance = 15, storage = 36010},
[{5000,140}] = {name = "Aquafilus", chance = 10, storage = 36011},
[{6000,140}] = {name = "Sharkeater", chance = 5, storage = 36012}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if not isInArray(config.waterIds, itemEx.itemid) then
return false
end
if (config.allowFromPz or not getTileInfo(getThingPos(cid)).protection) and itemEx.itemid ~= 493 and math.random((100 + (getPlayerSkill(cid, SKILL_FISHING) / 50))) < getPlayerSkill(cid, SKILL_FISHING) and (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1))) then
local bsMessage = "%s have caught %s"
for i, k in pairs(v) do
if getPlayerLevel(cid) >= i[1] and getPlayerSkillLevel(cid, SKILL_FISHING) >= i[2] then
local c = math.random(20000000)
if c <= k.chance then
doSummonCreature(k.name, getThingPos(cid))
setPlayerStorageValue(cid, k.storage, getPlayerStorageValue(cid, k.storage) +1)
end
end
if k.broadcast then
doBroadcastMessage(bsMessage:format(getCreatureName(cid), k.name))
break
end
end
end
if doPlayerAddSkillTry(cid, SKILL_FISHING, 1) then
return doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
end
end