DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
PrepareChicken.c
См. документацию.
1class PrepareChicken extends PrepareAnimal
2{
3 override void Init()
4 {
5 super.Init();
6
7 //----------------------------------------------------------------------------------------------------------------------
8 //ingredient 1
9 InsertIngredient(0,"DeadChicken_ColorBase");//you can insert multiple ingredients this way
10 m_IngredientAddHealth[0] = 0; // 0 = do nothing
11 m_IngredientSetHealth[0] = -1; // -1 = do nothing
12 m_IngredientAddQuantity[0] = 0; // 0 = do nothing
13 m_IngredientDestroy[0] = true; // true = destroy, false = do nothing
14
15 //----------------------------------------------------------------------------------------------------------------------
16 AddResult("Bone");//add results here
17 m_ResultSetFullQuantity[0] = false; // true = set full quantity, false = do nothing
18 m_ResultSetQuantity[0] = 2; // -1 = do nothing
19 m_ResultSetHealth[0] = -1; // -1 = do nothing
20 m_ResultInheritsHealth[0] = 0; // (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients)
21 m_ResultInheritsColor[0] = -1; // (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value)
22 m_ResultToInventory[0] = -2; // (value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value)
23 m_ResultReplacesIngredient[0] = 0; // (value) == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value
24
25 }
26
27 override void Do(ItemBase ingredients[], PlayerBase player,array<ItemBase> results, float specialty_weight)//gets called upon recipe's completion
28 {
29 ItemBase deadChicken = ingredients[0];
30 Bone resultBones = Bone.Cast(results[0]);
31 ItemBase result;
32
33 int steakCount = Math.RandomIntInclusive(2,4);
34 for (int i=0; i < steakCount; ++i)
35 {
36 result = ItemBase.Cast(player.SpawnEntityOnGroundRaycastDispersed("ChickenBreastMeat"));
37 MiscGameplayFunctions.TransferItemProperties(deadChicken, result);
38 result.SetQuantityNormalized(Math.RandomFloatInclusive(0.8,1));
39 }
40
41 result = ItemBase.Cast(player.SpawnEntityOnGroundRaycastDispersed("ChickenFeather"));
42 MiscGameplayFunctions.TransferItemProperties(deadChicken, result);
44
45 if (resultBones)
46 {
47 MiscGameplayFunctions.TransferItemProperties(deadChicken, resultBones);
48 resultBones.SetQuantity(Math.RandomIntInclusive(2,5));
49 }
50
51 SetBloodyHands(ingredients, player);
52 }
53}
void SetBloodyHands(PlayerBase player, bool show)
Определения PluginLifespan.c:449
Определения consumables.c:130
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Определения PileOfWoodenPlanks.c:88
Определения InventoryItem.c:731
Определения EnMath.c:7
Определения PlayerBaseClient.c:2
override void Do(ItemBase ingredients[], PlayerBase player, array< ItemBase > results, float specialty_weight)
Определения PrepareChicken.c:27
override void Init()
Определения PrepareChicken.c:3
Определения PrepareChicken.c:2
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Определения EnMath.c:106
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Определения EnMath.c:54