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

Converting this spell to MUI

Status
Not open for further replies.
Level 2
Joined
Mar 8, 2011
Messages
9
Hello all, I'm trying to convert a custom spell I made (with your help :D) some time ago to MUI, I've been unsucessful so far, so I thought I could use some help :p

I will explain what the spell does to prevent confusion since it does currently contains 11 triggers. Object data-wise, it uses Storm Bolt as base.

Main unit casts the spell creating a set of "illusions" around the target, the illusions circle around the target and there's 2/3/4 illusions depending on the skill level, they are equally distant from each other. Every 1.5 seconds the distance between the illusions and the target closes a little and the real hero is hidden for the 15 seconds the spell lasts.
One of the illusions is marked as the "right illusion", damage then occurs in one of these ways:
a) The right illusion is attacked.
b) A wrong illusion is attacked.
c) The 15 seconds expire and no illusion has been attacked.
The illusions may be attacked by any enemy, hero or not, being the target or not.
After damage the hero is unhidden.

So... this is what I have so far.

Main trigger, this one starts all other triggers, it sets the caster, target and will reset the variable which holds the original illusion-target distance.
Also creates the illusions, adds them to a group, starts a timer and hides the main unit:
  • Hallofstonemirrors
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Hall of Stone Mirrors
    • Actions
      • Countdown Timer - Start TimerHallStone as a One-shot timer that will expire in 15.00 seconds
      • Set TargetHallStone = (Target unit of ability being cast)
      • Set HeroHallStone = (Triggering unit)
      • Set OffsetHallStone = 250.00
      • Unit - Hide HeroHallStone
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Hall of Stone Mirrors for (Triggering unit)) Equal to 3
        • Then - Actions
          • Unit - Create 1 (illusion) for (Owner of (Triggering unit)) at ((Position of TargetHallStone) offset by 250.00 towards 0.00 degrees) facing (Position of TargetHallStone)
          • Set Ilu1 = (Last created unit)
          • Unit Group - Add Ilu1 to GroupHallStone
          • Unit - Create 1 (illusion) for (Owner of (Triggering unit)) at ((Position of TargetHallStone) offset by 250.00 towards 90.00 degrees) facing (Position of TargetHallStone)
          • Set Ilu2 = (Last created unit)
          • Unit Group - Add Ilu2 to GroupHallStone
          • Unit - Create 1 (illusion) for (Owner of (Triggering unit)) at ((Position of TargetHallStone) offset by 250.00 towards 180.00 degrees) facing (Position of TargetHallStone)
          • Set Ilu3 = (Last created unit)
          • Unit Group - Add Ilu3 to GroupHallStone
          • Unit - Create 1 (illusion) for (Owner of (Triggering unit)) at ((Position of TargetHallStone) offset by 250.00 towards 270.00 degrees) facing (Position of TargetHallStone)
          • Set Ilu4 = (Last created unit)
          • Unit Group - Add Ilu4 to GroupHallStone
          • Trigger - Turn on Hallmovement3 <gen>
          • Trigger - Turn on Halldamage3 <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Hall of Stone Mirrors for (Triggering unit)) Equal to 2
        • Then - Actions
          • Unit - Create 1 (illusion) for (Owner of (Triggering unit)) at ((Position of TargetHallStone) offset by 250.00 towards 0.00 degrees) facing (Position of TargetHallStone)
          • Set Ilu1 = (Last created unit)
          • Unit Group - Add Ilu1 to GroupHallStone
          • Unit - Create 1 (illusion) for (Owner of (Triggering unit)) at ((Position of TargetHallStone) offset by 250.00 towards 120.00 degrees) facing (Position of TargetHallStone)
          • Set Ilu2 = (Last created unit)
          • Unit Group - Add Ilu2 to GroupHallStone
          • Unit - Create 1 (illusion) for (Owner of (Triggering unit)) at ((Position of TargetHallStone) offset by 250.00 towards 240.00 degrees) facing (Position of TargetHallStone)
          • Set Ilu3 = (Last created unit)
          • Unit Group - Add Ilu3 to GroupHallStone
          • Trigger - Turn on Hallmovement2 <gen>
          • Trigger - Turn on Halldamage2 <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Hall of Stone Mirrors for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Create 1 (illusion) for (Owner of (Triggering unit)) at ((Position of TargetHallStone) offset by 250.00 towards 0.00 degrees) facing (Position of TargetHallStone)
          • Set Ilu1 = (Last created unit)
          • Unit Group - Add Ilu1 to GroupHallStone
          • Unit - Create 1 (illusion) for (Owner of (Triggering unit)) at ((Position of TargetHallStone) offset by 250.00 towards 180.00 degrees) facing (Position of TargetHallStone)
          • Set Ilu2 = (Last created unit)
          • Unit Group - Add Ilu2 to GroupHallStone
          • Trigger - Turn on Hallmovement1 <gen>
          • Trigger - Turn on Halldamage1 <gen>
        • Else - Actions
      • Set RandomHallStone = (Random unit from GroupHallStone)
      • Unit Group - Pick every unit in GroupHallStone and do (Actions)
        • Loop - Actions
          • Unit - Turn collision for (Picked unit) Off
          • Unit - Set (Picked unit) movement speed to 0.00
          • Animation - Change (Picked unit) turn speed to 0.00
          • Unit - Make (Picked unit) Explode on death
      • Trigger - Turn on Halltimer <gen>
      • Trigger - Turn on Hallclose <gen>
