Advertisement
techforce

Modified Tekbot dodroprune

Sep 26th, 2011
472
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. entity (float flag) Do_DropRune =
  2. {
  3.     local entity item;
  4.      
  5.     item = spawn ();
  6.     item.origin = (self.origin - '0 0 16');
  7.       spawn_tfog (item.origin);
  8.      
  9.       item.player_flag = flag;
  10.     item.velocity_z = 400;
  11.     item.velocity_x = (-500 + (random () * 1000));
  12.     item.velocity_y = (-500 + (random () * 1000));
  13.     item.bot_wants_item = TRUE;
  14.     item.flags = FL_ITEM;
  15.     item.solid = SOLID_TRIGGER;
  16.       if (random() < 0.5)
  17.     item.movetype = MOVETYPE_TOSS;
  18.      else
  19.      item.movetype = MOVETYPE_FLY;
  20.     if ((flag & ITEM_RUNE1_FLAG))
  21.          {
  22.            item.spawnflags = 32;// 2049; Resist
  23.         setmodel (item, "progs/end1.mdl");
  24.           }
  25.     else
  26.     {
  27.         if ((flag & ITEM_RUNE2_FLAG))
  28.         {
  29.             setmodel (item, "progs/end2.mdl");
  30.                  item.spawnflags = 64;// 2; Str
  31.         }
  32.         else
  33.         {
  34.             if ((flag & ITEM_RUNE3_FLAG))
  35.             {
  36.                 setmodel (item, "progs/end3.mdl");
  37.                   item.spawnflags = 128;//4; Haste
  38.                       }
  39.             else
  40.             {
  41.                 if ((flag & ITEM_RUNE4_FLAG))
  42.                 {
  43.                     setmodel (item, "progs/end4.mdl");
  44.                       item.spawnflags = 256;//8;
  45.                              }
  46.             }
  47.         }
  48.     }
  49. //serverflags = 0; //(serverflags | (item.spawnflags & 15.000));
  50.     setsize (item, '-16 -16 0', '16 16 56');
  51.     item.touch = RuneTouch;
  52.     if (!intermission_running)
  53.     {
  54.      item.think = RuneRespawn;
  55.      if (random() < 0.5)
  56.      item.nextthink = (time + random()*10 + 5);
  57.      else
  58.     item.nextthink = (time + random()*90 + 30);
  59.     }
  60.       item.altname = "rune";
  61.  
  62.     if ((flag & ITEM_RUNE1_FLAG))
  63.     {
  64.         item.classname = "item_rune1";
  65.         item.netname = "Resistance";
  66.                
  67.     }
  68.     else
  69.     {
  70.         if ((flag & ITEM_RUNE2_FLAG))
  71.         {
  72.             item.classname = "item_rune2";
  73.             item.netname = "Strength";
  74.  
  75.         }
  76.         else
  77.         {
  78.             if ((flag & ITEM_RUNE3_FLAG))
  79.             {
  80.                 item.classname = "item_rune3";
  81.                 item.netname = "Haste";
  82.  
  83.             }
  84.             else
  85.             {
  86.                 if ((flag & ITEM_RUNE4_FLAG))
  87.                 {
  88.                     item.classname = "item_rune4";
  89.                     item.netname = "Regeneration";
  90.  
  91.                 }
  92.             }
  93.         }
  94.     }
  95.     return (item);
  96. };
  97.  
  98. void () DropRune =
  99. {
  100.     if ((self.player_flag & ITEM_RUNE1_FLAG))
  101.     {
  102.         Do_DropRune (ITEM_RUNE1_FLAG);
  103.            if (self.items2)
  104.            self.items2 = self.items2 - 32;
  105.  
  106.     }
  107.     if ((self.player_flag & ITEM_RUNE2_FLAG))
  108.     {
  109.         Do_DropRune (ITEM_RUNE2_FLAG);
  110.            if (self.items2)
  111.            self.items2 = self.items2 - 64;
  112.  
  113.     }
  114.     if ((self.player_flag & ITEM_RUNE3_FLAG))
  115.     {
  116.         Do_DropRune (ITEM_RUNE3_FLAG);
  117.            if (self.items2)
  118.            self.items2 = self.items2 - 128;
  119.  
  120.     }
  121.     if ((self.player_flag & ITEM_RUNE4_FLAG))
  122.     {
  123.         Do_DropRune (ITEM_RUNE4_FLAG);
  124.            if (self.items2)
  125.            self.items2 = self.items2 - 256;
  126.  
  127.     }
  128.     self.player_flag = (self.player_flag - (self.player_flag & ITEM_RUNE_MASK));
  129. };
  130. entity () HeadSelectSpawnPoint;
  131. void () SpawnRunes =
  132. {
  133.     local entity oself;
  134.     local float i;
  135.      
  136.         oself = self;
  137.     i = (random () * 10);
  138.     while ((i > 0))
  139.     {
  140.         self = HeadSelectSpawnPoint ();
  141.         i = (i - 1);
  142.     }
  143.     self = HeadSelectSpawnPoint ();
  144.     Do_DropRune (ITEM_RUNE1_FLAG);
  145.     self = HeadSelectSpawnPoint ();
  146.     Do_DropRune (ITEM_RUNE2_FLAG);
  147.     self = HeadSelectSpawnPoint ();
  148.     Do_DropRune (ITEM_RUNE3_FLAG);
  149.     self = HeadSelectSpawnPoint ();
  150.     Do_DropRune (ITEM_RUNE4_FLAG);
  151.         remove (oself);
  152. };
  153.  
  154.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement