Index: conf/msg_conf/map_msg.conf
===================================================================
--- conf/msg_conf/map_msg.conf (revision 17251)
+++ conf/msg_conf/map_msg.conf (working copy)
@@ -448,6 +448,7 @@
461: Langtype is now = %s=>%d
462: The choosen langage is currently disable please choose another
463: Msg_conf have been reloaded
+464: Available langages:
// Messages of others (not for GM commands)
// ----------------------------------------
Index: src/common/msg_conf.c
===================================================================
--- src/common/msg_conf.c (revision 17251)
+++ src/common/msg_conf.c (working copy)
@@ -77,18 +77,32 @@
*/
int msg_langstr2langtype(char * langtype){
int lang=-1;
- if(!strncmp(langtype, "eng",2)) lang=0;
- else if (!strncmp(langtype, "rus",2)) lang = 1;
- else if (!strncmp(langtype, "spn",2)) lang = 2;
- else if (!strncmp(langtype, "grm",2)) lang = 3;
- else if (!strncmp(langtype, "chn",2)) lang = 4;
- else if (!strncmp(langtype, "mal",2)) lang = 5;
- else if (!strncmp(langtype, "idn",2)) lang = 6;
- else if (!strncmp(langtype, "frn",2)) lang = 7;
+ if(!strncmpi(langtype, "eng",2)) lang=0;
+ else if (!strncmpi(langtype, "rus",2)) lang = 1;
+ else if (!strncmpi(langtype, "spn",2)) lang = 2;
+ else if (!strncmpi(langtype, "grm",2)) lang = 3;
+ else if (!strncmpi(langtype, "chn",2)) lang = 4;
+ else if (!strncmpi(langtype, "mal",2)) lang = 5;
+ else if (!strncmpi(langtype, "idn",2)) lang = 6;
+ else if (!strncmpi(langtype, "frn",2)) lang = 7;
return lang;
}
+const char* msg_langtype2langstr(int langtype){
+ switch(langtype){
+ case 0: return "English (ENG)";
+ case 1: return "Russian (RUS)";
+ case 2: return "Spanish (SPN)";
+ case 3: return "German (GRM)";
+ case 4: return "Chinese (CHN)";
+ case 5: return "Malasian (MAL)";
+ case 6: return "Indonesian (IDN)";
+ case 7: return "French (FRN)";
+ default: return "??";
+ }
+}
+
/*
* verify that the choosen langtype is enable
* return
@@ -97,10 +111,10 @@
* -2 : disable
*/
int msg_checklangtype(int lang, bool display){
- uint16 test=1;
+ uint16 test= (1<<(lang-1));
if(!lang) return 1; //default english
- else if(lang < 0 && (test<<(lang-1)) > LANG_MAX ) return -1; //false range
- else if (LANG_ENABLE&(test<<(lang-1)) ) return 1;
+ else if(lang < 0 || test > LANG_MAX) return -1; //false range
+ else if (LANG_ENABLE&test) return 1;
else if(display) {
ShowDebug("Unsuported langtype=%d\n",lang);
}
Index: src/common/msg_conf.h
===================================================================
--- src/common/msg_conf.h (revision 17251)
+++ src/common/msg_conf.h (working copy)
@@ -26,6 +26,7 @@
int _msg_config_read(const char* cfgName,int size, char ** msg_table);
void _do_final_msg(int size, char ** msg_table);
int msg_langstr2langtype(char * langtype);
+const char* msg_langtype2langstr(int langtype);
//verify that the choosen langtype is enable
int msg_checklangtype(int lang, bool display);
Index: src/map/skill.c
===================================================================
--- src/map/skill.c (revision 17251)
+++ src/map/skill.c (working copy)
@@ -1045,7 +1045,7 @@
if(sd && (skill=pc_checkskill(sd,DC_DANCINGLESSON)))
rate += 5+skill;
status_zap(bl, 0, rate);
- break;
+ break;
case SL_STUN:
if (tstatus->size==SZ_MEDIUM) //Only stuns mid-sized mobs.
sc_start(src,bl,SC_STUN,(30+10*skill_lv),skill_lv,skill_get_time(skill_id,skill_lv));
@@ -15666,7 +15666,7 @@
{
struct map_session_data *sd = NULL;
if(group->val1) {
- sd = map_charid2sd(group->val1);
+ sd = map_charid2sd(group->val1);
group->val1 = 0;
if (sd && !map[sd->bl.m].flag.nowarp)
pc_setpos(sd,map_id2index(unit->bl.m),unit->bl.x,unit->bl.y,CLR_TELEPORT);
Index: src/map/battle.c
===================================================================
--- src/map/battle.c (revision 17251)
+++ src/map/battle.c (working copy)
@@ -1200,7 +1200,7 @@
}
if (battle_config.pk_mode && sd && bl->type == BL_PC && damage && map[bl->m].flag.pvp)
- {
+ {
if (flag & BF_SKILL) { //Skills get a different reduction than non-skills. [Skotlex]
if (flag&BF_WEAPON)
DAMAGE_RATE(battle_config.pk_weapon_damage_rate)
Index: src/map/unit.c
===================================================================
--- src/map/unit.c (revision 17251)
+++ src/map/unit.c (working copy)
@@ -924,10 +924,10 @@
|| (sc->data[SC_FEAR] && sc->data[SC_FEAR]->val2 > 0)
|| (sc->data[SC_SPIDERWEB] && sc->data[SC_SPIDERWEB]->val1)
|| (sc->data[SC_DANCING] && sc->data[SC_DANCING]->val4 && (
- !sc->data[SC_LONGING] ||
- (sc->data[SC_DANCING]->val1&0xFFFF) == CG_MOONLIT ||
- (sc->data[SC_DANCING]->val1&0xFFFF) == CG_HERMODE
- ) )
+ !sc->data[SC_LONGING] ||
+ (sc->data[SC_DANCING]->val1&0xFFFF) == CG_MOONLIT ||
+ (sc->data[SC_DANCING]->val1&0xFFFF) == CG_HERMODE
+ ) )
|| (sc->data[SC_CLOAKING] && //Need wall at level 1-2
sc->data[SC_CLOAKING]->val1 < 3 && !(sc->data[SC_CLOAKING]->val4&1))
)
Index: src/map/atcommand.c
===================================================================
--- src/map/atcommand.c (revision 17251)
+++ src/map/atcommand.c (working copy)
@@ -9088,7 +9088,16 @@
clif_displaymessage(fd,output); //"English is now set as default language"
}
else {
+ int i=0, test=0; char output[512]; //shoud be fine for 50 lang
clif_displaymessage(fd,msg_txt(sd,462));
+ clif_displaymessage(fd,msg_txt(sd,464));
+ while(test!=-1){ //out of range
+ test = msg_checklangtype(i,false);
+ if(test == 1)
+ sprintf(output,"%s%s => %d\n",output,msg_langtype2langstr(i),i);
+ i++;
+ }
+ clif_displaymessage(fd,output);
}
return 0;