summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-09-25 21:26:54 +0200
committerHaru <haru@dotalux.com>2013-09-25 22:15:53 +0200
commitafcad494411995396b906f214d1c4ffcf485cc0a (patch)
treee70b21658276ddef885322b7c9b18935b6c0235e /src/map/clif.c
parent13afb7e0bf35bacc9c90c7dffe34120ddd2fd099 (diff)
downloadhercules-afcad494411995396b906f214d1c4ffcf485cc0a.tar.gz
hercules-afcad494411995396b906f214d1c4ffcf485cc0a.tar.bz2
hercules-afcad494411995396b906f214d1c4ffcf485cc0a.tar.xz
hercules-afcad494411995396b906f214d1c4ffcf485cc0a.zip
Renamed local variables that would conflict with a rename of iStatus to status
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c157
1 files changed, 77 insertions, 80 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 7bc808eed..488e2cf0f 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1370,13 +1370,13 @@ int clif_spawn(struct block_list *bl)
/// Sends information about owned homunculus to the client (ZC_PROPERTY_HOMUN). [orn]
/// 022e <name>.24B <modified>.B <level>.W <hunger>.W <intimacy>.W <equip id>.W <atk>.W <matk>.W <hit>.W <crit>.W <def>.W <mdef>.W <flee>.W <aspd>.W <hp>.W <max hp>.W <sp>.W <max sp>.W <exp>.L <max exp>.L <skill points>.W <atk range>.W
void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag) {
- struct status_data *status;
+ struct status_data *hstatus;
unsigned char buf[128];
enum homun_type htype;
nullpo_retv(hd);
- status = &hd->battle_status;
+ hstatus = &hd->battle_status;
htype = homun->class2type(hd->homunculus.class_);
memset(buf,0,packet_len(0x22e));
@@ -1388,30 +1388,30 @@ void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag)
WBUFW(buf,29)=hd->homunculus.hunger;
WBUFW(buf,31)=(unsigned short) (hd->homunculus.intimacy / 100) ;
WBUFW(buf,33)=0; // equip id
- WBUFW(buf,35)=cap_value(status->rhw.atk2+status->batk, 0, INT16_MAX);
- WBUFW(buf,37)=cap_value(status->matk_max, 0, INT16_MAX);
- WBUFW(buf,39)=status->hit;
+ WBUFW(buf,35)=cap_value(hstatus->rhw.atk2+hstatus->batk, 0, INT16_MAX);
+ WBUFW(buf,37)=cap_value(hstatus->matk_max, 0, INT16_MAX);
+ WBUFW(buf,39)=hstatus->hit;
if (battle_config.hom_setting&0x10)
- WBUFW(buf,41)=status->luk/3 + 1; //crit is a +1 decimal value! Just display purpose.[Vicious]
+ WBUFW(buf,41)=hstatus->luk/3 + 1; //crit is a +1 decimal value! Just display purpose.[Vicious]
else
- WBUFW(buf,41)=status->cri/10;
- WBUFW(buf,43)=status->def + status->vit ;
- WBUFW(buf,45)=status->mdef;
- WBUFW(buf,47)=status->flee;
- WBUFW(buf,49)=(flag)?0:status->amotion;
- if (status->max_hp > INT16_MAX) {
- WBUFW(buf,51) = status->hp/(status->max_hp/100);
+ WBUFW(buf,41)=hstatus->cri/10;
+ WBUFW(buf,43)=hstatus->def + hstatus->vit ;
+ WBUFW(buf,45)=hstatus->mdef;
+ WBUFW(buf,47)=hstatus->flee;
+ WBUFW(buf,49)=(flag)?0:hstatus->amotion;
+ if (hstatus->max_hp > INT16_MAX) {
+ WBUFW(buf,51) = hstatus->hp/(hstatus->max_hp/100);
WBUFW(buf,53) = 100;
} else {
- WBUFW(buf,51)=status->hp;
- WBUFW(buf,53)=status->max_hp;
+ WBUFW(buf,51)=hstatus->hp;
+ WBUFW(buf,53)=hstatus->max_hp;
}
- if (status->max_sp > INT16_MAX) {
- WBUFW(buf,55) = status->sp/(status->max_sp/100);
+ if (hstatus->max_sp > INT16_MAX) {
+ WBUFW(buf,55) = hstatus->sp/(hstatus->max_sp/100);
WBUFW(buf,57) = 100;
} else {
- WBUFW(buf,55)=status->sp;
- WBUFW(buf,57)=status->max_sp;
+ WBUFW(buf,55)=hstatus->sp;
+ WBUFW(buf,57)=hstatus->max_sp;
}
WBUFL(buf,59)=hd->homunculus.exp;
WBUFL(buf,63)=hd->exp_next;
@@ -5462,9 +5462,8 @@ void clif_skill_mapinfomessage(struct map_session_data *sd, int type)
/// Displays Sense (WZ_ESTIMATION) information window (ZC_MONSTER_INFO).
/// 018c <class>.W <level>.W <size>.W <hp>.L <def>.W <race>.W <mdef>.W <element>.W
/// <water%>.B <earth%>.B <fire%>.B <wind%>.B <poison%>.B <holy%>.B <shadow%>.B <ghost%>.B <undead%>.B
-void clif_skill_estimation(struct map_session_data *sd,struct block_list *dst)
-{
- struct status_data *status;
+void clif_skill_estimation(struct map_session_data *sd,struct block_list *dst) {
+ struct status_data *dstatus;
unsigned char buf[64];
int i;//, fix;
@@ -5474,23 +5473,23 @@ void clif_skill_estimation(struct map_session_data *sd,struct block_list *dst)
if( dst->type != BL_MOB )
return;
- status = iStatus->get_status_data(dst);
+ dstatus = iStatus->get_status_data(dst);
WBUFW(buf, 0)=0x18c;
WBUFW(buf, 2)=iStatus->get_class(dst);
WBUFW(buf, 4)=iStatus->get_lv(dst);
- WBUFW(buf, 6)=status->size;
- WBUFL(buf, 8)=status->hp;
- WBUFW(buf,12)= (battle_config.estimation_type&1?status->def:0)
- +(battle_config.estimation_type&2?status->def2:0);
- WBUFW(buf,14)=status->race;
- WBUFW(buf,16)= (battle_config.estimation_type&1?status->mdef:0)
- +(battle_config.estimation_type&2?status->mdef2:0);
- WBUFW(buf,18)= status->def_ele;
+ WBUFW(buf, 6)=dstatus->size;
+ WBUFL(buf, 8)=dstatus->hp;
+ WBUFW(buf,12)= (battle_config.estimation_type&1?dstatus->def:0)
+ +(battle_config.estimation_type&2?dstatus->def2:0);
+ WBUFW(buf,14)=dstatus->race;
+ WBUFW(buf,16)= (battle_config.estimation_type&1?dstatus->mdef:0)
+ +(battle_config.estimation_type&2?dstatus->mdef2:0);
+ WBUFW(buf,18)= dstatus->def_ele;
for(i=0;i<9;i++)
- WBUFB(buf,20+i)= (unsigned char)battle->attr_ratio(i+1,status->def_ele, status->ele_lv);
+ WBUFB(buf,20+i)= (unsigned char)battle->attr_ratio(i+1,dstatus->def_ele, dstatus->ele_lv);
// The following caps negative attributes to 0 since the client displays them as 255-fix. [Skotlex]
-// WBUFB(buf,20+i)= (unsigned char)((fix=battle_attr_ratio(i+1,status->def_ele, status->ele_lv))<0?0:fix);
+// WBUFB(buf,20+i)= (unsigned char)((fix=battle_attr_ratio(i+1,dstatus->def_ele, dstatus->ele_lv))<0?0:fix);
clif->send(buf,packet_len(0x18c),&sd->bl,sd->status.party_id>0?PARTY_SAMEMAP:SELF);
}
@@ -15668,58 +15667,57 @@ void clif_quest_show_event(struct map_session_data *sd, struct block_list *bl, s
/// Notification about a mercenary status parameter change (ZC_MER_PAR_CHANGE).
/// 02a2 <var id>.W <value>.L
-void clif_mercenary_updatestatus(struct map_session_data *sd, int type)
-{
+void clif_mercenary_updatestatus(struct map_session_data *sd, int type) {
struct mercenary_data *md;
- struct status_data *status;
+ struct status_data *mstatus;
int fd;
if( sd == NULL || (md = sd->md) == NULL )
return;
fd = sd->fd;
- status = &md->battle_status;
+ mstatus = &md->battle_status;
WFIFOHEAD(fd,packet_len(0x2a2));
WFIFOW(fd,0) = 0x2a2;
WFIFOW(fd,2) = type;
switch( type ) {
case SP_ATK1:
- {
- int atk = rnd()%(status->rhw.atk2 - status->rhw.atk + 1) + status->rhw.atk;
- WFIFOL(fd,4) = cap_value(atk, 0, INT16_MAX);
- }
+ {
+ int atk = rnd()%(mstatus->rhw.atk2 - mstatus->rhw.atk + 1) + mstatus->rhw.atk;
+ WFIFOL(fd,4) = cap_value(atk, 0, INT16_MAX);
+ }
break;
case SP_MATK1:
- WFIFOL(fd,4) = cap_value(status->matk_max, 0, INT16_MAX);
+ WFIFOL(fd,4) = cap_value(mstatus->matk_max, 0, INT16_MAX);
break;
case SP_HIT:
- WFIFOL(fd,4) = status->hit;
+ WFIFOL(fd,4) = mstatus->hit;
break;
case SP_CRITICAL:
- WFIFOL(fd,4) = status->cri/10;
+ WFIFOL(fd,4) = mstatus->cri/10;
break;
case SP_DEF1:
- WFIFOL(fd,4) = status->def;
+ WFIFOL(fd,4) = mstatus->def;
break;
case SP_MDEF1:
- WFIFOL(fd,4) = status->mdef;
+ WFIFOL(fd,4) = mstatus->mdef;
break;
case SP_MERCFLEE:
- WFIFOL(fd,4) = status->flee;
+ WFIFOL(fd,4) = mstatus->flee;
break;
case SP_ASPD:
- WFIFOL(fd,4) = status->amotion;
+ WFIFOL(fd,4) = mstatus->amotion;
break;
case SP_HP:
- WFIFOL(fd,4) = status->hp;
+ WFIFOL(fd,4) = mstatus->hp;
break;
case SP_MAXHP:
- WFIFOL(fd,4) = status->max_hp;
+ WFIFOL(fd,4) = mstatus->max_hp;
break;
case SP_SP:
- WFIFOL(fd,4) = status->sp;
+ WFIFOL(fd,4) = mstatus->sp;
break;
case SP_MAXSP:
- WFIFOL(fd,4) = status->max_sp;
+ WFIFOL(fd,4) = mstatus->max_sp;
break;
case SP_MERCKILLS:
WFIFOL(fd,4) = md->mercenary.kill_count;
@@ -15736,39 +15734,38 @@ void clif_mercenary_updatestatus(struct map_session_data *sd, int type)
/// 029b <id>.L <atk>.W <matk>.W <hit>.W <crit>.W <def>.W <mdef>.W <flee>.W <aspd>.W
/// <name>.24B <level>.W <hp>.L <maxhp>.L <sp>.L <maxsp>.L <expire time>.L <faith>.W
/// <calls>.L <kills>.L <atk range>.W
-void clif_mercenary_info(struct map_session_data *sd)
-{
+void clif_mercenary_info(struct map_session_data *sd) {
int fd;
struct mercenary_data *md;
- struct status_data *status;
+ struct status_data *mstatus;
int atk;
if( sd == NULL || (md = sd->md) == NULL )
return;
fd = sd->fd;
- status = &md->battle_status;
+ mstatus = &md->battle_status;
WFIFOHEAD(fd,packet_len(0x29b));
WFIFOW(fd,0) = 0x29b;
WFIFOL(fd,2) = md->bl.id;
// Mercenary shows ATK as a random value between ATK ~ ATK2
- atk = rnd()%(status->rhw.atk2 - status->rhw.atk + 1) + status->rhw.atk;
+ atk = rnd()%(mstatus->rhw.atk2 - mstatus->rhw.atk + 1) + mstatus->rhw.atk;
WFIFOW(fd,6) = cap_value(atk, 0, INT16_MAX);
- WFIFOW(fd,8) = cap_value(status->matk_max, 0, INT16_MAX);
- WFIFOW(fd,10) = status->hit;
- WFIFOW(fd,12) = status->cri/10;
- WFIFOW(fd,14) = status->def;
- WFIFOW(fd,16) = status->mdef;
- WFIFOW(fd,18) = status->flee;
- WFIFOW(fd,20) = status->amotion;
+ WFIFOW(fd,8) = cap_value(mstatus->matk_max, 0, INT16_MAX);
+ WFIFOW(fd,10) = mstatus->hit;
+ WFIFOW(fd,12) = mstatus->cri/10;
+ WFIFOW(fd,14) = mstatus->def;
+ WFIFOW(fd,16) = mstatus->mdef;
+ WFIFOW(fd,18) = mstatus->flee;
+ WFIFOW(fd,20) = mstatus->amotion;
safestrncpy((char*)WFIFOP(fd,22), md->db->name, NAME_LENGTH);
WFIFOW(fd,46) = md->db->lv;
- WFIFOL(fd,48) = status->hp;
- WFIFOL(fd,52) = status->max_hp;
- WFIFOL(fd,56) = status->sp;
- WFIFOL(fd,60) = status->max_sp;
+ WFIFOL(fd,48) = mstatus->hp;
+ WFIFOL(fd,52) = mstatus->max_hp;
+ WFIFOL(fd,56) = mstatus->sp;
+ WFIFOL(fd,60) = mstatus->max_sp;
WFIFOL(fd,64) = (int)time(NULL) + (mercenary->get_lifetime(md) / 1000);
WFIFOW(fd,68) = mercenary->get_faith(md);
WFIFOL(fd,70) = mercenary->get_calls(md);
@@ -16291,29 +16288,29 @@ void clif_parse_ItemListWindowSelected(int fd, struct map_session_data* sd) {
*==========================================*/
void clif_elemental_updatestatus(struct map_session_data *sd, int type) {
struct elemental_data *ed;
- struct status_data *status;
+ struct status_data *estatus;
int fd;
if( sd == NULL || (ed = sd->ed) == NULL )
return;
fd = sd->fd;
- status = &ed->battle_status;
+ estatus = &ed->battle_status;
WFIFOHEAD(fd,8);
WFIFOW(fd,0) = 0x81e;
WFIFOW(fd,2) = type;
switch( type ) {
case SP_HP:
- WFIFOL(fd,4) = status->hp;
+ WFIFOL(fd,4) = estatus->hp;
break;
case SP_MAXHP:
- WFIFOL(fd,4) = status->max_hp;
+ WFIFOL(fd,4) = estatus->max_hp;
break;
case SP_SP:
- WFIFOL(fd,4) = status->sp;
+ WFIFOL(fd,4) = estatus->sp;
break;
case SP_MAXSP:
- WFIFOL(fd,4) = status->max_sp;
+ WFIFOL(fd,4) = estatus->max_sp;
break;
}
WFIFOSET(fd,8);
@@ -16322,21 +16319,21 @@ void clif_elemental_updatestatus(struct map_session_data *sd, int type) {
void clif_elemental_info(struct map_session_data *sd) {
int fd;
struct elemental_data *ed;
- struct status_data *status;
+ struct status_data *estatus;
if( sd == NULL || (ed = sd->ed) == NULL )
return;
fd = sd->fd;
- status = &ed->battle_status;
+ estatus = &ed->battle_status;
WFIFOHEAD(fd,22);
WFIFOW(fd, 0) = 0x81d;
WFIFOL(fd, 2) = ed->bl.id;
- WFIFOL(fd, 6) = status->hp;
- WFIFOL(fd,10) = status->max_hp;
- WFIFOL(fd,14) = status->sp;
- WFIFOL(fd,18) = status->max_sp;
+ WFIFOL(fd, 6) = estatus->hp;
+ WFIFOL(fd,10) = estatus->max_hp;
+ WFIFOL(fd,14) = estatus->sp;
+ WFIFOL(fd,18) = estatus->max_sp;
WFIFOSET(fd,22);
}