I cloned the weapon_handgrenade for HL1 (Solokillers SDK) with all settings and want to have it only give 1 Damage in the whole radius of the explosion. The DMG-skill is to 1 and in the ggrenade.cpp I tried these two settings:

void CSTUNGrenade::Spawn()
{
pev->movetype = MOVETYPE_BOUNCE;
pev->classname = MAKE_STRING("grenade");

pev->solid = SOLID_BBOX;

SET_MODEL(ENT(pev), "models/grenade.mdl");
UTIL_SetSize(pev, Vector(0, 0, 0), Vector(0, 0, 0));
* pev->dmg = 100;*
m_fRegisteredSound = false;
}

and

CSTUNGrenade* CSTUNGrenade::ShootTimed(entvars_t* pevOwner, Vector vecStart, Vector vecVelocity, float time)
{
CSTUNGrenade* pSTUNGrenade = GetClassPtr((CSTUNGrenade*)NULL);
pSTUNGrenade->Spawn();
UTIL_SetOrigin(pSTUNGrenade->pev, vecStart);
pSTUNGrenade->pev->velocity = vecVelocity;
pSTUNGrenade->pev->angles = UTIL_VecToAngles(pSTUNGrenade->pev->velocity);
pSTUNGrenade->pev->owner = ENT(pevOwner);

pSTUNGrenade->SetTouch(&CSTUNGrenade::BounceTouch); // Bounce if touched

// Take one second off of the desired detonation time and set the think to PreDetonate. PreDetonate
// will insert a DANGER sound into the world sound list and delay detonation for one second so that
// the grenade explodes after the exact amount of time specified in the call to ShootTimed().

pSTUNGrenade->pev->dmgtime = gpGlobals->time + time;
pSTUNGrenade->SetThink(&CSTUNGrenade::TumbleThink);
pSTUNGrenade->pev->nextthink = gpGlobals->time + 0.1;
if (time < 0.1)
{
pSTUNGrenade->pev->nextthink = gpGlobals->time;
pSTUNGrenade->pev->velocity = Vector(0, 0, 0);
}

pSTUNGrenade->pev->sequence = RANDOM_LONG(3, 6);
pSTUNGrenade->pev->framerate = 1.0;

// Tumble through the air
// pGrenade->pev->avelocity.x = -400;

pSTUNGrenade->pev->gravity = 0.5;
pSTUNGrenade->pev->friction = 0.8;

SET_MODEL(ENT(pSTUNGrenade->pev), "models/w_grenade.mdl");
  • pSTUNGrenade->pev->dmg = 100;*
return pSTUNGrenade;
}


I tried different values but either the damage is high in the radius (like normal) or 0 in the radius but 1 at the center of explosion. Also the scale of the explosion (spr) is scaled bigger when the values are lower.

Is it possible to have the damage 1 in the whole radius no matter where and not automatically upscaling the spr?