Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
shelterkit.c
Go to the documentation of this file.
1
class
ShelterKit
extends
KitBase
2
{
3
override
bool
CanReceiveAttachment
(
EntityAI
attachment,
int
slotId)
4
{
5
if
( !super.CanReceiveAttachment(attachment, slotId) )
6
return
false
;
7
8
ItemBase
att =
ItemBase
.Cast(GetInventory().FindAttachment(slotId));
9
if
(att)
10
return
false
;
11
12
return
true
;
13
}
14
15
//================================================================
16
// ADVANCED PLACEMENT
17
//================================================================
18
override
void
OnPlacementComplete
( Man player,
vector
position =
"0 0 0"
,
vector
orientation =
"0 0 0"
)
19
{
20
super.OnPlacementComplete( player, position, orientation );
21
22
if
(
g_Game
.IsServer() )
23
{
24
//Create shelter site
25
ShelterSite site = ShelterSite.Cast(
g_Game
.CreateObjectEx(
"ShelterSite"
,
GetPosition
(),
ECE_PLACE_ON_SURFACE
) );
26
site.SetPosition( position );
27
site.SetOrientation( orientation );
28
29
//make the kit invisible, so it can be destroyed from deploy UA when action ends
30
HideAllSelections();
31
}
32
}
33
34
override
bool
DoPlacingHeightCheck
()
35
{
36
return
true
;
37
}
38
39
override
float
HeightCheckOverride
()
40
{
41
return
1.6;
42
}
43
44
override
string
GetPlaceSoundset
()
45
{
46
return
"Shelter_Site_Build_Start_SoundSet"
;
47
}
48
49
override
string
GetDeploySoundset
()
50
{
51
return
"Shelter_Site_Build_Finish_SoundSet"
;
52
}
53
54
override
void
DisassembleKit
(
ItemBase
item)
55
{
56
if
(!
IsHologram
())
57
{
58
ItemBase
stick =
ItemBase
.Cast(
g_Game
.CreateObjectEx(
"WoodenStick"
,
GetPosition
(),
ECE_PLACE_ON_SURFACE
));
59
MiscGameplayFunctions.TransferItemProperties(
this
, stick);
60
stick.
SetQuantity
(4);
61
Rope rope = Rope.Cast(item);
62
CreateRope(rope);
63
}
64
}
65
66
//Debug menu Spawn Ground Special
67
override
void
OnDebugSpawn
()
68
{
69
SpawnEntityOnGroundPos(
"Shovel"
,
GetPosition
());
70
SpawnEntityOnGroundPos(
"Hammer"
,
GetPosition
());
71
SpawnEntityOnGroundPos(
"Pliers"
,
GetPosition
());
72
73
for
(
int
i0 = 0; i0 < 4; ++i0)
74
{
75
SpawnEntityOnGroundPos(
"LongWoodenStick"
,
GetPosition
());
76
}
77
78
for
(
int
i1 = 0; i1 < 8; ++i1)
79
{
80
SpawnEntityOnGroundPos(
"TannedLeather"
,
GetPosition
());
81
}
82
83
for
(
int
i2 = 0; i2 < 4; ++i2)
84
{
85
SpawnEntityOnGroundPos(
"Fabric"
,
GetPosition
());
86
}
87
88
for
(
int
i3 = 0; i3 < 50; ++i3)
89
{
90
SpawnEntityOnGroundPos(
"WoodenStick"
,
GetPosition
());
91
}
92
}
93
}
ECE_PLACE_ON_SURFACE
const int ECE_PLACE_ON_SURFACE
Definition
centraleconomy.c:37
EntityAI
Definition
inventoryitem.c:2
ItemBase
Definition
inventoryitem.c:742
ItemBase::SetQuantity
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Definition
pileofwoodenplanks.c:88
KitBase
Definition
fencekit.c:2
KitBase::OnDebugSpawn
override void OnDebugSpawn()
Definition
shelterkit.c:67
KitBase::DisassembleKit
override void DisassembleKit(ItemBase item)
Definition
shelterkit.c:54
KitBase::GetDeploySoundset
override string GetDeploySoundset()
Definition
shelterkit.c:49
KitBase::OnPlacementComplete
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
Definition
shelterkit.c:18
KitBase::GetPlaceSoundset
override string GetPlaceSoundset()
Definition
shelterkit.c:44
KitBase::DoPlacingHeightCheck
override bool DoPlacingHeightCheck()
Definition
shelterkit.c:34
KitBase::HeightCheckOverride
override float HeightCheckOverride()
Definition
shelterkit.c:39
KitBase::CanReceiveAttachment
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Definition
shelterkit.c:3
vector
Definition
enconvert.c:119
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
GetPosition
vector GetPosition()
Get the world position of the Effect.
Definition
effect.c:473
IsHologram
override bool IsHologram()
Definition
itembase.c:5885
Games
Dayz
scripts
4_world
entities
itembase
shelterkit.c
Generated by
1.17.0