Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2 > Metin2 Private Server > Metin2 PServer Guides & Strategies
You last visited: Today at 11:09

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] Talent Tree LUA by Agronaque512

Discussion on [Release] Talent Tree LUA by Agronaque512 within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2011
Posts: 17
Received Thanks: 0
[Release] Talent Tree LUA by Agronaque512

Hello,

Here is a second release of mine.
This will create a choice for the player in a RPG-style which allow him to choose between 3 talent-trees.

Depending on the choosed tree, the player will receive some bonus. Also, every levelup getting bonus.

Enjoy

Code:
quest specialization_intro begin
    state start begin
        -- Upon player login
        when login begin
            -- Check if the player has already received the letter
            if pc.getqf("specialization_intro_done") == 0 then
                -- Send the letter to the player
                send_letter("Specialization - Talk to the Guardian")
            end
        end
    end
end

quest specialization_bonus begin
    state start begin
        -- Interaction with the NPC to choose specialization
        when 11000.chat."Choose Specialization" or 11002.chat."Choose Specialization" or 11004.chat."Choose Specialization" begin
            if pc.getqf("specialization_chosen") == 0 then
                local job = pc.get_job()
                local specialization_choices = {
                    [0] = { -- Warrior
                        {"Barbarian", "A brutal warrior with great physical strength. Bonus: Vitality and Strength."},
                        {"Guardian", "A solid warrior protecting others. Bonus: Vitality and Defense."},
                        {"Balance", "A warrior who maintains a good balance between strength and defense."}
                    },
                    [1] = { -- Ninja
                        {"Assassin", "An expert in quick and stealthy attacks. Bonus: Dexterity and Strength."},
                        {"Shadow Master", "An agile ninja with great precision. Bonus: Dexterity and Precision."},
                        {"Balance", "A ninja who maintains a good balance between agility and strength."}
                    },
                    [3] = { -- Shaman
                        {"Earth Shaman", "A shaman who uses earth magic to strengthen vitality. Bonus: Intelligence and Vitality."},
                        {"Water Shaman", "A shaman who uses water magic to increase mana. Bonus: Intelligence and Mana."},
                        {"Balance", "A shaman who maintains a good balance between magic and vitality."}
                    },
                    [2] = { -- Sura
                        {"War Sura", "A powerful sura specialized in physical attacks. Bonus: Strength and Magic."},
                        {"Magic Sura", "A sura who uses powerful spells to deal damage. Bonus: Strength and Magic."},
                        {"Balance", "A sura who maintains a good balance between strength and magic."}
                    }
                }

                while true do
                    if specialization_choices[job] then
                        local choices = specialization_choices[job]
                        local choice = select(choices[1][1], choices[2][1], choices[3][1], "Return")

                        if choice == 4 then
                            -- If "Return" is chosen, cancel the process
                            say("Choice canceled.")
                            return
                        elseif choice then
                            local selected_choice = choices[choice]
                            local description = selected_choice[2]

                            -- Display the description and ask for confirmation
                            say("You have chosen: " .. selected_choice[1] .. ".")
                            say(description)
                            local confirm = select("Confirm", "Return")

                            if confirm == 1 then
                                -- Save the choice and exit the loop
                                pc.setqf("temp_specialization_choice", choice)
                                pc.setqf("temp_specialization_description", description)
                                break
                            else
                                -- Return to the initial selection
                                say("Returning to the initial choice.")
                            end
                        else
                            say("Choice canceled.")
                            return
                        end
                    else
                        say("You cannot choose a specialization.")
                        return
                    end
                end

                -- Confirm the specialization choice
                if pc.getqf("temp_specialization_choice") then
                    local choice = pc.getqf("temp_specialization_choice")
                    local description = pc.getqf("temp_specialization_description")
                    
                    -- Save the chosen specialization
                    local job = pc.get_job()
                    local specialization_choices = {
                        [0] = { -- Warrior
                            "Barbarian",
                            "Guardian",
                            "Balance"
                        },
                        [1] = { -- Ninja
                            "Assassin",
                            "Shadow Master",
                            "Balance"
                        },
                        [3] = { -- Shaman
                            "Earth Shaman",
                            "Water Shaman",
                            "Balance"
                        },
                        [2] = { -- Sura
                            "War Sura",
                            "Magic Sura",
                            "Balance"
                        }
                    }
                    
                    local selected_specialization = specialization_choices[job][choice]

                    -- Save and confirm the choice
                    pc.setqf("specialization_chosen", 1)
                    pc.setqf("specialization", choice)
                    pc.setqf("specialization_name", selected_specialization)
                    say("You have confirmed your specialization choice: " .. selected_specialization .. ".")
                    say(description)

                    -- Save the chosen specialization to apply the bonuses
                    pc.setqf("specialization_intro_done", 1)
                    pc.setqf("temp_specialization_choice", nil)
                    pc.setqf("temp_specialization_description", nil)
                end
            else
                say("You have already chosen a specialization.")
            end
        end
    end

    state apply_bonus begin
        -- Apply bonuses when leveling up
        when levelup begin
            if pc.getqf("specialization_chosen") == 1 then
                local job = pc.get_job()
                local spec = pc.getqf("specialization")

                local specialization_bonus = {
                    [0] = { -- Warrior
                        [1] = {ht = 2, st = 2},  -- Barbarian
                        [2] = {ht = 3, st = 1},  -- Guardian
                        [3] = {ht = 1, st = 1, dx = 1}  -- Balance
                    },
                    [1] = { -- Ninja
                        [1] = {dx = 3, st = 1}, -- Assassin
                        [2] = {dx = 2, st = 2}, -- Shadow Master
                        [3] = {dx = 2, st = 1, iq = 1}  -- Balance
                    },
                    [3] = { -- Shaman
                        [1] = {iq = 3, ht = 1},  -- Earth Shaman
                        [2] = {iq = 2, ht = 2},  -- Water Shaman
                        [3] = {iq = 2, ht = 1, dx = 1}   -- Balance
                    },
                    [2] = { -- Sura
                        [1] = {st = 2, iq = 1},  -- War Sura
                        [2] = {st = 1, iq = 2},  -- Magic Sura
                        [3] = {st = 2, iq = 1, dx = 1}   -- Balance
                    }
                }

                if specialization_bonus[job] and specialization_bonus[job][spec] then
                    -- Apply the bonuses
                    local bonuses = specialization_bonus[job][spec]
                    for stat, value in pairs(bonuses) do
                        if stat == "ht" then
                            pc.set_ht(pc.get_ht() + value)
                        elseif stat == "iq" then
                            pc.set_iq(pc.get_iq() + value)
                        elseif stat == "st" then
                            pc.set_st(pc.get_st() + value)
                        elseif stat == "dx" then
                            pc.set_dx(pc.get_dx() + value)
                        end
                    end
                end
            end
        end
    end
