Core/Creatures: DoTs and self damage will no longer reset time since last damage taken for stopping creature from evading

This commit is contained in:
Shauren
2013-08-02 19:56:48 +02:00
parent 5ae86ee2a8
commit 20a61b6400
2 changed files with 6 additions and 7 deletions
+1 -2
View File
@@ -165,8 +165,6 @@ void CreatureAI::EnterEvadeMode()
if (me->IsVehicle()) // use the same sequence of addtoworld, aireset may remove all summons!
me->GetVehicleKit()->Reset(true);
me->SetLastDamagedTime(0);
}
/*void CreatureAI::AttackedBy(Unit* attacker)
@@ -236,6 +234,7 @@ bool CreatureAI::_EnterEvadeMode()
me->LoadCreaturesAddon();
me->SetLootRecipient(NULL);
me->ResetPlayerDamageReq();
me->SetLastDamagedTime(0);
if (me->IsInEvadeMode())
return false;
+5 -5
View File
@@ -738,10 +738,14 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
if (victim->GetTypeId() == TYPEID_PLAYER)
victim->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED, damage);
victim->ModifyHealth(- (int32)damage);
victim->ModifyHealth(-(int32)damage);
if (damagetype == DIRECT_DAMAGE || damagetype == SPELL_DIRECT_DAMAGE)
{
victim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_DIRECT_DAMAGE, spellProto ? spellProto->Id : 0);
if (victim->GetTypeId() == TYPEID_UNIT && !victim->IsPet())
victim->SetLastDamagedTime(time(NULL));
}
if (victim->GetTypeId() != TYPEID_PLAYER)
victim->AddThreat(this, float(damage), damageSchoolMask, spellProto);
@@ -11961,10 +11965,6 @@ int32 Unit::ModifyHealth(int32 dVal)
if (dVal == 0)
return 0;
// Part of Evade mechanics. Only track health lost, not gained.
if (dVal < 0 && GetTypeId() != TYPEID_PLAYER && !IsPet())
SetLastDamagedTime(time(NULL));
int32 curHealth = (int32)GetHealth();
int32 val = dVal + curHealth;