| 76 | } |
| 77 | |
| 78 | bool IsUniqueMonsterItemValid(uint16_t iCreateInfo, uint32_t dwBuff) |
| 79 | { |
| 80 | const uint8_t level = iCreateInfo & CF_LEVEL; |
| 81 | const bool isHellfireItem = (dwBuff & CF_HELLFIRE) != 0; |
| 82 | |
| 83 | // Check all unique monster levels to see if they match the item level |
| 84 | for (int i = 0; UniqueMonstersData[i].mName != nullptr; i++) { |
| 85 | const auto &uniqueMonsterData = UniqueMonstersData[i]; |
| 86 | const auto &uniqueMonsterLevel = static_cast<uint8_t>(MonstersData[uniqueMonsterData.mtype].level); |
| 87 | |
| 88 | if (IsAnyOf(uniqueMonsterData.mtype, MT_DEFILER, MT_NAKRUL, MT_HORKDMN)) { |
| 89 | // These monsters don't use their mlvl for item generation |
| 90 | continue; |
| 91 | } |
| 92 | |
| 93 | if (level == uniqueMonsterLevel) { |
| 94 | // If the ilvl matches the mlvl, we confirm the item is legitimate |
| 95 | return true; |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | return false; |
| 100 | } |
| 101 | |
| 102 | bool IsDungeonItemValid(uint16_t iCreateInfo, uint32_t dwBuff) |
| 103 | { |
no test coverage detected