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
@@ -361,21 +361,6 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
{
if (!me->SetCharmedBy(unit, CHARM_TYPE_VEHICLE))
ASSERT(false);
// hack: should be done by aura system
if (VehicleScalingInfo const* scalingInfo = sObjectMgr->GetVehicleScalingInfo(m_vehicleInfo->m_ID))
{
Player* player = unit->ToPlayer();
float averageItemLevel = player->GetAverageItemLevel();
if (averageItemLevel < scalingInfo->baseItemLevel)
averageItemLevel = scalingInfo->baseItemLevel;
averageItemLevel -= scalingInfo->baseItemLevel;
float currentHealthPct = float(me->GetHealth() / me->GetMaxHealth());
m_bonusHP = uint32(me->GetMaxHealth() * (averageItemLevel * scalingInfo->scalingFactor));
me->SetMaxHealth(me->GetMaxHealth() + m_bonusHP);
me->SetHealth(uint32((me->GetHealth() + m_bonusHP) * currentHealthPct));
}
}
if (me->IsInWorld())