• 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.

bonus

Status
Not open for further replies.
Level 9
Joined
Apr 7, 2010
Messages
480
how do i add a bonus when a hero is killed, and if the killing unit is a hero, +1 stat to random(agi, str or int) and will be shown, using floating text

the event and the condition is pretty simple but how do i add the random bonus part

thanks.
 
Level 11
Joined
Jul 7, 2010
Messages
709
  • Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • -------- -------------------- --------
      • -------- 1 = STR 2 = AGI 3 = INT --------
      • Set Integer = (Random integer number between 1 and 3)
      • -------- -------------------- --------
      • Set Point = (Position of (Killing unit))
      • -------- -------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer Equal to 1
        • Then - Actions
          • Hero - Modify Strength of (Killing unit): Add 1
          • Floating Text - Create floating text that reads ~STR +1 at Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
          • Floating Text - Change the age of (Last created floating text) to 0.65 seconds
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer Equal to 2
            • Then - Actions
              • Hero - Modify Agility of (Killing unit): Add 1
              • Floating Text - Create floating text that reads ~STR +1 at Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
              • Floating Text - Change the age of (Last created floating text) to 0.65 seconds
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Integer Equal to 3
                • Then - Actions
                  • Hero - Modify Intelligence of (Killing unit): Add 1
                  • Floating Text - Create floating text that reads ~STR +1 at Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                  • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
                  • Floating Text - Change (Last created floating text): Disable permanence
                  • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
                  • Floating Text - Change the age of (Last created floating text) to 0.65 seconds
                • Else - Actions
      • Custom script: call RemoveLocation(udg_Point)
IF you want a test map just ask me.
 
Level 9
Joined
Apr 7, 2010
Messages
480
no thankyou, thanks +rep.

tested it many times, always +agi for the first kill. why?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • -------- -------------------- --------
      • -------- 1 = STR 2 = AGI 3 = INT --------
      • Set Integer = (Random integer number between 1 and 3)
      • -------- -------------------- --------
      • Set Point = (Position of (Killing unit))
      • -------- -------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer Equal to 1
        • Then - Actions
          • Hero - Modify Strength of (Killing unit): Add 1
          • Floating Text - Create floating text that reads ~STR +1 at Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
          • Floating Text - Change the age of (Last created floating text) to 0.65 seconds
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer Equal to 2
            • Then - Actions
              • Hero - Modify Agility of (Killing unit): Add 1
              • Floating Text - Create floating text that reads ~STR +1 at Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
              • Floating Text - Change the age of (Last created floating text) to 0.65 seconds
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Integer Equal to 3
                • Then - Actions
                  • Hero - Modify Intelligence of (Killing unit): Add 1
                  • Floating Text - Create floating text that reads ~STR +1 at Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                  • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
                  • Floating Text - Change (Last created floating text): Disable permanence
                  • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
                  • Floating Text - Change the age of (Last created floating text) to 0.65 seconds
                • Else - Actions
      • Custom script: call RemoveLocation(udg_Point)
IF you want a test map just ask me.


You don't have to do the integer equal to 3 comparison. If it is not 1 or 2 then we know it is 3.

Also move these actions out of the I/T/E since you're doing them anyway:
  • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
  • Floating Text - Change (Last created floating text): Disable permanence
  • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
  • Floating Text - Change the age of (Last created floating text) to 0.65 seconds
Position them after the I/T/E.
 
Level 9
Joined
Apr 7, 2010
Messages
480
is there a difference in positioning the 3 comparison after the I/T/E than the one posted by x3GlikE?
 
Status
Not open for further replies.
Top