From 690ef2ae18deedd44bf4670eaf751c3888cb5a37 Mon Sep 17 00:00:00 2001 From: zephyrus Date: Sun, 31 Aug 2008 18:37:00 +0000 Subject: * 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 --- src/map/pc.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'src/map/pc.c') 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) -- cgit v1.2.3-70-g09d2