Core/Creatures: Updated power type handling

This commit is contained in:
hondacrx
2018-03-04 23:40:51 -05:00
parent 17d3836438
commit b067976678
7 changed files with 119 additions and 82 deletions
+24 -1
View File
@@ -1941,12 +1941,35 @@ namespace Game.Entities
AuraEffect powerTypeAura = powerTypeAuras.First();
displayPower = (PowerType)powerTypeAura.GetMiscValue();
}
else
else if (GetTypeId() == TypeId.Player)
{
ChrClassesRecord cEntry = CliDB.ChrClassesStorage.LookupByKey(GetClass());
if (cEntry != null && cEntry.PowerType < PowerType.Max)
displayPower = cEntry.PowerType;
}
else if (GetTypeId() == TypeId.Unit)
{
Vehicle vehicle = GetVehicle();
if (vehicle)
{
PowerDisplayRecord powerDisplay = CliDB.PowerDisplayStorage.LookupByKey(vehicle.GetVehicleInfo().PowerDisplayID[0]);
if (powerDisplay != null)
displayPower = (PowerType)powerDisplay.PowerType;
else if (GetClass() == Class.Rogue)
displayPower = PowerType.Energy;
}
else
{
Pet pet = ToPet();
if (pet)
{
if (pet.getPetType() == PetType.Hunter) // Hunter pets have focus
displayPower = PowerType.Focus;
else if (pet.IsPetGhoul() || pet.IsPetAbomination()) // DK pets have energy
displayPower = PowerType.Energy;
}
}
}
break;
}
}