diff options
author | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-08-24 13:33:36 +0000 |
---|---|---|
committer | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-08-24 13:33:36 +0000 |
commit | 8cb6244382cb6e1bb8b2edd13bba6b91f9c67b1f (patch) | |
tree | 8f7a613a82dbc47716983718bfaf8bbf2f69793c /src/map/clif.c | |
parent | 9ef83b403e59be7824e55e2526b5163bdf17f2b6 (diff) | |
download | hercules-8cb6244382cb6e1bb8b2edd13bba6b91f9c67b1f.tar.gz hercules-8cb6244382cb6e1bb8b2edd13bba6b91f9c67b1f.tar.bz2 hercules-8cb6244382cb6e1bb8b2edd13bba6b91f9c67b1f.tar.xz hercules-8cb6244382cb6e1bb8b2edd13bba6b91f9c67b1f.zip |
- Implemented unit_calc_pos (copy from pet_calc_pos) to implement it on Mercenary/Homunculus and don't use x,y-1 always.
- Implemented Mercenary walk to master (same packet as Homunculus).
- Starting work on Stats but i will need lot of help.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13121 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index a82495aa0..78d73bca0 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11270,10 +11270,19 @@ void clif_parse_ChangeHomunculusName(int fd, struct map_session_data *sd) void clif_parse_HomMoveToMaster(int fd, struct map_session_data *sd) { - if(!merc_is_hom_active(sd->hd)) - return; + int id = RFIFOL(fd,2); // Mercenary or Homunculus + struct block_list *bl = NULL; + struct unit_data *ud = NULL; + + if( sd->md && sd->md->bl.id == id ) + bl = &sd->md->bl; + else if( merc_is_hom_active(sd->hd) && sd->hd->bl.id == id ) + bl = &sd->hd->bl; // Moving Homunculus + else return; - unit_walktoxy(&sd->hd->bl, sd->bl.x,sd->bl.y-1, 4); + unit_calc_pos(bl, sd->bl.x, sd->bl.y, sd->ud.dir); + ud = unit_bl2ud(bl); + unit_walktoxy(bl, ud->to_x, ud->to_y, 4); } void clif_parse_HomMoveTo(int fd, struct map_session_data *sd) @@ -12349,6 +12358,7 @@ void clif_mercenary_info(struct map_session_data *sd) int fd; struct mercenary_data *md; struct status_data *status; + int atk; if( sd == NULL || (md = sd->md) == NULL ) return; @@ -12359,14 +12369,16 @@ void clif_mercenary_info(struct map_session_data *sd) WFIFOHEAD(fd,80); WFIFOW(fd,0) = 0x029b; WFIFOL(fd,2) = md->bl.id; - WFIFOW(fd,6) = cap_value(status->rhw.atk2+status->batk, 0, SHRT_MAX); + // Mercenary shows ATK as a random value between ATK ~ ATK2 + atk = rand()%(status->rhw.atk - status->rhw.atk2 + 1) + status->rhw.atk; + WFIFOW(fd,6) = cap_value(atk, 0, SHRT_MAX); WFIFOW(fd,8) = cap_value(status->matk_max, 0, SHRT_MAX); WFIFOW(fd,10) = status->hit; WFIFOW(fd,12) = status->cri/10; - WFIFOW(fd,14) = status->def + status->vit; + WFIFOW(fd,14) = status->def + (status->vit/2); WFIFOW(fd,16) = status->mdef; WFIFOW(fd,18) = status->flee; - WFIFOW(fd,20) = status->amotion; + WFIFOW(fd,20) = status->aspd_rate; safestrncpy((char*)WFIFOP(fd,22), md->db->name, NAME_LENGTH); WFIFOW(fd,46) = md->db->lv; WFIFOL(fd,48) = status->hp; |