diff options
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 1901 |
1 files changed, 1074 insertions, 827 deletions
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 <mapname> <x> <y>). + clif->message(fd, msg_txt(909)); // Please enter a map (usage: @warp/@rura/@mapmove <mapname> <x> <y>). 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 <char name>). + clif->message(fd, msg_txt(910)); // Please enter a player name (usage: @where <char name>). 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 <char name/ID>). + clif->message(fd, msg_txt(911)); // Please enter a player name (usage: @jumpto/@warpto/@goto <char name/ID>). 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 <message>). + clif->message(fd, msg_txt(980)); // Please enter a message (usage: @kami <message>). 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 <color> <message>). + clif->message(fd, msg_txt(981)); // Please enter color and message (usage: @kamic <color> <message>). 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 <item name/ID> <quantity>). + clif->message(fd, msg_txt(983)); // Please enter an item name or ID (usage: @item <item name/ID> <quantity>). 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 <item name/ID> <quantity> - clif->displaymessage(fd, msg_txt(985)); // <identify_flag> <refine> <attribute> <card1> <card2> <card3> <card4>). + clif->message(fd, msg_txt(984)); // Please enter all parameters (usage: @item2 <item name/ID> <quantity> + clif->message(fd, msg_txt(985)); // <identify_flag> <refine> <attribute> <card1> <card2> <card3> <card4>). 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 <number of levels>). + clif->message(fd, msg_txt(986)); // Please enter a level adjustment (usage: @lvup/@blevel/@baselvlup <number of levels>). 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 <number of levels>). + clif->message(fd, msg_txt(987)); // Please enter a level adjustment (usage: @joblvup/@jlevel/@joblvlup <number of levels>). 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 <hair ID: %d-%d> <hair color: %d-%d> <clothes color: %d-%d>). 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 <clothes color: %d-%d>). - 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 <hair ID: %d-%d>). - 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 <hair color: %d-%d>). - 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 <equip position> <+/- amount>). + clif->message(fd, msg_txt(996)); // Please enter a position and an amount (usage: @refine <equip position> <+/- 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 <equip name/ID> <element> <# of very's>). + clif->message(fd, msg_txt(1007)); // Please enter at least one item name/ID (usage: @produce <equip name/ID> <element> <# 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 <memo_position:%d-%d>). - 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 <status type> <flag> <tick> {<val1> {<val2> {<val3>}}}). + clif->message(fd, msg_txt(1009)); // Please enter a status type/flag (usage: @displaystatus <status type> <flag> <tick> {<val1> {<val2> {<val3>}}}). 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 <number of points>). + clif->message(fd, msg_txt(1010)); // Please enter a number (usage: @stpoint <number of points>). 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 <number of points>). + clif->message(fd, msg_txt(1011)); // Please enter a number (usage: @skpoint <number of points>). 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 <amount>). + clif->message(fd, msg_txt(1012)); // Please enter an amount (usage: @zeny <amount>). 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 <pet>). + clif->message(fd, msg_txt(1015)); // Please enter a monster/egg name/ID (usage: @makeegg <pet>). 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 <char name/ID>). + clif->message(fd, msg_txt(1018)); // Please enter a player name (usage: @recall <char name/ID>). 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 <char name>). + clif->message(fd, msg_txt(1021)); // Please enter a player name (usage: @charblock/@block <char name>). 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 <time> <char name>). + clif->message(fd, msg_txt(1022)); // Please enter ban time and a player name (usage: @charban/@ban/@banish/@charbanish <time> <char name>). return -1; } @@ -2867,7 +2874,7 @@ ACMD_FUNC(char_ban) } } if (year == 0 && month == 0 && day == 0 && hour == 0 && minute == 0 && second == 0) { - clif->displaymessage(fd, msg_txt(85)); // Invalid time for ban command. + clif->message(fd, msg_txt(85)); // Invalid time for ban command. return -1; } /** @@ -2883,12 +2890,12 @@ ACMD_FUNC(char_ban) tmtime->tm_sec = tmtime->tm_sec + second; timestamp = mktime(tmtime); if( timestamp <= time(NULL) && !pc_can_use_command(sd, "unban", COMMAND_ATCOMMAND) ) { - clif->displaymessage(fd,msg_txt(1023)); // You are not allowed to reduce the length of a ban. + clif->message(fd,msg_txt(1023)); // You are not allowed to reduce the length of a ban. return -1; } chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 2, year, month, day, hour, minute, second); // type: 2 - ban - 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; } @@ -2903,13 +2910,13 @@ ACMD_FUNC(char_unblock) 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(1024)); // Please enter a player name (usage: @charunblock <char name>). + clif->message(fd, msg_txt(1024)); // Please enter a player name (usage: @charunblock <char name>). return -1; } // send answer to login server via char-server chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 3, 0, 0, 0, 0, 0, 0); // type: 3 - unblock - 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; } @@ -2924,13 +2931,13 @@ ACMD_FUNC(char_unban) 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(1025)); // Please enter a player name (usage: @charunban <char name>). + clif->message(fd, msg_txt(1025)); // Please enter a player name (usage: @charunban <char name>). return -1; } // send answer to login server via char-server chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 4, 0, 0, 0, 0, 0, 0); // type: 4 - unban - 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; } @@ -2945,7 +2952,7 @@ ACMD_FUNC(night) if (night_flag != 1) { map_night_timer(night_timer_tid, 0, 0, 1); } else { - clif->displaymessage(fd, msg_txt(89)); // Night mode is already enabled. + clif->message(fd, msg_txt(89)); // Night mode is already enabled. return -1; } @@ -2962,7 +2969,7 @@ ACMD_FUNC(day) if (night_flag != 0) { map_day_timer(day_timer_tid, 0, 0, 1); } else { - clif->displaymessage(fd, msg_txt(90)); // Day mode is already enabled. + clif->message(fd, msg_txt(90)); // Day mode is already enabled. return -1; } @@ -2986,12 +2993,12 @@ ACMD_FUNC(doom) { status_kill(&pl_sd->bl); clif->specialeffect(&pl_sd->bl,450,AREA); - clif->displaymessage(pl_sd->fd, msg_txt(61)); // The holy messenger has given judgement. + clif->message(pl_sd->fd, msg_txt(61)); // The holy messenger has given judgement. } } mapit_free(iter); - clif->displaymessage(fd, msg_txt(62)); // Judgement was made. + clif->message(fd, msg_txt(62)); // Judgement was made. return 0; } @@ -3013,12 +3020,12 @@ ACMD_FUNC(doommap) { status_kill(&pl_sd->bl); clif->specialeffect(&pl_sd->bl,450,AREA); - clif->displaymessage(pl_sd->fd, msg_txt(61)); // The holy messenger has given judgement. + clif->message(pl_sd->fd, msg_txt(61)); // The holy messenger has given judgement. } } mapit_free(iter); - clif->displaymessage(fd, msg_txt(62)); // Judgement was made. + clif->message(fd, msg_txt(62)); // Judgement was made. return 0; } @@ -3031,7 +3038,7 @@ static void atcommand_raise_sub(struct map_session_data* sd) { status_revive(&sd->bl, 100, 100); clif->skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1); - clif->displaymessage(sd->fd, msg_txt(63)); // Mercy has been shown. + clif->message(sd->fd, msg_txt(63)); // Mercy has been shown. } /*========================================== @@ -3050,7 +3057,7 @@ ACMD_FUNC(raise) atcommand_raise_sub(pl_sd); mapit_free(iter); - clif->displaymessage(fd, msg_txt(64)); // Mercy has been granted. + clif->message(fd, msg_txt(64)); // Mercy has been granted. return 0; } @@ -3071,7 +3078,7 @@ ACMD_FUNC(raisemap) atcommand_raise_sub(pl_sd); mapit_free(iter); - clif->displaymessage(fd, msg_txt(64)); // Mercy has been granted. + clif->message(fd, msg_txt(64)); // Mercy has been granted. return 0; } @@ -3087,19 +3094,19 @@ ACMD_FUNC(kick) memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message) { - clif->displaymessage(fd, msg_txt(1026)); // Please enter a player name (usage: @kick <char name/ID>). + clif->message(fd, msg_txt(1026)); // Please enter a player name (usage: @kick <char name/ID>). 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 don't authorise you to do this action on this player. + clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. return -1; } @@ -3127,7 +3134,7 @@ ACMD_FUNC(kickall) } mapit_free(iter); - clif->displaymessage(fd, msg_txt(195)); // All players have been kicked! + clif->message(fd, msg_txt(195)); // All players have been kicked! return 0; } @@ -3141,7 +3148,7 @@ ACMD_FUNC(allskill) pc_allskillup(sd); // all skills sd->status.skill_point = 0; // 0 skill points clif->updatestatus(sd, SP_SKILLPOINT); // update - clif->displaymessage(fd, msg_txt(76)); // All skills have been added to your skill tree. + clif->message(fd, msg_txt(76)); // All skills have been added to your skill tree. return 0; } @@ -3162,30 +3169,30 @@ ACMD_FUNC(questskill) text = atcommand_help_string( command ); // send the error message as always - clif->displaymessage(fd, msg_txt(1027)); // Please enter a quest skill number. + clif->message(fd, msg_txt(1027)); // Please enter a quest skill number. if( text ) {// send the skill ID list associated with this command - clif->displaymessage( fd, text ); + clif->message( fd, text ); } return -1; } if (skill_id >= MAX_SKILL_DB) { - clif->displaymessage(fd, msg_txt(198)); // This skill number doesn't exist. + clif->message(fd, msg_txt(198)); // This skill number doesn't exist. return -1; } if (!(skill->get_inf2(skill_id) & INF2_QUEST_SKILL)) { - clif->displaymessage(fd, msg_txt(197)); // This skill number doesn't exist or isn't a quest skill. + clif->message(fd, msg_txt(197)); // This skill number doesn't exist or isn't a quest skill. return -1; } if (pc_checkskill(sd, skill_id) > 0) { - clif->displaymessage(fd, msg_txt(196)); // You already have this quest skill. + clif->message(fd, msg_txt(196)); // You already have this quest skill. return -1; } pc_skill(sd, skill_id, 1, 0); - clif->displaymessage(fd, msg_txt(70)); // You have learned the skill. + clif->message(fd, msg_txt(70)); // You have learned the skill. return 0; } @@ -3206,32 +3213,32 @@ ACMD_FUNC(lostskill) text = atcommand_help_string( command ); // send the error message as always - clif->displaymessage(fd, msg_txt(1027)); // Please enter a quest skill number. + clif->message(fd, msg_txt(1027)); // Please enter a quest skill number. if( text ) {// send the skill ID list associated with this command - clif->displaymessage( fd, text ); + clif->message( fd, text ); } return -1; } if (skill_id >= MAX_SKILL) { - clif->displaymessage(fd, msg_txt(198)); // This skill number doesn't exist. + clif->message(fd, msg_txt(198)); // This skill number doesn't exist. return -1; } if (!(skill->get_inf2(skill_id) & INF2_QUEST_SKILL)) { - clif->displaymessage(fd, msg_txt(197)); // This skill number doesn't exist or isn't a quest skill. + clif->message(fd, msg_txt(197)); // This skill number doesn't exist or isn't a quest skill. return -1; } if (pc_checkskill(sd, skill_id) == 0) { - clif->displaymessage(fd, msg_txt(201)); // You don't have this quest skill. + clif->message(fd, msg_txt(201)); // You don't have this quest skill. return -1; } sd->status.skill[skill_id].lv = 0; sd->status.skill[skill_id].flag = 0; clif->deleteskill(sd,skill_id); - clif->displaymessage(fd, msg_txt(71)); // You have forgotten the skill. + clif->message(fd, msg_txt(71)); // You have forgotten the skill. return 0; } @@ -3251,7 +3258,7 @@ ACMD_FUNC(spiritball) { char msg[CHAT_SIZE_MAX]; safesnprintf(msg, sizeof(msg), msg_txt(1028), max_spiritballs); // Please enter a party name (usage: @party <party_name>). - clif->displaymessage(fd, msg); + clif->message(fd, msg); return -1; } @@ -3275,7 +3282,7 @@ ACMD_FUNC(party) memset(party, '\0', sizeof(party)); if (!message || !*message || sscanf(message, "%23[^\n]", party) < 1) { - clif->displaymessage(fd, msg_txt(1029)); // Please enter a party name (usage: @party <party_name>). + clif->message(fd, msg_txt(1029)); // Please enter a party name (usage: @party <party_name>). return -1; } @@ -3296,7 +3303,7 @@ ACMD_FUNC(guild) memset(guild, '\0', sizeof(guild)); if (!message || !*message || sscanf(message, "%23[^\n]", guild) < 1) { - clif->displaymessage(fd, msg_txt(1030)); // Please enter a guild name (usage: @guild <guild_name>). + clif->message(fd, msg_txt(1030)); // Please enter a guild name (usage: @guild <guild_name>). return -1; } @@ -3314,7 +3321,7 @@ ACMD_FUNC(breakguild) if (sd->status.guild_id) { // Check if the player has a guild struct guild *g; - g = guild_search(sd->status.guild_id); // Search the guild + g = sd->guild; // Search the guild if (g) { // Check if guild was found if (sd->state.gmaster_flag) { // Check if player is guild master int ret = 0; @@ -3325,15 +3332,15 @@ ACMD_FUNC(breakguild) return -1; // Something went wrong } } else { // Not guild master - clif->displaymessage(fd, msg_txt(1181)); // You need to be a Guild Master to use this command. + clif->message(fd, msg_txt(1181)); // You need to be a Guild Master to use this command. return -1; } } else { // Guild was not found. HOW? - clif->displaymessage(fd, msg_txt(252)); // You are not in a guild. + clif->message(fd, msg_txt(252)); // You are not in a guild. return -1; } } else { // Player does not have a guild - clif->displaymessage(fd, msg_txt(252)); // You are not in a guild. + clif->message(fd, msg_txt(252)); // You are not in a guild. return -1; } return 0; @@ -3346,13 +3353,13 @@ ACMD_FUNC(agitstart) { nullpo_retr(-1, sd); if (agit_flag == 1) { - clif->displaymessage(fd, msg_txt(73)); // War of Emperium is currently in progress. + clif->message(fd, msg_txt(73)); // War of Emperium is currently in progress. return -1; } agit_flag = 1; guild_agit_start(); - clif->displaymessage(fd, msg_txt(72)); // War of Emperium has been initiated. + clif->message(fd, msg_txt(72)); // War of Emperium has been initiated. return 0; } @@ -3364,13 +3371,13 @@ ACMD_FUNC(agitstart2) { nullpo_retr(-1, sd); if (agit2_flag == 1) { - clif->displaymessage(fd, msg_txt(404)); // "War of Emperium SE is currently in progress." + clif->message(fd, msg_txt(404)); // "War of Emperium SE is currently in progress." return -1; } agit2_flag = 1; guild_agit2_start(); - clif->displaymessage(fd, msg_txt(403)); // "War of Emperium SE has been initiated." + clif->message(fd, msg_txt(403)); // "War of Emperium SE has been initiated." return 0; } @@ -3382,13 +3389,13 @@ ACMD_FUNC(agitend) { nullpo_retr(-1, sd); if (agit_flag == 0) { - clif->displaymessage(fd, msg_txt(75)); // War of Emperium is currently not in progress. + clif->message(fd, msg_txt(75)); // War of Emperium is currently not in progress. return -1; } agit_flag = 0; guild_agit_end(); - clif->displaymessage(fd, msg_txt(74)); // War of Emperium has been ended. + clif->message(fd, msg_txt(74)); // War of Emperium has been ended. return 0; } @@ -3400,13 +3407,13 @@ ACMD_FUNC(agitend2) { nullpo_retr(-1, sd); if (agit2_flag == 0) { - clif->displaymessage(fd, msg_txt(406)); // "War of Emperium SE is currently not in progress." + clif->message(fd, msg_txt(406)); // "War of Emperium SE is currently not in progress." return -1; } agit2_flag = 0; guild_agit2_end(); - clif->displaymessage(fd, msg_txt(405)); // "War of Emperium SE has been ended." + clif->message(fd, msg_txt(405)); // "War of Emperium SE has been ended." return 0; } @@ -3436,24 +3443,24 @@ ACMD_FUNC(idsearch) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%99s", item_name) < 0) { - clif->displaymessage(fd, msg_txt(1031)); // Please enter part of an item name (usage: @idsearch <part_of_item_name>). + clif->message(fd, msg_txt(1031)); // Please enter part of an item name (usage: @idsearch <part_of_item_name>). return -1; } sprintf(atcmd_output, msg_txt(77), item_name); // The reference result of '%s' (name: id): - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); match = itemdb_searchname_array(item_array, MAX_SEARCH, item_name); if (match > MAX_SEARCH) { sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, match); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); match = MAX_SEARCH; } for(i = 0; i < match; i++) { sprintf(atcmd_output, msg_txt(78), item_array[i]->jname, item_array[i]->nameid); // %s: %d - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } sprintf(atcmd_output, msg_txt(79), match); // It is %d affair above. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return 0; } @@ -3471,7 +3478,7 @@ ACMD_FUNC(recallall) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif->displaymessage(fd, msg_txt(1032)); // You are not authorized to warp somenone to your current map. + clif->message(fd, msg_txt(1032)); // You are not authorized to warp somenone to your current map. return -1; } @@ -3496,10 +3503,10 @@ ACMD_FUNC(recallall) } mapit_free(iter); - clif->displaymessage(fd, msg_txt(92)); // All characters recalled! + clif->message(fd, msg_txt(92)); // All characters recalled! if (count) { sprintf(atcmd_output, msg_txt(1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } return 0; @@ -3521,19 +3528,19 @@ ACMD_FUNC(guildrecall) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) { - clif->displaymessage(fd, msg_txt(1034)); // Please enter a guild name/ID (usage: @guildrecall <guild_name/ID>). + clif->message(fd, msg_txt(1034)); // Please enter a guild name/ID (usage: @guildrecall <guild_name/ID>). 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(1032)); // You are not authorized to warp somenone to your current map. + clif->message(fd, msg_txt(1032)); // You are not authorized to warp somenone to your current map. return -1; } if ((g = guild_searchname(guild_name)) == NULL && // name first to avoid error when name begin with a number (g = guild_search(atoi(message))) == NULL) { - clif->displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online. + clif->message(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online. return -1; } @@ -3555,10 +3562,10 @@ ACMD_FUNC(guildrecall) mapit_free(iter); sprintf(atcmd_output, msg_txt(93), g->name); // All online characters of the %s guild have been recalled to your position. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); if (count) { sprintf(atcmd_output, msg_txt(1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } return 0; @@ -3580,19 +3587,19 @@ ACMD_FUNC(partyrecall) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%23[^\n]", party_name) < 1) { - clif->displaymessage(fd, msg_txt(1035)); // Please enter a party name/ID (usage: @partyrecall <party_name/ID>). + clif->message(fd, msg_txt(1035)); // Please enter a party name/ID (usage: @partyrecall <party_name/ID>). 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(1032)); // You are not authorized to warp somenone to your current map. + clif->message(fd, msg_txt(1032)); // You are not authorized to warp somenone to your current map. return -1; } if ((p = party_searchname(party_name)) == NULL && // name first to avoid error when name begin with a number (p = party_search(atoi(message))) == NULL) { - clif->displaymessage(fd, msg_txt(96)); // Incorrect name or ID, or no one from the party is online. + clif->message(fd, msg_txt(96)); // Incorrect name or ID, or no one from the party is online. return -1; } @@ -3614,10 +3621,10 @@ ACMD_FUNC(partyrecall) mapit_free(iter); sprintf(atcmd_output, msg_txt(95), p->party.name); // All online characters of the %s party have been recalled to your position. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); if (count) { sprintf(atcmd_output, msg_txt(1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } return 0; @@ -3630,7 +3637,7 @@ ACMD_FUNC(reloaditemdb) { nullpo_retr(-1, sd); itemdb_reload(); - clif->displaymessage(fd, msg_txt(97)); // Item database has been reloaded. + clif->message(fd, msg_txt(97)); // Item database has been reloaded. return 0; } @@ -3647,7 +3654,7 @@ ACMD_FUNC(reloadmobdb) read_mercenarydb(); read_mercenary_skilldb(); reload_elementaldb(); - clif->displaymessage(fd, msg_txt(98)); // Monster database has been reloaded. + clif->message(fd, msg_txt(98)); // Monster database has been reloaded. return 0; } @@ -3662,7 +3669,7 @@ ACMD_FUNC(reloadskilldb) merc_skill_reload(); reload_elemental_skilldb(); read_mercenary_skilldb(); - clif->displaymessage(fd, msg_txt(99)); // Skill database has been reloaded. + clif->message(fd, msg_txt(99)); // Skill database has been reloaded. return 0; } @@ -3675,14 +3682,14 @@ ACMD_FUNC(reloadatcommand) { config_t run_test; if (conf_read_file(&run_test, "conf/groups.conf")) { - clif->displaymessage(fd, msg_txt(1036)); // Error reading groups.conf, reload failed. + clif->message(fd, msg_txt(1036)); // Error reading groups.conf, reload failed. return -1; } config_destroy(&run_test); if (conf_read_file(&run_test, ATCOMMAND_CONF_FILENAME)) { - clif->displaymessage(fd, msg_txt(1037)); // Error reading atcommand.conf, reload failed. + clif->message(fd, msg_txt(1037)); // Error reading atcommand.conf, reload failed. return -1; } @@ -3690,7 +3697,7 @@ ACMD_FUNC(reloadatcommand) { atcommand_doload(); pc_groups_reload(); - clif->displaymessage(fd, msg_txt(254)); + clif->message(fd, msg_txt(254)); return 0; } /*========================================== @@ -3738,7 +3745,7 @@ ACMD_FUNC(reloadbattleconf) mob_reload(); //Needed as well so rate changes take effect. chrif_ragsrvinfo(battle_config.base_exp_rate, battle_config.job_exp_rate, battle_config.item_rate_common); } - clif->displaymessage(fd, msg_txt(255)); + clif->message(fd, msg_txt(255)); return 0; } /*========================================== @@ -3747,7 +3754,7 @@ ACMD_FUNC(reloadbattleconf) ACMD_FUNC(reloadstatusdb) { status_readdb(); - clif->displaymessage(fd, msg_txt(256)); + clif->message(fd, msg_txt(256)); return 0; } /*========================================== @@ -3756,7 +3763,7 @@ ACMD_FUNC(reloadstatusdb) ACMD_FUNC(reloadpcdb) { pc_readdb(); - clif->displaymessage(fd, msg_txt(257)); + clif->message(fd, msg_txt(257)); return 0; } @@ -3766,7 +3773,7 @@ ACMD_FUNC(reloadpcdb) ACMD_FUNC(reloadmotd) { pc_read_motd(); - clif->displaymessage(fd, msg_txt(268)); + clif->message(fd, msg_txt(268)); return 0; } @@ -3784,7 +3791,7 @@ ACMD_FUNC(reloadscript) script_reload(); npc_reload(); - clif->displaymessage(fd, msg_txt(100)); // Scripts have been reloaded. + clif->message(fd, msg_txt(100)); // Scripts have been reloaded. return 0; } @@ -3817,7 +3824,7 @@ ACMD_FUNC(mapinfo) { sscanf(message, "%d %23[^\n]", &list, mapname); if (list < 0 || list > 3) { - clif->displaymessage(fd, msg_txt(1038)); // Please enter at least one valid list number (usage: @mapinfo <0-3> <map>). + clif->message(fd, msg_txt(1038)); // Please enter at least one valid list number (usage: @mapinfo <0-3> <map>). return -1; } @@ -3829,12 +3836,12 @@ ACMD_FUNC(mapinfo) { } if (m_id < 0) { - clif->displaymessage(fd, msg_txt(1)); // Map not found. + clif->message(fd, msg_txt(1)); // Map not found. return -1; } m_index = mapindex_name2id(mapname); //This one shouldn't fail since the previous seek did not. - clif->displaymessage(fd, msg_txt(1039)); // ------ Map Info ------ + clif->message(fd, msg_txt(1039)); // ------ Map Info ------ // count chats (for initial message) chat_num = 0; @@ -3850,18 +3857,18 @@ ACMD_FUNC(mapinfo) { mapit_free(iter); sprintf(atcmd_output, msg_txt(1040), mapname, map[m_id].zone->name, map[m_id].users, map[m_id].npc_num, chat_num, vend_num); // Map: %s (Zone:%s) | Players: %d | NPCs: %d | Chats: %d | Vendings: %d - clif->displaymessage(fd, atcmd_output); - clif->displaymessage(fd, msg_txt(1041)); // ------ Map Flags ------ + clif->message(fd, atcmd_output); + clif->message(fd, msg_txt(1041)); // ------ Map Flags ------ if (map[m_id].flag.town) - clif->displaymessage(fd, msg_txt(1042)); // Town Map + clif->message(fd, msg_txt(1042)); // Town Map if (battle_config.autotrade_mapflag == map[m_id].flag.autotrade) - clif->displaymessage(fd, msg_txt(1043)); // Autotrade Enabled + clif->message(fd, msg_txt(1043)); // Autotrade Enabled else - clif->displaymessage(fd, msg_txt(1044)); // Autotrade Disabled + clif->message(fd, msg_txt(1044)); // Autotrade Disabled if (map[m_id].flag.battleground) - clif->displaymessage(fd, msg_txt(1045)); // Battlegrounds ON + clif->message(fd, msg_txt(1045)); // Battlegrounds ON strcpy(atcmd_output,msg_txt(1046)); // PvP Flags: if (map[m_id].flag.pvp) @@ -3874,7 +3881,7 @@ ACMD_FUNC(mapinfo) { strcat(atcmd_output, msg_txt(1050)); // NightmareDrop | if (map[m_id].flag.pvp_nocalcrank) strcat(atcmd_output, msg_txt(1051)); // NoCalcRank | - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); strcpy(atcmd_output,msg_txt(1052)); // GvG Flags: if (map[m_id].flag.gvg) @@ -3885,7 +3892,7 @@ ACMD_FUNC(mapinfo) { strcat(atcmd_output, msg_txt(1055)); // GvG Castle | if (map[m_id].flag.gvg_noparty) strcat(atcmd_output, msg_txt(1056)); // NoParty | - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); strcpy(atcmd_output,msg_txt(1057)); // Teleport Flags: if (map[m_id].flag.noteleport) @@ -3902,23 +3909,23 @@ ACMD_FUNC(mapinfo) { strcat(atcmd_output, msg_txt(1063)); // NoGo | if (map[m_id].flag.nomemo) strcat(atcmd_output, msg_txt(1064)); // NoMemo | - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1065), // No Exp Penalty: %s | No Zeny Penalty: %s (map[m_id].flag.noexppenalty) ? msg_txt(1066) : msg_txt(1067), (map[m_id].flag.nozenypenalty) ? msg_txt(1066) : msg_txt(1067)); // On / Off - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); if (map[m_id].flag.nosave) { if (!map[m_id].save.map) - clif->displaymessage(fd, msg_txt(1068)); // No Save (Return to last Save Point) + clif->message(fd, msg_txt(1068)); // No Save (Return to last Save Point) else if (map[m_id].save.x == -1 || map[m_id].save.y == -1 ) { sprintf(atcmd_output, msg_txt(1069), mapindex_id2name(map[m_id].save.map)); // No Save, Save Point: %s,Random - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } else { sprintf(atcmd_output, msg_txt(1070), // No Save, Save Point: %s,%d,%d mapindex_id2name(map[m_id].save.map),map[m_id].save.x,map[m_id].save.y); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } } @@ -3939,7 +3946,7 @@ ACMD_FUNC(mapinfo) { strcat(atcmd_output, msg_txt(1078)); // Leaves | if (map[m_id].flag.nightenabled) strcat(atcmd_output, msg_txt(1080)); // Displays Night | - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); strcpy(atcmd_output,msg_txt(1081)); // Other Flags: if (map[m_id].flag.nobranch) @@ -3958,7 +3965,7 @@ ACMD_FUNC(mapinfo) { strcat(atcmd_output, msg_txt(1088)); // AllowKS | if (map[m_id].flag.reset) strcat(atcmd_output, msg_txt(1089)); // Reset | - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); strcpy(atcmd_output,msg_txt(1090)); // Other Flags: if (map[m_id].nocommand) @@ -3975,27 +3982,27 @@ ACMD_FUNC(mapinfo) { strcat(atcmd_output, msg_txt(1096)); // PartyLock | if (map[m_id].flag.guildlock) strcat(atcmd_output, msg_txt(1097)); // GuildLock | - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); switch (list) { case 0: // Do nothing. It's list 0, no additional display. break; case 1: - clif->displaymessage(fd, msg_txt(1098)); // ----- Players in Map ----- + clif->message(fd, msg_txt(1098)); // ----- Players in Map ----- iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { if (pl_sd->mapindex == m_index) { sprintf(atcmd_output, msg_txt(1099), // Player '%s' (session #%d) | Location: %d,%d pl_sd->status.name, pl_sd->fd, pl_sd->bl.x, pl_sd->bl.y); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } } mapit_free(iter); break; case 2: - clif->displaymessage(fd, msg_txt(1100)); // ----- NPCs in Map ----- + clif->message(fd, msg_txt(1100)); // ----- NPCs in Map ----- for (i = 0; i < map[m_id].npc_num;) { nd = map[m_id].npc[i]; @@ -4017,11 +4024,11 @@ ACMD_FUNC(mapinfo) { else sprintf(atcmd_output, msg_txt(1112), // NPC %d: %s::%s | Direction: %s | Sprite: %d | Location: %d %d ++i, nd->name, nd->exname, direction, nd->class_, nd->bl.x, nd->bl.y); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } break; case 3: - clif->displaymessage(fd, msg_txt(1113)); // ----- Chats in Map ----- + clif->message(fd, msg_txt(1113)); // ----- Chats in Map ----- iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { @@ -4031,16 +4038,16 @@ ACMD_FUNC(mapinfo) { { sprintf(atcmd_output, msg_txt(1114), // Chat: %s | Player: %s | Location: %d %d cd->title, pl_sd->status.name, cd->bl.x, cd->bl.y); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1115), // Users: %d/%d | Password: %s | Public: %s cd->users, cd->limit, cd->pass, (cd->pub) ? msg_txt(1116) : msg_txt(1117)); // Yes / No - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } } mapit_free(iter); break; default: // normally impossible to arrive here - clif->displaymessage(fd, msg_txt(1118)); // Please enter at least one valid list number (usage: @mapinfo <0-3> <map>). + clif->message(fd, msg_txt(1118)); // Please enter at least one valid list number (usage: @mapinfo <0-3> <map>). return -1; break; } @@ -4056,36 +4063,36 @@ ACMD_FUNC(mount_peco) nullpo_retr(-1, sd); if (sd->disguise) { - clif->displaymessage(fd, msg_txt(212)); // Cannot mount while in disguise. + clif->message(fd, msg_txt(212)); // Cannot mount while in disguise. return -1; } if( (sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT && pc_checkskill(sd,RK_DRAGONTRAINING) > 0 ) { if( !(sd->sc.option&OPTION_DRAGON1) ) { - clif->displaymessage(sd->fd,msg_txt(1119)); // You have mounted your Dragon. + clif->message(sd->fd,msg_txt(1119)); // You have mounted your Dragon. pc_setoption(sd, sd->sc.option|OPTION_DRAGON1); } else { - clif->displaymessage(sd->fd,msg_txt(1120)); // You have released your Dragon. + clif->message(sd->fd,msg_txt(1120)); // You have released your Dragon. pc_setoption(sd, sd->sc.option&~OPTION_DRAGON1); } return 0; } if( (sd->class_&MAPID_THIRDMASK) == MAPID_RANGER && pc_checkskill(sd,RA_WUGRIDER) > 0 ) { if( !pc_isridingwug(sd) ) { - clif->displaymessage(sd->fd,msg_txt(1121)); // You have mounted your Warg. + clif->message(sd->fd,msg_txt(1121)); // You have mounted your Warg. pc_setoption(sd, sd->sc.option|OPTION_WUGRIDER); } else { - clif->displaymessage(sd->fd,msg_txt(1122)); // You have released your Warg. + clif->message(sd->fd,msg_txt(1122)); // You have released your Warg. pc_setoption(sd, sd->sc.option&~OPTION_WUGRIDER); } return 0; } if( (sd->class_&MAPID_THIRDMASK) == MAPID_MECHANIC ) { if( !pc_ismadogear(sd) ) { - clif->displaymessage(sd->fd,msg_txt(1123)); // You have mounted your Mado Gear. + clif->message(sd->fd,msg_txt(1123)); // You have mounted your Mado Gear. pc_setoption(sd, sd->sc.option|OPTION_MADOGEAR); } else { - clif->displaymessage(sd->fd,msg_txt(1124)); // You have released your Mado Gear. + clif->message(sd->fd,msg_txt(1124)); // You have released your Mado Gear. pc_setoption(sd, sd->sc.option&~OPTION_MADOGEAR); } return 0; @@ -4093,15 +4100,15 @@ ACMD_FUNC(mount_peco) if (!pc_isriding(sd)) { // if actually no peco if (!pc_checkskill(sd, KN_RIDING)) { - clif->displaymessage(fd, msg_txt(213)); // You can not mount a Peco Peco with your current job. + clif->message(fd, msg_txt(213)); // You can not mount a Peco Peco with your current job. return -1; } pc_setoption(sd, sd->sc.option | OPTION_RIDING); - clif->displaymessage(fd, msg_txt(102)); // You have mounted a Peco Peco. + clif->message(fd, msg_txt(102)); // You have mounted a Peco Peco. } else {//Dismount pc_setoption(sd, sd->sc.option & ~OPTION_RIDING); - clif->displaymessage(fd, msg_txt(214)); // You have released your Peco Peco. + clif->message(fd, msg_txt(214)); // You have released your Peco Peco. } return 0; @@ -4121,11 +4128,11 @@ ACMD_FUNC(guildspy) if (!enable_spy) { - clif->displaymessage(fd, msg_txt(1125)); // The mapserver has spy command support disabled. + clif->message(fd, msg_txt(1125)); // The mapserver has spy command support disabled. return -1; } if (!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) { - clif->displaymessage(fd, msg_txt(1126)); // Please enter a guild name/ID (usage: @guildspy <guild_name/ID>). + clif->message(fd, msg_txt(1126)); // Please enter a guild name/ID (usage: @guildspy <guild_name/ID>). return -1; } @@ -4134,14 +4141,14 @@ ACMD_FUNC(guildspy) if (sd->guildspy == g->guild_id) { sd->guildspy = 0; sprintf(atcmd_output, msg_txt(103), g->name); // No longer spying on the %s guild. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } else { sd->guildspy = g->guild_id; sprintf(atcmd_output, msg_txt(104), g->name); // Spying on the %s guild. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } } else { - clif->displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the specified guild is online. + clif->message(fd, msg_txt(94)); // Incorrect name/ID, or no one from the specified guild is online. return -1; } @@ -4162,12 +4169,12 @@ ACMD_FUNC(partyspy) if (!enable_spy) { - clif->displaymessage(fd, msg_txt(1125)); // The mapserver has spy command support disabled. + clif->message(fd, msg_txt(1125)); // The mapserver has spy command support disabled. return -1; } if (!message || !*message || sscanf(message, "%23[^\n]", party_name) < 1) { - clif->displaymessage(fd, msg_txt(1127)); // Please enter a party name/ID (usage: @partyspy <party_name/ID>). + clif->message(fd, msg_txt(1127)); // Please enter a party name/ID (usage: @partyspy <party_name/ID>). return -1; } @@ -4176,14 +4183,14 @@ ACMD_FUNC(partyspy) if (sd->partyspy == p->party.party_id) { sd->partyspy = 0; sprintf(atcmd_output, msg_txt(105), p->party.name); // No longer spying on the %s party. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } else { sd->partyspy = p->party.party_id; sprintf(atcmd_output, msg_txt(106), p->party.name); // Spying on the %s party. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } } else { - clif->displaymessage(fd, msg_txt(96)); // Incorrect name/ID, or no one from the specified party is online. + clif->message(fd, msg_txt(96)); // Incorrect name/ID, or no one from the specified party is online. return -1; } @@ -4210,9 +4217,9 @@ ACMD_FUNC(repairall) if (count > 0) { clif->misceffect(&sd->bl, 3); clif->equiplist(sd); - clif->displaymessage(fd, msg_txt(107)); // All items have been repaired. + clif->message(fd, msg_txt(107)); // All items have been repaired. } else { - clif->displaymessage(fd, msg_txt(108)); // No item need to be repaired. + clif->message(fd, msg_txt(108)); // No item need to be repaired. return -1; } @@ -4230,20 +4237,20 @@ ACMD_FUNC(nuke) 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(1128)); // Please enter a player name (usage: @nuke <char name>). + clif->message(fd, msg_txt(1128)); // Please enter a player name (usage: @nuke <char name>). return -1; } if ((pl_sd = map_nick2sd(atcmd_player_name)) != NULL) { if (pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { // you can kill only lower or same GM level skill->castend_nodamage_id(&pl_sd->bl, &pl_sd->bl, NPC_SELFDESTRUCTION, 99, gettick(), 0); - clif->displaymessage(fd, msg_txt(109)); // Player has been nuked! + clif->message(fd, msg_txt(109)); // Player has been nuked! } else { - clif->displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. + clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. return -1; } } else { - clif->displaymessage(fd, msg_txt(3)); // Character not found. + clif->message(fd, msg_txt(3)); // Character not found. return -1; } @@ -4263,17 +4270,17 @@ ACMD_FUNC(tonpc) memset(npcname, 0, sizeof(npcname)); if (!message || !*message || sscanf(message, "%23[^\n]", npcname) < 1) { - clif->displaymessage(fd, msg_txt(1129)); // Please enter a NPC name (usage: @tonpc <NPC_name>). + clif->message(fd, msg_txt(1129)); // Please enter a NPC name (usage: @tonpc <NPC_name>). return -1; } if ((nd = npc_name2id(npcname)) != NULL) { if (pc_setpos(sd, map_id2index(nd->bl.m), nd->bl.x, nd->bl.y, CLR_TELEPORT) == 0) - clif->displaymessage(fd, msg_txt(0)); // Warped. + clif->message(fd, msg_txt(0)); // Warped. else return -1; } else { - clif->displaymessage(fd, msg_txt(111)); // This NPC doesn't exist. + clif->message(fd, msg_txt(111)); // This NPC doesn't exist. return -1; } @@ -4291,15 +4298,15 @@ ACMD_FUNC(shownpc) memset(NPCname, '\0', sizeof(NPCname)); if (!message || !*message || sscanf(message, "%23[^\n]", NPCname) < 1) { - clif->displaymessage(fd, msg_txt(1130)); // Please enter a NPC name (usage: @enablenpc <NPC_name>). + clif->message(fd, msg_txt(1130)); // Please enter a NPC name (usage: @enablenpc <NPC_name>). return -1; } if (npc_name2id(NPCname) != NULL) { npc_enable(NPCname, 1); - clif->displaymessage(fd, msg_txt(110)); // Npc Enabled. + clif->message(fd, msg_txt(110)); // Npc Enabled. } else { - clif->displaymessage(fd, msg_txt(111)); // This NPC doesn't exist. + clif->message(fd, msg_txt(111)); // This NPC doesn't exist. return -1; } @@ -4317,17 +4324,17 @@ ACMD_FUNC(hidenpc) memset(NPCname, '\0', sizeof(NPCname)); if (!message || !*message || sscanf(message, "%23[^\n]", NPCname) < 1) { - clif->displaymessage(fd, msg_txt(1131)); // Please enter a NPC name (usage: @hidenpc <NPC_name>). + clif->message(fd, msg_txt(1131)); // Please enter a NPC name (usage: @hidenpc <NPC_name>). return -1; } if (npc_name2id(NPCname) == NULL) { - clif->displaymessage(fd, msg_txt(111)); // This NPC doesn't exist. + clif->message(fd, msg_txt(111)); // This NPC doesn't exist. return -1; } npc_enable(NPCname, 0); - clif->displaymessage(fd, msg_txt(112)); // Npc Disabled. + clif->message(fd, msg_txt(112)); // Npc Disabled. return 0; } @@ -4336,13 +4343,13 @@ ACMD_FUNC(loadnpc) FILE *fp; if (!message || !*message) { - clif->displaymessage(fd, msg_txt(1132)); // Please enter a script file name (usage: @loadnpc <file name>). + clif->message(fd, msg_txt(1132)); // Please enter a script file name (usage: @loadnpc <file name>). return -1; } // check if script file exists if ((fp = fopen(message, "r")) == NULL) { - clif->displaymessage(fd, msg_txt(261)); + clif->message(fd, msg_txt(261)); return -1; } fclose(fp); @@ -4352,7 +4359,7 @@ ACMD_FUNC(loadnpc) npc_parsesrcfile(message,true); npc_read_event_script(); - clif->displaymessage(fd, msg_txt(262)); + clif->message(fd, msg_txt(262)); return 0; } @@ -4366,19 +4373,19 @@ ACMD_FUNC(unloadnpc) memset(NPCname, '\0', sizeof(NPCname)); if (!message || !*message || sscanf(message, "%24[^\n]", NPCname) < 1) { - clif->displaymessage(fd, msg_txt(1133)); // Please enter a NPC name (usage: @npcoff <NPC_name>). + clif->message(fd, msg_txt(1133)); // Please enter a NPC name (usage: @npcoff <NPC_name>). return -1; } if ((nd = npc_name2id(NPCname)) == NULL) { - clif->displaymessage(fd, msg_txt(111)); // This NPC doesn't exist. + clif->message(fd, msg_txt(111)); // This NPC doesn't exist. return -1; } npc_unload_duplicates(nd); npc_unload(nd,true); npc_read_event_script(); - clif->displaymessage(fd, msg_txt(112)); // Npc Disabled. + clif->message(fd, msg_txt(112)); // Npc Disabled. return 0; } @@ -4440,54 +4447,54 @@ ACMD_FUNC(servertime) datetime = localtime(&time_server); // convert seconds in structure // like sprintf, but only for date/time (Sunday, November 02 2003 15:12:52) strftime(temp, sizeof(temp)-1, msg_txt(230), datetime); // Server time (normal time): %A, %B %d %Y %X. - clif->displaymessage(fd, temp); + clif->message(fd, temp); if (battle_config.night_duration == 0 && battle_config.day_duration == 0) { if (night_flag == 0) - clif->displaymessage(fd, msg_txt(231)); // Game time: The game is in permanent daylight. + clif->message(fd, msg_txt(231)); // Game time: The game is in permanent daylight. else - clif->displaymessage(fd, msg_txt(232)); // Game time: The game is in permanent night. + clif->message(fd, msg_txt(232)); // Game time: The game is in permanent night. } else if (battle_config.night_duration == 0) if (night_flag == 1) { // we start with night timer_data = get_timer(day_timer_tid); sprintf(temp, msg_txt(233), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in night for %s. - clif->displaymessage(fd, temp); - clif->displaymessage(fd, msg_txt(234)); // Game time: After, the game will be in permanent daylight. + clif->message(fd, temp); + clif->message(fd, msg_txt(234)); // Game time: After, the game will be in permanent daylight. } else - clif->displaymessage(fd, msg_txt(231)); // Game time: The game is in permanent daylight. + clif->message(fd, msg_txt(231)); // Game time: The game is in permanent daylight. else if (battle_config.day_duration == 0) if (night_flag == 0) { // we start with day timer_data = get_timer(night_timer_tid); sprintf(temp, msg_txt(235), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in daylight for %s. - clif->displaymessage(fd, temp); - clif->displaymessage(fd, msg_txt(236)); // Game time: After, the game will be in permanent night. + clif->message(fd, temp); + clif->message(fd, msg_txt(236)); // Game time: After, the game will be in permanent night. } else - clif->displaymessage(fd, msg_txt(232)); // Game time: The game is in permanent night. + clif->message(fd, msg_txt(232)); // Game time: The game is in permanent night. else { if (night_flag == 0) { timer_data = get_timer(night_timer_tid); timer_data2 = get_timer(day_timer_tid); sprintf(temp, msg_txt(235), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in daylight for %s. - clif->displaymessage(fd, temp); + clif->message(fd, temp); if (DIFF_TICK(timer_data->tick, timer_data2->tick) > 0) sprintf(temp, msg_txt(237), txt_time(DIFF_TICK(timer_data->interval,DIFF_TICK(timer_data->tick,timer_data2->tick)) / 1000)); // Game time: After, the game will be in night for %s. else sprintf(temp, msg_txt(237), txt_time(DIFF_TICK(timer_data2->tick,timer_data->tick)/1000)); // Game time: After, the game will be in night for %s. - clif->displaymessage(fd, temp); + clif->message(fd, temp); sprintf(temp, msg_txt(238), txt_time(timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s. - clif->displaymessage(fd, temp); + clif->message(fd, temp); } else { timer_data = get_timer(day_timer_tid); timer_data2 = get_timer(night_timer_tid); sprintf(temp, msg_txt(233), txt_time(DIFF_TICK(timer_data->tick,gettick()) / 1000)); // Game time: The game is actualy in night for %s. - clif->displaymessage(fd, temp); + clif->message(fd, temp); if (DIFF_TICK(timer_data->tick,timer_data2->tick) > 0) sprintf(temp, msg_txt(239), txt_time((timer_data->interval - DIFF_TICK(timer_data->tick, timer_data2->tick)) / 1000)); // Game time: After, the game will be in daylight for %s. else sprintf(temp, msg_txt(239), txt_time(DIFF_TICK(timer_data2->tick, timer_data->tick) / 1000)); // Game time: After, the game will be in daylight for %s. - clif->displaymessage(fd, temp); + clif->message(fd, temp); sprintf(temp, msg_txt(238), txt_time(timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s. - clif->displaymessage(fd, temp); + clif->message(fd, temp); } } @@ -4536,24 +4543,24 @@ ACMD_FUNC(jail) 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(1134)); // Please enter a player name (usage: @jail <char_name>). + clif->message(fd, msg_txt(1134)); // Please enter a player name (usage: @jail <char_name>). return -1; } if ((pl_sd = map_nick2sd(atcmd_player_name)) == 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)) { // you can jail only lower or same GM - clif->displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. + clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. return -1; } if (pl_sd->sc.data[SC_JAILED]) { - clif->displaymessage(fd, msg_txt(118)); // Player warped in jails. + clif->message(fd, msg_txt(118)); // Player warped in jails. return -1; } @@ -4572,8 +4579,8 @@ ACMD_FUNC(jail) //Duration of INT_MAX to specify infinity. sc_start4(&pl_sd->bl,SC_JAILED,100,INT_MAX,m_index,x,y,1000); - clif->displaymessage(pl_sd->fd, msg_txt(117)); // GM has send you in jails. - clif->displaymessage(fd, msg_txt(118)); // Player warped in jails. + clif->message(pl_sd->fd, msg_txt(117)); // GM has send you in jails. + clif->message(fd, msg_txt(118)); // Player warped in jails. return 0; } @@ -4588,31 +4595,31 @@ ACMD_FUNC(unjail) 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(1135)); // Please enter a player name (usage: @unjail/@discharge <char_name>). + clif->message(fd, msg_txt(1135)); // Please enter a player name (usage: @unjail/@discharge <char_name>). return -1; } if ((pl_sd = map_nick2sd(atcmd_player_name)) == 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)) { // you can jail only lower or same GM - clif->displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. + clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. return -1; } if (!pl_sd->sc.data[SC_JAILED]) { - clif->displaymessage(fd, msg_txt(119)); // This player is not in jails. + clif->message(fd, msg_txt(119)); // This player is not in jails. return -1; } //Reset jail time to 1 sec. sc_start(&pl_sd->bl,SC_JAILED,100,1,1000); - clif->displaymessage(pl_sd->fd, msg_txt(120)); // A GM has discharged you from jail. - clif->displaymessage(fd, msg_txt(121)); // Player unjailed. + clif->message(pl_sd->fd, msg_txt(120)); // A GM has discharged you from jail. + clif->message(fd, msg_txt(121)); // Player unjailed. return 0; } @@ -4626,7 +4633,7 @@ ACMD_FUNC(jailfor) nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%255s %23[^\n]",atcmd_output,atcmd_player_name) < 2) { - clif->displaymessage(fd, msg_txt(400)); //Usage: @jailfor <time> <character name> + clif->message(fd, msg_txt(400)); //Usage: @jailfor <time> <character name> return -1; } @@ -4668,24 +4675,24 @@ ACMD_FUNC(jailfor) } if (year == 0 && month == 0 && day == 0 && hour == 0 && minute == 0) { - clif->displaymessage(fd, msg_txt(1136)); // Invalid time for jail command. + clif->message(fd, msg_txt(1136)); // Invalid time for jail command. return -1; } if ((pl_sd = map_nick2sd(atcmd_player_name)) == 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(pl_sd) > pc_get_group_level(sd)) { - clif->displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. + clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. return -1; } jailtime = year*12*30*24*60 + month*30*24*60 + day*24*60 + hour*60 + minute; //In minutes if(jailtime==0) { - clif->displaymessage(fd, msg_txt(1136)); // Invalid time for jail command. + clif->message(fd, msg_txt(1136)); // Invalid time for jail command. return -1; } @@ -4696,17 +4703,17 @@ ACMD_FUNC(jailfor) jailtime += pl_sd->sc.data[SC_JAILED]->val1; if (jailtime <= 0) { jailtime = 0; - clif->displaymessage(pl_sd->fd, msg_txt(120)); // GM has discharge you. - clif->displaymessage(fd, msg_txt(121)); // Player unjailed + clif->message(pl_sd->fd, msg_txt(120)); // GM has discharge you. + clif->message(fd, msg_txt(121)); // Player unjailed } else { get_jail_time(jailtime,&year,&month,&day,&hour,&minute); sprintf(atcmd_output,msg_txt(402),msg_txt(1137),year,month,day,hour,minute); //%s in jail for %d years, %d months, %d days, %d hours and %d minutes - clif->displaymessage(pl_sd->fd, atcmd_output); + clif->message(pl_sd->fd, atcmd_output); sprintf(atcmd_output,msg_txt(402),msg_txt(1138),year,month,day,hour,minute); //This player is now in jail for %d years, %d months, %d days, %d hours and %d minutes - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } } else if (jailtime < 0) { - clif->displaymessage(fd, msg_txt(1136)); + clif->message(fd, msg_txt(1136)); return -1; } @@ -4736,17 +4743,17 @@ ACMD_FUNC(jailtime) nullpo_retr(-1, sd); if (!sd->sc.data[SC_JAILED]) { - clif->displaymessage(fd, msg_txt(1139)); // You are not in jail. + clif->message(fd, msg_txt(1139)); // You are not in jail. return -1; } if (sd->sc.data[SC_JAILED]->val1 == INT_MAX) { - clif->displaymessage(fd, msg_txt(1140)); // You have been jailed indefinitely. + clif->message(fd, msg_txt(1140)); // You have been jailed indefinitely. return 0; } if (sd->sc.data[SC_JAILED]->val1 <= 0) { // Was not jailed with @jailfor (maybe @jail? or warped there? or got recalled?) - clif->displaymessage(fd, msg_txt(1141)); // You have been jailed for an unknown amount of time. + clif->message(fd, msg_txt(1141)); // You have been jailed for an unknown amount of time. return -1; } @@ -4754,7 +4761,7 @@ ACMD_FUNC(jailtime) get_jail_time(sd->sc.data[SC_JAILED]->val1,&year,&month,&day,&hour,&minute); sprintf(atcmd_output,msg_txt(402),msg_txt(1142),year,month,day,hour,minute); // You will remain in jail for %d years, %d months, %d days, %d hours and %d minutes - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return 0; } @@ -4768,7 +4775,7 @@ ACMD_FUNC(disguise) nullpo_retr(-1, sd); if (!message || !*message) { - clif->displaymessage(fd, msg_txt(1143)); // Please enter a Monster/NPC name/ID (usage: @disguise <name/ID>). + clif->message(fd, msg_txt(1143)); // Please enter a Monster/NPC name/ID (usage: @disguise <name/ID>). return -1; } @@ -4787,18 +4794,18 @@ ACMD_FUNC(disguise) if (id == 0) { - clif->displaymessage(fd, msg_txt(123)); // Invalid Monster/NPC name/ID specified. + clif->message(fd, msg_txt(123)); // Invalid Monster/NPC name/ID specified. return -1; } if(pc_isriding(sd)) { - clif->displaymessage(fd, msg_txt(1144)); // Character cannot be disguised while mounted. + clif->message(fd, msg_txt(1144)); // Character cannot be disguised while mounted. return -1; } pc_disguise(sd, id); - clif->displaymessage(fd, msg_txt(122)); // Disguise applied. + clif->message(fd, msg_txt(122)); // Disguise applied. return 0; } @@ -4814,7 +4821,7 @@ ACMD_FUNC(disguiseall) nullpo_retr(-1, sd); if (!message || !*message) { - clif->displaymessage(fd, msg_txt(1145)); // Please enter a Monster/NPC name/ID (usage: @disguiseall <name/ID>). + clif->message(fd, msg_txt(1145)); // Please enter a Monster/NPC name/ID (usage: @disguiseall <name/ID>). return -1; } @@ -4822,7 +4829,7 @@ ACMD_FUNC(disguiseall) mob_id = atoi(message); if (!mobdb_checkid(mob_id) && !npcdb_checkid(mob_id)) { //if mob or npc... - clif->displaymessage(fd, msg_txt(123)); // Monster/NPC name/id not found. + clif->message(fd, msg_txt(123)); // Monster/NPC name/id not found. return -1; } @@ -4831,7 +4838,7 @@ ACMD_FUNC(disguiseall) pc_disguise(pl_sd, mob_id); mapit_free(iter); - clif->displaymessage(fd, msg_txt(122)); // Disguise applied. + clif->message(fd, msg_txt(122)); // Disguise applied. return 0; } @@ -4849,7 +4856,7 @@ ACMD_FUNC(disguiseguild) memset(guild, '\0', sizeof(guild)); if( !message || !*message || sscanf(message, "%23[^,], %23[^\r\n]", monster, guild) < 2 ) { - clif->displaymessage(fd, msg_txt(1146)); // Please enter a mob name/ID and guild name/ID (usage: @disguiseguild <mob name/ID>, <guild name/ID>). + clif->message(fd, msg_txt(1146)); // Please enter a mob name/ID and guild name/ID (usage: @disguiseguild <mob name/ID>, <guild name/ID>). return -1; } @@ -4865,12 +4872,12 @@ ACMD_FUNC(disguiseguild) } if( id == 0 ) { - clif->displaymessage(fd, msg_txt(123)); // Monster/NPC name/id hasn't been found. + clif->message(fd, msg_txt(123)); // Monster/NPC name/id hasn't been found. return -1; } if( (g = guild_searchname(guild)) == NULL && (g = guild_search(atoi(guild))) == NULL ) { - clif->displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online. + clif->message(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online. return -1; } @@ -4878,7 +4885,7 @@ ACMD_FUNC(disguiseguild) if( (pl_sd = g->member[i].sd) && !pc_isriding(pl_sd) ) pc_disguise(pl_sd, id); - clif->displaymessage(fd, msg_txt(122)); // Disguise applied. + clif->message(fd, msg_txt(122)); // Disguise applied. return 0; } @@ -4891,9 +4898,9 @@ ACMD_FUNC(undisguise) nullpo_retr(-1, sd); if (sd->disguise) { pc_disguise(sd, 0); - clif->displaymessage(fd, msg_txt(124)); // Undisguise applied. + clif->message(fd, msg_txt(124)); // Undisguise applied. } else { - clif->displaymessage(fd, msg_txt(125)); // You're not disguised. + clif->message(fd, msg_txt(125)); // You're not disguised. return -1; } @@ -4915,7 +4922,7 @@ ACMD_FUNC(undisguiseall) pc_disguise(pl_sd, 0); mapit_free(iter); - clif->displaymessage(fd, msg_txt(124)); // Undisguise applied. + clif->message(fd, msg_txt(124)); // Undisguise applied. return 0; } @@ -4934,12 +4941,12 @@ ACMD_FUNC(undisguiseguild) memset(guild_name, '\0', sizeof(guild_name)); if(!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) { - clif->displaymessage(fd, msg_txt(1147)); // Please enter guild name/ID (usage: @undisguiseguild <guild name/ID>). + clif->message(fd, msg_txt(1147)); // Please enter guild name/ID (usage: @undisguiseguild <guild name/ID>). return -1; } if( (g = guild_searchname(guild_name)) == NULL && (g = guild_search(atoi(message))) == NULL ) { - clif->displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online. + clif->message(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online. return -1; } @@ -4947,7 +4954,7 @@ ACMD_FUNC(undisguiseguild) if( (pl_sd = g->member[i].sd) && pl_sd->disguise ) pc_disguise(pl_sd, 0); - clif->displaymessage(fd, msg_txt(124)); // Undisguise applied. + clif->message(fd, msg_txt(124)); // Undisguise applied. return 0; } @@ -4971,7 +4978,7 @@ ACMD_FUNC(exp) nextj = sd->status.job_exp*100.0/nextj; sprintf(output, msg_txt(1148), sd->status.base_level, nextb, sd->status.job_level, nextj); // Base Level: %d (%.3f%%) | Job Level: %d (%.3f%%) - clif->displaymessage(fd, output); + clif->message(fd, output); return 0; } @@ -4986,7 +4993,7 @@ ACMD_FUNC(broadcast) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message) { - clif->displaymessage(fd, msg_txt(1149)); // Please enter a message (usage: @broadcast <message>). + clif->message(fd, msg_txt(1149)); // Please enter a message (usage: @broadcast <message>). return -1; } @@ -5006,7 +5013,7 @@ ACMD_FUNC(localbroadcast) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message) { - clif->displaymessage(fd, msg_txt(1150)); // Please enter a message (usage: @localbroadcast <message>). + clif->message(fd, msg_txt(1150)); // Please enter a message (usage: @localbroadcast <message>). return -1; } @@ -5030,26 +5037,26 @@ ACMD_FUNC(email) memset(new_email, '\0', sizeof(new_email)); if (!message || !*message || sscanf(message, "%99s %99s", actual_email, new_email) < 2) { - clif->displaymessage(fd, msg_txt(1151)); // Please enter 2 emails (usage: @email <actual@email> <new@email>). + clif->message(fd, msg_txt(1151)); // Please enter 2 emails (usage: @email <actual@email> <new@email>). return -1; } if (e_mail_check(actual_email) == 0) { - clif->displaymessage(fd, msg_txt(144)); // Invalid actual email. If you have default e-mail, give a@a.com. + clif->message(fd, msg_txt(144)); // Invalid actual email. If you have default e-mail, give a@a.com. return -1; } else if (e_mail_check(new_email) == 0) { - clif->displaymessage(fd, msg_txt(145)); // Invalid new email. Please enter a real e-mail. + clif->message(fd, msg_txt(145)); // Invalid new email. Please enter a real e-mail. return -1; } else if (strcmpi(new_email, "a@a.com") == 0) { - clif->displaymessage(fd, msg_txt(146)); // New email must be a real e-mail. + clif->message(fd, msg_txt(146)); // New email must be a real e-mail. return -1; } else if (strcmpi(actual_email, new_email) == 0) { - clif->displaymessage(fd, msg_txt(147)); // New email must be different of the actual e-mail. + clif->message(fd, msg_txt(147)); // New email must be different of the actual e-mail. return -1; } chrif_changeemail(sd->status.account_id, actual_email, new_email); - clif->displaymessage(fd, msg_txt(148)); // Information sended to login-server via char-server. + clif->message(fd, msg_txt(148)); // Information sended to login-server via char-server. return 0; } @@ -5062,12 +5069,12 @@ ACMD_FUNC(effect) nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%d", &type) < 1) { - clif->displaymessage(fd, msg_txt(1152)); // Please enter an effect number (usage: @effect <effect number>). + clif->message(fd, msg_txt(1152)); // Please enter an effect number (usage: @effect <effect number>). return -1; } clif->specialeffect(&sd->bl, type, (send_target)flag); - clif->displaymessage(fd, msg_txt(229)); // Your effect has changed. + clif->message(fd, msg_txt(229)); // Your effect has changed. return 0; } @@ -5081,9 +5088,9 @@ ACMD_FUNC(killer) sd->state.killer = !sd->state.killer; if(sd->state.killer) - clif->displaymessage(fd, msg_txt(241)); + clif->message(fd, msg_txt(241)); else { - clif->displaymessage(fd, msg_txt(292)); + clif->message(fd, msg_txt(292)); pc_stop_attack(sd); } return 0; @@ -5099,9 +5106,9 @@ ACMD_FUNC(killable) sd->state.killable = !sd->state.killable; if(sd->state.killable) - clif->displaymessage(fd, msg_txt(242)); + clif->message(fd, msg_txt(242)); else { - clif->displaymessage(fd, msg_txt(288)); + clif->message(fd, msg_txt(288)); map_foreachinrange(atcommand_stopattack,&sd->bl, AREA_SIZE, BL_CHAR, sd->bl.id); } return 0; @@ -5115,7 +5122,7 @@ ACMD_FUNC(skillon) { nullpo_retr(-1, sd); map[sd->bl.m].flag.noskill = 0; - clif->displaymessage(fd, msg_txt(244)); + clif->message(fd, msg_txt(244)); return 0; } @@ -5127,7 +5134,7 @@ ACMD_FUNC(skilloff) { nullpo_retr(-1, sd); map[sd->bl.m].flag.noskill = 1; - clif->displaymessage(fd, msg_txt(243)); + clif->message(fd, msg_txt(243)); return 0; } @@ -5143,19 +5150,19 @@ ACMD_FUNC(npcmove) memset(atcmd_player_name, '\0', sizeof atcmd_player_name); if (!message || !*message || sscanf(message, "%d %d %23[^\n]", &x, &y, atcmd_player_name) < 3) { - clif->displaymessage(fd, msg_txt(1153)); // Usage: @npcmove <X> <Y> <npc_name> + clif->message(fd, msg_txt(1153)); // Usage: @npcmove <X> <Y> <npc_name> return -1; } if ((nd = npc_name2id(atcmd_player_name)) == NULL) { - clif->displaymessage(fd, msg_txt(111)); // This NPC doesn't exist. + clif->message(fd, msg_txt(111)); // This NPC doesn't exist. return -1; } if ((m=nd->bl.m) < 0 || nd->bl.prev == NULL) { - clif->displaymessage(fd, msg_txt(1154)); // NPC is not on this map. + clif->message(fd, msg_txt(1154)); // NPC is not on this map. return -1; //Not on a map. } @@ -5164,7 +5171,7 @@ ACMD_FUNC(npcmove) map_foreachinrange(clif->outsight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl); map_moveblock(&nd->bl, x, y, gettick()); map_foreachinrange(clif->insight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl); - clif->displaymessage(fd, msg_txt(1155)); // NPC moved. + clif->message(fd, msg_txt(1155)); // NPC moved. return 0; } @@ -5184,7 +5191,7 @@ ACMD_FUNC(addwarp) memset(warpname, '\0', sizeof(warpname)); if (!message || !*message || sscanf(message, "%31s %d %d %23[^\n]", mapname, &x, &y, warpname) < 4) { - clif->displaymessage(fd, msg_txt(1156)); // Usage: @addwarp <mapname> <X> <Y> <npc name> + clif->message(fd, msg_txt(1156)); // Usage: @addwarp <mapname> <X> <Y> <npc name> return -1; } @@ -5192,7 +5199,7 @@ ACMD_FUNC(addwarp) if( m == 0 ) { sprintf(atcmd_output, msg_txt(1157), mapname); // Unknown map '%s'. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return -1; } @@ -5201,7 +5208,7 @@ ACMD_FUNC(addwarp) return -1; sprintf(atcmd_output, msg_txt(1158), nd->exname); // New warp NPC '%s' created. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return 0; } @@ -5219,22 +5226,22 @@ ACMD_FUNC(follow) return -1; pc_stop_following (sd); - clif->displaymessage(fd, msg_txt(1159)); // Follow mode OFF. + clif->message(fd, msg_txt(1159)); // Follow mode OFF. return 0; } if ( (pl_sd = map_nick2sd((char *)message)) == NULL ) { - clif->displaymessage(fd, msg_txt(3)); // Character not found. + clif->message(fd, msg_txt(3)); // Character not found. return -1; } if (sd->followtarget == pl_sd->bl.id) { pc_stop_following (sd); - clif->displaymessage(fd, msg_txt(1159)); // Follow mode OFF. + clif->message(fd, msg_txt(1159)); // Follow mode OFF. } else { pc_follow(sd, pl_sd->bl.id); - clif->displaymessage(fd, msg_txt(1160)); // Follow mode ON. + clif->message(fd, msg_txt(1160)); // Follow mode ON. } return 0; @@ -5271,7 +5278,7 @@ ACMD_FUNC(storeall) if (sd->state.storage_flag != 1) { //Open storage. if( storage_storageopen(sd) == 1 ) { - clif->displaymessage(fd, msg_txt(1161)); // You currently cannot open your storage. + clif->message(fd, msg_txt(1161)); // You currently cannot open your storage. return -1; } } @@ -5285,7 +5292,7 @@ ACMD_FUNC(storeall) } storage_storageclose(sd); - clif->displaymessage(fd, msg_txt(1162)); // All items stored. + clif->message(fd, msg_txt(1162)); // All items stored. return 0; } @@ -5295,7 +5302,7 @@ ACMD_FUNC(clearstorage) nullpo_retr(-1, sd); if (sd->state.storage_flag == 1) { - clif->displaymessage(fd, msg_txt(250)); + clif->message(fd, msg_txt(250)); return -1; } @@ -5305,7 +5312,7 @@ ACMD_FUNC(clearstorage) } storage_storageclose(sd); - clif->displaymessage(fd, msg_txt(1394)); // Your storage was cleaned. + clif->message(fd, msg_txt(1394)); // Your storage was cleaned. return 0; } @@ -5316,20 +5323,20 @@ ACMD_FUNC(cleargstorage) struct guild_storage *gstorage; nullpo_retr(-1, sd); - g = guild_search(sd->status.guild_id); + g = sd->guild; if (g == NULL) { - clif->displaymessage(fd, msg_txt(43)); + clif->message(fd, msg_txt(43)); 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; } @@ -5346,7 +5353,7 @@ ACMD_FUNC(cleargstorage) storage_guild_storageclose(sd); gstorage->lock = 0; // Cleaning done, release lock - clif->displaymessage(fd, msg_txt(1395)); // Your guild storage was cleaned. + clif->message(fd, msg_txt(1395)); // Your guild storage was cleaned. return 0; } @@ -5356,7 +5363,7 @@ ACMD_FUNC(clearcart) nullpo_retr(-1, sd); if (pc_iscarton(sd) == 0) { - clif->displaymessage(fd, msg_txt(1396)); // You do not have a cart to be cleaned. + clif->message(fd, msg_txt(1396)); // You do not have a cart to be cleaned. return -1; } @@ -5371,7 +5378,7 @@ ACMD_FUNC(clearcart) clif->clearcart(fd); clif->updatestatus(sd,SP_CARTINFO); - clif->displaymessage(fd, msg_txt(1397)); // Your cart was cleaned. + clif->message(fd, msg_txt(1397)); // Your cart was cleaned. return 0; } @@ -5391,7 +5398,7 @@ ACMD_FUNC(skillid) { nullpo_retr(-1, sd); if (!message || !*message) { - clif->displaymessage(fd, msg_txt(1163)); // Please enter a skill name to look up (usage: @skillid <skill name>). + clif->message(fd, msg_txt(1163)); // Please enter a skill name to look up (usage: @skillid <skill name>). return -1; } @@ -5403,7 +5410,7 @@ ACMD_FUNC(skillid) { idx = skill->get_index(db_data2i(data)); if (strnicmp(key.str, message, skillen) == 0 || strnicmp(skill_db[idx].desc, message, skillen) == 0) { sprintf(atcmd_output, msg_txt(1164), db_data2i(data), skill_db[idx].desc, key.str); // skill %d: %s (%s) - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } else if ( found < MAX_SKILLID_PARTIAL_RESULTS && ( stristr(key.str,message) || stristr(skill_db[idx].desc,message) ) ) { snprintf(partials[found++], MAX_SKILLID_PARTIAL_RESULTS_LEN, msg_txt(1164), db_data2i(data), skill_db[idx].desc, key.str); } @@ -5413,11 +5420,11 @@ ACMD_FUNC(skillid) { if( found ) { sprintf(atcmd_output, msg_txt(1398), found); // -- Displaying first %d partial matches - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } for(i = 0; i < found; i++) { /* partials */ - clif->displaymessage(fd, partials[i]); + clif->message(fd, partials[i]); } return 0; @@ -5437,19 +5444,19 @@ ACMD_FUNC(useskill) nullpo_retr(-1, sd); if(!message || !*message || sscanf(message, "%hu %hu %23[^\n]", &skill_id, &skill_lv, target) != 3) { - clif->displaymessage(fd, msg_txt(1165)); // Usage: @useskill <skill ID> <skill level> <target> + clif->message(fd, msg_txt(1165)); // Usage: @useskill <skill ID> <skill level> <target> return -1; } if(!strcmp(target,"self")) pl_sd = sd; //quick keyword else if ( (pl_sd = map_nick2sd(target)) == 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 don't authorise you to do this action on this player. + clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. return -1; } @@ -5482,7 +5489,7 @@ ACMD_FUNC(displayskill) if (!message || !*message || sscanf(message, "%hu %hu", &skill_id, &skill_lv) < 1) { - clif->displaymessage(fd, msg_txt(1166)); // Usage: @displayskill <skill ID> {<skill level>} + clif->message(fd, msg_txt(1166)); // Usage: @displayskill <skill ID> {<skill level>} return -1; } status = status_get_status_data(&sd->bl); @@ -5507,13 +5514,13 @@ ACMD_FUNC(skilltree) nullpo_retr(-1, sd); if(!message || !*message || sscanf(message, "%hu %23[^\r\n]", &skill_id, target) != 2) { - clif->displaymessage(fd, msg_txt(1167)); // Usage: @skilltree <skill ID> <target> + clif->message(fd, msg_txt(1167)); // Usage: @skilltree <skill ID> <target> return -1; } if ( (pl_sd = map_nick2sd(target)) == NULL ) { - clif->displaymessage(fd, msg_txt(3)); // Character not found. + clif->message(fd, msg_txt(3)); // Character not found. return -1; } @@ -5521,12 +5528,12 @@ ACMD_FUNC(skilltree) c = pc_mapid2jobid(c, pl_sd->status.sex); sprintf(atcmd_output, msg_txt(1168), job_name(c), pc_checkskill(pl_sd, NV_BASIC)); // Player is using %s skill tree (%d basic points). - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); ARR_FIND( 0, MAX_SKILL_TREE, j, skill_tree[c][j].id == 0 || skill_tree[c][j].id == skill_id ); if( j == MAX_SKILL_TREE || skill_tree[c][j].id == 0 ) { - clif->displaymessage(fd, msg_txt(1169)); // The player cannot use that skill. + clif->message(fd, msg_txt(1169)); // The player cannot use that skill. return 0; } @@ -5538,12 +5545,12 @@ ACMD_FUNC(skilltree) if( ent->need[j].id && pc_checkskill(sd,ent->need[j].id) < ent->need[j].lv) { sprintf(atcmd_output, msg_txt(1170), ent->need[j].lv, skill_db[ent->need[j].id].desc); // Player requires level %d of skill %s. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); meets = 0; } } if (meets == 1) { - clif->displaymessage(fd, msg_txt(1171)); // The player meets all the requirements for that skill. + clif->message(fd, msg_txt(1171)); // The player meets all the requirements for that skill. } return 0; @@ -5581,24 +5588,24 @@ ACMD_FUNC(marry) nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%23s", player_name) != 1) { - clif->displaymessage(fd, msg_txt(1172)); // Usage: @marry <char name> + clif->message(fd, msg_txt(1172)); // Usage: @marry <char name> return -1; } if ((pl_sd = map_nick2sd(player_name)) == NULL) { - clif->displaymessage(fd, msg_txt(3)); + clif->message(fd, msg_txt(3)); return -1; } if (pc_marriage(sd, pl_sd) == 0) { - clif->displaymessage(fd, msg_txt(1173)); // They are married... wish them well. + clif->message(fd, msg_txt(1173)); // They are married... wish them well. clif->wedding_effect(&pl_sd->bl); //wedding effect and music [Lupus] getring(sd); // Auto-give named rings (Aru) getring(pl_sd); return 0; } - clif->displaymessage(fd, msg_txt(1174)); // The two cannot wed because one is either a baby or already married. + clif->message(fd, msg_txt(1174)); // The two cannot wed because one is either a baby or already married. return -1; } @@ -5612,12 +5619,12 @@ ACMD_FUNC(divorce) if (pc_divorce(sd) != 0) { sprintf(atcmd_output, msg_txt(1175), sd->status.name); // '%s' is not married. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return -1; } sprintf(atcmd_output, msg_txt(1176), sd->status.name); // '%s' and his/her partner are now divorced. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return 0; } @@ -5630,8 +5637,8 @@ ACMD_FUNC(changelook) int pos[7] = { LOOK_HEAD_TOP,LOOK_HEAD_MID,LOOK_HEAD_BOTTOM,LOOK_WEAPON,LOOK_SHIELD,LOOK_SHOES,LOOK_ROBE }; if((i = sscanf(message, "%d %d", &j, &k)) < 1) { - clif->displaymessage(fd, msg_txt(1177)); // Usage: @changelook {<position>} <view id> - clif->displaymessage(fd, msg_txt(1178)); // Position: 1-Top 2-Middle 3-Bottom 4-Weapon 5-Shield 6-Shoes 7-Robe + clif->message(fd, msg_txt(1177)); // Usage: @changelook {<position>} <view id> + clif->message(fd, msg_txt(1178)); // Position: 1-Top 2-Middle 3-Bottom 4-Weapon 5-Shield 6-Shoes 7-Robe return -1; } else if ( i == 2 ) { if (j < 1 || j > 7) @@ -5656,17 +5663,17 @@ ACMD_FUNC(autotrade) nullpo_retr(-1, sd); if( map[sd->bl.m].flag.autotrade != battle_config.autotrade_mapflag ) { - clif->displaymessage(fd, msg_txt(1179)); // Autotrade is not allowed on this map. + clif->message(fd, msg_txt(1179)); // Autotrade is not allowed on this map. return -1; } if( pc_isdead(sd) ) { - clif->displaymessage(fd, msg_txt(1180)); // You cannot autotrade when dead. + clif->message(fd, msg_txt(1180)); // You cannot autotrade when dead. return -1; } if( !sd->state.vending && !sd->state.buyingstore ) { //check if player is vending or buying - clif->displaymessage(fd, msg_txt(549)); // "You should have a shop open to use @autotrade." + clif->message(fd, msg_txt(549)); // "You should have a shop open to use @autotrade." return -1; } @@ -5690,23 +5697,23 @@ ACMD_FUNC(changegm) struct map_session_data *pl_sd; nullpo_retr(-1, sd); - if (sd->status.guild_id == 0 || (g = guild_search(sd->status.guild_id)) == NULL || strcmp(g->master,sd->status.name)) { - clif->displaymessage(fd, msg_txt(1181)); // You need to be a Guild Master to use this command. + if (sd->status.guild_id == 0 || (g = sd->guild) == NULL || strcmp(g->master,sd->status.name)) { + clif->message(fd, msg_txt(1181)); // You need to be a Guild Master to use this command. return -1; } if( map[sd->bl.m].flag.guildlock || map[sd->bl.m].flag.gvg_castle ) { - clif->displaymessage(fd, msg_txt(1182)); // You cannot change guild leaders on this map. + clif->message(fd, msg_txt(1182)); // You cannot change guild leaders on this map. return -1; } if( !message[0] ) { - clif->displaymessage(fd, msg_txt(1183)); // Usage: @changegm <guild_member_name> + clif->message(fd, msg_txt(1183)); // Usage: @changegm <guild_member_name> return -1; } if((pl_sd=map_nick2sd((char *) message)) == NULL || pl_sd->status.guild_id != sd->status.guild_id) { - clif->displaymessage(fd, msg_txt(1184)); // Target character must be online and be a guild member. + clif->message(fd, msg_txt(1184)); // Target character must be online and be a guild member. return -1; } @@ -5724,7 +5731,7 @@ ACMD_FUNC(changeleader) if( !message[0] ) { - clif->displaymessage(fd, msg_txt(1185)); // Usage: @changeleader <party_member_name> + clif->message(fd, msg_txt(1185)); // Usage: @changeleader <party_member_name> return -1; } @@ -5746,7 +5753,7 @@ ACMD_FUNC(partyoption) if (sd->status.party_id == 0 || (p = party_search(sd->status.party_id)) == NULL) { - clif->displaymessage(fd, msg_txt(282)); + clif->message(fd, msg_txt(282)); return -1; } @@ -5756,13 +5763,13 @@ ACMD_FUNC(partyoption) if (!p->party.member[mi].leader) { - clif->displaymessage(fd, msg_txt(282)); + clif->message(fd, msg_txt(282)); return -1; } if(!message || !*message || sscanf(message, "%15s %15s", w1, w2) < 2) { - clif->displaymessage(fd, msg_txt(1186)); // Usage: @partyoption <pickup share: yes/no> <item distribution: yes/no> + clif->message(fd, msg_txt(1186)); // Usage: @partyoption <pickup share: yes/no> <item distribution: yes/no> return -1; } @@ -5772,7 +5779,7 @@ ACMD_FUNC(partyoption) if (option != p->party.item) party_changeoption(sd, p->party.exp, option); else - clif->displaymessage(fd, msg_txt(286)); + clif->message(fd, msg_txt(286)); return 0; } @@ -5803,9 +5810,9 @@ ACMD_FUNC(autoloot) sd->state.autoloot = rate; if (sd->state.autoloot) { snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1187),((double)sd->state.autoloot)/100.); // Autolooting items with drop rates of %0.02f%% and below. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); }else - clif->displaymessage(fd, msg_txt(1188)); // Autoloot is now off. + clif->message(fd, msg_txt(1188)); // Autoloot is now off. return 0; } @@ -5838,7 +5845,7 @@ ACMD_FUNC(autolootitem) item_data = itemdb_searchname(message); if (!item_data) { // No items founds in the DB with Id or Name - clif->displaymessage(fd, msg_txt(1189)); // Item not found. + clif->message(fd, msg_txt(1189)); // Item not found. return -1; } } @@ -5847,28 +5854,28 @@ ACMD_FUNC(autolootitem) case 1: ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == item_data->nameid); if (i != AUTOLOOTITEM_SIZE) { - clif->displaymessage(fd, msg_txt(1190)); // You're already autolooting this item. + clif->message(fd, msg_txt(1190)); // You're already autolooting this item. return -1; } ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == 0); if (i == AUTOLOOTITEM_SIZE) { - clif->displaymessage(fd, msg_txt(1191)); // Your autolootitem list is full. Remove some items first with @autolootid -<item name or ID>. + clif->message(fd, msg_txt(1191)); // Your autolootitem list is full. Remove some items first with @autolootid -<item name or ID>. return -1; } sd->state.autolootid[i] = item_data->nameid; // Autoloot Activated sprintf(atcmd_output, msg_txt(1192), item_data->name, item_data->jname, item_data->nameid); // Autolooting item: '%s'/'%s' {%d} - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sd->state.autolooting = 1; break; case 2: ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == item_data->nameid); if (i == AUTOLOOTITEM_SIZE) { - clif->displaymessage(fd, msg_txt(1193)); // You're currently not autolooting this item. + clif->message(fd, msg_txt(1193)); // You're currently not autolooting this item. return -1; } sd->state.autolootid[i] = 0; sprintf(atcmd_output, msg_txt(1194), item_data->name, item_data->jname, item_data->nameid); // Removed item: '%s'/'%s' {%d} from your autolootitem list. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] != 0); if (i == AUTOLOOTITEM_SIZE) { sd->state.autolooting = 0; @@ -5876,14 +5883,14 @@ ACMD_FUNC(autolootitem) break; case 3: sprintf(atcmd_output, msg_txt(1195), AUTOLOOTITEM_SIZE); // You can have %d items on your autolootitem list. - clif->displaymessage(fd, atcmd_output); - clif->displaymessage(fd, msg_txt(1196)); // To add an item to the list, use "@alootid +<item name or ID>". To remove an item, use "@alootid -<item name or ID>". - clif->displaymessage(fd, msg_txt(1197)); // "@alootid reset" will clear your autolootitem list. + clif->message(fd, atcmd_output); + clif->message(fd, msg_txt(1196)); // To add an item to the list, use "@alootid +<item name or ID>". To remove an item, use "@alootid -<item name or ID>". + clif->message(fd, msg_txt(1197)); // "@alootid reset" will clear your autolootitem list. ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] != 0); if (i == AUTOLOOTITEM_SIZE) { - clif->displaymessage(fd, msg_txt(1198)); // Your autolootitem list is empty. + clif->message(fd, msg_txt(1198)); // Your autolootitem list is empty. } else { - clif->displaymessage(fd, msg_txt(1199)); // Items on your autolootitem list: + clif->message(fd, msg_txt(1199)); // Items on your autolootitem list: for(i = 0; i < AUTOLOOTITEM_SIZE; i++) { if (sd->state.autolootid[i] == 0) @@ -5893,13 +5900,13 @@ ACMD_FUNC(autolootitem) continue; } sprintf(atcmd_output, "'%s'/'%s' {%d}", item_data->name, item_data->jname, item_data->nameid); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } } break; case 4: memset(sd->state.autolootid, 0, sizeof(sd->state.autolootid)); - clif->displaymessage(fd, msg_txt(1200)); // Your autolootitem list has been reset. + clif->message(fd, msg_txt(1200)); // Your autolootitem list has been reset. sd->state.autolooting = 0; break; } @@ -5917,11 +5924,11 @@ ACMD_FUNC(autolootitem) // if (map[sd->bl.m].flag.rain) { // map[sd->bl.m].flag.rain=0; // clif->weather(sd->bl.m); -// clif->displaymessage(fd, msg_txt(1201)); // The rain has stopped. +// clif->message(fd, msg_txt(1201)); // The rain has stopped. // } else { // map[sd->bl.m].flag.rain=1; // clif->weather(sd->bl.m); -// clif->displaymessage(fd, msg_txt(1202)); // It has started to rain. +// clif->message(fd, msg_txt(1202)); // It has started to rain. // } // return 0; //} @@ -5935,11 +5942,11 @@ ACMD_FUNC(snow) if (map[sd->bl.m].flag.snow) { map[sd->bl.m].flag.snow=0; clif->weather(sd->bl.m); - clif->displaymessage(fd, msg_txt(1203)); // Snow has stopped falling. + clif->message(fd, msg_txt(1203)); // Snow has stopped falling. } else { map[sd->bl.m].flag.snow=1; clif->weather(sd->bl.m); - clif->displaymessage(fd, msg_txt(1204)); // It has started to snow. + clif->message(fd, msg_txt(1204)); // It has started to snow. } return 0; @@ -5954,11 +5961,11 @@ ACMD_FUNC(sakura) if (map[sd->bl.m].flag.sakura) { map[sd->bl.m].flag.sakura=0; clif->weather(sd->bl.m); - clif->displaymessage(fd, msg_txt(1205)); // Cherry tree leaves no longer fall. + clif->message(fd, msg_txt(1205)); // Cherry tree leaves no longer fall. } else { map[sd->bl.m].flag.sakura=1; clif->weather(sd->bl.m); - clif->displaymessage(fd, msg_txt(1206)); // Cherry tree leaves have begun to fall. + clif->message(fd, msg_txt(1206)); // Cherry tree leaves have begun to fall. } return 0; } @@ -5972,11 +5979,11 @@ ACMD_FUNC(clouds) if (map[sd->bl.m].flag.clouds) { map[sd->bl.m].flag.clouds=0; clif->weather(sd->bl.m); - clif->displaymessage(fd, msg_txt(1207)); // The clouds has disappear. + clif->message(fd, msg_txt(1207)); // The clouds has disappear. } else { map[sd->bl.m].flag.clouds=1; clif->weather(sd->bl.m); - clif->displaymessage(fd, msg_txt(1208)); // Clouds appear. + clif->message(fd, msg_txt(1208)); // Clouds appear. } return 0; @@ -5991,11 +5998,11 @@ ACMD_FUNC(clouds2) if (map[sd->bl.m].flag.clouds2) { map[sd->bl.m].flag.clouds2=0; clif->weather(sd->bl.m); - clif->displaymessage(fd, msg_txt(1209)); // The alternative clouds disappear. + clif->message(fd, msg_txt(1209)); // The alternative clouds disappear. } else { map[sd->bl.m].flag.clouds2=1; clif->weather(sd->bl.m); - clif->displaymessage(fd, msg_txt(1210)); // Alternative clouds appear. + clif->message(fd, msg_txt(1210)); // Alternative clouds appear. } return 0; @@ -6010,11 +6017,11 @@ ACMD_FUNC(fog) if (map[sd->bl.m].flag.fog) { map[sd->bl.m].flag.fog=0; clif->weather(sd->bl.m); - clif->displaymessage(fd, msg_txt(1211)); // The fog has gone. + clif->message(fd, msg_txt(1211)); // The fog has gone. } else { map[sd->bl.m].flag.fog=1; clif->weather(sd->bl.m); - clif->displaymessage(fd, msg_txt(1212)); // Fog hangs over. + clif->message(fd, msg_txt(1212)); // Fog hangs over. } return 0; } @@ -6028,11 +6035,11 @@ ACMD_FUNC(leaves) if (map[sd->bl.m].flag.leaves) { map[sd->bl.m].flag.leaves=0; clif->weather(sd->bl.m); - clif->displaymessage(fd, msg_txt(1213)); // Leaves no longer fall. + clif->message(fd, msg_txt(1213)); // Leaves no longer fall. } else { map[sd->bl.m].flag.leaves=1; clif->weather(sd->bl.m); - clif->displaymessage(fd, msg_txt(1214)); // Fallen leaves fall. + clif->message(fd, msg_txt(1214)); // Fallen leaves fall. } return 0; @@ -6047,11 +6054,11 @@ ACMD_FUNC(fireworks) if (map[sd->bl.m].flag.fireworks) { map[sd->bl.m].flag.fireworks=0; clif->weather(sd->bl.m); - clif->displaymessage(fd, msg_txt(1215)); // Fireworks have ended. + clif->message(fd, msg_txt(1215)); // Fireworks have ended. } else { map[sd->bl.m].flag.fireworks=1; clif->weather(sd->bl.m); - clif->displaymessage(fd, msg_txt(1216)); // Fireworks have launched. + clif->message(fd, msg_txt(1216)); // Fireworks have launched. } return 0; @@ -6075,7 +6082,7 @@ ACMD_FUNC(clearweather) map[sd->bl.m].flag.fireworks=0; map[sd->bl.m].flag.leaves=0; clif->weather(sd->bl.m); - clif->displaymessage(fd, msg_txt(291)); + clif->message(fd, msg_txt(291)); return 0; } @@ -6090,7 +6097,7 @@ ACMD_FUNC(sound) memset(sound_file, '\0', sizeof(sound_file)); if(!message || !*message || sscanf(message, "%99[^\n]", sound_file) < 1) { - clif->displaymessage(fd, msg_txt(1217)); // Please enter a sound filename (usage: @sound <filename>). + clif->message(fd, msg_txt(1217)); // Please enter a sound filename (usage: @sound <filename>). return -1; } @@ -6115,7 +6122,7 @@ ACMD_FUNC(mobsearch) nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%99[^\n]", mob_name) < 1) { - clif->displaymessage(fd, msg_txt(1218)); // Please enter a monster name (usage: @mobsearch <monster name>). + clif->message(fd, msg_txt(1218)); // Please enter a monster name (usage: @mobsearch <monster name>). return -1; } @@ -6123,7 +6130,7 @@ ACMD_FUNC(mobsearch) mob_id = mobdb_searchname(mob_name); if(mob_id > 0 && mobdb_checkid(mob_id) == 0){ snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1219),mob_name); // Invalid mob ID %s! - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return -1; } if(mob_id == atoi(mob_name) && mob_db(mob_id)->jname) @@ -6131,7 +6138,7 @@ ACMD_FUNC(mobsearch) // strcpy(mob_name,mob_db(mob_id)->name); // --en-- snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1220), mob_name, mapindex_id2name(sd->mapindex)); // Mob Search... %s %s - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); it = mapit_geteachmob(); for(;;) @@ -6150,7 +6157,7 @@ ACMD_FUNC(mobsearch) snprintf(atcmd_output, sizeof(atcmd_output), "%2d[%3d:%3d] %s", number, md->bl.x, md->bl.y, md->name); else snprintf(atcmd_output, sizeof(atcmd_output), "%2d[%s] %s", number, "dead", md->name); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } mapit_free(it); @@ -6172,7 +6179,7 @@ static int atcommand_cleanfloor_sub(struct block_list *bl, va_list ap) ACMD_FUNC(cleanmap) { map_foreachinmap(atcommand_cleanfloor_sub, sd->bl.m, BL_ITEM); - clif->displaymessage(fd, msg_txt(1221)); // All dropped items have been cleaned up. + clif->message(fd, msg_txt(1221)); // All dropped items have been cleaned up. return 0; } @@ -6190,7 +6197,7 @@ ACMD_FUNC(cleanarea) map_foreachinarea(atcommand_cleanfloor_sub, sd->bl.m, x0, y0, x1, y1, BL_ITEM); } - clif->displaymessage(fd, msg_txt(1221)); // All dropped items have been cleaned up. + clif->message(fd, msg_txt(1221)); // All dropped items have been cleaned up. return 0; } @@ -6212,19 +6219,19 @@ ACMD_FUNC(npctalk) if(!ifcolor) { if (!message || !*message || sscanf(message, "%23[^,], %99[^\n]", name, mes) < 2) { - clif->displaymessage(fd, msg_txt(1222)); // Please enter the correct parameters (usage: @npctalk <npc name>, <message>). + clif->message(fd, msg_txt(1222)); // Please enter the correct parameters (usage: @npctalk <npc name>, <message>). return -1; } } else { if (!message || !*message || sscanf(message, "%lx %23[^,], %99[^\n]", &color, name, mes) < 3) { - clif->displaymessage(fd, msg_txt(1223)); // Please enter the correct parameters (usage: @npctalkc <color> <npc name>, <message>). + clif->message(fd, msg_txt(1223)); // Please enter the correct parameters (usage: @npctalkc <color> <npc name>, <message>). return -1; } } if (!(nd = npc_name2id(name))) { - clif->displaymessage(fd, msg_txt(111)); // This NPC doesn't exist + clif->message(fd, msg_txt(111)); // This NPC doesn't exist return -1; } @@ -6232,7 +6239,7 @@ ACMD_FUNC(npctalk) snprintf(temp, sizeof(temp), "%s : %s", name, mes); if(ifcolor) clif->messagecolor(&nd->bl,color,temp); - else clif->message(&nd->bl, temp); + else clif->disp_overhead(&nd->bl, temp); return 0; } @@ -6252,7 +6259,7 @@ ACMD_FUNC(pettalk) if(!sd->status.pet_id || !(pd=sd->pd)) { - clif->displaymessage(fd, msg_txt(184)); + clif->message(fd, msg_txt(184)); return -1; } @@ -6262,7 +6269,7 @@ ACMD_FUNC(pettalk) return -1; if (!message || !*message || sscanf(message, "%99[^\n]", mes) < 1) { - clif->displaymessage(fd, msg_txt(1224)); // Please enter a message (usage: @pettalk <message>). + clif->message(fd, msg_txt(1224)); // Please enter a message (usage: @pettalk <message>). return -1; } @@ -6296,7 +6303,7 @@ ACMD_FUNC(pettalk) } snprintf(temp, sizeof temp ,"%s : %s", pd->pet.name, mes); - clif->message(&pd->bl, temp); + clif->disp_overhead(&pd->bl, temp); return 0; } @@ -6337,12 +6344,12 @@ ACMD_FUNC(users) continue;// empty safesnprintf(buf, sizeof(buf), "%s: %d (%.2f%%)", mapindex_id2name(i), users[i], (float)(100.0f*users[i]/users_all)); - clif->displaymessage(sd->fd, buf); + clif->message(sd->fd, buf); } // display overall count safesnprintf(buf, sizeof(buf), "all: %d", users_all); - clif->displaymessage(sd->fd, buf); + clif->message(sd->fd, buf); return 0; } @@ -6355,7 +6362,7 @@ ACMD_FUNC(reset) pc_resetstate(sd); pc_resetskill(sd,1); sprintf(atcmd_output, msg_txt(208), sd->status.name); // '%s' skill and stats points reseted! - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return 0; } @@ -6374,7 +6381,7 @@ ACMD_FUNC(summon) if (!message || !*message || sscanf(message, "%23s %d", name, &duration) < 1) { - clif->displaymessage(fd, msg_txt(1225)); // Please enter a monster name (usage: @summon <monster name> {duration}). + clif->message(fd, msg_txt(1225)); // Please enter a monster name (usage: @summon <monster name> {duration}). return -1; } @@ -6387,7 +6394,7 @@ ACMD_FUNC(summon) mob_id = mobdb_searchname(name); if(mob_id == 0 || mobdb_checkid(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; } @@ -6403,7 +6410,7 @@ ACMD_FUNC(summon) mob_spawn(md); sc_start4(&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000); clif->skill_poseffect(&sd->bl,AM_CALLHOMUN,1,md->bl.x,md->bl.y,tick); - clif->displaymessage(fd, msg_txt(39)); // All monster summoned! + clif->message(fd, msg_txt(39)); // All monster summoned! return 0; } @@ -6419,19 +6426,19 @@ ACMD_FUNC(adjgroup) nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%d", &new_group) != 1) { - clif->displaymessage(fd, msg_txt(1226)); // Usage: @adjgroup <group_id> + clif->message(fd, msg_txt(1226)); // Usage: @adjgroup <group_id> return -1; } if (!pc_group_exists(new_group)) { - clif->displaymessage(fd, msg_txt(1227)); // Specified group does not exist. + clif->message(fd, msg_txt(1227)); // Specified group does not exist. return -1; } sd->group_id = new_group; pc_group_pc_load(sd);/* update cache */ - clif->displaymessage(fd, msg_txt(1228)); // Group changed successfully. - clif->displaymessage(sd->fd, msg_txt(1229)); // Your group has changed. + clif->message(fd, msg_txt(1228)); // Group changed successfully. + clif->message(sd->fd, msg_txt(1229)); // Your group has changed. return 0; } @@ -6445,13 +6452,13 @@ ACMD_FUNC(trade) nullpo_retr(-1, sd); if (!message || !*message) { - clif->displaymessage(fd, msg_txt(1230)); // Please enter a player name (usage: @trade <char name>). + clif->message(fd, msg_txt(1230)); // Please enter a player name (usage: @trade <char name>). return -1; } if ( (pl_sd = map_nick2sd((char *)message)) == NULL ) { - clif->displaymessage(fd, msg_txt(3)); // Character not found. + clif->message(fd, msg_txt(3)); // Character not found. return -1; } @@ -6469,16 +6476,16 @@ ACMD_FUNC(setbattleflag) nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%127s %127s", flag, value) != 2) { - clif->displaymessage(fd, msg_txt(1231)); // Usage: @setbattleflag <flag> <value> + clif->message(fd, msg_txt(1231)); // Usage: @setbattleflag <flag> <value> return -1; } if (battle->config_set_value(flag, value) == 0) { - clif->displaymessage(fd, msg_txt(1232)); // Unknown battle_config flag. + clif->message(fd, msg_txt(1232)); // Unknown battle_config flag. return -1; } - clif->displaymessage(fd, msg_txt(1233)); // Set battle_config as requested. + clif->message(fd, msg_txt(1233)); // Set battle_config as requested. return 0; } @@ -6492,24 +6499,24 @@ ACMD_FUNC(unmute) nullpo_retr(-1, sd); if (!message || !*message) { - clif->displaymessage(fd, msg_txt(1234)); // Please enter a player name (usage: @unmute <char name>). + clif->message(fd, msg_txt(1234)); // Please enter a player name (usage: @unmute <char name>). return -1; } if ( (pl_sd = map_nick2sd((char *)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->sc.data[SC_NOCHAT]) { - clif->displaymessage(sd->fd,msg_txt(1235)); // Player is not muted. + clif->message(sd->fd,msg_txt(1235)); // Player is not muted. return -1; } pl_sd->status.manner = 0; status_change_end(&pl_sd->bl, SC_NOCHAT, INVALID_TIMER); - clif->displaymessage(sd->fd,msg_txt(1236)); // Player unmuted. + clif->message(sd->fd,msg_txt(1236)); // Player unmuted. return 0; } @@ -6532,7 +6539,7 @@ ACMD_FUNC(uptime) seconds -= (seconds/minute>0)?(seconds/minute)*minute:0; snprintf(atcmd_output, sizeof(atcmd_output), msg_txt(245), days, hours, minutes, seconds); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return 0; } @@ -6563,19 +6570,19 @@ ACMD_FUNC(mute) nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%d %23[^\n]", &manner, atcmd_player_name) < 1) { - clif->displaymessage(fd, msg_txt(1237)); // Usage: @mute <time> <char name> + clif->message(fd, msg_txt(1237)); // Usage: @mute <time> <char name> return -1; } if ( (pl_sd = map_nick2sd(atcmd_player_name)) == 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 don't authorise you to do this action on this player. + clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. return -1; } @@ -6636,7 +6643,7 @@ ACMD_FUNC(identify) if (num > 0) { clif->item_identify_list(sd); } else { - clif->displaymessage(fd,msg_txt(1238)); // There are no items to appraise. + clif->message(fd,msg_txt(1238)); // There are no items to appraise. } return 0; } @@ -6722,7 +6729,7 @@ ACMD_FUNC(mobinfo) memset(atcmd_output2, '\0', sizeof(atcmd_output2)); if (!message || !*message) { - clif->displaymessage(fd, msg_txt(1239)); // Please enter a monster name/ID (usage: @mobinfo <monster_name_or_monster_ID>). + clif->message(fd, msg_txt(1239)); // Please enter a monster name/ID (usage: @mobinfo <monster_name_or_monster_ID>). return -1; } @@ -6735,13 +6742,13 @@ ACMD_FUNC(mobinfo) count = mobdb_searchname_array(mob_array, MAX_SEARCH, message); if (!count) { - 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 (count > MAX_SEARCH) { sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); count = MAX_SEARCH; } for (k = 0; k < count; k++) { @@ -6752,21 +6759,21 @@ ACMD_FUNC(mobinfo) sprintf(atcmd_output, msg_txt(1240), mob->name, mob->jname, mob->sprite, mob->vd.class_); // MVP Monster: '%s'/'%s'/'%s' (%d) else sprintf(atcmd_output, msg_txt(1241), mob->name, mob->jname, mob->sprite, mob->vd.class_); // Monster: '%s'/'%s'/'%s' (%d) - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1242), mob->lv, mob->status.max_hp, mob->base_exp, mob->job_exp,MOB_HIT(mob), MOB_FLEE(mob)); // Lv:%d HP:%d Base EXP:%u Job EXP:%u HIT:%d FLEE:%d - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1243), // DEF:%d MDEF:%d STR:%d AGI:%d VIT:%d INT:%d DEX:%d LUK:%d mob->status.def, mob->status.mdef,mob->status.str, mob->status.agi, mob->status.vit, mob->status.int_, mob->status.dex, mob->status.luk); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1244), // ATK:%d~%d Range:%d~%d~%d Size:%s Race: %s Element: %s (Lv:%d) mob->status.rhw.atk, mob->status.rhw.atk2, mob->status.rhw.range, mob->range2 , mob->range3, msize[mob->status.size], mrace[mob->status.race], melement[mob->status.def_ele], mob->status.ele_lv); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); // drops - clif->displaymessage(fd, msg_txt(1245)); // Drops: + clif->message(fd, msg_txt(1245)); // Drops: strcpy(atcmd_output, " "); j = 0; for (i = 0; i < MAX_MOB_DROP; i++) { @@ -6781,18 +6788,18 @@ ACMD_FUNC(mobinfo) sprintf(atcmd_output2, " - %s %02.02f%%", item_data->jname, (float)droprate / 100); strcat(atcmd_output, atcmd_output2); if (++j % 3 == 0) { - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); strcpy(atcmd_output, " "); } } if (j == 0) - clif->displaymessage(fd, msg_txt(1246)); // This monster has no drops. + clif->message(fd, msg_txt(1246)); // This monster has no drops. else if (j % 3 != 0) - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); // mvp if (mob->mexp) { sprintf(atcmd_output, msg_txt(1247), mob->mexp); // MVP Bonus EXP:%u - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); strcpy(atcmd_output, msg_txt(1248)); // MVP Items: j = 0; for (i = 0; i < MAX_MVP_DROP; i++) { @@ -6808,9 +6815,9 @@ ACMD_FUNC(mobinfo) } } if (j == 0) - clif->displaymessage(fd, msg_txt(1249)); // This monster has no MVP prizes. + clif->message(fd, msg_txt(1249)); // This monster has no MVP prizes. else - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } } return 0; @@ -6836,12 +6843,12 @@ ACMD_FUNC(showmobs) mob_id = mobdb_searchname(mob_name); if(mob_id > 0 && mobdb_checkid(mob_id) == 0){ snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1250),mob_name); // Invalid mob id %s! - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return 0; } if(mob_db(mob_id)->status.mode&MD_BOSS && !pc_has_permission(sd, PC_PERM_SHOW_BOSS)){ // If player group does not have access to boss mobs. - clif->displaymessage(fd, msg_txt(1251)); // Can't show boss mobs! + clif->message(fd, msg_txt(1251)); // Can't show boss mobs! return 0; } @@ -6851,7 +6858,7 @@ ACMD_FUNC(showmobs) snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1252), // Mob Search... %s %s mob_name, mapindex_id2name(sd->mapindex)); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); it = mapit_geteachmob(); for(;;) @@ -6888,12 +6895,12 @@ ACMD_FUNC(homlevel) nullpo_retr(-1, sd); if ( !message || !*message || ( level = atoi(message) ) < 1 ) { - clif->displaymessage(fd, msg_txt(1253)); // Please enter a level adjustment (usage: @homlevel <number of levels>). + clif->message(fd, msg_txt(1253)); // Please enter a level adjustment (usage: @homlevel <number of levels>). return -1; } if ( !merc_is_hom_active(sd->hd) ) { - clif->displaymessage(fd, msg_txt(1254)); // You do not have a homunculus. + clif->message(fd, msg_txt(1254)); // You do not have a homunculus. return -1; } @@ -6920,12 +6927,12 @@ ACMD_FUNC(homevolution) nullpo_retr(-1, sd); if ( !merc_is_hom_active(sd->hd) ) { - clif->displaymessage(fd, msg_txt(1254)); // You do not have a homunculus. + clif->message(fd, msg_txt(1254)); // You do not have a homunculus. return -1; } if ( !merc_hom_evolution(sd->hd) ) { - clif->displaymessage(fd, msg_txt(1255)); // Your homunculus doesn't evolve. + clif->message(fd, msg_txt(1255)); // Your homunculus doesn't evolve. return -1; } clif->homskillinfoblock(sd); @@ -6938,7 +6945,7 @@ ACMD_FUNC(hommutate) nullpo_retr(-1, sd); if (!merc_is_hom_active(sd->hd)) { - clif->displaymessage(fd, msg_txt(1254)); // You do not have a homunculus. + clif->message(fd, msg_txt(1254)); // You do not have a homunculus. return -1; } @@ -6968,19 +6975,19 @@ ACMD_FUNC(makehomun) nullpo_retr(-1, sd); if ( sd->status.hom_id ) { - clif->displaymessage(fd, msg_txt(450)); + clif->message(fd, msg_txt(450)); return -1; } if (!message || !*message) { - clif->displaymessage(fd, msg_txt(1256)); // Please enter a homunculus ID (usage: @makehomun <homunculus id>). + clif->message(fd, msg_txt(1256)); // Please enter a homunculus ID (usage: @makehomun <homunculus id>). return -1; } homunid = atoi(message); if( homunid < HM_CLASS_BASE || homunid > HM_CLASS_BASE + MAX_HOMUNCULUS_CLASS - 1 ) { - clif->displaymessage(fd, msg_txt(1257)); // Invalid Homunculus ID. + clif->message(fd, msg_txt(1257)); // Invalid Homunculus ID. return -1; } @@ -6998,12 +7005,12 @@ ACMD_FUNC(homfriendly) nullpo_retr(-1, sd); if ( !merc_is_hom_active(sd->hd) ) { - clif->displaymessage(fd, msg_txt(1254)); // You do not have a homunculus. + clif->message(fd, msg_txt(1254)); // You do not have a homunculus. return -1; } if (!message || !*message) { - clif->displaymessage(fd, msg_txt(1258)); // Please enter a friendly value (usage: @homfriendly <friendly value [0-1000]>). + clif->message(fd, msg_txt(1258)); // Please enter a friendly value (usage: @homfriendly <friendly value [0-1000]>). return -1; } @@ -7025,12 +7032,12 @@ ACMD_FUNC(homhungry) nullpo_retr(-1, sd); if ( !merc_is_hom_active(sd->hd) ) { - clif->displaymessage(fd, msg_txt(1254)); // You do not have a homunculus. + clif->message(fd, msg_txt(1254)); // You do not have a homunculus. return -1; } if (!message || !*message) { - clif->displaymessage(fd, msg_txt(1259)); // Please enter a hunger value (usage: @homhungry <hunger value [0-100]>). + clif->message(fd, msg_txt(1259)); // Please enter a hunger value (usage: @homhungry <hunger value [0-100]>). return -1; } @@ -7063,17 +7070,17 @@ ACMD_FUNC(homtalk) return -1; if ( !merc_is_hom_active(sd->hd) ) { - clif->displaymessage(fd, msg_txt(1254)); // You do not have a homunculus. + clif->message(fd, msg_txt(1254)); // You do not have a homunculus. return -1; } if (!message || !*message || sscanf(message, "%99[^\n]", mes) < 1) { - clif->displaymessage(fd, msg_txt(1260)); // Please enter a message (usage: @homtalk <message>). + clif->message(fd, msg_txt(1260)); // Please enter a message (usage: @homtalk <message>). return -1; } snprintf(temp, sizeof temp ,"%s : %s", sd->hd->homunculus.name, mes); - clif->message(&sd->hd->bl, temp); + clif->disp_overhead(&sd->hd->bl, temp); return 0; } @@ -7088,31 +7095,31 @@ ACMD_FUNC(hominfo) nullpo_retr(-1, sd); if ( !merc_is_hom_active(sd->hd) ) { - clif->displaymessage(fd, msg_txt(1254)); // You do not have a homunculus. + clif->message(fd, msg_txt(1254)); // You do not have a homunculus. return -1; } hd = sd->hd; status = status_get_status_data(&hd->bl); - clif->displaymessage(fd, msg_txt(1261)); // Homunculus stats: + clif->message(fd, msg_txt(1261)); // Homunculus stats: snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1262), // HP: %d/%d - SP: %d/%d status->hp, status->max_hp, status->sp, status->max_sp); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1263), // ATK: %d - MATK: %d~%d status->rhw.atk2 +status->batk, status->matk_min, status->matk_max); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1264), // Hungry: %d - Intimacy: %u hd->homunculus.hunger, hd->homunculus.intimacy/100); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); snprintf(atcmd_output, sizeof(atcmd_output) , msg_txt(1265), // Stats: Str %d / Agi %d / Vit %d / Int %d / Dex %d / Luk %d status->str, status->agi, status->vit, status->int_, status->dex, status->luk); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return 0; } @@ -7127,7 +7134,7 @@ ACMD_FUNC(homstats) nullpo_retr(-1, sd); if ( !merc_is_hom_active(sd->hd) ) { - clif->displaymessage(fd, msg_txt(1254)); // You do not have a homunculus. + clif->message(fd, msg_txt(1254)); // You do not have a homunculus. return -1; } @@ -7139,49 +7146,49 @@ ACMD_FUNC(homstats) snprintf(atcmd_output, sizeof(atcmd_output) , msg_txt(1266), lv, db->name); // Homunculus growth stats (Lv %d %s): - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); lv--; //Since the first increase is at level 2. evo = (hom->class_ == db->evo_class); min = db->base.HP +lv*db->gmin.HP +(evo?db->emin.HP:0); max = db->base.HP +lv*db->gmax.HP +(evo?db->emax.HP:0);; snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1267), hom->max_hp, min, max); // Max HP: %d (%d~%d) - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); min = db->base.SP +lv*db->gmin.SP +(evo?db->emin.SP:0); max = db->base.SP +lv*db->gmax.SP +(evo?db->emax.SP:0);; snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1268), hom->max_sp, min, max); // Max SP: %d (%d~%d) - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); min = db->base.str +lv*(db->gmin.str/10) +(evo?db->emin.str:0); max = db->base.str +lv*(db->gmax.str/10) +(evo?db->emax.str:0);; snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1269), hom->str/10, min, max); // Str: %d (%d~%d) - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); min = db->base.agi +lv*(db->gmin.agi/10) +(evo?db->emin.agi:0); max = db->base.agi +lv*(db->gmax.agi/10) +(evo?db->emax.agi:0);; snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1270), hom->agi/10, min, max); // Agi: %d (%d~%d) - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); min = db->base.vit +lv*(db->gmin.vit/10) +(evo?db->emin.vit:0); max = db->base.vit +lv*(db->gmax.vit/10) +(evo?db->emax.vit:0);; snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1271), hom->vit/10, min, max); // Vit: %d (%d~%d) - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); min = db->base.int_ +lv*(db->gmin.int_/10) +(evo?db->emin.int_:0); max = db->base.int_ +lv*(db->gmax.int_/10) +(evo?db->emax.int_:0);; snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1272), hom->int_/10, min, max); // Int: %d (%d~%d) - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); min = db->base.dex +lv*(db->gmin.dex/10) +(evo?db->emin.dex:0); max = db->base.dex +lv*(db->gmax.dex/10) +(evo?db->emax.dex:0);; snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1273), hom->dex/10, min, max); // Dex: %d (%d~%d) - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); min = db->base.luk +lv*(db->gmin.luk/10) +(evo?db->emin.luk:0); max = db->base.luk +lv*(db->gmax.luk/10) +(evo?db->emax.luk:0);; snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1274), hom->luk/10, min, max); // Luk: %d (%d~%d) - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return 0; } @@ -7196,7 +7203,7 @@ ACMD_FUNC(homshuffle) if(!merc_hom_shuffle(sd->hd)) return -1; - clif->displaymessage(sd->fd, msg_txt(1275)); // Homunculus stats altered. + clif->message(sd->fd, msg_txt(1275)); // Homunculus stats altered. atcommand_homstats(fd, sd, command, message); //Print out the new stats return 0; } @@ -7211,20 +7218,20 @@ ACMD_FUNC(iteminfo) int i, count = 1; if (!message || !*message) { - clif->displaymessage(fd, msg_txt(1276)); // Please enter an item name/ID (usage: @ii/@iteminfo <item name/ID>). + clif->message(fd, msg_txt(1276)); // Please enter an item name/ID (usage: @ii/@iteminfo <item name/ID>). return -1; } if ((item_array[0] = itemdb_exists(atoi(message))) == NULL) count = itemdb_searchname_array(item_array, MAX_SEARCH, message); if (!count) { - clif->displaymessage(fd, msg_txt(19)); // Invalid item ID or name. + clif->message(fd, msg_txt(19)); // Invalid item ID or name. return -1; } if (count > MAX_SEARCH) { sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count); // Displaying first %d out of %d matches - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); count = MAX_SEARCH; } for (i = 0; i < count; i++) { @@ -7234,10 +7241,10 @@ ACMD_FUNC(iteminfo) itemdb_typename(item_data->type), (item_data->script==NULL)? msg_txt(1278) : msg_txt(1279) // None / With script ); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1280), item_data->value_buy, item_data->value_sell, item_data->weight/10. ); // NPC Buy:%dz, Sell:%dz | Weight: %.1f - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); if (item_data->maxchance == -1) strcpy(atcmd_output, msg_txt(1281)); // - Available in the shops only. @@ -7245,7 +7252,7 @@ ACMD_FUNC(iteminfo) sprintf(atcmd_output, msg_txt(1282), (float)item_data->maxchance / 100 ); // - Maximal monsters drop chance: %02.02f%% else strcpy(atcmd_output, msg_txt(1283)); // - Monsters don't drop this item. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } return 0; @@ -7260,38 +7267,38 @@ ACMD_FUNC(whodrops) int i,j, count = 1; if (!message || !*message) { - clif->displaymessage(fd, msg_txt(1284)); // Please enter item name/ID (usage: @whodrops <item name/ID>). + clif->message(fd, msg_txt(1284)); // Please enter item name/ID (usage: @whodrops <item name/ID>). return -1; } if ((item_array[0] = itemdb_exists(atoi(message))) == NULL) count = itemdb_searchname_array(item_array, MAX_SEARCH, message); if (!count) { - clif->displaymessage(fd, msg_txt(19)); // Invalid item ID or name. + clif->message(fd, msg_txt(19)); // Invalid item ID or name. return -1; } if (count > MAX_SEARCH) { sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count); // Displaying first %d out of %d matches - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); count = MAX_SEARCH; } for (i = 0; i < count; i++) { item_data = item_array[i]; sprintf(atcmd_output, msg_txt(1285), item_data->jname,item_data->slot); // Item: '%s'[%d] - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); if (item_data->mob[0].chance == 0) { strcpy(atcmd_output, msg_txt(1286)); // - Item is not dropped by mobs. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } else { sprintf(atcmd_output, msg_txt(1287), MAX_SEARCH); // - Common mobs with highest drop chance (only max %d are listed): - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); for (j=0; j < MAX_SEARCH && item_data->mob[j].chance > 0; j++) { sprintf(atcmd_output, "- %s (%02.02f%%)", mob_db(item_data->mob[j].id)->jname, item_data->mob[j].chance/100.); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } } } @@ -7305,7 +7312,7 @@ ACMD_FUNC(whereis) int i, j, k; if (!message || !*message) { - clif->displaymessage(fd, msg_txt(1288)); // Please enter a monster name/ID (usage: @whereis <monster_name_or_monster_ID>). + clif->message(fd, msg_txt(1288)); // Please enter a monster name/ID (usage: @whereis <monster_name_or_monster_ID>). return -1; } @@ -7318,29 +7325,29 @@ ACMD_FUNC(whereis) count = mobdb_searchname_array(mob_array, MAX_SEARCH, message); if (!count) { - 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 (count > MAX_SEARCH) { sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); count = MAX_SEARCH; } for (k = 0; k < count; k++) { mob = mob_array[k]; snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1289), mob->jname); // %s spawns in: - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); for (i = 0; i < ARRAYLENGTH(mob->spawn) && mob->spawn[i].qty; i++) { j = map_mapindex2mapid(mob->spawn[i].mapindex); if (j < 0) continue; snprintf(atcmd_output, sizeof atcmd_output, "%s (%d)", map[j].name, mob->spawn[i].qty); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } if (i == 0) - clif->displaymessage(fd, msg_txt(1290)); // This monster does not spawn normally. + clif->message(fd, msg_txt(1290)); // This monster does not spawn normally. } return 0; @@ -7352,9 +7359,9 @@ ACMD_FUNC(version) if ((revision = get_svn_revision()) != 0) { sprintf(atcmd_output,msg_txt(1295),revision); // rAthena Version SVN r%s - clif->displaymessage(fd,atcmd_output); + clif->message(fd,atcmd_output); } else - clif->displaymessage(fd,msg_txt(1296)); // Cannot determine SVN revision. + clif->message(fd,msg_txt(1296)); // Cannot determine SVN revision. return 0; } @@ -7389,7 +7396,7 @@ ACMD_FUNC(mutearea) nullpo_ret(sd); if (!message || !*message) { - clif->displaymessage(fd, msg_txt(1297)); // Please enter a time in minutes (usage: @mutearea/@stfu <time in minutes>). + clif->message(fd, msg_txt(1297)); // Please enter a time in minutes (usage: @mutearea/@stfu <time in minutes>). return -1; } @@ -7412,16 +7419,16 @@ ACMD_FUNC(rates) snprintf(buf, CHAT_SIZE_MAX, msg_txt(1298), // Experience rates: Base %.2fx / Job %.2fx battle_config.base_exp_rate/100., battle_config.job_exp_rate/100.); - clif->displaymessage(fd, buf); + clif->message(fd, buf); snprintf(buf, CHAT_SIZE_MAX, msg_txt(1299), // Normal Drop Rates: Common %.2fx / Healing %.2fx / Usable %.2fx / Equipment %.2fx / Card %.2fx battle_config.item_rate_common/100., battle_config.item_rate_heal/100., battle_config.item_rate_use/100., battle_config.item_rate_equip/100., battle_config.item_rate_card/100.); - clif->displaymessage(fd, buf); + clif->message(fd, buf); snprintf(buf, CHAT_SIZE_MAX, msg_txt(1300), // Boss Drop Rates: Common %.2fx / Healing %.2fx / Usable %.2fx / Equipment %.2fx / Card %.2fx battle_config.item_rate_common_boss/100., battle_config.item_rate_heal_boss/100., battle_config.item_rate_use_boss/100., battle_config.item_rate_equip_boss/100., battle_config.item_rate_card_boss/100.); - clif->displaymessage(fd, buf); + clif->message(fd, buf); snprintf(buf, CHAT_SIZE_MAX, msg_txt(1301), // Other Drop Rates: MvP %.2fx / Card-Based %.2fx / Treasure %.2fx battle_config.item_rate_mvp/100., battle_config.item_rate_adddrop/100., battle_config.item_rate_treasure/100.); - clif->displaymessage(fd, buf); + clif->message(fd, buf); return 0; } @@ -7444,12 +7451,12 @@ ACMD_FUNC(me) return -1; if (!message || !*message || sscanf(message, "%199[^\n]", tempmes) < 0) { - clif->displaymessage(fd, msg_txt(1302)); // Please enter a message (usage: @me <message>). + clif->message(fd, msg_txt(1302)); // Please enter a message (usage: @me <message>). return -1; } sprintf(atcmd_output, msg_txt(270), sd->status.name, tempmes); // *%s %s* - clif->disp_overhead(sd, atcmd_output); + clif->disp_overhead(&sd->bl, atcmd_output); return 0; @@ -7477,7 +7484,7 @@ ACMD_FUNC(size) else if( size == SZ_BIG ) clif->specialeffect(&sd->bl,422,AREA); - clif->displaymessage(fd, msg_txt(1303)); // Size change applied. + clif->message(fd, msg_txt(1303)); // Size change applied. return 0; } @@ -7507,7 +7514,7 @@ ACMD_FUNC(sizeall) } mapit_free(iter); - clif->displaymessage(fd, msg_txt(1303)); // Size change applied. + clif->message(fd, msg_txt(1303)); // Size change applied. return 0; } @@ -7522,12 +7529,12 @@ ACMD_FUNC(sizeguild) memset(guild, '\0', sizeof(guild)); if( !message || !*message || sscanf(message, "%d %23[^\n]", &size, guild) < 2 ) { - clif->displaymessage(fd, msg_txt(1304)); // Please enter guild name/ID (usage: @sizeguild <size> <guild name/ID>). + clif->message(fd, msg_txt(1304)); // Please enter guild name/ID (usage: @sizeguild <size> <guild name/ID>). return -1; } if( (g = guild_searchname(guild)) == NULL && (g = guild_search(atoi(guild))) == NULL ) { - clif->displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online. + clif->message(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online. return -1; } @@ -7548,7 +7555,7 @@ ACMD_FUNC(sizeguild) } } - clif->displaymessage(fd, msg_txt(1303)); // Size change applied. + clif->message(fd, msg_txt(1303)); // Size change applied. return 0; } @@ -7562,10 +7569,10 @@ ACMD_FUNC(monsterignore) if (!sd->state.monster_ignore) { sd->state.monster_ignore = 1; - clif->displaymessage(sd->fd, msg_txt(1305)); // You are now immune to attacks. + clif->message(sd->fd, msg_txt(1305)); // You are now immune to attacks. } else { sd->state.monster_ignore = 0; - clif->displaymessage(sd->fd, msg_txt(1306)); // Returned to normal state. + clif->message(sd->fd, msg_txt(1306)); // Returned to normal state. } return 0; @@ -7584,23 +7591,23 @@ ACMD_FUNC(fakename) { sd->fakename[0] = '\0'; clif->charnameack(0, &sd->bl); - clif->displaymessage(sd->fd, msg_txt(1307)); // Returned to real name. + clif->message(sd->fd, msg_txt(1307)); // Returned to real name. return 0; } - clif->displaymessage(sd->fd, msg_txt(1308)); // You must enter a name. + clif->message(sd->fd, msg_txt(1308)); // You must enter a name. return -1; } if( strlen(message) < 2 ) { - clif->displaymessage(sd->fd, msg_txt(1309)); // Fake name must be at least two characters. + clif->message(sd->fd, msg_txt(1309)); // Fake name must be at least two characters. return -1; } safestrncpy(sd->fakename, message, sizeof(sd->fakename)); clif->charnameack(0, &sd->bl); - clif->displaymessage(sd->fd, msg_txt(1310)); // Fake name enabled. + clif->message(sd->fd, msg_txt(1310)); // Fake name enabled. return 0; } @@ -7609,12 +7616,12 @@ ACMD_FUNC(fakename) * Ragnarok Resources *------------------------------------------*/ ACMD_FUNC(mapflag) { -#define checkflag( cmd ) if ( map[ sd->bl.m ].flag.cmd ) clif->displaymessage(sd->fd,#cmd) +#define checkflag( cmd ) if ( map[ sd->bl.m ].flag.cmd ) clif->message(sd->fd,#cmd) #define setflag( cmd ) \ if ( strcmp( flag_name , #cmd ) == 0 ){\ map[ sd->bl.m ].flag.cmd = flag;\ sprintf(atcmd_output,"[ @mapflag ] %s flag has been set to %s value = %hd",#cmd,flag?"On":"Off",flag);\ - clif->displaymessage(sd->fd,atcmd_output);\ + clif->message(sd->fd,atcmd_output);\ return 0;\ } char flag_name[100]; @@ -7623,8 +7630,8 @@ ACMD_FUNC(mapflag) { memset(flag_name, '\0', sizeof(flag_name)); if (!message || !*message || (sscanf(message, "%99s %hd", flag_name, &flag) < 1)) { - clif->displaymessage(sd->fd,msg_txt(1311)); // Enabled Mapflags in this map: - clif->displaymessage(sd->fd,"----------------------------------"); + clif->message(sd->fd,msg_txt(1311)); // Enabled Mapflags in this map: + clif->message(sd->fd,"----------------------------------"); checkflag(autotrade); checkflag(allowks); checkflag(nomemo); checkflag(noteleport); checkflag(noreturn); checkflag(monster_noteleport); checkflag(nosave); checkflag(nobranch); checkflag(noexppenalty); checkflag(pvp); checkflag(pvp_noparty); checkflag(pvp_noguild); @@ -7637,9 +7644,9 @@ ACMD_FUNC(mapflag) { checkflag(nojobexp); checkflag(nomobloot); checkflag(nomvploot); checkflag(nightenabled); checkflag(nodrop); checkflag(novending); checkflag(loadevent); checkflag(nochat); checkflag(partylock); checkflag(guildlock); checkflag(src4instance); - clif->displaymessage(sd->fd," "); - clif->displaymessage(sd->fd,msg_txt(1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On) - clif->displaymessage(sd->fd,msg_txt(1313)); // Type "@mapflag available" to list the available mapflags. + clif->message(sd->fd," "); + clif->message(sd->fd,msg_txt(1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On) + clif->message(sd->fd,msg_txt(1313)); // Type "@mapflag available" to list the available mapflags. return 1; } for (i = 0; flag_name[i]; i++) flag_name[i] = (char)tolower(flag_name[i]); //lowercase @@ -7657,17 +7664,17 @@ ACMD_FUNC(mapflag) { setflag(nodrop); setflag(novending); setflag(loadevent); setflag(nochat); setflag(partylock); setflag(guildlock); setflag(src4instance); - clif->displaymessage(sd->fd,msg_txt(1314)); // Invalid flag name or flag. - clif->displaymessage(sd->fd,msg_txt(1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On) - clif->displaymessage(sd->fd,msg_txt(1315)); // Available Flags: - clif->displaymessage(sd->fd,"----------------------------------"); - clif->displaymessage(sd->fd,"town, autotrade, allowks, nomemo, noteleport, noreturn, monster_noteleport, nosave,"); - clif->displaymessage(sd->fd,"nobranch, noexppenalty, pvp, pvp_noparty, pvp_noguild, pvp_nightmaredrop,"); - clif->displaymessage(sd->fd,"pvp_nocalcrank, gvg_castle, gvg, gvg_dungeon, gvg_noparty, battleground,"); - clif->displaymessage(sd->fd,"nozenypenalty, notrade, noskill, nowarp, nowarpto, noicewall, snow, clouds, clouds2,"); - clif->displaymessage(sd->fd,"fog, fireworks, sakura, leaves, nogo, nobaseexp, nojobexp, nomobloot,"); - clif->displaymessage(sd->fd,"nomvploot, nightenabled, nodrop, novending, loadevent, nochat, partylock,"); - clif->displaymessage(sd->fd,"guildlock, src4instance"); + clif->message(sd->fd,msg_txt(1314)); // Invalid flag name or flag. + clif->message(sd->fd,msg_txt(1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On) + clif->message(sd->fd,msg_txt(1315)); // Available Flags: + clif->message(sd->fd,"----------------------------------"); + clif->message(sd->fd,"town, autotrade, allowks, nomemo, noteleport, noreturn, monster_noteleport, nosave,"); + clif->message(sd->fd,"nobranch, noexppenalty, pvp, pvp_noparty, pvp_noguild, pvp_nightmaredrop,"); + clif->message(sd->fd,"pvp_nocalcrank, gvg_castle, gvg, gvg_dungeon, gvg_noparty, battleground,"); + clif->message(sd->fd,"nozenypenalty, notrade, noskill, nowarp, nowarpto, noicewall, snow, clouds, clouds2,"); + clif->message(sd->fd,"fog, fireworks, sakura, leaves, nogo, nobaseexp, nojobexp, nomobloot,"); + clif->message(sd->fd,"nomvploot, nightenabled, nodrop, novending, loadevent, nochat, partylock,"); + clif->message(sd->fd,"guildlock, src4instance"); #undef checkflag #undef setflag @@ -7682,12 +7689,12 @@ ACMD_FUNC(showexp) { if (sd->state.showexp) { sd->state.showexp = 0; - clif->displaymessage(fd, msg_txt(1316)); // Gained exp will not be shown. + clif->message(fd, msg_txt(1316)); // Gained exp will not be shown. return 0; } sd->state.showexp = 1; - clif->displaymessage(fd, msg_txt(1317)); // Gained exp is now shown. + clif->message(fd, msg_txt(1317)); // Gained exp is now shown. return 0; } @@ -7695,12 +7702,12 @@ ACMD_FUNC(showzeny) { if (sd->state.showzeny) { sd->state.showzeny = 0; - clif->displaymessage(fd, msg_txt(1318)); // Gained zeny will not be shown. + clif->message(fd, msg_txt(1318)); // Gained zeny will not be shown. return 0; } sd->state.showzeny = 1; - clif->displaymessage(fd, msg_txt(1319)); // Gained zeny is now shown. + clif->message(fd, msg_txt(1319)); // Gained zeny is now shown. return 0; } @@ -7708,12 +7715,12 @@ ACMD_FUNC(showdelay) { if (sd->state.showdelay) { sd->state.showdelay = 0; - clif->displaymessage(fd, msg_txt(1320)); // Skill delay failures will not be shown. + clif->message(fd, msg_txt(1320)); // Skill delay failures will not be shown. return 0; } sd->state.showdelay = 1; - clif->displaymessage(fd, msg_txt(1321)); // Skill delay failures are now shown. + clif->message(fd, msg_txt(1321)); // Skill delay failures are now shown. return 0; } @@ -7733,7 +7740,7 @@ ACMD_FUNC(invite) if(did == 0) { // "Duel: @invite without @duel." - clif->displaymessage(fd, msg_txt(350)); + clif->message(fd, msg_txt(350)); return 0; } @@ -7741,32 +7748,32 @@ ACMD_FUNC(invite) duel_list[did].members_count >= duel_list[did].max_players_limit) { // "Duel: Limit of players is reached." - clif->displaymessage(fd, msg_txt(351)); + clif->message(fd, msg_txt(351)); return 0; } if(target_sd == NULL) { // "Duel: Player not found." - clif->displaymessage(fd, msg_txt(352)); + clif->message(fd, msg_txt(352)); return 0; } if(target_sd->duel_group > 0 || target_sd->duel_invite > 0) { // "Duel: Player already in duel." - clif->displaymessage(fd, msg_txt(353)); + clif->message(fd, msg_txt(353)); return 0; } if(battle_config.duel_only_on_same_map && target_sd->bl.m != sd->bl.m) { sprintf(atcmd_output, msg_txt(364), message); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return 0; } duel_invite(did, sd, target_sd); // "Duel: Invitation has been sent." - clif->displaymessage(fd, msg_txt(354)); + clif->message(fd, msg_txt(354)); return 0; } @@ -7781,7 +7788,7 @@ ACMD_FUNC(duel) if(sd->duel_invite > 0) { // "Duel: @duel without @reject." - clif->displaymessage(fd, msg_txt(355)); + clif->message(fd, msg_txt(355)); return 0; } @@ -7789,14 +7796,14 @@ ACMD_FUNC(duel) char output[CHAT_SIZE_MAX]; // "Duel: You can take part in duel only one time per %d minutes." sprintf(output, msg_txt(356), battle_config.duel_time_interval); - clif->displaymessage(fd, output); + clif->message(fd, output); return 0; } if( message[0] ) { if(sscanf(message, "%d", &maxpl) >= 1) { if(maxpl < 2 || maxpl > 65535) { - clif->displaymessage(fd, msg_txt(357)); // "Duel: Invalid value." + clif->message(fd, msg_txt(357)); // "Duel: Invalid value." return 0; } duel_create(sd, maxpl); @@ -7807,15 +7814,15 @@ ACMD_FUNC(duel) unsigned int newduel; if((newduel = duel_create(sd, 2)) != -1) { if(target_sd->duel_group > 0 || target_sd->duel_invite > 0) { - clif->displaymessage(fd, msg_txt(353)); // "Duel: Player already in duel." + clif->message(fd, msg_txt(353)); // "Duel: Player already in duel." return 0; } duel_invite(newduel, sd, target_sd); - clif->displaymessage(fd, msg_txt(354)); // "Duel: Invitation has been sent." + clif->message(fd, msg_txt(354)); // "Duel: Invitation has been sent." } } else { // "Duel: Player not found." - clif->displaymessage(fd, msg_txt(352)); + clif->message(fd, msg_txt(352)); return 0; } } @@ -7830,12 +7837,12 @@ ACMD_FUNC(leave) { if(sd->duel_group <= 0) { // "Duel: @leave without @duel." - clif->displaymessage(fd, msg_txt(358)); + clif->message(fd, msg_txt(358)); return 0; } duel_leave(sd->duel_group, sd); - clif->displaymessage(fd, msg_txt(359)); // "Duel: You left the duel." + clif->message(fd, msg_txt(359)); // "Duel: You left the duel." return 0; } @@ -7845,26 +7852,26 @@ ACMD_FUNC(accept) char output[CHAT_SIZE_MAX]; // "Duel: You can take part in duel only one time per %d minutes." sprintf(output, msg_txt(356), battle_config.duel_time_interval); - clif->displaymessage(fd, output); + clif->message(fd, output); return 0; } if(sd->duel_invite <= 0) { // "Duel: @accept without invititation." - clif->displaymessage(fd, msg_txt(360)); + clif->message(fd, msg_txt(360)); return 0; } if( duel_list[sd->duel_invite].max_players_limit > 0 && duel_list[sd->duel_invite].members_count >= duel_list[sd->duel_invite].max_players_limit ) { // "Duel: Limit of players is reached." - clif->displaymessage(fd, msg_txt(351)); + clif->message(fd, msg_txt(351)); return 0; } duel_accept(sd->duel_invite, sd); // "Duel: Invitation has been accepted." - clif->displaymessage(fd, msg_txt(361)); + clif->message(fd, msg_txt(361)); return 0; } @@ -7872,13 +7879,13 @@ ACMD_FUNC(reject) { if(sd->duel_invite <= 0) { // "Duel: @reject without invititation." - clif->displaymessage(fd, msg_txt(362)); + clif->message(fd, msg_txt(362)); return 0; } duel_reject(sd->duel_invite, sd); // "Duel: Invitation has been rejected." - clif->displaymessage(fd, msg_txt(363)); + clif->message(fd, msg_txt(363)); return 0; } @@ -7893,7 +7900,7 @@ ACMD_FUNC(cash) nullpo_retr(-1, sd); if( !message || !*message || (value = atoi(message)) == 0 ) { - clif->displaymessage(fd, msg_txt(1322)); // Please enter an amount. + clif->message(fd, msg_txt(1322)); // Please enter an amount. return -1; } @@ -7904,13 +7911,13 @@ ACMD_FUNC(cash) sprintf(output, msg_txt(505), ret, sd->cashPoints); clif->disp_onlyself(sd, output, strlen(output)); } - else clif->displaymessage(fd, msg_txt(149)); // Unable to decrease the number/value. + else clif->message(fd, msg_txt(149)); // Unable to decrease the number/value. } else { if( (ret=pc_paycash(sd, -value, 0)) >= 0){ sprintf(output, msg_txt(410), ret, sd->cashPoints); clif->disp_onlyself(sd, output, strlen(output)); } - else clif->displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value. + else clif->message(fd, msg_txt(41)); // Unable to decrease the number/value. } } else @@ -7920,13 +7927,13 @@ ACMD_FUNC(cash) sprintf(output, msg_txt(506), ret, sd->kafraPoints); clif->disp_onlyself(sd, output, strlen(output)); } - else clif->displaymessage(fd, msg_txt(149)); // Unable to decrease the number/value. + else clif->message(fd, msg_txt(149)); // Unable to decrease the number/value. } else { if( (ret=pc_paycash(sd, -value, -value)) >= 0){ sprintf(output, msg_txt(411), ret, sd->kafraPoints); clif->disp_onlyself(sd, output, strlen(output)); } - else clif->displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value. + else clif->message(fd, msg_txt(41)); // Unable to decrease the number/value. } } @@ -7940,17 +7947,17 @@ ACMD_FUNC(clone) struct map_session_data *pl_sd=NULL; if (!message || !*message) { - clif->displaymessage(sd->fd,msg_txt(1323)); // You must enter a player name or ID. + clif->message(sd->fd,msg_txt(1323)); // You must enter a player name or ID. return 0; } 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 0; } if(pc_get_group_level(pl_sd) > pc_get_group_level(sd)) { - clif->displaymessage(fd, msg_txt(126)); // Cannot clone a player of higher GM level than yourself. + clif->message(fd, msg_txt(126)); // Cannot clone a player of higher GM level than yourself. return 0; } @@ -7959,13 +7966,13 @@ ACMD_FUNC(clone) else if (strcmpi(command+1, "slaveclone") == 0) { flag = 2; if(pc_isdead(sd)){ - clif->displaymessage(fd, msg_txt(129+flag*2)); + clif->message(fd, msg_txt(129+flag*2)); return 0; } master = sd->bl.id; if (battle_config.atc_slave_clone_limit && mob_countslave(&sd->bl) >= battle_config.atc_slave_clone_limit) { - clif->displaymessage(fd, msg_txt(127)); // You've reached your slave clones limit. + clif->message(fd, msg_txt(127)); // You've reached your slave clones limit. return 0; } } @@ -7981,62 +7988,10 @@ ACMD_FUNC(clone) } if((x = mob_clone_spawn(pl_sd, sd->bl.m, x, y, "", master, 0, flag?1:0, 0)) > 0) { - clif->displaymessage(fd, msg_txt(128+flag*2)); // Evil Clone spawned. Clone spawned. Slave clone spawned. + clif->message(fd, msg_txt(128+flag*2)); // Evil Clone spawned. Clone spawned. Slave clone spawned. return 0; } - clif->displaymessage(fd, msg_txt(129+flag*2)); // Unable to spawn evil clone. Unable to spawn clone. Unable to spawn slave clone. - return 0; -} - -/*=================================== - * Main chat [LuzZza] - * Usage: @main <on|off|message> - *-----------------------------------*/ -ACMD_FUNC(main) -{ - if( message[0] ) { - - if(strcmpi(message, "on") == 0) { - if(!sd->state.mainchat) { - sd->state.mainchat = 1; - clif->displaymessage(fd, msg_txt(380)); // Main chat has been activated. - } else { - clif->displaymessage(fd, msg_txt(381)); // Main chat already activated. - } - } else if(strcmpi(message, "off") == 0) { - if(sd->state.mainchat) { - sd->state.mainchat = 0; - clif->displaymessage(fd, msg_txt(382)); // Main chat has been disabled. - } else { - clif->displaymessage(fd, msg_txt(383)); // Main chat already disabled. - } - } else { - if(!sd->state.mainchat) { - sd->state.mainchat = 1; - clif->displaymessage(fd, msg_txt(380)); // Main chat has been activated. - } - if (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) { - clif->displaymessage(fd, msg_txt(387)); - return -1; - } - - if ( battle_config.min_chat_delay ) { - if( DIFF_TICK(sd->cantalk_tick, gettick()) > 0 ) - return 0; - sd->cantalk_tick = gettick() + battle_config.min_chat_delay; - } - - // send the message using inter-server system - intif_main_message( sd, message ); - } - - } else { - - if(sd->state.mainchat) - clif->displaymessage(fd, msg_txt(384)); // Main chat currently enabled. Usage: @main <on|off>, @main <message>. - else - clif->displaymessage(fd, msg_txt(385)); // Main chat currently disabled. Usage: @main <on|off>, @main <message>. - } + clif->message(fd, msg_txt(129+flag*2)); // Unable to spawn evil clone. Unable to spawn clone. Unable to spawn slave clone. return 0; } @@ -8047,10 +8002,10 @@ ACMD_FUNC(main) ACMD_FUNC(noask) { if(sd->state.noask) { - clif->displaymessage(fd, msg_txt(391)); // Autorejecting is deactivated. + clif->message(fd, msg_txt(391)); // Autorejecting is deactivated. sd->state.noask = 0; } else { - clif->displaymessage(fd, msg_txt(390)); // Autorejecting is activated. + clif->message(fd, msg_txt(390)); // Autorejecting is activated. sd->state.noask = 1; } @@ -8064,14 +8019,14 @@ ACMD_FUNC(noask) ACMD_FUNC(request) { if (!message || !*message) { - clif->displaymessage(sd->fd,msg_txt(277)); // Usage: @request <petition/message to online GMs>. + clif->message(sd->fd,msg_txt(277)); // Usage: @request <petition/message to online GMs>. return -1; } sprintf(atcmd_output, msg_txt(278), message); // (@request): %s intif_wis_message_to_gm(sd->status.name, PC_PERM_RECEIVE_REQUESTS, atcmd_output); clif->disp_onlyself(sd, atcmd_output, strlen(atcmd_output)); - clif->displaymessage(sd->fd,msg_txt(279)); // @request sent. + clif->message(sd->fd,msg_txt(279)); // @request sent. return 0; } @@ -8081,7 +8036,7 @@ ACMD_FUNC(request) ACMD_FUNC(feelreset) { pc_resetfeel(sd); - clif->displaymessage(fd, msg_txt(1324)); // Reset 'Feeling' maps. + clif->message(fd, msg_txt(1324)); // Reset 'Feeling' maps. return 0; } @@ -8107,27 +8062,27 @@ ACMD_FUNC(ksprotection) if( sd->state.noks ) { sd->state.noks = 0; - clif->displaymessage(fd, msg_txt(1325)); // [ K.S Protection Inactive ] + clif->message(fd, msg_txt(1325)); // [ K.S Protection Inactive ] } else { if( !message || !*message || !strcmpi(message, "party") ) { // Default is Party sd->state.noks = 2; - clif->displaymessage(fd, msg_txt(1326)); // [ K.S Protection Active - Option: Party ] + clif->message(fd, msg_txt(1326)); // [ K.S Protection Active - Option: Party ] } else if( !strcmpi(message, "self") ) { sd->state.noks = 1; - clif->displaymessage(fd, msg_txt(1327)); // [ K.S Protection Active - Option: Self ] + clif->message(fd, msg_txt(1327)); // [ K.S Protection Active - Option: Self ] } else if( !strcmpi(message, "guild") ) { sd->state.noks = 3; - clif->displaymessage(fd, msg_txt(1328)); // [ K.S Protection Active - Option: Guild ] + clif->message(fd, msg_txt(1328)); // [ K.S Protection Active - Option: Guild ] } else - clif->displaymessage(fd, msg_txt(1329)); // Usage: @noks <self|party|guild> + clif->message(fd, msg_txt(1329)); // Usage: @noks <self|party|guild> } return 0; } @@ -8140,10 +8095,10 @@ ACMD_FUNC(allowks) if( map[sd->bl.m].flag.allowks ) { map[sd->bl.m].flag.allowks = 0; - clif->displaymessage(fd, msg_txt(1330)); // [ Map K.S Protection Active ] + clif->message(fd, msg_txt(1330)); // [ Map K.S Protection Active ] } else { map[sd->bl.m].flag.allowks = 1; - clif->displaymessage(fd, msg_txt(1331)); // [ Map K.S Protection Inactive ] + clif->message(fd, msg_txt(1331)); // [ Map K.S Protection Inactive ] } return 0; } @@ -8154,7 +8109,7 @@ ACMD_FUNC(resetstat) pc_resetstate(sd); sprintf(atcmd_output, msg_txt(207), sd->status.name); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return 0; } @@ -8164,7 +8119,7 @@ ACMD_FUNC(resetskill) pc_resetskill(sd,1); sprintf(atcmd_output, msg_txt(206), sd->status.name); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return 0; } @@ -8224,7 +8179,7 @@ ACMD_FUNC(itemlist) if( count == 1 ) { StringBuf_Printf(&buf, msg_txt(1332), location, sd->status.name); // ------ %s items list of '%s' ------ - clif->displaymessage(fd, StringBuf_Value(&buf)); + clif->message(fd, StringBuf_Value(&buf)); StringBuf_Clear(&buf); } @@ -8270,7 +8225,7 @@ ACMD_FUNC(itemlist) StringBuf_AppendStr(&buf, equipstr); } - clif->displaymessage(fd, StringBuf_Value(&buf)); + clif->message(fd, StringBuf_Value(&buf)); StringBuf_Clear(&buf); if( it->card[0] == CARD0_PET ) @@ -8317,7 +8272,7 @@ ACMD_FUNC(itemlist) } if( StringBuf_Length(&buf) > 0 ) - clif->displaymessage(fd, StringBuf_Value(&buf)); + clif->message(fd, StringBuf_Value(&buf)); StringBuf_Clear(&buf); } @@ -8327,7 +8282,7 @@ ACMD_FUNC(itemlist) else StringBuf_Printf(&buf, msg_txt(1354), counter, count, location); // %d item(s) found in %d %s slots. - clif->displaymessage(fd, StringBuf_Value(&buf)); + clif->message(fd, StringBuf_Value(&buf)); StringBuf_Destroy(&buf); @@ -8387,11 +8342,11 @@ ACMD_FUNC(stats) sprintf(job_jobname, "Job - %s %s", job_name(sd->status.class_), "(level %d)"); sprintf(output, msg_txt(53), sd->status.name); // '%s' stats: - clif->displaymessage(fd, output); + clif->message(fd, output); for (i = 0; output_table[i].format != NULL; i++) { sprintf(output, output_table[i].format, output_table[i].value); - clif->displaymessage(fd, output); + clif->message(fd, output); } return 0; @@ -8407,7 +8362,7 @@ ACMD_FUNC(delitem) if( !message || !*message || ( sscanf(message, "\"%99[^\"]\" %d", item_name, &amount) < 2 && sscanf(message, "%99s %d", item_name, &amount) < 2 ) || amount < 1 ) { - clif->displaymessage(fd, msg_txt(1355)); // Please enter an item name/ID, a quantity, and a player name (usage: #delitem <player> <item_name_or_ID> <quantity>). + clif->message(fd, msg_txt(1355)); // Please enter an item name/ID, a quantity, and a player name (usage: #delitem <player> <item_name_or_ID> <quantity>). return -1; } @@ -8417,7 +8372,7 @@ ACMD_FUNC(delitem) } 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; } @@ -8439,22 +8394,22 @@ ACMD_FUNC(delitem) // notify target sprintf(atcmd_output, msg_txt(113), total-amount); // %d item(s) removed by a GM. - clif->displaymessage(sd->fd, atcmd_output); + clif->message(sd->fd, atcmd_output); // notify source if( amount == total ) { - clif->displaymessage(fd, msg_txt(116)); // Character does not have the item. + clif->message(fd, msg_txt(116)); // Character does not have the item. } else if( amount ) { sprintf(atcmd_output, msg_txt(115), total-amount, total-amount, total); // %d item(s) removed. Player had only %d on %d items. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } else { sprintf(atcmd_output, msg_txt(114), total); // %d item(s) removed from the player. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } return 0; @@ -8474,25 +8429,25 @@ ACMD_FUNC(font) if( sd->user_font ) { sd->user_font = 0; - clif->displaymessage(fd, msg_txt(1356)); // Returning to normal font. + clif->message(fd, msg_txt(1356)); // Returning to normal font. clif->font(sd); } else { - clif->displaymessage(fd, msg_txt(1357)); // Use @font <1-9> to change your message font. - clif->displaymessage(fd, msg_txt(1358)); // Use 0 or no parameter to return to normal font. + clif->message(fd, msg_txt(1357)); // Use @font <1-9> to change your message font. + clif->message(fd, msg_txt(1358)); // Use 0 or no parameter to return to normal font. } } else if( font_id < 0 || font_id > 9 ) - clif->displaymessage(fd, msg_txt(1359)); // Invalid font. Use a value from 0 to 9. + clif->message(fd, msg_txt(1359)); // Invalid font. Use a value from 0 to 9. else if( font_id != sd->user_font ) { sd->user_font = font_id; clif->font(sd); - clif->displaymessage(fd, msg_txt(1360)); // Font changed. + clif->message(fd, msg_txt(1360)); // Font changed. } else - clif->displaymessage(fd, msg_txt(1361)); // Already using this font. + clif->message(fd, msg_txt(1361)); // Already using this font. return 0; } @@ -8511,7 +8466,7 @@ static void atcommand_commands_sub(struct map_session_data* sd, const int fd, At memset(line_buff,' ',CHATBOX_SIZE); line_buff[CHATBOX_SIZE-1] = 0; - clif->displaymessage(fd, msg_txt(273)); // "Commands available:" + clif->message(fd, msg_txt(273)); // "Commands available:" for (cmd = dbi_first(iter); dbi_exists(iter); cmd = dbi_next(iter)) { unsigned int slen = 0; @@ -8535,7 +8490,7 @@ static void atcommand_commands_sub(struct map_session_data* sd, const int fd, At // flush the text buffer if this command won't fit into it if ( slen + cur - line_buff >= CHATBOX_SIZE ) { - clif->displaymessage(fd,line_buff); + clif->message(fd,line_buff); cur = line_buff; memset(line_buff,' ',CHATBOX_SIZE); line_buff[CHATBOX_SIZE-1] = 0; @@ -8547,10 +8502,10 @@ static void atcommand_commands_sub(struct map_session_data* sd, const int fd, At count++; } dbi_destroy(iter); - clif->displaymessage(fd,line_buff); + clif->message(fd,line_buff); sprintf(atcmd_output, msg_txt(274), count); // "%d commands found." - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return; } @@ -8575,12 +8530,12 @@ ACMD_FUNC(charcommands) /* for new mounts */ ACMD_FUNC(mount2) { - clif->displaymessage(sd->fd,msg_txt(1362)); // NOTICE: If you crash with mount your LUA is outdated. + clif->message(sd->fd,msg_txt(1362)); // NOTICE: If you crash with mount your LUA is outdated. if( !(sd->sc.option&OPTION_MOUNTING) ) { - clif->displaymessage(sd->fd,msg_txt(1363)); // You have mounted. + clif->message(sd->fd,msg_txt(1363)); // You have mounted. pc_setoption(sd, sd->sc.option|OPTION_MOUNTING); } else { - clif->displaymessage(sd->fd,msg_txt(1364)); // You have released your mount. + clif->message(sd->fd,msg_txt(1364)); // You have released your mount. pc_setoption(sd, sd->sc.option&~OPTION_MOUNTING); } return 0; @@ -8590,8 +8545,8 @@ ACMD_FUNC(accinfo) { char query[NAME_LENGTH]; if (!message || !*message || strlen(message) > NAME_LENGTH ) { - clif->displaymessage(fd, msg_txt(1365)); // Usage: @accinfo/@accountinfo <account_id/char name> - clif->displaymessage(fd, msg_txt(1366)); // You may search partial name by making use of '%' in the search, ex. "@accinfo %Mario%" lists all characters whose name contains "Mario". + clif->message(fd, msg_txt(1365)); // Usage: @accinfo/@accountinfo <account_id/char name> + clif->message(fd, msg_txt(1366)); // You may search partial name by making use of '%' in the search, ex. "@accinfo %Mario%" lists all characters whose name contains "Mario". return -1; } @@ -8611,19 +8566,19 @@ ACMD_FUNC(set) { bool is_str = false; if( !message || !*message || (toset = sscanf(message, "%31s %128[^\n]s", reg, val)) < 1 ) { - clif->displaymessage(fd, msg_txt(1367)); // Usage: @set <variable name> <value> - clif->displaymessage(fd, msg_txt(1368)); // Usage: ex. "@set PoringCharVar 50" - clif->displaymessage(fd, msg_txt(1369)); // Usage: ex. "@set PoringCharVarSTR$ Super Duper String" - clif->displaymessage(fd, msg_txt(1370)); // Usage: ex. "@set PoringCharVarSTR$" outputs its value, Super Duper String. + clif->message(fd, msg_txt(1367)); // Usage: @set <variable name> <value> + clif->message(fd, msg_txt(1368)); // Usage: ex. "@set PoringCharVar 50" + clif->message(fd, msg_txt(1369)); // Usage: ex. "@set PoringCharVarSTR$ Super Duper String" + clif->message(fd, msg_txt(1370)); // Usage: ex. "@set PoringCharVarSTR$" outputs its value, Super Duper String. return -1; } /* disabled variable types (they require a proper script state to function, so allowing them would crash the server) */ if( reg[0] == '.' ) { - clif->displaymessage(fd, msg_txt(1371)); // NPC variables may not be used with @set. + clif->message(fd, msg_txt(1371)); // NPC variables may not be used with @set. return -1; } else if( reg[0] == '\'' ) { - clif->displaymessage(fd, msg_txt(1372)); // Instance variables may not be used with @set. + clif->message(fd, msg_txt(1372)); // Instance variables may not be used with @set. return -1; } @@ -8714,7 +8669,7 @@ ACMD_FUNC(set) { break; } - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); aFree(data); @@ -8722,7 +8677,7 @@ ACMD_FUNC(set) { } ACMD_FUNC(reloadquestdb) { do_reload_quest(); - clif->displaymessage(fd, msg_txt(1377)); // Quest database has been reloaded. + clif->message(fd, msg_txt(1377)); // Quest database has been reloaded. return 0; } ACMD_FUNC(addperm) { @@ -8732,11 +8687,11 @@ ACMD_FUNC(addperm) { if( !message || !*message ) { sprintf(atcmd_output, msg_txt(1378),command); // Usage: %s <permission_name> - clif->displaymessage(fd, atcmd_output); - clif->displaymessage(fd, msg_txt(1379)); // -- Permission List + clif->message(fd, atcmd_output); + clif->message(fd, msg_txt(1379)); // -- Permission List for( i = 0; i < perm_size; i++ ) { sprintf(atcmd_output,"- %s",pc_g_permission_name[i].name); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } return -1; } @@ -8745,28 +8700,28 @@ ACMD_FUNC(addperm) { if( i == perm_size ) { sprintf(atcmd_output,msg_txt(1380),message); // '%s' is not a known permission. - clif->displaymessage(fd, atcmd_output); - clif->displaymessage(fd, msg_txt(1379)); // -- Permission List + clif->message(fd, atcmd_output); + clif->message(fd, msg_txt(1379)); // -- Permission List for( i = 0; i < perm_size; i++ ) { sprintf(atcmd_output,"- %s",pc_g_permission_name[i].name); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } return -1; } if( add && (sd->permissions&pc_g_permission_name[i].permission) ) { sprintf(atcmd_output, msg_txt(1381),sd->status.name,pc_g_permission_name[i].name); // User '%s' already possesses the '%s' permission. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return -1; } else if ( !add && !(sd->permissions&pc_g_permission_name[i].permission) ) { sprintf(atcmd_output, msg_txt(1382),sd->status.name,pc_g_permission_name[i].name); // User '%s' doesn't possess the '%s' permission. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output,msg_txt(1383),sd->status.name); // -- User '%s' Permissions - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); for( i = 0; i < perm_size; i++ ) { if( sd->permissions&pc_g_permission_name[i].permission ) { sprintf(atcmd_output,"- %s",pc_g_permission_name[i].name); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } } @@ -8780,21 +8735,21 @@ ACMD_FUNC(addperm) { sprintf(atcmd_output, msg_txt(1384),sd->status.name); // User '%s' permissions updated successfully. The changes are temporary. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return 0; } ACMD_FUNC(unloadnpcfile) { if( !message || !*message ) { - clif->displaymessage(fd, msg_txt(1385)); // Usage: @unloadnpcfile <file name> + clif->message(fd, msg_txt(1385)); // Usage: @unloadnpcfile <file name> return -1; } if( npc_unloadfile(message) ) - clif->displaymessage(fd, msg_txt(1386)); // File unloaded. Be aware that mapflags and monsters spawned directly are not removed. + clif->message(fd, msg_txt(1386)); // File unloaded. Be aware that mapflags and monsters spawned directly are not removed. else { - clif->displaymessage(fd, msg_txt(1387)); // File not found. + clif->message(fd, msg_txt(1387)); // File not found. return -1; } return 0; @@ -8810,12 +8765,12 @@ ACMD_FUNC(cart) { if( !message || !*message || val < 0 || val > MAX_CARTS ) { sprintf(atcmd_output, msg_txt(1390),command,MAX_CARTS); // Unknown Cart (usage: %s <0-%d>). - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return -1; } if( val == 0 && !pc_iscarton(sd) ) { - clif->displaymessage(fd, msg_txt(1391)); // You do not possess a cart to be removed + clif->message(fd, msg_txt(1391)); // You do not possess a cart to be removed return -1; } @@ -8834,12 +8789,302 @@ ACMD_FUNC(cart) { MC_CART_MDFY(0); } - clif->displaymessage(fd, msg_txt(1392)); // Cart Added + clif->message(fd, msg_txt(1392)); // Cart Added return 0; #undef MC_CART_MDFY } +/* [Ind/Hercules] */ +ACMD_FUNC(join) { + struct hChSysCh *channel; + char name[HCHSYS_NAME_LENGTH], pass[HCHSYS_NAME_LENGTH]; + + if( !message || !*message || sscanf(message, "%s %s", name, pass) < 1 ) { + sprintf(atcmd_output, msg_txt(1399),command); // Unknown Channel (usage: %s <#channel_name>) + clif->message(fd, atcmd_output); + return -1; + } + if( hChSys.local && strcmpi(name + 1, hChSys.local_name) == 0 ) { + if( !map[sd->bl.m].channel ) { + clif->chsys_mjoin(sd); + return 0; + } else + channel = map[sd->bl.m].channel; + } else if( hChSys.ally && sd->status.guild_id && strcmpi(name + 1, hChSys.ally_name) == 0 ) { + struct guild *g = sd->guild; + if( !g ) return -1;/* unlikely, but we wont let it crash anyway. */ + channel = (struct hChSysCh *)g->channel; + } else if( !( channel = strdb_get(clif->channel_db, name + 1) ) ) { + sprintf(atcmd_output, msg_txt(1400),name,command); // Unknown Channel '%s' (usage: %s <#channel_name>) + clif->message(fd, atcmd_output); + return -1; + } + + if( idb_exists(channel->users, sd->status.char_id) ) { + sprintf(atcmd_output, msg_txt(1434),name); // You're already in the '%s' channel + clif->message(fd, atcmd_output); + return -1; + } + if( channel->pass[0] != '\0' && strcmp(channel->pass,pass) != 0 ) { + if( pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN) ) { + sd->stealth = true; + } else { + sprintf(atcmd_output, msg_txt(1401),name,command); // '%s' Channel is password protected (usage: %s <#channel_name> <password>) + clif->message(fd, atcmd_output); + return -1; + } + } + + if( !( channel->opt & hChSys_OPT_ANNOUNCE_JOIN ) ) { + sprintf(atcmd_output, msg_txt(1403),name); // You're now in the '%s' channel + clif->message(fd, atcmd_output); + } + + clif->chsys_join(channel,sd); + + return 0; +} +/* [Ind/Hercules] */ +inline void atcmd_channel_help(int fd, const char *command, bool can_create) { + sprintf(atcmd_output, msg_txt(1404),command); // %s failed. + clif->message(fd, atcmd_output); + clif->message(fd, msg_txt(1414));// --- Available options: + if( can_create ) { + sprintf(atcmd_output, msg_txt(1415),command);// -- %s create <channel name> <channel password> + clif->message(fd, atcmd_output); + clif->message(fd, msg_txt(1416));// - creates a new channel + } + sprintf(atcmd_output, msg_txt(1417),command);// -- %s list + clif->message(fd, atcmd_output); + clif->message(fd, msg_txt(1418));// - lists public channels + if( can_create ) { + sprintf(atcmd_output, msg_txt(1419),command);// -- %s list colors + clif->message(fd, atcmd_output); + clif->message(fd, msg_txt(1420));// - lists colors available to select for custom channels + sprintf(atcmd_output, msg_txt(1421),command);// -- %s setcolor <channel name> <color name> + clif->message(fd, atcmd_output); + clif->message(fd, msg_txt(1422));// - changes <channel name> color to <color name> + } + sprintf(atcmd_output, msg_txt(1423),command);// -- %s leave <channel name> + clif->message(fd, atcmd_output); + clif->message(fd, msg_txt(1424));// - leaves <channel name> + sprintf(atcmd_output, msg_txt(1427),command);// -- %s bindto <channel name> + clif->message(fd, atcmd_output); + clif->message(fd, msg_txt(1428));// - binds global chat to <channel name>, making anything you type in global be sent to the channel + sprintf(atcmd_output, msg_txt(1429),command);// -- %s unbind + clif->message(fd, atcmd_output); + clif->message(fd, msg_txt(1430));// - unbinds your global chat from its attached channel (if binded) + +} +/* [Ind/Hercules] */ +ACMD_FUNC(channel) { + struct hChSysCh *channel; + char key[HCHSYS_NAME_LENGTH], sub1[HCHSYS_NAME_LENGTH], sub2[HCHSYS_NAME_LENGTH], sub3[HCHSYS_NAME_LENGTH]; + unsigned char k = 0; + sub1[0] = sub2[0] = sub3[0] = '\0'; + + if( !message || !*message || sscanf(message, "%s %s %s %s", key, sub1, sub2, sub3) < 1 ) { + atcmd_channel_help(fd,command,( hChSys.allow_user_channel_creation || pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN) )); + return 0; + } + + if( strcmpi(key,"create") == 0 && ( hChSys.allow_user_channel_creation || pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN) ) ) { + if( sub1[0] != '#' ) { + clif->message(fd, msg_txt(1405));// Channel name must start with a '#' + return -1; + } else if ( strlen(sub1) < 3 || strlen(sub1) > HCHSYS_NAME_LENGTH ) { + sprintf(atcmd_output, msg_txt(1406), HCHSYS_NAME_LENGTH);// Channel length must be between 3 and %d + clif->message(fd, atcmd_output); + return -1; + } else if ( sub3[0] != '\0' ) { + clif->message(fd, msg_txt(1408)); // Channel password may not contain spaces + return -1; + } + if( strcmpi(sub1 + 1,hChSys.local_name) == 0 || strcmpi(sub1 + 1,hChSys.ally_name) == 0 || strdb_exists(clif->channel_db, sub1 + 1) ) { + sprintf(atcmd_output, msg_txt(1407), sub1);// Channel '%s' is not available + clif->message(fd, atcmd_output); + return -1; + } + + CREATE( channel, struct hChSysCh, 1 ); + + clif->chsys_create(channel,sub1 + 1,sub2,0); + + channel->owner = sd->status.char_id; + + if( !( channel->opt & hChSys_OPT_ANNOUNCE_JOIN ) ) { + sprintf(atcmd_output, msg_txt(1403),sub1); // You're now in the '%s' channel + clif->message(fd, atcmd_output); + } + + clif->chsys_join(channel,sd); + + } else if ( strcmpi(key,"list") == 0 ) { + if( sub1[0] != '\0' && strcmpi(sub1,"colors") == 0 ) { + char mout[40]; + for( k = 0; k < hChSys.colors_count; k++ ) { + unsigned short msg_len = 1; + msg_len += sprintf(mout, "[ %s list colors ] : %s",command,hChSys.colors_name[k]); + + WFIFOHEAD(fd,msg_len + 12); + WFIFOW(fd,0) = 0x2C1; + WFIFOW(fd,2) = msg_len + 12; + WFIFOL(fd,4) = 0; + WFIFOL(fd,8) = hChSys.colors[k]; + safestrncpy((char*)WFIFOP(fd,12), mout, msg_len); + WFIFOSET(fd, msg_len + 12); + } + } else { + DBIterator *iter = db_iterator(clif->channel_db); + bool show_all = pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN) ? true : false; + clif->message(fd, msg_txt(1410)); // -- Public Channels + if( hChSys.local ) { + sprintf(atcmd_output, msg_txt(1409), hChSys.local_name, map[sd->bl.m].channel ? db_size(map[sd->bl.m].channel->users) : 0);// - #%s ( %d users ) + clif->message(fd, atcmd_output); + } + if( hChSys.ally && sd->status.guild_id ) { + struct guild *g = sd->guild; + if( !g ) return -1; + sprintf(atcmd_output, msg_txt(1409), hChSys.ally_name, db_size(((struct hChSysCh *)g->channel)->users));// - #%s ( %d users ) + clif->message(fd, atcmd_output); + } + for(channel = dbi_first(iter); dbi_exists(iter); channel = dbi_next(iter)) { + if( show_all || channel->type == hChSys_PUBLIC ) { + sprintf(atcmd_output, msg_txt(1409), channel->name, db_size(channel->users));// - #%s ( %d users ) + clif->message(fd, atcmd_output); + } + } + dbi_destroy(iter); + } + } else if ( strcmpi(key,"setcolor") == 0 ) { + + if( sub1[0] != '#' ) { + clif->message(fd, msg_txt(1405));// Channel name must start with a '#' + return -1; + } + + if( !(channel = strdb_get(clif->channel_db, sub1 + 1)) ) { + sprintf(atcmd_output, msg_txt(1407), sub1);// Channel '%s' is not available + clif->message(fd, atcmd_output); + return -1; + } + + if( channel->owner != sd->status.char_id && !pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN) ) { + sprintf(atcmd_output, msg_txt(1412), sub1);// You're not the owner of channel '%s' + clif->message(fd, atcmd_output); + return -1; + } + + for( k = 0; k < hChSys.colors_count; k++ ) { + if( strcmpi(sub2,hChSys.colors_name[k]) == 0 ) + break; + } + if( k == hChSys.colors_count ) { + sprintf(atcmd_output, msg_txt(1411), sub2);// Unknown color '%s' + clif->message(fd, atcmd_output); + return -1; + } + channel->color = k; + sprintf(atcmd_output, msg_txt(1413),sub1,hChSys.colors_name[k]);// '%s' channel color updated to '%s' + clif->message(fd, atcmd_output); + } else if ( strcmpi(key,"leave") == 0 ) { + + if( sub1[0] != '#' ) { + clif->message(fd, msg_txt(1405));// Channel name must start with a '#' + return -1; + } + + for(k = 0; k < sd->channel_count; k++) { + if( strcmpi(sub1+1,sd->channels[k]->name) == 0 ) + break; + } + if( k == sd->channel_count ) { + sprintf(atcmd_output, msg_txt(1425),sub1);// You're not part of the '%s' channel + clif->message(fd, atcmd_output); + return -1; + } + clif->chsys_left(sd->channels[k],sd); + sprintf(atcmd_output, msg_txt(1425),sub1); // You've left the '%s' channel + clif->message(fd, atcmd_output); + } else if ( strcmpi(key,"bindto") == 0 ) { + + if( sub1[0] != '#' ) { + clif->message(fd, msg_txt(1405));// Channel name must start with a '#' + return -1; + } + + for(k = 0; k < sd->channel_count; k++) { + if( strcmpi(sub1+1,sd->channels[k]->name) == 0 ) + break; + } + if( k == sd->channel_count ) { + sprintf(atcmd_output, msg_txt(1425),sub1);// You're not part of the '%s' channel + clif->message(fd, atcmd_output); + return -1; + } + + sd->gcbind = sd->channels[k]; + sprintf(atcmd_output, msg_txt(1431),sub1); // Your global chat is now binded to the '%s' channel + clif->message(fd, atcmd_output); + } else if ( strcmpi(key,"unbind") == 0 ) { + + if( sd->gcbind == NULL ) { + clif->message(fd, msg_txt(1432));// Your global chat is not binded to any channel + return -1; + } + + sprintf(atcmd_output, msg_txt(1433),sd->gcbind->name); // Your global chat is now unbinded from the '#%s' channel + clif->message(fd, atcmd_output); + + sd->gcbind = NULL; + } else { + atcmd_channel_help(fd,command,( hChSys.allow_user_channel_creation || pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN) )); + } + + return 0; +} +/* debug only, delete after */ +ACMD_FUNC(fontcolor) { + unsigned char k; + + if( !message || !*message ) { + char mout[40]; + for( k = 0; k < hChSys.colors_count; k++ ) { + unsigned short msg_len = 1; + msg_len += sprintf(mout, "[ %s ] : %s",command,hChSys.colors_name[k]); + + WFIFOHEAD(fd,msg_len + 12); + WFIFOW(fd,0) = 0x2C1; + WFIFOW(fd,2) = msg_len + 12; + WFIFOL(fd,4) = 0; + WFIFOL(fd,8) = hChSys.colors[k]; + safestrncpy((char*)WFIFOP(fd,12), mout, msg_len); + WFIFOSET(fd, msg_len + 12); + } + return -1; + } + + if( message[0] == '0' ) { + sd->fontcolor = 0; + pc_disguise(sd,0); + return 0; + } + + for( k = 0; k < hChSys.colors_count; k++ ) { + if( strcmpi(message,hChSys.colors_name[k]) == 0 ) + break; + } + if( k == hChSys.colors_count ) { + sprintf(atcmd_output, msg_txt(1411), message);// Unknown color '%s' + clif->message(fd, atcmd_output); + return -1; + } + + sd->fontcolor = k + 1; + pc_disguise(sd,sd->status.class_); + return 0; +} /** * Fills the reference of available commands in atcommand DBMap **/ @@ -9052,7 +9297,6 @@ void atcommand_basecommands(void) { ACMD_DEF(leave), ACMD_DEF(accept), ACMD_DEF(reject), - ACMD_DEF(main), ACMD_DEF(clone), ACMD_DEF2("slaveclone", clone), ACMD_DEF2("evilclone", clone), @@ -9100,7 +9344,10 @@ void atcommand_basecommands(void) { ACMD_DEF2("rmvperm", addperm), ACMD_DEF(unloadnpcfile), ACMD_DEF(cart), - ACMD_DEF(mount2) + ACMD_DEF(mount2), + ACMD_DEF(join), + ACMD_DEF(channel), + ACMD_DEF(fontcolor) }; AtCommandInfo* atcommand; int i; @@ -9206,7 +9453,7 @@ static void atcommand_get_suggestions(struct map_session_data* sd, const char *n strcat(buffer," "); } - clif->displaymessage(sd->fd, buffer); + clif->message(sd->fd, buffer); } dbi_destroy(atcommand_iter); @@ -9250,7 +9497,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message if ( type == 1) { //Commands are disabled on maps flagged as 'nocommand' if ( map[sd->bl.m].nocommand && pc_get_group_level(sd) < map[sd->bl.m].nocommand ) { - clif->displaymessage(fd, msg_txt(143)); + clif->message(fd, msg_txt(143)); return false; } } @@ -9294,7 +9541,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message } sprintf(output, msg_txt(1388), charcommand_symbol); // Charcommand failed (usage: %c<command> <char name> <parameters>). - clif->displaymessage(fd, output); + clif->message(fd, output); return true; } while(0); } @@ -9321,7 +9568,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message if (*message == charcommand_symbol && (ssd = map_nick2sd(charname)) == NULL && (ssd = map_nick2sd(charname2)) == NULL ) { sprintf(output, msg_txt(1389), command); // %s failed. Player not found. - clif->displaymessage(fd, output); + clif->message(fd, output); return true; } @@ -9345,7 +9592,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message if (info == NULL) { if( pc_get_group_level(sd) ) { // TODO: remove or replace with proper permission sprintf(output, msg_txt(153), command); // "%s is Unknown Command." - clif->displaymessage(fd, output); + clif->message(fd, output); atcommand_get_suggestions(sd, command + 1, *message == atcommand_symbol); return true; } else @@ -9359,7 +9606,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message return false; } if( pc_isdead(sd) && pc_has_permission(sd,PC_PERM_DISABLE_CMD_DEAD) ) { - clif->displaymessage(fd, msg_txt(1393)); // You can't use commands while dead + clif->message(fd, msg_txt(1393)); // You can't use commands while dead return true; } } @@ -9368,7 +9615,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message if (*message == charcommand_symbol && (ssd = map_nick2sd(charname)) == NULL && (ssd = map_nick2sd(charname2)) == NULL ) { sprintf(output, msg_txt(1389), command); // %s failed. Player not found. - clif->displaymessage(fd, output); + clif->message(fd, output); return true; } @@ -9376,7 +9623,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message if ( (info->func(fd, (*atcmd_msg == atcommand_symbol) ? sd : ssd, command, params) != 0) ) { sprintf(output,msg_txt(154), command); // %s failed. - clif->displaymessage(fd, output); + clif->message(fd, output); return true; } |