end
agronaque512 is offline  
Reply


Similar Threads Similar Threads
SWTOR - Jedi Sentinel Combat Talent Tree Build!
07/21/2013 - SWTOR Guides & Strategies - 2 Replies
Hello everybody, I made a video on the Jedi Sentinels Combat talent tree build, so hopefully you fresh 50's or new 50's or anyone in between can take something useful out of this guide! Jedi Sentinel Combat Build: http://i.imgur.com/KiJw3Cr.png I also create MMO, Let’s Play, and Walkthrough Guide Content on my gaming channel as well, check it out! I just Like to make gaming videos, been gaming all my life, but I’m definitely new to making LP’s and Stuff so hopefully my contents good...
Talent calc tree
08/25/2012 - League of Legends - 0 Replies
Hello, someone have the league of legends talent calculator writed in php? I want it to my website ( LT Gaming Lietuvos eSporto atstovai| League of legends|Counter Strike|StarCraft2|) BUT i cant make it and find it anywhere. So maybe you have? Or I'm searching bad?
Suche DRINGEND Talent Tree Gen!!!!
11/15/2011 - World of Warcraft - 6 Replies
Heyho, wie die Überschrift schon sagt suche ich einen Talentbaum Generator, aber nicht irgendeinen, sondern einen für Patch 3.3.5a bzw. einen der den selben Baum hat wie 3.3.5a. Habe schon einen im Inet gefunden, jedoch nur für Cata oder vor WOLTK! Kann mir jemand weiterhelfen? Wäre echt super! Neede ihn btw. für Priests. Danke an alle im Voraus!:handsdown: LG Mona :p EDIT: Bitte keine Kommis wie: "Google.de ist dein Freund" sind unnötig. Hab in Google schon gesucht, jedoch nichts...
Druid Tree form buff without tree Form
11/11/2007 - WoW Exploits, Hacks, Tools & Macros - 5 Replies
My buddy and i were screwing around the other day in Mech and we figured out a way to have a working tree form buff for the party but not be in tree form. Which if anyone knows about druids allows them to cast all their other high healing spells. Anyway follow the instructions below its a bit tricky 1. Change your chest item to something else 2. Get into Combat.. Queue your chestpiece to switch back to your original 3. When the fights finishing, Get ready.. The second the...
Caster Druid Talent Tree
01/10/2005 - WoW Guides & Templates - 0 Replies
Class: if you had to pick between NightElf and Tauren, id go Night Elf. Strat: Entangle, stun, kill. Basically. Balance Talents (48 points)



All times are GMT +2. The time now is 11:09.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.