Jump to content
  • 0

[question] how to put max cap damage ?


aguyaguy

Question


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   0
  • Joined:  12/17/11
  • Last Seen:  

can someone assist me how to put a cap damage. in all skills . or just give me an example to edit it . thank you

help ?

bump

55 views and no one could help me @_@

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  52
  • Reputation:   6
  • Joined:  01/06/12
  • Last Seen:  

int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damage *d,int damage,int skill_num,int skill_lv)

Find that in battle.c, go down to the end of the function where it says return damage;

and add

if(damage > DAMAGECAP) damage = DAMAGECAP;

before it.

Replace DAMAGECAP with whatever number. Unless there's some function for some obscure skill that doesn't call this function, it should cap all damage. (Do skills like demonstration call this function actually? I'm not really sure, unit skills are weird, but I think they all call this function for damage.)

Edited by Variant
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  764
  • Reputation:   220
  • Joined:  11/14/11
  • Last Seen:  

There is a function called cap_value()...

cap_value(value, MIN, MAX)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  83
  • Reputation:   0
  • Joined:  12/07/11
  • Last Seen:  

regarding on this topic . is there any way to put a max cap damage let say Bowling Bash i want a max cap damage like 36000 is it possible?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  52
  • Reputation:   6
  • Joined:  01/06/12
  • Last Seen:  

There is a function called cap_value()...

cap_value(value, MIN, MAX)

Woops. Forgot about that macro function. Yeah, you could just use:

return cap_value(damage,0,DAMAGECAP); //Is it 0 or 1 that's the min here?

regarding on this topic . is there any way to put a max cap damage let say Bowling Bash i want a max cap damage like 36000 is it possible?

Replace return damage with

return (skill_num == KN_BOWLINGBASH)?cap_value(damage,0,36000):damage; 

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...