### BossModule Framework Implementation in C# Source: https://context7.com/ffxiv-combatreborn/bossmodreborn/llms.txt Demonstrates the core structure for creating a boss module in FFXIV using BossModule. This includes defining arena bounds, setting default targets for AI, and updating enemy states. It also shows examples of custom components for tankbuster, spread, and raidwide mechanics. ```csharp using BossMod; // Example boss module for a raid encounter [ModuleInfo( BossModuleInfo.Maturity.AISupport, Contributors = "YourName", GroupType = BossModuleInfo.GroupType.CFC, GroupID = 1015, NameID = 13351, SortOrder = 2, PlanLevel = 100 )] public sealed class ExampleBoss(WorldState ws, Actor primary) : BossModule(ws, primary, new WPos(100f, 100f), new ArenaBoundsSquare(20f)) { // Define arena bounds public static readonly WPos ArenaCenter = new(100f, 100f); public static readonly ArenaBoundsSquare DefaultBounds = new(20f); // Override to provide default target for AI public override Actor? GetDefaultTarget(int slot) { if (!PrimaryActor.IsDeadOrDestroyed && PrimaryActor.IsTargetable) return PrimaryActor; // Find highest priority add var adds = Enemies(0x3A5B); // Enemy OID return adds.FirstOrDefault(a => a.IsTargetable && !a.IsDead); } // Access multiple enemy types protected void UpdateEnemies() { uint[] relevantOIDs = { 0x3A5B, 0x3A5C, 0x3A5D }; var allEnemies = Enemies(relevantOIDs); foreach (var enemy in allEnemies) { if (enemy.CastInfo != null && enemy.CastInfo.IsSpell()) { // React to enemy casts } } } } // Example component for a tankbuster mechanic public sealed class TankbusterComponent(BossModule module) : Components.CastSharedTankbuster(module, 0x7A43, 6f) { // Automatically handles shared tankbuster with 6m radius } // Example component for spread mechanic public sealed class SpreadComponent(BossModule module) : Components.SpreadFromCastTargets(module, 0x7A44, 6f) { // Automatically creates 6m spread zones around targeted players } // Example component for raidwide damage public sealed class RaidwideComponent(BossModule module) : Components.RaidwideCast(module, 0x7A45) { // Shows cast bar and hints for raidwide damage } ``` -------------------------------- ### Configure Boss Module UI Settings (C#) Source: https://context7.com/ffxiv-combatreborn/bossmodreborn/llms.txt Demonstrates how to access and modify BossModuleConfig to control the visibility and lock state of boss module UI elements. It shows how to get the configuration service and set boolean properties like ShowUI and Lock. ```csharp using BossMod; var config = Service.Config.Get(); // Access window configuration config.ShowUI = true; // Show boss module UI config.Lock = false; // Unlock window for repositioning ``` -------------------------------- ### Implement Boss Module Drawing Logic (C#) Source: https://context7.com/ffxiv-combatreborn/bossmodreborn/llms.txt Provides an example of a C# BossModule class that overrides the Draw method to conditionally display UI elements based on the WindowConfig.ShowUI setting. It includes methods for drawing arena elements and hints. ```csharp using BossMod; public class ExampleBossModule : BossModule { public override void Draw() { if (BossModule.WindowConfig.ShowUI) { // Draw boss module UI DrawArena(); DrawHints(); } } private void DrawArena() { // Arena is automatically managed by base BossModule // Components handle drawing via DrawArenaBackground/Foreground } private void DrawHints() { // Hints are gathered from components via AddHints/AddGlobalHints var hints = new BossComponent.TextHints(); foreach (var component in Components) { component.AddHints(0, PrimaryActor, hints); } // Display hints to player foreach (var (text, isRisk) in hints) { var color = isRisk ? ArenaColor.Danger : ArenaColor.Safe; // Render hint with appropriate color } } } ``` -------------------------------- ### Manage Combat Rotation with AutorotationConfig Source: https://context7.com/ffxiv-combatreborn/bossmodreborn/llms.txt AutorotationConfig manages settings for the automated combat rotation system, controlling UI display, preset management, and behavior during events like death or combat changes. Users can configure visual hints and early pull detection thresholds. Changes are applied by getting the AutorotationConfig instance and modifying its properties, then firing the Service.Config.Modified event. ```csharp using BossMod.Autorotation; var config = Service.Config.Get(); // UI settings config.ShowUI = true; // Show in-game autorotation UI config.ShowDTR = AutorotationConfig.DtrStatus.Icon; // Show preset in server info bar with icon // DtrStatus options: None, TextOnly, Icon // Preset management config.HideDefaultPreset = false; // Hide VBM default preset from UI // Behavior settings config.ClearPresetOnDeath = true; // Disable autorotation on death config.ClearPresetOnCombatEnd = false; // Keep autorotation enabled after combat config.ClearPresetOnLuring = false; // Disable on Luring Trap (Deep Dungeons) config.ClearForceDisableOnCombatEnd = true; // Re-enable after combat if force-disabled // Visual hints config.ShowPositionals = true; // Show positional hints in world // Pull detection config.EarlyPullThreshold = 1.5f; // If combat starts >1.5s before countdown, force-disable // Healer AI suggestion config.SuggestHealerAI = true; // Suggest AI for healer jobs Service.Config.Modified.Fire(); // Example: Configure for parse mode (minimal automation) config.ClearPresetOnDeath = false; // Keep rotation active config.ClearPresetOnCombatEnd = false; // Don't disable after wipe config.ShowPositionals = false; // Hide visual clutter config.EarlyPullThreshold = 0.1f; // Strict early pull detection // Example: Configure for learning mode (maximum safety) config.ClearPresetOnDeath = true; config.ClearPresetOnCombatEnd = true; config.ShowPositionals = true; config.EarlyPullThreshold = 3.0f; // Lenient early pull tolerance ``` -------------------------------- ### Configure AI Behavior with AIConfig Source: https://context7.com/ffxiv-combatreborn/bossmodreborn/llms.txt AIConfig allows users to customize AI automation settings, including following behavior, movement restrictions, action automation, and AFK modes. It influences how the AI interacts with players and the game world. Changes are applied by getting the AIConfig instance and modifying its properties, then firing the Service.Config.Modified event. ```csharp using BossMod.AI; var config = Service.Config.Get(); // Display configuration config.ShowDTR = true; // Show AI status in DTR bar config.DrawUI = true; // Show AI management window // Following behavior config.FollowSlot = 1; // Follow party slot 1 (0-7) config.FocusTargetMaster = true; // Set focus target to followed player's target config.FollowDuringCombat = true; config.FollowDuringActiveBossModule = true; config.FollowOutOfCombat = false; config.FollowTarget = true; // Follow the target itself, not just the player config.DesiredPositional = Positional.Rear; // Maintain rear positional config.MaxDistanceToSlot = 1f; // Stay within 1 yalm of follow target config.MaxDistanceToTarget = 2.6f; // Stay within 2.6 yalms of combat target // Action and movement restrictions config.ForbidActions = false; // Disable all automated actions config.ForbidMovement = false; // Disable all automated movement config.ManualTarget = false; // Use manual targeting instead of AI config.ForbidAIMovementMounted = false; // Idle while mounted // AFK settings config.AutoAFK = true; // Enable automatic AFK mode config.AFKModeTimer = 10f; // Enter AFK after 10 seconds out of combat // Advanced settings config.DisableObstacleMaps = false; // Disable obstacle map loading (for deep dungeons) config.MoveDelay = 0.0; // Movement decision delay in seconds (use carefully!) config.BroadcastToSlaves = false; // Broadcast keypresses for multiboxing // Command echo config.EchoToChat = true; // Echo slash commands to chat // Save autorotation preset name config.AIAutorotPresetName = "MyCustomPreset"; // Example: Configure AI for healer follow mode config.FollowSlot = 0; // Follow tank (slot 0) config.FollowDuringCombat = true; config.FollowDuringActiveBossModule = true; config.DesiredPositional = Positional.Any; // Healers don't need positionals config.MaxDistanceToSlot = 15f; // Stay within healing range config.ForbidActions = false; // Allow autorotation config.AutoAFK = true; config.AFKModeTimer = 30f; // AFK after 30 seconds Service.Config.Modified.Fire(); ``` -------------------------------- ### ActionQueue: Prioritized Action Selection System in C# Source: https://context7.com/ffxiv-combatreborn/bossmodreborn/llms.txt Demonstrates the usage of the ActionQueue system for managing prioritized action execution in FFXIV. This system collects actions from various sources like manual input, autorotation, and boss modules, selecting the optimal action based on priority, cooldowns, and timing. It requires instances of WorldState, Actor, and Cooldowns to function. ```csharp using BossMod; // Create and populate an action queue var queue = new ActionQueue(); var worldState = /* WorldState instance */; var player = /* Actor instance */; var cooldowns = /* ReadOnlySpan */; var hints = new AIHints(); // Add a high-priority GCD action queue.Push( new ActionID(ActionType.Spell, 7535), // Action ID (e.g., Glare III for WHM) targetActor, ActionQueue.Priority.High, expire: worldState.CurrentTime.AddSeconds(2.5f).Timestamp, delay: 0f, castTime: 1.5f ); // Add a medium-priority OGCD action queue.Push( new ActionID(ActionType.Spell, 7432), // Assize player, ActionQueue.Priority.Medium, expire: float.MaxValue ); // Add a manual emergency action (user is spamming it) queue.Push( new ActionID(ActionType.Spell, 140), // Swiftcast player, ActionQueue.Priority.ManualEmergency, manual: true ); // Find the best action to execute right now var bestAction = queue.FindBest( worldState, player, cooldowns, animationLock: 0.6f, hints, instantAnimLockDelay: 0.6f, allowDismount: true ); if (bestAction.Action != default) { Console.WriteLine($"Execute: {bestAction.Action}, Target: {bestAction.Target?.Name}"); Console.WriteLine($"Priority: {bestAction.Priority}, Delay: {bestAction.Delay}s"); } // Priority guidelines for custom actions // VeryLow (1000): Only execute if nothing else to press // Low (2000): Safe to delay, won't affect DPS // Medium (3000): Use in first OGCD slot // High (4000): Use ASAP without delaying GCD // VeryHigh (5000): Drop everything, delay GCD if needed ``` -------------------------------- ### Configure Arena Bounds and Create Custom Boss Module (C#) Source: https://context7.com/ffxiv-combatreborn/bossmodreborn/llms.txt Illustrates how to define arena boundaries using WPos and ArenaBoundsSquare/Circle, and then create a custom BossModule with specific circular bounds. This allows for tailored visual representations of encounter areas. ```csharp using BossMod; // Configure arena appearance // (Note: Detailed arena config is managed via WindowConfig properties) var arenaCenter = new WPos(100f, 100f); var arenaBounds = new ArenaBoundsSquare(20f); // Create a boss module with custom bounds public sealed class CustomArenaBoss(WorldState ws, Actor primary) : BossModule(ws, primary, new WPos(100f, 100f), new ArenaBoundsCircle(25f)) { // Circular arena with 25 yalm radius } ``` -------------------------------- ### AIHints C# - Enemy and Zone Data Configuration Source: https://context7.com/ffxiv-combatreborn/bossmodreborn/llms.txt This snippet demonstrates how to configure AIHints by adding enemy data (priority, tanking status, desired position/rotation) and defining forbidden zones (cones, donuts) with activation times. It utilizes the BossMod framework's AIHints and ShapeDistance classes. ```csharp using BossMod; var hints = new AIHints(); var worldState = /* WorldState instance */; var player = /* Actor instance */; // Add enemy with priority and tanking information var boss = /* Boss Actor */; var bossEnemy = new AIHints.Enemy( boss, priority: 1, // Normal priority target shouldBeTanked: true ); bossEnemy.DesiredPosition = new WPos(100f, 100f); bossEnemy.DesiredRotation = 180f.Degrees(); bossEnemy.ShouldBeInterrupted = true; hints.Enemies[boss.CharacterSpawnIndex] = bossEnemy; hints.PotentialTargets.Add(bossEnemy); // Add add with lower priority var add = /* Add Actor */; var addEnemy = new AIHints.Enemy(add, priority: 0, shouldBeTanked: false); addEnemy.ForbidDOTs = true; // Don't apply DoTs (enemy dies soon) hints.Enemies[add.CharacterSpawnIndex] = addEnemy; hints.PotentialTargets.Add(addEnemy); // Create forbidden zone for AOE (cone) var aoeActivation = worldState.CurrentTime.AddSeconds(3); var coneForbidden = new ShapeDistance.Cone( boss.Position, range: 20f, direction: boss.Rotation, halfAngle: 30f.Degrees() ); hints.ForbiddenZones.Add((coneForbidden, aoeActivation, (ulong)boss.InstanceID)); // Create forbidden zone for donut AOE (safe spot in center) var donutInner = new ShapeDistance.Circle(boss.Position, 5f); // Safe zone var donutOuter = new ShapeDistance.Circle(boss.Position, 20f); // Danger zone var donutForbidden = new ShapeDistance.Donut(boss.Position, 5f, 20f); hints.ForbiddenZones.Add((donutForbidden, aoeActivation, (ulong)boss.InstanceID)); // Add goal zone (position AI wants to reach) hints.GoalZones.Add(pos => { // Return higher value for positions closer to boss rear var toPos = pos - boss.Position; var angle = Angle.FromDirection(toPos); var delta = (angle - boss.Rotation).Abs(); // Rear positional (within 45 degrees of back) if (delta.Deg <= 45f) return 2f; // Positional bonus // Flank positional (45-135 degrees) else if (delta.Deg <= 135f) return 1f; // Flank bonus else return 0.5f; // Front (not ideal) }); // Set max cast time (mechanic requires movement soon) hints.MaxCastTime = 2.5f; // Cancel casts longer than 2.5s // Predict incoming raidwide damage var raidwideTime = worldState.CurrentTime.AddSeconds(5); hints.PredictedDamage.Add(new AIHints.DamagePrediction( BitMask.Build(0, 1, 2, 3, 4, 5, 6, 7), // All 8 party members raidwideTime, AIHints.PredictedDamageType.Raidwide )); // Predict tankbuster var tankbusterTime = worldState.CurrentTime.AddSeconds(3); hints.PredictedDamage.Add(new AIHints.DamagePrediction( BitMask.Build(0), // Slot 0 (main tank) tankbusterTime, AIHints.PredictedDamageType.Tankbuster )); // Force specific target hints.ForcedTarget = boss; // Recommend positional hints.RecommendedPositional = (boss, Positional.Rear, imminent: true, correct: false); // Set pathfinding bounds hints.PathfindMapCenter = new WPos(100f, 100f); hints.PathfindMapBounds = new ArenaBoundsSquare(25f); // Highest priority enemy hints.HighestPotentialTargetPriority = hints.PotentialTargets .Max(e => e?.Priority ?? AIHints.Enemy.PriorityForbidden); ``` -------------------------------- ### AIController: Movement and Action Management (C#) Source: https://context7.com/ffxiv-combatreborn/bossmodreborn/llms.txt Manages AI-driven character actions like navigation, camera control, and safe spell casting. It integrates with WorldState, ActionManagerEx, and MovementOverride. Outputs navigation targets, movement flags, and AI state updates. Requires instances of WorldState, ActionManagerEx, and MovementOverride. ```csharp using BossMod.AI; var worldState = /* WorldState instance */; var actionManagerEx = /* ActionManagerEx instance */; var movementOverride = /* MovementOverride instance */; var aiController = new AIController(worldState, actionManagerEx, movementOverride); var player = worldState.Party.Player(); var hints = new AIHints(); // Set navigation target aiController.NaviTargetPos = new WPos(105f, 95f); aiController.NaviTargetVertical = null; // null for ground level, float for flying // Allow movement even if it interrupts casting aiController.AllowInterruptingCastByMovement = true; // Force cancel current cast aiController.ForceCancelCast = false; // Set focus target for UI var bossActor = /* Boss Actor */; aiController.SetFocusTarget(bossActor); // Update controller state (call every frame) aiController.Update(player, hints, DateTime.Now); // Check if vertical movement is allowed (flying) if (aiController.IsVerticalAllowed) { aiController.NaviTargetVertical = 10f; // Fly 10 yalms up } // Get camera information for relative positioning var cameraFacing = aiController.CameraFacing; // Angle var cameraAltitude = aiController.CameraAltitude; // Angle // Clear all AI state (stop movement, cancel navigation) aiController.Clear(); // Example: Move to safe spot based on AI hints var safeSpot = FindSafeSpot(hints); if (safeSpot.HasValue) { aiController.NaviTargetPos = safeSpot.Value; aiController.AllowInterruptingCastByMovement = IsMovementUrgent(hints); } ``` -------------------------------- ### Access Boss Module Information (C#) Source: https://context7.com/ffxiv-combatreborn/bossmodreborn/llms.txt Shows how to retrieve module information using BossModuleRegistry based on an actor's OID. This allows for conditional logic within the game based on the properties of the current boss module, such as its plan level and maturity. ```csharp using BossMod; // Access module info for conditional behavior var moduleInfo = BossModuleRegistry.FindByOID(primaryActor.OID); if (moduleInfo != null) { Console.WriteLine($"Module: {moduleInfo.PlanLevel}"); Console.WriteLine($"Maturity: {moduleInfo.Maturity}"); } ``` -------------------------------- ### BossComponent: Interruptible Cast Hint (C#) Source: https://context7.com/ffxiv-combatreborn/bossmodreborn/llms.txt A simple BossComponent that automatically adds hints and AI guidance for interrupting specific casts. It leverages the base CastInterruptHint class. Dependencies include BossMod and Components namespace. ```csharp using BossMod; using BossMod.Components; // Example interrupt component public sealed class InterruptibleCastComponent(BossModule module) : Components.CastInterruptHint(module, 0x7A51, canBeInterrupted: true, canBeStunned: true) { // Automatically adds hints and AI guidance to interrupt the cast // AI tanks/ranged will attempt to interrupt when possible } ``` -------------------------------- ### BossComponent: Cone Cleave Mechanic Handler (C#) Source: https://context7.com/ffxiv-combatreborn/bossmodreborn/llms.txt Implements a custom BossComponent to handle a cone cleave mechanic. It provides player hints, AI forbidden zones, arena visuals, and reacts to cast events. Dependencies include BossMod namespace and Actor types. Outputs text hints and arena drawing. ```csharp using BossMod; // Custom component for a cone cleave mechanic public sealed class ConeCleaveComponent : BossComponent { private Actor? _caster; private DateTime _activation; private const float ConeAngle = 60f; // degrees private const float ConeRange = 15f; // yalms public ConeCleaveComponent(BossModule module) : base(module) { } // Add text hints for players public override void AddHints(int slot, Actor actor, TextHints hints) { if (_caster != null && IsPlayerInCone(actor)) { hints.Add("Move out of cone!", true); // true = risk/danger } } // Add AI hints for automated positioning public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints) { if (_caster != null) { // Create forbidden zone for the cone var cone = new AOEShapeCone(ConeRange, (ConeAngle / 2).Degrees()); hints.ForbiddenZones.Add(( new ShapeDistance.Cone(_caster.Position, ConeRange, _caster.Rotation, cone.HalfAngle), _activation, (ulong)_caster.InstanceID )); } } // Draw the cone on the arena public override void DrawArenaBackground(int pcSlot, Actor pc) { if (_caster != null) { var cone = new AOEShapeCone(ConeRange, (ConeAngle / 2).Degrees()); Arena.ZoneShape(cone, _caster.Position, _caster.Rotation, ArenaColor.Danger); } } // React to cast events public override void OnCastStarted(Actor caster, ActorCastInfo spell) { if (spell.Action.ID == 0x7A50) // Cone cleave action ID { _caster = caster; _activation = spell.NPCFinishAt; } } public override void OnCastFinished(Actor caster, ActorCastInfo spell) { if (spell.Action.ID == 0x7A50) { _caster = null; } } private bool IsPlayerInCone(Actor player) { if (_caster == null) return false; var toPlayer = player.Position - _caster.Position; var distance = toPlayer.Length(); if (distance > ConeRange) return false; var angle = Angle.FromDirection(toPlayer); var deltaAngle = (angle - _caster.Rotation).Abs(); return deltaAngle.Deg <= ConeAngle / 2; } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.