50 Object targetObject = target.GetObject();
51 if ( targetObject != NULL )
53 if ( targetObject.CanBeSkinned() && !targetObject.IsAlive() )
61 if ( target_EAI.CanBeSkinnedWith(item) )
78 string cfg_skinning_organ_class;
83 vector body_pos = body.GetPosition();
91 if (body_PB.IsRestrained() && body_PB.GetHumanInventory().GetEntityInHands())
93 MiscGameplayFunctions.TransformRestrainItem(body_PB.GetHumanInventory().GetEntityInHands(), null, action_data.
m_Player, body_PB);
102 if (body_PB.IsWearingSplint())
104 EntityAI entity = action_data.
m_Player.SpawnEntityOnGroundOnCursorDir(
"Splint", 0.5);
107 Class.
CastTo(attachment, body_PB.GetItemOnSlot(
"Splint_Right"));
108 if ( attachment && attachment.GetType() ==
"Splint_Applied" )
112 MiscGameplayFunctions.TransferItemProperties(attachment,new_item);
117 if (new_item.GetHealthLevel() < 4)
119 int newDmgLevel = new_item.GetHealthLevel() + 1;
121 float max = new_item.GetMaxHealth(
"",
"");
123 switch ( newDmgLevel )
155 int deadBodyLifetime;
158 deadBodyLifetime =
GetCEApi().GetCEGlobalInt(
"CleanupLifetimeDeadPlayer" );
159 if ( deadBodyLifetime <= 0 )
161 deadBodyLifetime = 3600;
166 int count = children.Count();
167 for (
int i = 0; i < count; ++i)
172 body_PB.GetInventory().DropEntity(
InventoryMode.SERVER, body_PB, child);
173 child.SetLifetime( deadBodyLifetime );
185 string cfg_animal_class_path =
"cfgVehicles " + body.GetType() +
" " +
"Skinning ";
188 int child_count =
g_Game.ConfigGetChildrenCount( cfg_animal_class_path );
191 for (
int i1 = 0; i1 < child_count; i1++ )
194 g_Game.ConfigGetChildName(cfg_animal_class_path, i1, cfg_skinning_organ_class);
195 cfg_skinning_organ_class = cfg_animal_class_path + cfg_skinning_organ_class +
" ";
196 g_Game.ConfigGetText(cfg_skinning_organ_class +
"item", item_to_spawn);
198 if ( item_to_spawn !=
"" )
201 int item_count =
g_Game.ConfigGetInt( cfg_skinning_organ_class +
"count" );
210 if ( itemCount.Count() > 0 )
213 for (
int z = 0; z < itemZones.Count(); z++ )
215 zoneDmg = targetObject.GetHealth01(itemZones[z],
"Health");
216 zoneDmg *= itemCount[z];
221 for (
int i2 = 0; i2 < item_count; i2++ )
230 float avgDmgZones = 0;
231 for(
int c2 = 0; c2 < itemZones.Count(); c2++ )
233 avgDmgZones += targetObject.GetHealth01(itemZones[c2],
"Health");
236 avgDmgZones = avgDmgZones/itemZones.Count();
239 spawn_result.SetHealth01(
"",
"", avgDmgZones);
245 if ( ( item_to_spawn ==
"Lard" ) || ( item_to_spawn ==
"Guts" ) )
247 if ( body.IsKindOf(
"SurvivorBase" ) )
249 spawn_result.InsertAgent(
eAgents.BRAIN, 1);
262 module_lifespan.UpdateBloodyHandsVisibility( action_data.
m_Player,
true );
277 vector bodyPos = body.GetPosition();
279 for (
int i = count - 1; i >= 0; i--)
282 body.RemoveChild(arrow);
290 arrow.PlaceOnSurfaceRotated(m4, pos);
292 arrow.SetTransform(m4);
293 arrow.PlaceOnSurface();
311 added_item.PlaceOnSurface();
314 float item_quantity = 0;
323 if (quant_min_max.Count() > 0)
325 float soft_skill_manipulated_value = ( quant_min_max.Get(0)+ quant_min_max.Get(1) ) / 2;
326 float min_quantity = player.GetSoftSkillsManager().AddSpecialtyBonus( soft_skill_manipulated_value, this.
GetSpecialtyWeight() );
330 if (quant_min_max_coef.Count() > 0)
332 float coef =
Math.
RandomFloat(quant_min_max_coef.Get(0), quant_min_max_coef.Get(1));
333 item_quantity = added_item.GetQuantityMax() * coef;
337 item_quantity =
g_Game.ConfigGetFloat( cfg_skinning_organ_class +
"quantity" );
341 float coef2 =
g_Game.ConfigGetFloat( cfg_skinning_organ_class +
"quantityCoef" );
342 item_quantity = added_item.GetQuantityMax() * coef2;
345 if ( item_quantity > 0 )
347 item_quantity =
Math.
Round(item_quantity);
348 added_item.SetQuantity( item_quantity,
false );
352 float item_apply_tool_damage_coef =
GetGame().
ConfigGetFloat( cfg_skinning_organ_class +
"transferToolDamageCoef" );
354 if ( item_apply_tool_damage_coef > 0 )
356 float tool_dmg_coef = 1 - tool.GetHealth01();
357 float organ_dmg_coef = tool_dmg_coef * item_apply_tool_damage_coef;
358 added_item.DecreaseHealthCoef( organ_dmg_coef );
361 added_item.InsertAgent(
eAgents.SALMONELLA, 1);
367 super.OnFinishProgressClient( action_data );
373 if ( target_obj.IsKindOf(
"Animal_CapreolusCapreolus" ) || target_obj.IsKindOf(
"Animal_CapreolusCapreolusF" ) || target_obj.IsKindOf(
"Animal_CervusElaphus" ) || target_obj.IsKindOf(
"Animal_CervusElaphusF" ) )
float GetSpecialtyWeight()
protected float m_SpecialtyWeight
ref CCIBase m_ConditionItem
ref CCTBase m_ConditionTarget
protected bool m_FullBody
protected int m_StanceMask
class ActionTargets ActionTarget
proto native CEApi GetCEApi()
Get the CE API.
const int ECE_PLACE_ON_SURFACE
PluginBase GetPlugin(typename plugin_type)
protected ActionData m_ActionData
ref CABase m_ActionComponent
ref ActionTarget m_Target
override void CreateActionComponent()
override void OnFinishProgressServer(ActionData action_data)
private void DropArrows(EntityAI body)
override void CreateConditionComponents()
vector GetRandomPos(vector body_pos)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void OnFinishProgressClient(ActionData action_data)
ItemBase CreateOrgan(PlayerBase player, vector body_pos, string item_to_spawn, string cfg_skinning_organ_class, ItemBase tool)
void OnActionFinishedGutDeer()
protected int m_CommandUID
protected m_CallbackClass
EntityAI GetArrow(int index)
proto native void ObjectDelete(Object obj)
proto native void ConfigGetFloatArray(string path, out TFloatArray values)
Get array of floats from config on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
AnalyticsManagerClient GetAnalyticsClient()
Super root of all classes in Enforce script.
const float PRECISE_MEDIUM
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZPlayerConstants
defined in C++
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const float DAMAGE_RUINED_VALUE
const float DAMAGE_DAMAGED_VALUE
const float DAMAGE_BADLY_DAMAGED_VALUE
const float DAMAGE_WORN_VALUE
const int STATE_BADLY_DAMAGED
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static void MatrixIdentity4(out vector mat[4])
Creates identity matrix.
static proto float Round(float f)
Returns mathematical round of value.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
static proto float Floor(float f)
Returns floor of value.