diff options
author | Jeremy <Golrag@users.noreply.github.com> | 2018-05-01 18:26:22 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2018-05-01 19:26:22 +0300 |
commit | 8fa3d2a3852e3cdbc06f0a8080a9503b0697c3b8 (patch) | |
tree | aaae922fa54f58439cb48ef6bf9abad3f1b29c1d | |
parent | 87ed45d912ab6ffc6cf09bbf3a42ac59533ce5e1 (diff) |
Core/Player: Fix issue with pvp rules not being permanent in pvp areas (#21894)
* Core/Player: Make pvp rules enabled aura permanent when walking into a pvp zone while in pvp combat
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 9becff0eb34..b43074441fc 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -26346,19 +26346,23 @@ bool Player::HasPvpTalent(uint32 talentID, uint8 activeTalentGroup) const void Player::EnablePvpRules(bool dueToCombat /*= false*/) { - if (HasPvpRulesEnabled()) - return; + if (!HasPvpRulesEnabled()) + { + if (!HasSpell(195710)) // Honorable Medallion + CastSpell(this, 208682, true); // Learn Gladiator's Medallion - if (!HasSpell(195710)) // Honorable Medallion - CastSpell(this, 208682); // Learn Gladiator's Medallion + CastSpell(this, SPELL_PVP_RULES_ENABLED, true); + } - CastSpell(this, SPELL_PVP_RULES_ENABLED); if (!dueToCombat) { if (Aura* aura = GetAura(SPELL_PVP_RULES_ENABLED)) { - aura->SetMaxDuration(-1); - aura->SetDuration(-1); + if (!aura->IsPermanent()) + { + aura->SetMaxDuration(-1); + aura->SetDuration(-1); + } } } |