I am trying to make a HL mod, but this error comes up. Here is the code:
//=========================================================
// monster template
//=========================================================
// UNDONE: Holster weapon?
#include "extdll.h"
#include "plane.h"
#include "util.h"
#include "cbase.h"
#include "monsters.h"
#include "schedule.h"
#include "animation.h"
#include "squadmonster.h"
#include "hgrunt.cpp"
#include "weapons.h"
#include "talkmonster.h"
#include "soundent.h"
#include "effects.h"
#include "customentity.h"
class CHEVScientist : public CSquadMonster
{
public:
void Spawn(void);
void Precache(void);
int iSpikes;
int Classify(void);
void SetYawSpeed(void);
};
LINK_ENTITY_TO_CLASS(monster_hev_survivor, CHEVScientist);
//=========================================================
// HandleAnimEvent - catches the monster-specific messages
// that occur when tagged animation frames are played.
//=========================================================
void CHEVScientist::HandleAnimEvent(MonsterEvent_t* pEvent)
{
Vector vecShootDir;
Vector vecShootOrigin;
switch (pEvent->event)
{
case HGRUNT_AE_DROP_GUN:
{
if (GetBodygroup(GUN_GROUP) != GUN_NONE)
{
Vector vecGunPos;
Vector vecGunAngles;
GetAttachment(0, vecGunPos, vecGunAngles);
// switch to body group with no gun.
SetBodygroup(GUN_GROUP, GUN_NONE);
// now spawn a gun.
if (FBitSet(pev->weapons, HGRUNT_SHOTGUN))
{
DropItem("weapon_shotgun", vecGunPos, vecGunAngles);
}
else
{
DropItem("weapon_9mmAR", vecGunPos, vecGunAngles);
}
if (FBitSet(pev->weapons, HGRUNT_GRENADELAUNCHER))
{
DropItem("ammo_ARgrenades", BodyTarget(pev->origin), vecGunAngles);
}
}
}
break;
case HGRUNT_AE_RELOAD:
EMIT_SOUND(ENT(pev), CHAN_WEAPON, "hgrunt/gr_reload1.wav", 1, ATTN_NORM);
m_cAmmoLoaded = m_cClipSize;
ClearConditions(bits_COND_NO_AMMO_LOADED);
break;
case HGRUNT_AE_GREN_TOSS:
{
UTIL_MakeVectors(pev->angles);
// CGrenade::ShootTimed( pev, pev->origin + gpGlobals->v_forward * 34 + Vector (0, 0, 32), m_vecTossVelocity, 3.5 );
CGrenade::ShootTimed(pev, GetGunPosition(), m_vecTossVelocity, 3.5);
m_fThrowGrenade = false;
m_flNextGrenadeCheck = gpGlobals->time + 6; // wait six seconds before even looking again to see if a grenade can be thrown.
// !!!LATER - when in a group, only try to throw grenade if ordered.
}
break;
case HGRUNT_AE_GREN_LAUNCH:
{
EMIT_SOUND(ENT(pev), CHAN_WEAPON, "weapons/glauncher.wav", 0.8, ATTN_NORM);
CGrenade::ShootContact(pev, GetGunPosition(), m_vecTossVelocity);
m_fThrowGrenade = false;
if (g_iSkillLevel == SKILL_HARD)
m_flNextGrenadeCheck = gpGlobals->time + RANDOM_FLOAT(2, 5); // wait a random amount of time before shooting again
else
m_flNextGrenadeCheck = gpGlobals->time + 6; // wait six seconds before even looking again to see if a grenade can be thrown.
}
break;
case HGRUNT_AE_GREN_DROP:
{
UTIL_MakeVectors(pev->angles);
CGrenade::ShootTimed(pev, pev->origin + gpGlobals->v_forward * 17 - gpGlobals->v_right * 27 + gpGlobals->v_up * 6, g_vecZero, 3);
}
break;
case HGRUNT_AE_BURST1:
{
if (FBitSet(pev->weapons, HGRUNT_9MMAR))
{
Shoot();
// the first round of the three round burst plays the sound and puts a sound in the world sound list.
if (RANDOM_LONG(0, 1))
{
EMIT_SOUND(ENT(pev), CHAN_WEAPON, "hgrunt/gr_mgun1.wav", 1, ATTN_NORM);
}
else
{
EMIT_SOUND(ENT(pev), CHAN_WEAPON, "hgrunt/gr_mgun2.wav", 1, ATTN_NORM);
}
}
else
{
Shotgun();
EMIT_SOUND(ENT(pev), CHAN_WEAPON, "weapons/sbarrel1.wav", 1, ATTN_NORM);
}
CSoundEnt::InsertSound(bits_SOUND_COMBAT, pev->origin, 384, 0.3);
}
break;
case HGRUNT_AE_BURST2:
case HGRUNT_AE_BURST3:
Shoot();
break;
case HGRUNT_AE_KICK:
{
CBaseEntity* pHurt = Kick();
if (pHurt)
{
// SOUND HERE!
UTIL_MakeVectors(pev->angles);
pHurt->pev->punchangle.x = 15;
pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_forward * 100 + gpGlobals->v_up * 50;
pHurt->TakeDamage(pev, pev, gSkillData.hgruntDmgKick, DMG_CLUB);
}
}
break;
case HGRUNT_AE_CAUGHT_ENEMY:
{
if (FOkToSpeak())
{
SENTENCEG_PlayRndSz(ENT(pev), "HG_ALERT", HGRUNT_SENTENCE_VOLUME, GRUNT_ATTN, 0, m_voicePitch);
JustSpoke();
}
}
break;
default:
CSquadMonster::HandleAnimEvent(pEvent);
break;
}
}
void CHEVScientist ::Spawn()
{
Precache(); // So the model loads
SET_MODEL(ENT(pev), "models/hevsci.mdl"); // So you can see him
UTIL_SetSize(pev, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX); // Let's make his size human. If you're smart enough (or have lots of patience) you can get replace the VEC_ stuff with "Vector( x, y, z)".
pev->solid = SOLID_SLIDEBOX; // SOLID SNAKE??
pev->movetype = MOVETYPE_STEP; // thump thump im walkin
m_bloodColor = BLOOD_COLOR_RED; // SPLATTY SPLAT SPLATA AAAh
pev->health = 30; // he's got bad health
pev->view_ofs = Vector(0, 0, 20); // eyes offset (he knows where you sleep)
m_flFieldOfView = 0.5; // how far can he see
m_MonsterState = MONSTERSTATE_NONE; // stupid idiot spawner
MonsterInit();
}
void CHEVScientist ::Precache()
{
PRECACHE_MODEL("models/hevsci.mdl");
PRECACHE_SOUND("construction/cn_pain1.wav");
PRECACHE_SOUND("construction/cn_pain2.wav");
PRECACHE_SOUND("construction/cn_pain3.wav");
}
int CHEVScientist ::Classify(void)
{
return CLASS_PLAYER_ALLY;
}
void CHEVScientist ::SetYawSpeed(void)
{
pev->yaw_speed = 90;
}
//=========================================================
// Monster's Anim Events Go Here
//=========================================================
#define HGRUNT_AE_RELOAD (2)
#define HGRUNT_AE_KICK (3)
#define HGRUNT_AE_BURST1 (4)
#define HGRUNT_AE_BURST2 (5)
#define HGRUNT_AE_BURST3 (6)
#define HGRUNT_AE_GREN_TOSS (7)
#define HGRUNT_AE_GREN_LAUNCH (8)
#define HGRUNT_AE_GREN_DROP (9)
#define HGRUNT_AE_CAUGHT_ENEMY (10) // grunt established sight with an enemy (player only) that had previously eluded the squad.
#define HGRUNT_AE_DROP_GUN (11) // grunt (probably dead) is dropping his mp5.