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

Health Restore Move

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,601
Hey.

I'm doing an item that heals a wielder by 5% per 1 "square". I tried something and it works somehow. The percents are however not working and I don't know how to fix/calculate them so I posted to ask you guys how to fix the problem.

I have attached the map here, so please look at it and make the needed changes. The one who helps will have some rep & credits.

  • Untitled Trigger 001
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (AAAPhodom has an item of type Claws of Attack +15) Equal to True
        • Then - Actions
          • Set AerialShoesPoint[1] = (Position of (Picked unit))
          • Wait 0.50 seconds
          • Set TempLoc = (Position of AAAPhodom)
          • Set TempReal = ((Distance between AerialShoesPoint[1] and TempLoc) / 255.00)
          • Unit - Set life of AAAPhodom to ((Life of AAAPhodom) + TempReal)%
          • Custom script: call RemoveLocation(udg_TempLoc)
          • Custom script: call RemoveLocation(udg_AerialShoesPoint[2])
        • Else - Actions
 

Attachments

  • Health Restore Move.w3x
    17.1 KB · Views: 36
Level 37
Joined
Mar 6, 2006
Messages
9,240
Just make sure no other trigger uses AerialShoesPoint[1], because the trigger isn't MUI.

255 distance will give you +5% of max health back. You can change the 255. If you setthe grid in WE to medium, you'll set some squares. One square is 128x128, diameter ~181.


  • Untitled Trigger 001
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (AAAPhodom has an item of type Claws of Attack +15) Equal to True
        • Then - Actions
          • Set AerialShoesPoint[1] = (Position of AAAPhodom)
          • Wait 0.50 seconds
          • Set TempLoc = (Position of AAAPhodom)
          • Set TempReal = ((0.05 x (Distance between AerialShoesPoint[1] and TempLoc)) / 255.00)
          • Game - Display to Player Group - Player 1 (Red) the text: (Distance: + (String((Distance between AerialShoesPoint[1] and TempLoc))))
          • Game - Display to Player Group - Player 1 (Red) the text: (+Health: + (String((TempReal x (Max life of AAAPhodom)))))
          • Unit - Set life of AAAPhodom to ((Life of AAAPhodom) + (TempReal x (Max life of AAAPhodom)))
          • Custom script: call RemoveLocation(udg_TempLoc)
          • Custom script: call RemoveLocation(udg_AerialShoesPoint[1])
        • Else - Actions
 

Attachments

  • Health Restore Move.w3x
    17.1 KB · Views: 27
Level 37
Joined
Aug 14, 2006
Messages
7,601
Just make sure no other trigger uses AerialShoesPoint[1], because the trigger isn't MUI.

255 distance will give you +5% of max health back. You can change the 255. If you setthe grid in WE to medium, you'll set some squares. One square is 128x128, diameter ~181.


  • Untitled Trigger 001
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (AAAPhodom has an item of type Claws of Attack +15) Equal to True
        • Then - Actions
          • Set AerialShoesPoint[1] = (Position of AAAPhodom)
          • Wait 0.50 seconds
          • Set TempLoc = (Position of AAAPhodom)
          • Set TempReal = ((0.05 x (Distance between AerialShoesPoint[1] and TempLoc)) / 255.00)
          • Game - Display to Player Group - Player 1 (Red) the text: (Distance: + (String((Distance between AerialShoesPoint[1] and TempLoc))))
          • Game - Display to Player Group - Player 1 (Red) the text: (+Health: + (String((TempReal x (Max life of AAAPhodom)))))
          • Unit - Set life of AAAPhodom to ((Life of AAAPhodom) + (TempReal x (Max life of AAAPhodom)))
          • Custom script: call RemoveLocation(udg_TempLoc)
          • Custom script: call RemoveLocation(udg_AerialShoesPoint[1])
        • Else - Actions

Oh, it's my savior, once again!

And guess what? You have done perfectly what I wanted and needed. It was fun to test and it seems like it's already pretty balanced! No need changes at all, just import!

Thanks again(can't give rep at the moment, but credits are deserved).
 
Status
Not open for further replies.
Top