Skip to content

Greatblade of the Entwined Eclipse and Celestial Temple Forge Merge scripts#92

Open
robmart wants to merge 5 commits intoauqw:Skuafrom
robmart:EclipseAscent
Open

Greatblade of the Entwined Eclipse and Celestial Temple Forge Merge scripts#92
robmart wants to merge 5 commits intoauqw:Skuafrom
robmart:EclipseAscent

Conversation

@robmart
Copy link
Copy Markdown

@robmart robmart commented Apr 5, 2026

Will get the sword in about 3 days. Does not implement the dailies to speed it up. Code might be a bit scuffed, but it did successfully get me the sword. Code has been auto formatted to match repo style.

Summary by Sourcery

Add automation scripts to farm Eclipse Ascent dungeons and Celestial Temple Forge merge items to obtain Greatblade of the Entwined Eclipse in a coordinated 4‑account party.

New Features:

  • Introduce CoreEclipse utility for party setup, class equipping, enrage handling, and farming Eclipse Ascent dungeon resources (Sliver of Moonlight, Sliver of Sunlight, Ecliptic Offering).
  • Add CelestialTempleForgeMerge script to automate purchasing items from the Celestial Temple Forge merge shop, including handling prerequisite questlines and materials.
  • Add GreatbladeoftheEntwinedEclipse entry script that orchestrates party setup and merge farming to directly obtain the Greatblade of the Entwined Eclipse weapon.

Enhancements:

  • Integrate boss enrage detection and handling logic driven by in‑game packets, including death tracking and automatic fight resets for key Eclipse Ascent encounters.
  • Add multi‑account coordination support via party management, sync files, and role‑based class assignments for Eclipse Ascent runs.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Apr 5, 2026

Reviewer's Guide

Adds a reusable CoreEclipse helper plus two scripts to automate farming and purchasing the Greatblade of the Entwined Eclipse and related Celestial Temple Forge merge items via coordinated 4‑account dungeon runs with Scroll of Enrage handling and party management.

Sequence diagram for Greatblade farming and dungeon run with enrage handling

sequenceDiagram
    actor User
    participant GreatbladeScript as GreatbladeoftheEntwinedEclipse
    participant TempleMerge as CelestialTempleForgeMerge
    participant Eclipse as CoreEclipse
    participant Army as CoreArmyLite
    participant Game as AQW_Server

    User->>GreatbladeScript: run ScriptMain
    GreatbladeScript->>Army: subscribe PartyManagement
    GreatbladeScript->>Game: enable_party_join_pref
    loop wait_for_4_party_members
        GreatbladeScript->>Eclipse: SetupParty()
        Eclipse->>Army: PartyInvite(player2..4)
        Army-->>GreatbladeScript: PartyMemberArray()
    end
    GreatbladeScript->>Game: disable_party_join_pref
    GreatbladeScript->>Eclipse: EquipWait(Scroll_of_Enrage)
    GreatbladeScript->>Eclipse: EquipClasses(autoEnhance=true)

    Note over GreatbladeScript,TempleMerge: Purchase Greatblade of the Entwined Eclipse
    GreatbladeScript->>TempleMerge: BuyAllMerge(Greatblade_of_the_Entwined_Eclipse)

    loop merge_requirements
        TempleMerge->>TempleMerge: findIngredients()
        alt needs Sliver_of_Moonlight
            TempleMerge->>Eclipse: GetSliverOfMoonlight(count)
            Eclipse->>Eclipse: new SolsticeMoon(this, count)
        else needs Sliver_of_Sunlight
            TempleMerge->>Eclipse: GetSliverOfSunlight(count)
            Eclipse->>Eclipse: new MidnightSun(this, count)
        else needs Ecliptic_Offering
            TempleMerge->>Eclipse: GetEclipticOffering(count)
            Eclipse->>Eclipse: new AscendEclipse(this, count)
        end
    end

    Note over Eclipse,Game: Inside SolsticeMoon/MidnightSun/AscendEclipse dungeon loop
    loop dungeon_farming
        Eclipse->>Game: dungeonQueue_packet
        Game-->>Eclipse: map_load(solsticemoon/midnightsun/ascendeclipse)
        Eclipse->>Game: Attack or EclipseBossHandler()
        rect rgba(200,200,255,0.2)
            Game-->>Eclipse: boss_chat_or_aura_packets
            Eclipse->>Eclipse: Listener() parse_packets
            alt enrage_trigger_detected
                Eclipse->>Eclipse: needsEnrage=true
                Eclipse->>Game: pause_skill_rotation
                Eclipse->>Game: use Scroll_of_Enrage
                Game-->>Eclipse: target_aura_Focus_or_Reckless
                Eclipse->>Eclipse: usedEnrage=true
            end
        end
        Game-->>Eclipse: reward_item_drops
    end

    TempleMerge-->>GreatbladeScript: merge_complete
    GreatbladeScript->>Army: PartyLeave()
    GreatbladeScript->>Game: restore_gear_and_options
    GreatbladeScript-->>User: Greatblade_of_the_Entwined_Eclipse obtained
