[Help] How to remove an excellent option (X-Team sources)

Results 1 to 10 of 10
  1. #1
    Novice C++ allexander is offline
    MemberRank
    Feb 2011 Join Date
    European UnionLocation
    580Posts

    [Help] How to remove an excellent option (X-Team sources)

    Hello,

    like the title say i m looking for a way to remove zen exc option:

    [IMG][/IMG]

    i want to stop this option from being generated in to items or maby replace it.
    @Luis_br, @Pyke, @myheart, @LTPTeam, @SmileYzn

    Thank you.
    Last edited by allexander; 13-08-19 at 12:40 AM.


  2. #2
    0x4D696E68 myheart is offline
    MemberRank
    Jun 2017 Join Date
    356Posts

    Re: [Help] How to remove an excellent option (X-Team sources)

    Quote Originally Posted by allexander View Post
    Hello,

    like the title say i m looking for a way to remove zen exc option:

    [IMG][/IMG]

    i want to stop this option from being generated in to items or maby replace it.
    @Luis_br, @Pyke, @myheart, @LTPTeam, @SmileYzn

    Thank you.
    in ItemOptionRate.cpp -CItemOptionRate::MakeNewOption()

    ItemIndex >=(6,0) && < (12,0) !!

    Code:
    1 : Increases acquisition rate of Zen after Hunting monster +30%
    2 : Defence success rate +10%
    4 : Reflect damage +5%
    8 : Damage decrease +4%
    16 : Increase Max mana +4%
    32 : Increase Max HP +4%
    1. remove
    Code:
    while (true)
        {
      if (count >= value || count >= MaxNewOption)
      {
       break;
      }
    
      int value = 1 << (GetLargeRand() % MaxNewOption);
    
      if (((*option) & value) == 0)
      {
       (*option) |= value;
       count++;
      }
        }
    
        if (((*option) & 1) != 0)
        {
      (*option) &= ~1;
        }
    2. replace with random option
    Code:
    while (true)
        {
      if (count >= value || count >= MaxNewOption)
      {
       break;
      }
    
      int value = 1 << (GetLargeRand() % MaxNewOption);
    
      if (((*option) & value) == 0 && value != 1)
      {
       (*option) |= value;
       count++;
      }
        }
    3.remove and replace with special option if not exist
    Code:
    while (true)
        {
      if (count >= value || count >= MaxNewOption)
      {
       break;
      }
    
      int value = 1 << (GetLargeRand() % MaxNewOption);
    
      if (((*option) & value) == 0)
      {
       (*option) |= value;
       count++;
      }
        }
    
        if (((*option) & 1) != 0)
        {
      (*option) &= ~1;
    
      if (((*option) & OPTION INDEX) == 0)
      {
       (*option) |= OPTION INDEX;
      }
        }
    4. replace with special option
    Code:
    while (true)
        {
      if (count >= value || count >= MaxNewOption)
      {
       break;
      }
    
      int value = 1 << (GetLargeRand() % MaxNewOption);
    
      if (value == 1)
      {
       if (((*option) & OPTION INDEX) == 0)
       {
        (*option) |= OPTION INDEX;
        count++;
       }
       
       continue;
      }
    
      if (((*option) & value) == 0)
      {
       (*option) |= value;
       count++;
      }
        }
    Last edited by myheart; 13-08-19 at 04:39 AM.

  3. #3
    Novice C++ allexander is offline
    MemberRank
    Feb 2011 Join Date
    European UnionLocation
    580Posts

    Re: [Help] How to remove an excellent option (X-Team sources)

    Quote Originally Posted by myheart View Post
    ItemIndex >=(6,0) && < (12,0) !!
    ItemIndex >= (6,0) && ItemIndex < (14,0) ring and pendant too

    Thank you!
    Last edited by allexander; 14-08-19 at 03:15 AM.

  4. #4
    0x4D696E68 myheart is offline
    MemberRank
    Jun 2017 Join Date
    356Posts

    Re: [Help] How to remove an excellent option (X-Team sources)

    Quote Originally Posted by allexander View Post
    ItemIndex >= (6,0) && ItemIndex < (14,0) ring and pendant tooThank you!
    you forgot wings items
    (ItemIndex >= (6,0) && < (12,0)) || == (13,8) || == (13,9) || == (13,21) || == (13,22) || == (13,23) || == (13,24) is better
    Last edited by myheart; 15-08-19 at 07:50 AM.

  5. #5
    Novice C++ allexander is offline
    MemberRank
    Feb 2011 Join Date
    European UnionLocation
    580Posts

    Re: [Help] How to remove an excellent option (X-Team sources)

    Quote Originally Posted by myheart View Post
    you forgot wings items
    (ItemIndex >= (6,0) && ItemIndex < (12,0)) || ItemIndex == (13,8) || ItemIndex == (13,9) || ItemIndex == (13,21) || ItemIndex == (13,22) || ItemIndex == (13,23) || ItemIndex == (13,24) is better
    OK tried "Remove" & "Replace with random option" and i still get the option with zen so maby im doing something wrong, here is how i applied the code:

    Code:
    bool CItemOptionRate::MakeNewOption(int ItemIndex,int value,BYTE* option) // OK
    {
        (*option) = 0;
    
        int count = 0;
    
        int MaxNewOption = MAX_EXC_OPTION;
    
        if((ItemIndex >= GET_ITEM(12,3) && ItemIndex <= GET_ITEM(12,6)) || ItemIndex == GET_ITEM(12,42) || ItemIndex == GET_ITEM(12,49) || ItemIndex == GET_ITEM(13,30)) // 2sd Wings
        {
            MaxNewOption = ((ItemIndex==GET_ITEM(13,30))?4:3);
        }
    
        if((ItemIndex >= GET_ITEM(12,36) && ItemIndex <= GET_ITEM(12,40)) || ItemIndex == GET_ITEM(12,43) || ItemIndex == GET_ITEM(12,50)) // 3rd Wings
        {
            MaxNewOption = 4;
        }
    
        if(ItemIndex >= GET_ITEM(12,262) && ItemIndex <= GET_ITEM(12,265)) // Monster Wings
        {
            MaxNewOption = 2;
        }
    
        if(ItemIndex == GET_ITEM(12,266)) // Wings of Conqueror
        {
            MaxNewOption = 3;
        }
    
        if(ItemIndex == GET_ITEM(12,267)) // Wings of Angel and Devil
        {
            MaxNewOption = 3;
        }
    
        if(gCustomWing.CheckCustomWingByItem(ItemIndex) != 0)
        {
            MaxNewOption = 4;
        }
    
        if(ItemIndex == GET_ITEM(13,3)) // Dinorant
        {
            MaxNewOption = 3;
        }
    
        if(ItemIndex == GET_ITEM(13,37)) // Fenrir
        {
            MaxNewOption = 3;
        }
    
        if(ItemIndex >= (6,0) && ItemIndex < (14,0))
        {
            while (true)
            {
                if (count >= value || count >= MaxNewOption)
                {
                    break;
                }
    
                int value = 1 << (GetLargeRand() % MaxNewOption);
    
                if (((*option) & value) == 0 && value != 1)
                {
                    (*option) |= value;
                    count++;
                }
            }
        }
    
        while(true)
        {
            if(count >= value || count >= MaxNewOption)
            {
                break;
            }
    
            int value = 1 << (GetLargeRand()%MaxNewOption);
    
            if(((*option) & value) == 0)
            {
                (*option) |= value;
                count++;
            }
        }
        
        return 1;
    }
    i made a minor change because i couldn't compile the source without it maybe that is the problem:
    Util.cpp
    Code:
    void SetLargeRand() // OK
    {
        seed = std::mt19937(std::random_device()());
        dist = std::uniform_int_distribution<int>(0,2147483647);
    }
    without that extra pair of round brackets i get this error:


    Code:
    Error C2039 'generate': is not a member of 'std::random_device'    
    
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\random    1274
    About wings they are included in ItemIndex >= (6,0) && ItemIndex < (14,0) but if is safe to add them idividually than i will.

    Thank you.
    Last edited by allexander; 15-08-19 at 03:30 AM.

  6. #6
    0x4D696E68 myheart is offline
    MemberRank
    Jun 2017 Join Date
    356Posts

    Re: [Help] How to remove an excellent option (X-Team sources)

    two while loops??

    Code:
    if(ItemIndex >= (6,0) && ItemIndex < (14,0))
    {
    
    }
    this is bad
    ---------------------------------------------------------------------------------------------------
    void SetLargeRand() // OK
    {
    seed = std::mt19937(std::random_device()());
    dist = std::uniform_int_distribution<int>(0,2147483647);
    }
    Code:
    void SetLargeRand()
    {
        std::random_device rd;
        seed = std::mt19937(rd());
        dist = std::uniform_int_distribution<int>(0,2147483647);
    }

  7. #7
    Novice C++ allexander is offline
    MemberRank
    Feb 2011 Join Date
    European UnionLocation
    580Posts

    Re: [Help] How to remove an excellent option (X-Team sources)

    Quote Originally Posted by myheart View Post
    two while loops??



    this is bad
    ---------------------------------------------------------------------------------------------------


    Code:
    void SetLargeRand()
    {
        std::random_device rd;
        seed = std::mt19937(rd());
        dist = std::uniform_int_distribution<int>(0,2147483647);
    }
    ok, removed the second "while" loop and replaced the SetLargeRand but they still drop items +zen

    btw using this source.
    Last edited by allexander; 15-08-19 at 05:27 AM.

  8. #8
    0x4D696E68 myheart is offline
    MemberRank
    Jun 2017 Join Date
    356Posts

    Re: [Help] How to remove an excellent option (X-Team sources)

    Quote Originally Posted by allexander View Post
    ok, removed the second "while" loop and replaced the SetLargeRand but they still drop items +zen
    btw using this source.
    if(ItemIndex >= (6,0) && ItemIndex < (14,0)){
    }
    i means this is wrong
    GET_ITEM(6,0) not (6,0)

  9. #9
    Novice C++ allexander is offline
    MemberRank
    Feb 2011 Join Date
    European UnionLocation
    580Posts

    Re: [Help] How to remove an excellent option (X-Team sources)

    Quote Originally Posted by myheart View Post
    i means this is wrong
    GET_ITEM(6,0) not (6,0)
    Still not working:

    Code:
    bool CItemOptionRate::MakeNewOption(int ItemIndex,int value,BYTE* option) // OK
    {
        (*option) = 0;
    
        int count = 0;
    
        int MaxNewOption = MAX_EXC_OPTION;
    
        if(ItemIndex >= GET_ITEM(6,0) && ItemIndex < GET_ITEM(12,0))
        {
            while (true)
            {
                if (count >= value || count >= MaxNewOption)
                {
                    break;
                }
    
                int value = 1 << (GetLargeRand() % MaxNewOption);
    
                if (((*option) & value) == 0 && value != 1)
                {
                    (*option) |= value;
                    count++;
                }
            }
        }
    
        return 1;
    }

    - - - Updated - - -

    I don't think "MakeNewOption" even work... at least not with box drop
    Last edited by allexander; 15-08-19 at 10:07 PM.

  10. #10
    0x4D696E68 myheart is offline
    MemberRank
    Jun 2017 Join Date
    356Posts

    Re: [Help] How to remove an excellent option (X-Team sources)

    Quote Originally Posted by allexander View Post
    Still not working:I don't think "MakeNewOption" even work... at least not with box drop
    box drop: ItemBag.cpp - CItemBag::GetItemNewOption



Advertisement