Files
TCPlayerbotCore/src/server/game/Entities/DynamicObject/DynamicObject.h
T

67 lines
2.6 KiB
C++
Raw Normal View History

2010-10-07 15:54:07 +02:00
/*
2011-01-01 15:01:13 +01:00
* Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
2010-10-07 15:54:07 +02:00
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
2008-10-02 16:23:55 -05:00
*/
2009-10-17 15:51:44 -07:00
2008-10-14 11:57:03 -05:00
#ifndef TRINITYCORE_DYNAMICOBJECT_H
#define TRINITYCORE_DYNAMICOBJECT_H
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
#include "Object.h"
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
class Unit;
2010-01-10 01:23:15 +01:00
class Aura;
2008-10-02 16:23:55 -05:00
struct SpellEntry;
2009-10-17 15:51:44 -07:00
class DynamicObject : public WorldObject, public GridObject<DynamicObject>
2008-10-02 16:23:55 -05:00
{
public:
explicit DynamicObject();
~DynamicObject();
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
void AddToWorld();
void RemoveFromWorld();
2009-10-17 15:51:44 -07:00
2010-01-10 01:23:15 +01:00
bool Create(uint32 guidlow, Unit *caster, uint32 spellId, const Position &pos, float radius, bool active);
2008-10-02 16:23:55 -05:00
void Update(uint32 p_time);
void Remove();
2010-01-10 01:23:15 +01:00
void SetDuration(int32 newDuration);
int32 GetDuration() const;
void Delay(int32 delaytime);
void SetAura(Aura * aura);
void RemoveAura();
void SetCasterViewpoint();
void RemoveCasterViewpoint();
Unit * GetCaster() const { return m_caster; }
void BindToCaster();
void UnbindFromCaster();
2010-01-10 01:23:15 +01:00
uint32 GetSpellId() const { return GetUInt32Value(DYNAMICOBJECT_SPELLID); }
uint64 GetCasterGUID() const { return GetUInt64Value(DYNAMICOBJECT_CASTER); }
2010-01-10 01:23:15 +01:00
float GetRadius() const { return GetFloatValue(DYNAMICOBJECT_RADIUS); }
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId,language,TargetGuid); }
void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); }
void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId,TargetGuid); }
void Whisper(int32 textId,uint64 receiver) { MonsterWhisper(textId,receiver); }
void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId,language,TargetGuid); }
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
protected:
2010-01-10 01:23:15 +01:00
int32 m_duration; // for non-aura dynobjects
Aura * m_aura;
Unit * m_caster;
bool m_isViewpoint;
2008-10-02 16:23:55 -05:00
};
2010-01-10 22:01:18 +03:00
#endif