From b7b3080c9edec4c2f7d34b4d77b08646d46100eb Mon Sep 17 00:00:00 2001 From: Dastgir Date: Thu, 26 Jul 2018 12:26:44 +0530 Subject: Moved hardcoded messages from source to messages.conf Fixes #1282 --- src/map/battleground.c | 22 +++++++++++----------- src/map/channel.c | 4 ++-- src/map/clif.c | 8 ++++---- src/map/homunculus.c | 2 +- src/map/irc-bot.c | 8 ++++---- src/map/mob.c | 4 ++-- src/map/pc.c | 10 +++++----- src/map/skill.c | 6 +++--- 8 files changed, 32 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/map/battleground.c b/src/map/battleground.c index c2772a2b9..e0d2e8003 100644 --- a/src/map/battleground.c +++ b/src/map/battleground.c @@ -169,13 +169,13 @@ static int bg_team_leave(struct map_session_data *sd, enum bg_team_leave_type fl switch (flag) { default: case BGTL_QUIT: - sprintf(output, "Server : %s has quit the game...", sd->status.name); + sprintf(output, msg_txt(464), sd->status.name); // Server : %s has quit the game... break; case BGTL_LEFT: - sprintf(output, "Server : %s is leaving the battlefield...", sd->status.name); + sprintf(output, msg_txt(454), sd->status.name); // Server : %s is leaving the battlefield... break; case BGTL_AFK: - sprintf(output, "Server : %s has been afk-kicked from the battlefield...", sd->status.name); + sprintf(output, msg_txt(455), sd->status.name); // Server : %s has been afk-kicked from the battlefield... break; } clif->bg_message(bgd, 0, "Server", output); @@ -860,9 +860,9 @@ static enum BATTLEGROUNDS_QUEUE_ACK bg_canqueue(struct map_session_data *sd, str if ( ( tick = pc_readglobalreg(sd, script->add_variable(bg->gdelay_var)) ) && tsec < tick ) { char response[100]; if( (tick-tsec) > 60 ) - sprintf(response, "You are a deserter! Wait %u minute(s) before you can apply again", (tick - tsec) / 60); + sprintf(response, msg_sd(sd, 456), (tick - tsec) / 60); // You are a deserter! Wait %u minute(s) before you can apply again else - sprintf(response, "You are a deserter! Wait %u seconds before you can apply again", (tick - tsec)); + sprintf(response, msg_sd(sd, 457), (tick - tsec)); // You are a deserter! Wait %u seconds before you can apply again clif->messagecolor_self(sd->fd, COLOR_RED, response); return BGQA_FAIL_DESERTER; } @@ -870,9 +870,9 @@ static enum BATTLEGROUNDS_QUEUE_ACK bg_canqueue(struct map_session_data *sd, str if ( ( tick = pc_readglobalreg(sd, script->add_variable(arena->delay_var)) ) && tsec < tick ) { char response[100]; if( (tick-tsec) > 60 ) - sprintf(response, "You can't reapply to this arena so fast. Apply to the different arena or wait %u minute(s)", (tick - tsec) / 60); + sprintf(response, msg_sd(sd, 458), (tick - tsec) / 60); // You can't reapply to this arena so fast. Apply to the different arena or wait %u minute(s) else - sprintf(response, "You can't reapply to this arena so fast. Apply to the different arena or wait %u seconds", (tick - tsec)); + sprintf(response, msg_sd(sd, 459), (tick - tsec)); // You can't reapply to this arena so fast. Apply to the different arena or wait %u seconds clif->messagecolor_self(sd->fd, COLOR_RED, response); return BGQA_FAIL_COOLDOWN; } @@ -894,9 +894,9 @@ static enum BATTLEGROUNDS_QUEUE_ACK bg_canqueue(struct map_session_data *sd, str if ( count < arena->min_team_players ) { char response[121]; if( count != sd->guild->connect_member && sd->guild->connect_member >= arena->min_team_players ) - sprintf(response, "Can't apply: not enough members in your team/guild that have not entered the queue in individual mode, minimum is %d", arena->min_team_players); + sprintf(response, msg_sd(sd, 460), arena->min_team_players); // Can't apply: not enough members in your team/guild that have not entered the queue in individual mode, minimum is %d else - sprintf(response, "Can't apply: not enough members in your team/guild, minimum is %d", arena->min_team_players); + sprintf(response, msg_sd(sd, 461), arena->min_team_players); // Can't apply: not enough members in your team/guild, minimum is %d clif->messagecolor_self(sd->fd, COLOR_RED, response); return BGQA_FAIL_TEAM_COUNT; } @@ -926,9 +926,9 @@ static enum BATTLEGROUNDS_QUEUE_ACK bg_canqueue(struct map_session_data *sd, str if( count < arena->min_team_players ) { char response[121]; if( count != p->party.count && p->party.count >= arena->min_team_players ) - sprintf(response, "Can't apply: not enough members in your team/party that have not entered the queue in individual mode, minimum is %d", arena->min_team_players); + sprintf(response, msg_sd(sd, 462), arena->min_team_players); // Can't apply: not enough members in your team/party that have not entered the queue in individual mode, minimum is %d else - sprintf(response, "Can't apply: not enough members in your team/party, minimum is %d",arena->min_team_players); + sprintf(response, msg_sd(sd, 463), arena->min_team_players); // Can't apply: not enough members in your team/party, minimum is %d clif->messagecolor_self(sd->fd, COLOR_RED, response); return BGQA_FAIL_TEAM_COUNT; } diff --git a/src/map/channel.c b/src/map/channel.c index e27e9fb0b..c87e425eb 100644 --- a/src/map/channel.c +++ b/src/map/channel.c @@ -324,7 +324,7 @@ static void channel_join_sub(struct channel_data *chan, struct map_session_data if (!stealth && (chan->options&HCS_OPT_ANNOUNCE_JOIN)) { char message[60]; - sprintf(message, "#%s '%s' joined",chan->name,sd->status.name); + sprintf(message, msg_txt(897), chan->name, sd->status.name); // #%s '%s' joined clif->channel_msg(chan,sd,message); } @@ -442,7 +442,7 @@ static void channel_leave(struct channel_data *chan, struct map_session_data *sd channel->delete(chan); } else if (!channel->config->closing && (chan->options & HCS_OPT_ANNOUNCE_JOIN)) { char message[60]; - sprintf(message, "#%s '%s' left",chan->name,sd->status.name); + sprintf(message, msg_txt(898), chan->name, sd->status.name); // #%s '%s' left clif->channel_msg(chan,sd,message); } diff --git a/src/map/clif.c b/src/map/clif.c index f6caa502e..5c6bc39d3 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10769,7 +10769,7 @@ static void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) if( map->list[sd->bl.m].flag.allowks && !map_flag_ks(sd->bl.m) ) { char output[128]; - sprintf(output, "[ Kill Steal Protection Disabled. KS is allowed in this map ]"); + sprintf(output, "%s", msg_sd(sd, 893)); // [ Kill Steal Protection Disabled. KS is allowed in this map ] clif->broadcast(&sd->bl, output, (int)strlen(output) + 1, BC_BLUE, SELF); } @@ -11664,7 +11664,7 @@ static void clif_parse_WisMessage(int fd, struct map_session_data *sd) // if player is autotrading if (dstsd->state.autotrade) { char output[256]; - sprintf(output, "%s is in autotrade mode and cannot receive whispered messages.", dstsd->status.name); + sprintf(output, msg_fd(fd, 894), dstsd->status.name); // %s is in autotrade mode and cannot receive whispered messages. clif->wis_message(fd, map->wisp_server_name, output, (int)strlen(output)); return; } @@ -16683,7 +16683,7 @@ static void clif_Mail_refreshinbox(struct map_session_data *sd) if( md->full ) {// TODO: is this official? char output[100]; - sprintf(output, "Inbox is full (Max %d). Delete some mails.", MAIL_MAX_INBOX); + sprintf(output, msg_sd(sd, 511), MAIL_MAX_INBOX); // Inbox is full (Max %d). Delete some mails. clif_disp_onlyself(sd, output); } } @@ -20599,7 +20599,7 @@ static void clif_show_modifiers(struct map_session_data *sd) if( sd->status.mod_exp != 100 || sd->status.mod_drop != 100 || sd->status.mod_death != 100 ) { char output[128]; - snprintf(output,128,"Base EXP : %d%% | Base Drop: %d%% | Base Death Penalty: %d%%", + snprintf(output,128, msg_sd(sd, 896), // Base EXP : %d%% | Base Drop: %d%% | Base Death Penalty: %d%% sd->status.mod_exp,sd->status.mod_drop,sd->status.mod_death); clif->broadcast2(&sd->bl, output, (int)strlen(output) + 1, 0xffbc90, 0x190, 12, 0, 0, SELF); } diff --git a/src/map/homunculus.c b/src/map/homunculus.c index 43cb8d84b..fbb94334c 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -401,7 +401,7 @@ static bool homunculus_levelup(struct homun_data *hd) if ( battle_config.homunculus_show_growth ) { char output[256] ; sprintf(output, - "Growth: hp:%d sp:%d str(%.2f) agi(%.2f) vit(%.2f) int(%.2f) dex(%.2f) luk(%.2f) ", + msg_sd(hd->master, 892), // Growth: hp:%d sp:%d str(%.2f) agi(%.2f) vit(%.2f) int(%.2f) dex(%.2f) luk(%.2f) growth_max_hp, growth_max_sp, growth_str/10.0, growth_agi/10.0, growth_vit/10.0, growth_int/10.0, growth_dex/10.0, growth_luk/10.0); diff --git a/src/map/irc-bot.c b/src/map/irc-bot.c index 996107fea..a0c7276a9 100644 --- a/src/map/irc-bot.c +++ b/src/map/irc-bot.c @@ -396,7 +396,7 @@ static void irc_userjoin(int fd, char *cmd, char *source, char *target, char *ms ircbot->parse_source(source,source_nick,source_ident,source_host); if( ircbot->channel ) { - snprintf(send_string, 150, "[ #%s ] User IRC.%s joined the channel.",ircbot->channel->name,source_nick); + snprintf(send_string, 150, msg_txt(468), ircbot->channel->name, source_nick); // [ #%s ] User IRC.%s joined the channel. clif->channel_msg2(ircbot->channel,send_string); } } @@ -414,9 +414,9 @@ static void irc_userleave(int fd, char *cmd, char *source, char *target, char *m if( ircbot->channel ) { if (!strcmpi(cmd, "QUIT")) - snprintf(send_string, 150, "[ #%s ] User IRC.%s left the channel. [Quit: %s]",ircbot->channel->name,source_nick,msg); + snprintf(send_string, 150, msg_txt(465), ircbot->channel->name, source_nick, msg); // [ #%s ] User IRC.%s left the channel. [Quit: %s] else - snprintf(send_string, 150, "[ #%s ] User IRC.%s left the channel. [%s]",ircbot->channel->name,source_nick,msg); + snprintf(send_string, 150, msg_txt(466), ircbot->channel->name, source_nick, msg); // [ #%s ] User IRC.%s left the channel. [%s] clif->channel_msg2(ircbot->channel,send_string); } } @@ -433,7 +433,7 @@ static void irc_usernick(int fd, char *cmd, char *source, char *target, char *ms ircbot->parse_source(source,source_nick,source_ident,source_host); if( ircbot->channel ) { - snprintf(send_string, 150, "[ #%s ] User IRC.%s is now known as IRC.%s",ircbot->channel->name,source_nick,msg); + snprintf(send_string, 150, msg_txt(467), ircbot->channel->name, source_nick, msg); // [ #%s ] User IRC.%s is now known as IRC.%s clif->channel_msg2(ircbot->channel,send_string); } } diff --git a/src/map/mob.c b/src/map/mob.c index e04d6944e..215f82f5f 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -479,7 +479,7 @@ static bool mob_ksprotected(struct block_list *src, struct block_list *target) // Message to KS if( DIFF_TICK(sd->ks_floodprotect_tick, tick) <= 0 ) { - sprintf(output, "[KS Warning!! - Owner : %s]", pl_sd->status.name); + sprintf(output, msg_sd(sd, 890), pl_sd->status.name); // [KS Warning!! - Owner : %s] clif_disp_onlyself(sd, output); sd->ks_floodprotect_tick = tick + 2000; @@ -488,7 +488,7 @@ static bool mob_ksprotected(struct block_list *src, struct block_list *target) // Message to Owner if( DIFF_TICK(pl_sd->ks_floodprotect_tick, tick) <= 0 ) { - sprintf(output, "[Watch out! %s is trying to KS you!]", sd->status.name); + sprintf(output, msg_sd(pl_sd, 891), sd->status.name); // [Watch out! %s is trying to KS you!] clif_disp_onlyself(pl_sd, output); pl_sd->ks_floodprotect_tick = tick + 2000; diff --git a/src/map/pc.c b/src/map/pc.c index 2cefa7674..5eccfbaf6 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4441,7 +4441,7 @@ static int pc_payzeny(struct map_session_data *sd, int zeny, enum e_log_pick_typ if (sd->state.showzeny) { char output[255]; - sprintf(output, "Removed %dz.", zeny); + sprintf(output, msg_sd(sd, 885), zeny); // Removed %dz. clif_disp_onlyself(sd, output); } } @@ -4580,7 +4580,7 @@ static int pc_getzeny(struct map_session_data *sd, int zeny, enum e_log_pick_typ if (sd->state.showzeny) { char output[255]; - sprintf(output, "Gained %dz.", zeny); + sprintf(output, msg_sd(sd, 886), zeny); // Gained %dz. clif_disp_onlyself(sd, output); } } @@ -5535,9 +5535,9 @@ static int pc_show_steal(struct block_list *bl, va_list ap) nullpo_ret(sd); if((item=itemdb->exists(itemid))==NULL) - sprintf(output,"%s stole an Unknown Item (id: %i).",sd->status.name, itemid); + sprintf(output, msg_sd(sd, 887), sd->status.name, itemid); // %s stole an Unknown Item (id: %i). else - sprintf(output,"%s stole %s.",sd->status.name,item->jname); + sprintf(output, msg_sd(sd, 888), sd->status.name, item->jname); // %s stole %s. clif->message(tsd->fd, output); return 0; @@ -7084,7 +7084,7 @@ static bool pc_gainexp(struct map_session_data *sd, struct block_list *src, uint if(sd->state.showexp) { char output[256]; sprintf(output, - "Experience Gained Base:%"PRIu64" (%.2f%%) Job:%"PRIu64" (%.2f%%)", + msg_sd(sd, 889), // Experience Gained Base:%"PRIu64" (%.2f%%) Job:%"PRIu64" (%.2f%%) base_exp, nextbp * (float)100, job_exp, nextjp * (float)100); clif_disp_onlyself(sd, output); } diff --git a/src/map/skill.c b/src/map/skill.c index ad27ef0e3..60d5a397d 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -7205,7 +7205,7 @@ static int skill_castend_nodamage_id(struct block_list *src, struct block_list * // custom hack to make the mob display the skill, because these skills don't show the skill use text themselves //NOTE: mobs don't have the sprite animation that is used when performing this skill (will cause glitches) char temp[70]; - snprintf(temp, sizeof(temp), "%s : %s !!", md->name, skill->get_desc(skill_id)); + snprintf(temp, sizeof(temp), msg_txt(882), md->name, skill->get_desc(skill_id)); // %s : %s !! clif->disp_overhead(&md->bl, temp, AREA_CHAT_WOC, NULL); } break; @@ -14669,7 +14669,7 @@ static int skill_check_condition_castbegin(struct map_session_data *sd, uint16 s if (map->foreachinrange(mob->count_sub, &sd->bl, skill->get_splash(skill_id, skill_lv), BL_MOB, MOBID_EMPELIUM, MOBID_S_EMPEL_1, MOBID_S_EMPEL_2)) { char output[128]; - sprintf(output, "You're too close to a stone or emperium to do this skill"); /* TODO official response? or message.conf it */ + sprintf(output, "%s", msg_txt(883)); /* TODO official response */ // You are too close to a stone or emperium to do this skill clif->messagecolor_self(sd->fd, COLOR_RED, output); return 0; } @@ -15116,7 +15116,7 @@ static int skill_check_condition_castend(struct map_session_data *sd, uint16 ski return 0; } else if( sd->status.inventory[i].amount < require.ammo_qty ) { char e_msg[100]; - sprintf(e_msg,"Skill Failed. [%s] requires %dx %s.", + sprintf(e_msg, msg_txt(884), // Skill Failed. [%s] requires %dx %s. skill->get_desc(skill_id), require.ammo_qty, itemdb_jname(sd->status.inventory[i].nameid)); -- cgit v1.2.3-70-g09d2