[7905] Implement ACTION_T_SET_SHEATH for creature event ai make possibility set ranged fire state.

Also related cleanup code in field cases and player Player::SetSheath.
This commit is contained in:
VladimirMangos 2009-05-29 01:00:29 +04:00
parent 2fc277fdb6
commit b83f32fc19
10 changed files with 38 additions and 10 deletions

View file

@ -191,6 +191,8 @@ enum SheathState
SHEATH_STATE_RANGED = 2 // prepared ranged weapon
};
#define MAX_SHEATH_STATE 3
// byte (1 from 0..3) of UNIT_FIELD_BYTES_2
enum UnitBytes2_Flags
{
@ -918,6 +920,9 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
void ApplyAttackTimePercentMod(WeaponAttackType att,float val, bool apply);
void ApplyCastTimePercentMod(float val, bool apply);
SheathState GetSheath() const { return SheathState(GetByteValue(UNIT_FIELD_BYTES_2, 0)); }
virtual void SetSheath( SheathState sheathed ) { SetByteValue(UNIT_FIELD_BYTES_2, 0, sheathed); }
// faction template id
uint32 getFaction() const { return GetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE); }
void setFaction(uint32 faction) { SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, faction ); }