[8446] Update ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING only for real alive cases. Author: Opterman
This fix problem with temporary "alive" cases for prist talent for example.
Signed-off-by: VladimirMangos <[email protected]>
* Use final damage for check
* Also fix CMSG_REPOP_REQUEST read warning spam.
--HG--
branch : trunk
This commit is contained in:
@@ -48,10 +48,12 @@
|
||||
#include "Vehicle.h"
|
||||
#include "CreatureAI.h"
|
||||
|
||||
void WorldSession::HandleRepopRequestOpcode( WorldPacket & /*recv_data*/ )
|
||||
void WorldSession::HandleRepopRequestOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
sLog.outDebug( "WORLD: Recvd CMSG_REPOP_REQUEST Message" );
|
||||
|
||||
recv_data.read_skip<uint8>();
|
||||
|
||||
if(GetPlayer()->isAlive()||GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
return;
|
||||
|
||||
|
||||
+9
-6
@@ -874,10 +874,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;
|
||||
@@ -899,7 +899,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())
|
||||
{
|
||||
@@ -914,6 +914,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)
|
||||
@@ -21129,10 +21131,11 @@ void Player::HandleFall(MovementInfo const& movementInfo)
|
||||
if (HasAura(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 (damage < GetHealth())
|
||||
// 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));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2038,7 +2038,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||
/*** ENVIROMENTAL SYSTEM ***/
|
||||
/*********************************************************/
|
||||
|
||||
void EnvironmentalDamage(EnviromentalDamage type, uint32 damage);
|
||||
uint32 EnvironmentalDamage(EnviromentalDamage type, uint32 damage);
|
||||
|
||||
/*********************************************************/
|
||||
/*** FLOOD FILTER SYSTEM ***/
|
||||
|
||||
Reference in New Issue
Block a user