aboutsummaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/Creature.cpp1
-rw-r--r--src/game/Creature.h5
-rw-r--r--src/game/Object.cpp3
-rw-r--r--src/game/Player.cpp3
-rw-r--r--src/game/Unit.cpp6
5 files changed, 15 insertions, 3 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index 74ebe4406c8..e41d18ac0a0 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -151,6 +151,7 @@ m_creatureInfo(NULL), m_reactState(REACT_AGGRESSIVE), m_formation(NULL), m_summo
m_CreatureCategoryCooldowns.clear();
m_GlobalCooldown = 0;
m_unit_movement_flags = MOVEMENTFLAG_WALK_MODE;
+ DisableReputationGain = false;
}
Creature::~Creature()
diff --git a/src/game/Creature.h b/src/game/Creature.h
index 0b09a00b84f..ce890c34902 100644
--- a/src/game/Creature.h
+++ b/src/game/Creature.h
@@ -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
};
enum SummonMask
@@ -681,6 +682,8 @@ class TRINITY_DLL_SPEC Creature : public Unit
Unit *SelectVictim();
void SetDeadByDefault (bool death_state) {m_isDeadByDefault = death_state;}
+ 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);
@@ -729,6 +732,8 @@ class TRINITY_DLL_SPEC Creature : public Unit
float mHome_Z;
float mHome_O;
+ bool DisableReputationGain;
+
private:
//WaypointMovementGenerator vars
uint32 m_waypointID;
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index 924188bc3e2..cf59105742e 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -673,7 +673,8 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
if(sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && index == UNIT_FIELD_BYTES_2)
{
DEBUG_LOG("-- VALUES_UPDATE: Sending '%s' the blue-group-fix from '%s' (flag)", target->GetName(), ((Player*)this)->GetName());
- *data << ( m_uint32Values[ index ] & (UNIT_BYTE2_FLAG_SANCTUARY << 8) ); // this flag is at uint8 offset 1 !!
+ *data << ( m_uint32Values[ index ] & ((UNIT_BYTE2_FLAG_SANCTUARY | UNIT_BYTE2_FLAG_AURAS | UNIT_BYTE2_FLAG_UNK5) << 8) ); // this flag is at uint8 offset 1 !!
+
ch = true;
}
else
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 2064a6b6f3c..992630ad1d5 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -5722,6 +5722,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)
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index a54ca74dfc6..c287cb1a033 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -1621,7 +1621,8 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
// If this is a creature and it attacks from behind it has a probability to daze it's victim
if( (damageInfo->hitOutCome==MELEE_HIT_CRIT || damageInfo->hitOutCome==MELEE_HIT_CRUSHING || damageInfo->hitOutCome==MELEE_HIT_NORMAL || damageInfo->hitOutCome==MELEE_HIT_GLANCING) &&
- GetTypeId() != TYPEID_PLAYER && !((Creature*)this)->GetCharmerOrOwnerGUID() && !pVictim->HasInArc(M_PI, this) )
+ GetTypeId() != TYPEID_PLAYER && !((Creature*)this)->GetCharmerOrOwnerGUID() && !pVictim->HasInArc(M_PI, this)
+ && (pVictim->GetTypeId() == TYPEID_PLAYER || !((Creature*)pVictim)->isWorldBoss()))
{
// -probability is between 0% and 40%
// 20% base chance
@@ -2424,7 +2425,8 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
if (tmp > 0 && roll < (sum += tmp))
{
DEBUG_LOG ("RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum);
- return MELEE_HIT_CRIT;
+ if(GetTypeId()!=TYPEID_PLAYER && !(((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT))
+ return MELEE_HIT_CRIT;
}
// Max 40% chance to score a glancing blow against mobs that are higher level (can do only players and pets and not with ranged weapon)