From 1b57196b4e73150a136f37583ec5760f4ce602cf Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sun, 9 Aug 2015 10:50:16 +0200 Subject: [PATCH] Core/Misc: 3.3.5a fixes --- .../game/Entities/GameObject/GameObject.cpp | 3 +- src/server/game/Entities/Unit/Unit.cpp | 1 - src/server/game/Scripting/ScriptLoader.cpp | 2 - src/server/game/Spells/Spell.cpp | 2 +- src/server/scripts/Kalimdor/CMakeLists.txt | 1 - .../scripts/Kalimdor/zone_teldrassil.cpp | 115 ------------------ 6 files changed, 3 insertions(+), 121 deletions(-) delete mode 100644 src/server/scripts/Kalimdor/zone_teldrassil.cpp diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index fc761ce69ee..f8aa744594e 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -115,7 +115,8 @@ void GameObject::RemoveFromOwner() return; } - TC_LOG_FATAL("misc", "Removed GameObject (GUID: %u Entry: %u SpellId: %u LinkedGO: %u) that just lost any reference to the owner (%s) GO list", + // This happens when a mage portal is despawned after the caster changes map (for example using the portal) + TC_LOG_DEBUG("misc", "Removed GameObject (GUID: %u Entry: %u SpellId: %u LinkedGO: %u) that just lost any reference to the owner (%s) GO list", GetGUIDLow(), GetGOInfo()->entry, m_spellId, GetGOInfo()->GetLinkedGameObjectEntry(), ownerGUID.ToString().c_str()); SetOwnerGUID(ObjectGuid::Empty); } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index d38373193c2..f804240b66a 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -8197,7 +8197,6 @@ Unit* Unit::GetMagicHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo) { if (Unit* magnet = (*itr)->GetBase()->GetCaster()) if (spellInfo->CheckExplicitTarget(this, magnet) == SPELL_CAST_OK - && spellInfo->CheckTarget(this, magnet, false) == SPELL_CAST_OK && _IsValidAttackTarget(magnet, spellInfo)) { /// @todo handle this charge drop by proc in cast phase on explicit target diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index aa8be4946e4..ed3ca929221 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -372,7 +372,6 @@ void AddSC_orgrimmar(); void AddSC_silithus(); void AddSC_stonetalon_mountains(); void AddSC_tanaris(); -void AddSC_teldrassil(); void AddSC_the_barrens(); void AddSC_thousand_needles(); void AddSC_thunder_bluff(); @@ -1094,7 +1093,6 @@ void AddKalimdorScripts() AddSC_silithus(); AddSC_stonetalon_mountains(); AddSC_tanaris(); - AddSC_teldrassil(); AddSC_the_barrens(); AddSC_thousand_needles(); AddSC_thunder_bluff(); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index d8ce008a585..b2856118f30 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -730,7 +730,7 @@ void Spell::SelectExplicitTargets() { // check for explicit target redirection, for Grounding Totem for example if (m_spellInfo->GetExplicitTargetMask() & TARGET_FLAG_UNIT_ENEMY - || (m_spellInfo->GetExplicitTargetMask() & TARGET_FLAG_UNIT && !m_spellInfo->IsPositive())) + || (m_spellInfo->GetExplicitTargetMask() & TARGET_FLAG_UNIT && !m_caster->IsFriendlyTo(target))) { Unit* redirect; switch (m_spellInfo->DmgClass) diff --git a/src/server/scripts/Kalimdor/CMakeLists.txt b/src/server/scripts/Kalimdor/CMakeLists.txt index 8c3f3216e91..c8fd976765a 100644 --- a/src/server/scripts/Kalimdor/CMakeLists.txt +++ b/src/server/scripts/Kalimdor/CMakeLists.txt @@ -110,7 +110,6 @@ set(scripts_STAT_SRCS Kalimdor/zone_winterspring.cpp Kalimdor/zone_thousand_needles.cpp Kalimdor/zone_ashenvale.cpp - Kalimdor/zone_teldrassil.cpp Kalimdor/OnyxiasLair/boss_onyxia.cpp Kalimdor/OnyxiasLair/onyxias_lair.h Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp diff --git a/src/server/scripts/Kalimdor/zone_teldrassil.cpp b/src/server/scripts/Kalimdor/zone_teldrassil.cpp deleted file mode 100644 index 2173cd6de06..00000000000 --- a/src/server/scripts/Kalimdor/zone_teldrassil.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (C) 2008-2015 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * 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 . - */ - -/* ScriptData -SDName: Teldrassil -SD%Complete: 100 -SDComment: Quest support: 938 -SDCategory: Teldrassil -EndScriptData */ - -/* ContentData -npc_mist -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedFollowerAI.h" -#include "Player.h" - -/*#### -# npc_mist -####*/ - -enum Mist -{ - SAY_AT_HOME = 0, - EMOTE_AT_HOME = 1, - QUEST_MIST = 938, - NPC_ARYNIA = 3519, - FACTION_DARNASSUS = 79 -}; - -class npc_mist : public CreatureScript -{ -public: - npc_mist() : CreatureScript("npc_mist") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override - { - if (quest->GetQuestId() == QUEST_MIST) - if (npc_mistAI* pMistAI = CAST_AI(npc_mist::npc_mistAI, creature->AI())) - pMistAI->StartFollow(player, FACTION_DARNASSUS, quest); - - return true; - } - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_mistAI(creature); - } - - struct npc_mistAI : public FollowerAI - { - npc_mistAI(Creature* creature) : FollowerAI(creature) { } - - void Reset() override { } - - void MoveInLineOfSight(Unit* who) override - - { - FollowerAI::MoveInLineOfSight(who); - - if (!me->GetVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_ARYNIA) - { - if (me->IsWithinDistInMap(who, 10.0f)) - { - Talk(SAY_AT_HOME, who); - DoComplete(); - } - } - } - - void DoComplete() - { - Talk(EMOTE_AT_HOME); - - Player* player = GetLeaderForFollower(); - if (player && player->GetQuestStatus(QUEST_MIST) == QUEST_STATUS_INCOMPLETE) - player->GroupEventHappens(QUEST_MIST, me); - - //The follow is over (and for later development, run off to the woods before really end) - SetFollowComplete(); - } - - //call not needed here, no known abilities - /*void UpdateFollowerAI(const uint32 Diff) override - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - }*/ - }; - -}; - -void AddSC_teldrassil() -{ - new npc_mist(); -}