LucasFerraz
Systems Analyst
Can someone help me to create this funcion?
I will use to add/remove speed
Why? Because i'm trying to make a functional Boots of waterwalking
I will use to add/remove speed
LUA:
function ChangePlayerSpeed(cid)
end
Why? Because i'm trying to make a functional Boots of waterwalking
LUA:
local condition = createConditionObject(CONDITION_DROWN)
setConditionParam(condition, CONDITION_PARAM_PERIODICDAMAGE, -20)
setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
setConditionParam(condition, CONDITION_PARAM_TICKINTERVAL, 5000)
local t = {5405, 5406, 5407, 5408, 5409, 5410, 5743, 5744, 5764, 9671, 9672, 9673}
local HOTD_DECAYING = 12541
function onStepIn(cid)
if isPlayer(cid) then
if not getPlayerFlagValue(cid, PLAYERFLAG_CANNOTBEATTACKED) then
doAddCondition(cid, condition)
end
local v = getPlayerSlotItem(cid, CONST_SLOT_HEAD)
if v.itemid == 5461 then
local s = getCreatureStorage(cid, 25)
if os.time() < s then
doTransformItem(v.uid, 12541)
doItemSetAttribute(v.uid, 'duration', (s - os.time()) * 1000)
doDecayItem(v.uid)
end
end
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == 2358 then
if os.time() < getCreatureStorage(cid, 2358) == 1 then
doChangeSpeed(cid, 1200)
end
end
end
end
function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition)
if isPlayer(cid) and (toPosition.x == 0 or not isInArray(t, getThingfromPos(toPosition).itemid)) then
local v = getPlayerSlotItem(cid, CONST_SLOT_HEAD)
if v.itemid == 12541 then
doTransformItem(v.uid, 5461)
end
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == 2358 then
doChangeSpeed(cid, -1200)
end
doRemoveCondition(cid, CONDITION_DROWN)
end
end
Last edited: