Jump to content

Official Client Locale String[REVERSED]


Recommended Posts

  • 1 month later...
  • 2 months later...
  • 2 weeks later...
  • 3 months later...
On 6/3/2023 at 2:02 PM, coadapute123 said:

So, we can change:

ChatPacket(CHAT_TYPE_INFO, LC_TEXT("전투가 시작 되어 취소 되었습니다."));

To:

ChatPacket(CHAT_TYPE_INFO, "[LS;485]");

 

                    ch->ChatPacket(CHAT_TYPE_INFO, ("[LS;711 %s]"), LC_ITEM_NAME(bio_data[level][1], ch->GetLanguage()));

It doesn't work, it gives an error

Edited by Patron
Link to comment
Share on other sites

  • Management
7 hours ago, Mali said:

Fixed, wait @ AZICKO for update.

House Party Dancing GIF by Amazon Prime Video

Edited by Metin2 Dev International
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

I believe you've made a small typo in the tutorial.
In experimental -> 1.Svn -> Server -> game -> src -> input_main.cpp

This:

//Find in int CInputMain::Chat(LPCHARACTER ch, const char * data, size_t uiBytes)
#if defined(__BL_CLIENT_LOCALE_STRING__)
				pack.bCanFormat = false;
#endif

///Change
#if defined(__BL_CLIENT_LOCALE_STRING__)
				pack.bCanFormat = (hyperlinks > 0);
#endif

Should be this:

//Find in int CInputMain::Chat(LPCHARACTER ch, const char * data, size_t uiBytes)
#if defined(__BL_CLIENT_LOCALE_STRING__)
	pack_chat.bCanFormat = false;
#endif

///Change
#if defined(__BL_CLIENT_LOCALE_STRING__)
	pack_chat.bCanFormat = (hyperlinks > 0);
#endif

 

Edited by Debloat
typo
  • Metin2 Dev 1
Link to comment
Share on other sites

  • 2 weeks later...

Excuse me, I posted a thank you message here for access to the download links, and my post was deleted, may I know why? While in addition I have a problem with this system I don't even know if I have the right to post now.

My problem with this system :
In my client I added the "say(locale_quest(14188))" (Please excuse me in advance if it is written in French in my locale_quest.txt because I am French)

 

Spoiler

14188    Veuillez d'abord invoquer votre buffeuse.
14189    Veuillez mettre le nom de votre choix.
14190    Félicitations, votre nom de buff a changé.
14191    Une erreur s'est produite. Veuillez réessayer..
14196    Veuillez essayer un autre nom.
14192    Buffi Dragon
14193    Pouvoir du Dragon Buff
14194    Buffi Vitesse du vent
14195    Attaque renforcée de Buffi
14197    Vous n'avez aucune compétence de buff pour avoir besoin d'une mise à niveau.
14198    Veuillez sélectionner une compétence.

Server side :

Spoiler

quest __buffi__ begin
    state start begin
        when 952006.use begin
            say_title(item_name(952006))
            say("")
            if pc.get_buffi_count() < 1 then
                say(locale_quest(14188))
                return
            end
            say(locale_quest(14189))

            local result = pc.set_buffi_name(tostring(input()))
            say_title(item_name(952006))
            say("")
            if result == 99 then
                say(locale_quest(14190))
                item.set_count(item.get_count()-1)
            elseif result == 0 then
                say(locale_quest(14191))
            elseif result == 1 or result == 2 then
                say(locale_quest(14196))
            end
        end
        function BuildSkillList()
            local skillIdxList = {164, 165, 166, 167}
            local skillNameList = {locale_quest(14192), locale_quest(14193), locale_quest(14194), locale_quest(14195)}
            local ret_vnum_list = {}
            local ret_name_list = {}
            table.foreach(skillIdxList, 
            function(i, skillIdx)
            local skillLevel = pc.get_skill_level(skillIdx)
            if skillLevel >= 30 and skillLevel < 40 then
                table.insert(ret_vnum_list, skillIdx)
                table.insert(ret_name_list, skillNameList[i])
                end
            end)
            return {ret_vnum_list, ret_name_list}
        end

        when 952005.use begin
            if get_time() < pc.getqf("next_time_buffi") then
                if pc.is_skill_book_no_delay() then
                    say_title(locale_quest(9913))
                    say(locale_quest(9935))
                    wait()
                else
                    say_title(locale_quest(9913))
                    say(locale_quest(9936))
                    return
                end
            end

            local result = __buffi__.BuildSkillList()

            local vnum_list = result[1]
            local name_list = result[2]
            
            say_title(item_name(952005))
            say("")

            if table.getn(vnum_list) == 0 then
                say(locale_quest(14197))
                return
            end

            say(locale_quest(14198))

            local menu_list = {}
            table.foreach(name_list, function(i, name) table.insert(menu_list, name) end)
            table.insert(menu_list, locale_quest(1117))
            local s=select_table(menu_list)
            if table.getn(menu_list) == s then
                return
            end

            local skill_name=name_list[s]
            local skill_vnum=vnum_list[s]
            local skill_level = pc.get_skill_level(skill_vnum)
            local cur_alignment = pc.get_real_alignment()
            local need_alignment = 1000+500*(skill_level-30)

            say_title(locale_quest(9913))
            say(locale_quest(9942))

            if cur_alignment<-19000+need_alignment then
                say_reward(locale_quest(9914))
                return
            end

            if cur_alignment<0 then
                say_reward(string.format(locale_quest(9915), need_alignment, need_alignment*2))
                say_reward(locale_quest(9916))
                need_alignment=need_alignment*2
            elseif cur_alignment<need_alignment then
                say_reward(string.format(locale_quest(9917), need_alignment))
                say_reward(locale_quest(9918))
            else
                say_reward(string.format(locale_quest(9917), need_alignment))
            end

            local s= select(locale_quest(10065), locale_quest(10066))
            if s==2 then
                return
            end

            if get_time() < pc.getqf("next_time_buffi") then
                if pc.is_skill_book_no_delay() then
                    pc.remove_skill_book_no_delay()
                else
                    say_title(locale_quest(9913))
                    return
                end
            end

            pc.setqf("next_time_buffi", get_time() + time_hour_to_sec(number(8, 12)))        

            if need_alignment>0 then
                if pc.count_item(952005) > 0 then
                    local title=string.format(locale_quest(9941), name_list[s])

                    if pc.learn_grand_master_skill(skill_vnum) then
                        pc.change_alignment(-need_alignment)
                        say_title(title)
                        say_reward(locale_quest(9923))
                        if 40 == pc.get_skill_level(skill_vnum) then
                            say(locale_quest(9925))
                            say(string.format(locale_quest(9926), name_list[s]))
                            say(locale_quest(9927))
                        else
                            say(locale_quest(9928))
                            say(string.format(locale_quest(9929), name_list[s], skill_level-30+1+1))
                        end
                        say_reward(locale_quest(9930))
                        say_reward(string.format(locale_quest(9931), need_alignment))
                    else
                        say_title(title)
                        say_reward(locale_quest(9932))
                        say(locale_quest(9933))
                        say_reward(locale_quest(9934))
                        pc.change_alignment(-number(need_alignment/3, need_alignment/2))
                    end
                    pc.remove_item(952005)
                end
            end
        end
    end
