local function speedToNormal(cid)
doChangeSpeed(cid, -3000)
return true
end
function onStepIn(cid, item, fromPos, item2, toPos)
if item.uid == buffBgHealRedUID then
if (os.time() > getGlobalStorageValue(buffBgHealStorage) + 120) then -- -- jeśli teraz jest > od 15:06
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), false)
doSendMagicEffect(getThingPos(cid), 14)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Your health has been regenerated. Buff will spawn again in 2 minutes.')
setGlobalStorageValue(buffBgHealStorage, os.time()) -- 15:00
end
end
if item.uid == buffBgSpeedRedUID then
if (os.time() > getGlobalStorageValue(buffBgSpeedStorage) + 60) then -- -- jeśli teraz jest > od 15:06
doChangeSpeed(cid, 3000)
addEvent(speedToNormal, 15*1000, cid)
doSendMagicEffect(getThingPos(cid), 13)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You\'re faster for 15 seconds. Buff will spawn again in 1 minute.')
setGlobalStorageValue(buffBgSpeedStorage, os.time()) -- 15:00
end
end
if item.uid == buffBgManaBlueUID then
if (os.time() > getGlobalStorageValue(buffBgManaBlueStorage) + 120) then -- -- jeśli teraz jest > od 15:06
doCreatureAddMana(cid, getCreatureMaxMana(cid), false)
doSendMagicEffect(getThingPos(cid), 12)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Your mana has been regenerated. Buff will spawn again in 2 minutes.')
setGlobalStorageValue(buffBgManaBlueStorage, os.time()) -- 15:00
end
end
if item.uid == buffBgSpeedBlueUID then
if (os.time() > getGlobalStorageValue(buffBgSpeedBlueStorage) + 70) then -- -- jeśli teraz jest > od 15:06
doChangeSpeed(cid, 3000)
addEvent(speedToNormal, 17*1000, cid)
doSendMagicEffect(getThingPos(cid), 13)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You\'re faster for 17 seconds. Buff will spawn again in 1 minute and 10 seconds.')
setGlobalStorageValue(buffBgSpeedBlueStorage, os.time()) -- 15:00
end
end
return true
end