• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Mount System - The same functionality as real tibia.

Ped0bear

Haters keep hating
Joined
Mar 16, 2010
Messages
528
Reaction score
9
Location
Everywhere and nowhere
mount.lua
Lua:
local t = {
	[5907] = {'Bear', 3},
	[13226] = {'Black Sheep', 4},
	[13224] = {'Midnight Panther', 5},
	[13229] = {'Terror Bird', 2},
	[13178] = {'Boar', 10},
	[13236] = {'Crustacea Gigantica', 7},
	[13222] = {'Undead Cavebear', 12},
	[13238] = {'Wailing Widow', 1},
	[13225] = {'Draptor', 6}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isMonster(itemEx.uid) then
		local v = t[item.itemid]
		if v and v[1] == getCreatureName(itemEx.uid) and not getPlayerMount(cid, v[2]) then
			doPlayerAddMount(cid, v[2])
			doRemoveCreature(itemEx.uid)
			doSendMagicEffect(toPosition, CONST_ME_POFF)
            doRemoveItem(item.uid, 1)
		return true
		end
		end
		end

Actions.xml
XML:
			<!-- mount system  -->
	<action itemid="13238" event="script" value="mount.lua"/>
	<action itemid="5907" event="script" value="mount.lua"/>
	<action itemid="13229" event="script" value="mount.lua"/>
	<action itemid="13222" event="script" value="mount.lua"/>
	<action itemid="13225" event="script" value="mount.lua"/>
	<action itemid="13226" event="script" value="mount.lua"/>
	<action itemid="13236" event="script" value="mount.lua"/>
	<action itemid="13178" event="script" value="mount.lua"/>
	<action itemid="13224" event="script" value="mount.lua"/>

I´d suggest you edit the itemids as I am using others.
 
But i got client 8.54 because of some custom sprites and some issues
and TFS 0.3.6 ;p
 
it isnt same like rl in real u have chances to lost item/tamed/monsters run/
and monsters issue the special sounds
 
it isnt same like rl in real u have chances to lost item/tamed/monsters run/
and monsters issue the special sounds

Yeah.. lets not get to serious.
You can make it that way if you wish, I won´t release mine unfornatly, this was just a script someone requested :p
 
mount.lua
Lua:
local t = {
	[5907] = {'Bear', 3},
	[13226] = {'Black Sheep', 4},
	[13224] = {'Midnight Panther', 5},
	[13229] = {'Terror Bird', 2},
	[13178] = {'Boar', 10},
	[13236] = {'Crustacea Gigantica', 7},
	[13222] = {'Undead Cavebear', 12},
	[13238] = {'Wailing Widow', 1},
	[13225] = {'Draptor', 6}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isMonster(itemEx.uid) then
		local v = t[item.itemid]
		if v and v[1] == getCreatureName(itemEx.uid) and not getPlayerMount(cid, v[2]) then
			doPlayerAddMount(cid, v[2])
			doRemoveCreature(itemEx.uid)
			doSendMagicEffect(toPosition, CONST_ME_POFF)
            doRemoveItem(item.uid, 1)
		return true
		end
		end
		end

Actions.xml
XML:
			<!-- mount system  -->
	<action itemid="13238" event="script" value="mount.lua"/>
	<action itemid="5907" event="script" value="mount.lua"/>
	<action itemid="13229" event="script" value="mount.lua"/>
	<action itemid="13222" event="script" value="mount.lua"/>
	<action itemid="13225" event="script" value="mount.lua"/>
	<action itemid="13226" event="script" value="mount.lua"/>
	<action itemid="13236" event="script" value="mount.lua"/>
	<action itemid="13178" event="script" value="mount.lua"/>
	<action itemid="13224" event="script" value="mount.lua"/>

I´d suggest you edit the itemids as I am using others.

thanks u are the best :)
 
THIS IS GOOD FOR ME!

data/actions/actions.xml
Lua:
	<action itemid="13419" script="mount.lua"/>
	<action itemid="13410" script="mount.lua"/>
	<action itemid="5907" script="mount.lua"/>
	<action itemid="13407" script="mount.lua"/>
	<action itemid="13405" script="mount.lua"/>
	<action itemid="13406" script="mount.lua"/>
	<action itemid="13417" script="mount.lua"/>
	<action itemid="13404" script="mount.lua"/>
	<action itemid="13359" script="mount.lua"/>
	<action itemid="13403" script="mount.lua"/>
----------
data/actions/scripts/mount.lua

Lua:
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 = 13419, name = "wailing widow", id = 1, tame=10, run=39, broken=51},
{item = 13410, name = "terror bird", id = 2, tame=10, run=39, broken=51},
{item = 5907, name = "bear", id = 3, tame=7, run=39, broken=54},
{item = 13407, name = "black sheep", id = 4, tame=7, run=35, broken=58},
{item = 13405, name = "midnight panther", id = 5, tame=10, run=39, broken=51},
{item = 13406, name = "draptor", id = 6, tame=10, run=30, broken=51},
{item = 13417, name = "crustacea gigantica", id = 7, tame=10, run=39, broken=51},
{item = 0, name = "", id = 8, tame=0, run=0, broken=0},
{item = 0, name = "", id = 9, tame=0, run=0, broken=0},
{item = 13359, name = "boar", id = 10, tame=20, run=39, broken=51},
{item = 0, name = "", id = 11, tame=0, run=0, broken=0},
{item = 13403, name = "undead cavebear", id = 12, tame=10, run=39, broken=51}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isCreature(itemEx.uid) then
local creature = getCreatureName(itemEx.uid)
local itemName = getItemName(item.uid)

		if inArray(mounts, getCreatureName(itemEx.uid)) > 0 then
			i = inArray(mounts, getCreatureName(itemEx.uid))
			if item.itemid == mounts[i].item 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
