Jump to content
For maintenance and updates, the community will be offline on 31 December 2022 ×
  • 0

Modify soul stone to 100%


4peppe

Question

Hi everyone, I would like to change the probability from the soul stones to 100% success, can you help me? This is my quest: 

Spoiler

quest training_grandmaster_skill begin
    state start begin
        when 50513.use begin
            if pc.get_skill_group() == 0 then
                say_title(gameforge.training_grandmaster_skill._10_sayTitle)
                say(gameforge.training_grandmaster_skill._20_say)
                return
            end

            if get_time() < pc.getqf("next_time") then
                if pc.is_skill_book_no_delay() then
                    say_title(gameforge.training_grandmaster_skill._10_sayTitle)
                    say(gameforge.training_grandmaster_skill._30_say)
                    wait()
                else
                    say_title(gameforge.training_grandmaster_skill._10_sayTitle)
                    say(gameforge.training_grandmaster_skill._40_say)
                    return
                end
            end

            local result = training_grandmaster_skill.BuildGrandMasterSkillList(pc.get_job(), pc.get_skill_group())

            local vnum_list = result[1]
            local name_list = result[2]

            if table.getn(vnum_list) == 0 then
                say_title(gameforge.training_grandmaster_skill._10_sayTitle)
                say(gameforge.training_grandmaster_skill._50_say)
                return
            end
            say_title(gameforge.training_grandmaster_skill._10_sayTitle)
            say(gameforge.training_grandmaster_skill._60_say)

            local menu_list = {}
            table.foreach(name_list, function(i, name) table.insert(menu_list, name) end)
            table.insert(menu_list, gameforge.locale.cancel) 

            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)

            test_chat(string.format(gameforge.training_grandmaster_skill._70_chat, cur_alignment..gameforge.training_grandmaster_skill._75_chat..need_alignment))

            local title=string.format(gameforge.training_grandmaster_skill._80_stringFormat, skill_name, skill_level-30+1)

            say_title(gameforge.training_grandmaster_skill._10_sayTitle)
            say(gameforge.training_grandmaster_skill._90_say)

            if cur_alignment<-19000+need_alignment then
                say_reward(gameforge.training_grandmaster_skill._100_sayReward)
                                return
            end

            if cur_alignment<0 then
say_reward(string.format(gameforge.training_grandmaster_skill._110_sayReward, need_alignment, need_alignment*2))
                say_reward(gameforge.training_grandmaster_skill._120_sayReward)
                need_alignment=need_alignment*2
            elseif cur_alignment<need_alignment then
say_reward(string.format(gameforge.training_grandmaster_skill._130_sayReward, need_alignment))
                say_reward(gameforge.training_grandmaster_skill._140_sayReward)
            else
say_reward(string.format(gameforge.training_grandmaster_skill._130_sayReward, need_alignment))
            end
                
            local s= select(gameforge.locale.levelup.prev_quest_go, gameforge.locale.cancel)    
            
            if s==2 then
                return
            end


            if cur_alignment>=0 and cur_alignment<need_alignment then
say_title(title)
                say_reward(gameforge.training_grandmaster_skill._150_sayReward)
                say(gameforge.training_grandmaster_skill._160_say)
                say_reward(gameforge.training_grandmaster_skill._170_sayReward)
                say(gameforge.training_grandmaster_skill._180_say)
                local s=input()
                s = string.gsub(s, "(%a*)%s*", "%1")
                s = string.lower(string.gsub(s, "(%a*)%s*", "%1"))

                local t = string.gsub(gameforge.training_grandmaster_skill._10_answer, "(%a*)%s*", "%1")
                t = string.lower(string.gsub(gameforge.training_grandmaster_skill._10_answer, "(%a*)%s*", "%1"))
                
                if s!=t then
                    return
                end
            end

            if get_time() < pc.getqf("next_time") then
                if pc.is_skill_book_no_delay() then
                    pc.remove_skill_book_no_delay()
                else
                    say_title(gameforge.training_grandmaster_skill._10_sayTitle)
                    return
                end
            end

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


            if need_alignment>0 then
                if pc.count_item(50513) > 0 then
                    if pc.learn_grand_master_skill(skill_vnum) then
                        pc.change_alignment(-need_alignment)
                
                        say_title(title)
                        say_reward(gameforge.training_grandmaster_skill._190_sayReward)

                        if 40 == pc.get_skill_level(skill_vnum) then
                            say(gameforge.training_grandmaster_skill._200_say)
                            say(string.format(gameforge.training_grandmaster_skill._210_say, skill_name))
                            say(gameforge.training_grandmaster_skill._220_say)
                        else
                            say(gameforge.training_grandmaster_skill._230_say)
                            say(string.format(gameforge.training_grandmaster_skill._240_say, skill_name, skill_level-30+1+1))
                        end
                        say_reward(gameforge.training_grandmaster_skill._250_sayReward)
                        say_reward(string.format(gameforge.training_grandmaster_skill._260_sayReward, need_alignment))
                    else
                        say_title(title)
                        say_reward(gameforge.training_grandmaster_skill._270_sayReward)
                        say(gameforge.training_grandmaster_skill._280_say)
                        say_reward(gameforge.training_grandmaster_skill._290_sayReward)
                        pc.change_alignment(-number(need_alignment/3, need_alignment/2))
                    end
                    pc.remove_item(50513)
                else
                    char_log(0, "HACK 50513", pc.getname())
                end
            end
        end

        function BuildGrandMasterSkillList(job, group)
            GRAND_MASTER_SKILL_LEVEL = 30
            PERFECT_MASTER_SKILL_LEVEL = 40

            local skill_list = special.active_skill_list[job+1][group]
            local ret_vnum_list = {}
            local ret_name_list = {}

            table.foreach(skill_list, 
            function(i, skill_vnum) 
            local skill_level = pc.get_skill_level(skill_vnum)

            if skill_level >= GRAND_MASTER_SKILL_LEVEL and skill_level < PERFECT_MASTER_SKILL_LEVEL then
                table.insert(ret_vnum_list, skill_vnum)
                local name=locale.GM_SKILL_NAME_DICT[skill_vnum]
                
                if name == nil then name=skill_vnum end
                    table.insert(ret_name_list, name)
                end
            end)
            return {ret_vnum_list, ret_name_list}
        end
    end
