summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-12 20:22:25 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-12 20:22:25 +0000
commit408c3b028d4a27442c8832c172d4030d31666f0d (patch)
treebb113bc9e6d5b81399ddcd4e3d96ec247fe5f65b /src/map
parentf882f21e562ee2df9c2392ebd96858ff4647798e (diff)
downloadhercules-408c3b028d4a27442c8832c172d4030d31666f0d.tar.gz
hercules-408c3b028d4a27442c8832c172d4030d31666f0d.tar.bz2
hercules-408c3b028d4a27442c8832c172d4030d31666f0d.tar.xz
hercules-408c3b028d4a27442c8832c172d4030d31666f0d.zip
* Added enumeration for monster damage log field 'flag'.
* Corrected wording of the setting homunculus_autoloot (since r12203). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14587 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/mob.c22
-rw-r--r--src/map/mob.h7
2 files changed, 18 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]
diff --git a/src/map/mob.h b/src/map/mob.h
index e8bd0a837..ce896646c 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -55,6 +55,13 @@ enum MobSkillState {
MSS_ANYTARGET,
};
+enum MobDamageLogFlag
+{
+ MDLF_NORMAL = 0,
+ MDLF_HOMUN,
+ MDLF_PET,
+};
+
struct mob_skill {
enum MobSkillState state;
short skill_id,skill_lv;