Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function startRegen(playerid, isBlock)
- local regen = addEvent(function(pid)
- local c = Creature(pid)
- if c and c:isPlayer() then
- if isBlock then
- stopEvent(regen)
- else
- if not Tile(c:getPosition()):getGround():getActionId() == 4505 then
- stopEvent(regen)
- else
- c:addMana(c:getVocation():getManaGainAmount())
- c:addHealth(c:getVocation():getHealthGainAmount())
- startRegen(c:getId(), false)
- end
- end
- end
- end, 3*1000, playerid)
- end
- function onStepIn(creature, item, position, fromPosition)
- if not creature:isPlayer() then
- return true
- end
- if position == CASTLE_INFO.THRONE_POSITION then
- Castle:onStepIn(creature)
- else
- startRegen(creature:getId(), false)
- end
- return true
- end
- function onStepOut(creature, item, position, fromPosition)
- if not creature:isPlayer() then
- return true
- end
- if position == CASTLE_INFO.THRONE_POSITION then
- Castle:onStepOut(creature)
- else
- startRegen(creature:getId(), true)
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement