浏览代码

* Added enumeration for monster damage log field 'flag'.
* Corrected wording of the setting homunculus_autoloot (since r12203).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14587 54d463be-8e91-2dee-dedb-b68131a5f0ec

ai4rei 14 年之前
父节点
当前提交
c457a39996
共有 5 个文件被更改,包括 22 次插入12 次删除
  1. 1 0
      Changelog-Trunk.txt
  2. 2 0
      conf/Changelog.txt
  3. 1 1
      conf/battle/homunc.conf
  4. 11 11
      src/map/mob.c
  5. 7 0
      src/map/mob.h

+ 1 - 0
Changelog-Trunk.txt

@@ -1,6 +1,7 @@
 Date	Added
 
 2010/12/12
+	* Added enumeration for monster damage log field 'flag'. [Ai4rei]
 	* Removed disabled backup of script command 'isequipped' (since r1605). [Ai4rei]
 	* Made script engine's DEBUG_DISASM block use script_op2name, rather than hardcoding operator names as per TODO from r13083 (related r9569, follow up to r10667). [Ai4rei]
 	* Cleaned up MOTD reading (related r292 and r4552). [Ai4rei]

+ 2 - 0
conf/Changelog.txt

@@ -1,5 +1,7 @@
 Date	Added
 
+2010/12/12
+	* Rev. 14587 Corrected wording of the setting homunculus_autoloot (since r12203). [Ai4rei]
 2010/12/10
 	* Rev. 14572 Applied update to charhelp.txt provided by EvilPuncker to match current charcommand behavior (bugreport:4632, follow up to r13403). [Ai4rei]
 2010/10/10

+ 1 - 1
conf/battle/homunc.conf

@@ -44,7 +44,7 @@ hvan_explosion_intimate: 45000
 // Show stat growth to the owner when an Homunculus levels up
 homunculus_show_growth: no
 
-// If a monster is killed only by homunculus, can autoloot works?
+// Does autoloot work, when a monster is killed by homunculus only?
 homunculus_autoloot: yes
 
 // Should homunculii Vaporize when Master dies?

+ 11 - 11
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]

+ 7 - 0
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;