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

Mount System dont works

Xeikh

詠春 ☯
Joined
Oct 23, 2009
Messages
724
Reaction score
17
hello, i have rev 4115 with a mount system but when i "tame" the mount dont appears in the outfit window of character, how can fix it?... please help
 
Actions.xml

LUA:
<action itemid="13295" script="mounts.lua"/> --reins
	<action itemid="13294" script="mounts.lua"/> --harness
	<action itemid="13293" script="mounts.lua"/> --leather whip
	<action itemid="13298" script="mounts.lua"/> --carrot on a stick
	<action itemid="13247" script="mounts.lua"/> --hunting horn
	<action itemid="13305" script="mounts.lua"/> --Giant Shrimp
	<action itemid="13291" script="mounts.lua"/> --Maxilla Maximus
	<action itemid="5907" script="mounts.lua"/> --Slingshot
	<action itemid="13307" script="mounts.lua"/> --Sweet Smelling Bait
	<action itemid="13292" script="mounts.lua"/> --tin key



mounts.lua

LUA:
--taming monsters by ruda from otland
local function tameMonster(cid, item, itemEx, tame, run, broken)
	n = math.random(100)
	if n <= broken then
		doCreatureSay(cid, "Lost item", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid)
	elseif n > broken and n <= (tame+broken) then
		doRemoveItem(item.uid)
		doCreatureSay(cid, "You tamed", TALKTYPE_ORANGE_1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You tamed "..getCreatureName(itemEx.uid)..".")
		return true
	elseif n > (tame+broken) and n <= (tame+broken+run) then
		doCreatureSay(cid, "Fled", TALKTYPE_ORANGE_1)
		doRemoveCreature(itemEx.uid)
	else
		doCreatureSay(cid, "Try again", TALKTYPE_ORANGE_1)
	end
	return false
end

local function inArray(table, value)
	for i,v in pairs(table) do
		if (v.name == string.lower(value)) then
			return i
		end
	end
	return 0
end

local mounts = {
	{item = 13307, name = "wailing widow", id = 1, 			tame=20, run=29, broken=51},
	{item = 13298, name = "terror bird", id = 2, 			tame=20, run=29, broken=51},
	{item = 5907, name = "bear", id = 3, 				tame=20, run=29, broken=51},
	{item = 13295, name = "black sheep", id = 4,		 	tame=20, run=25, broken=55},
	{item = 13293, name = "midnight panther", id = 5, 		tame=10, run=39, broken=51},
	{item = 13309, name = "draptor", id = 6, 			tame=10, run=39, broken=51},
	{item = 13305, name = "crustacea gigantica", id = 7, 		tame=10, run=39, broken=51},
	{item = 13247, name = "boar", id = 10, 				tame=10, run=39, broken=51},
	{item = 13291, name = "undead cavebear", id = 12, 		tame=10, run=39, broken=51}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isCreature(itemEx.uid) then
		if inArray(mounts, getCreatureName(itemEx.uid)) > 0 then
			i = inArray(mounts, getCreatureName(itemEx.uid))
			if item.itemid == mounts[i].item and not getPlayerMount(cid, mounts[i].id) then
				if tameMonster(cid, item, itemEx, mounts[i].tame, mounts[i].run, mounts[i].broken) then
					doSendMagicEffect(fromPosition, CONST_ME_MAGIC_BLUE)
					doRemoveCreature(itemEx.uid)
					doPlayerAddMount(cid, mounts[i].id)
				else
					doSendMagicEffect(toPosition, CONST_ME_POFF)
				end
			end
		end
	end
	return true
end

The tame, run and broken all have to = up to 100.

tame is 20% chance you will tame it, run 29% chance it will run away, and 51% is the chance your item will break.

+REP please
 
Back
Top