end

InGame :

https://metin2.download/picture/0DuFaN3XJ16kadvf7olS369rjWFQM533/.png

 

Edited by Metin2 Dev International
Core X - External 2 Internal
Link to comment
Share on other sites

  • Active Member

Thanks @ Malí for the system, you are incredible! and @ Owsap for the script, all work great!.

.png

(Forgot the names of NPC i don't translate that.)

11 hours ago, kza54 said:

Excuse me, I posted a thank you message here for access to the download links, and my post was deleted, may I know why? While in addition I have a problem with this system I don't even know if I have the right to post now.

My problem with this system :
In my client I added the "say(locale_quest(14188))" (Please excuse me in advance if it is written in French in my locale_quest.txt because I am French)

 

  Hide contents

14188    Veuillez d'abord invoquer votre buffeuse.
14189    Veuillez mettre le nom de votre choix.
14190    Félicitations, votre nom de buff a changé.
14191    Une erreur s'est produite. Veuillez réessayer..
14196    Veuillez essayer un autre nom.
14192    Buffi Dragon
14193    Pouvoir du Dragon Buff
14194    Buffi Vitesse du vent
14195    Attaque renforcée de Buffi
14197    Vous n'avez aucune compétence de buff pour avoir besoin d'une mise à niveau.
14198    Veuillez sélectionner une compétence.

Server side :

  Reveal hidden contents

quest __buffi__ begin
    state start begin
        when 952006.use begin
            say_title(item_name(952006))
            say("")
            if pc.get_buffi_count() < 1 then
                say(locale_quest(14188))
                return
            end
            say(locale_quest(14189))

            local result = pc.set_buffi_name(tostring(input()))
            say_title(item_name(952006))
            say("")
            if result == 99 then
                say(locale_quest(14190))
                item.set_count(item.get_count()-1)
            elseif result == 0 then
                say(locale_quest(14191))
            elseif result == 1 or result == 2 then
                say(locale_quest(14196))
            end
        end
        function BuildSkillList()
            local skillIdxList = {164, 165, 166, 167}
            local skillNameList = {locale_quest(14192), locale_quest(14193), locale_quest(14194), locale_quest(14195)}
            local ret_vnum_list = {}
            local ret_name_list = {}
            table.foreach(skillIdxList, 
            function(i, skillIdx)
            local skillLevel = pc.get_skill_level(skillIdx)
            if skillLevel >= 30 and skillLevel < 40 then
                table.insert(ret_vnum_list, skillIdx)
                table.insert(ret_name_list, skillNameList[i])
                end
            end)
            return {ret_vnum_list, ret_name_list}
        end

        when 952005.use begin
            if get_time() < pc.getqf("next_time_buffi") then
                if pc.is_skill_book_no_delay() then
                    say_title(locale_quest(9913))
                    say(locale_quest(9935))
                    wait()
                else
                    say_title(locale_quest(9913))
                    say(locale_quest(9936))
                    return
                end
            end

            local result = __buffi__.BuildSkillList()

            local vnum_list = result[1]
            local name_list = result[2]
            
            say_title(item_name(952005))
            say("")

            if table.getn(vnum_list) == 0 then
                say(locale_quest(14197))
                return
            end

            say(locale_quest(14198))

            local menu_list = {}
            table.foreach(name_list, function(i, name) table.insert(menu_list, name) end)
            table.insert(menu_list, locale_quest(1117))
            local s=select_table(menu_list)
            if table.getn(menu_list) == s then
                return
            end

            local skill_name=name_list[s]
            local skill_vnum=vnum_list[s]
            local skill_level = pc.get_skill_level(skill_vnum)
            local cur_alignment = pc.get_real_alignment()
            local need_alignment = 1000+500*(skill_level-30)

            say_title(locale_quest(9913))
            say(locale_quest(9942))

            if cur_alignment<-19000+need_alignment then
                say_reward(locale_quest(9914))
                return
            end

            if cur_alignment<0 then
                say_reward(string.format(locale_quest(9915), need_alignment, need_alignment*2))
                say_reward(locale_quest(9916))
                need_alignment=need_alignment*2
            elseif cur_alignment<need_alignment then
                say_reward(string.format(locale_quest(9917), need_alignment))
                say_reward(locale_quest(9918))
            else
                say_reward(string.format(locale_quest(9917), need_alignment))
            end

            local s= select(locale_quest(10065), locale_quest(10066))
            if s==2 then
                return
            end

            if get_time() < pc.getqf("next_time_buffi") then
                if pc.is_skill_book_no_delay() then
                    pc.remove_skill_book_no_delay()
                else
                    say_title(locale_quest(9913))
                    return
                end
            end

            pc.setqf("next_time_buffi", get_time() + time_hour_to_sec(number(8, 12)))        

            if need_alignment>0 then
                if pc.count_item(952005) > 0 then
                    local title=string.format(locale_quest(9941), name_list[s])

                    if pc.learn_grand_master_skill(skill_vnum) then
                        pc.change_alignment(-need_alignment)
                        say_title(title)
                        say_reward(locale_quest(9923))
                        if 40 == pc.get_skill_level(skill_vnum) then
                            say(locale_quest(9925))
                            say(string.format(locale_quest(9926), name_list[s]))
                            say(locale_quest(9927))
                        else
                            say(locale_quest(9928))
                            say(string.format(locale_quest(9929), name_list[s], skill_level-30+1+1))
                        end
                        say_reward(locale_quest(9930))
                        say_reward(string.format(locale_quest(9931), need_alignment))
                    else
                        say_title(title)
                        say_reward(locale_quest(9932))
                        say(locale_quest(9933))
                        say_reward(locale_quest(9934))
                        pc.change_alignment(-number(need_alignment/3, need_alignment/2))
                    end
                    pc.remove_item(952005)
                end
            end
        end
    end
end

InGame :

https://metin2.download/picture/0DuFaN3XJ16kadvf7olS369rjWFQM533/.png

 

Hello, you add in quest_functions:

Spoiler

locale_quest

locale_string

locale_in

locale_mn

locale_sn

locale_psn

locale_ox

in questlib.lua:

Spoiler

-- @desc: function for locale quest converstion

-- @ref: https://www.lua.org/pil/5.2.html

-- @author: Owsap

locale_quest = function(vnum, ...)

local val = ""

for i, v in ipairs(arg) do

val = val .. tostring(string.format(";%s", v))

end

return string.format("[LC;%d%s]", vnum, val)

end

 

locale_string = function(vnum, ...)

local val = ""

for i, v in ipairs(arg) do

val = val .. tostring(string.format(";%s", v))

end

return string.format("[LS;%d%s]", vnum, val)

end

 

locale_in = function(vnum)

return string.format("[IN;%d]", vnum)

end

 

locale_mn = function(vnum)

return string.format("[MN;%d]", vnum)

end

 

locale_sn = function(vnum)

return string.format("[SN;%d]", vnum)

end

 

locale_psn = function(vnum)

return string.format("[PSN;%d]", vnum)

end

 

locale_ox = function(vnum)

return string.format("[LOX;%d]", vnum)

end

If even with this, you have this error, you can try the script that Owsap provided us, with which you can translate the translate.lua and not worry about the quests, since you will execute the corresponding LC according to the phrase for example "gameforge.metin2" in translate.lua would have something like "gameforge.metin2 = Hello" with the script it would become something like "gameforge.metin2 = [LC;01]" and within the game, it would execute the file "locale_quest 01 = Hello"  like the photo I posted in my post.

KH.jpg

Nicks: Nazox Krone Nagato Yahiko Yakiro
Proyecto: Trabajando en el.
Compañeros & firma: DreamHQ  - 2009-2015 [Nostalgia]

Link to comment
Share on other sites

  • 3 weeks later...

If applied correctly, everything works fine;
To also have the translations of the items in the strings you need to replace in
 

server -> conf -> item_names.txt

the item names with [IN;VALUEOFITEM]

The only flaw I'm finding is that it translates the names of the mobs but not those of the npcs;

Edited by 4peppe
Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.