src/map/atcommand.c | 22 +++++++++++-----------
src/map/clif.c | 32 ++++++++++++++++----------------
src/map/mob.c | 10 +++++-----
src/map/mob.h | 1 -
src/map/npc.h | 2 --
src/map/pc.h | 1 -
src/map/script.c | 12 ++++++------
src/map/status.c | 8 ++++----
src/map/unit.c | 4 ++--
src/map/unit.h | 1 +
10 files changed, 45 insertions(+), 48 deletions(-)
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 78483ef..666432b 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -7360,12 +7360,12 @@ ACMD(size)
size = cap_value(atoi(message),UNITSIZE_NORMAL,UNITSIZE_BIG);
- if(sd->state.size) {
- sd->state.size = UNITSIZE_NORMAL;
+ if(sd->vd.size) {
+ sd->vd.size = UNITSIZE_NORMAL;
pc->setpos(sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_TELEPORT);
}
- sd->state.size = size;
+ sd->vd.size = size;
if( size == UNITSIZE_SMALL )
clif->specialeffect(&sd->bl,420,AREA);
else if( size == UNITSIZE_BIG )
@@ -7386,13 +7386,13 @@ ACMD(sizeall)
iter = mapit_getallusers();
for (pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter)) {
- if (pl_sd->state.size != size) {
- if (pl_sd->state.size) {
- pl_sd->state.size = UNITSIZE_NORMAL;
+ if (pl_sd->vd.size != size) {
+ if (pl_sd->vd.size) {
+ pl_sd->vd.size = UNITSIZE_NORMAL;
pc->setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT);
}
- pl_sd->state.size = size;
+ pl_sd->vd.size = size;
if (size == UNITSIZE_SMALL)
clif->specialeffect(&pl_sd->bl,420,AREA);
else if (size == UNITSIZE_BIG)
@@ -7427,13 +7427,13 @@ ACMD(sizeguild)
size = cap_value(size,UNITSIZE_NORMAL,UNITSIZE_BIG);
for (i = 0; i < g->max_member; i++) {
- if ((pl_sd = g->member[i].sd) && pl_sd->state.size != size) {
- if( pl_sd->state.size ) {
- pl_sd->state.size = UNITSIZE_NORMAL;
+ if ((pl_sd = g->member[i].sd) && pl_sd->vd.size != size) {
+ if( pl_sd->vd.size ) {
+ pl_sd->vd.size = UNITSIZE_NORMAL;
pc->setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT);
}
- pl_sd->state.size = size;
+ pl_sd->vd.size = size;
if( size == UNITSIZE_SMALL )
clif->specialeffect(&pl_sd->bl,420,AREA);
else if( size == UNITSIZE_BIG )
diff --git a/src/map/clif.c b/src/map/clif.c
index 372ac9d..2740ff0 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1385,9 +1385,9 @@ bool clif_spawn(struct block_list *bl)
int i;
if (sd->spiritball > 0)
clif->spiritball(&sd->bl);
- if(sd->state.size==UNITSIZE_BIG) // tiny/big players [Valaris]
+ if(sd->vd.size==UNITSIZE_BIG) // tiny/big players [Valaris]
clif->specialeffect(bl,423,AREA);
- else if(sd->state.size==UNITSIZE_SMALL)
+ else if(sd->vd.size==UNITSIZE_SMALL)
clif->specialeffect(bl,421,AREA);
if( sd->bg_id && map->list[sd->bl.m].flag.battleground )
clif->sendbgemblem_area(sd);
@@ -1403,18 +1403,18 @@ bool clif_spawn(struct block_list *bl)
case BL_MOB:
{
TBL_MOB *md = ((TBL_MOB*)bl);
- if(md->special_state.size==UNITSIZE_BIG) // tiny/big mobs [Valaris]
+ if(md->vd->size==UNITSIZE_BIG) // tiny/big mobs [Valaris]
clif->specialeffect(&md->bl,423,AREA);
- else if(md->special_state.size==UNITSIZE_SMALL)
+ else if(md->vd->size==UNITSIZE_SMALL)
clif->specialeffect(&md->bl,421,AREA);
}
break;
case BL_NPC:
{
TBL_NPC *nd = ((TBL_NPC*)bl);
- if( nd->size == UNITSIZE_BIG )
+ if( nd->vd->size == UNITSIZE_BIG )
clif->specialeffect(&nd->bl,423,AREA);
- else if( nd->size == UNITSIZE_SMALL )
+ else if( nd->vd->size == UNITSIZE_SMALL )
clif->specialeffect(&nd->bl,421,AREA);
}
break;
@@ -1647,18 +1647,18 @@ void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_data *u
{
TBL_PC *sd = ((TBL_PC*)bl);
//clif_movepc(sd);
- if(sd->state.size==UNITSIZE_BIG) // tiny/big players [Valaris]
+ if(sd->vd.size==UNITSIZE_BIG) // tiny/big players [Valaris]
clif->specialeffect(&sd->bl,423,AREA);
- else if(sd->state.size==UNITSIZE_SMALL)
+ else if(sd->vd.size==UNITSIZE_SMALL)
clif->specialeffect(&sd->bl,421,AREA);
}
break;
case BL_MOB:
{
TBL_MOB *md = ((TBL_MOB*)bl);
- if(md->special_state.size==UNITSIZE_BIG) // tiny/big mobs [Valaris]
+ if(md->vd->size==UNITSIZE_BIG) // tiny/big mobs [Valaris]
clif->specialeffect(&md->bl,423,AREA);
- else if(md->special_state.size==UNITSIZE_SMALL)
+ else if(md->vd->size==UNITSIZE_SMALL)
clif->specialeffect(&md->bl,421,AREA);
}
break;
@@ -4125,9 +4125,9 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl) {
{
TBL_PC* tsd = (TBL_PC*)bl;
clif->getareachar_pc(sd, tsd);
- if(tsd->state.size==UNITSIZE_BIG) // tiny/big players [Valaris]
+ if(tsd->vd.size==UNITSIZE_BIG) // tiny/big players [Valaris]
clif->specialeffect_single(bl,423,sd->fd);
- else if(tsd->state.size==UNITSIZE_SMALL)
+ else if(tsd->vd.size==UNITSIZE_SMALL)
clif->specialeffect_single(bl,421,sd->fd);
if( tsd->bg_id && map->list[tsd->bl.m].flag.battleground )
clif->sendbgemblem_single(sd->fd,tsd);
@@ -4144,18 +4144,18 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl) {
TBL_NPC* nd = (TBL_NPC*)bl;
if( nd->chat_id )
clif->dispchat((struct chat_data*)map->id2bl(nd->chat_id),sd->fd);
- if( nd->size == UNITSIZE_BIG )
+ if( nd->vd->size == UNITSIZE_BIG )
clif->specialeffect_single(bl,423,sd->fd);
- else if( nd->size == UNITSIZE_SMALL )
+ else if( nd->vd->size == UNITSIZE_SMALL )
clif->specialeffect_single(bl,421,sd->fd);
}
break;
case BL_MOB:
{
TBL_MOB* md = (TBL_MOB*)bl;
- if(md->special_state.size==UNITSIZE_BIG) // tiny/big mobs [Valaris]
+ if(md->vd->size==UNITSIZE_BIG) // tiny/big mobs [Valaris]
clif->specialeffect_single(bl,423,sd->fd);
- else if(md->special_state.size==UNITSIZE_SMALL)
+ else if(md->vd->size==UNITSIZE_SMALL)
clif->specialeffect_single(bl,421,sd->fd);
#if PACKETVER >= 20120404
if (battle_config.show_monster_hp_bar && !(md->status.mode&MD_BOSS)) {
diff --git a/src/map/mob.c b/src/map/mob.c
index 20cc7e6..8fff570 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -273,7 +273,7 @@ struct mob_data* mob_spawn_dataset(struct spawn_data *data) {
if (data->state.ai)
md->special_state.ai = data->state.ai;
if (data->state.size)
- md->special_state.size = data->state.size;
+ md->vd->size = data->state.size;
if (data->eventname[0] && strlen(data->eventname) >= 4)
memcpy(md->npc_event, data->eventname, 50);
if(md->db->status.mode&MD_LOOTER)
@@ -2208,7 +2208,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
// change experience for different sized monsters [Valaris]
if (battle_config.mob_size_influence) {
- switch( md->special_state.size ) {
+ switch( md->vd->size ) {
case UNITSIZE_SMALL:
per /= 2.;
break;
@@ -2331,9 +2331,9 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
// change drops depending on monsters size [Valaris]
if (battle_config.mob_size_influence)
{
- if (md->special_state.size == UNITSIZE_SMALL && drop_rate >= 2)
+ if (md->vd->size == UNITSIZE_SMALL && drop_rate >= 2)
drop_rate /= 2;
- else if( md->special_state.size == UNITSIZE_BIG)
+ else if( md->vd->size == UNITSIZE_BIG)
drop_rate *= 2;
}
@@ -2879,7 +2879,7 @@ int mob_summonslave(struct mob_data *md2,int *value,int amount,uint16 skill_id)
data.x = md2->bl.x;
data.y = md2->bl.y;
data.num = 1;
- data.state.size = md2->special_state.size;
+ data.state.size = md2->vd->size;
data.state.ai = md2->special_state.ai;
if(mob->db_checkid(value[0]) == 0)
diff --git a/src/map/mob.h b/src/map/mob.h
index c16ff4c..7c11b32 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -152,7 +152,6 @@ struct mob_data {
struct mob_db *db; //For quick data access (saves doing mob_db(md->class_) all the time) [Skotlex]
char name[NAME_LENGTH];
struct {
- unsigned int size : 2; //Small/Big monsters. @see enum size
unsigned int ai : 4; //Special AI for summoned monsters. @see enum ai
unsigned int clone : 1;/* is clone? 1:0 */
} special_state; //Special mob information that does not needs to be zero'ed on mob respawn.
diff --git a/src/map/npc.h b/src/map/npc.h
index e7fc16a..36c7745 100644
--- a/src/map/npc.h
+++ b/src/map/npc.h
@@ -63,8 +63,6 @@ struct npc_data {
uint8 dir;
uint8 area_size;
- unsigned size : 2;
-
struct status_data status;
unsigned short level;
unsigned short stat_point;
diff --git a/src/map/pc.h b/src/map/pc.h
index 62571f1..699e3c5 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -169,7 +169,6 @@ struct map_session_data {
unsigned int trading :1; //[Skotlex] is 1 only after a trade has started.
unsigned int deal_locked :2; //1: Clicked on OK. 2: Clicked on TRADE
unsigned int monster_ignore :1; // for monsters to ignore a character [Valaris] [zzo]
- unsigned int size :2; // for tiny/large types
unsigned int night :1; //Holds whether or not the player currently has the SI_NIGHT effect on. [Skotlex]
unsigned int blockedmove :1;
unsigned int using_fake_npc :1;
diff --git a/src/map/script.c b/src/map/script.c
index 897c0e3..e7a1f9f 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -15447,8 +15447,8 @@ BUILDIN(setnpcdisplay) {
if( newname )
npc->setdisplayname(nd, newname);
- if( size != -1 && size != (int)nd->size )
- nd->size = size;
+ if( size != -1 && size != (int)nd->vd->size )
+ nd->vd->size = size;
else
size = -1;
@@ -16301,12 +16301,12 @@ BUILDIN(setcharsize) {
return false;
}
- if (sd->state.size) {
- sd->state.size = UNITSIZE_NORMAL;
+ if (sd->vd.size) {
+ sd->vd.size = UNITSIZE_NORMAL;
pc->setpos(sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_TELEPORT);
}
- sd->state.size = size;
+ sd->vd.size = size;
if (size == UNITSIZE_SMALL)
clif->specialeffect(&sd->bl, 420, AREA);
else if (size == UNITSIZE_BIG)
@@ -16330,7 +16330,7 @@ BUILDIN(getcharsize) {
if (!sd)
return true;
- script_pushint(st, sd->state.size);
+ script_pushint(st, sd->vd.size);
return true;
}
diff --git a/src/map/status.c b/src/map/status.c
index 89fe4b6..19feaaf 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1935,7 +1935,7 @@ int status_calc_mob_(struct mob_data* md, enum e_status_calc_opt opt) {
if (battle_config.mobs_level_up && md->level > md->db->lv)
flag|=1;
- if (md->special_state.size)
+ if (md->vd->size)
flag|=2;
if (md->guardian_data && md->guardian_data->g
@@ -2017,7 +2017,7 @@ int status_calc_mob_(struct mob_data* md, enum e_status_calc_opt opt) {
if (flag&2 && battle_config.mob_size_influence) {
// change for sized monsters [Valaris]
- if (md->special_state.size==UNITSIZE_SMALL) {
+ if (md->vd->size==UNITSIZE_SMALL) {
mstatus->max_hp>>=1;
mstatus->max_sp>>=1;
if (!mstatus->max_hp) mstatus->max_hp = 1;
@@ -2036,7 +2036,7 @@ int status_calc_mob_(struct mob_data* md, enum e_status_calc_opt opt) {
if (!mstatus->int_) mstatus->int_ = 1;
if (!mstatus->dex) mstatus->dex = 1;
if (!mstatus->luk) mstatus->luk = 1;
- } else if (md->special_state.size==UNITSIZE_BIG) {
+ } else if (md->vd->size==UNITSIZE_BIG) {
mstatus->max_hp<<=1;
mstatus->max_sp<<=1;
mstatus->hp=mstatus->max_hp;
@@ -3146,7 +3146,7 @@ int status_calc_npc_(struct npc_data *nd, enum e_status_calc_opt opt) {
nstatus->def_ele = ELE_NEUTRAL;
nstatus->ele_lv = 1;
nstatus->race = RC_PLAYER;
- nstatus->size = nd->size;
+ nstatus->size = nd->vd->size;
nstatus->rhw.range = 1 + nstatus->size;
nstatus->mode = (MD_CANMOVE|MD_CANATTACK);
nstatus->speed = nd->speed;
diff --git a/src/map/unit.c b/src/map/unit.c
index 3046db9..748be30 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -2295,9 +2295,9 @@ int unit_changeviewsize(struct block_list *bl,short size)
size=(size<0)?-1:(size>0)?1:0;
if(bl->type == BL_PC) {
- ((TBL_PC*)bl)->state.size=size;
+ ((TBL_PC*)bl)->vd.size=size;
} else if(bl->type == BL_MOB) {
- ((TBL_MOB*)bl)->special_state.size=size;
+ ((TBL_MOB*)bl)->vd->size=size;
} else
return 0;
if(size!=0)
diff --git a/src/map/unit.h b/src/map/unit.h
index ed58ef0..43ec7fc 100644
--- a/src/map/unit.h
+++ b/src/map/unit.h
@@ -88,6 +88,7 @@ struct view_data {
cloth_color;
char sex;
unsigned dead_sit : 2;
+ enum unitsize size;
};
struct unit_interface {