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

Request a spell for an archer

Status
Not open for further replies.
Level 12
Joined
Jan 13, 2008
Messages
559
It would be great if someone could make this probably simple trigger for me.
It's a no target spell. If you click it, the hero creates 5 clones of himself like the ability "Mirror Image". The clones should randomly spawn in an range area of 500. and so should the real hero (so its not obvious to tell which one is the real) and automatically attack the nearest target (they dont deal damage). They have the same health/armor as the hero and if 1 clone gets attacked..every clone (including the real hero) takes reduced damage. After 5 seconds they should disappear and the hero gets snared to the ground (rooted) for 3 seconds but can still attack.

(it would be even cooler if the clones disappear..that they somehow get sucked in from the real hero..)
If someone could do this..that would be awesome. thank you
 
Level 7
Joined
Nov 19, 2015
Messages
283
Making atm will upload later. Made a simple version at first using orc mirror image, ensnare and spirit link. Have restarted from scratch using hashtables for better animation of the sucking up part.
 
Level 7
Joined
Nov 19, 2015
Messages
283
Sorry, I was playing around with things that can go wrong to test the spell out and I uploaded the wrong version. This one should work.

View attachment Archer skill - Nordmar.w3x

BTW, I was testing mirror image on units with an expiration timer. Apparently they just die without creating the illusions. That's why the hero died straight away.

I don't know why but I'm asking now.
 
Level 12
Joined
Jan 13, 2008
Messages
559
What does this mean. If a clone takes damage, all the clones and the hero get damage reduction? Like increased armor? Or the some of the damage dealt is spread across the other clones and the hero?

It means the second. That everyone loses life but reduced. Like 50% for example.
@kingwonk: i will test your version as soon as I am home. Thank you already
 
Level 7
Joined
Nov 19, 2015
Messages
283
I don't really understand your spell. I can't tell if its a positive thing or a negative thing. You gain no increased damage output from using it and you also become rooted after use.

With 50% damage spread out, imagine if you got hit by an AOE spell. The You would take 100%+(4x50%) = 300% damage. I only put 20% in the map but all the spell variables can be changed in the constant trigger page.

I made the root only happen if they get sucked back into you rather than just dying since I feel like this spell is more of a hindrance than helpful. Unless I didn't fully understand your request. I'm new and this is my first spell request.
 
Level 12
Joined
Jan 13, 2008
Messages
559
Ok no problem. I try to explain it again more clearly.
When casting the ability,..x Mirror Images get created in an area of y around the hero. The hero should get replaced aswell within this area. The clones should attack any unit near them. They all share the damage they take which means if 1 clone gets attacked..all the other clones and the hero receive damage. After x seconds..the clones vanish and the hero gets rooted/snared for x seconds :) It is very important that I can change the damage and other variables any time and that it's MUI.
 
