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:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user