mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 07:37:03 +00:00
[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:
parent
3b1b68595b
commit
eec534f1f6
4 changed files with 14 additions and 9 deletions
|
|
@ -40,10 +40,12 @@
|
||||||
#include "Pet.h"
|
#include "Pet.h"
|
||||||
#include "SocialMgr.h"
|
#include "SocialMgr.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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -800,10 +800,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;
|
||||||
|
|
@ -825,7 +825,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())
|
||||||
{
|
{
|
||||||
|
|
@ -840,6 +840,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)
|
||||||
|
|
@ -19887,10 +19889,11 @@ void Player::HandleFall(MovementInfo const& movementInfo)
|
||||||
if (GetDummyAura(43621))
|
if (GetDummyAura(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 (isAlive())
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2045,7 +2045,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 ***/
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8445"
|
#define REVISION_NR "8446"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue