*Switch to support client version 3.1.3

*I strongly recommend you not to use this until you get the 313 db. Now all destructible buildings cause client crash.

Source: Mangos
Thanks to TOM_RUS for most work to make this switch possible ;)

--HG--
branch : trunk
This commit is contained in:
megamage
2009-06-11 00:45:59 -05:00
parent 9c70e3d89b
commit 9d670fe6f5
81 changed files with 2424 additions and 1480 deletions
+7 -72
View File
@@ -133,9 +133,6 @@ TalentSpellPosMap sTalentSpellPosMap;
DBCStorage <TalentTabEntry> sTalentTabStore(TalentTabEntryfmt);
// store absolute bit position for first rank for talent inspect
typedef std::map<uint32,uint32> TalentInspectMap;
static TalentInspectMap sTalentPosInInspect;
static TalentInspectMap sTalentTabSizeInInspect;
static uint32 sTalentTabPages[12/*MAX_CLASSES*/][3];
DBCStorage <TaxiNodesEntry> sTaxiNodesStore(TaxiNodesEntryfmt);
@@ -390,34 +387,6 @@ void LoadDBCStores(const std::string& dataPath)
// prepare fast data access to bit pos of talent ranks for use at inspecting
{
// fill table by amount of talent ranks and fill sTalentTabBitSizeInInspect
// store in with (row,col,talent)->size key for correct sorting by (row,col)
typedef std::map<uint32,uint32> TalentBitSize;
TalentBitSize sTalentBitSize;
for(uint32 i = 1; i < sTalentStore.GetNumRows(); ++i)
{
TalentEntry const *talentInfo = sTalentStore.LookupEntry(i);
if (!talentInfo) continue;
TalentTabEntry const *talentTabInfo = sTalentTabStore.LookupEntry( talentInfo->TalentTab );
if(!talentTabInfo)
continue;
// find talent rank
uint32 curtalent_maxrank = 0;
for(uint32 k = MAX_TALENT_RANK; k > 0; --k)
{
if(talentInfo->RankID[k-1])
{
curtalent_maxrank = k;
break;
}
}
sTalentBitSize[(talentInfo->Row<<24) + (talentInfo->Col<<16)+talentInfo->TalentID] = curtalent_maxrank;
sTalentTabSizeInInspect[talentInfo->TalentTab] += curtalent_maxrank;
}
// now have all max ranks (and then bit amount used for store talent ranks in inspect)
for(uint32 talentTabId = 1; talentTabId < sTalentTabStore.GetNumRows(); ++talentTabId)
{
@@ -434,22 +403,6 @@ void LoadDBCStores(const std::string& dataPath)
for(uint32 m=1;!(m & talentTabInfo->ClassMask) && cls < MAX_CLASSES;m <<=1, ++cls) {}
sTalentTabPages[cls][talentTabInfo->tabpage]=talentTabId;
// add total amount bits for first rank starting from talent tab first talent rank pos.
uint32 pos = 0;
for(TalentBitSize::iterator itr = sTalentBitSize.begin(); itr != sTalentBitSize.end(); ++itr)
{
uint32 talentId = itr->first & 0xFFFF;
TalentEntry const *talentInfo = sTalentStore.LookupEntry( talentId );
if(!talentInfo)
continue;
if(talentInfo->TalentTab != talentTabId)
continue;
sTalentPosInInspect[talentId] = pos;
pos+= itr->second;
}
}
}
@@ -553,13 +506,13 @@ void LoadDBCStores(const std::string& dataPath)
}
// Check loaded DBC files proper version
if( !sSpellStore.LookupEntry(62735) || // last added spell in 3.0.9
!sMapStore.LookupEntry(624) || // last map added in 3.0.8a/3.0.9
!sGemPropertiesStore.LookupEntry(1557) || // last gem property added in 3.0.8a/3.0.9
!sItemExtendedCostStore.LookupEntry(2589) || // last item extended cost added in 3.0.8a/3.0.9
!sCharTitlesStore.LookupEntry(144) || // last char title added in 3.0.8a/3.0.9
!sAreaStore.LookupEntry(2769) || // last area (areaflag) added in 3.0.8a/3.0.9
!sItemStore.LookupEntry(45037) ) // last client known item added in 3.0.9
if( !sSpellStore.LookupEntry(66530) || // last added spell in 3.1.3
!sMapStore.LookupEntry(624) || // last map added in 3.1.3
!sGemPropertiesStore.LookupEntry(1609) || // last gem property added in 3.1.3
!sItemExtendedCostStore.LookupEntry(2671) || // last item extended cost added in 3.1.3
!sCharTitlesStore.LookupEntry(166) || // last char title added in 3.1.3
!sAreaStore.LookupEntry(2905) || // last area (areaflag) added in 3.1.3
!sItemStore.LookupEntry(46894) ) // last client known item added in 3.1.3
{
sLog.outError("\nYou have _outdated_ DBC files. Please extract correct versions from current using client.");
exit(1);
@@ -729,24 +682,6 @@ void Map2ZoneCoordinates(float& x,float& y,uint32 zone)
std::swap(x,y); // client have map coords swapped
}
uint32 GetTalentInspectBitPosInTab(uint32 talentId)
{
TalentInspectMap::const_iterator itr = sTalentPosInInspect.find(talentId);
if(itr == sTalentPosInInspect.end())
return 0;
return itr->second;
}
uint32 GetTalentTabInspectBitSize(uint32 talentTabId)
{
TalentInspectMap::const_iterator itr = sTalentTabSizeInInspect.find(talentTabId);
if(itr == sTalentTabSizeInInspect.end())
return 0;
return itr->second;
}
uint32 const* GetTalentTabPages(uint32 cls)
{
return sTalentTabPages[cls];