diff options
Diffstat (limited to 'src')
71 files changed, 779 insertions, 693 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 07c75eb424f..dd8b42deb9f 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -252,15 +252,13 @@ Creature* CreatureAI::DoSummon(uint32 entry, const Position& pos, uint32 despawn Creature* CreatureAI::DoSummon(uint32 entry, WorldObject* obj, float radius, uint32 despawnTime, TempSummonType summonType) { - Position pos; - obj->GetRandomNearPosition(pos, radius); + Position pos = obj->GetRandomNearPosition(radius); return me->SummonCreature(entry, pos, summonType, despawnTime); } Creature* CreatureAI::DoSummonFlyer(uint32 entry, WorldObject* obj, float flightZ, float radius, uint32 despawnTime, TempSummonType summonType) { - Position pos; - obj->GetRandomNearPosition(pos, radius); + Position pos = obj->GetRandomNearPosition(radius); pos.m_positionZ += flightZ; return me->SummonCreature(entry, pos, summonType, despawnTime); } diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 3b055cabbfa..521f39171af 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -47,7 +47,7 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c) me->SetWalk(false); mRun = false; - me->GetPosition(&mLastOOCPos); + mLastOOCPos = me->GetPosition(); mCanAutoAttack = true; mCanCombatMove = true; @@ -132,7 +132,7 @@ void SmartAI::StartPath(bool run, uint32 path, bool repeat, Unit* /*invoker*/) if (WayPoint* wp = GetNextWayPoint()) { - me->GetPosition(&mLastOOCPos); + mLastOOCPos = me->GetPosition(); me->GetMotionMaster()->MovePoint(wp->id, wp->x, wp->y, wp->z); GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, NULL, wp->id, GetScript()->GetPathId()); } @@ -162,7 +162,7 @@ void SmartAI::PausePath(uint32 delay, bool forced) return; } mForcedPaused = forced; - me->GetPosition(&mLastOOCPos); + mLastOOCPos = me->GetPosition(); AddEscortState(SMART_ESCORT_PAUSED); mWPPauseTimer = delay; if (forced) @@ -184,7 +184,7 @@ void SmartAI::StopPath(uint32 DespawnTime, uint32 quest, bool fail) SetDespawnTime(DespawnTime); //mDespawnTime = DespawnTime; - me->GetPosition(&mLastOOCPos); + mLastOOCPos = me->GetPosition(); me->StopMoving();//force stop me->GetMotionMaster()->MoveIdle(); GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_STOPPED, NULL, mLastWP->id, GetScript()->GetPathId()); @@ -572,7 +572,7 @@ void SmartAI::EnterCombat(Unit* enemy) { me->InterruptNonMeleeSpells(false); // must be before ProcessEvents GetScript()->ProcessEventsFor(SMART_EVENT_AGGRO, enemy); - me->GetPosition(&mLastOOCPos); + mLastOOCPos = me->GetPosition(); SetRun(mRun); if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_ACTIVE) == POINT_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 92007a16569..a0e516ca819 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -42,18 +42,13 @@ class BroadcastTextBuilder { public: BroadcastTextBuilder(WorldObject const* obj, ChatMsg msgtype, uint32 id, WorldObject const* target, uint32 gender = GENDER_MALE) - : _source(obj), _msgType(msgtype), _textId(id), _target(target), _gender(gender) - { - } + : _source(obj), _msgType(msgtype), _textId(id), _target(target), _gender(gender) { } size_t operator()(WorldPacket* data, LocaleConstant locale) const { BroadcastText const* bct = sObjectMgr->GetBroadcastText(_textId); - std::string text = ""; - if (bct) - ObjectMgr::GetLocaleString(_gender == GENDER_MALE ? bct->MaleText : bct->FemaleText, locale, text); - return ChatHandler::BuildChatPacket(*data, _msgType, bct ? Language(bct->Language) : LANG_UNIVERSAL, _source, _target, text, 0, "", locale); + return ChatHandler::BuildChatPacket(*data, _msgType, bct ? Language(bct->Language) : LANG_UNIVERSAL, _source, _target, bct ? bct->GetText(locale, _gender) : "", 0, "", locale); } WorldObject const* _source; diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index 9b84d7ddb7d..9ce1f9bb67a 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -517,7 +517,7 @@ enum RBACPermissions RBAC_PERM_COMMAND_RELOAD_ALL = 611, RBAC_PERM_COMMAND_RELOAD_ALL_ACHIEVEMENT = 612, RBAC_PERM_COMMAND_RELOAD_ALL_AREA = 613, - RBAC_PERM_UNUSED_614 = 614, // unused + RBAC_PERM_COMMAND_RELOAD_BROADCAST_TEXT = 614, RBAC_PERM_COMMAND_RELOAD_ALL_GOSSIP = 615, RBAC_PERM_COMMAND_RELOAD_ALL_ITEM = 616, RBAC_PERM_COMMAND_RELOAD_ALL_LOCALES = 617, diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 5c7a4eb77b7..302adda0c8e 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -52,12 +52,9 @@ namespace Trinity void operator()(WorldPacket& data, LocaleConstant locale) { - std::string text = ""; BroadcastText const* bct = sObjectMgr->GetBroadcastText(_textId); - if (bct) - ObjectMgr::GetLocaleString(_player->getGender() == GENDER_MALE ? bct->MaleText : bct->FemaleText, locale, text); - ChatHandler::BuildChatPacket(data, _msgType, LANG_UNIVERSAL, _player, _player, text, _achievementId); + ChatHandler::BuildChatPacket(data, _msgType, bct ? Language(bct->Language) : LANG_UNIVERSAL, _player, _player, bct ? bct->GetText(locale, _player->getGender()) : "", _achievementId); } private: @@ -66,7 +63,7 @@ namespace Trinity int32 _textId; uint32 _achievementId; }; -} // namespace Trinity +} // namespace Trinity bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) { diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index 7ec5a09508a..5555f2a824c 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -156,8 +156,7 @@ bool BattlefieldWG::SetupBattlefield() // Spawn turrets and hide them per default for (uint8 i = 0; i < WG_MAX_TURRET; i++) { - Position towerCannonPos; - WGTurret[i].GetPosition(&towerCannonPos); + Position towerCannonPos = WGTurret[i].GetPosition(); if (Creature* creature = SpawnCreature(NPC_WINTERGRASP_TOWER_CANNON, towerCannonPos, TEAM_ALLIANCE)) { CanonList.insert(creature->GetGUID()); diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index c54d8915a33..3a64458c48b 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -1309,8 +1309,7 @@ struct BfWGGameObjectBuilding // Spawn Turret bottom for (uint8 i = 0; i < TowerCannon[towerid].nbTowerCannonBottom; i++) { - Position turretPos; - TowerCannon[towerid].TowerCannonBottom[i].GetPosition(&turretPos); + Position turretPos = TowerCannon[towerid].TowerCannonBottom[i].GetPosition(); if (Creature* turret = m_WG->SpawnCreature(NPC_WINTERGRASP_TOWER_CANNON, turretPos, TEAM_ALLIANCE)) { m_TowerCannonBottomList.insert(turret->GetGUID()); @@ -1335,8 +1334,7 @@ struct BfWGGameObjectBuilding // Spawn Turret top for (uint8 i = 0; i < TowerCannon[towerid].nbTurretTop; i++) { - Position towerCannonPos; - TowerCannon[towerid].TurretTop[i].GetPosition(&towerCannonPos); + Position towerCannonPos = TowerCannon[towerid].TurretTop[i].GetPosition(); if (Creature* turret = m_WG->SpawnCreature(NPC_WINTERGRASP_TOWER_CANNON, towerCannonPos, TeamId(0))) { m_TurretTopList.insert(turret->GetGUID()); diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index c4aa3ef4481..bd95004e390 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -21,6 +21,7 @@ #include "Battleground.h" #include "BattlegroundMgr.h" #include "Creature.h" +#include "CreatureTextMgr.h" #include "Chat.h" #include "Formulas.h" #include "GridNotifiersImpl.h" @@ -100,13 +101,13 @@ namespace Trinity int32 _arg1; int32 _arg2; }; -} // namespace Trinity +} // namespace Trinity template<class Do> void Battleground::BroadcastWorker(Do& _do) { for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) - if (Player* player = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER))) + if (Player* player = _GetPlayer(itr, "BroadcastWorker")) _do(player); } @@ -300,12 +301,11 @@ inline void Battleground::_CheckSafePositions(uint32 diff) { m_ValidStartPositionTimer = 0; - Position pos; float x, y, z, o; for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) if (Player* player = ObjectAccessor::FindPlayer(itr->first)) { - player->GetPosition(&pos); + Position pos = player->GetPosition(); GetTeamStartLoc(player->GetBGTeam(), x, y, z, o); if (pos.GetExactDistSq(x, y, z) > maxDist) { @@ -643,6 +643,11 @@ void Battleground::SendPacketToTeam(uint32 TeamID, WorldPacket* packet, Player* } } +void Battleground::SendChatMessage(Creature* source, uint8 textId, WorldObject* target /*= NULL*/) +{ + sCreatureTextMgr->SendChat(source, textId, target, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP); +} + void Battleground::PlaySoundToAll(uint32 SoundID) { WorldPacket data; @@ -1453,8 +1458,6 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, GetBgMap(), PHASEMASK_NORMAL, x, y, z, o, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY)) { - TC_LOG_ERROR("sql.sql", "Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!", - entry, m_MapId, m_InstanceID); TC_LOG_ERROR("bg.battleground", "Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!", entry, m_MapId, m_InstanceID); delete go; @@ -1492,6 +1495,11 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float return true; } +bool Battleground::AddObject(uint32 type, uint32 entry, Position const& pos, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime /*= 0*/) +{ + return AddObject(type, entry, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), rotation0, rotation1, rotation2, rotation3, respawnTime); +} + // Some doors aren't despawned so we cannot handle their closing in gameobject::update() // It would be nice to correctly implement GO_ACTIVATED state and open/close doors in gameobject code void Battleground::DoorClose(uint32 type) @@ -1611,7 +1619,12 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f if (respawntime) creature->SetRespawnDelay(respawntime); - return creature; + return creature; +} + +Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, Position const& pos, uint32 respawntime /*= 0*/) +{ + return AddCreature(entry, type, teamval, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), respawntime); } bool Battleground::DelCreature(uint32 type) @@ -1708,7 +1721,7 @@ void Battleground::SendWarningToAll(int32 entry, ...) std::map<uint32, WorldPacket> localizedPackets; for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) - if (Player* player = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER))) + if (Player* player = _GetPlayer(itr, "SendWarningToAll")) { if (localizedPackets.find(player->GetSession()->GetSessionDbLocaleIndex()) == localizedPackets.end()) { diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index 5e2aa4b2316..26f91650a22 100644 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -28,9 +28,11 @@ class GameObject; class Group; class Player; class Unit; +class WorldObject; class WorldPacket; class BattlegroundMap; +struct Position; struct PvPDifficultyEntry; struct WorldSafeLocsEntry; @@ -414,6 +416,8 @@ class Battleground void SendPacketToAll(WorldPacket* packet); void YellToAll(Creature* creature, const char* text, uint32 language); + void SendChatMessage(Creature* source, uint8 textId, WorldObject* target = NULL); + template<class Do> void BroadcastWorker(Do& _do); @@ -478,8 +482,7 @@ class Battleground virtual void EventPlayerClickedOnFlag(Player* /*player*/, GameObject* /*target_obj*/) { } void EventPlayerLoggedIn(Player* player); void EventPlayerLoggedOut(Player* player); - virtual void EventPlayerDamagedGO(Player* /*player*/, GameObject* /*go*/, uint32 /*eventType*/) { } - virtual void EventPlayerUsedGO(Player* /*player*/, GameObject* /*go*/){ } + virtual void ProcessEvent(WorldObject* /*obj*/, uint32 /*eventId*/, WorldObject* /*invoker*/ = NULL) { } // this function can be used by spell to interact with the BG map virtual void DoAction(uint32 /*action*/, uint64 /*var*/) { } @@ -506,7 +509,9 @@ class Battleground BGCreatures BgCreatures; void SpawnBGObject(uint32 type, uint32 respawntime); bool AddObject(uint32 type, uint32 entry, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime = 0); + bool AddObject(uint32 type, uint32 entry, Position const& pos, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime = 0); Creature* AddCreature(uint32 entry, uint32 type, uint32 teamval, float x, float y, float z, float o, uint32 respawntime = 0); + Creature* AddCreature(uint32 entry, uint32 type, uint32 teamval, Position const& pos, uint32 respawntime = 0); bool DelCreature(uint32 type); bool DelObject(uint32 type); bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, uint32 team); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index fc3f839ae76..7940aaf0585 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -842,8 +842,6 @@ void BattlegroundIC::DestroyGate(Player* player, GameObject* go) SendMessage2ToAll(lang_entry, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL, (player->GetTeamId() == TEAM_ALLIANCE ? LANG_BG_IC_HORDE_KEEP : LANG_BG_IC_ALLIANCE_KEEP)); } -void BattlegroundIC::EventPlayerDamagedGO(Player* /*player*/, GameObject* /*go*/, uint32 /*eventType*/) { } - WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveYard(Player* player) { TeamId teamIndex = GetTeamIndexByTeamId(player->GetTeam()); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h index 5238342ffcb..9bed8cdc2cd 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h @@ -876,7 +876,6 @@ class BattlegroundIC : public Battleground void EndBattleground(uint32 winner); void EventPlayerClickedOnFlag(Player* source, GameObject* /*target_obj*/); - void EventPlayerDamagedGO(Player* /*player*/, GameObject* go, uint32 eventType); void DestroyGate(Player* player, GameObject* go); WorldSafeLocsEntry const* GetClosestGraveYard(Player* player); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index 126077f7988..81b8f725e80 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -17,10 +17,11 @@ */ #include "BattlegroundSA.h" -#include "Language.h" -#include "Player.h" #include "GameObject.h" +#include "Language.h" #include "ObjectMgr.h" +#include "Player.h" +#include "ScriptedCreature.h" #include "WorldPacket.h" #include "WorldSession.h" @@ -29,7 +30,8 @@ BattlegroundSA::BattlegroundSA() StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_SA_START_TWO_MINUTES; StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_SA_START_ONE_MINUTE; StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_SA_START_HALF_MINUTE; - StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_SA_HAS_BEGUN; + StartMessageIds[BG_STARTING_EVENT_FOURTH] = 0; + BgObjects.resize(BG_SA_MAXOBJ); BgCreatures.resize(BG_SA_MAXNPC + BG_SA_MAX_GY); TimerEnabled = false; @@ -37,14 +39,14 @@ BattlegroundSA::BattlegroundSA() SignaledRoundTwo = false; SignaledRoundTwoHalfMin = false; InitSecondRound = false; - gateDestroyed = false; + _gateDestroyed = false; Attackers = TEAM_ALLIANCE; TotalTime = 0; EndRoundTimer = 0; ShipsStarted = false; - Status = BG_SA_NOTSTARTED; + Status = BG_SA_NOT_STARTED; - for (uint8 i = 0; i < 6; i++) + for (uint8 i = 0; i < MAX_GATES; ++i) GateStatus[i] = BG_SA_GATE_OK; for (uint8 i = 0; i < 2; i++) @@ -69,7 +71,7 @@ void BattlegroundSA::Reset() for (uint8 i = 0; i <= 5; i++) GateStatus[i] = BG_SA_GATE_OK; ShipsStarted = false; - gateDestroyed = false; + _gateDestroyed = false; _allVehiclesAlive[TEAM_ALLIANCE] = true; _allVehiclesAlive[TEAM_HORDE] = true; Status = BG_SA_WARMUP; @@ -101,9 +103,11 @@ bool BattlegroundSA::ResetObjs() for (uint8 i = 0; i < 6; i++) GateStatus[i] = BG_SA_GATE_OK; + AddCreature(BG_SA_NpcEntries[BG_SA_NPC_KANRETHAD], BG_SA_NPC_KANRETHAD, 0, BG_SA_NpcSpawnlocs[BG_SA_NPC_KANRETHAD]); + for (uint8 i = 0; i <= BG_SA_PORTAL_DEFFENDER_RED; i++) { - if (!AddObject(i, BG_SA_ObjEntries[i], BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1], BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3], 0, 0, 0, 0, RESPAWN_ONE_DAY)) + if (!AddObject(i, BG_SA_ObjEntries[i], BG_SA_ObjSpawnlocs[i], 0, 0, 0, 0, RESPAWN_ONE_DAY)) return false; } @@ -121,20 +125,17 @@ bool BattlegroundSA::ResetObjs() default: break; } - if (!AddObject(i, boatid, BG_SA_ObjSpawnlocs[i][0], - BG_SA_ObjSpawnlocs[i][1], - BG_SA_ObjSpawnlocs[i][2]+(Attackers ? -3.750f: 0), - BG_SA_ObjSpawnlocs[i][3], 0, 0, 0, 0, RESPAWN_ONE_DAY)) + if (!AddObject(i, boatid, BG_SA_ObjSpawnlocs[i].GetPositionX(), + BG_SA_ObjSpawnlocs[i].GetPositionY(), + BG_SA_ObjSpawnlocs[i].GetPositionZ() + (Attackers ? -3.750f: 0), + BG_SA_ObjSpawnlocs[i].GetOrientation(), 0, 0, 0, 0, RESPAWN_ONE_DAY)) return false; } for (uint8 i = BG_SA_SIGIL_1; i <= BG_SA_LEFT_FLAGPOLE; i++) { - if (!AddObject(i, BG_SA_ObjEntries[i], - BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1], - BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3], - 0, 0, 0, 0, RESPAWN_ONE_DAY)) - return false; + if (!AddObject(i, BG_SA_ObjEntries[i], BG_SA_ObjSpawnlocs[i], 0, 0, 0, 0, RESPAWN_ONE_DAY)) + return false; } // MAD props for Kiper for discovering those values - 4 hours of his work. @@ -147,10 +148,8 @@ bool BattlegroundSA::ResetObjs() //By capturing GYs. for (uint8 i = 0; i < BG_SA_DEMOLISHER_5; i++) { - if (!AddCreature(BG_SA_NpcEntries[i], i, (Attackers == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE), - BG_SA_NpcSpawnlocs[i][0], BG_SA_NpcSpawnlocs[i][1], - BG_SA_NpcSpawnlocs[i][2], BG_SA_NpcSpawnlocs[i][3], 600)) - return false; + if (!AddCreature(BG_SA_NpcEntries[i], i, (Attackers == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE), BG_SA_NpcSpawnlocs[i], 600)) + return false; } OverrideGunFaction(); @@ -159,10 +158,10 @@ bool BattlegroundSA::ResetObjs() for (uint8 i = 0; i <= BG_SA_PORTAL_DEFFENDER_RED; i++) { SpawnBGObject(i, RESPAWN_IMMEDIATELY); - GetBGObject(i)->SetUInt32Value(GAMEOBJECT_FACTION, defF); + GetBGObject(i)->SetFaction(defF); } - GetBGObject(BG_SA_TITAN_RELIC)->SetUInt32Value(GAMEOBJECT_FACTION, atF); + GetBGObject(BG_SA_TITAN_RELIC)->SetFaction(atF); GetBGObject(BG_SA_TITAN_RELIC)->Refresh(); for (uint8 i = 0; i <= 5; i++) @@ -199,20 +198,14 @@ bool BattlegroundSA::ResetObjs() //GY capture points for (uint8 i = BG_SA_CENTRAL_FLAG; i <= BG_SA_LEFT_FLAG; i++) { - AddObject(i, (BG_SA_ObjEntries[i] - (Attackers == TEAM_ALLIANCE ? 1 : 0)), - BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1], - BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3], - 0, 0, 0, 0, RESPAWN_ONE_DAY); - GetBGObject(i)->SetUInt32Value(GAMEOBJECT_FACTION, atF); + AddObject(i, (BG_SA_ObjEntries[i] - (Attackers == TEAM_ALLIANCE ? 1 : 0)), BG_SA_ObjSpawnlocs[i], 0, 0, 0, 0, RESPAWN_ONE_DAY); + GetBGObject(i)->SetFaction(atF); } for (uint8 i = BG_SA_BOMB; i < BG_SA_MAXOBJ; i++) { - AddObject(i, BG_SA_ObjEntries[BG_SA_BOMB], - BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1], - BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3], - 0, 0, 0, 0, RESPAWN_ONE_DAY); - GetBGObject(i)->SetUInt32Value(GAMEOBJECT_FACTION, atF); + AddObject(i, BG_SA_ObjEntries[BG_SA_BOMB], BG_SA_ObjSpawnlocs[i], 0, 0, 0, 0, RESPAWN_ONE_DAY); + GetBGObject(i)->SetFaction(atF); } //Player may enter BEFORE we set up BG - lets update his worldstates anyway... @@ -316,11 +309,14 @@ void BattlegroundSA::PostUpdateImpl(uint32 diff) } TotalTime += diff; - if (Status == BG_SA_WARMUP ) + if (Status == BG_SA_WARMUP) { EndRoundTimer = BG_SA_ROUNDLENGTH; if (TotalTime >= BG_SA_WARMUPLENGTH) { + if (Creature* c = GetBGCreature(BG_SA_NPC_KANRETHAD)) + SendChatMessage(c, TEXT_ROUND_STARTED); + TotalTime = 0; ToggleTimer(); DemolisherStartState(false); @@ -340,7 +336,9 @@ void BattlegroundSA::PostUpdateImpl(uint32 diff) if (TotalTime >= 60000) { - SendWarningToAll(LANG_BG_SA_HAS_BEGUN); + if (Creature* c = GetBGCreature(BG_SA_NPC_KANRETHAD)) + SendChatMessage(c, TEXT_ROUND_STARTED); + TotalTime = 0; ToggleTimer(); DemolisherStartState(false); @@ -380,6 +378,9 @@ void BattlegroundSA::PostUpdateImpl(uint32 diff) InitSecondRound = true; ToggleTimer(); ResetObjs(); + GetBgMap()->UpdateAreaDependentAuras(); + CastSpellOnTeam(SPELL_END_OF_ROUND, ALLIANCE); + CastSpellOnTeam(SPELL_END_OF_ROUND, HORDE); return; } } @@ -412,42 +413,42 @@ void BattlegroundSA::StartingEventOpenDoors() { } void BattlegroundSA::FillInitialWorldStates(WorldPacket& data) { - uint32 ally_attacks = uint32(Attackers == TEAM_ALLIANCE ? 1 : 0); - uint32 horde_attacks = uint32(Attackers == TEAM_HORDE ? 1 : 0); - - data << uint32(BG_SA_ANCIENT_GATEWS) << uint32(GateStatus[BG_SA_ANCIENT_GATE]); - data << uint32(BG_SA_YELLOW_GATEWS) << uint32(GateStatus[BG_SA_YELLOW_GATE]); - data << uint32(BG_SA_GREEN_GATEWS) << uint32(GateStatus[BG_SA_GREEN_GATE]); - data << uint32(BG_SA_BLUE_GATEWS) << uint32(GateStatus[BG_SA_BLUE_GATE]); - data << uint32(BG_SA_RED_GATEWS) << uint32(GateStatus[BG_SA_RED_GATE]); - data << uint32(BG_SA_PURPLE_GATEWS) << uint32(GateStatus[BG_SA_PURPLE_GATE]); - - data << uint32(BG_SA_BONUS_TIMER) << uint32(0); - - data << uint32(BG_SA_HORDE_ATTACKS) << horde_attacks; - data << uint32(BG_SA_ALLY_ATTACKS) << ally_attacks; - - //Time will be sent on first update... - data << uint32(BG_SA_ENABLE_TIMER) << ((TimerEnabled) ? uint32(1) : uint32(0)); - data << uint32(BG_SA_TIMER_MINS) << uint32(0); - data << uint32(BG_SA_TIMER_SEC_TENS) << uint32(0); - data << uint32(BG_SA_TIMER_SEC_DECS) << uint32(0); - - data << uint32(BG_SA_RIGHT_GY_HORDE) << uint32(GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0); - data << uint32(BG_SA_LEFT_GY_HORDE) << uint32(GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0); - data << uint32(BG_SA_CENTER_GY_HORDE) << uint32(GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0); - - data << uint32(BG_SA_RIGHT_GY_ALLIANCE) << uint32(GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0); - data << uint32(BG_SA_LEFT_GY_ALLIANCE) << uint32(GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0); - data << uint32(BG_SA_CENTER_GY_ALLIANCE) << uint32(GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0); - - data << uint32(BG_SA_HORDE_DEFENCE_TOKEN) << ally_attacks; - data << uint32(BG_SA_ALLIANCE_DEFENCE_TOKEN) << horde_attacks; - - data << uint32(BG_SA_LEFT_ATT_TOKEN_HRD) << horde_attacks; - data << uint32(BG_SA_RIGHT_ATT_TOKEN_HRD) << horde_attacks; - data << uint32(BG_SA_RIGHT_ATT_TOKEN_ALL) << ally_attacks; - data << uint32(BG_SA_LEFT_ATT_TOKEN_ALL) << ally_attacks; + bool allyAttacks = Attackers == TEAM_ALLIANCE; + bool hordeAttacks = Attackers == TEAM_HORDE; + + data << uint32(BG_SA_ANCIENT_GATEWS) << uint32(GateStatus[BG_SA_ANCIENT_GATE]); + data << uint32(BG_SA_YELLOW_GATEWS) << uint32(GateStatus[BG_SA_YELLOW_GATE]); + data << uint32(BG_SA_GREEN_GATEWS) << uint32(GateStatus[BG_SA_GREEN_GATE]); + data << uint32(BG_SA_BLUE_GATEWS) << uint32(GateStatus[BG_SA_BLUE_GATE]); + data << uint32(BG_SA_RED_GATEWS) << uint32(GateStatus[BG_SA_RED_GATE]); + data << uint32(BG_SA_PURPLE_GATEWS) << uint32(GateStatus[BG_SA_PURPLE_GATE]); + + data << uint32(BG_SA_BONUS_TIMER) << uint32(0); + + data << uint32(BG_SA_HORDE_ATTACKS) << uint32(hordeAttacks); + data << uint32(BG_SA_ALLY_ATTACKS) << uint32(allyAttacks); + + // Time will be sent on first update... + data << uint32(BG_SA_ENABLE_TIMER) << uint32(TimerEnabled); + data << uint32(BG_SA_TIMER_MINS) << uint32(0); + data << uint32(BG_SA_TIMER_SEC_TENS) << uint32(0); + data << uint32(BG_SA_TIMER_SEC_DECS) << uint32(0); + + data << uint32(BG_SA_RIGHT_GY_HORDE) << uint32(GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_HORDE); + data << uint32(BG_SA_LEFT_GY_HORDE) << uint32(GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_HORDE); + data << uint32(BG_SA_CENTER_GY_HORDE) << uint32(GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_HORDE); + + data << uint32(BG_SA_RIGHT_GY_ALLIANCE) << uint32(GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_ALLIANCE); + data << uint32(BG_SA_LEFT_GY_ALLIANCE) << uint32(GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_ALLIANCE); + data << uint32(BG_SA_CENTER_GY_ALLIANCE) << uint32(GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_ALLIANCE); + + data << uint32(BG_SA_HORDE_DEFENCE_TOKEN) << uint32(allyAttacks); + data << uint32(BG_SA_ALLIANCE_DEFENCE_TOKEN) << uint32(hordeAttacks); + + data << uint32(BG_SA_LEFT_ATT_TOKEN_HRD) << uint32(hordeAttacks); + data << uint32(BG_SA_RIGHT_ATT_TOKEN_HRD) << uint32(hordeAttacks); + data << uint32(BG_SA_RIGHT_ATT_TOKEN_ALL) << uint32(allyAttacks); + data << uint32(BG_SA_LEFT_ATT_TOKEN_ALL) << uint32(allyAttacks); } void BattlegroundSA::AddPlayer(Player* player) @@ -455,12 +456,15 @@ void BattlegroundSA::AddPlayer(Player* player) Battleground::AddPlayer(player); //create score and add it to map, default values are set in constructor BattlegroundSAScore* sc = new BattlegroundSAScore; + PlayerScores[player->GetGUID()] = sc; + + SendTransportInit(player); if (!ShipsStarted) { if (player->GetTeamId() == Attackers) { - player->CastSpell(player, 12438, true);//Without this player falls before boat loads... + player->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); if (urand(0, 1)) player->TeleportTo(607, 2682.936f, -830.368f, 15.0f, 2.895f, 0); @@ -478,8 +482,6 @@ void BattlegroundSA::AddPlayer(Player* player) else player->TeleportTo(607, 1209.7f, -65.16f, 70.1f, 0.0f, 0); } - SendTransportInit(player); - PlayerScores[player->GetGUID()] = sc; } void BattlegroundSA::RemovePlayer(Player* /*player*/, uint64 /*guid*/, uint32 /*team*/) { } @@ -530,7 +532,7 @@ void BattlegroundSA::TeleportPlayers() if (player->GetTeamId() == Attackers) { - player->CastSpell(player, 12438, true); //Without this player falls before boat loads... + player->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); if (urand(0, 1)) player->TeleportTo(607, 2682.936f, -830.368f, 15.0f, 2.895f, 0); @@ -543,30 +545,91 @@ void BattlegroundSA::TeleportPlayers() } } -void BattlegroundSA::EventPlayerDamagedGO(Player* /*player*/, GameObject* go, uint32 eventType) +void BattlegroundSA::ProcessEvent(WorldObject* obj, uint32 eventId, WorldObject* invoker /*= NULL*/) { - if (!go || !go->GetGOInfo()) - return; - - if (eventType == go->GetGOInfo()->building.damagedEvent) + if (GameObject* go = obj->ToGameObject()) { - uint32 i = getGateIdFromDamagedOrDestroyEventId(eventType); - GateStatus[i] = BG_SA_GATE_DAMAGED; - uint32 uws = getWorldStateFromGateId(i); - if (uws) - UpdateWorldState(uws, GateStatus[i]); - } + switch (go->GetGoType()) + { + case GAMEOBJECT_TYPE_GOOBER: + if (eventId == BG_SA_EVENT_TITAN_RELIC_ACTIVATED) + TitanRelicActivated(invoker->ToPlayer()); + break; + case GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING: + { + if (GateInfo const* gate = GetGate(obj->GetEntry())) + { + uint8 gateId = gate->GateId; - if (eventType == go->GetGOInfo()->building.destroyedEvent) - { - if (go->GetGOInfo()->building.destroyedEvent == BG_SA_EVENT_ANCIENT_GATE_DESTROYED) - SendWarningToAll(LANG_BG_SA_CHAMBER_BREACHED); - else - SendWarningToAll(LANG_BG_SA_WAS_DESTROYED, go->GetGOInfo()->name.c_str()); - } + // damaged + if (eventId == go->GetGOInfo()->building.damagedEvent) + { + GateStatus[gateId] = BG_SA_GATE_DAMAGED; + + if (Creature* c = obj->FindNearestCreature(NPC_WORLD_TRIGGER, 500.0f)) + SendChatMessage(c, gate->DamagedText, invoker); + + PlaySoundToAll(Attackers == TEAM_ALLIANCE ? SOUND_WALL_ATTACKED_ALLIANCE : SOUND_WALL_ATTACKED_HORDE); + } + // destroyed + else if (eventId == go->GetGOInfo()->building.destroyedEvent) + { + GateStatus[gate->GateId] = BG_SA_GATE_DESTROYED; + _gateDestroyed = true; + + bool rewardHonor = true; + + switch (gateId) + { + case BG_SA_GREEN_GATE: + if (GateStatus[BG_SA_BLUE_GATE] == BG_SA_GATE_DESTROYED) + rewardHonor = false; + break; + case BG_SA_BLUE_GATE: + if (GateStatus[BG_SA_GREEN_GATE] == BG_SA_GATE_DESTROYED) + rewardHonor = false; + break; + case BG_SA_RED_GATE: + if (GateStatus[BG_SA_PURPLE_GATE] == BG_SA_GATE_DESTROYED) + rewardHonor = false; + break; + case BG_SA_PURPLE_GATE: + if (GateStatus[BG_SA_RED_GATE] == BG_SA_GATE_DESTROYED) + rewardHonor = false; + break; + default: + break; + } + + if (gateId < 5) + DelObject(gateId + 14); + + if (Unit* unit = invoker->ToUnit()) + { + if (Player* player = unit->GetCharmerOrOwnerPlayerOrPlayerItself()) + { + UpdatePlayerScore(player, SCORE_DESTROYED_WALL, 1); + if (rewardHonor) + UpdatePlayerScore(player, SCORE_BONUS_HONOR, GetBonusHonorFromKill(1)); + } + } + + if (Creature* c = obj->FindNearestCreature(NPC_WORLD_TRIGGER, 500.0f)) + SendChatMessage(c, gate->DestroyedText, invoker); + + PlaySoundToAll(Attackers == TEAM_ALLIANCE ? SOUND_WALL_DESTROYED_ALLIANCE : SOUND_WALL_DESTROYED_HORDE); + } + else + break; - if (eventType == go->GetGOInfo()->building.damageEvent) - SendWarningToAll(LANG_BG_SA_IS_UNDER_ATTACK, go->GetGOInfo()->name.c_str()); + UpdateWorldState(gate->WorldState, GateStatus[gateId]); + } + break; + } + default: + break; + } + } } void BattlegroundSA::HandleKillUnit(Creature* creature, Player* killer) @@ -620,49 +683,6 @@ void BattlegroundSA::DemolisherStartState(bool start) void BattlegroundSA::DestroyGate(Player* player, GameObject* go) { - uint32 i = getGateIdFromDamagedOrDestroyEventId(go->GetGOInfo()->building.destroyedEvent); - if (!GateStatus[i]) - return; - - if (GameObject* g = GetBGObject(i)) - { - if (g->GetGOValue()->Building.Health == 0) - { - GateStatus[i] = BG_SA_GATE_DESTROYED; - uint32 uws = getWorldStateFromGateId(i); - if (uws) - UpdateWorldState(uws, GateStatus[i]); - bool rewardHonor = true; - gateDestroyed = true; - switch (i) - { - case BG_SA_GREEN_GATE: - if (GateStatus[BG_SA_BLUE_GATE] == BG_SA_GATE_DESTROYED) - rewardHonor = false; - break; - case BG_SA_BLUE_GATE: - if (GateStatus[BG_SA_GREEN_GATE] == BG_SA_GATE_DESTROYED) - rewardHonor = false; - break; - case BG_SA_RED_GATE: - if (GateStatus[BG_SA_PURPLE_GATE] == BG_SA_GATE_DESTROYED) - rewardHonor = false; - break; - case BG_SA_PURPLE_GATE: - if (GateStatus[BG_SA_RED_GATE] == BG_SA_GATE_DESTROYED) - rewardHonor = false; - break; - default: - break; - } - - if (i < 5) - DelObject(i + 14); - UpdatePlayerScore(player, SCORE_DESTROYED_WALL, 1); - if (rewardHonor) - UpdatePlayerScore(player, SCORE_BONUS_HONOR, GetBonusHonorFromKill(1)); - } - } } WorldSafeLocsEntry const* BattlegroundSA::GetClosestGraveYard(Player* player) @@ -708,24 +728,24 @@ void BattlegroundSA::SendTime() UpdateWorldState(BG_SA_TIMER_SEC_DECS, ((end_of_round%60000)%10000)/1000); } -void BattlegroundSA::EventPlayerClickedOnFlag(Player* Source, GameObject* target_obj) +void BattlegroundSA::EventPlayerClickedOnFlag(Player* source, GameObject* go) { - switch (target_obj->GetEntry()) + switch (go->GetEntry()) { case 191307: case 191308: if (GateStatus[BG_SA_GREEN_GATE] == BG_SA_GATE_DESTROYED || GateStatus[BG_SA_BLUE_GATE] == BG_SA_GATE_DESTROYED) - CaptureGraveyard(BG_SA_LEFT_CAPTURABLE_GY, Source); + CaptureGraveyard(BG_SA_LEFT_CAPTURABLE_GY, source); break; case 191305: case 191306: if (GateStatus[BG_SA_GREEN_GATE] == BG_SA_GATE_DESTROYED || GateStatus[BG_SA_BLUE_GATE] == BG_SA_GATE_DESTROYED) - CaptureGraveyard(BG_SA_RIGHT_CAPTURABLE_GY, Source); + CaptureGraveyard(BG_SA_RIGHT_CAPTURABLE_GY, source); break; case 191310: case 191309: if ((GateStatus[BG_SA_GREEN_GATE] == BG_SA_GATE_DESTROYED || GateStatus[BG_SA_BLUE_GATE] == BG_SA_GATE_DESTROYED) && (GateStatus[BG_SA_RED_GATE] == BG_SA_GATE_DESTROYED || GateStatus[BG_SA_PURPLE_GATE] == BG_SA_GATE_DESTROYED)) - CaptureGraveyard(BG_SA_CENTRAL_CAPTURABLE_GY, Source); + CaptureGraveyard(BG_SA_CENTRAL_CAPTURABLE_GY, source); break; default: return; @@ -756,19 +776,16 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source) flag = BG_SA_LEFT_FLAG; DelObject(flag); AddObject(flag, (BG_SA_ObjEntries[flag] - (Source->GetTeamId() == TEAM_ALLIANCE ? 0 : 1)), - BG_SA_ObjSpawnlocs[flag][0], BG_SA_ObjSpawnlocs[flag][1], - BG_SA_ObjSpawnlocs[flag][2], BG_SA_ObjSpawnlocs[flag][3], 0, 0, 0, 0, RESPAWN_ONE_DAY); + BG_SA_ObjSpawnlocs[flag], 0, 0, 0, 0, RESPAWN_ONE_DAY); npc = BG_SA_NPC_RIGSPARK; - AddCreature(BG_SA_NpcEntries[npc], npc, Attackers, - BG_SA_NpcSpawnlocs[npc][0], BG_SA_NpcSpawnlocs[npc][1], - BG_SA_NpcSpawnlocs[npc][2], BG_SA_NpcSpawnlocs[npc][3]); + if (Creature* rigspark = AddCreature(BG_SA_NpcEntries[npc], npc, Attackers, BG_SA_NpcSpawnlocs[npc])) + rigspark->AI()->Talk(TEXT_SPARKLIGHT_RIGSPARK_SPAWN); for (uint8 j = BG_SA_DEMOLISHER_7; j <= BG_SA_DEMOLISHER_8; j++) { AddCreature(BG_SA_NpcEntries[j], j, (Attackers == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE), - BG_SA_NpcSpawnlocs[j][0], BG_SA_NpcSpawnlocs[j][1], - BG_SA_NpcSpawnlocs[j][2], BG_SA_NpcSpawnlocs[j][3], 600); + BG_SA_NpcSpawnlocs[j], 600); if (Creature* dem = GetBGCreature(j)) dem->setFaction(BG_SA_Factions[Attackers]); @@ -776,28 +793,25 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source) UpdateWorldState(BG_SA_LEFT_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0)); UpdateWorldState(BG_SA_LEFT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 0 : 1)); - if (Source->GetTeamId() == TEAM_ALLIANCE) - SendWarningToAll(LANG_BG_SA_A_GY_WEST); - else - SendWarningToAll(LANG_BG_SA_H_GY_WEST); + + if (Creature* c = Source->FindNearestCreature(NPC_WORLD_TRIGGER, 500.0f)) + SendChatMessage(c, Source->GetTeamId() == TEAM_ALLIANCE ? TEXT_WEST_GRAVEYARD_CAPTURED_A : TEXT_WEST_GRAVEYARD_CAPTURED_H, Source); + break; case BG_SA_RIGHT_CAPTURABLE_GY: flag = BG_SA_RIGHT_FLAG; DelObject(flag); AddObject(flag, (BG_SA_ObjEntries[flag] - (Source->GetTeamId() == TEAM_ALLIANCE ? 0 : 1)), - BG_SA_ObjSpawnlocs[flag][0], BG_SA_ObjSpawnlocs[flag][1], - BG_SA_ObjSpawnlocs[flag][2], BG_SA_ObjSpawnlocs[flag][3], 0, 0, 0, 0, RESPAWN_ONE_DAY); + BG_SA_ObjSpawnlocs[flag], 0, 0, 0, 0, RESPAWN_ONE_DAY); npc = BG_SA_NPC_SPARKLIGHT; - AddCreature(BG_SA_NpcEntries[npc], npc, Attackers, - BG_SA_NpcSpawnlocs[npc][0], BG_SA_NpcSpawnlocs[npc][1], - BG_SA_NpcSpawnlocs[npc][2], BG_SA_NpcSpawnlocs[npc][3]); + if (Creature* sparklight = AddCreature(BG_SA_NpcEntries[npc], npc, Attackers, BG_SA_NpcSpawnlocs[npc])) + sparklight->AI()->Talk(TEXT_SPARKLIGHT_RIGSPARK_SPAWN); for (uint8 j = BG_SA_DEMOLISHER_5; j <= BG_SA_DEMOLISHER_6; j++) { AddCreature(BG_SA_NpcEntries[j], j, (Attackers == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE), - BG_SA_NpcSpawnlocs[j][0], BG_SA_NpcSpawnlocs[j][1], - BG_SA_NpcSpawnlocs[j][2], BG_SA_NpcSpawnlocs[j][3], 600); + BG_SA_NpcSpawnlocs[j], 600); if (Creature* dem = GetBGCreature(j)) dem->setFaction(BG_SA_Factions[Attackers]); @@ -805,24 +819,23 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source) UpdateWorldState(BG_SA_RIGHT_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0)); UpdateWorldState(BG_SA_RIGHT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 0 : 1)); - if (Source->GetTeamId() == TEAM_ALLIANCE) - SendWarningToAll(LANG_BG_SA_A_GY_EAST); - else - SendWarningToAll(LANG_BG_SA_H_GY_EAST); + + if (Creature* c = Source->FindNearestCreature(NPC_WORLD_TRIGGER, 500.0f)) + SendChatMessage(c, Source->GetTeamId() == TEAM_ALLIANCE ? TEXT_EAST_GRAVEYARD_CAPTURED_A : TEXT_EAST_GRAVEYARD_CAPTURED_H, Source); + break; case BG_SA_CENTRAL_CAPTURABLE_GY: flag = BG_SA_CENTRAL_FLAG; DelObject(flag); AddObject(flag, (BG_SA_ObjEntries[flag] - (Source->GetTeamId() == TEAM_ALLIANCE ? 0 : 1)), - BG_SA_ObjSpawnlocs[flag][0], BG_SA_ObjSpawnlocs[flag][1], - BG_SA_ObjSpawnlocs[flag][2], BG_SA_ObjSpawnlocs[flag][3], 0, 0, 0, 0, RESPAWN_ONE_DAY); + BG_SA_ObjSpawnlocs[flag], 0, 0, 0, 0, RESPAWN_ONE_DAY); UpdateWorldState(BG_SA_CENTER_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0)); UpdateWorldState(BG_SA_CENTER_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 0 : 1)); - if (Source->GetTeamId() == TEAM_ALLIANCE) - SendWarningToAll(LANG_BG_SA_A_GY_SOUTH); - else - SendWarningToAll(LANG_BG_SA_H_GY_SOUTH); + + if (Creature* c = Source->FindNearestCreature(NPC_WORLD_TRIGGER, 500.0f)) + SendChatMessage(c, Source->GetTeamId() == TEAM_ALLIANCE ? TEXT_SOUTH_GRAVEYARD_CAPTURED_A : TEXT_SOUTH_GRAVEYARD_CAPTURED_H, Source); + break; default: ASSERT(false); @@ -830,25 +843,28 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source) }; } -void BattlegroundSA::EventPlayerUsedGO(Player* Source, GameObject* object) +void BattlegroundSA::TitanRelicActivated(Player* clicker) { - if (object->GetEntry() == BG_SA_ObjEntries[BG_SA_TITAN_RELIC] && - GateStatus[BG_SA_ANCIENT_GATE] == BG_SA_GATE_DESTROYED && + if (!clicker) + return; + + if (GateStatus[BG_SA_ANCIENT_GATE] == BG_SA_GATE_DESTROYED && GateStatus[BG_SA_YELLOW_GATE] == BG_SA_GATE_DESTROYED && (GateStatus[BG_SA_PURPLE_GATE] == BG_SA_GATE_DESTROYED || GateStatus[BG_SA_RED_GATE] == BG_SA_GATE_DESTROYED) && (GateStatus[BG_SA_GREEN_GATE] == BG_SA_GATE_DESTROYED || GateStatus[BG_SA_BLUE_GATE] == BG_SA_GATE_DESTROYED)) { - if (Source->GetTeamId() == Attackers) + if (clicker->GetTeamId() == Attackers) { - if (Source->GetTeamId() == TEAM_ALLIANCE) + if (clicker->GetTeamId() == TEAM_ALLIANCE) SendMessageToAll(LANG_BG_SA_ALLIANCE_CAPTURED_RELIC, CHAT_MSG_BG_SYSTEM_NEUTRAL); - else SendMessageToAll(LANG_BG_SA_HORDE_CAPTURED_RELIC, CHAT_MSG_BG_SYSTEM_NEUTRAL); + else + SendMessageToAll(LANG_BG_SA_HORDE_CAPTURED_RELIC, CHAT_MSG_BG_SYSTEM_NEUTRAL); if (Status == BG_SA_ROUND_ONE) { RoundScores[0].winner = Attackers; RoundScores[0].time = TotalTime; - //Achievement Storm the Beach (1310) + // Achievement Storm the Beach (1310) for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) { if (Player* player = ObjectAccessor::FindPlayer(itr->first)) @@ -860,19 +876,25 @@ void BattlegroundSA::EventPlayerUsedGO(Player* Source, GameObject* object) Status = BG_SA_SECOND_WARMUP; TotalTime = 0; ToggleTimer(); - SendWarningToAll(LANG_BG_SA_ROUND_ONE_END); + + if (Creature* c = GetBGCreature(BG_SA_NPC_KANRETHAD)) + SendChatMessage(c, TEXT_ROUND_1_FINISHED); + UpdateWaitTimer = 5000; SignaledRoundTwo = false; SignaledRoundTwoHalfMin = false; InitSecondRound = true; ResetObjs(); + GetBgMap()->UpdateAreaDependentAuras(); + CastSpellOnTeam(SPELL_END_OF_ROUND, ALLIANCE); + CastSpellOnTeam(SPELL_END_OF_ROUND, HORDE); } else if (Status == BG_SA_ROUND_TWO) { RoundScores[1].winner = Attackers; RoundScores[1].time = TotalTime; ToggleTimer(); - //Achievement Storm the Beach (1310) + // Achievement Storm the Beach (1310) for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) { if (Player* player = ObjectAccessor::FindPlayer(itr->first)) @@ -894,18 +916,18 @@ void BattlegroundSA::EventPlayerUsedGO(Player* Source, GameObject* object) void BattlegroundSA::ToggleTimer() { TimerEnabled = !TimerEnabled; - UpdateWorldState(BG_SA_ENABLE_TIMER, (TimerEnabled) ? 1 : 0); + UpdateWorldState(BG_SA_ENABLE_TIMER, TimerEnabled); } void BattlegroundSA::EndBattleground(uint32 winner) { - //honor reward for winning + // honor reward for winning if (winner == ALLIANCE) RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE); else if (winner == HORDE) RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE); - //complete map_end rewards (even if no team wins) + // complete map_end rewards (even if no team wins) RewardHonorToTeam(GetBonusHonorFromKill(2), ALLIANCE); RewardHonorToTeam(GetBonusHonorFromKill(2), HORDE); @@ -931,9 +953,7 @@ void BattlegroundSA::UpdateDemolisherSpawns() { if (DemoliserRespawnList[i] < getMSTime()) { - Demolisher->Relocate(BG_SA_NpcSpawnlocs[i][0], BG_SA_NpcSpawnlocs[i][1], - BG_SA_NpcSpawnlocs[i][2], BG_SA_NpcSpawnlocs[i][3]); - + Demolisher->Relocate(BG_SA_NpcSpawnlocs[i]); Demolisher->Respawn(); DemoliserRespawnList.erase(i); } @@ -981,8 +1001,25 @@ bool BattlegroundSA::CheckAchievementCriteriaMeet(uint32 criteriaId, Player cons case BG_CRITERIA_CHECK_NOT_EVEN_A_SCRATCH: return _allVehiclesAlive[GetTeamIndexByTeamId(source->GetTeam())]; case BG_CRITERIA_CHECK_DEFENSE_OF_THE_ANCIENTS: - return source->GetTeamId() != Attackers && !gateDestroyed; + return source->GetTeamId() != Attackers && !_gateDestroyed; } return Battleground::CheckAchievementCriteriaMeet(criteriaId, source, target, miscValue); } + +bool BattlegroundSA::IsSpellAllowed(uint32 spellId, Player const* /*player*/) const +{ + switch (spellId) + { + case SPELL_ALLIANCE_CONTROL_PHASE_SHIFT: + return Attackers == TEAM_HORDE; + case SPELL_HORDE_CONTROL_PHASE_SHIFT: + return Attackers == TEAM_ALLIANCE; + case SPELL_PREPARATION: + return Status == BG_SA_WARMUP || Status == BG_SA_SECOND_WARMUP; + default: + break; + } + + return true; +} diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h index eb5e54231b5..8e3c933f893 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h @@ -20,10 +20,11 @@ #define __BATTLEGROUNDSA_H #include "Battleground.h" +#include "Object.h" struct BattlegroundSAScore : public BattlegroundScore { - BattlegroundSAScore(): demolishers_destroyed(0), gates_destroyed(0) { } + BattlegroundSAScore() : demolishers_destroyed(0), gates_destroyed(0) { } ~BattlegroundSAScore() { } uint8 demolishers_destroyed; uint8 gates_destroyed; @@ -34,7 +35,7 @@ struct BattlegroundSAScore : public BattlegroundScore enum BG_SA_Status { - BG_SA_NOTSTARTED = 0, + BG_SA_NOT_STARTED = 0, BG_SA_WARMUP, BG_SA_ROUND_ONE, BG_SA_SECOND_WARMUP, @@ -49,7 +50,7 @@ enum BG_SA_GateState BG_SA_GATE_DESTROYED = 3 }; -enum BG_SA_EventIdGate +enum BG_SA_EventIds { BG_SA_EVENT_BLUE_GATE_DAMAGED = 19040, BG_SA_EVENT_BLUE_GATE_DESTROYED = 19045, @@ -67,7 +68,42 @@ enum BG_SA_EventIdGate BG_SA_EVENT_YELLOW_GATE_DESTROYED = 19049, BG_SA_EVENT_ANCIENT_GATE_DAMAGED = 19836, - BG_SA_EVENT_ANCIENT_GATE_DESTROYED = 19837 + BG_SA_EVENT_ANCIENT_GATE_DESTROYED = 19837, + + BG_SA_EVENT_TITAN_RELIC_ACTIVATED = 22097 +}; + +enum SASpellIds +{ + SPELL_TELEPORT_DEFENDER = 52364, + SPELL_TELEPORT_ATTACKERS = 60178, + SPELL_END_OF_ROUND = 52459, + SPELL_REMOVE_SEAFORIUM = 59077, + SPELL_ALLIANCE_CONTROL_PHASE_SHIFT = 60027, + SPELL_HORDE_CONTROL_PHASE_SHIFT = 60028 +}; + +enum SACreatureIds +{ + NPC_KANRETHAD = 29, + NPC_INVISIBLE_STALKER = 15214, + NPC_WORLD_TRIGGER = 22515, + NPC_WORLD_TRIGGER_LARGE_AOI_NOT_IMMUNE_PC_NPC = 23472, + + NPC_ANTI_PERSONNAL_CANNON = 27894, + NPC_DEMOLISHER_SA = 28781, + NPC_RIGGER_SPARKLIGHT = 29260, + NPC_GORGRIL_RIGSPARK = 29262 +}; + +enum SAGameObjectIds +{ + GO_GATE_OF_THE_GREEN_EMERALD = 190722, + GO_GATE_OF_THE_PURPLE_AMETHYST = 190723, + GO_GATE_OF_THE_BLUE_SAPPHIRE = 190724, + GO_GATE_OF_THE_RED_SUN = 190726, + GO_GATE_OF_THE_YELLOW_MOON = 190727, + GO_CHAMBER_OF_ANCIENT_RELICS = 192549, }; enum BG_SA_Timers @@ -77,7 +113,51 @@ enum BG_SA_Timers BG_SA_ROUNDLENGTH = 600 * IN_MILLISECONDS }; -enum BG_SA_WorldStates +enum SASounds +{ + SOUND_GRAVEYARD_TAKEN_HORDE = 8174, + SOUND_GRAVEYARD_TAKEN_ALLIANCE = 8212, + SOUND_DEFEAT_HORDE = 15905, + SOUND_VICTORY_HORDE = 15906, + SOUND_VICTORY_ALLIANCE = 15907, + SOUND_DEFEAT_ALLIANCE = 15908, + SOUND_WALL_DESTROYED_ALLIANCE = 15909, + SOUND_WALL_DESTROYED_HORDE = 15910, + SOUND_WALL_ATTACKED_HORDE = 15911, + SOUND_WALL_ATTACKED_ALLIANCE = 15912 +}; + +enum SATexts +{ + // Kanrethad + TEXT_ROUND_STARTED = 1, + TEXT_ROUND_1_FINISHED = 2, + + // Rigger Sparklight / Gorgril Rigspark + TEXT_SPARKLIGHT_RIGSPARK_SPAWN = 1, + + // World Trigger + TEXT_BLUE_GATE_UNDER_ATTACK = 1, + TEXT_GREEN_GATE_UNDER_ATTACK = 2, + TEXT_RED_GATE_UNDER_ATTACK = 3, + TEXT_PURPLE_GATE_UNDER_ATTACK = 4, + TEXT_YELLOW_GATE_UNDER_ATTACK = 5, + TEXT_YELLOW_GATE_DESTROYED = 6, + TEXT_PURPLE_GATE_DESTROYED = 7, + TEXT_RED_GATE_DESTROYED = 8, + TEXT_GREEN_GATE_DESTROYED = 9, + TEXT_BLUE_GATE_DESTROYED = 10, + TEXT_EAST_GRAVEYARD_CAPTURED_A = 11, + TEXT_WEST_GRAVEYARD_CAPTURED_A = 12, + TEXT_SOUTH_GRAVEYARD_CAPTURED_A = 13, + TEXT_EAST_GRAVEYARD_CAPTURED_H = 14, + TEXT_WEST_GRAVEYARD_CAPTURED_H = 15, + TEXT_SOUTH_GRAVEYARD_CAPTURED_H = 16, + TEXT_ANCIENT_GATE_UNDER_ATTACK = 17, + TEXT_ANCIENT_GATE_DESTROYED = 18 +}; + +enum SAWorldStates { BG_SA_TIMER_MINS = 3559, BG_SA_TIMER_SEC_TENS = 3560, @@ -102,20 +182,12 @@ enum BG_SA_WorldStates BG_SA_RIGHT_GY_HORDE = 3632, BG_SA_LEFT_GY_HORDE = 3633, BG_SA_CENTER_GY_HORDE = 3634, - BG_SA_BONUS_TIMER = 0xdf3, + BG_SA_BONUS_TIMER = 3571, BG_SA_ENABLE_TIMER = 3564 }; -enum npc -{ - NPC_ANTI_PERSONNAL_CANNON = 27894, - NPC_DEMOLISHER_SA = 28781, - NPC_RIGGER_SPARKLIGHT = 29260, - NPC_GORGRIL_RIGSPARK = 29262 -}; - enum BG_SA_NPCs - { +{ BG_SA_GUN_1 = 0, BG_SA_GUN_2, BG_SA_GUN_3, @@ -126,11 +198,6 @@ enum BG_SA_NPCs BG_SA_GUN_8, BG_SA_GUN_9, BG_SA_GUN_10, - BG_SA_NPC_TRIGGER_1, - BG_SA_NPC_TRIGGER_2, - BG_SA_NPC_TRIGGER_3, - BG_SA_NPC_TRIGGER_4, - BG_SA_NPC_TRIGGER_5, BG_SA_DEMOLISHER_1, BG_SA_DEMOLISHER_2, BG_SA_DEMOLISHER_3, @@ -141,8 +208,9 @@ enum BG_SA_NPCs BG_SA_DEMOLISHER_8, BG_SA_NPC_SPARKLIGHT, BG_SA_NPC_RIGSPARK, + BG_SA_NPC_KANRETHAD, BG_SA_MAXNPC - }; +}; enum BG_SA_Boat { @@ -164,12 +232,6 @@ uint32 const BG_SA_NpcEntries[BG_SA_MAXNPC] = NPC_ANTI_PERSONNAL_CANNON, NPC_ANTI_PERSONNAL_CANNON, NPC_ANTI_PERSONNAL_CANNON, - // Triggers - 23472, - 23472, - 23472, - 23472, - 23472, // 4 beach demolishers NPC_DEMOLISHER_SA, NPC_DEMOLISHER_SA, @@ -182,10 +244,12 @@ uint32 const BG_SA_NpcEntries[BG_SA_MAXNPC] = NPC_DEMOLISHER_SA, // Used Demolisher Salesman NPC_RIGGER_SPARKLIGHT, - NPC_GORGRIL_RIGSPARK + NPC_GORGRIL_RIGSPARK, + // Kanrethad + NPC_KANRETHAD }; -float const BG_SA_NpcSpawnlocs[BG_SA_MAXNPC + BG_SA_DEMOLISHER_AMOUNT][4] = +Position const BG_SA_NpcSpawnlocs[BG_SA_MAXNPC + BG_SA_DEMOLISHER_AMOUNT] = { // Cannons { 1436.429f, 110.05f, 41.407f, 5.4f }, @@ -198,12 +262,6 @@ float const BG_SA_NpcSpawnlocs[BG_SA_MAXNPC + BG_SA_DEMOLISHER_AMOUNT][4] = { 1249.634f, -224.189f, 66.72f, 0.635f }, { 1236.213f, 92.287f, 64.965f, 5.751f }, { 1215.11f, 57.772f, 64.739f, 5.78f }, - // Triggers - { 1453.49f, -250.453f, 30.896f, 4.2883f}, - { 1377.05f, 97.036f, 30.8605f, 2.46539f}, - { 1186.05f, 58.8048f, 56.5491f, 2.75992f}, - { 1042.83f, -72.839f, 84.8145f, 3.58615f}, - { 1233.62f, -250.49f, 55.4036f, 3.7016f}, // Demolishers { 1611.597656f, -117.270073f, 8.719355f, 2.513274f}, { 1575.562500f, -158.421875f, 5.024450f, 2.129302f}, @@ -216,7 +274,8 @@ float const BG_SA_NpcSpawnlocs[BG_SA_MAXNPC + BG_SA_DEMOLISHER_AMOUNT][4] = { 1404.809570f, 197.027237f, 32.046032f, 3.605401f}, // Npcs { 1348.644165f, -298.786469f, 31.080130f, 1.710423f}, - { 1358.191040f, 195.527786f, 31.018187f, 4.171337f} + { 1358.191040f, 195.527786f, 31.018187f, 4.171337f}, + { 841.921f, -134.194f, 196.838f, 6.23082f } }; enum BG_SA_Objects @@ -250,7 +309,7 @@ enum BG_SA_Objects BG_SA_MAXOBJ = BG_SA_BOMB+68 }; -float const BG_SA_ObjSpawnlocs[BG_SA_MAXOBJ][4] = +Position const BG_SA_ObjSpawnlocs[BG_SA_MAXOBJ] = { { 1411.57f, 108.163f, 28.692f, 5.441f }, { 1055.452f, -108.1f, 82.134f, 0.034f }, @@ -430,6 +489,26 @@ float const BG_SA_GYOrientation[BG_SA_MAX_GY] = 6.148f, // defender last GY }; +struct GateInfo +{ + uint8 GateId; + uint32 GameObjectId; + uint32 WorldState; + uint8 DamagedText; + uint8 DestroyedText; +}; + +#define MAX_GATES 6 +GateInfo const Gates[MAX_GATES] = +{ + { BG_SA_GREEN_GATE, GO_GATE_OF_THE_GREEN_EMERALD, BG_SA_GREEN_GATEWS, TEXT_GREEN_GATE_UNDER_ATTACK, TEXT_GREEN_GATE_DESTROYED }, + { BG_SA_YELLOW_GATE, GO_GATE_OF_THE_YELLOW_MOON, BG_SA_YELLOW_GATEWS, TEXT_YELLOW_GATE_UNDER_ATTACK, TEXT_YELLOW_GATE_DESTROYED }, + { BG_SA_BLUE_GATE, GO_GATE_OF_THE_BLUE_SAPPHIRE, BG_SA_BLUE_GATEWS, TEXT_BLUE_GATE_UNDER_ATTACK, TEXT_BLUE_GATE_DESTROYED }, + { BG_SA_RED_GATE, GO_GATE_OF_THE_RED_SUN, BG_SA_RED_GATEWS, TEXT_RED_GATE_UNDER_ATTACK, TEXT_RED_GATE_DESTROYED }, + { BG_SA_PURPLE_GATE, GO_GATE_OF_THE_PURPLE_AMETHYST, BG_SA_PURPLE_GATEWS, TEXT_PURPLE_GATE_UNDER_ATTACK, TEXT_PURPLE_GATE_DESTROYED }, + { BG_SA_ANCIENT_GATE, GO_CHAMBER_OF_ANCIENT_RELICS, BG_SA_ANCIENT_GATEWS, TEXT_ANCIENT_GATE_UNDER_ATTACK, TEXT_ANCIENT_GATE_DESTROYED } +}; + struct BG_SA_RoundScore { TeamId winner; @@ -461,77 +540,30 @@ class BattlegroundSA : public Battleground void Reset(); /// Called for generate packet contain worldstate data void FillInitialWorldStates(WorldPacket& data); - /// Called when a player deal damage to building (door) - void EventPlayerDamagedGO(Player* player, GameObject* go, uint32 eventType); /// Called when a player kill a unit in bg void HandleKillUnit(Creature* creature, Player* killer); /// Return the nearest graveyard where player can respawn WorldSafeLocsEntry const* GetClosestGraveYard(Player* player); + /// Called when someone activates an event + void ProcessEvent(WorldObject* /*obj*/, uint32 /*eventId*/, WorldObject* /*invoker*/ = NULL) OVERRIDE; /// Called when a player click on flag (graveyard flag) - void EventPlayerClickedOnFlag(Player* Source, GameObject* target_obj); - /// Called when a player use a gamobject (relic) - void EventPlayerUsedGO(Player* Source, GameObject* object); - /// Return gate id, relative to bg data, according to gameobject id - uint32 getGateIdFromDamagedOrDestroyEventId(uint32 id) - { - switch (id) - { - // Green gate - case BG_SA_EVENT_GREEN_GATE_DAMAGED: - case BG_SA_EVENT_GREEN_GATE_DESTROYED: - return BG_SA_GREEN_GATE; - // Blue gate - case BG_SA_EVENT_BLUE_GATE_DAMAGED: - case BG_SA_EVENT_BLUE_GATE_DESTROYED: - return BG_SA_BLUE_GATE; - // Red gate - case BG_SA_EVENT_RED_GATE_DAMAGED: - case BG_SA_EVENT_RED_GATE_DESTROYED: - return BG_SA_RED_GATE; - // Purple gate - case BG_SA_EVENT_PURPLE_GATE_DAMAGED: - case BG_SA_EVENT_PURPLE_GATE_DESTROYED: - return BG_SA_PURPLE_GATE; - // Yellow gate - case BG_SA_EVENT_YELLOW_GATE_DAMAGED: - case BG_SA_EVENT_YELLOW_GATE_DESTROYED: - return BG_SA_YELLOW_GATE; - // Ancient gate - case BG_SA_EVENT_ANCIENT_GATE_DAMAGED: - case BG_SA_EVENT_ANCIENT_GATE_DESTROYED: - return BG_SA_ANCIENT_GATE; - default: - break; - } - return 0; - } - /// Return worldstate id, according to door id - uint32 getWorldStateFromGateId(uint32 id) + void EventPlayerClickedOnFlag(Player* source, GameObject* go); + /// Called when a player clicked on relic + void TitanRelicActivated(Player* clicker); + + /// Return GateInfo, relative to bg data, according to gameobject entry + GateInfo const* GetGate(uint32 entry) { - switch (id) - { - case BG_SA_GREEN_GATE: - return BG_SA_GREEN_GATEWS; - case BG_SA_YELLOW_GATE: - return BG_SA_YELLOW_GATEWS; - case BG_SA_BLUE_GATE: - return BG_SA_BLUE_GATEWS; - case BG_SA_RED_GATE: - return BG_SA_RED_GATEWS; - case BG_SA_PURPLE_GATE: - return BG_SA_PURPLE_GATEWS; - case BG_SA_ANCIENT_GATE: - return BG_SA_ANCIENT_GATEWS; - default: - break; - } - return 0; + for (uint8 i = 0; i < MAX_GATES; ++i) + if (Gates[i].GameObjectId == entry) + return &Gates[i]; + return NULL; } /// Called on battleground ending void EndBattleground(uint32 winner); - /// CAlled when a player leave battleground + /// Called when a player leave battleground void RemovePlayer(Player* player, uint64 guid, uint32 team); void HandleAreaTrigger(Player* Source, uint32 Trigger); @@ -539,14 +571,11 @@ class BattlegroundSA : public Battleground /// Update score board void UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor = true); - // Achievement: Defense of the Ancients - bool gateDestroyed; - // Achievement: Not Even a Scratch - bool CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* source, Unit const* target = NULL, uint32 miscvalue1 = 0); + bool CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* source, Unit const* target = NULL, uint32 miscValue = 0) OVERRIDE; - /// Id of attacker team - TeamId Attackers; + // Control Phase Shift + bool IsSpellAllowed(uint32 spellId, Player const* player) const OVERRIDE; private: @@ -600,6 +629,9 @@ class BattlegroundSA : public Battleground /// Send packet to player for destroy boats (client part) void SendTransportsRemove(Player* player); + /// Id of attacker team + TeamId Attackers; + /// Totale elapsed time of current round uint32 TotalTime; /// Max time of round @@ -607,7 +639,7 @@ class BattlegroundSA : public Battleground /// For know if boats has start moving or not yet bool ShipsStarted; /// Status of each gate (Destroy/Damage/Intact) - BG_SA_GateState GateStatus[6]; + BG_SA_GateState GateStatus[MAX_GATES]; /// Statu of battle (Start or not, and what round) BG_SA_Status Status; /// Team witch conntrol each graveyard @@ -626,6 +658,9 @@ class BattlegroundSA : public Battleground bool InitSecondRound; std::map<uint32/*id*/, uint32/*timer*/> DemoliserRespawnList; + // Achievement: Defense of the Ancients + bool _gateDestroyed; + // Achievement: Not Even a Scratch bool _allVehiclesAlive[BG_TEAMS_COUNT]; }; diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index 8671caf864d..078b6758860 100644 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -91,19 +91,40 @@ void GossipMenu::AddMenuItem(uint32 menuId, uint32 menuItemId, uint32 sender, ui continue; /// Store texts for localization. - std::string strOptionText = itr->second.OptionText; - std::string strBoxText = itr->second.BoxText; + std::string strOptionText, strBoxText; + BroadcastText const* optionBroadcastText = sObjectMgr->GetBroadcastText(itr->second.OptionBroadcastTextId); + BroadcastText const* boxBroadcastText = sObjectMgr->GetBroadcastText(itr->second.BoxBroadcastTextId); + + /// OptionText + if (optionBroadcastText) + ObjectMgr::GetLocaleString(optionBroadcastText->MaleText, GetLocale(), strOptionText); + else + strOptionText = itr->second.OptionText; + + /// BoxText + if (boxBroadcastText) + ObjectMgr::GetLocaleString(boxBroadcastText->MaleText, GetLocale(), strBoxText); + else + strBoxText = itr->second.BoxText; /// Check need of localization. - if (GetLocale() > LOCALE_enUS) - /// Find localizations from database. - if (GossipMenuItemsLocale const* no = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, menuItemId))) + if (GetLocale() != DEFAULT_LOCALE) + { + if (!optionBroadcastText) { - /// Translate texts if there are any. - ObjectMgr::GetLocaleString(no->OptionText, GetLocale(), strOptionText); - ObjectMgr::GetLocaleString(no->BoxText, GetLocale(), strBoxText); + /// Find localizations from database. + if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, menuItemId))) + ObjectMgr::GetLocaleString(gossipMenuLocale->OptionText, GetLocale(), strOptionText); } + if (!boxBroadcastText) + { + /// Find localizations from database. + if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, menuItemId))) + ObjectMgr::GetLocaleString(gossipMenuLocale->BoxText, GetLocale(), strBoxText); + } + } + /// Add menu item with existing method. Menu item id -1 is also used in ADD_GOSSIP_ITEM macro. AddMenuItem(-1, itr->second.OptionIcon, strOptionText, sender, action, strBoxText, itr->second.BoxMoney, itr->second.BoxCoded); } diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index cdd9e1441e7..de53385af9e 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -1274,10 +1274,8 @@ void GameObject::Use(Unit* user) { GameObjectTemplate const* info = GetGOInfo(); - if (user->GetTypeId() == TYPEID_PLAYER) + if (Player* player = user->ToPlayer()) { - Player* player = user->ToPlayer(); - if (info->goober.pageId) // show page... { WorldPacket data(SMSG_GAMEOBJECT_PAGETEXT, 8); @@ -1294,7 +1292,7 @@ void GameObject::Use(Unit* user) { TC_LOG_DEBUG("maps.script", "Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventId, GetEntry(), GetDBTableGUIDLow()); GetMap()->ScriptsStart(sEventScripts, info->goober.eventId, player, this); - EventInform(info->goober.eventId); + EventInform(info->goober.eventId, user); } // possible quest objective for active quests @@ -1305,9 +1303,6 @@ void GameObject::Use(Unit* user) break; } - if (Battleground* bg = player->GetBattleground()) - bg->EventPlayerUsedGO(player, this); - player->KillCreditGO(info->entry, GetGUID()); } @@ -1803,7 +1798,7 @@ bool GameObject::IsInRange(float x, float y, float z, float radius) const && dz < info->maxZ + radius && dz > info->minZ - radius; } -void GameObject::EventInform(uint32 eventId) +void GameObject::EventInform(uint32 eventId, WorldObject* invoker /*= NULL*/) { if (!eventId) return; @@ -1811,8 +1806,12 @@ void GameObject::EventInform(uint32 eventId) if (AI()) AI()->EventInform(eventId); - if (m_zoneScript) - m_zoneScript->ProcessEvent(this, eventId); + if (GetZoneScript()) + GetZoneScript()->ProcessEvent(this, eventId); + + if (BattlegroundMap* bgMap = GetMap()->ToBattlegroundMap()) + if (bgMap->GetBG()) + bgMap->GetBG()->ProcessEvent(this, eventId, invoker); } // overwrite WorldObject function for proper name localization @@ -1878,7 +1877,7 @@ void GameObject::ModifyHealth(int32 change, Unit* attackerOrHealer /*= NULL*/, u // Set the health bar, value = 255 * healthPct; SetGoAnimProgress(m_goValue.Building.Health * 255 / m_goValue.Building.MaxHealth); - Player* player = attackerOrHealer->GetCharmerOrOwnerPlayerOrPlayerItself(); + Player* player = attackerOrHealer ? attackerOrHealer->GetCharmerOrOwnerPlayerOrPlayerItself() : NULL; // dealing damage, send packet if (player) @@ -1927,11 +1926,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* break; case GO_DESTRUCTIBLE_DAMAGED: { - EventInform(m_goInfo->building.damagedEvent); + EventInform(m_goInfo->building.damagedEvent, eventInvoker); sScriptMgr->OnGameObjectDamaged(this, eventInvoker); - if (eventInvoker) - if (Battleground* bg = eventInvoker->GetBattleground()) - bg->EventPlayerDamagedGO(eventInvoker, this, m_goInfo->building.damagedEvent); RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED); SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED); @@ -1956,15 +1952,10 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* case GO_DESTRUCTIBLE_DESTROYED: { sScriptMgr->OnGameObjectDestroyed(this, eventInvoker); - EventInform(m_goInfo->building.destroyedEvent); + EventInform(m_goInfo->building.destroyedEvent, eventInvoker); if (eventInvoker) - { if (Battleground* bg = eventInvoker->GetBattleground()) - { - bg->EventPlayerDamagedGO(eventInvoker, this, m_goInfo->building.destroyedEvent); bg->DestroyGate(eventInvoker, this); - } - } RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED); SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED); @@ -1985,7 +1976,7 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* } case GO_DESTRUCTIBLE_REBUILDING: { - EventInform(m_goInfo->building.rebuildingEvent); + EventInform(m_goInfo->building.rebuildingEvent, eventInvoker); RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED | GO_FLAG_DESTROYED); uint32 modelId = m_goInfo->displayId; diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index 581208f1abd..979abebb2ea 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -806,7 +806,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map return GO_DESTRUCTIBLE_INTACT; } - void EventInform(uint32 eventId); + void EventInform(uint32 eventId, WorldObject* invoker = NULL); uint64 GetRotation() const { return m_rotation; } virtual uint32 GetScriptId() const { return GetGOInfo()->ScriptId; } diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index c0a54060298..9827babddd7 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1555,11 +1555,11 @@ void WorldObject::GetRandomPoint(const Position &pos, float distance, float &ran UpdateGroundPositionZ(rand_x, rand_y, rand_z); // update to LOS height if available } -void WorldObject::GetRandomPoint(const Position &srcPos, float distance, Position &pos) const +Position WorldObject::GetRandomPoint(const Position &srcPos, float distance) const { float x, y, z; GetRandomPoint(srcPos, distance, x, y, z); - pos.Relocate(x, y, z, GetOrientation()); + return Position(x, y, z, GetOrientation()); } void WorldObject::UpdateGroundPositionZ(float x, float y, float &z) const @@ -2527,22 +2527,25 @@ void WorldObject::GetClosePoint(float &x, float &y, float &z, float size, float GetNearPoint(NULL, x, y, z, size, distance2d, GetOrientation() + angle); } -void WorldObject::GetNearPosition(Position &pos, float dist, float angle) +Position WorldObject::GetNearPosition(float dist, float angle) { - GetPosition(&pos); + Position pos = GetPosition(); MovePosition(pos, dist, angle); + return pos; } -void WorldObject::GetFirstCollisionPosition(Position &pos, float dist, float angle) +Position WorldObject::GetFirstCollisionPosition(float dist, float angle) { - GetPosition(&pos); + Position pos = GetPosition(); MovePositionToFirstCollision(pos, dist, angle); + return pos; } -void WorldObject::GetRandomNearPosition(Position &pos, float radius) +Position WorldObject::GetRandomNearPosition(float radius) { - GetPosition(&pos); + Position pos = GetPosition(); MovePosition(pos, radius * (float)rand_norm(), (float)rand_norm() * static_cast<float>(2 * M_PI)); + return pos; } void WorldObject::GetContactPoint(const WorldObject* obj, float &x, float &y, float &z, float distance2d /*= CONTACT_DISTANCE*/) const diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 66cdd16bb6a..7bd253ab704 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -332,10 +332,10 @@ struct Position { x = m_positionX; y = m_positionY; z = m_positionZ; } void GetPosition(float &x, float &y, float &z, float &o) const { x = m_positionX; y = m_positionY; z = m_positionZ; o = m_orientation; } - void GetPosition(Position* pos) const + + Position GetPosition() const { - if (pos) - pos->Relocate(m_positionX, m_positionY, m_positionZ, m_orientation); + return *this; } Position::PositionXYZStreamer PositionXYZStream() @@ -490,6 +490,12 @@ class WorldLocation : public Position void WorldRelocate(const WorldLocation &loc) { m_mapId = loc.GetMapId(); Relocate(loc); } + + WorldLocation GetWorldLocation() const + { + return *this; + } + uint32 GetMapId() const { return m_mapId; } uint32 m_mapId; @@ -580,10 +586,10 @@ class WorldObject : public Object, public WorldLocation void GetNearPoint(WorldObject const* searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle) const; void GetClosePoint(float &x, float &y, float &z, float size, float distance2d = 0, float angle = 0) const; void MovePosition(Position &pos, float dist, float angle); - void GetNearPosition(Position &pos, float dist, float angle); + Position GetNearPosition(float dist, float angle); void MovePositionToFirstCollision(Position &pos, float dist, float angle); - void GetFirstCollisionPosition(Position &pos, float dist, float angle); - void GetRandomNearPosition(Position &pos, float radius); + Position GetFirstCollisionPosition(float dist, float angle); + Position GetRandomNearPosition(float radius); void GetContactPoint(WorldObject const* obj, float &x, float &y, float &z, float distance2d = CONTACT_DISTANCE) const; float GetObjectSize() const; @@ -591,7 +597,7 @@ class WorldObject : public Object, public WorldLocation void UpdateAllowedPositionZ(float x, float y, float &z) const; void GetRandomPoint(Position const &srcPos, float distance, float &rand_x, float &rand_y, float &rand_z) const; - void GetRandomPoint(Position const &srcPos, float distance, Position &pos) const; + Position GetRandomPoint(Position const &srcPos, float distance) const; uint32 GetInstanceId() const { return m_InstanceId; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 1c6c01270c1..ecea7104c5e 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2209,8 +2209,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati // near teleport, triggering send MSG_MOVE_TELEPORT_ACK from client at landing if (!GetSession()->PlayerLogout()) { - Position oldPos; - GetPosition(&oldPos); + Position oldPos = GetPosition(); if (HasUnitMovementFlag(MOVEMENTFLAG_HOVER)) z += GetFloatValue(UNIT_FIELD_HOVERHEIGHT); Relocate(x, y, z, orientation); @@ -14439,17 +14438,35 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool if (canTalk) { - std::string strOptionText = itr->second.OptionText; - std::string strBoxText = itr->second.BoxText; + std::string strOptionText, strBoxText; + BroadcastText const* optionBroadcastText = sObjectMgr->GetBroadcastText(itr->second.OptionBroadcastTextId); + BroadcastText const* boxBroadcastText = sObjectMgr->GetBroadcastText(itr->second.BoxBroadcastTextId); + LocaleConstant locale = GetSession()->GetSessionDbLocaleIndex(); - int32 locale = GetSession()->GetSessionDbLocaleIndex(); - if (locale >= 0) + if (optionBroadcastText) + ObjectMgr::GetLocaleString(getGender() == GENDER_MALE ? optionBroadcastText->MaleText : optionBroadcastText->FemaleText, locale, strOptionText); + else + strOptionText = itr->second.OptionText; + + if (boxBroadcastText) + ObjectMgr::GetLocaleString(getGender() == GENDER_MALE ? boxBroadcastText->MaleText : boxBroadcastText->FemaleText, locale, strBoxText); + else + strBoxText = itr->second.BoxText; + + if (locale != DEFAULT_LOCALE) { - uint32 idxEntry = MAKE_PAIR32(menuId, itr->second.OptionIndex); - if (GossipMenuItemsLocale const* no = sObjectMgr->GetGossipMenuItemsLocale(idxEntry)) + if (!optionBroadcastText) + { + /// Find localizations from database. + if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, menuId))) + ObjectMgr::GetLocaleString(gossipMenuLocale->OptionText, locale, strOptionText); + } + + if (!boxBroadcastText) { - ObjectMgr::GetLocaleString(no->OptionText, locale, strOptionText); - ObjectMgr::GetLocaleString(no->BoxText, locale, strBoxText); + /// Find localizations from database. + if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, menuId))) + ObjectMgr::GetLocaleString(gossipMenuLocale->BoxText, locale, strBoxText); } } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 979edcdafc7..a6871cd9906 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16907,7 +16907,7 @@ void Unit::_ExitVehicle(Position const* exitPosition) Position pos; if (!exitPosition) // Exit position not specified - vehicle->GetBase()->GetPosition(&pos); // This should use passenger's current position, leaving it as it is now + pos = vehicle->GetBase()->GetPosition(); // This should use passenger's current position, leaving it as it is now // because we calculate positions incorrect (sometimes under map) else pos = *exitPosition; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index e37513d0917..fce89b22b53 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -8586,6 +8586,7 @@ void ObjectMgr::LoadBroadcastTexts() return; } + _broadcastTextStore.rehash(result->GetRowCount()); uint32 count = 0; do @@ -8723,19 +8724,6 @@ void ObjectMgr::LoadDbScriptStrings() TC_LOG_ERROR("sql.sql", "Table `db_script_string` has unused string id %u", *itr); } -bool LoadTrinityStrings(const char* table, int32 start_value, int32 end_value) -{ - // MAX_DB_SCRIPT_STRING_ID is max allowed negative value for scripts (scrpts can use only more deep negative values - // start/end reversed for negative values - if (start_value > MAX_DB_SCRIPT_STRING_ID || end_value >= start_value) - { - TC_LOG_ERROR("sql.sql", "Table '%s' load attempted with range (%d - %d) reserved by Trinity, strings not loaded.", table, start_value, end_value+1); - return false; - } - - return sObjectMgr->LoadTrinityStrings(table, start_value, end_value); -} - CreatureBaseStats const* ObjectMgr::GetCreatureBaseStats(uint8 level, uint8 unitClass) { CreatureBaseStatsContainer::const_iterator it = _creatureBaseStatsStore.find(MAKE_PAIR16(level, unitClass)); diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 825ff3a740f..31b881dee37 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -426,6 +426,22 @@ struct BroadcastText uint32 Unk1; uint32 Unk2; // uint32 WDBVerified; + + std::string const& GetText(LocaleConstant locale = DEFAULT_LOCALE, uint8 gender = GENDER_MALE, bool forceGender = false) const + { + if (gender == GENDER_FEMALE && (forceGender || !FemaleText[DEFAULT_LOCALE].empty())) + { + if (FemaleText.size() > size_t(locale) && !FemaleText[locale].empty()) + return FemaleText[locale]; + return FemaleText[DEFAULT_LOCALE]; + } + // else if (gender == GENDER_MALE) + { + if (MaleText.size() > size_t(locale) && !MaleText[locale].empty()) + return MaleText[locale]; + return MaleText[DEFAULT_LOCALE]; + } + } }; typedef UNORDERED_MAP<uint32, BroadcastText> BroadcastTextContainer; @@ -446,8 +462,6 @@ typedef UNORDERED_MAP<uint32/*(mapid, spawnMode) pair*/, CellObjectGuidsMap> Map #define MAX_TRINITY_STRING_ID 2000000000 #define MIN_DB_SCRIPT_STRING_ID MAX_TRINITY_STRING_ID // 'db_script_string' #define MAX_DB_SCRIPT_STRING_ID 2000010000 -#define MIN_CREATURE_AI_TEXT_STRING_ID (-1) // 'creature_ai_texts' -#define MAX_CREATURE_AI_TEXT_STRING_ID (-1000000) // Trinity Trainer Reference start range #define TRINITY_TRAINER_START_REF 200000 @@ -1423,7 +1437,4 @@ class ObjectMgr #define sObjectMgr ACE_Singleton<ObjectMgr, ACE_Null_Mutex>::instance() -// scripting access functions -bool LoadTrinityStrings(char const* table, int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min()); - #endif diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp index e30260d34e2..3d083b3aa05 100644 --- a/src/server/game/Handlers/QueryHandler.cpp +++ b/src/server/game/Handlers/QueryHandler.cpp @@ -264,18 +264,18 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket& recvData) uint64 guid; recvData >> textID; - TC_LOG_DEBUG("network", "WORLD: CMSG_NPC_TEXT_QUERY ID '%u'", textID); + TC_LOG_DEBUG("network", "WORLD: CMSG_NPC_TEXT_QUERY TextId: %u", textID); recvData >> guid; - GossipText const* pGossip = sObjectMgr->GetGossipText(textID); + GossipText const* gossip = sObjectMgr->GetGossipText(textID); WorldPacket data(SMSG_NPC_TEXT_UPDATE, 100); // guess size data << textID; - if (!pGossip) + if (!gossip) { - for (uint32 i = 0; i < MAX_GOSSIP_TEXT_OPTIONS; ++i) + for (uint8 i = 0; i < MAX_GOSSIP_TEXT_OPTIONS; ++i) { data << float(0); data << "Greetings $N"; @@ -291,46 +291,50 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket& recvData) } else { - std::string Text_0[MAX_LOCALES], Text_1[MAX_LOCALES]; - for (int i = 0; i < MAX_GOSSIP_TEXT_OPTIONS; ++i) - { - Text_0[i]=pGossip->Options[i].Text_0; - Text_1[i]=pGossip->Options[i].Text_1; - } + std::string text0[MAX_GOSSIP_TEXT_OPTIONS], text1[MAX_GOSSIP_TEXT_OPTIONS]; + LocaleConstant locale = GetSessionDbLocaleIndex(); - int loc_idx = GetSessionDbLocaleIndex(); - if (loc_idx >= 0) + for (uint8 i = 0; i < MAX_GOSSIP_TEXT_OPTIONS; ++i) { - if (NpcTextLocale const* nl = sObjectMgr->GetNpcTextLocale(textID)) + BroadcastText const* bct = sObjectMgr->GetBroadcastText(gossip->Options[i].BroadcastTextID); + if (bct) + { + ObjectMgr::GetLocaleString(bct->MaleText, locale, text0[i]); + ObjectMgr::GetLocaleString(bct->FemaleText, locale, text1[i]); + } + else + { + text0[i] = gossip->Options[i].Text_0; + text1[i] = gossip->Options[i].Text_1; + } + + if (locale != DEFAULT_LOCALE && !bct) { - for (int i = 0; i < MAX_LOCALES; ++i) + if (NpcTextLocale const* npcTextLocale = sObjectMgr->GetNpcTextLocale(textID)) { - ObjectMgr::GetLocaleString(nl->Text_0[i], loc_idx, Text_0[i]); - ObjectMgr::GetLocaleString(nl->Text_1[i], loc_idx, Text_1[i]); + ObjectMgr::GetLocaleString(npcTextLocale->Text_0[i], locale, text0[i]); + ObjectMgr::GetLocaleString(npcTextLocale->Text_1[i], locale, text1[i]); } } - } - for (int i = 0; i < MAX_GOSSIP_TEXT_OPTIONS; ++i) - { - data << pGossip->Options[i].Probability; + data << gossip->Options[i].Probability; - if (Text_0[i].empty()) - data << Text_1[i]; + if (text0[i].empty()) + data << text1[i]; else - data << Text_0[i]; + data << text0[i]; - if (Text_1[i].empty()) - data << Text_0[i]; + if (text1[i].empty()) + data << text0[i]; else - data << Text_1[i]; + data << text1[i]; - data << pGossip->Options[i].Language; + data << gossip->Options[i].Language; - for (int j = 0; j < MAX_GOSSIP_TEXT_EMOTES; ++j) + for (uint8 j = 0; j < MAX_GOSSIP_TEXT_EMOTES; ++j) { - data << pGossip->Options[i].Emotes[j]._Delay; - data << pGossip->Options[i].Emotes[j]._Emote; + data << gossip->Options[i].Emotes[j]._Delay; + data << gossip->Options[i].Emotes[j]._Emote; } } } diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 68657640852..cd391299785 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -3532,3 +3532,15 @@ void Map::SetZoneOverrideLight(uint32 zoneId, uint32 lightId, uint32 fadeInTime) player->SendDirectMessage(&data); } } + +void Map::UpdateAreaDependentAuras() +{ + Map::PlayerList const& players = GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + if (Player* player = itr->GetSource()) + if (player->IsInWorld()) + { + player->UpdateAreaDependentAuras(player->GetAreaId()); + player->UpdateZoneDependentAuras(player->GetZoneId()); + } +} diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 4daeebe43d1..d965351fc79 100644 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -51,6 +51,7 @@ struct ScriptAction; struct Position; class Battleground; class MapInstanced; +class BattlegroundMap; class InstanceMap; class Transport; namespace Trinity { struct ObjectUpdater; } @@ -457,11 +458,15 @@ class Map : public GridRefManager<NGridType> Transport* GetTransport(uint64 guid); DynamicObject* GetDynamicObject(uint64 guid); - MapInstanced* ToMapInstanced(){ if (Instanceable()) return reinterpret_cast<MapInstanced*>(this); else return NULL; } - const MapInstanced* ToMapInstanced() const { if (Instanceable()) return (const MapInstanced*)((MapInstanced*)this); else return NULL; } + MapInstanced* ToMapInstanced() { if (Instanceable()) return reinterpret_cast<MapInstanced*>(this); return NULL; } + MapInstanced const* ToMapInstanced() const { if (Instanceable()) return reinterpret_cast<MapInstanced const*>(this); return NULL; } + + InstanceMap* ToInstanceMap() { if (IsDungeon()) return reinterpret_cast<InstanceMap*>(this); else return NULL; } + InstanceMap const* ToInstanceMap() const { if (IsDungeon()) return reinterpret_cast<InstanceMap const*>(this); return NULL; } + + BattlegroundMap* ToBattlegroundMap() { if (IsBattlegroundOrArena()) return reinterpret_cast<BattlegroundMap*>(this); else return NULL; } + BattlegroundMap const* ToBattlegroundMap() const { if (IsBattlegroundOrArena()) return reinterpret_cast<BattlegroundMap const*>(this); return NULL; } - InstanceMap* ToInstanceMap(){ if (IsDungeon()) return reinterpret_cast<InstanceMap*>(this); else return NULL; } - const InstanceMap* ToInstanceMap() const { if (IsDungeon()) return (const InstanceMap*)((InstanceMap*)this); else return NULL; } float GetWaterOrGroundLevel(float x, float y, float z, float* ground = NULL, bool swim = false) const; float GetHeight(uint32 phasemask, float x, float y, float z, bool vmap = true, float maxSearchDist = DEFAULT_HEIGHT_SEARCH) const; bool isInLineOfSight(float x1, float y1, float z1, float x2, float y2, float z2, uint32 phasemask) const; @@ -510,6 +515,8 @@ class Map : public GridRefManager<NGridType> void SetZoneWeather(uint32 zoneId, uint32 weatherId, float weatherGrade); void SetZoneOverrideLight(uint32 zoneId, uint32 lightId, uint32 fadeInTime); + void UpdateAreaDependentAuras(); + private: void LoadMapAndVMap(int gx, int gy); void LoadVMap(int gx, int gy); diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 51ce8250f89..eabc15d6ee7 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -1202,21 +1202,11 @@ enum TrinityStrings LANG_BG_SA_START_TWO_MINUTES = 10056, LANG_BG_SA_START_ONE_MINUTE = 10057, LANG_BG_SA_START_HALF_MINUTE = 10058, - LANG_BG_SA_HAS_BEGUN = 10059, - LANG_BG_SA_IS_UNDER_ATTACK = 10060, //The %s is under attack! - LANG_BG_SA_WAS_DESTROYED = 10061, //The %s was destroyed! - LANG_BG_SA_ROUND_ONE_END = 10062, //Round 1 - finished! + // unused 10059-10062 LANG_BG_SA_ALLIANCE_CAPTURED_RELIC = 10063, //The Alliance captured the titan portal! LANG_BG_SA_HORDE_CAPTURED_RELIC = 10064, //The Horde captured the titan portal! LANG_BG_SA_ROUND_TWO_ONE_MINUTE = 10065, //Round 2 of the Battle for the Strand of the Ancients begins in 1 minute. LANG_BG_SA_ROUND_TWO_START_HALF_MINUTE = 10066, //Round 2 begins in 30 seconds. Prepare yourselves! - LANG_BG_SA_CHAMBER_BREACHED = 10067, //The chamber has been breached! The titan relic is vulnerable! - LANG_BG_SA_A_GY_SOUTH = 10068, //The Alliance captured the South Graveyard! - LANG_BG_SA_A_GY_WEST = 10069, //The Alliance captured the West Graveyard! - LANG_BG_SA_A_GY_EAST = 10070, //The Alliance captured the East Graveyard! - LANG_BG_SA_H_GY_SOUTH = 10071, //The Horde captured the South Graveyard! - LANG_BG_SA_H_GY_WEST = 10072, //The Horde captured the West Graveyard! - LANG_BG_SA_H_GY_EAST = 10073, //The Horde captured the East Graveyard! // Use for custom patches 11000-11999 LANG_AUTO_BROADCAST = 11000, diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp index a34d09c3721..95320865d0b 100644 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp @@ -45,8 +45,7 @@ void FleeingMovementGenerator<T>::_setTargetLocation(T* owner) _getPoint(owner, x, y, z); // Add LOS check for target point - Position mypos; - owner->GetPosition(&mypos); + Position mypos = owner->GetPosition(); bool isInLOS = VMAP::VMapFactory::createOrGetVMapManager()->isInLineOfSight(owner->GetMapId(), mypos.m_positionX, mypos.m_positionY, @@ -109,8 +108,7 @@ void FleeingMovementGenerator<T>::_getPoint(T* owner, float &x, float &y, float angle = frand(0, 2*static_cast<float>(M_PI)); } - Position pos; - owner->GetFirstCollisionPosition(pos, dist, angle); + Position pos = owner->GetFirstCollisionPosition(dist, angle); x = pos.m_positionX; y = pos.m_positionY; z = pos.m_positionZ; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 124c1c21332..d9ad62ebf71 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5012,9 +5012,8 @@ SpellCastResult Spell::CheckCast(bool strict) if (!target) return SPELL_FAILED_DONT_REPORT; - Position pos; - target->GetContactPoint(m_caster, pos.m_positionX, pos.m_positionY, pos.m_positionZ); - target->GetFirstCollisionPosition(pos, CONTACT_DISTANCE, target->GetRelativeAngle(m_caster)); + //target->GetContactPoint(m_caster, pos.m_positionX, pos.m_positionY, pos.m_positionZ); + Position pos = target->GetFirstCollisionPosition(CONTACT_DISTANCE, target->GetRelativeAngle(m_caster)); m_preGeneratedPath.SetPathLengthLimit(m_spellInfo->GetMaxRange(true) * 1.5f); bool result = m_preGeneratedPath.CalculatePath(pos.m_positionX, pos.m_positionY, pos.m_positionZ + target->GetObjectSize(), false, true); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 35930906307..775f6540944 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2292,7 +2292,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) pos = *destTarget; else // randomize position for multiple summons - m_caster->GetRandomPoint(*destTarget, radius, pos); + pos = m_caster->GetRandomPoint(*destTarget, radius); summon = m_originalCaster->SummonCreature(entry, pos, summonType, duration); if (!summon) @@ -4593,9 +4593,8 @@ void Spell::EffectLeap(SpellEffIndex /*effIndex*/) if (!m_targets.HasDst()) return; - Position pos; - destTarget->GetPosition(&pos); - unitTarget->GetFirstCollisionPosition(pos, unitTarget->GetDistance(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ() + 2.0f), 0.0f); + Position pos = destTarget->GetPosition(); + pos = unitTarget->GetFirstCollisionPosition(unitTarget->GetDistance(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ() + 2.0f), 0.0f); unitTarget->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), unitTarget == m_caster); } @@ -4732,9 +4731,8 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/) // Spell is not using explicit target - no generated path if (m_preGeneratedPath.GetPathType() == PATHFIND_BLANK) { - Position pos; - unitTarget->GetContactPoint(m_caster, pos.m_positionX, pos.m_positionY, pos.m_positionZ); - unitTarget->GetFirstCollisionPosition(pos, unitTarget->GetObjectSize(), unitTarget->GetRelativeAngle(m_caster)); + //unitTarget->GetContactPoint(m_caster, pos.m_positionX, pos.m_positionY, pos.m_positionZ); + Position pos = unitTarget->GetFirstCollisionPosition(unitTarget->GetObjectSize(), unitTarget->GetRelativeAngle(m_caster)); m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ); } else @@ -4756,11 +4754,10 @@ void Spell::EffectChargeDest(SpellEffIndex /*effIndex*/) if (m_targets.HasDst()) { - Position pos; - destTarget->GetPosition(&pos); + Position pos = destTarget->GetPosition(); float angle = m_caster->GetRelativeAngle(pos.GetPositionX(), pos.GetPositionY()); float dist = m_caster->GetDistance(pos); - m_caster->GetFirstCollisionPosition(pos, dist, angle); + pos = m_caster->GetFirstCollisionPosition(dist, angle); m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ); } @@ -5688,7 +5685,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* pos = *destTarget; else // randomize position for multiple summons - m_caster->GetRandomPoint(*destTarget, radius, pos); + pos = m_caster->GetRandomPoint(*destTarget, radius); TempSummon* summon = map->SummonCreature(entry, pos, properties, duration, caster, m_spellInfo->Id); if (!summon) @@ -5909,10 +5906,7 @@ void Spell::EffectBind(SpellEffIndex effIndex) if (m_targets.HasDst()) homeLoc.WorldRelocate(*destTarget); else - { - player->GetPosition(&homeLoc); - homeLoc.m_mapId = player->GetMapId(); - } + homeLoc = player->GetWorldLocation(); player->SetHomebind(homeLoc, areaId); diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index dd790cf9072..72aaa17394f 100644 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -82,7 +82,7 @@ void CreatureTextMgr::LoadCreatureTexts() if (!result) { - TC_LOG_INFO("server.loading", ">> Loaded 0 ceature texts. DB table `creature_texts` is empty."); + TC_LOG_INFO("server.loading", ">> Loaded 0 ceature texts. DB table `creature_text` is empty."); return; } @@ -111,20 +111,20 @@ void CreatureTextMgr::LoadCreatureTexts() { if (!sSoundEntriesStore.LookupEntry(temp.sound)) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Sound %u but sound does not exist.", temp.entry, temp.group, temp.sound); + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Sound %u but sound does not exist.", temp.entry, temp.group, temp.sound); temp.sound = 0; } } if (!GetLanguageDescByID(temp.lang)) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` using Language %u but Language does not exist.", temp.entry, temp.group, uint32(temp.lang)); + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` using Language %u but Language does not exist.", temp.entry, temp.group, uint32(temp.lang)); temp.lang = LANG_UNIVERSAL; } if (temp.type >= MAX_CHAT_MSG_TYPE) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Type %u but this Chat Type does not exist.", temp.entry, temp.group, uint32(temp.type)); + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Type %u but this Chat Type does not exist.", temp.entry, temp.group, uint32(temp.type)); temp.type = CHAT_MSG_SAY; } @@ -132,7 +132,7 @@ void CreatureTextMgr::LoadCreatureTexts() { if (!sEmotesStore.LookupEntry(temp.emote)) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Emote %u but emote does not exist.", temp.entry, temp.group, uint32(temp.emote)); + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Emote %u but emote does not exist.", temp.entry, temp.group, uint32(temp.emote)); temp.emote = EMOTE_ONESHOT_NONE; } } @@ -141,7 +141,7 @@ void CreatureTextMgr::LoadCreatureTexts() { if (!sObjectMgr->GetBroadcastText(temp.BroadcastTextId)) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u, Id %u in table `creature_texts` has non-existing or incompatible BroadcastTextId %u.", temp.entry, temp.group, temp.id, temp.BroadcastTextId); + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u, Id %u in table `creature_text` has non-existing or incompatible BroadcastTextId %u.", temp.entry, temp.group, temp.id, temp.BroadcastTextId); temp.BroadcastTextId = 0; } } @@ -472,13 +472,19 @@ std::string CreatureTextMgr::GetLocalizedChatString(uint32 entry, uint8 textGrou if (locale > MAX_LOCALES) locale = DEFAULT_LOCALE; - std::string baseText = groupItr->text; + std::string baseText = ""; + BroadcastText const* bct = sObjectMgr->GetBroadcastText(groupItr->BroadcastTextId); - if (locale != DEFAULT_LOCALE) + if (bct) + ObjectMgr::GetLocaleString(bct->MaleText, locale, baseText); + else + baseText = groupItr->text; + + if (locale != DEFAULT_LOCALE && !bct) { - LocaleCreatureTextMap::const_iterator locItr = mLocaleTextMap.find(CreatureTextId(entry, uint32(textGroup), id)); - if (locItr != mLocaleTextMap.end()) - ObjectMgr::GetLocaleString(locItr->second.Text, locale, baseText); + LocaleCreatureTextMap::const_iterator locItr = mLocaleTextMap.find(CreatureTextId(entry, uint32(textGroup), id)); + if (locItr != mLocaleTextMap.end()) + ObjectMgr::GetLocaleString(locItr->second.Text, locale, baseText); } return baseText; diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 597823abc13..ba4b189b9f7 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1382,8 +1382,7 @@ public: } else { - Position pos; - transport->GetPosition(&pos); + Position pos = transport->GetPosition(); handler->PSendSysMessage("Transport %s is %s", transport->GetName().c_str(), transport->GetGoState() == GO_STATE_READY ? "stopped" : "moving"); handler->PSendSysMessage("Transport position: %s", pos.ToString().c_str()); return true; diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 7e759a788f5..4de697f2597 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -50,117 +50,118 @@ public: { static ChatCommand reloadAllCommandTable[] = { - { "achievement", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_ACHIEVEMENT, true, &HandleReloadAllAchievementCommand, "", NULL }, - { "area", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_AREA, true, &HandleReloadAllAreaCommand, "", NULL }, - { "gossips", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_GOSSIP, true, &HandleReloadAllGossipsCommand, "", NULL }, - { "item", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_ITEM, true, &HandleReloadAllItemCommand, "", NULL }, - { "locales", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_LOCALES, true, &HandleReloadAllLocalesCommand, "", NULL }, - { "loot", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_LOOT, true, &HandleReloadAllLootCommand, "", NULL }, - { "npc", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_NPC, true, &HandleReloadAllNpcCommand, "", NULL }, - { "quest", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_QUEST, true, &HandleReloadAllQuestCommand, "", NULL }, - { "scripts", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_SCRIPTS, true, &HandleReloadAllScriptsCommand, "", NULL }, - { "spell", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_SPELL, true, &HandleReloadAllSpellCommand, "", NULL }, - { "", rbac::RBAC_PERM_COMMAND_RELOAD_ALL, true, &HandleReloadAllCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "achievement", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_ACHIEVEMENT, true, &HandleReloadAllAchievementCommand, "", NULL }, + { "area", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_AREA, true, &HandleReloadAllAreaCommand, "", NULL }, + { "gossips", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_GOSSIP, true, &HandleReloadAllGossipsCommand, "", NULL }, + { "item", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_ITEM, true, &HandleReloadAllItemCommand, "", NULL }, + { "locales", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_LOCALES, true, &HandleReloadAllLocalesCommand, "", NULL }, + { "loot", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_LOOT, true, &HandleReloadAllLootCommand, "", NULL }, + { "npc", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_NPC, true, &HandleReloadAllNpcCommand, "", NULL }, + { "quest", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_QUEST, true, &HandleReloadAllQuestCommand, "", NULL }, + { "scripts", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_SCRIPTS, true, &HandleReloadAllScriptsCommand, "", NULL }, + { "spell", rbac::RBAC_PERM_COMMAND_RELOAD_ALL_SPELL, true, &HandleReloadAllSpellCommand, "", NULL }, + { "", rbac::RBAC_PERM_COMMAND_RELOAD_ALL, true, &HandleReloadAllCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand reloadCommandTable[] = { - { "auctions", rbac::RBAC_PERM_COMMAND_RELOAD_AUCTIONS, true, &HandleReloadAuctionsCommand, "", NULL }, - { "access_requirement", rbac::RBAC_PERM_COMMAND_RELOAD_ACCESS_REQUIREMENT, true, &HandleReloadAccessRequirementCommand, "", NULL }, - { "achievement_criteria_data", rbac::RBAC_PERM_COMMAND_RELOAD_ACHIEVEMENT_CRITERIA_DATA, true, &HandleReloadAchievementCriteriaDataCommand, "", NULL }, - { "achievement_reward", rbac::RBAC_PERM_COMMAND_RELOAD_ACHIEVEMENT_REWARD, true, &HandleReloadAchievementRewardCommand, "", NULL }, - { "all", rbac::RBAC_PERM_COMMAND_RELOAD_ALL, true, NULL, "", reloadAllCommandTable }, - { "areatrigger_involvedrelation", rbac::RBAC_PERM_COMMAND_RELOAD_AREATRIGGER_INVOLVEDRELATION, true, &HandleReloadQuestAreaTriggersCommand, "", NULL }, - { "areatrigger_tavern", rbac::RBAC_PERM_COMMAND_RELOAD_AREATRIGGER_TAVERN, true, &HandleReloadAreaTriggerTavernCommand, "", NULL }, - { "areatrigger_teleport", rbac::RBAC_PERM_COMMAND_RELOAD_AREATRIGGER_TELEPORT, true, &HandleReloadAreaTriggerTeleportCommand, "", NULL }, - { "autobroadcast", rbac::RBAC_PERM_COMMAND_RELOAD_AUTOBROADCAST, true, &HandleReloadAutobroadcastCommand, "", NULL }, - { "command", rbac::RBAC_PERM_COMMAND_RELOAD_COMMAND, true, &HandleReloadCommandCommand, "", NULL }, - { "conditions", rbac::RBAC_PERM_COMMAND_RELOAD_CONDITIONS, true, &HandleReloadConditions, "", NULL }, - { "config", rbac::RBAC_PERM_COMMAND_RELOAD_CONFIG, true, &HandleReloadConfigCommand, "", NULL }, - { "creature_text", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_TEXT, true, &HandleReloadCreatureText, "", NULL }, - { "creature_questender", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_QUESTENDER, true, &HandleReloadCreatureQuestEnderCommand, "", NULL }, - { "creature_linked_respawn", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_LINKED_RESPAWN, true, &HandleReloadLinkedRespawnCommand, "", NULL }, - { "creature_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesCreatureCommand, "", NULL }, - { "creature_onkill_reputation", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_ONKILL_REPUTATION, true, &HandleReloadOnKillReputationCommand, "", NULL }, - { "creature_queststarter", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_QUESTSTARTER, true, &HandleReloadCreatureQuestStarterCommand, "", NULL }, - { "creature_summon_groups", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_SUMMON_GROUPS, true, &HandleReloadCreatureSummonGroupsCommand, "", NULL }, - { "creature_template", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_TEMPLATE, true, &HandleReloadCreatureTemplateCommand, "", NULL }, - //{ "db_script_string", rbac::RBAC_PERM_COMMAND_RELOAD_, true, &HandleReloadDbScriptStringCommand, "", NULL }, - { "disables", rbac::RBAC_PERM_COMMAND_RELOAD_DISABLES, true, &HandleReloadDisablesCommand, "", NULL }, - { "disenchant_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_DISENCHANT_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesDisenchantCommand, "", NULL }, - { "event_scripts", rbac::RBAC_PERM_COMMAND_RELOAD_EVENT_SCRIPTS, true, &HandleReloadEventScriptsCommand, "", NULL }, - { "fishing_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_FISHING_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesFishingCommand, "", NULL }, - { "game_graveyard_zone", rbac::RBAC_PERM_COMMAND_RELOAD_GAME_GRAVEYARD_ZONE, true, &HandleReloadGameGraveyardZoneCommand, "", NULL }, - { "game_tele", rbac::RBAC_PERM_COMMAND_RELOAD_GAME_TELE, true, &HandleReloadGameTeleCommand, "", NULL }, - { "gameobject_questender", rbac::RBAC_PERM_COMMAND_RELOAD_GAMEOBJECT_QUESTENDER, true, &HandleReloadGOQuestEnderCommand, "", NULL }, - { "gameobject_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_GAMEOBJECT_QUEST_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesGameobjectCommand, "", NULL }, - { "gameobject_queststarter", rbac::RBAC_PERM_COMMAND_RELOAD_GAMEOBJECT_QUESTSTARTER, true, &HandleReloadGOQuestStarterCommand, "", NULL }, - { "gm_tickets", rbac::RBAC_PERM_COMMAND_RELOAD_GM_TICKETS, true, &HandleReloadGMTicketsCommand, "", NULL }, - { "gossip_menu", rbac::RBAC_PERM_COMMAND_RELOAD_GOSSIP_MENU, true, &HandleReloadGossipMenuCommand, "", NULL }, - { "gossip_menu_option", rbac::RBAC_PERM_COMMAND_RELOAD_GOSSIP_MENU_OPTION, true, &HandleReloadGossipMenuOptionCommand, "", NULL }, - { "item_enchantment_template", rbac::RBAC_PERM_COMMAND_RELOAD_ITEM_ENCHANTMENT_TEMPLATE, true, &HandleReloadItemEnchantementsCommand, "", NULL }, - { "item_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_ITEM_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesItemCommand, "", NULL }, - { "item_set_names", rbac::RBAC_PERM_COMMAND_RELOAD_ITEM_SET_NAMES, true, &HandleReloadItemSetNamesCommand, "", NULL }, - { "lfg_dungeon_rewards", rbac::RBAC_PERM_COMMAND_RELOAD_LFG_DUNGEON_REWARDS, true, &HandleReloadLfgRewardsCommand, "", NULL }, - { "locales_achievement_reward", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_ACHIEVEMENT_REWARD, true, &HandleReloadLocalesAchievementRewardCommand, "", NULL }, - { "locales_creature", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_CRETURE, true, &HandleReloadLocalesCreatureCommand, "", NULL }, - { "locales_creature_text", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_CRETURE_TEXT, true, &HandleReloadLocalesCreatureTextCommand, "", NULL }, - { "locales_gameobject", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_GAMEOBJECT, true, &HandleReloadLocalesGameobjectCommand, "", NULL }, - { "locales_gossip_menu_option", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_GOSSIP_MENU_OPTION, true, &HandleReloadLocalesGossipMenuOptionCommand, "", NULL }, - { "locales_item", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_ITEM, true, &HandleReloadLocalesItemCommand, "", NULL }, - { "locales_item_set_name", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_ITEM_SET_NAME, true, &HandleReloadLocalesItemSetNameCommand, "", NULL }, - { "locales_npc_text", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_NPC_TEXT, true, &HandleReloadLocalesNpcTextCommand, "", NULL }, - { "locales_page_text", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_PAGE_TEXT, true, &HandleReloadLocalesPageTextCommand, "", NULL }, - { "locales_points_of_interest", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_POINTS_OF_INTEREST, true, &HandleReloadLocalesPointsOfInterestCommand, "", NULL }, - { "locales_quest", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_QUEST, true, &HandleReloadLocalesQuestCommand, "", NULL }, - { "mail_level_reward", rbac::RBAC_PERM_COMMAND_RELOAD_MAIL_LEVEL_REWARD, true, &HandleReloadMailLevelRewardCommand, "", NULL }, - { "mail_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_MAIL_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesMailCommand, "", NULL }, - { "milling_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_MILLING_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesMillingCommand, "", NULL }, - { "npc_spellclick_spells", rbac::RBAC_PERM_COMMAND_RELOAD_NPC_SPELLCLICK_SPELLS, true, &HandleReloadSpellClickSpellsCommand, "", NULL}, - { "npc_trainer", rbac::RBAC_PERM_COMMAND_RELOAD_NPC_TRAINER, true, &HandleReloadNpcTrainerCommand, "", NULL }, - { "npc_vendor", rbac::RBAC_PERM_COMMAND_RELOAD_NPC_VENDOR, true, &HandleReloadNpcVendorCommand, "", NULL }, - { "page_text", rbac::RBAC_PERM_COMMAND_RELOAD_PAGE_TEXT, true, &HandleReloadPageTextsCommand, "", NULL }, - { "pickpocketing_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_PICKPOCKETING_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesPickpocketingCommand, "", NULL}, - { "points_of_interest", rbac::RBAC_PERM_COMMAND_RELOAD_POINTS_OF_INTEREST, true, &HandleReloadPointsOfInterestCommand, "", NULL }, - { "prospecting_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_PROSPECTING_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesProspectingCommand, "", NULL }, - { "quest_poi", rbac::RBAC_PERM_COMMAND_RELOAD_QUEST_POI, true, &HandleReloadQuestPOICommand, "", NULL }, - { "quest_template", rbac::RBAC_PERM_COMMAND_RELOAD_QUEST_TEMPLATE, true, &HandleReloadQuestTemplateCommand, "", NULL }, - { "rbac", rbac::RBAC_PERM_COMMAND_RELOAD_RBAC, true, &HandleReloadRBACCommand, "", NULL }, - { "reference_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_REFERENCE_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesReferenceCommand, "", NULL }, - { "reserved_name", rbac::RBAC_PERM_COMMAND_RELOAD_RESERVED_NAME, true, &HandleReloadReservedNameCommand, "", NULL }, - { "reputation_reward_rate", rbac::RBAC_PERM_COMMAND_RELOAD_REPUTATION_REWARD_RATE, true, &HandleReloadReputationRewardRateCommand, "", NULL }, - { "reputation_spillover_template", rbac::RBAC_PERM_COMMAND_RELOAD_SPILLOVER_TEMPLATE, true, &HandleReloadReputationRewardRateCommand, "", NULL }, - { "skill_discovery_template", rbac::RBAC_PERM_COMMAND_RELOAD_SKILL_DISCOVERY_TEMPLATE, true, &HandleReloadSkillDiscoveryTemplateCommand, "", NULL }, - { "skill_extra_item_template", rbac::RBAC_PERM_COMMAND_RELOAD_SKILL_EXTRA_ITEM_TEMPLATE, true, &HandleReloadSkillExtraItemTemplateCommand, "", NULL }, - { "skill_fishing_base_level", rbac::RBAC_PERM_COMMAND_RELOAD_SKILL_FISHING_BASE_LEVEL, true, &HandleReloadSkillFishingBaseLevelCommand, "", NULL }, - { "skinning_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_SKINNING_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesSkinningCommand, "", NULL }, - { "smart_scripts", rbac::RBAC_PERM_COMMAND_RELOAD_SMART_SCRIPTS, true, &HandleReloadSmartScripts, "", NULL }, - { "spell_required", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_REQUIRED, true, &HandleReloadSpellRequiredCommand, "", NULL }, - { "spell_area", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_AREA, true, &HandleReloadSpellAreaCommand, "", NULL }, - { "spell_bonus_data", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_BONUS_DATA, true, &HandleReloadSpellBonusesCommand, "", NULL }, - { "spell_group", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_GROUP, true, &HandleReloadSpellGroupsCommand, "", NULL }, - { "spell_learn_spell", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_LEARN_SPELL, true, &HandleReloadSpellLearnSpellCommand, "", NULL }, - { "spell_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesSpellCommand, "", NULL }, - { "spell_linked_spell", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_LINKED_SPELL, true, &HandleReloadSpellLinkedSpellCommand, "", NULL }, - { "spell_pet_auras", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_PET_AURAS, true, &HandleReloadSpellPetAurasCommand, "", NULL }, - { "spell_proc_event", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_PROC_EVENT, true, &HandleReloadSpellProcEventCommand, "", NULL }, - { "spell_proc", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_PROC, true, &HandleReloadSpellProcsCommand, "", NULL }, - { "spell_scripts", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_SCRIPTS, true, &HandleReloadSpellScriptsCommand, "", NULL }, - { "spell_target_position", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_TARGET_POSITION, true, &HandleReloadSpellTargetPositionCommand, "", NULL }, - { "spell_threats", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_THREATS, true, &HandleReloadSpellThreatsCommand, "", NULL }, - { "spell_group_stack_rules", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_GROUP_STACK_RULES, true, &HandleReloadSpellGroupStackRulesCommand, "", NULL }, - { "trinity_string", rbac::RBAC_PERM_COMMAND_RELOAD_TRINITY_STRING, true, &HandleReloadTrinityStringCommand, "", NULL }, - { "warden_action", rbac::RBAC_PERM_COMMAND_RELOAD_WARDEN_ACTION, true, &HandleReloadWardenactionCommand, "", NULL }, - { "waypoint_scripts", rbac::RBAC_PERM_COMMAND_RELOAD_WAYPOINT_SCRIPTS, true, &HandleReloadWpScriptsCommand, "", NULL }, - { "waypoint_data", rbac::RBAC_PERM_COMMAND_RELOAD_WAYPOINT_DATA, true, &HandleReloadWpCommand, "", NULL }, - { "vehicle_accessory", rbac::RBAC_PERM_COMMAND_RELOAD_VEHICLE_ACCESORY, true, &HandleReloadVehicleAccessoryCommand, "", NULL }, - { "vehicle_template_accessory", rbac::RBAC_PERM_COMMAND_RELOAD_VEHICLE_TEMPLATE_ACCESSORY, true, &HandleReloadVehicleTemplateAccessoryCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "auctions", rbac::RBAC_PERM_COMMAND_RELOAD_AUCTIONS, true, &HandleReloadAuctionsCommand, "", NULL }, + { "access_requirement", rbac::RBAC_PERM_COMMAND_RELOAD_ACCESS_REQUIREMENT, true, &HandleReloadAccessRequirementCommand, "", NULL }, + { "achievement_criteria_data", rbac::RBAC_PERM_COMMAND_RELOAD_ACHIEVEMENT_CRITERIA_DATA, true, &HandleReloadAchievementCriteriaDataCommand, "", NULL }, + { "achievement_reward", rbac::RBAC_PERM_COMMAND_RELOAD_ACHIEVEMENT_REWARD, true, &HandleReloadAchievementRewardCommand, "", NULL }, + { "all", rbac::RBAC_PERM_COMMAND_RELOAD_ALL, true, NULL, "", reloadAllCommandTable }, + { "areatrigger_involvedrelation", rbac::RBAC_PERM_COMMAND_RELOAD_AREATRIGGER_INVOLVEDRELATION, true, &HandleReloadQuestAreaTriggersCommand, "", NULL }, + { "areatrigger_tavern", rbac::RBAC_PERM_COMMAND_RELOAD_AREATRIGGER_TAVERN, true, &HandleReloadAreaTriggerTavernCommand, "", NULL }, + { "areatrigger_teleport", rbac::RBAC_PERM_COMMAND_RELOAD_AREATRIGGER_TELEPORT, true, &HandleReloadAreaTriggerTeleportCommand, "", NULL }, + { "autobroadcast", rbac::RBAC_PERM_COMMAND_RELOAD_AUTOBROADCAST, true, &HandleReloadAutobroadcastCommand, "", NULL }, + { "broadcast_text", rbac::RBAC_PERM_COMMAND_RELOAD_BROADCAST_TEXT, true, &HandleReloadBroadcastTextCommand, "", NULL }, + { "command", rbac::RBAC_PERM_COMMAND_RELOAD_COMMAND, true, &HandleReloadCommandCommand, "", NULL }, + { "conditions", rbac::RBAC_PERM_COMMAND_RELOAD_CONDITIONS, true, &HandleReloadConditions, "", NULL }, + { "config", rbac::RBAC_PERM_COMMAND_RELOAD_CONFIG, true, &HandleReloadConfigCommand, "", NULL }, + { "creature_text", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_TEXT, true, &HandleReloadCreatureText, "", NULL }, + { "creature_questender", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_QUESTENDER, true, &HandleReloadCreatureQuestEnderCommand, "", NULL }, + { "creature_linked_respawn", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_LINKED_RESPAWN, true, &HandleReloadLinkedRespawnCommand, "", NULL }, + { "creature_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesCreatureCommand, "", NULL }, + { "creature_onkill_reputation", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_ONKILL_REPUTATION, true, &HandleReloadOnKillReputationCommand, "", NULL }, + { "creature_queststarter", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_QUESTSTARTER, true, &HandleReloadCreatureQuestStarterCommand, "", NULL }, + { "creature_summon_groups", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_SUMMON_GROUPS, true, &HandleReloadCreatureSummonGroupsCommand, "", NULL }, + { "creature_template", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_TEMPLATE, true, &HandleReloadCreatureTemplateCommand, "", NULL }, + //{ "db_script_string", rbac::RBAC_PERM_COMMAND_RELOAD_, true, &HandleReloadDbScriptStringCommand, "", NULL }, + { "disables", rbac::RBAC_PERM_COMMAND_RELOAD_DISABLES, true, &HandleReloadDisablesCommand, "", NULL }, + { "disenchant_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_DISENCHANT_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesDisenchantCommand, "", NULL }, + { "event_scripts", rbac::RBAC_PERM_COMMAND_RELOAD_EVENT_SCRIPTS, true, &HandleReloadEventScriptsCommand, "", NULL }, + { "fishing_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_FISHING_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesFishingCommand, "", NULL }, + { "game_graveyard_zone", rbac::RBAC_PERM_COMMAND_RELOAD_GAME_GRAVEYARD_ZONE, true, &HandleReloadGameGraveyardZoneCommand, "", NULL }, + { "game_tele", rbac::RBAC_PERM_COMMAND_RELOAD_GAME_TELE, true, &HandleReloadGameTeleCommand, "", NULL }, + { "gameobject_questender", rbac::RBAC_PERM_COMMAND_RELOAD_GAMEOBJECT_QUESTENDER, true, &HandleReloadGOQuestEnderCommand, "", NULL }, + { "gameobject_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_GAMEOBJECT_QUEST_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesGameobjectCommand, "", NULL }, + { "gameobject_queststarter", rbac::RBAC_PERM_COMMAND_RELOAD_GAMEOBJECT_QUESTSTARTER, true, &HandleReloadGOQuestStarterCommand, "", NULL }, + { "gm_tickets", rbac::RBAC_PERM_COMMAND_RELOAD_GM_TICKETS, true, &HandleReloadGMTicketsCommand, "", NULL }, + { "gossip_menu", rbac::RBAC_PERM_COMMAND_RELOAD_GOSSIP_MENU, true, &HandleReloadGossipMenuCommand, "", NULL }, + { "gossip_menu_option", rbac::RBAC_PERM_COMMAND_RELOAD_GOSSIP_MENU_OPTION, true, &HandleReloadGossipMenuOptionCommand, "", NULL }, + { "item_enchantment_template", rbac::RBAC_PERM_COMMAND_RELOAD_ITEM_ENCHANTMENT_TEMPLATE, true, &HandleReloadItemEnchantementsCommand, "", NULL }, + { "item_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_ITEM_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesItemCommand, "", NULL }, + { "item_set_names", rbac::RBAC_PERM_COMMAND_RELOAD_ITEM_SET_NAMES, true, &HandleReloadItemSetNamesCommand, "", NULL }, + { "lfg_dungeon_rewards", rbac::RBAC_PERM_COMMAND_RELOAD_LFG_DUNGEON_REWARDS, true, &HandleReloadLfgRewardsCommand, "", NULL }, + { "locales_achievement_reward", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_ACHIEVEMENT_REWARD, true, &HandleReloadLocalesAchievementRewardCommand, "", NULL }, + { "locales_creature", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_CRETURE, true, &HandleReloadLocalesCreatureCommand, "", NULL }, + { "locales_creature_text", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_CRETURE_TEXT, true, &HandleReloadLocalesCreatureTextCommand, "", NULL }, + { "locales_gameobject", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_GAMEOBJECT, true, &HandleReloadLocalesGameobjectCommand, "", NULL }, + { "locales_gossip_menu_option", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_GOSSIP_MENU_OPTION, true, &HandleReloadLocalesGossipMenuOptionCommand, "", NULL }, + { "locales_item", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_ITEM, true, &HandleReloadLocalesItemCommand, "", NULL }, + { "locales_item_set_name", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_ITEM_SET_NAME, true, &HandleReloadLocalesItemSetNameCommand, "", NULL }, + { "locales_npc_text", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_NPC_TEXT, true, &HandleReloadLocalesNpcTextCommand, "", NULL }, + { "locales_page_text", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_PAGE_TEXT, true, &HandleReloadLocalesPageTextCommand, "", NULL }, + { "locales_points_of_interest", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_POINTS_OF_INTEREST, true, &HandleReloadLocalesPointsOfInterestCommand, "", NULL }, + { "locales_quest", rbac::RBAC_PERM_COMMAND_RELOAD_LOCALES_QUEST, true, &HandleReloadLocalesQuestCommand, "", NULL }, + { "mail_level_reward", rbac::RBAC_PERM_COMMAND_RELOAD_MAIL_LEVEL_REWARD, true, &HandleReloadMailLevelRewardCommand, "", NULL }, + { "mail_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_MAIL_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesMailCommand, "", NULL }, + { "milling_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_MILLING_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesMillingCommand, "", NULL }, + { "npc_spellclick_spells", rbac::RBAC_PERM_COMMAND_RELOAD_NPC_SPELLCLICK_SPELLS, true, &HandleReloadSpellClickSpellsCommand, "", NULL }, + { "npc_trainer", rbac::RBAC_PERM_COMMAND_RELOAD_NPC_TRAINER, true, &HandleReloadNpcTrainerCommand, "", NULL }, + { "npc_vendor", rbac::RBAC_PERM_COMMAND_RELOAD_NPC_VENDOR, true, &HandleReloadNpcVendorCommand, "", NULL }, + { "page_text", rbac::RBAC_PERM_COMMAND_RELOAD_PAGE_TEXT, true, &HandleReloadPageTextsCommand, "", NULL }, + { "pickpocketing_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_PICKPOCKETING_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesPickpocketingCommand, "", NULL }, + { "points_of_interest", rbac::RBAC_PERM_COMMAND_RELOAD_POINTS_OF_INTEREST, true, &HandleReloadPointsOfInterestCommand, "", NULL }, + { "prospecting_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_PROSPECTING_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesProspectingCommand, "", NULL }, + { "quest_poi", rbac::RBAC_PERM_COMMAND_RELOAD_QUEST_POI, true, &HandleReloadQuestPOICommand, "", NULL }, + { "quest_template", rbac::RBAC_PERM_COMMAND_RELOAD_QUEST_TEMPLATE, true, &HandleReloadQuestTemplateCommand, "", NULL }, + { "rbac", rbac::RBAC_PERM_COMMAND_RELOAD_RBAC, true, &HandleReloadRBACCommand, "", NULL }, + { "reference_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_REFERENCE_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesReferenceCommand, "", NULL }, + { "reserved_name", rbac::RBAC_PERM_COMMAND_RELOAD_RESERVED_NAME, true, &HandleReloadReservedNameCommand, "", NULL }, + { "reputation_reward_rate", rbac::RBAC_PERM_COMMAND_RELOAD_REPUTATION_REWARD_RATE, true, &HandleReloadReputationRewardRateCommand, "", NULL }, + { "reputation_spillover_template", rbac::RBAC_PERM_COMMAND_RELOAD_SPILLOVER_TEMPLATE, true, &HandleReloadReputationRewardRateCommand, "", NULL }, + { "skill_discovery_template", rbac::RBAC_PERM_COMMAND_RELOAD_SKILL_DISCOVERY_TEMPLATE, true, &HandleReloadSkillDiscoveryTemplateCommand, "", NULL }, + { "skill_extra_item_template", rbac::RBAC_PERM_COMMAND_RELOAD_SKILL_EXTRA_ITEM_TEMPLATE, true, &HandleReloadSkillExtraItemTemplateCommand, "", NULL }, + { "skill_fishing_base_level", rbac::RBAC_PERM_COMMAND_RELOAD_SKILL_FISHING_BASE_LEVEL, true, &HandleReloadSkillFishingBaseLevelCommand, "", NULL }, + { "skinning_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_SKINNING_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesSkinningCommand, "", NULL }, + { "smart_scripts", rbac::RBAC_PERM_COMMAND_RELOAD_SMART_SCRIPTS, true, &HandleReloadSmartScripts, "", NULL }, + { "spell_required", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_REQUIRED, true, &HandleReloadSpellRequiredCommand, "", NULL }, + { "spell_area", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_AREA, true, &HandleReloadSpellAreaCommand, "", NULL }, + { "spell_bonus_data", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_BONUS_DATA, true, &HandleReloadSpellBonusesCommand, "", NULL }, + { "spell_group", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_GROUP, true, &HandleReloadSpellGroupsCommand, "", NULL }, + { "spell_learn_spell", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_LEARN_SPELL, true, &HandleReloadSpellLearnSpellCommand, "", NULL }, + { "spell_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesSpellCommand, "", NULL }, + { "spell_linked_spell", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_LINKED_SPELL, true, &HandleReloadSpellLinkedSpellCommand, "", NULL }, + { "spell_pet_auras", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_PET_AURAS, true, &HandleReloadSpellPetAurasCommand, "", NULL }, + { "spell_proc_event", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_PROC_EVENT, true, &HandleReloadSpellProcEventCommand, "", NULL }, + { "spell_proc", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_PROC, true, &HandleReloadSpellProcsCommand, "", NULL }, + { "spell_scripts", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_SCRIPTS, true, &HandleReloadSpellScriptsCommand, "", NULL }, + { "spell_target_position", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_TARGET_POSITION, true, &HandleReloadSpellTargetPositionCommand, "", NULL }, + { "spell_threats", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_THREATS, true, &HandleReloadSpellThreatsCommand, "", NULL }, + { "spell_group_stack_rules", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_GROUP_STACK_RULES, true, &HandleReloadSpellGroupStackRulesCommand, "", NULL }, + { "trinity_string", rbac::RBAC_PERM_COMMAND_RELOAD_TRINITY_STRING, true, &HandleReloadTrinityStringCommand, "", NULL }, + { "warden_action", rbac::RBAC_PERM_COMMAND_RELOAD_WARDEN_ACTION, true, &HandleReloadWardenactionCommand, "", NULL }, + { "waypoint_scripts", rbac::RBAC_PERM_COMMAND_RELOAD_WAYPOINT_SCRIPTS, true, &HandleReloadWpScriptsCommand, "", NULL }, + { "waypoint_data", rbac::RBAC_PERM_COMMAND_RELOAD_WAYPOINT_DATA, true, &HandleReloadWpCommand, "", NULL }, + { "vehicle_accessory", rbac::RBAC_PERM_COMMAND_RELOAD_VEHICLE_ACCESORY, true, &HandleReloadVehicleAccessoryCommand, "", NULL }, + { "vehicle_template_accessory", rbac::RBAC_PERM_COMMAND_RELOAD_VEHICLE_TEMPLATE_ACCESSORY, true, &HandleReloadVehicleTemplateAccessoryCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { - { "reload", rbac::RBAC_PERM_COMMAND_RELOAD, true, NULL, "", reloadCommandTable }, - { NULL, 0, false, NULL, "", NULL } + { "reload", rbac::RBAC_PERM_COMMAND_RELOAD, true, NULL, "", reloadCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; return commandTable; } @@ -375,6 +376,15 @@ public: return true; } + static bool HandleReloadBroadcastTextCommand(ChatHandler* handler, const char* /*args*/) + { + TC_LOG_INFO("misc", "Re-Loading Broadcast texts..."); + sObjectMgr->LoadBroadcastTexts(); + sObjectMgr->LoadBroadcastTextLocales(); + handler->SendGlobalGMSysMessage("DB table `broadcast_text` reloaded."); + return true; + } + static bool HandleReloadCommandCommand(ChatHandler* handler, const char* /*args*/) { handler->SetLoadCommandTable(true); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 92cdb40dc7b..4caeafb681e 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -353,7 +353,7 @@ public: InfernalPoint *point = NULL; Position pos; if ((me->GetMapId() != 532) || positions.empty()) - me->GetRandomNearPosition(pos, 60); + pos = me->GetRandomNearPosition(60); else { point = Trinity::Containers::SelectRandomContainerElement(positions); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index 108aceebb90..f0ca568f0fd 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -740,8 +740,7 @@ public: if (MoveTimer <= diff) { - Position pos; - me->GetRandomNearPosition(pos, 10); + Position pos = me->GetRandomNearPosition(10); me->GetMotionMaster()->MovePoint(0, pos); MoveTimer = urand(5000, 8000); } else MoveTimer -= diff; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp index 9ceaf8cb85b..fb9f71a51bc 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp @@ -235,8 +235,7 @@ class instance_stratholme : public InstanceMapScript EncounterState[0] = data; if (Creature* ysidaTrigger = instance->GetCreature(ysidaTriggerGUID)) { - Position ysidaPos; - ysidaTrigger->GetPosition(&ysidaPos); + Position ysidaPos = ysidaTrigger->GetPosition(); ysidaTrigger->SummonCreature(NPC_YSIDA, ysidaPos, TEMPSUMMON_TIMED_DESPAWN, 1800000); } events.CancelEvent(EVENT_BARON_RUN); diff --git a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp index 9db6a6b4d19..76452fd2ed0 100644 --- a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp @@ -112,8 +112,7 @@ public: for (uint8 i = 0; i < 3; ++i) { const Position src = {147.927444f, -3851.513428f, 130.893f, 0}; - Position dst; - me->GetRandomPoint(src, 7.0f, dst); + Position dst = me->GetRandomPoint(src, 7.0f); DoSummon(NPC_MARAUDING_OWL, dst, 25000, TEMPSUMMON_CORPSE_TIMED_DESPAWN); } break; @@ -121,8 +120,7 @@ public: for (uint8 i = 0; i < 3; ++i) { const Position src = {-141.151581f, -4291.213867f, 120.130f, 0}; - Position dst; - me->GetRandomPoint(src, 7.0f, dst); + Position dst = me->GetRandomPoint(src, 7.0f); me->SummonCreature(NPC_VILE_AMBUSHER, dst, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000); } break; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index 4fa9af466b1..840cdf8cd20 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -212,8 +212,7 @@ public: } else { - Position pos; - me->GetRandomNearPosition(pos, 40); + Position pos = me->GetRandomNearPosition(40); me->GetMotionMaster()->MovePoint(0, pos.m_positionX, pos.m_positionY, pos.m_positionZ); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp index e5920084033..2246ec13726 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp @@ -269,8 +269,7 @@ public: TC_LOG_DEBUG("scripts", "Instance The Black Morass: Summoning rift boss entry %u.", entry); - Position pos; - me->GetRandomNearPosition(pos, 10.0f); + Position pos = me->GetRandomNearPosition(10.0f); //normalize Z-level if we can, if rift is not at ground level. pos.m_positionZ = std::max(me->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), me->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY)); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp index 58bda23fb36..48401674442 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp @@ -304,8 +304,7 @@ public: return; } - Position pos; - me->GetRandomNearPosition(pos, 10.0f); + Position pos = me->GetRandomNearPosition(10.0f); //normalize Z-level if we can, if rift is not at ground level. pos.m_positionZ = std::max(me->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), me->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY)); diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp index 678a79c51ad..9f04997dda7 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp @@ -82,8 +82,7 @@ public: switch (go->GetEntry()) { case GO_WHELP_SPAWNER: - Position goPos; - go->GetPosition(&goPos); + Position goPos = go->GetPosition(); if (Creature* temp = go->SummonCreature(NPC_WHELP, goPos, TEMPSUMMON_CORPSE_DESPAWN)) { temp->SetInCombatWithZone(); diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp index 04e5f031589..c2450d87739 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp @@ -158,8 +158,7 @@ class boss_ayamiss : public CreatureScript me->SetCanFly(false); if (me->GetVictim()) { - Position VictimPos; - me->EnsureVictim()->GetPosition(&VictimPos); + Position VictimPos = me->EnsureVictim()->GetPosition(); me->GetMotionMaster()->MovePoint(POINT_GROUND, VictimPos); } DoResetThreat(); @@ -212,8 +211,7 @@ class boss_ayamiss : public CreatureScript break; case EVENT_SUMMON_SWARMER: { - Position Pos; - me->GetRandomPoint(SwarmerPos, 80.0f, Pos); + Position Pos = me->GetRandomPoint(SwarmerPos, 80.0f); me->SummonCreature(NPC_SWARMER, Pos); events.ScheduleEvent(EVENT_SUMMON_SWARMER, 5000); break; diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp index 3852802f43d..d3744935f2e 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp @@ -146,8 +146,7 @@ class boss_ossirian : public CreatureScript for (uint8 i = 0; i < NUM_TORNADOS; ++i) { - Position Point; - me->GetRandomPoint(RoomCenter, RoomRadius, Point); + Position Point = me->GetRandomPoint(RoomCenter, RoomRadius); if (Creature* Tornado = me->GetMap()->SummonCreature(NPC_SAND_VORTEX, Point)) Tornado->CastSpell(Tornado, SPELL_SAND_STORM, true); } diff --git a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp index 38bc321d2af..d0c246eb0a3 100644 --- a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp @@ -669,8 +669,7 @@ class npc_stillpine_capitive : public CreatureScript Talk(CAPITIVE_SAY, owner); _player = owner; } - Position pos; - me->GetNearPosition(pos, 3.0f, 0.0f); + Position pos = me->GetNearPosition(3.0f, 0.0f); me->GetMotionMaster()->MovePoint(POINT_INIT, pos); } diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp index 8f71ae47bcb..9b1f833f51b 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp @@ -87,9 +87,7 @@ class boss_amanitar : public CreatureScript for (uint8 i = 0; i < 30; ++i) { - Position pos; - me->GetPosition(&pos); - me->GetRandomNearPosition(pos, 30.0f); + Position pos = me->GetRandomNearPosition(30.0f); pos.m_positionZ = me->GetMap()->GetHeight(pos.GetPositionX(), pos.GetPositionY(), MAX_HEIGHT) + 2.0f; if (Creature* trigger = me->SummonCreature(NPC_TRIGGER, pos)) diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp index 8a9fc2993a8..57549cd2d41 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp @@ -136,8 +136,7 @@ public: Creature* DoSummonImpaleTarget(Unit* target) { - Position targetPos; - target->GetPosition(&targetPos); + Position targetPos = target->GetPosition(); if (TempSummon* impaleTarget = me->SummonCreature(CREATURE_IMPALE_TARGET, targetPos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 6*IN_MILLISECONDS)) { diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index 966436a65df..37ee665e43e 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -418,7 +418,7 @@ class boss_halion : public CreatureScript { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_TWILIGHT_REALM)) { - target->GetPosition(&_meteorStrikePos); + _meteorStrikePos = target->GetPosition(); me->CastSpell(_meteorStrikePos.GetPositionX(), _meteorStrikePos.GetPositionY(), _meteorStrikePos.GetPositionZ(), SPELL_METEOR_STRIKE, true, NULL, NULL, me->GetGUID()); Talk(SAY_METEOR_STRIKE); } @@ -1013,7 +1013,6 @@ class npc_meteor_strike_initial : public CreatureScript if (HalionAI* halionAI = CAST_AI(HalionAI, owner->AI())) { Position const* ownerPos = halionAI->GetMeteorStrikePosition(); - Position newPos; float angle[4]; angle[0] = me->GetAngle(ownerPos); angle[1] = me->GetAngle(ownerPos) - static_cast<float>(M_PI/2); @@ -1025,7 +1024,7 @@ class npc_meteor_strike_initial : public CreatureScript { angle[i] = Position::NormalizeOrientation(angle[i]); me->SetOrientation(angle[i]); - me->GetNearPosition(newPos, 10.0f, 0.0f); // Exact distance + Position newPos = me->GetNearPosition(10.0f, 0.0f); // Exact distance if (Creature* meteor = me->SummonCreature(NPC_METEOR_STRIKE_NORTH + i, newPos, TEMPSUMMON_TIMED_DESPAWN, 30000)) _meteorList.push_back(meteor); } @@ -1087,8 +1086,7 @@ class npc_meteor_strike : public CreatureScript if (_events.ExecuteEvent() == EVENT_SPAWN_METEOR_FLAME) { - Position pos; - me->GetNearPosition(pos, _range, 0.0f); + Position pos = me->GetNearPosition( _range, 0.0f); if (Creature* flame = me->SummonCreature(NPC_METEOR_STRIKE_FLAME, pos, TEMPSUMMON_TIMED_DESPAWN, 25000)) { @@ -1503,8 +1501,7 @@ class spell_halion_damage_aoe_summon : public SpellScriptLoader SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(uint32(GetSpellInfo()->Effects[effIndex].MiscValueB)); uint32 duration = uint32(GetSpellInfo()->GetDuration()); - Position pos; - caster->GetPosition(&pos); + Position pos = caster->GetPosition(); if (Creature* summon = caster->GetMap()->SummonCreature(entry, pos, properties, duration, caster, GetSpellInfo()->Id)) if (summon->IsAIEnabled) summon->AI()->SetData(DATA_STACKS_DISPELLED, GetSpellValue()->EffectBasePoints[EFFECT_1]); diff --git a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp index 46912eeb898..f35d70e84b1 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp @@ -442,11 +442,9 @@ public: // we do this checks to see if the creature is one of the creatures that sorround the boss if (Creature* colossus = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_DRAKKARI_COLOSSUS))) { - Position homePosition; - me->GetHomePosition().GetPosition(&homePosition); + Position homePosition = me->GetHomePosition(); - Position colossusHomePosition; - colossus->GetHomePosition().GetPosition(&colossusHomePosition); + Position colossusHomePosition = colossus->GetHomePosition(); float distance = homePosition.GetExactDist(colossusHomePosition.GetPositionX(), colossusHomePosition.GetPositionY(), colossusHomePosition.GetPositionZ()); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index b053f0a0258..2299bd4012d 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -444,8 +444,7 @@ class boss_prince_keleseth_icc : public CreatureScript void JustSummoned(Creature* summon) OVERRIDE { summons.Summon(summon); - Position pos; - me->GetPosition(&pos); + Position pos = me->GetPosition(); float maxRange = me->GetDistance2d(summon); float angle = me->GetAngle(summon); me->MovePositionToFirstCollision(pos, maxRange, angle); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index f80afd055e9..f5f93292aac 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -576,8 +576,7 @@ class boss_lady_deathwhisper : public CreatureScript { if (spell->Id == SPELL_DARK_MARTYRDOM_T) { - Position pos; - target->GetPosition(&pos); + Position pos = target->GetPosition(); if (target->GetEntry() == NPC_CULT_FANATIC) me->SummonCreature(NPC_REANIMATED_FANATIC, pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); else diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index 162382e91b0..3acb7a704a9 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -401,8 +401,7 @@ class npc_coldflame : public CreatureScript if (_events.ExecuteEvent() == EVENT_COLDFLAME_TRIGGER) { - Position newPos; - me->GetNearPosition(newPos, 5.0f, 0.0f); + Position newPos = me->GetNearPosition(5.0f, 0.0f); me->NearTeleportTo(newPos.GetPositionX(), newPos.GetPositionY(), me->GetPositionZ(), me->GetOrientation()); DoCast(SPELL_COLDFLAME_SUMMON); _events.ScheduleEvent(EVENT_COLDFLAME_TRIGGER, 500); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index ac4d18adb8b..2e210b722ce 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -1436,8 +1436,7 @@ class spell_putricide_mutated_transformation : public SpellScriptLoader SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(uint32(GetSpellInfo()->Effects[effIndex].MiscValueB)); uint32 duration = uint32(GetSpellInfo()->GetDuration()); - Position pos; - caster->GetPosition(&pos); + Position pos = caster->GetPosition(); TempSummon* summon = caster->GetMap()->SummonCreature(entry, pos, properties, duration, caster, GetSpellInfo()->Id); if (!summon || !summon->IsVehicle()) return; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index b1141e31d39..32d8aaa3ba7 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -1266,8 +1266,7 @@ class spell_sindragosa_ice_tomb : public SpellScriptLoader void SummonTomb() { - Position pos; - GetHitUnit()->GetPosition(&pos); + Position pos = GetHitUnit()->GetPosition(); if (TempSummon* summon = GetCaster()->SummonCreature(NPC_ICE_TOMB, pos)) { summon->AI()->SetGUID(GetHitUnit()->GetGUID(), DATA_TRAPPED_PLAYER); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 0d262110b5f..7317f45aaaf 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -1646,8 +1646,7 @@ class npc_strangulate_vehicle : public CreatureScript { if (me->GetExactDist(lichKing) > 10.0f) { - Position pos; - lichKing->GetNearPosition(pos, float(rand_norm()) * 5.0f + 7.5f, lichKing->GetAngle(me)); + Position pos = lichKing->GetNearPosition(float(rand_norm()) * 5.0f + 7.5f, lichKing->GetAngle(me)); me->GetMotionMaster()->MovePoint(0, pos); } } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index ca2c75e502c..3a334f4d59c 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -1980,9 +1980,7 @@ class spell_svalna_revive_champion : public SpellScriptLoader if (!caster) return; - Position pos; - caster->GetPosition(&pos); - caster->GetNearPosition(pos, 5.0f, 0.0f); + Position pos = caster->GetNearPosition(5.0f, 0.0f); //pos.m_positionZ = caster->GetBaseMap()->GetHeight(caster->GetPhaseMask(), pos.GetPositionX(), pos.GetPositionY(), caster->GetPositionZ(), true, 50.0f); //pos.m_positionZ += 0.05f; caster->SetHomePosition(pos); diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index fd2734f55ba..c0728765ee9 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -470,8 +470,7 @@ public: break; case ACTION_LIFT_IN_AIR: { - Position _zToLift; - me->GetPosition(&_zToLift); + Position _zToLift = me->GetPosition(); if (_phase == PHASE_ONE) { _zToLift.m_positionZ += 20.0f; @@ -1596,8 +1595,7 @@ public: me->DespawnOrUnsummon(2050); me->SetOrientation(2.5f); me->SetSpeed(MOVE_FLIGHT, 1.0f, true); - Position pos; - me->GetPosition(&pos); + Position pos = me->GetPosition(); pos.m_positionX += 10.0f; pos.m_positionY += 10.0f; pos.m_positionZ += 12.0f; diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp index e79f8d0764f..2f85bc5d046 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp @@ -105,19 +105,19 @@ public: if (instance->GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) { irisGUID = go->GetGUID(); - go->GetPosition(&focusingIrisPosition); + focusingIrisPosition = go->GetPosition(); } break; case GO_FOCUSING_IRIS_25: if (instance->GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) { irisGUID = go->GetGUID(); - go->GetPosition(&focusingIrisPosition); + focusingIrisPosition = go->GetPosition(); } break; case GO_EXIT_PORTAL: exitPortalGUID = go->GetGUID(); - go->GetPosition(&exitPortalPosition); + exitPortalPosition = go->GetPosition(); break; case GO_HEART_OF_MAGIC_10: if (instance->GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp index 949b26d3d3b..eac3e1f0b9f 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp @@ -92,12 +92,9 @@ class boss_drakos : public CreatureScript { case EVENT_BOMB_SUMMON: { - Position position; - me->GetPosition(&position); - for (uint8 i = 0; i <= (postPull ? 3 : 0); i++) { - me->GetRandomNearPosition(position, frand(0.0f, 10.0f)); + Position position = me->GetRandomNearPosition(frand(0.0f, 10.0f)); me->SummonCreature(NPC_UNSTABLE_SPHERE, position); } } diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp index 0a2ebb549f8..7161f133e7c 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp @@ -232,8 +232,7 @@ class boss_urom : public CreatureScript { if (me->GetVictim()) { - Position pos; - me->EnsureVictim()->GetPosition(&pos); + Position pos = me->EnsureVictim()->GetPosition(); me->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation()); me->GetMotionMaster()->MoveChase(me->GetVictim()); diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp index f6cf17c5b88..001e5dbfff5 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp @@ -314,9 +314,6 @@ class spell_varos_energize_core_area_enemy : public SpellScriptLoader for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end();) { - Position pos; - (*itr)->GetPosition(&pos); - float angle = varos->GetAngle((*itr)->GetPositionX(), (*itr)->GetPositionY()); float diff = fabs(orientation - angle); @@ -361,9 +358,6 @@ class spell_varos_energize_core_area_entry : public SpellScriptLoader for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end();) { - Position pos; - (*itr)->GetPosition(&pos); - float angle = varos->GetAngle((*itr)->GetPositionX(), (*itr)->GetPositionY()); float diff = fabs(orientation - angle); diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index 506e16741fb..9d48298d07e 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -264,8 +264,7 @@ class npc_ruby_emerald_amber_drake : public CreatureScript return; } - Position pos; - summoner->GetPosition(&pos); + Position pos = summoner->GetPosition(); me->GetMotionMaster()->MovePoint(POINT_LAND, pos); } @@ -337,8 +336,7 @@ class npc_ruby_emerald_amber_drake : public CreatureScript me->SetOrientation(2.5f); me->SetSpeed(MOVE_FLIGHT, 1.0f, true); Talk(SAY_DRAKES_TAKEOFF); - Position pos; - me->GetPosition(&pos); + Position pos = me->GetPosition(); Position offset = { 10.0f, 10.0f, 12.0f, 0.0f }; pos.RelocateOffset(offset); me->SetDisableGravity(true); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp index 1788ecacd35..83ea202a03a 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp @@ -163,8 +163,7 @@ public: if (lSparkList.empty()) return; - Position pos; - me->GetPosition(&pos); + Position pos = me->GetPosition(); for (std::list<uint64>::const_iterator itr = lSparkList.begin(); itr != lSparkList.end(); ++itr) { @@ -345,8 +344,7 @@ public: { if (me->GetDistance(ionar) > DATA_MAX_SPARK_DISTANCE) { - Position pos; - ionar->GetPosition(&pos); + Position pos = ionar->GetPosition(); me->SetSpeed(MOVE_RUN, 2.0f); me->GetMotionMaster()->Clear(); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index 7f3e6485eaf..ca16df4a51e 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -1587,8 +1587,7 @@ class spell_freya_iron_roots : public SpellScriptLoader PreventHitDefaultEffect(effIndex); uint32 entry = uint32(GetSpellInfo()->Effects[effIndex].MiscValue); - Position pos; - GetCaster()->GetPosition(&pos); + Position pos = GetCaster()->GetPosition(); // Not good at all, but this prevents having roots in a different position then player if (Creature* Roots = GetCaster()->SummonCreature(entry, pos)) GetCaster()->NearTeleportTo(Roots->GetPositionX(), Roots->GetPositionY(), Roots->GetPositionZ(), GetCaster()->GetOrientation()); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index 26886719ec8..6e4dace58f2 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -587,8 +587,7 @@ class spell_ulduar_stone_grip : public SpellScriptLoader // Temporarily relocate player to vehicle exit dest serverside to send proper fall movement // beats me why blizzard sends these 2 spline packets one after another instantly - Position oldPos; - caster->GetPosition(&oldPos); + Position oldPos = caster->GetPosition(); caster->Relocate(exitPosition); caster->GetMotionMaster()->MoveFall(); caster->Relocate(oldPos); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index ee87e3e9732..2c6a747d7aa 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -562,8 +562,7 @@ class npc_pummeller : public CreatureScript if (Creature* xt002 = me->GetCreature(*me, _instance->GetData64(BOSS_XT002))) { - Position pos; - xt002->GetPosition(&pos); + Position pos = xt002->GetPosition(); me->GetMotionMaster()->MovePoint(0, pos); } } diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index 6ea4490c79d..ea9ebbdc15c 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -2027,8 +2027,7 @@ public: { if (uiTimer <= diff) { - Position pos; - me->GetRandomNearPosition(pos, 10.0f); + Position pos = me->GetRandomNearPosition(10.0f); me->GetMotionMaster()->MovePoint(0, pos); bStarted = false; } diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index 6e39d341c58..770a95c23d7 100644 --- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -1021,7 +1021,14 @@ public: void PassengerBoarded(Unit* passenger, int8 /*seatId*/, bool apply) OVERRIDE { if (apply && passenger->GetTypeId() == TYPEID_PLAYER) + { + /// @workaround - Because accessory gets unmounted when using vehicle_template_accessory. + /// When vehicle spawns accessory is mounted to seat 0,but when player mounts + /// he uses the same seat (instead of mounting to seat 1) kicking the accessory out. + passenger->ChangeSeat(1, false); + me->GetVehicleKit()->InstallAccessory(NPC_PILOT, 0, true, TEMPSUMMON_DEAD_DESPAWN, 0); me->GetMotionMaster()->MovePath(NPC_PLANE, false); + } } void MovementInform(uint32 type, uint32 id) OVERRIDE @@ -1056,6 +1063,7 @@ public: case 25: Talk(PLANE_EMOTE); DoCast(SPELL_ENGINE); + me->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FORCE_MOVEMENT); break; } } diff --git a/src/server/scripts/Northrend/zone_wintergrasp.cpp b/src/server/scripts/Northrend/zone_wintergrasp.cpp index e218741649d..813ec8c368d 100644 --- a/src/server/scripts/Northrend/zone_wintergrasp.cpp +++ b/src/server/scripts/Northrend/zone_wintergrasp.cpp @@ -611,8 +611,7 @@ public: { if (Unit* target = GetHitUnit()) { - WorldLocation loc; - target->GetPosition(&loc); + WorldLocation loc = target->GetWorldLocation(); SetExplTargetDest(loc); } } diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp index 1135a95e92b..649544e452f 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp @@ -133,8 +133,7 @@ class boss_mechano_lord_capacitus : public CreatureScript break; case EVENT_SUMMON_NETHER_CHARGE: { - Position pos; - me->GetRandomNearPosition(pos, 5.0f); + Position pos = me->GetRandomNearPosition(5.0f); me->SummonCreature(NPC_NETHER_CHARGE, pos, TEMPSUMMON_TIMED_DESPAWN, 18000); events.ScheduleEvent(EVENT_SUMMON_NETHER_CHARGE, 10 * IN_MILLISECONDS); break; diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp index f0defe88083..867eb542dcb 100644 --- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp @@ -311,10 +311,10 @@ public: Position pos; if (Unit* EscapeDummy = me->FindNearestCreature(NPC_ESCAPE_DUMMY, 30)) - EscapeDummy->GetPosition(&pos); + pos = EscapeDummy->GetPosition(); else { - me->GetRandomNearPosition(pos, 20); + pos = me->GetRandomNearPosition(20); pos.m_positionZ += 25; } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index b9fd07293cd..0c3d64dcf48 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -2011,8 +2011,7 @@ class spell_q12308_escape_from_silverbrook_summon_worgen : public SpellScriptLoa float dist = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster()); float angle = frand(0.75f, 1.25f) * M_PI; - Position pos; - GetCaster()->GetNearPosition(pos, dist, angle); + Position pos = GetCaster()->GetNearPosition(dist, angle); dest.Relocate(pos); } diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index c74405628b5..0ea9e50f56b 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -364,8 +364,7 @@ class boss_lethon : public CreatureScript { if (spell->Id == SPELL_DRAW_SPIRIT && target->GetTypeId() == TYPEID_PLAYER) { - Position targetPos; - target->GetPosition(&targetPos); + Position targetPos = target->GetPosition(); me->SummonCreature(NPC_SPIRIT_SHADE, targetPos, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 50000); } } |