• 🏆 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] Rocket Launch Abillity - Problem

Status
Not open for further replies.
Level 3
Joined
Sep 4, 2015
Messages
32
Description
Launch 3 rockets at random unit around you. There is a chance to hit ally (buildings too!).

I tried to check trigger to target atleast one unit from the group, but still not working =\.

  • Rocket Launch
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Launch Rockets! (Upgrade 1)
    • Actions
      • Set Rocket_Launch_Area = 250.00
      • Set Rocket_Launch_Caster = (Casting unit)
      • Set Rocket_Launch_Level = (Level of (Ability being cast) for Rocket_Launch_Caster)
      • Set Rocket_Launch_Spell = Acid Bomb
      • Set Rocket_Launch_Group = (Units within (Rocket_Launch_Area + ((Real(Rocket_Launch_Level)) x 250.00)) of (Position of Rocket_Launch_Caster))
      • Unit - Create 1 Dummy for (Owner of Rocket_Launch_Caster) at (Position of Rocket_Launch_Caster) facing Default building facing degrees
      • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
      • Unit - Add Rocket_Launch_Spell to (Last created unit)
      • Unit - Set level of Rocket_Launch_Spell for (Last created unit) to Rocket_Launch_Level
      • Unit - Order Rocket_Launch_Unit to Neutral Alchemist - Acid Bomb (Random unit from Rocket_Launch_Group)
 
Level 3
Joined
Jun 17, 2015
Messages
53
Use "A unit Starts the effect of an ability" if you want it trigger when casted the spell


  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to (==) Launch Rockets
  • Actions
    • Set Rocket_Caster = (Casting unit)
    • Set Rocket_Level = (Level of (Ability being cast) for Rocket_Caster)
    • Set Rocket_Point = (Target point of ability being cast)
    • -------- You know how to set group, but your way is wrong --------
    • Set Rocket_Group = (Units within 250.00 of Rocket_Point matching ((((Matching unit) is A structure) Not equal to (!=) True) and ((((Matching unit) belongs to an enemy of (Owner of Rocket_Caster)) Equal to (==) True) and (((Matching unit) is alive) Equal to (==) True))))
    • -------- You have to pick some random unit from unit group --------
    • Unit Group - Pick every unit in (Random 3 units from Rocket_Group) and do (Actions)
      • Loop - Actions
        • Set Rocket_Point2 = (Position of (Picked unit))
        • Unit - Create 1 Footman for (Owner of Rocket_Caster) at Rocket_Point2 facing Default building facing (270.0) degrees
        • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
        • Unit - Add Acid Bomb to (Last created unit)
        • Unit - Set level of Acid Bomb for (Last created unit) to Rocket_Level
        • Unit - Order (Last created unit) to Neutral Alchemist - Acid Bomb (Picked unit)
        • Custom script: call RemoveLocation(udg_Rocket_Point2)
        • -------- remove leaks or your map gonna lagger --------
    • -------- remove leaks or your map gonna lagger --------
    • Custom script: call RemoveLocation(udg_Rocket_Group)
    • -------- Chance to cast to ally --------
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random percentage) Less than or equal to (<=) 15.00
        • Then - Actions
          • Set Rocket_Group = (Units within 250.00 of Rocket_Point matching ((((Matching unit) is A structure) Equal to (==) True) and ((((Matching unit) belongs to an ally of (Owner of Rocket_Caster)) Equal to (==) True) and (((Matching unit) is alive) Equal to (==) True))))
          • Unit Group - Pick every unit in (Random 1 units from Rocket_Group) and do (Actions)
            • Loop - Actions
              • Set Rocket_Point2 = (Position of (Picked unit))
              • Unit - Create 1 Footman for (Owner of Rocket_Caster) at Rocket_Point2 facing Default building facing (270.0) degrees
              • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
              • Unit - Add Acid Bomb to (Last created unit)
              • Unit - Set level of Acid Bomb for (Last created unit) to Rocket_Level
              • Unit - Order (Last created unit) to Neutral Alchemist - Acid Bomb (Picked unit)
              • Custom script: call RemoveLocation(udg_Rocket_Point2)
          • Custom script: call RemoveLocation(udg_Rocket_Group)
        • Else - Actions
    • Custom script: call DestroyGroup( udg_Rocket_Point )
 
Last edited:
Status
Not open for further replies.
Top