-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
base: 3.3.5
Are you sure you want to change the base?
Conversation
|
||
for (uint8 i = 0; i < 4; ++i) | ||
caster->CastSpell(caster, SPELL_RANDOM_CIRCUMFERENCE_POINT_BONE_2); | ||
caster->CastSpell(caster, SPELL_RANDOM_CIRCUMFERENCE_POINT_POISON); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ^^
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Changes proposed:
Issues addressed:
none
Tests performed:
builds, tested in-game