DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
PrepareRabbit.c
См. документацию.
1class PrepareRabbit extends PrepareAnimal
2{
3 override void Init()
4 {
5 super.Init();
6
7 //----------------------------------------------------------------------------------------------------------------------
8 //ingredient 1
9 InsertIngredient(0,"DeadRabbit"); //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 //result1
17 AddResult("Bone");//add results here
18 m_ResultSetFullQuantity[0] = false; // true = set full quantity, false = do nothing
19 m_ResultSetQuantity[0] = -1; // -1 = do nothing
20 m_ResultSetHealth[0] = -1; // -1 = do nothing
21 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)
22 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)
23 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)
24 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
25
26 //result2
27 AddResult("RabbitPelt"); // add results here
28 m_ResultSetFullQuantity[1] = false; // true = set full quantity, false = do nothing
29 m_ResultSetQuantity[1] = -1; // -1 = do nothing
30 m_ResultSetHealth[1] = -1; // -1 = do nothing
31 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)
32 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)
33 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)
34 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
35 }
36
37 override void Do(ItemBase ingredients[], PlayerBase player,array<ItemBase> results, float specialty_weight)//gets called upon recipe's completion
38 {
39 ItemBase deadRabbit = ingredients[0];
40 ItemBase resultBones = results[0];
41
42 int legCount = Math.RandomIntInclusive(2,4);
43 for (int i=0; i < legCount; ++i)
44 {
45 ItemBase result = ItemBase.Cast(player.SpawnEntityOnGroundRaycastDispersed("RabbitLegMeat"));
46 MiscGameplayFunctions.TransferItemProperties(deadRabbit, result);
47 result.SetQuantityNormalized(Math.RandomFloatInclusive(0.8,1));
48 }
49
50 MiscGameplayFunctions.TransferItemProperties(deadRabbit, resultBones);
51 resultBones.SetQuantity(Math.RandomIntInclusive(2,5));
52
53 SetBloodyHands(ingredients, player);
54 }
55}
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)
Определения PrepareRabbit.c:37
override void Init()
Определения PrepareRabbit.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