Loading

Class diagram for CoreEclipse helpers and farming scripts

classDiagram
    class CoreEclipse {
        - IScriptInterface Bot
        - CoreBots C
        - CoreEngine Core
        - CoreUltra Ultra
        - CoreAdvanced Adv
        - CoreArmyLite sArmy
        - bool needsEnrage
        - bool usedEnrage
        - bool usedLastEnrage
        - DateTimeOffset tauntTime
        - int deathCount
        + void EquipWait(string item)
        + void SetupParty()
        + void EquipClasses(bool autoEnhance)
        + void GetScrollOfEnrage(int count)
        + void GetSliverOfMoonlight(int count)
        + void GetSliverOfSunlight(int count)
        + void GetEclipticOffering(int count)
        + void EclipseBossHandler(string startingEnragePlayer, string bossName, string enrageMessage, bool alternateEnrage, string bossCell, int tauntOffset, int deathResetCount, string[] deathMessages)
    }

    class EclipseBase {
        # CoreEclipse Eclipse
        # IScriptInterface Bot
        # CoreBots C
        # CoreUltra Ultra
        # bool doGetEnrage
        # EclipseBase(CoreEclipse eclipse)
        # void Restart(string packet)
        # void Move(string packet)
    }

    class SolsticeMoon {
        + SolsticeMoon(CoreEclipse eclipse, int count)
        - bool IsTaunter()
        - void Kill()
    }

    class MidnightSun {
        + MidnightSun(CoreEclipse eclipse, int count)
        - bool IsTaunter()
        - void Kill()
    }

    class AscendEclipse {
        + AscendEclipse(CoreEclipse eclipse, int count)
        - bool IsTeamSun()
        - void Kill()
    }

    class CelestialTempleForgeMerge {
        - IScriptInterface Bot
        - CoreBots Core
        - CoreFarms Farm
        - CoreAdvanced Adv
        - CoreAdvanced sAdv
        + CoreEclipse coreEclipse
        - CoreArmyLite sArmy
        - VictorMatsuri VictorMatsuri
        + bool DontPreconfigure
        + List~IOption~ Generic
        + string[] MultiOptions
        + string OptionsStorage
        - bool dontStopMissingIng
        + List~IOption~ Options
        + void ScriptMain(IScriptInterface Bot)
        + void BuyAllMerge(string buyOnlyThis, mergeOptionsEnum buyMode)
        - bool OnBotStopped(Exception exception)
    }

    class GreatbladeoftheEntwinedEclipse {
        - IScriptInterface Bot
        + CoreBots C
        - CoreAdvanced Adv
        + CoreUltra Ultra
        - CoreArmyLite sArmy
        + CoreEclipse coreEclipse
        + CelestialTempleForgeMerge templeMerge
        + bool DontPreconfigure
        + string OptionsStorage
        + List~IOption~ Options
        + void ScriptMain(IScriptInterface Bot)
        - bool OnBotStopped(Exception exception)
    }

    CoreEclipse <|-- EclipseBase
    EclipseBase <|-- SolsticeMoon
    EclipseBase <|-- MidnightSun
    EclipseBase <|-- AscendEclipse

    CelestialTempleForgeMerge --> CoreEclipse : uses
    CelestialTempleForgeMerge --> CoreArmyLite : partyManagement

    GreatbladeoftheEntwinedEclipse --> CoreEclipse : uses
    GreatbladeoftheEntwinedEclipse --> CelestialTempleForgeMerge : delegatesMerge
    GreatbladeoftheEntwinedEclipse --> CoreArmyLite : partyManagement
