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/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; } diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp index 678f5e3e2..3639208ba 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); + gameobject->SetGoState(GO_STATE_ACTIVE); break; case GO_IRON_CLAD_DOOR: if (_encounters[TYPE_CANNON] == DONE) 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) { 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 320d45072..87f29e9a2 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() { @@ -78,6 +79,7 @@ public: 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 df00c9b9a..33ae1d757 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, diff --git a/src/server/scripts/Pet/pet_mage.cpp b/src/server/scripts/Pet/pet_mage.cpp index 6a3d8e320..20e3ae8b4 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,19 @@ 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); - } - } - if (!me->GetVictim() || !me->GetVictim()->IsAlive()) - return; + if (!owner->IsInCombat() && !me->GetVictim()) + EnterEvadeMode(); + } } void Reset() @@ -190,23 +183,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;