Core/Auras: Implemented SPELL_AURA_PREVENT_RESSURECTION

This commit is contained in:
Shauren
2011-08-21 12:42:22 +02:00
parent 3476767eb0
commit 5f6c6d3925
4 changed files with 26 additions and 7 deletions
+6 -5
View File
@@ -831,7 +831,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
m_lastFallTime = 0;
m_lastFallZ = 0;
m_grantableLevels = 0;
m_ControlledByPlayer = true;
@@ -1751,7 +1751,7 @@ void Player::Update(uint32 p_time)
}
// not auto-free ghost from body in instances
if (m_deathTimer > 0 && !GetBaseMap()->Instanceable())
if (m_deathTimer > 0 && !GetBaseMap()->Instanceable() && !HasAuraType(SPELL_AURA_PREVENT_RESSURECTION))
{
if (p_time >= m_deathTimer)
{
@@ -5165,7 +5165,8 @@ bool Player::FallGround(uint8 FallMode)
void Player::KillPlayer()
{
if (IsFlying() && !GetTransport()) FallGround();
if (IsFlying() && !GetTransport())
FallGround();
SetMovement(MOVE_ROOT);
@@ -5175,10 +5176,10 @@ void Player::KillPlayer()
//SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_IN_PVP);
SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE);
ApplyModFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTE_RELEASE_TIMER, !sMapStore.LookupEntry(GetMapId())->Instanceable());
ApplyModFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTE_RELEASE_TIMER, !sMapStore.LookupEntry(GetMapId())->Instanceable() && !HasAuraType(SPELL_AURA_PREVENT_RESSURECTION));
// 6 minutes until repop at graveyard
m_deathTimer = 6*MINUTE*IN_MILLISECONDS;
m_deathTimer = 6 * MINUTE * IN_MILLISECONDS;
UpdateCorpseReclaimDelay(); // dependent at use SetDeathPvP() call before kill
SendCorpseReclaimDelay();
@@ -57,9 +57,12 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data)
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;
if (GetPlayer()->HasAuraType(SPELL_AURA_PREVENT_RESSURECTION))
return; // silently return, client should display the error by itself
// the world update order is sessions, players, creatures
// the netcode runs in parallel with all of these
// creatures can kill players
@@ -367,7 +367,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
&AuraEffect::HandleNULL, //311 0 spells in 3.3.5
&AuraEffect::HandleNULL, //312 0 spells in 3.3.5
&AuraEffect::HandleNULL, //313 0 spells in 3.3.5
&AuraEffect::HandleNoImmediateEffect, //314 SPELL_AURA_PREVENT_RESSURECTION todo
&AuraEffect::HandlePreventResurrection, //314 SPELL_AURA_PREVENT_RESSURECTION todo
&AuraEffect::HandleNoImmediateEffect, //315 SPELL_AURA_UNDERWATER_WALKING todo
&AuraEffect::HandleNoImmediateEffect, //316 SPELL_AURA_PERIODIC_HASTE implemented in AuraEffect::CalculatePeriodic
};
@@ -5600,6 +5600,20 @@ void AuraEffect::HandleAuraSetVehicle(AuraApplication const* aurApp, uint8 mode,
}
}
void AuraEffect::HandlePreventResurrection(AuraApplication const* aurApp, uint8 mode, bool apply) const
{
if (!(mode & AURA_EFFECT_HANDLE_REAL))
return;
if (aurApp->GetTarget()->GetTypeId() != TYPEID_PLAYER)
return;
if (apply)
aurApp->GetTarget()->RemoveByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER);
else if (!aurApp->GetTarget()->GetBaseMap()->Instanceable())
aurApp->GetTarget()->SetByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER);
}
void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const
{
switch (GetSpellInfo()->SpellFamilyName)
@@ -277,6 +277,7 @@ class AuraEffect
void HandleAuraModFakeInebriation(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleAuraSetVehicle(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandlePreventResurrection(AuraApplication const* aurApp, uint8 mode, bool apply) const;
// aura effect periodic tick handlers
void HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const;