Forum Moderator VegaS™ 10271 Posted October 10, 2019 Forum Moderator Share Posted October 10, 2019 (edited) CLICK FOR VIDEO Server\src\game\src\DragonSoul.h Spoiler //1.1) Search for: bool DragonSoulItemInitialize(LPITEM pItem); //1.2) Add after: bool HasActivedAllSlotsByPage(const LPCHARACTER ch, const BYTE bPageIndex = DRAGON_SOUL_DECK_0) const; Server\src\game\src\DragonSoul.cpp Spoiler //1.1) Search for: BYTE GetStrengthIdx(DWORD dwVnum) { return (dwVnum / 10) % 10; } //1.2) Add after: bool DSManager::HasActivedAllSlotsByPage(const LPCHARACTER ch, const uint8_t bPageIndex) const { if (!ch || bPageIndex >= DRAGON_SOUL_DECK_MAX_NUM) return false; const uint16_t iDragonSoulDeckAffectType = AFFECT_DRAGON_SOUL_DECK_0 + bPageIndex; // 540 + [0 or 1] if (!ch->FindAffect(iDragonSoulDeckAffectType)) return false; // start : 32 + ([0 or 1] * 6) = [32 or 38] // end : start + 6 const uint8_t iStartIndex = WEAR_MAX_NUM + (bPageIndex * DS_SLOT_MAX); const uint8_t iEndIndex = iStartIndex + DS_SLOT_MAX; uint8_t bSlotActive = 0; for (uint8_t bCell = iStartIndex; bCell < iEndIndex; ++bCell) // {0: 32-38, 1: 38-44} { const LPITEM pkItem = ch->GetWear(bCell); if (pkItem && pkItem->IsDragonSoul()) { if (IsTimeLeftDragonSoul(pkItem) && IsActiveDragonSoul(pkItem)) ++bSlotActive; } } return (bSlotActive == DS_SLOT_MAX); } How-To-How-To-How-To-Use-Ex: This is the hidden content, please Sign In or Sign Up Edited August 27, 2022 by Metin2 Dev Core X - External 2 Internal 31 7 27 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
Honorable Member xP3NG3Rx 19675 Posted October 10, 2019 Honorable Member Share Posted October 10, 2019 Why do you needed this? Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10271 Posted October 10, 2019 Author Forum Moderator Share Posted October 10, 2019 (edited) 5 minutes ago, xP3NG3Rx said: Why do you needed this? I posted the code some months ago and i thought is fine to be here too, not just in category of q&a. Edited August 21, 2022 by Metin2 Dev Core X - External 2 Internal 3 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
ManiacRobert 429 Posted October 10, 2019 Share Posted October 10, 2019 (edited) He means, on official server if you active a page with full mitic alchemy you will get a bonus from it, like the photo (screenshot from official). Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal 2 Link to comment Share on other sites More sharing options...
Honorable Member xP3NG3Rx 19675 Posted October 10, 2019 Honorable Member Share Posted October 10, 2019 Ahh I see now. Link to comment Share on other sites More sharing options...
Syriza 234 Posted October 10, 2019 Share Posted October 10, 2019 Aaaannd me again, Vegas always helping Link to comment Share on other sites More sharing options...
Tunga 10 Posted October 10, 2019 Share Posted October 10, 2019 thanks for release Link to comment Share on other sites More sharing options...
Active+ Member enisina 171 Posted October 11, 2019 Active+ Member Share Posted October 11, 2019 (edited) 22 hours ago, VegaS™ said: CLICK FOR VIDEO Server\src\game\src\DragonSoul.h Reveal hidden contents //1.1) Search for: bool DragonSoulItemInitialize(LPITEM pItem); //1.2) Add after: bool AreActivedAllSlotsDragonSoulByPage(const LPCHARACTER ch, const BYTE bPageIndex = DRAGON_SOUL_DECK_0) const; Server\src\game\src\DragonSoul.cpp Reveal hidden contents //1.1) Search for: BYTE GetStrengthIdx(DWORD dwVnum) { return (dwVnum / 10) % 10; } //1.2) Add after: bool DSManager::HasActivedAllSlotsByPage(const LPCHARACTER ch, const uint8_t bPageIndex) const { if (!ch || bPageIndex >= DRAGON_SOUL_DECK_MAX_NUM) return false; const uint16_t iDragonSoulDeckAffectType = AFFECT_DRAGON_SOUL_DECK_0 + bPageIndex; // 540 + [0 or 1] if (!ch->FindAffect(iDragonSoulDeckAffectType)) return false; // start : 32 + ([0 or 1] * 6) = [32 or 38] // end : start + 6 const uint8_t iStartIndex = WEAR_MAX_NUM + (bPageIndex * DS_SLOT_MAX); const uint8_t iEndIndex = iStartIndex + DS_SLOT_MAX; uint8_t bSlotActive = 0; for (uint8_t bCell = iStartIndex; bCell < iEndIndex; ++bCell) // {0: 32-38, 1: 38-44} { const LPITEM pkItem = ch->GetWear(bCell); if (pkItem && pkItem->IsDragonSoul()) { if (IsTimeLeftDragonSoul(pkItem) && IsActiveDragonSoul(pkItem)) ++bSlotActive; } } return (bSlotActive == DS_SLOT_MAX); } How-To-Use-Ex: Reveal hidden contents #include "DragonSoul.h" const DSManager & rkDSManager = DSManager::instance(); if (rkDSManager.HasActivedAllSlotsByPage(ch, DRAGON_SOUL_DECK_0)) { ch->ChatPacket(CHAT_TYPE_INFO, "DragonSoul: You've all of the dragon souls active in page 1."); // do something } if (rkDSManager.HasActivedAllSlotsByPage(ch, DRAGON_SOUL_DECK_1)) { ch->ChatPacket(CHAT_TYPE_INFO, "DragonSoul: You've all of the dragon souls active in page 2."); // do something } You are a genius! can i ask you for help? I don't know the c ++ language. can you write a function for this to work? item.GetDSSetWeight(dsType, grade) item.GetDSBasicApplyCount(dsType, grade) item.GetDSBasicApplyValue(dsType, type) item.GetDSAdditionalApplyValue(dsType, type) if app.ENABLE_DS_SET: def __AppendDragonSoulAttributeInformation(self, attrSlot, dsType = 0, grade = 0): if 0 != attrSlot: if grade != 0: setWeightValue = item.GetDSSetWeight(dsType, grade) basicApplyCount = item.GetDSBasicApplyCount(dsType, grade) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM): type = attrSlot[i][0] value = attrSlot[i][1] if 0 == value: continue affectString = self.__GetAffectString(type, value) if affectString: affectColor = self.__GetAttributeColor(i, value) setValue = 0 if i < basicApplyCount: setValue = item.GetDSBasicApplyValue(dsType, type) else: setValue = item.GetDSAdditionalApplyValue(dsType, type) if setValue != 0: setValue = (setValue * setWeightValue - 1)/100 + 1 if affectString.find('%') == -1: self.AppendTwoColorTextLine(affectString, affectColor, " (+%d)" % (setValue)) else: self.AppendTwoColorTextLine(affectString, affectColor, " (+%d%%)" % (setValue)) else: self.AppendTextLine(affectString, affectColor) else: for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM): type = attrSlot[i][0] value = attrSlot[i][1] if 0 == value: continue affectString = self.__GetAffectString(type, value) if affectString: affectColor = self.__GetAttributeColor(i, value) self.AppendTextLine(affectString, affectColor) Edited August 27, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Honorable Member Mali 41851 Posted October 15, 2019 Honorable Member Share Posted October 15, 2019 Thanks! For py usage: PythonPlayer.cpp: Spoiler bool CPythonPlayer::_IsDSPageFull(BYTE page) { if (page < 0 || page >= DS_DECK_MAX_NUM) return false; DWORD count = 0; DWORD startsize = c_DragonSoul_Equip_Start + c_DragonSoul_Equip_Slot_Max * page; const DWORD endsize = c_DragonSoul_Equip_Start + c_DragonSoul_Equip_Slot_Max * (page + 1); for (; startsize < endsize; ++startsize) if (GetItemIndex(TItemPos(INVENTORY, startsize))) count++; return count == c_DragonSoul_Equip_Slot_Max; } PythonPlayer.h: Spoiler //Find bool IsCantFightInstance(DWORD dwVID); ///Add bool _IsDSPageFull(BYTE page); PythonPlayerModule.cpp: Spoiler PyObject * playerIsDSPageFull(PyObject* poSelf, PyObject* poArgs) { int page; if (!PyTuple_GetInteger(poArgs, 0, &page)) return Py_BuildException(); return Py_BuildValue("i", CPythonPlayer::Instance()._IsDSPageFull(page)); } //Find { "GetName", playerGetName, METH_VARARGS }, ///Add { "IsDSPageFull", playerIsDSPageFull, METH_VARARGS }, Example: def TestDSFull(self): for i in xrange(player.DRAGON_SOUL_EQUIPMENT_PAGE_COUNT): if player.IsDSPageFull(i): chat.AppendChat(chat.CHAT_TYPE_INFO, "Page Full: %d" % i) else: chat.AppendChat(chat.CHAT_TYPE_INFO, "Page Not Full: %d" % i) 3 Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10271 Posted October 26, 2019 Author Forum Moderator Share Posted October 26, 2019 On 10/15/2019 at 1:30 PM, Mali61 said: PythonPlayer.cpp: bool CPythonPlayer::_IsDSPageFull(BYTE page) { if (page < 0 || page >= DS_DECK_MAX_NUM) return false; DWORD count = 0; DWORD startsize = c_DragonSoul_Equip_Start + c_DragonSoul_Equip_Slot_Max * page; const DWORD endsize = c_DragonSoul_Equip_Start + c_DragonSoul_Equip_Slot_Max * (page + 1); for (; startsize < endsize; ++startsize) if (GetItemIndex(TItemPos(INVENTORY, startsize))) count++; return count == c_DragonSoul_Equip_Slot_Max; } @Mali61 Good idea, but what i did doesn't work like this. You've to check each dragon soul from all pages if they aren't expired and the specific page is activated too. This is the hidden content, please Sign In or Sign Up 21 5 13 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
Recommended Posts