34 m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_MEDIUM;
50 Object targetObject = target.GetObject();
52 if (targetObject.CanBeSkinned() && !targetObject.IsAlive())
55 if (
Class.
CastTo(target_EAI, targetObject) && target_EAI.CanBeSkinnedWith(item))
65 super.OnFinishProgressServer(action_data);
67 Object targetObject = action_data.m_Target.GetObject();
73 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(body, {
Bolt_Base});
86 moduleLifespan.UpdateBloodyHandsVisibility(action_data.m_Player,
true);
87 action_data.m_Player.SetBloodyHandsPenaltyChancePerAgent(
eAgents.SALMONELLA, body.GetSkinningBloodInfectionChance(
eAgents.SALMONELLA));
96 MiscGameplayFunctions.GetHeadBonePos(player,posHead);
105 float item_quantity = 0;
113 if (quant_min_max.Count() > 0)
115 float soft_skill_manipulated_value = (quant_min_max.Get(0)+ quant_min_max.Get(1)) / 2;
116 item_quantity =
Math.
RandomFloat(soft_skill_manipulated_value, quant_min_max.Get(1));
119 if (quant_min_max_coef.Count() > 0)
121 float coef =
Math.
RandomFloat(quant_min_max_coef.Get(0), quant_min_max_coef.Get(1));
122 item_quantity = added_item.GetQuantityMax() * coef;
125 if (
GetGame().ConfigGetFloat(cfg_skinning_organ_class +
"quantity") > 0)
126 item_quantity =
g_Game.ConfigGetFloat(cfg_skinning_organ_class +
"quantity");
128 if (
GetGame().ConfigGetFloat(cfg_skinning_organ_class +
"quantityCoef") > 0)
130 float coef2 =
g_Game.ConfigGetFloat(cfg_skinning_organ_class +
"quantityCoef");
131 item_quantity = added_item.GetQuantityMax() * coef2;
134 if (item_quantity > 0)
136 item_quantity =
Math.
Round(item_quantity);
141 float item_apply_tool_damage_coef =
GetGame().
ConfigGetFloat(cfg_skinning_organ_class +
"transferToolDamageCoef");
143 if (item_apply_tool_damage_coef > 0)
145 float tool_dmg_coef = 1 - tool.GetHealth01();
146 float organ_dmg_coef = tool_dmg_coef * item_apply_tool_damage_coef;
147 added_item.DecreaseHealthCoef(organ_dmg_coef);
150 added_item.InsertAgent(
eAgents.SALMONELLA, 1);
156 super.OnFinishProgressClient(action_data);
158 if (action_data.m_Target)
160 Object target_obj = action_data.m_Target.GetObject();
162 if (target_obj.IsKindOf(
"Animal_CapreolusCapreolus") || target_obj.IsKindOf(
"Animal_CapreolusCapreolusF") || target_obj.IsKindOf(
"Animal_CervusElaphus") || target_obj.IsKindOf(
"Animal_CervusElaphusF"))
173 if (
Class.
CastTo(body,action_data.m_Target.GetObject()))
175 if (body.IsRestrained() && body.GetHumanInventory().GetEntityInHands())
176 MiscGameplayFunctions.TransformRestrainItem(body.GetHumanInventory().GetEntityInHands(), null, action_data.m_Player, body);
179 if (body.IsWearingSplint())
181 EntityAI entity = action_data.m_Player.SpawnEntityOnGroundOnCursorDir(
"Splint", 0.5);
183 EntityAI attachment = body.GetItemOnSlot(
"Splint_Right");
184 if (attachment && attachment.GetType() ==
"Splint_Applied")
188 MiscGameplayFunctions.TransferItemProperties(attachment, newItem);
190 if (newItem.GetHealthLevel() < 4)
192 int newDmgLevel = newItem.GetHealthLevel() + 1;
193 float max = newItem.GetMaxHealth(
"",
"");
223 int deadBodyLifetime;
226 deadBodyLifetime =
GetCEApi().GetCEGlobalInt(
"CleanupLifetimeDeadPlayer");
227 if (deadBodyLifetime <= 0)
228 deadBodyLifetime = 3600;
243 child.SetLifetime(newLifetime);
244 body.GetInventory().DropEntity(
InventoryMode.SERVER, body, child);
254 string cfg_animal_class_path =
"cfgVehicles " + body.GetType() +
" " +
"Skinning ";
255 vector bodyPosition = body.GetPosition();
257 if (!
g_Game.ConfigIsExisting(cfg_animal_class_path))
259 Debug.
Log(
"Failed to find class 'Skinning' in the config of: " + body.GetType());
264 int child_count =
g_Game.ConfigGetChildrenCount(cfg_animal_class_path);
266 string item_to_spawn;
267 string cfg_skinning_organ_class;
269 for (
int i1 = 0; i1 < child_count; i1++)
272 g_Game.ConfigGetChildName(cfg_animal_class_path, i1, cfg_skinning_organ_class);
273 cfg_skinning_organ_class = cfg_animal_class_path + cfg_skinning_organ_class +
" ";
274 g_Game.ConfigGetText(cfg_skinning_organ_class +
"item", item_to_spawn);
276 if (item_to_spawn !=
"")
279 int item_count =
g_Game.ConfigGetInt(cfg_skinning_organ_class +
"count");
288 if (itemCount.Count() > 0)
291 for (
int z = 0; z < itemZones.Count(); z++)
293 zoneDmg = body.GetHealth01(itemZones[z],
"Health");
294 zoneDmg *= itemCount[z];
299 for (
int i2 = 0; i2 < item_count; i2++)
301 ItemBase spawn_result =
CreateOrgan(action_data.m_Player, bodyPosition, item_to_spawn, cfg_skinning_organ_class, action_data.m_MainItem);
308 float avgDmgZones = 0;
309 for (
int c2 = 0; c2 < itemZones.Count(); c2++)
311 avgDmgZones += body.GetHealth01(itemZones[c2],
"Health");
314 avgDmgZones = avgDmgZones/itemZones.Count();
317 spawn_result.SetHealth01(
"",
"", avgDmgZones);
321 if (body.CanHaveTemperature() && spawn_result.CanHaveTemperature())
323 spawn_result.SetTemperatureDirect(body.GetTemperature());
324 spawn_result.SetFrozen(body.GetIsFrozen());
328 if ((item_to_spawn ==
"Lard") || (item_to_spawn ==
"Guts"))
330 if (body.IsKindOf(
"SurvivorBase"))
332 spawn_result.InsertAgent(
eAgents.BRAIN, 1);
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
void SpawnItems(ActionData action_data)
void DropInventoryItems(PlayerBase body, float newLifetime)
vector GetRandomPos(vector body_pos)
void HandlePlayerBody(ActionData action_data)
This section drops all clothes (and attachments) from the dead player before deleting their body.
ActionSkinningCB ActionContinuousBaseCB ActionSkinning()
ItemBase CreateOrgan(PlayerBase player, vector body_pos, string item_to_spawn, string cfg_skinning_organ_class, ItemBase tool)
class ActionTargets ActionTarget
proto native CEApi GetCEApi()
Get the CE API.
const int ECE_PLACE_ON_SURFACE
PluginBase GetPlugin(typename plugin_type)
void CreateConditionComponents()
void OnFinishProgressClient(ActionData action_data)
void OnFinishProgressServer(ActionData action_data)
override void CreateActionComponent()
void OnActionFinishedGutDeer()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
AnalyticsManagerClient GetAnalyticsClient()
proto native void ConfigGetFloatArray(string path, out TFloatArray values)
Get array of floats from config on path.
Super root of all classes in Enforce script.
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
proto void Call(func fn, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
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_BADLY_DAMAGED_VALUE
const float DAMAGE_RUINED_VALUE
const float DAMAGE_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 float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
static proto float Floor(float f)
Returns floor of value.
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].