Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Spell] Arcanic Reflection

Discussion in 'World Editor Help Zone' started by Dispatcher, Oct 22, 2020.

  1. Dispatcher

    Dispatcher

    Joined:
    Apr 22, 2020
    Messages:
    419
    Resources:
    0
    Resources:
    0
    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.
     
  2. biridius

    biridius

    Joined:
    Apr 3, 2018
    Messages:
    197
    Resources:
    4
    Maps:
    4
    Resources:
    4
    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.
     
  3. masih_julius

    masih_julius

    Joined:
    Aug 14, 2020
    Messages:
    100
    Resources:
    0
    Resources:
    0
    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: Oct 22, 2020
  4. biridius

    biridius

    Joined:
    Apr 3, 2018
    Messages:
    197
    Resources:
    4
    Maps:
    4
    Resources:
    4
    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: Oct 22, 2020
  5. masih_julius

    masih_julius

    Joined:
    Aug 14, 2020
    Messages:
    100
    Resources:
    0
    Resources:
    0
    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: Oct 22, 2020
  6. pr114

    pr114

    Joined:
    Mar 26, 2017
    Messages:
    188
    Resources:
    0
    Resources:
    0
    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.
     
  7. Dispatcher

    Dispatcher

    Joined:
    Apr 22, 2020
    Messages:
    419
    Resources:
    0
    Resources:
    0
    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: