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