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

[Trigger] Hero doesn't revive

Status
Not open for further replies.
Level 4
Joined
Aug 3, 2011
Messages
222
I just can't figure out...

  • Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is An Ancient) Equal to (==) False
      • ((Triggering unit) is in MonsterInTheAbilityArena) Equal to (==) False
    • Actions
      • Set Death_Count = (Death_Count + 1)
      • Set Death_Unit[Death_Count] = (Triggering unit)
      • Set Death_InviPercentage[Death_Count] = 0.00
      • Animation - Change Death_Unit[Death_Count]'s animation speed to 0.00% of its original speed
      • Unit - Set the custom value of Death_Unit[Death_Count] to Death_Count
      • Unit Group - Add Death_Unit[Death_Count] to Death_Group
      • Trigger - Turn on Loop <gen>
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (Triggering unit)) Equal to (==) Player
          • Then - Actions
            • Set Die_Count[(Player number of (Owner of (Triggering unit)))] = (Die_Count[(Player number of (Owner of (Triggering unit)))] + 1)
          • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Owner of (Triggering unit)) Equal to (==) Neutral Hostile
          • Then - Actions
            • Set Kill_Count[(Player number of (Owner of (Killing unit)))] = (Kill_Count[(Player number of (Owner of (Killing unit)))] + 1)
          • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • IntheBattleArena[(Player number of (Owner of (Dying unit)))] Equal to (==) True
            • IntheBattleArena[(Player number of (Owner of (Killing unit)))] Equal to (==) True
          • Then - Actions
            • Game - Display to (All players) the text: (MB_Colours[(Player number of (Owner of (Killing unit)))] + ((Name of (Owner of (Killing unit))) + (|r slashs + (MB_Colours[(Player number of (Owner of (Dying unit)))] + ((Name of (Owner of (Dying unit))) + |r in the BattleArena!)))))
            • Set PlayerKill_Count[(Player number of (Owner of (Killing unit)))] = (PlayerKill_Count[(Player number of (Owner of (Killing unit)))] + 1)
          • Else - Actions
  • Loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
      • (Number of units in Death_Group) Greater than (>) 0
    • Actions
      • Unit Group - Pick every unit in Death_Group and do (Actions)
        • Loop - Actions
          • Set Death_InviPercentage[(Custom value of (Picked unit))] = (Death_InviPercentage[(Custom value of (Picked unit))] + 2.50)
          • Animation - Change Death_Unit[(Custom value of (Picked unit))]'s vertex coloring to (100.00%, 100.00%, 100.00%) with Death_InviPercentage[(Custom value of (Picked unit))]% transparency
          • Set POINT = (Position of Death_Unit[(Custom value of (Picked unit))])
          • Special Effect - Create a special effect at POINT using war3mapImported\ArcaneExplosion.mdx
          • Custom script: call RemoveLocation (udg_POINT)
          • Special Effect - Destroy (Last created special effect)
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Death_InviPercentage[(Custom value of (Picked unit))] Greater than or equal to (>=) 100.00
              • Then - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Death_Unit[(Custom value of (Picked unit))] is A Hero) Equal to (==) True
                  • Then - Actions
                    • Set POINT2 = SavedPoint[(Player number of (Owner of Death_Unit[(Custom value of (Picked unit))]))]
                    • Hero - Instantly revive Death_Unit[(Custom value of (Picked unit))] at POINT2, Hide revival graphics
                    • Special Effect - Create a special effect at POINT2 using war3mapImported\Stomp.mdx
                    • Special Effect - Destroy (Last created special effect)
                    • Floating Text - Create floating text that reads Revive at POINT2 with Z offset 0.00, using font size 20.00, color (30.00%, 30.00%, 100.00%), and 30.00% transparency
                    • Custom script: call RemoveLocation (udg_POINT2)
                    • Floating Text - Hide (Last created floating text) for (All players)
                    • Floating Text - Show (Last created floating text) for (Player group((Owner of Death_Unit[(Custom value of (Picked unit))])))
                    • Floating Text - Change (Last created floating text): Disable permanence
                    • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
                    • Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • IntheBattleArena[(Player number of (Owner of Death_Unit[(Custom value of (Picked unit))]))] Equal to (==) True
                        • Then - Actions
                          • Set Teleportation_Enabled[(Player number of (Owner of Death_Unit[(Custom value of (Picked unit))]))] = True
                          • Player Group - Make (Player group((Owner of Death_Unit[(Custom value of (Picked unit))]))) treat (All players controlled by a User player) as an Ally with shared vision
                          • Player Group - Make (All players controlled by a User player) treat (Player group((Owner of Death_Unit[(Custom value of (Picked unit))]))) as an Ally with shared vision
                            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              • If - Conditions
                                • BattleArenaGoldProtection[(Player number of (Owner of Death_Unit[(Custom value of (Picked unit))]))] Equal to (==) False
                              • Then - Actions
                                • Cinematic - Clear the screen of text messages for (Player group(Player[(Player number of (Owner of Death_Unit[(Custom value of (Picked unit))]))]))
                                • Game - Display to (Player group(Player[(Player number of (Owner of Death_Unit[(Custom value of (Picked unit))]))])) the text: (|cffffcc00You lost + (((String(((Player[(Player number of (Owner of Death_Unit[(Custom value of (Picked unit))]))] Current gold) / 10))) + Gold and ) + 1 level for revive.))
                                • Player - Set Player[(Player number of (Owner of Death_Unit[(Custom value of (Picked unit))]))] Current gold to ((Player[(Player number of (Owner of Death_Unit[(Custom value of (Picked unit))]))] Current gold) - ((Player[(Player number of (Owner of Death_Unit[(Custom value of (Picked unit))]))] Current gold) / 10))
                                • Hero - Set Death_Unit[(Custom value of (Picked unit))] Hero-level to ((Hero level of Death_Unit[(Custom value of (Picked unit))]) - 1), Hide level-up graphics
                              • Else - Actions
                        • Else - Actions
                          • Cinematic - Clear the screen of text messages for (Player group(Player[(Player number of (Owner of Death_Unit[(Custom value of (Picked unit))]))]))
                          • Game - Display to (Player group(Player[(Player number of (Owner of Death_Unit[(Custom value of (Picked unit))]))])) the text: (|cffffcc00You lost + (((String(((Player[(Player number of (Owner of Death_Unit[(Custom value of (Picked unit))]))] Current gold) / 10))) + Gold and ) + 1 level for revive.))
                          • Player - Set Player[(Player number of (Owner of Death_Unit[(Custom value of (Picked unit))]))] Current gold to ((Player[(Player number of (Owner of Death_Unit[(Custom value of (Picked unit))]))] Current gold) - ((Player[(Player number of (Owner of Death_Unit[(Custom value of (Picked unit))]))] Current gold) / 10))
                          • Hero - Set Death_Unit[(Custom value of (Picked unit))] Hero-level to ((Hero level of Death_Unit[(Custom value of (Picked unit))]) - 1), Hide level-up graphics
                    • Selection - Select Death_Unit[(Custom value of (Picked unit))] for Player[(Custom value of (Picked unit))]
                    • Animation - Change Death_Unit[(Custom value of (Picked unit))]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
                    • Animation - Change Death_Unit[(Custom value of (Picked unit))]'s animation speed to 100.00% of its original speed
                    • Unit Group - Remove Death_Unit[(Custom value of (Picked unit))] from Death_Group
                  • Else - Actions
                    • Unit Group - Remove Death_Unit[(Custom value of (Picked unit))] from Death_Group
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Number of units in Death_Group) Equal to (==) 0
                  • Then - Actions
                    • Trigger - Turn off (This trigger)
                    • Set Death_Count = 0
                  • Else - Actions
              • Else - Actions
This make unit fade away when die and doesn't show the death animation, if the unit is hero then revive it after the loop.

The problem is, the hero won't revive.
  • Hero - Instantly revive Death_Unit[(Custom value of (Picked unit))] at POINT2, Hide revival graphics
This doesn't work but the action below and above work fine.
I lost gold, and my debug message shown, but the hero just don't revive ):
Com'on bro, don't shy, come out and continue your adventurer, hero!


In the Death trigger,
I add ancients classifield for every dummy unit.
Unit in the MonsterInTheAbilityArena straight removed while died.
Most bottom part of the trigger used on multiboard stuffs.
In the Loop trigger,
The If, then, else below the revive action is counting the gold lost while die, in some case player won't lost anything.
Ask me here if you didn't expect anything else.


Sorry for my bad english
 
Status
Not open for further replies.
Top