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

Duplication Spell Gone Awry

Status
Not open for further replies.
Level 15
Joined
Sep 3, 2006
Messages
1,738
Okay, I know you'll all be like "Use a dummy caster and make an illusion blah blah blah" but this way is much nicer and cleaner and works a ton better.

Basically, I'm making a spell like Juxtapose, but instead of it being every time you attack, it's every time you're attacked. Then after it creates the copy, it moves it to the unit who attacked you and it will attack that unit. I can do this all just fine and easy, but when it comes to removing it...If it spawns 2 at the same time, they won't remove. Here's what I got:

  • Moonlight
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) has buff Moonlight) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Moonlight (C) for (Attacked unit)) Equal to 1
          • (Random integer number between 1 and 100) Equal to 5
        • Then - Actions
          • Special Effect - Create a special effect at (Position of (Attacked unit)) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
          • Unit - Create 1 Klypto Dummy for (Owner of (Attacked unit)) at (Position of (Attacking unit)) facing Default building facing degrees
          • Animation - Play (Last created unit)'s attack animation
          • Unit - Cause (Last created unit) to damage (Attacking unit), dealing 50.00 damage of attack type Chaos and damage type Normal
          • Wait 1.00 game-time seconds
          • Unit - Remove (Last created unit) from the game
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Moonlight (C) for (Attacked unit)) Equal to 2
          • (Random integer number between 1 and 50) Equal to 5
        • Then - Actions
          • Special Effect - Create a special effect at (Position of (Attacked unit)) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
          • Unit - Create 1 Klypto Dummy for (Owner of (Attacked unit)) at (Position of (Attacking unit)) facing Default building facing degrees
          • Animation - Play (Last created unit)'s attack animation
          • Unit - Cause (Last created unit) to damage (Attacking unit), dealing 100.00 damage of attack type Chaos and damage type Normal
          • Wait 1.00 game-time seconds
          • Unit - Remove (Last created unit) from the game
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Moonlight (C) for (Attacked unit)) Equal to 3
          • (Random integer number between 1 and 25) Equal to 5
        • Then - Actions
          • Special Effect - Create a special effect at (Position of (Attacked unit)) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
          • Unit - Create 1 Klypto Dummy for (Owner of (Attacked unit)) at (Position of (Attacking unit)) facing Default building facing degrees
          • Animation - Play (Last created unit)'s attack animation
          • Unit - Cause (Last created unit) to damage (Attacking unit), dealing 150.00 damage of attack type Chaos and damage type Normal
          • Wait 1.00 game-time seconds
          • Unit - Remove (Last created unit) from the game
        • Else - Actions
          • Do nothing
 
Level 21
Joined
Aug 9, 2006
Messages
2,384
Easy 2 change. Use this function:

  • Unit - Add a 1.00 second Standard expiration timer to (Last Created Unit)
instead of

  • Wait 1.00 game-time seconds
  • Unit - Remove (Last created unit) from the game
Because after a wait the temporary Variable called: "Last created unit" is deleted, and cannot be used(its ever like this for those types of variables which are directly implemented by blizzard), you could store the last created unit in a var and use it then, but if you take my thing you only need to remove the 1 second wait and the remove unit function and add the expiration timer thing, and don't worry, when the timer expires the unit is completely removed.
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Spell-related matters go on the Spells and Systems forum.
[self="http://www.hiveworkshop.com/forums/forumdisplay.php?f=309"]
spellsandsystems.gif
»»» Spells and Systems
[/self]
Talk regarding custom created spells and systems takes place in here. Get help creating a spell or implementing a system etc.
Do NOT request for help or talk about spell-creation in the World Editor Help Zone. Spell-matters go on the Spells and Systems, which has it's link above.
~Thread Moved
 
Status
Not open for further replies.
Top