angreusz Posted July 21, 2018 Posted July 21, 2018 Hello guys, I'm trying to make the script for the item below but I can't seem to make it gain hp on kill when defeating mobs with ranged attacks. bHpGainValue only works for melee... *sigh* 19163,Catharina_Von_Brad_60th,Catharina Von Brad 60th,4,20,,0,,1,,1,0xFFFFFFFF,63,2,256,,0,1,1527,{bonus bHPGainValue,500; bonus bSPGainValue,50; bonus bMagicHPGainValue,500; bonus bMagicSPGainValue,50;},{},{} Quote
0 Jarek Posted July 22, 2018 Posted July 22, 2018 (edited) src\map\skil.cpp int skill_counter_additional_effect ... if( (attack_type&(BF_WEAPON|BF_SHORT)) == (BF_WEAPON|BF_SHORT) ) { sp += sd->bonus.sp_gain_value; sp += sd->sp_gain_race[status_get_race(bl)] + sd->sp_gain_race[RC_ALL]; hp += sd->bonus.hp_gain_value; } If you change condition like this if( attack_type&BF_WEAPON ) It will work with physical melee and ranged attacks Edited July 22, 2018 by Jarek 1 Quote
0 angreusz Posted July 22, 2018 Author Posted July 22, 2018 8 hours ago, Jarek said: src\map\skil.cpp int skill_counter_additional_effect ... if( (attack_type&(BF_WEAPON|BF_SHORT)) == (BF_WEAPON|BF_SHORT) ) { sp += sd->bonus.sp_gain_value; sp += sd->sp_gain_race[status_get_race(bl)] + sd->sp_gain_race[RC_ALL]; hp += sd->bonus.hp_gain_value; } If you change condition like this if( attack_type&BF_WEAPON ) It will work with physical melee and ranged attacks Thanks, it worked. Quote
Question
angreusz
Hello guys,
I'm trying to make the script for the item below but I can't seem to make it gain hp on kill when defeating mobs with ranged attacks. bHpGainValue only works for melee...

*sigh*
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.