DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ActionPlaceFireplaceIntoBarrel.c
Go to the documentation of this file.
2{
4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENDOORFW;
6 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
8 m_Text = "#place_object";
9 }
10
12 {
15 }
16
17 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
18 {
19 Object target_object = target.GetObject();
20
21 if ( target_object && target_object.IsInherited( BarrelHoles_ColorBase ) )
22 {
23 BarrelHoles_ColorBase fireplace_barrel = BarrelHoles_ColorBase.Cast( target_object );
24
25 if ( fireplace_barrel.IsOpen() && fireplace_barrel.GetInventory().AttachmentCount() == 0 && fireplace_barrel.IsCargoEmpty() )
26 {
27 return true;
28 }
29 }
30
31 return false;
32 }
33
34 override void OnExecuteServer( ActionData action_data )
35 {
36 FireplaceBase fireplace_in_hands = FireplaceBase.Cast( action_data.m_MainItem );
37 BarrelHoles_ColorBase fireplace_barrel = BarrelHoles_ColorBase.Cast( action_data.m_Target.GetObject() );
38
39 auto lambda = new MoveEquipToExistingItemAndDestroyOldRootLambda(fireplace_in_hands, "", action_data.m_Player, fireplace_barrel);
40 action_data.m_Player.ServerReplaceItemInHandsWithNewElsewhere(lambda);
41
42 action_data.m_Player.GetSoftSkillsManager().AddSpecialty( m_SpecialtyWeight );
43 }
44}
protected float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
protected string m_Text
Definition ActionBase.c:49
protected int m_StanceMask
Definition ActionBase.c:53
class ActionTargets ActionTarget
ItemBase m_MainItem
Definition ActionBase.c:28
PlayerBase m_Player
Definition ActionBase.c:33
ref ActionTarget m_Target
Definition ActionBase.c:32
override void OnExecuteServer(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
this one is a also bit special: it moves all items to already existing item and destroys the ex-root ...
const float DEFAULT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602