18#ifndef TRINITY_SCRIPTEDCREATURE_H
19#define TRINITY_SCRIPTEDCREATURE_H
45 return _storage.begin();
50 return _storage.begin();
55 return _storage.end();
60 return _storage.end();
65 return _storage.erase(i);
70 return _storage.empty();
75 return _storage.size();
86 void DespawnEntry(
uint32 entry);
92 _storage.remove_if(predicate);
95 template <
class Predicate>
100 std::copy_if(std::begin(_storage), std::end(_storage), std::inserter(listCopy, std::end(listCopy)), predicate);
101 DoActionImpl(info, listCopy, max);
104 void DoZoneInCombat(
uint32 entry = 0);
105 void RemoveNotExisting();
106 bool HasEntry(
uint32 entry)
const;
109 void DoActionImpl(
int32 action, StorageType& summons,
uint16 max);
141 void AttackStartNoMove(
Unit* target);
144 virtual void UpdateAI(
uint32 diff)
override;
158 void AttackStart(
Unit* )
override;
165 void DoStartMovement(
Unit* target,
float distance = 0.0f,
float angle = 0.0f);
168 void DoStartNoMovement(
Unit* target);
174 void DoCastSpell(
Unit* target,
SpellInfo const* spellInfo,
bool triggered =
false);
180 void AddThreat(
Unit* victim,
float amount,
Unit* who =
nullptr);
182 void ModifyThreatByPercent(
Unit* victim,
int32 pct,
Unit* who =
nullptr);
184 void ResetThreat(
Unit* victim,
Unit* who =
nullptr);
186 void ResetThreatList(
Unit* who =
nullptr);
188 float GetThreat(
Unit const* victim,
Unit const* who =
nullptr);
190 void ForceCombatStop(
Creature* who,
bool reset =
true);
192 void ForceCombatStopForCreatureEntry(
uint32 entry,
float maxSearchRange = 250.0f,
bool samePhase =
true,
bool reset =
true);
194 void ForceCombatStopForCreatureEntry(std::vector<uint32> creatureEntries,
float maxSearchRange = 250.0f,
bool samePhase =
true,
bool reset =
true);
196 void DoTeleportTo(
float x,
float y,
float z,
uint32 time = 0);
197 void DoTeleportTo(
float const pos[4]);
200 void DoTeleportPlayer(
Unit* unit,
float x,
float y,
float z,
float o);
201 void DoTeleportAll(
float x,
float y,
float z,
float o);
204 Unit* DoSelectLowestHpFriendly(
float range,
uint32 minHPDiff = 1);
207 Unit* DoSelectBelowHpPctFriendlyWithEntry(
uint32 entry,
float range,
uint8 hpPct = 1,
bool excludeSelf =
true);
210 std::list<Creature*> DoFindFriendlyCC(
float range);
213 std::list<Creature*> DoFindFriendlyMissingBuff(
float range,
uint32 spellId);
216 Player* GetPlayerAtMinimumRange(
float minRange);
221 bool HealthBelowPct(
uint32 pct)
const;
222 bool HealthAbovePct(
uint32 pct)
const;
234 void SetCombatMovement(
bool allowMovement);
255 inline T
const&
DUNGEON_MODE(T
const& normal5, T
const& heroic10)
const
271 inline T
const&
RAID_MODE(T
const& normal10, T
const& normal25)
const
287 inline T
const&
RAID_MODE(T
const& normal10, T
const& normal25, T
const& heroic10, T
const& heroic25)
const
320 void JustSummoned(
Creature* summon)
override;
321 void SummonedCreatureDespawn(
Creature* summon)
override;
323 virtual void UpdateAI(
uint32 diff)
override;
338 bool CanAIAttack(
Unit const* target)
const override;
342 void _JustEngagedWith(
Unit* who);
344 void _JustReachedHome();
345 void _DespawnAtEvade(
Seconds delayToRespawn = 30s,
Creature* who =
nullptr);
347 void TeleportCheaters();
363 void JustSummoned(
Creature* summon)
override;
364 void SummonedCreatureDespawn(
Creature* summon)
override;
366 virtual void UpdateAI(
uint32 diff)
override;
380 void _JustEngagedWith();
403template <
typename Container>
409template <
typename Container>
415template <
typename Container>
421template <
typename Container>
@ RAID_DIFFICULTY_25MAN_HEROIC
@ RAID_DIFFICULTY_10MAN_NORMAL
@ DUNGEON_DIFFICULTY_NORMAL
@ RAID_DIFFICULTY_25MAN_NORMAL
@ DUNGEON_DIFFICULTY_HEROIC
@ RAID_DIFFICULTY_10MAN_HEROIC
#define RAID_DIFFICULTY_MASK_25MAN
std::chrono::seconds Seconds
Seconds shorthand typedef.
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
std::list< ObjectGuid > GuidList
void GetCreatureListWithEntryInGrid(Container &container, WorldObject *source, uint32 entry, float maxSearchRange)
void GetCreatureListWithOptionsInGrid(Container &container, WorldObject *source, float maxSearchRange, FindCreatureOptions const &options)
void GetPlayerListInGrid(Container &container, WorldObject *source, float maxSearchRange, bool alive=true)
Creature * GetClosestCreatureWithOptions(WorldObject *source, float maxSearchRange, FindCreatureOptions const &options)
GameObject * GetClosestGameObjectWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool spawnedOnly=true)
Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive=true)
void GetGameObjectListWithEntryInGrid(Container &container, WorldObject *source, uint32 entry, float maxSearchRange)
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
void JustDied(Unit *) override
virtual void ExecuteEvent(uint32)
void JustReachedHome() override
virtual void ScheduleTasks()
bool operator()(ObjectGuid)
EntryCheckPredicate(uint32 entry)
bool operator()(ObjectGuid guid)
iterator erase(iterator i)
StorageType::const_iterator const_iterator
void DespawnIf(T const &predicate)
StorageType::size_type size_type
SummonList(Creature *creature)
StorageType::value_type value_type
const_iterator begin() const
const_iterator end() const
StorageType::iterator iterator
void DoAction(int32 info, Predicate &&predicate, uint16 max=0)
void JustDied(Unit *) override
virtual void ExecuteEvent(uint32)
void JustEngagedWith(Unit *) override
void GetPlayerListInGrid(Container &playerContainer, float maxSearchRange, bool alive=true) const
GameObject * FindNearestGameObject(uint32 entry, float range, bool spawnedOnly=true) const
Creature * FindNearestCreatureWithOptions(float range, FindCreatureOptions const &options) const
void GetCreatureListWithEntryInGrid(Container &creatureContainer, uint32 entry, float maxSearchRange=250.0f) const
void GetGameObjectListWithEntryInGrid(Container &gameObjectContainer, uint32 entry, float maxSearchRange=250.0f) const
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
void GetCreatureListWithOptionsInGrid(Container &creatureContainer, float maxSearchRange, FindCreatureOptions const &options) const
T const & DUNGEON_MODE(T const &normal5, T const &heroic10) const
bool IsCombatMovementAllowed() const
T const & RAID_MODE(T const &normal10, T const &normal25) const
bool _isCombatMovementAllowed
Difficulty GetDifficulty() const
T const & RAID_MODE(T const &normal10, T const &normal25, T const &heroic10, T const &heroic25) const