summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-11-24 10:12:43 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-11-24 10:12:43 +0000
commit67b396bd39ce915cd2f93029080aff0cab9aec85 (patch)
treec34bc5281a91c3da98a17938c1143309b30c52f7 /src/map
parent7e42b725526dc11abbe5c529c05013df77c8ee7b (diff)
downloadhercules-67b396bd39ce915cd2f93029080aff0cab9aec85.tar.gz
hercules-67b396bd39ce915cd2f93029080aff0cab9aec85.tar.bz2
hercules-67b396bd39ce915cd2f93029080aff0cab9aec85.tar.xz
hercules-67b396bd39ce915cd2f93029080aff0cab9aec85.zip
* Fixed the logged damage from pets doesn't count when 'pet_attack_exp_to_master' is inactive.
* Uncommented the codes that stop pc_bleeding when dead (shouldn't have been commented out.....) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14166 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/mob.c32
-rw-r--r--src/map/mob.h2
-rw-r--r--src/map/pc.c4
3 files changed, 22 insertions, 16 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 3ab50da79..803453718 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -1837,14 +1837,13 @@ void mob_log_damage(struct mob_data *md, struct block_list *src, int damage)
case BL_PET:
{
struct pet_data *pd = (TBL_PET*)src;
- if( battle_config.pet_attack_exp_to_master && pd->msd )
+ flag = 2;
+ if( pd->msd )
{
char_id = pd->msd->status.char_id;
- damage = (damage*battle_config.pet_attack_exp_rate)/100; //Modify logged damage accordingly.
+ if( damage ) //Let mobs retaliate against the pet's master [Skotlex]
+ md->attacked_id = pd->msd->bl.id;
}
- //Let mobs retaliate against the pet's master [Skotlex]
- if( pd->msd && damage )
- md->attacked_id = pd->msd->bl.id;
break;
}
case BL_MOB:
@@ -2014,8 +2013,10 @@ 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 && !merc_is_hom_active(tsd->hd))
+ if(md->dmglog[i].flag == 1 && !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) )
+ continue; // skip pet's share if inactive
if(md->dmglog[i].dmg > mvp_damage)
{
@@ -2027,7 +2028,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 && flaghom)
+ if(!md->dmglog[i].flag == 1 && flaghom)
flaghom = 0; // Damage received from other Types != Homunculus
}
@@ -2092,8 +2093,10 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
per /=2.;
else if(md->special_state.size==2)
per *=2.;
-
-
+
+ if( md->dmglog[i].flag == 2 )
+ per *= battle_config.pet_attack_exp_rate/100.;
+
if(battle_config.zeny_from_mobs && md->level) {
// zeny calculation moblv + random moblv [Valaris]
zeny=(int) ((md->level+rand()%md->level)*per*bonus/100.);
@@ -2106,12 +2109,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) //Homun earned job-exp is always lost.
+ if (map[m].flag.nojobexp || !md->db->job_exp || md->dmglog[i].flag == 1) //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) //Homun-done damage (flag 1) is not given to party
+ if((temp = tmpsd[i]->status.party_id )>0 && !md->dmglog[i].flag == 1) //Homun-done damage (flag 1) is not given to party
{
int j;
for(j=0;j<pnum && pt[j].id!=temp;j++); //Locate party.
@@ -2143,10 +2146,13 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
}
}
if(flag) {
- if(base_exp && md->dmglog[i].flag) //tmpsd[i] is null if it has no homunc.
+ if(base_exp && md->dmglog[i].flag == 1) //tmpsd[i] is null if it has no homunc.
merc_hom_gainexp(tmpsd[i]->hd, base_exp);
if(base_exp || job_exp)
- pc_gainexp(tmpsd[i], &md->bl, base_exp, job_exp);
+ {
+ if( md->dmglog[i].flag != 2 || battle_config.pet_attack_exp_to_master )
+ pc_gainexp(tmpsd[i], &md->bl, base_exp, job_exp);
+ }
if(zeny) // zeny from mobs [Valaris]
pc_getzeny(tmpsd[i], zeny);
}
diff --git a/src/map/mob.h b/src/map/mob.h
index 235e93756..b5127310f 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -121,7 +121,7 @@ struct mob_data {
struct {
int id;
unsigned int dmg;
- unsigned flag : 1; //0: Normal. 1: Homunc exp
+ unsigned flag : 2; //0: Normal. 1: Homunc exp. 2: Pet exp
} dmglog[DAMAGELOG_SIZE];
struct spawn_data *spawn; //Spawn data.
int spawn_timer; //Required for Convex Mirror
diff --git a/src/map/pc.c b/src/map/pc.c
index a186d4c6c..8b118270b 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -7369,8 +7369,8 @@ void pc_bleeding (struct map_session_data *sd, unsigned int diff_tick)
{
int hp = 0, sp = 0;
- //if( pc_isdead(sd) )
- // return;
+ if( pc_isdead(sd) )
+ return;
if (sd->hp_loss.value) {
sd->hp_loss.tick += diff_tick;