From be1ca945c77ea05b4e38b51e9e5ecb5ab1269323 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 28 May 2017 19:55:25 +0100 Subject: [PATCH] Core/Player: Fixed gem activation requirements Not sure if the structure is totally correct, but it can now properly read all the data we actually use --- src/server/game/DataStores/DBCStructure.h | 16 ++++++++++------ src/server/game/DataStores/DBCfmt.h | 2 +- src/server/game/Entities/Player/Player.cpp | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 5388b7a938..37f51aae52 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -2250,12 +2250,16 @@ struct SpellItemEnchantmentEntry struct SpellItemEnchantmentConditionEntry { uint32 ID; // 0 m_ID - uint8 Color[5]; // 1-5 m_lt_operandType[5] - //uint32 LT_Operand[5]; // 6-10 m_lt_operand[5] - uint8 Comparator[5]; // 11-15 m_operator[5] - uint8 CompareColor[5]; // 15-20 m_rt_operandType[5] - uint32 Value[5]; // 21-25 m_rt_operand[5] - //uint8 Logic[5] // 25-30 m_logic[5] + uint8 Color[3]; // 1-3 m_lt_operandType[5] + //uint8 unk1; // 4 + //uint32 unk2[6]; // 5-10 + uint8 Comparator[3]; // 11-13 m_operator[5] + //uint8 unk3[2]; // 14-15 + uint8 CompareColor[3]; // 16-18 m_rt_operandType[5] + //uint32 unk4; // 19 + uint32 Value[3]; // 20-22 m_rt_operand[5] + //uint32 unk5[2]; // 23-24 + //uint8 unk6[6]; // 25-30 }; struct StableSlotPricesEntry diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 5d0b31b18e..0ecc414c8d 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -148,7 +148,7 @@ const std::string CustomSpellEntryfmt = "ppppppppppppppapaaaaaaaaapaaaaaapapppaa const std::string CustomSpellEntryIndex = "Id"; char const SpellFocusObjectfmt[] = "nx"; char const SpellItemEnchantmentfmt[] = "nxiiiiiixxxiiisiiiiiiix"; -char const SpellItemEnchantmentConditionfmt[] = "nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX"; +char const SpellItemEnchantmentConditionfmt[] = "nbbbXxxxxxxbbbXXbbbxiiixxXXXXXX"; char const SpellRadiusfmt[] = "nfff"; char const SpellRangefmt[] = "nffffixx"; char const SpellReagentsEntryfmt[] = "diiiiiiiiiiiiiiii"; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 199b62f152..4a06a3b874 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -22435,7 +22435,7 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot) bool activate = true; - for (uint8 i = 0; i < 5; i++) + for (uint8 i = 0; i < 3; i++) { if (!Condition->Color[i]) continue;