diff options
author | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-09-02 16:29:29 +0000 |
---|---|---|
committer | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-09-02 16:29:29 +0000 |
commit | f4444897e96b9278ca952686e7dc0561a8b30efc (patch) | |
tree | 4a77e92c9ca5ac6a0916d79ec336cf143322184b /src/map/clif.c | |
parent | c23a8db0769097ef2aaf25d43b07cd6774a6fd8e (diff) | |
download | hercules-f4444897e96b9278ca952686e7dc0561a8b30efc.tar.gz hercules-f4444897e96b9278ca952686e7dc0561a8b30efc.tar.bz2 hercules-f4444897e96b9278ca952686e7dc0561a8b30efc.tar.xz hercules-f4444897e96b9278ca952686e7dc0561a8b30efc.zip |
- Implementing a correct update of mercenary status window on status change updates.
- Fixed Mercenary Heal is reduced 50%.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13185 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 52 |
1 files changed, 37 insertions, 15 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index f03264557..f1f1417fc 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -12376,36 +12376,56 @@ void clif_send_quest_status(struct map_session_data * sd, int quest_id, bool act void clif_mercenary_updatestatus(struct map_session_data *sd, int type) { struct mercenary_data *md; + struct status_data *status; int fd; if( sd == NULL || (md = sd->md) == NULL ) return; fd = sd->fd; + status = &md->battle_status; WFIFOHEAD(fd,8); WFIFOW(fd,0) = 0x02a2; WFIFOW(fd,2) = type; switch( type ) { - case SP_HP: - WFIFOL(fd,4) = md->battle_status.hp; + case SP_ATK1: + { + int atk = rand()%(status->rhw.atk2 - status->rhw.atk + 1) + status->rhw.atk; + WFIFOL(fd,4) = cap_value(atk, 0, SHRT_MAX); + } break; - case SP_MAXHP: - WFIFOL(fd,4) = md->battle_status.max_hp; + case SP_MATK1: + WFIFOL(fd,4) = cap_value(status->matk_max, 0, SHRT_MAX); break; - case SP_SP: - WFIFOL(fd,4) = md->battle_status.sp; + case SP_HIT: + WFIFOL(fd,4) = status->hit; break; - case SP_MAXSP: - WFIFOL(fd,4) = md->battle_status.max_sp; + case SP_CRITICAL: + WFIFOL(fd,4) = status->cri/10; + break; + case SP_DEF1: + WFIFOL(fd,4) = status->def; + break; + case SP_MDEF1: + WFIFOL(fd,4) = status->mdef; break; case SP_MERCFLEE: - WFIFOL(fd,4) = md->battle_status.flee; + WFIFOL(fd,4) = status->flee; break; - case SP_ATK1: - WFIFOL(fd,4) = md->battle_status.rhw.atk + md->battle_status.rhw.atk2; + case SP_ASPD: + WFIFOL(fd,4) = status->amotion; break; - case SP_HIT: - WFIFOL(fd,4) = md->battle_status.hit; + case SP_HP: + WFIFOL(fd,4) = status->hp; + break; + case SP_MAXHP: + WFIFOL(fd,4) = status->max_hp; + break; + case SP_SP: + WFIFOL(fd,4) = status->sp; + break; + case SP_MAXSP: + WFIFOL(fd,4) = status->max_sp; break; case SP_MERCKILLS: WFIFOL(fd,4) = md->mercenary.kill_count; @@ -12433,13 +12453,15 @@ void clif_mercenary_info(struct map_session_data *sd) WFIFOHEAD(fd,80); WFIFOW(fd,0) = 0x029b; WFIFOL(fd,2) = md->bl.id; + // Mercenary shows ATK as a random value between ATK ~ ATK2 - atk = rand()%(status->rhw.atk - status->rhw.atk2 + 1) + status->rhw.atk; + atk = rand()%(status->rhw.atk2 - status->rhw.atk + 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/2); + WFIFOW(fd,14) = status->def; WFIFOW(fd,16) = status->mdef; WFIFOW(fd,18) = status->flee; WFIFOW(fd,20) = status->amotion; |