• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Set level limit for spell that have many levels

Status
Not open for further replies.
Level 3
Joined
Jun 17, 2015
Messages
53
[SOLVED] Set level limit for spell that have many levels

Tooltips:
Stun and deal 50 (+souls) damage to the target. Limit 5/10/15/20 souls.

Everytime an enemy unit dies around you, get 1 soul (each soul +10 stun damage and 0.2s stun)

Of course this is 31 levels of "storm bolt"

here are my triggers:

  • Soul Blast Learn
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to (==) Soul Blast
    • Actions
      • Set SoulBlast_User = (Learning Hero)
      • Set SoulBlastStun = 1
      • Unit - Add Soul Blast [Stun] to (Learning Hero)
      • Trigger - Turn off (This trigger)
      • Trigger - Turn on Soul Blast Limit <gen>
  • Soul Blast Limit
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A structure) Not equal to (!=) True
      • ((Dying unit) belongs to an enemy of (Owner of SoulBlast_User)) Equal to (==) True
    • Actions
      • Set SoulBlast_Die = (Position of (Dying unit))
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • SoulBlastStun Less than (<) (1 + (5 x (Level of Soul Blast for SoulBlast_User)))
          • Then - Actions
            • Set AAGroup = (Units within 600.00 of SoulBlast_Die matching ((Matching unit) Equal to (==) SoulBlast_User))
            • Unit Group - Pick every unit in AAGroup and do (Actions)
              • Loop - Actions
                • Set SoulBlastStun = (SoulBlastStun + 1)
                • Unit - Set level of Soul Blast [Stun] for SoulBlast_User to SoulBlastStun
          • Else - Actions
      • Custom script: call DestroyGroup( udg_AAGroup )
      • Custom script: call RemoveLocation(udg_SoulBlast_Die)
  • Soul Blast After Cast
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to (==) Soul Blast [Stun]
    • Actions
      • Set SoulBlastStun = ((SoulBlastStun / 2) + 1)
      • Unit - Set level of Soul Blast [Stun] for SoulBlast_User to SoulBlastStun
 
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,657
Also use one ability to stun a unit.
This ability may have a few hundred levels depending on how accurate you want it to be or you use the mass teleport ability to stun the units instead which basically means more dummy units (that cast the stun) but only one ability level (no additional loading time and 100% accuracy).
 
Level 3
Joined
Jun 17, 2015
Messages
53
Yes, i use "Attribute Bonus" as dummy spell, after hero learnt it will dissapear, then add the 31 lvls stun to the hero

as i set the limit, sometime it stopped as 7 when the limit is 10 kills, dunno whats the problem
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,206
The tooltip will not updated when in view, make sure to refresh it on screen be moving the cursor off and on the command card button.

Instead of...
  • Unit - Increase level of Soul Blast [Stun] for SoulBlast_User
Try...
  • Unit - Set level of Soul Blast [Stun] for SoulBlast_User to (SoulBlastStun)
This should make sure the trigger logic is always consistent and reduce the chance of any error.
 
Status
Not open for further replies.
Top