Core/Vehicles: Remove vehicle stat scaling hack and implement it properly trough the spell system. NOTE: This does need some further research on coefficients for different vehicles.

Signed-off-by: Machiavelli <[email protected]>
This commit is contained in:
Sarjuuk
2011-06-27 14:23:58 +02:00
committed by Machiavelli
parent 8fd3c912c1
commit 249692b54b
8 changed files with 67 additions and 78 deletions
-42
View File
@@ -2935,48 +2935,6 @@ void ObjectMgr::LoadVehicleAccessories()
sLog->outString();
}
void ObjectMgr::LoadVehicleScaling()
{
uint32 oldMSTime = getMSTime();
m_VehicleScalingMap.clear(); // needed for reload case
uint32 count = 0;
QueryResult result = WorldDatabase.Query("SELECT `entry`, `baseItemLevel`, `scalingFactor` FROM `vehicle_scaling_info`");
if (!result)
{
sLog->outString(">> Loaded 0 vehicle scaling entries. DB table `vehicle_scaling_info` is empty.");
sLog->outString();
return;
}
do
{
Field *fields = result->Fetch();
uint32 vehicleEntry = fields[0].GetUInt32();
float baseItemLevel = fields[1].GetFloat();
float scalingFactor = fields[2].GetFloat();
if (!sVehicleStore.LookupEntry(vehicleEntry))
{
sLog->outErrorDb("Table `vehicle_scaling_info`: vehicle entry %u does not exist.", vehicleEntry);
continue;
}
m_VehicleScalingMap[vehicleEntry].ID = vehicleEntry;
m_VehicleScalingMap[vehicleEntry].baseItemLevel = baseItemLevel;
m_VehicleScalingMap[vehicleEntry].scalingFactor = scalingFactor;
++count;
} while (result->NextRow());
sLog->outString(">> Loaded %u vehicle scaling entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
sLog->outString();
}
void ObjectMgr::LoadPetLevelInfo()
{
uint32 oldMSTime = getMSTime();
-10
View File
@@ -791,14 +791,6 @@ class ObjectMgr
return NULL;
}
VehicleScalingInfo const* GetVehicleScalingInfo(uint32 vehicleEntry) const
{
VehicleScalingMap::const_iterator itr = m_VehicleScalingMap.find(vehicleEntry);
if (itr != m_VehicleScalingMap.end())
return &itr->second;
return NULL;
}
DungeonEncounterList const* GetDungeonEncounterList(uint32 mapId, Difficulty difficulty)
{
UNORDERED_MAP<uint32, DungeonEncounterList>::const_iterator itr = mDungeonEncounters.find(MAKE_PAIR32(mapId, difficulty));
@@ -896,7 +888,6 @@ class ObjectMgr
void LoadMailLevelRewards();
void LoadVehicleTemplateAccessories();
void LoadVehicleAccessories();
void LoadVehicleScaling();
void LoadGossipText();
@@ -1280,7 +1271,6 @@ class ObjectMgr
VehicleAccessoryMap m_VehicleTemplateAccessoryMap;
VehicleAccessoryMap m_VehicleAccessoryMap;
VehicleScalingMap m_VehicleScalingMap;
typedef std::vector<LocaleConstant> LocalForIndex;
LocalForIndex m_LocalForIndex;