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. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    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 Event: Critical from hero attribute

Discussion in 'World Editor Help Zone' started by crabas_sakti, May 1, 2016.

  1. crabas_sakti

    crabas_sakti

    Joined:
    Apr 28, 2016
    Messages:
    34
    Resources:
    0
    Resources:
    0
    Hello guys,

    I want to create a critical strike (passive skill) based on what the hero attribute. Like the hero will learn a new skill called CritAgi, then the hero has a skill of critical chance which the damage based on agility. If the hero attacking a unit, then the hero will deals x2 AGI to enemy for 20% chance. Is that possible to make it with trigger?

    Oh i also want to know how DDS works, i read on this thread from looking_for_help and i still don't understand the JASS code.

    Is the trigger will works even without JASS code, or it must use JASS code to detect the attack?
    Thanks.
     
  2. Meatmuffin

    Meatmuffin

    Joined:
    Jul 25, 2014
    Messages:
    451
    Resources:
    9
    Maps:
    2
    Spells:
    7
    Resources:
    9
  3. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,656
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    I think weep's dds is the best one for learning purposes.

    Basically it creates one trigger per unit and adds the "(specific) unit takes damage" even to each trigger.
    You only need a very basic level of jass to understand how to do this since it's lies with the fundamentals on how to use events, actions and conditions in jass.
     
  4. crabas_sakti

    crabas_sakti

    Joined:
    Apr 28, 2016
    Messages:
    34
    Resources:
    0
    Resources:
    0
    Thanks for the help guys, i really appreciate it and i figure it the trigger when i look again into GUI damage detector tutorial.

    I'm using "Event - A unit Is attacked" and condition. The damage is based on 1.5x AGI (hero attribute). =)

    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) belongs to an enemy of (Owner of (Attacked unit))) Equal to True
      • (Random real number between 0.01 and 100.00) Less than or equal to 25.00
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of CritAgi for (Attacking unit)) Equal to 1
        • Then - Actions
          • Unit - Cause (Attacking unit) to damage (Attacked unit), dealing (1.50 x (Real((Agility of (Attacking unit) (Include bonuses))))) damage of attack type Chaos and damage type Unknown
          • Floating Text - Create floating text that reads (String(((Agility of (Attacking unit) (Include bonuses)) + ((Agility of (Attacking unit) (Include bonuses)) / 2)))) at (Position of (Attacked unit)) with Z offset 0.00, using font size 10.00, color (0.00%, 0.00%, 100.00%), and 0.00% transparency
        • Else - Actions
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
     
    Last edited: May 1, 2016
  5. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,656
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    That can be abused.
    The unit is attack event fires even if you cancel that attack.
     
  6. crabas_sakti

    crabas_sakti

    Joined:
    Apr 28, 2016
    Messages:
    34
    Resources:
    0
    Resources:
    0
    So, the hero still damaged the target even when the unit start to attack and cancel it immediately?
     
  7. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,656
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    Yes.
     
  8. Erkki2

    Erkki2

    Joined:
    Jun 6, 2007
    Messages:
    382
    Resources:
    7
    Skins:
    6
    Spells:
    1
    Resources:
    7
    With PDD (physical damage detection), you would use an event "Game - PDD_damageEventTrigger becomes Equal to 1.00", and an additional condition "PDD_damageType Equal to PDD_PHYSICAL". Also replace all references to attacking unit with "PDD_source" and to attacked unit with "PDD_target".

    In my opinion PDD is the most suitable DDS in this case because it can separate between physical and magical damage. Just follow the import instructions very carefully. Also, worth noting: Some abilities, such as poison, deal physical damage. That would mean, that the trigger will fire very often. So don't give poison and your ability to the same unit, or if you must, use a triggered version of poison.