From c9f00ca65bb5cfe7b21dd6d8fa740f1319dcddbc Mon Sep 17 00:00:00 2001 From: grimgravy Date: Sun, 4 Mar 2018 17:37:34 +0100 Subject: [PATCH 01/12] Fix the North Portcullis in TOC --- .../instance_trial_of_the_champion.cpp | 20 ++++++++++++++++++- .../trial_of_the_champion.h | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp index fdcd5d44e..e5261037e 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp @@ -51,6 +51,7 @@ public: uint64 NPC_BlackKnightVehicleGUID; uint64 NPC_BlackKnightGUID; uint64 GO_MainGateGUID; + uint64 GO_EnterGateGUID; void Initialize() { @@ -74,10 +75,11 @@ public: memset(&NPC_GrandChampionMinionsGUID, 0, sizeof(NPC_GrandChampionMinionsGUID)); memset(&NPC_ArgentSoldierGUID, 0, sizeof(NPC_ArgentSoldierGUID)); NPC_ArgentChampionGUID = 0; - NPC_MemoryEntry = 0; +1 NPC_MemoryEntry = 0; NPC_BlackKnightVehicleGUID = 0; NPC_BlackKnightGUID = 0; GO_MainGateGUID = 0; + GO_EnterGateGUID = 0; } bool IsEncounterInProgress() const @@ -195,6 +197,10 @@ public: case GO_EAST_PORTCULLIS: HandleGameObject(go->GetGUID(), false, go); break; + case GO_NORTH_PORTCULLIS: + HandleGameObject(go->GetGUID(), true, go); + GO_EnterGateGUID = go->GetGUID(); + break; } } @@ -417,6 +423,7 @@ public: } HandleGameObject(GO_MainGateGUID, false); + HandleGameObject(GO_EnterGateGUID, true); Counter = 0; SaveToDB(); events.Reset(); @@ -503,6 +510,7 @@ public: else announcer->AI()->Talk(TEXT_INTRODUCE_PALETRESS); } + HandleGameObject(GO_EnterGateGUID, false); events.RescheduleEvent(EVENT_START_ARGENT_CHALLENGE_INTRO, 0); break; case INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED: @@ -627,6 +635,7 @@ public: m_auiEncounter[1] = uiData; if( uiData == DONE ) { + HandleGameObject(GO_EnterGateGUID, true); InstanceProgress = INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED; events.ScheduleEvent(EVENT_ARGENT_CHALLENGE_RUN_MIDDLE, 0); } @@ -644,9 +653,15 @@ public: { m_auiEncounter[2] = uiData; if (uiData == NOT_STARTED) + { + HandleGameObject(GO_EnterGateGUID, false); bAchievIveHadWorse = true; + } else if( uiData == DONE ) + { + HandleGameObject(GO_EnterGateGUID, true); InstanceProgress = INSTANCE_PROGRESS_FINISHED; + } } break; case DATA_ACHIEV_IVE_HAD_WORSE: @@ -802,6 +817,7 @@ public: announcer->SetFacingTo(4.714f); if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) ) tirion->AI()->Talk(TEXT_BEGIN); + HandleGameObject(GO_EnterGateGUID, false); } for( uint8 i=0; i<3; ++i ) if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[1][i]) ) @@ -955,6 +971,7 @@ public: if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) ) tirion->AI()->Talk(TEXT_GRATZ_SLAIN_CHAMPIONS); events.PopEvent(); + HandleGameObject(GO_EnterGateGUID, true); } break; case EVENT_RESTORE_ANNOUNCER_GOSSIP: @@ -972,6 +989,7 @@ public: { announcer->SetFacingToObject(gate); HandleGameObject(GO_MainGateGUID, true, gate); + HandleGameObject(GO_EnterGateGUID, false, gate); } if( Counter ) { diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h index 5db3b9571..704e63c59 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h @@ -135,6 +135,7 @@ enum eGameObjects GO_MAIN_GATE = 195647, GO_SOUTH_PORTCULLIS = 195649, GO_EAST_PORTCULLIS = 195648, + GO_NORTH_PORTCULLIS = 195650, GO_CHAMPIONS_LOOT = 195709, GO_CHAMPIONS_LOOT_H = 195710, From ecf34b1ed6ffd5e67c89fd25560b5be73dae5f50 Mon Sep 17 00:00:00 2001 From: BarbzYHOOL Date: Sun, 4 Mar 2018 20:20:06 +0100 Subject: [PATCH 02/12] Fix typo --- .../TrialOfTheChampion/instance_trial_of_the_champion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp index e5261037e..379098a80 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp @@ -75,7 +75,7 @@ public: memset(&NPC_GrandChampionMinionsGUID, 0, sizeof(NPC_GrandChampionMinionsGUID)); memset(&NPC_ArgentSoldierGUID, 0, sizeof(NPC_ArgentSoldierGUID)); NPC_ArgentChampionGUID = 0; -1 NPC_MemoryEntry = 0; + NPC_MemoryEntry = 0; NPC_BlackKnightVehicleGUID = 0; NPC_BlackKnightGUID = 0; GO_MainGateGUID = 0; From 72f9ef756e5a583c17f1e85b30c6e2b3c34ad24b Mon Sep 17 00:00:00 2001 From: Lee Date: Mon, 26 Mar 2018 21:14:34 +0100 Subject: [PATCH 03/12] removed extra space --- .../TrialOfTheChampion/instance_trial_of_the_champion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp index 379098a80..68227ed77 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp @@ -200,7 +200,7 @@ public: case GO_NORTH_PORTCULLIS: HandleGameObject(go->GetGUID(), true, go); GO_EnterGateGUID = go->GetGUID(); - break; + break; } } From 4cb370e1923058053c89d3e2073b9530d90877ff Mon Sep 17 00:00:00 2001 From: talamortis Date: Thu, 29 Mar 2018 01:01:38 +0100 Subject: [PATCH 04/12] More fixes for Mirror Image When player loses target on the mirror image should still attack the current target --- src/server/scripts/Pet/pet_mage.cpp | 35 +++++++++-------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/src/server/scripts/Pet/pet_mage.cpp b/src/server/scripts/Pet/pet_mage.cpp index 6a3d8e320..39266cc38 100644 --- a/src/server/scripts/Pet/pet_mage.cpp +++ b/src/server/scripts/Pet/pet_mage.cpp @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2016+ AzerothCore , released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2 * Copyright (C) 2008-2016 TrinityCore * Copyright (C) 2005-2009 MaNGOS @@ -81,7 +81,7 @@ class npc_pet_mage_mirror_image : public CreatureScript ((Minion*)me)->SetFollowAngle(angle); me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE); - me->SetReactState(REACT_PASSIVE); + me->SetReactState(REACT_DEFENSIVE); // Xinef: Inherit Master's Threat List (not yet implemented) //owner->CastSpell((Unit*)NULL, SPELL_MAGE_MASTERS_THREAT_LIST, true); @@ -149,26 +149,14 @@ class npc_pet_mage_mirror_image : public CreatureScript if (owner && owner->GetTypeId() == TYPEID_PLAYER) { Unit* selection = owner->ToPlayer()->GetSelectedUnit(); - if (selection && selection != me->GetVictim()) - { - // target has cc, search target without cc! - if (selection->HasBreakableByDamageCrowdControlAura() || !me->IsValidAttackTarget(selection)) - { - EnterEvadeMode(); - return; - } + if (selection) + { me->getThreatManager().resetAllAggro(); me->AddThreat(selection, 1000000.0f); - - if (owner->IsInCombat()) - AttackStart(selection); - + AttackStart(selection); } } - - if (!me->GetVictim() || !me->GetVictim()->IsAlive()) - return; } void Reset() @@ -183,6 +171,9 @@ class npc_pet_mage_mirror_image : public CreatureScript if (events.GetTimer() < 1200) return; + if (!me->GetVictim() || !me->GetVictim()->IsAlive()) + EnterEvadeMode(); + if (!me->IsInCombat() || !me->GetVictim()) { MySelectNextTarget(); @@ -190,23 +181,17 @@ class npc_pet_mage_mirror_image : public CreatureScript } checktarget += diff; + if (checktarget >= 1000) { if (me->GetVictim()->HasBreakableByDamageCrowdControlAura() || !me->GetVictim()->IsAlive()) { MySelectNextTarget(); - me->InterruptNonMeleeSpells(true); // Stop casting if target is C or not Alive. + me->InterruptNonMeleeSpells(true); // Stop casting if target is CC or not Alive. return; } } - selectionTimer += diff; - if (selectionTimer >= 1000) - { - MySelectNextTarget(); - selectionTimer = 0; - } - if (me->HasUnitState(UNIT_STATE_CASTING)) return; From 582abe15411128fdea52bb0225960e8f4e317ed5 Mon Sep 17 00:00:00 2001 From: talamortis Date: Thu, 29 Mar 2018 01:11:08 +0100 Subject: [PATCH 05/12] move a bit of code around for mirror image creatureAI --- src/server/scripts/Pet/pet_mage.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/Pet/pet_mage.cpp b/src/server/scripts/Pet/pet_mage.cpp index 39266cc38..20e3ae8b4 100644 --- a/src/server/scripts/Pet/pet_mage.cpp +++ b/src/server/scripts/Pet/pet_mage.cpp @@ -154,8 +154,13 @@ class npc_pet_mage_mirror_image : public CreatureScript { me->getThreatManager().resetAllAggro(); me->AddThreat(selection, 1000000.0f); - AttackStart(selection); + + if (owner->IsInCombat()) + AttackStart(selection); } + + if (!owner->IsInCombat() && !me->GetVictim()) + EnterEvadeMode(); } } @@ -171,9 +176,6 @@ class npc_pet_mage_mirror_image : public CreatureScript if (events.GetTimer() < 1200) return; - if (!me->GetVictim() || !me->GetVictim()->IsAlive()) - EnterEvadeMode(); - if (!me->IsInCombat() || !me->GetVictim()) { MySelectNextTarget(); From 5133af7b87cb751f117c4f8454b37d3245d3a7db Mon Sep 17 00:00:00 2001 From: Barbz Date: Thu, 29 Mar 2018 18:33:55 +0200 Subject: [PATCH 06/12] DB - Areatrigger - Removes warnings when booting the server (#819) * DB - Areatrigger - Removes warnings when booting the server There are 3 triggers that are from the areatrigger.dbc which are useless since the linked maps don't exist. It's probably a mistake from blizz. * Wrong database chosen... --- data/sql/updates/pending_db_world/rev_1522263653566045620.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1522263653566045620.sql diff --git a/data/sql/updates/pending_db_world/rev_1522263653566045620.sql b/data/sql/updates/pending_db_world/rev_1522263653566045620.sql new file mode 100644 index 000000000..59ea42e97 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1522263653566045620.sql @@ -0,0 +1,3 @@ +INSERT INTO version_db_world(sql_rev) VALUES ('1522263653566045620'); + +DELETE FROM `areatrigger` WHERE map IN (24,28); From 00cde32cd4142b96abb9b816bb9326125b5e084f Mon Sep 17 00:00:00 2001 From: Travis CI Date: Thu, 29 Mar 2018 16:35:34 +0000 Subject: [PATCH 07/12] Importing pending sql --- data/sql/updates/db_world/2018_03_29_00.sql | 28 +++++++++++++++++++ .../rev_1522263653566045620.sql | 3 -- 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 data/sql/updates/db_world/2018_03_29_00.sql delete mode 100644 data/sql/updates/pending_db_world/rev_1522263653566045620.sql diff --git a/data/sql/updates/db_world/2018_03_29_00.sql b/data/sql/updates/db_world/2018_03_29_00.sql new file mode 100644 index 000000000..3556285b1 --- /dev/null +++ b/data/sql/updates/db_world/2018_03_29_00.sql @@ -0,0 +1,28 @@ +-- DB update 2018_03_11_00 -> 2018_03_29_00 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2018_03_11_00'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2018_03_11_00 2018_03_29_00 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1522263653566045620'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- + +INSERT INTO version_db_world(sql_rev) VALUES ('1522263653566045620'); + +DELETE FROM `areatrigger` WHERE map IN (24,28); + +-- +-- END UPDATING QUERIES +-- +COMMIT; +END // +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1522263653566045620.sql b/data/sql/updates/pending_db_world/rev_1522263653566045620.sql deleted file mode 100644 index 59ea42e97..000000000 --- a/data/sql/updates/pending_db_world/rev_1522263653566045620.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO version_db_world(sql_rev) VALUES ('1522263653566045620'); - -DELETE FROM `areatrigger` WHERE map IN (24,28); From 68c0d298ce84f2936c392a2283463f7fc5cb76b8 Mon Sep 17 00:00:00 2001 From: talamortis Date: Sat, 31 Mar 2018 18:05:44 +0100 Subject: [PATCH 08/12] After killing Rhahk in deadmines the door will now open correctly. --- .../scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp index 678f5e3e2..0894f827e 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp @@ -1,4 +1,4 @@ -/* +/* * Originally written by Xinef - Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3 */ @@ -28,7 +28,7 @@ class instance_deadmines : public InstanceMapScript { case GO_FACTORY_DOOR: if (_encounters[TYPE_RHAHK_ZOR] == DONE) - HandleGameObject(0, true, gameobject); + HandleGameObject(30533, true, gameobject); break; case GO_IRON_CLAD_DOOR: if (_encounters[TYPE_CANNON] == DONE) From a6e10f2ab2b57463a1261c526db909d31f116691 Mon Sep 17 00:00:00 2001 From: talamortis Date: Sat, 31 Mar 2018 18:45:46 +0100 Subject: [PATCH 09/12] Instace to return the guid of the gameobject --- .../EasternKingdoms/Deadmines/instance_deadmines.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp index 0894f827e..5c8c643f6 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp @@ -22,13 +22,22 @@ class instance_deadmines : public InstanceMapScript memset(&_encounters, 0, sizeof(_encounters)); } + uint64 GetData64(uint32 data) const override + { + switch (data) + { + GO_FACTORY_DOOR: return DATA_FACTORY_DOORGUID; + } + } + void OnGameObjectCreate(GameObject* gameobject) { switch (gameobject->GetEntry()) { case GO_FACTORY_DOOR: + DATA_FACTORY_DOORGUID = gameobject->GetGUID(); if (_encounters[TYPE_RHAHK_ZOR] == DONE) - HandleGameObject(30533, true, gameobject); + gameobject->SetGoState(GO_STATE_ACTIVE); break; case GO_IRON_CLAD_DOOR: if (_encounters[TYPE_CANNON] == DONE) @@ -79,6 +88,7 @@ class instance_deadmines : public InstanceMapScript private: uint32 _encounters[MAX_ENCOUNTERS]; + uint64 DATA_FACTORY_DOORGUID; }; InstanceScript* GetInstanceScript(InstanceMap* map) const From d7e4799728216eaa2f91e5427f9e79644814ef36 Mon Sep 17 00:00:00 2001 From: talamortis Date: Sat, 31 Mar 2018 19:46:28 +0100 Subject: [PATCH 10/12] removed unused code - fix Travis --- .../EasternKingdoms/Deadmines/instance_deadmines.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp index 5c8c643f6..3639208ba 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp @@ -22,20 +22,11 @@ class instance_deadmines : public InstanceMapScript memset(&_encounters, 0, sizeof(_encounters)); } - uint64 GetData64(uint32 data) const override - { - switch (data) - { - GO_FACTORY_DOOR: return DATA_FACTORY_DOORGUID; - } - } - void OnGameObjectCreate(GameObject* gameobject) { switch (gameobject->GetEntry()) { case GO_FACTORY_DOOR: - DATA_FACTORY_DOORGUID = gameobject->GetGUID(); if (_encounters[TYPE_RHAHK_ZOR] == DONE) gameobject->SetGoState(GO_STATE_ACTIVE); break; @@ -88,7 +79,6 @@ class instance_deadmines : public InstanceMapScript private: uint32 _encounters[MAX_ENCOUNTERS]; - uint64 DATA_FACTORY_DOORGUID; }; InstanceScript* GetInstanceScript(InstanceMap* map) const From 77abc1df0ed415d4a7abcc4365faa8ad9b2ada36 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 31 Mar 2018 23:35:00 +0300 Subject: [PATCH 11/12] Core/Misc: Fixed memory leak in trade handler --- src/server/game/Handlers/TradeHandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index aece2d3d6..2989f2197 100644 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -427,6 +427,8 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) trader->GetSession()->SendNotification(LANG_NOT_PARTNER_FREE_TRADE_SLOTS); my_trade->SetAccepted(false); his_trade->SetAccepted(false); + delete my_spell; + delete his_spell; return; } else if (!hisCanCompleteTrade) @@ -437,6 +439,8 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) trader->GetSession()->SendNotification(LANG_NOT_FREE_TRADE_SLOTS); my_trade->SetAccepted(false); his_trade->SetAccepted(false); + delete my_spell; + delete his_spell; return; } From 05ed0597c04ec1eb1a708ee4358ef5bfd5668a80 Mon Sep 17 00:00:00 2001 From: talamortis Date: Sun, 1 Apr 2018 16:55:50 +0100 Subject: [PATCH 12/12] Tome of Valor should no longer desapwn the creature --- src/server/scripts/EasternKingdoms/zone_westfall.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/zone_westfall.cpp b/src/server/scripts/EasternKingdoms/zone_westfall.cpp index a9675bf21..ab68c203a 100644 --- a/src/server/scripts/EasternKingdoms/zone_westfall.cpp +++ b/src/server/scripts/EasternKingdoms/zone_westfall.cpp @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2016+ AzerothCore , released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2 * Copyright (C) 2008-2016 TrinityCore * Copyright (C) 2005-2009 MaNGOS @@ -85,11 +85,9 @@ public: void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); + if (!player) - { - me->DespawnOrUnsummon(1); return; - } switch (waypointId) {