summaryrefslogtreecommitdiff
path: root/src/map/clif.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/clif.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/clif.c')
-rw-r--r--src/map/clif.c77
1 files changed, 43 insertions, 34 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 674770e4a..c56fc3f26 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7881,19 +7881,28 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
}
//homunculus [blackhole89]
- if(merc_is_hom_active(sd->hd)) {
+ if( merc_is_hom_active(sd->hd) )
+ {
map_addblock(&sd->hd->bl);
clif_spawn(&sd->hd->bl);
clif_send_homdata(sd,0,0);
clif_hominfo(sd,sd->hd,1);
clif_hominfo(sd,sd->hd,0); //for some reason, at least older clients want this sent twice
clif_homskillinfoblock(sd);
- if (battle_config.hom_setting&0x8)
+ if( battle_config.hom_setting&0x8 )
status_calc_bl(&sd->hd->bl, SCB_SPEED); //Homunc mimic their master's speed on each map change
- if (!(battle_config.hom_setting&0x2))
+ if( !(battle_config.hom_setting&0x2) )
skill_unit_move(&sd->hd->bl,gettick(),1); // apply land skills immediately
}
+ if( sd->md )
+ {
+ map_addblock(&sd->md->bl);
+ clif_spawn(&sd->md->bl);
+ clif_mercenary_info(sd);
+ clif_mercenary_skillblock(sd);
+ }
+
if(sd->state.connect_new) {
int lv;
sd->state.connect_new = 0;
@@ -12364,6 +12373,35 @@ void clif_send_quest_status(struct map_session_data * sd, int quest_id, bool act
/*==========================================
* Mercenary System
*==========================================*/
+void clif_mercenary_updatestatus(struct map_session_data *sd, int type)
+{
+ struct mercenary_data *md;
+ int fd;
+ if( sd == NULL || (md = sd->md) == NULL )
+ return;
+
+ fd = sd->fd;
+ WFIFOHEAD(fd,8);
+ WFIFOW(fd,0) = 0x02a2;
+ WFIFOW(fd,2) = type;
+ switch( type )
+ {
+ case SP_HP:
+ WFIFOL(fd,4) = md->battle_status.hp;
+ break;
+ case SP_MAXHP:
+ WFIFOL(fd,4) = md->battle_status.max_hp;
+ break;
+ case SP_SP:
+ WFIFOL(fd,4) = md->battle_status.sp;
+ break;
+ case SP_MAXSP:
+ WFIFOL(fd,4) = md->battle_status.max_sp;
+ break;
+ }
+ WFIFOSET(fd,8);
+}
+
void clif_mercenary_info(struct map_session_data *sd)
{
int fd;
@@ -12389,7 +12427,7 @@ void clif_mercenary_info(struct map_session_data *sd)
WFIFOW(fd,14) = status->def + (status->vit/2);
WFIFOW(fd,16) = status->mdef;
WFIFOW(fd,18) = status->flee;
- WFIFOW(fd,20) = status->aspd_rate;
+ WFIFOW(fd,20) = status->amotion;
safestrncpy((char*)WFIFOP(fd,22), md->db->name, NAME_LENGTH);
WFIFOW(fd,46) = md->db->lv;
WFIFOL(fd,48) = status->hp;
@@ -12400,7 +12438,7 @@ void clif_mercenary_info(struct map_session_data *sd)
WFIFOW(fd,68) = 0; // Loyalty
WFIFOL(fd,70) = 0; // Summon Count
WFIFOL(fd,74) = md->mercenary.kill_count;
- WFIFOW(fd,78) = 0;
+ WFIFOW(fd,78) = md->battle_status.rhw.range;
WFIFOSET(fd,80);
}
@@ -12435,35 +12473,6 @@ void clif_mercenary_skillblock(struct map_session_data *sd)
WFIFOSET(fd,len);
}
-void clif_mercenary_updatestatus(struct map_session_data *sd, int type)
-{
- struct mercenary_data *md;
- int fd;
- if( sd == NULL || (md = sd->md) == NULL )
- return;
-
- fd = sd->fd;
- WFIFOHEAD(fd,8);
- WFIFOW(fd,0) = 0x02a2;
- WFIFOW(fd,2) = type;
- switch( type )
- {
- case SP_HP:
- WFIFOL(fd,4) = md->battle_status.hp;
- break;
- case SP_MAXHP:
- WFIFOL(fd,4) = md->battle_status.max_hp;
- break;
- case SP_SP:
- WFIFOL(fd,4) = md->battle_status.sp;
- break;
- case SP_MAXSP:
- WFIFOL(fd,4) = md->battle_status.max_sp;
- break;
- }
- WFIFOSET(fd,8);
-}
-
void clif_parse_mercenary_action(int fd, struct map_session_data* sd)
{
int option = RFIFOB(fd,2);