Jump to content
  • 0

Hp on ranged attack kill


angreusz

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  07/23/14
  • Last Seen:  

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

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  143
  • Reputation:   30
  • Joined:  12/23/11
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  07/23/14
  • Last Seen:  

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.

Link to comment
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.   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.

×
×
  • Create New...