[7577] Implement YellToZone for different world object types.
[AHbot.git] / src / game / DynamicObject.h
blobed19dc28fc4fcd9bad71a5da47437e80e5ef6c72
1 /*
2 * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef MANGOSSERVER_DYNAMICOBJECT_H
20 #define MANGOSSERVER_DYNAMICOBJECT_H
22 #include "Object.h"
24 class Unit;
25 struct SpellEntry;
27 class DynamicObject : public WorldObject
29 public:
30 typedef std::set<Unit*> AffectedSet;
31 explicit DynamicObject();
33 void AddToWorld();
34 void RemoveFromWorld();
36 bool Create(uint32 guidlow, Unit *caster, uint32 spellId, uint32 effIndex, float x, float y, float z, int32 duration, float radius);
37 void Update(uint32 p_time);
38 void Delete();
39 uint32 GetSpellId() const { return m_spellId; }
40 uint32 GetEffIndex() const { return m_effIndex; }
41 uint32 GetDuration() const { return m_aliveDuration; }
42 uint64 GetCasterGUID() const { return m_casterGuid; }
43 Unit* GetCaster() const;
44 float GetRadius() const { return m_radius; }
45 bool IsAffecting(Unit *unit) const { return m_affected.find(unit) != m_affected.end(); }
46 void AddAffected(Unit *unit) { m_affected.insert(unit); }
47 void RemoveAffected(Unit *unit) { m_affected.erase(unit); }
48 void Delay(int32 delaytime);
49 bool isVisibleForInState(Player const* u, bool inVisibleList) const;
51 void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId,language,TargetGuid); }
52 void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); }
53 void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId,TargetGuid); }
54 void Whisper(int32 textId,uint64 receiver) { MonsterWhisper(textId,receiver); }
55 void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId,language,TargetGuid); }
57 GridReference<DynamicObject> &GetGridRef() { return m_gridRef; }
59 bool isActiveObject() const { return false; }
60 protected:
61 uint64 m_casterGuid;
62 uint32 m_spellId;
63 uint32 m_effIndex;
64 int32 m_aliveDuration;
65 time_t m_nextThinkTime;
66 float m_radius;
67 AffectedSet m_affected;
68 private:
69 GridReference<DynamicObject> m_gridRef;
71 #endif