Merged and fixed some whitespaces.

This commit is contained in:
tomrus88 2009-05-29 10:40:13 +04:00
commit 84ed071e16
42 changed files with 283 additions and 141 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);
@ -256,7 +262,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data )
m_regenHealth = GetCreatureInfo()->RegenHealth;
// creatures always have melee weapon ready if any
SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
SetSheath(SHEATH_STATE_MELEE);
SelectLevel(GetCreatureInfo());
if (team == HORDE)
@ -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);