aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/DataStores/DBCStores.cpp2
-rw-r--r--src/server/game/DataStores/DBCStores.h1
-rw-r--r--src/server/game/DataStores/DBCStructure.h12
-rw-r--r--src/server/game/DataStores/DBCfmt.h1
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp2
-rwxr-xr-xsrc/server/game/Entities/Vehicle/Vehicle.cpp39
6 files changed, 19 insertions, 38 deletions
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index 9b0465a4536..44f03b6978d 100644
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -139,6 +139,7 @@ DBCStorage <MovieEntry> sMovieStore(MovieEntryfmt);
DBCStorage <OverrideSpellDataEntry> sOverrideSpellDataStore(OverrideSpellDatafmt);
+DBCStorage <PowerDisplayEntry> sPowerDisplayStore(PowerDisplayfmt);
DBCStorage <PvPDifficultyEntry> sPvPDifficultyStore(PvPDifficultyfmt);
DBCStorage <QuestSortEntry> sQuestSortStore(QuestSortEntryfmt);
@@ -391,6 +392,7 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales, bad_dbc_files, sOverrideSpellDataStore, dbcPath, "OverrideSpellData.dbc");
+ LoadDBC(availableDbcLocales, bad_dbc_files, sPowerDisplayStore, dbcPath, "PowerDisplay.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sPvPDifficultyStore, dbcPath, "PvpDifficulty.dbc");
for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h
index b77db950541..fe775dfda19 100644
--- a/src/server/game/DataStores/DBCStores.h
+++ b/src/server/game/DataStores/DBCStores.h
@@ -141,6 +141,7 @@ extern DBCStorage <MapEntry> sMapStore;
extern MapDifficultyMap sMapDifficultyMap;
extern DBCStorage <MovieEntry> sMovieStore;
extern DBCStorage <OverrideSpellDataEntry> sOverrideSpellDataStore;
+extern DBCStorage <PowerDisplayEntry> sPowerDisplayStore;
extern DBCStorage <QuestSortEntry> sQuestSortStore;
extern DBCStorage <QuestXPEntry> sQuestXPStore;
extern DBCStorage <QuestFactionRewEntry> sQuestFactionRewardStore;
diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h
index abe7bde4bf5..5d6c8c7aa89 100644
--- a/src/server/game/DataStores/DBCStructure.h
+++ b/src/server/game/DataStores/DBCStructure.h
@@ -1398,6 +1398,16 @@ struct OverrideSpellDataEntry
//uint32 unk0; // 11
};
+struct PowerDisplayEntry
+{
+ uint32 Id; // 0
+ uint32 PowerType; // 1
+ //char* Name; // 2
+ //uint32 R; // 3
+ //uint32 G; // 4
+ //uint32 B; // 5
+};
+
struct PvPDifficultyEntry
{
//uint32 id; // 0 m_ID
@@ -1982,7 +1992,7 @@ struct VehicleEntry
uint32 m_uiLocomotionType; // 34
float m_msslTrgtImpactTexRadius; // 35
uint32 m_uiSeatIndicatorType; // 36
- uint32 m_powerType; // 37, new in 3.1
+ uint32 m_powerDisplayId; // 37, new in 3.1
// 38, new in 3.1
// 39, new in 3.1
};
diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h
index 35a8eecb708..222353467f4 100644
--- a/src/server/game/DataStores/DBCfmt.h
+++ b/src/server/game/DataStores/DBCfmt.h
@@ -91,6 +91,7 @@ char const OverrideSpellDatafmt[] = "niiiiiiiiiix";
char const QuestFactionRewardfmt[] = "niiiiiiiiii";
char const QuestSortEntryfmt[] = "nxxxxxxxxxxxxxxxxx";
char const QuestXPfmt[] = "niiiiiiiiii";
+char const PowerDisplayfmt[] = "nixxxx";
char const PvPDifficultyfmt[] = "diiiii";
char const RandomPropertiesPointsfmt[] = "niiiiiiiiiiiiiii";
char const ScalingStatDistributionfmt[] = "niiiiiiiiiiiiiiiiiiiii";
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 36997eb884a..01621637985 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -569,7 +569,7 @@ void Creature::Update(uint32 diff)
if (getPowerType() == POWER_ENERGY)
{
- if (!IsVehicle() || GetVehicleKit()->GetVehicleInfo()->m_powerType != POWER_PYRITE)
+ if (!IsVehicle() || GetVehicleKit()->GetVehicleInfo()->m_powerDisplayId != POWER_PYRITE)
Regenerate(POWER_ENERGY);
}
else
diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp
index fae4f0c6b6a..4c3724a8860 100755
--- a/src/server/game/Entities/Vehicle/Vehicle.cpp
+++ b/src/server/game/Entities/Vehicle/Vehicle.cpp
@@ -76,42 +76,9 @@ Vehicle::~Vehicle()
void Vehicle::Install()
{
- if (Creature* creature = _me->ToCreature())
- {
- switch (_vehicleInfo->m_powerType)
- {
- case POWER_STEAM:
- case POWER_HEAT:
- case POWER_BLOOD:
- case POWER_OOZE:
- case POWER_WRATH:
- _me->setPowerType(POWER_ENERGY);
- _me->SetMaxPower(POWER_ENERGY, 100);
- break;
- case POWER_PYRITE:
- _me->setPowerType(POWER_ENERGY);
- _me->SetMaxPower(POWER_ENERGY, 50);
- break;
- default:
- for (uint32 i = 0; i < MAX_SPELL_VEHICLE; ++i)
- {
- if (!creature->m_spells[i])
- continue;
-
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(creature->m_spells[i]);
- if (!spellInfo)
- continue;
-
- if (spellInfo->PowerType == POWER_ENERGY && spellInfo->CalcPowerCost(_me, spellInfo->GetSchoolMask()) > 0)
- {
- _me->setPowerType(POWER_ENERGY);
- _me->SetMaxPower(POWER_ENERGY, 100);
- break;
- }
- }
- break;
- }
- }
+ if (_me->GetTypeId() == TYPEID_UNIT)
+ if (PowerDisplayEntry const* powerDisplay = sPowerDisplayStore.LookupEntry(_vehicleInfo->m_powerDisplayId))
+ _me->setPowerType(Powers(powerDisplay->PowerType));
_status = STATUS_INSTALLED;
if (GetBase()->GetTypeId() == TYPEID_UNIT)