This patch allows to specify creature power type (mana, energy, etc.) via field in creature_template. Uses same values as Powers enum.
Some remarks:
unk17 in creature cache is actually power_mod. For example http://www.wowhead.com/npc=33109 has power_mod = 0.5 in WDB.
max energy (100) * power_mod (0.5) = 50 pyrite max, that's right.
http://www.wowhead.com/npc=29859 has power_mod = 1 -> 100 energy as usual.
So I decided to use power_mod for calculating max energy.
Examples of creatures that have energy bar:
http://www.wowhead.com/npc=29840
http://www.wowhead.com/npc=37813
http://www.wowhead.com/npc=34472
http://www.wowhead.com/npc=34454
http://www.wowhead.com/npc=38200
Patch: http://paste2.org/p/1010938
SQL:
ALTER TABLE creature_template
ADD COLUMN `PowerType` tinyint(3) unsigned NOT NULL default '0' AFTER `MaxHealth`,
CHANGE COLUMN `unk16` `health_mod` float NOT NULL default '1',
CHANGE COLUMN `unk17` `power_mod` float NOT NULL default '1';