Author
|
Message
|
Junior Member
Join Date: Jul 2021
Location: Braap
|
11-13-2021
, 22:20
Increasing Spell Dmg via another attribute
|
#1
|
I've been trying to make a plugin that increases damage on a spell (currently using the fireball spell).
Here's the code I have so far with the help of others that I've asked about this
public OnClientPutInServer(client)
{
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
public OnClientDisconnect(client)
{
if(IsClientInGame(client))
{
SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
}
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype, &weapon, Float:damageForce[3], Float:damagePosition[3], damagecustom)
{
new String:classname[128];
GetEdictClassname(inflictor, classname, sizeof(classname));
if(!strcmp("tf_projectile_spellfireball", classname))
{
damage = 500.0;
damagetype |= DMG_PREVENT_PHYSICS_FORCE;
}
return Plugin_Changed;
}
What I want to happen is the damage value to multiply by a percentage per value of an attribute
To put that into something that makes a little more sense:
For every let's say 100% increase in the "damage bonus" attribute, multiply the spell's damage by 70%
I'm a complete noob when it comes to coding and I'm using this to hopefully get me into coding since it sounds simple on paper. Any and all help would be greatly appreciated.
|
|
|
|