Skip to content

Commit

Permalink
[12200] Implement storing talent tree roles
Browse files Browse the repository at this point in the history
Signed-off-by: Yaki Khadafi <elsoldollo@gmail.com>
  • Loading branch information
Zakamurite committed Sep 8, 2012
1 parent 29d1817 commit 26b2b40
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 5 deletions.
9 changes: 9 additions & 0 deletions src/game/DBCEnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,15 @@ enum ItemLimitCategory
ITEM_LIMIT_CATEGORY_MANA_GEM = 4,
};

enum TalentTreeRole
{
TALENT_ROLE_TANK = 0x2,
TALENT_ROLE_HEALER = 0x4,
TALENT_ROLE_DPS = 0x8,
};

#define MAX_MASTERY_SPELLS 2

enum TotemCategoryType
{
TOTEM_CATEGORY_TYPE_KNIFE = 1,
Expand Down
13 changes: 13 additions & 0 deletions src/game/DBCStores.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ DBCStorage <TalentTreePrimarySpellsEntry> sTalentTreePrimarySpellsStore(TalentTr
typedef std::map<uint32, std::vector<uint32> > TalentTreeSpellsMap;
TalentTreeSpellsMap sTalentTreeMasterySpellsMap;
TalentTreeSpellsMap sTalentTreePrimarySpellsMap;
typedef std::map<uint32, uint32> TalentTreeRolesMap;
TalentTreeRolesMap sTalentTreeRolesMap;

// store absolute bit position for first rank for talent inspect
static uint32 sTalentTabPages[MAX_CLASSES][3];
Expand Down Expand Up @@ -688,6 +690,8 @@ void LoadDBCStores(const std::string& dataPath)
for (uint32 cls = 1; cls < MAX_CLASSES; ++cls)
if (talentTabInfo->ClassMask & (1 << (cls - 1)))
sTalentTabPages[cls][talentTabInfo->tabpage] = talentTabId;

sTalentTreeRolesMap[talentTabId] = talentTabInfo->rolesMask;
}
}

Expand Down Expand Up @@ -1085,6 +1089,15 @@ std::vector<uint32> const* GetTalentTreePrimarySpells(uint32 talentTree)
return &itr->second;
}

uint32 GetTalentTreeRolesMask(uint32 talentTree)
{
TalentTreeRolesMap::const_iterator itr = sTalentTreeRolesMap.find(talentTree);
if (itr == sTalentTreeRolesMap.end())
return NULL;

return itr->second;
}

bool IsPointInAreaTriggerZone(AreaTriggerEntry const* atEntry, uint32 mapid, float x, float y, float z, float delta)
{
if (mapid != atEntry->mapid)
Expand Down
1 change: 1 addition & 0 deletions src/game/DBCStores.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ inline Difficulty GetPrevDifficulty(Difficulty diff, bool isRaid)
uint32 const* /*[3]*/ GetTalentTabPages(uint32 cls);
std::vector<uint32> const* GetTalentTreeMasterySpells(uint32 talentTree);
std::vector<uint32> const* GetTalentTreePrimarySpells(uint32 talentTree);
uint32 GetTalentTreeRolesMask(uint32 talentTree);

bool IsPointInAreaTriggerZone(AreaTriggerEntry const* atEntry, uint32 mapid, float x, float y, float z, float delta = 0.0f);

Expand Down
4 changes: 1 addition & 3 deletions src/game/DBCStructure.h
Original file line number Diff line number Diff line change
Expand Up @@ -2137,8 +2137,6 @@ struct TalentEntry
//uint64 allowForPet; // 17 m_categoryMask its a 64 bit mask for pet 1<<m_categoryEnumID in CreatureFamily.dbc
};

#define MAX_MASTERY_SPELLS 2

struct TalentTabEntry
{
uint32 TalentTabID; // 0 m_ID
Expand All @@ -2149,7 +2147,7 @@ struct TalentTabEntry
uint32 tabpage; // 5 m_orderIndex
//char* internalname; // 6 m_backgroundFile
//char* description; // 7
//uint32 rolesMask; // 8 4.0.0
uint32 rolesMask; // 8 4.0.0
uint32 masterySpells[MAX_MASTERY_SPELLS]; // 9-10 passive mastery bonus spells
};

Expand Down
2 changes: 1 addition & 1 deletion src/game/DBCfmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const char SpellShapeshiftFormfmt[]="nxxiixiiixxiiiiiiiixx";
//const char StableSlotPricesfmt[] = "ni"; // removed
const char SummonPropertiesfmt[] = "niiiii";
const char TalentEntryfmt[]="niiiiiiiiixxixxxxxx";
const char TalentTabEntryfmt[]="nxxiiixxxii";
const char TalentTabEntryfmt[]="nxxiiixxiii";
const char TalentTreePrimarySpellsfmt[]="diix";
const char TaxiNodesEntryfmt[]="nifffsiixxx";
const char TaxiPathEntryfmt[]="niii";
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12199"
#define REVISION_NR "12200"
#endif // __REVISION_NR_H__

0 comments on commit 26b2b40

Please sign in to comment.