Level 10
Joined
Apr 4, 2010
Messages
509
This is my version, I thought I'd give clones a try and using a DDS for the first time. MUI & no apparent bugs. It requires Bribe's DDS, you should also remove all the messages I put in the spell if you decide to use it.
  • Clone Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- The index is the level of the ability. --------
      • -------- For example, Clone_Counter[1] is the amount of clones at level one. --------
      • -------- The Abilities used. --------
      • Set Clone_Ability_Main = Mirror Image
      • Set Clone_Ability_Ensnare = Clone Ensnare
      • -------- Speed of which the Clones fly back into the Caster. --------
      • Set Clone_Speed = 20.00
      • -------- Amount Of Clones --------
      • -------- NOT CONFIGUIRABLE HERE: These must match the amount of clones in the spell in object editor. To configuire the amount of clones, change it in object editor and make the amount match these variables. --------
      • Set Clone_Counter[1] = 1
      • Set Clone_Counter[2] = 2
      • Set Clone_Counter[3] = 3
      • -------- Duration --------
      • -------- NOT CONFIGUIRABLE HERE: These must match the duration of the spell in object editor. To configuire the duration, change the duration in object editor and make the durations match these variables. --------
      • Set Clone_Config_Duration[1] = 10.00
      • Set Clone_Config_Duration[2] = 10.00
      • Set Clone_Config_Duration[3] = 10.00
      • -------- Damage Spread Percentage --------
      • Set Clone_Damage_Percent[1] = 1.00
      • Set Clone_Damage_Percent[2] = 0.70
      • Set Clone_Damage_Percent[3] = 0.50
  • Clone Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Clone_Ability_Main
    • Actions
      • For each (Integer Clone_Loop) from 1 to Clone_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Casting unit) Equal to Clone_Caster[Clone_Loop]
            • Then - Actions
              • Set Clone_Caster[Clone_Loop] = Clone_Caster[Clone_Index]
              • Set Clone_LevelOfAbility[Clone_Loop] = Clone_LevelOfAbility[Clone_Index]
              • Set Clone_Ready[Clone_Loop] = Clone_Ready[Clone_Index]
              • Set Clone_Duration_Timer[Clone_Loop] = Clone_Duration_Timer[Clone_Index]
              • Set CloneGroup[Clone_Loop] = CloneGroup[Clone_Index]
              • Custom script: call DestroyGroup (udg_CloneGroup[udg_Clone_Index])
              • Custom script: set udg_CloneGroup[udg_Clone_Index] = null
              • Set Clone_Index = (Clone_Index - 1)
              • Set Clone_Loop = (Clone_Loop - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Clone_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off Clone Loop <gen>
                • Else - Actions
            • Else - Actions
      • Set Clone_Index = (Clone_Index + 1)
      • Game - Display to (All players) the text: 1
      • Set Clone_Caster[Clone_Index] = (Casting unit)
      • Game - Display to (All players) the text: 2
      • Set Clone_LevelOfAbility[Clone_Index] = (Level of Clone_Ability_Main for Clone_Caster[Clone_Index])
      • Game - Display to (All players) the text: 3
      • Set Clone_Ready[Clone_Index] = False
      • Game - Display to (All players) the text: 4
      • Set Clone_Duration_Timer[Clone_Index] = Clone_Config_Duration[Clone_LevelOfAbility[Clone_Index]]
      • Game - Display to (All players) the text: 5
      • Custom script: if udg_CloneGroup[udg_Clone_Index] == null then
      • Custom script: set udg_CloneGroup[udg_Clone_Index] = CreateGroup()
      • Custom script: endif
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Clone_Index Equal to 1
        • Then - Actions
          • Game - Display to (All players) the text: 6
          • Trigger - Turn on Clone Loop <gen>
        • Else - Actions
  • Clone Spawn
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
    • Actions
      • For each (Integer Clone_Loop) from 1 to Clone_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Summoning unit) Equal to Clone_Caster[Clone_Loop]
              • (Unit-type of (Summoned unit)) Equal to (Unit-type of (Summoning unit))
            • Then - Actions
              • Unit Group - Add (Summoned unit) to CloneGroup[Clone_Loop]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Clone_Ready[Clone_Loop] Equal to False
                  • (Number of units in CloneGroup[Clone_Loop]) Equal to Clone_Counter[Clone_LevelOfAbility[Clone_Loop]]
                • Then - Actions
                  • Set Clone_Ready[Clone_Loop] = True
                  • Game - Display to (All players) the text: 7
                  • Game - Display to (All players) the text: (String((Number of units in CloneGroup[Clone_Loop])))
                • Else - Actions
            • Else - Actions
  • Clone Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Clone_Loop) from 1 to Clone_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Clone_Ready[Clone_Loop] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Clone_Duration_Timer[Clone_Loop] Less than or equal to 0.50
                • Then - Actions
                  • Unit Group - Pick every unit in CloneGroup[Clone_Loop] and do (Actions)
                    • Loop - Actions
                      • Set Clone_TempUnit = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Clone_TempUnit is alive) Equal to True
                          • (Clone_TempUnit is paused) Equal to True
                        • Then - Actions
                          • Game - Display to (All players) the text: 9
                          • Set Clone_TempPoint[0] = (Position of Clone_Caster[Clone_Loop])
                          • Set Clone_TempPoint[1] = (Position of Clone_TempUnit)
                          • Set Clone_TempAngle = (Angle from Clone_TempPoint[1] to Clone_TempPoint[0])
                          • Unit - Move Clone_TempUnit instantly to (Clone_TempPoint[1] offset by Clone_Speed towards Clone_TempAngle degrees)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Distance between Clone_TempPoint[0] and Clone_TempPoint[1]) Less than or equal to 10.00
                            • Then - Actions
                              • Unit - Kill Clone_TempUnit
                            • Else - Actions
                        • Else - Actions
                          • Unit - Pause the expiration timer for Clone_TempUnit
                          • Unit - Pause Clone_TempUnit
                          • Unit - Turn collision for Clone_TempUnit Off
                          • Custom script: call UnitAddAbility(udg_Clone_TempUnit, 'Aloc')
                • Else - Actions
                  • Set Clone_Duration_Timer[Clone_Loop] = (Clone_Duration_Timer[Clone_Loop] - 0.03)
                  • Game - Display to (All players) the text: (String(Clone_Duration_Timer[Clone_Loop]))
                  • Game - Display to (All players) the text: 8
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (All units of CloneGroup[Clone_Loop] are dead) Equal to True
                      • (Clone_Caster[Clone_Loop] is dead) Equal to True
                • Then - Actions
                  • Unit - Create 1 Dummy for (Owner of Clone_Caster[Clone_Loop]) at Clone_TempPoint[0] facing Default building facing degrees
                  • Unit - Add a 0.50 second Water Elemental expiration timer to (Last created unit)
                  • Unit - Add Clone_Ability_Ensnare to (Last created unit)
                  • Unit - Set level of Clone_Ability_Ensnare for (Last created unit) to Clone_LevelOfAbility[Clone_Loop]
                  • Unit - Order (Last created unit) to Orc Raider - Ensnare Clone_Caster[Clone_Loop]
                  • Custom script: call DestroyGroup (udg_CloneGroup[udg_Clone_Loop])
                  • Set Clone_Caster[Clone_Loop] = Clone_Caster[Clone_Index]
                  • Set Clone_LevelOfAbility[Clone_Loop] = Clone_LevelOfAbility[Clone_Index]
                  • Set Clone_Ready[Clone_Loop] = Clone_Ready[Clone_Index]
                  • Set Clone_Duration_Timer[Clone_Loop] = Clone_Duration_Timer[Clone_Index]
                  • Set CloneGroup[Clone_Loop] = CloneGroup[Clone_Index]
                  • Custom script: set udg_CloneGroup[udg_Clone_Index] = null
                  • Set Clone_Index = (Clone_Index - 1)
                  • Set Clone_Loop = (Clone_Loop - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Clone_Index Equal to 0
                    • Then - Actions
                      • Game - Display to (All players) the text: 10
                      • Trigger - Turn off Clone Loop <gen>
                    • Else - Actions
                • Else - Actions
            • Else - Actions
          • Custom script: call RemoveLocation (udg_Clone_TempPoint[0])
          • Custom script: call RemoveLocation (udg_Clone_TempPoint[1])
  • Clone Damage
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • For each (Integer Clone_Loop) from 1 to Clone_Index, do (Actions)
        • Loop - Actions
          • Trigger - Turn off (This trigger)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DamageEventTarget is in CloneGroup[Clone_Loop]) Equal to True
            • Then - Actions
              • Unit Group - Pick every unit in CloneGroup[Clone_Loop] and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to DamageEventTarget
                    • Then - Actions
                      • Unit - Cause DamageEventSource to damage (Picked unit), dealing (DamageEventAmount x Clone_Damage_Percent[Clone_LevelOfAbility[Clone_Loop]]) damage of attack type Spells and damage type Spirit Link
                    • Else - Actions
              • Unit - Cause DamageEventSource to damage Clone_Caster[Clone_Loop], dealing (DamageEventAmount x Clone_Damage_Percent[Clone_LevelOfAbility[Clone_Loop]]) damage of attack type Spells and damage type Spirit Link
            • Else - Actions
          • Trigger - Turn on (This trigger)
 

