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

Action Mount system

Ecstacy

Mothafuckaaa
Joined
Dec 26, 2008
Messages
3,836
Reaction score
108
Location
The Netherlands
Hello,

I would like to show you my mount system.
This will let you "mount" (change outfit to) an orc rider.

Add every itemid you want to use to mount in actions.xml

Lua:
<!-- mounting -->
<action itemid="####" event="script" value="mountsystem.lua"/>
Change #### to itemid

make a file named mountsystem.lua in 'actions/scripts'

Then paste in the following:
Lua:
--------------------
---- CONDITION -----
--------------------
local wolfCondition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(wolfCondition, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(wolfCondition, {lookType = 4, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})
--------------------
----- config -------
--------------------
local t =   {
	[7443] = {article='a' ,name='wolf', text='Mount, wolf!', dtext='Demount, wolf!', s=100, condition=wolfCondition},
}      

------------------------------------
--- don't change if you are noob ---
------------------------------------
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local v, r = getCreaturePosition(cid), t[item.itemid]
	local s = r.s
	local pos = {x = v.x, y = v.y, z = v.z}
	if r then
		if getPlayerStorageValue(cid, s) <= 0 then
			doSendMagicEffect(pos, 10)
			doCreatureSay(cid, r.text, 19)
			setPlayerStorageValue(cid, s, 1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted ' .. r.article .. ' '.. r.name .. '.')
			return doAddCondition(cid, r.condition)   
		elseif getPlayerStorageValue(cid, s) == 1 then
			doSendMagicEffect(pos, 10)
			doCreatureSay(cid, r.dtext, 19)
			setPlayerStorageValue(cid, s, 0)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have demounted ' .. r.article .. ' '.. r.name .. '.')
			return doRemoveCondition(cid, CONDITION_OUTFIT)
		else
			return doPlayerSendCancel(cid, 'You can\'t do this.')
		end
	else
		return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'There has been some error, try contacting a staff member.')
	end
end

To make a new monster do this:
Code:
[COLOR="Blue"]make a new condition value (like this)

local ##Condition =  createConditionObject(CONDITION_OUTFIT)
setConditionParam(##Condition, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(##Condition, {lookType = 4, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})

change ## to your monster name.
change '[COLOR="Red"]lookType[/COLOR] = [COLOR="DarkOrange"]4[/COLOR]' to what your monsters looktype is.[/COLOR]

----------------------------------

[COLOR="Blue"]make a new line it local t.
it should look like this
[####] = {article='a/an' ,name='monstername', text='Mount, ,monstername!', dtext='Demount, monstername!', s=storage, condition=testCondition},

[####] == itemid
article == a or an
name = monster name
text = text on mounting
dtext = text on demount
s = storageid
condition = the outfit condition name[/COLOR]

Have fun :thumbup:

##
screenshots
##

mounting.jpg

demount.jpg

mountmsg.jpg

####

tested and working on TFS 0.3.6pl1
 
Last edited:
u can help me :S one error =(

Lua Script Error: [Action Interface]
[06/06/2010 13:52:19] data/actions/scripts/other/mountsystem.lua:eek:nUse

[06/06/2010 13:52:19] data/actions/scripts/other/mountsystem.lua:19: attempt to index local 'r' (a nil value)
[06/06/2010 13:52:19] stack traceback:
[06/06/2010 13:52:19] data/actions/scripts/other/mountsystem.lua:19: in function <data/actions/scripts/other/mountsystem.lua:17>
 
Last edited:
Back
Top