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. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. 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.

Armor gain taunt

Discussion in 'Triggers & Scripts' started by Ragnar9, Dec 26, 2018.

  1. Ragnar9

    Ragnar9

    Joined:
    Jan 15, 2018
    Messages:
    86
    Resources:
    0
    Resources:
    0
    Im attempting to make a trigger similar to Axe's taunt in dota. However im struggling with when the ability is over how can i reset the units armor back to normal?

    • SamT
      • Events
        • Unit - Samwise 0808 <gen> Begins casting an ability
      • Conditions
        • (Ability being cast) Equal to Taunt (samwise)
      • Actions
        • Unit - Set Armor of (Triggering unit) to 50.00
     
  2. Aeryn

    Aeryn

    Joined:
    Apr 17, 2017
    Messages:
    266
    Resources:
    0
    Resources:
    0
    It is not wise to manipulate armor data directly, create a new spell based off spiked carapace and change its button position to x=0 y=-11(by shift clicking to enter a negative value) and change reflection value 0. Add that ability to your triggering unit wait 5 seconds remove that ability from triggering unit.
     
  3. Wark

    Wark

    Joined:
    Oct 12, 2016
    Messages:
    738
    Resources:
    2
    Maps:
    2
    Resources:
    2
    You could also base the taunt ability off the item spell "Item Temporary Area Armor Bonus," pick all enemy units in a radius around the hero, and then just force them to attack.
    Alternatively, use the Taunt ability but use something like Inner Fire or one of the Roar spells on a dummy unit to give the armor bonus.
    If you don't want to use a buff that can get dispelled, you could even base it off of the Avatar ability.
     
  4. Atakan Özel

    Atakan Özel

    Joined:
    Jan 12, 2019
    Messages:
    7
    Resources:
    0
    Resources:
    0
    taunt001.jpg taunt002.jpg

    This is my very simple way of doing tricks like that, don't know if it works for you too and you have to edit it as you can imagine, it is just a layout for you to understand the idea of minimalistic tricksterism. All you have to do is an "if" function and make the game engine check the condition every x second, your "if" is your hero's ability cooldown, so you may set numeric values and buffs without any additional information kept in memory. It's already using that ability condition data repeatedly.
     
  5. Wark

    Wark

    Joined:
    Oct 12, 2016
    Messages:
    738
    Resources:
    2
    Maps:
    2
    Resources:
    2
    @Atakan Özel
    There's a few problems with that method.
    What if the hero is not preset? What happens if more than 1 unit uses the "Taunt" spell?
    What if the armor gained is from multiple levels?
    What if there are items affecting armor?

    For that, you will need unit indexing to make sure you are truly getting the right amount of duration and armor reset for the hero.
    Although not fully MUI, assuming there's only 1 hero with "Taunt" per player,
    and assuming the duration of the armor increase is 10 seconds,
    something like this with variables would work:
    • Taunt Armor Part 1
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Taunt
      • Actions
        • Set TauntArmor[(Player number of (Owner of (Triggering unit)))] = (Armor of (Triggering unit))
        • Set TauntHero[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
        • Unit - Set Armor of (Triggering unit) to ((Armor of (Triggering unit)) + ((Real((Level of (Ability being cast) for (Triggering unit)))) x 5.00))
        • Set TauntCheck[(Player number of (Owner of (Triggering unit)))] = True
        • Trigger - Run Taunt Armor End 2 <gen> (ignoring conditions)
    • Taunt Armor End 2
      • Events
      • Conditions
      • Actions
        • Wait 10.00 seconds
        • For each (Integer A) from 1 to 12, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • TauntCheck[(Integer A)] Equal to True
              • Then - Actions
                • Set TauntCheck[(Player number of (Owner of (Triggering unit)))] = False
                • Unit - Set Armor of TauntHero[(Integer A)] to TauntArmor[(Integer A)]
              • Else - Actions

    I also highly recommend using "A unit Starts the effect of an ability" to detect when something casts anything. It then triggers at the start of the cast.
    In effect though, you CAN do it this way, but like what Aeryn said, it's not wise to directly manipulate the armor values even if it looks like a shortcut. It just creates ... problems.
     
  6. Astrella

    Astrella

    Joined:
    Oct 3, 2008
    Messages:
    152
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I might be reading it wrong but I think if hero A casts Taunt and then 2 seconds later hero B does both their taunts will expire when hero A's does.

    A way to do it would be to track remaining buff duration for each hero with a variable, lower it every second for example and then when it reaches 0 remove the armor buff.
     
  7. Wark

    Wark

    Joined:
    Oct 12, 2016
    Messages:
    738
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Yea, you are right. That's something I just threw together. Either way, that's why it's simpler just to use an ability to apply the buff.
     
  8. Atakan Özel

    Atakan Özel

    Joined:
    Jan 12, 2019
    Messages:
    7
    Resources:
    0
    Resources:
    0
    That is why i said "you have to edit it" i just tried to give the main idea of cooldown trick. It works fine for only one specific unit with that ability without any additional data storage.

    Just like Wark said, another way of doing it "simply" creating a new custom spell based on "inner fire"; event is "when a unit casts an ability" which is taunt and the condition is if the unit is your "specific hero" you may "give the hero custom inner fire" as an action, which has limited duration and temporal armor.

    I know there are better ways to solve such problem but i'm just kind of a "minimalist" human beign so always trying to solve things with less variables and lines.