doCreatureSay(cid, "You already have ".. creature .." mount!", TALKTYPE_ORANGE_1)
doSendMagicEffect(toPosition, CONST_ME_POFF)
				end
else
doCreatureSay(cid, "The ".. itemName .." is not meant to tame a ".. creature .." mount!", TALKTYPE_ORANGE_1)
doSendMagicEffect(toPosition, CONST_ME_POFF)


			end

		end


	end
	return true
end

TY
 
Last edited:
mount.lua
Lua:
local t = {
	[5907] = {'Bear', 3},
	[13226] = {'Black Sheep', 4},
	[13224] = {'Midnight Panther', 5},
	[13229] = {'Terror Bird', 2},
	[13178] = {'Boar', 10},
	[13236] = {'Crustacea Gigantica', 7},
	[13222] = {'Undead Cavebear', 12},
	[13238] = {'Wailing Widow', 1},
	[13225] = {'Draptor', 6}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isMonster(itemEx.uid) then
		local v = t[item.itemid]
		if v and v[1] == getCreatureName(itemEx.uid) and not getPlayerMount(cid, v[2]) then
			doPlayerAddMount(cid, v[2])
			doRemoveCreature(itemEx.uid)
			doSendMagicEffect(toPosition, CONST_ME_POFF)
            doRemoveItem(item.uid, 1)
		return true
		end
		end
		end

Actions.xml
XML:
			 <action itemid="13238" event="script" value="mount.lua"/> <action itemid="5907" event="script" value="mount.lua"/> <action itemid="13229" event="script" value="mount.lua"/> <action itemid="13222" event="script" value="mount.lua"/> <action itemid="13225" event="script" value="mount.lua"/> <action itemid="13226" event="script" value="mount.lua"/> <action itemid="13236" event="script" value="mount.lua"/> <action itemid="13178" event="script" value="mount.lua"/> <action itemid="13224" event="script" value="mount.lua"/>

I´d suggest you edit the itemids as I am using others.


Are you using 870 otb? or our custom?
 
Back
Top