Forums WoW Modding Support Archives TrinityCore Discord Archives [DiscordArchive] `void HandleProc(ProcEventInfo& eventInfo)

[DiscordArchive] `void HandleProc(ProcEventInfo& eventInfo)

[DiscordArchive] `void HandleProc(ProcEventInfo& eventInfo)

rektbyfaith
Administrator
0
01-15-2023, 04:50 AM
#1
Archived author: Deleted User • Posted: 2023-01-15T04:50:15.682000+00:00
Original source

`void HandleProc(ProcEventInfo& eventInfo)
{
Unit* target = GetTarget();
target->CastSpell(target, SPELL_DRUID_BRAMBLES_DAMAGE_AURA, true);
}

void Register() override
{
OnProc += AuraProcFn(spell_dru_pouncing_strikes::HandleProc);
}` The script is in a talent , the spell_proc in the SQL is pointed to any melee hit, I Link the script in the db correctly, but when I hit something , the spell isnt casted. Some idea?
rektbyfaith
01-15-2023, 04:50 AM #1

Archived author: Deleted User • Posted: 2023-01-15T04:50:15.682000+00:00
Original source

`void HandleProc(ProcEventInfo& eventInfo)
{
Unit* target = GetTarget();
target->CastSpell(target, SPELL_DRUID_BRAMBLES_DAMAGE_AURA, true);
}

void Register() override
{
OnProc += AuraProcFn(spell_dru_pouncing_strikes::HandleProc);
}` The script is in a talent , the spell_proc in the SQL is pointed to any melee hit, I Link the script in the db correctly, but when I hit something , the spell isnt casted. Some idea?

rektbyfaith
Administrator
0
01-15-2023, 04:55 AM
#2
Archived author: Ellienore • Posted: 2023-01-15T04:55:02.563000+00:00
Original source

There are a few things you should check to troubleshoot this issue:

1. Make sure that the HandleProc function is being called correctly. You can add some debug output (e.g. std::cout statements) to the function to verify that it is being executed when the talent's proc event occurs.

2. Verify that the SPELL_DRUID_BRAMBLES_DAMAGE_AURA spell ID is correct. Make sure that the spell exists in the database and that its Spell Family Flags match the melee hit event.

3. Check if the OnProc hook is correctly linked to the HandleProc function in the Register() function.

4. Check if the talent is correctly set to trigger on melee hit event in the SQL.

5. Make sure that the target of the spell is correct, in this case you are casting it on the same target that proc the event, but you should check if the target is in range and if it's alive.

6. Also check if the player have the talent learned and check the level of the talent.

These are some common issues that could cause the spell not to be casted. By checking each of these items, you should be able to identify and resolve the problem.

If none of these help, maybe a dev can enlighten the situation. It's also possible that the issue is in some other part of the code that the script provided here is dependent on, so it's recommended to check the whole codebase.
rektbyfaith
01-15-2023, 04:55 AM #2

Archived author: Ellienore • Posted: 2023-01-15T04:55:02.563000+00:00
Original source

There are a few things you should check to troubleshoot this issue:

1. Make sure that the HandleProc function is being called correctly. You can add some debug output (e.g. std::cout statements) to the function to verify that it is being executed when the talent's proc event occurs.

2. Verify that the SPELL_DRUID_BRAMBLES_DAMAGE_AURA spell ID is correct. Make sure that the spell exists in the database and that its Spell Family Flags match the melee hit event.

3. Check if the OnProc hook is correctly linked to the HandleProc function in the Register() function.

4. Check if the talent is correctly set to trigger on melee hit event in the SQL.

5. Make sure that the target of the spell is correct, in this case you are casting it on the same target that proc the event, but you should check if the target is in range and if it's alive.

6. Also check if the player have the talent learned and check the level of the talent.

These are some common issues that could cause the spell not to be casted. By checking each of these items, you should be able to identify and resolve the problem.

If none of these help, maybe a dev can enlighten the situation. It's also possible that the issue is in some other part of the code that the script provided here is dependent on, so it's recommended to check the whole codebase.

rektbyfaith
Administrator
0
01-15-2023, 05:01 AM
#3
Archived author: Deleted User • Posted: 2023-01-15T05:01:40.593000+00:00
Original source

damn you write a whole documentation for me, thanks
rektbyfaith
01-15-2023, 05:01 AM #3

Archived author: Deleted User • Posted: 2023-01-15T05:01:40.593000+00:00
Original source

damn you write a whole documentation for me, thanks

rektbyfaith
Administrator
0
01-15-2023, 05:01 AM
#4
Archived author: Ellienore • Posted: 2023-01-15T05:01:58.907000+00:00
Original source

No problem friend, just trying to help.
rektbyfaith
01-15-2023, 05:01 AM #4

Archived author: Ellienore • Posted: 2023-01-15T05:01:58.907000+00:00
Original source

No problem friend, just trying to help.

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)