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. Rubbed the right way, the genie is out of its lamp! The 12th Concept Art Contest Results have been announced.
    Dismiss Notice
  4. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  5. 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.

A unit is attacked with buff

Discussion in 'Triggers & Scripts' started by Keiga, Aug 20, 2005.

  1. Keiga

    Keiga

    Joined:
    Jul 25, 2005
    Messages:
    48
    Resources:
    0
    Resources:
    0
    I am trying to make an ability that if a unit is attacked and they have a specific buff then 50% of the time the unit with the buff takes no damage and the attacking unit damages himsekf with the damage that was going to hurt the unit with the buff, her eis what I have and it isn't working.

    Code (Text):
    Untitled Trigger 001
        Events
            Advanced - Any unit takes damage
        Conditions
            ((Triggering unit) has buff Countering ) Equal to True
        Actions
            Set ROBUNE = (Damage source)
            Unit - Set life of ROBUNE to ((Life of ROBUNE) - (Damage taken))
            Special Effect - Create a special effect attached to the overhead of ROBUNE using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
            Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
            Special Effect - Destroy (Last created special effect)
     
    I took out the % chance for testing purposes.
     
  2. Daelin

    Daelin

    Joined:
    Jul 20, 2004
    Messages:
    3,111
    Resources:
    41
    Models:
    22
    Icons:
    3
    Tutorials:
    16
    Resources:
    41
    Because it is working all the time right? I don't see any other error. You just need to add to the conditions this condition:

    (Random Integer between 1 and 2) is equal to 1

    It may the event's fault, but I never tried WEU so it might be the trigger's fault.

    ~Daelin
     
  3. Telefragged

    Telefragged

    Joined:
    Feb 4, 2005
    Messages:
    311
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Daelin, you didn't read properly. >_>
     
  4. Daminon

    Daminon

    Joined:
    Apr 29, 2005
    Messages:
    1,055
    Resources:
    0
    Resources:
    0
    Using WEU right? I also tried to get the damage when any unit takes damage but it didn't work for me either. I theory is that those functions does not work correctly.
     
  5. Keiga

    Keiga

    Joined:
    Jul 25, 2005
    Messages:
    48
    Resources:
    0
    Resources:
    0
    Is it possible to do it without any unit takes damage?
    I tried to use a unit is attacked but I don't think damage taken works with a unit is attacked, so I guess this skill isn't possible?
     
  6. Daelin

    Daelin

    Joined:
    Jul 20, 2004
    Messages:
    3,111
    Resources:
    41
    Models:
    22
    Icons:
    3
    Tutorials:
    16
    Resources:
    41
    It is, but you will probably need JASS, for the local triggers purpose. When an unit is attacked, you activate the trigger which checks if that unit is damaged by the unit with your skill. And then, the actions are the ones you mention... But unfortunately this works good only with JASS...

    ~Daelin