// creature.cpp
is to add energy in the table DATA BASE minenergy maxenergy.
I tried and worked but you need the update in the DATA BASE for the NPC VEHICLES, work with energy
// mana
uint32 minmana = std::min(cinfo->maxmana, cinfo->minmana);
uint32 maxmana = std::max(cinfo->maxmana, cinfo->minmana);
uint32 mana = minmana + uint32(rellevel*(maxmana - minmana));
+// energy
+ uint32 minenergy = std::min(cinfo->maxenergy, cinfo->minenergy);
+ uint32 maxenergy = std::max(cinfo->maxenergy, cinfo->minenergy);
+ uint32 energy = minenergy + uint32(rellevel*(maxenergy - minenergy));
SetCreateMana(mana);
SetMaxPower(POWER_MANA, mana); //MAX Mana
SetPower(POWER_MANA, mana);
+ SetCreateEnergy(energy);
+ SetMaxPower(POWER_ENERGY, energy); //MAX Energy
+ SetPower(POWER_ENERGY, energy);
// TODO: set UNIT_FIELD_POWER*, for some creature class case (energy, etc)
SetModifierValue(UNIT_MOD_HEALTH, BASE_VALUE, health);
SetModifierValue(UNIT_MOD_MANA, BASE_VALUE, mana);
+ SetModifierValue(UNIT_MOD_ENERGY, BASE_VALUE, energy);
// UpdateFields.h
UNIT_FIELD_RANGED_ATTACK_POWER_MODS = OBJECT_END + 0x0079, // Size: 1, Type: TWO_SHORT, Flags: PRIVATE, OWNER
+ UNIT_FIELD_BASE_ENERGY = OBJECT_END + 0x0080, // Size: 1, Type: INT, Flags: PUBLIC
// DATA BASE
ALTER TABLE creature_template
ADD COLUMN minenergy int(10) unsigned NOT NULL default '0' AFTER maxmana,
ADD COLUMN maxenergy int(10) unsigned NOT NULL default '0' AFTER minenergy;
But probleman update create DATA BASE.