[DiscordArchive] how can i get the damage of a spell in a spellscript?
[DiscordArchive] how can i get the damage of a spell in a spellscript?
![[Image: Screenshot_185.png?ex=690c78de&is=690b27...8d8ec1e84&]](https://cdn.discordapp.com/attachments/376457124726702080/1209628275282939984/Screenshot_185.png?ex=690c78de&is=690b275e&hm=8b1d76584c519a04c8aa28160e8adc20c66deb7108589690d3615ae8d8ec1e84&)
Archived author: Mematoru • Posted: 2024-02-20T22:30:54.680000+00:00
Original source
and seems like this is wats bein casted for the dmg part...but ofc doesnt work and gotta calc that
![[Image: Screenshot_185.png?ex=690c78de&is=690b27...8d8ec1e84&]](https://cdn.discordapp.com/attachments/376457124726702080/1209628275282939984/Screenshot_185.png?ex=690c78de&is=690b275e&hm=8b1d76584c519a04c8aa28160e8adc20c66deb7108589690d3615ae8d8ec1e84&)
Archived author: Northstrider • Posted: 2024-02-20T22:33:04.861000+00:00
Original source
390832 has a dummy aura effect so you need to write a spell script for shadow word:death and Mind Blast with a OnEffectHitTarget function. In this function you check if the caster has the dummy aura effect of spell 390832 (effect_1). if the dummy aura is present, modify the duration of shadow word pain or surge of the wicked by the amount of the dummy aura effect value
Archived author: Northstrider • Posted: 2024-02-20T22:33:41.729000+00:00
Original source
before doing that however, you have to calculate the damage that shadow word pain or purge of the wicked deal over 3 seconds
Archived author: Mematoru • Posted: 2024-02-20T22:33:43.247000+00:00
Original source
that part is done
Archived author: Mematoru • Posted: 2024-02-20T22:33:54.160000+00:00
Original source
ok ok i see
Archived author: Mematoru • Posted: 2024-02-20T22:35:49.470000+00:00
Original source
related to this, isnt enough OnHit hook?
Archived author: Northstrider • Posted: 2024-02-20T22:36:03.071000+00:00
Original source
gimme a sec, I'll write a small example
Archived author: Northstrider • Posted: 2024-02-20T22:42:08.862000+00:00
Original source
```
void HandleExpiation()
{
// get the dummy aura effect of 390832 here
AuraEffect const* expiationEffect = GetCaster()->GetDummyAuraEffect(..., EFFECT_1);
if (!expiationEffect)
return;
// find the shadow word pain or purge of the wicked periodic damage aura effect
if (AuraEffect* periodicDamageEffect = GetHitUnit()->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, [here spell family mask of the two periodic spells], EFFECT_0, GetCasterGuid()))
{
float multiplier = (float)expiationEffect->GetAmount() / periodicDamageEffect->GetPeriod();
int32 bp = periodicDamageEffect->GetAmount() * multiplier;
caster->CastSpell(GetHitUnit(), 390844, CastSpellExtraArgs(TRIGGERED_FULL_MASK).AddBp0(bp));
periodicDamageEffect->GetBase()->ModifyDuration(-(expiationEffect->GetAmount() * IN_MILLISECONDS));
}
}
```
something like that (replace magic numbers with proper enums
Archived author: Northstrider • Posted: 2024-02-20T22:42:31.313000+00:00
Original source
add such a hook to Mind Blast and Shadow Word: Death
Archived author: Mematoru • Posted: 2024-02-20T22:43:01.633000+00:00
Original source
oooohh i see GetAuraEFfect