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

Same ability, Different unit

Status
Not open for further replies.

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,539
I attached a map showing how this can be done.
Variables:
DoomGroup = Unit Group
DoomPoint = Point
DoomCount = Integer

Requires a new Dummy unit to be used by the Doom ability. This unit that should have no impact on the game and is designed to be removed immediately upon being summoned.

How it works:
These triggers keep track of your Doom targets by storing them in a Unit Group and tracking their Doom buff periodically. If a unit dies while inside of this Unit Group we know that they died while doomed and can spawn the appropriate Skeleton in response.
  • Doom Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Doom
    • Actions
      • Unit Group - Add (Target unit of ability being cast) to DoomGroup
      • Set VariableSet DoomCount = (DoomCount + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DoomCount Equal to 1
        • Then - Actions
          • Trigger - Turn on Doom Loop <gen>
        • Else - Actions
  • Doom Loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DoomGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Doom) Equal to False
            • Then - Actions
              • Unit Group - Remove (Picked unit) from DoomGroup.
              • Set VariableSet DoomCount = (DoomCount - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DoomCount Less than or equal to 0
                • Then - Actions
                  • Set VariableSet DoomCount = 0
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
  • Doom Skeleton
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in DoomGroup.) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from DoomGroup.
      • -------- --------
      • -------- Create the Skeleton: --------
      • Set VariableSet DoomPoint = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Archer
        • Then - Actions
          • Unit - Create 1 Skeleton Archer for (Owner of (Killing unit)) at DoomPoint facing Default building facing degrees
        • Else - Actions
          • Unit - Create 1 Skeleton Warrior for (Owner of (Killing unit)) at DoomPoint facing Default building facing degrees
      • Custom script: call RemoveLocation (udg_DoomPoint)
      • -------- --------
      • Set VariableSet DoomCount = (DoomCount - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DoomCount Less than or equal to 0
        • Then - Actions
          • Set VariableSet DoomCount = 0
          • Trigger - Turn off Doom Loop <gen>
        • Else - Actions
  • Doom Dummy
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Summoned unit)) Equal to Doom Dummy
    • Actions
      • Unit - Remove (Summoned unit) from the game
 

Attachments

  • Doom Demo.w3m
    19.3 KB · Views: 6
I attached a map showing how this can be done.
Variables:
DoomGroup = Unit Group
DoomPoint = Point
DoomCount = Integer

Requires a new Dummy unit to be used by the Doom ability. This unit that should have no impact on the game and is designed to be removed immediately upon being summoned.

How it works:
These triggers keep track of your Doom targets by storing them in a Unit Group and tracking their Doom buff periodically. If a unit dies while inside of this Unit Group we know that they died while doomed and can spawn the appropriate Skeleton in response.
  • Doom Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Doom
    • Actions
      • Unit Group - Add (Target unit of ability being cast) to DoomGroup
      • Set VariableSet DoomCount = (DoomCount + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DoomCount Equal to 1
        • Then - Actions
          • Trigger - Turn on Doom Loop <gen>
        • Else - Actions
  • Doom Loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DoomGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Doom) Equal to False
            • Then - Actions
              • Unit Group - Remove (Picked unit) from DoomGroup.
              • Set VariableSet DoomCount = (DoomCount - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DoomCount Less than or equal to 0
                • Then - Actions
                  • Set VariableSet DoomCount = 0
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
  • Doom Skeleton
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in DoomGroup.) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from DoomGroup.
      • -------- --------
      • -------- Create the Skeleton: --------
      • Set VariableSet DoomPoint = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Archer
        • Then - Actions
          • Unit - Create 1 Skeleton Archer for (Owner of (Killing unit)) at DoomPoint facing Default building facing degrees
        • Else - Actions
          • Unit - Create 1 Skeleton Warrior for (Owner of (Killing unit)) at DoomPoint facing Default building facing degrees
      • Custom script: call RemoveLocation (udg_DoomPoint)
      • -------- --------
      • Set VariableSet DoomCount = (DoomCount - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DoomCount Less than or equal to 0
        • Then - Actions
          • Set VariableSet DoomCount = 0
          • Trigger - Turn off Doom Loop <gen>
        • Else - Actions
  • Doom Dummy
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Summoned unit)) Equal to Doom Dummy
    • Actions
      • Unit - Remove (Summoned unit) from the game
Nice trigger but is not easy if he will make
Event
Unit A unit Starts the effect of an ability
Condition Doom (dummy skill)
Action
If Condition
Target of skill = Archer
Then
Variable (DoomPoint)= position of casting unit
Unit - Create 1 dummy archer for (Owner of (casting unit)) at DoomPoint
Unit Order last unit created to Doom target unit
Expiration time for dummy archer 5 sec
RemoveLocation (udg_DoomPoint)
Else
If Condition
Target of skill = Warrior
Then
Variable (DoomPoint)= position of casting unit
Unit - Create 1 dummy warrior for (Owner of (casting unit)) at DoomPoint
Unit Order last unit created to Doom target unit
Expiration time for dummy warrior 5 sec
RemoveLocation
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,539
I agree that it's a nice clean method BUT there are some catches. With my method, the Hero casting Doom will be the source of the Kill/Damage and not a Dummy unit. This could be useful for On Kill / Damage Event related stuff.

That being said, I also forgot that Doom lasts forever and cannot be dispelled. If that's the case then it makes the Loop trigger / DoomCount stuff completely pointless. But again, this mistake opens the door for a temporary Doom effect so it could come in handy. So I would say both methods have there place depending on what you want to do.
  • Unconcerned about On Kill/Damage Events? Use Dracula's method.
  • Concerned about On Kill/Damage Events and your Doom lasts forever? I would use my method and remove the Loop trigger/DoomCount stuff from it.
  • Concerned about On Kill/Damage Events and your Doom is temporary? I would use my method without changing anything.
Aside from all of that, the best method would be this but I couldn't get it to work:
  • Ability - Set Ability: (Unit: (Casting unit)'s Ability with Ability Code: Doom)'s Integer Level Field: Summoned Unit Type ('Ndou') of Level: 0 to X
 
Last edited:
Status
Not open for further replies.
Top