• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Actions] I need this fishing up monsters script edited

Cornwallis

Member
Joined
Jan 3, 2010
Messages
480
Reaction score
16
Well, this is a hard script to work with for me but I would like if someone would make it so it broadcasts a message when i catch a sea serpent, and still broadcast the massive water elemental, or if you have a better script that is easier to work with please post =)


Code:
local config = {
        waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
        rateSkill = getConfigValue("rateSkill"),
        allowFromPz = false,
        useWorms = true,
        randomsize = 500,
        v = {
                [{1, 5}] = {level = 60, monster = "Wyrm", msg = "You've caught a Wyrm!"},
                [{6, 10}] = {level = 50, monster = "Sea Serpent", msg = "You've caught a Sea Serpent!"},
                [{11, 15}] = {level = 55, monster = "Quara Constrictor", msg = "You've caught a Quara Constrictor!"},
                [{16, 20}] = {level = 65, monster = "Quara Hydromancer", msg = "You've caught a Quara Hydromancer!"},
                [{21, 25}] = {level = 70, monster = "Quara Mantassin", msg = "You've caught a Quara Mantassin!"},
                [{26, 30}] = {level = 70, monster = "Quara Pincher", msg = "You've caught a Quara Pincher!"},
                [{31, 35}] = {level = 70, monster = "Quara Predator", msg = "You've caught a Quara Predator!"},
                [{36, 40}] = {level = 100, monster = "Massive Water Elemental", msg = "You've angered the water gods and a water god has been sent to kill you!!", bc = true}
        }
}
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
                doPlayerAddItem(cid, ITEM_FISH, 1)
                doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
                local formula, lvl = math.random(config.randomsize), getPlayerLevel(cid)
                for range, inf in pairs(config.v) do
                        if formula >= range[1] and formula <= range[2] and lvl >= inf.level then
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, inf.msg)
                                doSummonCreature(inf.monster, getThingPos(cid))
                                if inf.bc then
                                        doBroadcastMessage(getPlayerName(cid) .. " has angered the goddess of water", 22)
                                end
                                break
                        end
                end
        end
        doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
        return true
end
 
Code:
local config = {
	waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
	rateSkill = getConfigValue("rateSkill"),
	allowFromPz = false,
	useWorms = true,
	randomsize = 500,
	v = {
		[{1, 5}] = {level = 60, monster = "Wyrm", msg = "You've caught a Wyrm!"},
		[{6, 10}] = {level = 50, monster = "Sea Serpent", msg = "You've caught a Sea Serpent!", bc = true},
		[{11, 15}] = {level = 55, monster = "Quara Constrictor", msg = "You've caught a Quara Constrictor!"},
		[{16, 20}] = {level = 65, monster = "Quara Hydromancer", msg = "You've caught a Quara Hydromancer!"},
		[{21, 25}] = {level = 70, monster = "Quara Mantassin", msg = "You've caught a Quara Mantassin!"},
		[{26, 30}] = {level = 70, monster = "Quara Pincher", msg = "You've caught a Quara Pincher!"},
		[{31, 35}] = {level = 70, monster = "Quara Predator", msg = "You've caught a Quara Predator!"},
		[{36, 40}] = {level = 100, monster = "Massive Water Elemental", msg = "You've angered the water gods and a water god has been sent to kill you!!"}
	}
}
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
		doPlayerAddItem(cid, ITEM_FISH, 1)
		doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
		local formula, lvl = math.random(config.randomsize), getPlayerLevel(cid)
		for range, inf in pairs(config.v) do
			if formula >= range[1] and formula <= range[2] and lvl >= inf.level then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, inf.msg)
				doSummonCreature(inf.monster, getThingPos(cid))
				if inf.bc then
					doBroadcastMessage(getCreatureName(cid) .. " " .. inf.msg)
				end
				break
			end
		end
	end
	return doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
end
 