Attachments

  • Clone Ability.w3x
    41.4 KB · Views: 48
Last edited:
Level 12
Joined
Jan 13, 2008
Messages
559
This is my version, I thought I'd give clones a try and using a DDS for the first time. MUI & no apparent bugs. It requires Bribe's DDS, you should also remove all the messages I put in the spell if you decide to use it.
  • Clone Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- The index is the level of the ability. --------
      • -------- For example, Clone_Counter[1] is the amount of clones at level one. --------
      • -------- The Abilities used. --------
      • Set Clone_Ability_Main = Mirror Image
      • Set Clone_Ability_Ensnare = Clone Ensnare
      • -------- Speed of which the Clones fly back into the Caster. --------
      • Set Clone_Speed = 20.00
      • -------- Amount Of Clones --------
      • -------- NOT CONFIGUIRABLE HERE: These must match the amount of clones in the spell in object editor. To configuire the amount of clones, change it in object editor and make the amount match these variables. --------
      • Set Clone_Counter[1] = 1
      • Set Clone_Counter[2] = 2
      • Set Clone_Counter[3] = 3
      • -------- Duration --------
      • -------- NOT CONFIGUIRABLE HERE: These must match the duration of the spell in object editor. To configuire the duration, change the duration in object editor and make the durations match these variables. --------
      • Set Clone_Config_Duration[1] = 10.00
      • Set Clone_Config_Duration[2] = 10.00
      • Set Clone_Config_Duration[3] = 10.00
      • -------- Damage Spread Percentage --------
      • Set Clone_Damage_Percent[1] = 1.00
      • Set Clone_Damage_Percent[2] = 0.70
      • Set Clone_Damage_Percent[3] = 0.50
  • Clone Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Clone_Ability_Main
    • Actions
      • For each (Integer Clone_Loop) from 1 to Clone_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Casting unit) Equal to Clone_Caster[Clone_Loop]
            • Then - Actions
              • Set Clone_Caster[Clone_Loop] = Clone_Caster[Clone_Index]
              • Set Clone_LevelOfAbility[Clone_Loop] = Clone_LevelOfAbility[Clone_Index]
              • Set Clone_Ready[Clone_Loop] = Clone_Ready[Clone_Index]
              • Set Clone_Duration_Timer[Clone_Loop] = Clone_Duration_Timer[Clone_Index]
              • Set CloneGroup[Clone_Loop] = CloneGroup[Clone_Index]
              • Custom script: call DestroyGroup (udg_CloneGroup[udg_Clone_Index])
              • Custom script: set udg_CloneGroup[udg_Clone_Index] = null
              • Set Clone_Index = (Clone_Index - 1)
              • Set Clone_Loop = (Clone_Loop - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Clone_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off Clone Loop <gen>
                • Else - Actions
            • Else - Actions
      • Set Clone_Index = (Clone_Index + 1)
      • Game - Display to (All players) the text: 1
      • Set Clone_Caster[Clone_Index] = (Casting unit)
      • Game - Display to (All players) the text: 2
      • Set Clone_LevelOfAbility[Clone_Index] = (Level of Clone_Ability_Main for Clone_Caster[Clone_Index])
      • Game - Display to (All players) the text: 3
      • Set Clone_Ready[Clone_Index] = False
      • Game - Display to (All players) the text: 4
      • Set Clone_Duration_Timer[Clone_Index] = Clone_Config_Duration[Clone_LevelOfAbility[Clone_Index]]
      • Game - Display to (All players) the text: 5
      • Custom script: if udg_CloneGroup[udg_Clone_Index] == null then
      • Custom script: set udg_CloneGroup[udg_Clone_Index] = CreateGroup()
      • Custom script: endif
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Clone_Index Equal to 1
        • Then - Actions
          • Game - Display to (All players) the text: 6
          • Trigger - Turn on Clone Loop <gen>
        • Else - Actions
  • Clone Spawn
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
    • Actions
      • For each (Integer Clone_Loop) from 1 to Clone_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Summoning unit) Equal to Clone_Caster[Clone_Loop]
              • (Unit-type of (Summoned unit)) Equal to (Unit-type of (Summoning unit))
            • Then - Actions
              • Unit Group - Add (Summoned unit) to CloneGroup[Clone_Loop]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Clone_Ready[Clone_Loop] Equal to False
                  • (Number of units in CloneGroup[Clone_Loop]) Equal to Clone_Counter[Clone_LevelOfAbility[Clone_Loop]]
                • Then - Actions
                  • Set Clone_Ready[Clone_Loop] = True
                  • Game - Display to (All players) the text: 7
                  • Game - Display to (All players) the text: (String((Number of units in CloneGroup[Clone_Loop])))
                • Else - Actions
            • Else - Actions
  • Clone Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Clone_Loop) from 1 to Clone_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Clone_Ready[Clone_Loop] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Clone_Duration_Timer[Clone_Loop] Less than or equal to 0.50
                • Then - Actions
                  • Unit Group - Pick every unit in CloneGroup[Clone_Loop] and do (Actions)
                    • Loop - Actions
                      • Set Clone_TempUnit = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Clone_TempUnit is alive) Equal to True
                          • (Clone_TempUnit is paused) Equal to True
                        • Then - Actions
                          • Game - Display to (All players) the text: 9
                          • Set Clone_TempPoint[0] = (Position of Clone_Caster[Clone_Loop])
                          • Set Clone_TempPoint[1] = (Position of Clone_TempUnit)
                          • Unit - Move Clone_TempUnit instantly to (Clone_TempPoint[1] offset by Clone_Speed towards (Angle from Clone_TempPoint[1] to Clone_TempPoint[0]) degrees)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Distance between Clone_TempPoint[0] and Clone_TempPoint[1]) Less than or equal to 10.00
                            • Then - Actions
                              • Unit - Kill Clone_TempUnit
                            • Else - Actions
                        • Else - Actions
                          • Unit - Pause the expiration timer for Clone_TempUnit
                          • Unit - Pause Clone_TempUnit
                          • Unit - Turn collision for Clone_TempUnit Off
                          • Custom script: call UnitAddAbility(udg_Clone_TempUnit, 'Aloc')
                • Else - Actions
                  • Set Clone_Duration_Timer[Clone_Loop] = (Clone_Duration_Timer[Clone_Loop] - 0.03)
                  • Game - Display to (All players) the text: (String(Clone_Duration_Timer[Clone_Loop]))
                  • Game - Display to (All players) the text: 8
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (All units of CloneGroup[Clone_Loop] are dead) Equal to True
                      • (Clone_Caster[Clone_Loop] is dead) Equal to True
                • Then - Actions
                  • Unit - Create 1 Dummy for (Owner of Clone_Caster[Clone_Loop]) at Clone_TempPoint[0] facing Default building facing degrees
                  • Unit - Add a 0.50 second Water Elemental expiration timer to (Last created unit)
                  • Unit - Add Clone_Ability_Ensnare to (Last created unit)
                  • Unit - Set level of Clone_Ability_Ensnare for (Last created unit) to Clone_LevelOfAbility[Clone_Loop]
                  • Unit - Order (Last created unit) to Orc Raider - Ensnare Clone_Caster[Clone_Loop]
                  • Custom script: call DestroyGroup (udg_CloneGroup[udg_Clone_Loop])
                  • Set Clone_Caster[Clone_Loop] = Clone_Caster[Clone_Index]
                  • Set Clone_LevelOfAbility[Clone_Loop] = Clone_LevelOfAbility[Clone_Index]
                  • Set Clone_Ready[Clone_Loop] = Clone_Ready[Clone_Index]
                  • Set Clone_Duration_Timer[Clone_Loop] = Clone_Duration_Timer[Clone_Index]
                  • Set CloneGroup[Clone_Loop] = CloneGroup[Clone_Index]
                  • Custom script: set udg_CloneGroup[udg_Clone_Index] = null
                  • Set Clone_Index = (Clone_Index - 1)
                  • Set Clone_Loop = (Clone_Loop - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Clone_Index Equal to 0
                    • Then - Actions
                      • Game - Display to (All players) the text: 10
                      • Trigger - Turn off Clone Loop <gen>
                    • Else - Actions
                • Else - Actions
            • Else - Actions
          • Custom script: call RemoveLocation (udg_Clone_TempPoint[0])
          • Custom script: call RemoveLocation (udg_Clone_TempPoint[1])
  • Clone Damage
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • For each (Integer Clone_Loop) from 1 to Clone_Index, do (Actions)
        • Loop - Actions
          • Trigger - Turn off (This trigger)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DamageEventTarget is in CloneGroup[Clone_Loop]) Equal to True
            • Then - Actions
              • Unit Group - Pick every unit in CloneGroup[Clone_Loop] and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to DamageEventTarget
                    • Then - Actions
                      • Unit - Cause DamageEventSource to damage (Picked unit), dealing (DamageEventAmount x Clone_Damage_Percent[Clone_LevelOfAbility[Clone_Loop]]) damage of attack type Spells and damage type Spirit Link
                    • Else - Actions
              • Unit - Cause DamageEventSource to damage Clone_Caster[Clone_Loop], dealing (DamageEventAmount x Clone_Damage_Percent[Clone_LevelOfAbility[Clone_Loop]]) damage of attack type Spells and damage type Spirit Link
            • Else - Actions
          • Trigger - Turn on (This trigger)

