* Added LowerPlayerDamageReq function from TC2
* Akama is summoned after the illidari council has been deafeated. (remove your akama spawn from creature db) * Dampen Magic timer * Merging mother from TC2 --HG-- branch : trunk
This commit is contained in:
@@ -93,7 +93,7 @@ void AggressorAI::EnterEvadeMode()
|
||||
i_victimGuid = 0;
|
||||
i_creature.CombatStop();
|
||||
i_creature.SetLootRecipient(NULL);
|
||||
i_creature.ResetDamageByPlayers();
|
||||
i_creature.ResetPlayerDamageReq();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -147,7 +147,7 @@ m_deathTimer(0), m_respawnTime(0), m_respawnDelay(25), m_corpseDelay(60), m_resp
|
||||
m_gossipOptionLoaded(false), m_emoteState(0), m_isPet(false), m_isTotem(false), m_reactState(REACT_AGGRESSIVE),
|
||||
m_regenTimer(2000), m_defaultMovementType(IDLE_MOTION_TYPE), m_equipmentId(0),
|
||||
m_AlreadyCallAssistance(false), m_regenHealth(true), m_AI_locked(false), m_isDeadByDefault(false),
|
||||
m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),m_creatureInfo(NULL), m_DBTableGuid(0), m_formation(NULL)
|
||||
m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),m_creatureInfo(NULL), m_DBTableGuid(0), m_formation(NULL), m_PlayerDamageReq(0)
|
||||
{
|
||||
m_valuesCount = UNIT_END;
|
||||
|
||||
@@ -159,7 +159,6 @@ m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),m_creatureInfo(NULL), m_DBTabl
|
||||
m_GlobalCooldown = 0;
|
||||
m_unit_movement_flags = MOVEMENTFLAG_WALK_MODE;
|
||||
DisableReputationGain = false;
|
||||
ResetDamageByPlayers();
|
||||
}
|
||||
|
||||
Creature::~Creature()
|
||||
@@ -1270,6 +1269,7 @@ void Creature::SelectLevel(const CreatureInfo *cinfo)
|
||||
SetCreateHealth(health);
|
||||
SetMaxHealth(health);
|
||||
SetHealth(health);
|
||||
ResetPlayerDamageReq();
|
||||
|
||||
// mana
|
||||
uint32 minmana = std::min(cinfo->maxmana, cinfo->minmana);
|
||||
@@ -1654,7 +1654,7 @@ void Creature::setDeathState(DeathState s)
|
||||
// setActive(true);
|
||||
SetHealth(GetMaxHealth());
|
||||
SetLootRecipient(NULL);
|
||||
ResetDamageByPlayers();
|
||||
ResetPlayerDamageReq();
|
||||
Unit::setDeathState(ALIVE);
|
||||
CreatureInfo const *cinfo = GetCreatureInfo();
|
||||
RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
|
||||
|
||||
+9
-5
@@ -637,10 +637,15 @@ class TRINITY_DLL_SPEC Creature : public Unit
|
||||
|
||||
void SetDisableReputationGain(bool disable) { DisableReputationGain = disable; }
|
||||
bool IsReputationGainDisabled() { return DisableReputationGain; }
|
||||
bool IsDamageEnoughForLootingAndReward() { return m_unDamageByPlayers >= (uint32)(GetMaxHealth() / 2); }
|
||||
void AddDamageByPlayers(uint32 unDamage) { m_unDamageByPlayers += unDamage; }
|
||||
void ResetDamageByPlayers() { m_unDamageByPlayers = 0; }
|
||||
|
||||
bool IsDamageEnoughForLootingAndReward() { return m_PlayerDamageReq == 0; }
|
||||
void LowerPlayerDamageReq(uint32 unDamage)
|
||||
{
|
||||
if(m_PlayerDamageReq)
|
||||
m_PlayerDamageReq > unDamage ? m_PlayerDamageReq -= unDamage : m_PlayerDamageReq = 0;
|
||||
}
|
||||
void ResetPlayerDamageReq() { m_PlayerDamageReq = GetHealth() / 2; }
|
||||
uint32 m_PlayerDamageReq;
|
||||
|
||||
protected:
|
||||
bool CreateFromProto(uint32 guidlow,uint32 Entry,uint32 team, const CreatureData *data = NULL);
|
||||
bool InitEntry(uint32 entry, uint32 team=ALLIANCE, const CreatureData* data=NULL);
|
||||
@@ -655,7 +660,6 @@ class TRINITY_DLL_SPEC Creature : public Unit
|
||||
|
||||
uint32 m_lootMoney;
|
||||
uint64 m_lootRecipient;
|
||||
uint32 m_unDamageByPlayers;
|
||||
|
||||
/// Timers
|
||||
uint32 m_deathTimer; // (msecs)timer for death or corpse disappearance
|
||||
|
||||
@@ -100,7 +100,7 @@ void CreatureAI::EnterEvadeMode()
|
||||
me->CombatStop();
|
||||
me->LoadCreaturesAddon();
|
||||
me->SetLootRecipient(NULL);
|
||||
me->ResetDamageByPlayers();
|
||||
me->ResetPlayerDamageReq();
|
||||
|
||||
if(me->isAlive())
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
@@ -104,7 +104,7 @@ ReactorAI::EnterEvadeMode()
|
||||
i_victimGuid = 0;
|
||||
i_creature.CombatStop();
|
||||
i_creature.SetLootRecipient(NULL);
|
||||
i_creature.ResetDamageByPlayers();
|
||||
i_creature.ResetPlayerDamageReq();
|
||||
|
||||
if(!i_creature.GetCharmerOrOwner())
|
||||
{
|
||||
|
||||
+1
-1
@@ -806,7 +806,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||
((Creature*)pVictim)->SetLootRecipient(this);
|
||||
|
||||
if(GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
((Creature*)pVictim)->AddDamageByPlayers(health < damage ? health : damage);
|
||||
((Creature*)pVictim)->LowerPlayerDamageReq(health < damage ? health : damage);
|
||||
}
|
||||
|
||||
if (health <= damage)
|
||||
|
||||
Reference in New Issue
Block a user