Forums WoW Modding Support Archives TrinityCore Discord Archives [DiscordArchive] Could you overwrite this immunity with a spell script?

[DiscordArchive] Could you overwrite this immunity with a spell script?

[DiscordArchive] Could you overwrite this immunity with a spell script?

Pages (2): 1 2 Next
rektbyfaith
Administrator
0
07-30-2025, 12:18 PM
#1
Archived author: Crane • Posted: 2025-07-30T12:18:13.617000+00:00
Original source

Could you overwrite this immunity with a spell script?
rektbyfaith
07-30-2025, 12:18 PM #1

Archived author: Crane • Posted: 2025-07-30T12:18:13.617000+00:00
Original source

Could you overwrite this immunity with a spell script?

rektbyfaith
Administrator
0
07-30-2025, 12:18 PM
#2
Archived author: Northstrider • Posted: 2025-07-30T12:18:30.472000+00:00
Original source

You can,ye
rektbyfaith
07-30-2025, 12:18 PM #2

Archived author: Northstrider • Posted: 2025-07-30T12:18:30.472000+00:00
Original source

You can,ye

rektbyfaith
Administrator
0
07-30-2025, 12:20 PM
#3
Archived author: Crane • Posted: 2025-07-30T12:20:11.403000+00:00
Original source

You would have to set this dunkrion _me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
_me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, true); to false in a spellscript
rektbyfaith
07-30-2025, 12:20 PM #3

Archived author: Crane • Posted: 2025-07-30T12:20:11.403000+00:00
Original source

You would have to set this dunkrion _me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
_me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, true); to false in a spellscript

rektbyfaith
Administrator
0
07-30-2025, 01:09 PM
#4
Archived author: Crane • Posted: 2025-07-30T13:09:14.056000+00:00
Original source

So, I'm starting to have doubts about whether it's actually possible to override this hardcoding with a spellscript.

My last attempt was:
```class spell_54458_knockback_on_vehicle : public SpellScript
{
PrepareSpellScript(spell_54458_knockback_on_vehicle);

void HandleOnHit()
{
if (Unit* target = GetHitUnit())
{
if (target->IsVehicle())
{
// Effect 0 = Knockback
target->ApplySpellImmune(EFFECT_0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, false);
}
}
}

void Register() override
{
OnHit += SpellHitFn(spell_54458_knockback_on_vehicle::HandleOnHit);
}
};
```
but has no effect
rektbyfaith
07-30-2025, 01:09 PM #4

Archived author: Crane • Posted: 2025-07-30T13:09:14.056000+00:00
Original source

So, I'm starting to have doubts about whether it's actually possible to override this hardcoding with a spellscript.

My last attempt was:
```class spell_54458_knockback_on_vehicle : public SpellScript
{
PrepareSpellScript(spell_54458_knockback_on_vehicle);

void HandleOnHit()
{
if (Unit* target = GetHitUnit())
{
if (target->IsVehicle())
{
// Effect 0 = Knockback
target->ApplySpellImmune(EFFECT_0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, false);
}
}
}

void Register() override
{
OnHit += SpellHitFn(spell_54458_knockback_on_vehicle::HandleOnHit);
}
};
```
but has no effect

rektbyfaith
Administrator
0
07-30-2025, 01:13 PM
#5
Archived author: Crane • Posted: 2025-07-30T13:13:28.953000+00:00
Original source

Or does anyone know how to write it correctly? Unfortunately, I'm not that good at it and am trying to tinker with it by analyzing and incorporating other things, but it doesn't seem to work.
rektbyfaith
07-30-2025, 01:13 PM #5

Archived author: Crane • Posted: 2025-07-30T13:13:28.953000+00:00
Original source

Or does anyone know how to write it correctly? Unfortunately, I'm not that good at it and am trying to tinker with it by analyzing and incorporating other things, but it doesn't seem to work.

rektbyfaith
Administrator
0
07-30-2025, 01:14 PM
#6
Archived author: Tea • Posted: 2025-07-30T13:14:30.302000+00:00
Original source

this is not going to work
rektbyfaith
07-30-2025, 01:14 PM #6

Archived author: Tea • Posted: 2025-07-30T13:14:30.302000+00:00
Original source

this is not going to work

rektbyfaith
Administrator
0
07-30-2025, 01:14 PM
#7
Archived author: Tea • Posted: 2025-07-30T13:14:54.710000+00:00
Original source

immunity means the unit (vehicle) is not selected as a target for the knockback effect at all
rektbyfaith
07-30-2025, 01:14 PM #7

Archived author: Tea • Posted: 2025-07-30T13:14:54.710000+00:00
Original source

immunity means the unit (vehicle) is not selected as a target for the knockback effect at all

rektbyfaith
Administrator
0
07-30-2025, 01:15 PM
#8
Archived author: Tea • Posted: 2025-07-30T13:15:12.241000+00:00
Original source

script with OnHit is already too late
rektbyfaith
07-30-2025, 01:15 PM #8

Archived author: Tea • Posted: 2025-07-30T13:15:12.241000+00:00
Original source

script with OnHit is already too late

rektbyfaith
Administrator
0
07-30-2025, 01:21 PM
#9
Archived author: Crane • Posted: 2025-07-30T13:21:26.745000+00:00
Original source

with BeforeHit += SpellScript::BeforeHitHandler(&spell_54458_knockback_on_vehicle::HandleBeforeHit); I've already tested it, but it only gives compile errors ^^
rektbyfaith
07-30-2025, 01:21 PM #9

Archived author: Crane • Posted: 2025-07-30T13:21:26.745000+00:00
Original source

with BeforeHit += SpellScript::BeforeHitHandler(&spell_54458_knockback_on_vehicle::HandleBeforeHit); I've already tested it, but it only gives compile errors ^^

rektbyfaith
Administrator
0
07-30-2025, 01:21 PM
#10
Archived author: Tea • Posted: 2025-07-30T13:21:49.155000+00:00
Original source

beforehit is also too late
rektbyfaith
07-30-2025, 01:21 PM #10

Archived author: Tea • Posted: 2025-07-30T13:21:49.155000+00:00
Original source

beforehit is also too late

Pages (2): 1 2 Next
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)