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

70 lines
2.4 KiB
C++
Raw Normal View History

2010-10-07 15:54:07 +02:00
/*
2017-01-01 16:21:30 +01:00
* Copyright (C) 2008-2017 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;
class SpellInfo;
2009-10-17 15:51:44 -07:00
enum DynamicObjectType
{
DYNAMIC_OBJECT_PORTAL = 0x0, // unused
DYNAMIC_OBJECT_AREA_SPELL = 0x1,
DYNAMIC_OBJECT_FARSIGHT_FOCUS = 0x2
};
class TC_GAME_API DynamicObject : public WorldObject, public GridObject<DynamicObject>, public MapObject
2008-10-02 16:23:55 -05:00
{
public:
DynamicObject(bool isWorldObject);
~DynamicObject();
2009-10-17 15:51:44 -07:00
2014-08-09 20:17:40 +01:00
void AddToWorld() override;
void RemoveFromWorld() override;
2009-10-17 15:51:44 -07:00
bool CreateDynamicObject(ObjectGuid::LowType guidlow, Unit* caster, SpellInfo const* spell, Position const& pos, float radius, DynamicObjectType type, uint32 spellXSpellVisualId);
2014-08-09 20:17:40 +01:00
void Update(uint32 p_time) override;
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 _caster; }
void BindToCaster();
void UnbindFromCaster();
2010-01-10 01:23:15 +01:00
uint32 GetSpellId() const { return GetUInt32Value(DYNAMICOBJECT_SPELLID); }
ObjectGuid GetCasterGUID() const { return GetGuidValue(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
protected:
Aura* _aura;
Aura* _removedAura;
Unit* _caster;
int32 _duration; // for non-aura dynobjects
uint32 _spellXSpellVisualId;
bool _isViewpoint;
2008-10-02 16:23:55 -05:00
};
2010-01-10 22:01:18 +03:00
#endif