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

C'on HeLP ;(

Mozax

New Member
Joined
Jun 12, 2009
Messages
26
Reaction score
0
Location
in a house lol -.-
like i have done a new monster called Leviathan
and i have puted him in data/monster/laviathan.xml
but i still get the same error
it says it cannot found the monster
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
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
}

local monsters = {'Leviathan'}

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 getPlayerLevel(cid) >= 5000 and getPlayerSkillLevel(cid, SKILL_FISHING) >= 100 then
randsummon = math.random(0,9)
elseif getPlayerLevel(cid) >= 5000 then
randsummon = math.random(0,8)
elseif getPlayerLevel(cid) >= 3000 then
randsummon = math.random(0,6)
elseif getPlayerLevel(cid) >= 1500 then
randsummon = math.random(0,4)
elseif getPlayerLevel(cid) >= 500 then
randsummon = math.random(0,2)
else
doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
end

if randsummon == 0 then
doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
else
doSummonMonster(monsters[randsummon], getCreaturePosition(cid))
doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
end
end

doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
return true
end

and the monster works fine as a respaw and summoned by a god


erro>[18/01/2010 16:20:09] [Error - Action Interface]
[18/01/2010 16:20:09] data/actions/scripts/tools/fishing.luanUse
[18/01/2010 16:20:09] Description:
[18/01/2010 16:20:09] (luaDoSummonMonster) Creature not found
what do i do?



Thx
 
[19/01/2010 20:58:06] [Error - Action Interface]
[19/01/2010 20:58:06] data/actions/scripts/tools/fishing.lua:onUse
[19/01/2010 20:58:06] Description:
[19/01/2010 20:58:06] (luaDoSummonMonster) Creature not found
 
Code:
local config = {
	monsters = {"Leviathan"},
	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
}
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 getPlayerLevel(cid) >= 500 then
			local randSummon = math.random(#config.monsters + 1)
			if config.monsters[randSummon] then
				doSummonMonster(config.monsters[randSummon], getCreaturePosition(cid))
			end
		else
			doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
		end
	end

	doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
	return true
end
 
Last edited:
ok i think it works cause i had no erros in the console
but 1 more question like if i wanted to add another monster like sea serpent
and i wanted to the sea serpent to be easier to catch then the leviathan
how would i do that?


thx u rly helped me
 
damn i just found a error the players cant use the rod
only gms


[19/01/2010 22:21:40] [Error - Action Interface]
[19/01/2010 22:21:40] data/actions/scripts/tools/fishing.lua:onUse
[19/01/2010 22:21:40] Description:
[19/01/2010 22:21:40] data/actions/scripts/tools/fishing.lua:15: attempt to get length of field '?' (a nil value)
[19/01/2010 22:21:40] stack traceback:
[19/01/2010 22:21:40] data/actions/scripts/tools/fishing.lua:15: in function <data/actions/scripts/tools/fishing.lua:8>
 
ok i think it works cause i had no erros in the console
but 1 more question like if i wanted to add another monster like sea serpent
and i wanted to the sea serpent to be easier to catch then the leviathan
how would i do that?


thx u rly helped me

noob way to do it, you could add sea serpent multiple times, and only one leviathan
 
Fixed and improved:
Code:
local config = {
	monsters = {
[B][COLOR="Red"]		{{1, 40}, "Sea Serpent"}, -- 40% chance for Sea Serpent,
		{{41, 50}, "Leviathan"}, -- 10% chance for Leaviathan,
		{{51, 100}} -- 50% chance for nothing[/COLOR][/B]
	},
	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
}
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 getPlayerLevel(cid) >= 500 then
			local randSummon, monster = math.random(100), nil
			for i = 1, #config.monsters do
				if randSummon >= config.monsters[i][1][1] and randSummon <= config.monsters[i][1][2] then
					if(config.monsters[i][2]) then
						monster = config.monsters[i][2]
					end
					break
				end
			end
			if(monster) then
				doSummonMonster(monster, getCreaturePosition(cid))
			end
		else
			doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
		end
	end

	doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
	return true
end
 
Back
Top