1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  4. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  5. The results are out! Check them out.
    Dismiss Notice
  6. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  7. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] Food = Item being bought / spell

Discussion in 'Triggers & Scripts' started by Neptix, Feb 12, 2019.

  1. Neptix

    Neptix

    Joined:
    Jan 5, 2019
    Messages:
    102
    Resources:
    0
    Resources:
    0
    Can someone help me set up a trigger, when ever an new item is being bought it count as 1 Food was used?

    In my case all my spells variable is set to be named Ability, so i would like to have my Ability/variable set to Food used + 1. so i can control how many spells the player gets to buy.

    But the tricky part is the item/spell the player bought cant cost any food after they bought it once, or else it wont be able to level up

    Here is how my spells setup looks.


    • Frost Nova
      • Events
        • Unit - A unit Acquires an item
      • Conditions
        • (Item-type of (Item being manipulated)) Equal to Frost Nova
      • Actions
        • Set Units = (Triggering unit)
        • Set Ability[(Player number of (Owner of Units))] = Frost Nova
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Level of Ability[(Player number of (Owner of Units))] for Units) Less than 1
          • Then - Actions
            • Unit - Add Ability[(Player number of (Owner of Units))] to Units
            • Game - Display to (Player group((Owner of Units))) for 5.00 seconds the text: |c0000FFFF Frost No...
            • Special Effect - Create a special effect attached to the origin of Units using Abilities\Spells\Items\AIem\AIemTarget.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
                • (Level of Ability[(Player number of (Owner of Units))] for Units) Less than 10
              • Then - Actions
                • Unit - Increase level of Ability[(Player number of (Owner of Units))] for Units
                • Game - Display to (Player group((Owner of Units))) for 5.00 seconds the text: (|c0000FFFF Frost Nova's |r Level + ( is + ( + (String((Level of Frost Nova for Units))))))
                • Special Effect - Create a special effect attached to the origin of Units using Abilities\Spells\Items\AIem\AIemTarget.mdl
                • Special Effect - Destroy (Last created special effect)
              • Else - Actions
                • Game - Display to (Player group((Owner of Units))) for 5.00 seconds the text: This spell is alrea...
                • Player - Add 400 to (Owner of Units) Current gold
     

    Attached Files:

    • Test.w3x
      File size:
      333.5 KB
      Views:
      13
    Last edited: Feb 12, 2019
  2. Overfrost

    Overfrost

    Joined:
    Jan 9, 2019
    Messages:
    102
    Resources:
    0
    Resources:
    0
    Create a dummy unit in object editor, give it Locust ability and no model, make sure it costs 1 food as you said. Create that unit whenever the ability is added. You can place it anywhere if it has no model, otherwise place it somewhere that can't be seen. Also, make sure that its owner is the player that learns the ability.