Jump to content
  • 0
Sign in to follow this  
Hidekitakase

Include dmg Mob received by map_zone_db

Question

Hello guys how can i do this... calculation of the damage boss/monster damage received that can be reduced by mapflag, its working but only with players pvp,gvg.... i really appreciate who can help me😀 
like this in src/map/battle.c

int64 battle_calc_pc_damage(struct block_list *src, struct block_list *bl, struct Damage *d, int64 damage, uint16 skill_id, uint16 skill_lv)
{
	int flag = d->flag;

	switch (skill_id) {
		//case PA_PRESSURE: /* pressure also belongs to this list but it doesn't reach this area -- so don't worry about it */
		case HW_GRAVITATION:
		case NJ_ZENYNAGE:
		case KO_MUCHANAGE:
			break;
		default:
			if (flag & BF_SKILL) { //Skills get a different reduction than non-skills. [Skotlex]
				if (flag & BF_WEAPON)
					damage = damage * map->list[bl->m].weapon_damage_rate / 100;
				if (flag & BF_MAGIC)
					damage = damage * map->list[bl->m].magic_damage_rate / 100;
				if (flag & BF_MISC)
					damage = damage * map->list[bl->m].misc_damage_rate / 100;
			} else { //Normal attacks get reductions based on range.
				if (flag & BF_SHORT)
					damage = damage * map->list[bl->m].short_damage_rate / 100;
				if (flag & BF_LONG)
					damage = damage * map->list[bl->m].long_damage_rate / 100;
			}
			if (!damage)
				damage  = 1;
			break;
	}
	return damage;
}

 

Edited by Hidekitakase

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

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

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.