summaryrefslogtreecommitdiff
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
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
-rw-r--r--Changelog-Trunk.txt1
-rw-r--r--conf/Changelog.txt2
-rw-r--r--conf/battle/homunc.conf2
-rw-r--r--src/map/mob.c22
-rw-r--r--src/map/mob.h7
5 files changed, 22 insertions, 12 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index e45582d41..86d9ddee4 100644
--- a/Changelog-Trunk.txt
+++ b/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]
diff --git a/conf/Changelog.txt b/conf/Changelog.txt
index cc0025ce5..4e0325682 100644
--- a/conf/Changelog.txt
+++ b/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
diff --git a/conf/battle/homunc.conf b/conf/battle/homunc.conf
index d9d501f4f..4b8205f9d 100644
--- a/conf/battle/homunc.conf
+++ b/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?
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;