Files
CypherCore/Source/Scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/KarshSteelbender.cs
T
2022-07-06 23:53:47 -04:00

86 lines
2.4 KiB
C#

/*
* 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());
}
}
}