Forums WoW Modding Support Archives TrinityCore Discord Archives [DiscordArchive] But should it still be in the spell script itself? Thinking that "something else" is launching the m

[DiscordArchive] But should it still be in the spell script itself? Thinking that "something else" is launching the m

[DiscordArchive] But should it still be in the spell script itself? Thinking that "something else" is launching the m

Pages (2): 1 2 Next
rektbyfaith
Administrator
0
04-07-2025, 09:43 AM
#1
Archived author: syntaxhell • Posted: 2025-04-07T09:43:13.567000+00:00
Original source

But should it still be in the spell script itself? Thinking that "something else" is launching the missiles?
rektbyfaith
04-07-2025, 09:43 AM #1

Archived author: syntaxhell • Posted: 2025-04-07T09:43:13.567000+00:00
Original source

But should it still be in the spell script itself? Thinking that "something else" is launching the missiles?

rektbyfaith
Administrator
0
04-07-2025, 09:59 AM
#2
Archived author: ModoX • Posted: 2025-04-07T09:59:31.512000+00:00
Original source

Iirc maxtargets are set to 3 by db2 (you can see that in spellwork tool). So your spellscript should only do:
if not has aura
RandomResize to 1
rektbyfaith
04-07-2025, 09:59 AM #2

Archived author: ModoX • Posted: 2025-04-07T09:59:31.512000+00:00
Original source

Iirc maxtargets are set to 3 by db2 (you can see that in spellwork tool). So your spellscript should only do:
if not has aura
RandomResize to 1

rektbyfaith
Administrator
0
04-07-2025, 09:59 AM
#3
Archived author: syntaxhell • Posted: 2025-04-07T09:59:56.731000+00:00
Original source

Huh okay, I thought there was something else I had to change too
rektbyfaith
04-07-2025, 09:59 AM #3

Archived author: syntaxhell • Posted: 2025-04-07T09:59:56.731000+00:00
Original source

Huh okay, I thought there was something else I had to change too

rektbyfaith
Administrator
0
04-07-2025, 10:00 AM
#4
Archived author: syntaxhell • Posted: 2025-04-07T10:00:14.742000+00:00
Original source

Shauren gave me really good pointers, where I obviously didn't look
rektbyfaith
04-07-2025, 10:00 AM #4

Archived author: syntaxhell • Posted: 2025-04-07T10:00:14.742000+00:00
Original source

Shauren gave me really good pointers, where I obviously didn't look

rektbyfaith
Administrator
0
04-07-2025, 10:00 AM
#5
Archived author: syntaxhell • Posted: 2025-04-07T10:00:19.568000+00:00
Original source

And thank you for the tips
rektbyfaith
04-07-2025, 10:00 AM #5

Archived author: syntaxhell • Posted: 2025-04-07T10:00:19.568000+00:00
Original source

And thank you for the tips

rektbyfaith
Administrator
0
04-07-2025, 10:00 AM
#6
Archived author: syntaxhell • Posted: 2025-04-07T10:00:31.673000+00:00
Original source

If I get this figured out, maybe I can make my very first PR
rektbyfaith
04-07-2025, 10:00 AM #6

Archived author: syntaxhell • Posted: 2025-04-07T10:00:31.673000+00:00
Original source

If I get this figured out, maybe I can make my very first PR

rektbyfaith
Administrator
0
04-07-2025, 10:04 AM
#7
Archived author: syntaxhell • Posted: 2025-04-07T10:04:01.020000+00:00
Original source

Maybe I am doing the resize part wrong?
rektbyfaith
04-07-2025, 10:04 AM #7

Archived author: syntaxhell • Posted: 2025-04-07T10:04:01.020000+00:00
Original source

Maybe I am doing the resize part wrong?

rektbyfaith
Administrator
0
04-07-2025, 10:04 AM
#8
Archived author: ModoX • Posted: 2025-04-07T10:04:12.370000+00:00
Original source

Show code
rektbyfaith
04-07-2025, 10:04 AM #8

Archived author: ModoX • Posted: 2025-04-07T10:04:12.370000+00:00
Original source

Show code

rektbyfaith
Administrator
0
04-07-2025, 10:04 AM
#9
Archived author: syntaxhell • Posted: 2025-04-07T10:04:20.665000+00:00
Original source

```class spell_warr_storm_bolt : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({
SPELL_WARRIOR_STORM_BOLT_STUN
});
}

void FilterTargets(std::list<WorldObject*>& targets)
{
if (targets.size() > 1)
Trinity::Containers::RandomResize(targets, 1);
}

void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
Unit* target = GetHitUnit();

if (!caster || !target)
return;

// Apply the stun effect to the primary target
caster->CastSpell(target, SPELL_WARRIOR_STORM_BOLT_STUN, true);
}

void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warr_storm_bolt::FilterTargets, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
OnEffectHitTarget += SpellEffectFn(spell_warr_storm_bolt::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};```
rektbyfaith
04-07-2025, 10:04 AM #9

Archived author: syntaxhell • Posted: 2025-04-07T10:04:20.665000+00:00
Original source

```class spell_warr_storm_bolt : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({
SPELL_WARRIOR_STORM_BOLT_STUN
});
}

void FilterTargets(std::list<WorldObject*>& targets)
{
if (targets.size() > 1)
Trinity::Containers::RandomResize(targets, 1);
}

void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
Unit* target = GetHitUnit();

if (!caster || !target)
return;

// Apply the stun effect to the primary target
caster->CastSpell(target, SPELL_WARRIOR_STORM_BOLT_STUN, true);
}

void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warr_storm_bolt::FilterTargets, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
OnEffectHitTarget += SpellEffectFn(spell_warr_storm_bolt::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};```

rektbyfaith
Administrator
0
04-07-2025, 10:04 AM
#10
Archived author: syntaxhell • Posted: 2025-04-07T10:04:37.784000+00:00
Original source

Maybe OnObjectAreaTargetSelect is the wrong way of doing it here
rektbyfaith
04-07-2025, 10:04 AM #10

Archived author: syntaxhell • Posted: 2025-04-07T10:04:37.784000+00:00
Original source

Maybe OnObjectAreaTargetSelect is the wrong way of doing it here

Pages (2): 1 2 Next
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)