Skip to content

Commit 0a84f31

Browse files
committed
Moved hardcoded messages from source to messages.conf
Fixes #1282
1 parent 852c133 commit 0a84f31

File tree

9 files changed

+75
-35
lines changed

9 files changed

+75
-35
lines changed

conf/messages.conf

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,25 @@
448448

449449
// Return pet to egg message
450450
451: You can't return your pet because your inventory is full.
451-
//452-497 FREE
451+
452+
// Battlegrounds
453+
452: Server : %s has quit the game...
454+
453: Server : %s is leaving the battlefield...
455+
454: Server : %s has been afk-kicked from the battlefield...
456+
455: You are a deserter! Wait %u minute(s) before you can apply again
457+
456: You are a deserter! Wait %u seconds before you can apply again
458+
457: You can't reapply to this arena so fast. Apply to the different arena or wait %u minute(s)
459+
458: You can't reapply to this arena so fast. Apply to the different arena or wait %u seconds
460+
459: Can't apply: not enough members in your team/guild that have not entered the queue in individual mode, minimum is %d
461+
460: Can't apply: not enough members in your team/guild, minimum is %d
462+
461: Can't apply: not enough members in your team/party that have not entered the queue in individual mode, minimum is %d
463+
462: Can't apply: not enough members in your team/party, minimum is %d
464+
// IRC
465+
463: [ #%s ] User IRC.%s joined the channel.
466+
464: [ #%s ] User IRC.%s left the channel. [Quit: %s]
467+
465: [ #%s ] User IRC.%s left the channel. [%s]
468+
466: [ #%s ] User IRC.%s is now known as IRC.%s
469+
// 467-497 FREE
452470

453471
// Messages of others (not for GM commands)
454472
// ----------------------------------------
@@ -476,7 +494,8 @@
476494
// mail system
477495
//----------------------
478496
510: You have %d new emails (%d unread)
479-
//511-537 FREE
497+
511: Inbox is full (Max %d). Delete some mails.
498+
// 512-537 FREE
480499

481500
// Trade Spoof Messages
482501
538: Hack on trade: character '%s' (account: %d) try to trade more items that he has.
@@ -659,7 +678,28 @@
659678
879: You have become the Guild Master!
660679
880: You have been recovered!
661680
881: Shop is out of stock! Come again later!
662-
//882-899 FREE
681+
682+
// Frost Joker / Scream text for monster (MobName : SkillName !!)
683+
882: %s : %s !!
684+
// Cursed Circle
685+
883: You are too close to a stone or emperium to do this skill
686+
//
687+
884: Skill Failed. [%s] requires %dx %s.
688+
885: Removed %dz.
689+
886: Gained %dz.
690+
887: %s stole an Unknown Item (id: %i).
691+
888: %s stole %s.
692+
889: Experience Gained Base:%"PRIu64" (%.2f%%) Job:%"PRIu64" (%.2f%%)
693+
890: [KS Warning!! - Owner : %s]
694+
891: [Watch out! %s is trying to KS you!]
695+
892: Growth: hp:%d sp:%d str(%.2f) agi(%.2f) vit(%.2f) int(%.2f) dex(%.2f) luk(%.2f)
696+
893: [ Kill Steal Protection Disabled. KS is allowed in this map ]
697+
894: %s is in autotrade mode and cannot receive whispered messages.
698+
// 895 FREE
699+
896: Base EXP : %d%% | Base Drop: %d%% | Base Death Penalty: %d%%
700+
897: #%s '%s' joined
701+
898: #%s '%s' left
702+
// 899 FREE
663703

664704
//------------------------------------
665705
// More atcommands message

src/map/battleground.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,13 @@ static int bg_team_leave(struct map_session_data *sd, enum bg_team_leave_type fl
169169
switch (flag) {
170170
default:
171171
case BGTL_QUIT:
172-
sprintf(output, "Server : %s has quit the game...", sd->status.name);
172+
sprintf(output, msg_txt(452), sd->status.name); // Server : %s has quit the game...
173173
break;
174174
case BGTL_LEFT:
175-
sprintf(output, "Server : %s is leaving the battlefield...", sd->status.name);
175+
sprintf(output, msg_txt(453), sd->status.name); // Server : %s is leaving the battlefield...
176176
break;
177177
case BGTL_AFK:
178-
sprintf(output, "Server : %s has been afk-kicked from the battlefield...", sd->status.name);
178+
sprintf(output, msg_txt(454), sd->status.name); // Server : %s has been afk-kicked from the battlefield...
179179
break;
180180
}
181181
clif->bg_message(bgd, 0, "Server", output);
@@ -860,19 +860,19 @@ static enum BATTLEGROUNDS_QUEUE_ACK bg_canqueue(struct map_session_data *sd, str
860860
if ( ( tick = pc_readglobalreg(sd, script->add_variable(bg->gdelay_var)) ) && tsec < tick ) {
861861
char response[100];
862862
if( (tick-tsec) > 60 )
863-
sprintf(response, "You are a deserter! Wait %u minute(s) before you can apply again", (tick - tsec) / 60);
863+
sprintf(response, msg_sd(sd, 455), (tick - tsec) / 60); // You are a deserter! Wait %u minute(s) before you can apply again
864864
else
865-
sprintf(response, "You are a deserter! Wait %u seconds before you can apply again", (tick - tsec));
865+
sprintf(response, msg_sd(sd, 456), (tick - tsec)); // You are a deserter! Wait %u seconds before you can apply again
866866
clif->messagecolor_self(sd->fd, COLOR_RED, response);
867867
return BGQA_FAIL_DESERTER;
868868
}
869869

870870
if ( ( tick = pc_readglobalreg(sd, script->add_variable(arena->delay_var)) ) && tsec < tick ) {
871871
char response[100];
872872
if( (tick-tsec) > 60 )
873-
sprintf(response, "You can't reapply to this arena so fast. Apply to the different arena or wait %u minute(s)", (tick - tsec) / 60);
873+
sprintf(response, msg_sd(sd, 457), (tick - tsec) / 60); // You can't reapply to this arena so fast. Apply to the different arena or wait %u minute(s)
874874
else
875-
sprintf(response, "You can't reapply to this arena so fast. Apply to the different arena or wait %u seconds", (tick - tsec));
875+
sprintf(response, msg_sd(sd, 458), (tick - tsec)); // You can't reapply to this arena so fast. Apply to the different arena or wait %u seconds
876876
clif->messagecolor_self(sd->fd, COLOR_RED, response);
877877
return BGQA_FAIL_COOLDOWN;
878878
}
@@ -894,9 +894,9 @@ static enum BATTLEGROUNDS_QUEUE_ACK bg_canqueue(struct map_session_data *sd, str
894894
if ( count < arena->min_team_players ) {
895895
char response[121];
896896
if( count != sd->guild->connect_member && sd->guild->connect_member >= arena->min_team_players )
897-
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);
897+
sprintf(response, msg_sd(sd, 459), 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
898898
else
899-
sprintf(response, "Can't apply: not enough members in your team/guild, minimum is %d", arena->min_team_players);
899+
sprintf(response, msg_sd(sd, 460), arena->min_team_players); // Can't apply: not enough members in your team/guild, minimum is %d
900900
clif->messagecolor_self(sd->fd, COLOR_RED, response);
901901
return BGQA_FAIL_TEAM_COUNT;
902902
}
@@ -926,9 +926,9 @@ static enum BATTLEGROUNDS_QUEUE_ACK bg_canqueue(struct map_session_data *sd, str
926926
if( count < arena->min_team_players ) {
927927
char response[121];
928928
if( count != p->party.count && p->party.count >= arena->min_team_players )
929-
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);
929+
sprintf(response, msg_sd(sd, 461), 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
930930
else
931-
sprintf(response, "Can't apply: not enough members in your team/party, minimum is %d",arena->min_team_players);
931+
sprintf(response, msg_sd(sd, 462), arena->min_team_players); // Can't apply: not enough members in your team/party, minimum is %d
932932
clif->messagecolor_self(sd->fd, COLOR_RED, response);
933933
return BGQA_FAIL_TEAM_COUNT;
934934
}

src/map/channel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ static void channel_join_sub(struct channel_data *chan, struct map_session_data
322322

323323
if (!stealth && (chan->options&HCS_OPT_ANNOUNCE_JOIN)) {
324324
char message[60];
325-
sprintf(message, "#%s '%s' joined",chan->name,sd->status.name);
325+
sprintf(message, msg_txt(897), chan->name, sd->status.name); // #%s '%s' joined
326326
clif->channel_msg(chan,sd,message);
327327
}
328328

@@ -456,7 +456,7 @@ static void channel_leave(struct channel_data *chan, struct map_session_data *sd
456456
channel->delete(chan);
457457
} else if (!channel->config->closing && (chan->options & HCS_OPT_ANNOUNCE_JOIN)) {
458458
char message[60];
459-
sprintf(message, "#%s '%s' left",chan->name,sd->status.name);
459+
sprintf(message, msg_txt(898), chan->name, sd->status.name); // #%s '%s' left
460460
clif->channel_msg(chan,sd,message);
461461
}
462462

src/map/clif.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10233,7 +10233,7 @@ static void clif_parse_LoadEndAck(int fd, struct map_session_data *sd)
1023310233

1023410234
if( map->list[sd->bl.m].flag.allowks && !map_flag_ks(sd->bl.m) ) {
1023510235
char output[128];
10236-
sprintf(output, "[ Kill Steal Protection Disabled. KS is allowed in this map ]");
10236+
sprintf(output, "%s", msg_sd(sd, 893)); // [ Kill Steal Protection Disabled. KS is allowed in this map ]
1023710237
clif->broadcast(&sd->bl, output, (int)strlen(output) + 1, BC_BLUE, SELF);
1023810238
}
1023910239

@@ -11079,7 +11079,7 @@ static void clif_parse_WisMessage(int fd, struct map_session_data *sd)
1107911079
// if player is autotrading
1108011080
if (dstsd->state.autotrade) {
1108111081
char output[256];
11082-
sprintf(output, "%s is in autotrade mode and cannot receive whispered messages.", dstsd->status.name);
11082+
sprintf(output, msg_fd(fd, 894), dstsd->status.name); // %s is in autotrade mode and cannot receive whispered messages.
1108311083
clif->wis_message(fd, map->wisp_server_name, output, (int)strlen(output));
1108411084
return;
1108511085
}
@@ -15751,7 +15751,7 @@ static void clif_Mail_refreshinbox(struct map_session_data *sd)
1575115751

1575215752
if( md->full ) {// TODO: is this official?
1575315753
char output[100];
15754-
sprintf(output, "Inbox is full (Max %d). Delete some mails.", MAIL_MAX_INBOX);
15754+
sprintf(output, msg_sd(sd, 511), MAIL_MAX_INBOX); // Inbox is full (Max %d). Delete some mails.
1575515755
clif_disp_onlyself(sd, output);
1575615756
}
1575715757
}
@@ -19487,7 +19487,7 @@ static void clif_show_modifiers(struct map_session_data *sd)
1948719487
if( sd->status.mod_exp != 100 || sd->status.mod_drop != 100 || sd->status.mod_death != 100 ) {
1948819488
char output[128];
1948919489

19490-
snprintf(output,128,"Base EXP : %d%% | Base Drop: %d%% | Base Death Penalty: %d%%",
19490+
snprintf(output,128, msg_sd(sd, 896), // Base EXP : %d%% | Base Drop: %d%% | Base Death Penalty: %d%%
1949119491
sd->status.mod_exp,sd->status.mod_drop,sd->status.mod_death);
1949219492
clif->broadcast2(&sd->bl, output, (int)strlen(output) + 1, 0xffbc90, 0x190, 12, 0, 0, SELF);
1949319493
}

src/map/homunculus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ static bool homunculus_levelup(struct homun_data *hd)
401401
if ( battle_config.homunculus_show_growth ) {
402402
char output[256] ;
403403
sprintf(output,
404-
"Growth: hp:%d sp:%d str(%.2f) agi(%.2f) vit(%.2f) int(%.2f) dex(%.2f) luk(%.2f) ",
404+
msg_sd(hd->master, 892), // Growth: hp:%d sp:%d str(%.2f) agi(%.2f) vit(%.2f) int(%.2f) dex(%.2f) luk(%.2f)
405405
growth_max_hp, growth_max_sp,
406406
growth_str/10.0, growth_agi/10.0, growth_vit/10.0,
407407
growth_int/10.0, growth_dex/10.0, growth_luk/10.0);

src/map/irc-bot.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ static void irc_userjoin(int fd, char *cmd, char *source, char *target, char *ms
395395
ircbot->parse_source(source,source_nick,source_ident,source_host);
396396

397397
if( ircbot->channel ) {
398-
snprintf(send_string, 150, "[ #%s ] User IRC.%s joined the channel.",ircbot->channel->name,source_nick);
398+
snprintf(send_string, 150, msg_txt(463), ircbot->channel->name, source_nick); // [ #%s ] User IRC.%s joined the channel.
399399
clif->channel_msg2(ircbot->channel,send_string);
400400
}
401401
}
@@ -413,9 +413,9 @@ static void irc_userleave(int fd, char *cmd, char *source, char *target, char *m
413413

414414
if( ircbot->channel ) {
415415
if (!strcmpi(cmd, "QUIT"))
416-
snprintf(send_string, 150, "[ #%s ] User IRC.%s left the channel. [Quit: %s]",ircbot->channel->name,source_nick,msg);
416+
snprintf(send_string, 150, msg_txt(464), ircbot->channel->name, source_nick, msg); // [ #%s ] User IRC.%s left the channel. [Quit: %s]
417417
else
418-
snprintf(send_string, 150, "[ #%s ] User IRC.%s left the channel. [%s]",ircbot->channel->name,source_nick,msg);
418+
snprintf(send_string, 150, msg_txt(465), ircbot->channel->name, source_nick, msg); // [ #%s ] User IRC.%s left the channel. [%s]
419419
clif->channel_msg2(ircbot->channel,send_string);
420420
}
421421
}
@@ -432,7 +432,7 @@ static void irc_usernick(int fd, char *cmd, char *source, char *target, char *ms
432432
ircbot->parse_source(source,source_nick,source_ident,source_host);
433433

434434
if( ircbot->channel ) {
435-
snprintf(send_string, 150, "[ #%s ] User IRC.%s is now known as IRC.%s",ircbot->channel->name,source_nick,msg);
435+
snprintf(send_string, 150, msg_txt(466), ircbot->channel->name, source_nick, msg); // [ #%s ] User IRC.%s is now known as IRC.%s
436436
clif->channel_msg2(ircbot->channel,send_string);
437437
}
438438
}

src/map/mob.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ static bool mob_ksprotected(struct block_list *src, struct block_list *target)
471471
// Message to KS
472472
if( DIFF_TICK(sd->ks_floodprotect_tick, tick) <= 0 )
473473
{
474-
sprintf(output, "[KS Warning!! - Owner : %s]", pl_sd->status.name);
474+
sprintf(output, msg_sd(sd, 890), pl_sd->status.name); // [KS Warning!! - Owner : %s]
475475
clif_disp_onlyself(sd, output);
476476

477477
sd->ks_floodprotect_tick = tick + 2000;
@@ -480,7 +480,7 @@ static bool mob_ksprotected(struct block_list *src, struct block_list *target)
480480
// Message to Owner
481481
if( DIFF_TICK(pl_sd->ks_floodprotect_tick, tick) <= 0 )
482482
{
483-
sprintf(output, "[Watch out! %s is trying to KS you!]", sd->status.name);
483+
sprintf(output, msg_sd(pl_sd, 891), sd->status.name); // [Watch out! %s is trying to KS you!]
484484
clif_disp_onlyself(pl_sd, output);
485485

486486
pl_sd->ks_floodprotect_tick = tick + 2000;

src/map/pc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4512,7 +4512,7 @@ static int pc_payzeny(struct map_session_data *sd, int zeny, enum e_log_pick_typ
45124512
logs->zeny(sd, type, tsd, -zeny);
45134513
if( zeny > 0 && sd->state.showzeny ) {
45144514
char output[255];
4515-
sprintf(output, "Removed %dz.", zeny);
4515+
sprintf(output, msg_sd(sd, 885), zeny); // Removed %dz.
45164516
clif_disp_onlyself(sd, output);
45174517
}
45184518

@@ -4650,7 +4650,7 @@ static int pc_getzeny(struct map_session_data *sd, int zeny, enum e_log_pick_typ
46504650
logs->zeny(sd, type, tsd, zeny);
46514651
if( zeny > 0 && sd->state.showzeny ) {
46524652
char output[255];
4653-
sprintf(output, "Gained %dz.", zeny);
4653+
sprintf(output, msg_sd(sd, 886), zeny); // Gained %dz.
46544654
clif_disp_onlyself(sd, output);
46554655
}
46564656

@@ -5582,9 +5582,9 @@ static int pc_show_steal(struct block_list *bl, va_list ap)
55825582
nullpo_ret(sd);
55835583

55845584
if((item=itemdb->exists(itemid))==NULL)
5585-
sprintf(output,"%s stole an Unknown Item (id: %i).",sd->status.name, itemid);
5585+
sprintf(output, msg_sd(sd, 887), sd->status.name, itemid); // %s stole an Unknown Item (id: %i).
55865586
else
5587-
sprintf(output,"%s stole %s.",sd->status.name,item->jname);
5587+
sprintf(output, msg_sd(sd, 888), sd->status.name, item->jname); // %s stole %s.
55885588
clif->message(tsd->fd, output);
55895589

55905590
return 0;
@@ -7128,7 +7128,7 @@ static bool pc_gainexp(struct map_session_data *sd, struct block_list *src, uint
71287128
if(sd->state.showexp) {
71297129
char output[256];
71307130
sprintf(output,
7131-
"Experience Gained Base:%"PRIu64" (%.2f%%) Job:%"PRIu64" (%.2f%%)",
7131+
msg_sd(sd, 889), // Experience Gained Base:%"PRIu64" (%.2f%%) Job:%"PRIu64" (%.2f%%)
71327132
base_exp, nextbp * (float)100, job_exp, nextjp * (float)100);
71337133
clif_disp_onlyself(sd, output);
71347134
}

src/map/skill.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7190,7 +7190,7 @@ static int skill_castend_nodamage_id(struct block_list *src, struct block_list *
71907190
// custom hack to make the mob display the skill, because these skills don't show the skill use text themselves
71917191
//NOTE: mobs don't have the sprite animation that is used when performing this skill (will cause glitches)
71927192
char temp[70];
7193-
snprintf(temp, sizeof(temp), "%s : %s !!", md->name, skill->get_desc(skill_id));
7193+
snprintf(temp, sizeof(temp), msg_txt(882), md->name, skill->get_desc(skill_id)); // %s : %s !!
71947194
clif->disp_overhead(&md->bl, temp, AREA_CHAT_WOC, NULL);
71957195
}
71967196
break;
@@ -14646,7 +14646,7 @@ static int skill_check_condition_castbegin(struct map_session_data *sd, uint16 s
1464614646
if (map->foreachinrange(mob->count_sub, &sd->bl, skill->get_splash(skill_id, skill_lv), BL_MOB,
1464714647
MOBID_EMPELIUM, MOBID_S_EMPEL_1, MOBID_S_EMPEL_2)) {
1464814648
char output[128];
14649-
sprintf(output, "You're too close to a stone or emperium to do this skill"); /* TODO official response? or message.conf it */
14649+
sprintf(output, "%s", msg_txt(883)); /* TODO official response */ // You are too close to a stone or emperium to do this skill
1465014650
clif->messagecolor_self(sd->fd, COLOR_RED, output);
1465114651
return 0;
1465214652
}
@@ -15093,7 +15093,7 @@ static int skill_check_condition_castend(struct map_session_data *sd, uint16 ski
1509315093
return 0;
1509415094
} else if( sd->status.inventory[i].amount < require.ammo_qty ) {
1509515095
char e_msg[100];
15096-
sprintf(e_msg,"Skill Failed. [%s] requires %dx %s.",
15096+
sprintf(e_msg, msg_txt(884), // Skill Failed. [%s] requires %dx %s.
1509715097
skill->get_desc(skill_id),
1509815098
require.ammo_qty,
1509915099
itemdb_jname(sd->status.inventory[i].nameid));

0 commit comments

Comments
 (0)