local speed = createConditionObject(CONDITION_HASTE)
setConditionParam(speed, CONDITION_PARAM_TICKS,2*60*1000)
setConditionFormula(speed, 0.9,150, 0.9,150)
local allowed = {4820,4821,4822,4823,4824,4825} --tiles.
function onStepIn(cid, item, frompos, itemEx, topos, fromPosition)
local s,v = 18528,getThingPos(cid)
local p = getThingPos(cid)
p.stackpos = 0
if isInArray(allowed,getThingFromPos(p).itemid) then
if getPlayerStorageValue(cid,s) < os.time then
local tmp = getCreatureOutfit(cid)
tmp.lookType = 125 -- change to outfit to change into when done.
doCreatureChangeOutfit(cid,tmp)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_RED,'['..os.time..'] You changed back into a human being.')
else
if getCreatureCondition(cid,speed) then
if getPlayerStorageValue(cid,s) < os.time then
return true
else
doRemoveCondition(cid,speed)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_RED,'You lost you\'re speed bonus.')
end
else
doAddCondition(cid,speed)
doSendMagicEffect(v,CONST_ME_POFF)
end
end
return true
else
local tmp = getCreatureOutfit(cid)
tmp.lookType = 125 -- change to outfit to change into when done.
doCreatureChangeOutfit(cid,tmp)
doRemoveCondition(cid,speed)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_RED,'You lost you\'re speed bonus and changed back into a human being.')
end
return true
end