Advertisement
Guest User

Untitled

a guest
Jul 11th, 2017
518
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.23 KB | None | 0 0
  1. int egg_preconditions()
  2. {
  3.     int required_resupplies;
  4.     int chance_of_occuring;
  5.     int rand;
  6.  
  7.     // Has the mission already been played?
  8.     // stat 15476 is a boolean flag which is set once the mission is triggered (we believe)
  9.     // if that flag has been set, return false
  10.     if (get_stat_bool(15476, -1, -1))
  11.     {
  12.         return 0;
  13.     }
  14.  
  15.     // Has the player completed 600 resupplies
  16.     required_resupplies = Global_262145.f_14865; /* 600 */
  17.     if (get_gunrunning_stat(get_mp_character(), 5) < required_resupplies)
  18.     {
  19.         return 0;
  20.     }
  21.  
  22.     // Is the time between 2100 and 2300?
  23.     if (Global_2445989.f_3066.f_174 < Global_262145.f_14866 || Global_2445989.f_3066.f_174 >= Global_262145.f_14867)
  24.     {
  25.         return 0;
  26.     }
  27.  
  28.     // This global value is set to 100 by default, but it's a tunable value.
  29.     // It's effectively a % chance of occuring. The value is currently always 100 so it always passes.
  30.     chance_of_occuring = Global_262145.f_14868;
  31.     rand = GAMEPLAY::GET_RANDOM_INT_IN_RANGE(1, 100);
  32.     if (rand > chance_of_occuring)
  33.     {
  34.         return 0;
  35.     }
  36.  
  37.     // If all of the above conditions are met, the mission is entered into the regular rotation
  38.     return 1;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement