Skip to content

Comments

Use party slot-based targeting for Arcane Mimicry#19

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/simplify-heroai-targeting
Draft

Use party slot-based targeting for Arcane Mimicry#19
Copilot wants to merge 2 commits intomainfrom
copilot/simplify-heroai-targeting

Conversation

Copy link

Copilot AI commented Nov 19, 2025

Arcane Mimicry was using dynamic health/energy-based targeting which couldn't predictably target a specific player/hero and interfered with other HeroAI targeting functions.

Changes

Shared Memory

  • Added ArcaneMimicryTargetSlot (c_int) to HeroAIOptionStruct
  • Defaults to 0 (party leader), configurable per account

Skill Configuration

  • Set TargetingStrict = False for Arcane Mimicry
  • Enables fallback to standard OtherAlly targeting if party slot target invalid

Combat Targeting

  • Implemented party slot lookup in GetAppropiateTarget()
  • Validates target slot bounds, agent liveness, and self-targeting before returning
  • Falls back silently on any validation failure
# Special handling for Arcane Mimicry - target based on party slot
if self.skills[slot].skill_id == self.arcane_mimicry:
    own_party_number = GLOBAL_CACHE.Party.GetOwnPartyNumber()
    if own_party_number != -1:
        hero_ai_options = GLOBAL_CACHE.ShMem.GetHeroAIOptions(...)
        if hero_ai_options is not None:
            target_slot = hero_ai_options.ArcaneMimicryTargetSlot
            players = GLOBAL_CACHE.Party.GetPlayers()
            if 0 <= target_slot < len(players):
                target_agent_id = GLOBAL_CACHE.Party.Players.GetAgentIDByLoginNumber(players[target_slot].login_number)
                if target_agent_id != 0 and GLOBAL_CACHE.Agent.IsAlive(target_agent_id):
                    if target_agent_id != GLOBAL_CACHE.Player.GetAgentID():
                        return target_agent_id

Users configure target via ArcaneMimicryTargetSlot in HeroAI options (0-based party index).

Original prompt

Arcane Mimicry HeroAI functionality isn't targeting the selected player/hero before casting. Can you make this simpler and have it just based off of party slot, and make sure HeroAI's other functions (targeting) and skills don't interfere.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: Ewoog <72410352+Ewoog@users.noreply.github.com>
Copilot AI changed the title [WIP] Update HeroAI functionality for party slot targeting Use party slot-based targeting for Arcane Mimicry Nov 19, 2025
Copilot AI requested a review from Ewoog November 19, 2025 13:10
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.

2 participants