From 7ec1e8fdff6adad1979d750774f9003f223bf3ef Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 30 Mar 2013 23:08:08 -0300 Subject: Hercules Renewal: clif.c complete Added the last missing functions into the interface, all functions in clif.c are now wired to the interface. http://hercules.ws/board/topic/237-hercules-renewal/ Also shortened clif->displaymessage to clif->message, removed the old clif->message and merged its functionality with clif->disp_overhead (both use the same packet and do the same thing :P) - and a gazillion other stuff: http://hercules.ws/board/topic/316-introducing-hercules-channel-system/ Signed-off-by: shennetsind --- src/char/char.c | 2 +- src/char/inter.c | 3 - src/char/inter.h | 2 - src/common/mmo.h | 5 +- src/map/atcommand.c | 1901 ++++++++++++++------------ src/map/battle.c | 54 +- src/map/buyingstore.c | 14 +- src/map/chat.c | 4 +- src/map/chrif.c | 14 +- src/map/clif.c | 3536 +++++++++++++++++++++++++++---------------------- src/map/clif.h | 313 ++++- src/map/guild.c | 153 ++- src/map/homunculus.c | 2 +- src/map/intif.c | 13 +- src/map/map.c | 38 +- src/map/map.h | 7 +- src/map/npc.c | 2 + src/map/party.c | 14 +- src/map/pc.c | 39 +- src/map/pc.h | 12 +- src/map/pc_groups.h | 2 + src/map/pet.c | 2 +- src/map/script.c | 26 +- src/map/skill.c | 10 +- src/map/storage.c | 8 +- src/map/trade.c | 8 +- src/map/vending.c | 4 +- 27 files changed, 3579 insertions(+), 2609 deletions(-) (limited to 'src') diff --git a/src/char/char.c b/src/char/char.c index 1745c061f..9e2400ddf 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -1465,7 +1465,7 @@ int check_char_name(char * name, char * esc_name) return -2; // control chars in name // check for reserved names - if( strcmpi(name, main_chat_nick) == 0 || strcmpi(name, wisp_server_name) == 0 ) + if( strcmpi(name, wisp_server_name) == 0 ) return -1; // nick reserved for internal server messages // Check Authorised letters/symbols in the name of the character diff --git a/src/char/inter.c b/src/char/inter.c index da790e200..dec217d02 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -43,7 +43,6 @@ char default_codepage[32] = ""; //Feature by irmin. static struct accreg *accreg_pt; unsigned int party_share_level = 10; -char main_chat_nick[16] = "Main"; // recv. packet list int inter_recv_packet_length[] = { @@ -731,8 +730,6 @@ static int inter_config_read(const char* cfgName) party_share_level = atoi(w2); else if(!strcmpi(w1,"log_inter")) log_inter = atoi(w2); - else if(!strcmpi(w1,"main_chat_nick")) - safestrncpy(main_chat_nick, w2, sizeof(main_chat_nick)); else if(!strcmpi(w1,"import")) inter_config_read(w2); } diff --git a/src/char/inter.h b/src/char/inter.h index 9f99197eb..e34c54c16 100644 --- a/src/char/inter.h +++ b/src/char/inter.h @@ -23,8 +23,6 @@ extern unsigned int party_share_level; extern Sql* sql_handle; extern Sql* lsql_handle; -extern char main_chat_nick[16]; - int inter_accreg_tosql(int account_id, int char_id, struct accreg *reg, int type); uint64 inter_chk_lastuid(int8 flag, uint64 value); diff --git a/src/common/mmo.h b/src/common/mmo.h index 56770fe02..7d1928201 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -5,6 +5,7 @@ #define _MMO_H_ #include "cbasetypes.h" +#include "../common/db.h" #include // server->client protocol version @@ -510,8 +511,10 @@ struct guild { struct guild_alliance alliance[MAX_GUILDALLIANCE]; struct guild_expulsion expulsion[MAX_GUILDEXPULSION]; struct guild_skill skill[MAX_GUILDSKILL]; - + + /* TODO: still used for something?|: */ unsigned short save_flag; // for TXT saving + void *channel; }; struct guild_castle { diff --git a/src/map/atcommand.c b/src/map/atcommand.c index a585e6cc8..94838f699 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->message(fd, msg_txt(i)); return -1; } #define PARSE_ERROR(error,p) \ {\ - clif->displaymessage(fd, (error));\ + clif->message(fd, (error));\ sprintf(atcmd_output, ">%s", (p));\ - clif->displaymessage(fd, atcmd_output);\ + clif->message(fd, atcmd_output);\ } //define PARSE_ERROR #define CHECK_EOS(p) \ if(*(p) == 0){\ - clif->displaymessage(fd, "Unexpected end of string");\ + clif->message(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->message(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->message(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->message(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->message(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->message(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->message(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->message(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->message(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->message(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->message(fd, msg_txt(1)); // Map not found. return -1; } - clif->displaymessage(fd, msg_txt(0)); // Warped. + clif->message(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->message(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->message(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->message(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->message(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->message(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->message(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->message(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->message(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->message(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->message(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->message(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->message(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->message(fd, atcmd_output); return 0; } @@ -667,7 +667,7 @@ ACMD_FUNC(who) } default: { struct party_data *p = party_search(pl_sd->status.party_id); - struct guild *g = guild_search(pl_sd->status.guild_id); + struct guild *g = pl_sd->guild; StringBuf_Printf(&buf, msg_txt(343), pl_sd->status.name); // "Name: %s " if (pc_get_group_id(pl_sd) > 0) // Player title, if exists @@ -679,7 +679,7 @@ ACMD_FUNC(who) break; } } - clif->displaymessage(fd, StringBuf_Value(&buf)); + clif->message(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->message(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->message(fd, atcmd_output); count++; continue; } @@ -762,31 +762,31 @@ 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->message(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->message(fd, atcmd_output); p = party_search(pl_sd->status.party_id); - g = guild_search(pl_sd->status.guild_id); + g = pl_sd->guild; 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->message(fd, atcmd_output); count++; } mapit_free(iter); if (count == 0) - clif->displaymessage(fd, msg_txt(150)); // No GM found. + clif->message(fd, msg_txt(150)); // No GM found. else if (count == 1) - clif->displaymessage(fd, msg_txt(151)); // 1 GM found. + clif->message(fd, msg_txt(151)); // 1 GM found. else { sprintf(atcmd_output, msg_txt(152), count); // %d GMs found. - clif->displaymessage(fd, atcmd_output); + clif->message(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->message(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->message(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->message(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->message(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->message(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->message(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->message(fd, msg_txt(250)); return -1; } - clif->displaymessage(fd, msg_txt(919)); // Storage opened. + clif->message(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->message(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->message(fd, msg_txt(250)); return -1; } if (sd->state.storage_flag == 2) { - clif->displaymessage(fd, msg_txt(251)); + clif->message(fd, msg_txt(251)); return -1; } storage_guild_storageopen(sd); - clif->displaymessage(fd, msg_txt(920)); // Guild storage opened. + clif->message(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->message(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->message( 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->message(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->message(fd, msg_txt(10)); // Invisible: Off // increment the number of pvp players on the map map[sd->bl.m].users_pvp++; @@ -971,7 +971,7 @@ ACMD_FUNC(hide) } else { sd->sc.option |= OPTION_INVISIBLE; sd->vd.class_ = INVISIBLE_CLASS; - clif->displaymessage(fd, msg_txt(11)); // Invisible: On + clif->message(fd, msg_txt(11)); // Invisible: On // decrement the number of pvp players on the map map[sd->bl.m].users_pvp--; @@ -1011,7 +1011,7 @@ ACMD_FUNC(jobchange) if (!found) { text = atcommand_help_string(command); if (text) - clif->displaymessage(fd, text); + clif->message(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->message(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->message(fd, msg_txt(12)); // Your job has been changed. else { - clif->displaymessage(fd, msg_txt(155)); // You are unable to change your job. + clif->message(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->message(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->message(sd->fd, msg_txt(13)); // A pity! You've died. if (fd != sd->fd) - clif->displaymessage(fd, msg_txt(14)); // Character killed. + clif->message(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->message(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->message(fd, msg_txt(16)); // You've been revived! It's a miracle! return 0; } @@ -1082,7 +1082,7 @@ 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->message(fd, msg_txt(980)); // Please enter a message (usage: @kami ). return -1; } @@ -1093,12 +1093,12 @@ ACMD_FUNC(kami) 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->message(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->message(fd, msg_txt(982)); // Invalid color. return -1; } intif_broadcast2(atcmd_output, strlen(atcmd_output) + 1, color, 0x190, 12, 0, 0); @@ -1113,33 +1113,40 @@ ACMD_FUNC(heal) { int hp = 0, sp = 0; // [Valaris] thanks to fov nullpo_retr(-1, sd); - + sscanf(message, "%d %d", &hp, &sp); + WFIFOHEAD(fd, 4); + WFIFOW(fd, 0) = 0x23e; + WFIFOW(fd, 2) = hp; + WFIFOSET(fd, 4); + ShowDebug("Sending~! %d\n",hp); + + // some overflow checks if( hp == INT_MIN ) hp++; if( sp == INT_MIN ) sp++; 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->message(fd, msg_txt(157)); // HP and SP have already been recovered. else - clif->displaymessage(fd, msg_txt(17)); // HP, SP recovered. + clif->message(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->message(fd, msg_txt(157)); // HP and SP are already with the good value. else - clif->displaymessage(fd, msg_txt(17)); // HP, SP recovered. + clif->message(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->message(fd, msg_txt(156)); // HP or/and SP modified. return 0; } @@ -1160,7 +1167,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->message(fd, msg_txt(156)); // HP or/and SP modified. return 0; } @@ -1182,7 +1189,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->message(fd, msg_txt(983)); // Please enter an item name or ID (usage: @item ). return -1; } @@ -1192,7 +1199,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->message(fd, msg_txt(19)); // Invalid item ID or name. return -1; } @@ -1215,7 +1222,7 @@ ACMD_FUNC(item) } if (flag == 0) - clif->displaymessage(fd, msg_txt(18)); // Item created. + clif->message(fd, msg_txt(18)); // Item created. return 0; } @@ -1238,8 +1245,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->message(fd, msg_txt(984)); // Please enter all parameters (usage: @item2 + clif->message(fd, msg_txt(985)); // ). return -1; } @@ -1287,9 +1294,9 @@ ACMD_FUNC(item2) } if (flag == 0) - clif->displaymessage(fd, msg_txt(18)); // Item created. + clif->message(fd, msg_txt(18)); // Item created. } else { - clif->displaymessage(fd, msg_txt(19)); // Invalid item ID or name. + clif->message(fd, msg_txt(19)); // Invalid item ID or name. return -1; } @@ -1309,7 +1316,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->message(fd, msg_txt(20)); // All of your items have been removed. return 0; } @@ -1324,13 +1331,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->message(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->message(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 @@ -1342,10 +1349,10 @@ ACMD_FUNC(baselevelup) 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->message(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->message(fd, msg_txt(158)); // Base level can't go any lower. return -1; } level*=-1; @@ -1360,7 +1367,7 @@ 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->message(fd, msg_txt(22)); // Base level lowered. } sd->status.base_exp = 0; clif->updatestatus(sd, SP_STATUSPOINT); @@ -1385,12 +1392,12 @@ 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->message(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->message(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 @@ -1398,10 +1405,10 @@ ACMD_FUNC(joblevelup) 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->message(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->message(fd, msg_txt(159)); // Job level can't go any lower. return -1; } level *=-1; @@ -1414,7 +1421,7 @@ ACMD_FUNC(joblevelup) sd->status.skill_point = 0; else sd->status.skill_point -= level; - clif->displaymessage(fd, msg_txt(25)); // Job level lowered. + clif->message(fd, msg_txt(25)); // Job level lowered. } sd->status.job_exp = 0; clif->updatestatus(sd, SP_JOBLEVEL); @@ -1440,7 +1447,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->message(fd, msg_txt(27)); // "Commands help is not available." return -1; } @@ -1454,20 +1461,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->message(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->message(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->message(fd, atcmd_output); { // Display aliases DBIterator* iter; @@ -1488,12 +1495,12 @@ ACMD_FUNC(help) } dbi_destroy(iter); if (has_aliases) - clif->displaymessage(fd, StringBuf_Value(&buf)); + clif->message(fd, StringBuf_Value(&buf)); StringBuf_Destroy(&buf); } // Display help contents - clif->displaymessage(fd, text); + clif->message(fd, text); return 0; } @@ -1529,7 +1536,7 @@ 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->message(fd, msg_txt(160)); // PvP is already Off. return -1; } @@ -1539,7 +1546,7 @@ ACMD_FUNC(pvpoff) 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->message(fd, msg_txt(31)); // PvP: Off. return 0; } @@ -1565,7 +1572,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->message(fd, msg_txt(161)); // PvP is already On. return -1; } @@ -1577,7 +1584,7 @@ ACMD_FUNC(pvpon) map_foreachinmap(atcommand_pvpon_sub,sd->bl.m, BL_PC); } - clif->displaymessage(fd, msg_txt(32)); // PvP: On. + clif->message(fd, msg_txt(32)); // PvP: On. return 0; } @@ -1590,14 +1597,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->message(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); map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0); - clif->displaymessage(fd, msg_txt(33)); // GvG: Off. + clif->message(fd, msg_txt(33)); // GvG: Off. return 0; } @@ -1610,13 +1617,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->message(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->message(fd, msg_txt(34)); // GvG: On. return 0; } @@ -1634,7 +1641,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->message(fd, atcmd_output); return -1; } @@ -1644,9 +1651,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->message(fd, msg_txt(36)); // Appearence changed. } else { - clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif->message(fd, msg_txt(37)); // An invalid number was specified. return -1; } @@ -1665,15 +1672,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->message(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->message(fd, msg_txt(36)); // Appearence changed. } else { - clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif->message(fd, msg_txt(37)); // An invalid number was specified. return -1; } @@ -1692,15 +1699,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->message(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->message(fd, msg_txt(36)); // Appearence changed. } else { - clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif->message(fd, msg_txt(37)); // An invalid number was specified. return -1; } @@ -1719,15 +1726,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->message(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->message(fd, msg_txt(36)); // Appearence changed. } else { - clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif->message(fd, msg_txt(37)); // An invalid number was specified. return -1; } @@ -1793,7 +1800,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->message(sd->fd,msg_txt(995)); // You cannot use @go on this map. return 0; } @@ -1810,11 +1817,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->message(fd, msg_txt(38)); // Invalid location number, or name. if( text ) {// send the text to the client - clif->displaymessage( fd, text ); + clif->message( fd, text ); } return -1; @@ -1913,21 +1920,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->message(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->message(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->message(fd, msg_txt(0)); // Warped. } else { - clif->displaymessage(fd, msg_txt(1)); // Map not found. + clif->message(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->message(fd, msg_txt(38)); // Invalid location number or name. return -1; } @@ -1955,7 +1962,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->message(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 +1978,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->message(fd, msg_txt(80)); // Give a display name and monster name/id please. return -1; } @@ -1979,12 +1986,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->message(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->message(fd, msg_txt(83)); // Monster 'Emperium' cannot be spawned. return -1; } @@ -2018,13 +2025,13 @@ ACMD_FUNC(monster) if (count != 0) if (number == count) - clif->displaymessage(fd, msg_txt(39)); // All monster summoned! + clif->message(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->message(fd, atcmd_output); } else { - clif->displaymessage(fd, msg_txt(40)); // Invalid monster ID or name. + clif->message(fd, msg_txt(40)); // Invalid monster ID or name. return -1; } @@ -2071,7 +2078,7 @@ ACMD_FUNC(killmonster) map_foreachinmap(atkillmonster_sub, map_id, BL_MOB, -drop_flag); - clif->displaymessage(fd, msg_txt(165)); // All monsters killed! + clif->message(fd, msg_txt(165)); // All monsters killed! return 0; } @@ -2088,27 +2095,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->message(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->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(998), EQP_HAND_R); // %d: Right Hand - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(999), EQP_GARMENT); // %d: Garment - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1000), EQP_ACC_L); // %d: Left Accessory - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1001), EQP_ARMOR); // %d: Body Armor - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1002), EQP_HAND_L); // %d: Left Hand - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1003), EQP_SHOES); // %d: Shoes - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1004), EQP_ACC_R); // %d: Right Accessory - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1005), EQP_HEAD_TOP); // %d: Top Headgear - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1006), EQP_HEAD_MID); // %d: Mid Headgear - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return -1; } @@ -2143,12 +2150,12 @@ ACMD_FUNC(refine) } if (count == 0) - clif->displaymessage(fd, msg_txt(166)); // No item has been refined. + clif->message(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->message(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->message(fd, atcmd_output); } return 0; @@ -2172,13 +2179,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->message(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->message(fd, msg_txt(170)); //This item is not an equipment. return -1; } @@ -2206,7 +2213,7 @@ ACMD_FUNC(produce) 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->message(fd, atcmd_output); return -1; } @@ -2226,14 +2233,14 @@ ACMD_FUNC(memo) if( !message || !*message || sscanf(message, "%d", &position) < 1 ) { int i; - clif->displaymessage(sd->fd, msg_txt(668)); + clif->message(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->message(sd->fd, atcmd_output); } return 0; } @@ -2241,7 +2248,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->message(fd, atcmd_output); return -1; } @@ -2268,7 +2275,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->message(fd, atcmd_output); } return 0; @@ -2283,7 +2290,7 @@ 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->message(fd, msg_txt(1009)); // Please enter a status type/flag (usage: @displaystatus { { {}}}). return -1; } if (i < 2) flag = 1; @@ -2303,7 +2310,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->message(fd, msg_txt(1010)); // Please enter a number (usage: @stpoint ). return -1; } @@ -2330,12 +2337,12 @@ 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->message(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->message(fd, msg_txt(41)); // Unable to decrease the number/value. else - clif->displaymessage(fd, msg_txt(149)); // Unable to increase the number/value. + clif->message(fd, msg_txt(149)); // Unable to increase the number/value. return -1; } @@ -2352,7 +2359,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->message(fd, msg_txt(1011)); // Please enter a number (usage: @skpoint ). return -1; } @@ -2379,12 +2386,12 @@ 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->message(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->message(fd, msg_txt(41)); // Unable to decrease the number/value. else - clif->displaymessage(fd, msg_txt(149)); // Unable to increase the number/value. + clif->message(fd, msg_txt(149)); // Unable to increase the number/value. return -1; } @@ -2400,20 +2407,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->message(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->message(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->message(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->message(fd, msg_txt(176)); //ret=0 mean cmd success return 0; } @@ -2431,14 +2438,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->message(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->message(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>). return -1; } @@ -2467,12 +2474,12 @@ ACMD_FUNC(param) 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->message(fd, msg_txt(42)); // Stat changed. } else { if (value < 0) - clif->displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value. + clif->message(fd, msg_txt(41)); // Unable to decrease the number/value. else - clif->displaymessage(fd, msg_txt(149)); // Unable to increase the number/value. + clif->message(fd, msg_txt(149)); // Unable to increase the number/value. return -1; } @@ -2526,12 +2533,12 @@ ACMD_FUNC(stat_all) if (count > 0) { // if at least 1 stat modified status_calc_pc(sd, 0); - clif->displaymessage(fd, msg_txt(84)); // All stats changed! + clif->message(fd, msg_txt(84)); // All stats changed! } else { if (value < 0) - clif->displaymessage(fd, msg_txt(177)); // You cannot decrease that stat anymore. + clif->message(fd, msg_txt(177)); // You cannot decrease that stat anymore. else - clif->displaymessage(fd, msg_txt(178)); // You cannot increase that stat anymore. + clif->message(fd, msg_txt(178)); // You cannot increase that stat anymore. return -1; } @@ -2549,16 +2556,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->message(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. + if (sd->status.guild_id <= 0 || (guild_info = sd->guild) == NULL) { + clif->message(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->message(fd, msg_txt(44)); // You're not the master of your guild. // return -1; //} @@ -2570,9 +2577,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->message(fd, msg_txt(179)); // Guild level changed. } else { - clif->displaymessage(fd, msg_txt(45)); // Guild level change failed. + clif->message(fd, msg_txt(45)); // Guild level change failed. return -1; } @@ -2589,7 +2596,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->message(fd, msg_txt(1015)); // Please enter a monster/egg name/ID (usage: @makeegg ). return -1; } @@ -2612,7 +2619,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->message(fd, msg_txt(180)); // The monster/egg name/id doesn't exist. return -1; } @@ -2628,7 +2635,7 @@ ACMD_FUNC(hatch) if (sd->status.pet_id <= 0) clif->sendegg(sd); else { - clif->displaymessage(fd, msg_txt(181)); // You already have a pet. + clif->message(fd, msg_txt(181)); // You already have a pet. return -1; } @@ -2645,30 +2652,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->message(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->message(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->message(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->message(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->message(fd, msg_txt(182)); // Pet intimacy changed. return 0; } @@ -2682,27 +2689,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->message(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->message(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->message(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->message(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->message(fd, msg_txt(185)); // Pet hunger changed. return 0; } @@ -2715,19 +2722,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->message(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->message(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->message(fd, msg_txt(187)); // You can now rename your pet. return 0; } @@ -2741,28 +2748,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->message(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->message(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->message(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->message(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->message(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 +2777,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->message(fd, atcmd_output); return 0; } @@ -2786,12 +2793,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->message(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->message(fd, msg_txt(88)); // Character name sent to char-server to ask it. return 0; } @@ -2823,7 +2830,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