Last edited by allexander; 13-08-19 at 12:40 AM.
in ItemOptionRate.cpp -CItemOptionRate::MakeNewOption()
ItemIndex >=(6,0) && < (12,0) !!
1. removeCode: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%
2. replace with random optionCode: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; }
3.remove and replace with special option if not existCode:while (true) { if (count >= value || count >= MaxNewOption) { break; } int value = 1 << (GetLargeRand() % MaxNewOption); if (((*option) & value) == 0 && value != 1) { (*option) |= value; count++; } }
4. replace with special optionCode: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; } }
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.
Last edited by allexander; 14-08-19 at 03:15 AM.
Last edited by myheart; 15-08-19 at 07:50 AM.
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:
i made a minor change because i couldn't compile the source without it maybe that is the problem: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; }
Util.cpp
without that extra pair of round brackets i get this error:Code:void SetLargeRand() // OK { seed = std::mt19937(std::random_device()()); dist = std::uniform_int_distribution<int>(0,2147483647); }
About wings they are included in ItemIndex >= (6,0) && ItemIndex < (14,0) but if is safe to add them idividually than i will.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
Thank you.
Last edited by allexander; 15-08-19 at 03:30 AM.
two while loops??
this is badCode:if(ItemIndex >= (6,0) && ItemIndex < (14,0)) { }
---------------------------------------------------------------------------------------------------
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); }
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.
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.