Loading

Flow diagram for Celestial Temple Forge merge ingredient acquisition

flowchart TD
    A_Start[Start CelestialTempleForgeMerge ScriptMain] --> B_Setup[SetOptions and enable party join]
    B_Setup --> C_WaitParty[Wait until PartyMemberArray length is 4]
    C_WaitParty --> D_SetupParty[coreEclipse.SetupParty on leader]
    D_SetupParty --> E_DisableParty[Disable party join preference]
    E_DisableParty --> F_GearStore[Store gear and auto enhance]
    F_GearStore --> G_Equip[coreEclipse.EquipWait and EquipClasses]
    G_Equip --> H_BuyAll[BuyAllMerge]

    subgraph MergeLoop[BuyAllMerge findIngredients loop]
        H_BuyAll --> I_GetReq[Determine required ingredient]
        I_GetReq --> J{Ingredient type}
        J -->|Sliver of Moonlight| K_Moon[coreEclipse.GetSliverOfMoonlight]
        J -->|Sliver of Sunlight| L_Sun[coreEclipse.GetSliverOfSunlight]
        J -->|Victor of the Festival| M_Victor[Run VictorMatsuri.Storyline]
        J -->|Ecliptic Offering| N_Offering[Ensure Rite of Ascension then coreEclipse.GetEclipticOffering]
        J -->|Unknown| O_Unknown[Log not implemented and possibly stop]
        K_Moon --> P_NextReq[Next ingredient]
        L_Sun --> P_NextReq
        M_Victor --> P_NextReq
        N_Offering --> P_NextReq
        O_Unknown --> P_NextReq
        P_NextReq --> Q{More items to buy?}
    end

    Q -->|Yes| I_GetReq
    Q -->|No| R_DoneMerge[All merge items purchased]

    R_DoneMerge --> S_PartyLeave[Leave party]
    S_PartyLeave --> T_RestoreGear[Restore gear from GearStore]
    T_RestoreGear --> U_ResetOptions[Reset options and unsubscribe events]
    U_ResetOptions --> V_End[End script]
Loading

File-Level Changes

Change Details Files
Introduce CoreEclipse utility for Eclipse Ascent dungeons with automated enrage handling, dungeon flow, and item farming.
  • Implements EquipWait and EquipClasses to equip and optionally auto‑enhance specific roles (Legion Revenant, StoneCrusher, ArchPaladin, Lord Of Order) based on configured account slots.
  • Adds Scroll of Enrage acquisition via SpellCrafting, including material farming, crafting packets, and drop handling.
  • Implements EclipseBossHandler with packet listeners to detect boss mechanics (enrage prompts, auras, death messages) and coordinate Scroll of Enrage usage and fight resets across players.
  • Adds EclipseBase and three concrete subclasses (SolsticeMoon, MidnightSun, AscendEclipse) that manage dungeon queueing, map progression, and boss kill logic for farming Sliver of Moonlight, Sliver of Sunlight, and Ecliptic Offering.
  • Implements fight reset and dungeon restart logic with army synchronization, party‑leader gated packet sending, and class re‑equip to avoid potion bugs.
Dungeons/EclipseAscent/CoreEclipse.cs
Add Celestial Temple Forge merge script that integrates Eclipse farming helpers with the merge shop to obtain all required materials.
  • Defines script options for four account usernames and an auto‑class toggle, reusing CoreAdvanced merge options and VictorMatsuri storyline helpers.
  • Sets up party management (join/leave, preference packets) and gear storage, then coordinates party formation via CoreEclipse.SetupParty before farming.
  • Implements BuyAllMerge wrapper for shop 2303 in /templeshrine, delegating ingredient acquisition to findIngredients.
  • Handles Sliver of Moonlight, Sliver of Sunlight, and Ecliptic Offering by calling CoreEclipse farming methods, including extra sliver for Rite of Ascension when needed.
  • Ensures prerequisite Victor of the Festival via VictorMatsuri.Storyline and validates its completion before continuing, with safe shutdown on failure.
