Core/Units: Added helper functions to modify UNIT_FLAG_UNINTERACTIBLE
Port From (https://github.com/TrinityCore/TrinityCore/commit/88ff97c1f96381565c47f8ca1993bdc7fce19fd6)
This commit is contained in:
+2
-2
@@ -46,7 +46,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.PyroguardEmbe
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
me.SetUnitFlag(UnitFlags.Uninteractible);
|
||||
me.SetUninteractible(true);
|
||||
me.SetImmuneToPC(true);
|
||||
_scheduler.CancelAll();
|
||||
// Apply auras on spawn and reset
|
||||
@@ -172,7 +172,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.PyroguardEmbe
|
||||
me.CastSpell(me, SpellIds.EmberseerFullStrength);
|
||||
Talk(TextIds.EmoteFreeOfBonds);
|
||||
Talk(TextIds.YellFreeOfBonds);
|
||||
me.RemoveUnitFlag(UnitFlags.Uninteractible);
|
||||
me.SetUninteractible(false);
|
||||
me.SetImmuneToPC(false);
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(2), task =>
|
||||
{
|
||||
|
||||
@@ -204,7 +204,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackwingLair.VictorNefarius
|
||||
if (summon.GetEntry() != BWLCreatureIds.Nefarian)
|
||||
{
|
||||
summon.UpdateEntry(CreatureIds.BoneConstruct);
|
||||
summon.SetUnitFlag(UnitFlags.Uninteractible);
|
||||
summon.SetUninteractible(true);
|
||||
summon.SetReactState(ReactStates.Passive);
|
||||
summon.SetStandState(UnitStandStateType.Dead);
|
||||
}
|
||||
@@ -561,7 +561,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackwingLair.VictorNefarius
|
||||
{
|
||||
creature.Respawn();
|
||||
DoZoneInCombat(creature);
|
||||
creature.RemoveUnitFlag(UnitFlags.Uninteractible);
|
||||
creature.SetUninteractible(false);
|
||||
creature.SetReactState(ReactStates.Aggressive);
|
||||
creature.SetStandState(UnitStandStateType.Stand);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackwingLair.Vaelastrasz
|
||||
Initialize();
|
||||
creature.SetNpcFlag(NPCFlags.Gossip);
|
||||
creature.SetFaction((uint)FactionTemplates.Friendly);
|
||||
creature.RemoveUnitFlag(UnitFlags.Uninteractible);
|
||||
creature.SetUninteractible(false);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.MoltenCore
|
||||
//Become unbanished again
|
||||
me.SetReactState(ReactStates.Aggressive);
|
||||
me.SetFaction((uint)FactionTemplates.Monster);
|
||||
me.RemoveUnitFlag(UnitFlags.Uninteractible);
|
||||
me.SetUninteractible(false);
|
||||
me.SetEmoteState(Emote.OneshotNone);
|
||||
me.HandleEmoteCommand(Emote.OneshotEmerge);
|
||||
Unit target = SelectTarget(SelectTargetMethod.Random, 0);
|
||||
@@ -240,7 +240,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.MoltenCore
|
||||
//Root self
|
||||
//DoCast(me, 23973);
|
||||
me.SetFaction((uint)FactionTemplates.Friendly);
|
||||
me.SetUnitFlag(UnitFlags.Uninteractible);
|
||||
me.SetUninteractible(true);
|
||||
me.SetEmoteState(Emote.StateSubmerged);
|
||||
me.HandleEmoteCommand(Emote.OneshotSubmerge);
|
||||
instance.SetData(MCMiscConst.DataRagnarosAdds, 0);
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Curator
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(2), task =>
|
||||
{
|
||||
me.SetReactState(ReactStates.Aggressive);
|
||||
me.RemoveUnitFlag(UnitFlags.Uninteractible);
|
||||
me.SetUninteractible(false);
|
||||
DoZoneInCombat();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Nightbane
|
||||
phase = NightbanePhases.Intro;
|
||||
me.SetActive(true);
|
||||
me.SetFarVisible(true);
|
||||
me.RemoveUnitFlag(UnitFlags.Uninteractible);
|
||||
me.SetUninteractible(false);
|
||||
me.GetMotionMaster().MoveAlongSplineChain(PointIds.IntroStart, SplineChainIds.IntroStart, false);
|
||||
HandleTerraceDoors(false);
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ namespace Scripts.EasternKingdoms.Karazhan.EsOpera
|
||||
creature.InterruptNonMeleeSpells(true);
|
||||
creature.RemoveAllAuras();
|
||||
creature.SetHealth(0);
|
||||
creature.SetUnitFlag(UnitFlags.Uninteractible);
|
||||
creature.SetUninteractible(true);
|
||||
creature.GetMotionMaster().Clear();
|
||||
creature.GetMotionMaster().MoveIdle();
|
||||
creature.SetStandState(UnitStandStateType.Dead);
|
||||
@@ -158,7 +158,7 @@ namespace Scripts.EasternKingdoms.Karazhan.EsOpera
|
||||
|
||||
public static void Resurrect(Creature target)
|
||||
{
|
||||
target.RemoveUnitFlag(UnitFlags.Uninteractible);
|
||||
target.SetUninteractible(false);
|
||||
target.SetFullHealth();
|
||||
target.SetStandState(UnitStandStateType.Stand);
|
||||
target.CastSpell(target, SpellIds.ResVisual, true);
|
||||
@@ -1070,7 +1070,7 @@ namespace Scripts.EasternKingdoms.Karazhan.EsOpera
|
||||
Creature Romulo = ObjectAccessor.GetCreature(me, RomuloGUID);
|
||||
if (Romulo)
|
||||
{
|
||||
Romulo.RemoveUnitFlag(UnitFlags.Uninteractible);
|
||||
Romulo.SetUninteractible(false);
|
||||
Romulo.GetMotionMaster().Clear();
|
||||
Romulo.SetDeathState(DeathState.JustDied);
|
||||
Romulo.CombatStop(true);
|
||||
@@ -1320,7 +1320,7 @@ namespace Scripts.EasternKingdoms.Karazhan.EsOpera
|
||||
Creature Julianne = ObjectAccessor.GetCreature(me, JulianneGUID);
|
||||
if (Julianne)
|
||||
{
|
||||
Julianne.RemoveUnitFlag(UnitFlags.Uninteractible);
|
||||
Julianne.SetUninteractible(false);
|
||||
Julianne.GetMotionMaster().Clear();
|
||||
Julianne.SetDeathState(DeathState.JustDied);
|
||||
Julianne.CombatStop(true);
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace Scripts.EasternKingdoms.Karazhan.PrinceMalchezaar
|
||||
if (spellInfo.Id == SpellIds.InfernalRelay)
|
||||
{
|
||||
me.SetDisplayId(me.GetNativeDisplayId());
|
||||
me.SetUnitFlag(UnitFlags.Uninteractible);
|
||||
me.SetUninteractible(true);
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(4), task => DoCast(me, SpellIds.Hellfire));
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(170), task =>
|
||||
@@ -402,7 +402,7 @@ namespace Scripts.EasternKingdoms.Karazhan.PrinceMalchezaar
|
||||
Creature axe = me.SummonCreature(MiscConst.MalchezarsAxe, me.GetPositionX(), me.GetPositionY(), me.GetPositionZ(), 0, TempSummonType.TimedDespawnOutOfCombat, TimeSpan.FromSeconds(1));
|
||||
if (axe)
|
||||
{
|
||||
axe.SetUnitFlag(UnitFlags.Uninteractible);
|
||||
axe.SetUninteractible(true);
|
||||
axe.SetFaction(me.GetFaction());
|
||||
axes[i] = axe.GetGUID();
|
||||
if (target)
|
||||
|
||||
@@ -378,7 +378,7 @@ namespace Scripts.EasternKingdoms.MagistersTerrace.FelbloodKaelthas
|
||||
me.AttackStop();
|
||||
me.SetReactState(ReactStates.Passive);
|
||||
me.RemoveAllAuras();
|
||||
me.SetUnitFlag(UnitFlags.Uninteractible);
|
||||
me.SetUninteractible(true);
|
||||
DoCastSelf(SpellIds.EmberBlast);
|
||||
// DoCastSelf(SpellSummonPhoenixEgg); -- We do a manual summon for now. Feel free to move it to spelleffect_dbc
|
||||
Creature egg = DoSummon(CreatureIds.PhoenixEgg, me.GetPosition(), TimeSpan.FromSeconds(0));
|
||||
@@ -407,7 +407,7 @@ namespace Scripts.EasternKingdoms.MagistersTerrace.FelbloodKaelthas
|
||||
_isInEgg = false;
|
||||
DoCastSelf(SpellIds.FullHeal);
|
||||
DoCastSelf(SpellIds.Burn);
|
||||
me.RemoveUnitFlag(UnitFlags.Uninteractible);
|
||||
me.SetUninteractible(false);
|
||||
engageTask.Schedule(TimeSpan.FromSeconds(2), task => me.SetReactState(ReactStates.Aggressive));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace Scripts.EasternKingdoms.MagistersTerrace.SelinFireheart
|
||||
Unit CrystalChosen = Global.ObjAccessor.GetUnit(me, CrystalGUID);
|
||||
if (CrystalChosen != null && CrystalChosen.IsAlive())
|
||||
{
|
||||
CrystalChosen.RemoveUnitFlag(UnitFlags.Uninteractible);
|
||||
CrystalChosen.SetUninteractible(false);
|
||||
CrystalChosen.CastSpell(me, SpellIds.ManaRage, true);
|
||||
_events.ScheduleEvent(EventIds.Empower, TimeSpan.FromSeconds(10), PhaseIds.Drain);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user