From e1cb43e831d017f7b0e047737d8983189d24f734 Mon Sep 17 00:00:00 2001 From: Intel Date: Wed, 5 Nov 2014 23:33:56 +0200 Subject: Core/DataStores: Fixed build after rename --- src/server/game/Spells/SpellInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/game/Spells/SpellInfo.cpp') diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index a5804ffd648..d2d92f50be1 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1546,7 +1546,7 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a { uint32 v_map = GetVirtualMapForMapAndZone(map_id, zone_id); MapEntry const* mapEntry = sMapStore.LookupEntry(v_map); - if (!mapEntry || mapEntry->addon < 1 || !mapEntry->IsContinent()) + if (!mapEntry || mapEntry->ExpansionID < 1 || !mapEntry->IsContinent()) return SPELL_FAILED_INCORRECT_AREA; } -- cgit v1.2.3 From 3fe1ad51baa8c4bdf1506b7d176ffa3f11b68abc Mon Sep 17 00:00:00 2001 From: Intel Date: Thu, 6 Nov 2014 00:52:54 +0200 Subject: Core/DataStores: Updated AreaGroup.dbc and removed AreaPOI.dbc (Moved to db2 + wasn't used in core at all?) --- src/server/game/DataStores/DBCStores.cpp | 2 -- src/server/game/DataStores/DBCStores.h | 1 - src/server/game/DataStores/DBCStructure.h | 22 +++------------------- src/server/game/DataStores/DBCfmt.h | 1 - src/server/game/Spells/SpellInfo.cpp | 6 +++--- 5 files changed, 6 insertions(+), 26 deletions(-) (limited to 'src/server/game/Spells/SpellInfo.cpp') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 5f49ad4f6d8..6bf5b49b297 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -52,7 +52,6 @@ typedef std::map WMOAreaInfoByTri DBCStorage sAreaStore(AreaTableEntryfmt); DBCStorage sAreaGroupStore(AreaGroupEntryfmt); -DBCStorage sAreaPOIStore(AreaPOIEntryfmt); static AreaFlagByAreaID sAreaFlagByAreaID; static AreaFlagByMapID sAreaFlagByMapID; // for instances without generated *.map files @@ -348,7 +347,6 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementCriteriaStore, dbcPath, "Achievement_Criteria.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sAreaTriggerStore, dbcPath, "AreaTrigger.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sAreaGroupStore, dbcPath, "AreaGroup.dbc");//15595 - LoadDBC(availableDbcLocales, bad_dbc_files, sAreaPOIStore, dbcPath, "AreaPOI.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sAuctionHouseStore, dbcPath, "AuctionHouse.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sArmorLocationStore, dbcPath, "ArmorLocation.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sBankBagSlotPricesStore, dbcPath, "BankBagSlotPrices.dbc");//15595 diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 885f6041a60..3fc688d23ff 100644 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -95,7 +95,6 @@ extern DBCStorage sAchievementStore; extern DBCStorage sAchievementCriteriaStore; extern DBCStorage sAreaStore;// recommend access using functions extern DBCStorage sAreaGroupStore; -extern DBCStorage sAreaPOIStore; extern DBCStorage sAreaTriggerStore; extern DBCStorage sArmorLocationStore; extern DBCStorage sAuctionHouseStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 1edba075bea..8798a328022 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -572,25 +572,9 @@ struct AreaTableEntry struct AreaGroupEntry { - uint32 AreaGroupId; // 0 - uint32 AreaId[MAX_GROUP_AREA_IDS]; // 1-6 - uint32 nextGroup; // 7 index of next group -}; - -struct AreaPOIEntry -{ - uint32 id; //0 - uint32 icon[11]; //1-11 - float x; //12 - float y; //13 - uint32 mapId; //14 - //uint32 val1; //15 - uint32 zoneId; //16 - //char* name; //17 - name - //char* name2; //18 - name2 - uint32 worldState; //19 - //uint32 val2; //20 - //uint32 unk; //21 + uint32 ID; // 0 + uint32 AreaID[MAX_GROUP_AREA_IDS]; // 1-6 + uint32 NextAreaID; // 7 index of next group }; struct AreaTriggerEntry diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index ca4232da630..ce348d05496 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -28,7 +28,6 @@ const std::string CustomAchievementIndex = "ID"; char const AchievementCriteriafmt[] = "niiiliiiisiiiiixxiiiiii"; char const AreaTableEntryfmt[] = "iiinixxxxxisiiiiiffixxxxxx"; char const AreaGroupEntryfmt[] = "niiiiiii"; -char const AreaPOIEntryfmt[] = "niiiiiiiiiiiffixixxixx"; char const AreaTriggerEntryfmt[] = "nifffxxxfffff"; char const ArmorLocationfmt[] = "nfffff"; char const AuctionHouseEntryfmt[] = "niiix"; diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index d2d92f50be1..8eb358cdcbb 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1529,12 +1529,12 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a while (groupEntry) { for (uint8 i = 0; i < MAX_GROUP_AREA_IDS; ++i) - if (groupEntry->AreaId[i] == zone_id || groupEntry->AreaId[i] == area_id) + if (groupEntry->AreaID[i] == zone_id || groupEntry->AreaID[i] == area_id) found = true; - if (found || !groupEntry->nextGroup) + if (found || !groupEntry->NextAreaID) break; // Try search in next group - groupEntry = sAreaGroupStore.LookupEntry(groupEntry->nextGroup); + groupEntry = sAreaGroupStore.LookupEntry(groupEntry->NextAreaID); } if (!found) -- cgit v1.2.3 From 2a4f56107f6e066211eebfe85ee70a9f5a9735fb Mon Sep 17 00:00:00 2001 From: Intel Date: Sun, 9 Nov 2014 02:51:35 +0200 Subject: Core/DataStores: Even more converted dbcs --- src/server/game/Achievements/AchievementMgr.cpp | 4 +- src/server/game/Battlegrounds/Battleground.cpp | 2 +- .../game/Battlegrounds/BattlegroundQueue.cpp | 4 +- src/server/game/Chat/ChatLink.cpp | 8 +- src/server/game/DataStores/DBCStores.cpp | 37 ++--- src/server/game/DataStores/DBCStructure.h | 179 +++++++++++---------- src/server/game/DataStores/DBCfmt.h | 18 +-- src/server/game/Entities/Player/Player.cpp | 74 ++++----- src/server/game/Globals/ObjectMgr.cpp | 8 +- src/server/game/Groups/Group.cpp | 2 +- src/server/game/Maps/MapInstanced.cpp | 11 +- src/server/game/Skills/SkillDiscovery.cpp | 4 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 +- src/server/game/Spells/SpellEffects.cpp | 4 +- src/server/game/Spells/SpellInfo.cpp | 6 +- src/server/game/Spells/SpellMgr.cpp | 14 +- src/server/scripts/Commands/cs_learn.cpp | 34 ++-- src/server/scripts/Commands/cs_lookup.cpp | 2 +- src/server/scripts/Commands/cs_misc.cpp | 2 +- 19 files changed, 205 insertions(+), 212 deletions(-) (limited to 'src/server/game/Spells/SpellInfo.cpp') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 47424798ec0..fed0a00d0dc 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1342,7 +1342,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter->first); for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter) { - if (skillIter->second->skillId == achievementCriteria->learn_skillline_spell.skillLine) + if (skillIter->second->SkillLine == achievementCriteria->learn_skillline_spell.skillLine) spellCount++; } } @@ -1367,7 +1367,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, { SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter->first); for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter) - if (skillIter->second->skillId == achievementCriteria->learn_skill_line.skillLine) + if (skillIter->second->SkillLine == achievementCriteria->learn_skill_line.skillLine) spellCount++; } SetCriteriaProgress(achievementCriteria, spellCount, referencePlayer); diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 396b549c0bc..ee3cb147b9f 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1902,7 +1902,7 @@ void Battleground::StartTimedAchievement(AchievementCriteriaTimedTypes type, uin void Battleground::SetBracket(PvPDifficultyEntry const* bracketEntry) { m_BracketId = bracketEntry->GetBracketId(); - SetLevelRange(bracketEntry->minLevel, bracketEntry->maxLevel); + SetLevelRange(bracketEntry->MinLevel, bracketEntry->MaxLevel); } void Battleground::RewardXPAtKill(Player* killer, Player* victim) diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index 095446bf627..65ae7de2d8c 100644 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -201,8 +201,8 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, Battlegr uint32 MinPlayers = bg->GetMinPlayersPerTeam(); uint32 qHorde = 0; uint32 qAlliance = 0; - uint32 q_min_level = bracketEntry->minLevel; - uint32 q_max_level = bracketEntry->maxLevel; + uint32 q_min_level = bracketEntry->MinLevel; + uint32 q_max_level = bracketEntry->MaxLevel; GroupsQueueType::const_iterator itr; for (itr = m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_ALLIANCE].begin(); itr != m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_ALLIANCE].end(); ++itr) if (!(*itr)->IsInvitedToBGInstanceGUID) diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index ea6df4c984c..e671713c643 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -299,15 +299,15 @@ bool SpellChatLink::ValidateName(char* buffer, const char* context) TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): skill line ability not found for spell %u", context, _spell->Id); return false; } - SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(skillInfo->skillId); + SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(skillInfo->SkillLine); if (!skillLine) { - TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): skill line not found for skill %u", context, skillInfo->skillId); + TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): skill line not found for skill %u", context, skillInfo->SkillLine); return false; } - uint32 skillLineNameLength = strlen(skillLine->name); - if (skillLineNameLength > 0 && strncmp(skillLine->name, buffer, skillLineNameLength) == 0) + uint32 skillLineNameLength = strlen(skillLine->DisplayName_lang); + if (skillLineNameLength > 0 && strncmp(skillLine->DisplayName_lang, buffer, skillLineNameLength) == 0) { // found the prefix, remove it to perform spellname validation below // -2 = strlen(": ") diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 1acb88b9ae5..18965178656 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -515,7 +515,7 @@ void LoadDBCStores(const std::string& dataPath) for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i) if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i)) - if (entry->bracketId > MAX_BATTLEGROUND_BRACKETS) + if (entry->BracketID > MAX_BATTLEGROUND_BRACKETS) ASSERT(false && "Need update MAX_BATTLEGROUND_BRACKETS by DBC data"); LoadDBC(availableDbcLocales, bad_dbc_files, sQuestXPStore, dbcPath, "QuestXP.dbc");//15595 @@ -531,8 +531,8 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sSkillRaceClassInfoStore, dbcPath, "SkillRaceClassInfo.dbc"); for (uint32 i = 0; i < sSkillRaceClassInfoStore.GetNumRows(); ++i) if (SkillRaceClassInfoEntry const* entry = sSkillRaceClassInfoStore.LookupEntry(i)) - if (sSkillLineStore.LookupEntry(entry->SkillId)) - SkillRaceClassInfoBySkill.emplace(entry->SkillId, entry); + if (sSkillLineStore.LookupEntry(entry->SkillID)) + SkillRaceClassInfoBySkill.emplace(entry->SkillID, entry); LoadDBC(availableDbcLocales, bad_dbc_files, sSkillTiersStore, dbcPath, "SkillTiers.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sSoundEntriesStore, dbcPath, "SoundEntries.dbc");//15595 @@ -584,7 +584,7 @@ void LoadDBCStores(const std::string& dataPath) if (!skillLine) continue; - SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId); + SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->SpellID); if (!spellInfo) continue; @@ -600,10 +600,10 @@ void LoadDBCStores(const std::string& dataPath) if (!cFamily) continue; - if (skillLine->skillId != cFamily->SkillLine[0] && skillLine->skillId != cFamily->SkillLine[1]) + if (skillLine->SkillLine != cFamily->SkillLine[0] && skillLine->SkillLine != cFamily->SkillLine[1]) continue; - if (skillLine->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) + if (skillLine->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) continue; sPetFamilySpellsStore[i].insert(spellInfo->Id); @@ -1081,15 +1081,15 @@ PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 lev if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i)) { // skip unrelated and too-high brackets - if (entry->mapId != mapid || entry->minLevel > level) + if (entry->MapID != mapid || entry->MinLevel > level) continue; // exactly fit - if (entry->maxLevel >= level) + if (entry->MaxLevel >= level) return entry; // remember for possible out-of-range case (search higher from existed) - if (!maxEntry || maxEntry->maxLevel < entry->maxLevel) + if (!maxEntry || maxEntry->MaxLevel < entry->MaxLevel) maxEntry = entry; } } @@ -1101,7 +1101,7 @@ PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundB { for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i) if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i)) - if (entry->mapId == mapid && entry->GetBracketId() == id) + if (entry->MapID == mapid && entry->GetBracketId() == id) return entry; return NULL; @@ -1203,7 +1203,6 @@ uint32 ScalingStatValuesEntry::GetArmor(uint32 inventoryType, uint32 armorType) case INVTYPE_FINGER: case INVTYPE_TRINKET: case INVTYPE_WEAPON: - case INVTYPE_SHIELD: case INVTYPE_RANGED: case INVTYPE_2HWEAPON: case INVTYPE_BAG: @@ -1227,7 +1226,9 @@ uint32 ScalingStatValuesEntry::GetArmor(uint32 inventoryType, uint32 armorType) case INVTYPE_WRISTS: return Armor[7][armorType]; case INVTYPE_CLOAK: - return CloakArmor; + return ArmorBack; + case INVTYPE_SHIELD: + return ArmorShield; default: break; } @@ -1247,7 +1248,7 @@ uint32 ScalingStatValuesEntry::GetDPSAndDamageMultiplier(uint32 subClass, bool i case ITEM_SUBCLASS_WEAPON_DAGGER: case ITEM_SUBCLASS_WEAPON_THROWN: *damageMultiplier = 0.3f; - return dpsMod[0]; + return DPSMod[0]; case ITEM_SUBCLASS_WEAPON_AXE2: case ITEM_SUBCLASS_WEAPON_MACE2: case ITEM_SUBCLASS_WEAPON_POLEARM: @@ -1255,12 +1256,12 @@ uint32 ScalingStatValuesEntry::GetDPSAndDamageMultiplier(uint32 subClass, bool i case ITEM_SUBCLASS_WEAPON_STAFF: case ITEM_SUBCLASS_WEAPON_FISHING_POLE: *damageMultiplier = 0.2f; - return dpsMod[1]; + return DPSMod[1]; case ITEM_SUBCLASS_WEAPON_BOW: case ITEM_SUBCLASS_WEAPON_GUN: case ITEM_SUBCLASS_WEAPON_CROSSBOW: *damageMultiplier = 0.3f; - return dpsMod[4]; + return DPSMod[4]; case ITEM_SUBCLASS_WEAPON_Obsolete: case ITEM_SUBCLASS_WEAPON_EXOTIC: case ITEM_SUBCLASS_WEAPON_EXOTIC2: @@ -1280,17 +1281,17 @@ uint32 ScalingStatValuesEntry::GetDPSAndDamageMultiplier(uint32 subClass, bool i if (mask & 0x562) { *damageMultiplier = 0.2f; - return dpsMod[3]; + return DPSMod[3]; } if (mask & (1 << ITEM_SUBCLASS_WEAPON_WAND)) { *damageMultiplier = 0.3f; - return dpsMod[5]; + return DPSMod[5]; } } *damageMultiplier = 0.3f; - return dpsMod[2]; + return DPSMod[2]; } return 0; } diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index b9a891ccec4..22bf5f20317 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1628,80 +1628,80 @@ struct NameGenEntry struct OverrideSpellDataEntry { - uint32 id; // 0 - uint32 spellId[MAX_OVERRIDE_SPELL]; // 1-10 - //uint32 unk0; // 11 - //char* SpellBarName; // 12 + uint32 ID; // 0 + uint32 SpellID[MAX_OVERRIDE_SPELL]; // 1-10 + //uint32 Flags; // 11 + //char* PlayerActionbarFileDataID; // 12 }; struct PowerDisplayEntry { - uint32 Id; // 0 - uint32 PowerType; // 1 - //char* Name; // 2 - //uint32 R; // 3 - //uint32 G; // 4 - //uint32 B; // 5 + uint32 ID; // 0 + uint32 PowerType; // 1 + //char* GlobalStringBaseTag; // 2 + //uint8 Red; // 3 + //uint8 Green; // 3 + //uint8 Blue; // 3 + //uint8 _padding0; // 3 }; struct PvPDifficultyEntry { - //uint32 id; // 0 m_ID - uint32 mapId; // 1 - uint32 bracketId; // 2 - uint32 minLevel; // 3 - uint32 maxLevel; // 4 - uint32 difficulty; // 5 + //uint32 ID; // 0 + uint32 MapID; // 1 + uint32 BracketID; // 2 m_rangeIndex + uint32 MinLevel; // 3 + uint32 MaxLevel; // 4 // helpers - BattlegroundBracketId GetBracketId() const { return BattlegroundBracketId(bracketId); } + BattlegroundBracketId GetBracketId() const { return BattlegroundBracketId(BracketID); } }; struct QuestSortEntry { - uint32 id; // 0 m_ID - //char* name; // 1 m_SortName_lang + uint32 ID; // 0 + //char* SortName_lang; // 1 }; struct QuestXPEntry { - uint32 id; - uint32 Exp[10]; + uint32 ID; // 0 + uint32 Exp[10]; // 1 }; struct QuestFactionRewEntry { - uint32 id; - int32 QuestRewFactionValue[10]; + uint32 ID; // 0 + int32 QuestRewFactionValue[10]; // 1-10 }; struct RandomPropertiesPointsEntry { - //uint32 Id; // 0 hidden key - uint32 itemLevel; // 1 - uint32 EpicPropertiesPoints[5]; // 2-6 - uint32 RarePropertiesPoints[5]; // 7-11 - uint32 UncommonPropertiesPoints[5]; // 12-16 + uint32 ItemLevel; // 0 + uint32 EpicPropertiesPoints[5]; // 1-5 + uint32 RarePropertiesPoints[5]; // 6-10 + uint32 UncommonPropertiesPoints[5]; // 11-15 }; struct ScalingStatDistributionEntry { - uint32 Id; // 0 - int32 StatMod[10]; // 1-10 - uint32 Modifier[10]; // 11-20 - //uint32 unk1; // 21 - uint32 MaxLevel; // 22 m_maxlevel + uint32 ID; // 0 + int32 StatID[10]; // 1-10 + uint32 Modifier[10]; // 11-20 + //uint32 MinLevel; // 21 + uint32 MaxLevel; // 22 m_maxlevel }; struct ScalingStatValuesEntry { - uint32 Id; // 0 - uint32 Level; // 1 - uint32 dpsMod[6]; // 2-7 DPS mod for level - uint32 Spellpower; // 8 spell power for level - uint32 StatMultiplier[5]; // 9-13 Multiplier for ScalingStatDistribution - uint32 Armor[8][4]; // 14-46 Armor for level - uint32 CloakArmor; // 47 armor for cloak + uint32 ID; // 0 + uint32 CharLevel; // 1 + uint32 DPSMod[6]; // 2-7 DPS mod for level + uint32 SpellPower; // 8 spell power for level + uint32 StatMultiplier[5]; // 9-13 Multiplier for ScalingStatDistribution + uint32 Armor[8][4]; // 14-46 Armor for level + uint32 ArmorBack; // 47 + uint32 ArmorShield; // 48 uint32 GetStatMultiplier(uint32 inventoryType) const; uint32 GetArmor(uint32 inventoryType, uint32 armorType) const; @@ -1717,73 +1717,74 @@ struct ScalingStatValuesEntry struct SkillLineEntry { - uint32 id; // 0 m_ID - int32 categoryId; // 1 m_categoryID - //uint32 skillCostID; // 2 m_skillCostsID - char* name; // 3 m_displayName_lang - //char* description; // 4 m_description_lang - uint32 spellIcon; // 5 m_spellIconID - //char* alternateVerb; // 6 m_alternateVerb_lang - uint32 canLink; // 7 m_canLink (prof. with recipes) + uint32 ID; // 0 m_ID + int32 CategoryID; // 1 m_categoryID + char* DisplayName_lang; // 2 m_displayName_lang + //char* Description_lang; // 3 m_description_lang + uint32 SpellIconID; // 4 m_spellIconID + //char* AlternateVerb_lang; // 5 m_alternateVerb_lang + uint32 CanLink; // 6 m_canLink (prof. with recipes) + //uint32 ParentSkillLineID; // 7 + //uint32 Flags; // 8 }; struct SkillLineAbilityEntry { - uint32 id; // 0 m_ID - uint32 skillId; // 1 m_skillLine - uint32 spellId; // 2 m_spell - uint32 racemask; // 3 m_raceMask - uint32 classmask; // 4 m_classMask - //uint32 racemaskNot; // 5 m_excludeRace - //uint32 classmaskNot; // 6 m_excludeClass - uint32 req_skill_value; // 7 m_minSkillLineRank - uint32 forward_spellid; // 8 m_supercededBySpell - uint32 AutolearnType; // 9 m_acquireMethod - uint32 max_value; // 10 m_trivialSkillLineRankHigh - uint32 min_value; // 11 m_trivialSkillLineRankLow - uint32 character_points[2]; // 12-13 m_characterPoints + uint32 ID; // 0 + uint32 SkillLine; // 1 + uint32 SpellID; // 2 + uint32 RaceMask; // 3 + uint32 ClassMask; // 4 + uint32 MinSkillLineRank; // 7 + uint32 SupercedesSpell; // 8 + uint32 AquireMethod; // 9 + uint32 TrivialSkillLineRankHigh; // 10 + uint32 TrivialSkillLineRankLow; // 11 + uint32 NumSkillUps; // 12 + uint32 UniqueBit; // 13 + uint32 TradeSkillCategoryID; // 14 }; struct SkillRaceClassInfoEntry { - //uint32 Id; // 0 m_ID - uint32 SkillId; // 1 m_skillID - uint32 RaceMask; // 2 m_raceMask - uint32 ClassMask; // 3 m_classMask - uint32 Flags; // 4 m_flags - //uint32 Unk; // 5 m_unk - //uint32 MinLevel; // 6 m_minLevel - uint32 SkillTier; // 7 m_skillTierID - //uint32 SkillCostType; // 8 m_skillCostIndex + //uint32 ID; // 0 + uint32 SkillID; // 1 + uint32 RaceMask; // 2 + uint32 ClassMask; // 3 + uint32 Flags; // 4 + //uint32 Availability; // 5 + //uint32 MinLevel; // 6 + uint32 SkillTierID; // 7 }; #define MAX_SKILL_STEP 16 struct SkillTiersEntry { - uint32 Id; // 0 m_ID - //uint32 StepCost[MAX_SKILL_STEP]; // 1-16 m_cost - uint32 MaxSkill[MAX_SKILL_STEP]; // 17-32 m_valueMax + uint32 ID; // 0 + uint32 Value[MAX_SKILL_STEP]; // 1-16 }; struct SoundEntriesEntry { - uint32 Id; // 0 m_ID - //uint32 Type; // 1 m_soundType - //char* InternalName; // 2 m_name - //char* FileName[10]; // 3-12 m_File[10] - //uint32 Unk13[10]; // 13-22 m_Freq[10] - //char* Path; // 23 m_DirectoryBase - // 24 m_volumeFloat - // 25 m_flags - // 26 m_minDistance - // 27 m_distanceCutoff - // 28 m_EAXDef - // 29 m_soundEntriesAdvancedID, new in 3.1 - //unk // 30 4.0.0 - //unk // 31 4.0.0 - //unk // 32 4.0.0 - //unk // 33 4.0.0 + uint32 ID; // 0 + //uint32 SoundType; // 1 + //char* Name; // 2 + //uint32 FileDataID[20]; // 3-22 + //uint32 Freq[20]; // 23-42 + //float VolumeFloat; // 43 + //uint32 Flags; // 44 + //float MinDistance; // 45 + //float DistanceCutoff; // 46 + //uint32 EAXDef; // 47 + //uint32 SoundEntriesAdvancedID; // 48 + //float VolumeVariationPlus; // 49 + //float VolumeVariationMinus; // 50 + //float PitchVariationPlus; // 51 + //float PitchVariationMinus; // 52 + //float PitchAdjust; // 53 + //uint32 DialogType; // 54 + //uint32 BusOverwriteID; // 55 }; // SpellEffect.dbc diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index d01d33ac685..84e98751a28 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -115,16 +115,16 @@ char const OverrideSpellDatafmt[] = "niiiiiiiiiixx"; char const QuestFactionRewardfmt[] = "niiiiiiiiii"; char const QuestSortEntryfmt[] = "nx"; char const QuestXPfmt[] = "niiiiiiiiii"; -char const PowerDisplayfmt[] = "nixxxx"; -char const PvPDifficultyfmt[] = "diiiii"; -char const RandomPropertiesPointsfmt[] = "niiiiiiiiiiiiiii"; +char const PowerDisplayfmt[] = "nixx"; +char const PvPDifficultyfmt[] = "diiii"; +char const RandomPropertiesPointsfmt[] = "niiiiiiiiiiiiii"; char const ScalingStatDistributionfmt[] = "niiiiiiiiiiiiiiiiiiiixi"; -char const ScalingStatValuesfmt[] = "iniiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii"; -char const SkillLinefmt[] = "nisxixi"; -char const SkillLineAbilityfmt[] = "niiiixxiiiiiii"; -char const SkillRaceClassInfofmt[] = "diiiixxix"; -char const SkillTiersfmt[] = "nxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiii"; -char const SoundEntriesfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +char const ScalingStatValuesfmt[] = "iniiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii"; +char const SkillLinefmt[] = "nisxixixx"; +char const SkillLineAbilityfmt[] = "niiiiiiiiiiii"; +char const SkillRaceClassInfofmt[] = "diiiixxi"; +char const SkillTiersfmt[] = "niiiiiiiiiiiiiiii"; +char const SoundEntriesfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; char const SpellCastTimefmt[] = "nixx"; char const SpellCategoriesEntryfmt[] = "diiiiii"; char const SpellCategoryfmt[] = "nixx"; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b01b602449e..139b36a35da 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3687,13 +3687,13 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent // not ranked skills for (SkillLineAbilityMap::const_iterator _spell_idx = skill_bounds.first; _spell_idx != skill_bounds.second; ++_spell_idx) { - SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(_spell_idx->second->skillId); + SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(_spell_idx->second->SkillLine); if (!pSkill) continue; ///@todo: confirm if rogues start with lockpicking skill at level 1 but only receive the spell to use it at level 16 - if ((_spell_idx->second->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && !HasSkill(pSkill->id)) || (pSkill->id == SKILL_LOCKPICKING && _spell_idx->second->max_value == 0)) - LearnDefaultSkill(pSkill->id, 0); + if ((_spell_idx->second->AquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && !HasSkill(pSkill->ID)) || (pSkill->ID == SKILL_LOCKPICKING && _spell_idx->second->TrivialSkillLineRankHigh == 0)) + LearnDefaultSkill(pSkill->ID, 0); } } } @@ -3717,8 +3717,8 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent // not ranked skills for (SkillLineAbilityMap::const_iterator _spell_idx = skill_bounds.first; _spell_idx != skill_bounds.second; ++_spell_idx) { - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE, _spell_idx->second->skillId); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS, _spell_idx->second->skillId); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE, _spell_idx->second->SkillLine); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS, _spell_idx->second->SkillLine); } UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL, spellId); @@ -5858,24 +5858,24 @@ bool Player::UpdateCraftSkill(uint32 spellid) for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) { - if (_spell_idx->second->skillId) + if (_spell_idx->second->SkillLine) { - uint32 SkillValue = GetPureSkillValue(_spell_idx->second->skillId); + uint32 SkillValue = GetPureSkillValue(_spell_idx->second->SkillLine); // Alchemy Discoveries here SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(spellid); if (spellEntry && spellEntry->Mechanic == MECHANIC_DISCOVERY) { - if (uint32 discoveredSpell = GetSkillDiscoverySpell(_spell_idx->second->skillId, spellid, this)) + if (uint32 discoveredSpell = GetSkillDiscoverySpell(_spell_idx->second->SkillLine, spellid, this)) LearnSpell(discoveredSpell, false); } uint32 craft_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_CRAFTING); - return UpdateSkillPro(_spell_idx->second->skillId, SkillGainChance(SkillValue, - _spell_idx->second->max_value, - (_spell_idx->second->max_value + _spell_idx->second->min_value)/2, - _spell_idx->second->min_value), + return UpdateSkillPro(_spell_idx->second->SkillLine, SkillGainChance(SkillValue, + _spell_idx->second->TrivialSkillLineRankHigh, + (_spell_idx->second->TrivialSkillLineRankHigh + _spell_idx->second->TrivialSkillLineRankLow)/2, + _spell_idx->second->TrivialSkillLineRankLow), craft_skill_gain); } } @@ -6015,7 +6015,7 @@ void Player::UpdateSkillsForLevel() if (GetSkillRangeType(rcEntry) != SKILL_RANGE_LEVEL) continue; - if (IsWeaponSkill(rcEntry->SkillId)) + if (IsWeaponSkill(rcEntry->SkillID)) continue; uint16 field = itr->second.pos / 2; @@ -6047,10 +6047,10 @@ void Player::UpdateSkillsToMaxSkillsForLevel() if (!rcEntry) continue; - if (IsProfessionOrRidingSkill(rcEntry->SkillId)) + if (IsProfessionOrRidingSkill(rcEntry->SkillID)) continue; - if (IsWeaponSkill(rcEntry->SkillId)) + if (IsWeaponSkill(rcEntry->SkillID)) continue; uint16 field = itr->second.pos / 2; @@ -6128,8 +6128,8 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal) // remove all spells that related to this skill for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) if (SkillLineAbilityEntry const* pAbility = sSkillLineAbilityStore.LookupEntry(j)) - if (pAbility->skillId == id) - RemoveSpell(sSpellMgr->GetFirstSpellInChain(pAbility->spellId)); + if (pAbility->SkillLine == id) + RemoveSpell(sSpellMgr->GetFirstSpellInChain(pAbility->SpellID)); // Clear profession lines if (GetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1) == id) @@ -6156,7 +6156,7 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal) } SetUInt16Value(PLAYER_SKILL_LINEID + SKILL_ID_OFFSET + field, offset, id); - if (skillEntry->categoryId == SKILL_CATEGORY_PROFESSION) + if (skillEntry->CategoryID == SKILL_CATEGORY_PROFESSION) { if (!GetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1)) SetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1, id); @@ -7882,9 +7882,9 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply // If set ScalingStatDistribution need get stats and values from it if (ssd && ssv) { - if (ssd->StatMod[i] < 0) + if (ssd->StatID[i] < 0) continue; - statType = ssd->StatMod[i]; + statType = ssd->StatID[i]; val = (ssv->GetStatMultiplier(proto->InventoryType) * ssd->Modifier[i]) / 10000; } else @@ -8060,7 +8060,7 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply // Apply Spell Power from ScalingStatValue if set if (ssv && proto->Flags2 & ITEM_FLAGS_EXTRA_CASTER_WEAPON) - if (int32 spellbonus = int32(ssv->Spellpower)) + if (int32 spellbonus = int32(ssv->SpellPower)) ApplySpellPowerBonus(spellbonus, apply); // If set ScalingStatValue armor get it or use item armor @@ -23490,8 +23490,8 @@ void Player::LearnDefaultSkill(uint32 skillId, uint16 rank) if (!rank) break; - SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcInfo->SkillTier); - uint16 maxValue = tier->MaxSkill[std::max(rank - 1, 0)]; + SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcInfo->SkillTierID); + uint16 maxValue = tier->Value[std::max(rank - 1, 0)]; uint16 skillValue = 1; if (rcInfo->Flags & SKILL_FLAG_ALWAYS_MAX_VALUE) skillValue = maxValue; @@ -23606,31 +23606,31 @@ void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue) for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) { SkillLineAbilityEntry const* ability = sSkillLineAbilityStore.LookupEntry(j); - if (!ability || ability->skillId != skillId) + if (!ability || ability->SkillLine != skillId) continue; - if (!sSpellMgr->GetSpellInfo(ability->spellId)) + if (!sSpellMgr->GetSpellInfo(ability->SpellID)) continue; - if (ability->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE && ability->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) + if (ability->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE && ability->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) continue; // Check race if set - if (ability->racemask && !(ability->racemask & raceMask)) + if (ability->RaceMask && !(ability->RaceMask & raceMask)) continue; // Check class if set - if (ability->classmask && !(ability->classmask & classMask)) + if (ability->ClassMask && !(ability->ClassMask & classMask)) continue; // need unlearn spell - if (skillValue < ability->req_skill_value && ability->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE) - RemoveSpell(ability->spellId); + if (skillValue < ability->MinSkillLineRank && ability->AquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE) + RemoveSpell(ability->SpellID); // need learn else if (!IsInWorld()) - AddSpell(ability->spellId, true, true, true, false, false, true); + AddSpell(ability->SpellID, true, true, true, false, false, true); else - LearnSpell(ability->spellId, true, true); + LearnSpell(ability->SpellID, true, true); } } @@ -23897,11 +23897,11 @@ bool Player::IsSpellFitByClassAndRace(uint32 spell_id) const for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) { // skip wrong race skills - if (_spell_idx->second->racemask && (_spell_idx->second->racemask & racemask) == 0) + if (_spell_idx->second->RaceMask && (_spell_idx->second->RaceMask & racemask) == 0) continue; // skip wrong class skills - if (_spell_idx->second->classmask && (_spell_idx->second->classmask & classmask) == 0) + if (_spell_idx->second->ClassMask && (_spell_idx->second->ClassMask & classmask) == 0) continue; return true; @@ -25418,13 +25418,13 @@ void Player::_LoadSkills(PreparedQueryResult result) SetUInt16Value(PLAYER_SKILL_LINEID + SKILL_ID_OFFSET + field, offset, skill); uint16 step = 0; - SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(rcEntry->SkillId); + SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(rcEntry->SkillID); if (skillLine) { - if (skillLine->categoryId == SKILL_CATEGORY_SECONDARY) + if (skillLine->CategoryID == SKILL_CATEGORY_SECONDARY) step = max / 75; - if (skillLine->categoryId == SKILL_CATEGORY_PROFESSION) + if (skillLine->CategoryID == SKILL_CATEGORY_PROFESSION) { step = max / 75; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 0e5c82510b4..97e2a40a02f 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -7865,17 +7865,17 @@ int32 ObjectMgr::GetBaseReputationOf(FactionEntry const* factionEntry, uint8 rac SkillRangeType GetSkillRangeType(SkillRaceClassInfoEntry const* rcEntry) { - SkillLineEntry const* skill = sSkillLineStore.LookupEntry(rcEntry->SkillId); + SkillLineEntry const* skill = sSkillLineStore.LookupEntry(rcEntry->SkillID); if (!skill) return SKILL_RANGE_NONE; - if (sSkillTiersStore.LookupEntry(rcEntry->SkillTier)) + if (sSkillTiersStore.LookupEntry(rcEntry->SkillTierID)) return SKILL_RANGE_RANK; - if (rcEntry->SkillId == SKILL_RUNEFORGING) + if (rcEntry->SkillID == SKILL_RUNEFORGING) return SKILL_RANGE_MONO; - switch (skill->categoryId) + switch (skill->CategoryID) { case SKILL_CATEGORY_ARMOR: return SKILL_RANGE_MONO; diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 8795bd812de..2aa40942171 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1881,7 +1881,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* if (member->GetTeam() != team) return ERR_BATTLEGROUND_JOIN_TIMED_OUT; // not in the same battleground level braket, don't let join - PvPDifficultyEntry const* memberBracketEntry = GetBattlegroundBracketByLevel(bracketEntry->mapId, member->getLevel()); + PvPDifficultyEntry const* memberBracketEntry = GetBattlegroundBracketByLevel(bracketEntry->MapID, member->getLevel()); if (memberBracketEntry != bracketEntry) return ERR_BATTLEGROUND_JOIN_RANGE_INDEX; // don't let join rated matches if the arena team id doesn't match diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index 498c669ba01..8dfa4449e12 100644 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -227,16 +227,7 @@ BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battlegroun TC_LOG_DEBUG("maps", "MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId()); - PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), bg->GetMinLevel()); - - uint8 spawnMode; - - if (bracketEntry) - spawnMode = bracketEntry->difficulty; - else - spawnMode = REGULAR_DIFFICULTY; - - BattlegroundMap* map = new BattlegroundMap(GetId(), GetGridExpiry(), InstanceId, this, spawnMode); + BattlegroundMap* map = new BattlegroundMap(GetId(), GetGridExpiry(), InstanceId, this, REGULAR_DIFFICULTY); ASSERT(map->IsBattlegroundOrArena()); map->SetBG(bg); bg->SetBgMap(map); diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp index e8a89039031..4d9800acedd 100644 --- a/src/server/game/Skills/SkillDiscovery.cpp +++ b/src/server/game/Skills/SkillDiscovery.cpp @@ -122,7 +122,7 @@ void LoadSkillDiscoveryTable() } for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) - SkillDiscoveryStore[-int32(_spell_idx->second->skillId)].push_back(SkillDiscoveryEntry(spellId, reqSkillValue, chance)); + SkillDiscoveryStore[-int32(_spell_idx->second->SkillLine)].push_back(SkillDiscoveryEntry(spellId, reqSkillValue, chance)); } else { @@ -164,7 +164,7 @@ uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player) return 0; SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId); - uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->skillId) : uint32(0); + uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->SkillLine) : uint32(0); float full_chance = 0; for (SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index c8fbbcbec53..ef83bdced50 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5293,7 +5293,7 @@ void AuraEffect::HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 m target->SetUInt16Value(PLAYER_FIELD_BYTES2, 0, overrideId); if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId)) for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i) - if (uint32 spellId = overrideSpells->spellId[i]) + if (uint32 spellId = overrideSpells->SpellID[i]) target->AddTemporarySpell(spellId); } else @@ -5301,7 +5301,7 @@ void AuraEffect::HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 m target->SetUInt16Value(PLAYER_FIELD_BYTES2, 0, 0); if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId)) for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i) - if (uint32 spellId = overrideSpells->spellId[i]) + if (uint32 spellId = overrideSpells->SpellID[i]) target->RemoveTemporarySpell(spellId); } } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 0f84226cf06..c441bd9b3f7 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2447,12 +2447,12 @@ void Spell::EffectLearnSkill(SpellEffIndex effIndex) if (!rcEntry) return; - SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcEntry->SkillTier); + SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcEntry->SkillTierID); if (!tier) return; uint16 skillval = unitTarget->ToPlayer()->GetPureSkillValue(skillid); - unitTarget->ToPlayer()->SetSkill(skillid, m_spellInfo->Effects[effIndex].CalcValue(), std::max(skillval, 1), tier->MaxSkill[damage - 1]); + unitTarget->ToPlayer()->SetSkill(skillid, m_spellInfo->Effects[effIndex].CalcValue(), std::max(skillval, 1), tier->Value[damage - 1]); } void Spell::EffectPlayMovie(SpellEffIndex effIndex) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 8eb358cdcbb..917f69547a1 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1131,10 +1131,10 @@ bool SpellInfo::IsAbilityLearnedWithProfession() const for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) { SkillLineAbilityEntry const* pAbility = _spell_idx->second; - if (!pAbility || pAbility->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE) + if (!pAbility || pAbility->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE) continue; - if (pAbility->req_skill_value > 0) + if (pAbility->MinSkillLineRank > 0) return true; } @@ -1146,7 +1146,7 @@ bool SpellInfo::IsAbilityOfSkillType(uint32 skillType) const SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(Id); for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) - if (_spell_idx->second->skillId == uint32(skillType)) + if (_spell_idx->second->SkillLine == uint32(skillType)) return true; return false; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 7aebc202d81..4463fc0da75 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -35,20 +35,20 @@ bool IsPrimaryProfessionSkill(uint32 skill) { SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(skill); - return pSkill && pSkill->categoryId == SKILL_CATEGORY_PROFESSION; + return pSkill && pSkill->CategoryID == SKILL_CATEGORY_PROFESSION; } bool IsWeaponSkill(uint32 skill) { SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(skill); - return pSkill && pSkill->categoryId == SKILL_CATEGORY_WEAPON; + return pSkill && pSkill->CategoryID == SKILL_CATEGORY_WEAPON; } bool IsPartOfSkillLine(uint32 skillId, uint32 spellId) { SkillLineAbilityMapBounds skillBounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId); for (SkillLineAbilityMap::const_iterator itr = skillBounds.first; itr != skillBounds.second; ++itr) - if (itr->second->skillId == skillId) + if (itr->second->SkillLine == skillId) return true; return false; @@ -2207,7 +2207,7 @@ void SpellMgr::LoadSkillLineAbilityMap() if (!SkillInfo) continue; - mSkillLineAbilityMap.insert(SkillLineAbilityMap::value_type(SkillInfo->spellId, SkillInfo)); + mSkillLineAbilityMap.insert(SkillLineAbilityMap::value_type(SkillInfo->SpellID, SkillInfo)); ++count; } @@ -2445,13 +2445,13 @@ void SpellMgr::LoadPetLevelupSpellMap() // (!creatureFamily->SkillLine[1] || skillLine->skillId != creatureFamily->SkillLine[1])) // continue; - if (skillLine->skillId != creatureFamily->SkillLine[j]) + if (skillLine->SkillLine != creatureFamily->SkillLine[j]) continue; - if (skillLine->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) + if (skillLine->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) continue; - SpellInfo const* spell = GetSpellInfo(skillLine->spellId); + SpellInfo const* spell = GetSpellInfo(skillLine->SpellID); if (!spell) // not exist or triggered or talent continue; diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index bed6715fec1..eb5be0950aa 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -160,7 +160,7 @@ public: if (!entry) continue; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(entry->spellId); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(entry->SpellID); if (!spellInfo) continue; @@ -352,10 +352,10 @@ public: if (!skillInfo) continue; - if ((skillInfo->categoryId == SKILL_CATEGORY_PROFESSION || skillInfo->categoryId == SKILL_CATEGORY_SECONDARY) && - skillInfo->canLink) // only prof. with recipes have + if ((skillInfo->CategoryID == SKILL_CATEGORY_PROFESSION || skillInfo->CategoryID == SKILL_CATEGORY_SECONDARY) && + skillInfo->CanLink) // only prof. with recipes have { - HandleLearnSkillRecipesHelper(target, skillInfo->id); + HandleLearnSkillRecipesHelper(target, skillInfo->ID); } } @@ -395,12 +395,12 @@ public: if (!skillInfo) continue; - if ((skillInfo->categoryId != SKILL_CATEGORY_PROFESSION && - skillInfo->categoryId != SKILL_CATEGORY_SECONDARY) || - !skillInfo->canLink) // only prof with recipes have set + if ((skillInfo->CategoryID != SKILL_CATEGORY_PROFESSION && + skillInfo->CategoryID != SKILL_CATEGORY_SECONDARY) || + !skillInfo->CanLink) // only prof with recipes have set continue; - name = skillInfo->name; + name = skillInfo->DisplayName_lang; if (name.empty()) continue; @@ -413,10 +413,10 @@ public: if (!targetSkillInfo) return false; - HandleLearnSkillRecipesHelper(target, targetSkillInfo->id); + HandleLearnSkillRecipesHelper(target, targetSkillInfo->ID); - uint16 maxLevel = target->GetPureMaxSkillValue(targetSkillInfo->id); - target->SetSkill(targetSkillInfo->id, target->GetSkillStep(targetSkillInfo->id), maxLevel, maxLevel); + uint16 maxLevel = target->GetPureMaxSkillValue(targetSkillInfo->ID); + target->SetSkill(targetSkillInfo->ID, target->GetSkillStep(targetSkillInfo->ID), maxLevel, maxLevel); handler->PSendSysMessage(LANG_COMMAND_LEARN_ALL_RECIPES, name.c_str()); return true; } @@ -432,26 +432,26 @@ public: continue; // wrong skill - if (skillLine->skillId != skillId) + if (skillLine->SkillLine != skillId) continue; // not high rank - if (skillLine->forward_spellid) + if (skillLine->SupercedesSpell) continue; // skip racial skills - if (skillLine->racemask != 0) + if (skillLine->RaceMask != 0) continue; // skip wrong class skills - if (skillLine->classmask && (skillLine->classmask & classmask) == 0) + if (skillLine->ClassMask && (skillLine->ClassMask & classmask) == 0) continue; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(skillLine->spellId); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(skillLine->SpellID); if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, player, false)) continue; - player->LearnSpell(skillLine->spellId, false); + player->LearnSpell(skillLine->SpellID, false); } } diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 67505e713de..7d8fec52143 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -724,7 +724,7 @@ public: SkillLineEntry const* skillInfo = sSkillLineStore.LookupEntry(id); if (skillInfo) { - std::string name = skillInfo->name; + std::string name = skillInfo->DisplayName_lang; if (name.empty()) continue; diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index d51150edb66..4c2b7d40a89 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1359,7 +1359,7 @@ public: // add the skill to the player's book with step 1 (which is the first rank, in most cases something // like 'Apprentice '. target->SetSkill(skill, targetHasSkill ? target->GetSkillStep(skill) : 1, level, max); - handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name, handler->GetNameLink(target).c_str(), level, max); + handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->DisplayName_lang, handler->GetNameLink(target).c_str(), level, max); return true; } -- cgit v1.2.3 From f847f55385cd1babc67d701d49f180242c63e83e Mon Sep 17 00:00:00 2001 From: Intel Date: Sun, 9 Nov 2014 23:53:48 +0200 Subject: Core/DataStores: Updating spells dbc part 1 --- src/server/game/DataStores/DB2Stores.cpp | 4 + src/server/game/DataStores/DB2Stores.h | 2 + src/server/game/DataStores/DB2Structure.h | 41 +++++ src/server/game/DataStores/DB2fmt.h | 2 + src/server/game/DataStores/DBCStores.cpp | 12 +- src/server/game/DataStores/DBCStores.h | 1 - src/server/game/DataStores/DBCStructure.h | 205 +++++++++------------ src/server/game/DataStores/DBCfmt.h | 13 +- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Entities/Unit/StatSystem.cpp | 4 +- src/server/game/Entities/Unit/Unit.cpp | 20 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 35 ++-- src/server/game/Spells/Auras/SpellAuraEffects.h | 8 +- src/server/game/Spells/Auras/SpellAuras.cpp | 8 +- src/server/game/Spells/Spell.cpp | 10 +- src/server/game/Spells/SpellInfo.cpp | 156 ++++++++-------- src/server/game/Spells/SpellInfo.h | 33 ++-- src/server/game/Spells/SpellMgr.cpp | 20 +- .../boss_icecrown_gunship_battle.cpp | 2 +- src/server/scripts/Spells/spell_dk.cpp | 2 +- src/server/scripts/Spells/spell_rogue.cpp | 2 +- src/server/scripts/Spells/spell_warlock.cpp | 2 +- src/server/scripts/Spells/spell_warrior.cpp | 2 +- src/server/shared/Utilities/Util.h | 140 +++++++++++++- 25 files changed, 451 insertions(+), 277 deletions(-) (limited to 'src/server/game/Spells/SpellInfo.cpp') 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 sItemCurrencyCostStore(ItemCurrencyCostfmt); DB2Storage sItemExtendedCostStore(ItemExtendedCostEntryfmt); DB2Storage sItemSparseStore(ItemSparsefmt, &DB2Utilities::HasItemSparseEntry, &DB2Utilities::WriteItemSparseDbReply); DB2Storage sKeyChainStore(KeyChainfmt); +DB2Storage sSpellAuraRestrictionsStore(SpellAuraRestrictionsEntryfmt); +DB2Storage sSpellMiscStore(SpellMiscEntryfmt); typedef std::list 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 sItemCurrencyCostStore; extern DB2Storage sItemExtendedCostStore; extern DB2Storage sItemSparseStore; extern DB2Storage sKeyChainStore; +extern DB2Storage sSpellAuraRestrictionsStore; +extern DB2Storage 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 sSpellEquippedItemsStore(SpellEquippedItems DBCStorage sSpellClassOptionsStore(SpellClassOptionsEntryfmt); DBCStorage sSpellCooldownsStore(SpellCooldownsEntryfmt); DBCStorage sSpellAuraOptionsStore(SpellAuraOptionsEntryfmt); -DBCStorage sSpellAuraRestrictionsStore(SpellAuraRestrictionsEntryfmt); DBCStorage sSpellCastingRequirementsStore(SpellCastingRequirementsEntryfmt); DBCStorage sSpellCastTimesStore(SpellCastTimefmt); DBCStorage 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 sSpellShapeshiftStore; extern DBCStorage sSpellShapeshiftFormStore; extern DBCStorage sSpellStore; extern DBCStorage sSpellAuraOptionsStore; -extern DBCStorage sSpellAuraRestrictionsStore; extern DBCStorage sSpellCastingRequirementsStore; extern DBCStorage sSpellCategoriesStore; extern DBCStorage 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 SpellCategorySet; @@ -1938,18 +1910,21 @@ typedef std::map 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 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* 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 #include #include +#include template struct Optional @@ -388,7 +389,142 @@ class HookList } }; -class flag96 +template +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& 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& 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& right) const + { + return !this->operator ==(right); + } + + inline flag& operator =(const flag& right) + { + for (uint8 i = 0; i < T_size; ++i) + part[i] = right.part[i]; + return *this; + } + + inline flag operator &(const flag &right) const + { + flag fl; + for (uint8 i = 0; i < T_size; ++i) + fl.part[i] = part[i] & right.part[i]; + return fl; + } + + inline flag& operator &=(const flag &right) + { + for (uint8 i = 0; i < T_size; ++i) + part[i] &= right.part[i]; + return *this; + } + + inline flag operator |(const flag &right) const + { + flag fl; + for (uint8 i = 0; i < T_size; ++i) + fl.part[i] = part[i] | right.part[i]; + return fl; + } + + inline flag& operator |=(const flag &right) + { + for (uint8 i = 0; i < T_size; ++i) + part[i] |= right.part[i]; + return *this; + } + + inline flag operator ~() const + { + flag fl; + for (uint8 i = 0; i < T_size; ++i) + fl.part[i] = ~part[i]; + return fl; + } + + inline flag operator ^(const flag& right) const + { + flag fl; + for (uint8 i = 0; i < T_size; ++i) + fl.part[i] = part[i] ^ right.part[i]; + return fl; + } + + inline flag& operator ^=(const flag& 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 { -- cgit v1.2.3 From 43d5fb5eaefeafb34bea10ff5c6a2878c6c14df1 Mon Sep 17 00:00:00 2001 From: Intel Date: Mon, 10 Nov 2014 02:51:55 +0200 Subject: Core/DataStores: Updating spells dbc part 2 --- src/server/game/AI/CoreAI/UnitAI.cpp | 2 +- src/server/game/DataStores/DB2Stores.cpp | 22 +- src/server/game/DataStores/DB2Stores.h | 4 + src/server/game/DataStores/DB2Structure.h | 47 ++++ src/server/game/DataStores/DB2fmt.h | 6 +- src/server/game/DataStores/DBCStores.cpp | 13 +- src/server/game/DataStores/DBCStores.h | 5 - src/server/game/DataStores/DBCStructure.h | 244 +++++++++------------ src/server/game/DataStores/DBCfmt.h | 24 +- src/server/game/Entities/Item/Item.cpp | 20 +- src/server/game/Entities/Player/Player.cpp | 70 +++--- src/server/game/Entities/Unit/StatSystem.cpp | 2 +- src/server/game/Entities/Unit/Unit.cpp | 22 +- src/server/game/Handlers/ItemHandler.cpp | 4 +- .../game/Server/Packets/CharacterPackets.cpp | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 8 +- src/server/game/Spells/Spell.cpp | 10 +- src/server/game/Spells/SpellEffects.cpp | 2 +- src/server/game/Spells/SpellInfo.cpp | 57 ++--- src/server/game/Spells/SpellMgr.cpp | 9 +- src/server/scripts/Spells/spell_rogue.cpp | 10 +- 21 files changed, 301 insertions(+), 282 deletions(-) (limited to 'src/server/game/Spells/SpellInfo.cpp') 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 sItemExtendedCostStore(ItemExtendedCostEntryfm DB2Storage sItemSparseStore(ItemSparsefmt, &DB2Utilities::HasItemSparseEntry, &DB2Utilities::WriteItemSparseDbReply); DB2Storage sKeyChainStore(KeyChainfmt); DB2Storage sSpellAuraRestrictionsStore(SpellAuraRestrictionsEntryfmt); +DB2Storage sSpellClassOptionsStore(SpellClassOptionsEntryfmt); DB2Storage sSpellMiscStore(SpellMiscEntryfmt); +DB2Storage sSpellPowerStore(SpellPowerEntryfmt); +DB2Storage sSpellReagentsStore(SpellReagentsEntryfmt); +DB2Storage sSpellRuneCostStore(SpellRuneCostEntryfmt); typedef std::list 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 sItemExtendedCostStore; extern DB2Storage sItemSparseStore; extern DB2Storage sKeyChainStore; extern DB2Storage sSpellAuraRestrictionsStore; +extern DB2Storage sSpellClassOptionsStore; extern DB2Storage sSpellMiscStore; +extern DB2Storage sSpellPowerStore; +extern DB2Storage sSpellReagentsStore; +extern DB2Storage 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 sSpellReagentsStore(SpellReagentsEntryfmt); DBCStorage sSpellScalingStore(SpellScalingEntryfmt); DBCStorage sSpellTotemsStore(SpellTotemsEntryfmt); DBCStorage sSpellTargetRestrictionsStore(SpellTargetRestrictionsEntryfmt); -DBCStorage sSpellPowerStore(SpellPowerEntryfmt); DBCStorage sSpellLevelsStore(SpellLevelsEntryfmt); DBCStorage sSpellInterruptsStore(SpellInterruptsEntryfmt); DBCStorage sSpellEquippedItemsStore(SpellEquippedItemsEntryfmt); -DBCStorage sSpellClassOptionsStore(SpellClassOptionsEntryfmt); DBCStorage sSpellCooldownsStore(SpellCooldownsEntryfmt); DBCStorage sSpellAuraOptionsStore(SpellAuraOptionsEntryfmt); DBCStorage sSpellCastingRequirementsStore(SpellCastingRequirementsEntryfmt); @@ -210,12 +207,10 @@ DBCStorage sSpellCastTimesStore(SpellCastTimefmt); DBCStorage sSpellCategoriesStore(SpellCategoriesEntryfmt); DBCStorage sSpellCategoryStore(SpellCategoryfmt); DBCStorage sSpellEffectStore(SpellEffectEntryfmt); -DBCStorage sSpellDifficultyStore(SpellDifficultyfmt); DBCStorage sSpellDurationStore(SpellDurationfmt); DBCStorage sSpellFocusObjectStore(SpellFocusObjectfmt); DBCStorage sSpellRadiusStore(SpellRadiusfmt); DBCStorage sSpellRangeStore(SpellRangefmt); -DBCStorage sSpellRuneCostStore(SpellRuneCostfmt); DBCStorage sSpellShapeshiftStore(SpellShapeshiftEntryfmt); DBCStorage sSpellShapeshiftFormStore(SpellShapeshiftFormfmt); DBCStorage 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 sSkillTiersStore; extern DBCStorage sSoundEntriesStore; extern DBCStorage sSpellCastTimesStore; extern DBCStorage sSpellCategoryStore; -extern DBCStorage sSpellDifficultyStore; extern DBCStorage sSpellDurationStore; extern DBCStorage sSpellFocusObjectStore; extern DBCStorage sSpellItemEnchantmentStore; @@ -208,21 +207,17 @@ extern SpellCategoryStore sSpellsByCategoryStore; extern PetFamilySpellsStore sPetFamilySpellsStore; extern DBCStorage sSpellRadiusStore; extern DBCStorage sSpellRangeStore; -extern DBCStorage sSpellRuneCostStore; extern DBCStorage sSpellShapeshiftStore; extern DBCStorage sSpellShapeshiftFormStore; extern DBCStorage sSpellStore; extern DBCStorage sSpellAuraOptionsStore; extern DBCStorage sSpellCastingRequirementsStore; extern DBCStorage sSpellCategoriesStore; -extern DBCStorage sSpellClassOptionsStore; extern DBCStorage sSpellCooldownsStore; extern DBCStorage sSpellEffectStore; extern DBCStorage sSpellEquippedItemsStore; extern DBCStorage sSpellInterruptsStore; extern DBCStorage sSpellLevelsStore; -extern DBCStorage sSpellPowerStore; -extern DBCStorage sSpellReagentsStore; extern DBCStorage sSpellScalingStore; extern DBCStorage sSpellTargetRestrictionsStore; extern DBCStorage 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 use them as count, else use 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 than ( || ) 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); } } } -- cgit v1.2.3