Start adding missing scripts Part3

This commit is contained in:
hondacrx
2022-07-06 23:53:47 -04:00
parent 8cfd263fea
commit ba6c30add4
39 changed files with 5180 additions and 27 deletions
@@ -0,0 +1,87 @@
/*
* Copyright (C) 2012-2020 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Game.AI;
using Game.Entities;
using Game.Scripting;
using Game.Spells;
using System;
namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockCaverns.AscendantLordObsidius
{
struct SpellIds
{
public const uint ManaTap = 36021;
public const uint ArcaneTorrent = 36022;
public const uint Domination = 35280;
}
struct TextIds
{
public const uint YellAggro = 0;
public const uint YellKill = 1;
public const uint YellSwitchingShadows = 2;
public const uint YellDeath = 3;
public const uint EmoteSwitchingShadows = 4;
}
[Script]
class boss_ascendant_lord_obsidius : BossAI
{
public boss_ascendant_lord_obsidius(Creature creature) : base(creature, DataTypes.AscendantLordObsidius) { }
public override void Reset()
{
_Reset();
}
public override void JustEngagedWith(Unit who)
{
base.JustEngagedWith(who);
_scheduler.Schedule(TimeSpan.FromSeconds(30), ScheduleTasks =>
{
DoCastVictim(SpellIds.ManaTap, new CastSpellExtraArgs(true));
ScheduleTasks.Repeat(TimeSpan.FromSeconds(14), TimeSpan.FromSeconds(22));
});
Talk(TextIds.YellAggro);
}
public override void KilledUnit(Unit who)
{
if (who.IsPlayer())
Talk(TextIds.YellKill);
}
public override void JustDied(Unit killer)
{
_JustDied();
Talk(TextIds.YellDeath);
}
public override void UpdateAI(uint diff)
{
if (!UpdateVictim())
return;
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
}
}
}
@@ -0,0 +1,89 @@
/*
* Copyright (C) 2012-2020 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Game.AI;
using Game.Entities;
using Game.Scripting;
using Game.Spells;
using System;
namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockCaverns.Beauty
{
struct SpellIds
{
public const uint TerrifyingRoar = 76028; // Not yet Implemented
public const uint BerserkerCharge = 76030;
public const uint MagmaSpit = 76031;
public const uint Flamebreak = 76032;
public const uint Berserk = 82395; // Not yet Implemented
}
struct SoundIds
{
public const uint Aggro = 18559;
public const uint Death = 18563;
}
[Script]
class boss_beauty : BossAI
{
public boss_beauty(Creature creature) : base(creature, DataTypes.Beauty) { }
public override void Reset()
{
_Reset();
}
public override void JustEngagedWith(Unit who)
{
base.JustEngagedWith(who);
_scheduler.Schedule(TimeSpan.FromSeconds(7), TimeSpan.FromSeconds(10), task =>
{
DoCast(SelectTarget(SelectTargetMethod.Random, 0, 100, true), SpellIds.MagmaSpit, new CastSpellExtraArgs(true));
task.Repeat();
});
_scheduler.Schedule(TimeSpan.FromSeconds(16), TimeSpan.FromSeconds(19), task =>
{
DoCast(SelectTarget(SelectTargetMethod.Random, 0, 100, true), SpellIds.BerserkerCharge, new CastSpellExtraArgs(true));
task.Repeat();
});
_scheduler.Schedule(TimeSpan.FromSeconds(18), TimeSpan.FromSeconds(22), task =>
{
DoCast(me, SpellIds.Flamebreak);
task.Repeat();
});
DoPlaySoundToSet(me, SoundIds.Aggro);
}
public override void JustDied(Unit killer)
{
_JustDied();
DoPlaySoundToSet(me, SoundIds.Death);
}
public override void UpdateAI(uint diff)
{
if (!UpdateVictim())
return;
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
}
}
}
@@ -0,0 +1,100 @@
/*
* Copyright (C) 2012-2020 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Framework.Constants;
using Game.AI;
using Game.Entities;
using Game.Scripting;
using System;
namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockCaverns.Corla
{
struct SpellIds
{
public const uint Evolution = 75610;
public const uint DrainEssense = 75645;
public const uint ShadowPower = 35322;
public const uint HShadowPower = 39193;
}
struct TextIds
{
public const uint YellAggro = 0;
public const uint YellKill = 1;
public const uint YellEvolvedZealot = 2;
public const uint YellDeath = 3;
public const uint EmoteEvolvedZealot = 4;
}
[Script]
class boss_corla : BossAI
{
bool combatPhase;
public boss_corla(Creature creature) : base(creature, DataTypes.Corla) { }
public override void Reset()
{
_Reset();
combatPhase = false;
_scheduler.SetValidator(() => !combatPhase);
_scheduler.Schedule(TimeSpan.FromSeconds(2), drainTask =>
{
DoCast(me, SpellIds.DrainEssense);
drainTask.Schedule(TimeSpan.FromSeconds(15), stopDrainTask =>
{
me.InterruptSpell(CurrentSpellTypes.Channeled);
stopDrainTask.Schedule(TimeSpan.FromSeconds(2), evolutionTask =>
{
DoCast(me, SpellIds.Evolution);
drainTask.Repeat(TimeSpan.FromSeconds(2));
});
});
});
}
public override void JustEngagedWith(Unit who)
{
base.JustEngagedWith(who);
Talk(TextIds.YellAggro);
_scheduler.CancelAll();
combatPhase = true;
}
public override void KilledUnit(Unit who)
{
if (who.IsPlayer())
Talk(TextIds.YellKill);
}
public override void JustDied(Unit killer)
{
_JustDied();
Talk(TextIds.YellDeath);
}
public override void UpdateAI(uint diff)
{
_scheduler.Update(diff);
DoMeleeAttackIfReady();
}
}
}
@@ -0,0 +1,90 @@
/*
* Copyright (C) 2012-2020 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Framework.Constants;
using Game.Maps;
using Game.Scripting;
namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockCaverns
{
struct DataTypes
{
// Encounter States // Boss GUIDs
public const uint RomoggBonecrusher = 0;
public const uint Corla = 1;
public const uint KarshSteelbender = 2;
public const uint Beauty = 3;
public const uint AscendantLordObsidius = 4;
// Additional Objects
public const uint RazTheCrazed = 5;
}
struct CreatureIds
{
public const uint TwilightFlameCaller = 39708;
public const uint RazTheCrazed = 39670;
public const uint RomoggBonecrusher = 39665;
}
[Script]
class instance_blackrock_caverns : InstanceMapScript
{
static ObjectData[] creatureData =
{
new ObjectData(CreatureIds.RazTheCrazed, DataTypes.RazTheCrazed)
};
public instance_blackrock_caverns() : base(nameof(instance_blackrock_caverns), 645) { }
class instance_blackrock_caverns_InstanceMapScript : InstanceScript
{
public instance_blackrock_caverns_InstanceMapScript(InstanceMap map) : base(map)
{
SetHeaders("BRC");
SetBossNumber(5);
LoadObjectData(creatureData, null);
}
public override bool SetBossState(uint type, EncounterState state)
{
if (!base.SetBossState(type, state))
return false;
switch (type)
{
case DataTypes.RomoggBonecrusher:
case DataTypes.Corla:
case DataTypes.KarshSteelbender:
case DataTypes.Beauty:
case DataTypes.AscendantLordObsidius:
break;
default:
break;
}
return true;
}
}
public override InstanceScript GetInstanceScript(InstanceMap map)
{
return new instance_blackrock_caverns_InstanceMapScript(map);
}
}
}
@@ -0,0 +1,85 @@
/*
* Copyright (C) 2012-2020 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Game.AI;
using Game.Entities;
using Game.Scripting;
using System;
namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockCaverns.KarshSteelbender
{
struct SpellIds
{
public const uint Cleave = 15284;
public const uint QuicksilverArmor = 75842;
public const uint SuperheatedQuicksilverArmor = 75846;
}
struct TextIds
{
public const uint YellAggro = 0;
public const uint YellKill = 1;
public const uint YellQuicksilverArmor = 2;
public const uint YellDeath = 3;
public const uint EmoteQuicksilverArmor = 4;
}
[Script]
class boss_karsh_steelbender : BossAI
{
public boss_karsh_steelbender(Creature creature) : base(creature, DataTypes.KarshSteelbender) { }
public override void Reset()
{
_Reset();
}
public override void JustEngagedWith(Unit who)
{
base.JustEngagedWith(who);
Talk(TextIds.YellAggro);
_scheduler.Schedule(TimeSpan.FromSeconds(10), task =>
{
DoCastVictim(SpellIds.Cleave);
task.Repeat(TimeSpan.FromSeconds(10));
});
}
public override void KilledUnit(Unit who)
{
if (who.IsPlayer())
Talk(TextIds.YellKill);
}
public override void JustDied(Unit victim)
{
_JustDied();
Talk(TextIds.YellDeath);
}
public override void UpdateAI(uint diff)
{
if (!UpdateVictim())
return;
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
}
}
}
@@ -0,0 +1,123 @@
/*
* Copyright (C) 2012-2020 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Framework.Constants;
using Game.AI;
using Game.Entities;
using Game.Scripting;
using Game.Spells;
using System;
namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockCaverns.RomoggBonecrusher
{
struct SpellIds
{
public const uint CallForHelp = 82137; // Needs Scripting
public const uint ChainsOfWoe = 75539;
public const uint Quake = 75272;
public const uint Skullcracker = 75543;
public const uint WoundingStrike = 75571;
}
struct TextIds
{
public const uint YellAggro = 0;
public const uint YellKill = 1;
public const uint YellSkullcracker = 2;
public const uint YellDeath = 3;
public const uint EmoteCallForHelp = 4;
public const uint EmoteSkullcracker = 5;
}
struct MiscConst
{
public const uint TypeRaz = 1;
public const uint DataRomoggDead = 1;
public static Position SummonPos = new Position(249.2639f, 949.1614f, 191.7866f, 3.141593f);
}
[Script]
class boss_romogg_bonecrusher : BossAI
{
public boss_romogg_bonecrusher(Creature creature) : base(creature, DataTypes.RomoggBonecrusher)
{
me.SummonCreature(CreatureIds.RazTheCrazed, MiscConst.SummonPos, TempSummonType.ManualDespawn, TimeSpan.FromSeconds(200));
}
public override void Reset()
{
_Reset();
}
public override void JustDied(Unit killer)
{
_JustDied();
Talk(TextIds.YellDeath);
Creature raz = instance.GetCreature(DataTypes.RazTheCrazed);
if (raz)
raz.GetAI().SetData(MiscConst.TypeRaz, MiscConst.DataRomoggDead);
}
public override void KilledUnit(Unit who)
{
if (who.IsPlayer())
Talk(TextIds.YellKill);
}
public override void JustEngagedWith(Unit who)
{
base.JustEngagedWith(who);
_scheduler.Schedule(TimeSpan.FromSeconds(22), TimeSpan.FromSeconds(32), task =>
{
Talk(TextIds.YellSkullcracker);
DoCast(me, SpellIds.ChainsOfWoe);
task.Repeat(TimeSpan.FromSeconds(22), TimeSpan.FromSeconds(32));
_scheduler.Schedule(TimeSpan.FromSeconds(3), skullCrackerTask =>
{
Talk(TextIds.EmoteSkullcracker);
DoCast(me, SpellIds.Skullcracker);
});
});
_scheduler.Schedule(TimeSpan.FromSeconds(26), TimeSpan.FromSeconds(32), task =>
{
DoCastVictim(SpellIds.WoundingStrike, new CastSpellExtraArgs(true));
task.Repeat(TimeSpan.FromSeconds(26), TimeSpan.FromSeconds(32));
});
_scheduler.Schedule(TimeSpan.FromSeconds(45), task =>
{
DoCast(me, SpellIds.Quake);
task.Repeat(TimeSpan.FromSeconds(32), TimeSpan.FromSeconds(40));
});
Talk(TextIds.YellAggro);
Talk(TextIds.EmoteCallForHelp);
DoCast(me, SpellIds.CallForHelp);
}
public override void UpdateAI(uint diff)
{
if (!UpdateVictim())
return;
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
}
}
}