end
 

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
  • Distinguished Member

The prob is actually calculated on the source. The logic fcked up as usual for Ymir... so I advice this rework for you:

(You should use unmodified quest for this one)

  • Love 1
Link to comment
Share on other sites

  • 0
Spoiler

 

4 hours ago, TMP4 said:

The prob is actually calculated on the source. The logic fcked up as usual for Ymir... so I advice this rework for you:

(You should use unmodified quest for this one)

I love you, you are number one! 🥰 If you need a hand I'm here;
may I ask you where should I put this file? like quest for file 50513 (Stone of Souls)? Ok, in char_skill.cpp! obviously, it works!
 

Spoiler

// ADD_GRANDMASTER_SKILL
bool CHARACTER::LearnGrandMasterSkill(DWORD dwSkillVnum)    //SAVIRIS EDIT - Dziwny algorytm treningu zast?piony najzwyklejsz? szans? na przeczytanie
{
    CSkillProto * pkSk = CSkillManager::instance().Get(dwSkillVnum);

    if (!pkSk)
        return false;

    if (!IsLearnableSkill(dwSkillVnum))
    {
        return false;
    }

    sys_log(0, "learn grand master skill[%d] cur %d, next %d", dwSkillVnum, get_global_time(), GetSkillNextReadTime(dwSkillVnum));

    if (pkSk->dwType == 0)
    {
        return false;
    }

    std::string strTrainSkill;
    {
        std::ostringstream os;
        os << "training_grandmaster_skill.skill" << dwSkillVnum;
        strTrainSkill = os.str();
    }

    // ?ⓒ±a?­ ?®·u?≫ °?≫?C?´?´?.
    BYTE bLastLevel = GetSkillLevel(dwSkillVnum);

    int idx = MIN(9, GetSkillLevel(dwSkillVnum) - 30);

    sys_log(0, "LearnGrandMasterSkill %s table idx %d value %d", GetName(), idx, aiGrandMasterSkillBookCountForLevelUp[idx]);

    int iBookCount = aiGrandMasterSkillBookCountForLevelUp[idx];

    if (FindAffect(AFFECT_SKILL_BOOK_BONUS))
    {
        if (iBookCount&1)
            iBookCount = iBookCount / 2 + 1; 
        else
            iBookCount = iBookCount / 2; 

        RemoveAffect(AFFECT_SKILL_BOOK_BONUS);
    }

    int n = number(1, 100);
    sys_log(0, "Number(%d)", n);

    DWORD nextTime = get_global_time() + number(28800, 43200);
    
    bool bSuccess = false;
    
    const int aiGrandMasterSkillBookSuccessProb[10] = 
        { //1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10    <-- Poziomy G
            100, 100, 100, 100, 100, 100, 100, 100, 100, 100
        };
    if (n <= aiGrandMasterSkillBookSuccessProb[idx])
    {
        bSuccess = true;
    }
        
    if (test_server)
    {
        ChatPacket(CHAT_TYPE_INFO, "[TEST] Dane: aiGrandMasterSkillBookSuccessProb[%d] = %d, n = %d", idx, aiGrandMasterSkillBookSuccessProb[idx], n);
    }
    
    if (bSuccess)
    {
        SkillLevelUp(dwSkillVnum, SKILL_UP_BY_QUEST);
    }

    SetSkillNextReadTime(dwSkillVnum, nextTime);

    if (bLastLevel == GetSkillLevel(dwSkillVnum))
    {
        LogManager::instance().CharLog(this, dwSkillVnum, "GM_READ_FAIL", "");
        return false;
    }

    LogManager::instance().CharLog(this, dwSkillVnum, "GM_READ_SUCCESS", "");
    return true;
}
// END_OF_ADD_GRANDMASTER_SKILL

here it is edited without korean writing, and 100% chance

Edited by 4peppe
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Activity

    1. 0

      Need Help With Char_Item.cpp

    2. 0

      ULTERIUS2.COM

    3. 7

      Killua - Unholy God Set

    4. 2

      Visual studio 2022 compiling issue

    5. 991

      [40250] Reference Serverfile + Client + Src [15 Available Languages]

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.