summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-08-31 18:37:00 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-08-31 18:37:00 +0000
commit690ef2ae18deedd44bf4670eaf751c3888cb5a37 (patch)
treeb062e4bbb763f3a1cec82ed85e84ceb8550f256d /src/map/pc.c
parentf1f46c5b4ba04d590ff2ffbf28d84c3888ff3399 (diff)
downloadhercules-690ef2ae18deedd44bf4670eaf751c3888cb5a37.tar.gz
hercules-690ef2ae18deedd44bf4670eaf751c3888cb5a37.tar.bz2
hercules-690ef2ae18deedd44bf4670eaf751c3888cb5a37.tar.xz
hercules-690ef2ae18deedd44bf4670eaf751c3888cb5a37.zip
* More mercenary updates.
- Implemented Mercenary Die, Damage, Run Away when master dies. - Log mercenary damage and gives exp to Master. - Some little bugs. * Fixed Bubble Gums effect works on mvp_sd not sd (according to Doddler). NOTE: Now you can summon a mercenary, make it attack (not skills), follow you even on map change. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13158 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 0c8af18d3..5e4954eeb 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -873,7 +873,7 @@ int pc_reg_received(struct map_session_data *sd)
sd->cashPoints = pc_readaccountreg(sd,"#CASHPOINTS");
sd->kafraPoints = pc_readaccountreg(sd,"#KAFRAPOINTS");
- if ((sd->class_&MAPID_BASEMASK)==MAPID_TAEKWON)
+ if( (sd->class_&MAPID_BASEMASK) == MAPID_TAEKWON )
{ //Better check for class rather than skill to prevent "skill resets" from unsetting this
sd->mission_mobid = pc_readglobalreg(sd,"TK_MISSION_ID");
sd->mission_count = pc_readglobalreg(sd,"TK_MISSION_COUNT");
@@ -3571,32 +3571,42 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
//Tag player for rewarping after map-loading is done. [Skotlex]
sd->state.rewarp = 1;
- sd->mapindex = mapindex;
+ sd->mapindex = mapindex;
sd->bl.m = m;
sd->bl.x = sd->ud.to_x = x;
sd->bl.y = sd->ud.to_y = y;
- if (sd->status.guild_id > 0 && map[m].flag.gvg_castle)
+ if( sd->status.guild_id > 0 && map[m].flag.gvg_castle )
{ // Increased guild castle regen [Valaris]
struct guild_castle *gc = guild_mapindex2gc(sd->mapindex);
if(gc && gc->guild_id == sd->status.guild_id)
sd->regen.state.gc = 1;
}
- if(sd->status.pet_id > 0 && sd->pd && sd->pd->pet.intimate > 0) {
+ if( sd->status.pet_id > 0 && sd->pd && sd->pd->pet.intimate > 0 )
+ {
sd->pd->bl.m = m;
sd->pd->bl.x = sd->pd->ud.to_x = x;
sd->pd->bl.y = sd->pd->ud.to_y = y;
sd->pd->ud.dir = sd->ud.dir;
}
- if(merc_is_hom_active(sd->hd)) { //orn
+ if( merc_is_hom_active(sd->hd) )
+ {
sd->hd->bl.m = m;
sd->hd->bl.x = sd->hd->ud.to_x = x;
sd->hd->bl.y = sd->hd->ud.to_y = y;
sd->hd->ud.dir = sd->ud.dir;
}
+ if( sd->md )
+ {
+ sd->md->bl.m = m;
+ sd->md->bl.x = sd->hd->ud.to_x = x;
+ sd->md->bl.y = sd->hd->ud.to_y = y;
+ sd->md->ud.dir = sd->ud.dir;
+ }
+
return 0;
}
@@ -4925,9 +4935,12 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
pet_unlocktarget(sd->pd);
}
- if(sd->status.hom_id > 0 && battle_config.homunculus_auto_vapor) //orn
+ if( sd->status.hom_id > 0 && battle_config.homunculus_auto_vapor )
merc_hom_vaporize(sd, 0);
+ if( sd->md )
+ merc_delete(sd->md, 3); // Your mercenary soldier has ran away.
+
// Leave duel if you die [LuzZza]
if(battle_config.duel_autoleave_when_die) {
if(sd->duel_group > 0)
@@ -4968,6 +4981,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
status_calc_mob(md, 0);
status_percent_heal(src,10,0);
}
+ src = battle_get_master(src); // Maybe Player Summon
}
break;
case BL_PET: //Pass on to master...
@@ -4976,6 +4990,9 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
case BL_HOM:
src = &((TBL_HOM*)src)->master->bl;
break;
+ case BL_MER:
+ src = &((TBL_MER*)src)->master->bl;
+ break;
}
if (src && src->type == BL_PC)