• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!

[Spell] Custom Passive Spell Question

Status
Not open for further replies.
Level 7
Joined
Nov 6, 2019
Messages
186
Hey i know how to set them up but not how i want it to be

i can set up, passive for units being attacked, and units attacking.

But i wanna set up one thats a constant passive, casting spells / attacking / being attacked

I can set up. chance to proc, when being attacked, chance to proc attacking, but that to specific that hero has a specific buff, to proc it.

Basically, i want to set a passive 2.5% chance 3.75% chance and 5% chance to AOE heal nearby allies within 500 Range, healing for 3 x Hero Intelligence Including Bonus.

i can easily set it up if it checks passive when being attacked or attacking, but as a healer they dont attack or be attack they stand out of the way and heal.

i can dot his and it works perfectly, but only if the hero is being attacked or attacking

  • HeavenlyGraceAttacked
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacking unit) has buff |cffd45e19Heavenly Grace|r (2.5%)) Equal to True
          • (Random percentage) Less than or equal to RacialPercentage[1]
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 500.00 of (Position of (Attacking unit)) matching (((Matching unit) belongs to an ally of (Owner of (Attacking unit)).) Equal to True).) and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect at (Position of (Picked unit)) using war3mapImported\Heal Orange.mdx
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (3.00 x (Real((Intelligence of (Attacking unit) (Include bonuses))))))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacked unit) has buff |cffd45e19Heavenly Grace|r (2.5%)) Equal to True
          • (Random percentage) Less than or equal to RacialPercentage[1]
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 500.00 of (Position of (Attacked unit)) matching (((Matching unit) belongs to an ally of (Owner of (Attacked unit)).) Equal to True).) and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect at (Position of (Picked unit)) using war3mapImported\Heal Orange.mdx
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (3.00 x (Real((Intelligence of (Attacked unit) (Include bonuses))))))
        • Else - Actions
Not sure but this might also work?

  • HeavenlyGraceCasting
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Casting unit) has buff |cffd45e19Heavenly Grace|r (2.5%)) Equal to True
          • (Random percentage) Less than or equal to RacialPercentage[1]
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 500.00 of (Position of (Casting unit)) matching (((Matching unit) belongs to an ally of (Owner of (Casting unit)).) Equal to True).) and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect at (Position of (Picked unit)) using war3mapImported\Heal Orange.mdx
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (3.00 x (Real((Intelligence of (Casting unit) (Include bonuses))))))
        • Else - Actions
 
Last edited:
Level 7
Joined
Jul 4, 2007
Messages
249
Yes it should work, doesn't it? You could put them in the same trigger though, just put this as condition instead
  • Events
    • Unit - A unit Is attacked
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • ((Attacking unit) has buff |cffd45e19Heavenly Grace|r (2.5%)) Equal to True
        • ((Casting unit) has buff |cffd45e19Heavenly Grace|r (2.5%)) Equal to True
  • Actions
By the way your trigger is leaking unit groups, Things That Leak
 
Level 7
Joined
Nov 6, 2019
Messages
186
so.. what is the problem? i dont get it.
do you want the percentage chance to increase based on the ability level?


No I want it constant chance, atm the healer has to be attacking or be attacked

but as a healer you job is to heal not attack and tank should have aggro

therefore the healer is t attacking not being attacked, so it will never proc

want it to have chance to proc always even if healer is stood still doing nothing


Also, if healer is attacking and being attack, then it has 2, 2.5% chances to proc, so 5% not 2.5%


Yes it should work, doesn't it? You could put them in the same trigger though, just put this as condition instead
  • Events
    • Unit - A unit Is attacked
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • ((Attacking unit) has buff |cffd45e19Heavenly Grace|r (2.5%)) Equal to True
        • ((Casting unit) has buff |cffd45e19Heavenly Grace|r (2.5%)) Equal to True
  • Actions
By the way your trigger is leaking unit groups, Things That Leak

how is it leaking? There is no user group Variable to custom script destroy, I could always add a variable to destroy to be safe I guess.
 
Last edited:
Level 7
Joined
Nov 6, 2019
Messages
186
Using a variable alone doesn't tell if code leaks or not. Memory Leaks

So does this fix it then, as i never had a issue with UserGroup before

  • HeavenlyGrace
    • Events
      • Unit - A unit Is attacked
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Casting unit) has buff |cffd45e19Heavenly Grace|r (2.5%)) Equal to True
          • (Random percentage) Less than or equal to RacialPercentage[1]
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 500.00 of (Position of (Casting unit)) matching (((Matching unit) belongs to an ally of (Owner of (Casting unit)).) Equal to True).) and do (Actions)
            • Loop - Actions
              • Set VariableSet HGCasting = (Last created unit group)
              • Special Effect - Create a special effect at (Position of (Picked unit)) using war3mapImported\Heal Orange.mdx
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (3.00 x (Real((Intelligence of (Casting unit) (Include bonuses))))))
              • Custom script: call DestroyGroup(udg_HGCasting)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacked unit) has buff |cffd45e19Heavenly Grace|r (2.5%)) Equal to True
          • (Random percentage) Less than or equal to RacialPercentage[1]
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 500.00 of (Position of (Attacked unit)) matching (((Matching unit) belongs to an ally of (Owner of (Attacked unit)).) Equal to True).) and do (Actions)
            • Loop - Actions
              • Set VariableSet HGAttack = (Last created unit group)
              • Special Effect - Create a special effect at (Position of (Picked unit)) using war3mapImported\Heal Orange.mdx
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (3.00 x (Real((Intelligence of (Attacked unit) (Include bonuses))))))
              • Custom script: call DestroyGroup(udg_HGAttack)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacking unit) has buff |cffd45e19Heavenly Grace|r (2.5%)) Equal to True
          • (Random percentage) Less than or equal to RacialPercentage[1]
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 500.00 of (Position of (Attacking unit)) matching (((Matching unit) belongs to an ally of (Owner of (Attacking unit)).) Equal to True).) and do (Actions)
            • Loop - Actions
              • Set VariableSet HGAttacking = (Last created unit group)
              • Special Effect - Create a special effect at (Position of (Picked unit)) using war3mapImported\Heal Orange.mdx
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (3.00 x (Real((Intelligence of (Attacking unit) (Include bonuses))))))
              • Custom script: call DestroyGroup(udg_HGAttacking)
        • Else - Actions
 
