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

Dual Storm Bolts and Thunder Claps

Status
Not open for further replies.
Level 2
Joined
Mar 21, 2009
Messages
7
In the map X Hero Siege, when the mountain king reaches level 20, he can throw storm bolt twice (and thunder clap twice as well). I want to make the mountain king in my custom map to do that as well but i'm quite new to World Edit so I don't know what to do with the trigger to produce that effect. So can any one help me here :grin:
BTW, the map X Hero Siege is protected so i can't open it to have a look at it :sad:
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
This works if a player can only have one unit with Storm Bolt. Create a duplicate of Storm Bolt ability.

  • Untitled Trigger 020
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Storm Bolt
      • (Level of (Triggering unit)) Equal to 10
    • Actions
      • Player - Disable Storm Bolt for (Owner of (Triggering unit))
      • Player - Enable Storm Bolt 2 for (Owner of (Triggering unit))
      • Unit - Add Storm Bolt 2 to (Triggering unit)
  • Untitled Trigger 020 Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Storm Bolt 2
      • (Level of (Triggering unit)) Equal to 10
    • Actions
      • Player - Disable Storm Bolt 2 for (Owner of (Triggering unit))
      • Player - Enable Storm Bolt for (Owner of (Triggering unit))
      • Unit - Add Storm Bolt to (Triggering unit)
or all in one trigger:
  • Untitled Trigger 020 Copy Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Level of (Triggering unit)) Equal to 10
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Storm Bolt
          • (Ability being cast) Equal to Storm Bolt 2
    • Actions
      • Player - Disable (Ability being cast) for (Owner of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Storm Bolt
        • Then - Actions
          • Player - Enable Storm Bolt 2 for (Owner of (Triggering unit))
          • Unit - Add Storm Bolt 2 to (Triggering unit)
        • Else - Actions
          • Player - Enable Storm Bolt for (Owner of (Triggering unit))
          • Unit - Add Storm Bolt to (Triggering unit)
 
Level 2
Joined
Mar 21, 2009
Messages
7
Wow, that was fast.
Do I have to order my unit to use the 2nd storm bolt on the target too, because I want him to throw another storm bolt instantly at the target after the first one.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Then do this. Make Storm Bolt 2 a unit ability.

  • Untitled Trigger 020 Copy Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Level of (Triggering unit)) Equal to 10
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Storm Bolt - (this)
          • (Ability being cast) Equal to Storm Bolt 2
    • Actions
      • Custom script: local unit u = GetSpellTargetUnit()
      • Wait 0.50 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Storm Bolt - (this)
        • Then - Actions
          • Unit - Add Storm Bolt 2 to (Triggering unit)
          • Unit - Set level of Storm Bolt 2 for (Triggering unit) to (Level of Storm Bolt - (this) for (Triggering unit))
          • Player - Disable Storm Bolt - (this) for (Owner of (Triggering unit))
          • Custom script: call IssueTargetOrder( GetTriggerUnit() , "thunderbolt" , u )
        • Else - Actions
          • Unit - Remove Storm Bolt 2 from (Triggering unit)
          • Player - Enable Storm Bolt - (this) for (Owner of (Triggering unit))
      • Custom script: set u = null
 
Level 2
Joined
Mar 21, 2009
Messages
7
Thanks! It worked perfectly!
Oh, and for thunder clap, I just only need to replace the order id thunderbolt -> thunderclap right? EDIT: nvm, I'll have to change to script to IssueImmediateOrderBJ( GetTriggerUnit(), "thunderclap" ) and no longer need the u variable
BTW, the 2nd storm bolt ability might not be removed if the unit is ordered to stop, stunned, etc. so I'll just have the trigger to manually remove it afterward.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
id thunderbolt -> thunderclap right? EDIT: nvm, I'll have to change to script to IssueImmediateOrderBJ( GetTriggerUnit(), "thunderclap" ) and no longer need the u variable
Use IssueImmediateOrder( GetTriggerUnit(), "thunderclap" )

And even better code:
  • Untitled Trigger 020
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Level of (Triggering unit)) Equal to 10
      • (Ability being cast) Equal to Storm Bolt - (this)
    • Actions
      • Custom script: local unit u = GetSpellTargetUnit()
      • Wait 0.50 seconds
      • Unit - Add Storm Bolt 2 to (Triggering unit)
      • Unit - Set level of Storm Bolt 2 for (Triggering unit) to (Level of Storm Bolt - (this) for (Triggering unit))
      • Player - Disable Storm Bolt - (this) for (Owner of (Triggering unit))
      • Custom script: call IssueTargetOrder( GetTriggerUnit() , "thunderbolt" , u )
      • Wait 0.50 seconds
      • Unit - Remove Storm Bolt 2 from (Triggering unit)
      • Player - Enable Storm Bolt - (this) for (Owner of (Triggering unit))
      • Custom script: set u = null
 
Status
Not open for further replies.
Top