*Grobbulus - in Inject event, tank is not a target for this spell, by Gyullo
*Gundrak - AI for the boss Moorabi, by Manuel *Improvements to player death handling (they will now fall to the ground).. also attempted to improve creature death handling the same way. --HG-- branch : trunk
This commit is contained in:
@@ -1773,7 +1773,7 @@ void Creature::setDeathState(DeathState s)
|
||||
if(m_formation && m_formation->getLeader() == this)
|
||||
m_formation->FormationReset(true);
|
||||
|
||||
if (canFly() && FallGround())
|
||||
if ((canFly() || IsFlying()) && FallGround())
|
||||
return;
|
||||
|
||||
Unit::setDeathState(CORPSE);
|
||||
|
||||
@@ -4442,8 +4442,27 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
|
||||
}
|
||||
}
|
||||
|
||||
bool Player::FallGround(bool noDeath/* = false*/)
|
||||
{
|
||||
// Let's abort after we called this function one time
|
||||
if (getDeathState() == DEAD_FALLING && !noDeath)
|
||||
return false;
|
||||
|
||||
float x, y, z;
|
||||
GetPosition(x, y, z);
|
||||
float ground_Z = GetMap()->GetVmapHeight(x, y, z, true);
|
||||
if (fabs(ground_Z - z) < 0.1f)
|
||||
return false;
|
||||
|
||||
GetMotionMaster()->MoveFall(ground_Z, EVENT_FALL_GROUND);
|
||||
if(!noDeath) Unit::setDeathState(DEAD_FALLING);
|
||||
return true;
|
||||
}
|
||||
|
||||
void Player::KillPlayer()
|
||||
{
|
||||
if(IsFlying()) FallGround();
|
||||
|
||||
SetMovement(MOVE_ROOT);
|
||||
|
||||
StopMirrorTimers(); //disable timers(bars)
|
||||
|
||||
@@ -1748,6 +1748,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||
Corpse *GetCorpse() const;
|
||||
void SpawnCorpseBones();
|
||||
void CreateCorpse();
|
||||
bool FallGround(bool noDeath = false);
|
||||
void KillPlayer();
|
||||
uint32 GetResurrectionSpellId();
|
||||
void ResurrectPlayer(float restore_percent, bool applySickness = false);
|
||||
|
||||
Reference in New Issue
Block a user