Jump to content
  • 0

Question

Posted

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*
image.png.ce5695a27472a061209518771ba59368.png
 

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;},{},{}

 

2 answers to this question

Recommended Posts

  • 0
Posted (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 by Jarek
  • Upvote 1
  • 0
Posted
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.

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...