• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Level Command - any integer

Status
Not open for further replies.
Level 5
Joined
Mar 27, 2008
Messages
107
Basically, when a player types 'Level 2' their hero level to 2, and when they type 'level 3' their level becomes 3, and so on. I want it to work with other commands like 'Mana 150', 'Life 200' and so on.
Is it possible to do this without creating thousands of triggers?
 
  • Untitled Trigger 013
    • Events
      • Player - Player 1 (Red) types a chat message containing - as A substring // Checks that there is - somewhere in the chat message
    • Conditions
      • (Substring((Entered chat string), 1, 1)) Equal to - // Makes sure the - is the first character
    • Actions
      • Custom script: set bj_wantDestroyGroup = true // removes the unit group leak from the next action
      • Set u = (Random unit from (Units currently selected by (Triggering player))) // Set the unit whose stats you want to modify
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 2, 6)) Equal to level // Checks that in the string, there is level after -.
        • Then - Actions
          • Hero - Set u Hero-level to (Integer((Substring((Entered chat string), 8, (Length of (Entered chat string)))))), Hide level-up graphics
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), 2, 3)) Equal to hp
            • Then - Actions
              • Unit - Set life of u to (Real((Substring((Entered chat string), 5, (Length of (Entered chat string))))))
            • Else - Actions
              • // Add more options here
If you type
-level 2
hero level will become 2.

If you type
-hp 100
Hit points will become 100.
 
Status
Not open for further replies.
Back
Top