aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorccrs <ccrs@users.noreply.github.com>2019-06-29 16:01:58 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-13 00:42:18 +0100
commitcadbf42ea4489933f28caf356f8c8d09ca243083 (patch)
treeedd3011eb7d7cb6802685fe4186ae56eaa92331f /src
parent996b7c1f0ebb22b424d7406adf88b43143b2ede4 (diff)
Misc: some corrections after recent merges
(cherry picked from commit 626a24822b3c6a5d5b9a4b29861ecf393fd9288b)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/CreatureAI.cpp3
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp19
-rw-r--r--src/server/scripts/Northrend/zone_sholazar_basin.cpp10
-rw-r--r--src/server/scripts/Northrend/zone_storm_peaks.cpp5
-rw-r--r--src/server/scripts/Spells/spell_item.cpp32
6 files changed, 69 insertions, 2 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 9ded80817a1..b23a7284da1 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -159,7 +159,7 @@ void CreatureAI::TriggerAlert(Unit const* who) const
me->GetMotionMaster()->MoveDistract(5 * IN_MILLISECONDS, me->GetAbsoluteAngle(who));
}
-// adapted from logic in Spell:EFfectSummonType before commit 8499434
+// adapted from logic in Spell:EffectSummonType
static bool ShouldFollowOnSpawn(SummonPropertiesEntry const* properties)
{
// Summons without SummonProperties are generally scripted summons that don't belong to any owner
@@ -190,6 +190,7 @@ static bool ShouldFollowOnSpawn(SummonPropertiesEntry const* properties)
return false;
}
}
+
void CreatureAI::JustAppeared()
{
if (TempSummon* summon = me->ToTempSummon())
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp
index 54223d08184..db3f2bcd876 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp
@@ -638,6 +638,8 @@ class instance_culling_of_stratholme : public InstanceMapScript
object->setActive(true);
object->SetGoState(_currentState <= GAUNTLET_TRANSITION ? GO_STATE_READY : GO_STATE_ACTIVE);
break;
+ default:
+ break;
}
}
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp
index 19a75c6fc99..c2ab2ee203b 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp
@@ -555,8 +555,12 @@ public:
void AdvanceToState(COSProgressStates newState)
{
+ TC_LOG_TRACE("scripts.cos", "npc_arthas_stratholmeAI::AdvanceToState: advancing to 0x%X", newState);
if (!_progressRP)
+ {
+ TC_LOG_WARN("scripts.cos", "npc_arthas_stratholmeAI::AdvanceToState: advancing to instance state 0x%X, but RP is paused. Overriding!", newState);
_progressRP = true;
+ }
auto itr = ArthasSnapbackPositions.find(newState);
if (itr != ArthasSnapbackPositions.end())
@@ -576,6 +580,7 @@ public:
else
me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
+ TC_LOG_TRACE("scripts.cos", "npc_arthas_stratholmeAI::AdvanceToState: has snapback for this state, distance = %u", target.SnapbackPosition->GetExactDist(me));
// Snapback handling - if we're too far from where we're supposed to be, teleport there
if (target.SnapbackPosition->GetExactDist(me) > ArthasSnapbackDistanceThreshold)
me->NearTeleportTo(*target.SnapbackPosition);
@@ -1536,18 +1541,24 @@ public:
void JustEngagedWith(Unit* who) override
{
+ TC_LOG_TRACE("scripts.cos", "npc_arthas_stratholmeAI::JustEngagedWith: RP in progress? '%s'", _progressRP ? "YES" : "NO");
if (_progressRP)
{
_progressRP = false;
me->SetHomePosition(me->GetPosition());
SplineChainMovementGenerator::GetResumeInfo(_resumeMovement, me);
+ if (!_resumeMovement.Empty())
+ TC_LOG_TRACE("scripts.cos", "npc_arthas_stratholmeAI::JustEngagedWith: spline chain motion paused");
+ else
+ TC_LOG_TRACE("scripts.cos", "npc_arthas_stratholmeAI::JustEngagedWith: entered combat without pathing, pausing RP regardless");
}
ScriptedAI::JustEngagedWith(who);
}
void EnterEvadeMode(EvadeReason why) override
{
+ TC_LOG_TRACE("scripts.cos", "npc_arthas_stratholmeAI::EnterEvadeMode: why = %u ", why);
ScriptedAI::EnterEvadeMode(why);
}
@@ -1560,9 +1571,12 @@ public:
if (!_resumeMovement.Empty()) // WP motion was interrupted, resume
{
+ TC_LOG_TRACE("scripts.cos", "npc_arthas_stratholmeAI::JustReachedHome: Resuming motion");
me->GetMotionMaster()->ResumeSplineChain(_resumeMovement);
_resumeMovement.Clear();
}
+ else
+ TC_LOG_TRACE("scripts.cos", "npc_arthas_stratholmeAI::JustReachedHome: Back at leash pos, resuming RP");
if (_afterCombat)
{
@@ -1591,8 +1605,11 @@ public:
instance->SetGuidData(command, cause->GetGUID());
}
- bool GossipSelect(Player* player, uint32 /*sender*/, uint32 /*listId*/) override
+ bool GossipSelect(Player* player, uint32 /*sender*/, uint32 listId) override
{
+ uint32 const action = GetGossipActionFor(player, listId);
+ TC_LOG_TRACE("scripts.cos", "npc_arthas_stratholmeAI::GossipSelect: '%s' selects action '%u' on '%s'", player->GetGUID().ToString().c_str(), action, me->GetGUID().ToString().c_str());
+
AdvanceDungeon(player, PURGE_PENDING, DATA_START_PURGE);
AdvanceDungeon(player, TOWN_HALL_PENDING, DATA_START_TOWN_HALL);
AdvanceDungeon(player, TOWN_HALL_COMPLETE, DATA_TO_GAUNTLET);
diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp
index fd4d463b601..1fbe817b82c 100644
--- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp
+++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp
@@ -762,6 +762,16 @@ class spell_q12611_deathbolt : public SpellScript
{
PrepareSpellScript(spell_q12611_deathbolt);
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo(
+ {
+ SPELL_FREYAS_WARD,
+ SPELL_SEVENFOLD_RETRIBUTION,
+ SPELL_DEATHBOLT
+ });
+ }
+
void HandleScriptEffect(SpellEffIndex /* effIndex */)
{
Unit* caster = GetCaster();
diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp
index 30b1438b6fd..e5ec9d5a6ad 100644
--- a/src/server/scripts/Northrend/zone_storm_peaks.cpp
+++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp
@@ -1538,6 +1538,11 @@ class spell_q12823_remove_collapsing_cave_aura : public SpellScript
{
PrepareSpellScript(spell_q12823_remove_collapsing_cave_aura);
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_COLLAPSING_CAVE });
+ }
+
void HandleScriptEffect(SpellEffIndex /* effIndex */)
{
GetHitUnit()->RemoveAurasDueToSpell(SPELL_COLLAPSING_CAVE);
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index 2538f536ff6..cc7078b8f69 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -32,6 +32,7 @@
#include "Map.h"
#include "ObjectMgr.h"
#include "Player.h"
+#include "Random.h"
#include "ScriptedCreature.h"
#include "SkillDiscovery.h"
#include "Spell.h"
@@ -1727,6 +1728,21 @@ class spell_item_ultrasafe_transporter : public SpellScript
{
PrepareSpellScript(spell_item_ultrasafe_transporter);
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo(
+ {
+ SPELL_TRANSPORTER_MALFUNCTION_SMALLER,
+ SPELL_TRANSPORTER_MALFUNCTION_BIGGER,
+ SPELL_SOUL_SPLIT_EVIL,
+ SPELL_SOUL_SPLIT_GOOD,
+ SPELL_TRANSFORM_HORDE,
+ SPELL_TRANSFORM_ALLIANCE,
+ SPELL_TRANSPORTER_MALFUNCTION_CHICKEN,
+ SPELL_EVIL_TWIN,
+ });
+ }
+
bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
@@ -1766,6 +1782,8 @@ class spell_item_ultrasafe_transporter : public SpellScript
case 6:
spellId = SPELL_EVIL_TWIN;
break;
+ default:
+ break;
}
caster->CastSpell(caster, spellId, true);
@@ -1782,6 +1800,18 @@ class spell_item_dimensional_ripper_area52 : public SpellScript
{
PrepareSpellScript(spell_item_dimensional_ripper_area52);
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo(
+ {
+ SPELL_TRANSPORTER_MALFUNCTION_BIGGER,
+ SPELL_SOUL_SPLIT_EVIL,
+ SPELL_SOUL_SPLIT_GOOD,
+ SPELL_TRANSFORM_HORDE,
+ SPELL_TRANSFORM_ALLIANCE
+ });
+ }
+
bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
@@ -1812,6 +1842,8 @@ class spell_item_dimensional_ripper_area52 : public SpellScript
else
spellId = SPELL_TRANSFORM_ALLIANCE;
break;
+ default:
+ break;
}
caster->CastSpell(caster, spellId, true);