diff options
| author | Shauren <shauren.trinity@gmail.com> | 2015-02-19 22:25:59 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2015-02-19 22:25:59 +0100 |
| commit | 474d299b0e567a2b11415c4168d10ee85e82f021 (patch) | |
| tree | 9454b18cc3326a125b53617a5a8fd58b18e3a9cb /src/server/game/DataStores | |
| parent | 1cb513295bef82b1b4defd9c9a7854010cf5296e (diff) | |
Core/Auras: Implemented using Mount.db2 for selecting mount display id
Diffstat (limited to 'src/server/game/DataStores')
| -rw-r--r-- | src/server/game/DataStores/DB2Stores.cpp | 21 | ||||
| -rw-r--r-- | src/server/game/DataStores/DB2Stores.h | 3 | ||||
| -rw-r--r-- | src/server/game/DataStores/DB2Structure.h | 14 | ||||
| -rw-r--r-- | src/server/game/DataStores/DB2fmt.h | 1 | ||||
| -rw-r--r-- | src/server/game/DataStores/DBCEnums.h | 13 |
5 files changed, 47 insertions, 5 deletions
diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp index 875505425f5..fed1c1e60b3 100644 --- a/src/server/game/DataStores/DB2Stores.cpp +++ b/src/server/game/DataStores/DB2Stores.cpp @@ -37,6 +37,7 @@ DB2Storage<ItemModifiedAppearanceEntry> sItemModifiedAppearanceStore(ItemMod DB2Storage<ItemSparseEntry> sItemSparseStore(ItemSparsefmt); DB2Storage<ItemXBonusTreeEntry> sItemXBonusTreeStore(ItemXBonusTreeEntryfmt); DB2Storage<KeyChainEntry> sKeyChainStore(KeyChainfmt); +DB2Storage<MountEntry> sMountStore(Mountfmt); DB2Storage<OverrideSpellDataEntry> sOverrideSpellDataStore(OverrideSpellDataEntryfmt); DB2Storage<PhaseGroupEntry> sPhaseGroupStore(PhaseGroupEntryfmt); DB2Storage<SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore(SpellAuraRestrictionsEntryfmt); @@ -138,6 +139,7 @@ void DB2Manager::LoadStores(std::string const& dataPath) LoadDB2(availableDb2Locales, bad_db2_files, _stores, sItemSparseStore, db2Path, "Item-sparse.db2"); LoadDB2(availableDb2Locales, bad_db2_files, _stores, sItemXBonusTreeStore, db2Path, "ItemXBonusTree.db2"); LoadDB2(availableDb2Locales, bad_db2_files, _stores, sKeyChainStore, db2Path, "KeyChain.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, _stores, sMountStore, db2Path, "Mount.db2"); LoadDB2(availableDb2Locales, bad_db2_files, _stores, sOverrideSpellDataStore, db2Path, "OverrideSpellData.db2"); LoadDB2(availableDb2Locales, bad_db2_files, _stores, sPhaseGroupStore, db2Path, "PhaseXPhaseGroup.db2"); LoadDB2(availableDb2Locales, bad_db2_files, _stores, sSpellAuraRestrictionsStore, db2Path, "SpellAuraRestrictions.db2"); @@ -191,15 +193,19 @@ void DB2Manager::LoadStores(std::string const& dataPath) _heirloomCurvePoints[curvePoint->CurveID][curvePoint->Index] = curvePoint; } - for (uint32 i = 0; i < sSpellPowerStore.GetNumRows(); ++i) - if (SpellPowerEntry const* power = sSpellPowerStore.LookupEntry(i)) - sSpellPowerBySpellIDStore[power->SpellID] = power; + for (uint32 i = 0; i < sMountStore.GetNumRows(); ++i) + if (MountEntry const* mount = sMountStore.LookupEntry(i)) + _mountsBySpellId[mount->SpellId] = mount; for (uint32 i = 0; i < sPhaseGroupStore.GetNumRows(); ++i) if (PhaseGroupEntry const* group = sPhaseGroupStore.LookupEntry(i)) if (PhaseEntry const* phase = sPhaseStore.LookupEntry(group->PhaseID)) _phasesByGroup[group->PhaseGroupID].insert(phase->ID); + for (uint32 i = 0; i < sSpellPowerStore.GetNumRows(); ++i) + if (SpellPowerEntry const* power = sSpellPowerStore.LookupEntry(i)) + sSpellPowerBySpellIDStore[power->SpellID] = power; + for (uint32 i = 1; i < sTaxiPathStore.GetNumRows(); ++i) if (TaxiPathEntry const* entry = sTaxiPathStore.LookupEntry(i)) sTaxiPathSetBySource[entry->From][entry->To] = TaxiPathBySourceAndDestination(entry->ID, entry->Cost); @@ -448,6 +454,15 @@ DB2Manager::ItemBonusList DB2Manager::GetItemBonusList(uint32 bonusListId) const return ItemBonusList(); } +MountEntry const* DB2Manager::GetMount(uint32 spellId) const +{ + auto itr = _mountsBySpellId.find(spellId); + if (itr != _mountsBySpellId.end()) + return itr->second; + + return nullptr; +} + std::set<uint32> DB2Manager::GetPhasesForGroup(uint32 group) const { auto itr = _phasesByGroup.find(group); diff --git a/src/server/game/DataStores/DB2Stores.h b/src/server/game/DataStores/DB2Stores.h index f721fd4bc19..f43dd2098f2 100644 --- a/src/server/game/DataStores/DB2Stores.h +++ b/src/server/game/DataStores/DB2Stores.h @@ -72,6 +72,7 @@ public: typedef std::unordered_map<uint32 /*bonusListId*/, ItemBonusList> ItemBonusListContainer; typedef std::unordered_multimap<uint32 /*itemId*/, uint32 /*bonusTreeId*/> ItemToBonusTreeContainer; typedef std::unordered_map<uint32, std::set<ItemBonusTreeNodeEntry const*>> ItemBonusTreeContainer; + typedef std::unordered_map<uint32, MountEntry const*> MountContainer; typedef std::unordered_map<uint32, std::set<uint32>> PhaseGroupContainer; static DB2Manager& Instance() @@ -92,6 +93,7 @@ public: uint32 GetItemDisplayId(uint32 itemId, uint32 appearanceModId) const; std::set<uint32> GetItemBonusTree(uint32 itemId, uint32 itemBonusTreeMod) const; ItemBonusList GetItemBonusList(uint32 bonusListId) const; + MountEntry const* GetMount(uint32 spellId) const; std::set<uint32> GetPhasesForGroup(uint32 group) const; private: @@ -103,6 +105,7 @@ private: ItemBonusListContainer _itemBonusLists; ItemToBonusTreeContainer _itemToBonusTree; ItemBonusTreeContainer _itemBonusTrees; + MountContainer _mountsBySpellId; PhaseGroupContainer _phasesByGroup; }; diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index 7c68e5bb39a..be0ee1b9e75 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -239,6 +239,20 @@ struct KeyChainEntry uint8 Key[KEYCHAIN_SIZE]; }; +struct MountEntry +{ + uint32 Id; + uint32 MountTypeId; + uint32 DisplayId; + uint32 Flags; + LocalizedString* Name; + LocalizedString* Description; + LocalizedString* SourceDescription; + uint32 Source; + uint32 SpellId; + uint32 PlayerConditionId; +}; + #define MAX_OVERRIDE_SPELL 10 struct OverrideSpellDataEntry diff --git a/src/server/game/DataStores/DB2fmt.h b/src/server/game/DataStores/DB2fmt.h index 3a56fb75ca5..84b69ef03b4 100644 --- a/src/server/game/DataStores/DB2fmt.h +++ b/src/server/game/DataStores/DB2fmt.h @@ -32,6 +32,7 @@ char const ItemModifiedAppearanceEntryfmt[] = "niiiii"; char const ItemSparsefmt[] = "niiiiffiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffffffffffiiifisssssiiiiiiiiiiiiiiiiiiifiiifiii"; char const ItemXBonusTreeEntryfmt[] = "nii"; char const KeyChainfmt[] = "nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"; +char const Mountfmt[] = "niiisssiii"; char const OverrideSpellDataEntryfmt[] = "niiiiiiiiiixx"; char const PhaseGroupEntryfmt[] = "nii"; char const SpellAuraRestrictionsEntryfmt[] = "diiiiiiii"; diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index cc97e50fa3e..0a97e431fdc 100644 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -474,10 +474,19 @@ enum ItemLimitCategoryMode ITEM_LIMIT_CATEGORY_MODE_EQUIP = 1 // limit applied to amount equipped items (including used gems) }; +enum MountCapabilityFlags +{ + MOUNT_CAPABILITY_FLAG_CAN_PITCH = 0x4, // client checks MOVEMENTFLAG2_FULL_SPEED_PITCHING + MOUNT_CAPABILITY_FLAG_CAN_SWIM = 0x8, // client checks MOVEMENTFLAG_SWIMMING +}; + enum MountFlags { - MOUNT_FLAG_CAN_PITCH = 0x4, // client checks MOVEMENTFLAG2_FULL_SPEED_PITCHING - MOUNT_FLAG_CAN_SWIM = 0x8, // client checks MOVEMENTFLAG_SWIMMING + MOUNT_FLAG_SELF_MOUNT = 0x02, // Player becomes the mount himself + MOUNT_FLAG_FACTION_SPECIFIC = 0x04, + MOUNT_FLAG_PREFERRED_SWIMMING = 0x10, + MOUNT_FLAG_PREFERRED_WATER_WALKING = 0x20, + MOUNT_FLAG_HIDE_IF_UNKNOWN = 0x40 }; enum SkillRaceClassInfoFlags |
