• 🏆 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!

Help with passive spells

Status
Not open for further replies.
Level 2
Joined
Nov 4, 2017
Messages
7
Hi, I need help to make a passive spell. I'm not good at trigger right now.

Passive: Whenever the [Hero] is attacked, have % the attacked unit will take X damge and be root/or any cc for X second.
Thanks! :)
 
You need 2 skills:
  • The learnable skill in the UI of your hero.
  • The disable skill, this skill has an invisible dummy caster which will cast the effect when needed.
A Trigger with the event any Unit is attacked,
inside this trigger roll an integer check if the roll is below equal the wanted %.
Yes, deal damage and let the dummy caster spell the disable effect.
The unit is attacked event will make the dummy cast the spell before the attack is launched.
Might contain useful information regarding this.
Single Target Spell for Multiple Units
  • Counter Effect
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Set Level = (Level of CounterSkill for (Attacked unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to Counter_Chance[Level]
        • Then - Actions
          • Unit - Cause (Attacked unit) to damage (Attacking unit), dealing CounterDamage[Level] damage of attack type Spells and damage type Magic
          • Unit - Set level of CounterDisable for CounterCaster to Level
          • Unit - Order CounterCaster to Night Elf Keeper Of The Grove - Entangling Roots (Attacking unit)
        • Else - Actions
  • Counter Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set CounterSkill = Hero Skill
      • Set CounterDisable = Root-Skill
      • Set Counter_Chance[1] = 20
      • Set Counter_Chance[2] = 22
      • Set Counter_Chance[3] = 24
      • Set Counter_Chance[4] = 25
      • Set CounterDamage[1] = 10.00
      • Set CounterDamage[2] = 25.00
      • Set CounterDamage[3] = 40.00
      • Set CounterDamage[4] = 50.00
      • Unit - Create 1 Dummy Caster for Neutral Passive at (Center of (Playable map area)) facing Default building facing degrees
      • Set CounterCaster = (Last created unit)
      • Unit - Add CounterDisable to CounterCaster
 
Level 21
Joined
Apr 8, 2017
Messages
1,530
This what i do in these cases.
23414580_1492087880884248_291971763_n.jpg


Without leaks
23435303_1492087894217580_1948750534_n.jpg


I use spanish version :/
Quality is "Salt-Home-India-Trap"
 
Level 4
Joined
Jul 26, 2017
Messages
66
I strongly suggest you put a GUI-Friendly Damage Detection v1.2.1 on your map so that you can use the amount of damage that was done in the calculation of how much damage is returned. Then you make a trigger a lot like this:

  • <some ability>
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Level of <some ability>for GDD_DamagedUnit) Greater than 0
      • (Random integer number between 1 and 20) Less than or equal to ((Level of <some ability> for GDD_DamagedUnit) + 1)
    • Actions
      • Trigger - Turn off GUI Friendly Damage Detection <gen>
      • Unit - Cause GDD_DamagedUnit to damage GDD_DamageSource, dealing (GDD_Damage x (<some factor>)) damage of attack type Normal and damage type Normal
      • Trigger - Turn on GUI Friendly Damage Detection <gen>
      • Set tempLoc = (Position of GDD_DamagedUnit)
      • Unit - Create 1 dummy for (Owner of GDD_DamagedUnit) at tempLoc facing 0.00 degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Add dummy Ensnare to (Last created unit)
      • Unit - Order (Last created unit) to Orc Raider - Ensnare GDD_DamagedUnit
      • Custom script: call RemoveLocation(udg_tempLoc)
where dummy Ensnare is a copy of the orc ability ensnare.
 
Status
Not open for further replies.
Top