[8446] Update ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING only for real alive cases.

This fix problem with temporary "alive" cases for prist talent for example.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>

* Use final damage for check
* Also fix CMSG_REPOP_REQUEST read warning spam.
This commit is contained in:
Opterman 2009-09-01 15:44:22 +04:00 committed by VladimirMangos
parent 3b1b68595b
commit eec534f1f6
4 changed files with 14 additions and 9 deletions

View file

@ -800,10 +800,10 @@ void Player::StopMirrorTimer(MirrorTimerType Type)
GetSession()->SendPacket( &data );
}
void Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
{
if(!isAlive() || isGameMaster())
return;
return 0;
// Absorb, resist some environmental damage type
uint32 absorb = 0;
@ -825,7 +825,7 @@ void Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
data << uint32(resist);
SendMessageToSet(&data, true);
DealDamage(this, damage, NULL, SELF_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
uint32 final_damage = DealDamage(this, damage, NULL, SELF_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
if(!isAlive())
{
@ -840,6 +840,8 @@ void Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM, 1, type);
}
return final_damage;
}
int32 Player::getMaxTimer(MirrorTimerType timer)
@ -19887,10 +19889,11 @@ void Player::HandleFall(MovementInfo const& movementInfo)
if (GetDummyAura(43621))
damage = GetMaxHealth()/2;
EnvironmentalDamage(DAMAGE_FALL, damage);
uint32 original_health = GetHealth();
uint32 final_damage = EnvironmentalDamage(DAMAGE_FALL, damage);
// recheck alive, might have died of EnvironmentalDamage
if (isAlive())
// recheck alive, might have died of EnvironmentalDamage, avoid cases when player die in fact like Spirit of Redemption case
if (isAlive() && final_damage < original_health)
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING, uint32(z_diff*100));
}