Wow, that's exactly how I wanted it to be. Thank you very much :thumbs_up: A moderator would probably tell you that 5 triggers are too much for a spell but I don't mind ;) U should upload this spell to the database - dunno if ppl care tho.

It's a good spell for PVP imo :)

@kingkwong I just checked your version and it's also exactly what I asked for. Thank you :) (I think you forgot the sharing damage tho?) Thanks to both of you. Can't decide which one I should take >_>
 
Level 7
Joined
Nov 19, 2015
Messages
283
My damage share does work. Its just that the footmen only do 12-13 damage and the damage share is initially set for 20%. You can see your Hero's health go down when you get hit but the regen heals over time.

Dee-Boo's version looks good. After looking at his I remember that I forgot to add something for if the hero casting unit dies.

EDIT:
  • Unit - Move Clone_TempUnit instantly to (Clone_TempPoint[1] offset by Clone_Speed towards (Angle from Clone_TempPoint[1] to Clone_TempPoint[0]) degrees)
This leaks
 
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,657
  • Unit - Kill Clone_TempUnit
Leaks.

  • Game - Display to (All players) the text: (String(Clone_Duration_Timer[Clone_Loop]))
  • Game - Display to (All players) the text: 8
  • ...
  • Game - Display to (All players) the text: 10
