[10788] Replace bytes in single field bytes2 by independent fields for creature_addon.

This commit is contained in:
VladimirMangos 2010-11-27 23:50:26 +03:00
parent 9460ed0494
commit 0c8a7c3826
9 changed files with 50 additions and 22 deletions

View file

@ -1852,20 +1852,19 @@ bool Creature::LoadCreatureAddon(bool reload)
SetByteValue(UNIT_FIELD_BYTES_1, 3, uint8((cainfo->bytes1 >> 24) & 0xFF));
}
if (cainfo->bytes2 != 0)
{
// 0 SheathState
// 1 UnitPVPStateFlags Set at Creature::UpdateEntry (SetPvp())
// 2 UnitRename Pet only, so always 0 for default creature
// 3 ShapeshiftForm Must be determined/set by shapeshift spell/aura
// UNIT_FIELD_BYTES_2
// 0 SheathState
// 1 UnitPVPStateFlags Set at Creature::UpdateEntry (SetPvp())
// 2 UnitRename Pet only, so always 0 for default creature
// 3 ShapeshiftForm Must be determined/set by shapeshift spell/aura
if (cainfo->stash != 0)
SetByteValue(UNIT_FIELD_BYTES_2, 0, cainfo->stash);
SetByteValue(UNIT_FIELD_BYTES_2, 0, uint8(cainfo->bytes2 & 0xFF));
SetByteValue(UNIT_FIELD_BYTES_2, 1, uint8((cainfo->bytes2 >> 8) & 0xFF));
//SetByteValue(UNIT_FIELD_BYTES_2, 2, uint8((cainfo->bytes2 >> 16) & 0xFF));
SetByteValue(UNIT_FIELD_BYTES_2, 2, 0);
//SetByteValue(UNIT_FIELD_BYTES_2, 3, uint8((cainfo->bytes2 >> 24) & 0xFF));
SetByteValue(UNIT_FIELD_BYTES_2, 3, 0);
}
if (cainfo->pvp_state != 0)
SetByteValue(UNIT_FIELD_BYTES_2, 1, cainfo->pvp_state);
//SetByteValue(UNIT_FIELD_BYTES_2, 2, 0);
//SetByteValue(UNIT_FIELD_BYTES_2, 3, 0);
if (cainfo->emote != 0)
SetUInt32Value(UNIT_NPC_EMOTESTATE, cainfo->emote);

View file

@ -197,13 +197,14 @@ struct CreatureDataAddonAura
SpellEffectIndex effect_idx;
};
// from `creature_addon` table
// from `creature_addon` and `creature_template_addon`tables
struct CreatureDataAddon
{
uint32 guidOrEntry;
uint32 mount;
uint32 bytes1;
uint32 bytes2;
uint8 stash; // SheathState
uint8 pvp_state; // UnitPVPStateFlags
uint32 emote;
uint32 splineFlags;
CreatureDataAddonAura const* auras; // loaded as char* "spell1 eff1 spell2 eff2 ... "