• 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 8.6 Mount Wolf

God Mythera

Veteran OT User
Joined
Aug 11, 2012
Messages
2,048
Solutions
2
Reaction score
256
Location
United States
I take no credit, Therefor this isnt my script... NO FLAMING

gcH5u.png


But this in Actions/Actions.xml
Code:
<action itemid="xxxx" event="script" value="mountsystem.lua"/>


But this in Actions/Scripts/Mount System.xml
Code:
--------------------
---- 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

Edit; This item is pretty useful since it give's speed 50-100 will be normal speed used for a donation item
 
Fixed the problem, I'm an idiot.. = ) k thx bye!

======================================



Not sure why but I'm getting this error..

[26/08/2012 11:51:34] [Error - Action Interface]
[26/08/2012 11:51:34] data/actions/scripts/mount system.lua:eek:nUse
[26/08/2012 11:51:34] Description:
[26/08/2012 11:51:34] data/actions/scripts/mount system.lua:19: attempt to index local 'r' (a nil value)
[26/08/2012 11:51:34] stack traceback:
[26/08/2012 11:51:34] data/actions/scripts/mount system.lua:19: in function <data/actions/scripts/mount system.lua:17>

Help please! Thanks in advance~
 
Fixed the problem, I'm an idiot.. = ) k thx bye!

======================================



Not sure why but I'm getting this error..

[26/08/2012 11:51:34] [Error - Action Interface]
[26/08/2012 11:51:34] data/actions/scripts/mount system.lua:eek:nUse
[26/08/2012 11:51:34] Description:
[26/08/2012 11:51:34] data/actions/scripts/mount system.lua:19: attempt to index local 'r' (a nil value)
[26/08/2012 11:51:34] stack traceback:
[26/08/2012 11:51:34] data/actions/scripts/mount system.lua:19: in function <data/actions/scripts/mount system.lua:17>

Help please! Thanks in advance~

try adding another script in action's with this in it called Mount.xml
Code:
-- [( Mount System 1.4 created by Doidin for XTibia.com )] --
function onUse(cid, item)

local outfit = {lookType = 342} -- Outfit da montaria!
local exhaust = 10 -- Tempo para player poder usar o item novamente! (tempo em segundos)
local time = 1800 -- Tempo para ficar na montaria! (tempo em segundos)
local speed = 100 -- Velocidade adicionada ao player após usar o item! (300 = velocidade, quanto maior mais rapido...)
local mana = 1300 -- Quantidade de mana que o player necessita para usar o sistema!
local premium = 1 -- Apenas players premium accounts "yes" or "no"!?
local storage = 9393 -- Não mexa aqui!

if premium == "yes" and not isPremium(cid) then
return doPlayerSendTextMessage(cid, 23, "Sorry, only premium players.")
end

if(getCreatureMana(cid) < mana) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMANA)
end

if (getPlayerStorageValue(cid, storage) <= os.time()) then
doCreatureSay(cid, "Yeeeah!!!\nYou went up on his ride.", 19)
doSetCreatureOutfit(cid, outfit, time*1000)
doChangeSpeed(cid, speed)
doSendMagicEffect(getCreaturePosition(cid), 34)
setPlayerStorageValue(cid, storage, os.time()+exhaust)
doPlayerAddMana(cid, -mana)
addEvent(doChangeSpeed, time*1000+40, cid, -speed)
addEvent(doPlayerSendTextMessage, time*1000+45, cid, 23, "Mount System is time out!")
addEvent(doSendMagicEffect, time*1000+50, getCreaturePosition(cid), 2)
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid, "Sorry, you only can again use this item after "..exhaust.." seconds.")
end
return TRUE
end
 
Back
Top