[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 "Vehicle.h"
|
||||||
#include "CreatureAI.h"
|
#include "CreatureAI.h"
|
||||||
|
|
||||||
void WorldSession::HandleRepopRequestOpcode( WorldPacket & /*recv_data*/ )
|
void WorldSession::HandleRepopRequestOpcode( WorldPacket & recv_data )
|
||||||
{
|
{
|
||||||
sLog.outDebug( "WORLD: Recvd CMSG_REPOP_REQUEST Message" );
|
sLog.outDebug( "WORLD: Recvd CMSG_REPOP_REQUEST Message" );
|
||||||
|
|
||||||
|
recv_data.read_skip<uint8>();
|
||||||
|
|
||||||
if(GetPlayer()->isAlive()||GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
if(GetPlayer()->isAlive()||GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
+9
-6
@@ -874,10 +874,10 @@ void Player::StopMirrorTimer(MirrorTimerType Type)
|
|||||||
GetSession()->SendPacket( &data );
|
GetSession()->SendPacket( &data );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
|
uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
|
||||||
{
|
{
|
||||||
if(!isAlive() || isGameMaster())
|
if(!isAlive() || isGameMaster())
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
// Absorb, resist some environmental damage type
|
// Absorb, resist some environmental damage type
|
||||||
uint32 absorb = 0;
|
uint32 absorb = 0;
|
||||||
@@ -899,7 +899,7 @@ void Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
|
|||||||
data << uint32(resist);
|
data << uint32(resist);
|
||||||
SendMessageToSet(&data, true);
|
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())
|
if(!isAlive())
|
||||||
{
|
{
|
||||||
@@ -914,6 +914,8 @@ void Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
|
|||||||
|
|
||||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM, 1, type);
|
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM, 1, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return final_damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 Player::getMaxTimer(MirrorTimerType timer)
|
int32 Player::getMaxTimer(MirrorTimerType timer)
|
||||||
@@ -21129,10 +21131,11 @@ void Player::HandleFall(MovementInfo const& movementInfo)
|
|||||||
if (HasAura(43621))
|
if (HasAura(43621))
|
||||||
damage = GetMaxHealth()/2;
|
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
|
// recheck alive, might have died of EnvironmentalDamage, avoid cases when player die in fact like Spirit of Redemption case
|
||||||
if (damage < GetHealth())
|
if (isAlive() && final_damage < original_health)
|
||||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING, uint32(z_diff*100));
|
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 ***/
|
/*** ENVIROMENTAL SYSTEM ***/
|
||||||
/*********************************************************/
|
/*********************************************************/
|
||||||
|
|
||||||
void EnvironmentalDamage(EnviromentalDamage type, uint32 damage);
|
uint32 EnvironmentalDamage(EnviromentalDamage type, uint32 damage);
|
||||||
|
|
||||||
/*********************************************************/
|
/*********************************************************/
|
||||||
/*** FLOOD FILTER SYSTEM ***/
|
/*** FLOOD FILTER SYSTEM ***/
|
||||||
|
|||||||
Reference in New Issue
Block a user