• 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!

Fishing

Status
Not open for further replies.

Fallen

Freelancer
Senator
Joined
Aug 21, 2009
Messages
3,712
Reaction score
250
Location
Egypt
Fixed and Approved by Cykotitan, Thanks alot dude <3 ill mass repp you!
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 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
 
Last edited:
This line:
LUA:
doSummonCreature("Wyrm", toPosition)

Should be:
LUA:
doSummonCreature("Wyrm", getCreaturePosition(cid))

So it would be:
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
}
rand = math.random(1,2000)
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(not isInArray(config.waterIds, itemEx.itemid)) then
        return false
    end
    if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and itemEx.itemid ~= 493 and
        math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and
        (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))) then
                                if rand <= 20 then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You\'ve caught a Wyrm!")
            doSummonCreature("Wyrm", getCreaturePosition(cid))
                                elseif rand >= 1300 then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You\'ve caught a Sea Serpent!")
            doSummonCreature("Sea Serpent", getCreaturePosition(cid))
                                elseif rand > 500 and rand < 700 then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You\'ve caught a quara constrictor!")
            doSummonCreature("quara constrictor", getCreaturePosition(cid))
                                elseif rand > 700 and rand < 1000 then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You\'ve caught a quara hydromancer!")
            doSummonCreature("quara hydromancer", getCreaturePosition(cid))
                                elseif rand > 1000 and rand < 1300 then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You\'ve caught a quara mantassin!")
            doSummonCreature("quara mantassin", getCreaturePosition(cid))
                                elseif rand > 300 and rand < 600 then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You\'ve caught a quara pincher!")
            doSummonCreature("quara pincher", getCreaturePosition(cid))
                                elseif rand > 1500 and rand < 1800 then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You\'ve caught a quara predator!")
            doSummonCreature("quara predator", getCreaturePosition(cid))
                                elseif rand >= 200 and rand < 255 then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You\'ve angered the water gods and a water god has been sent to kill you!!")
                        doSummonCreature("Oceanus", getCreaturePosition(cid))
                        doBroadcastMessage(getPlayerName(cid) .. " has angered the goddess of water", 22)
                                end
                                doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
    end
    doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
    return true
end
 
#SexyDevil#
Script with noobish table :P
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
}
summonTable = {
	{min_ = 1500, max_ = 1800, name_ = "quara predator"},
	{min_ = 1000, max_ = 1300, name_ = "quara mantassin"},
	{min_ = 700, max_ = 1000, name_ = "quara hydromancer"},
	{min_ = 500, max_ = 700, name_ = "quara constrictor"},
	{min_ = 300, max_ = 500, name_ = "quara pincher"}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(not isInArray(config.waterIds, itemEx.itemid)) then
		return false
	end
	
	local rand = math.random(1,2000)
	if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and itemEx.itemid ~= 493 and math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and (not config.useWorms or doPlayerRemoveItem(cid, ITEM_WORM, 1))) then
		for v in summonTable do
			if rand >= v.min_ and rand < v.max_ then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You\'ve caught a "..v.name_.."!")
				doSummonCreature(v.name_, getCreaturePosition(cid))
				break
			end
		end
		if rand <= 20 then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You\'ve caught a Wyrm!")
			doSummonCreature("Wyrm", getCreaturePosition(cid))
		elseif rand >= 1300 then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You\'ve caught a Sea Serpent!")
            doSummonCreature("Sea Serpent", getCreaturePosition(cid))
		elseif rand >= 200 and rand < 255 then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You\'ve angered the water gods and a water god has been sent to kill you!!")
			doSummonCreature("Oceanus", getCreaturePosition(cid))
			doBroadcastMessage(getPlayerName(cid) .. " has angered the goddess of water", 22)
		end
		doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
	end
    doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
    return true
end
 
@2nd post Gives an error:
Lua Script Error: [Action Interface]
data/actions/scripts/tools/fishing.lua:onUse

data/actions/scripts/tools/fishing.lua:21: attempt to call a table value stack traceback:
data/actions/scripts/tools/fishing.lua:21: in function <data/actions/scripts/tools/fishing.lua

@1st one Works perfect Just if you mind fixing me the randomization ill be happy cuz it only catchs one monster!, Thank you man
 
Last edited:
I don't know why it won't work, but TFS 0.3.x have bugged stack...

Try this:
LUA:
  local config = {
    waterIds = {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
}
summonTable = {
        {min_ = 1500, max_ = 1800, name_ = "quara predator"},
        {min_ = 1000, max_ = 1300, name_ = "quara mantassin"},
        {min_ = 700, max_ = 1000, name_ = "quara hydromancer"},
        {min_ = 500, max_ = 700, name_ = "quara constrictor"},
        {min_ = 300, max_ = 500, name_ = "quara pincher"}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
        if (not isInArray(config.waterIds, itemEx.itemid)) then
                return false
        end
       
        local rand = math.random(1,2000)
        if ((config.allowFromPz or (not getTileInfo(getCreaturePosition(cid)).protection)) and (math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING)) and (not config.useWorms or doPlayerRemoveItem(cid, ITEM_WORM, 1))) then
                for _, v in summonTable do
                        if rand >= v.min_ and rand < v.max_ then
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You\'ve caught a "..v.name_.."!")
                                doSummonCreature(v.name_, getCreaturePosition(cid))
                                break
                        end
                end
                if rand <= 20 then
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You\'ve caught a Wyrm!")
					doSummonCreature("Wyrm", getCreaturePosition(cid))
                elseif rand >= 1300 then
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You\'ve caught a Sea Serpent!")
					doSummonCreature("Sea Serpent", getCreaturePosition(cid))
                elseif rand >= 200 and rand < 255 then
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You\'ve angered the water gods and a water god has been sent to kill you!!")
					doSummonCreature("Oceanus", getCreaturePosition(cid))
					doBroadcastMessage(getPlayerName(cid) .. " has angered the goddess of water", 22)
                end
                doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
        end
    doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
    return true
end
 
could make according to the level of fhishin sumon a monster or another?

for example 10 will come a Rotworm fhising
fhising 20 Dragon
fhisinh 30 dragon lord
fhising 50 demon

fhising 60 Orshaball >.<

¿?

could be done?

thanks
 
Fixed and Approved by Cyko~
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 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
 
Last edited:
Fixed? lmao - you can say, someone else fixed, I dont believe someone from Egypt can do anything.
 
He's a guy living in Egypt...(not egyptian)
He REALLY hates egyptians(I know him lol)
Some egyptians are a pain in the ass.(spamming 'xd' when you kill them, and nothing else.)
 
Our current script:
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 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

Sorry, Yeah Its working perfectly.
 
Last edited:
Our current script:
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 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

If some1 can fix it, ull have your reward!
wat

OtLand - Conversation Between chubby711 and Cykotitan

op delivar nao

it's not working right?
 
Status
Not open for further replies.
Back
Top