• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

easiest way to do this...

Status
Not open for further replies.
Level 4
Joined
Jun 1, 2007
Messages
92
I'm making a map where there are multiple heroes, each having a full spellbook of different abilities. While each ability are 3 levels. At the start of the map, each ability is inactive and requires you to buy an item to activate it. After activating an ability once, you can buy the same item to increase the ability's level.

My problem is since my map with have several abilities, I need the fastest way to trigger all the abilities, rather than making a trigger for every ability/spellbook buttonpos.

This is what I have right now, and there will be alot more work for me to do if I want to finish it.
ability 1a is the first ability on the first hero in the first buttonpos. (0,0)
ability 1b is the first ability on the second hero in the first buttonpos.
Ability (Slot 1) is the upgrade required to first activate an ability.
  • Ability Learn
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Powerup
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Item-type of (Item being manipulated)) Equal to Ability 1a (Item)
              • (Item-type of (Item being manipulated)) Equal to Ability 1b (Item)
              • (Item-type of (Item being manipulated)) Equal to Ability 1c (Item)
        • Then - Actions
          • If ((Item-type of (Item being manipulated)) Equal to Ability 1a (Item)) then do (Set Temp_Ability = Ability 1a ) else do (Do nothing)
          • If ((Item-type of (Item being manipulated)) Equal to Ability 1b (Item)) then do (Set Temp_Ability = Ability 1b ) else do (Do nothing)
          • If ((Item-type of (Item being manipulated)) Equal to Ability 1c (Item)) then do (Set Temp_Ability = Ability 1c ) else do (Do nothing)
          • Set Temp_Point[0] = (Position of (Hero manipulating item))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Ability (Slot 1) for (Owner of (Hero manipulating item))) Equal to 0
            • Then - Actions
              • Player - Set the current research level of Ability (Slot 1) to 1 for (Owner of (Hero manipulating item))
              • Special Effect - Create a special effect at Temp_Point[0] using Abilities\Spells\Other\Charm\CharmTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Hero level of (Hero manipulating item)) Greater than or equal to ((Level of Temp_Ability for (Hero manipulating item)) x 5)
                  • (Level of Temp_Ability for (Hero manipulating item)) Less than 3
                • Then - Actions
                  • Unit - Increase level of Temp_Ability for (Hero manipulating item)
                  • Special Effect - Create a special effect at Temp_Point[0] using Abilities\Spells\Items\AIem\AIemTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
                  • Game - Display to (All players) the text: |cffff0000You are u...
                  • Player - Add 20 to (Owner of (Hero manipulating item)) Current gold
                  • Player - Add 1 to (Owner of (Hero manipulating item)) Current lumber
          • Custom script: call RemoveLocation(udg_Temp_Point[0])
 
Status
Not open for further replies.
Top