*added creature extra flag No Crit (CREATURE_FLAG_EXTRA_NO_CRIT)

*added function to disable reputation gained from monsters
*tabs2spaces in affected files

--HG--
branch : trunk
This commit is contained in:
Rat
2009-04-10 18:11:09 +02:00
parent aa6347538a
commit 1e61dffc89
4 changed files with 17 additions and 6 deletions
+1
View File
@@ -158,6 +158,7 @@ m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),m_creatureInfo(NULL), m_DBTabl
m_CreatureCategoryCooldowns.clear();
m_GlobalCooldown = 0;
m_unit_movement_flags = MOVEMENTFLAG_WALK_MODE;
DisableReputationGain = false;
}
Creature::~Creature()
+6
View File
@@ -134,6 +134,7 @@ enum CreatureFlagsExtra
CREATURE_FLAG_EXTRA_WORLDEVENT = 0x00004000, // custom flag for world event creatures (left room for merging)
//CREATURE_FLAG_EXTRA_CHARM_AI = 0x00008000, // use ai when charmed
CREATURE_FLAG_EXTRA_NO_TAUNT = 0x00010000, // cannot be taunted
CREATURE_FLAG_EXTRA_NO_CRIT = 0x00020000, // creature can't do critical strikes
};
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform
@@ -628,6 +629,9 @@ class TRINITY_DLL_SPEC Creature : public Unit
uint32 GetFormationID(){return m_formationID;}
Unit *SelectVictim();
void SetDisableReputationGain(bool disable) { DisableReputationGain = disable; }
bool IsReputationGainDisabled() { return DisableReputationGain; }
protected:
bool CreateFromProto(uint32 guidlow,uint32 Entry,uint32 team, const CreatureData *data = NULL);
bool InitEntry(uint32 entry, uint32 team=ALLIANCE, const CreatureData* data=NULL);
@@ -678,6 +682,8 @@ class TRINITY_DLL_SPEC Creature : public Unit
float mHome_Z;
float mHome_O;
bool DisableReputationGain;
private:
//WaypointMovementGenerator vars
uint32 m_waypointID;
+3
View File
@@ -5924,6 +5924,9 @@ void Player::RewardReputation(Unit *pVictim, float rate)
if(!pVictim || pVictim->GetTypeId() == TYPEID_PLAYER)
return;
if(((Creature*)pVictim)->IsReputationGainDisabled())
return;
ReputationOnKillEntry const* Rep = objmgr.GetReputationOnKilEntry(((Creature*)pVictim)->GetCreatureInfo()->Entry);
if(!Rep)
+1
View File
@@ -2557,6 +2557,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
if (tmp > 0 && roll < (sum += tmp))
{
DEBUG_LOG ("RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum);
if(GetTypeId()!=TYPEID_PLAYER && !(((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT))
return MELEE_HIT_CRIT;
}