From 9bf4c93d86a081c0c1254613d5115e8210e035ec Mon Sep 17 00:00:00 2001 From: zephyrus Date: Sun, 24 Aug 2008 22:45:32 +0000 Subject: - Implemented Mercenary Scrolls (item_db) - There are some little problems, like remaining time going to 0, but you can summon it, make it walk, follow you. - Feel free to test it. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13126 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/clif.c | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index a66f2b393..69534c9ed 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11306,11 +11306,21 @@ void clif_parse_HomMoveTo(int fd, struct map_session_data *sd) } void clif_parse_HomAttack(int fd,struct map_session_data *sd) -{ //[orn] - if(!merc_is_hom_active(sd->hd)) - return; - - unit_attack(&sd->hd->bl,RFIFOL(fd,6),0) ; +{ + struct block_list *bl = NULL; + int id = RFIFOL(fd,2), + target_id = RFIFOL(fd,6), + action_type = RFIFOB(fd,10); + + if( merc_is_hom_active(sd->hd) && sd->hd->bl.id == id ) + bl = &sd->hd->bl; + else if( sd->md && sd->md->bl.id == id ) + bl = &sd->md->bl; + else return; + + unit_stop_walking(bl, 1); + unit_stop_attack(bl); + unit_attack(bl, target_id, action_type != 0); } void clif_parse_HomMenu(int fd, struct map_session_data *sd) @@ -12386,10 +12396,10 @@ void clif_mercenary_info(struct map_session_data *sd) WFIFOL(fd,52) = status->max_hp; WFIFOL(fd,56) = status->sp; WFIFOL(fd,60) = status->max_sp; - WFIFOL(fd,64) = 0; // Contract End + WFIFOL(fd,64) = (int)time(NULL) + (md->mercenary.remain_life_time / 1000); WFIFOW(fd,68) = 0; // Loyalty WFIFOL(fd,70) = 0; // Summon Count - WFIFOL(fd,74) = 0; // Kill Counter + WFIFOL(fd,74) = md->mercenary.kill_count; WFIFOW(fd,78) = 0; WFIFOSET(fd,80); } @@ -12461,6 +12471,21 @@ void clif_parse_mercenary_action(int fd, struct map_session_data* sd) return; } +/*------------------------------------------ + * Mercenary Message + * 0 = Mercenary soldier's duty hour is over. + * 1 = Your mercenary soldier has been killed. + * 2 = Your mercenary soldier has been fired. + * 3 = Your mercenary soldier has ran away. + *------------------------------------------*/ +void clif_mercenary_message(int fd, int message) +{ + WFIFOHEAD(fd,4); + WFIFOW(fd,0) = 0x0291; + WFIFOW(fd,2) = 1266 + message; + WFIFOSET(fd,4); +} + /*========================================== * パケットデバッグ *------------------------------------------*/ -- cgit v1.2.3-70-g09d2