• 🏆 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!

how to detect reincarnation

Status
Not open for further replies.
Level 11
Joined
Oct 20, 2007
Messages
342
How to detect reincarnation skill

event -
the unit is die,

condition -
if the unit have reincarnation ability,
the skill is not cooldown

action -
i want hide it and move it to another place
 
Level 27
Joined
Sep 24, 2006
Messages
4,979
Mh, a unit does NOT die when it dies with a reincarnation ahnk in his inventory or while having the ability active. (That means you cannot use an event where the specified unit dies)

You could make a bolean variable like ''HasReincarnation'' and then give it an array if it is for multiple players, then if a hero learns reincarnation you turn the bolean to true for him and you just move him when his hitpoints hit 1.

You can check that with an if/then/else. Just use the ''Every few seconds of gametime'' event.

But i think this would be bettered solved with JASS because i have no clue how to do it with a normal unit.
 
Level 11
Joined
Oct 20, 2007
Messages
342
ty for suggestion,
i have figure out how to make it in GUI,

when unit taking dmg,
if taking dmg > life of unit
wait 0.01
if unit is alive

and reincarnation revive delay set to 0.00

thx anyway
 
Level 11
Joined
Oct 20, 2007
Messages
342
no it juz a concept, i have make it in MUI in the system.
checking every 0.01 if any unit die, (if no unit die the trigger will be closed)[it close almost all the time, to reduce lag]

  • Immortal
    • Events
      • Unit - Vampire 0001 <gen> Takes damage
    • Conditions
      • (Level of Vampire - Immortal for (Triggering unit)) Greater than 0
      • (Life of (Triggering unit)) Less than or equal to (Damage taken)
    • Actions
      • Game - Display to (All players) the text: TRUE
      • Unit Group - Add (Triggering unit) to SK_UnitGroup[10]
      • Trigger - Turn on Immortal Check <gen>
  • Immortal Check
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in SK_UnitGroup[10]) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in SK_UnitGroup[10] and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is dead) Equal to True
                • Then - Actions
                  • Game - Display to (All players) the text: death
                  • Unit Group - Remove (Picked unit) from SK_UnitGroup[10]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to True
                • Then - Actions
                  • Game - Display to (All players) the text: alive
                  • Unit Group - Remove (Picked unit) from SK_UnitGroup[10]
                • Else - Actions
 
Level 8
Joined
Nov 9, 2008
Messages
502
I remember somekind of way to check if a unit receives damage but then you actually can use a variable, i saw it somewhere but i forgot how =p

It involves using 2 trigger. 1 to get units when they enter a map which then passes an event to another trigger which is '(picked unit) takes damage'. I think this is only way in GUI but there is no way to destroy those events so if you have many units passing through your map using the system the trigger will grow and grow.

Seeing as Reincarnation is an ability, can't you simply use event 'unit begins effect of an ability' and condition '(ability in being cast) equal to Reincarnation'??
 
Level 8
Joined
Nov 9, 2008
Messages
502
Well as soon as unit comes back alive that is the moment when event will register that unit has used reincarnation so that's the time to move your unit wherever you want to.

So use event unit begins the effect of ability.
 
Status
Not open for further replies.
Top