iCORE 33 Posted February 27, 2019 (edited) 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 February 28, 2019 by iCORE Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted March 12, 2019 (edited) Spoiler then I also repeat again ... I never seen this kind of bonus not even in Diablo 2https://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 March 12, 2019 by AnnieRuru 1 iCORE reacted to this Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted February 28, 2019 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; 1 iCORE reacted to this Quote Share this post Link to post Share on other sites
0 iCORE 33 Posted February 28, 2019 (edited) 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 February 28, 2019 by iCORE Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted February 28, 2019 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 Quote Share this post Link to post Share on other sites
0 iCORE 33 Posted March 6, 2019 (edited) 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 March 6, 2019 by iCORE Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted March 7, 2019 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 Quote Share this post Link to post Share on other sites
0 KirieZ 88 Posted March 7, 2019 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 Quote Share this post Link to post Share on other sites
0 iCORE 33 Posted March 7, 2019 thanks to all but will bHPDrainRateRace will work on magic? Quote Share this post Link to post Share on other sites
0 KirieZ 88 Posted March 7, 2019 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 Quote Share this post Link to post Share on other sites
0 iCORE 33 Posted March 7, 2019 if not is it possible to make it work on all attacks? Quote Share this post Link to post Share on other sites
0 KirieZ 88 Posted March 7, 2019 Probably yes, but would require source changes to achieve that Quote Share this post Link to post Share on other sites
0 iCORE 33 Posted March 7, 2019 can you help me make it work with all attacks? Quote Share this post Link to post Share on other sites
0 KirieZ 88 Posted March 7, 2019 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)); } 1 iCORE reacted to this Quote Share this post Link to post Share on other sites
0 iCORE 33 Posted March 7, 2019 will try as soon i get home thanks alot. Quote Share this post Link to post Share on other sites
0 iCORE 33 Posted March 7, 2019 ive already tested its not correct it acts as a lifesteal not damage absorb. Quote Share this post Link to post Share on other sites
0 KirieZ 88 Posted March 7, 2019 hmm so I didn't get what exactly you're trying to do too xD Quote Share this post Link to post Share on other sites
0 iCORE 33 Posted March 7, 2019 no worries maybe ill try to experiment some bonuses... Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted March 10, 2019 OnPCStatCalcEvent: bonus bNoWeaponDamage, 100; end; totally immune to physical damage so ... bonus bNoWeaponDamage, 10; will reduce 10% physical damage Quote Share this post Link to post Share on other sites
0 iCORE 33 Posted March 11, 2019 (edited) @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 March 11, 2019 by iCORE Quote Share this post Link to post Share on other sites
0 iCORE 33 Posted March 12, 2019 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 Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted March 12, 2019 (edited) 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 March 12, 2019 by AnnieRuru Quote Share this post Link to post Share on other sites
0 iCORE 33 Posted March 12, 2019 i got healing numbers but no effect at all. im using latest gcc running at centos 7 redhat 64bit Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted March 12, 2019 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 Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted March 12, 2019 (edited) fix value overflow problem https://github.com/AnnieRuru/Release/blob/master/plugins/bHPGainRateWhenHit/bHPGainRateWhenHit_0.4.c Edited March 12, 2019 by AnnieRuru Quote Share this post Link to post Share on other sites
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 iCOREShare this post
Link to post
Share on other sites