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

Also related cleanup code in field cases and player Player::SetSheath.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-28 18:43:57 -05:00
parent 451471d438
commit 1288761fb7
11 changed files with 59 additions and 9 deletions
+5
View File
@@ -219,6 +219,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
{
@@ -1036,6 +1038,9 @@ class TRINITY_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 ); }