diff options
author | Shauren <shauren.trinity@gmail.com> | 2011-08-21 12:42:22 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2011-08-21 12:42:22 +0200 |
commit | 5f6c6d392582b18dbe183d774665475ab7957bf5 (patch) | |
tree | b076a7e71cbc3f352485457dc4a833101947032a /src | |
parent | 3476767eb064a648744ee294282f35e5eb60aff8 (diff) |
Core/Auras: Implemented SPELL_AURA_PREVENT_RESSURECTION
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Entities/Player/Player.cpp | 11 | ||||
-rwxr-xr-x | src/server/game/Server/Protocol/Handlers/MiscHandler.cpp | 5 | ||||
-rwxr-xr-x | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 16 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.h | 1 |
4 files changed, 26 insertions, 7 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 56899b5086a..3de39aa1d74 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -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(); diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index 3d8bb9e15c4..a5f84c411da 100755 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -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 diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 9adf57e12f8..25af367685d 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -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) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index 0c5e500d887..86bb325aa3c 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -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; |