Code:
local config = {
	waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
	rateSkill = getConfigValue("rateSkill"),
	allowFromPz = false,
	useWorms = true,
	randomsize = 500,
	v = {
		[{1, 5}] = {level = 60, monster = "Wyrm", msg = "You've caught a Wyrm!"},
		[{6, 10}] = {level = 50, monster = "Sea Serpent", msg = "You've caught a Sea Serpent!", bc = true},
		[{11, 15}] = {level = 55, monster = "Quara Constrictor", msg = "You've caught a Quara Constrictor!"},
		[{16, 20}] = {level = 65, monster = "Quara Hydromancer", msg = "You've caught a Quara Hydromancer!"},
		[{21, 25}] = {level = 70, monster = "Quara Mantassin", msg = "You've caught a Quara Mantassin!"},
		[{26, 30}] = {level = 70, monster = "Quara Pincher", msg = "You've caught a Quara Pincher!"},
		[{31, 35}] = {level = 70, monster = "Quara Predator", msg = "You've caught a Quara Predator!"},
		[{36, 40}] = {level = 100, monster = "Massive Water Elemental", msg = "You've angered the water gods and a water god has been sent to kill you!!"}
	}
}
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
		doPlayerAddItem(cid, ITEM_FISH, 1)
		doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
		local formula, lvl = math.random(config.randomsize), getPlayerLevel(cid)
		for range, inf in pairs(config.v) do
			if formula >= range[1] and formula <= range[2] and lvl >= inf.level then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, inf.msg)
				doSummonCreature(inf.monster, getThingPos(cid))
				if inf.bc then
					doBroadcastMessage(getCreatureName(cid) .. " " .. inf.msg)
				end
				break
			end
		end
	end
	return doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
end
broadcasts a message when i catch a sea serpent, and still broadcast the massive water elemental,
!!!
Code:
local config = {
	waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
	rateSkill = getConfigValue("rateSkill"),
	allowFromPz = false,
	useWorms = true,
	randomsize = 500,
v = {
	[{1, 5}] = {
		level = 60,
		monster = "Wyrm",
		msg = "You've caught a %M!"
	},
	[{6, 10}] = {
		level = 50,
		monster = "Sea Serpent",
		msg = "You've caught a %M!",
		broadcast = "%N has caught a %M!"
	},
	[{11, 15}] = {
		level = 55,
		monster = "Quara Constrictor",
		msg = "You've caught a %M!"
	},
	[{16, 20}] = {
		level = 65,
		monster = "Quara Hydromancer",
		msg = "You've caught a %M!"
	},
	[{21, 25}] = {
		level = 70,
		monster = "Quara Mantassin",
		msg = "You've caught a %M!"
	},
	[{26, 30}] = {
		level = 70,
		monster = "Quara Pincher",
		msg = "You've caught a %M!"
	},
	[{31, 35}] = {
		level = 70,
		monster = "Quara Predator",
		msg = "You've caught a %M!"
	},
	[{36, 40}] = {
		level = 100,
		monster = "Massive Water Elemental",
		msg = "You've angered the water gods and a water god has been sent to kill you!!",
		broadcast = "%N has angered the goddess of water!"
	}
}
}

local function parseMsg(cid, msg, inf)
	if msg:find("%%N") then
		msg = msg:gsub("%%N", getCreatureName(cid))
	end
	if msg:find("%%M") then
		msg = msg:gsub("%%M", inf.monster)
	end
	return msg
end

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
		doPlayerAddItem(cid, ITEM_FISH, 1)
		doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
		local formula, lvl = math.random(config.randomsize), getPlayerLevel(cid)
		for range, inf in pairs(config.v) do
			if formula >= range[1] and formula <= range[2] and lvl >= inf.level then
				local msg = inf.msg
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, parseMsg(cid, msg, inf))
				doSummonCreature(inf.monster, getThingPos(cid))
				if inf.broadcast then
					local bc = inf.broadcast
					doBroadcastMessage(parseMsg(cid, bc, inf), 22)
				end
				break
			end
		end
	end
	doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
	return true
end
 
