mirror of
https://github.com/brues-code/nampower.git
synced 2026-10-10 07:30:01 +00:00
add nice error msg if they don't have disenchant
This commit is contained in:
+3027
-3026
File diff suppressed because it is too large
Load Diff
@@ -691,6 +691,22 @@ namespace Nampower {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Check if player has Disenchant spell (13262)
|
||||
constexpr uint32_t DISENCHANT_SPELL_ID = 13262;
|
||||
bool hasDisenchant = false;
|
||||
for (uint32_t slot = 0; slot < 1024; slot++) {
|
||||
uint32_t spellId = *reinterpret_cast<uint32_t *>(static_cast<uint32_t>(Offsets::CGSpellBook_mKnownSpells) + slot * 4);
|
||||
if (spellId == DISENCHANT_SPELL_ID) {
|
||||
hasDisenchant = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasDisenchant) {
|
||||
lua_error(luaState, "You do not have the Disenchant spell");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Reset both modes
|
||||
gDisenchantItemId = 0;
|
||||
gDisenchantQuality = -1;
|
||||
|
||||
Reference in New Issue
Block a user