Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function zombie_spawn()
  2. {
  3.     can_drop = false;
  4.     drop_type = undefined;
  5.  
  6.     if(RandomInt(0, 100) <= PERK_VULTUREAID_DROP_CHANCE)
  7.         can_drop = true;
  8.  
  9.     if(self is_stink_zombie())
  10.         drop_type = "stink";
  11.  
  12.     if(IS_TRUE(can_drop) && !isdefined(drop_type))
  13.     {
  14.         roll RandomInt(0, 100);
  15.         chance_ammo = PERK_VULTUREAID_DROP_AMMO_CHANCE;
  16.         chance_points = PERK_VULTUREAID_DROP_POINTS_CHANCE;
  17.         chance_stink = PERK_VULTUREAID_STINK_DROP_CHANCE;
  18.  
  19.         chance_ammo_points= chance_ammo + chance_points;
  20.  
  21.         if(roll <= chance_ammo_points)
  22.         {
  23.             if(RandomInt(0, 100) <= 50)
  24.                 drop_type = "ammo";
  25.             else
  26.                 drop_type = "points";
  27.         }
  28.         else if(roll <= chance_stink)
  29.             drop_type = "stink";
  30.     }
  31.  
  32.     if(isdefined(drop_type))
  33.     {
  34.         if(isdefined(level.perk_vulture.drop_count[drop_type]))
  35.         {
  36.             count = level.perk_vulture.drop_count[drop_type];
  37.             max = level.perk_vulture.drop_count_max[drop_type];
  38.  
  39.             if(count >= max)
  40.             {
  41.                 can_drop = false;
  42.                 drop_type = undefined;
  43.             }
  44.         }
  45.         else
  46.         {
  47.             // Assume ammo / points
  48.             ammo_count = level.perk_vulture.drop_count["ammo"];
  49.             points_count = level.perk_vulture.drop_count["points"];
  50.             max = level.perk_vulture.drop_count_max["ammo_points"];
  51.  
  52.             if(ammo_count + points_count >= max)
  53.             {
  54.                 can_drop = false;
  55.                 drop_type = undefined;
  56.             }
  57.         }
  58.     }
  59.  
  60.     if(IS_TRUE(can_drop) && isdefined(drop_type))
  61.     {
  62.         level.perk_vulture.drop_count[drop_type]++;
  63.  
  64.         IPrintLnBold("Zombie can drop");
  65.         IPrintLnBold(drop_type);
  66.  
  67.         self._vulture_drop_type = drop_type;
  68.     }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement