void CreatureEventAI::DoFindFriendlyMissingBuff(std::list<Creature*>& _list, float range, uint32 spellid) { CellCoord p(Trinity::ComputeCellCoord(me->GetPositionX(), me->GetPositionY())); Cell cell(p); cell.SetNoCreate(); Trinity::FriendlyMissingBuffInRange u_check(me, range, spellid); Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange> searcher(me, _list, u_check); TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange>, GridTypeMapContainer > grid_creature_searcher(searcher); cell.Visit(p, grid_creature_searcher, *me->GetMap(), *me, range); }
std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 spellid) { CellPair p(MaNGOS::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); Cell cell(p); cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); std::list<Creature*> pList; MaNGOS::FriendlyMissingBuffInRange u_check(m_creature, range, spellid); MaNGOS::CreatureListSearcher<MaNGOS::FriendlyMissingBuffInRange> searcher(m_creature, pList, u_check); TypeContainerVisitor<MaNGOS::CreatureListSearcher<MaNGOS::FriendlyMissingBuffInRange>, GridTypeMapContainer > grid_creature_searcher(searcher); CellLock<GridReadGuard> cell_lock(cell, p); cell_lock->Visit(cell_lock, grid_creature_searcher, *(m_creature->GetMap())); return pList; }
Creature *RespawnNearbyBugsAndGetOne() { CellPair p(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); Cell cell(p); cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); std::list<Creature*> unitList; AnyBugCheck u_check(m_creature, 150); Trinity::CreatureListSearcher<AnyBugCheck> searcher(unitList, u_check); TypeContainerVisitor<Trinity::CreatureListSearcher<AnyBugCheck>, GridTypeMapContainer > grid_creature_searcher(searcher); CellLock<GridReadGuard> cell_lock(cell, p); cell_lock->Visit(cell_lock, grid_creature_searcher, *(m_creature->GetMap())); Creature *nearb = NULL; for(std::list<Creature*>::iterator iter = unitList.begin(); iter != unitList.end(); ++iter) { Creature *c = (Creature *)(*iter); if (c->isDead()) { c->Respawn(); c->setFaction(7); c->RemoveAllAuras(); } if (c->IsWithinDistInMap(m_creature, ABUSE_BUG_RANGE)) { if (!nearb || (rand()%4)==0) nearb = c; } } return nearb; }
std::list<Creature*> ScriptedAI::DoFindFriendlyCC(float fRange) { CellPair p(MaNGOS::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); Cell cell(p); cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); std::list<Creature*> pList; MaNGOS::FriendlyCCedInRange u_check(m_creature, fRange); MaNGOS::CreatureListSearcher<MaNGOS::FriendlyCCedInRange> searcher(m_creature, pList, u_check); TypeContainerVisitor<MaNGOS::CreatureListSearcher<MaNGOS::FriendlyCCedInRange>, GridTypeMapContainer > grid_creature_searcher(searcher); cell.Visit(p, grid_creature_searcher, *(m_creature->GetMap()), *m_creature, fRange); return pList; }
Creature* RespawnNearbyBugsAndGetOne() { CellCoord p(Oregon::ComputeCellCoord(me->GetPositionX(), me->GetPositionY())); Cell cell(p); cell.SetNoCreate(); std::list<Creature*> unitList; AnyBugCheck u_check(me, 150); Oregon::CreatureListSearcher<AnyBugCheck> searcher(me, unitList, u_check); TypeContainerVisitor<Oregon::CreatureListSearcher<AnyBugCheck>, GridTypeMapContainer > grid_creature_searcher(searcher); cell.Visit(p, grid_creature_searcher, *(me->GetMap()), *me, me->GetGridActivationRange()); Creature* nearb = NULL; for (std::list<Creature*>::iterator iter = unitList.begin(); iter != unitList.end(); ++iter) { Creature* c = (Creature*)(*iter); if (c && c->isDead()) { c->Respawn(); c->SetFaction(7); c->RemoveAllAuras(); } if (c->IsWithinDistInMap(me, ABUSE_BUG_RANGE)) { if (!nearb || (rand() % 4) == 0) nearb = c; } } return nearb; }
void CreatureEventAI::DoFindFriendlyCC(std::list<Creature*>& _list, float range) { CellPair p(Trinity::ComputeCellPair(me->GetPositionX(), me->GetPositionY())); Cell cell(p); cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); Trinity::FriendlyCCedInRange u_check(me, range); Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange> searcher(me, _list, u_check); TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange>, GridTypeMapContainer > grid_creature_searcher(searcher); cell.Visit(p, grid_creature_searcher, *me->GetMap()); }
std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float fRange, uint32 uiSpellId) { CellPair p(Diamond::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); Cell cell(p); cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); std::list<Creature*> pList; Diamond::FriendlyMissingBuffInRange u_check(m_creature, fRange, uiSpellId); Diamond::CreatureListSearcher<Diamond::FriendlyMissingBuffInRange> searcher(m_creature, pList, u_check); GridTypeVisitor<Diamond::CreatureListSearcher<Diamond::FriendlyMissingBuffInRange> >::Grid grid_creature_searcher(searcher); cell.Visit(p, grid_creature_searcher, *(m_creature->GetMap()), *m_creature, fRange); return pList; }