[delete]

  • Unit - Add a 0.50 second Water Elemental expiration timer to (Last created unit)
Water Elemental?

  • Set Clone_TempPoint[0] = (Position of Clone_Caster[0]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[1]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[2]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[3]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[4]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[5]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[6]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[7]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[8]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[9]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[10]) (+1)
  • Custom script: call RemoveLocation (udg_Clone_TempPoint[0]) (-1)
11-1=10 leaks...
You have to remove the created location before you overwrite the variable.
"Clone_TempPoint[x]" is only a pointer to a newly created location.
Every time that you point it to something else before you remove the location pointed by the variable, you leak a location.
The same counts for all other places where you did this.
 
Level 10
Joined
Apr 4, 2010
Messages
509
  • Unit - Kill Clone_TempUnit
Leaks.
Ok, I didn't know that.

  • Unit - Add a 0.50 second Water Elemental expiration timer to (Last created unit)
Water Elemental?
I've read somewhere that using water-elemental is cleaner, someone said that Maker told them that.

  • Set Clone_TempPoint[0] = (Position of Clone_Caster[0]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[1]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[2]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[3]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[4]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[5]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[6]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[7]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[8]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[9]) (+1)
  • Set Clone_TempPoint[0] = (Position of Clone_Caster[10]) (+1)
  • Custom script: call RemoveLocation (udg_Clone_TempPoint[0]) (-1)
