diff options
author | Intel <chemicstry@gmail.com> | 2014-11-09 23:53:48 +0200 |
---|---|---|
committer | Intel <chemicstry@gmail.com> | 2014-11-09 23:53:48 +0200 |
commit | f847f55385cd1babc67d701d49f180242c63e83e (patch) | |
tree | 60b5ca2094ee359cd297da3a1217959b9bad672c /src | |
parent | 2a4f56107f6e066211eebfe85ee70a9f5a9735fb (diff) |
Core/DataStores: Updating spells dbc part 1
Diffstat (limited to 'src')
25 files changed, 451 insertions, 277 deletions
diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp index f1436dd90e3..31f2df225fe 100644 --- a/src/server/game/DataStores/DB2Stores.cpp +++ b/src/server/game/DataStores/DB2Stores.cpp @@ -27,6 +27,8 @@ DB2Storage<ItemCurrencyCostEntry> sItemCurrencyCostStore(ItemCurrencyCostfmt); DB2Storage<ItemExtendedCostEntry> sItemExtendedCostStore(ItemExtendedCostEntryfmt); DB2Storage<ItemSparseEntry> sItemSparseStore(ItemSparsefmt, &DB2Utilities::HasItemSparseEntry, &DB2Utilities::WriteItemSparseDbReply); DB2Storage<KeyChainEntry> sKeyChainStore(KeyChainfmt); +DB2Storage<SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore(SpellAuraRestrictionsEntryfmt); +DB2Storage<SpellMiscEntry> sSpellMiscStore(SpellMiscEntryfmt); typedef std::list<std::string> DB2StoreProblemList; @@ -101,6 +103,8 @@ void LoadDB2Stores(std::string const& dataPath) 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"); // 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..93393e1cb82 100644 --- a/src/server/game/DataStores/DB2Stores.h +++ b/src/server/game/DataStores/DB2Stores.h @@ -27,6 +27,8 @@ extern DB2Storage<ItemCurrencyCostEntry> sItemCurrencyCostStore; extern DB2Storage<ItemExtendedCostEntry> sItemExtendedCostStore; extern DB2Storage<ItemSparseEntry> sItemSparseStore; extern DB2Storage<KeyChainEntry> sKeyChainStore; +extern DB2Storage<SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore; +extern DB2Storage<SpellMiscEntry> sSpellMiscStore; void LoadDB2Stores(std::string const& dataPath); diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index 0a60d0b860f..de75d30ba6b 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -150,6 +150,47 @@ struct KeyChainEntry uint8 Key[KEYCHAIN_SIZE]; }; +struct SpellAuraRestrictionsEntry +{ + //uint32 ID; // 0 + uint32 CasterAuraState; // 1 + uint32 TargetAuraState; // 2 + uint32 ExcludeCasterAuraState; // 3 + uint32 ExcludeTargetAuraState; // 4 + uint32 CasterAuraSpell; // 5 + uint32 TargetAuraSpell; // 6 + uint32 ExcludeCasterAuraSpell; // 7 + uint32 ExcludeTargetAuraSpell; // 8 +}; + +struct SpellMiscEntry +{ + uint32 ID; // 0 + uint32 Attributes; // 1 + uint32 AttributesEx; // 2 + uint32 AttributesExB; // 3 + uint32 AttributesExC; // 4 + uint32 AttributesExD; // 5 + uint32 AttributesExE; // 6 + uint32 AttributesExF; // 7 + uint32 AttributesExG; // 8 + uint32 AttributesExH; // 9 + uint32 AttributesExI; // 10 + uint32 AttributesExJ; // 11 + uint32 AttributesExK; // 12 + uint32 AttributesExL; // 13 + uint32 AttributesExM; // 14 + uint32 CastingTimeIndex; // 15 + uint32 DurationIndex; // 16 + uint32 RangeIndex; // 17 + uint32 Speed; // 18 + uint32 SpellVisualID[2]; // 19-20 + uint32 SpellIconID; // 21 + uint32 ActiveIconID; // 22 + uint32 SchoolMask; // 23 + //float Unk; // 24 +}; + // 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..480f150e746 100644 --- a/src/server/game/DataStores/DB2fmt.h +++ b/src/server/game/DataStores/DB2fmt.h @@ -23,5 +23,7 @@ char const ItemCurrencyCostfmt[]="xn"; char const ItemSparsefmt[]="niiiffiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiisssssiiiiiiiiiiiiiiiiiiiiiifiiifii"; char const ItemExtendedCostEntryfmt[]="nxxiiiiiiiiiiiixiiiiiiiiiiiiiii"; char const KeyChainfmt[]="nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"; +char const SpellAuraRestrictionsEntryfmt[] = "diiiiiiii"; +char const SpellMiscEntryfmt[] = "niiiiiiiiiiiiiiiiiiiiiif"; #endif diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 18965178656..c6ff7d882a2 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -205,7 +205,6 @@ DBCStorage <SpellEquippedItemsEntry> sSpellEquippedItemsStore(SpellEquippedItems 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); @@ -545,7 +544,7 @@ void LoadDBCStores(const std::string& dataPath) if (!spell) continue; - if (SpellCategoriesEntry const* category = sSpellCategoriesStore.LookupEntry(spell->SpellCategoriesId)) + if (SpellCategoriesEntry const* category = sSpellCategoriesStore.LookupEntry(spell->CategoriesID)) sSpellsByCategoryStore[category->Category].insert(i); } @@ -560,7 +559,6 @@ void LoadDBCStores(const std::string& dataPath) 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 @@ -578,6 +576,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sSummonPropertiesStore, dbcPath, "SummonProperties.dbc");//15595 // Must be done when sSkillLineAbilityStore, sSpellStore, sSpellLevelsStore and sCreatureFamilyStore are all loaded + /* TODO: Requires spells attributes from SpellMisc.db2 is loaded after dbc for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) { SkillLineAbilityEntry const* skillLine = sSkillLineAbilityStore.LookupEntry(j); @@ -588,8 +587,8 @@ void LoadDBCStores(const std::string& dataPath) if (!spellInfo) continue; - SpellLevelsEntry const* levels = sSpellLevelsStore.LookupEntry(spellInfo->SpellLevelsId); - if (spellInfo->SpellLevelsId && (!levels || levels->spellLevel)) + SpellLevelsEntry const* levels = sSpellLevelsStore.LookupEntry(spellInfo->SpellLevelsID); + if (spellInfo->SpellLevelsID && (!levels || levels->spellLevel)) continue; if (spellInfo && spellInfo->Attributes & SPELL_ATTR0_PASSIVE) @@ -606,10 +605,11 @@ void LoadDBCStores(const std::string& dataPath) if (skillLine->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) continue; - sPetFamilySpellsStore[i].insert(spellInfo->Id); + sPetFamilySpellsStore[i].insert(spellInfo->ID); } } } + */ LoadDBC(availableDbcLocales, bad_dbc_files, sTalentStore, dbcPath, "Talent.dbc");//15595 diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index d5868fb94d3..912e456b200 100644 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -213,7 +213,6 @@ 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; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 22bf5f20317..92c85928349 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1790,31 +1790,33 @@ struct SoundEntriesEntry // SpellEffect.dbc struct SpellEffectEntry { - uint32 Id; // 0 m_ID - uint32 Effect; // 1 m_effect - float EffectValueMultiplier; // 2 m_effectAmplitude - uint32 EffectApplyAuraName; // 3 m_effectAura - uint32 EffectAmplitude; // 4 m_effectAuraPeriod - int32 EffectBasePoints; // 5 m_effectBasePoints (don't must be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints) - float EffectBonusMultiplier; // 6 m_effectBonus - float EffectDamageMultiplier; // 7 m_effectChainAmplitude - uint32 EffectChainTarget; // 8 m_effectChainTargets - int32 EffectDieSides; // 9 m_effectDieSides - uint32 EffectItemType; // 10 m_effectItemType - uint32 EffectMechanic; // 11 m_effectMechanic - int32 EffectMiscValue; // 12 m_effectMiscValue - int32 EffectMiscValueB; // 13 m_effectMiscValueB - float EffectPointsPerComboPoint; // 14 m_effectPointsPerCombo - uint32 EffectRadiusIndex; // 15 m_effectRadiusIndex - spellradius.dbc - uint32 EffectRadiusMaxIndex; // 16 4.0.0 - float EffectRealPointsPerLevel; // 17 m_effectRealPointsPerLevel - flag96 EffectSpellClassMask; // 18 19 20 m_effectSpellClassMask1(2/3), effect 0 - uint32 EffectTriggerSpell; // 21 m_effectTriggerSpell - uint32 EffectImplicitTargetA; // 22 m_implicitTargetA - uint32 EffectImplicitTargetB; // 23 m_implicitTargetB - uint32 EffectSpellId; // 24 new 4.0.0 - uint32 EffectIndex; // 25 new 4.0.0 - //uint32 Unk0 // 26 4.2.0 only 0 or 1 + uint32 ID; // 0 + uint32 DifficultyID; // 1 + uint32 Effect; // 2 + float EffectAmplitude; // 3 + uint32 EffectAura; // 4 + uint32 EffectAuraPeriod; // 5 + uint32 EffectBasePoints; // 6 + float EffectBonusCoefficient; // 7 + float EffectChainAmplitude; // 8 + uint32 EffectChainTargets; // 9 + uint32 EffectDieSides; // 10 + uint32 EffectItemType; // 11 + uint32 EffectMechanic; // 12 + int32 EffectMiscValue; // 13 + int32 EffectMiscValueB; // 14 + float EffectPointsPerResource; // 15 + uint32 EffectRadiusIndex; // 16 + uint32 EffectRadiusMaxIndex; // 17 + float EffectRealPointsPerLevel; // 18 + flag128 EffectSpellClassMask; // 19-22 + uint32 EffectTriggerSpell; // 23 + float EffectPosFacing; // 24 + uint32 ImplicitTarget[2]; // 25-26 + uint32 SpellID; // 27 + uint32 EffectIndex; // 28 + uint32 EffectAttributes; // 29 + float BonusCoefficientFromAP; // 30 }; #define MAX_SPELL_EFFECTS 3 @@ -1824,37 +1826,27 @@ struct SpellEffectEntry // SpellAuraOptions.dbc struct SpellAuraOptionsEntry { - uint32 Id; // 0 m_ID - uint32 StackAmount; // 1 m_cumulativeAura - uint32 procChance; // 2 m_procChance - uint32 procCharges; // 3 m_procCharges - 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 + uint32 ID; // 0 + uint32 SpellID; // 1 + uint32 DifficultyID; // 2 + uint32 CumulativeAura; // 3 + uint32 ProcChance; // 4 + uint32 ProcCharges; // 5 + uint32 ProcTypeMask; // 6 + uint32 ProcCategoryRecovery; // 7 + uint32 SpellProcsPerMinuteID; // 8 }; // SpellCastingRequirements.dbc struct SpellCastingRequirementsEntry { - //uint32 Id; // 0 m_ID - uint32 FacingCasterFlags; // 1 m_facingCasterFlags - //uint32 MinFactionId; // 2 m_minFactionID not used - //uint32 MinReputation; // 3 m_minReputation not used - int32 AreaGroupId; // 4 m_requiredAreaGroupId - //uint32 RequiredAuraVision; // 5 m_requiredAuraVision not used - uint32 RequiresSpellFocus; // 6 m_requiresSpellFocus + //uint32 ID; // 0 + uint32 FacingCasterFlags; // 1 + //uint32 MinFactionID; // 1 + //uint32 MinReputation; // 3 + uint32 RequiredAreasID; // 4 + //uint32 RequiredAuraVision; // 5 + uint32 RequiresSpellFocus; // 6 }; #define MAX_SPELL_TOTEMS 2 @@ -1862,73 +1854,53 @@ struct SpellCastingRequirementsEntry // SpellTotems.dbc struct SpellTotemsEntry { - uint32 Id; // 0 m_ID - uint32 TotemCategory[MAX_SPELL_TOTEMS]; // 1 m_requiredTotemCategoryID - uint32 Totem[MAX_SPELL_TOTEMS]; // 2 m_totem + uint32 ID; // 0 m_ID + uint32 TotemCategory[MAX_SPELL_TOTEMS]; // 1 m_requiredTotemCategoryID + uint32 Totem[MAX_SPELL_TOTEMS]; // 2 m_totem }; // Spell.dbc struct SpellEntry { - 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 CastingTimeIndex; // 12 m_castingTimeIndex - uint32 DurationIndex; // 13 m_durationIndex - uint32 powerType; // 14 m_powerType - uint32 rangeIndex; // 15 m_rangeIndex - float speed; // 16 m_speed - uint32 SpellVisual[2]; // 17-18 m_spellVisualID - uint32 SpellIconID; // 19 m_spellIconID - uint32 activeIconID; // 20 m_activeIconID - char* SpellName; // 21 m_name_lang - char* Rank; // 22 m_nameSubtext_lang - //char* Description; // 23 m_description_lang not used - //char* ToolTip; // 24 m_auraDescription_lang not used - uint32 SchoolMask; // 25 m_schoolMask - uint32 runeCostID; // 26 m_runeCostID - //uint32 spellMissileID; // 27 m_spellMissileID not used - //uint32 spellDescriptionVariableID; // 28 m_spellDescriptionVariableID, 3.2.0 - uint32 SpellDifficultyId; // 29 m_spellDifficultyID - id from SpellDifficulty.dbc - float SpellCoef; // 30 - uint32 SpellScalingId; // 31 SpellScaling.dbc - uint32 SpellAuraOptionsId; // 32 SpellAuraOptions.dbc - uint32 SpellAuraRestrictionsId; // 33 SpellAuraRestrictions.dbc - uint32 SpellCastingRequirementsId; // 34 SpellCastingRequirements.dbc - uint32 SpellCategoriesId; // 35 SpellCategories.dbc - uint32 SpellClassOptionsId; // 36 SpellClassOptions.dbc - uint32 SpellCooldownsId; // 37 SpellCooldowns.dbc - //uint32 unkIndex7; // 38 all zeros... - uint32 SpellEquippedItemsId; // 39 SpellEquippedItems.dbc - uint32 SpellInterruptsId; // 40 SpellInterrupts.dbc - uint32 SpellLevelsId; // 41 SpellLevels.dbc - uint32 SpellPowerId; // 42 SpellPower.dbc - uint32 SpellReagentsId; // 43 SpellReagents.dbc - uint32 SpellShapeshiftId; // 44 SpellShapeshift.dbc - uint32 SpellTargetRestrictionsId; // 45 SpellTargetRestrictions.dbc - uint32 SpellTotemsId; // 46 SpellTotems.dbc - //uint32 ResearchProject; // 47 ResearchProject.dbc + uint32 ID; // 0 + char* Name_lang; // 1 + //char* NameSubtext_lang; // 2 + //char* Description_lang; // 3 + //char* AuraDescription_lang; // 4 + uint32 RuneCostID; // 5 + uint32 SpellMissileID; // 6 + uint32 DescriptionVariablesID; // 7 + uint32 ScalingID; // 8 + uint32 AuraOptionsID; // 9 + uint32 AuraRestrictionsID; // 10 + uint32 CastingRequirementsID; // 11 + uint32 CategoriesID; // 12 + uint32 ClassOptionsID; // 13 + uint32 CooldownsID; // 14 + uint32 EquippedItemsID; // 15 + uint32 InterruptsID; // 16 + uint32 LevelsID; // 17 + uint32 ReagentsID; // 18 + uint32 ShapeshiftID; // 19 + uint32 TargetRestrictionsID; // 20 + uint32 TotemsID; // 21 + uint32 RequiredProjectID; // 22 + uint32 MiscID; // 23 }; // SpellCategories.dbc struct SpellCategoriesEntry { - //uint32 Id; // 0 m_ID - uint32 Category; // 1 m_category - uint32 DmgClass; // 153 m_defenseType - uint32 Dispel; // 2 m_dispelType - uint32 Mechanic; // 3 m_mechanic - uint32 PreventionType; // 154 m_preventionType - uint32 StartRecoveryCategory; // 145 m_startRecoveryCategory + //uint32 ID; // 0 + //uint32 SpellID; // 1 + //uint32 DifficultyID; // 2 + uint32 Category; // 3 + uint32 DefenseType; // 4 + uint32 DispelType; // 5 + uint32 Mechanic; // 6 + uint32 PreventionType; // 7 + uint32 StartRecoveryCategory; // 8 + //uint32 ChargeCategory; // 9 }; typedef std::set<uint32> SpellCategorySet; @@ -1938,18 +1910,21 @@ typedef std::map<uint32, PetFamilySpellsSet > PetFamilySpellsStore; struct SpellCastTimesEntry { - uint32 ID; // 0 - int32 CastTime; // 1 + uint32 ID; // 0 + int32 CastTime; // 1 //float CastTimePerLevel; // 2 unsure / per skill? //int32 MinCastTime; // 3 unsure }; struct SpellCategoryEntry { - uint32 Id; - uint32 Flags; - // uint32 unk; - // char* Name; + uint32 ID; // 0 + uint32 Flags; // 1 + //uint8 UsesPerWeek; // 2 + //uint8 Padding[3]; // 2 + //char* Name_lang; // 3 + //uint32 MaxCharges; // 4 + //uint32 ChargeRecoveryTime; // 5 }; struct SpellDifficultyEntry @@ -2007,7 +1982,7 @@ struct SpellClassOptionsEntry { //uint32 Id; // 0 m_ID //uint32 modalNextSpell; // 1 m_modalNextSpell not used - flag96 SpellFamilyFlags; // 2-4 + flag128 SpellFamilyFlags; // 2-4 uint32 SpellFamilyName; // 5 m_spellClassSet //char* Description; // 6 4.0.0 }; diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 84e98751a28..b54fed77efb 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -126,18 +126,16 @@ char const SkillRaceClassInfofmt[] = "diiiixxi"; char const SkillTiersfmt[] = "niiiiiiiiiiiiiiii"; char const SoundEntriesfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; char const SpellCastTimefmt[] = "nixx"; -char const SpellCategoriesEntryfmt[] = "diiiiii"; -char const SpellCategoryfmt[] = "nixx"; +char const SpellCategoriesEntryfmt[] = "dxxiiiiiix"; +char const SpellCategoryfmt[] = "nixxxx"; char const SpellDifficultyfmt[] = "niiii"; const std::string CustomSpellDifficultyfmt = "ppppp"; const std::string CustomSpellDifficultyIndex = "id"; char const SpellDurationfmt[] = "niii"; -// 0 10 20 26 -char const SpellEffectEntryfmt[] = "nifiiiffiiiiiifiifiiiiiiiix"; +char const SpellEffectEntryfmt[] = "niifiiiffiiiiiifiifiiiiifiiiiif"; const std::string CustomSpellEffectEntryfmt = "ppppppppppppppappppppppppp"; const std::string CustomSpellEffectEntryIndex = "Id"; -// 0 10 20 30 40 47 -char const SpellEntryfmt[] = "niiiiiiiiiiiiiiifiiiissxxiixxifiiiiiiixiiiiiiiix"; +char const SpellEntryfmt[] = "nixxxiiiiiiiiiiiiiiiiiii"; const std::string CustomSpellEntryfmt = "ppppppppppppppapaaaaaaaaapaaaaaapapppaapppaaapa"; const std::string CustomSpellEntryIndex = "Id"; char const SpellFocusObjectfmt[] = "nx"; @@ -152,8 +150,7 @@ 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 SpellAuraOptionsEntryfmt[] = "niiiiiiii"; char const SpellCastingRequirementsEntryfmt[] = "dixxixi"; char const SpellClassOptionsEntryfmt[] = "dxiiiix"; char const SpellCooldownsEntryfmt[] = "diii"; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 139b36a35da..078fcfde1c9 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -20978,7 +20978,7 @@ void Player::AddSpellMod(SpellModifier* mod, bool apply) OpcodeServer opcode = (mod->type == SPELLMOD_FLAT) ? SMSG_SET_FLAT_SPELL_MODIFIER : SMSG_SET_PCT_SPELL_MODIFIER; int i = 0; - flag96 _mask = 0; + flag96 _mask; uint32 modTypeCount = 0; // count of mods per one mod->op WorldPacket data(opcode); data << uint32(1); // count of different mod->op's in packet diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index fe8ef48d267..0ff29a9b053 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -165,7 +165,7 @@ struct SpellModifier SpellModType type : 8; int16 charges : 16; int32 value; - flag96 mask; + flag128 mask; uint32 spellId; Aura* const ownerAura; }; diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 729cd4f1a41..53d4a01ac4c 100644 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -542,11 +542,11 @@ void Player::UpdateMastery() if (!aura->HasEffect(j)) continue; - float mult = aura->GetSpellInfo()->Effects[j].BonusMultiplier; + float mult = aura->GetSpellInfo()->Effects[j].BonusCoefficient; if (G3D::fuzzyEq(mult, 0.0f)) continue; - aura->GetEffect(j)->ChangeAmount(int32(value * aura->GetSpellInfo()->Effects[j].BonusMultiplier)); + aura->GetEffect(j)->ChangeAmount(int32(value * aura->GetSpellInfo()->Effects[j].BonusCoefficient)); } } } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 043c0581ac4..e2fd4d3b96b 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3728,7 +3728,7 @@ void Unit::RemoveAurasWithFamily(SpellFamilyNames family, uint32 familyFlag1, ui if (!casterGUID || aura->GetCasterGUID() == casterGUID) { SpellInfo const* spell = aura->GetSpellInfo(); - if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags.HasFlag(familyFlag1, familyFlag2, familyFlag3)) + if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags & flag96(familyFlag1, familyFlag2, familyFlag3)) { RemoveAura(iter); continue; @@ -3990,7 +3990,7 @@ AuraEffect* Unit::GetAuraEffect(AuraType type, SpellFamilyNames family, uint32 f for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i) { SpellInfo const* spell = (*i)->GetSpellInfo(); - if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags.HasFlag(familyFlag1, familyFlag2, familyFlag3)) + if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags & flag96(familyFlag1, familyFlag2, familyFlag3)) { if (!casterGUID.IsEmpty() && (*i)->GetCasterGUID() != casterGUID) continue; @@ -5521,7 +5521,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere return true; } // Seed of Corruption (Mobs cast) - no die req - if (dummySpell->SpellFamilyFlags.IsEqual(0, 0, 0) && dummySpell->SpellIconID == 1932) + if (!dummySpell->SpellFamilyFlags && dummySpell->SpellIconID == 1932) { // if damage is more than need deal finish spell if (triggeredByAura->GetAmount() <= int32(damage)) @@ -5625,7 +5625,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere SpellInfo const* blessHealing = sSpellMgr->GetSpellInfo(triggered_spell_id); if (!blessHealing) return false; - basepoints0 = int32(CalculatePct(damage, triggerAmount) / (blessHealing->GetMaxDuration() / blessHealing->Effects[0].Amplitude)); + basepoints0 = int32(CalculatePct(damage, triggerAmount) / (blessHealing->GetMaxDuration() / blessHealing->Effects[0].ApplyAuraPeriod)); } break; } @@ -5745,7 +5745,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere SpellInfo const* triggeredSpell = sSpellMgr->GetSpellInfo(triggered_spell_id); if (!triggeredSpell) return false; - basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].Amplitude); + basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].ApplyAuraPeriod); // Add remaining ticks to damage done basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE); } @@ -6129,7 +6129,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere SpellInfo const* triggeredSpell = sSpellMgr->GetSpellInfo(triggered_spell_id); if (!triggeredSpell) return false; - basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].Amplitude); + basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].ApplyAuraPeriod); } break; } @@ -6143,7 +6143,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere SpellInfo const* triggeredSpell = sSpellMgr->GetSpellInfo(triggered_spell_id); if (!triggeredSpell) return false; - basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].Amplitude); + basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].ApplyAuraPeriod); // Add remaining ticks to healing done basepoints0 += GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_HEAL); } @@ -6159,7 +6159,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere { Aura* flameShock = aurEff->GetBase(); int32 maxDuration = flameShock->GetMaxDuration(); - int32 newDuration = flameShock->GetDuration() + 2 * aurEff->GetAmplitude(); + int32 newDuration = flameShock->GetDuration() + 2 * aurEff->GetPeriod(); flameShock->SetDuration(newDuration); // is it blizzlike to change max duration for FS? @@ -6303,7 +6303,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere if (AuraEffect* glyph=GetAuraEffect(63332, 0)) AddPct(basepoints0, glyph->GetAmount()); - basepoints0 = basepoints0 / (unholyBlight->GetMaxDuration() / unholyBlight->Effects[0].Amplitude); + basepoints0 = basepoints0 / (unholyBlight->GetMaxDuration() / unholyBlight->Effects[0].ApplyAuraPeriod); basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE); break; } @@ -6777,7 +6777,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg if (!TriggerPS) return false; - basepoints0 = CalculatePct(int32(damage), triggerAmount) / (TriggerPS->GetMaxDuration() / TriggerPS->Effects[0].Amplitude); + basepoints0 = CalculatePct(int32(damage), triggerAmount) / (TriggerPS->GetMaxDuration() / TriggerPS->Effects[0].ApplyAuraPeriod); basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), trigger_spell_id, SPELL_AURA_PERIODIC_DAMAGE); break; } diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index ef83bdced50..88791cc2e77 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -476,10 +476,10 @@ int32 AuraEffect::CalculateAmount(Unit* caster) // default amount calculation int32 amount = 0; - if (!(m_spellInfo->AttributesEx8 & SPELL_ATTR8_MASTERY_SPECIALIZATION) || G3D::fuzzyEq(m_spellInfo->Effects[m_effIndex].BonusMultiplier, 0.0f)) + if (!(m_spellInfo->AttributesEx8 & SPELL_ATTR8_MASTERY_SPECIALIZATION) || G3D::fuzzyEq(m_spellInfo->Effects[m_effIndex].BonusCoefficient, 0.0f)) amount = m_spellInfo->Effects[m_effIndex].CalcValue(caster, &m_baseAmount, GetBase()->GetOwner()->ToUnit()); else if (caster && caster->GetTypeId() == TYPEID_PLAYER) - amount = int32(caster->GetFloatValue(PLAYER_MASTERY) * m_spellInfo->Effects[m_effIndex].BonusMultiplier); + amount = int32(caster->GetFloatValue(PLAYER_MASTERY) * m_spellInfo->Effects[m_effIndex].BonusCoefficient); // check item enchant aura cast if (!amount && caster) @@ -604,15 +604,15 @@ int32 AuraEffect::CalculateAmount(Unit* caster) void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= true*/, bool load /*= false*/) { - m_amplitude = m_spellInfo->Effects[m_effIndex].Amplitude; + m_period = m_spellInfo->Effects[m_effIndex].ApplyAuraPeriod; // prepare periodics switch (GetAuraType()) { case SPELL_AURA_OBS_MOD_POWER: // 3 spells have no amplitude set - if (!m_amplitude) - m_amplitude = 1 * IN_MILLISECONDS; + if (!m_period) + m_period = 1 * IN_MILLISECONDS; case SPELL_AURA_PERIODIC_DAMAGE: case SPELL_AURA_PERIODIC_HEAL: case SPELL_AURA_OBS_MOD_HEALTH: @@ -631,7 +631,7 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= tru break; } - GetBase()->CallScriptEffectCalcPeriodicHandlers(this, m_isPeriodic, m_amplitude); + GetBase()->CallScriptEffectCalcPeriodicHandlers(this, m_isPeriodic, m_period); if (!m_isPeriodic) return; @@ -639,11 +639,11 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= tru Player* modOwner = caster ? caster->GetSpellModOwner() : NULL; // Apply casting time mods - if (m_amplitude) + if (m_period) { // Apply periodic time mod if (modOwner) - modOwner->ApplySpellMod(GetId(), SPELLMOD_ACTIVATION_TIME, m_amplitude); + modOwner->ApplySpellMod(GetId(), SPELLMOD_ACTIVATION_TIME, m_period); if (caster) { @@ -651,17 +651,17 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= tru if (m_spellInfo->IsChanneled()) { if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) - caster->ModSpellCastTime(m_spellInfo, m_amplitude); + caster->ModSpellCastTime(m_spellInfo, m_period); } else if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) - m_amplitude = int32(m_amplitude * caster->GetFloatValue(UNIT_MOD_CAST_SPEED)); + m_period = int32(m_period * caster->GetFloatValue(UNIT_MOD_CAST_SPEED)); } } if (load) // aura loaded from db { - m_tickNumber = m_amplitude ? GetBase()->GetDuration() / m_amplitude : 0; - m_periodicTimer = m_amplitude ? GetBase()->GetDuration() % m_amplitude : 0; + m_tickNumber = m_period ? GetBase()->GetDuration() / m_period : 0; + m_periodicTimer = m_period ? GetBase()->GetDuration() % m_period : 0; if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_START_PERIODIC_AT_APPLY) ++m_tickNumber; } @@ -675,8 +675,8 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= tru { m_periodicTimer = 0; // Start periodic on next tick or at aura apply - if (m_amplitude && !(m_spellInfo->AttributesEx5 & SPELL_ATTR5_START_PERIODIC_AT_APPLY)) - m_periodicTimer += m_amplitude; + if (m_period && !(m_spellInfo->AttributesEx5 & SPELL_ATTR5_START_PERIODIC_AT_APPLY)) + m_periodicTimer += m_period; } } } @@ -859,7 +859,7 @@ void AuraEffect::Update(uint32 diff, Unit* caster) ++m_tickNumber; // update before tick (aura can be removed in TriggerSpell or PeriodicTick calls) - m_periodicTimer += m_amplitude - diff; + m_periodicTimer += m_period - diff; UpdatePeriodic(caster); std::list<AuraApplication*> effectApplications; @@ -1128,7 +1128,7 @@ void AuraEffect::CleanupTriggeredSpells(Unit* target) // needed for spell 43680, maybe others /// @todo is there a spell flag, which can solve this in a more sophisticated way? if (m_spellInfo->Effects[GetEffIndex()].ApplyAuraName == SPELL_AURA_PERIODIC_TRIGGER_SPELL && - uint32(m_spellInfo->GetDuration()) == m_spellInfo->Effects[GetEffIndex()].Amplitude) + uint32(m_spellInfo->GetDuration()) == m_spellInfo->Effects[GetEffIndex()].ApplyAuraPeriod) return; target->RemoveAurasDueToSpell(tSpellId, GetCasterGUID()); @@ -4596,7 +4596,7 @@ void AuraEffect::HandleNoReagentUseAura(AuraApplication const* aurApp, uint8 mod if (target->GetTypeId() != TYPEID_PLAYER) return; - flag96 mask; + flag128 mask; Unit::AuraEffectList const& noReagent = target->GetAuraEffectsByType(SPELL_AURA_NO_REAGENT_USE); for (Unit::AuraEffectList::const_iterator i = noReagent.begin(); i != noReagent.end(); ++i) mask |= (*i)->m_spellInfo->Effects[(*i)->m_effIndex].SpellClassMask; @@ -4604,6 +4604,7 @@ void AuraEffect::HandleNoReagentUseAura(AuraApplication const* aurApp, uint8 mod target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1 , mask[0]); target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1+1, mask[1]); target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1+2, mask[2]); + target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1+3, mask[3]); } void AuraEffect::HandleAuraRetainComboPoints(AuraApplication const* aurApp, uint8 mode, bool apply) const diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index d07885aaa83..22571f4851e 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -47,7 +47,7 @@ class AuraEffect uint32 GetId() const { return m_spellInfo->Id; } uint32 GetEffIndex() const { return m_effIndex; } int32 GetBaseAmount() const { return m_baseAmount; } - int32 GetAmplitude() const { return m_amplitude; } + int32 GetPeriod() const { return m_period; } int32 GetMiscValueB() const { return m_spellInfo->Effects[m_effIndex].MiscValueB; } int32 GetMiscValue() const { return m_spellInfo->Effects[m_effIndex].MiscValue; } @@ -81,8 +81,8 @@ class AuraEffect void UpdatePeriodic(Unit* caster); uint32 GetTickNumber() const { return m_tickNumber; } - int32 GetTotalTicks() const { return m_amplitude ? (GetBase()->GetMaxDuration() / m_amplitude) : 1;} - void ResetPeriodic(bool resetPeriodicTimer = false) { if (resetPeriodicTimer) m_periodicTimer = m_amplitude; m_tickNumber = 0;} + int32 GetTotalTicks() const { return m_period ? (GetBase()->GetMaxDuration() / m_period) : 1;} + void ResetPeriodic(bool resetPeriodicTimer = false) { if (resetPeriodicTimer) m_periodicTimer = m_period; m_tickNumber = 0;} bool IsPeriodic() const { return m_isPeriodic; } void SetPeriodic(bool isPeriodic) { m_isPeriodic = isPeriodic; } @@ -112,7 +112,7 @@ class AuraEffect SpellModifier* m_spellmod; int32 m_periodicTimer; - int32 m_amplitude; + int32 m_period; uint32 m_tickNumber; uint8 const m_effIndex; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index d0c40f2bb2b..67df56d892e 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -781,14 +781,14 @@ void Aura::RefreshTimers() bool resetPeriodic = true; if (m_spellInfo->AttributesEx8 & SPELL_ATTR8_DONT_RESET_PERIODIC_TIMER) { - int32 minAmplitude = m_maxDuration; + int32 minPeriod = m_maxDuration; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (AuraEffect const* eff = GetEffect(i)) - if (int32 ampl = eff->GetAmplitude()) - minAmplitude = std::min(ampl, minAmplitude); + if (int32 period = eff->GetPeriod()) + minPeriod = std::min(period, minPeriod); // If only one tick remaining, roll it over into new duration - if (GetDuration() <= minAmplitude) + if (GetDuration() <= minPeriod) { m_maxDuration += GetDuration(); resetPeriodic = false; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index cb2e2e82e9d..75f6c7d86fa 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1451,7 +1451,7 @@ void Spell::SelectImplicitTargetObjectTargets(SpellEffIndex effIndex, SpellImpli void Spell::SelectImplicitChainTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, WorldObject* target, uint32 effMask) { - uint32 maxTargets = m_spellInfo->Effects[effIndex].ChainTarget; + uint32 maxTargets = m_spellInfo->Effects[effIndex].ChainTargets; if (Player* modOwner = m_caster->GetSpellModOwner()) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, maxTargets, this); @@ -2626,8 +2626,8 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA duration = 0; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (AuraEffect const* eff = m_spellAura->GetEffect(i)) - if (int32 amplitude = eff->GetAmplitude()) // amplitude is hastened by UNIT_MOD_CAST_SPEED - duration = std::max(std::max(origDuration / amplitude, 1) * amplitude, duration); + if (int32 period = eff->GetPeriod()) // period is hastened by UNIT_MOD_CAST_SPEED + duration = std::max(std::max(origDuration / period, 1) * period, duration); // if there is no periodic effect if (!duration) @@ -4815,7 +4815,7 @@ SpellCastResult Spell::CheckCast(bool strict) { if (m_spellInfo->CasterAuraState && !m_caster->HasAuraState(AuraStateType(m_spellInfo->CasterAuraState), m_spellInfo, m_caster)) return SPELL_FAILED_CASTER_AURASTATE; - if (m_spellInfo->CasterAuraStateNot && m_caster->HasAuraState(AuraStateType(m_spellInfo->CasterAuraStateNot), m_spellInfo, m_caster)) + if (m_spellInfo->ExcludeCasterAuraState && m_caster->HasAuraState(AuraStateType(m_spellInfo->ExcludeCasterAuraState), m_spellInfo, m_caster)) return SPELL_FAILED_CASTER_AURASTATE; // Note: spell 62473 requres casterAuraSpell = triggering spell @@ -5476,7 +5476,7 @@ SpellCastResult Spell::CheckCast(bool strict) InstanceTemplate const* it = sObjectMgr->GetInstanceTemplate(m_caster->GetMapId()); if (it) allowMount = it->AllowMount; - if (m_caster->GetTypeId() == TYPEID_PLAYER && !allowMount && !m_spellInfo->AreaGroupId) + if (m_caster->GetTypeId() == TYPEID_PLAYER && !allowMount && !m_spellInfo->RequiredAreasID) return SPELL_FAILED_NO_MOUNTS_ALLOWED; if (m_caster->IsInDisallowedMountForm()) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 917f69547a1..dcd3338e0c2 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -346,26 +346,26 @@ SpellEffectInfo::SpellEffectInfo(SpellEntry const* /*spellEntry*/, SpellInfo con _spellInfo = spellInfo; _effIndex = _effect ? _effect->EffectIndex : effIndex; Effect = _effect ? _effect->Effect : 0; - ApplyAuraName = _effect ? _effect->EffectApplyAuraName : 0; - Amplitude = _effect ? _effect->EffectAmplitude : 0; + ApplyAuraName = _effect ? _effect->EffectAura : 0; + ApplyAuraPeriod = _effect ? _effect->EffectAuraPeriod : 0; DieSides = _effect ? _effect->EffectDieSides : 0; RealPointsPerLevel = _effect ? _effect->EffectRealPointsPerLevel : 0.0f; BasePoints = _effect ? _effect->EffectBasePoints : 0; - PointsPerComboPoint = _effect ? _effect->EffectPointsPerComboPoint : 0.0f; - ValueMultiplier = _effect ? _effect->EffectValueMultiplier : 0.0f; - DamageMultiplier = _effect ? _effect->EffectDamageMultiplier : 0.0f; - BonusMultiplier = _effect ? _effect->EffectBonusMultiplier : 0.0f; + PointsPerResource = _effect ? _effect->EffectPointsPerResource : 0.0f; + Amplitude = _effect ? _effect->EffectAmplitude : 0.0f; + ChainAmplitude = _effect ? _effect->EffectChainAmplitude : 0.0f; + BonusCoefficient = _effect ? _effect->EffectBonusCoefficient : 0.0f; MiscValue = _effect ? _effect->EffectMiscValue : 0; MiscValueB = _effect ? _effect->EffectMiscValueB : 0; Mechanic = Mechanics(_effect ? _effect->EffectMechanic : 0); - TargetA = SpellImplicitTargetInfo(_effect ? _effect->EffectImplicitTargetA : 0); - TargetB = SpellImplicitTargetInfo(_effect ? _effect->EffectImplicitTargetB : 0); + TargetA = SpellImplicitTargetInfo(_effect ? _effect->ImplicitTarget[0] : 0); + TargetB = SpellImplicitTargetInfo(_effect ? _effect->ImplicitTarget[1] : 0); RadiusEntry = _effect && _effect->EffectRadiusIndex ? sSpellRadiusStore.LookupEntry(_effect->EffectRadiusIndex) : NULL; MaxRadiusEntry = _effect && _effect->EffectRadiusMaxIndex ? sSpellRadiusStore.LookupEntry(_effect->EffectRadiusMaxIndex) : NULL; - ChainTarget = _effect ? _effect->EffectChainTarget : 0; + ChainTargets = _effect ? _effect->EffectChainTargets : 0; ItemType = _effect ? _effect->EffectItemType : 0; TriggerSpell = _effect ? _effect->EffectTriggerSpell : 0; - SpellClassMask = _effect ? _effect->EffectSpellClassMask : flag96(0); + SpellClassMask = _effect ? _effect->EffectSpellClassMask : flag128(); ImplicitTargetConditions = NULL; ScalingMultiplier = scaling ? scaling->Multiplier[_effIndex] : 0.0f; DeltaScalingMultiplier = scaling ? scaling->RandomMultiplier[_effIndex] : 0.0f; @@ -432,7 +432,7 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const { float basePointsPerLevel = RealPointsPerLevel; int32 basePoints = bp ? *bp : BasePoints; - float comboDamage = PointsPerComboPoint; + float comboDamage = PointsPerResource; // base amount modification based on spell lvl vs caster lvl if (ScalingMultiplier != 0.0f) @@ -589,7 +589,7 @@ int32 SpellEffectInfo::CalcBaseValue(int32 value) const float SpellEffectInfo::CalcValueMultiplier(Unit* caster, Spell* spell) const { - float multiplier = ValueMultiplier; + float multiplier = Amplitude; if (Player* modOwner = (caster ? caster->GetSpellModOwner() : NULL)) modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_VALUE_MULTIPLIER, multiplier, spell); return multiplier; @@ -597,7 +597,7 @@ float SpellEffectInfo::CalcValueMultiplier(Unit* caster, Spell* spell) const float SpellEffectInfo::CalcDamageMultiplier(Unit* caster, Spell* spell) const { - float multiplier = DamageMultiplier; + float multiplier = ChainAmplitude; if (Player* modOwner = (caster ? caster->GetSpellModOwner() : NULL)) modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_DAMAGE_MULTIPLIER, multiplier, spell); return multiplier; @@ -863,50 +863,57 @@ SpellEffectInfo::StaticData SpellEffectInfo::_data[TOTAL_SPELL_EFFECTS] = SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effects) { - Id = spellEntry->Id; - Attributes = spellEntry->Attributes; - AttributesEx = spellEntry->AttributesEx; - AttributesEx2 = spellEntry->AttributesEx2; - AttributesEx3 = spellEntry->AttributesEx3; - AttributesEx4 = spellEntry->AttributesEx4; - AttributesEx5 = spellEntry->AttributesEx5; - AttributesEx6 = spellEntry->AttributesEx6; - AttributesEx7 = spellEntry->AttributesEx7; - AttributesEx8 = spellEntry->AttributesEx8; - AttributesEx9 = spellEntry->AttributesEx9; - AttributesEx10 = spellEntry->AttributesEx10; + Id = spellEntry->ID; + + SpellName = spellEntry->Name_lang; + //Rank = spellEntry->Rank; + RuneCostID = spellEntry->RuneCostID; + //SpellDifficultyId = spellEntry->DifficultyID; + SpellScalingId = spellEntry->ScalingID; + SpellAuraOptionsId = spellEntry->AuraOptionsID; + SpellAuraRestrictionsId = spellEntry->AuraRestrictionsID; + SpellCastingRequirementsId = spellEntry->CastingRequirementsID; + SpellCategoriesId = spellEntry->CategoriesID; + SpellClassOptionsId = spellEntry->ClassOptionsID; + SpellCooldownsId = spellEntry->CooldownsID; + SpellEquippedItemsId = spellEntry->EquippedItemsID; + SpellInterruptsId = spellEntry->InterruptsID; + SpellLevelsId = spellEntry->LevelsID; + //SpellPowerId = spellEntry->PowerID; + SpellReagentsId = spellEntry->ReagentsID; + SpellShapeshiftId = spellEntry->ShapeshiftID; + SpellTargetRestrictionsId = spellEntry->TargetRestrictionsID; + SpellTotemsId = spellEntry->TotemsID; + SpellMiscId = spellEntry->MiscID; + + // SpellMiscEntry + SpellMiscEntry const* _misc = GetSpellMisc(); + Attributes = _misc ? _misc->Attributes : 0; + AttributesEx = _misc ? _misc->AttributesEx : 0; + AttributesEx2 = _misc ? _misc->AttributesExB : 0; + AttributesEx3 = _misc ? _misc->AttributesExC : 0; + AttributesEx4 = _misc ? _misc->AttributesExD : 0; + AttributesEx5 = _misc ? _misc->AttributesExE : 0; + AttributesEx6 = _misc ? _misc->AttributesExF : 0; + AttributesEx7 = _misc ? _misc->AttributesExG : 0; + AttributesEx8 = _misc ? _misc->AttributesExH : 0; + AttributesEx9 = _misc ? _misc->AttributesExI : 0; + AttributesEx10 = _misc ? _misc->AttributesExJ : 0; + AttributesEx11 = _misc ? _misc->AttributesExK : 0; + AttributesEx12 = _misc ? _misc->AttributesExL : 0; + AttributesEx13 = _misc ? _misc->AttributesExM : 0; + CastTimeEntry = _misc ? (_misc->CastingTimeIndex ? sSpellCastTimesStore.LookupEntry(_misc->CastingTimeIndex) : NULL) : NULL; + DurationEntry = _misc ? (_misc->DurationIndex ? sSpellDurationStore.LookupEntry(_misc->DurationIndex) : NULL) : NULL; + RangeEntry = _misc ? (_misc->RangeIndex ? sSpellRangeStore.LookupEntry(_misc->RangeIndex) : NULL) : NULL; + Speed = _misc ? _misc->Speed : 0; + SchoolMask = _misc ? _misc->SchoolMask : 0; AttributesCu = 0; - CastTimeEntry = spellEntry->CastingTimeIndex ? sSpellCastTimesStore.LookupEntry(spellEntry->CastingTimeIndex) : NULL; - DurationEntry = spellEntry->DurationIndex ? sSpellDurationStore.LookupEntry(spellEntry->DurationIndex) : NULL; - PowerType = spellEntry->powerType; - RangeEntry = spellEntry->rangeIndex ? sSpellRangeStore.LookupEntry(spellEntry->rangeIndex) : NULL; - Speed = spellEntry->speed; - + //PowerType = _misc ? _misc->powerType : 0; for (uint8 i = 0; i < 2; ++i) - SpellVisual[i] = spellEntry->SpellVisual[i]; - - SpellIconID = spellEntry->SpellIconID; - ActiveIconID = spellEntry->activeIconID; - SpellName = spellEntry->SpellName; - Rank = spellEntry->Rank; - SchoolMask = spellEntry->SchoolMask; - RuneCostID = spellEntry->runeCostID; - SpellDifficultyId = spellEntry->SpellDifficultyId; - SpellScalingId = spellEntry->SpellScalingId; - SpellAuraOptionsId = spellEntry->SpellAuraOptionsId; - SpellAuraRestrictionsId = spellEntry->SpellAuraRestrictionsId; - SpellCastingRequirementsId = spellEntry->SpellCastingRequirementsId; - SpellCategoriesId = spellEntry->SpellCategoriesId; - SpellClassOptionsId = spellEntry->SpellClassOptionsId; - SpellCooldownsId = spellEntry->SpellCooldownsId; - SpellEquippedItemsId = spellEntry->SpellEquippedItemsId; - SpellInterruptsId = spellEntry->SpellInterruptsId; - SpellLevelsId = spellEntry->SpellLevelsId; - SpellPowerId = spellEntry->SpellPowerId; - SpellReagentsId = spellEntry->SpellReagentsId; - SpellShapeshiftId = spellEntry->SpellShapeshiftId; - SpellTargetRestrictionsId = spellEntry->SpellTargetRestrictionsId; - SpellTotemsId = spellEntry->SpellTotemsId; + SpellVisual[i] = _misc ? _misc->SpellVisualID[i] : 0; + + SpellIconID = _misc ? _misc->SpellIconID : 0; + ActiveIconID = _misc ? _misc->ActiveIconID : 0; // SpellDifficultyEntry for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) @@ -923,27 +930,27 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe // SpellAuraOptionsEntry SpellAuraOptionsEntry const* _options = GetSpellAuraOptions(); - ProcFlags = _options ? _options->procFlags : 0; - ProcChance = _options ? _options->procChance : 0; - ProcCharges = _options ? _options->procCharges : 0; - StackAmount = _options ? _options->StackAmount : 0; + ProcFlags = _options ? _options->ProcTypeMask : 0; + ProcChance = _options ? _options->ProcChance : 0; + ProcCharges = _options ? _options->ProcCharges : 0; + StackAmount = _options ? _options->CumulativeAura : 0; // SpellAuraRestrictionsEntry SpellAuraRestrictionsEntry const* _aura = GetSpellAuraRestrictions(); CasterAuraState = _aura ? _aura->CasterAuraState : 0; 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; + ExcludeCasterAuraState = _aura ? _aura->ExcludeCasterAuraState : 0; + ExcludeTargetAuraState = _aura ? _aura->ExcludeTargetAuraState : 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(); RequiresSpellFocus = _castreq ? _castreq->RequiresSpellFocus : 0; FacingCasterFlags = _castreq ? _castreq->FacingCasterFlags : 0; - AreaGroupId = _castreq ? _castreq->AreaGroupId : -1; + RequiredAreasID = _castreq ? _castreq->RequiredAreasID : -1; // SpellCategoriesEntry SpellCategoriesEntry const* _categorie = GetSpellCategories(); @@ -1522,10 +1529,10 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 area_id, Player const* player) const { // normal case - if (AreaGroupId > 0) + if (RequiredAreasID > 0) { bool found = false; - AreaGroupEntry const* groupEntry = sAreaGroupStore.LookupEntry(AreaGroupId); + AreaGroupEntry const* groupEntry = sAreaGroupStore.LookupEntry(RequiredAreasID); while (groupEntry) { for (uint8 i = 0; i < MAX_GROUP_AREA_IDS; ++i) @@ -1798,7 +1805,7 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta if (TargetAuraState && !unitTarget->HasAuraState(AuraStateType(TargetAuraState), this, caster)) return SPELL_FAILED_TARGET_AURASTATE; - if (TargetAuraStateNot && unitTarget->HasAuraState(AuraStateType(TargetAuraStateNot), this, caster)) + if (ExcludeTargetAuraState && unitTarget->HasAuraState(AuraStateType(ExcludeTargetAuraState), this, caster)) return SPELL_FAILED_TARGET_AURASTATE; } @@ -2168,7 +2175,7 @@ SpellSpecificType SpellInfo::GetSpellSpecific() const return SPELL_SPECIFIC_STING; // only hunter aspects have this (but not all aspects in hunter family) - if (SpellFamilyFlags.HasFlag(0x00380000, 0x00440000, 0x00001010)) + if (SpellFamilyFlags & flag96(0x00380000, 0x00440000, 0x00001010)) return SPELL_SPECIFIC_ASPECT; break; @@ -2317,8 +2324,8 @@ uint32 SpellInfo::GetMaxTicks() const case SPELL_AURA_PERIODIC_DAMAGE: case SPELL_AURA_PERIODIC_HEAL: case SPELL_AURA_PERIODIC_LEECH: - if (Effects[x].Amplitude != 0) - return DotDuration / Effects[x].Amplitude; + if (Effects[x].ApplyAuraPeriod != 0) + return DotDuration / Effects[x].ApplyAuraPeriod; break; } } @@ -2881,6 +2888,11 @@ SpellTotemsEntry const* SpellInfo::GetSpellTotems() const return SpellTotemsId ? sSpellTotemsStore.LookupEntry(SpellTotemsId) : NULL; } +SpellMiscEntry const* SpellInfo::GetSpellMisc() const +{ + return SpellMiscId ? sSpellMiscStore.LookupEntry(SpellMiscId) : NULL; +} + SpellAuraOptionsEntry const* SpellInfo::GetSpellAuraOptions() const { return SpellAuraOptionsId ? sSpellAuraOptionsStore.LookupEntry(SpellAuraOptionsId) : NULL; diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index ea29eb1b00f..edf997db0e5 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -233,14 +233,14 @@ class SpellEffectInfo public: uint32 Effect; uint32 ApplyAuraName; - uint32 Amplitude; + uint32 ApplyAuraPeriod; int32 DieSides; float RealPointsPerLevel; int32 BasePoints; - float PointsPerComboPoint; - float ValueMultiplier; - float DamageMultiplier; - float BonusMultiplier; + float PointsPerResource; + float Amplitude; + float ChainAmplitude; + float BonusCoefficient; int32 MiscValue; int32 MiscValueB; Mechanics Mechanic; @@ -248,19 +248,19 @@ public: SpellImplicitTargetInfo TargetB; SpellRadiusEntry const* RadiusEntry; SpellRadiusEntry const* MaxRadiusEntry; - uint32 ChainTarget; + uint32 ChainTargets; uint32 ItemType; uint32 TriggerSpell; - flag96 SpellClassMask; + flag128 SpellClassMask; std::list<Condition*>* ImplicitTargetConditions; // SpellScalingEntry float ScalingMultiplier; float DeltaScalingMultiplier; float ComboScalingMultiplier; - SpellEffectInfo() : _spellInfo(NULL), _effIndex(0), Effect(0), ApplyAuraName(0), Amplitude(0), DieSides(0), - RealPointsPerLevel(0), BasePoints(0), PointsPerComboPoint(0), ValueMultiplier(0), DamageMultiplier(0), - BonusMultiplier(0), MiscValue(0), MiscValueB(0), Mechanic(MECHANIC_NONE), RadiusEntry(NULL), ChainTarget(0), + SpellEffectInfo() : _spellInfo(NULL), _effIndex(0), Effect(0), ApplyAuraName(0), ApplyAuraPeriod(0), DieSides(0), + RealPointsPerLevel(0), BasePoints(0), PointsPerResource(0), Amplitude(0), ChainAmplitude(0), + BonusCoefficient(0), MiscValue(0), MiscValueB(0), Mechanic(MECHANIC_NONE), RadiusEntry(NULL), ChainTargets(0), ItemType(0), TriggerSpell(0), ImplicitTargetConditions(NULL) {} SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* spellInfo, uint8 effIndex, SpellEffectEntry const* effect); @@ -316,6 +316,9 @@ public: uint32 AttributesEx8; uint32 AttributesEx9; uint32 AttributesEx10; + uint32 AttributesEx11; + uint32 AttributesEx12; + uint32 AttributesEx13; uint32 AttributesCu; uint32 Stances; uint32 StancesNot; @@ -325,8 +328,8 @@ public: uint32 FacingCasterFlags; uint32 CasterAuraState; uint32 TargetAuraState; - uint32 CasterAuraStateNot; - uint32 TargetAuraStateNot; + uint32 ExcludeCasterAuraState; + uint32 ExcludeTargetAuraState; uint32 CasterAuraSpell; uint32 TargetAuraSpell; uint32 ExcludeCasterAuraSpell; @@ -370,10 +373,10 @@ public: uint32 MaxTargetLevel; uint32 MaxAffectedTargets; uint32 SpellFamilyName; - flag96 SpellFamilyFlags; + flag128 SpellFamilyFlags; uint32 DmgClass; uint32 PreventionType; - int32 AreaGroupId; + int32 RequiredAreasID; uint32 SchoolMask; uint32 SpellDifficultyId; uint32 SpellScalingId; @@ -391,6 +394,7 @@ public: uint32 SpellShapeshiftId; uint32 SpellTargetRestrictionsId; uint32 SpellTotemsId; + uint32 SpellMiscId; // SpellScalingEntry int32 CastTimeMin; int32 CastTimeMax; @@ -418,6 +422,7 @@ public: SpellScalingEntry const* GetSpellScaling() const; SpellShapeshiftEntry const* GetSpellShapeshift() const; SpellTotemsEntry const* GetSpellTotems() const; + SpellMiscEntry const* GetSpellMisc() const; SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effects); ~SpellInfo(); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 4463fc0da75..6d2973b1644 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2813,7 +2813,7 @@ void SpellMgr::LoadSpellInfoStore() if (!effect) continue; - effectsBySpell[effect->EffectSpellId].effects[effect->EffectIndex] = effect; + effectsBySpell[effect->SpellID].effects[effect->EffectIndex] = effect; } for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i) @@ -3188,7 +3188,7 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->ProcCharges = 1; break; case 44544: // Fingers of Frost - spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(685904631, 1151048, 0); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag128(685904631, 1151048, 0, 0); break; case 74396: // Fingers of Frost visual buff spellInfo->ProcCharges = 2; @@ -3212,7 +3212,7 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->Effects[EFFECT_0].MiscValue |= 1; break; case 51912: // Crafty's Ultra-Advanced Proto-Typical Shortening Blaster - spellInfo->Effects[EFFECT_0].Amplitude = 3000; + spellInfo->Effects[EFFECT_0].ApplyAuraPeriod = 3000; break; // Master Shapeshifter: missing stance data for forms other than bear - bear version has correct data // To prevent aura staying on target after talent unlearned @@ -3231,7 +3231,7 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA; spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; spellInfo->Effects[EFFECT_1].MiscValue = SPELLMOD_EFFECT2; - spellInfo->Effects[EFFECT_1].SpellClassMask = flag96(0x00000000, 0x00004000, 0x00000000); + spellInfo->Effects[EFFECT_1].SpellClassMask = flag128(0x00000000, 0x00004000, 0x00000000, 0x00000000); break; case 47569: // Improved Shadowform (Rank 1) // with this spell atrribute aura can be stacked several times @@ -3273,7 +3273,7 @@ void SpellMgr::LoadSpellInfoCorrections() break; case 53241: // Marked for Death (Rank 1) case 53243: // Marked for Death (Rank 2) - spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00067801, 0x10820001, 0x00000801); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag128(0x00067801, 0x10820001, 0x00000801, 0x00000000); break; case 5176: // Wrath case 2912: // Starfire @@ -3294,22 +3294,22 @@ void SpellMgr::LoadSpellInfoCorrections() // this is done because another spell also uses the same SpellFamilyFlags as Icy Touch // SpellFamilyFlags[0] & 0x00000040 in SPELLFAMILY_DEATHKNIGHT is currently unused (3.3.5a) // this needs research on modifier applying rules, does not seem to be in Attributes fields - spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00000040, 0x00000000, 0x00000000); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag128(0x00000040, 0x00000000, 0x00000000, 0x00000000); break; case 64949: // Idol of the Flourishing Life - spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00000000, 0x02000000, 0x00000000); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag128(0x00000000, 0x02000000, 0x00000000, 0x00000000); spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; break; case 34231: // Libram of the Lightbringer case 60792: // Libram of Tolerance case 64956: // Libram of the Resolute - spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x80000000, 0x00000000, 0x00000000); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag128(0x80000000, 0x00000000, 0x00000000, 0x00000000); spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; break; case 28851: // Libram of Light case 28853: // Libram of Divinity case 32403: // Blessed Book of Nagrand - spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x40000000, 0x00000000, 0x00000000); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag128(0x40000000, 0x00000000, 0x00000000, 0x00000000); spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; break; case 45602: // Ride Carpet @@ -3540,7 +3540,7 @@ void SpellMgr::LoadSpellInfoCorrections() break; case 71266: // Swarming Shadows case 72890: // Swarming Shadows - spellInfo->AreaGroupId = 0; // originally, these require area 4522, which is... outside of Icecrown Citadel + spellInfo->RequiredAreasID = 0; // originally, these require area 4522, which is... outside of Icecrown Citadel break; case 70602: // Corruption case 48278: // Paralyze diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp index a0f871eacff..416c27b7353 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp @@ -1847,7 +1847,7 @@ class spell_igb_rocket_pack : public SpellScriptLoader void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { SpellInfo const* damageInfo = sSpellMgr->EnsureSpellInfo(SPELL_ROCKET_PACK_DAMAGE); - GetTarget()->CastCustomSpell(SPELL_ROCKET_PACK_DAMAGE, SPELLVALUE_BASE_POINT0, 2 * (damageInfo->Effects[EFFECT_0].CalcValue() + aurEff->GetTickNumber() * aurEff->GetAmplitude()), NULL, TRIGGERED_FULL_MASK); + GetTarget()->CastCustomSpell(SPELL_ROCKET_PACK_DAMAGE, SPELLVALUE_BASE_POINT0, 2 * (damageInfo->Effects[EFFECT_0].CalcValue() + aurEff->GetTickNumber() * aurEff->GetPeriod()), NULL, TRIGGERED_FULL_MASK); GetTarget()->CastSpell(NULL, SPELL_ROCKET_BURST, TRIGGERED_FULL_MASK); } diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 638538872e8..0ff7d116a88 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -628,7 +628,7 @@ class spell_dk_death_strike : public SpellScriptLoader if (AuraEffect* enabler = GetCaster()->GetAuraEffect(SPELL_DK_DEATH_STRIKE_ENABLER, EFFECT_0, GetCaster()->GetGUID())) { // Call CalculateAmount() to constantly fire the AuraEffect's HandleCalcAmount method - int32 heal = CalculatePct(enabler->CalculateAmount(GetCaster()), GetSpellInfo()->Effects[EFFECT_0].DamageMultiplier); + int32 heal = CalculatePct(enabler->CalculateAmount(GetCaster()), GetSpellInfo()->Effects[EFFECT_0].ChainAmplitude); if (AuraEffect const* aurEff = GetCaster()->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_DEATH_STRIKE, EFFECT_2)) heal = AddPct(heal, aurEff->GetAmount()); diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 68a21cc61c6..a8d5d8ce667 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -327,7 +327,7 @@ class spell_rog_deadly_poison : public SpellScriptLoader continue; // Do not reproc deadly - if (spellInfo->SpellFamilyFlags.IsEqual(0x10000, 0x80000, 0)) + if (spellInfo->SpellFamilyFlags == flag96(0x10000, 0x80000, 0)) continue; if (spellInfo->IsPositive()) diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 24fa9ee31ae..128cddef1c1 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -1249,7 +1249,7 @@ class spell_warl_soul_swap_dot_marker : public SpellScriptLoader if (!warlock || !swapVictim) return; - flag96 classMask = GetSpellInfo()->Effects[effIndex].SpellClassMask; + flag128 classMask = GetSpellInfo()->Effects[effIndex].SpellClassMask; Unit::AuraApplicationMap const& appliedAuras = swapVictim->GetAppliedAuras(); SoulSwapOverrideAuraScript* swapSpellScript = NULL; diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 5e976b12071..3b6b68d3fce 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -245,7 +245,7 @@ class spell_warr_deep_wounds : public SpellScriptLoader ApplyPct(damage, 16 * GetSpellInfo()->GetRank()); SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC); - uint32 ticks = uint32(spellInfo->GetDuration()) / spellInfo->Effects[EFFECT_0].Amplitude; + uint32 ticks = uint32(spellInfo->GetDuration()) / spellInfo->Effects[EFFECT_0].ApplyAuraPeriod; // Add remaining ticks to damage done if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC, EFFECT_0, caster->GetGUID())) diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h index 216fe08d64a..90d19f7f7eb 100644 --- a/src/server/shared/Utilities/Util.h +++ b/src/server/shared/Utilities/Util.h @@ -27,6 +27,7 @@ #include <vector> #include <list> #include <map> +#include <stdarg.h> template<typename T> struct Optional @@ -388,7 +389,142 @@ class HookList } }; -class flag96 +template<uint8 T_size> +class flag +{ +protected: + uint32 part[T_size]; + +public: + flag() + { + memset(part, 0, sizeof(uint32)*T_size); + } + + flag(uint32 first, ...) + { + va_list ap; + part[0] = first; + + va_start(ap, first); + for (int i = 1; i < T_size; ++i) + part[i] = va_arg(ap, uint32); + va_end(ap); + } + + inline bool operator <(const flag<T_size>& right) const + { + for (uint8 i = T_size; 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 flag<T_size>& right) const + { + for (uint8 i = 0; i < T_size; ++i) + if (part[i] != right.part[i]) + return false; + return true; + } + + inline bool operator !=(const flag<T_size>& right) const + { + return !this->operator ==(right); + } + + inline flag<T_size>& operator =(const flag<T_size>& right) + { + for (uint8 i = 0; i < T_size; ++i) + part[i] = right.part[i]; + return *this; + } + + inline flag<T_size> operator &(const flag<T_size> &right) const + { + flag<T_size> fl; + for (uint8 i = 0; i < T_size; ++i) + fl.part[i] = part[i] & right.part[i]; + return fl; + } + + inline flag<T_size>& operator &=(const flag<T_size> &right) + { + for (uint8 i = 0; i < T_size; ++i) + part[i] &= right.part[i]; + return *this; + } + + inline flag<T_size> operator |(const flag<T_size> &right) const + { + flag<T_size> fl; + for (uint8 i = 0; i < T_size; ++i) + fl.part[i] = part[i] | right.part[i]; + return fl; + } + + inline flag<T_size>& operator |=(const flag<T_size> &right) + { + for (uint8 i = 0; i < T_size; ++i) + part[i] |= right.part[i]; + return *this; + } + + inline flag<T_size> operator ~() const + { + flag<T_size> fl; + for (uint8 i = 0; i < T_size; ++i) + fl.part[i] = ~part[i]; + return fl; + } + + inline flag<T_size> operator ^(const flag<T_size>& right) const + { + flag<T_size> fl; + for (uint8 i = 0; i < T_size; ++i) + fl.part[i] = part[i] ^ right.part[i]; + return fl; + } + + inline flag<T_size>& operator ^=(const flag<T_size>& right) + { + for (uint8 i = 0; i < T_size; ++i) + part[i] ^= right.part[i]; + return *this; + } + + inline operator bool() const + { + for (uint8 i = 0; i < T_size; ++i) + if (part[i] != 0) + return true; + return false; + } + + 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]; + } +}; + +typedef flag<3> flag96; +typedef flag<4> flag128; + +/*class flag96 { private: uint32 part[3]; @@ -519,7 +655,7 @@ public: { return part[el]; } -}; +};*/ enum ComparisionType { |