Core/Game: Include cleanup part 5

* ObjectMgr.h
* Player.h
* Unit.h
* G3D should no longer propagate everywhere from Spline/MotionMaster
This commit is contained in:
Shauren
2017-06-04 01:00:45 +02:00
parent ec72a59b08
commit b453e12423
442 changed files with 3521 additions and 2850 deletions
@@ -30,6 +30,7 @@ EndScriptData */
#include "Player.h"
#include "ScriptMgr.h"
#include "World.h"
#include "WorldSession.h"
#include <boost/asio/ip/address_v4.hpp>
class account_commandscript : public CommandScript
@@ -25,6 +25,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "AchievementMgr.h"
#include "Chat.h"
#include "DB2Stores.h"
#include "Language.h"
#include "Player.h"
#include "RBAC.h"
+1
View File
@@ -30,6 +30,7 @@ EndScriptData */
#include "ObjectMgr.h"
#include "Player.h"
#include "RBAC.h"
#include "WorldSession.h"
class arena_commandscript : public CommandScript
{
+1
View File
@@ -31,6 +31,7 @@ EndScriptData */
#include "Player.h"
#include "ScriptMgr.h"
#include "World.h"
#include "WorldSession.h"
class ban_commandscript : public CommandScript
{
@@ -25,6 +25,7 @@
#include "Player.h"
#include "ScriptMgr.h"
#include "Util.h"
#include "WorldSession.h"
#include <boost/asio/ip/address_v4.hpp>
class battlenet_account_commandscript : public CommandScript
+2
View File
@@ -28,6 +28,8 @@ EndScriptData */
#include "Language.h"
#include "Player.h"
#include "RBAC.h"
#include "SpellMgr.h"
#include "WorldSession.h"
class cast_commandscript : public CommandScript
{
@@ -25,13 +25,16 @@ EndScriptData */
#include "AccountMgr.h"
#include "Chat.h"
#include "DatabaseEnv.h"
#include "DB2Stores.h"
#include "Log.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "PlayerDump.h"
#include "Player.h"
#include "ReputationMgr.h"
#include "ScriptMgr.h"
#include "World.h"
#include "WorldSession.h"
class character_commandscript : public CommandScript
{
+1
View File
@@ -27,6 +27,7 @@ EndScriptData */
#include "Language.h"
#include "Player.h"
#include "RBAC.h"
#include "WorldSession.h"
class cheat_commandscript : public CommandScript
{
+2 -2
View File
@@ -23,15 +23,14 @@ Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "Bag.h"
#include "BattlefieldMgr.h"
#include "BattlegroundMgr.h"
#include "Cell.h"
#include "CellImpl.h"
#include "Chat.h"
#include "ChatPackets.h"
#include "Conversation.h"
#include "GossipDef.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "Language.h"
#include "Log.h"
@@ -42,6 +41,7 @@ EndScriptData */
#include "RBAC.h"
#include "SpellPackets.h"
#include "Transport.h"
#include "WorldSession.h"
#include <fstream>
#include <limits>
@@ -26,6 +26,7 @@ EndScriptData */
#include "Chat.h"
#include "CriteriaHandler.h"
#include "DatabaseEnv.h"
#include "DB2Stores.h"
#include "DisableMgr.h"
#include "Language.h"
#include "ObjectMgr.h"
+2 -1
View File
@@ -26,12 +26,13 @@ EndScriptData */
#include "Chat.h"
#include "DatabaseEnv.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "ObjectAccessor.h"
#include "Opcodes.h"
#include "Player.h"
#include "Realm.h"
#include "ScriptMgr.h"
#include "World.h"
#include "WorldSession.h"
#include <boost/thread/shared_mutex.hpp>
#include <boost/thread/locks.hpp>
+2
View File
@@ -27,11 +27,13 @@ EndScriptData */
#include "DatabaseEnv.h"
#include "Language.h"
#include "MapManager.h"
#include "MotionMaster.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "RBAC.h"
#include "SupportMgr.h"
#include "Transport.h"
#include "WorldSession.h"
class go_commandscript : public CommandScript
{
+6 -5
View File
@@ -25,16 +25,19 @@ EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "DatabaseEnv.h"
#include "DB2Stores.h"
#include "GameEventMgr.h"
#include "GameObject.h"
#include "Language.h"
#include "Log.h"
#include "MapManager.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "Player.h"
#include "PoolMgr.h"
#include "RBAC.h"
#include <G3D/Quat.h>
#include "WorldSession.h"
class gobject_commandscript : public CommandScript
{
@@ -141,8 +144,7 @@ public:
GameObject* object = new GameObject();
G3D::Quat rot = G3D::Matrix3::fromEulerAnglesZYX(player->GetOrientation(), 0.f, 0.f);
if (!object->Create(objectInfo->entry, map, 0, *player, QuaternionData(rot.x, rot.y, rot.z, rot.w), 255, GO_STATE_READY))
if (!object->Create(objectInfo->entry, map, 0, *player, QuaternionData::fromEulerAnglesZYX(player->GetOrientation(), 0.0f, 0.0f), 255, GO_STATE_READY))
{
delete object;
return false;
@@ -197,7 +199,6 @@ public:
if (spawntime)
spawntm = atoul(spawntime);
G3D::Quat rotation = G3D::Matrix3::fromEulerAnglesZYX(player->GetOrientation(), 0.f, 0.f);
uint32 objectId = atoul(id);
if (!sObjectMgr->GetGameObjectTemplate(objectId))
@@ -207,7 +208,7 @@ public:
return false;
}
player->SummonGameObject(objectId, *player, QuaternionData(rotation.x, rotation.y, rotation.z, rotation.w), spawntm);
player->SummonGameObject(objectId, *player, QuaternionData::fromEulerAnglesZYX(player->GetOrientation(), 0.0f, 0.0f), spawntm);
return true;
}
+5
View File
@@ -18,12 +18,17 @@
#include "ScriptMgr.h"
#include "Chat.h"
#include "DatabaseEnv.h"
#include "DB2Stores.h"
#include "GroupMgr.h"
#include "Language.h"
#include "LFG.h"
#include "Map.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "RBAC.h"
#include "WorldSession.h"
class group_commandscript : public CommandScript
{
+1
View File
@@ -28,6 +28,7 @@ EndScriptData */
#include "ObjectMgr.h"
#include "Player.h"
#include "RBAC.h"
#include "WorldSession.h"
class honor_commandscript : public CommandScript
{
@@ -33,6 +33,7 @@ EndScriptData */
#include "ObjectMgr.h"
#include "Player.h"
#include "RBAC.h"
#include "WorldSession.h"
class instance_commandscript : public CommandScript
{
+2
View File
@@ -24,6 +24,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "DB2Stores.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "Pet.h"
@@ -31,6 +32,7 @@ EndScriptData */
#include "RBAC.h"
#include "SpellInfo.h"
#include "SpellMgr.h"
#include "WorldSession.h"
class learn_commandscript : public CommandScript
{
+1
View File
@@ -22,6 +22,7 @@
#include "GroupMgr.h"
#include "Language.h"
#include "LFGMgr.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "RBAC.h"
+1
View File
@@ -31,6 +31,7 @@ EndScriptData */
#include "Player.h"
#include "RBAC.h"
#include "SpellAuraEffects.h"
#include "WorldSession.h"
class list_commandscript : public CommandScript
{
+4 -1
View File
@@ -22,17 +22,20 @@ Comment: All lookup related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "AccountMgr.h"
#include "Chat.h"
#include "DatabaseEnv.h"
#include "DB2Stores.h"
#include "GameEventMgr.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ReputationMgr.h"
#include "ScriptMgr.h"
#include "SpellInfo.h"
#include "SpellMgr.h"
#include "World.h"
#include "WorldSession.h"
class lookup_commandscript : public CommandScript
{
@@ -28,11 +28,14 @@ EndScriptData */
#include "Channel.h"
#include "ChannelMgr.h"
#include "DatabaseEnv.h"
#include "DB2Stores.h"
#include "Language.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "RBAC.h"
#include "World.h"
#include "WorldSession.h"
class message_commandscript : public CommandScript
{
+3
View File
@@ -26,6 +26,7 @@
#include "Group.h"
#include "GroupMgr.h"
#include "InstanceSaveMgr.h"
#include "Item.h"
#include "Language.h"
#include "LFG.h"
#include "Log.h"
@@ -42,11 +43,13 @@
#include "ScriptMgr.h"
#include "SpellAuras.h"
#include "SpellHistory.h"
#include "SpellMgr.h"
#include "TargetedMovementGenerator.h"
#include "Transport.h"
#include "Weather.h"
#include "WeatherMgr.h"
#include "World.h"
#include "WorldSession.h"
#include <boost/asio/ip/address_v4.hpp>
// temporary hack until database includes are sorted out (don't want to pull in Windows.h everywhere from mysql.h)
+1 -1
View File
@@ -30,12 +30,12 @@
#include "GridNotifiersImpl.h"
#include "Map.h"
#include "MMapFactory.h"
#include "ObjectMgr.h"
#include "PathGenerator.h"
#include "Player.h"
#include "PointMovementGenerator.h"
#include "RBAC.h"
#include "TargetedMovementGenerator.h"
#include "WorldSession.h"
class mmaps_commandscript : public CommandScript
{
+4 -1
View File
@@ -24,13 +24,16 @@ EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "DB2Stores.h"
#include "Log.h"
#include "ObjectMgr.h"
#include "Pet.h"
#include "Player.h"
#include "RBAC.h"
#include "ReputationMgr.h"
#include "SpellMgr.h"
#include "SpellPackets.h"
#include "WorldSession.h"
class modify_commandscript : public CommandScript
{
@@ -322,7 +325,7 @@ public:
modData.ModifierValue = float(val);
spellMod.ModifierData.push_back(modData);
packet.Modifiers.push_back(spellMod);
target->GetSession()->SendPacket(packet.Write());
target->SendDirectMessage(packet.Write());
return true;
}
+3
View File
@@ -29,6 +29,8 @@ EndScriptData */
#include "DatabaseEnv.h"
#include "Language.h"
#include "Log.h"
#include "Map.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Pet.h"
#include "Player.h"
@@ -36,6 +38,7 @@ EndScriptData */
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
#include "Transport.h"
#include "World.h"
#include "WorldSession.h"
template<typename E, typename T = char const*>
struct EnumName
+3
View File
@@ -19,10 +19,13 @@
#include "Chat.h"
#include "Language.h"
#include "Log.h"
#include "Map.h"
#include "Pet.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "RBAC.h"
#include "SpellMgr.h"
#include "WorldSession.h"
static inline Pet* GetSelectedPlayerPetOrOwn(ChatHandler* handler)
{
+1
View File
@@ -25,6 +25,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "DatabaseEnv.h"
#include "DB2Stores.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "RBAC.h"
+1
View File
@@ -30,6 +30,7 @@ EndScriptData */
#include "Realm.h"
#include "ScriptMgr.h"
#include "World.h"
#include "WorldSession.h"
struct RBACCommandData
{
@@ -33,6 +33,7 @@ EndScriptData */
#include "CreatureTextMgr.h"
#include "DatabaseEnv.h"
#include "DisableMgr.h"
#include "ItemEnchantmentMgr.h"
#include "Language.h"
#include "LFGMgr.h"
#include "Log.h"
@@ -47,6 +48,7 @@ EndScriptData */
#include "SupportMgr.h"
#include "WardenCheckMgr.h"
#include "WaypointManager.h"
#include "World.h"
class reload_commandscript : public CommandScript
{
+2
View File
@@ -26,6 +26,7 @@ EndScriptData */
#include "AchievementMgr.h"
#include "Chat.h"
#include "DatabaseEnv.h"
#include "DB2Stores.h"
#include "Language.h"
#include "Log.h"
#include "ObjectAccessor.h"
@@ -33,6 +34,7 @@ EndScriptData */
#include "Player.h"
#include "RBAC.h"
#include "World.h"
#include "WorldSession.h"
#include <boost/thread/shared_mutex.hpp>
#include <boost/thread/locks.hpp>
+2
View File
@@ -17,10 +17,12 @@
#include "ScriptMgr.h"
#include "Chat.h"
#include "DB2Stores.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "RBAC.h"
#include "WorldSession.h"
class scene_commandscript : public CommandScript
{
+3
View File
@@ -18,11 +18,14 @@
#include "ScriptMgr.h"
#include "Chat.h"
#include "DatabaseEnv.h"
#include "Item.h"
#include "Language.h"
#include "Mail.h"
#include "ObjectMgr.h"
#include "Pet.h"
#include "Player.h"
#include "RBAC.h"
#include "WorldSession.h"
class send_commandscript : public CommandScript
{
@@ -33,6 +33,7 @@ EndScriptData */
#include "RBAC.h"
#include "Util.h"
#include "World.h"
#include "WorldSession.h"
class server_commandscript : public CommandScript
{
+3
View File
@@ -25,12 +25,15 @@ EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "DatabaseEnv.h"
#include "DB2Stores.h"
#include "Group.h"
#include "Language.h"
#include "MapManager.h"
#include "MotionMaster.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "RBAC.h"
#include "WorldSession.h"
class tele_commandscript : public CommandScript
{
@@ -33,6 +33,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "SupportMgr.h"
#include "World.h"
#include "WorldSession.h"
class ticket_commandscript : public CommandScript
{
@@ -24,6 +24,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "DB2Stores.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "Player.h"
+4
View File
@@ -24,12 +24,16 @@ EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "Creature.h"
#include "DatabaseEnv.h"
#include "Language.h"
#include "Map.h"
#include "MotionMaster.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "RBAC.h"
#include "WaypointManager.h"
#include "WorldSession.h"
class wp_commandscript : public CommandScript
{
@@ -18,6 +18,7 @@
#include "ScriptMgr.h"
#include "baradin_hold.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -62,7 +62,6 @@ class boss_pit_lord_argaloth : public CreatureScript
void EnterEvadeMode(EvadeReason /*why*/) override
{
me->GetMotionMaster()->MoveTargetedHome();
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
_DespawnAtEvade();
}
@@ -552,7 +552,7 @@ public:
void DoGo(uint32 id, uint32 state)
{
if (GameObject* go = instance->instance->GetGameObject(instance->GetGuidData(id)))
if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(id)))
go->SetGoState((GOState)state);
}
@@ -22,6 +22,7 @@
#include "InstanceScript.h"
#include "Log.h"
#include "Map.h"
#include "MotionMaster.h"
#include "ScriptedCreature.h"
#define TIMER_TOMBOFTHESEVEN 15000
@@ -17,6 +17,7 @@
#include "ScriptMgr.h"
#include "blackrock_spire.h"
#include "MotionMaster.h"
#include "ScriptedCreature.h"
#include "TemporarySummon.h"
@@ -19,6 +19,7 @@
#include "blackrock_spire.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ScriptedCreature.h"
enum Spells
@@ -17,8 +17,10 @@
#include "ScriptMgr.h"
#include "blackrock_spire.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "ObjectMgr.h"
#include "Map.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
@@ -105,10 +107,10 @@ public:
break;
case 2:
// Close these two doors on Blackhand Incarcerators aggro
if (GameObject* door1 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_IN)))
if (GameObject* door1 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_IN)))
if (door1->GetGoState() == GO_STATE_ACTIVE)
door1->SetGoState(GO_STATE_READY);
if (GameObject* door2 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_DOORS)))
if (GameObject* door2 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_DOORS)))
if (door2->GetGoState() == GO_STATE_ACTIVE)
door2->SetGoState(GO_STATE_READY);
break;
@@ -167,33 +169,33 @@ public:
void OpenDoors(bool Boss_Killed)
{
// These two doors reopen on reset or boss kill
if (GameObject* door1 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_IN)))
if (GameObject* door1 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_IN)))
door1->SetGoState(GO_STATE_ACTIVE);
if (GameObject* door2 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_DOORS)))
if (GameObject* door2 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_DOORS)))
door2->SetGoState(GO_STATE_ACTIVE);
// This door opens on boss kill
if (Boss_Killed)
if (GameObject* door3 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_OUT)))
if (GameObject* door3 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_OUT)))
door3->SetGoState(GO_STATE_ACTIVE);
}
void UpdateRunes(GOState state)
{
// update all runes
if (GameObject* rune1 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_1)))
if (GameObject* rune1 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_RUNE_1)))
rune1->SetGoState(state);
if (GameObject* rune2 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_2)))
if (GameObject* rune2 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_RUNE_2)))
rune2->SetGoState(state);
if (GameObject* rune3 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_3)))
if (GameObject* rune3 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_RUNE_3)))
rune3->SetGoState(state);
if (GameObject* rune4 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_4)))
if (GameObject* rune4 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_RUNE_4)))
rune4->SetGoState(state);
if (GameObject* rune5 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_5)))
if (GameObject* rune5 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_RUNE_5)))
rune5->SetGoState(state);
if (GameObject* rune6 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_6)))
if (GameObject* rune6 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_RUNE_6)))
rune6->SetGoState(state);
if (GameObject* rune7 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_7)))
if (GameObject* rune7 = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_EMBERSEER_RUNE_7)))
rune7->SetGoState(state);
}
@@ -19,6 +19,7 @@
#include "ScriptMgr.h"
#include "blackrock_spire.h"
#include "GameObject.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -374,37 +375,37 @@ public:
me->SummonCreature(NPC_GYTH, 211.762f, -397.5885f, 111.1817f, 4.747295f);
break;
case EVENT_WAVE_1:
if (GameObject* portcullis = me->GetMap()->GetGameObject(portcullisGUID))
if (GameObject* portcullis = ObjectAccessor::GetGameObject(*me, portcullisGUID))
portcullis->UseDoorOrButton();
// move wave
break;
case EVENT_WAVE_2:
// spawn wave
if (GameObject* portcullis = me->GetMap()->GetGameObject(portcullisGUID))
if (GameObject* portcullis = ObjectAccessor::GetGameObject(*me, portcullisGUID))
portcullis->UseDoorOrButton();
// move wave
break;
case EVENT_WAVE_3:
// spawn wave
if (GameObject* portcullis = me->GetMap()->GetGameObject(portcullisGUID))
if (GameObject* portcullis = ObjectAccessor::GetGameObject(*me, portcullisGUID))
portcullis->UseDoorOrButton();
// move wave
break;
case EVENT_WAVE_4:
// spawn wave
if (GameObject* portcullis = me->GetMap()->GetGameObject(portcullisGUID))
if (GameObject* portcullis = ObjectAccessor::GetGameObject(*me, portcullisGUID))
portcullis->UseDoorOrButton();
// move wave
break;
case EVENT_WAVE_5:
// spawn wave
if (GameObject* portcullis = me->GetMap()->GetGameObject(portcullisGUID))
if (GameObject* portcullis = ObjectAccessor::GetGameObject(*me, portcullisGUID))
portcullis->UseDoorOrButton();
// move wave
break;
case EVENT_WAVE_6:
// spawn wave
if (GameObject* portcullis = me->GetMap()->GetGameObject(portcullisGUID))
if (GameObject* portcullis = ObjectAccessor::GetGameObject(*me, portcullisGUID))
portcullis->UseDoorOrButton();
// move wave
break;
@@ -17,9 +17,10 @@
*/
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "Player.h"
#include "blackwing_lair.h"
#include "Map.h"
#include "Player.h"
#include "ScriptedCreature.h"
enum Emotes
{
@@ -20,6 +20,7 @@
#include "blackwing_lair.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
@@ -19,6 +19,8 @@
#include "blackwing_lair.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
#include "MotionMaster.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "TemporarySummon.h"
@@ -25,6 +25,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "InstanceScript.h"
#include "Map.h"
#include "molten_core.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -25,6 +25,7 @@ EndScriptData */
#include "deadmines.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
@@ -28,6 +28,7 @@ EndScriptData */
#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
#include "MotionMaster.h"
#include "TemporarySummon.h"
enum Sounds
@@ -26,6 +26,7 @@ Script Data End */
#include "GameObject.h"
#include "gnomeregan.h"
#include "InstanceScript.h"
#include "Map.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedEscortAI.h"
@@ -21,7 +21,7 @@
#include "gnomeregan.h"
#include "InstanceScript.h"
#include "Log.h"
#include "Player.h"
#include "Map.h"
#define MAX_ENCOUNTER 1
@@ -25,6 +25,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "karazhan.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
@@ -27,6 +27,7 @@ EndScriptData */
#include "GameObject.h"
#include "InstanceScript.h"
#include "karazhan.h"
#include "Map.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -26,6 +26,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "InstanceScript.h"
#include "karazhan.h"
#include "MotionMaster.h"
#include "ScriptedCreature.h"
enum Spells
@@ -26,7 +26,10 @@ EndScriptData */
#include "ScriptMgr.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "Item.h"
#include "karazhan.h"
#include "Map.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -27,6 +27,7 @@ EndScriptData */
#include "InstanceScript.h"
#include "karazhan.h"
#include "Log.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -32,6 +32,8 @@ EndContentData */
#include "InstanceScript.h"
#include "karazhan.h"
#include "Log.h"
#include "Map.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedEscortAI.h"
@@ -477,7 +479,7 @@ public:
if (instance->GetGuidData(DATA_IMAGE_OF_MEDIVH).IsEmpty())
{
instance->SetGuidData(DATA_IMAGE_OF_MEDIVH, me->GetGUID());
(*me).GetMotionMaster()->MovePoint(1, MedivPos[0], MedivPos[1], MedivPos[2]);
me->GetMotionMaster()->MovePoint(1, MedivPos[0], MedivPos[1], MedivPos[2]);
Step = 0;
}
else
@@ -27,6 +27,7 @@ EndScriptData */
#include "GameObject.h"
#include "InstanceScript.h"
#include "magisters_terrace.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "TemporarySummon.h"
@@ -18,6 +18,7 @@
#include "ScriptMgr.h"
#include "InstanceScript.h"
#include "magisters_terrace.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
@@ -18,6 +18,7 @@
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "magisters_terrace.h"
#include "MotionMaster.h"
enum Yells
{
@@ -21,6 +21,7 @@
#include "InstanceScript.h"
#include "magisters_terrace.h"
#include "Map.h"
#include "MotionMaster.h"
#include "ScriptedCreature.h"
#include "TemporarySummon.h"
@@ -28,11 +28,11 @@ npc_kalecgos
EndContentData */
#include "ScriptMgr.h"
#include "magisters_terrace.h"
#include "MotionMaster.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "Player.h"
#include "magisters_terrace.h"
#include "EventMap.h"
/*######
## npc_kalecgos
@@ -16,18 +16,20 @@
*/
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "Vehicle.h"
#include "ObjectMgr.h"
#include "ScriptedEscortAI.h"
#include "CombatAI.h"
#include "CreatureTextMgr.h"
#include "GameObject.h"
#include "Log.h"
#include "MotionMaster.h"
#include "MoveSplineInit.h"
#include "ObjectAccessor.h"
#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
#include "SpellInfo.h"
#include "CreatureTextMgr.h"
#include "MoveSplineInit.h"
#include "Log.h"
#include "TemporarySummon.h"
#include "Vehicle.h"
/*######
##Quest 12848
@@ -950,15 +952,10 @@ public:
std::list<TempSummon*> MinionList;
owner->GetAllMinionsByEntry(MinionList, NPC_GHOULS);
if (!MinionList.empty())
{
for (TempSummon* summon : MinionList)
{
if (summon->GetOwnerGUID() == me->GetOwnerGUID())
if (summon->IsInCombat() && summon->getAttackerForHelper())
AttackStart(summon->getAttackerForHelper());
}
}
for (TempSummon* summon : MinionList)
if (summon->GetOwnerGUID() == me->GetOwnerGUID())
if (summon->IsInCombat() && summon->getAttackerForHelper())
AttackStart(summon->getAttackerForHelper());
}
void UpdateAI(uint32 /*diff*/) override
@@ -16,11 +16,13 @@
*/
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
#include "Player.h"
#include "SpellInfo.h"
#include "CreatureTextMgr.h"
#include "GameObject.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedEscortAI.h"
#include "SpellInfo.h"
//How to win friends and influence enemies
// texts signed for creature 28939 but used for 28939, 28940, 28610
@@ -17,6 +17,8 @@
#include "ScriptMgr.h"
#include "GameObject.h"
#include "Map.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedEscortAI.h"
@@ -16,6 +16,7 @@
*/
#include "ScriptMgr.h"
#include "MotionMaster.h"
#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -29,6 +29,7 @@ EndScriptData */
#include "InstanceScript.h"
#include "LFGMgr.h"
#include "Map.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "scarlet_monastery.h"
@@ -99,7 +100,7 @@ enum Spells
SPELL_DEATH = 42566 //not correct spell
};
G3D::Vector3 const FlightPoint[]=
Position const FlightPoint[]=
{
{1754.00f, 1346.00f, 17.50f},
{1765.00f, 1347.00f, 19.00f},
@@ -124,7 +125,7 @@ G3D::Vector3 const FlightPoint[]=
{1758.00f, 1367.00f, 19.51f}
};
G3D::Vector3 const Spawn[]=
Position const Spawn[]=
{
{1776.27f, 1348.74f, 19.20f}, //spawn point for pumpkin shrine mob
{1765.28f, 1347.46f, 17.55f} //spawn point for smoke
@@ -476,7 +477,7 @@ public:
break;
case 1:
{
if (Creature* smoke = me->SummonCreature(HELPER, Spawn[1].x, Spawn[1].y, Spawn[1].z, 0, TEMPSUMMON_TIMED_DESPAWN, 20000))
if (Creature* smoke = me->SummonCreature(HELPER, Spawn[1], TEMPSUMMON_TIMED_DESPAWN, 20000))
ENSURE_AI(npc_wisp_invis::npc_wisp_invisAI, smoke->AI())->SetType(3);
DoCast(me, SPELL_RHYME_BIG);
break;
@@ -685,7 +686,7 @@ public:
{
wp_reached = false;
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MovePoint(id, FlightPoint[id].x, FlightPoint[id].y, FlightPoint[id].z);
me->GetMotionMaster()->MovePoint(id, FlightPoint[id]);
}
}
}
@@ -695,7 +696,7 @@ public:
break;
if (burn <= diff)
{
if (Creature* flame = me->SummonCreature(HELPER, Spawn[0].x, Spawn[0].y, Spawn[0].z, 0, TEMPSUMMON_TIMED_DESPAWN, 17000))
if (Creature* flame = me->SummonCreature(HELPER, Spawn[0], TEMPSUMMON_TIMED_DESPAWN, 17000))
ENSURE_AI(npc_wisp_invis::npc_wisp_invisAI, flame->AI())->SetType(2);
burned = true;
}
@@ -899,7 +900,7 @@ public:
return false;
player->AreaExploredOrEventHappens(11405);
if (Creature* horseman = go->SummonCreature(HH_MOUNTED, FlightPoint[20].x, FlightPoint[20].y, FlightPoint[20].z, 0, TEMPSUMMON_MANUAL_DESPAWN, 0))
if (Creature* horseman = go->SummonCreature(HH_MOUNTED, FlightPoint[20], TEMPSUMMON_MANUAL_DESPAWN, 0))
{
ENSURE_AI(boss_headless_horseman::boss_headless_horsemanAI, horseman->AI())->PlayerGUID = player->GetGUID();
ENSURE_AI(boss_headless_horseman::boss_headless_horsemanAI, horseman->AI())->FlyMode();
@@ -25,6 +25,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "scarlet_monastery.h"
#include "ScriptedCreature.h"
@@ -25,6 +25,7 @@ Category: Scholomance
#include "ScriptMgr.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "scholomance.h"
@@ -18,6 +18,7 @@
#include "ScriptMgr.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "MoveSplineInit.h"
#include "ObjectAccessor.h"
#include "Player.h"
@@ -162,13 +163,13 @@ class boss_kirtonos_the_herald : public CreatureScript
events.ScheduleEvent(INTRO_3, 1000);
break;
case INTRO_3:
if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetGuidData(GO_GATE_KIRTONOS)))
if (GameObject* gate = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_GATE_KIRTONOS)))
gate->SetGoState(GO_STATE_READY);
me->SetFacingTo(0.01745329f);
events.ScheduleEvent(INTRO_4, 3000);
break;
case INTRO_4:
if (GameObject* brazier = me->GetMap()->GetGameObject(instance->GetGuidData(GO_BRAZIER_OF_THE_HERALD)))
if (GameObject* brazier = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_BRAZIER_OF_THE_HERALD)))
brazier->SetGoState(GO_STATE_READY);
me->SetWalk(true);
me->SetDisableGravity(false);
@@ -34,6 +34,7 @@ EndContentData */
#include "GameObject.h"
#include "Group.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -25,6 +25,7 @@ EndScriptData */
#include "CellImpl.h"
#include "GridNotifiersImpl.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "sunwell_plateau.h"
@@ -26,6 +26,8 @@ EndScriptData */
#include "ScriptMgr.h"
#include "InstanceScript.h"
#include "Log.h"
#include "Map.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -28,6 +28,7 @@ EndScriptData */
#include "GameObject.h"
#include "InstanceScript.h"
#include "Log.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -20,6 +20,7 @@
#include "GameObject.h"
#include "InstanceScript.h"
#include "Log.h"
#include "Map.h"
#include "Player.h"
#include "sunwell_plateau.h"
@@ -30,6 +30,7 @@ EndScriptData */
#include "InstanceScript.h"
#include "Log.h"
#include "Map.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "uldaman.h"
@@ -17,7 +17,9 @@
#include "ScriptMgr.h"
#include "CreatureTextMgr.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -20,6 +20,7 @@
#include "GridNotifiers.h"
#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "MotionMaster.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
@@ -491,11 +492,7 @@ class spell_mandokir_bloodletting : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_BLOODLETTING_DAMAGE))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_BLOODLETTING_HEAL))
return false;
return true;
return ValidateSpellInfo({ SPELL_BLOODLETTING_DAMAGE, SPELL_BLOODLETTING_HEAL });
}
void HandleEffectPeriodic(AuraEffect const* aurEff)
@@ -16,6 +16,7 @@
*/
#include "ScriptMgr.h"
#include "MotionMaster.h"
#include "ScriptedCreature.h"
enum FrozenMountaineer
@@ -17,6 +17,7 @@
#include "ScriptMgr.h"
#include "CombatAI.h"
#include "MotionMaster.h"
#include "MoveSplineInit.h"
#include "ObjectAccessor.h"
#include "Player.h"
@@ -222,8 +223,7 @@ enum MilosGyro
EVENT_MILO_DESPAWN = 13
};
uint32 const pathSize = 24;
G3D::Vector3 const kharanosPath[pathSize] =
Position const kharanosPath[] =
{
{ -6247.328f, 299.5365f, 390.266f },
{ -6247.328f, 299.5365f, 390.266f },
@@ -250,6 +250,7 @@ G3D::Vector3 const kharanosPath[pathSize] =
{ -5603.897f, -466.3438f, 409.8931f },
{ -5566.957f, -472.5642f, 399.0056f }
};
size_t const pathSize = std::extent<decltype(kharanosPath)>::value;
class npc_milos_gyro : public CreatureScript
{
@@ -302,7 +303,7 @@ public:
switch (eventId)
{
case EVENT_START_PATH:
me->GetMotionMaster()->MoveSmoothPath(pathSize, kharanosPath, pathSize, false, true);
me->GetMotionMaster()->MoveSmoothPath(uint32(pathSize), kharanosPath, pathSize, false, true);
_events.ScheduleEvent(EVENT_MILO_SAY_0, Seconds(5));
break;
case EVENT_MILO_SAY_0:
@@ -28,6 +28,7 @@ npc_oox09hl
EndContentData */
#include "ScriptMgr.h"
#include "MotionMaster.h"
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
#include "Player.h"
@@ -144,8 +145,7 @@ enum Sharpbeak
SPELL_EJECT_ALL_PASSENGERS = 50630
};
uint32 const campPathSize = 12;
G3D::Vector3 const campPath[campPathSize] =
Position const campPath[] =
{
{ -75.40077f, -4037.111f, 114.6418f },
{ -68.80193f, -4034.235f, 123.6844f },
@@ -160,9 +160,9 @@ G3D::Vector3 const campPath[campPathSize] =
{ -169.123f, -3582.08f, 282.866f },
{ -241.8403f, -3625.01f, 247.4203f }
};
size_t constexpr campPathSize = std::extent<decltype(campPath)>::value;
uint32 const jinthaalorPathSize = 20;
G3D::Vector3 const jinthaalorPath[jinthaalorPathSize] =
Position const jinthaalorPath[] =
{
{ -249.4681f, -3632.487f, 232.6947f },
{ -241.606f, -3627.713f, 236.61870f },
@@ -185,6 +185,7 @@ G3D::Vector3 const jinthaalorPath[jinthaalorPathSize] =
{ -76.90625f, -4040.207f, 126.0433f },
{ -77.51563f, -4022.026f, 123.2135f }
};
size_t constexpr jinthaalorPathSize = std::extent<decltype(jinthaalorPath)>::value;
class npc_sharpbeak : public CreatureScript
{
@@ -211,11 +212,11 @@ public:
switch (me->GetEntry())
{
case NPC_SHARPBEAK_CAMP:
me->GetMotionMaster()->MoveSmoothPath(campPathSize, campPath, campPathSize, false);
me->GetMotionMaster()->MoveSmoothPath(uint32(campPathSize), campPath, campPathSize, false);
endPoint = campPathSize;
break;
case NPC_SHARPBEAK_JINTHAALOR:
me->GetMotionMaster()->MoveSmoothPath(jinthaalorPathSize, jinthaalorPath, jinthaalorPathSize, false, true);
me->GetMotionMaster()->MoveSmoothPath(uint32(jinthaalorPathSize), jinthaalorPath, jinthaalorPathSize, false, true);
endPoint = jinthaalorPathSize;
break;
}
@@ -228,8 +229,9 @@ public:
DoCast(SPELL_EJECT_ALL_PASSENGERS);
}
}
private:
uint8 endPoint;
private:
size_t endPoint;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -19,6 +19,7 @@
#include "Battlefield.h"
#include "BattlefieldMgr.h"
#include "BattlefieldTB.h"
#include "DB2Stores.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
@@ -29,6 +29,7 @@ npc_highborne_lamenter
EndContentData */
#include "ScriptMgr.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -16,6 +16,7 @@
*/
#include "ScriptMgr.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -84,10 +84,7 @@ public:
{
Initialize();
if (creature->IsSummon())
{
creature->SetHomePosition(HomePosition);
AttackPlayer();
}
instance = creature->GetInstanceScript();
}
@@ -114,28 +111,9 @@ public:
Initialize();
}
void AttackPlayer()
void IsSummonedBy(Unit*) override
{
Map::PlayerList const &PlList = me->GetMap()->GetPlayers();
if (PlList.isEmpty())
return;
for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
{
if (Player* player = i->GetSource())
{
if (player->IsGameMaster())
continue;
if (player->IsAlive())
{
me->SetInCombatWith(player);
player->SetInCombatWith(me);
me->AddThreat(player, 0.0f);
}
}
}
DoZoneInCombat();
}
void UpdateAI(uint32 diff) override
@@ -26,6 +26,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "hyjal.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
@@ -30,6 +30,7 @@ EndScriptData */
#include "hyjalAI.h"
#include "InstanceScript.h"
#include "Log.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "TemporarySummon.h"
@@ -20,6 +20,7 @@
#include "hyjal_trash.h"
#include "hyjalAI.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "TemporarySummon.h"
@@ -26,6 +26,7 @@ Script Data End */
#include "ScriptMgr.h"
#include "culling_of_stratholme.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -19,6 +19,7 @@
#include "culling_of_stratholme.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "PassiveAI.h"
#include "Player.h"
@@ -23,6 +23,7 @@
#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
#include "MotionMaster.h"
#include "TemporarySummon.h"
#include "WorldStatePackets.h"
@@ -26,6 +26,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "old_hillsbrad.h"
#include "ScriptedEscortAI.h"
@@ -72,7 +73,7 @@ enum LieutenantDrake
SPELL_FRIGHTENING_SHOUT = 33789
};
G3D::Vector3 const DrakeWP[]=
Position const DrakeWP[]=
{
{ 2125.84f, 88.2535f, 54.8830f },
{ 2111.01f, 93.8022f, 52.6356f },
@@ -156,7 +157,7 @@ public:
/// @todo make this work
if (CanPatrol && wpId == 0)
{
me->GetMotionMaster()->MovePoint(wpId, DrakeWP[wpId].x, DrakeWP[wpId].y, DrakeWP[wpId].z);
me->GetMotionMaster()->MovePoint(wpId, DrakeWP[wpId]);
++wpId;
}
@@ -31,6 +31,7 @@ EndContentData */
#include "ScriptMgr.h"
#include "InstanceScript.h"
#include "Map.h"
#include "ObjectAccessor.h"
#include "old_hillsbrad.h"
#include "Player.h"
@@ -32,6 +32,7 @@ EndContentData */
#include "ScriptMgr.h"
#include "InstanceScript.h"
#include "Log.h"
#include "Map.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -20,6 +20,8 @@
#include "DB2Stores.h"
#include "firelands.h"
#include "GridNotifiersImpl.h"
#include "MotionMaster.h"
#include "MoveSplineInit.h"
#include "ObjectAccessor.h"
#include "PassiveAI.h"
#include "ScriptedCreature.h"
@@ -19,6 +19,8 @@
#include "GridNotifiers.h"
#include "halls_of_origination.h"
#include "InstanceScript.h"
#include "Map.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -18,6 +18,7 @@
#include "ScriptMgr.h"
#include "halls_of_origination.h"
#include "InstanceScript.h"
#include "Map.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
@@ -19,6 +19,7 @@
#include "GridNotifiers.h"
#include "halls_of_origination.h"
#include "InstanceScript.h"
#include "Map.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -286,17 +287,14 @@ class spell_anhuur_shield_of_light : public SpellScriptLoader
void FilterTargets(std::list<WorldObject*>& targets)
{
if (InstanceMap* instance = GetCaster()->GetMap()->ToInstanceMap())
if (InstanceScript* const script = GetCaster()->GetInstanceScript())
{
if (InstanceScript* const script = instance->GetInstanceScript())
if (GameObject* go = ObjectAccessor::GetGameObject(*GetCaster(), script->GetGuidData(DATA_ANHUUR_DOOR)))
{
if (GameObject* go = ObjectAccessor::GetGameObject(*GetCaster(), script->GetGuidData(DATA_ANHUUR_DOOR)))
{
targets.remove_if(Trinity::HeightDifferenceCheck(go, 5.0f, false));
targets.remove(GetCaster());
targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster()));
targets.resize(2);
}
targets.remove_if(Trinity::HeightDifferenceCheck(go, 5.0f, false));
targets.remove(GetCaster());
targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster()));
targets.resize(2);
}
}
}
@@ -329,10 +327,9 @@ class spell_anhuur_disable_beacon_beams : public SpellScriptLoader
void Notify(SpellEffIndex /*index*/)
{
if (InstanceMap* instance = GetCaster()->GetMap()->ToInstanceMap())
if (InstanceScript* const script = instance->GetInstanceScript())
if (Creature* anhuur = instance->GetCreature(script->GetGuidData(DATA_ANHUUR_GUID)))
anhuur->AI()->DoAction(ACTION_DISABLE_BEACON);
if (InstanceScript* const script = GetCaster()->GetInstanceScript())
if (Creature* anhuur = ObjectAccessor::GetCreature(*GetCaster(), script->GetGuidData(DATA_ANHUUR_GUID)))
anhuur->AI()->DoAction(ACTION_DISABLE_BEACON);
}
void Register() override

Some files were not shown because too many files have changed in this diff Show More