Moved some remaining constants into src (#2501)

* Moved all npc view constants into src

Source side the constants will use Gravity's naming standard(JT_*)
NPC side still supports the old names without JT_

* Moved all effect constants into src

Added check for effect validation to atcommand effect and all script commands using them
Removed the unused and broken function unit_changeviewsize from unit.c
Replaced a lot of hardcoded effect ids with their respective constants
Cleaned up the effect documentations

* Moved all hat effect constants into src

Added check for effect validation to script command hateffect
This commit is contained in:
Lemongrass3110
2017-10-14 18:13:51 +02:00
committed by GitHub
parent 951ff55573
commit f42c2ff211
25 changed files with 4455 additions and 2313 deletions

View File

@@ -1060,7 +1060,7 @@ static int clif_set_unit_idle(struct block_list* bl, unsigned char* buffer, bool
WBUFW(buf,24) = vd->head_top;
WBUFW(buf,26) = vd->head_mid;
if( bl->type == BL_NPC && vd->class_ == FLAG_CLASS )
if( bl->type == BL_NPC && vd->class_ == JT_GUILD_FLAG )
{ //The hell, why flags work like this?
WBUFW(buf,22) = status_get_emblem_id(bl);
WBUFW(buf,24) = GetWord(status_get_guild_id(bl), 1);
@@ -1371,22 +1371,22 @@ static void clif_weather_check(struct map_session_data *sd)
|| map[m].flag.clouds2)
{
if (map[m].flag.snow)
clif_specialeffect_single(&sd->bl, 162, fd);
clif_specialeffect_single(&sd->bl, EF_SNOW, fd);
if (map[m].flag.clouds)
clif_specialeffect_single(&sd->bl, 233, fd);
clif_specialeffect_single(&sd->bl, EF_CLOUD3, fd);
if (map[m].flag.clouds2)
clif_specialeffect_single(&sd->bl, 516, fd);
clif_specialeffect_single(&sd->bl, EF_CLOUD5, fd);
if (map[m].flag.fog)
clif_specialeffect_single(&sd->bl, 515, fd);
clif_specialeffect_single(&sd->bl, EF_CLOUD4, fd);
if (map[m].flag.fireworks) {
clif_specialeffect_single(&sd->bl, 297, fd);
clif_specialeffect_single(&sd->bl, 299, fd);
clif_specialeffect_single(&sd->bl, 301, fd);
clif_specialeffect_single(&sd->bl, EF_POKJUK, fd);
clif_specialeffect_single(&sd->bl, EF_THROWITEM2, fd);
clif_specialeffect_single(&sd->bl, EF_POKJUK_SOUND, fd);
}
if (map[m].flag.sakura)
clif_specialeffect_single(&sd->bl, 163, fd);
clif_specialeffect_single(&sd->bl, EF_SAKURA, fd);
if (map[m].flag.leaves)
clif_specialeffect_single(&sd->bl, 333, fd);
clif_specialeffect_single(&sd->bl, EF_MAPLE, fd);
}
}
/**
@@ -1415,7 +1415,7 @@ int clif_spawn(struct block_list *bl)
int len;
vd = status_get_viewdata(bl);
if( !vd || vd->class_ == INVISIBLE_CLASS )
if( !vd || vd->class_ == JT_INVISIBLE )
return 0;
/**
@@ -1443,9 +1443,9 @@ int clif_spawn(struct block_list *bl)
if (sd->spiritball > 0)
clif_spiritball(&sd->bl);
if(sd->state.size==SZ_BIG) // tiny/big players [Valaris]
clif_specialeffect(bl,423,AREA);
clif_specialeffect(bl,EF_GIANTBODY2,AREA);
else if(sd->state.size==SZ_MEDIUM)
clif_specialeffect(bl,421,AREA);
clif_specialeffect(bl,EF_BABYBODY2,AREA);
if( sd->bg_id && map[sd->bl.m].flag.battleground )
clif_sendbgemblem_area(sd);
if (sd->spiritcharm_type != CHARM_TYPE_NONE && sd->spiritcharm > 0)
@@ -1460,18 +1460,18 @@ int clif_spawn(struct block_list *bl)
{
TBL_MOB *md = ((TBL_MOB*)bl);
if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris]
clif_specialeffect(&md->bl,423,AREA);
clif_specialeffect(&md->bl,EF_GIANTBODY2,AREA);
else if(md->special_state.size==SZ_MEDIUM)
clif_specialeffect(&md->bl,421,AREA);
clif_specialeffect(&md->bl,EF_BABYBODY2,AREA);
}
break;
case BL_NPC:
{
TBL_NPC *nd = ((TBL_NPC*)bl);
if( nd->size == SZ_BIG )
clif_specialeffect(&nd->bl,423,AREA);
clif_specialeffect(&nd->bl,EF_GIANTBODY2,AREA);
else if( nd->size == SZ_MEDIUM )
clif_specialeffect(&nd->bl,421,AREA);
clif_specialeffect(&nd->bl,EF_BABYBODY2,AREA);
clif_efst_status_change_sub(bl, bl, AREA);
clif_progressbar_npc_area(nd);
}
@@ -1723,9 +1723,9 @@ static void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_
TBL_PC *sd = ((TBL_PC*)bl);
// clif_movepc(sd);
if(sd->state.size==SZ_BIG) // tiny/big players [Valaris]
clif_specialeffect(&sd->bl,423,AREA);
clif_specialeffect(&sd->bl,EF_GIANTBODY2,AREA);
else if(sd->state.size==SZ_MEDIUM)
clif_specialeffect(&sd->bl,421,AREA);
clif_specialeffect(&sd->bl,EF_BABYBODY2,AREA);
if (sd->status.robe)
clif_refreshlook(bl,bl->id,LOOK_ROBE,sd->status.robe,AREA);
}
@@ -1734,9 +1734,9 @@ static void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_
{
TBL_MOB *md = ((TBL_MOB*)bl);
if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris]
clif_specialeffect(&md->bl,423,AREA);
clif_specialeffect(&md->bl,EF_GIANTBODY2,AREA);
else if(md->special_state.size==SZ_MEDIUM)
clif_specialeffect(&md->bl,421,AREA);
clif_specialeffect(&md->bl,EF_BABYBODY2,AREA);
}
break;
case BL_PET:
@@ -1762,7 +1762,7 @@ void clif_move(struct unit_data *ud)
if (!vd )
return;
//This performance check is needed to keep GM-hidden objects from being notified to bots.
else if( vd->class_ == INVISIBLE_CLASS ){
else if( vd->class_ == JT_INVISIBLE ){
// If the player was disguised we still need to update the disguised unit, since the main unit will be updated through clif_walkok
if(disguised(bl)) {
WBUFW(buf,0)=0x86;
@@ -3492,7 +3492,7 @@ void clif_changelook(struct block_list *bl, int type, int val) {
if (!sd)
break;
if ( val == INVISIBLE_CLASS )
if ( val == JT_INVISIBLE )
return;
if (sd->sc.option&OPTION_COSTUME)
@@ -4612,7 +4612,7 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
int len;
vd = status_get_viewdata(bl);
if (!vd || vd->class_ == INVISIBLE_CLASS)
if (!vd || vd->class_ == JT_INVISIBLE)
return;
/**
@@ -4638,9 +4638,9 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
clif_getareachar_pc(sd, tsd);
if(tsd->state.size==SZ_BIG) // tiny/big players [Valaris]
clif_specialeffect_single(bl,423,sd->fd);
clif_specialeffect_single(bl,EF_GIANTBODY2,sd->fd);
else if(tsd->state.size==SZ_MEDIUM)
clif_specialeffect_single(bl,421,sd->fd);
clif_specialeffect_single(bl,EF_BABYBODY2,sd->fd);
if( tsd->bg_id && map[tsd->bl.m].flag.battleground )
clif_sendbgemblem_single(sd->fd,tsd);
if ( tsd->status.robe )
@@ -4659,9 +4659,9 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
if( nd->chat_id )
clif_dispchat((struct chat_data*)map_id2bl(nd->chat_id),sd->fd);
if( nd->size == SZ_BIG )
clif_specialeffect_single(bl,423,sd->fd);
clif_specialeffect_single(bl,EF_GIANTBODY2,sd->fd);
else if( nd->size == SZ_MEDIUM )
clif_specialeffect_single(bl,421,sd->fd);
clif_specialeffect_single(bl,EF_BABYBODY2,sd->fd);
clif_efst_status_change_sub(&sd->bl, bl, SELF);
clif_progressbar_npc(nd, sd);
}
@@ -4670,9 +4670,9 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
{
TBL_MOB* md = (TBL_MOB*)bl;
if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris]
clif_specialeffect_single(bl,423,sd->fd);
clif_specialeffect_single(bl,EF_GIANTBODY2,sd->fd);
else if(md->special_state.size==SZ_MEDIUM)
clif_specialeffect_single(bl,421,sd->fd);
clif_specialeffect_single(bl,EF_BABYBODY2,sd->fd);
#if PACKETVER >= 20120404
if (battle_config.monster_hp_bars_info && !map[bl->m].flag.hidemobhpbar) {
int i;
@@ -5152,7 +5152,7 @@ int clif_outsight(struct block_list *bl,va_list ap)
nullpo_ret(bl);
switch(bl->type){
case BL_PC:
if(sd->vd.class_ != INVISIBLE_CLASS)
if(sd->vd.class_ != JT_INVISIBLE)
clif_clearunit_single(bl->id,CLR_OUTSIGHT,tsd->fd);
if(sd->chatID){
struct chat_data *cd;
@@ -5176,7 +5176,7 @@ int clif_outsight(struct block_list *bl,va_list ap)
clif_clearunit_single(bl->id,CLR_OUTSIGHT,tsd->fd);
break;
default:
if((vd=status_get_viewdata(bl)) && vd->class_ != INVISIBLE_CLASS)
if((vd=status_get_viewdata(bl)) && vd->class_ != JT_INVISIBLE)
clif_clearunit_single(bl->id,CLR_OUTSIGHT,tsd->fd);
break;
}
@@ -5185,7 +5185,7 @@ int clif_outsight(struct block_list *bl,va_list ap)
nullpo_ret(tbl);
if(tbl->type == BL_SKILL) //Trap knocked out of sight
clif_clearchar_skillunit((struct skill_unit *)tbl,sd->fd);
else if(((vd=status_get_viewdata(tbl)) && vd->class_ != INVISIBLE_CLASS) &&
else if(((vd=status_get_viewdata(tbl)) && vd->class_ != JT_INVISIBLE) &&
!(tbl->type == BL_NPC && (((TBL_NPC*)tbl)->sc.option&OPTION_INVISIBLE)))
clif_clearunit_single(tbl->id,CLR_OUTSIGHT,sd->fd);
}