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
|
|
|
|
2009-12-26 11:38:30 +01:00
|
|
|
class DynamicObject : public WorldObject, public GridObject<DynamicObject>
|
2008-10-02 16:23:55 -05:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit DynamicObject();
|
2011-02-04 00:27:43 +01:00
|
|
|
~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);
|
2011-02-04 00:27:43 +01:00
|
|
|
void Remove();
|
2010-01-10 01:23:15 +01:00
|
|
|
void SetDuration(int32 newDuration);
|
|
|
|
|
int32 GetDuration() const;
|
|
|
|
|
void Delay(int32 delaytime);
|
2011-02-04 00:27:43 +01:00
|
|
|
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); }
|
2009-06-06 20:22:14 -05:00
|
|
|
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); }
|
2009-03-28 18:03:56 -06:00
|
|
|
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;
|
2011-02-04 00:27:43 +01:00
|
|
|
Unit * m_caster;
|
|
|
|
|
bool m_isViewpoint;
|
2008-10-02 16:23:55 -05:00
|
|
|
};
|
2010-01-10 22:01:18 +03:00
|
|
|
#endif
|