Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actiondecraftwitchhoodcoif.c
Go to the documentation of this file.
2 {
3  override void CreateActionComponent()
4  {
5  m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.DEFAULT_DECRAFT);
6  }
7 }
8 
10 {
12  {
13  m_CallbackClass = ActionDeCraftWitchHoodCoifCB;
14  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
15  m_FullBody = true;
16  m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
18 
19  m_Text = "#dismantle";
20  }
21 
22  override void CreateConditionComponents()
23  {
25  m_ConditionTarget = new CCTNone();
26  }
27 
28  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
29  {
30  return true;
31  }
32 
33  override bool HasTarget()
34  {
35  return false;
36  }
37 
38  override void OnFinishProgressServer(ActionData action_data)
39  {
40  EntityAI mainItem = action_data.m_MainItem;
41 
42  string color = mainItem.ConfigGetString("color");
43  string className = "WitchHood_" + color;
44 
45  EntityAI result1 = action_data.m_Player.SpawnEntityOnGroundPos(className, action_data.m_Player.GetPosition());
46  EntityAI result2 = action_data.m_Player.SpawnEntityOnGroundPos("Chainmail_Coif", action_data.m_Player.GetPosition());
47 
48  if (!result1 || !result2)
49  return;
50 
51  MiscGameplayFunctions.TransferItemProperties(mainItem, result1);
52  MiscGameplayFunctions.TransferItemProperties(mainItem, result2);
53 
54  action_data.m_MainItem.Delete();
55  }
56 }
ItemBase
Definition: inventoryitem.c:730
ActionDeCraftWitchHoodCoifCB
Definition: actiondecraftwitchhoodcoif.c:1
CAContinuousTime
Definition: cacontinuoustime.c:1
CreateConditionComponents
override void CreateConditionComponents()
Definition: actiondecraftwitchhoodcoif.c:22
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actiondecraftwitchhoodcoif.c:28
UASoftSkillsWeight
Definition: actionconstants.c:118
CCTNone
Definition: cctnone.c:1
ActionDeCraftWitchHoodCoif
ActionDeCraftWitchHoodCoifCB ActionContinuousBaseCB ActionDeCraftWitchHoodCoif()
Definition: actiondecraftwitchhoodcoif.c:11
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
UATimeSpent
Definition: actionconstants.c:26
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
HasTarget
override bool HasTarget()
Definition: actiondecraftwitchhoodcoif.c:33
ActionContinuousBase
Definition: actioncontinuousbase.c:132
OnFinishProgressServer
override void OnFinishProgressServer(ActionData action_data)
Definition: actiondecraftwitchhoodcoif.c:38
CCINonRuined
Definition: ccinonruined.c:1
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53
EntityAI
Definition: building.c:5