diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h index 9ac71ee02..b04c7818c 100644 --- a/src/game/GridNotifiers.h +++ b/src/game/GridNotifiers.h @@ -469,6 +469,21 @@ namespace MaNGOS template void Visit(GridRefManager &) {} }; + template + struct MANGOS_DLL_DECL PlayerListSearcher + { + uint32 i_phaseMask; + std::list &i_objects; + Check& i_check; + + PlayerListSearcher(std::list &objects, Check & check) + : i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_objects(objects),i_check(check) {} + + void Visit(PlayerMapType &m); + + template void Visit(GridRefManager &) {} + }; + template struct MANGOS_DLL_DECL PlayerWorker { @@ -1137,6 +1152,8 @@ namespace MaNGOS NearestCreatureEntryWithLiveStateInObjectRangeCheck(NearestCreatureEntryWithLiveStateInObjectRangeCheck const&); }; + // Player checks and do + class AnyPlayerInObjectRangeCheck { public: @@ -1154,7 +1171,23 @@ namespace MaNGOS float i_range; }; - // Player checks and do + class AnyPlayerInObjectRangeWithAuraCheck + { + public: + AnyPlayerInObjectRangeWithAuraCheck(WorldObject const* obj, float range, uint32 spellId) + : i_obj(obj), i_range(range), i_spellId(spellId) {} + WorldObject const& GetFocusObject() const { return *i_obj; } + bool operator()(Player* u) + { + return u->isAlive() + && i_obj->IsWithinDistInMap(u, i_range) + && u->HasAura(i_spellId); + } + private: + WorldObject const* i_obj; + float i_range; + uint32 i_spellId; + }; // Prepare using Builder localized packets with caching and send to player template diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h index 59b4dcd58..f8e8e8f29 100644 --- a/src/game/GridNotifiersImpl.h +++ b/src/game/GridNotifiersImpl.h @@ -547,6 +547,15 @@ void MaNGOS::PlayerSearcher::Visit(PlayerMapType &m) } } +template +void MaNGOS::PlayerListSearcher::Visit(PlayerMapType &m) +{ + for(PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr) + if (itr->getSource()->InSamePhase(i_phaseMask)) + if (i_check(itr->getSource())) + i_objects.push_back(itr->getSource()); +} + template void MaNGOS::LocalizedPacketDo::operator()( Player* p ) { diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index dd8d57c33..a854f808e 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1112,8 +1112,29 @@ void Aura::TriggerSpell() target->CastSpell(target, 23171, true, NULL, this); return; } -// // Mark of Frost -// case 23184: break; + case 23184: // Mark of Frost + case 25041: // Mark of Nature + { + std::list targets; + + // spells existed in 1.x.x; 23183 - mark of frost; 25042 - mark of nature; both had radius of 100.0 yards in 1.x.x DBC + // spells are used by Azuregos and the Emerald dragons in order to put a stun debuff on the players which resurrect during the encounter + // in order to implement the missing spells we need to make a grid search for hostile players and check their auras; if they are marked apply debuff + + // Mark of Frost or Mark of Nature + uint32 markSpellId = auraId == 23184 ? 23182 : 25040; + // Aura of Frost or Aura of Nature + uint32 debufSpellId = auraId == 23184 ? 23186 : 25043; + + MaNGOS::AnyPlayerInObjectRangeWithAuraCheck u_check(GetTarget(), 100.0f, markSpellId); + MaNGOS::PlayerListSearcher checker(targets, u_check); + Cell::VisitWorldObjects(GetTarget(), checker, 100.0f); + + for (std::list::iterator itr = targets.begin(); itr != targets.end(); ++itr) + (*itr)->CastSpell((*itr), debufSpellId, true, NULL, NULL, casterGUID); + + return; + } case 23493: // Restoration { uint32 heal = triggerTarget->GetMaxHealth() / 10; @@ -1161,8 +1182,6 @@ void Aura::TriggerSpell() } // // Stink Trap // case 24918: break; -// // Mark of Nature -// case 25041: break; // // Agro Drones // case 25152: break; case 25371: // Consume diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 4873598e9..40ef06f66 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11471" + #define REVISION_NR "11472" #endif // __REVISION_NR_H__