11-1=10 leaks...
You have to remove the created location before you overwrite the variable.
"Clone_TempPoint[x]" is only a pointer to a newly created location.
Every time that you point it to something else before you remove the location pointed by the variable, you leak a location.
The same counts for all other places where you did this.
I don't think I did that :\ I just created two temp locations and made them array so I don't have to create separate two variables.

  • Set Clone_TempPoint[0] = (Position of Clone_Caster[Clone_Loop])
  • Set Clone_TempPoint[1] = (Position of Clone_TempUnit)
  • Custom script: call RemoveLocation (udg_Clone_TempPoint[0])
  • Custom script: call RemoveLocation (udg_Clone_TempPoint[1])
So this leaks? Sorry for not understanding, I'm still learning. Thanks for helping. :)
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
I've read somewhere that using water-elemental is cleaner, someone said that Maker told them that.
The buff id only gives some text to the expiration bar, you could leave it 0 when using JASS, but as far as this goes, a generic timer would be "cleaner", but it won't matter at all.

I don't think I did that :\ I just created two temp locations and made them array so I don't have to create separate two variables.
Place the "Set TempLocation[0] = ..." in a loop, place the "call RemoveLocation(udg_TempLocation[0])" also in the same loop.
You currently leak 2 locations multiplied by "Clone_Index - 1".
You only remove the locations created by the last iteration because you didn't place it inside the loop.
 
Level 10
Joined
Apr 4, 2010
Messages
509
Place the "Set TempLocation[0] = ..." in a loop, place the "call RemoveLocation(udg_TempLocation[0])" also in the same loop.
You currently leak 2 locations multiplied by "Clone_Index - 1".
You only remove the locations created by the last iteration because you didn't place it inside the loop.

I thought it was in the loop. Is this outside of the loop?
  • Clone Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Clone_Loop) from 1 to Clone_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • Custom script: call RemoveLocation (udg_Clone_TempPoint[0])
          • Custom script: call RemoveLocation (udg_Clone_TempPoint[1])
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Sorry, you create them in "Unit Group - Pick every unit in CloneGroup[Clone_Loop] and do (Actions)" this loop, but dont remove them in that loop.
Except if you are 100% certain that that group will always have 1 unit (in which a group is useless), then you havent got that leak :D
 
Level 10
Joined
Apr 4, 2010
Messages
509
Sorry, you create them in "Unit Group - Pick every unit in CloneGroup[Clone_Loop] and do (Actions)" this loop, but dont remove them in that loop.
Except if you are 100% certain that that group will always have 1 unit (in which a group is useless), then you havent got that leak :D

