Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
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 {
17 m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_LOW;
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.IsSprayable())
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};
ActionData m_ActionData
void SendMessageToClient(Object reciever, string message)
float m_SpecialtyWeight
Definition actionbase.c:77
string m_Text
Definition actionbase.c:58
ref CCIBase m_ConditionItem
Definition actionbase.c:64
ref CCTBase m_ConditionTarget
Definition actionbase.c:65