More Scripts done.
This commit is contained in:
+183
@@ -0,0 +1,183 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.Entities;
|
||||
using Game.Maps;
|
||||
using Game.Scripting;
|
||||
|
||||
namespace Scripts.DragonIsles.AberrusTheShadowedCrucible
|
||||
{
|
||||
//uint EncounterCount = 9;
|
||||
|
||||
struct DataTypes
|
||||
{
|
||||
// Encounters
|
||||
public const uint KazzaraTheHellforged = 0;
|
||||
public const uint TheAmalgamationChamber = 1;
|
||||
public const uint TheForgottenExperiments = 2;
|
||||
public const uint AssaultOfTheZaqali = 3;
|
||||
public const uint RashokTheElder = 4;
|
||||
public const uint ZskarnTheVigilantSteward = 5;
|
||||
public const uint Magmorax = 6;
|
||||
public const uint EchoOfNeltharion = 7;
|
||||
public const uint ScalecommanderSarkareth = 8;
|
||||
|
||||
// Additional public const uint
|
||||
public const uint KazzaraGate = 9;
|
||||
|
||||
// Misc
|
||||
public const uint KazzaraIntroDone = 10;
|
||||
}
|
||||
|
||||
struct CreatureIds
|
||||
{
|
||||
// public const uint Bosses
|
||||
public const uint BossKazzaraTheHellforged = 201261;
|
||||
|
||||
public const uint BossEternalBlaze = 201773;
|
||||
public const uint BossEssenceOfShadow = 201774;
|
||||
public const uint BossShadowflameAmalgamation = 201934;
|
||||
|
||||
public const uint BossNeldris = 200912;
|
||||
public const uint BossThadrion = 200913;
|
||||
public const uint BossRionthus = 200918;
|
||||
|
||||
public const uint BossWarlordKagni = 199659;
|
||||
public const uint BossRashokTheElder = 201320;
|
||||
public const uint BossZskarnTheVigilantSteward = 202637;
|
||||
public const uint BossMagmorax = 201579;
|
||||
public const uint BossEchoOfNeltharion = 204223;
|
||||
public const uint BossScalecommanderSarkareth = 205319;
|
||||
|
||||
// Misc
|
||||
public const uint SabellianAtAberrusEntrance = 201575;
|
||||
public const uint ScalecommanderSarkarethAtKazzara = 202416;
|
||||
}
|
||||
|
||||
struct GameObjectIds
|
||||
{
|
||||
public const uint KazzaraDoor = 398742;
|
||||
public const uint KazzaraGate = 397996;
|
||||
public const uint InvisibleDoor = 398588;
|
||||
}
|
||||
|
||||
struct MiscConst
|
||||
{
|
||||
public const int ActionStartKazzaraIntro = 0;
|
||||
|
||||
public const uint SpellAberrusEntranceRpConversation3 = 403409; // Winglord Dezran, Sarkareth and Zskarn (Kazzara Summon)
|
||||
}
|
||||
|
||||
[Script]
|
||||
class instance_aberrus_the_shadowed_crucible : InstanceMapScript
|
||||
{
|
||||
static ObjectData[] creatureData =
|
||||
{
|
||||
new(CreatureIds.BossKazzaraTheHellforged, DataTypes.KazzaraTheHellforged),
|
||||
new(CreatureIds.BossShadowflameAmalgamation, DataTypes.TheAmalgamationChamber),
|
||||
new(CreatureIds.BossRionthus, DataTypes.TheForgottenExperiments),
|
||||
new(CreatureIds.BossWarlordKagni, DataTypes.AssaultOfTheZaqali),
|
||||
new(CreatureIds.BossRashokTheElder, DataTypes.RashokTheElder),
|
||||
new(CreatureIds.BossZskarnTheVigilantSteward, DataTypes.ZskarnTheVigilantSteward),
|
||||
new(CreatureIds.BossMagmorax, DataTypes.Magmorax),
|
||||
new(CreatureIds.BossEchoOfNeltharion, DataTypes.EchoOfNeltharion),
|
||||
new(CreatureIds.BossScalecommanderSarkareth, DataTypes.ScalecommanderSarkareth)
|
||||
};
|
||||
|
||||
static DoorData[] doorData =
|
||||
{
|
||||
new (GameObjectIds.KazzaraDoor, DataTypes.KazzaraTheHellforged, DoorType.Room)
|
||||
};
|
||||
|
||||
static ObjectData[] objData =
|
||||
{
|
||||
new (GameObjectIds.KazzaraGate, DataTypes.KazzaraGate)
|
||||
};
|
||||
|
||||
static DungeonEncounterData[] encounters =
|
||||
{
|
||||
new(DataTypes.KazzaraTheHellforged, 2688),
|
||||
new(DataTypes.TheAmalgamationChamber, 2687),
|
||||
new(DataTypes.TheForgottenExperiments, 2693),
|
||||
new(DataTypes.AssaultOfTheZaqali, 2682),
|
||||
new(DataTypes.RashokTheElder, 2680),
|
||||
new(DataTypes.ZskarnTheVigilantSteward, 2689),
|
||||
new(DataTypes.Magmorax, 2683),
|
||||
new(DataTypes.EchoOfNeltharion, 2684),
|
||||
new(DataTypes.ScalecommanderSarkareth, 2685)
|
||||
};
|
||||
|
||||
public instance_aberrus_the_shadowed_crucible() : base(nameof(instance_aberrus_the_shadowed_crucible), 2569) { }
|
||||
|
||||
class instance_aberrus_the_shadowed_crucible_InstanceMapScript : InstanceScript
|
||||
{
|
||||
byte _deadSunderedMobs;
|
||||
bool _kazzaraIntroDone;
|
||||
|
||||
public instance_aberrus_the_shadowed_crucible_InstanceMapScript(InstanceMap map) : base(map)
|
||||
{
|
||||
SetHeaders("Aberrus");
|
||||
SetBossNumber(9);
|
||||
LoadObjectData(creatureData, objData);
|
||||
LoadDoorData(doorData);
|
||||
LoadDungeonEncounterData(encounters);
|
||||
|
||||
_kazzaraIntroDone = false;
|
||||
_deadSunderedMobs = 0;
|
||||
}
|
||||
|
||||
public override uint GetData(uint dataId)
|
||||
{
|
||||
switch (dataId)
|
||||
{
|
||||
case DataTypes.KazzaraIntroDone:
|
||||
return _kazzaraIntroDone ? 1 : 0u;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override void SetData(uint dataId, uint value)
|
||||
{
|
||||
switch (dataId)
|
||||
{
|
||||
case DataTypes.KazzaraIntroDone:
|
||||
_kazzaraIntroDone = true; // no need to pass value, it will never reset to false
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUnitDeath(Unit unit)
|
||||
{
|
||||
Creature creature = unit.ToCreature();
|
||||
if (creature == null)
|
||||
return;
|
||||
|
||||
if (creature.HasStringId("sundered_mob"))
|
||||
{
|
||||
if (_deadSunderedMobs >= 6)
|
||||
return;
|
||||
|
||||
_deadSunderedMobs++;
|
||||
if (_deadSunderedMobs >= 6)
|
||||
{
|
||||
Creature sarkareth = creature.FindNearestCreature(CreatureIds.ScalecommanderSarkarethAtKazzara, 300.0f);
|
||||
if (sarkareth == null)
|
||||
return;
|
||||
|
||||
sarkareth.CastSpell(null, MiscConst.SpellAberrusEntranceRpConversation3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override InstanceScript GetInstanceScript(InstanceMap map)
|
||||
{
|
||||
return new instance_aberrus_the_shadowed_crucible_InstanceMapScript(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.AI;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Scripts.DragonIsles.AberrusTheShadowedCrucible.KazzaraTheHellforged
|
||||
{
|
||||
struct SpellIds
|
||||
{
|
||||
// Sundered NPCs
|
||||
public const uint Fear = 220540;
|
||||
|
||||
// Kazzara
|
||||
public const uint DreadLanding = 411872;
|
||||
public const uint KazzaraIntro = 410541;
|
||||
}
|
||||
|
||||
[Script] // 201261 - Kazzara the Hellforged
|
||||
class boss_kazzara_the_hellforged : BossAI
|
||||
{
|
||||
public boss_kazzara_the_hellforged(Creature creature) : base(creature, DataTypes.KazzaraTheHellforged) { }
|
||||
|
||||
public override void JustAppeared()
|
||||
{
|
||||
if (instance.GetData(DataTypes.KazzaraIntroDone) == 0)
|
||||
{
|
||||
me.SetUninteractible(true);
|
||||
me.SetImmuneToAll(true);
|
||||
me.SetVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
public override void DoAction(int actionId)
|
||||
{
|
||||
switch (actionId)
|
||||
{
|
||||
case MiscConst.ActionStartKazzaraIntro:
|
||||
{
|
||||
GameObject gate = instance.GetGameObject(DataTypes.KazzaraGate);
|
||||
if (gate != null)
|
||||
{
|
||||
gate.SetFlag(GameObjectFlags.InUse);
|
||||
gate.SetGoState(GameObjectState.Ready);
|
||||
}
|
||||
|
||||
me.SetVisible(true);
|
||||
|
||||
DoCast(SpellIds.DreadLanding);
|
||||
DoCast(SpellIds.KazzaraIntro);
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(1) + TimeSpan.FromMilliseconds(500), _ =>
|
||||
{
|
||||
List<Creature> sunderedMobs = me.GetCreatureListWithOptionsInGrid(50.0f, new FindCreatureOptions() { StringId = "sundered_mob" });
|
||||
foreach (Creature sunderedMob in sunderedMobs)
|
||||
{
|
||||
if (!sunderedMob.IsAlive() || sunderedMob.IsInCombat())
|
||||
continue;
|
||||
|
||||
sunderedMob.CastSpell(null, SpellIds.Fear, false);
|
||||
}
|
||||
});
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(12), _ =>
|
||||
{
|
||||
me.SetUninteractible(false);
|
||||
me.SetImmuneToAll(false);
|
||||
});
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.Entities;
|
||||
using Game.Maps;
|
||||
using Game.Scripting;
|
||||
|
||||
namespace Scripts.DragonIsles.AzureVault
|
||||
{
|
||||
struct DataTypes
|
||||
{
|
||||
// Encounters
|
||||
public const uint Leymor = 0;
|
||||
public const uint Azureblade = 1;
|
||||
public const uint TelashGreywing = 2;
|
||||
public const uint Umbrelskul = 3;
|
||||
|
||||
public const uint LeymorIntroDone = 4;
|
||||
}
|
||||
|
||||
struct CreatureIds
|
||||
{
|
||||
// Bosses
|
||||
public const uint BossLeymor = 186644;
|
||||
public const uint BossAzureblade = 186739;
|
||||
public const uint BossTelashGreywing = 199614;
|
||||
public const uint BossUmbrelskul = 186738;
|
||||
|
||||
// Leymor
|
||||
public const uint ArcaneTender = 191164;
|
||||
}
|
||||
|
||||
struct GameObjectIds
|
||||
{
|
||||
public const uint ArcaneVaultsDoorLeymorEntrance = 380536;
|
||||
public const uint ArcaneVaultsDoorLeymorExit = 377951;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class instance_azure_vault : InstanceMapScript
|
||||
{
|
||||
static BossBoundaryEntry[] boundaries =
|
||||
{
|
||||
new(DataTypes.Leymor, new CircleBoundary(new Position(-5129.39f, 1253.30f), 75.0f))
|
||||
};
|
||||
|
||||
static ObjectData[] creatureData =
|
||||
{
|
||||
new(CreatureIds.BossLeymor, DataTypes.Leymor),
|
||||
new(CreatureIds.BossAzureblade, DataTypes.Azureblade),
|
||||
new(CreatureIds.BossTelashGreywing, DataTypes.TelashGreywing),
|
||||
new(CreatureIds.BossUmbrelskul, DataTypes.Umbrelskul),
|
||||
};
|
||||
|
||||
static DoorData[] doorData =
|
||||
{
|
||||
new(GameObjectIds.ArcaneVaultsDoorLeymorEntrance, DataTypes.Leymor, DoorType.Room),
|
||||
new(GameObjectIds.ArcaneVaultsDoorLeymorExit, DataTypes.Leymor, DoorType.Passage),
|
||||
};
|
||||
|
||||
static DungeonEncounterData[] encounters =
|
||||
{
|
||||
new(DataTypes.Leymor, 2582),
|
||||
new(DataTypes.Azureblade, 2585),
|
||||
new(DataTypes.TelashGreywing, 2583),
|
||||
new(DataTypes.Umbrelskul, 2584)
|
||||
};
|
||||
|
||||
public instance_azure_vault() : base(nameof(instance_azure_vault), 2515) { }
|
||||
|
||||
class instance_azure_vault_InstanceMapScript : InstanceScript
|
||||
{
|
||||
public instance_azure_vault_InstanceMapScript(InstanceMap map) : base(map)
|
||||
{
|
||||
SetHeaders("AzureVault");
|
||||
SetBossNumber(4);
|
||||
LoadObjectData(creatureData, null);
|
||||
LoadDoorData(doorData);
|
||||
LoadBossBoundaries(boundaries);
|
||||
LoadDungeonEncounterData(encounters);
|
||||
|
||||
_leymorIntroDone = false;
|
||||
}
|
||||
|
||||
public override uint GetData(uint dataId)
|
||||
{
|
||||
switch (dataId)
|
||||
{
|
||||
case DataTypes.LeymorIntroDone:
|
||||
return _leymorIntroDone ? 1 : 0u;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override void SetData(uint dataId, uint value)
|
||||
{
|
||||
switch (dataId)
|
||||
{
|
||||
case DataTypes.LeymorIntroDone:
|
||||
_leymorIntroDone = true; // no need to pass value, it will never reset to false
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool _leymorIntroDone;
|
||||
}
|
||||
|
||||
public override InstanceScript GetInstanceScript(InstanceMap map)
|
||||
{
|
||||
return new instance_azure_vault_InstanceMapScript(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,478 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.AI;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
|
||||
namespace Scripts.DragonIsles.AzureVault.Leymor
|
||||
{
|
||||
struct SpellIds
|
||||
{
|
||||
// Leymor
|
||||
public const uint Stasis = 375729;
|
||||
public const uint ArcaneEruption = 375749;
|
||||
public const uint LeyLineSprouts = 374364;
|
||||
public const uint LeyLineSproutsMissile = 374362;
|
||||
public const uint ConsumingStomp = 374720;
|
||||
public const uint ConsumingStompDamage = 374731;
|
||||
public const uint EruptingFissure = 386660;
|
||||
public const uint EruptingFissureSproutSelector = 394154;
|
||||
public const uint ExplosiveBrand = 374567;
|
||||
public const uint ExplosiveBrandDamage = 374570;
|
||||
public const uint ExplosiveBrandKnockback = 374582;
|
||||
public const uint InfusedStrike = 374789;
|
||||
|
||||
// Ley-Line Sprout
|
||||
public const uint VolatileSapling = 388654;
|
||||
public const uint LeyLineSproutAt = 374161;
|
||||
public const uint ArcanePower = 374736;
|
||||
|
||||
// Volatile Sapling
|
||||
public const uint SappyBurst = 375591;
|
||||
|
||||
// Arcane Tender
|
||||
public const uint StasisRitual = 375732;
|
||||
public const uint StasisRitualMissile = 375738;
|
||||
public const uint ErraticGrowthChannel = 375596;
|
||||
public const uint WildEruption = 375652;
|
||||
public const uint WildEruptionMissile = 375650;
|
||||
}
|
||||
|
||||
struct MiscConst
|
||||
{
|
||||
public const uint SayAnnounceAwaken = 0;
|
||||
|
||||
public const uint SpellVisualKitSproutDeath = 159239;
|
||||
|
||||
public const uint NpcLeylineSprouts = 190509;
|
||||
|
||||
public const int ActionArcaneTenderDeath = 1;
|
||||
}
|
||||
|
||||
[Script] // 186644 - Leymor
|
||||
class boss_leymor : BossAI
|
||||
{
|
||||
int _killedArcaneTender;
|
||||
|
||||
public boss_leymor(Creature creature) : base(creature, DataTypes.Leymor) { }
|
||||
|
||||
public override void JustAppeared()
|
||||
{
|
||||
if (instance.GetData(DataTypes.LeymorIntroDone) != 0)
|
||||
return;
|
||||
|
||||
me.SetUnitFlag(UnitFlags.ImmuneToPc | UnitFlags.ImmuneToNpc);
|
||||
DoCastSelf(SpellIds.Stasis);
|
||||
}
|
||||
|
||||
public override void DoAction(int action)
|
||||
{
|
||||
if (action == MiscConst.ActionArcaneTenderDeath)
|
||||
{
|
||||
_killedArcaneTender++;
|
||||
if (_killedArcaneTender >= 3)
|
||||
{
|
||||
instance.SetData(DataTypes.LeymorIntroDone, 1);
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(1), _ =>
|
||||
{
|
||||
me.RemoveAurasDueToSpell(SpellIds.Stasis);
|
||||
me.RemoveUnitFlag(UnitFlags.ImmuneToPc | UnitFlags.ImmuneToNpc);
|
||||
DoCastSelf(SpellIds.ArcaneEruption);
|
||||
Talk(MiscConst.SayAnnounceAwaken);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
_JustDied();
|
||||
instance.SendEncounterUnit(EncounterFrameType.Disengage, me);
|
||||
}
|
||||
|
||||
public override void EnterEvadeMode(EvadeReason why)
|
||||
{
|
||||
instance.SendEncounterUnit(EncounterFrameType.Disengage, me);
|
||||
|
||||
summons.DespawnAll();
|
||||
_EnterEvadeMode();
|
||||
_DespawnAtEvade();
|
||||
}
|
||||
|
||||
public override void OnChannelFinished(SpellInfo spell)
|
||||
{
|
||||
if (spell.Id == SpellIds.ConsumingStomp)
|
||||
DoCastAOE(SpellIds.ConsumingStompDamage, true);
|
||||
}
|
||||
|
||||
public override void JustEngagedWith(Unit who)
|
||||
{
|
||||
base.JustEngagedWith(who);
|
||||
_scheduler.CancelAll();
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(3), task =>
|
||||
{
|
||||
DoCastSelf(SpellIds.LeyLineSprouts);
|
||||
task.Repeat(TimeSpan.FromSeconds(48));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(45), task =>
|
||||
{
|
||||
DoCastSelf(SpellIds.ConsumingStomp);
|
||||
task.Repeat(TimeSpan.FromSeconds(48));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(20), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.EruptingFissure);
|
||||
task.Repeat(TimeSpan.FromSeconds(48));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(31), task =>
|
||||
{
|
||||
DoCastSelf(SpellIds.ExplosiveBrand);
|
||||
task.Repeat(TimeSpan.FromSeconds(48));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(10), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.InfusedStrike);
|
||||
task.Repeat(TimeSpan.FromSeconds(48));
|
||||
});
|
||||
instance.SendEncounterUnit(EncounterFrameType.Engage, me, 1);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
_scheduler.Update(diff, DoMeleeAttackIfReady);
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 191164 - Arcane Tender
|
||||
class npc_arcane_tender : ScriptedAI
|
||||
{
|
||||
public npc_arcane_tender(Creature creature) : base(creature) { }
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
Creature leymor = me.GetInstanceScript().GetCreature(DataTypes.Leymor);
|
||||
if (leymor == null)
|
||||
return;
|
||||
|
||||
if (!leymor.IsAIEnabled())
|
||||
return;
|
||||
|
||||
leymor.GetAI().DoAction(MiscConst.ActionArcaneTenderDeath);
|
||||
}
|
||||
|
||||
public override void JustAppeared()
|
||||
{
|
||||
Creature leymor = me.GetInstanceScript().GetCreature(DataTypes.Leymor);
|
||||
if (leymor == null)
|
||||
return;
|
||||
|
||||
DoCast(leymor, SpellIds.StasisRitual);
|
||||
}
|
||||
|
||||
public override void JustReachedHome()
|
||||
{
|
||||
JustAppeared();
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
_events.Reset();
|
||||
}
|
||||
|
||||
public override void JustEngagedWith(Unit who)
|
||||
{
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(22), task =>
|
||||
{
|
||||
DoCastAOE(SpellIds.ErraticGrowthChannel);
|
||||
task.Repeat();
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(12), task =>
|
||||
{
|
||||
DoCastAOE(SpellIds.WildEruption);
|
||||
task.Repeat();
|
||||
});
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, DoMeleeAttackIfReady);
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 190509 - Ley-Line Sprout
|
||||
class npc_ley_line_sprouts : ScriptedAI
|
||||
{
|
||||
public npc_ley_line_sprouts(Creature creature) : base(creature) { }
|
||||
|
||||
public override void JustAppeared()
|
||||
{
|
||||
DoCastSelf(SpellIds.LeyLineSproutAt);
|
||||
|
||||
DoCastAOE(SpellIds.ArcanePower, true);
|
||||
}
|
||||
|
||||
public override void JustSummoned(Creature summon)
|
||||
{
|
||||
Creature leymor = me.GetInstanceScript().GetCreature(DataTypes.Leymor);
|
||||
if (leymor == null)
|
||||
return;
|
||||
|
||||
if (!leymor.IsAIEnabled())
|
||||
return;
|
||||
|
||||
leymor.GetAI().JustSummoned(summon);
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
if (GetDifficulty() == Difficulty.Mythic || GetDifficulty() == Difficulty.MythicKeystone)
|
||||
DoCastAOE(SpellIds.VolatileSapling, true);
|
||||
|
||||
TempSummon tempSummon = me.ToTempSummon();
|
||||
if (tempSummon != null)
|
||||
{
|
||||
Unit summoner = tempSummon.GetSummonerUnit();
|
||||
if (summoner != null)
|
||||
{
|
||||
Aura aura = summoner.GetAura(SpellIds.ArcanePower);
|
||||
if (aura != null)
|
||||
aura.ModStackAmount(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void SpellHit(WorldObject caster, SpellInfo spellInfo)
|
||||
{
|
||||
if (spellInfo.Id != SpellIds.ExplosiveBrandDamage && spellInfo.Id != SpellIds.EruptingFissureSproutSelector)
|
||||
return;
|
||||
|
||||
me.SendPlaySpellVisualKit(MiscConst.SpellVisualKitSproutDeath, 0, 0);
|
||||
me.KillSelf();
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 196559 - Volatile Sapling
|
||||
class npc_volatile_sapling : ScriptedAI
|
||||
{
|
||||
public npc_volatile_sapling(Creature creature) : base(creature) { }
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage, DamageEffectType damageType, SpellInfo spellInfo = null)
|
||||
{
|
||||
if (me.GetHealth() <= damage)
|
||||
{
|
||||
damage = (uint)(me.GetHealth() - 1);
|
||||
|
||||
if (!_isSappyBurstCast)
|
||||
{
|
||||
me.CastSpell(null, SpellIds.SappyBurst, false);
|
||||
_isSappyBurstCast = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSpellCast(SpellInfo spell)
|
||||
{
|
||||
if (spell.Id != SpellIds.SappyBurst)
|
||||
return;
|
||||
|
||||
me.KillSelf();
|
||||
}
|
||||
|
||||
|
||||
bool _isSappyBurstCast;
|
||||
}
|
||||
|
||||
[Script] // 374364 - Ley-Line Sprouts
|
||||
class spell_ley_line_sprouts : SpellScript
|
||||
{
|
||||
Position[] LeyLineSproutGroupOrigin =
|
||||
{
|
||||
new(-5129.39f, 1253.30f, 555.58f),
|
||||
new(-5101.68f, 1253.71f, 555.90f),
|
||||
new(-5114.70f, 1230.28f, 555.89f),
|
||||
new(-5141.62f, 1230.33f, 555.83f),
|
||||
new(-5155.62f, 1253.60f, 555.87f),
|
||||
new(-5141.42f, 1276.70f, 555.89f),
|
||||
new(-5114.78f, 1277.42f, 555.87f)
|
||||
};
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.LeyLineSproutsMissile);
|
||||
}
|
||||
|
||||
void HandleHit(uint effIndex)
|
||||
{
|
||||
foreach (Position pos in LeyLineSproutGroupOrigin)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
GetCaster().CastSpell(pos, SpellIds.LeyLineSproutsMissile, true);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHit.Add(new(HandleHit, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 375732 - Stasis Ritual
|
||||
class spell_stasis_ritual : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.StasisRitualMissile);
|
||||
}
|
||||
|
||||
void HandlePeriodic(AuraEffect aurEff)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
if (caster != null)
|
||||
caster.CastSpell(null, SpellIds.StasisRitualMissile, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectPeriodic.Add(new(HandlePeriodic, 0, AuraType.PeriodicDummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 375652 - Wild Eruption
|
||||
class spell_wild_eruption : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.WildEruptionMissile);
|
||||
}
|
||||
|
||||
void HandleHitTarget(uint effIndex)
|
||||
{
|
||||
GetCaster().CastSpell(GetHitDest(), SpellIds.WildEruptionMissile, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new(HandleHitTarget, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 375749 - Arcane Eruption
|
||||
class at_leymor_arcane_eruption : AreaTriggerAI
|
||||
{
|
||||
public at_leymor_arcane_eruption(AreaTrigger areatrigger) : base(areatrigger) { }
|
||||
|
||||
public override void OnUnitEnter(Unit unit)
|
||||
{
|
||||
if (!unit.IsPlayer())
|
||||
return;
|
||||
|
||||
unit.ApplyMovementForce(at.GetGUID(), at.GetPosition(), -20.0f, MovementForceType.Gravity);
|
||||
}
|
||||
|
||||
public override void OnUnitExit(Unit unit)
|
||||
{
|
||||
if (!unit.IsPlayer())
|
||||
return;
|
||||
|
||||
unit.RemoveMovementForce(at.GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 374567 - Explosive Brand
|
||||
class spell_explosive_brand : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.ExplosiveBrandKnockback);
|
||||
}
|
||||
|
||||
void HandleHit(uint effIndex)
|
||||
{
|
||||
GetCaster().CastSpell(null, SpellIds.ExplosiveBrandKnockback, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHit.Add(new(HandleHit, 0, SpellEffectName.ApplyAura));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 374567 - Explosive Brand
|
||||
class spell_explosive_brand_AuraScript : AuraScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.ExplosiveBrandDamage);
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
if (GetTargetApplication().GetRemoveMode() != AuraRemoveMode.Expire)
|
||||
return;
|
||||
|
||||
Unit caster = GetCaster();
|
||||
if (caster != null)
|
||||
caster.CastSpell(GetTarget(), SpellIds.ExplosiveBrandDamage, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectRemove.Add(new(OnRemove, 0, AuraType.Dummy, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 374720 - Consuming Stomp
|
||||
class spell_consuming_stomp : AuraScript
|
||||
{
|
||||
void OnRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
GetTarget().KillSelf();
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
AfterEffectRemove.Add(new(OnRemove, 0, AuraType.PeriodicTriggerSpell, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 386660 - Erupting Fissure
|
||||
class spell_erupting_fissure : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.EruptingFissureSproutSelector);
|
||||
}
|
||||
|
||||
void HandleHit(uint effIndex)
|
||||
{
|
||||
GetCaster().CastSpell(GetHitDest(), SpellIds.EruptingFissureSproutSelector, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHit.Add(new(HandleHit, 0, SpellEffectName.Dummy));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 375591 - Sappy Burst
|
||||
class spell_sappy_burst : SpellScript
|
||||
{
|
||||
void HandleHitTarget(uint effIndex)
|
||||
{
|
||||
GetCaster().KillSelf();
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new(HandleHitTarget, 2, SpellEffectName.ScriptEffect));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
@@ -18,9 +18,9 @@ namespace Scripts.DragonIsles.RubyLifePools
|
||||
struct CreatureIds
|
||||
{
|
||||
// Bosses
|
||||
public const uint MelidrussaChillworn = 188252;
|
||||
public const uint KokiaBlazehoof = 189232;
|
||||
public const uint Kyrakka = 190484;
|
||||
public const uint BossMelidrussaChillworn = 188252;
|
||||
public const uint BossKokiaBlazehoof = 189232;
|
||||
public const uint BossKyrakka = 190484;
|
||||
}
|
||||
|
||||
struct GameObjectIds
|
||||
@@ -28,26 +28,25 @@ namespace Scripts.DragonIsles.RubyLifePools
|
||||
public const uint FireWall = 377194;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class instance_ruby_life_pools : InstanceMapScript
|
||||
{
|
||||
public static ObjectData[] creatureData =
|
||||
static ObjectData[] creatureData =
|
||||
{
|
||||
new ObjectData(CreatureIds.MelidrussaChillworn, DataTypes.MelidrussaChillworn),
|
||||
new ObjectData(CreatureIds.KokiaBlazehoof, DataTypes.KokiaBlazehoof),
|
||||
new ObjectData(CreatureIds.Kyrakka, DataTypes.KyrakkaAndErkhartStormvein),
|
||||
new(CreatureIds.BossMelidrussaChillworn, DataTypes.MelidrussaChillworn),
|
||||
new(CreatureIds.BossKokiaBlazehoof, DataTypes.KokiaBlazehoof),
|
||||
new(CreatureIds.BossKyrakka, DataTypes.KyrakkaAndErkhartStormvein)
|
||||
};
|
||||
|
||||
public static DoorData[] doorData =
|
||||
static DoorData[] doorData =
|
||||
{
|
||||
new DoorData(GameObjectIds.FireWall, DataTypes.KokiaBlazehoof, DoorType.Passage),
|
||||
new(GameObjectIds.FireWall, DataTypes.KokiaBlazehoof, DoorType.Passage)
|
||||
};
|
||||
|
||||
public static DungeonEncounterData[] encounters =
|
||||
static DungeonEncounterData[] encounters =
|
||||
{
|
||||
new DungeonEncounterData(DataTypes.MelidrussaChillworn, 2609 ),
|
||||
new DungeonEncounterData(DataTypes.KokiaBlazehoof, 2606 ),
|
||||
new DungeonEncounterData(DataTypes.KyrakkaAndErkhartStormvein, 2623 )
|
||||
new(DataTypes.MelidrussaChillworn, 2609),
|
||||
new(DataTypes.KokiaBlazehoof, 2606),
|
||||
new(DataTypes.KyrakkaAndErkhartStormvein, 2623)
|
||||
};
|
||||
|
||||
public instance_ruby_life_pools() : base(nameof(instance_ruby_life_pools), 2521) { }
|
||||
@@ -69,4 +68,4 @@ namespace Scripts.DragonIsles.RubyLifePools
|
||||
return new instance_ruby_life_pools_InstanceMapScript(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
@@ -6,75 +6,63 @@ using Game;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
|
||||
namespace Scripts.DragonIsles
|
||||
namespace Scripts.DragonIsles.ZoneTheForbiddenReach
|
||||
{
|
||||
struct SpellIds
|
||||
{
|
||||
// Spells
|
||||
public const uint DracthyrLogin = 369728; // teleports to random room, plays scene for the room, binds the home position
|
||||
public const uint Stasis1 = 369735; // triggers 366620
|
||||
public const uint Stasis2 = 366620; // triggers 366636
|
||||
public const uint Stasis3 = 366636; // removes 365560, sends first quest (64864)
|
||||
public const uint Stasis4 = 365560; // freeze the target
|
||||
public const uint DracthyrMovieRoom01 = 394245; // scene for room 1
|
||||
public const uint DracthyrMovieRoom02 = 394279; // scene for room 2
|
||||
public const uint DracthyrMovieRoom03 = 394281; // scene for room 3
|
||||
public const uint DracthyrMovieRoom04 = 394282; // scene for room 4
|
||||
//public const uint DracthyrMovieRoom05 = 394283, // scene for room 5 (only plays sound, unused?)
|
||||
}
|
||||
|
||||
struct MiscConst
|
||||
{
|
||||
public static Tuple<uint, Position>[] LoginRoomData =
|
||||
{
|
||||
Tuple.Create(SpellIds.DracthyrMovieRoom01, new Position(5725.32f, -3024.26f, 251.047f, 0.01745329238474369f)),
|
||||
Tuple.Create(SpellIds.DracthyrMovieRoom02, new Position( 5743.03f, -3067.28f, 251.047f, 0.798488140106201171f)),
|
||||
Tuple.Create(SpellIds.DracthyrMovieRoom03, new Position(5787.1597f, -3083.3906f, 251.04698f, 1.570796370506286621f)),
|
||||
Tuple.Create(SpellIds.DracthyrMovieRoom04, new Position(5829.32f, -3064.49f, 251.047f, 2.364955902099609375f))
|
||||
};
|
||||
}
|
||||
|
||||
[Script] // 369728 - Dracthyr Login
|
||||
class spell_dracthyr_login : SpellScript
|
||||
{
|
||||
const uint SpellDracthyrMovieRoom01 = 394245; // scene for room 1
|
||||
const uint SpellDracthyrMovieRoom02 = 394279; // scene for room 2
|
||||
const uint SpellDracthyrMovieRoom03 = 394281; // scene for room 3
|
||||
const uint SpellDracthyrMovieRoom04 = 394282; // scene for room 4
|
||||
|
||||
(uint, Position)[] LoginRoomData =
|
||||
{
|
||||
(SpellDracthyrMovieRoom01, new(5725.32f, -3024.26f, 251.047f, 0.01745329238474369f)),
|
||||
(SpellDracthyrMovieRoom02, new(5743.03f, -3067.28f, 251.047f, 0.798488140106201171f)),
|
||||
(SpellDracthyrMovieRoom03, new(5787.1597f, -3083.3906f, 251.04698f, 1.570796370506286621f)),
|
||||
(SpellDracthyrMovieRoom04, new(5829.32f, -3064.49f, 251.047f, 2.364955902099609375f))
|
||||
};
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(SpellIds.DracthyrMovieRoom01, SpellIds.DracthyrMovieRoom02, SpellIds.DracthyrMovieRoom03, SpellIds.DracthyrMovieRoom04);
|
||||
return ValidateSpellInfo(SpellDracthyrMovieRoom01, SpellDracthyrMovieRoom02, SpellDracthyrMovieRoom03, SpellDracthyrMovieRoom04);
|
||||
}
|
||||
|
||||
void HandleTeleport(uint effIndex)
|
||||
{
|
||||
var room = MiscConst.LoginRoomData[RandomHelper.URand(0, 3)];
|
||||
var (spellId, pos) = LoginRoomData[RandomHelper.URand(0, 3)];
|
||||
|
||||
WorldLocation dest = GetHitUnit().GetWorldLocation();
|
||||
SetExplTargetDest(dest);
|
||||
|
||||
GetHitDest().Relocate(room.Item2);
|
||||
GetHitDest().Relocate(pos);
|
||||
|
||||
GetCaster().CastSpell(GetHitUnit(), room.Item1, true);
|
||||
GetCaster().CastSpell(GetHitUnit(), spellId, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleTeleport, 0, SpellEffectName.TeleportUnits));
|
||||
OnEffectHitTarget.Add(new(HandleTeleport, 0, SpellEffectName.TeleportUnits));
|
||||
}
|
||||
}
|
||||
|
||||
[Script] // 3730 - Dracthyr Evoker Intro (Post Movie)
|
||||
class scene_dracthyr_evoker_intro : SceneScript
|
||||
{
|
||||
const uint SpellStasis1 = 369735; // triggers 366620'
|
||||
|
||||
public scene_dracthyr_evoker_intro() : base("scene_dracthyr_evoker_intro") { }
|
||||
|
||||
public override void OnSceneComplete(Player player, uint sceneInstanceID, SceneTemplate sceneTemplate)
|
||||
{
|
||||
player.CastSpell(player, SpellIds.Stasis1, true);
|
||||
player.CastSpell(player, SpellStasis1, true);
|
||||
}
|
||||
|
||||
public override void OnSceneCancel(Player player, uint sceneInstanceID, SceneTemplate sceneTemplate)
|
||||
{
|
||||
player.CastSpell(player, SpellIds.Stasis1, true);
|
||||
player.CastSpell(player, SpellStasis1, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user