Compare commits
4 commits
main
...
kbatman/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51a57f98fc | ||
|
|
520a521c94 | ||
|
|
25bed78b59 | ||
|
|
5fe42912de |
6 changed files with 133 additions and 115 deletions
|
|
@ -1350,7 +1350,7 @@ public abstract partial class BaseWeapon
|
|||
theirValue = Math.Max(0.1, defValue + 50.0);
|
||||
}
|
||||
|
||||
var chance = ourValue / (theirValue * 2.0) * 1.0 + (double)bonus / 100;;
|
||||
var chance = ourValue / (theirValue * 2.0) * 1.0 + (double)bonus / 100;
|
||||
|
||||
if (Core.AOS && chance < 0.02)
|
||||
{
|
||||
|
|
@ -1997,6 +1997,11 @@ public abstract partial class BaseWeapon
|
|||
Bladeweave.BladeWeaving(attacker, out var bladeweavingAbi) &&
|
||||
bladeweavingAbi is ArmorIgnore;
|
||||
|
||||
if (bcAtt?.TriggerAbilitySpecialAttack(defender) != true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var damageGiven = AOS.Damage(
|
||||
defender,
|
||||
attacker,
|
||||
|
|
|
|||
|
|
@ -5,8 +5,23 @@ namespace Server.Mobiles;
|
|||
public class FanningFire : MonsterAbilitySingleTargetDoT
|
||||
{
|
||||
public override MonsterAbilityType AbilityType => MonsterAbilityType.FanningFire;
|
||||
public override MonsterAbilityTrigger AbilityTrigger => MonsterAbilityTrigger.GiveDamage;
|
||||
public override double ChanceToTrigger => 0.05;
|
||||
public override MonsterAbilityTrigger AbilityTrigger => MonsterAbilityTrigger.SpecialAttack;
|
||||
|
||||
public FanningFire(double chanceToTrigger, int fireResistMod, int minDamage, int maxDamage)
|
||||
{
|
||||
ChanceToTrigger = chanceToTrigger;
|
||||
FireResistMod = fireResistMod;
|
||||
MinDamage = minDamage;
|
||||
MaxDamage = maxDamage;
|
||||
}
|
||||
|
||||
public sealed override double ChanceToTrigger { get; }
|
||||
|
||||
public int FireResistMod { get; }
|
||||
|
||||
public int MinDamage { get; }
|
||||
|
||||
public int MaxDamage { get; }
|
||||
|
||||
public const string Name = "FanningFire";
|
||||
|
||||
|
|
@ -52,16 +67,12 @@ public class FanningFire : MonsterAbilitySingleTargetDoT
|
|||
*/
|
||||
|
||||
source.DoHarmful(defender);
|
||||
var effect = -(defender.FireResistance / 10);
|
||||
defender.AddResistanceMod(new ResistanceMod(ResistanceType.Fire, Name, FireResistMod));
|
||||
|
||||
var mod = new ResistanceMod(ResistanceType.Fire, Name, effect);
|
||||
defender.AddResistanceMod(mod);
|
||||
|
||||
defender.FixedParticles(0x37B9, 10, 30, 0x34, EffectLayer.RightFoot);
|
||||
defender.FixedParticles(0x3709, 10, 30, 0x34, EffectLayer.RightFoot);
|
||||
defender.PlaySound(0x208);
|
||||
|
||||
// TODO: Trigger replaces a normal attack.
|
||||
AOS.Damage(defender, source, Utility.RandomMinMax(35, 45), 0, 100, 0, 0, 0);
|
||||
AOS.Damage(defender, source, Utility.RandomMinMax(MinDamage, MaxDamage), 0, 100, 0, 0, 0);
|
||||
}
|
||||
|
||||
protected override void EffectTick(BaseCreature source, Mobile defender, ref TimeSpan nextDelay)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ public static class MonsterAbilities
|
|||
// Resistance Debuffs
|
||||
public static GraspingClaw GraspingClaw => new();
|
||||
public static RuneCorruption RuneCorruption => new();
|
||||
public static FanningFire FanningFire => new();
|
||||
public static FanningFire FanningFire => new(0.05, -10, 35, 45);
|
||||
|
||||
// Summon Undead
|
||||
public static SummonSkeletonsCounter SummonSkeletonsCounter => new();
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ public enum MonsterAbilityTrigger : ulong
|
|||
CombatAction = 0x0000000000000020,
|
||||
Death = 0x0000000000000040,
|
||||
Movement = 0x0000000000000080,
|
||||
SpecialAttack = 0x0000000000000100, // Triggers instead of a regular attack
|
||||
|
||||
GiveDamage = GiveMeleeDamage | GiveSpellDamage,
|
||||
TakeDamage = TakeMeleeDamage | TakeSpellDamage
|
||||
|
|
|
|||
|
|
@ -1313,6 +1313,28 @@ namespace Server.Mobiles
|
|||
}
|
||||
}
|
||||
|
||||
public virtual bool TriggerAbilitySpecialAttack(Mobile target)
|
||||
{
|
||||
var abilities = GetMonsterAbilities();
|
||||
|
||||
if (abilities == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var i = 0; i < abilities.Length; i++)
|
||||
{
|
||||
var ability = abilities[i];
|
||||
if (ability.CanTrigger(this, MonsterAbilityTrigger.SpecialAttack))
|
||||
{
|
||||
ability.Trigger(MonsterAbilityTrigger.SpecialAttack, this, target);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual WeaponAbility GetWeaponAbility() => null;
|
||||
|
||||
public virtual bool IsEnemy(Mobile m)
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ using ModernUO.Serialization;
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
namespace Server.Mobiles;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class LadyJennifyr : SkeletalKnight
|
||||
{
|
||||
private static readonly Dictionary<Mobile, ExpireTimer> m_Table = new();
|
||||
private static readonly Dictionary<Mobile, ExpireTimer> _table = new();
|
||||
|
||||
[Constructible]
|
||||
public LadyJennifyr()
|
||||
|
|
@ -66,57 +66,36 @@ namespace Server.Mobiles
|
|||
AddLoot(LootPack.UltraRich, 3);
|
||||
}
|
||||
|
||||
public override void OnGaveMeleeAttack(Mobile defender, int damage)
|
||||
{
|
||||
base.OnGaveMeleeAttack(defender, damage);
|
||||
private static readonly MonsterAbility[] _abilities =
|
||||
[
|
||||
new FanningFire(0.10, -10, 35, 45)
|
||||
];
|
||||
|
||||
if (Utility.RandomDouble() < 0.9)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_Table.Remove(defender, out var timer))
|
||||
{
|
||||
timer.DoExpire();
|
||||
}
|
||||
|
||||
defender.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot);
|
||||
defender.PlaySound(0x208);
|
||||
// The creature fans you with fire, reducing your resistance to fire attacks.
|
||||
defender.SendLocalizedMessage(1070833);
|
||||
|
||||
var mod = new ResistanceMod(ResistanceType.Fire, "FireResistFanningFire", -10);
|
||||
defender.AddResistanceMod(mod);
|
||||
|
||||
m_Table[defender] = timer = new ExpireTimer(defender, mod);
|
||||
timer.Start();
|
||||
}
|
||||
public override MonsterAbility[] GetMonsterAbilities() => _abilities;
|
||||
|
||||
private class ExpireTimer : Timer
|
||||
{
|
||||
private readonly Mobile m_Mobile;
|
||||
private readonly ResistanceMod m_Mod;
|
||||
private readonly Mobile _mobile;
|
||||
private readonly ResistanceMod _mod;
|
||||
|
||||
public ExpireTimer(Mobile m, ResistanceMod mod)
|
||||
: base(TimeSpan.FromSeconds(10))
|
||||
public ExpireTimer(Mobile m, ResistanceMod mod) : base(TimeSpan.FromSeconds(10))
|
||||
{
|
||||
m_Mobile = m;
|
||||
m_Mod = mod;
|
||||
_mobile = m;
|
||||
_mod = mod;
|
||||
}
|
||||
|
||||
public void DoExpire()
|
||||
{
|
||||
m_Mobile.RemoveResistanceMod(m_Mod);
|
||||
_mobile.RemoveResistanceMod(_mod);
|
||||
|
||||
Stop();
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Mobile.SendLocalizedMessage(1070834); // Your resistance to fire attacks has returned.
|
||||
_mobile.SendLocalizedMessage(1070834); // Your resistance to fire attacks has returned.
|
||||
DoExpire();
|
||||
m_Table.Remove(m_Mobile);
|
||||
}
|
||||
_table.Remove(_mobile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue