Hello everyone! I'm making a NPC that can shoot the following weapons: Glock, Python (357. Magnum), Shotgun, MP5, Crossbow, RPG, Gauss and Egon!
Hard work I've chosen. I wrote up the code for Glock, Python, Shotgun and MP5. They basically are a slightly modified copy of a hgrunt.cpp's bunch of code. I'll show up as an example my Python's method:
void CMyNewNPC :: PythonShoot ( void )
Vector vecShootOrigin = GetGunPosition();
Vector vecShootDir = ShootAtEnemy( vecShootOrigin );
UTIL_MakeVectors ( pev->angles );
Vector vecShellVelocity = gpGlobals->v_right * RANDOM_FLOAT(40,90) + gpGlobals->v_up * RANDOM_FLOAT(75,200) + gpGlobals->v_forward * RANDOM_FLOAT(-40, 40);
EjectBrass ( vecShootOrigin - vecShootDir * -24, vecShellVelocity, pev->angles.y, m_iBrassShell, TE_BOUNCE_SHELL);
FireBullets(1, vecShootOrigin, vecShootDir, VECTOR_CONE_10DEGREES, 2048, BULLET_PLAYER_357 );
pev->effects |= EF_MUZZLEFLASH;
Vector angDir = UTIL_VecToAngles( vecShootDir );
SetBlending( 0, angDir.x );
I wonder if you have the bunch of code for RPG, Crossbow, Gauss and Egon shoots! Due to I couldn't find them out through the Half-Life SDK yet. Or at least if you know where I can find them, please tell me! I suspect they are a little bit more complicated than the others I made! (I think they use different sprites, more sounds and models, beams...).
Thanks in advance,