Ok, lets say that you're weapon's projectile is blahProjectile.
First set that variable you mentioned earlier to 70.
Then you would do this (read the comments):
function blahProjectile::damage(%this,%obj,%col,%fade,%pos,%normal)
{
if(%this.directDamage <= 0)
{
return;
}
%damageType = $DamageType::Direct;
if(%this.DirectDamageType)
{
%damageType = %this.DirectDamageType;
}
//%directDamage is your projectile's damage,
//defined by the datablock. It should be 70, because
//you set it to be that
%directDamage = %this.directDamage;
//now vary it - get a random number between 0 and 30
//and add it
%add = getRandom(0, 30);
%directDamage = %directDamage + %add;
if(%col.getType() & $TypeMasks::PlayerObjectType)
{
%col.damage(%obj, %pos, %directDamage, %damageType);
}
else
{
%col.damage(%obj, %pos, %directDamage, %damageType);
}
}
I didn't test this but it's a good generalization of what I was talking about.