DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
PrepareFox.c
См. документацию.
1class PrepareFox extends PrepareAnimal
2{
3 override void Init()
4 {
5 super.Init();
6
7 //----------------------------------------------------------------------------------------------------------------------
8 //ingredient 1
9 InsertIngredient(0,"DeadFox");//you can insert multiple ingredients this way
10
11 m_IngredientAddHealth[0] = 0;// 0 = do nothing
12 m_IngredientSetHealth[0] = -1; // -1 = do nothing
13 m_IngredientAddQuantity[0] = 0;// 0 = do nothing
14 m_IngredientDestroy[0] = true;//true = destroy, false = do nothing
15
16 //----------------------------------------------------------------------------------------------------------------------
17 //result1
18 AddResult("Bone");//add results here
19 m_ResultSetFullQuantity[0] = false; //true = set full quantity, false = do nothing
20 m_ResultSetQuantity[0] = -1; // -1 = do nothing
21 m_ResultSetHealth[0] = -1; // -1 = do nothing
22 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)
23 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)
24 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)
25 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
26
27 //result2
28 AddResult("FoxPelt");//add results here
29 m_ResultSetFullQuantity[1] = false; //true = set full quantity, false = do nothing
30 m_ResultSetQuantity[1] = -1; // -1 = do nothing
31 m_ResultSetHealth[1] = -1; // -1 = do nothing
32 m_ResultInheritsHealth[1] = 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)
33 m_ResultInheritsColor[1] = -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)
34 m_ResultToInventory[1] = -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)
35 m_ResultReplacesIngredient[1] = 0; // (value) == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value
36 }
37
38 override void Do(ItemBase ingredients[], PlayerBase player,array<ItemBase> results, float specialty_weight)//gets called upon recipe's completion
39 {
40 ItemBase deadRabbit = ingredients[0];
41 ItemBase resultBones = results[0];
42
43 int legCount = Math.RandomIntInclusive(2,4);
44 for (int i=0; i < legCount; ++i)
45 {
46 ItemBase result = ItemBase.Cast(player.SpawnEntityOnGroundRaycastDispersed("FoxSteakMeat"));
47 MiscGameplayFunctions.TransferItemProperties(deadRabbit, result);
48 result.SetQuantityNormalized(Math.RandomFloatInclusive(0.8,1));
49 }
50
51 MiscGameplayFunctions.TransferItemProperties(deadRabbit, resultBones);
52 resultBones.SetQuantity(Math.RandomIntInclusive(2,5));
53
54 SetBloodyHands(ingredients, player);
55 }
56}
void SetBloodyHands(PlayerBase player, bool show)
Определения PluginLifespan.c:449
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)
Определения PrepareFox.c:38
override void Init()
Определения PrepareFox.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