The timer, if it expires it will damage the target, also prints the damage:
  • Halltimer
    • Events
      • Time - TimerHallStone expires
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Hall of Stone Mirrors for HeroHallStone) Equal to 1
        • Then - Actions
          • Floating Text - Create floating text that reads 900! above TargetHallStone with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 100.00%), and 0.00% transparency
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
          • Unit - Cause RandomHallStone to damage TargetHallStone, dealing 900.00 damage of attack type Chaos and damage type Normal
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Hall of Stone Mirrors for HeroHallStone) Equal to 2
        • Then - Actions
          • Floating Text - Create floating text that reads 1800! above TargetHallStone with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 100.00%), and 0.00% transparency
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
          • Unit - Cause RandomHallStone to damage TargetHallStone, dealing 1800.00 damage of attack type Chaos and damage type Normal
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Hall of Stone Mirrors for HeroHallStone) Equal to 3
        • Then - Actions
          • Floating Text - Create floating text that reads 2700! above TargetHallStone with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 100.00%), and 0.00% transparency
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
          • Unit - Cause RandomHallStone to damage TargetHallStone, dealing 2700.00 damage of attack type Chaos and damage type Normal
        • Else - Actions
      • Unit Group - Pick every unit in GroupHallStone and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Unit - Unhide HeroHallStone
      • Trigger - Turn off Hallmovement3 <gen>
      • Trigger - Turn off Hallmovement2 <gen>
      • Trigger - Turn off Hallmovement1 <gen>
      • Trigger - Turn off Hallclose <gen>
      • Trigger - Turn off Halldamage1 <gen>
      • Trigger - Turn off Halltimer <gen>
This one closes the gap between the illusions and the target:
  • Hallclose
    • Events
      • Time - Every 1.50 seconds of game time
    • Conditions
    • Actions
      • Set OffsetHallStone = (OffsetHallStone - 25.00)
Then comes the 3 triggers for illusion movement, I will post only one for level 3 so to(try to) not make a giant post(yeah I know about the 0.01, but I kinda sense a difference if I put a slower value), the other 2 triggers DO contain more Angle and Location variables:
  • Hallmovement3
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set Angle1lvl3 = (Angle1lvl3 + 1.00)
      • Set Angle2lvl3 = (Angle2lvl3 + 1.00)
      • Set Angle3lvl3 = (Angle3lvl3 + 1.00)
      • Set Angle4lvl3 = (Angle4lvl3 + 1.00)
      • Set LocTargetHallStone = (Position of TargetHallStone)
      • Set Loc1lvl3 = (LocTargetHallStone offset by OffsetHallStone towards Angle1lvl3 degrees)
      • Set Loc2lvl3 = (LocTargetHallStone offset by OffsetHallStone towards Angle2lvl3 degrees)
      • Set Loc3lvl3 = (LocTargetHallStone offset by OffsetHallStone towards Angle3lvl3 degrees)
      • Set Loc4lvl3 = (LocTargetHallStone offset by OffsetHallStone towards Angle4lvl3 degrees)
      • Unit - Move Ilu1 instantly to Loc1lvl3, facing LocTargetHallStone
      • Unit - Move Ilu2 instantly to Loc2lvl3, facing LocTargetHallStone
      • Unit - Move Ilu3 instantly to Loc3lvl3, facing LocTargetHallStone
      • Unit - Move Ilu4 instantly to Loc4lvl3, facing LocTargetHallStone
      • Custom script: call RemoveLocation(udg_LocTargetHallStone)
      • Custom script: call RemoveLocation(udg_Loc1lvl3)
      • Custom script: call RemoveLocation(udg_Loc2lvl3)
      • Custom script: call RemoveLocation(udg_Loc3lvl3)
      • Custom script: call RemoveLocation(udg_Loc4lvl3)
Finally there's the damage trigger, like the movement triggers, there's one for each level of the spell, I will post level 3 only:
  • Halldamage3
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacked unit)) Equal to (illusion)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Attacked unit) Equal to RandomHallStone
        • Then - Actions
          • Unit - Cause (Attacked unit) to damage TargetHallStone, dealing 450.00 damage of attack type Spells and damage type Normal
          • Floating Text - Create floating text that reads 450! above TargetHallStone with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
        • Else - Actions
          • Unit - Cause (Attacked unit) to damage TargetHallStone, dealing 900.00 damage of attack type Spells and damage type Normal
          • Floating Text - Create floating text that reads 900! above TargetHallStone with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
      • Unit Group - Pick every unit in GroupHallStone and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Unit - Unhide HeroHallStone
      • Trigger - Turn off Halltimer <gen>
      • Trigger - Turn off Hallmovement3 <gen>
      • Trigger - Turn off Hallclose <gen>
      • Trigger - Turn off Halldamage3 <gen>
So that would be it, also I suppose I need to add a call for DestroyGroup(udg_GroupHallStone) in everywhere damage to target occurs, is that correct?

Thanks for your time and help.

Edit: Btw I posted here because it is not mal-functioning, I just want to improve it. :)
 
Status
Not open for further replies.
Top