--------------------
---- CONDITION -----
--------------------
local wolfCondition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(wolfCondition, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(wolfCondition, {lookType = 27, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})
local bearCondition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(bearCondition, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(bearCondition, {lookType = 16, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})
--------------------
----- config -------
--------------------
local t = {
[2129] = {article='a' ,name='wolf', text='Transform, wolf!', dtext='DeTransform, wolf!', s=100, condition=wolfCondition},
}
local t = {
[5896] = {article='a' ,name='bear', text='Transform, bear!', dtext='DeTransform, bear!', s=100, condition=bearCondition},
}
------------------------------------
--- 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 transformed ' .. 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 detransformed ' .. 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
<!-- mounting -->
<action itemid="2129" event="script" value="mountsystem.lua"/>
<action itemid="5896" event="script" value="mountsystem.lua"/>
--------------------
---- CONDITION -----
--------------------
local wolfCondition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(wolfCondition, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(wolfCondition, {lookType = 27, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})
local bearCondition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(bearCondition, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(bearCondition, {lookType = 16, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})
--------------------
----- config -------
--------------------
local t = {
[2129] = {article='a' ,name='wolf', text='Transform, wolf!', dtext='DeTransform, wolf!', s=100, condition=wolfCondition},
[5896] = {article='a' ,name='bear', text='Transform, bear!', dtext='DeTransform, bear!', s=101, condition=bearCondition}
}
------------------------------------
--- 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 transformed ' .. 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 detransformed ' .. 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
<action itemid="2129;5896" event="script" value="mountsystem.lua"/>
--------------------
---- CONDITION -----
--------------------
local wolfCondition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(wolfCondition, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(wolfCondition, {lookType = 27, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})
local bearCondition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(bearCondition, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(bearCondition, {lookType = 16, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})
--------------------
----- config -------
--------------------
local t = {
[2129] = {article='a' ,name='wolf', text='Transform, wolf!', dtext='DeTransform, wolf!', s=100, condition=wolfCondition},
[5896] = {article='a' ,name='bear', text='Transform, bear!', dtext='DeTransform, bear!', s=100, condition=bearCondition}
}
------------------------------------
--- 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 .. '.')
doRemoveItem(item.uid,1)
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 .. '.')
doRemoveItem(item.uid,1)
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
lookType = 27
Is this in real tibia?
cant get ur point
Just curious where it came from, I haven't seen it on real tibia.
I think it came from a project started here on OtLand if I remember correctly...