• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] Arcanic Reflection

Status
Not open for further replies.
Level 9
Joined
Apr 22, 2020
Messages
430
Hello guys does anyone know how to trigger a passive ability which has a chance to reflect "negative" spells back to the casting unit? I'm trying to make an upgrade which if researched will enable the passive ability called "Arcanic Reflection" so the units that have this ability will have a chance to reflect the negative spells that is casted to them back to the caster. So can anyone pls help me make this trigger.
 
Level 23
Joined
Apr 3, 2018
Messages
460
There is no easy way of doing it.

It's not going to be just one trigger, you would need to have all of your deflectable spells as triggered spells.
Then in the code of each of them you would need to check if the target can deflect, and change target back to the caster when the projectile dummy connects and if the chance procs.
 
Level 5
Joined
Aug 14, 2020
Messages
118
There is no easy way of doing it.

It's not going to be just one trigger, you would need to have all of your deflectable spells as triggered spells.
Then in the code of each of them you would need to check if the target can deflect, and change target back to the caster when the projectile dummy connects and if the chance procs.
U might be right, or might be not,
I have an idea but I don't know it works or not, we can create a dummy with 1000 mana max point and 1000 regn mana, then use this trigger:

  • Events
  • unit begins casting an ability
  • Conditions
  • target of ability being cast equal to X
  • casting unit is a hero = false
  • Actions
  • set IdAbility to ability being cast
  • create dummy at position of X
  • add IdAbility to dummy
  • issue order dummy to cast IdAbility on casting unit
  • set IdAbility to null
but I'm not sure if it works,even if it does it needs to be improved
 
Last edited:
Level 23
Joined
Apr 3, 2018
Messages
460
If you just detect casting the ability, the returning effect will appear instantly without waiting for it to reach the target.
You would also need to stop the spell itself (maybe using SetUnitPosition or making the target invulnerable).
If the deflected spell is triggered, there will be a conflict with its trigger still working from the same event.
 
Last edited:
Level 5
Joined
Aug 14, 2020
Messages
118
If you just detect casting the ability, the returning effect will appear instantly without waiting for it to reach the target.
You would also need to stop the spell itself (maybe using SetUnitPosition?).
If the deflected spell is triggered, there will be a conflict with its trigger still working from the same event.
for stopping spell he can add spell imunnity or item amulet ability (to block just one ability)
[if we make hero invulnerable the units around hero (which are attacking hero) will change their target]
 
Last edited:
Level 9
Joined
Mar 26, 2017
Messages
376
If you add and remove spell immunity, it will also immediately get rid of ongoing spells, like Entangling roots. Don't think you want that.
If you would want to block the spell, it would make things incredibly complicated. You could instead make it like Dota's Lotus Orb, where the spell will be reflected but also effective on the original unit.

Projectile spells are a bit harder to make smoothly. You may detect buff placers, or use a DDS. I think with the latter, it is possible to find the exact spell that has been cast on the basis of event damage and/or damage type.

But all of that is fairly complicated. The simplest, reasonable smooth approach would be to just have spell not be blocked and the spell be cast back by dummy immediately (or perhaps add a wait time that depends on the distance and projectile speed). And ofcourse, in the case you have triggered target abilities (such as a custom 'charge' abilty, something like that), you will have to code up the right behaviour as well.
 
Level 9
Joined
Apr 22, 2020
Messages
430
Woah... Sounds like it's quite hard and challenging to trigger. Well what i'm asking for is to good to be true anyways. I myself am not good at triggering complicated stuff, i only know how to trigger basic stuff so, if anyone has a complete "solid" trigger of doing this stuff then i would really be happy.:grin:
 
Status
Not open for further replies.
Top