aboutsummaryrefslogtreecommitdiff
path: root/src/server/game
diff options
context:
space:
mode:
authorVincent_Michael <Vincent_Michael@gmx.de>2013-12-08 20:27:46 +0100
committerVincent_Michael <Vincent_Michael@gmx.de>2013-12-08 20:27:46 +0100
commite8be55aa8b3facd776303a34acf6048f50dcfa51 (patch)
treedb95abc0bd54a7693025306c3b435d672da00800 /src/server/game
parent214d0822ce41fb326a9763ae7507923fdfa659f1 (diff)
parent5c15e88da9037af885c40a55aeea581c520148d7 (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/AI/CoreAI/TotemAI.cpp src/server/game/Entities/Player/Player.cpp src/server/game/Entities/Unit/Unit.cpp src/server/game/Globals/ObjectMgr.cpp src/server/game/Guilds/Guild.cpp src/server/game/Guilds/Guild.h src/server/game/Movement/Spline/MoveSplineInit.cpp src/server/game/Movement/Spline/MovementPacketBuilder.cpp src/server/game/Movement/Spline/MovementPacketBuilder.h src/server/game/Spells/SpellMgr.cpp src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp src/server/scripts/Kalimdor/zone_mulgore.cpp src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp src/server/shared/Database/Implementation/CharacterDatabase.cpp
Diffstat (limited to 'src/server/game')
-rw-r--r--src/server/game/AI/CoreAI/CombatAI.cpp2
-rw-r--r--src/server/game/AI/CoreAI/CombatAI.h8
-rw-r--r--src/server/game/AI/CoreAI/UnitAI.h5
-rw-r--r--src/server/game/AI/CreatureAIFactory.h1
-rw-r--r--src/server/game/AI/CreatureAISelector.cpp1
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.cpp19
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp20
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.h20
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp20
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h20
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedGossip.h19
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp6
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.h2
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp59
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.h4
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp2
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h20
-rw-r--r--src/server/game/Accounts/AccountMgr.cpp2
-rw-r--r--src/server/game/Accounts/RBAC.h6
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp6
-rw-r--r--src/server/game/Chat/ChatLink.h10
-rw-r--r--src/server/game/Combat/UnitEvents.h8
-rw-r--r--src/server/game/Entities/AreaTrigger/AreaTrigger.cpp2
-rw-r--r--src/server/game/Entities/Creature/Creature.h8
-rw-r--r--src/server/game/Entities/GameObject/GameObject.cpp3
-rw-r--r--src/server/game/Entities/Object/Object.h5
-rw-r--r--src/server/game/Entities/Pet/Pet.cpp33
-rw-r--r--src/server/game/Entities/Player/Player.cpp141
-rw-r--r--src/server/game/Entities/Player/Player.h2
-rw-r--r--src/server/game/Entities/Transport/Transport.cpp7
-rw-r--r--src/server/game/Entities/Transport/Transport.h1
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp18
-rw-r--r--src/server/game/Entities/Unit/Unit.h2
-rw-r--r--src/server/game/Entities/Vehicle/Vehicle.cpp2
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp40
-rw-r--r--src/server/game/Globals/ObjectMgr.h8
-rw-r--r--src/server/game/Guilds/Guild.cpp11
-rw-r--r--src/server/game/Guilds/Guild.h5
-rw-r--r--src/server/game/Handlers/MovementHandler.cpp7
-rw-r--r--src/server/game/Handlers/PetHandler.cpp10
-rw-r--r--src/server/game/Handlers/QueryHandler.cpp2
-rw-r--r--src/server/game/Maps/Map.cpp2
-rw-r--r--src/server/game/Maps/TransportMgr.cpp6
-rw-r--r--src/server/game/Maps/TransportMgr.h4
-rw-r--r--src/server/game/Movement/PathGenerator.cpp2
-rw-r--r--src/server/game/Movement/Spline/MovementUtil.cpp2
-rw-r--r--src/server/game/Scripting/MapScripts.cpp4
-rw-r--r--src/server/game/Scripting/ScriptLoader.cpp74
-rw-r--r--src/server/game/Spells/SpellEffects.cpp55
-rw-r--r--src/server/game/Spells/SpellMgr.cpp4
-rw-r--r--src/server/game/World/World.cpp10
-rw-r--r--src/server/game/World/World.h6
52 files changed, 512 insertions, 224 deletions
diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp
index 723f8262181..4f015e3f016 100644
--- a/src/server/game/AI/CoreAI/CombatAI.cpp
+++ b/src/server/game/AI/CoreAI/CombatAI.cpp
@@ -330,7 +330,7 @@ void VehicleAI::CheckConditions(const uint32 diff)
{
if (!conditions.empty())
{
- if( Vehicle* vehicleKit = me->GetVehicleKit())
+ if (Vehicle* vehicleKit = me->GetVehicleKit())
for (SeatMap::iterator itr = vehicleKit->Seats.begin(); itr != vehicleKit->Seats.end(); ++itr)
if (Unit* passenger = ObjectAccessor::GetUnit(*me, itr->second.Passenger.Guid))
{
diff --git a/src/server/game/AI/CoreAI/CombatAI.h b/src/server/game/AI/CoreAI/CombatAI.h
index 16167d1be59..3fac2c78962 100644
--- a/src/server/game/AI/CoreAI/CombatAI.h
+++ b/src/server/game/AI/CoreAI/CombatAI.h
@@ -72,7 +72,7 @@ struct ArcherAI : public CreatureAI
void AttackStart(Unit* who);
void UpdateAI(uint32 diff);
- static int Permissible(const Creature*);
+ static int Permissible(Creature const*);
protected:
float m_minRange;
};
@@ -81,11 +81,11 @@ struct TurretAI : public CreatureAI
{
public:
explicit TurretAI(Creature* c);
- bool CanAIAttack(const Unit* who) const;
+ bool CanAIAttack(Unit const* who) const;
void AttackStart(Unit* who);
void UpdateAI(uint32 diff);
- static int Permissible(const Creature*);
+ static int Permissible(Creature const*);
protected:
float m_minRange;
};
@@ -98,7 +98,7 @@ struct VehicleAI : public CreatureAI
explicit VehicleAI(Creature* c);
void UpdateAI(uint32 diff);
- static int Permissible(const Creature*);
+ static int Permissible(Creature const*);
void Reset();
void MoveInLineOfSight(Unit*) { }
void AttackStart(Unit*) { }
diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h
index 71fc86f112b..33a09fd03b0 100644
--- a/src/server/game/AI/CoreAI/UnitAI.h
+++ b/src/server/game/AI/CoreAI/UnitAI.h
@@ -26,7 +26,6 @@
class Player;
class Quest;
-class Unit;
struct AISpellInfoType;
//Selection method used by SelectTarget
@@ -142,9 +141,9 @@ class UnitAI
virtual uint64 GetGUID(int32 /*id*/ = 0) const { return 0; }
Unit* SelectTarget(SelectAggroTarget targetType, uint32 position = 0, float dist = 0.0f, bool playerOnly = false, int32 aura = 0);
- // Select the targets satifying the predicate.
+ // Select the targets satisfying the predicate.
// predicate shall extend std::unary_function<Unit*, bool>
- template <class PREDICATE> Unit* SelectTarget(SelectAggroTarget targetType, uint32 position, PREDICATE const& predicate)
+ template<class PREDICATE> Unit* SelectTarget(SelectAggroTarget targetType, uint32 position, PREDICATE const& predicate)
{
ThreatContainer::StorageType const& threatlist = me->getThreatManager().getThreatList();
if (position >= threatlist.size())
diff --git a/src/server/game/AI/CreatureAIFactory.h b/src/server/game/AI/CreatureAIFactory.h
index 30576cf28bd..809c17cadb8 100644
--- a/src/server/game/AI/CreatureAIFactory.h
+++ b/src/server/game/AI/CreatureAIFactory.h
@@ -15,6 +15,7 @@
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
#ifndef TRINITY_CREATUREAIFACTORY_H
#define TRINITY_CREATUREAIFACTORY_H
diff --git a/src/server/game/AI/CreatureAISelector.cpp b/src/server/game/AI/CreatureAISelector.cpp
index ec2d3687f5f..597ad24d4e1 100644
--- a/src/server/game/AI/CreatureAISelector.cpp
+++ b/src/server/game/AI/CreatureAISelector.cpp
@@ -147,4 +147,3 @@ namespace FactorySelector
return (ai_factory == NULL ? new NullGameObjectAI(go) : ai_factory->Create(go));
}
}
-
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
index 9fa7ea2f870..c70fc45be33 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
@@ -1,9 +1,20 @@
-/* Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+/*
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
- * Thanks to the original authors: 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 free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
+ * 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/>.
+ */
#include "ScriptedCreature.h"
#include "Item.h"
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index ca4b06742ef..dbc8989c530 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -1,6 +1,20 @@
-/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
+/*
+ * Copyright (C) 2008-2013 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: Npc_EscortAI
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
index 4b0f4e97a1c..280990fd648 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
@@ -1,6 +1,20 @@
-/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
+/*
+ * Copyright (C) 2008-2013 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/>.
+ */
#ifndef SC_ESCORTAI_H
#define SC_ESCORTAI_H
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
index 41b6c962471..5cc128fda5f 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
@@ -1,6 +1,20 @@
-/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
+/*
+ * Copyright (C) 2008-2013 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: FollowerAI
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h
index cdd6d31c0b4..c1fa3275bb8 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h
@@ -1,6 +1,20 @@
-/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
+/*
+ * Copyright (C) 2008-2013 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/>.
+ */
#ifndef SC_FOLLOWERAI_H
#define SC_FOLLOWERAI_H
diff --git a/src/server/game/AI/ScriptedAI/ScriptedGossip.h b/src/server/game/AI/ScriptedAI/ScriptedGossip.h
index 93add2ae652..5e76c1f83f4 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedGossip.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedGossip.h
@@ -1,9 +1,20 @@
-/* Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+/*
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
- * Thanks to the original authors: 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 free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
+ * 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/>.
+ */
#ifndef SC_GOSSIP_H
#define SC_GOSSIP_H
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index ae3f7078f5c..c367ba0a5ed 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -460,7 +460,6 @@ void SmartAI::EnterEvadeMode()
me->LoadCreaturesAddon();
me->SetLootRecipient(NULL);
me->ResetPlayerDamageReq();
-
GetScript()->ProcessEventsFor(SMART_EVENT_EVADE);//must be after aura clear so we can cast spells from db
SetRun(mRun);
@@ -588,6 +587,9 @@ int SmartAI::Permissible(const Creature* creature)
void SmartAI::JustReachedHome()
{
GetScript()->ProcessEventsFor(SMART_EVENT_REACHED_HOME);
+
+ if (!UpdateVictim() && me->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE && me->GetWaypointPath())
+ me->ToCreature()->GetMotionMaster()->MovePath(me->GetWaypointPath(), true);
}
void SmartAI::EnterCombat(Unit* enemy)
@@ -787,6 +789,8 @@ void SmartAI::SetCombatMove(bool on)
}
else
{
+ me->GetMotionMaster()->MovementExpired();
+ me->GetMotionMaster()->Clear(true);
me->StopMoving();
me->GetMotionMaster()->MoveIdle();
}
diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h
index ae6719aa8f3..92637b17f25 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.h
+++ b/src/server/game/AI/SmartScripts/SmartAI.h
@@ -56,7 +56,7 @@ class SmartAI : public CreatureAI
void EndPath(bool fail = false);
void ResumePath();
WayPoint* GetNextWayPoint();
- bool HasEscortState(uint32 uiEscortState) { return (mEscortState & uiEscortState); }
+ bool HasEscortState(uint32 uiEscortState) const { return (mEscortState & uiEscortState) != 0; }
void AddEscortState(uint32 uiEscortState) { mEscortState |= uiEscortState; }
void RemoveEscortState(uint32 uiEscortState) { mEscortState &= ~uiEscortState; }
void SetAutoAttack(bool on) { mCanAutoAttack = on; }
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 0cb68e2fd05..e98c196d6e3 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -168,12 +168,12 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
- if (IsCreature((*itr)) && !(*itr)->ToCreature()->IsPet()) // Prevented sending text to pets.
+ if (IsCreature(*itr) && !(*itr)->ToCreature()->IsPet()) // Prevented sending text to pets.
{
talker = (*itr)->ToCreature();
break;
}
- else if (IsPlayer((*itr)))
+ else if (IsPlayer(*itr))
{
targetPlayer = (*itr)->ToPlayer();
break;
@@ -516,7 +516,26 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS)
me->InterruptNonMeleeSpells(false);
+ if (e.action.cast.flags & SMARTCAST_COMBAT_MOVE)
+ {
+ // If cast flag SMARTCAST_COMBAT_MOVE is set combat movement will not be allowed
+ // unless target is outside spell range, out of mana, or LOS.
+
+ bool _allowMove = false;
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(e.action.cast.spell);
+ int32 mana = me->GetPower(POWER_MANA);
+
+ if (me->GetDistance((*itr)->ToUnit()) > spellInfo->GetMaxRange(true) ||
+ me->GetDistance((*itr)->ToUnit()) < spellInfo->GetMinRange(true) ||
+ !me->ToUnit()->IsWithinLOSInMap((*itr)->ToUnit()) ||
+ mana < spellInfo->CalcPowerCost(me, spellInfo->GetSchoolMask()))
+ _allowMove = true;
+
+ CAST_AI(SmartAI, me->AI())->SetCombatMove(_allowMove);
+ }
+
me->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED));
+
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_CAST:: Creature %u casts spell %u on target %u with castflags %u",
me->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags);
}
@@ -542,17 +561,17 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (!IsUnit(*itr))
continue;
- if (!(e.action.cast.flags & SMARTCAST_AURA_NOT_PRESENT) || !(*itr)->ToUnit()->HasAura(e.action.cast.spell))
- {
- if (e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS)
- tempLastInvoker->InterruptNonMeleeSpells(false);
+ if (!(e.action.cast.flags & SMARTCAST_AURA_NOT_PRESENT) || !(*itr)->ToUnit()->HasAura(e.action.cast.spell))
+ {
+ if (e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS)
+ tempLastInvoker->InterruptNonMeleeSpells(false);
- tempLastInvoker->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED));
- TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_INVOKER_CAST: Invoker %u casts spell %u on target %u with castflags %u",
- tempLastInvoker->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags);
- }
- else
- TC_LOG_DEBUG("scripts.ai", "Spell %u not casted because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*itr)->GetGUID(), (*itr)->GetEntry(), uint32((*itr)->GetTypeId()));
+ tempLastInvoker->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED));
+ TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_INVOKER_CAST: Invoker %u casts spell %u on target %u with castflags %u",
+ tempLastInvoker->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags);
+ }
+ else
+ TC_LOG_DEBUG("scripts.ai", "Spell %u not casted because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*itr)->GetGUID(), (*itr)->GetEntry(), uint32((*itr)->GetTypeId()));
}
delete targets;
@@ -784,13 +803,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
- if (!IsUnit((*itr)))
+ if (!IsUnit(*itr))
continue;
- if (e.action.removeAura.spell == 0)
- (*itr)->ToUnit()->RemoveAllAuras();
- else
+ if (e.action.removeAura.spell)
(*itr)->ToUnit()->RemoveAurasDueToSpell(e.action.removeAura.spell);
+ else
+ (*itr)->ToUnit()->RemoveAllAuras();
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_REMOVEAURASFROMSPELL: Unit %u, spell %u",
(*itr)->GetGUIDLow(), e.action.removeAura.spell);
@@ -810,7 +829,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
- if (IsUnit((*itr)))
+ if (IsUnit(*itr))
{
CAST_AI(SmartAI, me->AI())->SetFollow((*itr)->ToUnit(), (float)e.action.follow.dist, (float)e.action.follow.angle, e.action.follow.credit, e.action.follow.entry, e.action.follow.creditType);
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_FOLLOW: Creature %u following target %u",
@@ -1673,6 +1692,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (!IsUnit(*itr))
continue;
+ Unit* unit = (*itr)->ToUnit();
+
bool interruptedSpell = false;
for (ObjectList::const_iterator it = targets->begin(); it != targets->end(); ++it)
@@ -1684,11 +1705,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
if (!interruptedSpell && e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS)
{
- (*itr)->ToUnit()->InterruptNonMeleeSpells(false);
+ unit->InterruptNonMeleeSpells(false);
interruptedSpell = true;
}
- (*itr)->ToUnit()->CastSpell((*it)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED));
+ unit->CastSpell((*it)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED));
}
else
TC_LOG_DEBUG("scripts.ai", "Spell %u not casted because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*it)->GetGUID(), (*it)->GetEntry(), uint32((*it)->GetTypeId()));
diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h
index e320e122d0f..f9eff2ec96e 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.h
+++ b/src/server/game/AI/SmartScripts/SmartScript.h
@@ -244,7 +244,7 @@ class SmartScript
SMARTAI_TEMPLATE mTemplate;
void InstallEvents();
- void RemoveStoredEvent (uint32 id)
+ void RemoveStoredEvent(uint32 id)
{
if (!mStoredEvents.empty())
{
@@ -258,7 +258,7 @@ class SmartScript
}
}
}
- SmartScriptHolder FindLinkedEvent (uint32 link)
+ SmartScriptHolder FindLinkedEvent(uint32 link)
{
if (!mEvents.empty())
{
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 27adb44f452..74d2d5c49a1 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -441,7 +441,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_EVENT_VICTIM_CASTING:
if (e.event.targetCasting.spellId > 0 && !sSpellMgr->GetSpellInfo(e.event.targetCasting.spellId))
{
- sLog->outError("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Spell entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell);
+ TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Spell entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell);
return false;
}
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index 07e700ddb46..093f71ad1bd 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -736,7 +736,7 @@ struct SmartAction
} summonGO;
struct
- {
+ {
uint32 state;
} active;
@@ -1281,10 +1281,11 @@ enum SmartCastFlags
{
SMARTCAST_INTERRUPT_PREVIOUS = 0x01, //Interrupt any spell casting
SMARTCAST_TRIGGERED = 0x02, //Triggered (this makes spell cost zero mana and have no cast time)
- //CAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range
- //CAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range
- //CAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself
- SMARTCAST_AURA_NOT_PRESENT = 0x20 //Only casts the spell if the target does not have an aura from the spell
+ //SMARTCAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range
+ //SMARTCAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range
+ //SMARTCAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself
+ SMARTCAST_AURA_NOT_PRESENT = 0x20, //Only casts the spell if the target does not have an aura from the spell
+ SMARTCAST_COMBAT_MOVE = 0x40 //Prevents combat movement if cast successful. Allows movement on range, OOM, LOS
};
// one line in DB is one event
@@ -1303,11 +1304,10 @@ struct SmartScriptHolder
SmartAction action;
SmartTarget target;
- public:
- uint32 GetScriptType() const { return (uint32)source_type; }
- uint32 GetEventType() const { return (uint32)event.type; }
- uint32 GetActionType() const { return (uint32)action.type; }
- uint32 GetTargetType() const { return (uint32)target.type; }
+ uint32 GetScriptType() const { return (uint32)source_type; }
+ uint32 GetEventType() const { return (uint32)event.type; }
+ uint32 GetActionType() const { return (uint32)action.type; }
+ uint32 GetTargetType() const { return (uint32)target.type; }
uint32 timer;
bool active;
diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp
index b80df5018e4..4c71a044488 100644
--- a/src/server/game/Accounts/AccountMgr.cpp
+++ b/src/server/game/Accounts/AccountMgr.cpp
@@ -459,7 +459,7 @@ void AccountMgr::LoadRBAC()
{
Field* field = result->Fetch();
uint32 newId = field[0].GetUInt32();
- if (secId != newId)
+ if (secId != newId || permissions == NULL)
{
secId = newId;
permissions = &_defaultPermissions[secId];
diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h
index 1f55ebd4996..bdc1d39713f 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_COMMAND_RELOAD_ALL_EVENTAI = 614,
+ RBAC_PERM_UNUSED_614 = 614, // unused
RBAC_PERM_COMMAND_RELOAD_ALL_GOSSIP = 615,
RBAC_PERM_COMMAND_RELOAD_ALL_ITEM = 616,
RBAC_PERM_COMMAND_RELOAD_ALL_LOCALES = 617,
@@ -534,8 +534,8 @@ enum RBACPermissions
RBAC_PERM_COMMAND_RELOAD_COMMAND = 628,
RBAC_PERM_COMMAND_RELOAD_CONDITIONS = 629,
RBAC_PERM_COMMAND_RELOAD_CONFIG = 630,
- RBAC_PERM_COMMAND_RELOAD_CREATURE_AI_SCRIPTS = 631,
- RBAC_PERM_COMMAND_RELOAD_CREATURE_AI_TEXTS = 632,
+ RBAC_PERM_UNUSED_631 = 631, // unused
+ RBAC_PERM_UNUSED_632 = 632, // unused
RBAC_PERM_COMMAND_RELOAD_CREATURE_LINKED_RESPAWN = 633,
RBAC_PERM_COMMAND_RELOAD_CREATURE_LOOT_TEMPLATE = 634,
RBAC_PERM_COMMAND_RELOAD_CREATURE_ONKILL_REPUTATION = 635,
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
index c4e8ba49ba9..aa3568a62d5 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
@@ -558,8 +558,12 @@ void BattlegroundIC::UpdateNodeWorldState(ICNodePoint* nodePoint)
uint32 worldstate = nodePoint->worldStates[nodePoint->nodeState];
// with this we are sure we dont bug the client
- for (uint8 i = 0; i < 4; ++i)
+ for (uint8 i = 0; i < 5; ++i)
+ {
+ if (nodePoint->worldStates[i] == worldstate)
+ continue;
UpdateWorldState(nodePoint->worldStates[i], 0);
+ }
UpdateWorldState(worldstate, 1);
}
diff --git a/src/server/game/Chat/ChatLink.h b/src/server/game/Chat/ChatLink.h
index 76ce4662d6f..29704396b88 100644
--- a/src/server/game/Chat/ChatLink.h
+++ b/src/server/game/Chat/ChatLink.h
@@ -56,7 +56,10 @@ protected:
class ItemChatLink : public ChatLink
{
public:
- ItemChatLink() : ChatLink(), _item(NULL), _suffix(NULL), _property(NULL) { }
+ ItemChatLink() : ChatLink(), _item(NULL), _suffix(NULL), _property(NULL)
+ {
+ memset(_data, 0, sizeof(_data));
+ }
virtual bool Initialize(std::istringstream& iss);
virtual bool ValidateName(char* buffer, const char* context);
@@ -98,7 +101,10 @@ protected:
class AchievementChatLink : public ChatLink
{
public:
- AchievementChatLink() : ChatLink(), _guid(0), _achievement(NULL) { }
+ AchievementChatLink() : ChatLink(), _guid(0), _achievement(NULL)
+ {
+ memset(_data, 0, sizeof(_data));
+ }
virtual bool Initialize(std::istringstream& iss);
virtual bool ValidateName(char* buffer, const char* context);
diff --git a/src/server/game/Combat/UnitEvents.h b/src/server/game/Combat/UnitEvents.h
index 0e568d139a8..8bb7d95a384 100644
--- a/src/server/game/Combat/UnitEvents.h
+++ b/src/server/game/Combat/UnitEvents.h
@@ -93,13 +93,13 @@ class ThreatRefStatusChangeEvent : public UnitBaseEvent
};
ThreatManager* iThreatManager;
public:
- ThreatRefStatusChangeEvent(uint32 pType) : UnitBaseEvent(pType) { iHostileReference = NULL; }
+ ThreatRefStatusChangeEvent(uint32 pType) : UnitBaseEvent(pType), iThreatManager(NULL) { iHostileReference = NULL; }
- ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference) : UnitBaseEvent(pType) { iHostileReference = pHostileReference; }
+ ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference) : UnitBaseEvent(pType), iThreatManager(NULL) { iHostileReference = pHostileReference; }
- ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, float pValue) : UnitBaseEvent(pType) { iHostileReference = pHostileReference; iFValue = pValue; }
+ ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, float pValue) : UnitBaseEvent(pType), iThreatManager(NULL) { iHostileReference = pHostileReference; iFValue = pValue; }
- ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, bool pValue) : UnitBaseEvent(pType) { iHostileReference = pHostileReference; iBValue = pValue; }
+ ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, bool pValue) : UnitBaseEvent(pType), iThreatManager(NULL) { iHostileReference = pHostileReference; iBValue = pValue; }
int32 getIValue() const { return iIValue; }
diff --git a/src/server/game/Entities/AreaTrigger/AreaTrigger.cpp b/src/server/game/Entities/AreaTrigger/AreaTrigger.cpp
index 0d1a427d223..08e6412e2c2 100644
--- a/src/server/game/Entities/AreaTrigger/AreaTrigger.cpp
+++ b/src/server/game/Entities/AreaTrigger/AreaTrigger.cpp
@@ -64,7 +64,7 @@ bool AreaTrigger::CreateAreaTrigger(uint32 guidlow, uint32 triggerEntry, Unit* c
Relocate(pos);
if (!IsPositionValid())
{
- sLog->outError("misc", "AreaTrigger (spell %u) not created. Invalid coordinates (X: %f Y: %f)", spell->Id, GetPositionX(), GetPositionY());
+ TC_LOG_ERROR("misc", "AreaTrigger (spell %u) not created. Invalid coordinates (X: %f Y: %f)", spell->Id, GetPositionX(), GetPositionY());
return false;
}
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h
index a40d0646121..23ff89f383a 100644
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -630,15 +630,15 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
void GetTransportHomePosition(float &x, float &y, float &z, float &ori) { m_transportHomePosition.GetPosition(x, y, z, ori); }
Position GetTransportHomePosition() { return m_transportHomePosition; }
- uint32 GetWaypointPath(){return m_path_id;}
+ uint32 GetWaypointPath() const { return m_path_id; }
void LoadPath(uint32 pathid) { m_path_id = pathid; }
uint32 GetCurrentWaypointID() const { return m_waypointID; }
void UpdateWaypointID(uint32 wpID) { m_waypointID = wpID; }
void SearchFormation();
- CreatureGroup* GetFormation() {return m_formation;}
- void SetFormation(CreatureGroup* formation) {m_formation = formation;}
+ CreatureGroup* GetFormation() { return m_formation; }
+ void SetFormation(CreatureGroup* formation) { m_formation = formation; }
Unit* SelectVictim();
@@ -710,10 +710,10 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
CreatureData const* m_creatureData;
uint16 m_LootMode; // Bitmask (default: LOOT_MODE_DEFAULT) that determines what loot will be lootable
- uint32 guid_transport;
bool IsInvisibleDueToDespawn() const;
bool CanAlwaysSee(WorldObject const* obj) const;
+
private:
void ForcedDespawn(uint32 timeMSToDespawn = 0);
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 3c939b2a1f3..97287aabe3c 100644
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -64,6 +64,7 @@ GameObject::GameObject() : WorldObject(false), MapObject(),
lootingGroupLowGUID = 0;
ResetLootMode(); // restore default loot mode
+ m_stationaryPosition.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
}
GameObject::~GameObject()
@@ -341,7 +342,7 @@ void GameObject::Update(uint32 diff)
G3D::Vector3 src(GetPositionX(), GetPositionY(), GetPositionZ());
- sLog->outInfo("misc", "Src: %s Dest: %s", src.toString().c_str(), pos.toString().c_str());
+ TC_LOG_INFO("misc", "Src: %s Dest: %s", src.toString().c_str(), pos.toString().c_str());
GetMap()->GameObjectRelocation(this, pos.x, pos.y, pos.z, GetOrientation());
}
diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h
index 9da5e1e034c..6254989d8ce 100644
--- a/src/server/game/Entities/Object/Object.h
+++ b/src/server/game/Entities/Object/Object.h
@@ -610,7 +610,10 @@ class MapObject
friend class ObjectGridLoader; //grid loader for loading creatures
protected:
- MapObject() : _moveState(MAP_OBJECT_CELL_MOVE_NONE) { }
+ MapObject() : _moveState(MAP_OBJECT_CELL_MOVE_NONE)
+ {
+ _newPosition.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
+ }
private:
Cell _currentCell;
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp
index 2106cab78fb..5f48649db17 100644
--- a/src/server/game/Entities/Pet/Pet.cpp
+++ b/src/server/game/Entities/Pet/Pet.cpp
@@ -179,17 +179,6 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c
if (!Create(guid, map, owner->GetPhaseMask(), petEntry, petId))
return false;
- float px, py, pz;
- owner->GetClosePoint(px, py, pz, GetObjectSize(), PET_FOLLOW_DIST, GetFollowAngle());
- Relocate(px, py, pz, owner->GetOrientation());
-
- if (!IsPositionValid())
- {
- TC_LOG_ERROR("entities.pet", "Pet (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",
- GetGUIDLow(), GetEntry(), GetPositionX(), GetPositionY());
- return false;
- }
-
setPetType(petType);
setFaction(owner->getFaction());
SetUInt32Value(UNIT_CREATED_BY_SPELL, summonSpellId);
@@ -197,6 +186,17 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c
CreatureTemplate const* cinfo = GetCreatureTemplate();
if (cinfo->type == CREATURE_TYPE_CRITTER)
{
+ float px, py, pz;
+ owner->GetClosePoint(px, py, pz, GetObjectSize(), PET_FOLLOW_DIST, GetFollowAngle());
+ Relocate(px, py, pz, owner->GetOrientation());
+
+ if (!IsPositionValid())
+ {
+ TC_LOG_ERROR("entities.pet", "Pet (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",
+ GetGUIDLow(), GetEntry(), GetPositionX(), GetPositionY());
+ return false;
+ }
+
map->AddToMap(this->ToCreature());
return true;
}
@@ -241,6 +241,17 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c
SynchronizeLevelWithOwner();
+ // Set pet's position after setting level, its size depends on it
+ float px, py, pz;
+ owner->GetClosePoint(px, py, pz, GetObjectSize(), PET_FOLLOW_DIST, GetFollowAngle());
+ Relocate(px, py, pz, owner->GetOrientation());
+ if (!IsPositionValid())
+ {
+ TC_LOG_ERROR("entities.pet", "Pet (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",
+ GetGUIDLow(), GetEntry(), GetPositionX(), GetPositionY());
+ return false;
+ }
+
SetReactState(ReactStates(fields[6].GetUInt8()));
SetCanModifyStats(true);
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 09121846096..d0d287237d5 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -2209,6 +2209,8 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
{
Position oldPos;
GetPosition(&oldPos);
+ if (HasUnitMovementFlag(MOVEMENTFLAG_HOVER))
+ z += GetFloatValue(UNIT_FIELD_HOVERHEIGHT);
Relocate(x, y, z, orientation);
SendTeleportPacket(oldPos); // this automatically relocates to oldPos in order to broadcast the packet in the right place
}
@@ -9820,6 +9822,16 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
data << uint32(3932) << uint32(0); // 13 WORLDSTATE_TIME_GUARDIAN_SHOW
}
break;
+ // The Oculus
+ case 4228:
+ if (instance && mapid == 578)
+ instance->FillInitialWorldStates(data);
+ else
+ {
+ data << uint32(3524) << uint32(0); // 9 WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW
+ data << uint32(3486) << uint32(0); // 10 WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT
+ }
+ break;
// Ulduar
case 4273:
if (instance && mapid == 603)
@@ -9868,6 +9880,7 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
bf->FillInitialWorldStates(data);
break;
}
+ // Halls of Refection
case 4820:
if (instance && mapid == 668)
instance->FillInitialWorldStates(data);
@@ -9877,7 +9890,6 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
data << uint32(4882) << uint32(0); // 10 WORLD_STATE_HOR_WAVE_COUNT
}
break;
-
// No break here, intended.
default:
data << uint32(0x914) << uint32(0x0); // 7
@@ -15389,9 +15401,27 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
// cast spells after mark quest complete (some spells have quest completed state requirements in spell_area data)
if (quest->GetRewSpellCast() > 0)
- CastSpell(this, quest->GetRewSpellCast(), true);
+ {
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(quest->GetRewSpellCast());
+ if (questGiver->isType(TYPEMASK_UNIT) && !spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL))
+ {
+ if (Creature* creature = GetMap()->GetCreature(questGiver->GetGUID()))
+ creature->CastSpell(this, quest->GetRewSpellCast(), true);
+ }
+ else
+ CastSpell(this, quest->GetRewSpellCast(), true);
+ }
else if (quest->GetRewSpell() > 0)
- CastSpell(this, quest->GetRewSpell(), true);
+ {
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(quest->GetRewSpell());
+ if (questGiver->isType(TYPEMASK_UNIT) && !spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL))
+ {
+ if (Creature* creature = GetMap()->GetCreature(questGiver->GetGUID()))
+ creature->CastSpell(this, quest->GetRewSpell(), true);
+ }
+ else
+ CastSpell(this, quest->GetRewSpell(), true);
+ }
if (quest->GetZoneOrSort() > 0)
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE, quest->GetZoneOrSort());
@@ -17137,8 +17167,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
InitPrimaryProfessions(); // to max set before any spell loaded
// init saved position, and fix it later if problematic
- uint32 transGUID = uint32(fields[31].GetUInt32());
-
+ uint32 transLowGUID = uint32(fields[31].GetUInt32());
+
Relocate(fields[12].GetFloat(), fields[13].GetFloat(), fields[14].GetFloat(), fields[16].GetFloat());
uint32 mapId = fields[15].GetUInt16();
@@ -17241,41 +17271,49 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
}
}
// currently we do not support transport in bg
- else if (transGUID)
+ else if (transLowGUID)
{
- m_movementInfo.transport.guid = MAKE_NEW_GUID(transGUID, 0, HIGHGUID_MO_TRANSPORT);
- m_movementInfo.transport.pos.Relocate(fields[27].GetFloat(), fields[28].GetFloat(), fields[29].GetFloat(), fields[30].GetFloat());
+ uint64 transGUID = MAKE_NEW_GUID(transLowGUID, 0, HIGHGUID_MO_TRANSPORT);
- if (!Trinity::IsValidMapCoord(
- GetPositionX()+m_movementInfo.transport.pos.GetPositionX(), GetPositionY()+m_movementInfo.transport.pos.GetPositionY(),
- GetPositionZ()+m_movementInfo.transport.pos.GetPositionZ(), GetOrientation()+m_movementInfo.transport.pos.GetOrientation()) ||
- // transport size limited
- m_movementInfo.transport.pos.m_positionX > 250 || m_movementInfo.transport.pos.m_positionY > 250 || m_movementInfo.transport.pos.m_positionZ > 250)
- {
- TC_LOG_ERROR("entities.player", "Player (guidlow %d) have invalid transport coordinates (X: %f Y: %f Z: %f O: %f). Teleport to bind location.",
- guid, GetPositionX()+m_movementInfo.transport.pos.GetPositionX(), GetPositionY()+m_movementInfo.transport.pos.GetPositionY(),
- GetPositionZ()+m_movementInfo.transport.pos.GetPositionZ(), GetOrientation()+m_movementInfo.transport.pos.GetOrientation());
+ if (GameObject* go = HashMapHolder<GameObject>::Find(transGUID))
+ m_transport = go->ToTransport();
- RelocateToHomebind();
- }
- else
+ if (m_transport)
{
- if (GameObject* go = HashMapHolder<GameObject>::Find(m_movementInfo.transport.guid))
- m_transport = go->ToTransport();
+ m_movementInfo.transport.guid = transGUID;
+ float x = fields[27].GetFloat(), y = fields[28].GetFloat(), z = fields[29].GetFloat(), o = fields[30].GetFloat();
+ m_movementInfo.transport.pos.Relocate(x, y, z, o);
+ m_transport->CalculatePassengerPosition(x, y, z, &o);
- if (m_transport)
+ if (!Trinity::IsValidMapCoord(x, y, z, o) ||
+ // transport size limited
+ std::fabs(m_movementInfo.transport.pos.GetPositionX()) > 250.0f ||
+ std::fabs(m_movementInfo.transport.pos.GetPositionY()) > 250.0f ||
+ std::fabs(m_movementInfo.transport.pos.GetPositionZ()) > 250.0f)
{
- m_transport->AddPassenger(this);
- mapId = m_transport->GetMapId();
+ TC_LOG_ERROR("entities.player", "Player (guidlow %d) have invalid transport coordinates (X: %f Y: %f Z: %f O: %f). Teleport to bind location.",
+ guid, x, y, z, o);
+
+ m_transport = NULL;
+ m_movementInfo.transport.Reset();
+
+ RelocateToHomebind();
}
else
{
- TC_LOG_ERROR("entities.player", "Player (guidlow %d) have problems with transport guid (%u). Teleport to bind location.",
- guid, transGUID);
+ Relocate(x, y, z, o);
+ mapId = m_transport->GetMapId();
- RelocateToHomebind();
+ m_transport->AddPassenger(this);
}
}
+ else
+ {
+ TC_LOG_ERROR("entities.player", "Player (guidlow %d) have problems with transport guid (%u). Teleport to bind location.",
+ guid, transLowGUID);
+
+ RelocateToHomebind();
+ }
}
// currently we do not support taxi in instance
else if (!taxi_nodes.empty())
@@ -19159,6 +19197,14 @@ void Player::SaveToDB(bool create /*=false*/)
stmt->setFloat(index++, finiteAlways(GetPositionY()));
stmt->setFloat(index++, finiteAlways(GetPositionZ()));
stmt->setFloat(index++, finiteAlways(GetOrientation()));
+ stmt->setFloat(index++, finiteAlways(GetTransOffsetX()));
+ stmt->setFloat(index++, finiteAlways(GetTransOffsetY()));
+ stmt->setFloat(index++, finiteAlways(GetTransOffsetZ()));
+ stmt->setFloat(index++, finiteAlways(GetTransOffsetO()));
+ uint32 transLowGUID = 0;
+ if (GetTransport())
+ transLowGUID = GetTransport()->GetGUIDLow();
+ stmt->setUInt32(index++, transLowGUID);
std::ostringstream ss;
ss << m_taxi;
@@ -19280,6 +19326,15 @@ void Player::SaveToDB(bool create /*=false*/)
stmt->setFloat(index++, finiteAlways(GetTeleportDest().GetOrientation()));
}
+ stmt->setFloat(index++, finiteAlways(GetTransOffsetX()));
+ stmt->setFloat(index++, finiteAlways(GetTransOffsetY()));
+ stmt->setFloat(index++, finiteAlways(GetTransOffsetZ()));
+ stmt->setFloat(index++, finiteAlways(GetTransOffsetO()));
+ uint32 transLowGUID = 0;
+ if (GetTransport())
+ transLowGUID = GetTransport()->GetGUIDLow();
+ stmt->setUInt32(index++, transLowGUID);
+
std::ostringstream ss;
ss << m_taxi;
stmt->setString(index++, ss.str());
@@ -20165,7 +20220,7 @@ void Player::UpdateSpeakTime()
}
}
else
- m_speakCount = 0;
+ m_speakCount = 1;
m_speakTime = current + sWorld->getIntConfig(CONFIG_CHATFLOOD_MESSAGE_DELAY);
}
@@ -21001,13 +21056,15 @@ void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId, Aura* aura)
if (!spell || spell->m_appliedMods.empty())
return;
+ std::list<Aura*> aurasQueue;
+
for (uint8 i=0; i<MAX_SPELLMOD; ++i)
{
for (SpellModList::iterator itr = m_spellMods[i].begin(); itr != m_spellMods[i].end(); ++itr)
{
SpellModifier* mod = *itr;
- // spellmods without aura set cannot be charged
+ // Spellmods without aura set cannot be charged
if (!mod->ownerAura || !mod->ownerAura->IsUsingCharges())
continue;
@@ -21018,17 +21075,20 @@ void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId, Aura* aura)
if (aura && mod->ownerAura != aura)
continue;
- // check if mod affected this spell
- // first, check if the mod aura applied at least one spellmod to this spell
+ // Check if mod affected this spell
+ // First, check if the mod aura applied at least one spellmod to this spell
Spell::UsedSpellMods::iterator iterMod = spell->m_appliedMods.find(mod->ownerAura);
if (iterMod == spell->m_appliedMods.end())
continue;
- // secondly, check if the current mod is one of the spellmods applied by the mod aura
+ // Second, check if the current mod is one of those applied by the mod aura
if (!(mod->mask & spell->m_spellInfo->SpellFamilyFlags))
continue;
- // remove from list
- spell->m_appliedMods.erase(iterMod);
+ // remove from list - This will be done after all mods have been gone through
+ // to ensure we iterate over all mods of an aura before removing said aura
+ // from applied mods (Else, an aura with two mods on the current spell would
+ // only see the first of its modifier restored)
+ aurasQueue.push_back(mod->ownerAura);
// add mod charges back to mod
if (mod->charges == -1)
@@ -21036,15 +21096,22 @@ void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId, Aura* aura)
else
mod->charges++;
- // Do not set more spellmods than avalible
+ // Do not set more spellmods than available
if (mod->ownerAura->GetCharges() < mod->charges)
mod->charges = mod->ownerAura->GetCharges();
// Skip this check for now - aura charges may change due to various reason
- /// @todo trac these changes correctly
+ /// @todo track these changes correctly
//ASSERT (mod->ownerAura->GetCharges() <= mod->charges);
}
}
+
+ for (std::list<Aura*>::iterator itr = aurasQueue.begin(); itr != aurasQueue.end(); ++itr)
+ {
+ Spell::UsedSpellMods::iterator iterMod = spell->m_appliedMods.find(*itr);
+ if (iterMod != spell->m_appliedMods.end())
+ spell->m_appliedMods.erase(iterMod);
+ }
}
void Player::RestoreAllSpellMods(uint32 ownerAuraId, Aura* aura)
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 62d7f1fc5a4..a96c6fd281d 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -388,7 +388,7 @@ typedef std::list<PlayerCreateInfoAction> PlayerCreateInfoActions;
struct PlayerInfo
{
// existence checked by displayId != 0
- PlayerInfo() : displayId_m(0), displayId_f(0), levelInfo(NULL) { }
+ PlayerInfo() : mapId(0), areaId(0), positionX(0.0f), positionY(0.0f), positionZ(0.0f), orientation(0.0f), displayId_m(0), displayId_f(0), levelInfo(NULL) { }
uint32 mapId;
uint32 areaId;
diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp
index e3b4bbc5b56..9026f4c0e46 100644
--- a/src/server/game/Entities/Transport/Transport.cpp
+++ b/src/server/game/Entities/Transport/Transport.cpp
@@ -33,7 +33,8 @@
#include "CellImpl.h"
Transport::Transport() : GameObject(),
- _transportInfo(NULL), _isMoving(true), _pendingStop(false)
+ _transportInfo(NULL), _isMoving(true), _pendingStop(false),
+ _triggeredArrivalEvent(false), _triggeredDepartureEvent(false)
{
m_updateFlag = UPDATEFLAG_TRANSPORT | UPDATEFLAG_LOWGUID | UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_ROTATION;
}
@@ -529,7 +530,9 @@ void Transport::UpdatePassengerPositions(std::set<WorldObject*>& passengers)
break;
}
case TYPEID_PLAYER:
- GetMap()->PlayerRelocation(passenger->ToPlayer(), x, y, z, o);
+ //relocate only passengers in world and skip any player that might be still logging in/teleporting
+ if (passenger->IsInWorld())
+ GetMap()->PlayerRelocation(passenger->ToPlayer(), x, y, z, o);
break;
case TYPEID_GAMEOBJECT:
GetMap()->GameObjectRelocation(passenger->ToGameObject(), x, y, z, o, false);
diff --git a/src/server/game/Entities/Transport/Transport.h b/src/server/game/Entities/Transport/Transport.h
index 0145ec608ae..e290a5d5e00 100644
--- a/src/server/game/Entities/Transport/Transport.h
+++ b/src/server/game/Entities/Transport/Transport.h
@@ -90,7 +90,6 @@ class Transport : public GameObject, public TransportBase
KeyFrameVec::const_iterator _currentFrame;
KeyFrameVec::const_iterator _nextFrame;
- uint32 _moveTimer;
TimeTrackerSmall _positionChangeTimer;
bool _isMoving;
bool _pendingStop;
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 84ab938a443..849c1c9af49 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -240,8 +240,6 @@ Unit::Unit(bool isWorldObject) :
for (uint8 i = 0; i < MAX_SPELL_SCHOOL; ++i)
m_threatModifier[i] = 1.0f;
- m_isSorted = true;
-
for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i)
m_speed_rate[i] = 1.0f;
@@ -11889,9 +11887,19 @@ void CharmInfo::InitEmptyActionBar(bool withAttack)
void CharmInfo::InitPossessCreateSpells()
{
- InitEmptyActionBar();
if (_unit->GetTypeId() == TYPEID_UNIT)
{
+ // Adding switch until better way is found. Malcrom
+ // Adding entrys to this switch will prevent COMMAND_ATTACK being added to pet bar.
+ switch (_unit->GetEntry())
+ {
+ case 23575: // Mindless Abomination
+ break;
+ default:
+ InitEmptyActionBar();
+ break;
+ }
+
for (uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i)
{
uint32 spellId = _unit->ToCreature()->m_spells[i];
@@ -11905,6 +11913,8 @@ void CharmInfo::InitPossessCreateSpells()
}
}
}
+ else
+ InitEmptyActionBar();
}
void CharmInfo::InitCharmCreateSpells()
@@ -12700,6 +12710,8 @@ void Unit::StopMoving()
if (!IsInWorld() || movespline->Finalized())
return;
+ // Update position now since Stop does not start a new movement that can be updated later
+ UpdateSplinePosition();
Movement::MoveSplineInit init(this);
init.Stop();
}
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 9ba93c38569..cb228bd135d 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -2168,7 +2168,7 @@ class Unit : public WorldObject
typedef std::list<GameObject*> GameObjectList;
GameObjectList m_gameObj;
- bool m_isSorted;
+
uint32 m_transform;
Spell* m_currentSpells[CURRENT_MAX_SPELL];
diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp
index e7bc1d75bfb..e6303a5d5b6 100644
--- a/src/server/game/Entities/Vehicle/Vehicle.cpp
+++ b/src/server/game/Entities/Vehicle/Vehicle.cpp
@@ -102,7 +102,7 @@ void Vehicle::Install()
if (!spellInfo)
continue;
- if (spellInfo->PowerType == POWER_ENERGY)
+ if (spellInfo->PowerType == POWER_ENERGY && spellInfo->CalcPowerCost(_me, spellInfo->GetSchoolMask()) > 0)
{
_me->setPowerType(POWER_ENERGY);
_me->SetMaxPower(POWER_ENERGY, 100);
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index f1bbb1d6839..9987019d75d 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -240,7 +240,8 @@ ObjectMgr::ObjectMgr():
_hiDoGuid(1),
_hiCorpseGuid(1),
_hiAreaTriggerGuid(1),
- _hiMoTransGuid(1)
+ _hiMoTransGuid(1),
+ DBCLocaleIndex(LOCALE_enUS)
{
for (uint8 i = 0; i < MAX_CLASSES; ++i)
for (uint8 j = 0; j < MAX_RACES; ++j)
@@ -1266,7 +1267,7 @@ void ObjectMgr::LoadLinkedRespawn()
const CreatureData* slave = GetCreatureData(guidLow);
if (!slave)
{
- TC_LOG_ERROR("sql.sql", "Couldn't get creature data for GUIDLow %u", guidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature (guid) '%u' not found in creature table", guidLow);
error = true;
break;
}
@@ -1274,7 +1275,7 @@ void ObjectMgr::LoadLinkedRespawn()
const CreatureData* master = GetCreatureData(linkedGuidLow);
if (!master)
{
- TC_LOG_ERROR("sql.sql", "Couldn't get creature data for GUIDLow %u", linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature (linkedGuid) '%u' not found in creature table", linkedGuidLow);
error = true;
break;
}
@@ -1282,14 +1283,14 @@ void ObjectMgr::LoadLinkedRespawn()
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))
{
- TC_LOG_ERROR("sql.sql", "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature '%u' linking to Creature '%u' on an unpermitted map.", guidLow, linkedGuidLow);
error = true;
break;
}
if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty)
{
- TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature '%u' linking to Creature '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
error = true;
break;
}
@@ -1303,7 +1304,7 @@ void ObjectMgr::LoadLinkedRespawn()
const CreatureData* slave = GetCreatureData(guidLow);
if (!slave)
{
- TC_LOG_ERROR("sql.sql", "Couldn't get creature data for GUIDLow %u", guidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature (guid) '%u' not found in creature table", guidLow);
error = true;
break;
}
@@ -1311,7 +1312,7 @@ void ObjectMgr::LoadLinkedRespawn()
const GameObjectData* master = GetGOData(linkedGuidLow);
if (!master)
{
- TC_LOG_ERROR("sql.sql", "Couldn't get gameobject data for GUIDLow %u", linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject (linkedGuid) '%u' not found in gameobject table", linkedGuidLow);
error = true;
break;
}
@@ -1319,14 +1320,14 @@ void ObjectMgr::LoadLinkedRespawn()
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))
{
- TC_LOG_ERROR("sql.sql", "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature '%u' linking to Gameobject '%u' on an unpermitted map.", guidLow, linkedGuidLow);
error = true;
break;
}
if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty)
{
- TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature '%u' linking to Gameobject '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
error = true;
break;
}
@@ -1340,7 +1341,7 @@ void ObjectMgr::LoadLinkedRespawn()
const GameObjectData* slave = GetGOData(guidLow);
if (!slave)
{
- TC_LOG_ERROR("sql.sql", "Couldn't get gameobject data for GUIDLow %u", guidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject (guid) '%u' not found in gameobject table", guidLow);
error = true;
break;
}
@@ -1348,7 +1349,7 @@ void ObjectMgr::LoadLinkedRespawn()
const GameObjectData* master = GetGOData(linkedGuidLow);
if (!master)
{
- TC_LOG_ERROR("sql.sql", "Couldn't get gameobject data for GUIDLow %u", linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject (linkedGuid) '%u' not found in gameobject table", linkedGuidLow);
error = true;
break;
}
@@ -1356,14 +1357,14 @@ void ObjectMgr::LoadLinkedRespawn()
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))
{
- TC_LOG_ERROR("sql.sql", "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject '%u' linking to Gameobject '%u' on an unpermitted map.", guidLow, linkedGuidLow);
error = true;
break;
}
if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty)
{
- TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject '%u' linking to Gameobject '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
error = true;
break;
}
@@ -1377,7 +1378,7 @@ void ObjectMgr::LoadLinkedRespawn()
const GameObjectData* slave = GetGOData(guidLow);
if (!slave)
{
- TC_LOG_ERROR("sql.sql", "Couldn't get gameobject data for GUIDLow %u", guidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject (guid) '%u' not found in gameobject table", guidLow);
error = true;
break;
}
@@ -1385,7 +1386,7 @@ void ObjectMgr::LoadLinkedRespawn()
const CreatureData* master = GetCreatureData(linkedGuidLow);
if (!master)
{
- TC_LOG_ERROR("sql.sql", "Couldn't get creature data for GUIDLow %u", linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature (linkedGuid) '%u' not found in creature table", linkedGuidLow);
error = true;
break;
}
@@ -1393,14 +1394,14 @@ void ObjectMgr::LoadLinkedRespawn()
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))
{
- TC_LOG_ERROR("sql.sql", "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject '%u' linking to Creature '%u' on an unpermitted map.", guidLow, linkedGuidLow);
error = true;
break;
}
if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty)
{
- TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
+ TC_LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject '%u' linking to Creature '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
error = true;
break;
}
@@ -1437,6 +1438,11 @@ bool ObjectMgr::SetCreatureLinkedRespawn(uint32 guidLow, uint32 linkedGuidLow)
}
const CreatureData* slave = GetCreatureData(linkedGuidLow);
+ if (!slave)
+ {
+ TC_LOG_ERROR("sql.sql", "Creature '%u' linking to non-existent creature '%u'.", guidLow, linkedGuidLow);
+ return false;
+ }
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index 22fc83b1e7f..fb106884bba 100644
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -457,7 +457,7 @@ typedef std::pair<QuestRelations::const_iterator, QuestRelations::const_iterator
struct PetLevelInfo
{
- PetLevelInfo() : health(0), mana(0) { for (uint8 i=0; i < MAX_STATS; ++i) stats[i] = 0; }
+ PetLevelInfo() : health(0), mana(0), armor(0) { for (uint8 i=0; i < MAX_STATS; ++i) stats[i] = 0; }
uint16 stats[MAX_STATS];
uint16 health;
@@ -566,13 +566,13 @@ struct QuestPOI
int32 ObjectiveIndex;
uint32 MapId;
uint32 AreaId;
- uint32 Unk2;
+ uint32 FloorId;
uint32 Unk3;
uint32 Unk4;
std::vector<QuestPOIPoint> points;
- QuestPOI() : Id(0), ObjectiveIndex(0), MapId(0), AreaId(0), Unk2(0), Unk3(0), Unk4(0) { }
- QuestPOI(uint32 id, int32 objIndex, uint32 mapId, uint32 areaId, uint32 unk2, uint32 unk3, uint32 unk4) : Id(id), ObjectiveIndex(objIndex), MapId(mapId), AreaId(areaId), Unk2(unk2), Unk3(unk3), Unk4(unk4) { }
+ QuestPOI() : Id(0), ObjectiveIndex(0), MapId(0), AreaId(0), FloorId(0), Unk3(0), Unk4(0) { }
+ QuestPOI(uint32 id, int32 objIndex, uint32 mapId, uint32 areaId, uint32 floorId, uint32 unk3, uint32 unk4) : Id(id), ObjectiveIndex(objIndex), MapId(mapId), AreaId(areaId), FloorId(floorId), Unk3(unk3), Unk4(unk4) { }
};
typedef std::vector<QuestPOI> QuestPOIVector;
diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp
index 2b3654d1da1..1c9fc2f04ba 100644
--- a/src/server/game/Guilds/Guild.cpp
+++ b/src/server/game/Guilds/Guild.cpp
@@ -73,7 +73,7 @@ std::string _GetGuildEventString(GuildEvents event)
return "Bank tab updated";
case GE_BANK_MONEY_SET:
return "Bank money set";
- case GE_BANK_MONEY_CHANGED:
+ case GE_BANK_TAB_AND_MONEY_UPDATED:
return "Bank money changed";
case GE_BANK_TEXT_CHANGED:
return "Bank tab text changed";
@@ -386,6 +386,7 @@ void Guild::RankInfo::SaveToDB(SQLTransaction& trans) const
stmt->setUInt8 (1, m_rankId);
stmt->setString(2, m_name);
stmt->setUInt32(3, m_rights);
+ stmt->setUInt32(4, m_bankMoneyPerDay);
CharacterDatabase.ExecuteOrAppend(trans, stmt);
}
@@ -2059,8 +2060,8 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint64 amount, bool
_LogBankEvent(trans, cashFlow ? GUILD_BANK_LOG_CASH_FLOW_DEPOSIT : GUILD_BANK_LOG_DEPOSIT_MONEY, uint8(0), player->GetGUIDLow(), amount);
CharacterDatabase.CommitTransaction(trans);
- std::string aux = ByteArrayToHexStr(reinterpret_cast<uint8*>(&amount), 8, true);
- _BroadcastEvent(GE_BANK_MONEY_CHANGED, 0, aux.c_str());
+ std::string aux = ByteArrayToHexStr(reinterpret_cast<uint8*>(&m_bankMoney), 8, true);
+ _BroadcastEvent(GE_BANK_MONEY_SET, 0, aux.c_str());
if (player->GetSession()->HasPermission(rbac::RBAC_PERM_LOG_GM_TRADE))
{
@@ -2109,8 +2110,8 @@ bool Guild::HandleMemberWithdrawMoney(WorldSession* session, uint64 amount, bool
_LogBankEvent(trans, repair ? GUILD_BANK_LOG_REPAIR_MONEY : GUILD_BANK_LOG_WITHDRAW_MONEY, uint8(0), player->GetGUIDLow(), amount);
CharacterDatabase.CommitTransaction(trans);
- std::string aux = ByteArrayToHexStr(reinterpret_cast<uint8*>(&amount), 8, true);
- _BroadcastEvent(GE_BANK_MONEY_CHANGED, 0, aux.c_str());
+ std::string aux = ByteArrayToHexStr(reinterpret_cast<uint8*>(&m_bankMoney), 8, true);
+ _BroadcastEvent(GE_BANK_MONEY_SET, 0, aux.c_str());
return true;
}
diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h
index cd4b3fe5252..256c876931d 100644
--- a/src/server/game/Guilds/Guild.h
+++ b/src/server/game/Guilds/Guild.h
@@ -165,7 +165,7 @@ enum GuildEvents
GE_BANK_TAB_PURCHASED = 19,
GE_BANK_TAB_UPDATED = 20,
GE_BANK_MONEY_SET = 21,
- GE_BANK_MONEY_CHANGED = 22,
+ GE_BANK_TAB_AND_MONEY_UPDATED = 22,
GE_BANK_TEXT_CHANGED = 23,
// 24 - error 795
GE_SIGNED_ON_MOBILE = 25,
@@ -576,7 +576,8 @@ private:
RankInfo(): m_guildId(0), m_rankId(GUILD_RANK_NONE), m_rights(GR_RIGHT_EMPTY), m_bankMoneyPerDay(0) { }
RankInfo(uint32 guildId) : m_guildId(guildId), m_rankId(GUILD_RANK_NONE), m_rights(GR_RIGHT_EMPTY), m_bankMoneyPerDay(0) { }
RankInfo(uint32 guildId, uint8 rankId, std::string const& name, uint32 rights, uint32 money) :
- m_guildId(guildId), m_rankId(rankId), m_name(name), m_rights(rights), m_bankMoneyPerDay(money) { }
+ m_guildId(guildId), m_rankId(rankId), m_name(name), m_rights(rights),
+ m_bankMoneyPerDay(rankId != GR_GUILDMASTER ? money : GUILD_WITHDRAW_MONEY_UNLIMITED) { }
void LoadFromDB(Field* fields);
void SaveToDB(SQLTransaction& trans) const;
diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp
index fd845efff3a..cd5a26272eb 100644
--- a/src/server/game/Handlers/MovementHandler.cpp
+++ b/src/server/game/Handlers/MovementHandler.cpp
@@ -84,8 +84,11 @@ void WorldSession::HandleMoveWorldportAckOpcode()
GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->GetOrientation());
return;
}
- else
- GetPlayer()->Relocate(&loc);
+
+ float z = loc.GetPositionZ();
+ if (GetPlayer()->HasUnitMovementFlag(MOVEMENTFLAG_HOVER))
+ z += GetPlayer()->GetFloatValue(UNIT_FIELD_HOVERHEIGHT);
+ GetPlayer()->Relocate(loc.GetPositionX(), loc.GetPositionY(), z, loc.GetOrientation());
GetPlayer()->ResetMap();
GetPlayer()->SetMap(newMap);
diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp
index b87840a74ec..3570822751c 100644
--- a/src/server/game/Handlers/PetHandler.cpp
+++ b/src/server/game/Handlers/PetHandler.cpp
@@ -149,8 +149,8 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid
CharmInfo* charmInfo = pet->GetCharmInfo();
if (!charmInfo)
{
- TC_LOG_ERROR("network", "WorldSession::HandlePetAction(petGuid: " UI64FMTD ", tagGuid: " UI64FMTD ", spellId: %u, flag: %u): object (entry: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!",
- guid1, guid2, spellid, flag, pet->GetGUIDLow(), pet->GetTypeId());
+ TC_LOG_ERROR("network", "WorldSession::HandlePetAction(petGuid: " UI64FMTD ", tagGuid: " UI64FMTD ", spellId: %u, flag: %u): object (GUID: %u Entry: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!",
+ guid1, guid2, spellid, flag, pet->GetGUIDLow(), pet->GetEntry(), pet->GetTypeId());
return;
}
@@ -727,6 +727,12 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket)
}
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
+ if (!spellInfo)
+ {
+ TC_LOG_ERROR("network", "WORLD: unknown PET spell id %u", spellid);
+ return;
+ }
+
// do not add not learned spells/ passive spells
if (!pet->HasSpell(spellid) || !spellInfo->IsAutocastable())
return;
diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp
index 43bb843f0f1..7516bcc80cd 100644
--- a/src/server/game/Handlers/QueryHandler.cpp
+++ b/src/server/game/Handlers/QueryHandler.cpp
@@ -443,7 +443,7 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recvData)
data << int32(itr->ObjectiveIndex); // objective index
data << uint32(itr->MapId); // mapid
data << uint32(itr->AreaId); // areaid
- data << uint32(itr->Unk2); // unknown
+ data << uint32(itr->FloorId); // floorid
data << uint32(itr->Unk3); // unknown
data << uint32(itr->Unk4); // unknown
data << uint32(itr->points.size()); // POI points count
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index e08ccfab31d..85d80f3a420 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -1066,7 +1066,7 @@ void Map::MoveAllGameObjectsInMoveList()
{
// ... or unload (if respawn grid also not loaded)
#ifdef TRINITY_DEBUG
- sLog->outDebug("maps", "GameObject (GUID: %u Entry: %u) cannot be move to unloaded respawn grid.", go->GetGUIDLow(), go->GetEntry());
+ TC_LOG_DEBUG("maps", "GameObject (GUID: %u Entry: %u) cannot be move to unloaded respawn grid.", go->GetGUIDLow(), go->GetEntry());
#endif
AddObjectToRemoveList(go);
}
diff --git a/src/server/game/Maps/TransportMgr.cpp b/src/server/game/Maps/TransportMgr.cpp
index b84a8ddb217..11798201397 100644
--- a/src/server/game/Maps/TransportMgr.cpp
+++ b/src/server/game/Maps/TransportMgr.cpp
@@ -60,6 +60,12 @@ void TransportMgr::LoadTransportTemplates()
Field* fields = result->Fetch();
uint32 entry = fields[0].GetUInt32();
GameObjectTemplate const* goInfo = sObjectMgr->GetGameObjectTemplate(entry);
+ if (goInfo == NULL)
+ {
+ TC_LOG_ERROR("sql.sql", "Transport %u has no associated GameObjectTemplate from `gameobject_template` , skipped.", entry);
+ continue;
+ }
+
if (goInfo->moTransport.taxiPathId >= sTaxiPathNodesByPath.size())
{
TC_LOG_ERROR("sql.sql", "Transport %u (name: %s) has an invalid path specified in `gameobject_template`.`data0` (%u) field, skipped.", entry, goInfo->name.c_str(), goInfo->moTransport.taxiPathId);
diff --git a/src/server/game/Maps/TransportMgr.h b/src/server/game/Maps/TransportMgr.h
index 250a2c50bb1..205a614eabb 100644
--- a/src/server/game/Maps/TransportMgr.h
+++ b/src/server/game/Maps/TransportMgr.h
@@ -38,7 +38,7 @@ typedef UNORDERED_MAP<uint32, std::set<uint32> > TransportInstanceMap;
struct KeyFrame
{
- explicit KeyFrame(TaxiPathNodeEntry const& _node) : Node(&_node),
+ explicit KeyFrame(TaxiPathNodeEntry const& _node) : Index(0), Node(&_node),
DistSinceStop(-1.0f), DistUntilStop(-1.0f), DistFromPrev(-1.0f), TimeFrom(0.0f), TimeTo(0.0f),
Teleport(false), ArriveTime(0), DepartureTime(0), Spline(NULL), NextDistFromPrev(0.0f), NextArriveTime(0)
{
@@ -66,7 +66,7 @@ struct KeyFrame
struct TransportTemplate
{
- TransportTemplate() : pathTime(0), accelTime(0.0f), accelDist(0.0f) { }
+ TransportTemplate() : inInstance(false), pathTime(0), accelTime(0.0f), accelDist(0.0f), entry(0) { }
~TransportTemplate();
std::set<uint32> mapsUsed;
diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp
index 85a08e49fd3..91ad6d2b676 100644
--- a/src/server/game/Movement/PathGenerator.cpp
+++ b/src/server/game/Movement/PathGenerator.cpp
@@ -33,6 +33,8 @@ PathGenerator::PathGenerator(const Unit* owner) :
_endPosition(G3D::Vector3::zero()), _sourceUnit(owner), _navMesh(NULL),
_navMeshQuery(NULL)
{
+ memset(_pathPolyRefs, 0, sizeof(_pathPolyRefs));
+
TC_LOG_DEBUG("maps", "++ PathGenerator::PathGenerator for %u \n", _sourceUnit->GetGUIDLow());
uint32 mapId = _sourceUnit->GetMapId();
diff --git a/src/server/game/Movement/Spline/MovementUtil.cpp b/src/server/game/Movement/Spline/MovementUtil.cpp
index ee47a5ebedc..f5bdba378d1 100644
--- a/src/server/game/Movement/Spline/MovementUtil.cpp
+++ b/src/server/game/Movement/Spline/MovementUtil.cpp
@@ -77,7 +77,7 @@ namespace Movement
{
result = termVel * (t_passed - terminal_time) +
start_velocity * terminal_time +
- gravity * terminal_time * terminal_time*0.5f;
+ gravity * terminal_time * terminal_time * 0.5f;
}
else
result = t_passed * (start_velocity + t_passed * gravity * 0.5f);
diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp
index e70c88d2181..41c18b850a1 100644
--- a/src/server/game/Scripting/MapScripts.cpp
+++ b/src/server/game/Scripting/MapScripts.cpp
@@ -499,7 +499,7 @@ void Map::ScriptsProcess()
if (step.script->FlagToggle.FieldID <= OBJECT_FIELD_ENTRY || step.script->FlagToggle.FieldID >= cSource->GetValuesCount())
TC_LOG_ERROR("scripts", "%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
step.script->GetDebugInfo().c_str(), step.script->FlagToggle.FieldID,
- source->GetValuesCount(), source->GetTypeId(), source->GetEntry(), source->GetGUIDLow());
+ cSource->GetValuesCount(), cSource->GetTypeId(), cSource->GetEntry(), cSource->GetGUIDLow());
else
cSource->SetFlag(step.script->FlagToggle.FieldID, step.script->FlagToggle.FieldValue);
}
@@ -513,7 +513,7 @@ void Map::ScriptsProcess()
if (step.script->FlagToggle.FieldID <= OBJECT_FIELD_ENTRY || step.script->FlagToggle.FieldID >= cSource->GetValuesCount())
TC_LOG_ERROR("scripts", "%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
step.script->GetDebugInfo().c_str(), step.script->FlagToggle.FieldID,
- source->GetValuesCount(), source->GetTypeId(), source->GetEntry(), source->GetGUIDLow());
+ cSource->GetValuesCount(), cSource->GetTypeId(), cSource->GetEntry(), cSource->GetGUIDLow());
else
cSource->RemoveFlag(step.script->FlagToggle.FieldID, step.script->FlagToggle.FieldValue);
}
diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp
index b014ff85562..976a3e6fb7a 100644
--- a/src/server/game/Scripting/ScriptLoader.cpp
+++ b/src/server/game/Scripting/ScriptLoader.cpp
@@ -319,7 +319,10 @@ void AddSC_boss_ptheradras();
void AddSC_instance_maraudon();
void AddSC_boss_onyxia(); //Onyxia's Lair
void AddSC_instance_onyxias_lair();
-void AddSC_boss_amnennar_the_coldbringer(); //Razorfen Downs
+void AddSC_boss_tuten_kash(); //Razorfen Downs
+void AddSC_boss_mordresh_fire_eye();
+void AddSC_boss_glutton();
+void AddSC_boss_amnennar_the_coldbringer();
void AddSC_razorfen_downs();
void AddSC_instance_razorfen_downs();
void AddSC_razorfen_kraul(); //Razorfen Kraul
@@ -578,7 +581,8 @@ void AddSC_boss_grandmaster_vorpil();
void AddSC_boss_murmur();
void AddSC_instance_shadow_labyrinth();
-void AddSC_black_temple(); //Black Temple
+// Black Temple
+void AddSC_black_temple();
void AddSC_boss_illidan();
void AddSC_boss_shade_of_akama();
void AddSC_boss_supremus();
@@ -589,22 +593,35 @@ void AddSC_boss_teron_gorefiend();
void AddSC_boss_najentus();
void AddSC_boss_illidari_council();
void AddSC_instance_black_temple();
-void AddSC_boss_fathomlord_karathress(); //CR Serpent Shrine Cavern
+
+// Coilfang Reservoir - Serpent Shrine Cavern
+void AddSC_boss_fathomlord_karathress();
void AddSC_boss_hydross_the_unstable();
void AddSC_boss_lady_vashj();
void AddSC_boss_leotheras_the_blind();
void AddSC_boss_morogrim_tidewalker();
void AddSC_instance_serpentshrine_cavern();
void AddSC_boss_the_lurker_below();
-void AddSC_boss_hydromancer_thespia(); //CR Steam Vault
+
+// Coilfang Reservoir - The Steam Vault
+void AddSC_boss_hydromancer_thespia();
void AddSC_boss_mekgineer_steamrigger();
void AddSC_boss_warlord_kalithresh();
void AddSC_instance_steam_vault();
-void AddSC_instance_the_slave_pens(); //The Slave Pens
-void AddSC_boss_hungarfen(); //CR Underbog
-void AddSC_boss_the_black_stalker();
+
+// Coilfang Reservoir - The Slave Pens
+void AddSC_instance_the_slave_pens();
+void AddSC_boss_mennu_the_betrayer();
+void AddSC_boss_rokmar_the_crackler();
+void AddSC_boss_quagmirran();
+
+// Coilfang Reservoir - The Underbog
void AddSC_instance_the_underbog();
-void AddSC_boss_gruul(); //Gruul's Lair
+void AddSC_boss_hungarfen();
+void AddSC_boss_the_black_stalker();
+
+// Gruul's Lair
+void AddSC_boss_gruul();
void AddSC_boss_high_king_maulgar();
void AddSC_instance_gruuls_lair();
void AddSC_boss_broggok(); //HC Blood Furnace
@@ -622,6 +639,9 @@ void AddSC_boss_omor_the_unscarred();
void AddSC_boss_vazruden_the_herald();
void AddSC_instance_ramparts();
void AddSC_arcatraz(); //TK Arcatraz
+void AddSC_boss_zereketh_the_unbound();
+void AddSC_boss_dalliah_the_doomsayer();
+void AddSC_boss_wrath_scryer_soccothrates();
void AddSC_boss_harbinger_skyriss();
void AddSC_instance_arcatraz();
void AddSC_boss_high_botanist_freywinn(); //TK Botanica
@@ -1020,7 +1040,10 @@ void AddKalimdorScripts()
AddSC_instance_maraudon();
AddSC_boss_onyxia(); //Onyxia's Lair
AddSC_instance_onyxias_lair();
- AddSC_boss_amnennar_the_coldbringer(); //Razorfen Downs
+ AddSC_boss_tuten_kash(); //Razorfen Downs
+ AddSC_boss_mordresh_fire_eye();
+ AddSC_boss_glutton();
+ AddSC_boss_amnennar_the_coldbringer();
AddSC_razorfen_downs();
AddSC_instance_razorfen_downs();
AddSC_razorfen_kraul(); //Razorfen Kraul
@@ -1108,7 +1131,8 @@ void AddOutlandScripts()
AddSC_boss_murmur();
AddSC_instance_shadow_labyrinth();
- AddSC_black_temple(); //Black Temple
+ // Black Temple
+ AddSC_black_temple();
AddSC_boss_illidan();
AddSC_boss_shade_of_akama();
AddSC_boss_supremus();
@@ -1119,22 +1143,35 @@ void AddOutlandScripts()
AddSC_boss_najentus();
AddSC_boss_illidari_council();
AddSC_instance_black_temple();
- AddSC_boss_fathomlord_karathress(); //CR Serpent Shrine Cavern
+
+ // Coilfang Reservoir - Serpent Shrine Cavern
+ AddSC_boss_fathomlord_karathress();
AddSC_boss_hydross_the_unstable();
AddSC_boss_lady_vashj();
AddSC_boss_leotheras_the_blind();
AddSC_boss_morogrim_tidewalker();
AddSC_instance_serpentshrine_cavern();
AddSC_boss_the_lurker_below();
- AddSC_boss_hydromancer_thespia(); //CR Steam Vault
+
+ // Coilfang Reservoir - The Steam Vault
+ AddSC_instance_steam_vault();
+ AddSC_boss_hydromancer_thespia();
AddSC_boss_mekgineer_steamrigger();
AddSC_boss_warlord_kalithresh();
- AddSC_instance_steam_vault();
- AddSC_instance_the_slave_pens(); //The Slave Pens
- AddSC_boss_hungarfen(); //CR Underbog
- AddSC_boss_the_black_stalker();
+
+ // Coilfang Reservoir - The Slave Pens
+ AddSC_instance_the_slave_pens();
+ AddSC_boss_mennu_the_betrayer();
+ AddSC_boss_rokmar_the_crackler();
+ AddSC_boss_quagmirran();
+
+ // Coilfang Reservoir - The Underbog
AddSC_instance_the_underbog();
- AddSC_boss_gruul(); //Gruul's Lair
+ AddSC_boss_hungarfen();
+ AddSC_boss_the_black_stalker();
+
+ // Gruul's Lair
+ AddSC_boss_gruul();
AddSC_boss_high_king_maulgar();
AddSC_instance_gruuls_lair();
AddSC_boss_broggok(); //HC Blood Furnace
@@ -1152,6 +1189,9 @@ void AddOutlandScripts()
AddSC_boss_vazruden_the_herald();
AddSC_instance_ramparts();
AddSC_arcatraz(); //TK Arcatraz
+ AddSC_boss_zereketh_the_unbound();
+ AddSC_boss_dalliah_the_doomsayer();
+ AddSC_boss_wrath_scryer_soccothrates();
AddSC_boss_harbinger_skyriss();
AddSC_instance_arcatraz();
AddSC_boss_high_botanist_freywinn(); //TK Botanica
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 51fd45f9880..621c4e2bce0 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -4768,28 +4768,43 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/)
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
return;
- Player* player = m_caster->ToPlayer();
- if (!player)
+ if (damage < 0)
return;
- Pet* pet = player->GetPet();
- if (pet && pet->IsAlive())
+ Player* player = m_caster->ToPlayer();
+ if (!player)
return;
- if (damage < 0)
- return;
- float x, y, z;
- player->GetPosition(x, y, z);
- if (!pet)
+ // Maybe player dismissed dead pet or pet despawned?
+ bool hadPet = true;
+ if (!player->GetPet())
{
- player->SummonPet(0, x, y, z, player->GetOrientation(), SUMMON_PET, 0);
- pet = player->GetPet();
+ // Position passed to SummonPet is irrelevant with current implementation,
+ // pet will be relocated without using these coords in Pet::LoadPetFromDB
+ player->SummonPet(0, 0.0f, 0.0f, 0.0f, 0.0f, SUMMON_PET, 0);
+ hadPet = false;
}
+
+ // TODO: Better to fail Hunter's "Revive Pet" at cast instead of here when casting ends
+ Pet* pet = player->GetPet(); // Attempt to get current pet
if (!pet)
return;
- player->GetMap()->CreatureRelocation(pet, x, y, z, player->GetOrientation());
+ // TODO: Better to fail Hunter's "Revive Pet" at cast instead of here when casting ends
+ if (pet->IsAlive())
+ return;
+
+ // If player did have a pet before reviving, teleport it
+ if (hadPet)
+ {
+ // Reposition the pet's corpse before reviving so as not to grab aggro
+ // We can use a different, more accurate version of GetClosePoint() since we have a pet
+ float x, y, z; // Will be used later to reposition the pet if we have one
+ player->GetClosePoint(x, y, z, pet->GetObjectSize(), PET_FOLLOW_DIST, pet->GetFollowAngle());
+ pet->NearTeleportTo(x, y, z, player->GetOrientation());
+ pet->Relocate(x, y, z, player->GetOrientation()); // This is needed so SaveStayPosition() will get the proper coords.
+ }
pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE);
pet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
@@ -4797,8 +4812,20 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/)
pet->ClearUnitState(uint32(UNIT_STATE_ALL_STATE));
pet->SetHealth(pet->CountPctFromMaxHealth(damage));
- //pet->AIM_Initialize();
- //player->PetSpellInitialize();
+ // Reset things for when the AI to takes over
+ CharmInfo *ci = pet->GetCharmInfo();
+ if (ci)
+ {
+ // In case the pet was at stay, we don't want it running back
+ ci->SaveStayPosition();
+ ci->SetIsAtStay(ci->HasCommandState(COMMAND_STAY));
+
+ ci->SetIsFollowing(false);
+ ci->SetIsCommandAttack(false);
+ ci->SetIsCommandFollow(false);
+ ci->SetIsReturning(false);
+ }
+
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
}
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 3e9c564e874..9a01b86af00 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -3185,6 +3185,7 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS_2);
break;
case 31347: // Doom
+ case 36327: // Shoot Arcane Explosion Arrow
case 39365: // Thundering Storm
case 41071: // Raise Dead (HACK)
case 42442: // Vengeance Landing Cannonfire
@@ -3285,6 +3286,9 @@ void SpellMgr::LoadSpellInfoCorrections()
// add corruption to affected spells
spellInfo->Effects[EFFECT_1].SpellClassMask[0] |= 2;
break;
+ case 37408: // Oscillation Field
+ spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS;
+ break;
case 51852: // The Eye of Acherus (no spawn in phase 2 in db)
spellInfo->Effects[EFFECT_0].MiscValue |= 1;
break;
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index 68fe06f5f9f..701fb144165 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -3103,16 +3103,6 @@ void World::LoadDBVersion()
m_DBVersion = "Unknown world database.";
}
-void World::ProcessStartEvent()
-{
- isEventKillStart = true;
-}
-
-void World::ProcessStopEvent()
-{
- isEventKillStart = false;
-}
-
void World::UpdateAreaDependentAuras()
{
SessionMap::const_iterator itr;
diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
index a649791546f..10d5d4ef36c 100644
--- a/src/server/game/World/World.h
+++ b/src/server/game/World/World.h
@@ -751,12 +751,6 @@ class World
void UpdateAreaDependentAuras();
- void ProcessStartEvent();
- void ProcessStopEvent();
- bool GetEventKill() const { return isEventKillStart; }
-
- bool isEventKillStart;
-
CharacterNameData const* GetCharacterNameData(uint32 guid) const;
void AddCharacterNameData(uint32 guid, std::string const& name, uint8 gender, uint8 race, uint8 playerClass, uint8 level);
void UpdateCharacterNameData(uint32 guid, std::string const& name, uint8 gender = GENDER_NONE, uint8 race = RACE_NONE);