private static Ability Boaz(bool upgradeEffect = false) { return(new Ability { Name = "Boaz", Cooldown = 5, ModelMetadata = new ModelMetadata { JsAssetPath = "npc/ec77d956-5a29-4591-ad5b-231f1d39ab6f/abilities/2/ab_3040168000_02.js", ConstructorName = "mc_ab_3040168000_02_effect", ImageAssets = { new ImageAsset { Name = "ab_3040168000_02", Path = "npc/ec77d956-5a29-4591-ad5b-231f1d39ab6f/abilities/2/ab_3040168000_02.png", }, }, }, ProcessEffects = (haaselia, targetPositionInFrontline, raidActions) => { var target = haaselia.ResolveEnemyTarget(targetPositionInFrontline); if (target == null) { return; } if (!haaselia.GlobalState.ContainsKey("boaz")) { haaselia.GlobalState.Add("boaz", TypedValue.FromLong(0)); } var stacks = haaselia.GlobalState["boaz"].IntegerValue; var newStackCount = Math.Min(stacks + 1, 3); haaselia.GlobalState["boaz"].IntegerValue = newStackCount; target.ApplyStatusEffect( new StatusEffectSnapshot { Id = BewitchingId, IsLocal = true, BaseAccuracy = 150, TurnDuration = int.MaxValue, IsUndispellable = true, }, overrideExistingEffects: true, raidActions); target.ApplyStatusEffectsFromTemplate( new StatusEffectSnapshot { IsLocal = true, BaseAccuracy = double.PositiveInfinity, TurnDuration = int.MaxValue, IsUndispellable = true, IsUsedInternally = true, TriggerCondition = new StatusEffectSnapshot.Types.TriggerCondition { Type = StatusEffectSnapshot.Types.TriggerCondition.Types.Type.HasStatusEffect, Data = BewitchingId, }, }, overrideExistingEffects: true, raidActions, ($"{BewitchingId}/atk_down", ModifierLibrary.FlatAttackBoost, -5 * newStackCount), ($"{BewitchingId}/def_down", ModifierLibrary.FlatDefenseBoost, -5 * stacks), ($"{BewitchingId}/dr_down", ModifierLibrary.FlatDebuffResistanceBoost, -5 * stacks)); if (upgradeEffect) { target.ApplyStatusEffect(new StatusEffectSnapshot { Id = StatusEffectLibrary.Delay, BaseAccuracy = 150 }); } // Skill linked to Jachin haaselia.AbilityCooldowns[1] = 5; }, AnimationName = "ab_motion", ShouldRepositionSpriteAnimation = true, RepositionOnTarget = true, });
public static Npc NewInstance() { return(new Npc { Id = Id, Name = "Bahamut", Gender = Gender.Unknown, Attack = 0, MaxHp = 1_500_000_000, Level = 150, Description = string.Empty, Defense = 20, Element = Element.Dark, MaxChargeDiamonds = 3, ModelMetadata = new ModelMetadata { ConstructorName = "mc_enemy_7300293", JsAssetPath = "npc/bahamut/model/enemy_7300293.js", ImageAssets = { new ImageAsset { Name = "enemy_7300293_a", Path = "npc/bahamut/model/enemy_7300293_a.png", }, new ImageAsset { Name = "enemy_7300293_b", Path = "npc/bahamut/model/enemy_7300293_b.png", }, }, DisplayRegistrationPointX = 80, DisplayRegistrationPointY = -120, }, OnHitEffectModelMetadata = new ModelMetadata { ConstructorName = "mc_ehit_7300213_all_effect", JsAssetPath = "npc/bahamut/model/ehit_7300213_all.js", ImageAssets = { new ImageAsset { Name = "ehit_7300213_all", Path = "npc/bahamut/model/ehit_7300213_all.png", }, }, }, OnSetup = (bahamut) => { bahamut.GlobalState.Add("form", TypedValue.FromLong(InitialForm)); bahamut.MaxChargeDiamonds = 3; }, OnActionStart = (bahamut, raidActions) => { }, OnSpecialAttackStart = (bahamut, raidActions) => { if (bahamut.GlobalState["form"].IntegerValue == InitialForm) { Reginleiv(bahamut, raidActions); } else if (bahamut.GlobalState["form"].IntegerValue == FireForm) { if (bahamut.IsInOverdriveMode()) { if (ThreadSafeRandom.NextDouble() < 0.5) { FireIV(bahamut, raidActions); } else { ScarletRain(bahamut, raidActions); } } else { FireIV(bahamut, raidActions); } } else if (bahamut.GlobalState["form"].IntegerValue == WaterForm) { if (bahamut.IsInOverdriveMode()) { if (ThreadSafeRandom.NextDouble() < 0.5) { FreezeIV(bahamut, raidActions); } else { SilverWave(bahamut, raidActions); } } else { FreezeIV(bahamut, raidActions); } } }, OnAttackStart = (bahamut, raidActions) => { if (bahamut.Raid.Turn == 0) { RagnarokFieldII(bahamut, raidActions); bahamut.NoChargeDiamondGainThisTurn = true; return false; } return true; }, OnTurnEnd = (bahamut, raidActions) => { foreach (var enemy in bahamut.Raid.Enemies) { if (enemy.IsAlive() && enemy.PositionInFrontline < 4 && enemy.GetStatusEffects().Any(e => e.Id == RagnarokFieldId)) { enemy.DealRawDamage((long)(enemy.MaxHp * 0.05 / bahamut.Raid.NumParticipants), Element.Null, raidActions); } } if (bahamut.HpPercentage <= 25) { ChangeToFinalForm(bahamut, raidActions); } else if (bahamut.HpPercentage <= 50) { ChangeToDarkForm(bahamut, raidActions); } else if (bahamut.HpPercentage <= 60) { ChangeToWindForm(bahamut, raidActions); } else if (bahamut.HpPercentage <= 70) { ChangeToEarthForm(bahamut, raidActions); } else if (bahamut.HpPercentage <= 80) { ChangeToWaterForm(bahamut, raidActions); } else if (bahamut.HpPercentage <= 90) { ChangeToFireForm(bahamut, raidActions); } }, OnHitEffectDelaysInMs = { 180, 180, 180 }, });