Dungeons/EclipseAscent/CelestialTempleForgeMerge.cs
Add top‑level script to directly farm and purchase the Greatblade of the Entwined Eclipse using the merge script and Eclipse helpers.
  • Defines configuration options (same four player accounts and auto‑class flag) plus standard SkipOptions, and blacklists key materials from banking.
  • Orchestrates party setup, enabling party preferences, waiting for a full 4‑member party, then disabling auto‑join and preparing gear storage.
  • Uses CoreEclipse to equip Scroll of Enrage and appropriate classes, then calls CelestialTempleForgeMerge.BuyAllMerge targeting only "Greatblade of the Entwined Eclipse".
  • Registers and cleans up ScriptStopping and party management events, performing party leave and gear restore on exit.
Dungeons/EclipseAscent/0GreatbladeoftheEntwinedEclipse.cs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • The player configuration (player1–player4, autoclass) and party setup logic are duplicated between CelestialTempleForgeMerge and GreatbladeoftheEntwinedEclipse; consider centralizing this in CoreEclipse (or a shared helper) so that party configuration and auto-class behavior are defined in one place.
  • Several snippets for the “potions bug” workaround (Unbank("Healer"), Equip("Healer"), then EquipClasses(false)) are repeated in multiple spots; extracting this into a single helper method in CoreEclipse or a utility class would make the behavior easier to maintain and adjust.
  • Many calls to Bot.Config!.Get<string>(...)!.ToLower() assume non-null config values; adding validation and caching of normalized usernames early (e.g., in a small configuration object) would make the code more robust and avoid repeated ToLower() calls throughout the flow.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The player configuration (player1–player4, autoclass) and party setup logic are duplicated between `CelestialTempleForgeMerge` and `GreatbladeoftheEntwinedEclipse`; consider centralizing this in `CoreEclipse` (or a shared helper) so that party configuration and auto-class behavior are defined in one place.
- Several snippets for the “potions bug” workaround (`Unbank("Healer")`, `Equip("Healer")`, then `EquipClasses(false)`) are repeated in multiple spots; extracting this into a single helper method in `CoreEclipse` or a utility class would make the behavior easier to maintain and adjust.
- Many calls to `Bot.Config!.Get<string>(...)!.ToLower()` assume non-null config values; adding validation and caching of normalized usernames early (e.g., in a small configuration object) would make the code more robust and avoid repeated `ToLower()` calls throughout the flow.

## Individual Comments

### Comment 1
<location path="Dungeons/EclipseAscent/CoreEclipse.cs" line_range="198-199" />
<code_context>
+                    C.UsePotion();
+                    C.Sleep(200); // Small delay to allow scroll to apply
+
+                    if (Bot.Player.HasTarget && (Bot.Target.Auras.Any(x => x.Name.Equals("Focus", StringComparison.OrdinalIgnoreCase) && x.RemainingTime > 4)) ||
+                        Bot.Target.Auras.Any(x => x.Name.Equals("Reckless", StringComparison.OrdinalIgnoreCase) && x.RemainingTime > 4))
+                    {
+                        usedEnrage = true;
</code_context>
<issue_to_address>
**issue (bug_risk):** The aura check mixes && and || without full parentheses, which can cause incorrect logic and possible null access on Bot.Target.

Because `&&` binds tighter than `||`, this is evaluated as `(Bot.Player.HasTarget && focusAura) || recklessAura`. That allows the second `Bot.Target.Auras.Any(...)` to run even when `Bot.Player.HasTarget` is false, which can both change the intended logic and risk a null `Bot.Target`. Wrapping both aura checks in a single parenthesized group under the `HasTarget` check avoids this:

```csharp
if (Bot.Player.HasTarget && (
        Bot.Target.Auras.Any(x => x.Name.Equals("Focus", StringComparison.OrdinalIgnoreCase) && x.RemainingTime > 4) ||
        Bot.Target.Auras.Any(x => x.Name.Equals("Reckless", StringComparison.OrdinalIgnoreCase) && x.RemainingTime > 4)
    ))
{
    ...
}
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant