mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Misc: some corrections after recent merges
This commit is contained in:
@@ -152,7 +152,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
|
||||
@@ -183,6 +183,7 @@ static bool ShouldFollowOnSpawn(SummonPropertiesEntry const* properties)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void CreatureAI::JustAppeared()
|
||||
{
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
|
||||
@@ -176,6 +176,8 @@ class boss_thekal : public CreatureScript
|
||||
case NPC_ZEALOT_ZATH:
|
||||
_isZathDead = true;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (_isThekalDead && _isLorkhanDead && _isZathDead)
|
||||
@@ -373,23 +375,23 @@ enum LorkhanEvents
|
||||
class LorKhanSelectTargetToHeal
|
||||
{
|
||||
public:
|
||||
LorKhanSelectTargetToHeal(Unit const* obj, float range) : i_obj(obj), i_range(range), i_hp(0) { }
|
||||
LorKhanSelectTargetToHeal(Unit const* reference, float range) : _reference(reference), _range(range), _hp(0) { }
|
||||
|
||||
bool operator()(Unit* u)
|
||||
bool operator()(Unit* object)
|
||||
{
|
||||
if (u->GetTypeId() != TYPEID_UNIT || !u->IsAlive() || !u->IsInCombat())
|
||||
if (object->GetTypeId() != TYPEID_UNIT || !object->IsAlive() || !object->IsInCombat())
|
||||
return false;
|
||||
|
||||
if (u->ToCreature()->GetEntry() != NPC_HIGH_PRIEST_THEKAL && u->GetEntry() != NPC_ZEALOT_LORKHAN && u->GetEntry() != NPC_ZEALOT_ZATH)
|
||||
if (object->ToCreature()->GetEntry() != NPC_HIGH_PRIEST_THEKAL && object->GetEntry() != NPC_ZEALOT_LORKHAN && object->GetEntry() != NPC_ZEALOT_ZATH)
|
||||
return false;
|
||||
|
||||
// Don't allow to heal a target that is waiting for resurrection
|
||||
if (u->HasAura(SPELL_PERMANENT_FEIGN_DEATH))
|
||||
if (object->HasAura(SPELL_PERMANENT_FEIGN_DEATH))
|
||||
return false;
|
||||
|
||||
if ((u->GetMaxHealth() - u->GetHealth() > i_hp) && i_obj->IsWithinDistInMap(u, i_range))
|
||||
if ((object->GetMaxHealth() - object->GetHealth() > _hp) && _reference->IsWithinDistInMap(object, _range))
|
||||
{
|
||||
i_hp = u->GetMaxHealth() - u->GetHealth();
|
||||
_hp = object->GetMaxHealth() - object->GetHealth();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -397,15 +399,16 @@ class LorKhanSelectTargetToHeal
|
||||
}
|
||||
|
||||
private:
|
||||
Unit const* i_obj;
|
||||
float i_range;
|
||||
uint32 i_hp;
|
||||
Unit const* _reference;
|
||||
float const _range;
|
||||
uint32 _hp;
|
||||
};
|
||||
|
||||
// Zealot Lor'Khan
|
||||
class npc_zealot_lorkhan : public CreatureScript
|
||||
{
|
||||
public: npc_zealot_lorkhan() : CreatureScript("npc_zealot_lorkhan") { }
|
||||
public:
|
||||
npc_zealot_lorkhan() : CreatureScript("npc_zealot_lorkhan") { }
|
||||
|
||||
struct npc_zealot_lorkhanAI : public ScriptedAI
|
||||
{
|
||||
@@ -479,6 +482,8 @@ public: npc_zealot_lorkhan() : CreatureScript("npc_zealot_lorkhan") { }
|
||||
DoCastVictim(SPELL_DISARM);
|
||||
_events.ScheduleEvent(EVENT_DISARM, 15s, 25s);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -581,6 +586,8 @@ class npc_zealot_zath : public CreatureScript
|
||||
DoCastVictim(SPELL_BLIND);
|
||||
_events.ScheduleEvent(EVENT_BLIND, 10s, 20s);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -639,6 +639,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->RemoveFlag(UNIT_NPC_FLAGS, 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);
|
||||
|
||||
@@ -766,6 +766,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();
|
||||
|
||||
@@ -1446,6 +1446,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);
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "Map.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "Random.h"
|
||||
#include "SkillDiscovery.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellHistory.h"
|
||||
@@ -1737,6 +1738,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;
|
||||
@@ -1776,6 +1792,8 @@ class spell_item_ultrasafe_transporter : public SpellScript
|
||||
case 6:
|
||||
spellId = SPELL_EVIL_TWIN;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
caster->CastSpell(caster, spellId, true);
|
||||
@@ -1792,6 +1810,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;
|
||||
@@ -1822,6 +1852,8 @@ class spell_item_dimensional_ripper_area52 : public SpellScript
|
||||
else
|
||||
spellId = SPELL_TRANSFORM_ALLIANCE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
caster->CastSpell(caster, spellId, true);
|
||||
|
||||
@@ -3925,6 +3925,7 @@ Logger.mmaps=3,Server
|
||||
#Logger.scripts.ai.followerai=3,Console Server
|
||||
#Logger.scripts.ai.petai=3,Console Server
|
||||
#Logger.scripts.ai.sai=3,Console Server
|
||||
#Logger.scripts.cos=3,Console Server
|
||||
#Logger.server.authserver=3,Console Server
|
||||
#Logger.spells=3,Console Server
|
||||
#Logger.spells.aura.effect=3,Console Server
|
||||
|
||||
Reference in New Issue
Block a user