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 haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Lead your forces to battle in the 15th Techtree Contest. The call is yours, commander!
    Dismiss Notice
  4. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  5. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  6. 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] Affecting a Units Attack cooldown

Discussion in 'Triggers & Scripts' started by Lingonberryjam, Aug 16, 2007.

  1. Lingonberryjam

    Lingonberryjam

    Joined:
    Feb 25, 2005
    Messages:
    230
    Resources:
    0
    Resources:
    0
    Well hi there,

    I have made a spell, enabling a hero to swing his sword manually, dealing damage to enemies in range of his sword (the hero is a blademaster).

    The spell is based on a 'Howl of Terror', but that is just to have a 'triggerer-spell' with no target (the spell actually has no effects of itself, except playing the Hero's attack animation).

    This is what happens when using the spell:
    Removed some floating texts and sounds in the trigger to make it cleaner... tell me if you want the whole trigger.

    • Slice
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Slice
      • Actions
        • Set tempPoint[2] = ((Position of (Triggering unit)) offset by 100.00 towards (Facing of (Triggering unit)) degrees)
        • Wait 0.11 seconds
        • Set tempUnitGroup[1] = (Units within 100.00 of tempPoint[2] matching ((((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is A structure) Equal to False)))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Triggering unit) is alive) Equal to True
          • Then - Actions
            • Unit Group - Pick every unit in tempUnitGroup[1] and do (Actions)
              • Loop - Actions
                • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (X) damage of attack type Hero and damage type Normal

    --


    Here's the problem: After using this spell, dealing damage to enemies, you can simply attack them again (using the 'normal' attack). This enables a sort of 'double strike', or even 'triple strike' if the player goes like this: attack - slice - attack. I would like the spell to count on the units attack-cooldown, not allowing him to attack directly afterwards.

    Can this be done in the Object Editor or in GUI?

    Any help appreciated.
     
  2. Preskooldude

    Preskooldude

    Joined:
    Jul 23, 2005
    Messages:
    329
    Resources:
    0
    Resources:
    0
    Why don't you set a variable that says that the player wants to slice on his next attack?

    So there would be two triggers. One that detects the player casting the spell and sets a variable.

    The other detects an attack, checks if the variable is on, then PISHOO with your spell.
     
  3. Lingonberryjam

    Lingonberryjam

    Joined:
    Feb 25, 2005
    Messages:
    230
    Resources:
    0
    Resources:
    0
    Maybe i dont want the spell to be casted repeatedly and automatically?

    ---

    Anyway i figured a way to prevent the triple strike, using a dummy unit that casts a manipulated 'Silence' on the hero. The silent prevents melee attacks only, and lasts 1.82 seconds = the hero's attack cooldown.

    But that doesnt matter, i changed my mind about how the combat play should be in the game.

    -This thread may now be closed-
     
  4. Just_Spectating

    Just_Spectating

    Joined:
    May 16, 2007
    Messages:
    7,022
    Resources:
    46
    Models:
    11
    Icons:
    9
    Skins:
    26
    Resources:
    46
    wait, i have an option, why not make ur "slice ability" replace your attack button?