aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRat <gmstreetrat@gmail.com>2014-11-10 11:28:34 +0100
committerRat <gmstreetrat@gmail.com>2014-11-10 11:28:34 +0100
commitb4a9f471238aeefcadab765fc8ec2ae4b1af79bd (patch)
tree3015750e8b73d627673d0eb49aaeb31522bfd989
parentae132dbf1128c1a65747af34265d8a32142604ac (diff)
Core/DataStores: Implemented loading of SpellMisc.db2, SpellClassOptions.db2, SpellPower.db2, SpellAuraRestrictions.db2, OverrideSpellData.db2 files
- Note: you will need the above files from 6.x - Implemented flag128 class, used for spellfamilymasks
-rw-r--r--sql/updates/world/2014_11_10_02_world.sql2
-rw-r--r--src/server/game/DataStores/DB2Stores.cpp12
-rw-r--r--src/server/game/DataStores/DB2Stores.h6
-rw-r--r--src/server/game/DataStores/DB2Structure.h80
-rw-r--r--src/server/game/DataStores/DB2fmt.h6
-rw-r--r--src/server/game/DataStores/DBCStores.cpp10
-rw-r--r--src/server/game/DataStores/DBCStores.h4
-rw-r--r--src/server/game/DataStores/DBCStructure.h47
-rw-r--r--src/server/game/DataStores/DBCfmt.h4
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp4
-rw-r--r--src/server/game/Spells/SpellInfo.cpp16
-rw-r--r--src/server/game/Spells/SpellInfo.h3
-rw-r--r--src/server/game/Spells/SpellMgr.cpp38
-rw-r--r--src/server/game/Spells/SpellMgr.h4
-rw-r--r--src/server/shared/Utilities/Util.h148
15 files changed, 288 insertions, 96 deletions
diff --git a/sql/updates/world/2014_11_10_02_world.sql b/sql/updates/world/2014_11_10_02_world.sql
new file mode 100644
index 00000000000..4b0fc4a4fe2
--- /dev/null
+++ b/sql/updates/world/2014_11_10_02_world.sql
@@ -0,0 +1,2 @@
+ALTER TABLE spell_proc_event ADD spellFamilyMask3 INT(10) UNSIGNED DEFAULT 0 NOT NULL AFTER spellFamilyMask2;
+ALTER TABLE spell_proc ADD spellFamilyMask3 INT(10) UNSIGNED DEFAULT 0 NOT NULL AFTER spellFamilyMask2;
diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp
index f1436dd90e3..e1f5792484a 100644
--- a/src/server/game/DataStores/DB2Stores.cpp
+++ b/src/server/game/DataStores/DB2Stores.cpp
@@ -28,6 +28,12 @@ DB2Storage<ItemExtendedCostEntry> sItemExtendedCostStore(ItemExtendedCostEntryfm
DB2Storage<ItemSparseEntry> sItemSparseStore(ItemSparsefmt, &DB2Utilities::HasItemSparseEntry, &DB2Utilities::WriteItemSparseDbReply);
DB2Storage<KeyChainEntry> sKeyChainStore(KeyChainfmt);
+DB2Storage<SpellMiscEntry> sSpellMiscStore(SpellMiscfmt);
+DB2Storage <SpellClassOptionsEntry> sSpellClassOptionsStore(SpellClassOptionsEntryfmt);
+DB2Storage <SpellPowerEntry> sSpellPowerStore(SpellPowerEntryfmt);
+DB2Storage <SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore(SpellAuraRestrictionsEntryfmt);
+DB2Storage <OverrideSpellDataEntry> sOverrideSpellDataStore(OverrideSpellDatafmt);
+
typedef std::list<std::string> DB2StoreProblemList;
typedef std::map<uint32 /*hash*/, DB2StorageBase*> DB2StorageMap;
@@ -102,6 +108,12 @@ void LoadDB2Stores(std::string const& dataPath)
LoadDB2(availableDb2Locales, bad_db2_files, sItemExtendedCostStore, db2Path, "ItemExtendedCost.db2");
LoadDB2(availableDb2Locales, bad_db2_files, sKeyChainStore, db2Path, "KeyChain.db2");
+ LoadDB2(availableDb2Locales, bad_db2_files, sSpellMiscStore, db2Path, "SpellMisc.db2");
+ LoadDB2(availableDb2Locales, bad_db2_files, sSpellClassOptionsStore, db2Path, "SpellClassOptions.db2");
+ LoadDB2(availableDb2Locales, bad_db2_files, sSpellPowerStore, db2Path, "SpellPower.db2");
+ LoadDB2(availableDb2Locales, bad_db2_files, sSpellAuraRestrictionsStore, db2Path, "SpellAuraRestrictions.db2");
+ LoadDB2(availableDb2Locales, bad_db2_files, sOverrideSpellDataStore, db2Path, "OverrideSpellData.db2");
+
// error checks
if (bad_db2_files.size() >= DB2FilesCount)
{
diff --git a/src/server/game/DataStores/DB2Stores.h b/src/server/game/DataStores/DB2Stores.h
index 17a92f98cde..037e364d891 100644
--- a/src/server/game/DataStores/DB2Stores.h
+++ b/src/server/game/DataStores/DB2Stores.h
@@ -28,6 +28,12 @@ extern DB2Storage<ItemExtendedCostEntry> sItemExtendedCostStore;
extern DB2Storage<ItemSparseEntry> sItemSparseStore;
extern DB2Storage<KeyChainEntry> sKeyChainStore;
+extern DB2Storage<SpellMiscEntry> sSpellMiscStore;
+extern DB2Storage <SpellClassOptionsEntry> sSpellClassOptionsStore;
+extern DB2Storage <SpellPowerEntry> sSpellPowerStore;
+extern DB2Storage <SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore;
+extern DB2Storage <OverrideSpellDataEntry> sOverrideSpellDataStore;
+
void LoadDB2Stores(std::string const& dataPath);
DB2StorageBase const* GetDB2Storage(uint32 type);
diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h
index 0a60d0b860f..078f3aea239 100644
--- a/src/server/game/DataStores/DB2Structure.h
+++ b/src/server/game/DataStores/DB2Structure.h
@@ -150,6 +150,86 @@ struct KeyChainEntry
uint8 Key[KEYCHAIN_SIZE];
};
+struct SpellMiscEntry
+{
+ //uint32 ID; // 0 m_ID
+ uint32 Attributes; // 1 m_attribute
+ uint32 AttributesEx; // 2 m_attributesEx
+ uint32 AttributesEx2; // 3 m_attributesExB
+ uint32 AttributesEx3; // 4 m_attributesExC
+ uint32 AttributesEx4; // 5 m_attributesExD
+ uint32 AttributesEx5; // 6 m_attributesExE
+ uint32 AttributesEx6; // 7 m_attributesExF
+ uint32 AttributesEx7; // 8 m_attributesExG
+ uint32 AttributesEx8; // 9 m_attributesExH
+ uint32 AttributesEx9; // 10 m_attributesExI
+ uint32 AttributesEx10; // 11 m_attributesExJ
+ uint32 AttributesEx11; // 12 m_attributesExK
+ uint32 AttributesEx12; // 13 m_attributesExL
+ uint32 AttributesEx13; // 14 m_attributesExL
+ uint32 CastingTimeIndex; // 15 m_castingTimeIndex
+ uint32 DurationIndex; // 16 m_durationIndex
+ uint32 RangeIndex; // 17 m_rangeIndex
+ float Speed; // 18 m_speed
+ uint32 SpellVisual[2]; // 19-20 m_spellVisualID
+ uint32 SpellIconID; // 21 m_spellIconID
+ uint32 ActiveIconID; // 22 m_activeIconID
+ uint32 SchoolMask; // 23 m_schoolMask
+ //float UnkWod; // 24
+};
+
+// SpellClassOptions.db2
+struct SpellClassOptionsEntry
+{
+ //uint32 ID; // 0 m_ID
+ //uint32 modalNextSpell; // 1 m_modalNextSpell
+ flag128 SpellFamilyFlags; // 2-5
+ uint32 SpellFamilyName; // 6 m_spellClassSet
+};
+
+// SpellPower.db2
+struct SpellPowerEntry
+{
+ //uint32 ID; // 0
+ uint32 PowerType; // 1
+ uint32 ManaCost; // 2
+ uint32 ManaCostPerlevel; // 3
+ uint32 ManaPerSecond; // 4
+ uint32 ManaPerSecondPerLevel; // 5
+ uint32 PowerDisplayId; // 6
+ float ManaCostPercentage; // 7
+ //float UnkMop1; // 8
+ uint32 RequiredAura; // 9
+ //float UnkMop2; // 10
+ //uint32 UnkWod1; // 11
+ //uint32 UnkWod2; // 12
+ //uint32 UnkWod3; // 13
+};
+
+// SpellAuraRestrictions.db2
+struct SpellAuraRestrictionsEntry
+{
+ //uint32 ID; // 0 m_ID
+ uint32 CasterAuraState; // 1 m_casterAuraState
+ uint32 TargetAuraState; // 2 m_targetAuraState
+ uint32 CasterAuraStateNot; // 3 m_excludeCasterAuraState
+ uint32 TargetAuraStateNot; // 4 m_excludeTargetAuraState
+ uint32 CasterAuraSpell; // 5 m_casterAuraSpell
+ uint32 TargetAuraSpell; // 6 m_targetAuraSpell
+ uint32 ExcludeCasterAuraSpell; // 7 m_excludeCasterAuraSpell
+ uint32 ExcludeTargetAuraSpell; // 8 m_excludeTargetAuraSpell
+};
+
+#define MAX_OVERRIDE_SPELL 10
+
+struct OverrideSpellDataEntry
+{
+ //uint32 id; // 0
+ uint32 SpellID[MAX_OVERRIDE_SPELL]; // 1-10
+ //uint32 Unk1; // 11
+ //int32 Unk2; // 12 SpellBarNameId?
+};
+
// GCC has alternative #pragma pack(N) syntax and old gcc version does not support pack(push, N), also any gcc version does not support it at some platform
#if defined(__GNUC__)
#pragma pack()
diff --git a/src/server/game/DataStores/DB2fmt.h b/src/server/game/DataStores/DB2fmt.h
index e2904aed51e..bb8eb680389 100644
--- a/src/server/game/DataStores/DB2fmt.h
+++ b/src/server/game/DataStores/DB2fmt.h
@@ -24,4 +24,10 @@ char const ItemSparsefmt[]="niiiffiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
char const ItemExtendedCostEntryfmt[]="nxxiiiiiiiiiiiixiiiiiiiiiiiiiii";
char const KeyChainfmt[]="nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
+char const SpellMiscfmt[] = "diiiiiiiiiiiiiiiiifiiiiix";
+char const SpellClassOptionsEntryfmt[] = "dxiiiii";
+char const SpellPowerEntryfmt[] = "diiiiiifxixxxx";
+char const SpellAuraRestrictionsEntryfmt[] = "diiiiiiii";
+char const OverrideSpellDatafmt[] = "diiiiiiiiiixx";
+
#endif
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index 69617deee5f..954e83ccce1 100644
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -168,8 +168,6 @@ DBCStorage <NameGenEntry> sNameGenStore(NameGenfmt);
NameGenContainer sGenerateNamesMap;
DBCStorage <NumTalentsAtLevelEntry> sNumTalentsAtLevelStore(NumTalentsAtLevelfmt);
-DBCStorage <OverrideSpellDataEntry> sOverrideSpellDataStore(OverrideSpellDatafmt);
-
DBCStorage <PowerDisplayEntry> sPowerDisplayStore(PowerDisplayfmt);
DBCStorage <PvPDifficultyEntry> sPvPDifficultyStore(PvPDifficultyfmt);
@@ -199,14 +197,11 @@ DBCStorage <SpellReagentsEntry> sSpellReagentsStore(SpellReagentsEntryfmt);
DBCStorage <SpellScalingEntry> sSpellScalingStore(SpellScalingEntryfmt);
DBCStorage <SpellTotemsEntry> sSpellTotemsStore(SpellTotemsEntryfmt);
DBCStorage <SpellTargetRestrictionsEntry> sSpellTargetRestrictionsStore(SpellTargetRestrictionsEntryfmt);
-DBCStorage <SpellPowerEntry> sSpellPowerStore(SpellPowerEntryfmt);
DBCStorage <SpellLevelsEntry> sSpellLevelsStore(SpellLevelsEntryfmt);
DBCStorage <SpellInterruptsEntry> sSpellInterruptsStore(SpellInterruptsEntryfmt);
DBCStorage <SpellEquippedItemsEntry> sSpellEquippedItemsStore(SpellEquippedItemsEntryfmt);
-DBCStorage <SpellClassOptionsEntry> sSpellClassOptionsStore(SpellClassOptionsEntryfmt);
DBCStorage <SpellCooldownsEntry> sSpellCooldownsStore(SpellCooldownsEntryfmt);
DBCStorage <SpellAuraOptionsEntry> sSpellAuraOptionsStore(SpellAuraOptionsEntryfmt);
-DBCStorage <SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore(SpellAuraRestrictionsEntryfmt);
DBCStorage <SpellCastingRequirementsEntry> sSpellCastingRequirementsStore(SpellCastingRequirementsEntryfmt);
DBCStorage <SpellCastTimesEntry> sSpellCastTimesStore(SpellCastTimefmt);
DBCStorage <SpellCategoriesEntry> sSpellCategoriesStore(SpellCategoriesEntryfmt);
@@ -499,8 +494,6 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales, bad_dbc_files, sMovieStore, dbcPath, "Movie.dbc");//15595
- LoadDBC(availableDbcLocales, bad_dbc_files, sOverrideSpellDataStore, dbcPath, "OverrideSpellData.dbc");//15595
-
LoadDBC(availableDbcLocales, bad_dbc_files, sPhaseStore, dbcPath, "Phase.dbc"); // 15595
LoadDBC(availableDbcLocales, bad_dbc_files, sPhaseGroupStore, dbcPath, "PhaseXPhaseGroup.dbc"); // 15595
@@ -553,14 +546,11 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellScalingStore, dbcPath,"SpellScaling.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellTotemsStore, dbcPath,"SpellTotems.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellTargetRestrictionsStore, dbcPath,"SpellTargetRestrictions.dbc");//15595
- LoadDBC(availableDbcLocales, bad_dbc_files, sSpellPowerStore, dbcPath,"SpellPower.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellLevelsStore, dbcPath,"SpellLevels.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellInterruptsStore, dbcPath,"SpellInterrupts.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellEquippedItemsStore, dbcPath,"SpellEquippedItems.dbc");//15595
- LoadDBC(availableDbcLocales, bad_dbc_files, sSpellClassOptionsStore, dbcPath,"SpellClassOptions.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCooldownsStore, dbcPath,"SpellCooldowns.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellAuraOptionsStore, dbcPath,"SpellAuraOptions.dbc");//15595
- LoadDBC(availableDbcLocales, bad_dbc_files, sSpellAuraRestrictionsStore, dbcPath,"SpellAuraRestrictions.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCastingRequirementsStore, dbcPath,"SpellCastingRequirements.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellEffectStore, dbcPath,"SpellEffect.dbc", &CustomSpellEffectEntryfmt, &CustomSpellEffectEntryIndex);//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCastTimesStore, dbcPath, "SpellCastTimes.dbc");//15595
diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h
index 994e830431e..ea0bfdad934 100644
--- a/src/server/game/DataStores/DBCStores.h
+++ b/src/server/game/DataStores/DBCStores.h
@@ -185,7 +185,6 @@ extern DBCStorage <PhaseGroupEntry> sPhaseGroupStore;
//extern DBCStorage <MapDifficultyEntry> sMapDifficultyStore; -- use GetMapDifficultyData insteed
extern MapDifficultyMap sMapDifficultyMap;
extern DBCStorage <MovieEntry> sMovieStore;
-extern DBCStorage <OverrideSpellDataEntry> sOverrideSpellDataStore;
extern DBCStorage <PowerDisplayEntry> sPowerDisplayStore;
extern DBCStorage <QuestSortEntry> sQuestSortStore;
extern DBCStorage <QuestXPEntry> sQuestXPStore;
@@ -213,16 +212,13 @@ extern DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore;
extern DBCStorage <SpellShapeshiftFormEntry> sSpellShapeshiftFormStore;
extern DBCStorage <SpellEntry> sSpellStore;
extern DBCStorage <SpellAuraOptionsEntry> sSpellAuraOptionsStore;
-extern DBCStorage <SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore;
extern DBCStorage <SpellCastingRequirementsEntry> sSpellCastingRequirementsStore;
extern DBCStorage <SpellCategoriesEntry> sSpellCategoriesStore;
-extern DBCStorage <SpellClassOptionsEntry> sSpellClassOptionsStore;
extern DBCStorage <SpellCooldownsEntry> sSpellCooldownsStore;
extern DBCStorage <SpellEffectEntry> sSpellEffectStore;
extern DBCStorage <SpellEquippedItemsEntry> sSpellEquippedItemsStore;
extern DBCStorage <SpellInterruptsEntry> sSpellInterruptsStore;
extern DBCStorage <SpellLevelsEntry> sSpellLevelsStore;
-extern DBCStorage <SpellPowerEntry> sSpellPowerStore;
extern DBCStorage <SpellReagentsEntry> sSpellReagentsStore;
extern DBCStorage <SpellScalingEntry> sSpellScalingStore;
extern DBCStorage <SpellTargetRestrictionsEntry> sSpellTargetRestrictionsStore;
diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h
index 8ac2af5d8ab..2f11e104731 100644
--- a/src/server/game/DataStores/DBCStructure.h
+++ b/src/server/game/DataStores/DBCStructure.h
@@ -1590,16 +1590,6 @@ struct NumTalentsAtLevelEntry
float Talents; // 1 talent count
};
-#define MAX_OVERRIDE_SPELL 10
-
-struct OverrideSpellDataEntry
-{
- uint32 id; // 0
- uint32 spellId[MAX_OVERRIDE_SPELL]; // 1-10
- //uint32 unk0; // 11
- //char* SpellBarName; // 12
-};
-
struct PowerDisplayEntry
{
uint32 Id; // 0
@@ -1796,20 +1786,6 @@ struct SpellAuraOptionsEntry
uint32 procFlags; // 4 m_procTypeMask
};
-// SpellAuraRestrictions.dbc/
-struct SpellAuraRestrictionsEntry
-{
- //uint32 Id; // 0 m_ID
- uint32 CasterAuraState; // 1 m_casterAuraState
- uint32 TargetAuraState; // 2 m_targetAuraState
- uint32 CasterAuraStateNot; // 3 m_excludeCasterAuraState
- uint32 TargetAuraStateNot; // 4 m_excludeTargetAuraState
- uint32 casterAuraSpell; // 5 m_casterAuraSpell
- uint32 targetAuraSpell; // 6 m_targetAuraSpell
- uint32 excludeCasterAuraSpell; // 7 m_excludeCasterAuraSpell
- uint32 excludeTargetAuraSpell; // 8 m_excludeTargetAuraSpell
-};
-
// SpellCastingRequirements.dbc
struct SpellCastingRequirementsEntry
{
@@ -1967,16 +1943,6 @@ struct SpellCooldownsEntry
uint32 StartRecoveryTime; // 146 m_startRecoveryTime
};
-// SpellClassOptions.dbc
-struct SpellClassOptionsEntry
-{
- //uint32 Id; // 0 m_ID
- //uint32 modalNextSpell; // 1 m_modalNextSpell not used
- flag96 SpellFamilyFlags; // 2-4
- uint32 SpellFamilyName; // 5 m_spellClassSet
- //char* Description; // 6 4.0.0
-};
-
// SpellInterrupts.dbc
struct SpellInterruptsEntry
{
@@ -1997,19 +1963,6 @@ struct SpellLevelsEntry
uint32 spellLevel; // 3 m_spellLevel
};
-// SpellPower.dbc
-struct SpellPowerEntry
-{
- //uint32 Id; // 0 m_ID
- uint32 manaCost; // 1 m_manaCost
- uint32 manaCostPerlevel; // 2 m_manaCostPerLevel
- uint32 ManaCostPercentage; // 3 m_manaCostPct
- uint32 manaPerSecond; // 4 m_manaPerSecond
- uint32 manaPerSecondPerLevel; // 5 m_manaPerSecondPerLevel
- //uint32 PowerDisplayId; // 6 m_powerDisplayID - id from PowerDisplay.dbc, new in 3.1
- float ManaCostPercentageFloat; // 7 4.3.0
-};
-
struct SpellRuneCostEntry
{
uint32 ID; // 0
diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h
index db6fd04d369..70e6a9f373f 100644
--- a/src/server/game/DataStores/DBCfmt.h
+++ b/src/server/game/DataStores/DBCfmt.h
@@ -111,7 +111,6 @@ char const MountCapabilityfmt[] = "niiiiiii";
char const MountTypefmt[] = "niiiiiiiiiiiiiiiiiiiiiiii";
char const NameGenfmt[] = "dsii";
char const NumTalentsAtLevelfmt[] = "df";
-char const OverrideSpellDatafmt[] = "niiiiiiiiiixx";
char const QuestFactionRewardfmt[] = "niiiiiiiiii";
char const QuestSortEntryfmt[] = "nx";
char const QuestXPfmt[] = "niiiiiiiiii";
@@ -149,13 +148,10 @@ char const SpellReagentsEntryfmt[] = "diiiiiiiiiiiiiiii";
char const SpellScalingEntryfmt[] = "diiiiffffffffffi";
char const SpellTotemsEntryfmt[] = "niiii";
char const SpellTargetRestrictionsEntryfmt[] = "nxiiii";
-char const SpellPowerEntryfmt[] = "diiiiixf";
char const SpellInterruptsEntryfmt[] = "dixixi";
char const SpellEquippedItemsEntryfmt[] = "diii";
char const SpellAuraOptionsEntryfmt[] = "niiii";
-char const SpellAuraRestrictionsEntryfmt[] = "diiiiiiii";
char const SpellCastingRequirementsEntryfmt[] = "dixxixi";
-char const SpellClassOptionsEntryfmt[] = "dxiiiix";
char const SpellCooldownsEntryfmt[] = "diii";
char const SpellLevelsEntryfmt[] = "diii";
char const SpellRuneCostfmt[] = "niiii";
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index cb7df6c2650..cde7326a424 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -5293,7 +5293,7 @@ void AuraEffect::HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 m
target->SetUInt16Value(PLAYER_FIELD_BYTES2, 0, overrideId);
if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
- if (uint32 spellId = overrideSpells->spellId[i])
+ if (uint32 spellId = overrideSpells->SpellID[i])
target->AddTemporarySpell(spellId);
}
else
@@ -5301,7 +5301,7 @@ void AuraEffect::HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 m
target->SetUInt16Value(PLAYER_FIELD_BYTES2, 0, 0);
if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
- if (uint32 spellId = overrideSpells->spellId[i])
+ if (uint32 spellId = overrideSpells->SpellID[i])
target->RemoveTemporarySpell(spellId);
}
}
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index a5804ffd648..cf517421907 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -934,10 +934,10 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
TargetAuraState = _aura ? _aura->TargetAuraState : 0;
CasterAuraStateNot = _aura ? _aura->CasterAuraStateNot : 0;
TargetAuraStateNot = _aura ? _aura->TargetAuraStateNot : 0;
- CasterAuraSpell = _aura ? _aura->casterAuraSpell : 0;
- TargetAuraSpell = _aura ? _aura->targetAuraSpell : 0;
- ExcludeCasterAuraSpell = _aura ? _aura->excludeCasterAuraSpell : 0;
- ExcludeTargetAuraSpell = _aura ? _aura->excludeTargetAuraSpell : 0;
+ CasterAuraSpell = _aura ? _aura->CasterAuraSpell : 0;
+ TargetAuraSpell = _aura ? _aura->TargetAuraSpell : 0;
+ ExcludeCasterAuraSpell = _aura ? _aura->ExcludeCasterAuraSpell : 0;
+ ExcludeTargetAuraSpell = _aura ? _aura->ExcludeTargetAuraSpell : 0;
// SpellCastingRequirementsEntry
SpellCastingRequirementsEntry const* _castreq = GetSpellCastingRequirements();
@@ -957,7 +957,7 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
// SpellClassOptionsEntry
SpellClassOptionsEntry const* _class = GetSpellClassOptions();
SpellFamilyName = _class ? _class->SpellFamilyName : 0;
- SpellFamilyFlags = _class ? _class->SpellFamilyFlags : flag96(0);
+ SpellFamilyFlags = _class ? _class->SpellFamilyFlags : flag128(0);
// SpellCooldownsEntry
SpellCooldownsEntry const* _cooldowns = GetSpellCooldowns();
@@ -985,10 +985,10 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
// SpellPowerEntry
SpellPowerEntry const* _power = GetSpellPower();
- ManaCost = _power ? _power->manaCost : 0;
- ManaCostPerlevel = _power ? _power->manaCostPerlevel : 0;
+ ManaCost = _power ? _power->ManaCost : 0;
+ ManaCostPerlevel = _power ? _power->ManaCostPerlevel : 0;
ManaCostPercentage = _power ? _power->ManaCostPercentage : 0;
- ManaPerSecond = _power ? _power->manaPerSecond : 0;
+ ManaPerSecond = _power ? _power->ManaPerSecond : 0;
// SpellReagentsEntry
SpellReagentsEntry const* _reagents = GetSpellReagents();
diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h
index ea29eb1b00f..336dab95702 100644
--- a/src/server/game/Spells/SpellInfo.h
+++ b/src/server/game/Spells/SpellInfo.h
@@ -21,6 +21,7 @@
#include "SharedDefines.h"
#include "Util.h"
#include "DBCStructure.h"
+#include "DB2Structure.h"
#include "Object.h"
#include "SpellAuraDefines.h"
@@ -370,7 +371,7 @@ public:
uint32 MaxTargetLevel;
uint32 MaxAffectedTargets;
uint32 SpellFamilyName;
- flag96 SpellFamilyFlags;
+ flag128 SpellFamilyFlags;
uint32 DmgClass;
uint32 PreventionType;
int32 AreaGroupId;
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 46fac6340a8..7a460c8190e 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -1893,8 +1893,8 @@ void SpellMgr::LoadSpellProcEvents()
mSpellProcEventMap.clear(); // need for reload case
- // 0 1 2 3 4 5 6 7 8 9 10
- QueryResult result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, procFlags, procEx, ppmRate, CustomChance, Cooldown FROM spell_proc_event");
+ // 0 1 2 3 4 5 6 7 8 9 10 11
+ QueryResult result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, SpellFamilyMask3, procFlags, procEx, ppmRate, CustomChance, Cooldown FROM spell_proc_event");
if (!result)
{
TC_LOG_INFO("server.loading", ">> Loaded 0 spell proc event conditions. DB table `spell_proc_event` is empty.");
@@ -1942,11 +1942,12 @@ void SpellMgr::LoadSpellProcEvents()
spellProcEvent.spellFamilyMask[0] = fields[3].GetUInt32();
spellProcEvent.spellFamilyMask[1] = fields[4].GetUInt32();
spellProcEvent.spellFamilyMask[2] = fields[5].GetUInt32();
- spellProcEvent.procFlags = fields[6].GetUInt32();
- spellProcEvent.procEx = fields[7].GetUInt32();
- spellProcEvent.ppmRate = fields[8].GetFloat();
- spellProcEvent.customChance = fields[9].GetFloat();
- spellProcEvent.cooldown = fields[10].GetUInt32();
+ spellProcEvent.spellFamilyMask[3] = fields[6].GetUInt32();
+ spellProcEvent.procFlags = fields[7].GetUInt32();
+ spellProcEvent.procEx = fields[8].GetUInt32();
+ spellProcEvent.ppmRate = fields[9].GetFloat();
+ spellProcEvent.customChance = fields[10].GetFloat();
+ spellProcEvent.cooldown = fields[11].GetUInt32();
while (spellInfo)
{
@@ -1980,8 +1981,8 @@ void SpellMgr::LoadSpellProcs()
mSpellProcMap.clear(); // need for reload case
- // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
- QueryResult result = WorldDatabase.Query("SELECT spellId, schoolMask, spellFamilyName, spellFamilyMask0, spellFamilyMask1, spellFamilyMask2, typeMask, spellTypeMask, spellPhaseMask, hitMask, attributesMask, ratePerMinute, chance, cooldown, charges FROM spell_proc");
+ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
+ QueryResult result = WorldDatabase.Query("SELECT spellId, schoolMask, spellFamilyName, spellFamilyMask0, spellFamilyMask1, spellFamilyMask2, spellFamilyMask3, typeMask, spellTypeMask, spellPhaseMask, hitMask, attributesMask, ratePerMinute, chance, cooldown, charges FROM spell_proc");
if (!result)
{
TC_LOG_INFO("server.loading", ">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty.");
@@ -2028,16 +2029,17 @@ void SpellMgr::LoadSpellProcs()
baseProcEntry.spellFamilyMask[0] = fields[3].GetUInt32();
baseProcEntry.spellFamilyMask[1] = fields[4].GetUInt32();
baseProcEntry.spellFamilyMask[2] = fields[5].GetUInt32();
- baseProcEntry.typeMask = fields[6].GetUInt32();
- baseProcEntry.spellTypeMask = fields[7].GetUInt32();
- baseProcEntry.spellPhaseMask = fields[8].GetUInt32();
- baseProcEntry.hitMask = fields[9].GetUInt32();
- baseProcEntry.attributesMask = fields[10].GetUInt32();
- baseProcEntry.ratePerMinute = fields[11].GetFloat();
- baseProcEntry.chance = fields[12].GetFloat();
- float cooldown = fields[13].GetFloat();
+ baseProcEntry.spellFamilyMask[3] = fields[6].GetUInt32();
+ baseProcEntry.typeMask = fields[7].GetUInt32();
+ baseProcEntry.spellTypeMask = fields[8].GetUInt32();
+ baseProcEntry.spellPhaseMask = fields[9].GetUInt32();
+ baseProcEntry.hitMask = fields[10].GetUInt32();
+ baseProcEntry.attributesMask = fields[11].GetUInt32();
+ baseProcEntry.ratePerMinute = fields[12].GetFloat();
+ baseProcEntry.chance = fields[13].GetFloat();
+ float cooldown = fields[14].GetFloat();
baseProcEntry.cooldown = uint32(cooldown);
- baseProcEntry.charges = fields[14].GetUInt32();
+ baseProcEntry.charges = fields[15].GetUInt32();
while (spellInfo)
{
diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h
index f2555820b92..ae8ae2446d6 100644
--- a/src/server/game/Spells/SpellMgr.h
+++ b/src/server/game/Spells/SpellMgr.h
@@ -276,7 +276,7 @@ struct SpellProcEventEntry
{
uint32 schoolMask; // if nonzero - bit mask for matching proc condition based on spell candidate's school: Fire=2, Mask=1<<(2-1)=2
uint32 spellFamilyName; // if nonzero - for matching proc condition based on candidate spell's SpellFamilyNamer value
- flag96 spellFamilyMask; // if nonzero - for matching proc condition based on candidate spell's SpellFamilyFlags (like auras 107 and 108 do)
+ flag128 spellFamilyMask; // if nonzero - for matching proc condition based on candidate spell's SpellFamilyFlags (like auras 107 and 108 do)
uint32 procFlags; // bitmask for matching proc event
uint32 procEx; // proc Extend info (see ProcFlagsEx)
float ppmRate; // for melee (ranged?) damage spells - proc rate per minute. if zero, falls back to flat chance from Spell.dbc
@@ -290,7 +290,7 @@ struct SpellProcEntry
{
uint32 schoolMask; // if nonzero - bitmask for matching proc condition based on spell's school
uint32 spellFamilyName; // if nonzero - for matching proc condition based on candidate spell's SpellFamilyName
- flag96 spellFamilyMask; // if nonzero - bitmask for matching proc condition based on candidate spell's SpellFamilyFlags
+ flag128 spellFamilyMask; // if nonzero - bitmask for matching proc condition based on candidate spell's SpellFamilyFlags
uint32 typeMask; // if nonzero - owerwrite procFlags field for given Spell.dbc entry, bitmask for matching proc condition, see enum ProcFlags
uint32 spellTypeMask; // if nonzero - bitmask for matching proc condition based on candidate spell's damage/heal effects, see enum ProcFlagsSpellType
uint32 spellPhaseMask; // if nonzero - bitmask for matching phase of a spellcast on which proc occurs, see enum ProcFlagsSpellPhase
diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h
index 216fe08d64a..57ac731f81a 100644
--- a/src/server/shared/Utilities/Util.h
+++ b/src/server/shared/Utilities/Util.h
@@ -521,6 +521,154 @@ public:
}
};
+class flag128
+{
+private:
+ uint32 part[4];
+
+public:
+ flag128(uint32 p1 = 0, uint32 p2 = 0, uint32 p3 = 0, uint32 p4 = 0)
+ {
+ part[0] = p1;
+ part[1] = p2;
+ part[2] = p3;
+ part[3] = p4;
+ }
+
+ flag128(uint64 p1, uint64 p2)
+ {
+ part[0] = (uint32)(p1 & UI64LIT(0x00000000FFFFFFFF));
+ part[1] = (uint32)((p1 >> 32) & UI64LIT(0x00000000FFFFFFFF));
+ part[0] = (uint32)(p2 & UI64LIT(0x00000000FFFFFFFF));
+ part[1] = (uint32)((p2 >> 32) & UI64LIT(0x00000000FFFFFFFF));
+ }
+
+ inline bool IsEqual(uint32 p1 = 0, uint32 p2 = 0, uint32 p3 = 0, uint32 p4 = 0) const
+ {
+ return (part[0] == p1 && part[1] == p2 && part[2] == p3 && part[3] == p4);
+ }
+
+ inline bool HasFlag(uint32 p1 = 0, uint32 p2 = 0, uint32 p3 = 0, uint32 p4 = 0) const
+ {
+ return (part[0] & p1 || part[1] & p2 || part[2] & p3 && part[3] & p4);
+ }
+
+ inline void Set(uint32 p1 = 0, uint32 p2 = 0, uint32 p3 = 0, uint32 p4 = 0)
+ {
+ part[0] = p1;
+ part[1] = p2;
+ part[2] = p3;
+ part[3] = p4;
+ }
+
+ inline bool operator <(const flag128 &right) const
+ {
+ for (uint8 i = 4; i > 0; --i)
+ {
+ if (part[i - 1] < right.part[i - 1])
+ return true;
+ else if (part[i - 1] > right.part[i - 1])
+ return false;
+ }
+ return false;
+ }
+
+ inline bool operator ==(const flag128 &right) const
+ {
+ return
+ (
+ part[0] == right.part[0] &&
+ part[1] == right.part[1] &&
+ part[2] == right.part[2] &&
+ part[3] == right.part[3]
+ );
+ }
+
+ inline bool operator !=(const flag128 &right) const
+ {
+ return !this->operator ==(right);
+ }
+
+ inline flag128 & operator =(const flag128 &right)
+ {
+ part[0] = right.part[0];
+ part[1] = right.part[1];
+ part[2] = right.part[2];
+ part[3] = right.part[3];
+ return *this;
+ }
+
+ inline flag128 operator &(const flag128 &right) const
+ {
+ return flag128(part[0] & right.part[0], part[1] & right.part[1],
+ part[2] & right.part[2], part[3] & right.part[3]);
+ }
+
+ inline flag128 & operator &=(const flag128 &right)
+ {
+ part[0] &= right.part[0];
+ part[1] &= right.part[1];
+ part[2] &= right.part[2];
+ part[3] &= right.part[3];
+ return *this;
+ }
+
+ inline flag128 operator |(const flag128 &right) const
+ {
+ return flag128(part[0] | right.part[0], part[1] | right.part[1],
+ part[2] | right.part[2], part[3] | right.part[3]);
+ }
+
+ inline flag128 & operator |=(const flag128 &right)
+ {
+ part[0] |= right.part[0];
+ part[1] |= right.part[1];
+ part[2] |= right.part[2];
+ part[3] |= right.part[3];
+ return *this;
+ }
+
+ inline flag128 operator ~() const
+ {
+ return flag128(~part[0], ~part[1], ~part[2], ~part[3]);
+ }
+
+ inline flag128 operator ^(const flag128 &right) const
+ {
+ return flag128(part[0] ^ right.part[0], part[1] ^ right.part[1],
+ part[2] ^ right.part[2], part[3] ^ right.part[3]);
+ }
+
+ inline flag128 & operator ^=(const flag128 &right)
+ {
+ part[0] ^= right.part[0];
+ part[1] ^= right.part[1];
+ part[2] ^= right.part[2];
+ part[3] ^= right.part[3];
+ return *this;
+ }
+
+ inline operator bool() const
+ {
+ return (part[0] != 0 || part[1] != 0 || part[2] != 0 || part[3] != 0);
+ }
+
+ inline bool operator !() const
+ {
+ return !this->operator bool();
+ }
+
+ inline uint32 & operator [](uint8 el)
+ {
+ return part[el];
+ }
+
+ inline const uint32 & operator [](uint8 el) const
+ {
+ return part[el];
+ }
+};
+
enum ComparisionType
{
COMP_TYPE_EQ = 0,