[DiscordArchive] can you cancel a cast too by setting the state?
[DiscordArchive] can you cancel a cast too by setting the state?
Archived author: Pandaros • Posted: 2023-01-17T22:10:55.456000+00:00
Original source
TY
Archived author: Pandaros • Posted: 2023-01-17T22:21:58.785000+00:00
Original source
```
void HandleAfterCast()
{
Unit* caster = GetCaster();
Unit* target = GetExplTargetUnit();
if (!caster || !target)
return;
std::list<Creature*> dreadstalkers;
caster->GetCreatureListWithEntryInGrid(dreadstalkers, 98035);
for (Creature* dreadstalker : dreadstalkers)
{
if (dreadstalker->GetOwner() == caster)
{
dreadstalker->SetLevel(caster->GetLevel());
dreadstalker->SetMaxHealth(caster->GetMaxHealth() / 3);
dreadstalker->SetHealth(caster->GetHealth() / 3);
dreadstalker->AI()->AttackStart(target);
dreadstalker->SetReactState(REACT_DEFENSIVE);
}
}
if (uint32 impsToSummon = caster->GetAuraEffectAmount(SPELL_WARLOCK_IMPROVED_DREADSTALKERS, EFFECT_0))
{
if (impsToSummon > 1)
caster->CastSpell(caster, 296553, true);
for (uint32 i = 0; i < impsToSummon; ++i)
caster->CastSpell(target->GetRandomNearPosition(3.f), SPELL_WARLOCK_WILD_IMP_SUMMON, true);
}
}
```
I checked if the caster had the talent and summoned the imps, do I just cast the aura?
Archived author: Pandaros • Posted: 2023-01-17T22:37:20.545000+00:00
Original source
nope
Archived author: Pandaros • Posted: 2023-01-17T22:37:22.081000+00:00
Original source
lol
Archived author: Pandaros • Posted: 2023-01-17T22:37:29.200000+00:00
Original source
I get the imps
Archived author: Pandaros • Posted: 2023-01-17T22:37:33.070000+00:00
Original source
not the buff
Archived author: Pandaros • Posted: 2023-01-17T23:17:36.168000+00:00
Original source
how do I apply the aura
Archived author: Pandaros • Posted: 2023-01-17T23:17:50.094000+00:00
Original source
sorry learning this code still
Archived author: ModoX • Posted: 2023-01-17T23:20:41.751000+00:00
Original source
Just cast it