1
1
Auto Defense in Selendriale Gearswap functions as an automated, reactive gear-swapping system designed to enhance survivability by instantly equipping defensive gear the moment your character takes damage. It operates on a simple but powerful principle: when a damage event occurs that matches your predefined criteria, the addon interrupts the game’s normal flow to swap your equipment to a designated defensive set before the next attack lands. This happens within a single game tick, providing a crucial edge in reaction time that manual swapping cannot match. The core trigger is the “damage taken” packet from the game server, which the addon monitors constantly in the background.
Furthermore, the behavior is highly configurable through the addon’s rule files, typically located in the `addons/GearSwap/data/` directory. You define specific conditions under which Auto Defense activates. The most common condition is simply “when damaged,” but you can narrow it down by damage type—physical, magical, or ranged—or even by the specific ability or spell that hit you. For instance, you could create a rule that only swaps when you take damage from a weapon skill, ignoring minor hits from mobs, or a separate rule that triggers specifically against a boss’s notorious area-of-effect magic attack. Each condition is then linked to a named gear set, like `PDT` (Physical Defense Taken) or `MDT` (Magic Defense Taken), which you must also pre-define in your character’s main GearSwap file.
In practice, this means a well-configured Auto Defense system acts as an invisible, split-second shield. Consider a Warrior tanking a powerful monster. Without Auto Defense, after a heavy physical attack lands, you must manually press a macro to swap in your highest defense gear, leaving you vulnerable to the next swing. With Auto Defense enabled and a rule like `if damage_type == physical then equip set.PDT`, the moment the first attack connects, your gear instantly swaps to your best PDT set. By the time the monster’s next attack command is processed, you are already armored for it. This is equally valuable for mages and healers, who might swap to an `MDT` or `Barspell` set the instant a disruptive spell like Silence or Paralyze lands on them, mitigating follow-up damage or effects.
The setup requires creating clear, unambiguous gear sets in your main `.lua` file. A typical PDT set might include a heavy armor piece like `Aegis` or `Paragon Stalker’s Gear` for the body, a high-defense shield, and accessories with +Defense or -Damage Taken stats. The Auto Defense rule then simply references this set by name. It is critical that these referenced sets are complete and valid; if a set is missing a piece, the swap will fail or equip nothing, leaving you exposed. Advanced users can chain rules for layered defense. For example, a rule for `if damage_type == physical and player.hpp < 50 then equip set.EmergencyPDT` could trigger a more aggressive, high-defense but potentially encumbering set only when health is critically low, while a standard PDT set handles routine hits.
Transitioning from theory to implementation, the first step is always to examine the example configuration files included with Selendriale Gearswap, often found in the `examples/` folder. These provide a foundational template showing the exact syntax for defining Auto Defense rules. The syntax follows a logical `if [condition] then [action]` structure. Common conditions include checking `damage`, `damage_type`, `mobid` (for specific enemy targeting), and even `ability` for named weapon skills or spells. The action is almost always `equip set.[SetName]`. Importantly, you can include multiple conditions with `and` or `or` operators for granular control, such as `if damage_type == magical and mobid == 12345 then equip set.SpecificBossMDT`.
A key practical insight is that Auto Defense works best when your defensive sets are specialized and non-overlapping with your standard engaged or idle sets. If your PDT set is identical to your normal TP build, the swap is pointless. Therefore, curating dedicated defensive gear—often sacrificing damage output or accuracy for raw defense, evasion, or specific resistances—is essential. For a Red Mage, this might mean a PDT set with `Runeist's Attire' for its high defense and magic evasion, while their normal set uses `Mpu Gandring' for accuracy. Testing is non-negotiable; you must spend time in a safe, low-threat area like the pastelawns in Port Bastok or against weak training dummies to confirm your rules trigger correctly and your sets equip without error messages in your GearSwap log.
Moreover, Auto Defense has notable limitations and considerations. It is purely reactive, not proactive; it cannot prevent the initial hit that triggers it, only the subsequent ones. It does not automatically cancel buffs or debuffs—for that, you need separate Auto Buff or Auto Debuff rules. It also cannot swap gear that is currently locked by an ability like `Soul Voice` or `Mighty Strikes` unless configured with the `force` option, which should be used sparingly due to potential conflicts. The addon processes all rules sequentially, so the order of your Auto Defense rules matters; a more specific rule should generally be placed before a general one to avoid being overridden.
Finally, the true power of Auto Defense lies in its customization for specific jobs and content. A Paladin might have three distinct Auto Defense rules: one for `PDT` on general mob hits, one for `MDT` triggered by a specific boss's deadly AoE spell like "Mortal Ray," and a third for `Evasion` set when fighting a high-Delay, low-accuracy foe. A Summoner could have a rule to instantly swap to a high-Magic Defense set with `Lugalbanda' and `Mephitas' accessories the moment they take damage from a petrifying or silencing breath. Community repositories and forums for GearSwap are invaluable resources, as experienced players often share their meticulously tuned Auto Defense rule sets for current endgame events, providing an excellent starting point for newcomers to adapt to their own gear collection.
In summary, Auto Defense transforms GearSwap from a static, pre-set automation tool into a dynamic, responsive defense mechanism. It works by listening for damage events and instantly applying a pre-configured gear set, creating a seamless layer of automated protection. Its effectiveness is entirely dependent on the quality and specificity of your defined rules and defensive gear sets. When properly implemented, it removes a significant manual burden from the player, ensuring optimal defensive posture is maintained with zero input delay during the chaotic moments of combat. The key takeaways are to start with clear, simple rules, build dedicated defensive gear sets, test rigorously, and then gradually layer in complexity for specific encounters, always prioritizing reliability over overly complex conditional chains.