Last edited:
Code:
local config = {
	waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
	rateSkill = getConfigValue("rateSkill"),
	allowFromPz = false,
	useWorms = true,
	randomsize = 500,
	v = {
		[{1, 5}] = {level = 60, monster = "Wyrm", msg = "You've caught a Wyrm!"},
		[B][COLOR="Blue"][{6, 10}] = {level = 50, monster = "Sea Serpent", msg = "You've caught a Sea Serpent!", bc = true[/COLOR][/B]},
		[{11, 15}] = {level = 55, monster = "Quara Constrictor", msg = "You've caught a Quara Constrictor!"},
		[{16, 20}] = {level = 65, monster = "Quara Hydromancer", msg = "You've caught a Quara Hydromancer!"},
		[{21, 25}] = {level = 70, monster = "Quara Mantassin", msg = "You've caught a Quara Mantassin!"},
		[{26, 30}] = {level = 70, monster = "Quara Pincher", msg = "You've caught a Quara Pincher!"},
		[{31, 35}] = {level = 70, monster = "Quara Predator", msg = "You've caught a Quara Predator!"},
		[{36, 40}] = {level = 100, monster = "Massive Water Elemental", msg = "You've angered the water gods and a water god has been sent to kill you!!"}
	}
}
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
		doPlayerAddItem(cid, ITEM_FISH, 1)
		doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
		local formula, lvl = math.random(config.randomsize), getPlayerLevel(cid)
		for range, inf in pairs(config.v) do
			if formula >= range[1] and formula <= range[2] and lvl >= inf.level then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, inf.msg)
				doSummonCreature(inf.monster, getThingPos(cid))
				if inf.bc then
					doBroadcastMessage(getCreatureName(cid) .. " " .. inf.msg)
				end
				break
			end
		end
	end
	return doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
end
!!!
 
Cykotitan, that script you gave me, do you think you can somehow find a way to make each monster have its own random or w.e ill edit it and also make it so it doesn't catch fish, thanks for trying Existance, I don't think you understood my question but ill rep you both. :p
 
Last edited:
Cykotitan, that script you gave me, do you think you can somehow find a way to make each monster have its own random or w.e ill edit it and also make it so it doesn't catch fish, thanks for trying Existance, I don't think you understood my question but ill rep you both. :p
random broadcast or random normal message?
 
LUA:
local config = {
	waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
	rateSkill = getConfigValue("rateSkill"),
	allowFromPz = false,
	useWorms = true,
	randomsize = 500,
v = {
	[{1, 5}] = {
		level = 60,
		monster = "Wyrm",
		msg = "You've caught a %M!"
	},
	[{6, 10}] = {
		level = 50,
		monster = "Sea Serpent",
		msg = "You've caught a %M!",
		broadcast = "%N has caught a %M!"
	},
	[{11, 15}] = {
		level = 55,
		monster = "Quara Constrictor",
		msg = "You've caught a %M!"
	},
	[{16, 20}] = {
		level = 65,
		monster = "Quara Hydromancer",
		msg = "You've caught a %M!"
	},
	[{21, 25}] = {
		level = 70,
		monster = "Quara Mantassin",
		msg = "You've caught a %M!"
	},
	[{26, 30}] = {
		level = 70,
		monster = "Quara Pincher",
		msg = "You've caught a %M!"
	},
	[{31, 35}] = {
		level = 70,
		monster = "Quara Predator",
		msg = "You've caught a %M!"
	},
	[{36, 40}] = {
		level = 100,
		monster = "Massive Water Elemental",
		msg = "You've angered the water gods and a water god has been sent to kill you!!",
		broadcast = "%N has angered the goddess of water!"
	}
}
}

local function parseMsg(cid, msg, inf)
	if msg:find("%%N") then
		msg = msg:gsub("%%N", getCreatureName(cid))
	end
	if msg:find("%%M") then
		msg = msg:gsub("%%M", inf.monster)
	end
	return msg
end

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
		--doPlayerAddItem(cid, ITEM_FISH, 1)
		doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
		local formula, lvl = math.random(config.randomsize), getPlayerLevel(cid)
		for range, inf in pairs(config.v) do
			if formula >= range[1] and formula <= range[2] and lvl >= inf.level then
				local msg = inf.msg
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, parseMsg(cid, msg, inf))
				doSummonCreature(inf.monster, getThingPos(cid))
				if inf.broadcast then
					local bc = inf.broadcast
					doBroadcastMessage(parseMsg(cid, bc, inf), 22)
				end
				break
			end
		end
	end
	doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
	return true
end

Without a fish -_-
 
LOL obiusly u wanna copy Collapser´s ot Fishing System

YouMad.jpg
 
Back
Top