Level 7
Joined
Jul 4, 2007
Messages
249
So does this fix it then, as i never had a issue with UserGroup before

  • HeavenlyGrace
    • Events
      • Unit - A unit Is attacked
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Casting unit) has buff |cffd45e19Heavenly Grace|r (2.5%)) Equal to True
          • (Random percentage) Less than or equal to RacialPercentage[1]
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 500.00 of (Position of (Casting unit)) matching (((Matching unit) belongs to an ally of (Owner of (Casting unit)).) Equal to True).) and do (Actions)
            • Loop - Actions
              • Set VariableSet HGCasting = (Last created unit group)
              • Special Effect - Create a special effect at (Position of (Picked unit)) using war3mapImported\Heal Orange.mdx
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (3.00 x (Real((Intelligence of (Casting unit) (Include bonuses))))))
              • Custom script: call DestroyGroup(udg_HGCasting)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacked unit) has buff |cffd45e19Heavenly Grace|r (2.5%)) Equal to True
          • (Random percentage) Less than or equal to RacialPercentage[1]
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 500.00 of (Position of (Attacked unit)) matching (((Matching unit) belongs to an ally of (Owner of (Attacked unit)).) Equal to True).) and do (Actions)
            • Loop - Actions
              • Set VariableSet HGAttack = (Last created unit group)
              • Special Effect - Create a special effect at (Position of (Picked unit)) using war3mapImported\Heal Orange.mdx
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (3.00 x (Real((Intelligence of (Attacked unit) (Include bonuses))))))
              • Custom script: call DestroyGroup(udg_HGAttack)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacking unit) has buff |cffd45e19Heavenly Grace|r (2.5%)) Equal to True
          • (Random percentage) Less than or equal to RacialPercentage[1]
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 500.00 of (Position of (Attacking unit)) matching (((Matching unit) belongs to an ally of (Owner of (Attacking unit)).) Equal to True).) and do (Actions)
            • Loop - Actions
              • Set VariableSet HGAttacking = (Last created unit group)
              • Special Effect - Create a special effect at (Position of (Picked unit)) using war3mapImported\Heal Orange.mdx
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (3.00 x (Real((Intelligence of (Attacking unit) (Include bonuses))))))
              • Custom script: call DestroyGroup(udg_HGAttacking)
        • Else - Actions
No what you do is,
  • Set tempLoc = (Position of (Casting unit))
  • Set unitGrp = (Units within 500.00 of tempLoc)
  • Custom script: call RemoveLocation(udg_tempLoc)
  • Unit Group - Pick every unit in unitGrp and do (Actions)
    • Loop - Actions
      • -------- <Your actions> --------
  • Custom script: call DestroyGroup(udg_unitGrp)
I added the location leak aswell, which I didn't notice before.

You could make the trigger something like this.
  • HeavenlyGrace
    • Events
      • Unit - A unit Is attacked
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random real number between 0.00 and 1.00) Less than or equal to RacialPercentage[1]
        • Then - Actions
          • -------- ATTACKED --------
          • Set unit = (Attacked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (unit has buff Heavenly Grace) Equal to True
            • Then - Actions
              • Set tempLoc = (Position of unit)
            • Else - Actions
              • -------- ATTACKING --------
              • Set unit = (Attacking unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (unit has buff Heavenly Grace) Equal to True
                • Then - Actions
                  • Set tempLoc = (Position of unit)
                • Else - Actions
                  • -------- CASTING --------
                  • Set unit = (Casting unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (unit has buff Heavenly Grace) Equal to True
                    • Then - Actions
                      • Set tempLoc = (Position of unit)
                    • Else - Actions
          • Set unitGrp = (Units within 500.00 of tempLoc)
          • Custom script: call RemoveLocation(udg_tempLoc)
          • Unit Group - Pick every unit in unitGrp and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) belongs to an ally of (Owner of unit)) Equal to True
                • Then - Actions
                  • Set tempLoc = (Position of (Picked unit))
                  • Special Effect - Create a special effect at tempLoc using war3mapImported\Heal Orange.mdx
                  • Custom script: call RemoveLocation(udg_tempLoc)
                  • Special Effect - Destroy (Last created special effect)
                  • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (3.00 x (Real((Intelligence of unit (Include bonuses))))))
                • Else - Actions
          • Custom script: call DestroyGroup(udg_unitGrp)
        • Else - Actions
It makes more sense to use
  • Special Effect - Create a special effect attached to the origin of (Picked unit) using war3mapImported\Heal Orange.mdx
than on a point, but it depends on what you want to achieve of course.
 
Last edited:
Status
Not open for further replies.
Top