Raised This Month: $ Target: $400
 0% 

Increasing Spell Dmg via another attribute


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Recluse
Junior Member
Join Date: Jul 2021
Location: Braap
Old 11-13-2021 , 22:20   Increasing Spell Dmg via another attribute
Reply With Quote #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.
Recluse is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:33.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode