[7908] Extract class data from creature_*_addon bytes0 fields, drop its, amd add unit_class field to creature_template.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
NoFantasy 2009-05-29 05:43:08 +04:00 committed by VladimirMangos
parent 39637858aa
commit 84464e5f3f
12 changed files with 65 additions and 16 deletions

View file

@ -197,6 +197,12 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data )
SetEntry(Entry); // normal entry always
m_creatureInfo = cinfo; // map mode related always
// equal to player Race field, but creature does not have race
SetByteValue(UNIT_FIELD_BYTES_0, 0, 0);
// known valid are: CLASS_WARRIOR,CLASS_PALADIN,CLASS_ROGUE,CLASS_MAGE
SetByteValue(UNIT_FIELD_BYTES_0, 1, uint8(cinfo->unit_class));
if (cinfo->DisplayID_A == 0 || cinfo->DisplayID_H == 0) // Cancel load if no model defined
{
sLog.outErrorDb("Creature (Entry: %u) has no model defined for Horde or Alliance in table `creature_template`, can't load. ",Entry);
@ -1204,6 +1210,8 @@ void Creature::SelectLevel(const CreatureInfo *cinfo)
SetMaxPower(POWER_MANA, mana); //MAX Mana
SetPower(POWER_MANA, mana);
// 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);
@ -1860,9 +1868,6 @@ bool Creature::LoadCreaturesAddon(bool reload)
if (cainfo->mount != 0)
Mount(cainfo->mount);
if (cainfo->bytes0 != 0)
SetUInt32Value(UNIT_FIELD_BYTES_0, cainfo->bytes0);
if (cainfo->bytes1 != 0)
SetUInt32Value(UNIT_FIELD_BYTES_1, cainfo->bytes1);