diff options
author | Spp <none@none> | 2010-01-07 07:36:49 +0100 |
---|---|---|
committer | Spp <none@none> | 2010-01-07 07:36:49 +0100 |
commit | 7fff2a72a1e9e1b3e014fcec2f2a06f212342fe0 (patch) | |
tree | 265573551847bf47ecba5f1b731381ee7d1b4516 | |
parent | de414a2b198863943046decd9bca919bb70e1c2c (diff) |
Fix Essence of Wintergrasp apply conditions removed in 3.2.2 upgrade
--HG--
branch : trunk
-rw-r--r-- | src/game/SpellMgr.cpp | 57 |
1 files changed, 19 insertions, 38 deletions
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index a6935cf9077..4efd88def0c 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -3009,67 +3009,48 @@ DiminishingReturnsType GetDiminishingReturnsGroupType(DiminishingGroup group) bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 newArea) const { - if(gender!=GENDER_NONE) - { - // not in expected gender - if(!player || gender != player->getGender()) + if (gender != GENDER_NONE) // not in expected gender + if (!player || gender != player->getGender()) return false; - } - if(raceMask) - { - // not in expected race - if(!player || !(raceMask & player->getRaceMask())) + if (raceMask) // not in expected race + if (!player || !(raceMask & player->getRaceMask())) return false; - } - if(areaId) - { - // not in expected zone - if(newZone!=areaId && newArea!=areaId) + if (areaId) // not in expected zone + if (newZone != areaId && newArea != areaId) return false; - } - if(questStart) - { - // not in expected required quest state - if(!player || (!questStartCanActive || !player->IsActiveQuest(questStart)) && !player->GetQuestRewardStatus(questStart)) + if (questStart) // not in expected required quest state + if (!player || (!questStartCanActive || !player->IsActiveQuest(questStart)) && !player->GetQuestRewardStatus(questStart)) return false; - } - if(questEnd) - { - // not in expected forbidden quest state - if(!player || player->GetQuestRewardStatus(questEnd)) + if (questEnd) // not in expected forbidden quest state + if (!player || player->GetQuestRewardStatus(questEnd)) return false; - } - if(auraSpell) - { - // not have expected aura - if(!player) + if (auraSpell) // not have expected aura + if (!player || auraSpell > 0 && !player->HasAura(auraSpell) || auraSpell < 0 && player->HasAura(-auraSpell)) return false; - if(auraSpell > 0) - // have expected aura - return player->HasAura(auraSpell); - else - // not have expected aura - return !player->HasAura(-auraSpell); - } // Extra conditions switch(spellId) { - case 58600: // No fly Zone - Dalaran (Krasus Landing exception) + case SPELL_RESTRICTED_FLIGHT_AREA_58600: // No fly Zone - Dalaran (Krasus Landing exception) if (!player || player->GetAreaId() == 4564 || !player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !player->HasAuraType(SPELL_AURA_FLY) || player->HasAura(44795)) return false; break; - case 58730: // No fly Zone - Wintergrasp + case SPELL_RESTRICTED_FLIGHT_AREA_58730: // No fly Zone - Wintergrasp if (!player || !player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !player->HasAuraType(SPELL_AURA_FLY) || player->HasAura(45472) || player->HasAura(44795)) return false; break; + case SPELL_ESSENCE_OF_WINTERGRASP_58045: // Essence of Wintergrasp - Wintergrasp + case SPELL_ESSENCE_OF_WINTERGRASP_57940: // Essence of Wintergrasp - Northrend + if (!player || player->GetTeamId() != sWorld.getState(WORLDSTATE_WINTERGRASP_CONTROLING_FACTION)) + return false; + break; } return true; |