Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- entity (float flag) Do_DropRune =
- {
- local entity item;
- item = spawn ();
- item.origin = (self.origin - '0 0 16');
- spawn_tfog (item.origin);
- item.player_flag = flag;
- item.velocity_z = 400;
- item.velocity_x = (-500 + (random () * 1000));
- item.velocity_y = (-500 + (random () * 1000));
- item.bot_wants_item = TRUE;
- item.flags = FL_ITEM;
- item.solid = SOLID_TRIGGER;
- if (random() < 0.5)
- item.movetype = MOVETYPE_TOSS;
- else
- item.movetype = MOVETYPE_FLY;
- if ((flag & ITEM_RUNE1_FLAG))
- {
- item.spawnflags = 32;// 2049; Resist
- setmodel (item, "progs/end1.mdl");
- }
- else
- {
- if ((flag & ITEM_RUNE2_FLAG))
- {
- setmodel (item, "progs/end2.mdl");
- item.spawnflags = 64;// 2; Str
- }
- else
- {
- if ((flag & ITEM_RUNE3_FLAG))
- {
- setmodel (item, "progs/end3.mdl");
- item.spawnflags = 128;//4; Haste
- }
- else
- {
- if ((flag & ITEM_RUNE4_FLAG))
- {
- setmodel (item, "progs/end4.mdl");
- item.spawnflags = 256;//8;
- }
- }
- }
- }
- //serverflags = 0; //(serverflags | (item.spawnflags & 15.000));
- setsize (item, '-16 -16 0', '16 16 56');
- item.touch = RuneTouch;
- if (!intermission_running)
- {
- item.think = RuneRespawn;
- if (random() < 0.5)
- item.nextthink = (time + random()*10 + 5);
- else
- item.nextthink = (time + random()*90 + 30);
- }
- item.altname = "rune";
- if ((flag & ITEM_RUNE1_FLAG))
- {
- item.classname = "item_rune1";
- item.netname = "Resistance";
- }
- else
- {
- if ((flag & ITEM_RUNE2_FLAG))
- {
- item.classname = "item_rune2";
- item.netname = "Strength";
- }
- else
- {
- if ((flag & ITEM_RUNE3_FLAG))
- {
- item.classname = "item_rune3";
- item.netname = "Haste";
- }
- else
- {
- if ((flag & ITEM_RUNE4_FLAG))
- {
- item.classname = "item_rune4";
- item.netname = "Regeneration";
- }
- }
- }
- }
- return (item);
- };
- void () DropRune =
- {
- if ((self.player_flag & ITEM_RUNE1_FLAG))
- {
- Do_DropRune (ITEM_RUNE1_FLAG);
- if (self.items2)
- self.items2 = self.items2 - 32;
- }
- if ((self.player_flag & ITEM_RUNE2_FLAG))
- {
- Do_DropRune (ITEM_RUNE2_FLAG);
- if (self.items2)
- self.items2 = self.items2 - 64;
- }
- if ((self.player_flag & ITEM_RUNE3_FLAG))
- {
- Do_DropRune (ITEM_RUNE3_FLAG);
- if (self.items2)
- self.items2 = self.items2 - 128;
- }
- if ((self.player_flag & ITEM_RUNE4_FLAG))
- {
- Do_DropRune (ITEM_RUNE4_FLAG);
- if (self.items2)
- self.items2 = self.items2 - 256;
- }
- self.player_flag = (self.player_flag - (self.player_flag & ITEM_RUNE_MASK));
- };
- entity () HeadSelectSpawnPoint;
- void () SpawnRunes =
- {
- local entity oself;
- local float i;
- oself = self;
- i = (random () * 10);
- while ((i > 0))
- {
- self = HeadSelectSpawnPoint ();
- i = (i - 1);
- }
- self = HeadSelectSpawnPoint ();
- Do_DropRune (ITEM_RUNE1_FLAG);
- self = HeadSelectSpawnPoint ();
- Do_DropRune (ITEM_RUNE2_FLAG);
- self = HeadSelectSpawnPoint ();
- Do_DropRune (ITEM_RUNE3_FLAG);
- self = HeadSelectSpawnPoint ();
- Do_DropRune (ITEM_RUNE4_FLAG);
- remove (oself);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement