Code
#define Debug(string) = DisplayTextToPlayer(Player(0), 0., 0., string)
#define < Expired Timer() > = GetExpiredTimer()
scope OgreAstral
globals
private trigger InitTrigger = CreateTrigger()
endglobals
private module Init
private static method onInit takes nothing returns nothing
call Preload(I2S('AHds'));PreloadEnd(0.1)
call Preload("Abilities\\Spells\\Human\\DivineShield\\DivineShieldTarget.mdl");PreloadEnd(0.1)
call TriggerRegisterAnyUnitEventBJ(InitTrigger, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddAction(InitTrigger, function thistype.Actions)
//Map
call TriggerSleepAction( 2 )
call IssueImmediateOrder( gg_unit_H000_0002, "divineshield" )
endmethod
endmodule
private struct Table
unit caster = null
private static method AstralEnd takes nothing returns thistype
local timer SaveTimer = Expired Timer()
local thistype this = GetTimerData(SaveTimer)
call ShowUnit(.caster , true)
if GetLocalPlayer() == GetOwningPlayer(.caster ) then
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 0.7, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100.00, 100.00, 100.00, 50.00 )
endif
call .destroy()
call ReleaseTimer(SaveTimer)
set SaveTimer = null
return this
endmethod
private static method Actions takes nothing returns thistype
if ( GetSpellAbilityId() == 'AHds') then
local integer Index = 0
local thistype this
local timer SaveTimer
local unit Hero = GetSpellAbilityUnit()
set this = thistype.create()
set SaveTimer = NewTimer()
call ShowUnit(Hero, false)
if GetLocalPlayer() == GetOwningPlayer(Hero) then
call ShowUnit(Hero, true)
call SelectUnit(Hero,true)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 1., "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100.00, 100.00, 100.00, 50.00 )
endif
set .caster = Hero
call SetTimerData(SaveTimer, this)
call TimerStart(SaveTimer, 5., false, function thistype.AstralEnd)
set SaveTimer = null
endif
set Hero = null
return this
endmethod
//==========================================================================
implement Init
endstruct
endscope