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

[Trigger] Immortal?

Discussion in 'Triggers & Scripts' started by NiddHogg-kun, Feb 17, 2010.

  1. NiddHogg-kun

    NiddHogg-kun

    Joined:
    Sep 24, 2007
    Messages:
    268
    Resources:
    2
    Icons:
    2
    Resources:
    2
    Have you ever played DOTA? Have you seen spell GRAVE?
    It's the spell of Duzzle. It makes you NOT ABLE TO DIE last 5 seconds. You will have 1 HP but you will not die.

    HAVE somebody got any ideas how to do that?
     
  2. ED_Reborn

    ED_Reborn

    Joined:
    Jan 9, 2010
    Messages:
    85
    Resources:
    0
    Resources:
    0
    Ok, I don't really have an idea for how you could make it, but I suspect that it would require a custom damage detection system and the damage to be completely scripted.

    That's what I think, I might have overlooked a spell or a trigger that makes it possible.
     
  3. NiddHogg-kun

    NiddHogg-kun

    Joined:
    Sep 24, 2007
    Messages:
    268
    Resources:
    2
    Icons:
    2
    Resources:
    2
    well i will wait for the answer but i will still try to do that.

    Thx for answering by the way
     
  4. Justify

    Justify

    Joined:
    Mar 16, 2008
    Messages:
    935
    Resources:
    5
    Models:
    1
    Icons:
    1
    Spells:
    3
    Resources:
    5
    Its quite simple: use a damage detection system and heal the unit by the amount of damage he took. Keep in mind that you can't heal more then full life, so if one unit could "one-hit" another unit you'd need a system to increase max-life temporary.
     
  5. NiddHogg-kun

    NiddHogg-kun

    Joined:
    Sep 24, 2007
    Messages:
    268
    Resources:
    2
    Icons:
    2
    Resources:
    2
    remember. Unit TAKES damage. But he will never die. so if he has 50 hp and his attacker has 150 DMG, the immortal unit will have 1 HP. o_O
     
  6. DarkAngelAzazel

    DarkAngelAzazel

    Joined:
    Sep 14, 2008
    Messages:
    1,308
    Resources:
    0
    Resources:
    0
    Maybe they add an 100% evasion and then trigger the damage he gets?
     
  7. takakenji

    takakenji

    Joined:
    Jul 7, 2008
    Messages:
    3,418
    Resources:
    27
    Models:
    23
    Icons:
    4
    Resources:
    27
    then you'd have to trigger every unit in the game because each dosnt have the same damage
     
  8. Maximilianx

    Maximilianx

    Joined:
    Oct 14, 2008
    Messages:
    334
    Resources:
    0
    Resources:
    0
    Have you tried detecting damage that brings the units health below 1, then setting that units health to 1? It may fire fast enough to avoid the unit ever dying.
     
  9. Landy

    Landy

    Joined:
    Jan 7, 2007
    Messages:
    243
    Resources:
    0
    Resources:
    0
    Yeah, its pretty simple. It detects how much damage unit gets and heals him for amount of damage taken before he actually gets damage.
     
  10. Maximilianx

    Maximilianx

    Joined:
    Oct 14, 2008
    Messages:
    334
    Resources:
    0
    Resources:
    0
    No you don't want to heal him for the damage he takes, you just want to set his health to 1, this is what NiddHogg is looking for.
     
  11. Chewii

    Chewii

    Joined:
    Dec 5, 2009
    Messages:
    841
    Resources:
    0
    Resources:
    0
    you mb could change his Hp reg to 99999 :)
     
  12. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,429
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    The damage detecting event (as far as I know) kicks in before the unit takes damage, so it would set it to 1 before the damage is taken and kill the unit. D:
    EDIT: Nvm, the damage detecting event does it before, and the unit attacked one fires at the actual time. =P

    Perhaps you could give him some sort of divine shield. =P I haven't played DotA though, so I don't really know how the spell works.

    EDIT: Tested the methods mentioned above and yeah, it works:
    Code (vJASS):
    function Trig_Immune_Actions takes nothing returns nothing
        local real damage = GetEventDamage()
        call SetWidgetLife(GetTriggerUnit(),(1+damage))
    endfunction


    But only problem is if he takes damage equal to more than his maximum health. Also, this is a specific unit event, not a generic unit event.

    EDIT: @Watermelon: Thanks, fixed. =D
     
    Last edited: Feb 18, 2010
  13. watermelon_1234

    watermelon_1234

    Joined:
    Nov 18, 2007
    Messages:
    1,066
    Resources:
    10
    Spells:
    9
    JASS:
    1
    Resources:
    10
    Justify's idea along with some of the above posts works:
    Make a trigger that can detect the damage the unit will take.
    If the damage it takes is greater than the unit's life, add an ability that can raise the unit's max hp by some big number. Then create a timer that will expire in 0 seconds to remove the ability and set the unit's life to 1.
    (BTW, you should use SetWidgetLife instead of SetUnitState)
     
  14. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,429
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
  15. watermelon_1234

    watermelon_1234

    Joined:
    Nov 18, 2007
    Messages:
    1,066
    Resources:
    10
    Spells:
    9
    JASS:
    1
    Resources:
    10
    If you wanted to do it with a system, I advise using an updated version: http://www.wc3c.net/showthread.php?t=107451

    Edit: Here's a crummy test map of what I was talking about. It's just to show you a general idea of what I meant.
    How much damage the unit can sustain before it will get damaged regardless of the trigger is limited by the amount of max life that the ability gives.
    Hopefully, you will use TimerUtils or some timer recycling system if you decide to use this method.
     

    Attached Files:

  16. SlayerII

    SlayerII

    Joined:
    Aug 21, 2008
    Messages:
    526
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    at dota the unit still dies if it gets more damage than it have max life. So no need for hp incrase if you really like to have it like in dota.
    In additon, when you are able to cast the spell, then there is normaly no sourge of damage nearby which could onehit you:grin:
     
  17. NiddHogg-kun

    NiddHogg-kun

    Joined:
    Sep 24, 2007
    Messages:
    268
    Resources:
    2
    Icons:
    2
    Resources:
    2
    ok trying Takes Damage event.
    i will do it so the damage taken will not be more then his cureent hp. so he will have 1 hp. Thank. Trying o_O

    but if someone has more idea - type them :D

    thx a lot


    EDIT:
    watermelon_1234

    thx a lot. It works :D
     
  18. Mooglefrooglian

    Mooglefrooglian

    Joined:
    Nov 28, 2008
    Messages:
    701
    Resources:
    0
    Resources:
    0
    Simple damage detection system. If a unit has your buff, and they receive damage, check:

    Will the damage do more than their total hp? If not, ignore this damage.

    If so, heal for (Damage - CurrentHP + 1) points of health.
     
  19. watermelon_1234

    watermelon_1234

    Joined:
    Nov 18, 2007
    Messages:
    1,066
    Resources:
    10
    Spells:
    9
    JASS:
    1
    Resources:
    10
    What if there is? That's really up to the map maker though.
    Example of why something like that will not work:
    Unit A has only 10 max life. Unit A takes 20 damage.
    The healing will come before the damage is actually dealt, thus resulting in Unit A's death.
     
  20. Mooglefrooglian

    Mooglefrooglian

    Joined:
    Nov 28, 2008
    Messages:
    701
    Resources:
    0
    Resources:
    0
    Thats why your damage system to heal should be capable of adding a temp buiff of +9999999 hp, then removing it a split second later.

    The damage system I made does that anyways. Don't know what other people use, so I can't comment.