aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/AI/CoreAI/UnitAI.cpp2
-rw-r--r--src/server/game/DataStores/DB2Stores.cpp22
-rw-r--r--src/server/game/DataStores/DB2Stores.h4
-rw-r--r--src/server/game/DataStores/DB2Structure.h47
-rw-r--r--src/server/game/DataStores/DB2fmt.h6
-rw-r--r--src/server/game/DataStores/DBCStores.cpp13
-rw-r--r--src/server/game/DataStores/DBCStores.h5
-rw-r--r--src/server/game/DataStores/DBCStructure.h244
-rw-r--r--src/server/game/DataStores/DBCfmt.h24
-rw-r--r--src/server/game/Entities/Item/Item.cpp20
-rw-r--r--src/server/game/Entities/Player/Player.cpp70
-rw-r--r--src/server/game/Entities/Unit/StatSystem.cpp2
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp22
-rw-r--r--src/server/game/Handlers/ItemHandler.cpp4
-rw-r--r--src/server/game/Server/Packets/CharacterPackets.cpp2
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp8
-rw-r--r--src/server/game/Spells/Spell.cpp10
-rw-r--r--src/server/game/Spells/SpellEffects.cpp2
-rw-r--r--src/server/game/Spells/SpellInfo.cpp57
-rw-r--r--src/server/game/Spells/SpellMgr.cpp9
-rw-r--r--src/server/scripts/Spells/spell_rogue.cpp10
21 files changed, 301 insertions, 282 deletions
diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp
index 90bd3e8627a..33772c2c165 100644
--- a/src/server/game/AI/CoreAI/UnitAI.cpp
+++ b/src/server/game/AI/CoreAI/UnitAI.cpp
@@ -296,7 +296,7 @@ bool SpellTargetSelector::operator()(Unit const* target) const
return false;
// copypasta from Spell::CheckRange
- uint32 range_type = _spellInfo->RangeEntry ? _spellInfo->RangeEntry->type : 0;
+ uint32 range_type = _spellInfo->RangeEntry ? _spellInfo->RangeEntry->Flags : 0;
float max_range = _caster->GetSpellMaxRangeForTarget(target, _spellInfo);
float min_range = _caster->GetSpellMinRangeForTarget(target, _spellInfo);
diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp
index 31f2df225fe..b56c68f7ac2 100644
--- a/src/server/game/DataStores/DB2Stores.cpp
+++ b/src/server/game/DataStores/DB2Stores.cpp
@@ -28,7 +28,11 @@ DB2Storage<ItemExtendedCostEntry> sItemExtendedCostStore(ItemExtendedCostEntryfm
DB2Storage<ItemSparseEntry> sItemSparseStore(ItemSparsefmt, &DB2Utilities::HasItemSparseEntry, &DB2Utilities::WriteItemSparseDbReply);
DB2Storage<KeyChainEntry> sKeyChainStore(KeyChainfmt);
DB2Storage<SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore(SpellAuraRestrictionsEntryfmt);
+DB2Storage<SpellClassOptionsEntry> sSpellClassOptionsStore(SpellClassOptionsEntryfmt);
DB2Storage<SpellMiscEntry> sSpellMiscStore(SpellMiscEntryfmt);
+DB2Storage<SpellPowerEntry> sSpellPowerStore(SpellPowerEntryfmt);
+DB2Storage<SpellReagentsEntry> sSpellReagentsStore(SpellReagentsEntryfmt);
+DB2Storage<SpellRuneCostEntry> sSpellRuneCostStore(SpellRuneCostEntryfmt);
typedef std::list<std::string> DB2StoreProblemList;
@@ -98,13 +102,17 @@ void LoadDB2Stores(std::string const& dataPath)
DB2StoreProblemList bad_db2_files;
uint32 availableDb2Locales = 0xFF;
- LoadDB2(availableDb2Locales, bad_db2_files, sItemStore, db2Path, "Item.db2");
- LoadDB2(availableDb2Locales, bad_db2_files, sItemCurrencyCostStore, db2Path, "ItemCurrencyCost.db2");
- LoadDB2(availableDb2Locales, bad_db2_files, sItemSparseStore, db2Path, "Item-sparse.db2");
- LoadDB2(availableDb2Locales, bad_db2_files, sItemExtendedCostStore, db2Path, "ItemExtendedCost.db2");
- LoadDB2(availableDb2Locales, bad_db2_files, sKeyChainStore, db2Path, "KeyChain.db2");
- LoadDB2(availableDb2Locales, bad_db2_files, sSpellAuraRestrictionsStore, db2Path, "SpellAuraRestrictions.db2");
- LoadDB2(availableDb2Locales, bad_db2_files, sSpellMiscStore, db2Path, "SpellMisc.db2");
+ LoadDB2(availableDb2Locales, bad_db2_files, sItemStore, db2Path, "Item.db2");
+ LoadDB2(availableDb2Locales, bad_db2_files, sItemCurrencyCostStore, db2Path, "ItemCurrencyCost.db2");
+ LoadDB2(availableDb2Locales, bad_db2_files, sItemSparseStore, db2Path, "Item-sparse.db2");
+ LoadDB2(availableDb2Locales, bad_db2_files, sItemExtendedCostStore, db2Path, "ItemExtendedCost.db2");
+ LoadDB2(availableDb2Locales, bad_db2_files, sKeyChainStore, db2Path, "KeyChain.db2");
+ LoadDB2(availableDb2Locales, bad_db2_files, sSpellAuraRestrictionsStore, db2Path, "SpellAuraRestrictions.db2");
+ LoadDB2(availableDb2Locales, bad_db2_files, sSpellClassOptionsStore, db2Path, "SpellClassOptions.db2");
+ LoadDB2(availableDb2Locales, bad_db2_files, sSpellMiscStore, db2Path, "SpellMisc.db2");
+ LoadDB2(availableDb2Locales, bad_db2_files, sSpellPowerStore, db2Path, "SpellPower.db2");
+ LoadDB2(availableDb2Locales, bad_db2_files, sSpellReagentsStore, db2Path, "SpellReagents.db2");
+ LoadDB2(availableDb2Locales, bad_db2_files, sSpellRuneCostStore, db2Path, "SpellRuneCost.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 93393e1cb82..0f8ce80bae5 100644
--- a/src/server/game/DataStores/DB2Stores.h
+++ b/src/server/game/DataStores/DB2Stores.h
@@ -28,7 +28,11 @@ extern DB2Storage<ItemExtendedCostEntry> sItemExtendedCostStore;
extern DB2Storage<ItemSparseEntry> sItemSparseStore;
extern DB2Storage<KeyChainEntry> sKeyChainStore;
extern DB2Storage<SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore;
+extern DB2Storage<SpellClassOptionsEntry> sSpellClassOptionsStore;
extern DB2Storage<SpellMiscEntry> sSpellMiscStore;
+extern DB2Storage<SpellPowerEntry> sSpellPowerStore;
+extern DB2Storage<SpellReagentsEntry> sSpellReagentsStore;
+extern DB2Storage<SpellRuneCostEntry> sSpellRuneCostStore;
void LoadDB2Stores(std::string const& dataPath);
diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h
index de75d30ba6b..02fcbc0898b 100644
--- a/src/server/game/DataStores/DB2Structure.h
+++ b/src/server/game/DataStores/DB2Structure.h
@@ -163,6 +163,14 @@ struct SpellAuraRestrictionsEntry
uint32 ExcludeTargetAuraSpell; // 8
};
+struct SpellClassOptionsEntry
+{
+ uint32 ID; // 0
+ uint32 ModalNextSpell; // 1
+ flag128 SpellClassMask; // 2
+ uint32 SpellClassSet; // 3
+};
+
struct SpellMiscEntry
{
uint32 ID; // 0
@@ -191,6 +199,45 @@ struct SpellMiscEntry
//float Unk; // 24
};
+struct SpellPowerEntry
+{
+ uint32 ID; // 0
+ uint32 SpellID; // 1
+ //uint32 Unk2; // 2
+ //uint32 Unk3; // 3
+ uint32 ManaCost; // 4
+ uint32 ManaCostPerLevel; // 5
+ uint32 ManaCostPerSecond; // 6
+ //uint32 Unk4; // 7 (All 0 except one spell: 22570)
+ //uint32 Unk5; // 8
+ //uint32 Unk6; // 9
+ float ManaCostPercentage; // 10
+ //float Unk7; // 11
+ //uint32 Unk8; // 12
+};
+
+#define MAX_SPELL_REAGENTS 8
+
+struct SpellReagentsEntry
+{
+ uint32 ID; // 0
+ int32 Reagent[MAX_SPELL_REAGENTS]; // 1-8
+ uint32 ReagentCount[MAX_SPELL_REAGENTS]; // 9-16
+ //uint32 Unk1; // 17
+ //uint32 Unk2; // 18
+};
+
+struct SpellRuneCostEntry
+{
+ uint32 ID; // 0
+ uint32 RuneCost[3]; // 1-3 (0=blood, 1=frost, 2=unholy)
+ //uint32 Unk; // 4 (All 0 except for 2 ids: 2510, 2748)
+ uint32 RunePowerGain; // 5
+
+ bool NoRuneCost() const { return RuneCost[0] == 0 && RuneCost[1] == 0 && RuneCost[2] == 0; }
+ bool NoRunicPowerGain() const { return RunePowerGain == 0; }
+};
+
// 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 480f150e746..e8bcde8985b 100644
--- a/src/server/game/DataStores/DB2fmt.h
+++ b/src/server/game/DataStores/DB2fmt.h
@@ -24,6 +24,10 @@ char const ItemSparsefmt[]="niiiffiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
char const ItemExtendedCostEntryfmt[]="nxxiiiiiiiiiiiixiiiiiiiiiiiiiii";
char const KeyChainfmt[]="nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
char const SpellAuraRestrictionsEntryfmt[] = "diiiiiiii";
-char const SpellMiscEntryfmt[] = "niiiiiiiiiiiiiiiiiiiiiif";
+char const SpellClassOptionsEntryfmt[] = "niiiiii";
+char const SpellMiscEntryfmt[] = "niiiiiiiiiiiiiiiiiiiiiix";
+char const SpellPowerEntryfmt[] = "nixxiiixxxfxx";
+char const SpellReagentsEntryfmt[] = "niiiiiiiiiiiiiiiixx";
+char const SpellRuneCostEntryfmt[] = "niiixi";
#endif
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index c6ff7d882a2..c48bf907d53 100644
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -194,15 +194,12 @@ SpellCategoryStore sSpellsByCategoryStore;
PetFamilySpellsStore sPetFamilySpellsStore;
-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 <SpellCastingRequirementsEntry> sSpellCastingRequirementsStore(SpellCastingRequirementsEntryfmt);
@@ -210,12 +207,10 @@ DBCStorage <SpellCastTimesEntry> sSpellCastTimesStore(SpellCastTimefmt);
DBCStorage <SpellCategoriesEntry> sSpellCategoriesStore(SpellCategoriesEntryfmt);
DBCStorage <SpellCategoryEntry> sSpellCategoryStore(SpellCategoryfmt);
DBCStorage <SpellEffectEntry> sSpellEffectStore(SpellEffectEntryfmt);
-DBCStorage <SpellDifficultyEntry> sSpellDifficultyStore(SpellDifficultyfmt);
DBCStorage <SpellDurationEntry> sSpellDurationStore(SpellDurationfmt);
DBCStorage <SpellFocusObjectEntry> sSpellFocusObjectStore(SpellFocusObjectfmt);
DBCStorage <SpellRadiusEntry> sSpellRadiusStore(SpellRadiusfmt);
DBCStorage <SpellRangeEntry> sSpellRangeStore(SpellRangefmt);
-DBCStorage <SpellRuneCostEntry> sSpellRuneCostStore(SpellRuneCostfmt);
DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore(SpellShapeshiftEntryfmt);
DBCStorage <SpellShapeshiftFormEntry> sSpellShapeshiftFormStore(SpellShapeshiftFormfmt);
DBCStorage <StableSlotPricesEntry> sStableSlotPricesStore(StableSlotPricesfmt);
@@ -548,28 +543,23 @@ void LoadDBCStores(const std::string& dataPath)
sSpellsByCategoryStore[category->Category].insert(i);
}
- LoadDBC(availableDbcLocales, bad_dbc_files, sSpellReagentsStore, dbcPath,"SpellReagents.dbc");//15595
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, 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
- LoadDBC(availableDbcLocales, bad_dbc_files, sSpellDifficultyStore, dbcPath, "SpellDifficulty.dbc", &CustomSpellDifficultyfmt, &CustomSpellDifficultyIndex);//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellDurationStore, dbcPath, "SpellDuration.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellFocusObjectStore, dbcPath, "SpellFocusObject.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellItemEnchantmentStore, dbcPath, "SpellItemEnchantment.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellItemEnchantmentConditionStore, dbcPath, "SpellItemEnchantmentCondition.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRadiusStore, dbcPath, "SpellRadius.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRangeStore, dbcPath, "SpellRange.dbc");//15595
- LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRuneCostStore, dbcPath, "SpellRuneCost.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellShapeshiftStore, dbcPath, "SpellShapeshift.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellShapeshiftFormStore, dbcPath, "SpellShapeshiftForm.dbc");//15595
//LoadDBC(availableDbcLocales, bad_dbc_files, sStableSlotPricesStore, dbcPath, "StableSlotPrices.dbc");
@@ -614,6 +604,7 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales, bad_dbc_files, sTalentStore, dbcPath, "Talent.dbc");//15595
// Create Spelldifficulty searcher
+ /* TODO: 6.x update to new spell diffs
for (uint32 i = 0; i < sSpellDifficultyStore.GetNumRows(); ++i)
{
SpellDifficultyEntry const* spellDiff = sSpellDifficultyStore.LookupEntry(i);
@@ -640,7 +631,7 @@ void LoadDBCStores(const std::string& dataPath)
for (uint32 x = 0; x < MAX_DIFFICULTY; ++x)
if (newEntry.SpellID[x])
sSpellMgr->SetSpellDifficultyId(uint32(newEntry.SpellID[x]), spellDiff->ID);
- }
+ }*/
// create talent spells set
for (unsigned int i = 0; i < sTalentStore.GetNumRows(); ++i)
diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h
index 912e456b200..3df92263a86 100644
--- a/src/server/game/DataStores/DBCStores.h
+++ b/src/server/game/DataStores/DBCStores.h
@@ -199,7 +199,6 @@ extern DBCStorage <SkillTiersEntry> sSkillTiersStore;
extern DBCStorage <SoundEntriesEntry> sSoundEntriesStore;
extern DBCStorage <SpellCastTimesEntry> sSpellCastTimesStore;
extern DBCStorage <SpellCategoryEntry> sSpellCategoryStore;
-extern DBCStorage <SpellDifficultyEntry> sSpellDifficultyStore;
extern DBCStorage <SpellDurationEntry> sSpellDurationStore;
extern DBCStorage <SpellFocusObjectEntry> sSpellFocusObjectStore;
extern DBCStorage <SpellItemEnchantmentEntry> sSpellItemEnchantmentStore;
@@ -208,21 +207,17 @@ extern SpellCategoryStore sSpellsByCategoryStore;
extern PetFamilySpellsStore sPetFamilySpellsStore;
extern DBCStorage <SpellRadiusEntry> sSpellRadiusStore;
extern DBCStorage <SpellRangeEntry> sSpellRangeStore;
-extern DBCStorage <SpellRuneCostEntry> sSpellRuneCostStore;
extern DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore;
extern DBCStorage <SpellShapeshiftFormEntry> sSpellShapeshiftFormStore;
extern DBCStorage <SpellEntry> sSpellStore;
extern DBCStorage <SpellAuraOptionsEntry> sSpellAuraOptionsStore;
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;
extern DBCStorage <SpellTotemsEntry> sSpellTotemsStore;
diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h
index 92c85928349..e8848fb8eaa 100644
--- a/src/server/game/DataStores/DBCStructure.h
+++ b/src/server/game/DataStores/DBCStructure.h
@@ -1821,7 +1821,6 @@ struct SpellEffectEntry
#define MAX_SPELL_EFFECTS 3
#define MAX_EFFECT_MASK 7
-#define MAX_SPELL_REAGENTS 8
// SpellAuraOptions.dbc
struct SpellAuraOptionsEntry
@@ -1892,8 +1891,8 @@ struct SpellEntry
struct SpellCategoriesEntry
{
//uint32 ID; // 0
- //uint32 SpellID; // 1
- //uint32 DifficultyID; // 2
+ uint32 SpellID; // 1
+ uint32 DifficultyID; // 2
uint32 Category; // 3
uint32 DefenseType; // 4
uint32 DispelType; // 5
@@ -1927,208 +1926,179 @@ struct SpellCategoryEntry
//uint32 ChargeRecoveryTime; // 5
};
-struct SpellDifficultyEntry
-{
- uint32 ID; // 0
- int32 SpellID[MAX_DIFFICULTY]; // 1-4 instance modes: 10N, 25N, 10H, 25H or Normal/Heroic if only 1-2 is set, if 3-4 is 0 then Mode-2
-};
-
struct SpellFocusObjectEntry
{
- uint32 ID; // 0
- //char* Name; // 1 m_name_lang
+ uint32 ID; // 0
+ //char* Name_lang; // 1
};
struct SpellRadiusEntry
{
- uint32 ID;
- float RadiusMin;
- float RadiusPerLevel;
- float RadiusMax;
+ uint32 ID; // 0
+ //float Radius; // 1
+ float RadiusMin; // 2
+ float RadiusPerLevel; // 3
+ float RadiusMax; // 4
};
struct SpellRangeEntry
{
- uint32 ID;
- float minRangeHostile;
- float minRangeFriend;
- float maxRangeHostile;
- float maxRangeFriend; //friend means unattackable unit here
- uint32 type;
- //char* Name; // 6-21 m_displayName_lang
- //char* ShortName; // 23-38 m_displayNameShort_lang
+ uint32 ID; // 0
+ float MinRangeHostile; // 1
+ float MinRangeFriend; // 2
+ float MaxRangeHostile; // 3
+ float MaxRangeFriend; // 4 friend means unattackable unit here
+ uint32 Flags; // 5
+ //char* DisplayName_lang; // 6
+ //char* DisplayNameShort_lang; // 7
};
// SpellEquippedItems.dbc
struct SpellEquippedItemsEntry
{
- //uint32 Id; // 0 m_ID
- int32 EquippedItemClass; // 70 m_equippedItemClass (value)
- int32 EquippedItemInventoryTypeMask; // 72 m_equippedItemInvTypes (mask)
- int32 EquippedItemSubClassMask; // 71 m_equippedItemSubclass (mask)
+ //uint32 ID; // 0
+ uint32 SpellID; // 1
+ uint32 DifficultyID; // 2
+ int32 EquippedItemClass; // 3 m_equippedItemClass (value)
+ int32 EquippedItemInventoryTypeMask; // 4 m_equippedItemInvTypes (mask)
+ int32 EquippedItemSubClassMask; // 5 m_equippedItemSubclass (mask)
};
// SpellCooldowns.dbc
struct SpellCooldownsEntry
{
- //uint32 Id; // 0 m_ID
- uint32 CategoryRecoveryTime; // 31 m_categoryRecoveryTime
- uint32 RecoveryTime; // 30 m_recoveryTime
- uint32 StartRecoveryTime; // 146 m_startRecoveryTime
-};
-
-// SpellClassOptions.dbc
-struct SpellClassOptionsEntry
-{
- //uint32 Id; // 0 m_ID
- //uint32 modalNextSpell; // 1 m_modalNextSpell not used
- flag128 SpellFamilyFlags; // 2-4
- uint32 SpellFamilyName; // 5 m_spellClassSet
- //char* Description; // 6 4.0.0
+ //uint32 ID; // 0
+ uint32 SpellID; // 1
+ uint32 DifficultyID; // 2
+ uint32 CategoryRecoveryTime; // 3
+ uint32 RecoveryTime; // 4
+ uint32 StartRecoveryTime; // 5
};
// SpellInterrupts.dbc
struct SpellInterruptsEntry
{
- //uint32 Id; // 0 m_ID
- uint32 AuraInterruptFlags; // 1 m_auraInterruptFlags
- //uint32 // 2 4.0.0
- uint32 ChannelInterruptFlags; // 3 m_channelInterruptFlags
- //uint32 // 4 4.0.0
- uint32 InterruptFlags; // 5 m_interruptFlags
+ //uint32 ID; // 0
+ uint32 SpellID; // 1
+ uint32 DifficultyID; // 2
+ uint32 AuraInterruptFlags[2]; // 3-4
+ uint32 ChannelInterruptFlags[2]; // 5-6
+ uint32 InterruptFlags; // 7
};
// SpellLevels.dbc
struct SpellLevelsEntry
{
- //uint32 Id; // 0 m_ID
- uint32 baseLevel; // 1 m_baseLevel
- uint32 maxLevel; // 2 m_maxLevel
- 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
- uint32 RuneCost[3]; // 1-3 (0=blood, 1=frost, 2=unholy)
- uint32 runePowerGain; // 4
-
- bool NoRuneCost() const { return RuneCost[0] == 0 && RuneCost[1] == 0 && RuneCost[2] == 0; }
- bool NoRunicPowerGain() const { return runePowerGain == 0; }
+ //uint32 ID; // 0
+ uint32 SpellID; // 1
+ uint32 DifficultyID; // 2
+ uint32 BaseLevel; // 3
+ uint32 MaxLevel; // 4
+ uint32 SpellLevel; // 5
};
#define MAX_SHAPESHIFT_SPELLS 8
struct SpellShapeshiftFormEntry
{
- uint32 ID; // 0
- //uint32 buttonPosition; // 1 unused
- //char* Name; // 2 unused
- uint32 flags1; // 3
- int32 creatureType; // 4 <=0 humanoid, other normal creature types
- //uint32 spellIcon; // 5 unused, related to next field
- uint32 attackSpeed; // 6
- // Models changed, 0 is main model, the rest 3 are unused.
- uint32 modelID_A; // 7 alliance modelid (0 means no model)
- uint32 modelID_H; // 8 horde modelid (but only for one form)
- //uint32 unk3; // 9 unused always 0
- //uint32 unk4; // 10 unused always 0
- uint32 stanceSpell[MAX_SHAPESHIFT_SPELLS]; // 11-18 spells which appear in the bar after shapeshifting
- //uint32 unk5; // 19
- //uint32 unk6; // 20
+ uint32 ID; // 0
+ //uint32 BonusActionBar; // 1
+ //char* Name_lang; // 2
+ uint32 Flags; // 3
+ int32 CreatureType; // 4 <=0 humanoid, other normal creature types
+ //uint32 AttackIconID; // 5 unused, related to next field
+ uint32 CombatRoundTime; // 6
+ uint32 CreatureDisplayID[4]; // 7-10 (0 - Alliance, 1 - Horde)
+ uint32 PresetSpellID[MAX_SHAPESHIFT_SPELLS]; // 11-18 spells which appear in the bar after shapeshifting
+ //uint32 MountTypeID; // 19
+ //uint32 ExitSoundEntriesID; // 20
};
// SpellShapeshift.dbc
struct SpellShapeshiftEntry
{
- uint32 Id; // 0 - m_ID
- uint32 StancesNot; // 3 - m_shapeshiftExclude
- // uint32 unk_320_2; // 2 - 3.2.0
- uint32 Stances; // 1 - m_shapeshiftMask
- // uint32 unk_320_3; // 4 - 3.2.0
- // uint32 StanceBarOrder; // 5 - m_stanceBarOrder not used
+ uint32 ID; // 0
+ uint32 ShapeshiftExclude[2]; // 1-2
+ uint32 ShapeshiftMask[2]; // 3-4
+ //uint32 StanceBarOrder; // 5
};
// SpellTargetRestrictions.dbc
struct SpellTargetRestrictionsEntry
{
- uint32 Id; // 0 m_ID
- uint32 MaxAffectedTargets; // 1 m_maxTargets
- uint32 MaxTargetLevel; // 2 m_maxTargetLevel
- uint32 TargetCreatureType; // 3 m_targetCreatureType
- uint32 Targets; // 4 m_targets
-};
-
-// SpellReagents.dbc
-struct SpellReagentsEntry
-{
- //uint32 Id; // 0 m_ID
- int32 Reagent[MAX_SPELL_REAGENTS]; // 54-61 m_reagent
- uint32 ReagentCount[MAX_SPELL_REAGENTS]; // 62-69 m_reagentCount
+ uint32 ID; // 0
+ uint32 SpellID; // 1
+ uint32 DifficultyID; // 2
+ float ConeAngle; // 3
+ float Width; // 4
+ uint32 MaxAffectedTargets; // 5
+ uint32 MaxTargetLevel; // 6
+ uint32 TargetCreatureType; // 7
+ uint32 Targets; // 8
};
// SpellScaling.dbc
struct SpellScalingEntry
{
- //uint32 Id; // 0 m_ID
- int32 CastTimeMin; // 1
- int32 CastTimeMax; // 2
- int32 CastTimeMaxLevel; // 3
- int32 ScalingClass; // 4 (index * 100) + charLevel - 1 => gtSpellScaling.dbc
- float Multiplier[3]; // 5-7
- float RandomMultiplier[3]; // 8-10
- float OtherMultiplier[3]; // 11-13
- float CoefBase; // 14 some coefficient, mostly 1.0f
- int32 CoefLevelBase; // 15 some level
+ uint32 ID; // 0
+ int32 CastTimeMin; // 1
+ int32 CastTimeMax; // 2
+ uint32 CastTimeMaxLevel; // 3
+ int32 ScalingClass; // 4
+ float NerfFactor; // 5
+ uint32 NerfMaxLevel; // 6
+ uint32 MaxScalingLevel; // 7
+ uint32 ScalesFromItemLevel; // 8
};
struct SpellDurationEntry
{
- uint32 ID;
- int32 Duration[3];
+ uint32 ID;
+ int32 Duration[3];
};
struct SpellItemEnchantmentEntry
{
- uint32 ID; // 0 m_ID
- //uint32 charges; // 1 m_charges
- uint32 type[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 2-4 m_effect[MAX_ITEM_ENCHANTMENT_EFFECTS]
- uint32 amount[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 5-7 m_effectPointsMin[MAX_ITEM_ENCHANTMENT_EFFECTS]
- //uint32 amount2[MAX_ITEM_ENCHANTMENT_EFFECTS] // 8-10 m_effectPointsMax[MAX_ITEM_ENCHANTMENT_EFFECTS]
- uint32 spellid[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 11-13 m_effectArg[MAX_ITEM_ENCHANTMENT_EFFECTS]
- char* description; // 14 m_name_lang
- uint32 aura_id; // 15 m_itemVisual
- uint32 slot; // 16 m_flags
- uint32 GemID; // 17 m_src_itemID
- uint32 EnchantmentCondition; // 18 m_condition_id
- uint32 requiredSkill; // 19 m_requiredSkillID
- uint32 requiredSkillValue; // 20 m_requiredSkillRank
- uint32 requiredLevel; // 21 new in 3.1
- // 22 new in 3.1
+ uint32 ID; // 0
+ uint32 Charges; // 1
+ uint32 Effect[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 2-4
+ uint32 EffectPointsMin[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 5-7
+ uint32 EffectSpellID[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 8-10
+ //char* Name_lang // 11
+ uint32 ItemVisual; // 12
+ uint32 Flags; // 13
+ uint32 SRCItemID; // 14
+ uint32 ConditionID; // 15
+ uint32 RequiredSkillID; // 16
+ uint32 RequiredSkillRank; // 17
+ uint32 MinLevel; // 18
+ uint32 MaxLevel; // 19
+ uint32 ItemLevel; // 20
+ int32 ScalingClass; // 21
+ int32 ScalingClassRestricted; // 22
+ float EffectScalingPoints[MAX_ITEM_ENCHANTMENT_EFFECTS];//23
};
struct SpellItemEnchantmentConditionEntry
{
- uint32 ID; // 0 m_ID
+ uint32 ID; // 0
+ uint8 LTOperandType[5]; // 1-2
+ //uint8 Padding[3]; // 1-2
+ uint32 LTOperand[5]; // 2-6
+ uint8 Operator[5]; // 7-8
+ uint8 RTOperandType[5]; // 8-9
+ //uint8 Padding[2]; // 9
+ uint32 RTOperand[5]; // 10-14
+ uint8 Logic[5]; // 15-16
+ //uint8 Padding[3]; // 16
+
+ /*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 Logic[5] // 25-30 m_logic[5]*/
};
struct StableSlotPricesEntry
diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h
index b54fed77efb..af091f80a55 100644
--- a/src/server/game/DataStores/DBCfmt.h
+++ b/src/server/game/DataStores/DBCfmt.h
@@ -126,11 +126,8 @@ char const SkillRaceClassInfofmt[] = "diiiixxi";
char const SkillTiersfmt[] = "niiiiiiiiiiiiiiii";
char const SoundEntriesfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
char const SpellCastTimefmt[] = "nixx";
-char const SpellCategoriesEntryfmt[] = "dxxiiiiiix";
+char const SpellCategoriesEntryfmt[] = "diiiiiiiix";
char const SpellCategoryfmt[] = "nixxxx";
-char const SpellDifficultyfmt[] = "niiii";
-const std::string CustomSpellDifficultyfmt = "ppppp";
-const std::string CustomSpellDifficultyIndex = "id";
char const SpellDurationfmt[] = "niii";
char const SpellEffectEntryfmt[] = "niifiiiffiiiiiifiifiiiiifiiiiif";
const std::string CustomSpellEffectEntryfmt = "ppppppppppppppappppppppppp";
@@ -139,23 +136,20 @@ char const SpellEntryfmt[] = "nixxxiiiiiiiiiiiiiiiiiii";
const std::string CustomSpellEntryfmt = "ppppppppppppppapaaaaaaaaapaaaaaapapppaapppaaapa";
const std::string CustomSpellEntryIndex = "Id";
char const SpellFocusObjectfmt[] = "nx";
-char const SpellItemEnchantmentfmt[] = "nxiiiiiixxxiiisiiiiiiix";
-char const SpellItemEnchantmentConditionfmt[] = "nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX";
-char const SpellRadiusfmt[] = "nfff";
+char const SpellItemEnchantmentfmt[] = "niiiiiiiiiixiiiiiiiiiiiiii";
+char const SpellItemEnchantmentConditionfmt[] = "nbbbbbXXXiiiiibbbbbbbbbbXXiiiiibbbbbXXX";
+char const SpellRadiusfmt[] = "nxfff";
char const SpellRangefmt[] = "nffffixx";
-char const SpellReagentsEntryfmt[] = "diiiiiiiiiiiiiiii";
-char const SpellScalingEntryfmt[] = "diiiiffffffffffi";
+char const SpellScalingEntryfmt[] = "niiiifiii";
char const SpellTotemsEntryfmt[] = "niiii";
-char const SpellTargetRestrictionsEntryfmt[] = "nxiiii";
+char const SpellTargetRestrictionsEntryfmt[] = "niiffiiii";
char const SpellPowerEntryfmt[] = "diiiiixf";
-char const SpellInterruptsEntryfmt[] = "dixixi";
-char const SpellEquippedItemsEntryfmt[] = "diii";
+char const SpellInterruptsEntryfmt[] = "diiiiiii";
+char const SpellEquippedItemsEntryfmt[] = "diiiii";
char const SpellAuraOptionsEntryfmt[] = "niiiiiiii";
char const SpellCastingRequirementsEntryfmt[] = "dixxixi";
-char const SpellClassOptionsEntryfmt[] = "dxiiiix";
-char const SpellCooldownsEntryfmt[] = "diii";
+char const SpellCooldownsEntryfmt[] = "diiiii";
char const SpellLevelsEntryfmt[] = "diii";
-char const SpellRuneCostfmt[] = "niiii";
char const SpellShapeshiftEntryfmt[] = "nixixx";
char const SpellShapeshiftFormfmt[] = "nxxiixiiixxiiiiiiiixx";
char const StableSlotPricesfmt[] = "ni";
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index c98ea4b2911..4b4874666fd 100644
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -773,7 +773,7 @@ bool Item::HasEnchantRequiredSkill(const Player* player) const
if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)))
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id))
- if (enchantEntry->requiredSkill && player->GetSkillValue(enchantEntry->requiredSkill) < enchantEntry->requiredSkillValue)
+ if (enchantEntry->RequiredSkillID && player->GetSkillValue(enchantEntry->RequiredSkillID) < enchantEntry->RequiredSkillRank)
return false;
}
@@ -792,8 +792,8 @@ uint32 Item::GetEnchantRequiredLevel() const
if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)))
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id))
- if (enchantEntry->requiredLevel > level)
- level = enchantEntry->requiredLevel;
+ if (enchantEntry->MinLevel > level)
+ level = enchantEntry->MinLevel;
}
return level;
@@ -809,7 +809,7 @@ bool Item::IsBoundByEnchant() const
if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)))
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id))
- if (enchantEntry->slot & ENCHANTMENT_CAN_SOULBOUND)
+ if (enchantEntry->Flags & ENCHANTMENT_CAN_SOULBOUND)
return true;
}
@@ -939,7 +939,7 @@ bool Item::GemsFitSockets() const
uint8 GemColor = 0;
- uint32 gemid = enchantEntry->GemID;
+ uint32 gemid = enchantEntry->SRCItemID;
if (gemid)
{
ItemTemplate const* gemProto = sObjectMgr->GetItemTemplate(gemid);
@@ -970,7 +970,7 @@ uint8 Item::GetGemCountWithID(uint32 GemID) const
if (!enchantEntry)
continue;
- if (GemID == enchantEntry->GemID)
+ if (GemID == enchantEntry->SRCItemID)
++count;
}
return count;
@@ -989,7 +989,7 @@ uint8 Item::GetGemCountWithLimitCategory(uint32 limitCategory) const
if (!enchantEntry)
continue;
- ItemTemplate const* gemProto = sObjectMgr->GetItemTemplate(enchantEntry->GemID);
+ ItemTemplate const* gemProto = sObjectMgr->GetItemTemplate(enchantEntry->SRCItemID);
if (!gemProto)
continue;
@@ -1495,7 +1495,7 @@ int32 Item::GetReforgableStat(ItemModType statType) const
for (uint32 e = PROP_ENCHANTMENT_SLOT_0; e <= PROP_ENCHANTMENT_SLOT_4; ++e)
if (SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(GetEnchantmentId(EnchantmentSlot(e))))
for (uint32 f = 0; f < MAX_ITEM_ENCHANTMENT_EFFECTS; ++f)
- if (enchant->type[f] == ITEM_ENCHANTMENT_TYPE_STAT && ItemModType(enchant->spellid[f]) == statType)
+ if (enchant->Effect[f] == ITEM_ENCHANTMENT_TYPE_STAT && ItemModType(enchant->EffectSpellID[f]) == statType)
for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k)
if (randomSuffix->Enchantment[k] == enchant->ID)
return int32((randomSuffix->AllocationPct[k] * GetItemSuffixFactor()) / 10000);
@@ -1509,10 +1509,10 @@ int32 Item::GetReforgableStat(ItemModType statType) const
for (uint32 e = PROP_ENCHANTMENT_SLOT_0; e <= PROP_ENCHANTMENT_SLOT_4; ++e)
if (SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(GetEnchantmentId(EnchantmentSlot(e))))
for (uint32 f = 0; f < MAX_ITEM_ENCHANTMENT_EFFECTS; ++f)
- if (enchant->type[f] == ITEM_ENCHANTMENT_TYPE_STAT && ItemModType(enchant->spellid[f]) == statType)
+ if (enchant->Effect[f] == ITEM_ENCHANTMENT_TYPE_STAT && ItemModType(enchant->EffectSpellID[f]) == statType)
for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k)
if (randomProp->Enchantment[k] == enchant->ID)
- return int32(enchant->amount[k]);
+ return int32(enchant->EffectPointsMin[k]);
}
return 0;
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 078fcfde1c9..106c8e82ead 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -8439,7 +8439,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s)
{
- if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
+ if (pEnchant->Effect[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
continue;
SpellEnchantProcEntry const* entry = sSpellMgr->GetSpellEnchantProcEvent(enchant_id);
@@ -8458,15 +8458,15 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
continue;
}
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]);
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->EffectSpellID[s]);
if (!spellInfo)
{
TC_LOG_ERROR("entities.player.items", "Player::CastItemCombatSpell(%s, name: %s, enchant: %i): unknown spell %i is cast, ignoring...",
- GetGUID().ToString().c_str(), GetName().c_str(), pEnchant->ID, pEnchant->spellid[s]);
+ GetGUID().ToString().c_str(), GetName().c_str(), pEnchant->ID, pEnchant->EffectSpellID[s]);
continue;
}
- float chance = pEnchant->amount[s] != 0 ? float(pEnchant->amount[s]) : GetWeaponProcChance();
+ float chance = pEnchant->EffectPointsMin[s] != 0 ? float(pEnchant->EffectPointsMin[s]) : GetWeaponProcChance();
if (entry)
{
@@ -8477,7 +8477,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
}
// Apply spell mods
- ApplySpellMod(pEnchant->spellid[s], SPELLMOD_CHANCE_OF_SUCCESS, chance);
+ ApplySpellMod(pEnchant->EffectSpellID[s], SPELLMOD_CHANCE_OF_SUCCESS, chance);
// Shiv has 100% chance to apply the poison
if (FindCurrentSpellBySpellId(5938) && e_slot == TEMP_ENCHANTMENT_SLOT)
@@ -8563,13 +8563,13 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
continue;
for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s)
{
- if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_USE_SPELL)
+ if (pEnchant->Effect[s] != ITEM_ENCHANTMENT_TYPE_USE_SPELL)
continue;
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]);
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->EffectSpellID[s]);
if (!spellInfo)
{
- TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]);
+ TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->EffectSpellID[s]);
continue;
}
@@ -13700,17 +13700,17 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
if (!pEnchant)
return;
- if (!ignore_condition && pEnchant->EnchantmentCondition && !EnchantmentFitsRequirements(pEnchant->EnchantmentCondition, -1))
+ if (!ignore_condition && pEnchant->ConditionID && !EnchantmentFitsRequirements(pEnchant->ConditionID, -1))
return;
- if (pEnchant->requiredLevel > getLevel())
+ if (pEnchant->MinLevel > getLevel())
return;
- if (pEnchant->requiredSkill > 0 && pEnchant->requiredSkillValue > GetSkillValue(pEnchant->requiredSkill))
+ if (pEnchant->RequiredSkillID > 0 && pEnchant->RequiredSkillRank > GetSkillValue(pEnchant->RequiredSkillID))
return;
// Cogwheel gems dont have requirement data set in SpellItemEnchantment.dbc, but they do have it in Item-sparse.db2
- if (ItemTemplate const* gem = sObjectMgr->GetItemTemplate(pEnchant->GemID))
+ if (ItemTemplate const* gem = sObjectMgr->GetItemTemplate(pEnchant->SRCItemID))
if (gem->RequiredSkill && GetSkillValue(gem->RequiredSkill) < gem->RequiredSkillRank)
return;
@@ -13720,18 +13720,18 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
&& !item->GetTemplate()->Socket[slot-SOCK_ENCHANTMENT_SLOT].Color)
{
// Check if the requirements for the prismatic socket are met before applying the gem stats
- SpellItemEnchantmentEntry const* pPrismaticEnchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT));
- if (!pPrismaticEnchant || (pPrismaticEnchant->requiredSkill > 0 && pPrismaticEnchant->requiredSkillValue > GetSkillValue(pPrismaticEnchant->requiredSkill)))
- return;
+ SpellItemEnchantmentEntry const* pPrismaticEnchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT));
+ if (!pPrismaticEnchant || (pPrismaticEnchant->RequiredSkillID > 0 && pPrismaticEnchant->RequiredSkillRank > GetSkillValue(pPrismaticEnchant->RequiredSkillID)))
+ return;
}
if (!item->IsBroken())
{
for (int s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s)
{
- uint32 enchant_display_type = pEnchant->type[s];
- uint32 enchant_amount = pEnchant->amount[s];
- uint32 enchant_spell_id = pEnchant->spellid[s];
+ uint32 enchant_display_type = pEnchant->Effect[s];
+ uint32 enchant_amount = pEnchant->EffectPointsMin[s];
+ uint32 enchant_spell_id = pEnchant->EffectSpellID[s];
switch (enchant_display_type)
{
@@ -14075,12 +14075,12 @@ void Player::UpdateSkillEnchantments(uint16 skill_id, uint16 curr_value, uint16
if (!Enchant)
return;
- if (Enchant->requiredSkill == skill_id)
+ if (Enchant->RequiredSkillID == skill_id)
{
// Checks if the enchantment needs to be applied or removed
- if (curr_value < Enchant->requiredSkillValue && new_value >= Enchant->requiredSkillValue)
+ if (curr_value < Enchant->RequiredSkillRank && new_value >= Enchant->RequiredSkillRank)
ApplyEnchantment(m_items[i], EnchantmentSlot(slot), true);
- else if (new_value < Enchant->requiredSkillValue && curr_value >= Enchant->requiredSkillValue)
+ else if (new_value < Enchant->RequiredSkillRank && curr_value >= Enchant->RequiredSkillRank)
ApplyEnchantment(m_items[i], EnchantmentSlot(slot), false);
}
@@ -14091,11 +14091,11 @@ void Player::UpdateSkillEnchantments(uint16 skill_id, uint16 curr_value, uint16
{
SpellItemEnchantmentEntry const* pPrismaticEnchant = sSpellItemEnchantmentStore.LookupEntry(m_items[i]->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT));
- if (pPrismaticEnchant && pPrismaticEnchant->requiredSkill == skill_id)
+ if (pPrismaticEnchant && pPrismaticEnchant->RequiredSkillID == skill_id)
{
- if (curr_value < pPrismaticEnchant->requiredSkillValue && new_value >= pPrismaticEnchant->requiredSkillValue)
+ if (curr_value < pPrismaticEnchant->RequiredSkillRank && new_value >= pPrismaticEnchant->RequiredSkillRank)
ApplyEnchantment(m_items[i], EnchantmentSlot(slot), true);
- else if (new_value < pPrismaticEnchant->requiredSkillValue && curr_value >= pPrismaticEnchant->requiredSkillValue)
+ else if (new_value < pPrismaticEnchant->RequiredSkillRank && curr_value >= pPrismaticEnchant->RequiredSkillRank)
ApplyEnchantment(m_items[i], EnchantmentSlot(slot), false);
}
}
@@ -21590,10 +21590,10 @@ void Player::InitDataForForm(bool reapplyMods)
ShapeshiftForm form = GetShapeshiftForm();
SpellShapeshiftFormEntry const* ssEntry = sSpellShapeshiftFormStore.LookupEntry(form);
- if (ssEntry && ssEntry->attackSpeed)
+ if (ssEntry && ssEntry->CombatRoundTime)
{
- SetAttackTime(BASE_ATTACK, ssEntry->attackSpeed);
- SetAttackTime(OFF_ATTACK, ssEntry->attackSpeed);
+ SetAttackTime(BASE_ATTACK, ssEntry->CombatRoundTime);
+ SetAttackTime(OFF_ATTACK, ssEntry->CombatRoundTime);
SetAttackTime(RANGED_ATTACK, BASE_ATTACK_TIME);
}
else
@@ -22482,7 +22482,7 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot)
if (!enchantEntry)
continue;
- uint32 gemid = enchantEntry->GemID;
+ uint32 gemid = enchantEntry->SRCItemID;
if (!gemid)
continue;
@@ -22509,15 +22509,15 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot)
for (uint8 i = 0; i < 5; i++)
{
- if (!Condition->Color[i])
+ if (!Condition->LTOperandType[i])
continue;
- uint32 _cur_gem = curcount[Condition->Color[i] - 1];
+ uint32 _cur_gem = curcount[Condition->LTOperandType[i] - 1];
// if have <CompareColor> use them as count, else use <value> from Condition
- uint32 _cmp_gem = Condition->CompareColor[i] ? curcount[Condition->CompareColor[i] - 1]: Condition->Value[i];
+ uint32 _cmp_gem = Condition->RTOperandType[i] ? curcount[Condition->RTOperandType[i] - 1]: Condition->RTOperand[i];
- switch (Condition->Comparator[i])
+ switch (Condition->Operator[i])
{
case 2: // requires less <color> than (<value> || <comparecolor>) gems
activate &= (_cur_gem < _cmp_gem) ? true : false;
@@ -22560,7 +22560,7 @@ void Player::CorrectMetaGemEnchants(uint8 exceptslot, bool apply)
if (!enchantEntry)
continue;
- uint32 condition = enchantEntry->EnchantmentCondition;
+ uint32 condition = enchantEntry->ConditionID;
if (condition)
{
//was enchant active with/without item?
@@ -22604,7 +22604,7 @@ void Player::ToggleMetaGemsActive(uint8 exceptslot, bool apply)
continue;
//only metagems to be (de)activated, so only enchants with condition
- uint32 condition = enchantEntry->EnchantmentCondition;
+ uint32 condition = enchantEntry->ConditionID;
if (condition)
ApplyEnchantment(pItem, EnchantmentSlot(enchant_slot), apply);
}
@@ -25489,7 +25489,7 @@ InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limi
if (!enchantEntry)
continue;
- ItemTemplate const* pGem = sObjectMgr->GetItemTemplate(enchantEntry->GemID);
+ ItemTemplate const* pGem = sObjectMgr->GetItemTemplate(enchantEntry->SRCItemID);
if (!pGem)
continue;
diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp
index 53d4a01ac4c..b832292d89b 100644
--- a/src/server/game/Entities/Unit/StatSystem.cpp
+++ b/src/server/game/Entities/Unit/StatSystem.cpp
@@ -327,7 +327,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
SpellShapeshiftFormEntry const* form = sSpellShapeshiftFormStore.LookupEntry(GetShapeshiftForm());
// Directly taken from client, SHAPESHIFT_FLAG_AP_FROM_STRENGTH ?
- if (form && form->flags1 & 0x20)
+ if (form && form->Flags & 0x20)
agilityValue += std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->AttackPowerPerStrength, 0.0f);
val2 = strengthValue + agilityValue;
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index e2fd4d3b96b..0152b132370 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -6032,7 +6032,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
Item* addWeapon = player->GetWeaponForAttack(attType == BASE_ATTACK ? OFF_ATTACK : BASE_ATTACK, true);
uint32 enchant_id_add = addWeapon ? addWeapon->GetEnchantmentId(EnchantmentSlot(TEMP_ENCHANTMENT_SLOT)) : 0;
SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id_add);
- if (pEnchant && pEnchant->spellid[0] == dummySpell->Id)
+ if (pEnchant && pEnchant->EffectSpellID[0] == dummySpell->Id)
chance += 14;
if (!roll_chance_i(chance))
@@ -11398,7 +11398,7 @@ float Unit::GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spell
{
if (!spellInfo->RangeEntry)
return 0;
- if (spellInfo->RangeEntry->maxRangeFriend == spellInfo->RangeEntry->maxRangeHostile)
+ if (spellInfo->RangeEntry->MaxRangeFriend == spellInfo->RangeEntry->MaxRangeHostile)
return spellInfo->GetMaxRange();
if (target == NULL)
return spellInfo->GetMaxRange(true);
@@ -11409,7 +11409,7 @@ float Unit::GetSpellMinRangeForTarget(Unit const* target, SpellInfo const* spell
{
if (!spellInfo->RangeEntry)
return 0;
- if (spellInfo->RangeEntry->minRangeFriend == spellInfo->RangeEntry->minRangeHostile)
+ if (spellInfo->RangeEntry->MinRangeFriend == spellInfo->RangeEntry->MinRangeHostile)
return spellInfo->GetMinRange();
return spellInfo->GetMinRange(!IsHostileTo(target));
}
@@ -11420,8 +11420,8 @@ uint32 Unit::GetCreatureType() const
{
ShapeshiftForm form = GetShapeshiftForm();
SpellShapeshiftFormEntry const* ssEntry = sSpellShapeshiftFormStore.LookupEntry(form);
- if (ssEntry && ssEntry->creatureType > 0)
- return ssEntry->creatureType;
+ if (ssEntry && ssEntry->CreatureType > 0)
+ return ssEntry->CreatureType;
else
return CREATURE_TYPE_HUMANOID;
}
@@ -11454,7 +11454,7 @@ bool Unit::IsInDisallowedMountForm() const
if (!shapeshift)
return true;
- if (!(shapeshift->flags1 & 0x1))
+ if (!(shapeshift->Flags & 0x1))
return true;
}
@@ -15206,21 +15206,21 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form) const
uint32 modelid = 0;
SpellShapeshiftFormEntry const* formEntry = sSpellShapeshiftFormStore.LookupEntry(form);
- if (formEntry && formEntry->modelID_A)
+ if (formEntry && formEntry->CreatureDisplayID[0])
{
// Take the alliance modelid as default
if (GetTypeId() != TYPEID_PLAYER)
- return formEntry->modelID_A;
+ return formEntry->CreatureDisplayID[0];
else
{
if (Player::TeamForRace(getRace()) == ALLIANCE)
- modelid = formEntry->modelID_A;
+ modelid = formEntry->CreatureDisplayID[0];
else
- modelid = formEntry->modelID_H;
+ modelid = formEntry->CreatureDisplayID[1];
// If the player is horde but there are no values for the horde modelid - take the alliance modelid
if (!modelid && Player::TeamForRace(getRace()) == HORDE)
- modelid = formEntry->modelID_A;
+ modelid = formEntry->CreatureDisplayID[0];
}
}
diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp
index 87d17a8fc7c..f6566044278 100644
--- a/src/server/game/Handlers/ItemHandler.cpp
+++ b/src/server/game/Handlers/ItemHandler.cpp
@@ -1176,7 +1176,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData)
{
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(OldEnchants[j]))
{
- if (iGemProto->ItemId == enchantEntry->GemID)
+ if (iGemProto->ItemId == enchantEntry->SRCItemID)
{
_player->SendEquipError(EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED, itemTarget, NULL);
return;
@@ -1205,7 +1205,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData)
{
// existing gem
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(OldEnchants[j]))
- if (ItemTemplate const* jProto = sObjectMgr->GetItemTemplate(enchantEntry->GemID))
+ if (ItemTemplate const* jProto = sObjectMgr->GetItemTemplate(enchantEntry->SRCItemID))
if (iGemProto->ItemLimitCategory == jProto->ItemLimitCategory)
++limit_newcount;
}
diff --git a/src/server/game/Server/Packets/CharacterPackets.cpp b/src/server/game/Server/Packets/CharacterPackets.cpp
index 4b73b48aa76..17ccf4f4316 100644
--- a/src/server/game/Server/Packets/CharacterPackets.cpp
+++ b/src/server/game/Server/Packets/CharacterPackets.cpp
@@ -112,7 +112,7 @@ WorldPackets::Character::CharEnumResult::CharacterInfo::CharacterInfo(Field* fie
if (SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId))
{
- VisualItems[slot].DisplayEnchantId = enchant->aura_id;
+ VisualItems[slot].DisplayEnchantId = enchant->ItemVisual;
break;
}
}
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 88791cc2e77..4e31af725a9 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -502,7 +502,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
if (pEnchant)
{
for (int t = 0; t < MAX_ITEM_ENCHANTMENT_EFFECTS; t++)
- if (pEnchant->spellid[t] == m_spellInfo->Id)
+ if (pEnchant->EffectSpellID[t] == m_spellInfo->Id)
{
amount = uint32((item_rand_suffix->AllocationPct[k] * castItem->GetItemSuffixFactor()) / 10000);
break;
@@ -1902,12 +1902,12 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo
// Learn spells for shapeshift form - no need to send action bars or add spells to spellbook
for (uint8 i = 0; i < MAX_SHAPESHIFT_SPELLS; ++i)
{
- if (!shapeInfo->stanceSpell[i])
+ if (!shapeInfo->PresetSpellID[i])
continue;
if (apply)
- target->ToPlayer()->AddTemporarySpell(shapeInfo->stanceSpell[i]);
+ target->ToPlayer()->AddTemporarySpell(shapeInfo->PresetSpellID[i]);
else
- target->ToPlayer()->RemoveTemporarySpell(shapeInfo->stanceSpell[i]);
+ target->ToPlayer()->RemoveTemporarySpell(shapeInfo->PresetSpellID[i]);
}
}
}
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 75f6c7d86fa..3b9acb90d79 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -4546,7 +4546,7 @@ void Spell::TakeRunePower(bool didHit)
// you can gain some runic power when use runes
if (didHit)
- if (int32 rp = int32(runeCostData->runePowerGain * sWorld->getRate(RATE_POWER_RUNICPOWER_INCOME)))
+ if (int32 rp = int32(runeCostData->RunePowerGain * sWorld->getRate(RATE_POWER_RUNICPOWER_INCOME)))
player->ModifyPower(POWER_RUNIC_POWER, int32(rp));
}
@@ -5812,7 +5812,7 @@ SpellCastResult Spell::CheckRange(bool strict)
if (m_spellInfo->RangeEntry->ID == 1)
return SPELL_CAST_OK;
- range_type = m_spellInfo->RangeEntry->type;
+ range_type = m_spellInfo->RangeEntry->Flags;
}
Unit* target = m_targets.GetUnitTarget();
@@ -6132,7 +6132,7 @@ SpellCastResult Spell::CheckItems()
{
for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s)
{
- switch (enchantEntry->type[s])
+ switch (enchantEntry->Effect[s])
{
case ITEM_ENCHANTMENT_TYPE_USE_SPELL:
if (isItemUsable)
@@ -6158,7 +6158,7 @@ SpellCastResult Spell::CheckItems()
{
if (!enchantEntry)
return SPELL_FAILED_ERROR;
- if (enchantEntry->slot & ENCHANTMENT_CAN_SOULBOUND)
+ if (enchantEntry->Flags & ENCHANTMENT_CAN_SOULBOUND)
return SPELL_FAILED_NOT_TRADEABLE;
}
break;
@@ -6175,7 +6175,7 @@ SpellCastResult Spell::CheckItems()
SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
if (!pEnchant)
return SPELL_FAILED_ERROR;
- if (pEnchant->slot & ENCHANTMENT_CAN_SOULBOUND)
+ if (pEnchant->Flags & ENCHANTMENT_CAN_SOULBOUND)
return SPELL_FAILED_NOT_TRADEABLE;
}
break;
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index c441bd9b3f7..c383ba0d51f 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -2571,7 +2571,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex)
bool add_socket = false;
for (uint8 i = 0; i < MAX_ITEM_ENCHANTMENT_EFFECTS; ++i)
{
- if (enchant->type[i] == ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET)
+ if (enchant->Effect[i] == ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET)
{
add_socket = true;
break;
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index dcd3338e0c2..9fc99e431d3 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -367,9 +367,10 @@ SpellEffectInfo::SpellEffectInfo(SpellEntry const* /*spellEntry*/, SpellInfo con
TriggerSpell = _effect ? _effect->EffectTriggerSpell : 0;
SpellClassMask = _effect ? _effect->EffectSpellClassMask : flag128();
ImplicitTargetConditions = NULL;
- ScalingMultiplier = scaling ? scaling->Multiplier[_effIndex] : 0.0f;
- DeltaScalingMultiplier = scaling ? scaling->RandomMultiplier[_effIndex] : 0.0f;
- ComboScalingMultiplier = scaling ? scaling->OtherMultiplier[_effIndex] : 0.0f;
+ // TODO: 6.x these values are no longer in dbc
+ ScalingMultiplier = /*scaling ? scaling->Multiplier[_effIndex] :*/ 0.0f;
+ DeltaScalingMultiplier = /*scaling ? scaling->RandomMultiplier[_effIndex] :*/ 0.0f;
+ ComboScalingMultiplier = /*scaling ? scaling->OtherMultiplier[_effIndex] :*/ 0.0f;
}
bool SpellEffectInfo::IsEffect() const
@@ -925,8 +926,8 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
CastTimeMax = _scaling ?_scaling->CastTimeMax : 0;
CastTimeMaxLevel = _scaling ? _scaling->CastTimeMaxLevel : 0;
ScalingClass = _scaling ? _scaling->ScalingClass : 0;
- CoefBase = _scaling ? _scaling->CoefBase : 0;
- CoefLevelBase = _scaling ? _scaling->CoefLevelBase : 0;
+ CoefBase = _scaling ? _scaling->NerfFactor : 0;
+ CoefLevelBase = _scaling ? _scaling->NerfMaxLevel : 0;
// SpellAuraOptionsEntry
SpellAuraOptionsEntry const* _options = GetSpellAuraOptions();
@@ -955,16 +956,16 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
// SpellCategoriesEntry
SpellCategoriesEntry const* _categorie = GetSpellCategories();
CategoryEntry = _categorie ? sSpellCategoryStore.LookupEntry(_categorie->Category) : NULL;
- Dispel = _categorie ? _categorie->Dispel : 0;
+ Dispel = _categorie ? _categorie->DispelType : 0;
Mechanic = _categorie ? _categorie->Mechanic : 0;
StartRecoveryCategory = _categorie ? _categorie->StartRecoveryCategory : 0;
- DmgClass = _categorie ? _categorie->DmgClass : 0;
+ DmgClass = _categorie ? _categorie->DefenseType : 0;
PreventionType = _categorie ? _categorie->PreventionType : 0;
// SpellClassOptionsEntry
SpellClassOptionsEntry const* _class = GetSpellClassOptions();
- SpellFamilyName = _class ? _class->SpellFamilyName : 0;
- SpellFamilyFlags = _class ? _class->SpellFamilyFlags : flag96(0);
+ SpellFamilyName = _class ? _class->SpellClassSet : 0;
+ SpellFamilyFlags = _class ? _class->SpellClassMask : flag128(0);
// SpellCooldownsEntry
SpellCooldownsEntry const* _cooldowns = GetSpellCooldowns();
@@ -981,21 +982,22 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
// SpellInterruptsEntry
SpellInterruptsEntry const* _interrupt = GetSpellInterrupts();
InterruptFlags = _interrupt ? _interrupt->InterruptFlags : 0;
- AuraInterruptFlags = _interrupt ? _interrupt->AuraInterruptFlags : 0;
- ChannelInterruptFlags = _interrupt ? _interrupt->ChannelInterruptFlags : 0;
+ // TODO: 6.x these flags have 2 parts
+ AuraInterruptFlags = _interrupt ? _interrupt->AuraInterruptFlags[0] : 0;
+ ChannelInterruptFlags = _interrupt ? _interrupt->ChannelInterruptFlags[0] : 0;
// SpellLevelsEntry
SpellLevelsEntry const* _levels = GetSpellLevels();
- MaxLevel = _levels ? _levels->maxLevel : 0;
- BaseLevel = _levels ? _levels->baseLevel : 0;
- SpellLevel = _levels ? _levels->spellLevel : 0;
+ MaxLevel = _levels ? _levels->MaxLevel : 0;
+ BaseLevel = _levels ? _levels->BaseLevel : 0;
+ SpellLevel = _levels ? _levels->SpellLevel : 0;
// 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->ManaCostPerSecond : 0;
// SpellReagentsEntry
SpellReagentsEntry const* _reagents = GetSpellReagents();
@@ -1006,8 +1008,9 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
// SpellShapeshiftEntry
SpellShapeshiftEntry const* _shapeshift = GetSpellShapeshift();
- Stances = _shapeshift ? _shapeshift->Stances : 0;
- StancesNot = _shapeshift ? _shapeshift->StancesNot : 0;
+ // TODO: 6.x these maks have 2 parts
+ Stances = _shapeshift ? _shapeshift->ShapeshiftMask[0] : 0;
+ StancesNot = _shapeshift ? _shapeshift->ShapeshiftExclude[0] : 0;
// SpellTargetRestrictionsEntry
SpellTargetRestrictionsEntry const* _target = GetSpellTargetRestrictions();
@@ -1033,7 +1036,7 @@ SpellInfo::~SpellInfo()
uint32 SpellInfo::GetCategory() const
{
- return CategoryEntry ? CategoryEntry->Id : 0;
+ return CategoryEntry ? CategoryEntry->ID : 0;
}
bool SpellInfo::HasEffect(SpellEffects effect) const
@@ -1497,7 +1500,7 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const
TC_LOG_ERROR("spells", "GetErrorAtShapeshiftedCast: unknown shapeshift %u", form);
return SPELL_CAST_OK;
}
- actAsShifted = !(shapeInfo->flags1 & 1); // shapeshift acts as normal form for spells
+ actAsShifted = !(shapeInfo->Flags & 1); // shapeshift acts as normal form for spells
}
if (actAsShifted)
@@ -1517,7 +1520,7 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const
// Check if stance disables cast of not-stance spells
// Example: cannot cast any other spells in zombie or ghoul form
/// @todo Find a way to disable use of these spells clientside
- if (shapeInfo && shapeInfo->flags1 & 0x400)
+ if (shapeInfo && shapeInfo->Flags & 0x400)
{
if (!(stanceMask & Stances))
return SPELL_FAILED_ONLY_SHAPESHIFT;
@@ -1872,7 +1875,7 @@ SpellCastResult SpellInfo::CheckVehicle(Unit const* caster) const
if (Effects[effIndex].ApplyAuraName == SPELL_AURA_MOD_SHAPESHIFT)
{
SpellShapeshiftFormEntry const* shapeShiftFromEntry = sSpellShapeshiftFormStore.LookupEntry(Effects[effIndex].MiscValue);
- if (shapeShiftFromEntry && (shapeShiftFromEntry->flags1 & 1) == 0) // unk flag
+ if (shapeShiftFromEntry && (shapeShiftFromEntry->Flags & 1) == 0) // unk flag
checkMask |= VEHICLE_SEAT_FLAG_UNCONTROLLED;
break;
}
@@ -2245,8 +2248,8 @@ float SpellInfo::GetMinRange(bool positive) const
if (!RangeEntry)
return 0.0f;
if (positive)
- return RangeEntry->minRangeFriend;
- return RangeEntry->minRangeHostile;
+ return RangeEntry->MinRangeFriend;
+ return RangeEntry->MinRangeHostile;
}
float SpellInfo::GetMaxRange(bool positive, Unit* caster, Spell* spell) const
@@ -2255,9 +2258,9 @@ float SpellInfo::GetMaxRange(bool positive, Unit* caster, Spell* spell) const
return 0.0f;
float range;
if (positive)
- range = RangeEntry->maxRangeFriend;
+ range = RangeEntry->MaxRangeFriend;
else
- range = RangeEntry->maxRangeHostile;
+ range = RangeEntry->MaxRangeHostile;
if (caster)
if (Player* modOwner = caster->GetSpellModOwner())
modOwner->ApplySpellMod(Id, SPELLMOD_RANGE, range, spell);
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 6d2973b1644..cf25599cfaa 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -466,9 +466,10 @@ void SpellMgr::SetSpellDifficultyId(uint32 spellId, uint32 id)
mSpellDifficultySearcherMap[spellId] = id;
}
+// TODO: 6.x adapt to new spell diff system
uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) const
{
- if (!GetSpellInfo(spellId))
+ /*if (!GetSpellInfo(spellId))
return spellId;
if (!caster || !caster->GetMap() || !caster->GetMap()->IsDungeon())
@@ -506,6 +507,8 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con
TC_LOG_DEBUG("spells", "SpellMgr::GetSpellIdForDifficulty: spellid for spell %u in mode %u is %d", spellId, mode, difficultyEntry->SpellID[mode]);
return uint32(difficultyEntry->SpellID[mode]);
+ */
+ return 0;
}
SpellInfo const* SpellMgr::GetSpellForDifficultyFromSpell(SpellInfo const* spell, Unit const* caster) const
@@ -2951,10 +2954,10 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s)
{
- if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
+ if (enchant->Effect[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
continue;
- SpellInfo* procInfo = _GetSpellInfo(enchant->spellid[s]);
+ SpellInfo* procInfo = _GetSpellInfo(enchant->EffectSpellID[s]);
if (!procInfo)
continue;
diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp
index a8d5d8ce667..9b3b38875af 100644
--- a/src/server/scripts/Spells/spell_rogue.cpp
+++ b/src/server/scripts/Spells/spell_rogue.cpp
@@ -312,13 +312,13 @@ class spell_rog_deadly_poison : public SpellScriptLoader
for (uint8 s = 0; s < 3; ++s)
{
- if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
+ if (enchant->Effect[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
continue;
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->spellid[s]);
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->EffectSpellID[s]);
if (!spellInfo)
{
- TC_LOG_ERROR("spells", "Player::CastItemCombatSpell Enchant %i, player (Name: %s, %s) cast unknown spell %i", enchant->ID, player->GetName().c_str(), player->GetGUID().ToString().c_str(), enchant->spellid[s]);
+ TC_LOG_ERROR("spells", "Player::CastItemCombatSpell Enchant %i, player (Name: %s, %s) cast unknown spell %i", enchant->ID, player->GetName().c_str(), player->GetGUID().ToString().c_str(), enchant->EffectSpellID[s]);
continue;
}
@@ -331,9 +331,9 @@ class spell_rog_deadly_poison : public SpellScriptLoader
continue;
if (spellInfo->IsPositive())
- player->CastSpell(player, enchant->spellid[s], true, item);
+ player->CastSpell(player, enchant->EffectSpellID[s], true, item);
else
- player->CastSpell(target, enchant->spellid[s], true, item);
+ player->CastSpell(target, enchant->EffectSpellID[s], true, item);
}
}
}