Skip to content

Scripts/Quest: Update 'Guide Our Sights' #31132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 3.3.5
Choose a base branch
from
Open

Conversation

offl
Copy link
Contributor

@offl offl commented Jul 9, 2025

Changes proposed:

  • Update 'Guide Our Sights'

Issues addressed:

none

Tests performed:

builds, tested in-game


for (uint8 i = 0; i < 4; ++i)
caster->CastSpell(caster, SPELL_RANDOM_CIRCUMFERENCE_POINT_BONE_2);
caster->CastSpell(caster, SPELL_RANDOM_CIRCUMFERENCE_POINT_POISON);
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't it best to create a constexpr array with all of these and just loop it which keeps the order you're using?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Imo that is making it overcomplicated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason why I kept sniffed order is just because why not

Copy link
Contributor

Choose a reason for hiding this comment

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

I get that keeping the sniffed order makes sense visually or for matching behavior, but honestly, having 20+ repeated CastSpell calls clutters the code and makes it harder to maintain or verify. A constexpr array (or even just a static list) would keep the order intact while making the logic much clearer and future-proof.

Up to you anyway ^^

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like making stuff simple, majority of Blizz scripts are simple
This script is quite simple as we just casted 20 spells using same function
Same in smaller versions of such spell scripts

    void HandleScript(SpellEffIndex /*effIndex*/)
    {
        Unit* caster = GetCaster();
        caster->CastSpell(caster, SPELL_BALLISTA_BOW);
        caster->CastSpell(caster, SPELL_BALLISTA_FRAME);
        caster->CastSpell(caster, SPELL_BALLISTA_MISSILE);
        caster->CastSpell(caster, SPELL_BALLISTA_WHEEL);
        caster->CastSpell(caster, SPELL_BALLISTA_WHEEL);
        caster->CastSpell(caster, SPELL_BALLISTA_WHEEL);
        caster->CastSpell(caster, SPELL_BALLISTA_WHEEL);
        caster->CastSpell(caster, SPELL_BALLISTA_KNOCKBACK);
    }

I understand that casting 20 spells may look weird but that is how it is scripted

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh no, the idea was to make the code look better, plain as it is.

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

Successfully merging this pull request may close these issues.

3 participants