From a89d501fc60b12a997a262429cb4515af9dad69e Mon Sep 17 00:00:00 2001 From: shennetsind Date: Fri, 29 Mar 2013 19:40:25 -0300 Subject: Hercules Renewal: clif.c 1st Phase Complete. http://hercules.ws/board/topic/237-hercules-renewal/ Signed-off-by: shennetsind --- src/map/atcommand.c | 1780 ++++++++++++++++++++++++------------------------ src/map/battle.c | 66 +- src/map/battleground.c | 14 +- src/map/buyingstore.c | 66 +- src/map/chat.c | 54 +- src/map/chrif.c | 50 +- src/map/clif.c | 1177 +++++++++++++++++++++----------- src/map/clif.h | 911 ++++++++++++------------- src/map/duel.c | 26 +- src/map/elemental.c | 18 +- src/map/guild.c | 160 ++--- src/map/homunculus.c | 108 +-- src/map/instance.c | 12 +- src/map/intif.c | 64 +- src/map/mail.c | 12 +- src/map/map.c | 71 +- src/map/mercenary.c | 16 +- src/map/mob.c | 46 +- src/map/npc.c | 66 +- src/map/party.c | 110 +-- src/map/pc.c | 531 +++++++-------- src/map/pet.c | 78 +-- src/map/quest.c | 18 +- src/map/script.c | 230 +++---- src/map/searchstore.c | 34 +- src/map/skill.c | 1606 +++++++++++++++++++++---------------------- src/map/status.c | 278 ++++---- src/map/storage.c | 46 +- src/map/trade.c | 90 +-- src/map/unit.c | 98 +-- src/map/vending.c | 32 +- 31 files changed, 4084 insertions(+), 3784 deletions(-) (limited to 'src/map') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 096d7a4b9..a585e6cc8 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -219,21 +219,21 @@ ACMD_FUNC(send) { int i; for (i = 900; i <= 903; ++i) - clif_displaymessage(fd, msg_txt(i)); + clif->displaymessage(fd, msg_txt(i)); return -1; } #define PARSE_ERROR(error,p) \ {\ - clif_displaymessage(fd, (error));\ + clif->displaymessage(fd, (error));\ sprintf(atcmd_output, ">%s", (p));\ - clif_displaymessage(fd, atcmd_output);\ + clif->displaymessage(fd, atcmd_output);\ } //define PARSE_ERROR #define CHECK_EOS(p) \ if(*(p) == 0){\ - clif_displaymessage(fd, "Unexpected end of string");\ + clif->displaymessage(fd, "Unexpected end of string");\ return -1;\ } //define CHECK_EOS @@ -259,7 +259,7 @@ ACMD_FUNC(send) if(len) {// show packet length sprintf(atcmd_output, msg_txt(904), type, packet_db[sd->packet_ver][type].len); // Packet 0x%x length: %d - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); return 0; } @@ -268,7 +268,7 @@ ACMD_FUNC(send) if(len == 0) {// unknown packet - ERROR sprintf(atcmd_output, msg_txt(905), type); // Unknown packet: 0x%x - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); return -1; } else if(len == -1) {// dynamic packet @@ -425,11 +425,11 @@ ACMD_FUNC(send) WFIFOSET(fd,len); } } else { - clif_displaymessage(fd, msg_txt(259)); // Invalid packet + clif->displaymessage(fd, msg_txt(259)); // Invalid packet return -1; } sprintf (atcmd_output, msg_txt(258), type, type); // Sent packet 0x%x (%d) - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); return 0; #undef PARSE_ERROR #undef CHECK_EOS @@ -455,7 +455,7 @@ ACMD_FUNC(mapmove) (sscanf(message, "%15s %hd %hd", map_name, &x, &y) < 3 && sscanf(message, "%15[^,],%hd,%hd", map_name, &x, &y) < 1)) { - clif_displaymessage(fd, msg_txt(909)); // Please enter a map (usage: @warp/@rura/@mapmove ). + clif->displaymessage(fd, msg_txt(909)); // Please enter a map (usage: @warp/@rura/@mapmove ). return -1; } @@ -464,30 +464,30 @@ ACMD_FUNC(mapmove) m = map_mapindex2mapid(mapindex); if (!mapindex) { // m < 0 means on different server! [Kevin] - clif_displaymessage(fd, msg_txt(1)); // Map not found. + clif->displaymessage(fd, msg_txt(1)); // Map not found. return -1; } if ((x || y) && map_getcell(m, x, y, CELL_CHKNOPASS)) { //This is to prevent the pc_setpos call from printing an error. - clif_displaymessage(fd, msg_txt(2)); + clif->displaymessage(fd, msg_txt(2)); if (!map_search_freecell(NULL, m, &x, &y, 10, 10, 1)) x = y = 0; //Invalid cell, use random spot. } if (map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(247)); + clif->displaymessage(fd, msg_txt(247)); return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(248)); + clif->displaymessage(fd, msg_txt(248)); return -1; } if (pc_setpos(sd, mapindex, x, y, CLR_TELEPORT) != 0) { - clif_displaymessage(fd, msg_txt(1)); // Map not found. + clif->displaymessage(fd, msg_txt(1)); // Map not found. return -1; } - clif_displaymessage(fd, msg_txt(0)); // Warped. + clif->displaymessage(fd, msg_txt(0)); // Warped. return 0; } @@ -502,7 +502,7 @@ ACMD_FUNC(where) memset(atcmd_player_name, '\0', sizeof atcmd_player_name); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { - clif_displaymessage(fd, msg_txt(910)); // Please enter a player name (usage: @where ). + clif->displaymessage(fd, msg_txt(910)); // Please enter a player name (usage: @where ). return -1; } @@ -511,12 +511,12 @@ ACMD_FUNC(where) strncmp(pl_sd->status.name, atcmd_player_name, NAME_LENGTH) != 0 || (pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) && pc_get_group_level(pl_sd) > pc_get_group_level(sd) && !pc_has_permission(sd, PC_PERM_WHO_DISPLAY_AID)) ) { - clif_displaymessage(fd, msg_txt(3)); // Character not found. + clif->displaymessage(fd, msg_txt(3)); // Character not found. return -1; } snprintf(atcmd_output, sizeof atcmd_output, "%s %s %d %d", pl_sd->status.name, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); return 0; } @@ -531,37 +531,37 @@ ACMD_FUNC(jumpto) nullpo_retr(-1, sd); if (!message || !*message) { - clif_displaymessage(fd, msg_txt(911)); // Please enter a player name (usage: @jumpto/@warpto/@goto ). + clif->displaymessage(fd, msg_txt(911)); // Please enter a player name (usage: @jumpto/@warpto/@goto ). return -1; } if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL) { - clif_displaymessage(fd, msg_txt(3)); // Character not found. + clif->displaymessage(fd, msg_txt(3)); // Character not found. return -1; } if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(247)); // You are not authorized to warp to this map. + clif->displaymessage(fd, msg_txt(247)); // You are not authorized to warp to this map. return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map. + clif->displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map. return -1; } if( pc_isdead(sd) ) { - clif_displaymessage(fd, msg_txt(664)); + clif->displaymessage(fd, msg_txt(664)); return -1; } pc_setpos(sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT); sprintf(atcmd_output, msg_txt(4), pl_sd->status.name); // Jumped to %s - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); return 0; } @@ -580,26 +580,26 @@ ACMD_FUNC(jump) sscanf(message, "%hd %hd", &x, &y); if (map[sd->bl.m].flag.noteleport && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map. + clif->displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map. return -1; } if( pc_isdead(sd) ) { - clif_displaymessage(fd, msg_txt(664)); + clif->displaymessage(fd, msg_txt(664)); return -1; } if ((x || y) && map_getcell(sd->bl.m, x, y, CELL_CHKNOPASS)) { //This is to prevent the pc_setpos call from printing an error. - clif_displaymessage(fd, msg_txt(2)); + clif->displaymessage(fd, msg_txt(2)); if (!map_search_freecell(NULL, sd->bl.m, &x, &y, 10, 10, 1)) x = y = 0; //Invalid cell, use random spot. } pc_setpos(sd, sd->mapindex, x, y, CLR_TELEPORT); sprintf(atcmd_output, msg_txt(5), sd->bl.x, sd->bl.y); // Jumped to %d %d - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); return 0; } @@ -679,7 +679,7 @@ ACMD_FUNC(who) break; } } - clif_displaymessage(fd, StringBuf_Value(&buf)); + clif->displaymessage(fd, StringBuf_Value(&buf)); StringBuf_Clear(&buf); count++; } @@ -701,7 +701,7 @@ ACMD_FUNC(who) else StringBuf_Printf(&buf, msg_txt(56), count, map[map_id].name); // %d players found in map '%s'. } - clif_displaymessage(fd, StringBuf_Value(&buf)); + clif->displaymessage(fd, StringBuf_Value(&buf)); StringBuf_Destroy(&buf); return 0; } @@ -754,7 +754,7 @@ ACMD_FUNC(whogm) if (pl_sd->sc.option & OPTION_INVISIBLE) continue; sprintf(atcmd_output, msg_txt(913), pl_sd->status.name); // Name: %s (GM) - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); count++; continue; } @@ -762,12 +762,12 @@ ACMD_FUNC(whogm) sprintf(atcmd_output, msg_txt(914), // Name: %s (GM:%d) | Location: %s %d %d pl_sd->status.name, pl_level, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(915), // BLvl: %d | Job: %s (Lvl: %d) pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level); - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); p = party_search(pl_sd->status.party_id); g = guild_search(pl_sd->status.guild_id); @@ -775,18 +775,18 @@ ACMD_FUNC(whogm) sprintf(atcmd_output,msg_txt(916), // Party: '%s' | Guild: '%s' p?p->party.name:msg_txt(917), g?g->name:msg_txt(917)); // None. - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); count++; } mapit_free(iter); if (count == 0) - clif_displaymessage(fd, msg_txt(150)); // No GM found. + clif->displaymessage(fd, msg_txt(150)); // No GM found. else if (count == 1) - clif_displaymessage(fd, msg_txt(151)); // 1 GM found. + clif->displaymessage(fd, msg_txt(151)); // 1 GM found. else { sprintf(atcmd_output, msg_txt(152), count); // %d GMs found. - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); } return 0; @@ -805,7 +805,7 @@ ACMD_FUNC(save) chrif_save(sd,0); - clif_displaymessage(fd, msg_txt(6)); // Your save point has been changed. + clif->displaymessage(fd, msg_txt(6)); // Your save point has been changed. return 0; } @@ -821,16 +821,16 @@ ACMD_FUNC(load) m = map_mapindex2mapid(sd->status.save_point.map); if (m >= 0 && map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(249)); // You are not authorized to warp to your save map. + clif->displaymessage(fd, msg_txt(249)); // You are not authorized to warp to your save map. return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map. + clif->displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map. return -1; } pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_OUTSIGHT); - clif_displaymessage(fd, msg_txt(7)); // Warping to save point.. + clif->displaymessage(fd, msg_txt(7)); // Warping to save point.. return 0; } @@ -848,13 +848,13 @@ ACMD_FUNC(speed) if (!message || !*message || sscanf(message, "%d", &speed) < 1) { sprintf(atcmd_output, msg_txt(918), MIN_WALK_SPEED, MAX_WALK_SPEED); // Please enter a speed value (usage: @speed <%d-%d>). - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); return -1; } sd->base_status.speed = cap_value(speed, MIN_WALK_SPEED, MAX_WALK_SPEED); status_calc_bl(&sd->bl, SCB_SPEED); - clif_displaymessage(fd, msg_txt(8)); // Speed changed. + clif->displaymessage(fd, msg_txt(8)); // Speed changed. return 0; } @@ -870,11 +870,11 @@ ACMD_FUNC(storage) if (storage_storageopen(sd) == 1) { //Already open. - clif_displaymessage(fd, msg_txt(250)); + clif->displaymessage(fd, msg_txt(250)); return -1; } - clif_displaymessage(fd, msg_txt(919)); // Storage opened. + clif->displaymessage(fd, msg_txt(919)); // Storage opened. return 0; } @@ -888,7 +888,7 @@ ACMD_FUNC(guildstorage) nullpo_retr(-1, sd); if (!sd->status.guild_id) { - clif_displaymessage(fd, msg_txt(252)); + clif->displaymessage(fd, msg_txt(252)); return -1; } @@ -896,17 +896,17 @@ ACMD_FUNC(guildstorage) return -1; if (sd->state.storage_flag == 1) { - clif_displaymessage(fd, msg_txt(250)); + clif->displaymessage(fd, msg_txt(250)); return -1; } if (sd->state.storage_flag == 2) { - clif_displaymessage(fd, msg_txt(251)); + clif->displaymessage(fd, msg_txt(251)); return -1; } storage_guild_storageopen(sd); - clif_displaymessage(fd, msg_txt(920)); // Guild storage opened. + clif->displaymessage(fd, msg_txt(920)); // Guild storage opened. return 0; } @@ -926,11 +926,11 @@ ACMD_FUNC(option) text = atcommand_help_string( command ); // notify the user of the requirement to enter an option - clif_displaymessage(fd, msg_txt(921)); // Please enter at least one option. + clif->displaymessage(fd, msg_txt(921)); // Please enter at least one option. if( text ) {// send the help text associated with this command - clif_displaymessage( fd, text ); + clif->displaymessage( fd, text ); } return -1; @@ -940,7 +940,7 @@ ACMD_FUNC(option) sd->sc.opt2 = param2; pc_setoption(sd, param3); - clif_displaymessage(fd, msg_txt(9)); // Options changed. + clif->displaymessage(fd, msg_txt(9)); // Options changed. return 0; } @@ -957,7 +957,7 @@ ACMD_FUNC(hide) status_set_viewdata(&sd->bl, sd->disguise); else status_set_viewdata(&sd->bl, sd->status.class_); - clif_displaymessage(fd, msg_txt(10)); // Invisible: Off + clif->displaymessage(fd, msg_txt(10)); // Invisible: Off // increment the number of pvp players on the map map[sd->bl.m].users_pvp++; @@ -967,11 +967,11 @@ ACMD_FUNC(hide) sd->pvp_timer = add_timer( gettick() + 200, pc_calc_pvprank_timer, sd->bl.id, 0 ); } //bugreport:2266 - map_foreachinmovearea(clif_insight, &sd->bl, AREA_SIZE, sd->bl.x, sd->bl.y, BL_ALL, &sd->bl); + map_foreachinmovearea(clif->insight, &sd->bl, AREA_SIZE, sd->bl.x, sd->bl.y, BL_ALL, &sd->bl); } else { sd->sc.option |= OPTION_INVISIBLE; sd->vd.class_ = INVISIBLE_CLASS; - clif_displaymessage(fd, msg_txt(11)); // Invisible: On + clif->displaymessage(fd, msg_txt(11)); // Invisible: On // decrement the number of pvp players on the map map[sd->bl.m].users_pvp--; @@ -982,7 +982,7 @@ ACMD_FUNC(hide) sd->pvp_timer = INVALID_TIMER; } } - clif_changeoption(&sd->bl); + clif->changeoption(&sd->bl); return 0; } @@ -1011,7 +1011,7 @@ ACMD_FUNC(jobchange) if (!found) { text = atcommand_help_string(command); if (text) - clif_displaymessage(fd, text); + clif->displaymessage(fd, text); return -1; } } @@ -1020,21 +1020,21 @@ ACMD_FUNC(jobchange) || job == JOB_LORD_KNIGHT2 || job == JOB_PALADIN2 || job == JOB_BABY_KNIGHT2 || job == JOB_BABY_CRUSADER2 || job == JOB_STAR_GLADIATOR2 || (job >= JOB_RUNE_KNIGHT2 && job <= JOB_MECHANIC_T2) || (job >= JOB_BABY_RUNE2 && job <= JOB_BABY_MECHANIC2) ) // Deny direct transformation into dummy jobs - {clif_displaymessage(fd, msg_txt(923)); //"You can not change to this job by command." + {clif->displaymessage(fd, msg_txt(923)); //"You can not change to this job by command." return 0;} if (pcdb_checkid(job)) { if (pc_jobchange(sd, job, upper) == 0) - clif_displaymessage(fd, msg_txt(12)); // Your job has been changed. + clif->displaymessage(fd, msg_txt(12)); // Your job has been changed. else { - clif_displaymessage(fd, msg_txt(155)); // You are unable to change your job. + clif->displaymessage(fd, msg_txt(155)); // You are unable to change your job. return -1; } } else { text = atcommand_help_string(command); if (text) - clif_displaymessage(fd, text); + clif->displaymessage(fd, text); return -1; } @@ -1048,9 +1048,9 @@ ACMD_FUNC(kill) { nullpo_retr(-1, sd); status_kill(&sd->bl); - clif_displaymessage(sd->fd, msg_txt(13)); // A pity! You've died. + clif->displaymessage(sd->fd, msg_txt(13)); // A pity! You've died. if (fd != sd->fd) - clif_displaymessage(fd, msg_txt(14)); // Character killed. + clif->displaymessage(fd, msg_txt(14)); // Character killed. return 0; } @@ -1062,11 +1062,11 @@ ACMD_FUNC(alive) nullpo_retr(-1, sd); if (!status_revive(&sd->bl, 100, 100)) { - clif_displaymessage(fd, msg_txt(667)); + clif->displaymessage(fd, msg_txt(667)); return -1; } - clif_skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1); - clif_displaymessage(fd, msg_txt(16)); // You've been revived! It's a miracle! + clif->skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1); + clif->displaymessage(fd, msg_txt(16)); // You've been revived! It's a miracle! return 0; } @@ -1082,23 +1082,23 @@ ACMD_FUNC(kami) if(*(command + 5) != 'c' && *(command + 5) != 'C') { if (!message || !*message) { - clif_displaymessage(fd, msg_txt(980)); // Please enter a message (usage: @kami ). + clif->displaymessage(fd, msg_txt(980)); // Please enter a message (usage: @kami ). return -1; } sscanf(message, "%199[^\n]", atcmd_output); if (strstr(command, "l") != NULL) - clif_broadcast(&sd->bl, atcmd_output, strlen(atcmd_output) + 1, 0, ALL_SAMEMAP); + clif->broadcast(&sd->bl, atcmd_output, strlen(atcmd_output) + 1, 0, ALL_SAMEMAP); else intif_broadcast(atcmd_output, strlen(atcmd_output) + 1, (*(command + 5) == 'b' || *(command + 5) == 'B') ? 0x10 : 0); } else { if(!message || !*message || (sscanf(message, "%lx %199[^\n]", &color, atcmd_output) < 2)) { - clif_displaymessage(fd, msg_txt(981)); // Please enter color and message (usage: @kamic ). + clif->displaymessage(fd, msg_txt(981)); // Please enter color and message (usage: @kamic ). return -1; } if(color > 0xFFFFFF) { - clif_displaymessage(fd, msg_txt(982)); // Invalid color. + clif->displaymessage(fd, msg_txt(982)); // Invalid color. return -1; } intif_broadcast2(atcmd_output, strlen(atcmd_output) + 1, color, 0x190, 12, 0, 0); @@ -1122,24 +1122,24 @@ ACMD_FUNC(heal) if ( hp == 0 && sp == 0 ) { if (!status_percent_heal(&sd->bl, 100, 100)) - clif_displaymessage(fd, msg_txt(157)); // HP and SP have already been recovered. + clif->displaymessage(fd, msg_txt(157)); // HP and SP have already been recovered. else - clif_displaymessage(fd, msg_txt(17)); // HP, SP recovered. + clif->displaymessage(fd, msg_txt(17)); // HP, SP recovered. return 0; } if ( hp > 0 && sp >= 0 ) { if(!status_heal(&sd->bl, hp, sp, 0)) - clif_displaymessage(fd, msg_txt(157)); // HP and SP are already with the good value. + clif->displaymessage(fd, msg_txt(157)); // HP and SP are already with the good value. else - clif_displaymessage(fd, msg_txt(17)); // HP, SP recovered. + clif->displaymessage(fd, msg_txt(17)); // HP, SP recovered. return 0; } if ( hp < 0 && sp <= 0 ) { status_damage(NULL, &sd->bl, -hp, -sp, 0, 0); - clif_damage(&sd->bl,&sd->bl, gettick(), 0, 0, -hp, 0, 4, 0); - clif_displaymessage(fd, msg_txt(156)); // HP or/and SP modified. + clif->damage(&sd->bl,&sd->bl, gettick(), 0, 0, -hp, 0, 4, 0); + clif->displaymessage(fd, msg_txt(156)); // HP or/and SP modified. return 0; } @@ -1149,7 +1149,7 @@ ACMD_FUNC(heal) status_heal(&sd->bl, hp, 0, 0); else { status_damage(NULL, &sd->bl, -hp, 0, 0, 0); - clif_damage(&sd->bl,&sd->bl, gettick(), 0, 0, -hp, 0, 4, 0); + clif->damage(&sd->bl,&sd->bl, gettick(), 0, 0, -hp, 0, 4, 0); } } @@ -1160,7 +1160,7 @@ ACMD_FUNC(heal) status_damage(NULL, &sd->bl, 0, -sp, 0, 0); } - clif_displaymessage(fd, msg_txt(156)); // HP or/and SP modified. + clif->displaymessage(fd, msg_txt(156)); // HP or/and SP modified. return 0; } @@ -1182,7 +1182,7 @@ ACMD_FUNC(item) sscanf(message, "\"%99[^\"]\" %d", item_name, &number) < 1 && sscanf(message, "%99s %d", item_name, &number) < 1 )) { - clif_displaymessage(fd, msg_txt(983)); // Please enter an item name or ID (usage: @item ). + clif->displaymessage(fd, msg_txt(983)); // Please enter an item name or ID (usage: @item ). return -1; } @@ -1192,7 +1192,7 @@ ACMD_FUNC(item) if ((item_data = itemdb_searchname(item_name)) == NULL && (item_data = itemdb_exists(atoi(item_name))) == NULL) { - clif_displaymessage(fd, msg_txt(19)); // Invalid item ID or name. + clif->displaymessage(fd, msg_txt(19)); // Invalid item ID or name. return -1; } @@ -1210,12 +1210,12 @@ ACMD_FUNC(item) item_tmp.identify = 1; if ((flag = pc_additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND))) - clif_additem(sd, 0, 0, flag); + clif->additem(sd, 0, 0, flag); } } if (flag == 0) - clif_displaymessage(fd, msg_txt(18)); // Item created. + clif->displaymessage(fd, msg_txt(18)); // Item created. return 0; } @@ -1238,8 +1238,8 @@ ACMD_FUNC(item2) sscanf(message, "\"%99[^\"]\" %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9 && sscanf(message, "%99s %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9 )) { - clif_displaymessage(fd, msg_txt(984)); // Please enter all parameters (usage: @item2 - clif_displaymessage(fd, msg_txt(985)); // ). + clif->displaymessage(fd, msg_txt(984)); // Please enter all parameters (usage: @item2 + clif->displaymessage(fd, msg_txt(985)); // ). return -1; } @@ -1283,13 +1283,13 @@ ACMD_FUNC(item2) item_tmp.card[2] = c3; item_tmp.card[3] = c4; if ((flag = pc_additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND))) - clif_additem(sd, 0, 0, flag); + clif->additem(sd, 0, 0, flag); } if (flag == 0) - clif_displaymessage(fd, msg_txt(18)); // Item created. + clif->displaymessage(fd, msg_txt(18)); // Item created. } else { - clif_displaymessage(fd, msg_txt(19)); // Invalid item ID or name. + clif->displaymessage(fd, msg_txt(19)); // Invalid item ID or name. return -1; } @@ -1309,7 +1309,7 @@ ACMD_FUNC(itemreset) pc_delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_COMMAND); } } - clif_displaymessage(fd, msg_txt(20)); // All of your items have been removed. + clif->displaymessage(fd, msg_txt(20)); // All of your items have been removed. return 0; } @@ -1324,13 +1324,13 @@ ACMD_FUNC(baselevelup) level = atoi(message); if (!message || !*message || !level) { - clif_displaymessage(fd, msg_txt(986)); // Please enter a level adjustment (usage: @lvup/@blevel/@baselvlup ). + clif->displaymessage(fd, msg_txt(986)); // Please enter a level adjustment (usage: @lvup/@blevel/@baselvlup ). return -1; } if (level > 0) { if (sd->status.base_level >= pc_maxbaselv(sd)) { // check for max level by Valaris - clif_displaymessage(fd, msg_txt(47)); // Base level can't go any higher. + clif->displaymessage(fd, msg_txt(47)); // Base level can't go any higher. return -1; } // End Addition if ((unsigned int)level > pc_maxbaselv(sd) || (unsigned int)level > pc_maxbaselv(sd) - sd->status.base_level) // fix positiv overflow @@ -1341,11 +1341,11 @@ ACMD_FUNC(baselevelup) sd->status.status_point += status_point; sd->status.base_level += (unsigned int)level; status_percent_heal(&sd->bl, 100, 100); - clif_misceffect(&sd->bl, 0); - clif_displaymessage(fd, msg_txt(21)); // Base level raised. + clif->misceffect(&sd->bl, 0); + clif->displaymessage(fd, msg_txt(21)); // Base level raised. } else { if (sd->status.base_level == 1) { - clif_displaymessage(fd, msg_txt(158)); // Base level can't go any lower. + clif->displaymessage(fd, msg_txt(158)); // Base level can't go any lower. return -1; } level*=-1; @@ -1360,13 +1360,13 @@ ACMD_FUNC(baselevelup) else sd->status.status_point -= status_point; sd->status.base_level -= (unsigned int)level; - clif_displaymessage(fd, msg_txt(22)); // Base level lowered. + clif->displaymessage(fd, msg_txt(22)); // Base level lowered. } sd->status.base_exp = 0; - clif_updatestatus(sd, SP_STATUSPOINT); - clif_updatestatus(sd, SP_BASELEVEL); - clif_updatestatus(sd, SP_BASEEXP); - clif_updatestatus(sd, SP_NEXTBASEEXP); + clif->updatestatus(sd, SP_STATUSPOINT); + clif->updatestatus(sd, SP_BASELEVEL); + clif->updatestatus(sd, SP_BASEEXP); + clif->updatestatus(sd, SP_NEXTBASEEXP); status_calc_pc(sd, 0); pc_baselevelchanged(sd); if(sd->status.party_id) @@ -1385,23 +1385,23 @@ ACMD_FUNC(joblevelup) level = atoi(message); if (!message || !*message || !level) { - clif_displaymessage(fd, msg_txt(987)); // Please enter a level adjustment (usage: @joblvup/@jlevel/@joblvlup ). + clif->displaymessage(fd, msg_txt(987)); // Please enter a level adjustment (usage: @joblvup/@jlevel/@joblvlup ). return -1; } if (level > 0) { if (sd->status.job_level >= pc_maxjoblv(sd)) { - clif_displaymessage(fd, msg_txt(23)); // Job level can't go any higher. + clif->displaymessage(fd, msg_txt(23)); // Job level can't go any higher. return -1; } if ((unsigned int)level > pc_maxjoblv(sd) || (unsigned int)level > pc_maxjoblv(sd) - sd->status.job_level) // fix positiv overflow 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_displaymessage(fd, msg_txt(24)); // Job level raised. + clif->misceffect(&sd->bl, 1); + clif->displaymessage(fd, msg_txt(24)); // Job level raised. } else { if (sd->status.job_level == 1) { - clif_displaymessage(fd, msg_txt(159)); // Job level can't go any lower. + clif->displaymessage(fd, msg_txt(159)); // Job level can't go any lower. return -1; } level *=-1; @@ -1414,13 +1414,13 @@ ACMD_FUNC(joblevelup) sd->status.skill_point = 0; else sd->status.skill_point -= level; - clif_displaymessage(fd, msg_txt(25)); // Job level lowered. + clif->displaymessage(fd, msg_txt(25)); // Job level lowered. } sd->status.job_exp = 0; - clif_updatestatus(sd, SP_JOBLEVEL); - clif_updatestatus(sd, SP_JOBEXP); - clif_updatestatus(sd, SP_NEXTJOBEXP); - clif_updatestatus(sd, SP_SKILLPOINT); + clif->updatestatus(sd, SP_JOBLEVEL); + clif->updatestatus(sd, SP_JOBEXP); + clif->updatestatus(sd, SP_NEXTJOBEXP); + clif->updatestatus(sd, SP_SKILLPOINT); status_calc_pc(sd, 0); return 0; @@ -1440,7 +1440,7 @@ ACMD_FUNC(help) help = config_lookup(&atcommand_config, "help"); if (help == NULL) { - clif_displaymessage(fd, msg_txt(27)); // "Commands help is not available." + clif->displaymessage(fd, msg_txt(27)); // "Commands help is not available." return -1; } @@ -1454,20 +1454,20 @@ ACMD_FUNC(help) if (!pc_can_use_command(sd, command_name, COMMAND_ATCOMMAND)) { sprintf(atcmd_output, msg_txt(153), message); // "%s is Unknown Command" - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); atcommand_get_suggestions(sd, command_name, true); return -1; } if (!config_setting_lookup_string(help, command_name, &text)) { sprintf(atcmd_output, msg_txt(988), atcommand_symbol, command_name); // There is no help for %c%s. - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); atcommand_get_suggestions(sd, command_name, true); return -1; } sprintf(atcmd_output, msg_txt(989), atcommand_symbol, command_name); // Help for command %c%s: - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); { // Display aliases DBIterator* iter; @@ -1488,12 +1488,12 @@ ACMD_FUNC(help) } dbi_destroy(iter); if (has_aliases) - clif_displaymessage(fd, StringBuf_Value(&buf)); + clif->displaymessage(fd, StringBuf_Value(&buf)); StringBuf_Destroy(&buf); } // Display help contents - clif_displaymessage(fd, text); + clif->displaymessage(fd, text); return 0; } @@ -1516,7 +1516,7 @@ static int atcommand_stopattack(struct block_list *bl,va_list ap) static int atcommand_pvpoff_sub(struct block_list *bl,va_list ap) { TBL_PC* sd = (TBL_PC*)bl; - clif_pvpset(sd, 0, 0, 2); + clif->pvpset(sd, 0, 0, 2); if (sd->pvp_timer != INVALID_TIMER) { delete_timer(sd->pvp_timer, pc_calc_pvprank_timer); sd->pvp_timer = INVALID_TIMER; @@ -1529,17 +1529,17 @@ ACMD_FUNC(pvpoff) nullpo_retr(-1, sd); if (!map[sd->bl.m].flag.pvp) { - clif_displaymessage(fd, msg_txt(160)); // PvP is already Off. + clif->displaymessage(fd, msg_txt(160)); // PvP is already Off. return -1; } map[sd->bl.m].flag.pvp = 0; if (!battle_config.pk_mode) - clif_map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING); + clif->map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING); map_foreachinmap(atcommand_pvpoff_sub,sd->bl.m, BL_PC); map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0); - clif_displaymessage(fd, msg_txt(31)); // PvP: Off. + clif->displaymessage(fd, msg_txt(31)); // PvP: Off. return 0; } @@ -1565,7 +1565,7 @@ ACMD_FUNC(pvpon) nullpo_retr(-1, sd); if (map[sd->bl.m].flag.pvp) { - clif_displaymessage(fd, msg_txt(161)); // PvP is already On. + clif->displaymessage(fd, msg_txt(161)); // PvP is already On. return -1; } @@ -1573,11 +1573,11 @@ ACMD_FUNC(pvpon) if (!battle_config.pk_mode) {// display pvp circle and rank - clif_map_property_mapall(sd->bl.m, MAPPROPERTY_FREEPVPZONE); + clif->map_property_mapall(sd->bl.m, MAPPROPERTY_FREEPVPZONE); map_foreachinmap(atcommand_pvpon_sub,sd->bl.m, BL_PC); } - clif_displaymessage(fd, msg_txt(32)); // PvP: On. + clif->displaymessage(fd, msg_txt(32)); // PvP: On. return 0; } @@ -1590,14 +1590,14 @@ ACMD_FUNC(gvgoff) nullpo_retr(-1, sd); if (!map[sd->bl.m].flag.gvg) { - clif_displaymessage(fd, msg_txt(162)); // GvG is already Off. + clif->displaymessage(fd, msg_txt(162)); // GvG is already Off. return -1; } map[sd->bl.m].flag.gvg = 0; - clif_map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING); + clif->map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING); map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0); - clif_displaymessage(fd, msg_txt(33)); // GvG: Off. + clif->displaymessage(fd, msg_txt(33)); // GvG: Off. return 0; } @@ -1610,13 +1610,13 @@ ACMD_FUNC(gvgon) nullpo_retr(-1, sd); if (map[sd->bl.m].flag.gvg) { - clif_displaymessage(fd, msg_txt(163)); // GvG is already On. + clif->displaymessage(fd, msg_txt(163)); // GvG is already On. return -1; } map[sd->bl.m].flag.gvg = 1; - clif_map_property_mapall(sd->bl.m, MAPPROPERTY_AGITZONE); - clif_displaymessage(fd, msg_txt(34)); // GvG: On. + clif->map_property_mapall(sd->bl.m, MAPPROPERTY_AGITZONE); + clif->displaymessage(fd, msg_txt(34)); // GvG: On. return 0; } @@ -1634,7 +1634,7 @@ ACMD_FUNC(model) if (!message || !*message || sscanf(message, "%d %d %d", &hair_style, &hair_color, &cloth_color) < 1) { sprintf(atcmd_output, msg_txt(991), // Please enter at least one value (usage: @model ). MIN_HAIR_STYLE, MAX_HAIR_STYLE, MIN_HAIR_COLOR, MAX_HAIR_COLOR, MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); return -1; } @@ -1644,9 +1644,9 @@ ACMD_FUNC(model) pc_changelook(sd, LOOK_HAIR, hair_style); pc_changelook(sd, LOOK_HAIR_COLOR, hair_color); pc_changelook(sd, LOOK_CLOTHES_COLOR, cloth_color); - clif_displaymessage(fd, msg_txt(36)); // Appearence changed. + clif->displaymessage(fd, msg_txt(36)); // Appearence changed. } else { - clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified. return -1; } @@ -1665,15 +1665,15 @@ ACMD_FUNC(dye) if (!message || !*message || sscanf(message, "%d", &cloth_color) < 1) { sprintf(atcmd_output, msg_txt(992), MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); // Please enter a clothes color (usage: @dye/@ccolor ). - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); return -1; } if (cloth_color >= MIN_CLOTH_COLOR && cloth_color <= MAX_CLOTH_COLOR) { pc_changelook(sd, LOOK_CLOTHES_COLOR, cloth_color); - clif_displaymessage(fd, msg_txt(36)); // Appearence changed. + clif->displaymessage(fd, msg_txt(36)); // Appearence changed. } else { - clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified. return -1; } @@ -1692,15 +1692,15 @@ ACMD_FUNC(hair_style) if (!message || !*message || sscanf(message, "%d", &hair_style) < 1) { sprintf(atcmd_output, msg_txt(993), MIN_HAIR_STYLE, MAX_HAIR_STYLE); // Please enter a hair style (usage: @hairstyle/@hstyle ). - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); return -1; } if (hair_style >= MIN_HAIR_STYLE && hair_style <= MAX_HAIR_STYLE) { pc_changelook(sd, LOOK_HAIR, hair_style); - clif_displaymessage(fd, msg_txt(36)); // Appearence changed. + clif->displaymessage(fd, msg_txt(36)); // Appearence changed. } else { - clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified. return -1; } @@ -1719,15 +1719,15 @@ ACMD_FUNC(hair_color) if (!message || !*message || sscanf(message, "%d", &hair_color) < 1) { sprintf(atcmd_output, msg_txt(994), MIN_HAIR_COLOR, MAX_HAIR_COLOR); // Please enter a hair color (usage: @haircolor/@hcolor ). - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); return -1; } if (hair_color >= MIN_HAIR_COLOR && hair_color <= MAX_HAIR_COLOR) { pc_changelook(sd, LOOK_HAIR_COLOR, hair_color); - clif_displaymessage(fd, msg_txt(36)); // Appearence changed. + clif->displaymessage(fd, msg_txt(36)); // Appearence changed. } else { - clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified. return -1; } @@ -1793,7 +1793,7 @@ ACMD_FUNC(go) nullpo_retr(-1, sd); if( map[sd->bl.m].flag.nogo && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE) ) { - clif_displaymessage(sd->fd,msg_txt(995)); // You cannot use @go on this map. + clif->displaymessage(sd->fd,msg_txt(995)); // You cannot use @go on this map. return 0; } @@ -1810,11 +1810,11 @@ ACMD_FUNC(go) // attempt to find the text help string text = atcommand_help_string( command ); - clif_displaymessage(fd, msg_txt(38)); // Invalid location number, or name. + clif->displaymessage(fd, msg_txt(38)); // Invalid location number, or name. if( text ) {// send the text to the client - clif_displaymessage( fd, text ); + clif->displaymessage( fd, text ); } return -1; @@ -1913,21 +1913,21 @@ ACMD_FUNC(go) { m = map_mapname2mapid(data[town].map); if (m >= 0 && map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(247)); + clif->displaymessage(fd, msg_txt(247)); return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(248)); + clif->displaymessage(fd, msg_txt(248)); return -1; } if (pc_setpos(sd, mapindex_name2id(data[town].map), data[town].x, data[town].y, CLR_TELEPORT) == 0) { - clif_displaymessage(fd, msg_txt(0)); // Warped. + clif->displaymessage(fd, msg_txt(0)); // Warped. } else { - clif_displaymessage(fd, msg_txt(1)); // Map not found. + clif->displaymessage(fd, msg_txt(1)); // Map not found. return -1; } } else { // if you arrive here, you have an error in town variable when reading of names - clif_displaymessage(fd, msg_txt(38)); // Invalid location number or name. + clif->displaymessage(fd, msg_txt(38)); // Invalid location number or name. return -1; } @@ -1955,7 +1955,7 @@ ACMD_FUNC(monster) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message) { - clif_displaymessage(fd, msg_txt(80)); // Give the display name or monster name/id please. + clif->displaymessage(fd, msg_txt(80)); // Give the display name or monster name/id please. return -1; } if (sscanf(message, "\"%23[^\"]\" %23s %d", name, monster, &number) > 1 || @@ -1971,7 +1971,7 @@ ACMD_FUNC(monster) //As before, name may be already filled. name[0] = '\0'; } else { - clif_displaymessage(fd, msg_txt(80)); // Give a display name and monster name/id please. + clif->displaymessage(fd, msg_txt(80)); // Give a display name and monster name/id please. return -1; } @@ -1979,12 +1979,12 @@ ACMD_FUNC(monster) mob_id = mobdb_checkid(atoi(monster)); if (mob_id == 0) { - clif_displaymessage(fd, msg_txt(40)); // Invalid monster ID or name. + clif->displaymessage(fd, msg_txt(40)); // Invalid monster ID or name. return -1; } if (mob_id == MOBID_EMPERIUM) { - clif_displaymessage(fd, msg_txt(83)); // Monster 'Emperium' cannot be spawned. + clif->displaymessage(fd, msg_txt(83)); // Monster 'Emperium' cannot be spawned. return -1; } @@ -2018,13 +2018,13 @@ ACMD_FUNC(monster) if (count != 0) if (number == count) - clif_displaymessage(fd, msg_txt(39)); // All monster summoned! + clif->displaymessage(fd, msg_txt(39)); // All monster summoned! else { sprintf(atcmd_output, msg_txt(240), count); // %d monster(s) summoned! - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); } else { - clif_displaymessage(fd, msg_txt(40)); // Invalid monster ID or name. + clif->displaymessage(fd, msg_txt(40)); // Invalid monster ID or name. return -1; } @@ -2071,7 +2071,7 @@ ACMD_FUNC(killmonster) map_foreachinmap(atkillmonster_sub, map_id, BL_MOB, -drop_flag); - clif_displaymessage(fd, msg_txt(165)); // All monsters killed! + clif->displaymessage(fd, msg_txt(165)); // All monsters killed! return 0; } @@ -2088,27 +2088,27 @@ ACMD_FUNC(refine) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d %d", &position, &refine) < 2) { - clif_displaymessage(fd, msg_txt(996)); // Please enter a position and an amount (usage: @refine <+/- amount>). + clif->displaymessage(fd, msg_txt(996)); // Please enter a position and an amount (usage: @refine <+/- amount>). sprintf(atcmd_output, msg_txt(997), EQP_HEAD_LOW); // %d: Lower Headgear - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(998), EQP_HAND_R); // %d: Right Hand - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(999), EQP_GARMENT); // %d: Garment - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1000), EQP_ACC_L); // %d: Left Accessory - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1001), EQP_ARMOR); // %d: Body Armor - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1002), EQP_HAND_L); // %d: Left Hand - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1003), EQP_SHOES); // %d: Shoes - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1004), EQP_ACC_R); // %d: Right Accessory - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1005), EQP_HEAD_TOP); // %d: Top Headgear - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1006), EQP_HEAD_MID); // %d: Mid Headgear - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); return -1; } @@ -2133,22 +2133,22 @@ ACMD_FUNC(refine) sd->status.inventory[i].refine = final_refine; current_position = sd->status.inventory[i].equip; pc_unequipitem(sd, i, 3); - clif_refine(fd, 0, i, sd->status.inventory[i].refine); - clif_delitem(sd, i, 1, 3); - clif_additem(sd, i, 1, 0); + clif->refine(fd, 0, i, sd->status.inventory[i].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, 3); count++; } } if (count == 0) - clif_displaymessage(fd, msg_txt(166)); // No item has been refined. + clif->displaymessage(fd, msg_txt(166)); // No item has been refined. else if (count == 1) - clif_displaymessage(fd, msg_txt(167)); // 1 item has been refined. + clif->displaymessage(fd, msg_txt(167)); // 1 item has been refined. else { sprintf(atcmd_output, msg_txt(168), count); // %d items have been refined. - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); } return 0; @@ -2172,13 +2172,13 @@ ACMD_FUNC(produce) sscanf(message, "\"%99[^\"]\" %d %d", item_name, &attribute, &star) < 1 && sscanf(message, "%99s %d %d", item_name, &attribute, &star) < 1 )) { - clif_displaymessage(fd, msg_txt(1007)); // Please enter at least one item name/ID (usage: @produce <# of very's>). + clif->displaymessage(fd, msg_txt(1007)); // Please enter at least one item name/ID (usage: @produce <# of very's>). return -1; } if ( (item_data = itemdb_searchname(item_name)) == NULL && (item_data = itemdb_exists(atoi(item_name))) == NULL ) { - clif_displaymessage(fd, msg_txt(170)); //This item is not an equipment. + clif->displaymessage(fd, msg_txt(170)); //This item is not an equipment. return -1; } @@ -2199,14 +2199,14 @@ ACMD_FUNC(produce) ((star*5) << 8) + attribute:0; 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->produce_effect(sd, 0, item_id); + clif->misceffect(&sd->bl, 3); if ((flag = pc_additem(sd, &tmp_item, 1, LOG_TYPE_COMMAND))) - clif_additem(sd, 0, 0, flag); + clif->additem(sd, 0, 0, flag); } else { sprintf(atcmd_output, msg_txt(169), item_id, item_data->name); // The item (%d: '%s') is not equipable. - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); return -1; } @@ -2226,14 +2226,14 @@ ACMD_FUNC(memo) if( !message || !*message || sscanf(message, "%d", &position) < 1 ) { int i; - clif_displaymessage(sd->fd, msg_txt(668)); + clif->displaymessage(sd->fd, msg_txt(668)); for( i = 0; i < MAX_MEMOPOINTS; i++ ) { if( sd->status.memo_point[i].map ) sprintf(atcmd_output, "%d - %s (%d,%d)", i, mapindex_id2name(sd->status.memo_point[i].map), sd->status.memo_point[i].x, sd->status.memo_point[i].y); else sprintf(atcmd_output, msg_txt(171), i); // %d - void - clif_displaymessage(sd->fd, atcmd_output); + clif->displaymessage(sd->fd, atcmd_output); } return 0; } @@ -2241,7 +2241,7 @@ ACMD_FUNC(memo) if( position < 0 || position >= MAX_MEMOPOINTS ) { sprintf(atcmd_output, msg_txt(1008), 0, MAX_MEMOPOINTS-1); // Please enter a valid position (usage: @memo ). - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); return -1; } @@ -2268,7 +2268,7 @@ ACMD_FUNC(gat) map_getcell(sd->bl.m, sd->bl.x + 1, sd->bl.y + y, CELL_GETTYPE), map_getcell(sd->bl.m, sd->bl.x + 2, sd->bl.y + y, CELL_GETTYPE)); - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); } return 0; @@ -2283,13 +2283,13 @@ ACMD_FUNC(displaystatus) nullpo_retr(-1, sd); if (!message || !*message || (i = sscanf(message, "%d %d %d %d %d %d", &type, &flag, &tick, &val1, &val2, &val3)) < 1) { - clif_displaymessage(fd, msg_txt(1009)); // Please enter a status type/flag (usage: @displaystatus { { {}}}). + clif->displaymessage(fd, msg_txt(1009)); // Please enter a status type/flag (usage: @displaystatus { { {}}}). return -1; } if (i < 2) flag = 1; if (i < 3) tick = 0; - clif_status_change(&sd->bl, type, flag, tick, val1, val2, val3); + clif->status_change(&sd->bl, type, flag, tick, val1, val2, val3); return 0; } @@ -2303,7 +2303,7 @@ ACMD_FUNC(statuspoint) unsigned int new_status_point; if (!message || !*message || (point = atoi(message)) == 0) { - clif_displaymessage(fd, msg_txt(1010)); // Please enter a number (usage: @stpoint ). + clif->displaymessage(fd, msg_txt(1010)); // Please enter a number (usage: @stpoint ). return -1; } @@ -2329,13 +2329,13 @@ ACMD_FUNC(statuspoint) if (new_status_point != sd->status.status_point) { sd->status.status_point = new_status_point; - clif_updatestatus(sd, SP_STATUSPOINT); - clif_displaymessage(fd, msg_txt(174)); // Number of status points changed. + clif->updatestatus(sd, SP_STATUSPOINT); + clif->displaymessage(fd, msg_txt(174)); // Number of status points changed. } else { if (point < 0) - clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value. + clif->displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value. else - clif_displaymessage(fd, msg_txt(149)); // Unable to increase the number/value. + clif->displaymessage(fd, msg_txt(149)); // Unable to increase the number/value. return -1; } @@ -2352,7 +2352,7 @@ ACMD_FUNC(skillpoint) nullpo_retr(-1, sd); if (!message || !*message || (point = atoi(message)) == 0) { - clif_displaymessage(fd, msg_txt(1011)); // Please enter a number (usage: @skpoint ). + clif->displaymessage(fd, msg_txt(1011)); // Please enter a number (usage: @skpoint ). return -1; } @@ -2378,13 +2378,13 @@ ACMD_FUNC(skillpoint) if (new_skill_point != sd->status.skill_point) { sd->status.skill_point = new_skill_point; - clif_updatestatus(sd, SP_SKILLPOINT); - clif_displaymessage(fd, msg_txt(175)); // Number of skill points changed. + clif->updatestatus(sd, SP_SKILLPOINT); + clif->displaymessage(fd, msg_txt(175)); // Number of skill points changed. } else { if (point < 0) - clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value. + clif->displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value. else - clif_displaymessage(fd, msg_txt(149)); // Unable to increase the number/value. + clif->displaymessage(fd, msg_txt(149)); // Unable to increase the number/value. return -1; } @@ -2400,20 +2400,20 @@ ACMD_FUNC(zeny) nullpo_retr(-1, sd); if (!message || !*message || (zeny = atoi(message)) == 0) { - clif_displaymessage(fd, msg_txt(1012)); // Please enter an amount (usage: @zeny ). + clif->displaymessage(fd, msg_txt(1012)); // Please enter an amount (usage: @zeny ). return -1; } if(zeny > 0){ if((ret=pc_getzeny(sd,zeny,LOG_TYPE_COMMAND,NULL)) == 1) - clif_displaymessage(fd, msg_txt(149)); // Unable to increase the number/value. + clif->displaymessage(fd, msg_txt(149)); // Unable to increase the number/value. } else { if( sd->status.zeny < -zeny ) zeny = -sd->status.zeny; if((ret=pc_payzeny(sd,-zeny,LOG_TYPE_COMMAND,NULL)) == 1) - clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value. + clif->displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value. } - if(!ret) clif_displaymessage(fd, msg_txt(176)); //ret=0 mean cmd success + if(!ret) clif->displaymessage(fd, msg_txt(176)); //ret=0 mean cmd success return 0; } @@ -2431,14 +2431,14 @@ ACMD_FUNC(param) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d", &value) < 1 || value == 0) { - clif_displaymessage(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>). + clif->displaymessage(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>). return -1; } ARR_FIND( 0, ARRAYLENGTH(param), i, strcmpi(command+1, param[i]) == 0 ); if( i == ARRAYLENGTH(param) || i > MAX_STATUS_TYPE) { // normally impossible... - clif_displaymessage(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>). + clif->displaymessage(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>). return -1; } @@ -2464,15 +2464,15 @@ ACMD_FUNC(param) if (new_value != *status[i]) { *status[i] = new_value; - clif_updatestatus(sd, SP_STR + i); - clif_updatestatus(sd, SP_USTR + i); + clif->updatestatus(sd, SP_STR + i); + clif->updatestatus(sd, SP_USTR + i); status_calc_pc(sd, 0); - clif_displaymessage(fd, msg_txt(42)); // Stat changed. + clif->displaymessage(fd, msg_txt(42)); // Stat changed. } else { if (value < 0) - clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value. + clif->displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value. else - clif_displaymessage(fd, msg_txt(149)); // Unable to increase the number/value. + clif->displaymessage(fd, msg_txt(149)); // Unable to increase the number/value. return -1; } @@ -2518,20 +2518,20 @@ ACMD_FUNC(stat_all) if (new_value != (int)*status[index]) { *status[index] = new_value; - clif_updatestatus(sd, SP_STR + index); - clif_updatestatus(sd, SP_USTR + index); + clif->updatestatus(sd, SP_STR + index); + clif->updatestatus(sd, SP_USTR + index); count++; } } if (count > 0) { // if at least 1 stat modified status_calc_pc(sd, 0); - clif_displaymessage(fd, msg_txt(84)); // All stats changed! + clif->displaymessage(fd, msg_txt(84)); // All stats changed! } else { if (value < 0) - clif_displaymessage(fd, msg_txt(177)); // You cannot decrease that stat anymore. + clif->displaymessage(fd, msg_txt(177)); // You cannot decrease that stat anymore. else - clif_displaymessage(fd, msg_txt(178)); // You cannot increase that stat anymore. + clif->displaymessage(fd, msg_txt(178)); // You cannot increase that stat anymore. return -1; } @@ -2549,16 +2549,16 @@ ACMD_FUNC(guildlevelup) nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%d", &level) < 1 || level == 0) { - clif_displaymessage(fd, msg_txt(1014)); // Please enter a valid level (usage: @guildlvup/@guildlvlup <# of levels>). + clif->displaymessage(fd, msg_txt(1014)); // Please enter a valid level (usage: @guildlvup/@guildlvlup <# of levels>). return -1; } if (sd->status.guild_id <= 0 || (guild_info = guild_search(sd->status.guild_id)) == NULL) { - clif_displaymessage(fd, msg_txt(43)); // You're not in a guild. + clif->displaymessage(fd, msg_txt(43)); // You're not in a guild. return -1; } //if (strcmp(sd->status.name, guild_info->master) != 0) { - // clif_displaymessage(fd, msg_txt(44)); // You're not the master of your guild. + // clif->displaymessage(fd, msg_txt(44)); // You're not the master of your guild. // return -1; //} @@ -2570,9 +2570,9 @@ ACMD_FUNC(guildlevelup) if (added_level != 0) { intif_guild_change_basicinfo(guild_info->guild_id, GBI_GUILDLV, &added_level, sizeof(added_level)); - clif_displaymessage(fd, msg_txt(179)); // Guild level changed. + clif->displaymessage(fd, msg_txt(179)); // Guild level changed. } else { - clif_displaymessage(fd, msg_txt(45)); // Guild level change failed. + clif->displaymessage(fd, msg_txt(45)); // Guild level change failed. return -1; } @@ -2589,7 +2589,7 @@ ACMD_FUNC(makeegg) nullpo_retr(-1, sd); if (!message || !*message) { - clif_displaymessage(fd, msg_txt(1015)); // Please enter a monster/egg name/ID (usage: @makeegg ). + clif->displaymessage(fd, msg_txt(1015)); // Please enter a monster/egg name/ID (usage: @makeegg ). return -1; } @@ -2612,7 +2612,7 @@ ACMD_FUNC(makeegg) (short)pet_db[pet_id].EggID, 0, (short)pet_db[pet_id].intimate, 100, 0, 1, pet_db[pet_id].jname); } else { - clif_displaymessage(fd, msg_txt(180)); // The monster/egg name/id doesn't exist. + clif->displaymessage(fd, msg_txt(180)); // The monster/egg name/id doesn't exist. return -1; } @@ -2626,9 +2626,9 @@ ACMD_FUNC(hatch) { nullpo_retr(-1, sd); if (sd->status.pet_id <= 0) - clif_sendegg(sd); + clif->sendegg(sd); else { - clif_displaymessage(fd, msg_txt(181)); // You already have a pet. + clif->displaymessage(fd, msg_txt(181)); // You already have a pet. return -1; } @@ -2645,30 +2645,30 @@ ACMD_FUNC(petfriendly) nullpo_retr(-1, sd); if (!message || !*message || (friendly = atoi(message)) < 0) { - clif_displaymessage(fd, msg_txt(1016)); // Please enter a valid value (usage: @petfriendly <0-1000>). + clif->displaymessage(fd, msg_txt(1016)); // Please enter a valid value (usage: @petfriendly <0-1000>). return -1; } pd = sd->pd; if (!pd) { - clif_displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet. + clif->displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet. return -1; } if (friendly < 0 || friendly > 1000) { - clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified. return -1; } if (friendly == pd->pet.intimate) { - clif_displaymessage(fd, msg_txt(183)); // Pet intimacy is already at maximum. + clif->displaymessage(fd, msg_txt(183)); // Pet intimacy is already at maximum. return -1; } pet_set_intimate(pd, friendly); - clif_send_petstatus(sd); - clif_displaymessage(fd, msg_txt(182)); // Pet intimacy changed. + clif->send_petstatus(sd); + clif->displaymessage(fd, msg_txt(182)); // Pet intimacy changed. return 0; } @@ -2682,27 +2682,27 @@ ACMD_FUNC(pethungry) nullpo_retr(-1, sd); if (!message || !*message || (hungry = atoi(message)) < 0) { - clif_displaymessage(fd, msg_txt(1017)); // Please enter a valid number (usage: @pethungry <0-100>). + clif->displaymessage(fd, msg_txt(1017)); // Please enter a valid number (usage: @pethungry <0-100>). return -1; } pd = sd->pd; if (!sd->status.pet_id || !pd) { - clif_displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet. + clif->displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet. return -1; } if (hungry < 0 || hungry > 100) { - clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified. return -1; } if (hungry == pd->pet.hungry) { - clif_displaymessage(fd, msg_txt(186)); // Pet hunger is already at maximum. + clif->displaymessage(fd, msg_txt(186)); // Pet hunger is already at maximum. return -1; } pd->pet.hungry = hungry; - clif_send_petstatus(sd); - clif_displaymessage(fd, msg_txt(185)); // Pet hunger changed. + clif->send_petstatus(sd); + clif->displaymessage(fd, msg_txt(185)); // Pet hunger changed. return 0; } @@ -2715,19 +2715,19 @@ ACMD_FUNC(petrename) struct pet_data *pd; nullpo_retr(-1, sd); if (!sd->status.pet_id || !sd->pd) { - clif_displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet. + clif->displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet. return -1; } pd = sd->pd; if (!pd->pet.rename_flag) { - clif_displaymessage(fd, msg_txt(188)); // You can already rename your pet. + clif->displaymessage(fd, msg_txt(188)); // You can already rename your pet. return -1; } pd->pet.rename_flag = 0; intif_save_petdata(sd->status.account_id, &pd->pet); - clif_send_petstatus(sd); - clif_displaymessage(fd, msg_txt(187)); // You can now rename your pet. + clif->send_petstatus(sd); + clif->displaymessage(fd, msg_txt(187)); // You can now rename your pet. return 0; } @@ -2741,28 +2741,28 @@ ACMD_FUNC(recall) { nullpo_retr(-1, sd); if (!message || !*message) { - clif_displaymessage(fd, msg_txt(1018)); // Please enter a player name (usage: @recall ). + clif->displaymessage(fd, msg_txt(1018)); // Please enter a player name (usage: @recall ). return -1; } if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL) { - clif_displaymessage(fd, msg_txt(3)); // Character not found. + clif->displaymessage(fd, msg_txt(3)); // Character not found. return -1; } if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) ) { - clif_displaymessage(fd, msg_txt(81)); // Your GM level doesn't authorize you to preform this action on the specified player. + clif->displaymessage(fd, msg_txt(81)); // Your GM level doesn't authorize you to preform this action on the specified player. return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(1019)); // You are not authorized to warp someone to this map. + clif->displaymessage(fd, msg_txt(1019)); // You are not authorized to warp someone to this map. return -1; } if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(1020)); // You are not authorized to warp this player from their map. + clif->displaymessage(fd, msg_txt(1020)); // You are not authorized to warp this player from their map. return -1; } if (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y) { @@ -2770,7 +2770,7 @@ ACMD_FUNC(recall) { } pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN); sprintf(atcmd_output, msg_txt(46), pl_sd->status.name); // %s recalled! - clif_displaymessage(fd, atcmd_output); + clif->displaymessage(fd, atcmd_output); return 0; } @@ -2786,12 +2786,12 @@ ACMD_FUNC(char_block) memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { - clif_displaymessage(fd, msg_txt(1021)); // Please enter a player name (usage: @charblock/@block ). + clif->displaymessage(fd, msg_txt(1021)); // Please enter a player name (usage: @charblock/@block ). return -1; } chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 1, 0, 0, 0, 0, 0, 0); // type: 1 - block - clif_displaymessage(fd, msg_txt(88)); // Character name sent to char-server to ask it. + clif->displaymessage(fd, msg_txt(88)); // Character name sent to char-server to ask it. return 0; } @@ -2823,7 +2823,7 @@ ACMD_FUNC(char_ban) memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%255s %23[^\n]", atcmd_output, atcmd_player_name) < 2) { - clif_displaymessage(fd, msg_txt(1022)); // Please enter ban time and a player name (usage: @charban/@ban/@banish/@charbanish