TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GridNotifiers.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef TRINITY_GRIDNOTIFIERS_H
20 #define TRINITY_GRIDNOTIFIERS_H
21 
22 #include "ObjectGridLoader.h"
23 #include "UpdateData.h"
24 #include <iostream>
25 
26 #include "Corpse.h"
27 #include "Object.h"
28 #include "AreaTrigger.h"
29 #include "DynamicObject.h"
30 #include "GameObject.h"
31 #include "Player.h"
32 #include "Unit.h"
33 #include "CreatureAI.h"
34 #include "Spell.h"
35 #include "WorldSession.h"
36 #include "Packet.h"
37 
38 class Player;
39 //class Map;
40 
41 namespace Trinity
42 {
44  {
47  std::set<Unit*> i_visibleNow;
49 
50  VisibleNotifier(Player &player) : i_player(player), i_data(player.GetMapId()), vis_guids(player.m_clientGUIDs) { }
51  template<class T> void Visit(GridRefManager<T> &m);
52  void SendToSelf(void);
53  };
54 
56  {
58 
59  explicit VisibleChangesNotifier(WorldObject &object) : i_object(object) { }
60  template<class T> void Visit(GridRefManager<T> &) { }
61  void Visit(PlayerMapType &);
62  void Visit(CreatureMapType &);
64  };
65 
67  {
68  PlayerRelocationNotifier(Player &player) : VisibleNotifier(player) { }
69 
70  template<class T> void Visit(GridRefManager<T> &m) { VisibleNotifier::Visit(m); }
71  void Visit(CreatureMapType &);
72  void Visit(PlayerMapType &);
73  };
74 
76  {
78  CreatureRelocationNotifier(Creature &c) : i_creature(c) { }
79  template<class T> void Visit(GridRefManager<T> &) { }
80  void Visit(CreatureMapType &);
81  void Visit(PlayerMapType &);
82  };
83 
85  {
89  const float i_radius;
90  DelayedUnitRelocation(Cell &c, CellCoord &pair, Map &map, float radius) :
91  i_map(map), cell(c), p(pair), i_radius(radius) { }
92  template<class T> void Visit(GridRefManager<T> &) { }
93  void Visit(CreatureMapType &);
94  void Visit(PlayerMapType &);
95  };
96 
98  {
101  explicit AIRelocationNotifier(Unit &unit) : i_unit(unit), isCreature(unit.GetTypeId() == TYPEID_UNIT) { }
102  template<class T> void Visit(GridRefManager<T> &) { }
103  void Visit(CreatureMapType &);
104  };
105 
106  struct GridUpdater
107  {
110  GridUpdater(GridType &grid, uint32 diff) : i_grid(grid), i_timeDiff(diff) { }
111 
112  template<class T> void updateObjects(GridRefManager<T> &m)
113  {
114  for (typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
115  iter->GetSource()->Update(i_timeDiff);
116  }
117 
118  void Visit(PlayerMapType &m) { updateObjects<Player>(m); }
119  void Visit(CreatureMapType &m){ updateObjects<Creature>(m); }
120  void Visit(GameObjectMapType &m) { updateObjects<GameObject>(m); }
121  void Visit(DynamicObjectMapType &m) { updateObjects<DynamicObject>(m); }
122  void Visit(CorpseMapType &m) { updateObjects<Corpse>(m); }
123  void Visit(AreaTriggerMapType &m) { updateObjects<AreaTrigger>(m); }
124  };
125 
127  {
130  float i_distSq;
133  MessageDistDeliverer(WorldObject* src, WorldPacket const* msg, float dist, bool own_team_only = false, Player const* skipped = NULL)
134  : i_source(src), i_message(msg), i_distSq(dist * dist)
135  , team(0)
136  , skipped_receiver(skipped)
137  {
138  if (own_team_only)
139  if (Player* player = src->ToPlayer())
140  team = player->GetTeam();
141  }
142 
143  void Visit(PlayerMapType &m);
144  void Visit(CreatureMapType &m);
145  void Visit(DynamicObjectMapType &m);
146  template<class SKIP> void Visit(GridRefManager<SKIP> &) { }
147 
148  void SendPacket(Player* player)
149  {
150  // never send packet to self
151  if (player == i_source || (team && player->GetTeam() != team) || skipped_receiver == player)
152  return;
153 
154  if (!player->HaveAtClient(i_source))
155  return;
156 
157  if (WorldSession* session = player->GetSession())
158  session->SendPacket(i_message);
159  }
160  };
161 
163  {
165  explicit ObjectUpdater(const uint32 diff) : i_timeDiff(diff) { }
166  template<class T> void Visit(GridRefManager<T> &m);
167  void Visit(PlayerMapType &) { }
168  void Visit(CorpseMapType &) { }
169  };
170 
171  // SEARCHERS & LIST SEARCHERS & WORKERS
172 
173  // WorldObject searchers & workers
174 
175  template<class Check>
177  {
180  Check &i_check;
182 
183  WorldObjectSearcher(WorldObject const* searcher, WorldObject* & result, Check& check, uint32 mapTypeMask = GRID_MAP_TYPE_MASK_ALL)
184  : _searcher(searcher), i_object(result), i_check(check), i_mapTypeMask(mapTypeMask) { }
185 
186  void Visit(GameObjectMapType &m);
187  void Visit(PlayerMapType &m);
188  void Visit(CreatureMapType &m);
189  void Visit(CorpseMapType &m);
190  void Visit(DynamicObjectMapType &m);
191  void Visit(AreaTriggerMapType &m);
192 
193  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
194  };
195 
196  template<class Check>
198  {
201  Check &i_check;
203 
204  WorldObjectLastSearcher(WorldObject const* searcher, WorldObject* & result, Check& check, uint32 mapTypeMask = GRID_MAP_TYPE_MASK_ALL)
205  : _searcher(searcher), i_object(result), i_check(check), i_mapTypeMask(mapTypeMask) { }
206 
207  void Visit(GameObjectMapType &m);
208  void Visit(PlayerMapType &m);
209  void Visit(CreatureMapType &m);
210  void Visit(CorpseMapType &m);
211  void Visit(DynamicObjectMapType &m);
212  void Visit(AreaTriggerMapType &m);
213 
214  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
215  };
216 
217  template<class Check>
219  {
222  std::list<WorldObject*> &i_objects;
223  Check& i_check;
224 
225  WorldObjectListSearcher(WorldObject const* searcher, std::list<WorldObject*> &objects, Check & check, uint32 mapTypeMask = GRID_MAP_TYPE_MASK_ALL)
226  : i_mapTypeMask(mapTypeMask), _searcher(searcher), i_objects(objects), i_check(check) { }
227 
228  void Visit(PlayerMapType &m);
229  void Visit(CreatureMapType &m);
230  void Visit(CorpseMapType &m);
231  void Visit(GameObjectMapType &m);
232  void Visit(DynamicObjectMapType &m);
233  void Visit(AreaTriggerMapType &m);
234 
235  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
236  };
237 
238  template<class Do>
240  {
243  Do const& i_do;
244 
245  WorldObjectWorker(WorldObject const* searcher, Do const& _do, uint32 mapTypeMask = GRID_MAP_TYPE_MASK_ALL)
246  : i_mapTypeMask(mapTypeMask), _searcher(searcher), i_do(_do) { }
247 
249  {
250  if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_GAMEOBJECT))
251  return;
252  for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
253  if (itr->GetSource()->IsInPhase(_searcher))
254  i_do(itr->GetSource());
255  }
256 
258  {
259  if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_PLAYER))
260  return;
261  for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
262  if (itr->GetSource()->IsInPhase(_searcher))
263  i_do(itr->GetSource());
264  }
266  {
267  if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CREATURE))
268  return;
269  for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
270  if (itr->GetSource()->IsInPhase(_searcher))
271  i_do(itr->GetSource());
272  }
273 
275  {
276  if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CORPSE))
277  return;
278  for (CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
279  if (itr->GetSource()->IsInPhase(_searcher))
280  i_do(itr->GetSource());
281  }
282 
284  {
285  if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_DYNAMICOBJECT))
286  return;
287  for (DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
288  if (itr->GetSource()->IsInPhase(_searcher))
289  i_do(itr->GetSource());
290  }
291 
293  {
294  if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_AREATRIGGER))
295  return;
296  for (AreaTriggerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
297  if (itr->GetSource()->IsInPhase(_searcher))
298  i_do(itr->GetSource());
299  }
300 
301  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
302  };
303 
304  // Gameobject searchers
305 
306  template<class Check>
308  {
311  Check &i_check;
312 
313  GameObjectSearcher(WorldObject const* searcher, GameObject* & result, Check& check)
314  : _searcher(searcher), i_object(result), i_check(check) { }
315 
316  void Visit(GameObjectMapType &m);
317 
318  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
319  };
320 
321  // Last accepted by Check GO if any (Check can change requirements at each call)
322  template<class Check>
324  {
327  Check& i_check;
328 
329  GameObjectLastSearcher(WorldObject const* searcher, GameObject* & result, Check& check)
330  : _searcher(searcher), i_object(result), i_check(check) { }
331 
332  void Visit(GameObjectMapType &m);
333 
334  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
335  };
336 
337  template<class Check>
339  {
341  std::list<GameObject*> &i_objects;
342  Check& i_check;
343 
344  GameObjectListSearcher(WorldObject const* searcher, std::list<GameObject*> &objects, Check & check)
345  : _searcher(searcher), i_objects(objects), i_check(check) { }
346 
347  void Visit(GameObjectMapType &m);
348 
349  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
350  };
351 
352  template<class Functor>
354  {
355  GameObjectWorker(WorldObject const* searcher, Functor& func)
356  : _func(func), _searcher(searcher) { }
357 
359  {
360  for (GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
361  if (itr->GetSource()->IsInPhase(_searcher))
362  _func(itr->GetSource());
363  }
364 
365  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
366 
367  private:
368  Functor& _func;
370  };
371 
372  // Unit searchers
373 
374  // First accepted by Check Unit if any
375  template<class Check>
377  {
380  Check & i_check;
381 
382  UnitSearcher(WorldObject const* searcher, Unit* & result, Check & check)
383  : _searcher(searcher), i_object(result), i_check(check) { }
384 
385  void Visit(CreatureMapType &m);
386  void Visit(PlayerMapType &m);
387 
388  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
389  };
390 
391  // Last accepted by Check Unit if any (Check can change requirements at each call)
392  template<class Check>
394  {
397  Check & i_check;
398 
399  UnitLastSearcher(WorldObject const* searcher, Unit* & result, Check & check)
400  : _searcher(searcher), i_object(result), i_check(check) { }
401 
402  void Visit(CreatureMapType &m);
403  void Visit(PlayerMapType &m);
404 
405  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
406  };
407 
408  // All accepted by Check units if any
409  template<class Check>
411  {
413  std::list<Unit*> &i_objects;
414  Check& i_check;
415 
416  UnitListSearcher(WorldObject const* searcher, std::list<Unit*> &objects, Check & check)
417  : _searcher(searcher), i_objects(objects), i_check(check) { }
418 
419  void Visit(PlayerMapType &m);
420  void Visit(CreatureMapType &m);
421 
422  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
423  };
424 
425  // Creature searchers
426 
427  template<class Check>
429  {
432  Check & i_check;
433 
434  CreatureSearcher(WorldObject const* searcher, Creature* & result, Check & check)
435  : _searcher(searcher), i_object(result), i_check(check) { }
436 
437  void Visit(CreatureMapType &m);
438 
439  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
440  };
441 
442  // Last accepted by Check Creature if any (Check can change requirements at each call)
443  template<class Check>
445  {
448  Check & i_check;
449 
450  CreatureLastSearcher(WorldObject const* searcher, Creature* & result, Check & check)
451  : _searcher(searcher), i_object(result), i_check(check) { }
452 
453  void Visit(CreatureMapType &m);
454 
455  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
456  };
457 
458  template<class Check>
460  {
462  std::list<Creature*> &i_objects;
463  Check& i_check;
464 
465  CreatureListSearcher(WorldObject const* searcher, std::list<Creature*> &objects, Check & check)
466  : _searcher(searcher), i_objects(objects), i_check(check) { }
467 
468  void Visit(CreatureMapType &m);
469 
470  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
471  };
472 
473  template<class Do>
475  {
477  Do& i_do;
478 
479  CreatureWorker(WorldObject const* searcher, Do& _do)
480  : _searcher(searcher), i_do(_do) { }
481 
483  {
484  for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
485  if (itr->GetSource()->IsInPhase(_searcher))
486  i_do(itr->GetSource());
487  }
488 
489  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
490  };
491 
492  // Player searchers
493 
494  template<class Check>
496  {
499  Check & i_check;
500 
501  PlayerSearcher(WorldObject const* searcher, Player* & result, Check & check)
502  : _searcher(searcher), i_object(result), i_check(check) { }
503 
504  void Visit(PlayerMapType &m);
505 
506  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
507  };
508 
509  template<class Check>
511  {
513  std::list<Player*> &i_objects;
514  Check& i_check;
515 
516  PlayerListSearcher(WorldObject const* searcher, std::list<Player*> &objects, Check & check)
517  : _searcher(searcher), i_objects(objects), i_check(check) { }
518 
519  void Visit(PlayerMapType &m);
520 
521  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
522  };
523 
524  template<class Check>
526  {
529  Check& i_check;
530 
531  PlayerLastSearcher(WorldObject const* searcher, Player*& result, Check& check) : _searcher(searcher), i_object(result), i_check(check)
532  {
533  }
534 
535  void Visit(PlayerMapType& m);
536 
537  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
538  };
539 
540  template<class Do>
542  {
544  Do& i_do;
545 
546  PlayerWorker(WorldObject const* searcher, Do& _do)
547  : _searcher(searcher), i_do(_do) { }
548 
550  {
551  for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
552  if (itr->GetSource()->IsInPhase(_searcher))
553  i_do(itr->GetSource());
554  }
555 
556  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
557  };
558 
559  template<class Do>
561  {
563  float i_dist;
564  Do& i_do;
565 
566  PlayerDistWorker(WorldObject const* searcher, float _dist, Do& _do)
567  : i_searcher(searcher), i_dist(_dist), i_do(_do) { }
568 
570  {
571  for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
572  if (itr->GetSource()->IsInPhase(i_searcher) && itr->GetSource()->IsWithinDist(i_searcher, i_dist))
573  i_do(itr->GetSource());
574  }
575 
576  template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
577  };
578 
579  // CHECKS && DO classes
580 
581  // WorldObject check classes
582 
584  {
585  public:
586  AnyDeadUnitObjectInRangeCheck(Unit* searchObj, float range) : i_searchObj(searchObj), i_range(range) { }
587  bool operator()(Player* u);
588  bool operator()(Corpse* u);
589  bool operator()(Creature* u);
590  template<class NOT_INTERESTED> bool operator()(NOT_INTERESTED*) { return false; }
591  protected:
592  Unit const* const i_searchObj;
593  float i_range;
594  };
595 
597  {
598  public:
600  : AnyDeadUnitObjectInRangeCheck(searchObj, range), i_spellInfo(spellInfo), i_check(searchObj, searchObj, spellInfo, check, NULL)
601  { }
602  bool operator()(Player* u);
603  bool operator()(Corpse* u);
604  bool operator()(Creature* u);
605  template<class NOT_INTERESTED> bool operator()(NOT_INTERESTED*) { return false; }
606  protected:
609  };
610 
611  // WorldObject do classes
612 
613  class RespawnDo
614  {
615  public:
616  RespawnDo() { }
617  void operator()(Creature* u) const { u->Respawn(); }
618  void operator()(GameObject* u) const { u->Respawn(); }
619  void operator()(WorldObject*) const { }
620  void operator()(Corpse*) const { }
621  };
622 
623  // GameObject checks
624 
626  {
627  public:
628  GameObjectFocusCheck(Unit const* unit, uint32 focusId) : i_unit(unit), i_focusId(focusId) { }
629  bool operator()(GameObject* go) const
630  {
632  return false;
633 
634  if (go->GetGOInfo()->spellFocus.spellFocusType != i_focusId)
635  return false;
636 
637  float dist = go->GetGOInfo()->spellFocus.radius / 2.f;
638 
639  return go->IsWithinDistInMap(i_unit, dist);
640  }
641  private:
642  Unit const* i_unit;
644  };
645 
646  // Find the nearest Fishing hole and return true only if source object is in range of hole
648  {
649  public:
650  NearestGameObjectFishingHole(WorldObject const& obj, float range) : i_obj(obj), i_range(range) { }
652  {
654  {
655  i_range = i_obj.GetDistance(go);
656  return true;
657  }
658  return false;
659  }
660  float GetLastRange() const { return i_range; }
661  private:
663  float i_range;
664 
665  // prevent clone
667  };
668 
670  {
671  public:
672  NearestGameObjectCheck(WorldObject const& obj) : i_obj(obj), i_range(999) { }
674  {
676  {
677  i_range = i_obj.GetDistance(go); // use found GO range as new range limit for next check
678  return true;
679  }
680  return false;
681  }
682  float GetLastRange() const { return i_range; }
683  private:
685  float i_range;
686 
687  // prevent clone this object
689  };
690 
691  // Success at unit in range, range update for next check (this can be use with GameobjectLastSearcher to find nearest GO)
693  {
694  public:
695  NearestGameObjectEntryInObjectRangeCheck(WorldObject const& obj, uint32 entry, float range) : i_obj(obj), i_entry(entry), i_range(range) { }
697  {
698  if (go->GetEntry() == i_entry && i_obj.IsWithinDistInMap(go, i_range))
699  {
700  i_range = i_obj.GetDistance(go); // use found GO range as new range limit for next check
701  return true;
702  }
703  return false;
704  }
705  float GetLastRange() const { return i_range; }
706  private:
709  float i_range;
710 
711  // prevent clone this object
713  };
714 
715  // Success at unit in range, range update for next check (this can be use with GameobjectLastSearcher to find nearest GO with a certain type)
717  {
718  public:
719  NearestGameObjectTypeInObjectRangeCheck(WorldObject const& obj, GameobjectTypes type, float range) : i_obj(obj), i_type(type), i_range(range) { }
721  {
722  if (go->GetGoType() == i_type && i_obj.IsWithinDistInMap(go, i_range))
723  {
724  i_range = i_obj.GetDistance(go); // use found GO range as new range limit for next check
725  return true;
726  }
727  return false;
728  }
729  float GetLastRange() const { return i_range; }
730  private:
733  float i_range;
734 
735  // prevent clone this object
737  };
738 
739  // Unit checks
740 
742  {
743  public:
744  MostHPMissingInRange(Unit const* obj, float range, uint32 hp) : i_obj(obj), i_range(range), i_hp(hp) { }
745  bool operator()(Unit* u)
746  {
747  if (u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) && u->GetMaxHealth() - u->GetHealth() > i_hp)
748  {
749  i_hp = u->GetMaxHealth() - u->GetHealth();
750  return true;
751  }
752  return false;
753  }
754  private:
755  Unit const* i_obj;
756  float i_range;
758  };
759 
761  {
762  public:
763  FriendlyCCedInRange(Unit const* obj, float range) : i_obj(obj), i_range(range) { }
764  bool operator()(Unit* u)
765  {
766  if (u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
768  {
769  return true;
770  }
771  return false;
772  }
773  private:
774  Unit const* i_obj;
775  float i_range;
776  };
777 
779  {
780  public:
781  FriendlyMissingBuffInRange(Unit const* obj, float range, uint32 spellid) : i_obj(obj), i_range(range), i_spell(spellid) { }
782  bool operator()(Unit* u)
783  {
784  if (u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
785  !(u->HasAura(i_spell)))
786  {
787  return true;
788  }
789  return false;
790  }
791  private:
792  Unit const* i_obj;
793  float i_range;
795  };
796 
798  {
799  public:
800  AnyUnfriendlyUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) : i_obj(obj), i_funit(funit), i_range(range) { }
801  bool operator()(Unit* u)
802  {
803  if (u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range) && !i_funit->IsFriendlyTo(u))
804  return true;
805  else
806  return false;
807  }
808  private:
810  Unit const* i_funit;
811  float i_range;
812  };
813 
815  {
816  public:
817  AnyUnfriendlyNoTotemUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) : i_obj(obj), i_funit(funit), i_range(range) { }
818  bool operator()(Unit* u)
819  {
820  if (!u->IsAlive())
821  return false;
822 
824  return false;
825 
826  if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->IsTotem())
827  return false;
828 
829  if (!u->isTargetableForAttack(false))
830  return false;
831 
832  return i_obj->IsWithinDistInMap(u, i_range) && !i_funit->IsFriendlyTo(u);
833  }
834  private:
836  Unit const* i_funit;
837  float i_range;
838  };
839 
841  {
842  public:
843  AnyFriendlyUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range, bool playerOnly = false) : i_obj(obj), i_funit(funit), i_range(range), i_playerOnly(playerOnly) { }
844  bool operator()(Unit* u)
845  {
847  return true;
848  else
849  return false;
850  }
851  private:
853  Unit const* i_funit;
854  float i_range;
856  };
857 
859  {
860  public:
861  AnyGroupedUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range, bool raid) : _source(obj), _refUnit(funit), _range(range), _raid(raid) { }
862  bool operator()(Unit* u)
863  {
864  if (G3D::fuzzyEq(_range, 0))
865  return false;
866 
867  if (_raid)
868  {
869  if (!_refUnit->IsInRaidWith(u))
870  return false;
871  }
872  else if (!_refUnit->IsInPartyWith(u))
873  return false;
874 
875  return !_refUnit->IsHostileTo(u) && u->IsAlive() && _source->IsWithinDistInMap(u, _range);
876  }
877 
878  private:
880  Unit const* _refUnit;
881  float _range;
882  bool _raid;
883  };
884 
886  {
887  public:
888  AnyUnitInObjectRangeCheck(WorldObject const* obj, float range) : i_obj(obj), i_range(range) { }
889  bool operator()(Unit* u)
890  {
891  if (u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range))
892  return true;
893 
894  return false;
895  }
896  private:
898  float i_range;
899  };
900 
901  // Success at unit in range, range update for next check (this can be use with UnitLastSearcher to find nearest unit)
903  {
904  public:
905  NearestAttackableUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) : i_obj(obj), i_funit(funit), i_range(range) { }
906  bool operator()(Unit* u)
907  {
910  {
911  i_range = i_obj->GetDistance(u); // use found unit range as new range limit for next check
912  return true;
913  }
914 
915  return false;
916  }
917  private:
919  Unit const* i_funit;
920  float i_range;
921 
922  // prevent clone this object
924  };
925 
927  {
928  public:
929  AnyAoETargetUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range)
930  : i_obj(obj), i_funit(funit), _spellInfo(NULL), i_range(range)
931  {
932  Unit const* check = i_funit;
933  Unit const* owner = i_funit->GetOwner();
934  if (owner)
935  check = owner;
936  i_targetForPlayer = (check->GetTypeId() == TYPEID_PLAYER);
937  if (DynamicObject const* dynObj = i_obj->ToDynObject())
938  _spellInfo = sSpellMgr->GetSpellInfo(dynObj->GetSpellId());
939  }
940  bool operator()(Unit* u)
941  {
942  // Check contains checks for: live, non-selectable, non-attackable flags, flight check and GM check, ignore totems
943  if (u->GetTypeId() == TYPEID_UNIT && u->IsTotem())
944  return false;
945 
947  return true;
948 
949  return false;
950  }
951  private:
954  Unit const* i_funit;
956  float i_range;
957  };
958 
959  // do attack at call of help to friendly crearture
961  {
962  public:
963  CallOfHelpCreatureInRangeDo(Unit* funit, Unit* enemy, float range)
964  : i_funit(funit), i_enemy(enemy), i_range(range)
965  { }
967  {
968  if (u == i_funit)
969  return;
970 
971  if (!u->CanAssistTo(i_funit, i_enemy, false))
972  return;
973 
974  // too far
976  return;
977 
978  // only if see assisted creature's enemy
979  if (!u->IsWithinLOSInMap(i_enemy))
980  return;
981 
982  if (u->AI())
983  u->AI()->AttackStart(i_enemy);
984  }
985  private:
986  Unit* const i_funit;
987  Unit* const i_enemy;
988  float i_range;
989  };
990 
992  {
993  bool operator()(Unit* u) { return !u->IsAlive(); }
994  };
995 
996  /*
997  struct AnyStealthedCheck
998  {
999  bool operator()(Unit* u) { return u->GetVisibility() == VISIBILITY_GROUP_STEALTH; }
1000  };
1001  */
1002 
1003  // Creature checks
1004 
1006  {
1007  public:
1008  explicit NearestHostileUnitCheck(Creature const* creature, float dist = 0, bool playerOnly = false) : me(creature), i_playerOnly(playerOnly)
1009  {
1010  m_range = (dist == 0 ? 9999 : dist);
1011  }
1012  bool operator()(Unit* u)
1013  {
1014  if (!me->IsWithinDistInMap(u, m_range))
1015  return false;
1016 
1017  if (!me->IsValidAttackTarget(u))
1018  return false;
1019 
1020  if (i_playerOnly && u->GetTypeId() != TYPEID_PLAYER)
1021  return false;
1022 
1023  m_range = me->GetDistance(u); // use found unit range as new range limit for next check
1024  return true;
1025  }
1026 
1027  private:
1028  Creature const* me;
1029  float m_range;
1032  };
1033 
1035  {
1036  public:
1037  explicit NearestHostileUnitInAttackDistanceCheck(Creature const* creature, float dist = 0) : me(creature)
1038  {
1039  m_range = (dist == 0 ? 9999 : dist);
1040  m_force = (dist == 0 ? false : true);
1041  }
1042  bool operator()(Unit* u)
1043  {
1044  if (!me->IsWithinDistInMap(u, m_range))
1045  return false;
1046 
1047  if (!me->CanSeeOrDetect(u))
1048  return false;
1049 
1050  if (m_force)
1051  {
1052  if (!me->IsValidAttackTarget(u))
1053  return false;
1054  }
1055  else if (!me->CanStartAttack(u, false))
1056  return false;
1057 
1058  m_range = me->GetDistance(u); // use found unit range as new range limit for next check
1059  return true;
1060  }
1061  float GetLastRange() const { return m_range; }
1062  private:
1063  Creature const* me;
1064  float m_range;
1065  bool m_force;
1067  };
1068 
1070  {
1071  public:
1072  explicit NearestHostileUnitInAggroRangeCheck(Creature const* creature, bool useLOS = false) : _me(creature), _useLOS(useLOS)
1073  {
1074  }
1075  bool operator()(Unit* u)
1076  {
1077  if (!u->IsHostileTo(_me))
1078  return false;
1079 
1080  if (!u->IsWithinDistInMap(_me, _me->GetAggroRange(u)))
1081  return false;
1082 
1083  if (!_me->IsValidAttackTarget(u))
1084  return false;
1085 
1086  if (_useLOS && !u->IsWithinLOSInMap(_me))
1087  return false;
1088 
1089  return true;
1090  }
1091 
1092  private:
1093  Creature const* _me;
1094  bool _useLOS;
1096  };
1097 
1099  {
1100  public:
1101  AnyAssistCreatureInRangeCheck(Unit* funit, Unit* enemy, float range)
1102  : i_funit(funit), i_enemy(enemy), i_range(range)
1103  {
1104  }
1106  {
1107  if (u == i_funit)
1108  return false;
1109 
1110  if (!u->CanAssistTo(i_funit, i_enemy))
1111  return false;
1112 
1113  // too far
1114  if (!i_funit->IsWithinDistInMap(u, i_range))
1115  return false;
1116 
1117  // only if see assisted creature
1118  if (!i_funit->IsWithinLOSInMap(u))
1119  return false;
1120 
1121  return true;
1122  }
1123  private:
1124  Unit* const i_funit;
1125  Unit* const i_enemy;
1126  float i_range;
1127  };
1128 
1130  {
1131  public:
1133  : i_obj(obj), i_enemy(enemy), i_range(range) { }
1134 
1136  {
1137  if (u == i_obj)
1138  return false;
1139  if (!u->CanAssistTo(i_obj, i_enemy))
1140  return false;
1141 
1142  if (!i_obj->IsWithinDistInMap(u, i_range))
1143  return false;
1144 
1145  if (!i_obj->IsWithinLOSInMap(u))
1146  return false;
1147 
1148  i_range = i_obj->GetDistance(u); // use found unit range as new range limit for next check
1149  return true;
1150  }
1151  float GetLastRange() const { return i_range; }
1152  private:
1153  Creature* const i_obj;
1154  Unit* const i_enemy;
1155  float i_range;
1156 
1157  // prevent clone this object
1159  };
1160 
1161  // Success at unit in range, range update for next check (this can be use with CreatureLastSearcher to find nearest creature)
1163  {
1164  public:
1165  NearestCreatureEntryWithLiveStateInObjectRangeCheck(WorldObject const& obj, uint32 entry, bool alive, float range)
1166  : i_obj(obj), i_entry(entry), i_alive(alive), i_range(range) { }
1167 
1169  {
1170  if (u->GetEntry() == i_entry && u->IsAlive() == i_alive && i_obj.IsWithinDistInMap(u, i_range))
1171  {
1172  i_range = i_obj.GetDistance(u); // use found unit range as new range limit for next check
1173  return true;
1174  }
1175  return false;
1176  }
1177  float GetLastRange() const { return i_range; }
1178  private:
1181  bool i_alive;
1182  float i_range;
1183 
1184  // prevent clone this object
1186  };
1187 
1189  {
1190  public:
1191  AnyPlayerInObjectRangeCheck(WorldObject const* obj, float range, bool reqAlive = true) : _obj(obj), _range(range), _reqAlive(reqAlive) { }
1192  bool operator()(Player* u)
1193  {
1194  if (_reqAlive && !u->IsAlive())
1195  return false;
1196 
1197  if (!_obj->IsWithinDistInMap(u, _range))
1198  return false;
1199 
1200  return true;
1201  }
1202 
1203  private:
1205  float _range;
1207  };
1208 
1210  {
1211  public:
1212  NearestPlayerInObjectRangeCheck(WorldObject const* obj, float range) : i_obj(obj), i_range(range)
1213  {
1214  }
1215 
1216  bool operator()(Player* u)
1217  {
1218  if (u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range))
1219  {
1220  i_range = i_obj->GetDistance(u);
1221  return true;
1222  }
1223 
1224  return false;
1225  }
1226  private:
1228  float i_range;
1229 
1231  };
1232 
1234  {
1235  public:
1236  AllFriendlyCreaturesInGrid(Unit const* obj) : unit(obj) { }
1238  {
1239  if (u->IsAlive() && u->IsVisible() && u->IsFriendlyTo(unit))
1240  return true;
1241 
1242  return false;
1243  }
1244  private:
1245  Unit const* unit;
1246  };
1247 
1249  {
1250  public:
1251  AllGameObjectsWithEntryInRange(const WorldObject* object, uint32 entry, float maxRange) : m_pObject(object), m_uiEntry(entry), m_fRange(maxRange) { }
1253  {
1254  if (go->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(go, m_fRange, false))
1255  return true;
1256 
1257  return false;
1258  }
1259  private:
1262  float m_fRange;
1263  };
1264 
1266  {
1267  public:
1268  AllCreaturesOfEntryInRange(const WorldObject* object, uint32 entry, float maxRange) : m_pObject(object), m_uiEntry(entry), m_fRange(maxRange) { }
1269  bool operator() (Unit* unit)
1270  {
1271  if (unit->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(unit, m_fRange, false))
1272  return true;
1273 
1274  return false;
1275  }
1276 
1277  private:
1280  float m_fRange;
1281  };
1282 
1284  {
1285  public:
1286  PlayerAtMinimumRangeAway(Unit const* unit, float fMinRange) : unit(unit), fRange(fMinRange) { }
1287  bool operator() (Player* player)
1288  {
1289  //No threat list check, must be done explicit if expected to be in combat with creature
1290  if (!player->IsGameMaster() && player->IsAlive() && !unit->IsWithinDist(player, fRange, false))
1291  return true;
1292 
1293  return false;
1294  }
1295 
1296  private:
1297  Unit const* unit;
1298  float fRange;
1299  };
1300 
1302  {
1303  public:
1304  GameObjectInRangeCheck(float _x, float _y, float _z, float _range, uint32 _entry = 0) :
1305  x(_x), y(_y), z(_z), range(_range), entry(_entry) { }
1307  {
1308  if (!entry || (go->GetGOInfo() && go->GetGOInfo()->entry == entry))
1309  return go->IsInRange(x, y, z, range);
1310  else return false;
1311  }
1312  private:
1313  float x, y, z, range;
1315  };
1316 
1318  {
1319  public:
1320  AllWorldObjectsInRange(const WorldObject* object, float maxRange) : m_pObject(object), m_fRange(maxRange) { }
1322  {
1323  return m_pObject->IsWithinDist(go, m_fRange, false) && m_pObject->IsInPhase(go);
1324  }
1325  private:
1327  float m_fRange;
1328  };
1329 
1331  {
1332  public:
1333  ObjectTypeIdCheck(TypeID typeId, bool equals) : _typeId(typeId), _equals(equals) { }
1334  bool operator()(WorldObject* object)
1335  {
1336  return (object->GetTypeId() == _typeId) == _equals;
1337  }
1338 
1339  private:
1341  bool _equals;
1342  };
1343 
1345  {
1346  public:
1348  bool operator()(WorldObject* object)
1349  {
1350  return object->GetGUID() == _GUID;
1351  }
1352 
1353  private:
1355  };
1356 
1358  {
1359  public:
1360  HeightDifferenceCheck(WorldObject* go, float diff, bool reverse)
1361  : _baseObject(go), _difference(diff), _reverse(reverse)
1362  {
1363  }
1364 
1365  bool operator()(WorldObject* unit) const
1366  {
1367  return (unit->GetPositionZ() - _baseObject->GetPositionZ() > _difference) != _reverse;
1368  }
1369 
1370  private:
1373  bool _reverse;
1374  };
1375 
1377  {
1378  public:
1379  UnitAuraCheck(bool present, uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty) : _present(present), _spellId(spellId), _casterGUID(casterGUID) { }
1380  bool operator()(Unit* unit) const
1381  {
1382  return unit->HasAura(_spellId, _casterGUID) == _present;
1383  }
1384 
1385  bool operator()(WorldObject* object) const
1386  {
1387  return object->ToUnit() && object->ToUnit()->HasAura(_spellId, _casterGUID) == _present;
1388  }
1389 
1390  private:
1391  bool _present;
1394  };
1395 
1396  // Player checks and do
1397 
1398  // Prepare using Builder localized packets with caching and send to player
1399  template<class Builder>
1401  {
1402  public:
1403  explicit LocalizedPacketDo(Builder& builder) : i_builder(builder) { }
1404 
1406  {
1407  for (size_t i = 0; i < i_data_cache.size(); ++i)
1408  delete i_data_cache[i];
1409  }
1410  void operator()(Player* p);
1411 
1412  private:
1413  Builder& i_builder;
1414  std::vector<WorldPackets::Packet*> i_data_cache; // 0 = default, i => i-1 locale index
1415  };
1416 
1417  // Prepare using Builder localized packets with caching and send to player
1418  template<class Builder>
1420  {
1421  public:
1422  typedef std::vector<WorldPackets::Packet*> WorldPacketList;
1423  explicit LocalizedPacketListDo(Builder& builder) : i_builder(builder) { }
1424 
1426  {
1427  for (size_t i = 0; i < i_data_cache.size(); ++i)
1428  for (size_t j = 0; j < i_data_cache[i].size(); ++j)
1429  delete i_data_cache[i][j];
1430  }
1431  void operator()(Player* p);
1432 
1433  private:
1434  Builder& i_builder;
1435  std::vector<WorldPacketList> i_data_cache;
1436  // 0 = default, i => i-1 locale index
1437  };
1438 }
1439 #endif
float i_range
Definition: GridNotifiers.h:988
void Visit(CreatureMapType &m)
Definition: GridNotifiers.h:265
Creature *const i_obj
Definition: GridNotifiers.h:1153
float x
Definition: GridNotifiers.h:1313
GameObjectFocusCheck(Unit const *unit, uint32 focusId)
Definition: GridNotifiers.h:628
PlayerWorker(WorldObject const *searcher, Do &_do)
Definition: GridNotifiers.h:546
Functor & _func
Definition: GridNotifiers.h:368
bool operator()(NOT_INTERESTED *)
Definition: GridNotifiers.h:590
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4240
bool _reverse
Definition: GridNotifiers.h:1373
Definition: GridNotifiers.h:1069
bool _present
Definition: GridNotifiers.h:1391
Definition: GridDefines.h:78
float GetLastRange() const
Definition: GridNotifiers.h:1177
Definition: GridNotifiers.h:338
UpdateData i_data
Definition: GridNotifiers.h:46
Definition: Corpse.h:49
LocalizedPacketListDo(Builder &builder)
Definition: GridNotifiers.h:1423
Definition: GridDefines.h:79
bool operator()(WorldObject *object)
Definition: GridNotifiers.h:1334
WorldObject const * _searcher
Definition: GridNotifiers.h:430
MessageDistDeliverer(WorldObject *src, WorldPacket const *msg, float dist, bool own_team_only=false, Player const *skipped=NULL)
Definition: GridNotifiers.h:133
void updateObjects(GridRefManager< T > &m)
Definition: GridNotifiers.h:112
ObjectGuid _casterGUID
Definition: GridNotifiers.h:1393
bool operator()(Unit *u)
Definition: GridNotifiers.h:782
uint32 m_uiEntry
Definition: GridNotifiers.h:1261
Definition: GridNotifiers.h:840
Unit *const i_enemy
Definition: GridNotifiers.h:987
bool operator()(WorldObject *go)
Definition: GridNotifiers.h:1321
Definition: GridNotifiers.h:176
WorldObject const & i_obj
Definition: GridNotifiers.h:684
float i_range
Definition: GridNotifiers.h:709
Definition: GridNotifiers.h:1098
GameObjectListSearcher(WorldObject const *searcher, std::list< GameObject * > &objects, Check &check)
Definition: GridNotifiers.h:344
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
NearestHostileUnitCheck(Creature const *creature, float dist=0, bool playerOnly=false)
Definition: GridNotifiers.h:1008
WorldObject const * _searcher
Definition: GridNotifiers.h:199
uint32 GetMaxHealth() const
Definition: Unit.h:1427
RespawnDo()
Definition: GridNotifiers.h:616
NearestAssistCreatureInCreatureRangeCheck(Creature *obj, Unit *enemy, float range)
Definition: GridNotifiers.h:1132
NearestGameObjectFishingHole(WorldObject const &obj, float range)
Definition: GridNotifiers.h:650
Do const & i_do
Definition: GridNotifiers.h:243
float i_range
Definition: GridNotifiers.h:854
Definition: GridNotifiers.h:625
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:349
Check & i_check
Definition: GridNotifiers.h:223
Definition: GridNotifiers.h:162
GameObject *& i_object
Definition: GridNotifiers.h:310
bool operator()(Player *u)
Definition: GridNotifiers.h:1216
AnyUnfriendlyUnitInObjectRangeCheck(WorldObject const *obj, Unit const *funit, float range)
Definition: GridNotifiers.h:800
Unit const * unit
Definition: GridNotifiers.h:1245
Definition: GridNotifiers.h:885
float m_fRange
Definition: GridNotifiers.h:1327
bool operator()(Creature *u)
Definition: GridNotifiers.h:1135
float i_range
Definition: GridNotifiers.h:593
Definition: GridNotifiers.h:323
Definition: GridNotifiers.h:75
Builder & i_builder
Definition: GridNotifiers.h:1434
Definition: GridNotifiers.h:97
Definition: GridNotifiers.h:66
WorldObject const * i_obj
Definition: GridNotifiers.h:1227
bool _IsValidAttackTarget(Unit const *target, SpellInfo const *bySpell, WorldObject const *obj=NULL) const
Definition: Unit.cpp:10008
Check & i_check
Definition: GridNotifiers.h:448
float y
Definition: GridNotifiers.h:1313
Definition: GridNotifiers.h:1005
Definition: GridNotifiers.h:669
Definition: GridNotifiers.h:1188
void Visit(GameObjectMapType &m)
Definition: GridNotifiers.h:120
Definition: SpellInfo.h:326
const WorldObject * m_pObject
Definition: GridNotifiers.h:1260
void operator()(Creature *u) const
Definition: GridNotifiers.h:617
WorldObject const * i_searcher
Definition: GridNotifiers.h:562
WorldObject const * _searcher
Definition: GridNotifiers.h:461
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:521
NearestGameObjectCheck(WorldObject const &obj)
Definition: GridNotifiers.h:672
bool IsWithinLOSInMap(WorldObject const *obj) const
Definition: Object.cpp:1584
WorldObject const & i_obj
Definition: GridNotifiers.h:707
bool operator()(GameObject *go)
Definition: GridNotifiers.h:673
Definition: GridNotifiers.h:560
Map & i_map
Definition: GridNotifiers.h:86
Definition: GridNotifiers.h:376
float m_fRange
Definition: GridNotifiers.h:1280
PlayerAtMinimumRangeAway(Unit const *unit, float fMinRange)
Definition: GridNotifiers.h:1286
void Visit(PlayerMapType &m)
Definition: GridNotifiersImpl.h:549
Definition: GridNotifiers.h:474
void Visit(AreaTriggerMapType &m)
Definition: GridNotifiers.h:123
Player *& i_object
Definition: GridNotifiers.h:498
Do & i_do
Definition: GridNotifiers.h:477
Check & i_check
Definition: GridNotifiers.h:397
Check & i_check
Definition: GridNotifiers.h:432
void Visit(GridRefManager< T > &)
Definition: GridNotifiers.h:60
bool operator()(Unit *u)
Definition: GridNotifiers.h:1012
float GetLastRange() const
Definition: GridNotifiers.h:729
bool IsInPartyWith(Unit const *unit) const
Definition: Unit.cpp:14372
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:214
Definition: SharedDefines.h:3565
AnyDeadUnitSpellTargetInRangeCheck(Unit *searchObj, float range, SpellInfo const *spellInfo, SpellTargetCheckTypes check)
Definition: GridNotifiers.h:599
uint32 team
Definition: GridNotifiers.h:131
void Visit(CreatureMapType &m)
Definition: GridNotifiersImpl.h:498
UnitAuraCheck(bool present, uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty)
Definition: GridNotifiers.h:1379
bool IsInCombat() const
Definition: Unit.h:1584
void Visit(GridRefManager< T > &m)
Definition: GridNotifiers.cpp:343
float GetLastRange() const
Definition: GridNotifiers.h:660
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:318
AnyGroupedUnitInObjectRangeCheck(WorldObject const *obj, Unit const *funit, float range, bool raid)
Definition: GridNotifiers.h:861
Definition: GridNotifiers.h:1376
Unit *& i_object
Definition: GridNotifiers.h:379
float z
Definition: GridNotifiers.h:1313
bool IsValidAttackTarget(Unit const *target) const
Definition: Unit.cpp:10002
float i_range
Definition: GridNotifiers.h:1155
Definition: ObjectGuid.h:32
void operator()(GameObject *u) const
Definition: GridNotifiers.h:618
void Visit(DynamicObjectMapType &m)
Definition: GridNotifiers.h:121
WorldObject const * _searcher
Definition: GridNotifiers.h:512
WorldObject const * _searcher
Definition: GridNotifiers.h:178
WorldObject const * _searcher
Definition: GridNotifiers.h:527
AllWorldObjectsInRange(const WorldObject *object, float maxRange)
Definition: GridNotifiers.h:1320
std::list< Player * > & i_objects
Definition: GridNotifiers.h:513
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: GridNotifiers.h:307
uint32 m_uiEntry
Definition: GridNotifiers.h:1279
Definition: GridNotifiers.h:583
Check & i_check
Definition: GridNotifiers.h:327
const WorldObject * m_pObject
Definition: GridNotifiers.h:1326
Definition: Unit.h:561
std::list< GameObject * > & i_objects
Definition: GridNotifiers.h:341
void Visit(CreatureMapType &m)
Definition: GridNotifiers.h:119
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:576
bool operator()(Unit *u)
Definition: GridNotifiers.h:1075
Definition: GridNotifiers.h:1400
Definition: SharedDefines.h:2073
Definition: Grid.h:46
LocalizedPacketDo(Builder &builder)
Definition: GridNotifiers.h:1403
bool operator()(Unit *u)
Definition: GridNotifiers.h:1042
ObjectGUIDCheck(ObjectGuid GUID)
Definition: GridNotifiers.h:1347
Definition: GridNotifiers.h:741
TypeID _typeId
Definition: GridNotifiers.h:1340
Definition: GridNotifiers.h:1248
Unit *const i_funit
Definition: GridNotifiers.h:1124
uint32 i_mapTypeMask
Definition: GridNotifiers.h:220
Definition: Object.h:423
std::list< Unit * > & i_objects
Definition: GridNotifiers.h:413
Definition: Creature.h:467
AnyUnfriendlyNoTotemUnitInObjectRangeCheck(WorldObject const *obj, Unit const *funit, float range)
Definition: GridNotifiers.h:817
float i_range
Definition: GridNotifiers.h:1126
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:301
CreatureRelocationNotifier(Creature &c)
Definition: GridNotifiers.h:78
DynamicObject * ToDynObject()
Definition: Object.h:206
void Respawn()
Definition: GameObject.cpp:1069
void Visit(GridRefManager< T > &)
Definition: GridNotifiers.h:102
Definition: GridNotifiers.h:510
WorldObject const & i_obj
Definition: GridNotifiers.h:662
FriendlyCCedInRange(Unit const *obj, float range)
Definition: GridNotifiers.h:763
float i_range
Definition: GridNotifiers.h:775
bool m_force
Definition: GridNotifiers.h:1065
bool operator()(Unit *unit) const
Definition: GridNotifiers.h:1380
UnitSearcher(WorldObject const *searcher, Unit *&result, Check &check)
Definition: GridNotifiers.h:382
uint32 GetCreatureType() const
Definition: Unit.cpp:11248
Definition: GridDefines.h:77
MostHPMissingInRange(Unit const *obj, float range, uint32 hp)
Definition: GridNotifiers.h:744
Check & i_check
Definition: GridNotifiers.h:514
GameObjectInRangeCheck(float _x, float _y, float _z, float _range, uint32 _entry=0)
Definition: GridNotifiers.h:1304
CreatureWorker(WorldObject const *searcher, Do &_do)
Definition: GridNotifiers.h:479
Unit const * _refUnit
Definition: GridNotifiers.h:880
Definition: GridNotifiers.h:525
Creature & i_creature
Definition: GridNotifiers.h:77
float i_range
Definition: GridNotifiers.h:685
float i_range
Definition: GridNotifiers.h:733
bool operator()(GameObject *go)
Definition: GridNotifiers.h:1306
Definition: UpdateData.h:59
NearestGameObjectTypeInObjectRangeCheck(WorldObject const &obj, GameobjectTypes type, float range)
Definition: GridNotifiers.h:719
bool operator()(Creature *u)
Definition: GridNotifiers.h:1105
Definition: GridNotifiers.h:960
HeightDifferenceCheck(WorldObject *go, float diff, bool reverse)
Definition: GridNotifiers.h:1360
Definition: GridNotifiers.h:858
bool CanAssistTo(const Unit *u, const Unit *enemy, bool checkfaction=true) const
Definition: Creature.cpp:2078
GameobjectTypes
Definition: SharedDefines.h:2063
bool operator()(GameObject *go)
Definition: GridNotifiers.h:696
Definition: GridNotifiers.h:444
WorldObject const * _searcher
Definition: GridNotifiers.h:412
NearestHostileUnitInAttackDistanceCheck(Creature const *creature, float dist=0)
Definition: GridNotifiers.h:1037
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.cpp:1663
WorldObject const & i_obj
Definition: GridNotifiers.h:731
Player * ToPlayer()
Definition: Object.h:191
void Visit(CreatureMapType &m)
Definition: GridNotifiersImpl.h:511
Definition: GridNotifiers.h:495
bool operator()(Unit *u)
Definition: GridNotifiers.h:1237
Unit const * i_funit
Definition: GridNotifiers.h:954
bool _reqAlive
Definition: GridNotifiers.h:1206
float m_fRange
Definition: GridNotifiers.h:1262
Check & i_check
Definition: GridNotifiers.h:414
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:193
Do & i_do
Definition: GridNotifiers.h:544
Creature *& i_object
Definition: GridNotifiers.h:447
GameObjectSearcher(WorldObject const *searcher, GameObject *&result, Check &check)
Definition: GridNotifiers.h:313
Definition: GridNotifiers.h:410
Do & i_do
Definition: GridNotifiers.h:564
GameObjectLastSearcher(WorldObject const *searcher, GameObject *&result, Check &check)
Definition: GridNotifiers.h:329
uint32 _spellId
Definition: GridNotifiers.h:1392
GameObject *& i_object
Definition: GridNotifiers.h:326
ObjectUpdater(const uint32 diff)
Definition: GridNotifiers.h:165
Definition: GridNotifiers.h:613
Definition: GridNotifiers.h:541
void Visit(PlayerMapType &m)
Definition: GridNotifiersImpl.h:458
Definition: DynamicObject.h:35
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.cpp:1658
std::vector< WorldPackets::Packet * > WorldPacketList
Definition: GridNotifiers.h:1422
void Visit(GameObjectMapType &m)
Definition: GridNotifiersImpl.h:348
WorldObject const * _searcher
Definition: GridNotifiers.h:476
void Visit(CreatureMapType &m)
Definition: GridNotifiersImpl.h:432
bool _equals
Definition: GridNotifiers.h:1341
uint32 i_spell
Definition: GridNotifiers.h:794
TypeID GetTypeId() const
Definition: Object.h:113
Definition: GridNotifiers.h:778
WorldObject const * _source
Definition: GridNotifiers.h:879
SpellInfo const * _spellInfo
Definition: GridNotifiers.h:955
Check & i_check
Definition: GridNotifiers.h:499
void Visit(GameObjectMapType &m)
Definition: GridNotifiersImpl.h:46
void operator()(Creature *u)
Definition: GridNotifiers.h:966
float range
Definition: GridNotifiers.h:1313
bool operator()(Player *u)
Definition: GridNotifiers.h:1192
FriendlyMissingBuffInRange(Unit const *obj, float range, uint32 spellid)
Definition: GridNotifiers.h:781
uint32 i_mapTypeMask
Definition: GridNotifiers.h:202
bool i_playerOnly
Definition: GridNotifiers.h:855
Definition: GridDefines.h:76
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:537
float _range
Definition: GridNotifiers.h:1205
uint32 i_hp
Definition: GridNotifiers.h:757
bool isFeared() const
Definition: Unit.h:1599
bool operator()(Unit *u)
Definition: GridNotifiers.h:940
void Visit(GameObjectMapType &m)
Definition: GridNotifiersImpl.h:184
bool operator()(Unit *u)
Definition: GridNotifiers.h:906
std::list< WorldObject * > & i_objects
Definition: GridNotifiers.h:222
WorldObject const * _searcher
Definition: GridNotifiers.h:325
Definition: Unit.h:553
Definition: GridNotifiers.h:596
bool operator()(GameObject *go) const
Definition: GridNotifiers.h:629
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1594
float GetAggroRange(Unit const *target) const
Definition: Creature.cpp:2557
Unit const * i_funit
Definition: GridNotifiers.h:836
void Visit(GridRefManager< T > &m)
Definition: GridNotifiersImpl.h:32
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:439
Definition: GridNotifiers.h:1344
uint32 i_mapTypeMask
Definition: GridNotifiers.h:241
Unit *& i_object
Definition: GridNotifiers.h:396
float fRange
Definition: GridNotifiers.h:1298
Unit const * i_obj
Definition: GridNotifiers.h:792
WorldObject const * i_obj
Definition: GridNotifiers.h:953
PlayerSearcher(WorldObject const *searcher, Player *&result, Check &check)
Definition: GridNotifiers.h:501
float i_range
Definition: GridNotifiers.h:811
Cell & cell
Definition: GridNotifiers.h:87
const float i_radius
Definition: GridNotifiers.h:89
void operator()(Player *p)
Definition: GridNotifiersImpl.h:562
float i_range
Definition: GridNotifiers.h:756
Definition: GridNotifiers.h:353
float m_range
Definition: GridNotifiers.h:1064
WorldObject const * i_obj
Definition: GridNotifiers.h:835
bool IsAlive() const
Definition: Unit.h:1692
void Visit(PlayerMapType &m)
Definition: GridNotifiers.h:549
Definition: GridNotifiers.h:106
Definition: GridNotifiers.h:55
WorldObject const * _searcher
Definition: GridNotifiers.h:369
WorldObject const * i_obj
Definition: GridNotifiers.h:852
bool operator()(Unit *u)
Definition: GridNotifiers.h:818
UnitLastSearcher(WorldObject const *searcher, Unit *&result, Check &check)
Definition: GridNotifiers.h:399
GridType & i_grid
Definition: GridNotifiers.h:108
void SendPacket(Player *player)
Definition: GridNotifiers.h:148
void Visit(PlayerMapType &m)
Definition: GridNotifiers.h:569
ObjectGuid _GUID
Definition: GridNotifiers.h:1354
Definition: GridNotifiers.h:459
CreatureListSearcher(WorldObject const *searcher, std::list< Creature * > &objects, Check &check)
Definition: GridNotifiers.h:465
WorldObject const * _searcher
Definition: GridNotifiers.h:340
float GetLastRange() const
Definition: GridNotifiers.h:1151
Check & i_check
Definition: GridNotifiers.h:180
CreatureAI * AI() const
Definition: Creature.h:525
Definition: GridNotifiers.h:1330
Definition: GridNotifiers.h:1301
GridUpdater(GridType &grid, uint32 diff)
Definition: GridNotifiers.h:110
void Visit(PlayerMapType &m)
Definition: GridNotifiersImpl.h:529
Definition: GridNotifiers.h:926
void Visit(PlayerMapType &m)
Definition: GridNotifiers.h:118
float i_range
Definition: GridNotifiers.h:920
Definition: GridNotifiers.h:1419
#define sSpellMgr
Definition: SpellMgr.h:756
AnyDeadUnitObjectInRangeCheck(Unit *searchObj, float range)
Definition: GridNotifiers.h:586
CreatureSearcher(WorldObject const *searcher, Creature *&result, Check &check)
Definition: GridNotifiers.h:434
NearestCreatureEntryWithLiveStateInObjectRangeCheck(WorldObject const &obj, uint32 entry, bool alive, float range)
Definition: GridNotifiers.h:1165
float GetPositionZ() const
Definition: Position.h:106
AnyFriendlyUnitInObjectRangeCheck(WorldObject const *obj, Unit const *funit, float range, bool playerOnly=false)
Definition: GridNotifiers.h:843
PlayerLastSearcher(WorldObject const *searcher, Player *&result, Check &check)
Definition: GridNotifiers.h:531
Definition: GridDefines.h:75
bool operator()(Unit *u)
Definition: GridNotifiers.h:844
Definition: GridNotifiers.h:1233
Unit const * i_funit
Definition: GridNotifiers.h:853
uint32_t uint32
Definition: Define.h:150
WorldObject const * _searcher
Definition: GridNotifiers.h:395
bool IsFriendlyTo(Unit const *unit) const
Definition: Unit.cpp:7170
WorldObject const * i_obj
Definition: GridNotifiers.h:809
GameObjectTemplate const * GetGOInfo() const
Definition: GameObject.h:894
Definition: GridNotifiers.h:84
Creature const * _me
Definition: GridNotifiers.h:1093
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:388
Definition: LinkedList.h:141
bool operator()(WorldObject *object)
Definition: GridNotifiers.h:1348
WorldObject *& i_object
Definition: GridNotifiers.h:200
Builder & i_builder
Definition: GridNotifiers.h:1413
WorldPacket const * i_message
Definition: GridNotifiers.h:129
Definition: GridNotifiers.h:991
Definition: GameObject.h:880
void Visit(GameObjectMapType &m)
Definition: GridNotifiers.h:248
bool isFrozen() const
Definition: Unit.cpp:12107
AnyPlayerInObjectRangeCheck(WorldObject const *obj, float range, bool reqAlive=true)
Definition: GridNotifiers.h:1191
Definition: GridNotifiers.h:760
UnitListSearcher(WorldObject const *searcher, std::list< Unit * > &objects, Check &check)
Definition: GridNotifiers.h:416
AllGameObjectsWithEntryInRange(const WorldObject *object, uint32 entry, float maxRange)
Definition: GridNotifiers.h:1251
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:455
bool operator()(Unit *u)
Definition: GridNotifiers.h:745
ObjectTypeIdCheck(TypeID typeId, bool equals)
Definition: GridNotifiers.h:1333
Player & i_player
Definition: GridNotifiers.h:45
bool IsInPhase(uint32 phase) const
Definition: Object.h:462
void operator()(Player *p)
Definition: GridNotifiersImpl.h:589
uint32 i_entry
Definition: GridNotifiers.h:1180
WorldObject const * _searcher
Definition: GridNotifiers.h:242
uint32 entry
Definition: GameObject.h:36
void Visit(PlayerMapType &m)
Definition: GridNotifiers.h:257
bool IsInRange(float x, float y, float z, float radius) const
Definition: GameObject.cpp:1887
AnyUnitInObjectRangeCheck(WorldObject const *obj, float range)
Definition: GridNotifiers.h:888
WorldObjectSpellTargetCheck i_check
Definition: GridNotifiers.h:608
Unit const * i_funit
Definition: GridNotifiers.h:919
bool IsVisible() const
Definition: Unit.cpp:10363
Definition: GridNotifiers.h:1265
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:470
~LocalizedPacketListDo()
Definition: GridNotifiers.h:1425
PlayerListSearcher(WorldObject const *searcher, std::list< Player * > &objects, Check &check)
Definition: GridNotifiers.h:516
Definition: Map.h:259
WorldObject const * _searcher
Definition: GridNotifiers.h:446
WorldObject const * i_obj
Definition: GridNotifiers.h:918
WorldObject *& i_object
Definition: GridNotifiers.h:179
VisibleNotifier(Player &player)
Definition: GridNotifiers.h:50
void Visit(CorpseMapType &)
Definition: GridNotifiers.h:168
NearestPlayerInObjectRangeCheck(WorldObject const *obj, float range)
Definition: GridNotifiers.h:1212
std::vector< WorldPackets::Packet * > i_data_cache
Definition: GridNotifiers.h:1414
WorldObjectLastSearcher(WorldObject const *searcher, WorldObject *&result, Check &check, uint32 mapTypeMask=GRID_MAP_TYPE_MASK_ALL)
Definition: GridNotifiers.h:204
bool operator()(WorldObject *object) const
Definition: GridNotifiers.h:1385
iterator begin()
Definition: GridRefManager.h:36
Creature const * me
Definition: GridNotifiers.h:1028
TypeID
Definition: ObjectGuid.h:27
bool operator()(Player *player)
Definition: GridNotifiers.h:1287
WorldObject const * _obj
Definition: GridNotifiers.h:1204
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:365
Definition: SharedDefines.h:2090
Check & i_check
Definition: GridNotifiers.h:380
bool operator()(Unit *unit)
Definition: GridNotifiers.h:1269
bool operator()(NOT_INTERESTED *)
Definition: GridNotifiers.h:605
Definition: GridNotifiers.h:393
Unit const *const i_searchObj
Definition: GridNotifiers.h:592
bool i_playerOnly
Definition: GridNotifiers.h:1030
GameObjectWorker(WorldObject const *searcher, Functor &func)
Definition: GridNotifiers.h:355
Definition: GridNotifiers.h:428
bool operator()(Unit *u)
Definition: GridNotifiers.h:862
uint32 i_mapTypeMask
Definition: GridNotifiers.h:181
Definition: Cell.h:49
void Visit(CorpseMapType &m)
Definition: GridNotifiers.h:122
AIRelocationNotifier(Unit &unit)
Definition: GridNotifiers.h:101
Definition: GridNotifiers.h:647
CreatureLastSearcher(WorldObject const *searcher, Creature *&result, Check &check)
Definition: GridNotifiers.h:450
float m_range
Definition: GridNotifiers.h:1029
void Respawn(bool force=false)
Definition: Creature.cpp:1697
AnyAssistCreatureInRangeCheck(Unit *funit, Unit *enemy, float range)
Definition: GridNotifiers.h:1101
void operator()(Corpse *) const
Definition: GridNotifiers.h:620
float GetLastRange() const
Definition: GridNotifiers.h:1061
SpellInfo const * i_spellInfo
Definition: GridNotifiers.h:607
Unit & i_unit
Definition: GridNotifiers.h:99
bool operator()(GameObject *go)
Definition: GridNotifiers.h:720
bool isSpawned() const
Definition: GameObject.h:951
WorldObject const * _searcher
Definition: GridNotifiers.h:309
DelayedUnitRelocation(Cell &c, CellCoord &pair, Map &map, float radius)
Definition: GridNotifiers.h:90
bool i_targetForPlayer
Definition: GridNotifiers.h:952
PlayerRelocationNotifier(Player &player)
Definition: GridNotifiers.h:68
const WorldObject * m_pObject
Definition: GridNotifiers.h:1278
Definition: ObjectGuid.h:33
NearestGameObjectEntryInObjectRangeCheck(WorldObject const &obj, uint32 entry, float range)
Definition: GridNotifiers.h:695
bool operator()(WorldObject *unit) const
Definition: GridNotifiers.h:1365
Check & i_check
Definition: GridNotifiers.h:311
void Visit(GridRefManager< T > &)
Definition: GridNotifiers.h:79
GameobjectTypes GetGoType() const
Definition: GameObject.h:964
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:556
bool _useLOS
Definition: GridNotifiers.h:1094
float i_range
Definition: GridNotifiers.h:1228
VisibleChangesNotifier(WorldObject &object)
Definition: GridNotifiers.h:59
void Visit(PlayerMapType &m)
Definition: GridNotifiersImpl.h:520
Unit const * unit
Definition: GridNotifiers.h:1297
NearestAttackableUnitInObjectRangeCheck(WorldObject const *obj, Unit const *funit, float range)
Definition: GridNotifiers.h:905
bool IsTotem() const
Definition: Unit.h:1405
PlayerDistWorker(WorldObject const *searcher, float _dist, Do &_do)
Definition: GridNotifiers.h:566
float GetLastRange() const
Definition: GridNotifiers.h:705
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:405
bool operator()(Unit *u)
Definition: GridNotifiers.h:993
Definition: GridNotifiers.h:43
Unit * GetOwner() const
Definition: Unit.cpp:7542
void Visit(DynamicObjectMapType &m)
Definition: GridNotifiers.h:283
void Visit(GameObjectMapType &m)
Definition: GridNotifiersImpl.h:381
bool operator()(GameObject *go)
Definition: GridNotifiers.h:651
#define TC_GAME_API
Definition: Define.h:134
Definition: GridNotifiers.h:1283
WorldObject const & i_obj
Definition: GridNotifiers.h:1179
Check & i_check
Definition: GridNotifiers.h:529
void Visit(CorpseMapType &m)
Definition: GridNotifiers.h:274
void Visit(PlayerMapType &)
Definition: GridNotifiers.h:167
float _difference
Definition: GridNotifiers.h:1372
Check & i_check
Definition: GridNotifiers.h:342
bool _raid
Definition: GridNotifiers.h:882
void Visit(GridRefManager< T > &m)
Definition: GridNotifiers.h:70
bool IsHostileTo(Unit const *unit) const
Definition: Unit.cpp:7165
float i_dist
Definition: GridNotifiers.h:563
Definition: GridNotifiers.h:239
float i_range
Definition: GridNotifiers.h:956
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1395
WorldObjectWorker(WorldObject const *searcher, Do const &_do, uint32 mapTypeMask=GRID_MAP_TYPE_MASK_ALL)
Definition: GridNotifiers.h:245
WorldObject & i_object
Definition: GridNotifiers.h:57
float i_range
Definition: GridNotifiers.h:663
void Visit(GridRefManager< T > &)
Definition: GridNotifiers.h:92
WorldObject * i_source
Definition: GridNotifiers.h:128
float i_distSq
Definition: GridNotifiers.h:130
void Visit(CreatureMapType &m)
Definition: GridNotifiersImpl.h:392
std::set< Unit * > i_visibleNow
Definition: GridNotifiers.h:47
GuidUnorderedSet vis_guids
Definition: GridNotifiers.h:48
Unit *const i_enemy
Definition: GridNotifiers.h:1154
Definition: GridNotifiers.h:1034
WorldObjectSearcher(WorldObject const *searcher, WorldObject *&result, Check &check, uint32 mapTypeMask=GRID_MAP_TYPE_MASK_ALL)
Definition: GridNotifiers.h:183
CallOfHelpCreatureInRangeDo(Unit *funit, Unit *enemy, float range)
Definition: GridNotifiers.h:963
uint32 i_timeDiff
Definition: GridNotifiers.h:109
bool operator()(Unit *u)
Definition: GridNotifiers.h:764
Definition: GridDefines.h:74
AllCreaturesOfEntryInRange(const WorldObject *object, uint32 entry, float maxRange)
Definition: GridNotifiers.h:1268
std::unordered_set< ObjectGuid > GuidUnorderedSet
Definition: ObjectGuid.h:336
uint32 GetEntry() const
Definition: Object.h:107
Unit *const i_enemy
Definition: GridNotifiers.h:1125
uint32 i_focusId
Definition: GridNotifiers.h:643
SpellTargetCheckTypes
Definition: SpellInfo.h:118
Unit *const i_funit
Definition: GridNotifiers.h:986
Player session in the World.
Definition: WorldSession.h:882
NearestHostileUnitInAggroRangeCheck(Creature const *creature, bool useLOS=false)
Definition: GridNotifiers.h:1072
struct GameObjectTemplate::@221::@248 fishingHole
Definition: ObjectGuid.h:189
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:506
Definition: Common.h:172
float i_range
Definition: GridNotifiers.h:837
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:489
iterator end()
Definition: GridRefManager.h:37
WorldObject const * i_obj
Definition: GridNotifiers.h:897
Check & i_check
Definition: GridNotifiers.h:463
struct GameObjectTemplate::@221::@231 spellFocus
std::vector< WorldPacketList > i_data_cache
Definition: GridNotifiers.h:1435
WorldObject const * _searcher
Definition: GridNotifiers.h:221
bool operator()(Unit *u)
Definition: GridNotifiers.h:889
Unit const * i_unit
Definition: GridNotifiers.h:642
float i_range
Definition: GridNotifiers.h:898
Check & i_check
Definition: GridNotifiers.h:201
Definition: ObjectGuid.h:35
Player *& i_object
Definition: GridNotifiers.h:528
T check(T value)
Definition: format.h:305
Creature *& i_object
Definition: GridNotifiers.h:431
void Visit(PlayerMapType &m)
Definition: GridNotifiersImpl.h:280
bool CanSeeOrDetect(WorldObject const *obj, bool ignoreStealth=false, bool distanceCheck=false, bool checkAlert=false) const
Definition: Object.cpp:1940
bool IsInRaidWith(Unit const *unit) const
Definition: Unit.cpp:14391
Definition: GridNotifiers.h:126
bool operator()(Unit *u)
Definition: GridNotifiers.h:801
uint32 entry
Definition: GridNotifiers.h:1314
uint32 GetHealth() const
Definition: Unit.h:1426
Definition: GridNotifiers.h:797
Definition: GridNotifiers.h:1357
std::list< Creature * > & i_objects
Definition: GridNotifiers.h:462
Definition: GridNotifiers.h:1209
~LocalizedPacketDo()
Definition: GridNotifiers.h:1405
WorldObject const * _searcher
Definition: GridNotifiers.h:378
AllFriendlyCreaturesInGrid(Unit const *obj)
Definition: GridNotifiers.h:1236
CellCoord & p
Definition: GridNotifiers.h:88
Definition: Unit.h:1305
uint32 i_entry
Definition: GridNotifiers.h:708
uint32 i_timeDiff
Definition: GridNotifiers.h:164
void Visit(GameObjectMapType &m)
Definition: GridNotifiers.h:358
WorldObjectListSearcher(WorldObject const *searcher, std::list< WorldObject * > &objects, Check &check, uint32 mapTypeMask=GRID_MAP_TYPE_MASK_ALL)
Definition: GridNotifiers.h:225
AnyAoETargetUnitInObjectRangeCheck(WorldObject const *obj, Unit const *funit, float range)
Definition: GridNotifiers.h:929
void Visit(CreatureMapType &m)
Definition: GridNotifiersImpl.h:478
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:422
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:29
bool operator()(GameObject *go)
Definition: GridNotifiers.h:1252
GameobjectTypes i_type
Definition: GridNotifiers.h:732
bool isCreature
Definition: GridNotifiers.h:100
Definition: WorldPacket.h:26
Definition: GridNotifiers.h:218
bool isTargetableForAttack(bool checkFakeDeath=true) const
Definition: Unit.cpp:9987
bool fuzzyEq(double a, double b)
Definition: g3dmath.h:857
void Visit(CreatureMapType &m)
Definition: GridNotifiers.h:482
Player const * skipped_receiver
Definition: GridNotifiers.h:132
uint32 type
Definition: GameObject.h:37
Unit const * i_obj
Definition: GridNotifiers.h:774
Unit const * i_funit
Definition: GridNotifiers.h:810
Definition: GridNotifiers.h:1317
Definition: GridNotifiers.h:197
void operator()(WorldObject *) const
Definition: GridNotifiers.h:619
Definition: GridDefines.h:73
void Visit(GameObjectMapType &m)
Definition: GridNotifiersImpl.h:368
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:334
WorldObject * _baseObject
Definition: GridNotifiers.h:1371
bool IsCharmed() const
Definition: Unit.h:1742
void Visit(GridRefManager< NOT_INTERESTED > &)
Definition: GridNotifiers.h:235
bool operator()(Creature *u)
Definition: GridNotifiers.h:1168
float _range
Definition: GridNotifiers.h:881
void Visit(GridRefManager< SKIP > &)
Definition: GridNotifiers.h:146
float GetLastRange() const
Definition: GridNotifiers.h:682
WorldObject const * _searcher
Definition: GridNotifiers.h:497
float i_range
Definition: GridNotifiers.h:793
WorldObject const * _searcher
Definition: GridNotifiers.h:543
void Visit(AreaTriggerMapType &m)
Definition: GridNotifiers.h:292
bool CanStartAttack(Unit const *u, bool force) const
Definition: Creature.cpp:1525
Creature const * me
Definition: GridNotifiers.h:1063
Unit const * i_obj
Definition: GridNotifiers.h:755