Jump to content
  • 0

Max damage for Monsters


Question

Posted

So while im editing monsters min ~ max damage I noticed that there's a limit. I wonder where can I find or adjust it in the source?

2 answers to this question

Recommended Posts

  • 0
Posted
On 4/29/2017 at 1:37 AM, Radian said:

So while im editing monsters min ~ max damage I noticed that there's a limit. I wonder where can I find or adjust it in the source?

You try to look at battle.h

// Final calculation Damage
int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damage *d,int64 damage,uint16 skill_id,uint16 skill_lv);
int64 battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int64 damage,uint16 skill_id,int flag);
int64 battle_calc_bg_damage(struct block_list *src,struct block_list *bl,int64 damage,uint16 skill_id,int flag);

simply changing the return type would do it but that would affect a lot of things.

  • 0
Posted (edited)

In const.h add:

/**
 * THe maximum amount of damage a monster can do in Normal circumstances. (Ignoring GvG & BG maps)
 */
#define MAX_MONSTER_DAMAGE 2147483647

in battle.c  

find (Battle_calc_damage)
 

	if( sd ) {
		if( pc_ismadogear(sd) && rnd()%100 < 50 ) {
			short element = skill_get_ele(skill_id, skill_lv);
			if( !skill_id || element == -1 ) { //Take weapon's element
				struct status_data *sstatus = NULL;
				if( src->type == BL_PC && ((TBL_PC*)src)->bonus.arrow_ele )
					element = ((TBL_PC*)src)->bonus.arrow_ele;
				else if( (sstatus = status_get_status_data(src)) ) {
					element = sstatus->rhw.ele;
				}
			} else if( element == -2 ) //Use enchantment's element
				element = status_get_attack_sc_element(src,status_get_sc(src));
			else if( element == -3 ) //Use random element
				element = rnd()%ELE_ALL;
			if( element == ELE_FIRE || element == ELE_WATER )
				pc_overheat(sd,element == ELE_FIRE ? 1 : -1);
		}
	}

add This below:
 

	if (bl->type == BL_MOB && damage > MAX_MONSTER_DAMAGE)
	{
		return MAX_MONSTER_DAMAGE;
	} 

 

 

I  wasn't sure what you were asking. If this isn't what you're looking for, please elaborate.

Edited by Ajjwidjdneidjenw

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