DayZ 1.24
Loading...
Searching...
No Matches
ChristmasTree.c
Go to the documentation of this file.
1class ChristmasTree extends House
2{
3 XmasTreeLight m_TreeLight;
5 const string LOOP_SOUND = "ChristmasMusic_SoundSet";
6
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 PlaySoundSetLoop(m_AmbientSoundLoop, LOOP_SOUND, 0, 0);
20 }
21
22 override void EEDelete(EntityAI parent)
23 {
24 if (!GetGame().IsDedicatedServer())
25 {
26 if (m_TreeLight)
27 m_TreeLight.Destroy();
28 if (m_AmbientSoundLoop)
29 SEffectManager.DestroyEffect(m_AmbientSoundLoop);
30 }
31 }
32};
Wrapper class for managing sound through SEffectManager.
Definition EffectSound.c:5
override void EEInit()
EffectSound m_AmbientSoundLoop
XmasTreeLight m_TreeLight
override void EEDelete(EntityAI parent)
void ChristmasTree()
Manager class for managing Effect (EffectParticle, EffectSound)
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
proto native CGame GetGame()