Jump to content
  • 0

Which part of the source handles the damage output of normal attacks?


Ninja

Question


  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

Hi rA,

I'm a big newb in source modification, I'm trying to implement a new mapflag called "instakill." as the name suggests, if the mapflag is turned on, 1 normal attack would output maximum damage to the target.

I've already figured out how to create my own mapflag, the only thing left to do is the damage modification that this mapflag would inflict. I was looking at 

int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damage *d,int64 damage,uint16 skill_id,uint16 skill_lv)

but I'm not sure if it is the right one. Can someone please point me to the right direction?

Thanks in advance.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

Okay. Thanks for the input. I decided to give it a try and figured out that it is indeed 

int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damage *d,int64 damage,uint16 skill_id,uint16 skill_lv)

It's actually the final damage calculation of everything (yes, from normal attacks to skills.)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  350
  • Reputation:   43
  • Joined:  09/07/12
  • Last Seen:  

iirc, "normal attack" command is taken by the server as skill too,

you can find it somewhere in battle.c and add the checks there to avoid unnecessary computations.

Edited by benching
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

7 minutes ago, benching said:

iirc, "normal attack" command is taken by the server as skill too,

you can find it somewhere in battle.c and add the checks there to avoid unnecessary computations.

Yes, I do understand that it can be found in battle.c, I'm looking for the specific function though. Thank you :)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  350
  • Reputation:   43
  • Joined:  09/07/12
  • Last Seen:  

oh sheep, if normal attack is taken as skill, then it might be in the skill.c

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  350
  • Reputation:   43
  • Joined:  09/07/12
  • Last Seen:  

battle_calc_damage return the calculated damage base from the parameters given,

you can confirm what it really does just by checking at it,(which i cant do rn)

if you know the max damage you want to be output-ed, im not sure if you need to run through that function,

here.PNG

Edited by benching
mispelling
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  350
  • Reputation:   43
  • Joined:  09/07/12
  • Last Seen:  

just what i said

Link to comment
Share on other sites

  • -1

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

if you can actually check out what I posted,

int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damage *d,int64 damage,uint16 skill_id,uint16 skill_lv)

I'm just not sure if it can take "0" as skill_id for normal attacks.

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