Converted some packets to structs (#8351)
This commit is contained in:
parent
d1cf6f4ac7
commit
361530a1b6
@ -1606,7 +1606,7 @@ ACMD_FUNC(baselevelup)
|
||||
sd->status.base_level += (unsigned int)level;
|
||||
status_calc_pc(sd, SCO_FORCE);
|
||||
status_percent_heal(&sd->bl, 100, 100);
|
||||
clif_misceffect(&sd->bl, 0);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_BASE_LEVEL_UP );
|
||||
for (uint32 j = sd->status.base_level - level; j <= sd->status.base_level; j++) {
|
||||
achievement_update_objective(sd, AG_GOAL_LEVEL, 1, j);
|
||||
achievement_update_objective(sd, AG_GOAL_STATUS, 2, j, sd->status.class_);
|
||||
@ -1679,7 +1679,7 @@ ACMD_FUNC(joblevelup)
|
||||
level = pc_maxjoblv(sd) - sd->status.job_level;
|
||||
sd->status.job_level += (unsigned int)level;
|
||||
sd->status.skill_point += level;
|
||||
clif_misceffect(&sd->bl, 1);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_JOB_LEVEL_UP );
|
||||
for (uint32 i = sd->status.job_level - level; i <= sd->status.job_level; i++)
|
||||
achievement_update_objective(sd, AG_GOAL_LEVEL, 1, i);
|
||||
clif_displaymessage(fd, msg_txt(sd,24)); // Job level raised.
|
||||
@ -2420,7 +2420,7 @@ ACMD_FUNC(refine)
|
||||
clif_delitem( *sd, i, 1, 3 );
|
||||
clif_additem(sd, i, 1, 0);
|
||||
pc_equipitem(sd, i, current_position);
|
||||
clif_misceffect(&sd->bl, 3);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_REFINE_SUCCESS );
|
||||
if( sd->inventory_data[i]->type == IT_WEAPON ){
|
||||
achievement_update_objective(sd, AG_ENCHANT_SUCCESS, 2, sd->inventory_data[i]->weapon_level, sd->inventory.u.items_inventory[i].refine);
|
||||
}
|
||||
@ -2499,7 +2499,7 @@ ACMD_FUNC(grade)
|
||||
clif_delitem( *sd, i, 1, 3 );
|
||||
clif_additem(sd, i, 1, 0);
|
||||
pc_equipitem(sd, i, current_position);
|
||||
clif_misceffect(&sd->bl, 3);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_REFINE_SUCCESS );
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@ -2562,7 +2562,7 @@ ACMD_FUNC(produce)
|
||||
tmp_item.card[2] = GetWord(sd->status.char_id, 0);
|
||||
tmp_item.card[3] = GetWord(sd->status.char_id, 1);
|
||||
clif_produceeffect(sd, 0, item_id);
|
||||
clif_misceffect(&sd->bl, 3);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_REFINE_SUCCESS );
|
||||
|
||||
if ((flag = pc_additem(sd, &tmp_item, 1, LOG_TYPE_COMMAND)))
|
||||
clif_additem(sd, 0, 0, flag);
|
||||
@ -4923,7 +4923,7 @@ ACMD_FUNC(repairall)
|
||||
}
|
||||
|
||||
if (count > 0) {
|
||||
clif_misceffect(&sd->bl, 3);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_REFINE_SUCCESS );
|
||||
clif_equiplist(sd);
|
||||
clif_displaymessage(fd, msg_txt(sd,107)); // All items have been repaired.
|
||||
} else {
|
||||
@ -7717,7 +7717,9 @@ ACMD_FUNC(misceffect)
|
||||
return -1;
|
||||
if (sscanf(message, "%11d", &effect) < 1)
|
||||
return -1;
|
||||
clif_misceffect(&sd->bl,effect);
|
||||
if (effect < NOTIFYEFFECT_BASE_LEVEL_UP || effect > NOTIFYEFFECT_TAEKWON_BASE_LEVEL_UP)
|
||||
return -1;
|
||||
clif_misceffect( sd->bl, static_cast<e_notify_effect>(effect) );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -9810,7 +9810,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
|
||||
if (sd->weapontype1 > W_KATAR && sd->weapontype1 < W_HUUMA)
|
||||
clif_skill_fail( *sd, 0, USESKILL_FAIL_NEED_MORE_BULLET );
|
||||
else
|
||||
clif_arrow_fail(sd,0);
|
||||
clif_arrow_fail( *sd, ARROWFAIL_NO_AMMO );
|
||||
return ATK_NONE;
|
||||
}
|
||||
//Ammo check by Ishizu-chan
|
||||
@ -9818,7 +9818,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
|
||||
switch (sd->status.weapon) {
|
||||
case W_BOW:
|
||||
if (sd->inventory_data[index]->subtype != AMMO_ARROW) {
|
||||
clif_arrow_fail(sd,0);
|
||||
clif_arrow_fail( *sd, ARROWFAIL_NO_AMMO );
|
||||
return ATK_NONE;
|
||||
}
|
||||
break;
|
||||
|
@ -105,7 +105,7 @@ int chat_createpcchat(map_session_data* sd, const char* title, const char* pass,
|
||||
cd->usersd[0] = sd;
|
||||
pc_setchatid(sd,cd->bl.id);
|
||||
pc_stop_attack(sd);
|
||||
clif_createchat(sd,0);
|
||||
clif_createchat( *sd, CREATEROOM_SUCCESS );
|
||||
clif_dispchat(cd,0);
|
||||
|
||||
if (status_isdead(&sd->bl))
|
||||
@ -113,7 +113,7 @@ int chat_createpcchat(map_session_data* sd, const char* title, const char* pass,
|
||||
else
|
||||
achievement_update_objective(sd, AG_CHATTING_CREATE, 1, 1);
|
||||
} else
|
||||
clif_createchat(sd,1);
|
||||
clif_createchat( *sd, CREATEROOM_LIMIT_EXCEEDED );
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -134,31 +134,31 @@ int chat_joinchat(map_session_data* sd, int chatid, const char* pass)
|
||||
cd = (struct chat_data*)map_id2bl(chatid);
|
||||
|
||||
if( cd == nullptr || cd->bl.type != BL_CHAT || cd->bl.m != sd->bl.m || sd->state.vending || sd->state.buyingstore || sd->chatID || ((cd->owner->type == BL_NPC) ? cd->users+1 : cd->users) >= cd->limit ) {
|
||||
clif_joinchatfail(sd,0);
|
||||
clif_joinchatfail( *sd, ENTERROOM_FULL );
|
||||
return 0;
|
||||
}
|
||||
|
||||
if( !cd->pub && strncmp(pass, cd->pass, sizeof(cd->pass)) != 0 && !pc_has_permission(sd, PC_PERM_JOIN_ALL_CHAT) ) {
|
||||
clif_joinchatfail(sd,1);
|
||||
clif_joinchatfail( *sd, ENTERROOM_WRONG_PASSWORD );
|
||||
return 0;
|
||||
}
|
||||
|
||||
if( sd->status.base_level < cd->minLvl || sd->status.base_level > cd->maxLvl ) {
|
||||
if(sd->status.base_level < cd->minLvl)
|
||||
clif_joinchatfail(sd,5);
|
||||
clif_joinchatfail( *sd, ENTERROOM_TOO_LOW_LEVEL );
|
||||
else
|
||||
clif_joinchatfail(sd,6);
|
||||
clif_joinchatfail( *sd, ENTERROOM_TOO_HIGH_LEVEL );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if( sd->status.zeny < cd->zeny ) {
|
||||
clif_joinchatfail(sd,4);
|
||||
clif_joinchatfail( *sd, ENTERROOM_NO_ZENY );
|
||||
return 0;
|
||||
}
|
||||
|
||||
if( cd->owner->type != BL_NPC && idb_exists(cd->kick_list,sd->status.char_id) ) {
|
||||
clif_joinchatfail(sd,2);//You have been kicked out of the room.
|
||||
clif_joinchatfail( *sd, ENTERROOM_KICKED );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
277
src/map/clif.cpp
277
src/map/clif.cpp
@ -4194,8 +4194,8 @@ void clif_arrowequip( map_session_data& sd ) {
|
||||
}
|
||||
|
||||
|
||||
/// Ammunition action message (ZC_ACTION_FAILURE).
|
||||
/// 013b <type>.W
|
||||
/// Ammunition action message.
|
||||
/// 013b <type>.W (ZC_ACTION_FAILURE)
|
||||
/// type:
|
||||
/// 0 = MsgStringTable[242]="Please equip the proper ammunition first."
|
||||
/// 1 = MsgStringTable[243]="You can't Attack or use Skills because your Weight Limit has been exceeded."
|
||||
@ -4203,16 +4203,13 @@ void clif_arrowequip( map_session_data& sd ) {
|
||||
/// 3 = assassin, baby_assassin, assassin_cross => MsgStringTable[1040]="You have equipped throwing daggers."
|
||||
/// gunslinger => MsgStringTable[1175]="Bullets have been equipped."
|
||||
/// NOT ninja => MsgStringTable[245]="Ammunition has been equipped."
|
||||
void clif_arrow_fail(map_session_data *sd,int type) {
|
||||
int fd;
|
||||
void clif_arrow_fail( map_session_data& sd, e_action_failure type ) {
|
||||
PACKET_ZC_ACTION_FAILURE packet{};
|
||||
|
||||
nullpo_retv(sd);
|
||||
packet.packetType = HEADER_ZC_ACTION_FAILURE;
|
||||
packet.type = static_cast<decltype(packet.type)>(type);
|
||||
|
||||
fd=sd->fd;
|
||||
WFIFOHEAD(fd, packet_len(0x013b));
|
||||
WFIFOW(fd,0) = 0x013b;
|
||||
WFIFOW(fd,2) = type;
|
||||
WFIFOSET(fd, packet_len(0x013b));
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
@ -4263,25 +4260,22 @@ void clif_arrow_create_list( map_session_data *sd ){
|
||||
}
|
||||
|
||||
|
||||
/// Notifies the client, about the result of an status change request (ZC_STATUS_CHANGE_ACK).
|
||||
/// 00bc <status id>.W <result>.B <value>.B
|
||||
/// Notifies the client, about the result of an status change request.
|
||||
/// 00bc <status id>.W <result>.B <value>.B (ZC_STATUS_CHANGE_ACK)
|
||||
/// status id:
|
||||
/// SP_STR ~ SP_LUK and SP_POW ~ SP_CRT
|
||||
/// result:
|
||||
/// 0 = failure
|
||||
/// 1 = success
|
||||
void clif_statusupack(map_session_data *sd,int type,int ok,int val) {
|
||||
int fd;
|
||||
void clif_statusupack( map_session_data& sd, int32 type, bool success, int32 val ) {
|
||||
PACKET_ZC_STATUS_CHANGE_ACK packet{};
|
||||
|
||||
nullpo_retv(sd);
|
||||
packet.packetType = HEADER_ZC_STATUS_CHANGE_ACK;
|
||||
packet.sp = static_cast<decltype(packet.sp)>(type);
|
||||
packet.ok = success;
|
||||
packet.value = cap_value(val, 0, UINT8_MAX);
|
||||
|
||||
fd=sd->fd;
|
||||
WFIFOHEAD(fd, packet_len(0xbc));
|
||||
WFIFOW(fd,0) = 0xbc;
|
||||
WFIFOW(fd,2) = type;
|
||||
WFIFOB(fd,4) = ok;
|
||||
WFIFOB(fd,5) = cap_value(val, 0, UINT8_MAX);
|
||||
WFIFOSET(fd, packet_len(0xbc));
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
@ -4349,8 +4343,8 @@ void clif_unequipitemack(map_session_data *sd,int n,int pos,int ok)
|
||||
}
|
||||
|
||||
|
||||
/// Notifies clients in the area about an special/visual effect (ZC_NOTIFY_EFFECT).
|
||||
/// 019b <id>.L <effect id>.L
|
||||
/// Notifies clients in the area about an special/visual effect.
|
||||
/// 019b <id>.L <effect id>.L (ZC_NOTIFY_EFFECT)
|
||||
/// effect id:
|
||||
/// 0 = base level up
|
||||
/// 1 = job level up
|
||||
@ -4362,17 +4356,14 @@ void clif_unequipitemack(map_session_data *sd,int n,int pos,int ok)
|
||||
/// 7 = base level up (super novice)
|
||||
/// 8 = job level up (super novice)
|
||||
/// 9 = base level up (taekwon)
|
||||
void clif_misceffect(struct block_list* bl,int type)
|
||||
{
|
||||
unsigned char buf[32];
|
||||
void clif_misceffect( block_list& bl, e_notify_effect type ){
|
||||
PACKET_ZC_NOTIFY_EFFECT packet{};
|
||||
|
||||
nullpo_retv(bl);
|
||||
packet.packetType = HEADER_ZC_NOTIFY_EFFECT;
|
||||
packet.aid = bl.id;
|
||||
packet.effectId = static_cast<decltype(packet.effectId)>(type);
|
||||
|
||||
WBUFW(buf,0) = 0x19b;
|
||||
WBUFL(buf,2) = bl->id;
|
||||
WBUFL(buf,6) = type;
|
||||
|
||||
clif_send(buf,packet_len(0x19b),bl,AREA);
|
||||
clif_send( &packet, sizeof( packet ), &bl, AREA );
|
||||
}
|
||||
|
||||
|
||||
@ -4433,30 +4424,33 @@ void clif_changeoption_target( struct block_list* bl, struct block_list* target
|
||||
}
|
||||
|
||||
|
||||
/// Displays status change effects on NPCs/monsters (ZC_NPC_SHOWEFST_UPDATE).
|
||||
/// 028a <id>.L <effect state>.L <level>.L <showEFST>.L
|
||||
void clif_changeoption2(struct block_list* bl)
|
||||
{
|
||||
unsigned char buf[20];
|
||||
status_change *sc;
|
||||
/// Displays status change effects on NPCs/monsters.
|
||||
/// 028a <id>.L <effect state>.L <level>.L <showEFST>.L (ZC_NPC_SHOWEFST_UPDATE)
|
||||
void clif_changeoption2( block_list& bl ){
|
||||
status_change *sc = status_get_sc(&bl);
|
||||
if (!sc)
|
||||
return; //How can an option change if there's no sc?
|
||||
|
||||
sc = status_get_sc(bl);
|
||||
if (!sc) return; //How can an option change if there's no sc?
|
||||
PACKET_ZC_NPC_SHOWEFST_UPDATE packet{};
|
||||
|
||||
WBUFW(buf,0) = 0x28a;
|
||||
WBUFL(buf,2) = bl->id;
|
||||
WBUFL(buf,6) = sc->option;
|
||||
WBUFL(buf,10) = clif_setlevel(bl);
|
||||
WBUFL(buf,14) = sc->opt3;
|
||||
if(disguised(bl)) {
|
||||
clif_send(buf,packet_len(0x28a),bl,AREA_WOS);
|
||||
WBUFL(buf,2) = disguised_bl_id( bl->id );
|
||||
clif_send(buf,packet_len(0x28a),bl,SELF);
|
||||
WBUFL(buf,2) = bl->id;
|
||||
WBUFL(buf,6) = OPTION_INVISIBLE;
|
||||
clif_send(buf,packet_len(0x28a),bl,SELF);
|
||||
} else
|
||||
clif_send(buf,packet_len(0x28a),bl,AREA);
|
||||
packet.packetType = HEADER_ZC_NPC_SHOWEFST_UPDATE;
|
||||
packet.gid = bl.id;
|
||||
packet.effectState = sc->option;
|
||||
packet.level = clif_setlevel(&bl);
|
||||
packet.showEFST = sc->opt3;
|
||||
|
||||
if (disguised(&bl)) {
|
||||
clif_send( &packet, sizeof( packet ), &bl, AREA_WOS );
|
||||
|
||||
packet.gid = disguised_bl_id( bl.id );
|
||||
clif_send( &packet, sizeof( packet ), &bl, SELF );
|
||||
|
||||
packet.gid = bl.id;
|
||||
packet.effectState = OPTION_INVISIBLE;
|
||||
clif_send( &packet, sizeof( packet ), &bl, SELF );
|
||||
} else {
|
||||
clif_send( &packet, sizeof( packet ), &bl, AREA );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -4495,23 +4489,19 @@ void clif_useitemack( map_session_data *sd, int index, int amount, bool ok ){
|
||||
}
|
||||
|
||||
|
||||
/// Inform client whether chatroom creation was successful or not (ZC_ACK_CREATE_CHATROOM).
|
||||
/// 00d6 <flag>.B
|
||||
/// Inform client whether chatroom creation was successful or not.
|
||||
/// 00d6 <flag>.B (ZC_ACK_CREATE_CHATROOM)
|
||||
/// flag:
|
||||
/// 0 = Room has been successfully created (opens chat room)
|
||||
/// 1 = Room limit exceeded
|
||||
/// 2 = Same room already exists
|
||||
void clif_createchat(map_session_data* sd, int flag)
|
||||
{
|
||||
int fd;
|
||||
void clif_createchat( map_session_data& sd, e_create_chatroom flag ){
|
||||
PACKET_ZC_ACK_CREATE_CHATROOM packet{};
|
||||
|
||||
nullpo_retv(sd);
|
||||
packet.packetType = HEADER_ZC_ACK_CREATE_CHATROOM;
|
||||
packet.flag = static_cast<decltype(packet.flag)>(flag);
|
||||
|
||||
fd = sd->fd;
|
||||
WFIFOHEAD(fd,packet_len(0xd6));
|
||||
WFIFOW(fd,0) = 0xd6;
|
||||
WFIFOB(fd,2) = flag;
|
||||
WFIFOSET(fd,packet_len(0xd6));
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
@ -4605,8 +4595,8 @@ void clif_clearchat(struct chat_data *cd,int fd)
|
||||
}
|
||||
|
||||
|
||||
/// Displays messages regarding join chat failures (ZC_REFUSE_ENTER_ROOM).
|
||||
/// 00da <result>.B
|
||||
/// Displays messages regarding join chat failures.
|
||||
/// 00da <result>.B (ZC_REFUSE_ENTER_ROOM)
|
||||
/// result:
|
||||
/// 0 = room full
|
||||
/// 1 = wrong password
|
||||
@ -4616,18 +4606,13 @@ void clif_clearchat(struct chat_data *cd,int fd)
|
||||
/// 5 = too low level
|
||||
/// 6 = too high level
|
||||
/// 7 = unsuitable job class
|
||||
void clif_joinchatfail(map_session_data *sd,int flag)
|
||||
{
|
||||
int fd;
|
||||
void clif_joinchatfail( map_session_data& sd, e_refuse_enter_room result ){
|
||||
PACKET_ZC_REFUSE_ENTER_ROOM packet{};
|
||||
|
||||
nullpo_retv(sd);
|
||||
packet.packetType = HEADER_ZC_REFUSE_ENTER_ROOM;
|
||||
packet.result = static_cast<decltype(packet.result)>(result);
|
||||
|
||||
fd = sd->fd;
|
||||
|
||||
WFIFOHEAD(fd,packet_len(0xda));
|
||||
WFIFOW(fd,0) = 0xda;
|
||||
WFIFOB(fd,2) = flag;
|
||||
WFIFOSET(fd,packet_len(0xda));
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
@ -4855,84 +4840,70 @@ void clif_tradeitemok(map_session_data& sd, int index, e_exitem_add_result resul
|
||||
}
|
||||
|
||||
|
||||
/// Notifies the client about finishing one side of the current trade (ZC_CONCLUDE_EXCHANGE_ITEM).
|
||||
/// 00ec <who>.B
|
||||
/// Notifies the client about finishing one side of the current trade.
|
||||
/// 00ec <who>.B (ZC_CONCLUDE_EXCHANGE_ITEM)
|
||||
/// who:
|
||||
/// 0 = self
|
||||
/// 1 = other player
|
||||
void clif_tradedeal_lock(map_session_data* sd, int fail)
|
||||
{
|
||||
int fd;
|
||||
nullpo_retv(sd);
|
||||
void clif_tradedeal_lock( map_session_data& sd, bool who ){
|
||||
PACKET_ZC_CONCLUDE_EXCHANGE_ITEM packet{};
|
||||
|
||||
fd = sd->fd;
|
||||
WFIFOHEAD(fd,packet_len(0xec));
|
||||
WFIFOW(fd,0) = 0xec;
|
||||
WFIFOB(fd,2) = fail;
|
||||
WFIFOSET(fd,packet_len(0xec));
|
||||
packet.packetType = HEADER_ZC_CONCLUDE_EXCHANGE_ITEM;
|
||||
packet.who = who;
|
||||
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
/// Notifies the client about the trade being canceled (ZC_CANCEL_EXCHANGE_ITEM).
|
||||
/// 00ee
|
||||
void clif_tradecancelled(map_session_data* sd)
|
||||
{
|
||||
int fd;
|
||||
nullpo_retv(sd);
|
||||
/// Notifies the client about the trade being canceled.
|
||||
/// 00ee (ZC_CANCEL_EXCHANGE_ITEM)
|
||||
void clif_tradecancelled( map_session_data& sd ){
|
||||
PACKET_ZC_CANCEL_EXCHANGE_ITEM packet{};
|
||||
|
||||
fd = sd->fd;
|
||||
WFIFOHEAD(fd,packet_len(0xee));
|
||||
WFIFOW(fd,0) = 0xee;
|
||||
WFIFOSET(fd,packet_len(0xee));
|
||||
packet.packetType = HEADER_ZC_CANCEL_EXCHANGE_ITEM;
|
||||
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
/// Result of a trade (ZC_EXEC_EXCHANGE_ITEM).
|
||||
/// 00f0 <result>.B
|
||||
/// Result of a trade.
|
||||
/// 00f0 <result>.B (ZC_EXEC_EXCHANGE_ITEM)
|
||||
/// result:
|
||||
/// 0 = success
|
||||
/// 1 = failure
|
||||
void clif_tradecompleted(map_session_data* sd, int fail)
|
||||
{
|
||||
int fd;
|
||||
nullpo_retv(sd);
|
||||
void clif_tradecompleted( map_session_data& sd ){
|
||||
PACKET_ZC_EXEC_EXCHANGE_ITEM packet{};
|
||||
|
||||
fd = sd->fd;
|
||||
WFIFOHEAD(fd,packet_len(0xf0));
|
||||
WFIFOW(fd,0) = 0xf0;
|
||||
WFIFOB(fd,2) = fail;
|
||||
WFIFOSET(fd,packet_len(0xf0));
|
||||
packet.packetType = HEADER_ZC_EXEC_EXCHANGE_ITEM;
|
||||
packet.result = 0;
|
||||
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
/// Resets the trade window on the send side (ZC_EXCHANGEITEM_UNDO).
|
||||
/// 00f1
|
||||
/// Resets the trade window on the send side.
|
||||
/// 00f1 (ZC_EXCHANGEITEM_UNDO)
|
||||
/// NOTE: Unknown purpose. Items are not removed until the window is
|
||||
/// refreshed (ex. by putting another item in there).
|
||||
void clif_tradeundo(map_session_data* sd)
|
||||
{
|
||||
int fd = sd->fd;
|
||||
void clif_tradeundo( map_session_data& sd ){
|
||||
PACKET_ZC_EXCHANGEITEM_UNDO packet{};
|
||||
|
||||
WFIFOHEAD(fd,packet_len(0xf1));
|
||||
WFIFOW(fd,0) = 0xf1;
|
||||
WFIFOSET(fd,packet_len(0xf1));
|
||||
packet.packetType = HEADER_ZC_EXCHANGEITEM_UNDO;
|
||||
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
/// Updates storage total amount (ZC_NOTIFY_STOREITEM_COUNTINFO).
|
||||
/// 00f2 <current count>.W <max count>.W
|
||||
void clif_updatestorageamount(map_session_data* sd, int amount, int max_amount)
|
||||
{
|
||||
int fd;
|
||||
/// Updates storage total amount.
|
||||
/// 00f2 <current count>.W <max count>.W (ZC_NOTIFY_STOREITEM_COUNTINFO)
|
||||
void clif_updatestorageamount( map_session_data& sd, uint16 amount, uint16 max_amount ){
|
||||
PACKET_ZC_NOTIFY_STOREITEM_COUNTINFO packet{};
|
||||
|
||||
nullpo_retv(sd);
|
||||
packet.packetType = HEADER_ZC_NOTIFY_STOREITEM_COUNTINFO;
|
||||
packet.amount = amount;
|
||||
packet.max_amount = max_amount;
|
||||
|
||||
fd=sd->fd;
|
||||
WFIFOHEAD(fd,packet_len(0xf2));
|
||||
WFIFOW(fd,0) = 0xf2;
|
||||
WFIFOW(fd,2) = amount;
|
||||
WFIFOW(fd,4) = max_amount;
|
||||
WFIFOSET(fd,packet_len(0xf2));
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
@ -4974,35 +4945,27 @@ void clif_storageitemadded( map_session_data* sd, struct item* i, int index, int
|
||||
}
|
||||
|
||||
|
||||
/// Notifies the client of an item being deleted from the storage (ZC_DELETE_ITEM_FROM_STORE).
|
||||
/// 00f6 <index>.W <amount>.L
|
||||
void clif_storageitemremoved(map_session_data* sd, int index, int amount)
|
||||
{
|
||||
int fd;
|
||||
/// Notifies the client of an item being deleted from the storage.
|
||||
/// 00f6 <index>.W <amount>.L (ZC_DELETE_ITEM_FROM_STORE)
|
||||
void clif_storageitemremoved( map_session_data& sd, uint16 index, uint32 amount ){
|
||||
PACKET_ZC_DELETE_ITEM_FROM_STORE packet{};
|
||||
|
||||
nullpo_retv(sd);
|
||||
packet.packetType = HEADER_ZC_DELETE_ITEM_FROM_STORE;
|
||||
packet.index = client_storage_index(index);
|
||||
packet.amount = amount;
|
||||
|
||||
fd=sd->fd;
|
||||
WFIFOHEAD(fd,packet_len(0xf6));
|
||||
WFIFOW(fd,0)=0xf6; // Storage item removed
|
||||
WFIFOW(fd,2)=client_storage_index(index);
|
||||
WFIFOL(fd,4)=amount;
|
||||
WFIFOSET(fd,packet_len(0xf6));
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
/// Closes storage (ZC_CLOSE_STORE).
|
||||
/// 00f8
|
||||
void clif_storageclose(map_session_data* sd)
|
||||
{
|
||||
int fd;
|
||||
/// Closes storage.
|
||||
/// 00f8 (ZC_CLOSE_STORE)
|
||||
void clif_storageclose( map_session_data& sd ){
|
||||
PACKET_ZC_CLOSE_STORE packet{};
|
||||
|
||||
nullpo_retv(sd);
|
||||
packet.packetType = HEADER_ZC_CLOSE_STORE;
|
||||
|
||||
fd=sd->fd;
|
||||
WFIFOHEAD(fd,packet_len(0xf8));
|
||||
WFIFOW(fd,0) = 0xf8; // Storage Closed
|
||||
WFIFOSET(fd,packet_len(0xf8));
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
@ -9895,7 +9858,7 @@ void clif_refresh_storagewindow(map_session_data *sd) {
|
||||
if( sd->state.storage_flag == 1 ) {
|
||||
storage_sortitem(sd->storage.u.items_storage, ARRAYLENGTH(sd->storage.u.items_storage));
|
||||
clif_storagelist(sd, sd->storage.u.items_storage, ARRAYLENGTH(sd->storage.u.items_storage), storage_getName(0));
|
||||
clif_updatestorageamount(sd, sd->storage.amount, sd->storage.max_amount);
|
||||
clif_updatestorageamount(*sd, sd->storage.amount, sd->storage.max_amount);
|
||||
}
|
||||
// Notify the client that the gstorage is open otherwise it will
|
||||
// remain locked forever and nobody will be able to access it
|
||||
@ -9907,14 +9870,14 @@ void clif_refresh_storagewindow(map_session_data *sd) {
|
||||
else {
|
||||
storage_sortitem(gstor->u.items_guild, ARRAYLENGTH(gstor->u.items_guild));
|
||||
clif_storagelist(sd, gstor->u.items_guild, ARRAYLENGTH(gstor->u.items_guild), "Guild Storage");
|
||||
clif_updatestorageamount(sd, gstor->amount, gstor->max_amount);
|
||||
clif_updatestorageamount(*sd, gstor->amount, gstor->max_amount);
|
||||
}
|
||||
}
|
||||
// Notify the client that the premium storage is open
|
||||
if (sd->state.storage_flag == 3) {
|
||||
storage_sortitem(sd->premiumStorage.u.items_storage, ARRAYLENGTH(sd->premiumStorage.u.items_storage));
|
||||
clif_storagelist(sd, sd->premiumStorage.u.items_storage, ARRAYLENGTH(sd->premiumStorage.u.items_storage), storage_getName(sd->premiumStorage.stor_id));
|
||||
clif_updatestorageamount(sd, sd->premiumStorage.amount, sd->premiumStorage.max_amount);
|
||||
clif_updatestorageamount(*sd, sd->premiumStorage.amount, sd->premiumStorage.max_amount);
|
||||
}
|
||||
}
|
||||
|
||||
@ -22514,7 +22477,7 @@ void clif_parse_refineui_refine( int fd, map_session_data* sd ){
|
||||
// Success
|
||||
item->refine = cap_value( item->refine + 1, 0, MAX_REFINE );
|
||||
log_pick_pc( sd, LOG_TYPE_OTHER, 1, item );
|
||||
clif_misceffect( &sd->bl, 3 );
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_REFINE_SUCCESS );
|
||||
clif_refine( *sd, index, ITEMREFINING_SUCCESS );
|
||||
if (info->broadcast_success) {
|
||||
clif_broadcast_refine_result(*sd, item->nameid, item->refine, true);
|
||||
@ -22548,7 +22511,7 @@ void clif_parse_refineui_refine( int fd, map_session_data* sd ){
|
||||
clif_refineui_info( sd, index );
|
||||
}
|
||||
|
||||
clif_misceffect( &sd->bl, 2 );
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_REFINE_FAILURE );
|
||||
achievement_update_objective( sd, AG_ENCHANT_FAIL, 1, 1 );
|
||||
}
|
||||
#endif
|
||||
|
@ -638,6 +638,43 @@ enum e_ack_itemrefining : uint8 {
|
||||
ITEMREFINING_FAILURE2 = 3
|
||||
};
|
||||
|
||||
enum e_refuse_enter_room : uint8 {
|
||||
ENTERROOM_FULL = 0,
|
||||
ENTERROOM_WRONG_PASSWORD = 1,
|
||||
ENTERROOM_KICKED = 2,
|
||||
ENTERROOM_SUCCESS = 3,
|
||||
ENTERROOM_NO_ZENY = 4,
|
||||
ENTERROOM_TOO_LOW_LEVEL = 5,
|
||||
ENTERROOM_TOO_HIGH_LEVEL = 6,
|
||||
ENTERROOM_UNSUITABLE_JOB = 7
|
||||
};
|
||||
|
||||
enum e_create_chatroom : uint8 {
|
||||
CREATEROOM_SUCCESS = 0,
|
||||
CREATEROOM_LIMIT_EXCEEDED = 1,
|
||||
CREATEROOM_ALREADY_EXISTS = 2
|
||||
};
|
||||
|
||||
enum e_action_failure : uint8 {
|
||||
ARROWFAIL_NO_AMMO = 0,
|
||||
ARROWFAIL_WEIGHT_LIMIT = 1,
|
||||
ARROWFAIL_WEIGHT_LIMIT2 = 2,
|
||||
ARROWFAIL_SUCCESS = 3
|
||||
};
|
||||
|
||||
enum e_notify_effect : uint8 {
|
||||
NOTIFYEFFECT_BASE_LEVEL_UP = 0,
|
||||
NOTIFYEFFECT_JOB_LEVEL_UP = 1,
|
||||
NOTIFYEFFECT_REFINE_FAILURE = 2,
|
||||
NOTIFYEFFECT_REFINE_SUCCESS = 3,
|
||||
NOTIFYEFFECT_GAME_OVER = 4,
|
||||
NOTIFYEFFECT_PHARMACY_SUCCESS = 5,
|
||||
NOTIFYEFFECT_PHARMACY_FAILURE = 6,
|
||||
NOTIFYEFFECT_SUPER_NOVICE_BASE_LEVEL_UP = 7,
|
||||
NOTIFYEFFECT_SUPER_NOVICE_JOB_LEVEL_UP = 8,
|
||||
NOTIFYEFFECT_TAEKWON_BASE_LEVEL_UP = 9,
|
||||
};
|
||||
|
||||
int clif_setip(const char* ip);
|
||||
void clif_setbindip(const char* ip);
|
||||
void clif_setport(uint16 port);
|
||||
@ -694,20 +731,20 @@ void clif_changelook(struct block_list *bl,int type,int val); // area
|
||||
void clif_changetraplook(struct block_list *bl,int val); // area
|
||||
void clif_refreshlook(struct block_list *bl,int id,int type,int val,enum send_target target); //area specified in 'target'
|
||||
void clif_arrowequip( map_session_data& sd );
|
||||
void clif_arrow_fail(map_session_data *sd,int type); //self
|
||||
void clif_arrow_fail( map_session_data& sd, e_action_failure type );
|
||||
void clif_arrow_create_list(map_session_data *sd); //self
|
||||
void clif_statusupack(map_session_data *sd,int type,int ok,int val); // self
|
||||
void clif_statusupack( map_session_data& sd, int32 type, bool success, int32 val = 0 );
|
||||
void clif_equipitemack( map_session_data& sd, uint8 flag, int index, int pos = 0 ); // self
|
||||
void clif_unequipitemack(map_session_data *sd,int n,int pos,int ok); // self
|
||||
void clif_misceffect(struct block_list* bl,int type); // area
|
||||
void clif_misceffect( block_list& bl, e_notify_effect type );
|
||||
void clif_changeoption_target(struct block_list* bl, struct block_list* target);
|
||||
#define clif_changeoption(bl) clif_changeoption_target(bl, nullptr) // area
|
||||
void clif_changeoption2(struct block_list* bl); // area
|
||||
void clif_changeoption2( block_list& bl );
|
||||
void clif_useitemack(map_session_data *sd,int index,int amount,bool ok); // self
|
||||
void clif_GlobalMessage(struct block_list* bl, const char* message,enum send_target target);
|
||||
void clif_createchat(map_session_data* sd, int flag); // self
|
||||
void clif_createchat( map_session_data& sd, e_create_chatroom flag );
|
||||
void clif_dispchat(struct chat_data* cd, int fd); // area or fd
|
||||
void clif_joinchatfail(map_session_data *sd,int flag); // self
|
||||
void clif_joinchatfail( map_session_data& sd, e_refuse_enter_room result );
|
||||
void clif_joinchatok(map_session_data *sd,struct chat_data* cd); // self
|
||||
void clif_addchat(struct chat_data* cd,map_session_data *sd); // chat
|
||||
void clif_changechatowner(struct chat_data* cd, map_session_data* sd); // chat
|
||||
@ -733,17 +770,17 @@ void clif_traderequest(map_session_data* sd, const char* name);
|
||||
void clif_tradestart(map_session_data* sd, uint8 type);
|
||||
void clif_tradeadditem(map_session_data* sd, map_session_data* tsd, int index, int amount);
|
||||
void clif_tradeitemok(map_session_data& sd, int index, e_exitem_add_result result);
|
||||
void clif_tradedeal_lock(map_session_data* sd, int fail);
|
||||
void clif_tradecancelled(map_session_data* sd);
|
||||
void clif_tradecompleted(map_session_data* sd, int fail);
|
||||
void clif_tradeundo(map_session_data* sd);
|
||||
void clif_tradedeal_lock( map_session_data& sd, bool who );
|
||||
void clif_tradecancelled( map_session_data& sd );
|
||||
void clif_tradecompleted( map_session_data& sd );
|
||||
void clif_tradeundo( map_session_data& sd );
|
||||
|
||||
// storage
|
||||
void clif_storagelist(map_session_data* sd, struct item* items, int items_length, const char *storename);
|
||||
void clif_updatestorageamount(map_session_data* sd, int amount, int max_amount);
|
||||
void clif_updatestorageamount( map_session_data& sd, uint16 amount, uint16 max_amount );
|
||||
void clif_storageitemadded(map_session_data* sd, struct item* i, int index, int amount);
|
||||
void clif_storageitemremoved(map_session_data* sd, int index, int amount);
|
||||
void clif_storageclose(map_session_data* sd);
|
||||
void clif_storageitemremoved( map_session_data& sd, uint16 index, uint32 amount );
|
||||
void clif_storageclose( map_session_data& sd );
|
||||
|
||||
int clif_insight(struct block_list *bl,va_list ap); // map_forallinmovearea callback
|
||||
int clif_outsight(struct block_list *bl,va_list ap); // map_forallinmovearea callback
|
||||
|
@ -72,7 +72,6 @@
|
||||
parseable_packet(0x00b9,6,clif_parse_NpcNextClicked,2);
|
||||
packet(0x00ba,2);
|
||||
parseable_packet(0x00bb,5,clif_parse_StatusUp,2,4);
|
||||
packet(0x00bc,6);
|
||||
parseable_packet(0x00bf,3,clif_parse_Emotion,2);
|
||||
packet(0x00c0,7);
|
||||
parseable_packet(0x00c1,2,clif_parse_HowManyConnections,0);
|
||||
@ -94,11 +93,9 @@
|
||||
parseable_packet(0x00d3,2,clif_parse_PMIgnoreList,0);
|
||||
packet(0x00d4,-1);
|
||||
parseable_packet(0x00d5,-1,clif_parse_CreateChatRoom,2,4,6,7,15);
|
||||
packet(0x00d6,3);
|
||||
packet(0x00d7,-1);
|
||||
packet(0x00d8,6);
|
||||
parseable_packet(0x00d9,14,clif_parse_ChatAddMember,2,6);
|
||||
packet(0x00da,3);
|
||||
packet(0x00db,-1);
|
||||
packet(0x00dc,28);
|
||||
packet(0x00dd,29);
|
||||
@ -115,18 +112,11 @@
|
||||
parseable_packet(0x00e8,8,clif_parse_TradeAddItem,2,4);
|
||||
packet(0x00ea,5);
|
||||
parseable_packet(0x00eb,2,clif_parse_TradeOk,0);
|
||||
packet(0x00ec,3);
|
||||
parseable_packet(0x00ed,2,clif_parse_TradeCancel,0);
|
||||
packet(0x00ee,2);
|
||||
parseable_packet(0x00ef,2,clif_parse_TradeCommit,0);
|
||||
packet(0x00f0,3);
|
||||
packet(0x00f1,2);
|
||||
packet(0x00f2,6);
|
||||
parseable_packet(0x00f3,8,clif_parse_MoveToKafra,2,4);
|
||||
parseable_packet(0x00f5,8,clif_parse_MoveFromKafra,2,4);
|
||||
packet(0x00f6,8);
|
||||
parseable_packet(0x00f7,2,clif_parse_CloseKafra,0);
|
||||
packet(0x00f8,2);
|
||||
parseable_packet(0x00f9,26,clif_parse_CreateParty,2);
|
||||
packet(0x00fb,-1);
|
||||
parseable_packet(0x00fc,6,clif_parse_PartyInvite,2);
|
||||
@ -180,7 +170,6 @@
|
||||
packet(0x0137,6);
|
||||
packet(0x0138,3);
|
||||
packet(0x0139,16);
|
||||
packet(0x013b,4);
|
||||
packet(0x013d,6);
|
||||
packet(0x013e,24);
|
||||
parseable_packet(0x013f,26,clif_parse_GM_Item_Monster,2);
|
||||
@ -269,7 +258,6 @@
|
||||
parseable_packet(0x0198,8,clif_parse_GMChangeMapType,2,4,6);
|
||||
packet(0x0199,4);
|
||||
packet(0x019a,14);
|
||||
packet(0x019b,10);
|
||||
parseable_packet(0x019c,-1,clif_parse_LocalBroadcast,2,4);
|
||||
parseable_packet(0x019d,6,clif_parse_GMHide,2);
|
||||
packet(0x019e,2);
|
||||
@ -917,7 +905,6 @@
|
||||
packet(0x0287,-1);
|
||||
packet(0x0288,6);
|
||||
packet(0x0289,8);
|
||||
packet(0x028a,18);
|
||||
packet(0x028b,-1);
|
||||
packet(0x028c,46);
|
||||
packet(0x028d,34);
|
||||
|
@ -853,6 +853,82 @@ struct PACKET_ZC_EQUIP_ARROW {
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_EQUIP_ARROW, 0x13c)
|
||||
|
||||
struct PACKET_ZC_CLOSE_STORE {
|
||||
int16 packetType;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_CLOSE_STORE, 0xf8);
|
||||
|
||||
struct PACKET_ZC_DELETE_ITEM_FROM_STORE {
|
||||
int16 packetType;
|
||||
uint16 index;
|
||||
uint32 amount;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_DELETE_ITEM_FROM_STORE, 0xf6);
|
||||
|
||||
struct PACKET_ZC_NOTIFY_STOREITEM_COUNTINFO {
|
||||
int16 packetType;
|
||||
uint16 amount;
|
||||
uint16 max_amount;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_NOTIFY_STOREITEM_COUNTINFO, 0xf2);
|
||||
|
||||
struct PACKET_ZC_EXCHANGEITEM_UNDO {
|
||||
int16 packetType;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_EXCHANGEITEM_UNDO, 0xf1);
|
||||
|
||||
struct PACKET_ZC_EXEC_EXCHANGE_ITEM {
|
||||
int16 packetType;
|
||||
uint8 result;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_EXEC_EXCHANGE_ITEM, 0xf0);
|
||||
|
||||
struct PACKET_ZC_CANCEL_EXCHANGE_ITEM {
|
||||
int16 packetType;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_CANCEL_EXCHANGE_ITEM, 0xee);
|
||||
|
||||
struct PACKET_ZC_CONCLUDE_EXCHANGE_ITEM {
|
||||
int16 packetType;
|
||||
uint8 who;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct PACKET_ZC_ACK_CREATE_CHATROOM {
|
||||
int16 packetType;
|
||||
uint8 flag;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_ACK_CREATE_CHATROOM, 0xd6);
|
||||
|
||||
DEFINE_PACKET_HEADER(ZC_CONCLUDE_EXCHANGE_ITEM, 0xec);
|
||||
|
||||
struct PACKET_ZC_REFUSE_ENTER_ROOM {
|
||||
int16 packetType;
|
||||
uint8 result;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_REFUSE_ENTER_ROOM, 0xda);
|
||||
|
||||
struct PACKET_ZC_NPC_SHOWEFST_UPDATE {
|
||||
int16 packetType;
|
||||
uint32 gid;
|
||||
uint32 effectState;
|
||||
int32 level;
|
||||
uint32 showEFST;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_NPC_SHOWEFST_UPDATE, 0x28a);
|
||||
|
||||
struct PACKET_ZC_ACTION_FAILURE {
|
||||
int16 packetType;
|
||||
uint16 type;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_ACTION_FAILURE, 0x13b)
|
||||
|
||||
struct PACKET_ZC_NOTIFY_EFFECT {
|
||||
int16 packetType;
|
||||
uint32 aid;
|
||||
uint32 effectId;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_NOTIFY_EFFECT, 0x19b);
|
||||
|
||||
// NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
|
||||
#if !defined( sun ) && ( !defined( __NETBSD__ ) || __NetBSD_Version__ >= 600000000 )
|
||||
#pragma pack( pop )
|
||||
|
@ -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 );
|
||||
|
@ -9343,7 +9343,7 @@ BUILDIN_FUNC(repair)
|
||||
sd->inventory.u.items_inventory[i].attribute = 0;
|
||||
clif_equiplist(sd);
|
||||
clif_produceeffect(sd, 0, sd->inventory.u.items_inventory[i].nameid);
|
||||
clif_misceffect(&sd->bl, 3);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_REFINE_SUCCESS );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -9374,7 +9374,7 @@ BUILDIN_FUNC(repairall)
|
||||
|
||||
if(repaircounter)
|
||||
{
|
||||
clif_misceffect(&sd->bl, 3);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_REFINE_SUCCESS );
|
||||
clif_equiplist(sd);
|
||||
}
|
||||
|
||||
@ -9642,7 +9642,7 @@ BUILDIN_FUNC(successrefitem) {
|
||||
|
||||
clif_additem(sd,i,1,0);
|
||||
pc_equipitem(sd,i,ep);
|
||||
clif_misceffect(&sd->bl,3);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_REFINE_SUCCESS );
|
||||
if( sd->inventory_data[i]->type == IT_WEAPON ){
|
||||
achievement_update_objective(sd, AG_ENCHANT_SUCCESS, 2, sd->inventory_data[i]->weapon_level, sd->inventory.u.items_inventory[i].refine);
|
||||
}
|
||||
@ -9695,7 +9695,7 @@ BUILDIN_FUNC(failedrefitem) {
|
||||
pc_unequipitem(sd,i,3); //recalculate bonus
|
||||
clif_refine( *sd, i, ITEMREFINING_FAILURE);
|
||||
pc_delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
|
||||
clif_misceffect(&sd->bl,2); // display failure effect
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_REFINE_FAILURE );
|
||||
achievement_update_objective(sd, AG_ENCHANT_FAIL, 1, 1);
|
||||
script_pushint(st, 1);
|
||||
return SCRIPT_CMD_SUCCESS;
|
||||
@ -9744,7 +9744,7 @@ BUILDIN_FUNC(downrefitem) {
|
||||
|
||||
clif_additem(sd,i,1,0);
|
||||
pc_equipitem(sd,i,ep);
|
||||
clif_misceffect(&sd->bl,2);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_REFINE_FAILURE );
|
||||
achievement_update_objective(sd, AG_ENCHANT_FAIL, 1, sd->inventory.u.items_inventory[i].refine);
|
||||
script_pushint(st, sd->inventory.u.items_inventory[i].refine);
|
||||
return SCRIPT_CMD_SUCCESS;
|
||||
@ -14050,7 +14050,7 @@ BUILDIN_FUNC(successremovecards) {
|
||||
map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0,0);
|
||||
}
|
||||
|
||||
clif_misceffect(&sd->bl,3);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_REFINE_SUCCESS );
|
||||
}
|
||||
return SCRIPT_CMD_SUCCESS;
|
||||
}
|
||||
@ -14137,7 +14137,7 @@ BUILDIN_FUNC(failedremovecards) {
|
||||
map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0,0);
|
||||
}
|
||||
}
|
||||
clif_misceffect(&sd->bl,2);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_REFINE_FAILURE );
|
||||
}
|
||||
return SCRIPT_CMD_SUCCESS;
|
||||
}
|
||||
|
@ -18594,7 +18594,7 @@ bool skill_check_condition_castend( map_session_data& sd, uint16 skill_id, uint1
|
||||
}
|
||||
#endif
|
||||
if((i=sd.equip_index[EQI_AMMO]) < 0 || !sd.inventory_data[i] ) {
|
||||
clif_arrow_fail(&sd,0);
|
||||
clif_arrow_fail( sd, ARROWFAIL_NO_AMMO );
|
||||
return false;
|
||||
} else if( sd.inventory.u.items_inventory[i].amount < require.ammo_qty + extra_ammo ) {
|
||||
char e_msg[100];
|
||||
@ -18615,7 +18615,7 @@ bool skill_check_condition_castend( map_session_data& sd, uint16 skill_id, uint1
|
||||
}
|
||||
if (!(require.ammo&1<<sd.inventory_data[i]->subtype)) { //Ammo type check. Send the "wrong weapon type" message
|
||||
//which is the closest we have to wrong ammo type. [Skotlex]
|
||||
clif_arrow_fail(&sd,0); //Haplo suggested we just send the equip-arrows message instead. [Skotlex]
|
||||
clif_arrow_fail( sd, ARROWFAIL_NO_AMMO ); //Haplo suggested we just send the equip-arrows message instead. [Skotlex]
|
||||
//clif_skill_fail( sd, skill_id, USESKILL_FAIL_THIS_WEAPON );
|
||||
return false;
|
||||
}
|
||||
@ -19723,7 +19723,7 @@ void skill_weaponrefine( map_session_data& sd, int idx ){
|
||||
}
|
||||
if (ep)
|
||||
pc_equipitem(&sd,idx,ep);
|
||||
clif_misceffect(&sd.bl,3);
|
||||
clif_misceffect( sd.bl, NOTIFYEFFECT_REFINE_SUCCESS );
|
||||
if(item->refine == 10 &&
|
||||
item->card[0] == CARD0_FORGE &&
|
||||
(int)MakeDWord(item->card[2],item->card[3]) == sd.status.char_id)
|
||||
@ -19748,7 +19748,7 @@ void skill_weaponrefine( map_session_data& sd, int idx ){
|
||||
clif_refine( sd, idx, ITEMREFINING_FAILURE );
|
||||
achievement_update_objective(&sd, AG_ENCHANT_FAIL, 1, 1);
|
||||
pc_delitem(&sd,idx,1,0,2, LOG_TYPE_OTHER);
|
||||
clif_misceffect(&sd.bl,2);
|
||||
clif_misceffect( sd.bl, NOTIFYEFFECT_REFINE_FAILURE );
|
||||
clif_emotion(&sd.bl, ET_HUK);
|
||||
}
|
||||
}
|
||||
@ -22312,7 +22312,7 @@ bool skill_produce_mix(map_session_data *sd, uint16 skill_id, t_itemid nameid, i
|
||||
|
||||
if (equip) {
|
||||
clif_produceeffect(sd,0,nameid);
|
||||
clif_misceffect(&sd->bl,3);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_REFINE_SUCCESS );
|
||||
if (wlv >= 3 && ((ele? 1 : 0) + sc) >= 3) // Fame point system [DracoRPG]
|
||||
pc_addfame(*sd, battle_config.fame_forge); // Success to forge a lv3 weapon with 3 additional ingredients = +10 fame point
|
||||
} else {
|
||||
@ -22364,13 +22364,13 @@ bool skill_produce_mix(map_session_data *sd, uint16 skill_id, t_itemid nameid, i
|
||||
case ASC_CDP:
|
||||
case GC_CREATENEWPOISON:
|
||||
clif_produceeffect(sd,2,nameid);
|
||||
clif_misceffect(&sd->bl,5);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_PHARMACY_SUCCESS );
|
||||
break;
|
||||
case BS_IRON:
|
||||
case BS_STEEL:
|
||||
case BS_ENCHANTEDSTONE:
|
||||
clif_produceeffect(sd,0,nameid);
|
||||
clif_misceffect(&sd->bl,3);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_REFINE_SUCCESS );
|
||||
break;
|
||||
default: //Those that don't require a skill?
|
||||
if (skill_produce_db[idx].itemlv > 10 && skill_produce_db[idx].itemlv <= 20) { //Cooking items.
|
||||
@ -22407,7 +22407,7 @@ bool skill_produce_mix(map_session_data *sd, uint16 skill_id, t_itemid nameid, i
|
||||
}
|
||||
if (k) {
|
||||
clif_produceeffect(sd,6,nameid);
|
||||
clif_misceffect(&sd->bl,5);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_PHARMACY_SUCCESS );
|
||||
clif_msg_skill(sd,skill_id,ITEM_PRODUCE_SUCCESS);
|
||||
return true;
|
||||
}
|
||||
@ -22421,23 +22421,23 @@ bool skill_produce_mix(map_session_data *sd, uint16 skill_id, t_itemid nameid, i
|
||||
switch (skill_id) {
|
||||
case RK_RUNEMASTERY:
|
||||
clif_produceeffect(sd, 4, nameid);
|
||||
clif_misceffect(&sd->bl, 5);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_PHARMACY_SUCCESS );
|
||||
break;
|
||||
case GN_MIX_COOKING:
|
||||
case GN_MAKEBOMB:
|
||||
case GN_S_PHARMACY:
|
||||
clif_produceeffect(sd, 6, nameid);
|
||||
clif_misceffect(&sd->bl, 5);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_PHARMACY_SUCCESS );
|
||||
clif_msg_skill(sd, skill_id, ITEM_PRODUCE_SUCCESS);
|
||||
break;
|
||||
case MT_M_MACHINE:
|
||||
clif_produceeffect(sd, 0, nameid);
|
||||
clif_misceffect(&sd->bl, 3);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_REFINE_SUCCESS );
|
||||
clif_msg_skill(sd, skill_id, ITEM_PRODUCE_SUCCESS);
|
||||
break;
|
||||
case BO_BIONIC_PHARMACY:
|
||||
clif_produceeffect(sd, 2, nameid);
|
||||
clif_misceffect(&sd->bl, 5);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_PHARMACY_SUCCESS );
|
||||
clif_msg_skill(sd, skill_id, ITEM_PRODUCE_SUCCESS);
|
||||
break;
|
||||
}
|
||||
@ -22452,7 +22452,7 @@ bool skill_produce_mix(map_session_data *sd, uint16 skill_id, t_itemid nameid, i
|
||||
|
||||
if (equip) {
|
||||
clif_produceeffect(sd,1,nameid);
|
||||
clif_misceffect(&sd->bl,2);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_REFINE_FAILURE );
|
||||
} else {
|
||||
switch (skill_id) {
|
||||
case ASC_CDP: //25% Damage yourself, and display same effect as failed potion.
|
||||
@ -22464,18 +22464,18 @@ bool skill_produce_mix(map_session_data *sd, uint16 skill_id, t_itemid nameid, i
|
||||
case AM_TWILIGHT3:
|
||||
case GC_CREATENEWPOISON:
|
||||
clif_produceeffect(sd,3,nameid);
|
||||
clif_misceffect(&sd->bl,6);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_PHARMACY_FAILURE );
|
||||
sd->potion_success_counter = 0; // Fame point system [DracoRPG]
|
||||
break;
|
||||
case BS_IRON:
|
||||
case BS_STEEL:
|
||||
case BS_ENCHANTEDSTONE:
|
||||
clif_produceeffect(sd,1,nameid);
|
||||
clif_misceffect(&sd->bl,2);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_REFINE_FAILURE );
|
||||
break;
|
||||
case RK_RUNEMASTERY:
|
||||
clif_produceeffect(sd,5,nameid);
|
||||
clif_misceffect(&sd->bl,6);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_PHARMACY_FAILURE );
|
||||
break;
|
||||
case GN_MIX_COOKING:
|
||||
if (qty == 0) {
|
||||
@ -22506,7 +22506,7 @@ bool skill_produce_mix(map_session_data *sd, uint16 skill_id, t_itemid nameid, i
|
||||
}
|
||||
}
|
||||
clif_produceeffect(sd,7,nameid);
|
||||
clif_misceffect(&sd->bl,6);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_PHARMACY_FAILURE );
|
||||
clif_msg_skill(sd,skill_id,ITEM_PRODUCE_FAIL);
|
||||
}
|
||||
break;
|
||||
@ -22514,17 +22514,17 @@ bool skill_produce_mix(map_session_data *sd, uint16 skill_id, t_itemid nameid, i
|
||||
case GN_S_PHARMACY:
|
||||
case GN_CHANGEMATERIAL:
|
||||
clif_produceeffect(sd,7,nameid);
|
||||
clif_misceffect(&sd->bl,6);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_PHARMACY_FAILURE );
|
||||
clif_msg_skill(sd,skill_id,ITEM_PRODUCE_FAIL);
|
||||
break;
|
||||
case MT_M_MACHINE:
|
||||
clif_produceeffect(sd, 1, nameid);
|
||||
clif_misceffect(&sd->bl, 2);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_REFINE_FAILURE );
|
||||
clif_msg_skill(sd, skill_id, ITEM_PRODUCE_FAIL);
|
||||
break;
|
||||
case BO_BIONIC_PHARMACY:
|
||||
clif_produceeffect(sd, 3, nameid);
|
||||
clif_misceffect(&sd->bl, 6);
|
||||
clif_misceffect( sd->bl, NOTIFYEFFECT_PHARMACY_FAILURE );
|
||||
clif_msg_skill(sd, skill_id, ITEM_PRODUCE_FAIL);
|
||||
break;
|
||||
default:
|
||||
|
@ -2992,7 +2992,7 @@ void status_calc_pet_(struct pet_data *pd, uint8 opt)
|
||||
|
||||
pd->pet.level = lv;
|
||||
if (!(opt&SCO_FIRST)) // Lv Up animation
|
||||
clif_misceffect(&pd->bl, 0);
|
||||
clif_misceffect( pd->bl, NOTIFYEFFECT_BASE_LEVEL_UP );
|
||||
status->rhw.atk = (bstat->rhw.atk*lv)/pd->db->lv;
|
||||
status->rhw.atk2 = (bstat->rhw.atk2*lv)/pd->db->lv;
|
||||
status->str = (bstat->str*lv)/pd->db->lv;
|
||||
@ -13811,7 +13811,7 @@ int status_change_end(struct block_list* bl, enum sc_type type, int tid)
|
||||
clif_status_change(bl,status_icon,0,0,0,0,0);
|
||||
|
||||
if( opt_flag[SCF_NONPLAYER] ) // bugreport:681
|
||||
clif_changeoption2(bl);
|
||||
clif_changeoption2( *bl );
|
||||
else if (!disable_opt_flag && (opt_flag[SCF_SENDOPTION] || opt_flag[SCF_ONTOUCH] || opt_flag[SCF_UNITMOVE] || opt_flag[SCF_NONPLAYER] || opt_flag[SCF_SENDLOOK])) {
|
||||
clif_changeoption(bl);
|
||||
if (sd && opt_flag[SCF_SENDLOOK]) {
|
||||
|
@ -145,7 +145,7 @@ int storage_storageopen(map_session_data *sd)
|
||||
sd->state.storage_flag = 1;
|
||||
storage_sortitem(sd->storage.u.items_storage, ARRAYLENGTH(sd->storage.u.items_storage));
|
||||
clif_storagelist(sd, sd->storage.u.items_storage, ARRAYLENGTH(sd->storage.u.items_storage), storage_getName(0));
|
||||
clif_updatestorageamount(sd, sd->storage.amount, sd->storage.max_amount);
|
||||
clif_updatestorageamount(*sd, sd->storage.amount, sd->storage.max_amount);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -290,7 +290,7 @@ static int storage_additem(map_session_data* sd, struct s_storage *stor, struct
|
||||
stor->u.items_storage[i].amount = amount;
|
||||
stor->dirty = true;
|
||||
clif_storageitemadded(sd,&stor->u.items_storage[i],i,amount);
|
||||
clif_updatestorageamount(sd, stor->amount, stor->max_amount);
|
||||
clif_updatestorageamount(*sd, stor->amount, stor->max_amount);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -314,11 +314,11 @@ int storage_delitem(map_session_data* sd, struct s_storage *stor, int index, int
|
||||
memset(&stor->u.items_storage[index],0,sizeof(stor->u.items_storage[0]));
|
||||
stor->amount--;
|
||||
if( sd->state.storage_flag == 1 || sd->state.storage_flag == 3 )
|
||||
clif_updatestorageamount(sd, stor->amount, stor->max_amount);
|
||||
clif_updatestorageamount(*sd, stor->amount, stor->max_amount);
|
||||
}
|
||||
|
||||
if( sd->state.storage_flag == 1 || sd->state.storage_flag == 3 )
|
||||
clif_storageitemremoved(sd,index,amount);
|
||||
clif_storageitemremoved( *sd, index, amount );
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -353,7 +353,7 @@ void storage_storageadd(map_session_data* sd, struct s_storage *stor, int index,
|
||||
}
|
||||
}
|
||||
|
||||
clif_storageitemremoved(sd,index,0);
|
||||
clif_storageitemremoved( *sd, index, 0 );
|
||||
clif_dropitem( *sd, index, 0 );
|
||||
}
|
||||
|
||||
@ -378,7 +378,7 @@ void storage_storageget(map_session_data *sd, struct s_storage *stor, int index,
|
||||
if ((flag = pc_additem(sd,&stor->u.items_storage[index],amount,LOG_TYPE_STORAGE)) == ADDITEM_SUCCESS)
|
||||
storage_delitem(sd,stor,index,amount);
|
||||
else {
|
||||
clif_storageitemremoved(sd,index,0);
|
||||
clif_storageitemremoved( *sd, index, 0 );
|
||||
clif_additem(sd,0,0,flag);
|
||||
}
|
||||
}
|
||||
@ -416,7 +416,7 @@ void storage_storageaddfromcart(map_session_data *sd, struct s_storage *stor, in
|
||||
}
|
||||
}
|
||||
|
||||
clif_storageitemremoved(sd,index,0);
|
||||
clif_storageitemremoved( *sd, index, 0 );
|
||||
clif_dropitem( *sd, index, 0 );
|
||||
}
|
||||
|
||||
@ -446,7 +446,7 @@ void storage_storagegettocart(map_session_data* sd, struct s_storage *stor, int
|
||||
if ((flag = pc_cart_additem(sd,&stor->u.items_storage[index],amount,LOG_TYPE_STORAGE)) == 0)
|
||||
storage_delitem(sd,stor,index,amount);
|
||||
else {
|
||||
clif_storageitemremoved(sd,index,0);
|
||||
clif_storageitemremoved( *sd, index, 0 );
|
||||
clif_cart_additem_ack(sd,(flag==1)?ADDITEM_TO_CART_FAIL_WEIGHT:ADDITEM_TO_CART_FAIL_COUNT);
|
||||
}
|
||||
}
|
||||
@ -480,7 +480,7 @@ void storage_storageclose(map_session_data *sd)
|
||||
|
||||
if( sd->state.storage_flag == 1 ){
|
||||
sd->state.storage_flag = 0;
|
||||
clif_storageclose( sd );
|
||||
clif_storageclose( *sd );
|
||||
}
|
||||
}
|
||||
|
||||
@ -600,7 +600,7 @@ char storage_guild_storageopen(map_session_data* sd)
|
||||
sd->state.storage_flag = 2;
|
||||
storage_sortitem(gstor->u.items_guild, ARRAYLENGTH(gstor->u.items_guild));
|
||||
clif_storagelist(sd, gstor->u.items_guild, ARRAYLENGTH(gstor->u.items_guild), "Guild Storage");
|
||||
clif_updatestorageamount(sd, gstor->amount, gstor->max_amount);
|
||||
clif_updatestorageamount(*sd, gstor->amount, gstor->max_amount);
|
||||
|
||||
return GSTORAGE_OPEN;
|
||||
}
|
||||
@ -777,7 +777,7 @@ bool storage_guild_additem(map_session_data* sd, struct s_storage* stor, struct
|
||||
stor->u.items_guild[i].amount = amount;
|
||||
stor->amount++;
|
||||
clif_storageitemadded(sd,&stor->u.items_guild[i],i,amount);
|
||||
clif_updatestorageamount(sd, stor->amount, stor->max_amount);
|
||||
clif_updatestorageamount(*sd, stor->amount, stor->max_amount);
|
||||
stor->dirty = true;
|
||||
|
||||
storage_guild_log( sd, &stor->u.items_guild[i], amount );
|
||||
@ -856,10 +856,10 @@ bool storage_guild_delitem(map_session_data* sd, struct s_storage* stor, int n,
|
||||
if(!stor->u.items_guild[n].amount) {
|
||||
memset(&stor->u.items_guild[n],0,sizeof(stor->u.items_guild[0]));
|
||||
stor->amount--;
|
||||
clif_updatestorageamount(sd, stor->amount, stor->max_amount);
|
||||
clif_updatestorageamount(*sd, stor->amount, stor->max_amount);
|
||||
}
|
||||
|
||||
clif_storageitemremoved(sd,n,amount);
|
||||
clif_storageitemremoved( *sd, n, amount );
|
||||
stor->dirty = true;
|
||||
return true;
|
||||
}
|
||||
@ -899,7 +899,7 @@ void storage_guild_storageadd(map_session_data* sd, int index, int amount)
|
||||
if(storage_guild_additem(sd,stor,&sd->inventory.u.items_inventory[index],amount))
|
||||
pc_delitem(sd,index,amount,0,4,LOG_TYPE_GSTORAGE);
|
||||
else {
|
||||
clif_storageitemremoved(sd,index,0);
|
||||
clif_storageitemremoved( *sd, index, 0 );
|
||||
clif_dropitem( *sd, index, 0 );
|
||||
}
|
||||
}
|
||||
@ -939,7 +939,7 @@ void storage_guild_storageget(map_session_data* sd, int index, int amount)
|
||||
if((flag = pc_additem(sd,&stor->u.items_guild[index],amount,LOG_TYPE_GSTORAGE)) == 0)
|
||||
storage_guild_delitem(sd,stor,index,amount);
|
||||
else { // inform fail
|
||||
clif_storageitemremoved(sd,index,0);
|
||||
clif_storageitemremoved( *sd, index, 0 );
|
||||
clif_additem(sd,0,0,flag);
|
||||
}
|
||||
}
|
||||
@ -972,7 +972,7 @@ void storage_guild_storageaddfromcart(map_session_data* sd, int index, int amoun
|
||||
if(storage_guild_additem(sd,stor,&sd->cart.u.items_cart[index],amount))
|
||||
pc_cart_delitem(sd,index,amount,0,LOG_TYPE_GSTORAGE);
|
||||
else {
|
||||
clif_storageitemremoved(sd,index,0);
|
||||
clif_storageitemremoved( *sd, index, 0 );
|
||||
clif_dropitem( *sd, index, 0 );
|
||||
}
|
||||
}
|
||||
@ -1007,7 +1007,7 @@ void storage_guild_storagegettocart(map_session_data* sd, int index, int amount)
|
||||
if((flag = pc_cart_additem(sd,&stor->u.items_guild[index],amount,LOG_TYPE_GSTORAGE)) == 0)
|
||||
storage_guild_delitem(sd,stor,index,amount);
|
||||
else {
|
||||
clif_storageitemremoved(sd,index,0);
|
||||
clif_storageitemremoved( *sd, index, 0 );
|
||||
clif_cart_additem_ack(sd,(flag == 1) ? ADDITEM_TO_CART_FAIL_WEIGHT:ADDITEM_TO_CART_FAIL_COUNT);
|
||||
}
|
||||
}
|
||||
@ -1061,7 +1061,7 @@ void storage_guild_storageclose(map_session_data* sd)
|
||||
nullpo_retv(sd);
|
||||
nullpo_retv(stor = guild2storage2(sd->status.guild_id));
|
||||
|
||||
clif_storageclose(sd);
|
||||
clif_storageclose( *sd );
|
||||
if (stor->status) {
|
||||
if (save_settings&CHARSAVE_STORAGE)
|
||||
chrif_save(sd, CSAVE_INVENTORY|CSAVE_CART); //This one also saves the storage. [Skotlex]
|
||||
@ -1087,7 +1087,7 @@ void storage_guild_storage_quit(map_session_data* sd, int flag)
|
||||
nullpo_retv(stor = guild2storage2(sd->status.guild_id));
|
||||
|
||||
if (flag) { //Only during a guild break flag is 1 (don't save storage)
|
||||
clif_storageclose(sd);
|
||||
clif_storageclose( *sd );
|
||||
|
||||
if (save_settings&CHARSAVE_STORAGE)
|
||||
chrif_save(sd, CSAVE_INVENTORY|CSAVE_CART);
|
||||
@ -1118,7 +1118,7 @@ void storage_premiumStorage_open(map_session_data *sd) {
|
||||
sd->state.storage_flag = 3;
|
||||
storage_sortitem(sd->premiumStorage.u.items_storage, ARRAYLENGTH(sd->premiumStorage.u.items_storage));
|
||||
clif_storagelist(sd, sd->premiumStorage.u.items_storage, ARRAYLENGTH(sd->premiumStorage.u.items_storage), storage_getName(sd->premiumStorage.stor_id));
|
||||
clif_updatestorageamount(sd, sd->premiumStorage.amount, sd->premiumStorage.max_amount);
|
||||
clif_updatestorageamount(*sd, sd->premiumStorage.amount, sd->premiumStorage.max_amount);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1184,7 +1184,7 @@ void storage_premiumStorage_close(map_session_data *sd) {
|
||||
|
||||
if( sd->state.storage_flag == 3 ){
|
||||
sd->state.storage_flag = 0;
|
||||
clif_storageclose( sd );
|
||||
clif_storageclose( *sd );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,12 +57,12 @@ void trade_traderequest(map_session_data *sd, map_session_data *target_sd)
|
||||
if ( sd->trade_partner != 0 ) { // If a character tries to trade to another one then cancel the previous one
|
||||
map_session_data *previous_sd = map_id2sd(sd->trade_partner);
|
||||
|
||||
if( previous_sd ){
|
||||
if( previous_sd != nullptr ){
|
||||
previous_sd->trade_partner = 0;
|
||||
clif_tradecancelled(previous_sd);
|
||||
clif_tradecancelled( *previous_sd );
|
||||
} // Once cancelled then continue to the new one.
|
||||
sd->trade_partner = 0;
|
||||
clif_tradecancelled(sd);
|
||||
clif_tradecancelled( *sd );
|
||||
}
|
||||
|
||||
if (target_sd->trade_partner != 0) {
|
||||
@ -485,8 +485,8 @@ void trade_tradeok(map_session_data *sd)
|
||||
|
||||
sd->state.deal_locked = 1;
|
||||
clif_tradeitemok(*sd, -2, EXITEM_ADD_SUCCEED); // We pass -2 which will becomes 0 in clif_tradeitemok (Official behavior)
|
||||
clif_tradedeal_lock(sd, 0);
|
||||
clif_tradedeal_lock(target_sd, 1);
|
||||
clif_tradedeal_lock( *sd, false );
|
||||
clif_tradedeal_lock( *target_sd, true );
|
||||
}
|
||||
|
||||
/**
|
||||
@ -504,12 +504,12 @@ void trade_tradecancel(map_session_data *sd)
|
||||
sd->state.isBoundTrading = 0;
|
||||
|
||||
if(!sd->state.trading) { // Not trade accepted
|
||||
if( target_sd ) {
|
||||
if( target_sd != nullptr ) {
|
||||
target_sd->trade_partner = 0;
|
||||
clif_tradecancelled(target_sd);
|
||||
clif_tradecancelled( *target_sd );
|
||||
}
|
||||
sd->trade_partner = 0;
|
||||
clif_tradecancelled(sd);
|
||||
clif_tradecancelled( *sd );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -530,7 +530,7 @@ void trade_tradecancel(map_session_data *sd)
|
||||
sd->state.deal_locked = 0;
|
||||
sd->state.trading = 0;
|
||||
sd->trade_partner = 0;
|
||||
clif_tradecancelled(sd);
|
||||
clif_tradecancelled( *sd );
|
||||
|
||||
if (!target_sd)
|
||||
return;
|
||||
@ -551,7 +551,7 @@ void trade_tradecancel(map_session_data *sd)
|
||||
target_sd->state.deal_locked = 0;
|
||||
target_sd->trade_partner = 0;
|
||||
target_sd->state.trading = 0;
|
||||
clif_tradecancelled(target_sd);
|
||||
clif_tradecancelled( *target_sd );
|
||||
}
|
||||
|
||||
/**
|
||||
@ -651,8 +651,8 @@ void trade_tradecommit(map_session_data *sd)
|
||||
tsd->state.trading = 0;
|
||||
tsd->state.isBoundTrading = 0;
|
||||
|
||||
clif_tradecompleted(sd, 0);
|
||||
clif_tradecompleted(tsd, 0);
|
||||
clif_tradecompleted( *sd );
|
||||
clif_tradecompleted( *tsd );
|
||||
|
||||
// save both player to avoid crash: they always have no advantage/disadvantage between the 2 players
|
||||
if (save_settings&CHARSAVE_TRADE) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user