aboutsummaryrefslogtreecommitdiff
path: root/src/game/Creature.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Creature.cpp')
-rw-r--r--src/game/Creature.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index 6eecc3213fa..840af9b4591 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -277,6 +277,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));
+
// Cancel load if no model defined
if (!(cinfo->GetFirstValidModelId()))
{
@@ -1347,6 +1353,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);
@@ -2120,9 +2128,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);