servuo/Scripts/Abilities/ArmorPierce.cs
Dexter 18816a601a Bug Fixes
- Fixed Auto Item Use/Target macro. New packet handlers conflicted with the old macros.  From what I see, this is only used with bandages.  I've removed all BandageSelf/Target macros and will use this from now on.
- Fixed Dual Wield, per EA
- Fixed Issue where champ spawns that spawn with 1+ candle will auto Revert
- Spell Channeling weapons/shields will no longer fizzle a spell while equipping
- Fixed minor messages with Armor Pierce
- Added more Enhanced Client context buttons
2017-10-28 14:56:55 -07:00

93 lines
2.7 KiB
C#

using System;
using System.Collections.Generic;
namespace Server.Items
{
/// <summary>
/// Strike your opponent with great force, partially bypassing their armor and inflicting greater damage. Requires either Bushido or Ninjitsu skill
/// </summary>
public class ArmorPierce : WeaponAbility
{
public static Dictionary<Mobile, Timer> _Table = new Dictionary<Mobile, Timer>();
public ArmorPierce()
{
}
public override SkillName GetSecondarySkill(Mobile from)
{
return from.Skills[SkillName.Ninjitsu].Base > from.Skills[SkillName.Bushido].Base ? SkillName.Ninjitsu : SkillName.Bushido;
}
public override int BaseMana
{
get
{
return 30;
}
}
public override double DamageScalar
{
get
{
return Core.HS ? 1.0 : 1.5;
}
}
public override bool RequiresSE
{
get
{
return true;
}
}
public override void OnHit(Mobile attacker, Mobile defender, int damage)
{
if (!this.Validate(attacker) || !this.CheckMana(attacker, true))
return;
ClearCurrentAbility(attacker);
attacker.SendLocalizedMessage(1063350); // You pierce your opponent's armor!
defender.SendLocalizedMessage(1153764); // Your armor has been pierced!
defender.SendLocalizedMessage(1063351); // Your attacker pierced your armor!
if (Core.HS)
{
if (_Table.ContainsKey(defender))
{
if (attacker.Weapon is BaseRanged)
return;
_Table[defender].Stop();
}
BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.ArmorPierce, 1028860, 1154367, TimeSpan.FromSeconds(3), defender, "10"));
_Table[defender] = Timer.DelayCall<Mobile>(TimeSpan.FromSeconds(3), RemoveEffects, defender);
}
defender.PlaySound(0x28E);
defender.FixedParticles(0x3728, 1, 26, 0x26D6, 0, 0, EffectLayer.Waist);
}
public static void RemoveEffects(Mobile m)
{
if (IsUnderEffects(m))
{
m.SendLocalizedMessage(1153904); // Your armor has returned to normal.
_Table.Remove(m);
}
}
public static bool IsUnderEffects(Mobile m)
{
if(m == null)
return false;
return _Table.ContainsKey(m);
}
}
}