PDA

View Full Version : DoD Reduced Bot Damage


Dr.G
01-23-2009, 11:47 PM
//////////////////////////////////////////////////////////////////////////////////
//
// Information:
//
// This plugin will allow you to adjust how much damage bots will do..
// Note that damage are set for ALL weapons used by bots! Your bots will still
// be damn stupid and weird, but they wont do as much damage to you..
//
// Thanks to diamond-optic(www.avamods.com) for DoD stronger rifles!
// Everything in this code is from the stronger rifles plugin... I didnt even
// bother to change any pointer lol no need to...
//
//
/////////////////////////////////////////////////////////////////////////////////
//
// CVARs:
//
// dod_bot_dmg "1" //turn ON(1)/OFF(0)
//
// dod_bot_dmg_head "30" //Damage % for head shots
// dod_bot_dmg_chest "30" //Damage % for chest shots
// dod_bot_dmg_stomach "30" //Damage % for stomach shots
// dod_bot_dmg_arms "30" //Damage % for arm shots
// dod_bot_dmg_legs "30" //Damage % for leg shots
//
//////////////////////////////////////////////////////////////////////////////////
//
// Changelog:
//
// 01-28-2009
// stopped trace if !is_user_bot
// moved unneeded branch and return in func_TakeDamage :S
//
//////////////////////////////////////////////////////////////////////////////////

This will work with shrikebots and sturmbots, or any other bot... if there are any :)

NOTE the damage is set in % !!! Default all values is set to 30 %


Public Stats (http://www.game-monitor.com/search.php?search=dod_bot_dmg_stats&type=variable)

meathead
01-24-2009, 02:15 AM
Awesome idea gman!! I'm trying it out tomorrow!!

diamond-optic
01-24-2009, 09:26 PM
works nice :)

..also, you can remove the dodx include since your plugin doesnt need it

diamond-optic
01-24-2009, 09:41 PM
heh a few more little things that are up to you to do...

in the func_TraceAttack function you could do this instead to not even bother getting the trace result if it wasnt a bot
if(!get_pcvar_num(p_strong) || !is_user_bot(idattacker))
return HAM_IGNORED

then you could make the func_TakeDamage function a bit smaller too
public func_TakeDamage(id,inflictor,attacker,Float:damage ,damagebits)
{
if(!get_pcvar_num(p_strong) || !is_user_bot(attacker))
return HAM_IGNORED

switch(hitbox[id])
{
case HIT_HEAD: damage=float(floatround(get_pcvar_float(p_head) / 100 * damage))
case HIT_CHEST: damage=float(floatround(get_pcvar_float(p_chest) / 100 * damage))
case HIT_STOMACH: damage=float(floatround(get_pcvar_float(p_stomach) / 100 * damage))
case HIT_LEFTARM,HIT_RIGHTARM: damage=float(floatround(get_pcvar_float(p_arms) / 100 * damage))
case HIT_LEFTLEG,HIT_RIGHTLEG: damage=float(floatround(get_pcvar_float(p_legs) / 100 * damage))
}

SetHamParamFloat(4,damage)

return HAM_HANDLED
}
and if you wanted, you could make it so bots still do normal damage to other bots by changing that takedamage if statement to something like:
if(!get_pcvar_num(p_strong) || !is_user_bot(attacker) || is_user_bot(id))
return HAM_IGNORED

Dr.G
01-25-2009, 12:19 PM
Yeah it works very well.. And yea d-o of cource no need to run thru all that shit unless its a bot... ill update it later today...

Dr.G
01-28-2009, 09:54 AM
* UPDATED TO v1.1 *

The first version i posted looked like a beta beta version, i messed something cuz some !is_user_bot thing was already done in the dmg part :S sry bout that... maybe i should stop drinking lol.. However this version should be ok! Thanks D-O!

Cheers!