/* * Copyright (C) 2012-2020 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 . */ 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()); } } }