• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Trigger Event: Critical from hero attribute

Status
Not open for further replies.
Level 4
Joined
Apr 28, 2016
Messages
33
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.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
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.
 
Level 4
Joined
Apr 28, 2016
Messages
33
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:
Level 10
Joined
Jun 6, 2007
Messages
392
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.
 
Status
Not open for further replies.
Top