Ohhh, I forgot that Groups are loops. :\ Now I get it. Thanks again.
EDIT: Here is a fixed version
  • Clone Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- The index is the level of the ability. --------
      • -------- For example, Clone_Counter[1] is the amount of clones at level one. --------
      • -------- The Abilities used. --------
      • Set Clone_Ability_Main = Mirror Image
      • Set Clone_Ability_Ensnare = Clone Ensnare
      • -------- Special Effect used when a clone flies back to the caster. --------
      • Set Clone_Config_SPFX = Abilities\Spells\Orc\FeralSpirit\feralspirittarget.mdl
      • -------- Speed of which the Clones fly back into the Caster. --------
      • Set Clone_Speed = 20.00
      • -------- Amount Of Clones --------
      • -------- NOT CONFIGUIRABLE HERE: These must match the amount of clones in the spell in object editor. To configuire the amount of clones, change it in object editor and make the amount match these variables. --------
      • Set Clone_Counter[1] = 1
      • Set Clone_Counter[2] = 2
      • Set Clone_Counter[3] = 3
      • -------- Duration --------
      • -------- NOT CONFIGUIRABLE HERE: These must match the duration of the spell in object editor. To configuire the duration, change the duration in object editor and make the durations match these variables. --------
      • Set Clone_Config_Duration[1] = 10.00
      • Set Clone_Config_Duration[2] = 10.00
      • Set Clone_Config_Duration[3] = 10.00
      • -------- Damage Spread Percentage --------
      • Set Clone_Damage_Percent[1] = 1.00
      • Set Clone_Damage_Percent[2] = 0.70
      • Set Clone_Damage_Percent[3] = 0.50
      • -------- ----------------------------------- --------
      • -------- Dummy Pre-Load --------
      • Set Clone_TempPoint[0] = (Center of (Playable map area))
      • Unit - Create 1 Dummy for Neutral Passive at Clone_TempPoint[0] facing Default building facing degrees
      • Set Clone_TempUnit = (Last created unit)
      • Unit - Add Clone_Ability_Ensnare to Clone_TempUnit
      • Unit - Remove Clone_TempUnit from the game
      • Custom script: call RemoveLocation (udg_Clone_TempPoint[0])
  • Clone Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Clone_Ability_Main
    • Actions
      • For each (Integer Clone_Loop) from 1 to Clone_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Casting unit) Equal to Clone_Caster[Clone_Loop]
            • Then - Actions
              • Set Clone_Caster[Clone_Loop] = Clone_Caster[Clone_Index]
              • Set Clone_LevelOfAbility[Clone_Loop] = Clone_LevelOfAbility[Clone_Index]
              • Set Clone_Ready[Clone_Loop] = Clone_Ready[Clone_Index]
              • Set Clone_Duration_Timer[Clone_Loop] = Clone_Duration_Timer[Clone_Index]
              • Set CloneGroup[Clone_Loop] = CloneGroup[Clone_Index]
              • Custom script: call DestroyGroup (udg_CloneGroup[udg_Clone_Index])
              • Custom script: set udg_CloneGroup[udg_Clone_Index] = null
              • Set Clone_Index = (Clone_Index - 1)
              • Set Clone_Loop = (Clone_Loop - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Clone_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off Clone Loop <gen>
                • Else - Actions
            • Else - Actions
      • Set Clone_Index = (Clone_Index + 1)
      • Set Clone_Caster[Clone_Index] = (Casting unit)
      • Set Clone_LevelOfAbility[Clone_Index] = (Level of Clone_Ability_Main for Clone_Caster[Clone_Index])
      • Set Clone_Ready[Clone_Index] = False
      • Set Clone_Duration_Timer[Clone_Index] = Clone_Config_Duration[Clone_LevelOfAbility[Clone_Index]]
      • Custom script: if udg_CloneGroup[udg_Clone_Index] == null then
      • Custom script: set udg_CloneGroup[udg_Clone_Index] = CreateGroup()
      • Custom script: endif
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Clone_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on Clone Loop <gen>
        • Else - Actions
  • Clone Spawn
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
    • Actions
      • For each (Integer Clone_Loop) from 1 to Clone_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Summoning unit) Equal to Clone_Caster[Clone_Loop]
              • (Unit-type of (Summoned unit)) Equal to (Unit-type of (Summoning unit))
            • Then - Actions
              • Unit Group - Add (Summoned unit) to CloneGroup[Clone_Loop]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Clone_Ready[Clone_Loop] Equal to False
                  • (Number of units in CloneGroup[Clone_Loop]) Equal to Clone_Counter[Clone_LevelOfAbility[Clone_Loop]]
                • Then - Actions
                  • Set Clone_Ready[Clone_Loop] = True
                • Else - Actions
            • Else - Actions
  • Clone Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Clone_Loop) from 1 to Clone_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Clone_Ready[Clone_Loop] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Clone_Duration_Timer[Clone_Loop] Less than or equal to 0.50
                • Then - Actions
                  • Unit Group - Pick every unit in CloneGroup[Clone_Loop] and do (Actions)
                    • Loop - Actions
                      • Set Clone_TempUnit = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Clone_TempUnit is alive) Equal to True
                          • (Clone_TempUnit is paused) Equal to True
                        • Then - Actions
                          • Set Clone_TempPoint[0] = (Position of Clone_Caster[Clone_Loop])
                          • Set Clone_TempPoint[1] = (Position of Clone_TempUnit)
                          • Set Clone_TempAngle = (Angle from Clone_TempPoint[1] to Clone_TempPoint[0])
                          • Unit - Move Clone_TempUnit instantly to (Clone_TempPoint[1] offset by Clone_Speed towards Clone_TempAngle degrees)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Distance between Clone_TempPoint[0] and Clone_TempPoint[1]) Less than or equal to 10.00
                            • Then - Actions
                              • Special Effect - Create a special effect at Clone_TempPoint[1] using Clone_Config_SPFX
                              • Special Effect - Destroy (Last created special effect)
                              • Unit Group - Remove Clone_TempUnit from CloneGroup[Clone_Loop]
                              • Unit - Remove Clone_TempUnit from the game
                            • Else - Actions
                          • Custom script: call RemoveLocation (udg_Clone_TempPoint[0])
                          • Custom script: call RemoveLocation (udg_Clone_TempPoint[1])
                        • Else - Actions
                          • Unit - Pause the expiration timer for Clone_TempUnit
                          • Unit - Pause Clone_TempUnit
                          • Unit - Turn collision for Clone_TempUnit Off
                          • Custom script: call UnitAddAbility(udg_Clone_TempUnit, 'Aloc')
                • Else - Actions
                  • Set Clone_Duration_Timer[Clone_Loop] = (Clone_Duration_Timer[Clone_Loop] - 0.03)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (All units of CloneGroup[Clone_Loop] are dead) Equal to True
                      • (CloneGroup[Clone_Loop] is empty) Equal to True
                      • (Clone_Caster[Clone_Loop] is dead) Equal to True
                • Then - Actions
                  • Set Clone_TempPoint[2] = (Position of Clone_Caster[Clone_Loop])
                  • Unit - Create 1 Dummy for (Owner of Clone_Caster[Clone_Loop]) at Clone_TempPoint[2] facing Default building facing degrees
                  • Set Clone_TempUnit = (Last created unit)
                  • Unit - Add a 0.50 second Water Elemental expiration timer to Clone_TempUnit
                  • Unit - Add Clone_Ability_Ensnare to Clone_TempUnit
                  • Unit - Set level of Clone_Ability_Ensnare for Clone_TempUnit to Clone_LevelOfAbility[Clone_Loop]
                  • Unit - Order Clone_TempUnit to Orc Raider - Ensnare Clone_Caster[Clone_Loop]
                  • Custom script: call DestroyGroup (udg_CloneGroup[udg_Clone_Loop])
                  • Set Clone_Caster[Clone_Loop] = Clone_Caster[Clone_Index]
                  • Set Clone_LevelOfAbility[Clone_Loop] = Clone_LevelOfAbility[Clone_Index]
                  • Set Clone_Ready[Clone_Loop] = Clone_Ready[Clone_Index]
                  • Set Clone_Duration_Timer[Clone_Loop] = Clone_Duration_Timer[Clone_Index]
                  • Set CloneGroup[Clone_Loop] = CloneGroup[Clone_Index]
                  • Custom script: set udg_CloneGroup[udg_Clone_Index] = null
                  • Set Clone_Index = (Clone_Index - 1)
                  • Set Clone_Loop = (Clone_Loop - 1)
                  • Custom script: call RemoveLocation (udg_Clone_TempPoint[2])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Clone_Index Equal to 0
                    • Then - Actions
                      • Trigger - Turn off Clone Loop <gen>
                    • Else - Actions
                • Else - Actions
            • Else - Actions
  • Clone Damage
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • For each (Integer Clone_Loop) from 1 to Clone_Index, do (Actions)
        • Loop - Actions
          • Trigger - Turn off (This trigger)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DamageEventTarget is in CloneGroup[Clone_Loop]) Equal to True
            • Then - Actions
              • Unit Group - Pick every unit in CloneGroup[Clone_Loop] and do (Actions)
                • Loop - Actions
                  • Set Clone_TempUnit = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Clone_TempUnit Not equal to DamageEventTarget
                    • Then - Actions
                      • Unit - Cause DamageEventSource to damage Clone_TempUnit, dealing (DamageEventAmount x Clone_Damage_Percent[Clone_LevelOfAbility[Clone_Loop]]) damage of attack type Spells and damage type Spirit Link
                    • Else - Actions
              • Unit - Cause DamageEventSource to damage Clone_Caster[Clone_Loop], dealing (DamageEventAmount x Clone_Damage_Percent[Clone_LevelOfAbility[Clone_Loop]]) damage of attack type Spells and damage type Spirit Link
            • Else - Actions
          • Trigger - Turn on (This trigger)
 

Attachments

  • Clone Ability.w3x
    42 KB · Views: 47
Last edited:
Status
Not open for further replies.
Top