home *** CD-ROM | disk | FTP | other *** search
- /*
- ==============================================================================
-
- BOT
-
- ==============================================================================
- */
-
- // Prototypes
-
- void () Bot_Precache;
- void () BotCreate;
-
- void (vector org) spawn_tfog;
-
- //=============================================================
- // Bot_Precache - called by Worldspawn
- //=============================================================
- void () Bot_Precache =
- {
- precache_model2 ("progs/enforcer.mdl");
- precache_model2 ("progs/h_mega.mdl");
-
- precache_sound2 ("enforcer/death1.wav");
- precache_sound2 ("enforcer/idle1.wav");
- precache_sound2 ("enforcer/pain1.wav");
- precache_sound2 ("enforcer/pain2.wav");
- precache_sound2 ("enforcer/sight1.wav");
- precache_sound2 ("enforcer/sight2.wav");
- precache_sound2 ("enforcer/sight3.wav");
- precache_sound2 ("enforcer/sight4.wav");
- };
-
- //=============================================================
- // BotActivate - Activates the bot
- //=============================================================
- void () BotCreate =
- {
- // sounds and models precached in the world.qc file
-
- local entity newbot;
- local entity spot;
-
- newbot = spawn();
- newbot.solid = SOLID_SLIDEBOX;
- newbot.movetype = MOVETYPE_STEP;
-
- newbot.netname = "DeathBot";
- newbot.classname = "bot";
- newbot.health = 150;
- newbot.max_health = 300;
- if (teamplay)
- newbot.team = self.team;
- newbot.frags = 0;
- newbot.flags = FL_CLIENT;
- newbot.takedamage = DAMAGE_AIM;
- newbot.goalentity = self;
- newbot.movetarget = self;
- newbot.oldtarg = self;
- newbot.pausetime = time + 1;
- newbot.ideal_yaw = newbot.angles * '0 1 0';
- newbot.yaw_speed = 60;
- newbot.weapon = 1;
- newbot.ammo_shells = 20;
- newbot.view_ofs = '0 0 25';
- newbot.th_stand = bot_stand1;
- //***********
- newbot.th_walk = bot_runa1;
- // newbot.th_walk = bot_walk1;
- //***********
- newbot.th_stuff = bot_stuff1;
- newbot.th_run = bot_run1;
- newbot.th_pain = bot_pain;
- newbot.th_die = bot_die;
- newbot.th_missile = bot_atk1;
- setmodel(newbot, "progs/enforcer.mdl");
- setsize (newbot, '-16 -16 -24', '16 16 40');
-
- //***********
- newbot.fl_lead = FALSE;
- //***********
-
- // BG Bot - begin select a spot to spawn bot
- // if not deathmatch or coop. starts bot in players starting point
- spot = SelectSpawnPoint ();
-
- newbot.origin = spot.origin + '0 0 1';
- newbot.angles = spot.angles;
- // BG Bot - end select a spot to spawn bot
-
- spawn_tfog (newbot.origin);
-
- bprint("DeathBot created...\n");
-
- newbot.nextthink = time + 0.1;
- newbot.think = newbot.th_stand;
- };
-