Forums WoW Modding Support Archives TrinityCore Discord Archives [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?

[DiscordArchive] how can i get the damage of a spell in a spellscript?

Pages (4): Previous 1 2 3 4 Next
rektbyfaith
Administrator
0
02-20-2024, 10:30 PM
#11
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&]
rektbyfaith
02-20-2024, 10:30 PM #11

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&]

rektbyfaith
Administrator
0
02-20-2024, 10:33 PM
#12
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
rektbyfaith
02-20-2024, 10:33 PM #12

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

rektbyfaith
Administrator
0
02-20-2024, 10:33 PM
#13
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
rektbyfaith
02-20-2024, 10:33 PM #13

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

rektbyfaith
Administrator
0
02-20-2024, 10:33 PM
#14
Archived author: Mematoru • Posted: 2024-02-20T22:33:43.247000+00:00
Original source

that part is done
rektbyfaith
02-20-2024, 10:33 PM #14

Archived author: Mematoru • Posted: 2024-02-20T22:33:43.247000+00:00
Original source

that part is done

rektbyfaith
Administrator
0
02-20-2024, 10:33 PM
#15
Archived author: Mematoru • Posted: 2024-02-20T22:33:54.160000+00:00
Original source

ok ok i see
rektbyfaith
02-20-2024, 10:33 PM #15

Archived author: Mematoru • Posted: 2024-02-20T22:33:54.160000+00:00
Original source

ok ok i see

rektbyfaith
Administrator
0
02-20-2024, 10:35 PM
#16
Archived author: Mematoru • Posted: 2024-02-20T22:35:49.470000+00:00
Original source

related to this, isnt enough OnHit hook?
rektbyfaith
02-20-2024, 10:35 PM #16

Archived author: Mematoru • Posted: 2024-02-20T22:35:49.470000+00:00
Original source

related to this, isnt enough OnHit hook?

rektbyfaith
Administrator
0
02-20-2024, 10:36 PM
#17
Archived author: Northstrider • Posted: 2024-02-20T22:36:03.071000+00:00
Original source

gimme a sec, I'll write a small example
rektbyfaith
02-20-2024, 10:36 PM #17

Archived author: Northstrider • Posted: 2024-02-20T22:36:03.071000+00:00
Original source

gimme a sec, I'll write a small example

rektbyfaith
Administrator
0
02-20-2024, 10:42 PM
#18
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
rektbyfaith
02-20-2024, 10:42 PM #18

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

rektbyfaith
Administrator
0
02-20-2024, 10:42 PM
#19
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
rektbyfaith
02-20-2024, 10:42 PM #19

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

rektbyfaith
Administrator
0
02-20-2024, 10:43 PM
#20
Archived author: Mematoru • Posted: 2024-02-20T22:43:01.633000+00:00
Original source

oooohh i see GetAuraEFfect
rektbyfaith
02-20-2024, 10:43 PM #20

Archived author: Mematoru • Posted: 2024-02-20T22:43:01.633000+00:00
Original source

oooohh i see GetAuraEFfect

Pages (4): Previous 1 2 3 4 Next
Recently Browsing
 
Recently Browsing