feat: Adds SpecialAttack monster ability trigger. Fixes fanning fire. (#2186)

This commit is contained in:
Kamron Batman 2025-05-15 22:14:52 -07:00 • committed by GitHub
parent 91b2912ee4
commit e468f79e18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 89 additions and 119 deletions

View file

@ -890,6 +890,11 @@ public abstract partial class BaseWeapon
if (attacker is BaseCreature bc)
{
if (bc.TriggerAbility(MonsterAbilityTrigger.CombatAction, defender))
{
return GetDelay(attacker);
}
// Only change direction if they are not a player.
attacker.Direction = attacker.GetDirectionTo(defender);
var ab = bc.GetWeaponAbility();
@ -1350,7 +1355,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)
{

View file

@ -70,6 +70,11 @@ namespace Server.Items
attacker.DisruptiveAction();
attacker.NetState.SendSwing(attacker.Serial, defender.Serial);
if (attacker is BaseCreature bc && bc.TriggerAbility(MonsterAbilityTrigger.CombatAction, defender))
{
return GetDelay(attacker);
}
if (OnFired(attacker, defender))
{
if (CheckHit(attacker, defender))