Core: ported headers cleanup from master branch

This commit is contained in:
ariel-
2017-06-19 23:20:06 -03:00
parent 052fc24315
commit 85a7d5ce9a
1207 changed files with 21154 additions and 18404 deletions

View File

@@ -17,13 +17,19 @@
*/
#include "ScriptedCreature.h"
#include "Spell.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "AreaBoundary.h"
#include "Cell.h"
#include "CellImpl.h"
#include "ObjectMgr.h"
#include "AreaBoundary.h"
#include "DBCStores.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "InstanceScript.h"
#include "Log.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Spell.h"
#include "SpellMgr.h"
#include "TemporarySummon.h"
// Spell summary for ScriptedAI::SelectSpell
struct TSpellSummary
@@ -32,6 +38,16 @@ struct TSpellSummary
uint8 Effects; // set of enum SelectEffect
} extern* SpellSummary;
void SummonList::Summon(Creature const* summon)
{
storage_.push_back(summon->GetGUID());
}
void SummonList::Despawn(Creature const* summon)
{
storage_.remove(summon->GetGUID());
}
void SummonList::DoZoneInCombat(uint32 entry, float maxRangeToNearestTarget)
{
for (StorageType::iterator i = storage_.begin(); i != storage_.end();)
@@ -97,6 +113,16 @@ bool SummonList::HasEntry(uint32 entry) const
return false;
}
void SummonList::DoActionImpl(int32 action, StorageType const& summons)
{
for (auto const& guid : summons)
{
Creature* summon = ObjectAccessor::GetCreature(*me, guid);
if (summon && summon->IsAIEnabled)
summon->AI()->DoAction(action);
}
}
ScriptedAI::ScriptedAI(Creature* creature) : CreatureAI(creature),
IsFleeing(false),
_isCombatMovementAllowed(true)
@@ -179,6 +205,16 @@ Creature* ScriptedAI::DoSpawnCreature(uint32 entry, float offsetX, float offsetY
return me->SummonCreature(entry, me->GetPositionX() + offsetX, me->GetPositionY() + offsetY, me->GetPositionZ() + offsetZ, angle, TempSummonType(type), despawntime);
}
bool ScriptedAI::HealthBelowPct(uint32 pct) const
{
return me->HealthBelowPct(pct);
}
bool ScriptedAI::HealthAbovePct(uint32 pct) const
{
return me->HealthAbovePct(pct);
}
SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effects)
{
//No target so we can't cast
@@ -444,6 +480,11 @@ void BossAI::_JustDied()
instance->SetBossState(_bossId, DONE);
}
void BossAI::_JustReachedHome()
{
me->setActive(false);
}
void BossAI::_EnterCombat()
{
if (instance)
@@ -507,6 +548,11 @@ void BossAI::UpdateAI(uint32 diff)
DoMeleeAttackIfReady();
}
bool BossAI::CanAIAttack(Unit const* target) const
{
return CheckBoundary(target);
}
void BossAI::_DespawnAtEvade(uint32 delayToRespawn /*= 30*/, Creature* who /*= nullptr*/)
{
if (delayToRespawn < 2)