printl("### Reflected rocket damage against bots will now scale with the value of the 'throwable damage' attribute.") //Simplifying references to constants and NetProps. //Credit: VDC wiki, lite. foreach (k, v in NetProps.getclass()) if (k != "IsValid") getroottable()[k] <- NetProps[k].bindenv(NetProps); ::ReflectDamage <- { Cleanup = function() { delete ::ReflectDamage } OnGameEvent_recalculate_holidays = function(_) { if (GetRoundState() == 3) Cleanup() } OnGameEvent_mvm_wave_complete = function(_) { Cleanup() } function OnScriptHook_OnTakeDamage(params) { local hVictim = params.const_entity; local hAttacker = params.attacker; local hInflictor = params.inflictor // Inflictor is the projectile that dealt the damage for projectile weapons. if ( !(hVictim.IsPlayer()) ) return; if ( hAttacker.IsPlayer() && !(hAttacker.IsBotOfType(1337)) && hVictim.IsBotOfType(1337) ) { // Increased reflect damage. if ( GetPropInt(hInflictor,"m_iDeflected") == 1 && hInflictor.GetClassname() == "tf_projectile_rocket") { printl("Reflected rocket damage dealt!") local iDmgBonusReflect = GetPropEntityArray(hAttacker,"m_hMyWeapons",0).GetAttribute("throwable damage",1) params.damage *= iDmgBonusReflect } } } }; __CollectGameEventCallbacks(ReflectDamage)