mirror of
https://gitcode.com/GitHub_Trending/az/azerothcore-wotlk.git
synced 2026-10-10 07:06:38 +08:00
fix(Core/Vehicles): Salvaged Demolishers should spawn with full pyrite (#27399)
This commit is contained in:
@@ -28,6 +28,11 @@
|
||||
#include "Util.h"
|
||||
#include <algorithm>
|
||||
|
||||
enum PowerDisplayIds
|
||||
{
|
||||
POWER_DISPLAY_PYRITE = 41
|
||||
};
|
||||
|
||||
Vehicle::Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry) :
|
||||
_me(unit), _vehicleInfo(vehInfo), _usableSeatNum(0), _creatureEntry(creatureEntry), _status(STATUS_NONE),
|
||||
_accessoriesInstalled(false)
|
||||
@@ -76,7 +81,14 @@ void Vehicle::Install()
|
||||
if (_me->IsCreature())
|
||||
{
|
||||
if (PowerDisplayEntry const* powerDisplay = sPowerDisplayStore.LookupEntry(_vehicleInfo->m_powerDisplayId))
|
||||
{
|
||||
_me->setPowerType(Powers(powerDisplay->PowerType));
|
||||
|
||||
// Pyrite does not regenerate and is only refilled by scripted energizes,
|
||||
// so the Salvaged Demolisher and its Mechanic Seat spawn with a full bar
|
||||
if (_vehicleInfo->m_powerDisplayId == POWER_DISPLAY_PYRITE)
|
||||
_me->SetPower(_me->getPowerType(), _me->GetMaxPower(_me->getPowerType()));
|
||||
}
|
||||
else if (_me->IsClass(CLASS_ROGUE, CLASS_CONTEXT_ABILITY))
|
||||
_me->setPowerType(POWER_ENERGY);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user