mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Misc: some corrections after recent merges
(cherry picked from commit 626a24822b)
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user