Raised This Month: $ Target: $400
 0% 

SDKHooks_TakeDamage - Change damage taken from it ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mr.Orion
Senior Member
Join Date: Apr 2012
Location: In my microwave.
Old 09-12-2015 , 15:30   SDKHooks_TakeDamage - Change damage taken from it ?
Reply With Quote #1

Hello ,

Warning: stupid question ahead.

So I was wondering if there was a way of modifing damage TAKEN from SDKHooks_TakeDamage.

for example : with base damage stuff.
Code:
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype, &weapon, Float:damageForce[3], Float:damagePosition[3], damagecustom)
{
    damage *= 0.5; //This will reduce damage taken from weapons and stuff by 50%.
}
But now the deal is, how to reduce damage from SDKHooks_TakeDamage.
I used damage *= 0.0 to immune me from weapon damage, but if you get stomped by gooma stomp (obvious), you'll still get damaged.

I don't want to use anything like the "dmg taken increased" attribute nor anything related to godmode.

If you're wondering why, it's for my custom weapons 2 attributes packs : the evasion attribute.
It might be actually impossible, but you never know.
__________________

Last edited by Mr.Orion; 09-12-2015 at 15:31.
Mr.Orion is offline
Akuba
Senior Member
Join Date: Oct 2013
Old 09-12-2015 , 16:41   Re: SDKHooks_TakeDamage - Change damage taken from it ?
Reply With Quote #2

Why do you not change the damage on SDKHooks_TakeDamage itself? Since you use it to deal out damage..?

Last edited by Akuba; 09-12-2015 at 16:42.
Akuba is offline
Mr.Orion
Senior Member
Join Date: Apr 2012
Location: In my microwave.
Old 09-12-2015 , 16:42   Re: SDKHooks_TakeDamage - Change damage taken from it ?
Reply With Quote #3

Quote:
Originally Posted by Akuba View Post
Why do you not change the damage on TakeDamage?
Because I don't want to modify them directly. I don't think it was clear enough, heh. What I want is :
Code:
► "Player1" does 100 damage with SDKHooks_TakeDamage.
► "Player2" has a damage resitance of 50%.
► "Player3" has no damage resistance.

► "Player1" attacks "Player2" and deal 50 damage instead of 100.
► "Player1" attacks "Player3" and deal 100 damage.
That's basically the same a damage *= 0.5 but with SDKHooks_TakeDamage.
__________________

Last edited by Mr.Orion; 09-12-2015 at 16:48.
Mr.Orion is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 09-12-2015 , 16:55   Re: SDKHooks_TakeDamage - Change damage taken from it ?
Reply With Quote #4

The SDKHook_TakeDamage native is purposefully bypassed around the forward.
__________________
WildCard65 is offline
Mr.Orion
Senior Member
Join Date: Apr 2012
Location: In my microwave.
Old 09-13-2015 , 12:31   Re: SDKHooks_TakeDamage - Change damage taken from it ?
Reply With Quote #5

Okay so, looks like SDKHooks_TakeDamage isn't detected by SDKHook_OnTakeDamage. By that it means that if you want to do something when attacked or attacking with SDKHooks_TakeDamage, it just won't do anything.

But, "player_hurt" does detect it but you can't do anything to modify damages anyway.
I've tried this :
Code:
damage = 0;
SetEventInt(event, "damageamount", damage);
This part of code removes the damage that you can see upon hitting someone, BUT, the player attacked by a SDKHooks_TakeDamage still get damaged, even though it doesn't show damage anymore.

...That moment when you don't know how something works .
__________________
Mr.Orion is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 09-13-2015 , 13:33   Re: SDKHooks_TakeDamage - Change damage taken from it ?
Reply With Quote #6

The reason SDKHooks_TakeDamage doesn't fire the OnTakeDamage hook is because it's bypassed intentionally around the internal master hook on OnTakeDamage in the extension to prevent an infinite loop
__________________
WildCard65 is offline
Mr.Orion
Senior Member
Join Date: Apr 2012
Location: In my microwave.
Old 09-14-2015 , 14:46   Re: SDKHooks_TakeDamage - Change damage taken from it ?
Reply With Quote #7

Welp, I found a way to actually reduce that kind of incoming damage.
Replacing every SDKHooks_TakeDamage by DealDamage actually does the trick, although, there is no kill icon anymore.
__________________
Mr.Orion is offline
Reply



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 21:22.


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