• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Health Restore Move

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,614
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: 39
Level 37
Joined
Mar 6, 2006
Messages
9,243
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: 31
Level 37
Joined
Aug 14, 2006
Messages
7,614
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