Jump to content
  • 0

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


Question

Posted

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.

7 answers to this question

Recommended Posts

  • 0
Posted

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

  • 0
Posted (edited)

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
  • 0
Posted
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 :)

  • 0
Posted (edited)

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
  • -1
Posted

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.

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