Jump to content
  • 0
iCORE

[HELP] Absorb Damage Taken Bonus

Question

hi Everyone can you help me make a bonus like this

Absorb 10% HP From Physical Damage Taken

for example i have 100 hp and im being attack with 50 damage and the 10% if the 50 damage will be absorb as HP.

sorry for my bad english hope you can help me, thanks alot 

Edited by iCORE

Share this post


Link to post
Share on other sites

29 answers to this question

Recommended Posts

  • 0
bonus bNearAtkDef,`n`;            | Adds `n`% damage reduction against melee physical attacks
bonus bLongAtkDef,`n`;            | Adds `n`% damage reduction against ranged physical attacks


7 hours ago, iCORE said:

hi AnnieRuRu can you help me make a bonus like this

Increases AllStats by 30%

for example i have

STR: 100 + 30% = 30
AGI: 200 + 30% = 60 
VIT: 100 + 30% = 30
DEX: 150 + 30% = 45
INT: 100 + 30% = 30
LUK: 100 +30% = 30

i try using this bonus <" bonus bAllStats (readparam(bAllStats) / 30) "> but it only read as every 30 of my status points. 

sorry for my bad english hope you can help me, thanks alot :)

bonus bStr, readparam(bStr) *3/ 10;
....
bonus bLuk, readparam(bLuk) *3/ 10;

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, AnnieRuru said:

bonus bNearAtkDef,`n`;            | Adds `n`% damage reduction against melee physical attacks
bonus bLongAtkDef,`n`;            | Adds `n`% damage reduction against ranged physical attacks

 


bonus bStr, readparam(bStr) *3/ 10;
....
bonus bLuk, readparam(bLuk) *3/ 10;

thanks annie and how about

regain % of damage taken and receive it as hp

Edited by iCORE

Share this post


Link to post
Share on other sites
  • 0

just use reduce damage taken ...

imagine if the player having 199 attack speed, and trigger the hunter fly card effect every time, that effect kinda spammy

Share this post


Link to post
Share on other sites
  • 0

hmm, what i want to ask is how to make a script for damage taken, like when the attacker has 100 damage the receiver will gain the percent of that damage.

Edited by iCORE

Share this post


Link to post
Share on other sites
  • 0

is there some kind of game ... that use this description ?

don't really understand whats the difference in reduce damage taken and absorb damage taken ...
if absorb 10% damage taken, that would equal to reduce 20% taken isn't it ?

btw sorry earlier, it seems bonus bNearAtkDef,`n`; reduce damage taken in value, not percentage

if you couldn't find the bonus you want ...
https://github.com/HerculesWS/Hercules/blob/stable/doc/item_bonus.md
then its probably not there

Share this post


Link to post
Share on other sites
  • 0

I think what he means is recovering attacker's HP by a % of the damage dealt.

Example: absorb 10% of damage as HP
if your attack causes 100 points of damage, you will recover 10 HP (10% of 100)

I think you might be looking for bHPDrainRateRace or bHPDrainRate

Share this post


Link to post
Share on other sites
  • 0
1 minute ago, iCORE said:

thanks to all :) but will bHPDrainRateRace will work on magic?

Hmm I'm not completely sure, but its description says "with weapon attack" so I think not

Share this post


Link to post
Share on other sites
  • 0

I haven't tested, but try this:

src/map/battle.c search:

		if (wd.flag & BF_WEAPON && src != target && damage > 0) {
			if (battle_config.left_cardfix_to_right)
				battle->drain(sd, target, wd.damage, wd.damage, tstatus->race, is_boss(target));
			else
				battle->drain(sd, target, wd.damage, wd.damage2, tstatus->race, is_boss(target));
		}

change to (first line)

		if (src != target && damage > 0) {
			if (battle_config.left_cardfix_to_right)
				battle->drain(sd, target, wd.damage, wd.damage, tstatus->race, is_boss(target));
			else
				battle->drain(sd, target, wd.damage, wd.damage2, tstatus->race, is_boss(target));
		}

 

Share this post


Link to post
Share on other sites
  • 0

ive already tested its not correct :( it acts as a lifesteal not damage absorb.

Share this post


Link to post
Share on other sites
  • 0
OnPCStatCalcEvent:
	bonus bNoWeaponDamage, 100;
	end;

totally immune to physical damage

 

so ... bonus bNoWeaponDamage, 10; will reduce 10% physical damage

Share this post


Link to post
Share on other sites
  • 0

@AnnieRuru sorry for my bad explanation but ill still try to explain it more clearly.

Example:

Item Description is "Absord 10% damage and heal as HP".

Player A deals 100 damage to Player B therefore Player B will heal 10% of the damage as HP. 

its like bHPDrainRate,'n'; but will trigger when being attacked by someone.

hope i explain it clearly that its not reduce damage like you are saying.

Edited by iCORE

Share this post


Link to post
Share on other sites
  • 0
Spoiler

 

then I also repeat again ... I never seen this kind of bonus
not even in Diablo 2
https://diablo.gamepedia.com/Affixes_(Diablo_II)#Damage_Reduction

if you know a game that has this kind of bonus, I like to see a video how its done

 

https://github.com/AnnieRuru/Release/blob/master/plugins/bHPGainRateWhenHit/bHPGainRateWhenHit_0.2.c
- fix this bonus can only use 1 time

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0
absorb_health.c: In function ‘pc_damage_pre’:
absorb_health.c:66:9: warning: implicit declaration of function ‘rand’ [-Wimplicit-function-declaration]
   if ( (rand() % 1000) < ssd->hp_gain_rate_chance ) {
         ^
absorb_health.c:66:3: warning: nested extern declaration of ‘rand’ [-Wnested-externs]
   if ( (rand() % 1000) < ssd->hp_gain_rate_chance ) {
   ^
        PLUGIN  absorb_health

@AnnieRuru

Share this post


Link to post
Share on other sites
  • 0

hmmmmm ........

https://github.com/AnnieRuru/Release/blob/master/plugins/bHPGainRateWhenHit/bHPGainRateWhenHit_0.3.c

curious, what is your compiler ?
I'm using visual studio 2017
maybe should report in github

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0

i got healing numbers but no effect at all.

 

im using latest gcc running at centos 7 redhat 64bit

Share this post


Link to post
Share on other sites
  • 0

already tested with

OnPCStatCalcEvent:
	bonus2 bHPGainRateWhenHit, 500, 50;
	bonus2 bHPGainRateWhenHit, 500, 50;
	end;

total up 100% chance to recover 100% hp

this formula is the same as hunter fly card, the chance and the value are just sum up

if doesn't work for you, no idea, it works on my test server

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.