Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
watchtowerkit.c
Go to the documentation of this file.
1
class
WatchtowerKit
extends
KitBase
2
{
3
override
bool
CanReceiveAttachment
(
EntityAI
attachment,
int
slotId)
4
{
5
ItemBase
att =
ItemBase
.Cast(GetInventory().FindAttachment(slotId));
6
if
(att)
7
return
false
;
8
9
return
super.
CanReceiveAttachment
(attachment, slotId);
10
}
11
12
//================================================================
13
// ADVANCED PLACEMENT
14
//================================================================
15
16
override
void
OnPlacementComplete
( Man player,
vector
position =
"0 0 0"
,
vector
orientation =
"0 0 0"
)
17
{
18
super.OnPlacementComplete( player, position, orientation );
19
20
if
(
g_Game
.IsServer() )
21
{
22
//Create watchtower
23
Watchtower watchtower = Watchtower.Cast(
g_Game
.CreateObjectEx(
"Watchtower"
,
GetPosition
(),
ECE_PLACE_ON_SURFACE
) );
24
watchtower.SetPosition( position );
25
watchtower.SetOrientation( orientation );
26
27
//make the kit invisible, so it can be destroyed from deploy UA when action ends
28
HideAllSelections();
29
}
30
}
31
32
override
bool
DoPlacingHeightCheck
()
33
{
34
return
true
;
35
}
36
37
override
float
HeightCheckOverride
()
38
{
39
return
2.83;
//9.56;
40
}
41
42
override
void
DisassembleKit
(
ItemBase
item)
43
{
44
if
(!
IsHologram
())
45
{
46
ItemBase
stick =
ItemBase
.Cast(
g_Game
.CreateObjectEx(
"WoodenStick"
,
GetPosition
(),
ECE_PLACE_ON_SURFACE
));
47
MiscGameplayFunctions.TransferItemProperties(
this
, stick);
48
stick.
SetQuantity
(4);
49
Rope rope = Rope.Cast(item);
50
CreateRope(rope);
51
}
52
}
53
54
//Debug menu Spawn Ground Special
55
override
void
OnDebugSpawn
()
56
{
57
SpawnEntityOnGroundPos(
"Shovel"
,
GetPosition
());
58
SpawnEntityOnGroundPos(
"Hammer"
,
GetPosition
());
59
SpawnEntityOnGroundPos(
"Hammer"
,
GetPosition
());
60
SpawnEntityOnGroundPos(
"Hammer"
,
GetPosition
());
61
SpawnEntityOnGroundPos(
"Hammer"
,
GetPosition
());
62
SpawnEntityOnGroundPos(
"Pliers"
,
GetPosition
());
63
64
for
(
int
i0 = 0; i0 < 30; i0++)
65
{
66
SpawnEntityOnGroundPos(
"WoodenPlank"
,
GetPosition
());
67
}
68
69
for
(
int
i1 = 0; i1 < 10; i1++)
70
{
71
SpawnEntityOnGroundPos(
"WoodenLog"
,
GetPosition
());
72
}
73
74
for
(
int
i2 = 0; i2 < 15; i2++)
75
{
76
SpawnEntityOnGroundPos(
"Nail"
,
GetPosition
());
77
}
78
79
for
(
int
i3 = 0; i3 < 9; i3++)
80
{
81
SpawnEntityOnGroundPos(
"CamoNet"
,
GetPosition
());
82
}
83
84
for
(
int
i4 = 0; i4 < 6; i4++)
85
{
86
SpawnEntityOnGroundPos(
"BarbedWire"
,
GetPosition
());
87
}
88
}
89
}
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
ItemBase::CanReceiveAttachment
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Definition
basebuildingbase.c:982
KitBase
Definition
fencekit.c:2
KitBase::OnDebugSpawn
override void OnDebugSpawn()
Definition
watchtowerkit.c:55
KitBase::DisassembleKit
override void DisassembleKit(ItemBase item)
Definition
watchtowerkit.c:42
KitBase::OnPlacementComplete
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
Definition
watchtowerkit.c:16
KitBase::DoPlacingHeightCheck
override bool DoPlacingHeightCheck()
Definition
watchtowerkit.c:32
KitBase::HeightCheckOverride
override float HeightCheckOverride()
Definition
watchtowerkit.c:37
KitBase::CanReceiveAttachment
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Definition
watchtowerkit.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
watchtowerkit.c
Generated by
1.17.0