feat: Adds ability groups, DOT abilities, and combat abilities (#1264)

- [X] Adds `MonsterAbilitySingleTarget`
- [X] Adds `MonsterAbilitySingleTargetDoT`
- [X] Adds monster ability groups with weighted abilities
- [X] Adds rune corruption ability
- [X] Adds poison gas counter ability
- [X] Adds stun attack ability
- [X] Adds throw hatchet counter ability
- [X] Adds fanning fire ability
- [X] Fixes destroy equipment to skip spell channel items
This commit is contained in:
Kamron Batman 2022-11-23 12:33:27 -08:00 • committed by GitHub
parent df9a58dd49
commit 520f15e46c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 644 additions and 546 deletions

View file

@ -4,7 +4,7 @@ using Server.Network;
namespace Server.Mobiles;
public class DestroyEquipment : MonsterAbilityAttack
public class DestroyEquipment : MonsterAbilitySingleTarget
{
public override MonsterAbilityType AbilityType => MonsterAbilityType.DestroyEquipment;
public override MonsterAbilityTrigger AbilityTrigger => MonsterAbilityTrigger.GiveMeleeDamage;
@ -12,9 +12,9 @@ public class DestroyEquipment : MonsterAbilityAttack
public virtual int AttackRange => 1;
protected override void OnAttack(MonsterAbilityTrigger trigger, BaseCreature source, Mobile defender)
protected override void OnTarget(MonsterAbilityTrigger trigger, BaseCreature source, Mobile defender)
{
base.OnAttack(trigger, source, defender);
base.OnTarget(trigger, source, defender);
using var queue = PooledRefQueue<Item>.Create();
for (var i = 0; i < defender.Items.Count; i++)
@ -25,7 +25,18 @@ public class DestroyEquipment : MonsterAbilityAttack
continue;
}
if (!(Mobile.InsuranceEnabled && item.Insured) && item is IDurability { MaxHitPoints: > 0 })
if (Mobile.InsuranceEnabled && item.Insured)
{
continue;
}
// Late publish AOS, do not destroy equipment that mages use
if (item is IAosItem { Attributes.SpellChanneling: > 0 })
{
continue;
}
if (item is IDurability { MaxHitPoints: > 0 })
{
queue.Enqueue(item);
}