• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

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?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • 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.
Top