[DiscordArchive] so you want it to return when target is not a player?
[DiscordArchive] so you want it to return when target is not a player?
Archived author: Ĝ̷̳r̸̹͊a̷̜̚k̴̞̔ • Posted: 2024-05-21T21:07:33.592000+00:00
Original source
oh its that easy? here i thought id have to recompile
Archived author: stoneharry • Posted: 2024-05-21T21:08:43.138000+00:00
Original source
just need to restart the program after changing it
Archived author: Thulz • Posted: 2024-05-21T21:09:06.296000+00:00
Original source
```
void AuraEffect::HandleModTriggerSpellOnStacks(AuraApplication const* aurApp, uint8 mode, bool apply) const
{
if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_REAPPLY)))
return;
Unit* target = aurApp->GetTarget();
Unit* caster = GetCaster();
if (!apply || !caster || !target || target->GetTypeId() != TYPEID_UNIT)
return;
Aura* aura = aurApp->GetBase();
if (!aura)
return;
if (aura->GetStackAmount() >= GetMiscValue())
{
caster->CastSpell(target, GetTriggerSpell(), true);
if (!GetMiscValueB())
target->RemoveAura(aura);
}
}
```
Archived author: Thulz • Posted: 2024-05-21T21:09:08.579000+00:00
Original source
bit more cleaned up
Archived author: Thulz • Posted: 2024-05-21T21:09:25.613000+00:00
Original source
test the if, it should work tho (I have not had any issues with UNIT not referencing players as well)
Archived author: Aleist3r • Posted: 2024-05-21T21:09:59.154000+00:00
Original source
also i'd remove those cringy comments, at least one of them is factually incorrect
Archived author: stoneharry • Posted: 2024-05-21T21:10:51.931000+00:00
Original source
I would nullptr check aura to be safe, had some strange crashes from getting things not set which I expected to be set in all cases. I think you can get a reference to the aura through `aurApp->GetBase()`
Archived author: Thulz • Posted: 2024-05-21T21:11:28.806000+00:00
Original source
yea
Archived author: Thulz • Posted: 2024-05-21T21:12:03.436000+00:00
Original source
` Aura* aura = aurApp->GetBase();` this you saying?
Archived author: stoneharry • Posted: 2024-05-21T21:12:17.059000+00:00
Original source
♂️ would need to check in VS to check what the API is