summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 3c5a611af..1f1145846 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -1804,7 +1804,7 @@ int mob_respawn(int tid, unsigned int tick, int id, intptr data)
void mob_log_damage(struct mob_data *md, struct block_list *src, int damage)
{
- int char_id = 0, flag = 0;
+ int char_id = 0, flag = MDLF_NORMAL;
if( damage < 0 )
return; //Do nothing for absorbed damage.
@@ -1826,7 +1826,7 @@ void mob_log_damage(struct mob_data *md, struct block_list *src, int damage)
case BL_HOM:
{
struct homun_data *hd = (TBL_HOM*)src;
- flag = 1;
+ flag = MDLF_HOMUN;
if( hd->master )
char_id = hd->master->status.char_id;
if( damage )
@@ -1845,7 +1845,7 @@ void mob_log_damage(struct mob_data *md, struct block_list *src, int damage)
case BL_PET:
{
struct pet_data *pd = (TBL_PET*)src;
- flag = 2;
+ flag = MDLF_PET;
if( pd->msd )
{
char_id = pd->msd->status.char_id;
@@ -2021,9 +2021,9 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
count++; //Only logged into same map chars are counted for the total.
if (pc_isdead(tsd))
continue; // skip dead players
- if(md->dmglog[i].flag == 1 && !merc_is_hom_active(tsd->hd))
+ if(md->dmglog[i].flag == MDLF_HOMUN && !merc_is_hom_active(tsd->hd))
continue; // skip homunc's share if inactive
- if( md->dmglog[i].flag == 2 && (!tsd->status.pet_id || !tsd->pd) )
+ if( md->dmglog[i].flag == MDLF_PET && (!tsd->status.pet_id || !tsd->pd) )
continue; // skip pet's share if inactive
if(md->dmglog[i].dmg > mvp_damage)
@@ -2036,7 +2036,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
tmpsd[i] = tsd; // record as valid damage-log entry
- if(!md->dmglog[i].flag == 1 && flaghom)
+ if(!md->dmglog[i].flag == MDLF_HOMUN && flaghom)
flaghom = 0; // Damage received from other Types != Homunculus
}
@@ -2102,7 +2102,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
else if(md->special_state.size==2)
per *=2.;
- if( md->dmglog[i].flag == 2 )
+ if( md->dmglog[i].flag == MDLF_PET )
per *= battle_config.pet_attack_exp_rate/100.;
if(battle_config.zeny_from_mobs && md->level) {
@@ -2117,12 +2117,12 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
else
base_exp = (unsigned int)cap_value(md->db->base_exp * per * bonus/100. * map[m].bexp/100., 1, UINT_MAX);
- if (map[m].flag.nojobexp || !md->db->job_exp || md->dmglog[i].flag == 1) //Homun earned job-exp is always lost.
+ if (map[m].flag.nojobexp || !md->db->job_exp || md->dmglog[i].flag == MDLF_HOMUN) //Homun earned job-exp is always lost.
job_exp = 0;
else
job_exp = (unsigned int)cap_value(md->db->job_exp * per * bonus/100. * map[m].jexp/100., 1, UINT_MAX);
- if((temp = tmpsd[i]->status.party_id )>0 && !md->dmglog[i].flag == 1) //Homun-done damage (flag 1) is not given to party
+ if((temp = tmpsd[i]->status.party_id )>0 && !md->dmglog[i].flag == MDLF_HOMUN) //Homun-done damage (flag 1) is not given to party
{
int j;
for(j=0;j<pnum && pt[j].id!=temp;j++); //Locate party.
@@ -2154,11 +2154,11 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
}
}
if(flag) {
- if(base_exp && md->dmglog[i].flag == 1) //tmpsd[i] is null if it has no homunc.
+ if(base_exp && md->dmglog[i].flag == MDLF_HOMUN) //tmpsd[i] is null if it has no homunc.
merc_hom_gainexp(tmpsd[i]->hd, base_exp);
if(base_exp || job_exp)
{
- if( md->dmglog[i].flag != 2 || battle_config.pet_attack_exp_to_master )
+ if( md->dmglog[i].flag != MDLF_PET || battle_config.pet_attack_exp_to_master )
pc_gainexp(tmpsd[i], &md->bl, base_exp, job_exp, false);
}
if(zeny) // zeny from mobs [Valaris]