Selecting Hero after using Resurrection

kirinelf

New Member
Reaction score
10
My Hero has a skill based off Resurrection, but every time he resurrects, it's annoying having to select him again. I tried making a simple trigger to reselect him after he revives:

Trigger:
  • Resurrection
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Rebirth (Kurai)
    • Actions
      • Selection - Select (Triggering unit)


But it doesn't work. I'm pretty sure I'm missing something, I'm just not sure what. Any tips?
 

kirinelf

New Member
Reaction score
10
Yup. I figured that 'Starts the effect of an ability' includes Passive spells as well, but am I wrong?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Yes, unfortunately, you are :p

For this passive to work, you have to have the event "A unit Dies", and then use a condition (I'm not sure if this works for dead units :S) check if the level of "Ressurection" is greater than 0 :D

Note: Again, not sure if it works for dead units :S
 

kirinelf

New Member
Reaction score
10
How would I get to the 'Ability level > 0' Condition check in the GUI?

I'm currently trying to throw a bit of JASS into the editor to see if it'll work and to learn more about it. This is what I have:

JASS:
function Trig_Resurrection_Copy_Conditions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'E001' ) ) then
        return false
        if ( not ( GetUnitAbilityLevel(GetTriggerUnit(), 'A006') > 0 ) ) then
        return false
        endif
    endif
    return true
endfunction

function Trig_Resurrection_Copy_Actions takes nothing returns nothing
    call CustomPolledWait( 4.50 )
    call SelectUnitForPlayerSingle( GetTriggerUnit(), GetOwningPlayer(GetTriggerUnit()) )
endfunction

//===========================================================================
function InitTrig_Resurrection_Copy takes nothing returns nothing
    set gg_trg_Resurrection_Copy = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Resurrection_Copy, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_Resurrection_Copy, Condition( function Trig_Resurrection_Copy_Conditions ) )
    call TriggerAddAction( gg_trg_Resurrection_Copy, function Trig_Resurrection_Copy_Actions )
endfunction


It doesn't work.

I'm still looking forward to GUI answers as well, and this is my current non-working GUI trigger:
Trigger:
  • Resurrection
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Fallen Angel
    • Actions
      • Wait 5.50 game-time seconds
      • Selection - Select (Triggering unit) for (Owner of (Triggering unit))
 

Yoshii

New Member
Reaction score
74
integer comparaison
Trigger:
  • (Level of Banish for (Triggering unit)) Greater than or equal to 1

so basically something like
Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Banish for (Triggering unit)) Greater than or equal to 1
        • Then - Actions
          • Wait 5.50 game-time seconds
          • Hero - Instantly revive (Reviving Hero) at (Center of (Playable map area)), Hide revival graphics
        • Else - Actions

with
Trigger:
  • Untitled Trigger 002
    • Events
      • Unit - A unit Begins reviving
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Selection - Select (Reviving Hero)

edit: sec i screwed up 2nd trigger
 

OMGedDude

New Member
Reaction score
5
I'm quite sure that when a unit "dies" when it has ressurection, it doesn't count as a death since no exp/gold is recieved, so the "A Unit Dies" event would probably not detect it. You can try to use the event "<Your Unit>'s life becomes less than or equal to 0.4", and select the unit after an amount of time. Still may or may not work, since I didnt test it, but its worth a try. By the way, remember to use the trigger "Selection - Select <unit> for Player"
 

kirinelf

New Member
Reaction score
10
But would I have to assign the Hero to a variable? Because the "Unit's Life becomes less than or equal to <Real Number>" event needs me to target a specific unit, and I have a Hero Selection system so he may or may not be on the field.

Yoshii, with yours, should I completely disable the effect of Reincarnation?
 

Yoshii

New Member
Reaction score
74
But would I have to assign the Hero to a variable? Because the "Unit's Life becomes less than or equal to <Real Number>" event needs me to target a specific unit, and I have a Hero Selection system so he may or may not be on the field.

Yoshii, with yours, should I completely disable the effect of Reincarnation?

ya;with my trigger you should be able to use any skill so using a passive or a skill that does nothing is best
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top