diff options
Diffstat (limited to 'src')
23 files changed, 137 insertions, 290 deletions
diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/authserver/Realms/RealmList.cpp index fe1a43a34c6..bea775d9d83 100644 --- a/src/server/authserver/Realms/RealmList.cpp +++ b/src/server/authserver/Realms/RealmList.cpp @@ -16,6 +16,7 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <boost/asio/ip/tcp.hpp> #include "Common.h" #include "RealmList.h" #include "BattlenetManager.h" diff --git a/src/server/game/Battlefield/BattlefieldMgr.h b/src/server/game/Battlefield/BattlefieldMgr.h index ca057367e5a..0fa4add13a8 100644 --- a/src/server/game/Battlefield/BattlefieldMgr.h +++ b/src/server/game/Battlefield/BattlefieldMgr.h @@ -32,7 +32,7 @@ class BattlefieldMgr static BattlefieldMgr instance; return &instance; } - + // create battlefield events void InitBattlefield(); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index 7c03776ccec..10ede74685c 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -103,12 +103,19 @@ 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, BG_SA_NpcSpawnlocs[BG_SA_NPC_KANRETHAD]); + if (!AddCreature(BG_SA_NpcEntries[BG_SA_NPC_KANRETHAD], BG_SA_NPC_KANRETHAD, BG_SA_NpcSpawnlocs[BG_SA_NPC_KANRETHAD])) + { + TC_LOG_ERROR("bg.battleground", "SOTA: couldn't spawn Kanrethad, aborted. Entry: %u", BG_SA_NpcEntries[BG_SA_NPC_KANRETHAD]); + return false; + } for (uint8 i = 0; i <= BG_SA_PORTAL_DEFFENDER_RED; i++) { if (!AddObject(i, BG_SA_ObjEntries[i], BG_SA_ObjSpawnlocs[i], 0, 0, 0, 0, RESPAWN_ONE_DAY)) - return false; + { + TC_LOG_ERROR("bg.battleground", "SOTA: couldn't spawn BG_SA_PORTAL_DEFFENDER_RED, Entry: %u", BG_SA_ObjEntries[i]); + continue; + } } for (uint8 i = BG_SA_BOAT_ONE; i <= BG_SA_BOAT_TWO; i++) @@ -129,13 +136,19 @@ bool BattlegroundSA::ResetObjs() 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; + { + TC_LOG_ERROR("bg.battleground", "SOTA: couldn't spawn one of the BG_SA_BOAT, Entry: %u", boatid); + continue; + } } 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, 0, 0, 0, RESPAWN_ONE_DAY)) - return false; + { + TC_LOG_ERROR("bg.battleground", "SOTA: couldn't spawn Sigil, Entry: %u", BG_SA_ObjEntries[i]); + continue; + } } // MAD props for Kiper for discovering those values - 4 hours of his work. @@ -149,7 +162,10 @@ bool BattlegroundSA::ResetObjs() for (uint8 i = 0; i < BG_SA_DEMOLISHER_5; i++) { if (!AddCreature(BG_SA_NpcEntries[i], i, BG_SA_NpcSpawnlocs[i], Attackers == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE, 600)) - return false; + { + TC_LOG_ERROR("bg.battleground", "SOTA: couldn't spawn Cannon or demolisher, Entry: %u, Attackers: %s", BG_SA_NpcEntries[i], Attackers == TEAM_ALLIANCE ? "Horde(1)" : "Alliance(0)"); + continue; + } } OverrideGunFaction(); @@ -198,13 +214,21 @@ 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, 0, 0, 0, RESPAWN_ONE_DAY); + if (!AddObject(i, (BG_SA_ObjEntries[i] - (Attackers == TEAM_ALLIANCE ? 1 : 0)), BG_SA_ObjSpawnlocs[i], 0, 0, 0, 0, RESPAWN_ONE_DAY)) + { + TC_LOG_ERROR("bg.battleground", "SOTA: couldn't spawn Central Flag Entry: %u", BG_SA_ObjEntries[i] - (Attackers == TEAM_ALLIANCE ? 1 : 0)); + continue; + } 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, 0, 0, 0, RESPAWN_ONE_DAY); + if (!AddObject(i, BG_SA_ObjEntries[BG_SA_BOMB], BG_SA_ObjSpawnlocs[i], 0, 0, 0, 0, RESPAWN_ONE_DAY)) + { + TC_LOG_ERROR("bg.battleground", "SOTA: couldn't spawn SA Bomb Entry: %u", BG_SA_ObjEntries[BG_SA_BOMB] + i); + continue; + } GetBGObject(i)->SetFaction(atF); } diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp index d2426effa8e..a464d0c57eb 100644 --- a/src/server/game/Globals/ObjectAccessor.cpp +++ b/src/server/game/Globals/ObjectAccessor.cpp @@ -218,7 +218,7 @@ Unit* ObjectAccessor::FindUnit(uint64 guid) Player* ObjectAccessor::FindPlayerByName(std::string const& name) { boost::shared_lock<boost::shared_mutex> lock(*HashMapHolder<Player>::GetLock()); - + std::string nameStr = name; std::transform(nameStr.begin(), nameStr.end(), nameStr.begin(), ::tolower); HashMapHolder<Player>::MapType const& m = GetPlayers(); diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 48ae15285a9..d4b75b026f6 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -633,7 +633,7 @@ namespace Trinity if (go->GetGOInfo()->spellFocus.focusId != i_focusId) return false; - float dist = (float)((go->GetGOInfo()->spellFocus.dist)/2); + float dist = go->GetGOInfo()->spellFocus.dist / 2.f; return go->IsWithinDistInMap(i_unit, dist); } diff --git a/src/server/game/Instances/InstanceSaveMgr.h b/src/server/game/Instances/InstanceSaveMgr.h index 75dd8ef3f74..701776bb57d 100644 --- a/src/server/game/Instances/InstanceSaveMgr.h +++ b/src/server/game/Instances/InstanceSaveMgr.h @@ -80,10 +80,10 @@ class InstanceSave /* online players bound to the instance (perm/solo) does not include the members of the group unless they have permanent saves */ - void AddPlayer(Player* player) - { + void AddPlayer(Player* player) + { std::lock_guard<std::mutex> lock(_playerListLock); - m_playerList.push_back(player); + m_playerList.push_back(player); } bool RemovePlayer(Player* player) diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index 89cb5745267..aee8c497247 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -166,7 +166,10 @@ bool WaypointMovementGenerator<Creature>::StartMove(Creature* creature) //Call for creature group update if (creature->GetFormation() && creature->GetFormation()->getLeader() == creature) + { + creature->SetWalk(!node->run); creature->GetFormation()->LeaderMoveTo(formationDest.x, formationDest.y, formationDest.z); + } return true; } diff --git a/src/server/game/Movement/Spline/MovementTypedefs.h b/src/server/game/Movement/Spline/MovementTypedefs.h index 57958f604d2..134e7a45425 100644 --- a/src/server/game/Movement/Spline/MovementTypedefs.h +++ b/src/server/game/Movement/Spline/MovementTypedefs.h @@ -23,14 +23,12 @@ namespace G3D { - class Vector2; class Vector3; class Vector4; } namespace Movement { - using G3D::Vector2; using G3D::Vector3; using G3D::Vector4; diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 6c77daa19d2..c9b65c3a046 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -269,7 +269,6 @@ void AddSC_eastern_plaguelands(); void AddSC_eversong_woods(); void AddSC_ghostlands(); void AddSC_hinterlands(); -void AddSC_ironforge(); void AddSC_isle_of_queldanas(); void AddSC_loch_modan(); void AddSC_redridge_mountains(); @@ -280,7 +279,6 @@ void AddSC_swamp_of_sorrows(); void AddSC_tirisfal_glades(); void AddSC_undercity(); void AddSC_western_plaguelands(); -void AddSC_westfall(); void AddSC_wetlands(); //kalimdor @@ -992,7 +990,6 @@ void AddEasternKingdomsScripts() AddSC_eversong_woods(); AddSC_ghostlands(); AddSC_hinterlands(); - AddSC_ironforge(); AddSC_isle_of_queldanas(); AddSC_loch_modan(); AddSC_redridge_mountains(); @@ -1003,7 +1000,6 @@ void AddEasternKingdomsScripts() AddSC_tirisfal_glades(); AddSC_undercity(); AddSC_western_plaguelands(); - AddSC_westfall(); AddSC_wetlands(); #endif } diff --git a/src/server/scripts/EasternKingdoms/CMakeLists.txt b/src/server/scripts/EasternKingdoms/CMakeLists.txt index 1e0e05840c4..118d2498727 100644 --- a/src/server/scripts/EasternKingdoms/CMakeLists.txt +++ b/src/server/scripts/EasternKingdoms/CMakeLists.txt @@ -106,7 +106,6 @@ set(scripts_STAT_SRCS EasternKingdoms/Gnomeregan/gnomeregan.cpp EasternKingdoms/Gnomeregan/gnomeregan.h EasternKingdoms/zone_redridge_mountains.cpp - EasternKingdoms/zone_ironforge.cpp EasternKingdoms/ScarletEnclave/chapter2.cpp EasternKingdoms/ScarletEnclave/chapter5.cpp EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -189,8 +188,6 @@ set(scripts_STAT_SRCS EasternKingdoms/ZulAman/zulaman.h EasternKingdoms/zone_hinterlands.cpp EasternKingdoms/zone_western_plaguelands.cpp - EasternKingdoms/zone_alterac_mountains.cpp - EasternKingdoms/zone_westfall.cpp EasternKingdoms/zone_silverpine_forest.cpp EasternKingdoms/Karazhan/instance_karazhan.cpp EasternKingdoms/Karazhan/boss_nightbane.cpp diff --git a/src/server/scripts/EasternKingdoms/zone_alterac_mountains.cpp b/src/server/scripts/EasternKingdoms/zone_alterac_mountains.cpp deleted file mode 100644 index 3df4fddf69f..00000000000 --- a/src/server/scripts/EasternKingdoms/zone_alterac_mountains.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -/* ScriptData -SDName: Alterac_Mountains -SD%Complete: 0 -SDComment: Placeholder -SDCategory: Alterac Mountains -EndScriptData */ - -/* ContentData -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" - -/*void AddSC_alterac_mountains() -{ - Script* newscript; -}*/ diff --git a/src/server/scripts/EasternKingdoms/zone_westfall.cpp b/src/server/scripts/EasternKingdoms/zone_westfall.cpp deleted file mode 100644 index 7f0fbd8f97b..00000000000 --- a/src/server/scripts/EasternKingdoms/zone_westfall.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -/* ScriptData -SDName: Westfall -SD%Complete: 90 -SDComment: Quest support: 1651 -SDCategory: Westfall -EndScriptData */ - -/* ContentData -npc_daphne_stilwell -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedEscortAI.h" -#include "Player.h" - -/*###### -## npc_daphne_stilwell -######*/ - -enum DaphneStilwell -{ - // Yells - SAY_DS_START = 0, - SAY_DS_DOWN_1 = 1, - SAY_DS_DOWN_2 = 2, - SAY_DS_DOWN_3 = 3, - SAY_DS_PROLOGUE = 4, - - // Spells - SPELL_SHOOT = 6660, - - // Quests - QUEST_TOME_VALOR = 1651, - - // Creatures - NPC_DEFIAS_RAIDER = 6180, - - // Equips - EQUIP_ID_RIFLE = 2511 -}; - -class npc_daphne_stilwell : public CreatureScript -{ -public: - npc_daphne_stilwell() : CreatureScript("npc_daphne_stilwell") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) override - { - if (quest->GetQuestId() == QUEST_TOME_VALOR) - { - creature->AI()->Talk(SAY_DS_START); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_daphne_stilwell::npc_daphne_stilwellAI, creature->AI())) - pEscortAI->Start(true, true, player->GetGUID()); - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_daphne_stilwellAI(creature); - } - - struct npc_daphne_stilwellAI : public npc_escortAI - { - npc_daphne_stilwellAI(Creature* creature) : npc_escortAI(creature) { } - - uint32 uiWPHolder; - uint32 uiShootTimer; - - void Reset() override - { - if (HasEscortState(STATE_ESCORT_ESCORTING)) - { - switch (uiWPHolder) - { - case 7: - Talk(SAY_DS_DOWN_1); - break; - case 8: - Talk(SAY_DS_DOWN_2); - break; - case 9: - Talk(SAY_DS_DOWN_3); - break; - } - } - else - uiWPHolder = 0; - - uiShootTimer = 0; - } - - void WaypointReached(uint32 waypointId) override - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - uiWPHolder = waypointId; - - switch (waypointId) - { - case 4: - SetEquipmentSlots(false, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE, EQUIP_ID_RIFLE); - me->SetSheath(SHEATH_STATE_RANGED); - me->HandleEmoteCommand(EMOTE_STATE_USE_STANDING_NO_SHEATHE); - break; - case 7: - me->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836f, 1569.755f, 54.267f, 4.230f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697f, 1569.124f, 54.421f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237f, 1568.307f, 54.620f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 8: - me->SetSheath(SHEATH_STATE_RANGED); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836f, 1569.755f, 54.267f, 4.230f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697f, 1569.124f, 54.421f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237f, 1568.307f, 54.620f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037f, 1570.213f, 54.961f, 4.283f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 9: - me->SetSheath(SHEATH_STATE_RANGED); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836f, 1569.755f, 54.267f, 4.230f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697f, 1569.124f, 54.421f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237f, 1568.307f, 54.620f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037f, 1570.213f, 54.961f, 4.283f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11449.018f, 1570.738f, 54.828f, 4.220f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 10: - SetRun(false); - break; - case 11: - Talk(SAY_DS_PROLOGUE); - break; - case 13: - SetEquipmentSlots(true); - me->SetSheath(SHEATH_STATE_UNARMED); - me->HandleEmoteCommand(EMOTE_STATE_USE_STANDING_NO_SHEATHE); - break; - case 17: - player->GroupEventHappens(QUEST_TOME_VALOR, me); - break; - } - } - - void AttackStart(Unit* who) override - { - if (!who) - return; - - if (me->Attack(who, false)) - { - me->AddThreat(who, 0.0f); - me->SetInCombatWith(who); - who->SetInCombatWith(me); - - me->GetMotionMaster()->MoveChase(who, 30.0f); - } - } - - void JustSummoned(Creature* summoned) override - { - summoned->AI()->AttackStart(me); - } - - void Update(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - - if (!UpdateVictim()) - return; - - if (uiShootTimer <= diff) - { - uiShootTimer = 1500; - - if (!me->IsWithinDist(me->GetVictim(), ATTACK_DISTANCE)) - DoCastVictim(SPELL_SHOOT); - } else uiShootTimer -= diff; - } - }; -}; - -void AddSC_westfall() -{ - new npc_daphne_stilwell(); -} diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp index 4e45d72cadf..90d91199e7a 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp @@ -20,6 +20,7 @@ #include "ScriptedCreature.h" #include "SpellAuras.h" #include "icecrown_citadel.h" +#include "Player.h" enum ScriptTexts { @@ -457,11 +458,39 @@ class spell_festergut_blighted_spores : public SpellScriptLoader if (InstanceScript* instance = GetTarget()->GetInstanceScript()) if (Creature* festergut = ObjectAccessor::GetCreature(*GetTarget(), instance->GetData64(DATA_FESTERGUT))) festergut->AI()->SetData(DATA_INOCULATED_STACK, GetStackAmount()); + + HandleResidue(); + } + + void HandleResidue() + { + Player* target = GetUnitOwner()->ToPlayer(); + if (!target) + return; + + if (target->HasAura(SPELL_ORANGE_BLIGHT_RESIDUE)) + return; + + if (target->GetMap() && !target->GetMap()->Is25ManRaid()) + { + if (target->GetQuestStatus(QUEST_RESIDUE_RENDEZVOUS_10) != QUEST_STATUS_INCOMPLETE) + return; + + target->CastSpell(target, SPELL_ORANGE_BLIGHT_RESIDUE, TRIGGERED_FULL_MASK); + } + + if (target->GetMap() && target->GetMap()->Is25ManRaid()) + { + if (target->GetQuestStatus(QUEST_RESIDUE_RENDEZVOUS_25) != QUEST_STATUS_INCOMPLETE) + return; + + target->CastSpell(target, SPELL_ORANGE_BLIGHT_RESIDUE, TRIGGERED_FULL_MASK); + } } void Register() override { - AfterEffectApply += AuraEffectApplyFn(spell_festergut_blighted_spores_AuraScript::ExtraEffect, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectRemove += AuraEffectApplyFn(spell_festergut_blighted_spores_AuraScript::ExtraEffect, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); } }; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index c1ee616218c..2f2889a9cf3 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -862,6 +862,53 @@ class spell_rotface_vile_gas_trigger : public SpellScriptLoader } }; +class spell_rotface_slime_spray : public SpellScriptLoader +{ + public: + spell_rotface_slime_spray() : SpellScriptLoader("spell_rotface_slime_spray") { } + + class spell_rotface_slime_spray_SpellScript : public SpellScript + { + PrepareSpellScript(spell_rotface_slime_spray_SpellScript); + + void HandleResidue() + { + Player* target = GetHitPlayer(); + if (!target) + return; + + if (target->HasAura(SPELL_GREEN_BLIGHT_RESIDUE)) + return; + + if (target->GetMap() && !target->GetMap()->Is25ManRaid()) + { + if (target->GetQuestStatus(QUEST_RESIDUE_RENDEZVOUS_10) != QUEST_STATUS_INCOMPLETE) + return; + + target->CastSpell(target, SPELL_GREEN_BLIGHT_RESIDUE, TRIGGERED_FULL_MASK); + } + + if (target->GetMap() && target->GetMap()->Is25ManRaid()) + { + if (target->GetQuestStatus(QUEST_RESIDUE_RENDEZVOUS_25) != QUEST_STATUS_INCOMPLETE) + return; + + target->CastSpell(target, SPELL_GREEN_BLIGHT_RESIDUE, TRIGGERED_FULL_MASK); + } + } + + void Register() override + { + OnHit += SpellHitFn(spell_rotface_slime_spray_SpellScript::HandleResidue); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_rotface_slime_spray_SpellScript(); + } +}; + void AddSC_boss_rotface() { new boss_rotface(); @@ -877,4 +924,5 @@ void AddSC_boss_rotface() new spell_rotface_unstable_ooze_explosion(); new spell_rotface_unstable_ooze_explosion_suicide(); new spell_rotface_vile_gas_trigger(); + new spell_rotface_slime_spray(); } diff --git a/src/server/shared/Configuration/Config.cpp b/src/server/shared/Configuration/Config.cpp index 5cd7ef52f82..ecebf30182e 100644 --- a/src/server/shared/Configuration/Config.cpp +++ b/src/server/shared/Configuration/Config.cpp @@ -103,6 +103,6 @@ std::list<std::string> ConfigMgr::GetKeysByString(std::string const& name) for (const ptree::value_type& child : _config) if (child.first.compare(0, name.length(), name) == 0) keys.push_back(child.first); - + return keys; } diff --git a/src/server/shared/Database/DatabaseWorkerPool.h b/src/server/shared/Database/DatabaseWorkerPool.h index f0b540022da..a1ee6407fea 100644 --- a/src/server/shared/Database/DatabaseWorkerPool.h +++ b/src/server/shared/Database/DatabaseWorkerPool.h @@ -59,6 +59,11 @@ class DatabaseWorkerPool ~DatabaseWorkerPool() { + _queue->Cancel(); + + delete _queue; + + delete _connectionInfo; } bool Open(const std::string& infoString, uint8 async_threads, uint8 synch_threads) @@ -122,12 +127,7 @@ class DatabaseWorkerPool for (uint8 i = 0; i < _connectionCount[IDX_SYNCH]; ++i) _connections[IDX_SYNCH][i]->Close(); - delete _queue; - TC_LOG_INFO("sql.driver", "All connections on DatabasePool '%s' closed.", GetDatabaseName()); - - delete _connectionInfo; - _connectionInfo = NULL; } /** diff --git a/src/server/shared/Database/PreparedStatement.cpp b/src/server/shared/Database/PreparedStatement.cpp index fb1bfa687d0..23c50ac2ef8 100644 --- a/src/server/shared/Database/PreparedStatement.cpp +++ b/src/server/shared/Database/PreparedStatement.cpp @@ -446,8 +446,8 @@ std::string MySQLPreparedStatement::getQueryString(std::string const& sqlPattern //- Execution PreparedStatementTask::PreparedStatementTask(PreparedStatement* stmt, bool async) : -m_stmt(stmt) -{ +m_stmt(stmt), m_result(nullptr) +{ m_has_result = async; // If it's async, then there's a result if (async) m_result = new PreparedQueryResultPromise(); diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index 65cf930a634..a7b6b418cc4 100644 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -278,7 +278,7 @@ void Log::write(LogMessage* msg) const auto logOperation = std::shared_ptr<LogOperation>(new LogOperation(logger, msg)); _ioService->post(_strand->wrap([logOperation](){ logOperation->call(); })); - + } else { diff --git a/src/server/shared/Logging/Log.h b/src/server/shared/Logging/Log.h index 8ae8db5bf5f..78e7e012bbe 100644 --- a/src/server/shared/Logging/Log.h +++ b/src/server/shared/Logging/Log.h @@ -50,7 +50,7 @@ class Log instance._ioService = ioService; instance._strand = new boost::asio::strand(*ioService); } - + return &instance; } diff --git a/src/server/shared/Threading/ProducerConsumerQueue.h b/src/server/shared/Threading/ProducerConsumerQueue.h index 3fefd27ba6e..98a0188b6b5 100644 --- a/src/server/shared/Threading/ProducerConsumerQueue.h +++ b/src/server/shared/Threading/ProducerConsumerQueue.h @@ -76,7 +76,7 @@ public: { _condition.wait(lock); } - + if (_queue.empty()) return; @@ -106,6 +106,6 @@ public: } }; -#endif +#endif diff --git a/src/server/shared/Utilities/ServiceWin32.cpp b/src/server/shared/Utilities/ServiceWin32.cpp index f4a0339d9e6..ecf403423f7 100644 --- a/src/server/shared/Utilities/ServiceWin32.cpp +++ b/src/server/shared/Utilities/ServiceWin32.cpp @@ -24,11 +24,6 @@ #include <windows.h> #include <winsvc.h> -// stupid ACE define -#ifdef main -#undef main -#endif //main - #if !defined(WINADVAPI) #if !defined(_ADVAPI32_) #define WINADVAPI DECLSPEC_IMPORT diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index a048a7d3a80..e482e3d4c37 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -146,7 +146,7 @@ BindIP = "0.0.0.0" # # ThreadPool -# Description: Number of threads to be used for the global thread pool +# Description: Number of threads to be used for the global thread pool # The thread pool is currently used for the signal handler and remote access # Default: 1 @@ -170,7 +170,7 @@ UseProcessors = 0 # # ProcessPriority # Description: Process priority setting for Windows and Linux based systems. -# Details: On Linux, a nice value of -15 is used. (requires superuser). +# Details: On Linux, a nice value of -15 is used. (requires superuser). # On Windows, process is set to HIGH class. # Default: 0 - (Normal) # 1 - (High) @@ -1052,7 +1052,7 @@ Account.PasswordChangeSecurity = 0 # # BirthdayTime -# Description: Set to date of project's birth in UNIX time. By default the date when +# Description: Set to date of project's birth in UNIX time. By default the date when # TrinityCore was started (Thu Oct 2, 2008) # Default: 1222964635 # @@ -2605,9 +2605,9 @@ UI.ShowQuestLevelsInDialogs = 0 # 1 - Prefix Timestamp to the text # 2 - Prefix Log Level to the text # 4 - Prefix Log Filter type to the text -# 8 - Append timestamp to the log file name. Format: YYYY-MM-DD_HH-MM-SS +# 8 - Append timestamp to the log file name. Format: YYYY-MM-DD_HH-MM-SS # (Only used with Type = 2) -# 16 - Make a backup of existing file before overwrite +# 16 - Make a backup of existing file before overwrite # (Only used with Mode = w) # # Colors (read as optional1 if Type = Console) @@ -2724,7 +2724,7 @@ Log.Async.Enable = 0 # # Allow.IP.Based.Action.Logging -# Description: Logs actions, e.g. account login and logout to name a few, based on IP of +# Description: Logs actions, e.g. account login and logout to name a few, based on IP of # current session. # Default: 0 - (Disabled) # 1 - (Enabled) diff --git a/src/tools/mmaps_generator/MapBuilder.h b/src/tools/mmaps_generator/MapBuilder.h index 944d03968b5..1d688ccfa77 100644 --- a/src/tools/mmaps_generator/MapBuilder.h +++ b/src/tools/mmaps_generator/MapBuilder.h @@ -35,8 +35,6 @@ using namespace VMAP; -// G3D namespace typedefs conflicts with ACE typedefs - namespace MMAP { struct MapTiles |