Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
christmastree.c
Go to the documentation of this file.
1class ChristmasTree extends House
2{
3 XmasTreeLight m_TreeLight;
4 EffectSound m_AmbientSoundLoop;
5 const string LOOP_SOUND = "ChristmasMusic_SoundSet";
6
7 void ChristmasTree()
8 {
9 if ( !GetGame().IsDedicatedServer() )
10 {
11 m_TreeLight = XmasTreeLight.Cast( ScriptedLightBase.CreateLight( XmasTreeLight, "0 0 0" ) );
12 m_TreeLight.AttachOnMemoryPoint( this, "action" );
13 }
14 }
15
16 override void EEInit()
17 {
18 if ( !GetGame().IsDedicatedServer() )
19 {
20 PlaySoundSetLoop( m_AmbientSoundLoop, LOOP_SOUND, 0, 0 );
21 }
22 }
23
24 override void EEDelete(EntityAI parent)
25 {
26 if ( !GetGame().IsDedicatedServer() )
27 {
28 if ( m_TreeLight )
29 m_TreeLight.Destroy();
30 if ( m_AmbientSoundLoop )
31 SEffectManager.DestroyEffect(m_AmbientSoundLoop);
32 }
33 }
34};
35class ChristmasTree_Green extends ChristmasTree {};
Wrapper class for managing sound through SEffectManager.
Definition effectsound.c:5
Manager class for managing Effect (EffectParticle, EffectSound)
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
ContaminatedArea_Base EffectArea EEInit()
override void EEDelete(EntityAI parent)
proto native CGame GetGame()