Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actiondisinfectplantbit.c
Go to the documentation of this file.
1 // TO DO: Remove this script!
2 
4 {
5  override void CreateActionComponent()
6  {
7  m_ActionData.m_ActionComponent = new CASingleUseQuantity(UAQuantityConsumed.GARDEN_DISINFECT_PLANT);
8  }
9 };
10 
11 
13 {
15  {
16  m_CallbackClass = ActionDisinfectPlantBitCB;
18  m_Text = "#apply";
19  }
20 
21  override void CreateConditionComponents()
22  {
25  }
26 
27  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
28  {
29  Object targetObject = target.GetObject();
30 
31  if ( targetObject != NULL && targetObject.IsInherited(PlantBase) && !item.IsDamageDestroyed() )
32  {
33  PlantBase plant = PlantBase.Cast( targetObject );
34 
35  if ( plant.IsGrowing() && plant.NeedsSpraying() )
36  {
37  if ( item.GetQuantity() > 0 )
38  {
39  return true;
40  }
41  }
42  }
43 
44  return false;
45  }
46 
47  override void OnExecuteServer( ActionData action_data )
48  {
49  Object targetObject = action_data.m_Target.GetObject();
50 
51  if ( targetObject != NULL && targetObject.IsInherited(PlantBase) )
52  {
53 
54  PlantBase plant = PlantBase.Cast( targetObject );
55  Param1<float> nacdata = Param1<float>.Cast( action_data.m_ActionComponent.GetACData() );
56  SendMessageToClient(action_data.m_Player, plant.StopInfestation( nacdata.param1 ));
57  }
58 
59  action_data.m_Player.GetSoftSkillsManager().AddSpecialty( m_SpecialtyWeight );
60  }
61 };
ItemBase
Definition: inventoryitem.c:730
UASoftSkillsWeight
Definition: actionconstants.c:118
UAQuantityConsumed
Definition: actionconstants.c:3
CASingleUseQuantity
Definition: casingleusequantity.c:1
ActionSingleUseBaseCB
Definition: actionsingleusebase.c:1
UAMaxDistances
Definition: actionconstants.c:104
ActionDisinfectPlantBit
Definition: actiondisinfectplantbit.c:12
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
SendMessageToClient
void SendMessageToClient(Object reciever, string message)
Definition: actionbase.c:901
CCTNonRuined
Definition: cctnonruined.c:1
Object
Definition: objecttyped.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
ActionSingleUseBase
Definition: actionsingleusebase.c:41
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
CCINonRuined
Definition: ccinonruined.c:1
ActionDisinfectPlantBitCB
Definition: actiondisinfectplantbit.c:3
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68