Hello!
I'm working on the boss' reflexes.
However, the explosion damage does not reflect, and the rest reflect well.
Originally, "Player_Hurt" was used, but when the summoner and boss hit at the same time,
the server crashes.
Changed to "TrackAttack" and remade.
using the code below, and for some reason the explosion damage is not reflecting. How can I reflect the explosion damage?
PHP Code:
public Action Spell_CounterAttack(int _Victim, int& _Attacker, int& _Inflictor, float& _Damage, int& _Damagetype, int& _Ammotype, int _Hitbox, int _Hitgroup)
{
if (IsValidUser(_Attacker, true))
{
if (IsValidUser(_Victim, true))
{
if (TF2_GetClientTeam(_Victim) == TFTeam_Blue && TF2_GetClientTeam(_Attacker) == TFTeam_Red && _Attacker != _Victim) // _Attacker have "curse" and _Attacker is not _Victim
{
int health = GetClientHealth(_Attacker); // Get _Attacker health
//int dmg = RoundFloat(_Damage); // How much _Damage _Attacker did
if (health > 0) // Health left and more health than _Damage
{
SDKHooks_TakeDamage(_Attacker, _Victim, _Victim, _Damage, _Damagetype);
//SetEntityHealth(_Attacker, health - dmg); // Set health
_Damage *= 0.0; // Prevent _Damage to _Victim
return Plugin_Changed;
}
else
{
GetEdictClassname(_Inflictor, g_Weapon, sizeof(g_Weapon)); // Attacking weapon
if (StrContains(g_Weapon, "_projectile") > 0) // weapon was hegrenade_projectile, flashbang_projectile, smokegrenade_projectile
{
ReplaceString(g_Weapon, sizeof(g_Weapon), "_projectile", "", false); // Erase _projectile from weapon name
ForcePlayerSuicide(_Attacker); // Force _Attacker suicide
_Damage *= 0.0; // Prevent _Damage to _Victim
return Plugin_Changed;
}
else // Any other weapon
{
GetClientWeapon(_Attacker, g_Weapon, sizeof(g_Weapon)); // Get _Attacker weapon
ReplaceString(g_Weapon, sizeof(g_Weapon), "weapon_", "", false); // Erase weapon_ from weapon name
ForcePlayerSuicide(_Attacker); // Force _Attacker suicide
_Damage *= 0.0; // Prevent _Damage to _Victim
return Plugin_Changed;
}
}
}
}
}
return Plugin_Continue;
}