Converted some packets to structs (#8351)

This commit is contained in:
Atemo
2024-05-21 21:28:01 +02:00
committed by GitHub
parent d1cf6f4ac7
commit 361530a1b6
13 changed files with 343 additions and 278 deletions

View File

@@ -8118,7 +8118,7 @@ int pc_checkbaselevelup(map_session_data *sd) {
sc_start(&sd->bl, &sd->bl, status.second->type, 100, 10, 600000);
}
}
clif_misceffect(&sd->bl,0);
clif_misceffect( sd->bl, NOTIFYEFFECT_BASE_LEVEL_UP );
npc_script_event(sd, NPCE_BASELVUP); //LORDALFA - LVLUPEVENT
if(sd->status.party_id)
@@ -8173,7 +8173,7 @@ int pc_checkjoblevelup(map_session_data *sd)
clif_updatestatus(*sd,SP_NEXTJOBEXP);
clif_updatestatus(*sd,SP_SKILLPOINT);
status_calc_pc(sd,SCO_FORCE);
clif_misceffect(&sd->bl,1);
clif_misceffect( sd->bl, NOTIFYEFFECT_JOB_LEVEL_UP );
if (pc_checkskill(sd, SG_DEVIL) && ((sd->class_&MAPID_THIRDMASK) == MAPID_STAR_EMPEROR || pc_is_maxjoblv(sd)) )
clif_status_change(&sd->bl, EFST_DEVIL1, 1, 0, 0, 0, 1); //Permanent blind effect from SG_DEVIL.
@@ -8705,7 +8705,7 @@ bool pc_statusup(map_session_data* sd, int type, int increase)
// check conditions
if (type < SP_STR || type > SP_LUK || increase <= 0) {
clif_statusupack(sd, type, 0, 0);
clif_statusupack( *sd, type, false );
return false;
}
@@ -8714,14 +8714,14 @@ bool pc_statusup(map_session_data* sd, int type, int increase)
max_increase = pc_maxparameterincrease(sd, type);
increase = cap_value(increase, 0, max_increase); // cap to the maximum status points available
if (increase <= 0 || current + increase > pc_maxparameter(sd, (enum e_params)(type-SP_STR))) {
clif_statusupack(sd, type, 0, 0);
clif_statusupack( *sd, type, false );
return false;
}
// check status points
needed_points = pc_need_status_point(sd, type, increase);
if (needed_points < 0 || needed_points > sd->status.status_point) { // Sanity check
clif_statusupack(sd, type, 0, 0);
clif_statusupack( *sd, type, false );
return false;
}
@@ -8738,7 +8738,7 @@ bool pc_statusup(map_session_data* sd, int type, int increase)
clif_updatestatus(*sd, SP_STATUSPOINT);
// update stat value
clif_statusupack(sd, type, 1, final_value); // required
clif_statusupack( *sd, type, true, final_value );
if( final_value > 255 )
clif_updatestatus(*sd, static_cast<_sp>( type ) ); // send after the 'ack' to override the truncated value
@@ -8766,7 +8766,7 @@ int pc_statusup2(map_session_data* sd, int type, int val)
if( type < SP_STR || type > SP_LUK )
{
clif_statusupack(sd,type,0,0);
clif_statusupack( *sd, type, false );
return 0;
}
@@ -8782,7 +8782,7 @@ int pc_statusup2(map_session_data* sd, int type, int val)
clif_updatestatus(*sd, static_cast<_sp>( SP_USTR + type-SP_STR ) );
// update stat value
clif_statusupack(sd,type,1,val); // required
clif_statusupack( *sd, type, true, val );
if( val > 255 )
clif_updatestatus(*sd, static_cast<_sp>( type ) ); // send after the 'ack' to override the truncated value
@@ -8865,7 +8865,7 @@ bool pc_traitstatusup(map_session_data* sd, int type, int increase)
// check conditions
if (type < SP_POW || type > SP_CRT || increase <= 0) {
clif_statusupack(sd, type, 0, 0);
clif_statusupack( *sd, type, false );
return false;
}
@@ -8875,7 +8875,7 @@ bool pc_traitstatusup(map_session_data* sd, int type, int increase)
increase = cap_value(increase, 0, max_increase); // cap to the maximum status points available
if (increase <= 0 || current + increase > pc_maxparameter(sd, (enum e_params)(PARAM_POW + type - SP_POW))) {
clif_statusupack(sd, type, 0, 0);
clif_statusupack( *sd, type, false );
return false;
}
@@ -8883,7 +8883,7 @@ bool pc_traitstatusup(map_session_data* sd, int type, int increase)
int needed_points = pc_need_trait_point(sd, type, increase);
if (needed_points < 0 || needed_points > sd->status.trait_point) { // Sanity check
clif_statusupack(sd, type, 0, 0);
clif_statusupack( *sd, type, false );
return false;
}
@@ -8901,7 +8901,7 @@ bool pc_traitstatusup(map_session_data* sd, int type, int increase)
clif_updatestatus(*sd, SP_TRAITPOINT);
// update stat value
clif_statusupack(sd, type, 1, final_value); // required
clif_statusupack( *sd, type, true, final_value );
if (final_value > 255)
clif_updatestatus(*sd, static_cast<_sp>( type ) ); // send after the 'ack' to override the truncated value
@@ -8927,7 +8927,7 @@ int pc_traitstatusup2(map_session_data* sd, int type, int val)
nullpo_ret(sd);
if (type < SP_POW || type > SP_CRT) {
clif_statusupack(sd, type, 0, 0);
clif_statusupack( *sd, type, false );
return 0;
}
@@ -8943,7 +8943,7 @@ int pc_traitstatusup2(map_session_data* sd, int type, int val)
clif_updatestatus(*sd, static_cast<_sp>( SP_UPOW + type - SP_POW ) );
// update stat value
clif_statusupack(sd, type, 1, val); // required
clif_statusupack( *sd, type, true, val );
if (val > 255)
clif_updatestatus(*sd, static_cast<_sp>( type ) ); // send after the 'ack' to override the truncated value
@@ -9742,7 +9742,7 @@ int pc_dead(map_session_data *sd,struct block_list *src)
(unsigned int)md->level < pc_maxbaselv(sd) &&
!md->guardian_data && !md->special_state.ai// Guardians/summons should not level. [Skotlex]
) { // monster level up [Valaris]
clif_misceffect(&md->bl,0);
clif_misceffect( md->bl, NOTIFYEFFECT_BASE_LEVEL_UP );
md->level++;
status_calc_mob(md, SCO_NONE);
status_percent_heal(src,10,0);
@@ -11975,7 +11975,7 @@ bool pc_equipitem(map_session_data *sd,short n,int req_pos,bool equipswitch)
if(pos==EQP_AMMO) {
clif_arrowequip( *sd );
clif_arrow_fail(sd,3);
clif_arrow_fail( *sd, ARROWFAIL_SUCCESS );
}
else
clif_equipitemack( *sd, ITEM_EQUIP_ACK_OK, n, pos );