mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01:00
Core/Spells: Fixed spell powers initialization
This commit is contained in:
@@ -39,6 +39,7 @@ DB2Storage<SpellCastingRequirementsEntry> sSpellCastingRequirementsStore(Spell
|
||||
DB2Storage<SpellClassOptionsEntry> sSpellClassOptionsStore(SpellClassOptionsEntryfmt);
|
||||
DB2Storage<SpellMiscEntry> sSpellMiscStore(SpellMiscEntryfmt);
|
||||
DB2Storage<SpellPowerEntry> sSpellPowerStore(SpellPowerEntryfmt);
|
||||
SpellPowerBySpellIDMap sSpellPowerBySpellIDStore;
|
||||
DB2Storage<SpellReagentsEntry> sSpellReagentsStore(SpellReagentsEntryfmt);
|
||||
DB2Storage<SpellRuneCostEntry> sSpellRuneCostStore(SpellRuneCostEntryfmt);
|
||||
DB2Storage<SpellTotemsEntry> sSpellTotemsStore(SpellTotemsEntryfmt);
|
||||
@@ -144,6 +145,10 @@ void LoadDB2Stores(std::string const& dataPath)
|
||||
LoadDB2(availableDb2Locales, bad_db2_files, sTaxiPathStore, db2Path, "TaxiPath.db2");
|
||||
LoadDB2(availableDb2Locales, bad_db2_files, sTaxiPathNodeStore, db2Path, "TaxiPathNode.db2");
|
||||
|
||||
for (uint32 i = 0; i < sSpellPowerStore.GetNumRows(); ++i)
|
||||
if (SpellPowerEntry const* power = sSpellPowerStore.LookupEntry(i))
|
||||
sSpellPowerBySpellIDStore[power->SpellID] = power;
|
||||
|
||||
for (uint32 i = 0; i < sPhaseGroupStore.GetNumRows(); ++i)
|
||||
if (PhaseGroupEntry const* group = sPhaseGroupStore.LookupEntry(i))
|
||||
if (PhaseEntry const* phase = sPhaseStore.LookupEntry(group->PhaseID))
|
||||
|
||||
@@ -39,6 +39,7 @@ extern DB2Storage<SpellCastingRequirementsEntry> sSpellCastingRequirementsStore;
|
||||
extern DB2Storage<SpellClassOptionsEntry> sSpellClassOptionsStore;
|
||||
extern DB2Storage<SpellMiscEntry> sSpellMiscStore;
|
||||
extern DB2Storage<SpellPowerEntry> sSpellPowerStore;
|
||||
extern SpellPowerBySpellIDMap sSpellPowerBySpellIDStore;
|
||||
extern DB2Storage<SpellReagentsEntry> sSpellReagentsStore;
|
||||
extern DB2Storage<SpellRuneCostEntry> sSpellRuneCostStore;
|
||||
extern DB2Storage<SpellTotemsEntry> sSpellTotemsStore;
|
||||
|
||||
@@ -354,6 +354,8 @@ struct TaxiPathNodeEntry
|
||||
|
||||
typedef std::map<uint32, uint32> ItemDisplayIDMap;
|
||||
|
||||
typedef std::map<uint32, SpellPowerEntry const*> SpellPowerBySpellIDMap;
|
||||
|
||||
struct TaxiPathBySourceAndDestination
|
||||
{
|
||||
TaxiPathBySourceAndDestination() : ID(0), price(0) { }
|
||||
|
||||
@@ -880,7 +880,6 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntryMap effects)
|
||||
SpellEquippedItemsId = spellEntry->EquippedItemsID;
|
||||
SpellInterruptsId = spellEntry->InterruptsID;
|
||||
SpellLevelsId = spellEntry->LevelsID;
|
||||
//SpellPowerId = spellEntry->PowerID;
|
||||
SpellReagentsId = spellEntry->ReagentsID;
|
||||
SpellShapeshiftId = spellEntry->ShapeshiftID;
|
||||
SpellTargetRestrictionsId = spellEntry->TargetRestrictionsID;
|
||||
@@ -2976,7 +2975,10 @@ SpellLevelsEntry const* SpellInfo::GetSpellLevels() const
|
||||
|
||||
SpellPowerEntry const* SpellInfo::GetSpellPower() const
|
||||
{
|
||||
return SpellPowerId ? sSpellPowerStore.LookupEntry(SpellPowerId) : NULL;
|
||||
auto itr = sSpellPowerBySpellIDStore.find(Id);
|
||||
if (itr != sSpellPowerBySpellIDStore.end())
|
||||
return itr->second;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SpellReagentsEntry const* SpellInfo::GetSpellReagents() const
|
||||
|
||||
@@ -404,7 +404,6 @@ public:
|
||||
uint32 SpellEquippedItemsId;
|
||||
uint32 SpellInterruptsId;
|
||||
uint32 SpellLevelsId;
|
||||
uint32 SpellPowerId;
|
||||
uint32 SpellReagentsId;
|
||||
uint32 SpellShapeshiftId;
|
||||
uint32 SpellTargetRestrictionsId;
|
||||
|
||||
Reference in New Issue
Block a user