Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local MOVE_WALK = 0
- local MOVE_RUN = 1
- local MOVE_RUN_BACK = 2
- local MOVE_SWIM = 3
- local MOVE_SWIM_BACK = 4
- local MOVE_TURN_RATE = 5
- local MOVE_FLIGHT = 6
- local MOVE_FLIGHT_BACK = 7
- local MOVE_PITCH_RATE = 8
- local UNIT_FIELD_MOUNTDISPLAYID = 69
- local FlyMountModel = 25511
- local function UponDeathTimedEvent(eventId, delay, calls, player)
- player:SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, FlyMountModel)
- player:AddAura( 34873, player ) -- add fly aura
- player:SetSpeed( MOVE_FLIGHT, 4.1, false )
- player:SetSpeed( MOVE_RUN, 2.0, false )
- end
- local function OnRepop(event, player)
- inBattleGround = player:InBattleground()
- if not inBattleGround then
- player:RegisterEvent(UponDeathTimedEvent, 1000, 1)
- end
- end
- local function OnResurrect(event, player)
- inBattleGround = player:InBattleground()
- if not inBattleGround then
- player:SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0)
- player:RemoveAura( 34873 ) -- remove fly aura
- player:SetSpeed( MOVE_FLIGHT, 4.1, false )
- player:SetSpeed( MOVE_RUN, 1.0, false )
- end
- end
- RegisterPlayerEvent(35, OnRepop)
- RegisterPlayerEvent(36, OnResurrect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement