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

Zephyr Competition #8 - Illusion

Status
Not open for further replies.
Level 11
Joined
Jun 28, 2011
Messages
540
WIP, documented.

I need to re-trigger this into custom script.



Ingame Description:

The caster opens a portal to purgatory. Several ghosts will begin to wander about while the caster becomes invisible. As long as the ghosts remain alive and the caster stays within the portal, the caster will remain invisible.

Level 1 - Ghosts have 300 health and the portal will have an area of 800.

Level 2 - Ghosts have 400 health and the portal will have an area of 1000.

Level 3 - Ghosts have 500 health and the portal will have an area of 1200.

  • GhostField
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- REQUIRED --------
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Disable GhostSpells (Invisibility, Magic Immune, True Sight, Regen) for (Picked player)
      • Custom script: set udg_GhostHash = InitHashtable()
      • -------- --------
      • -------- --------
      • -------- NOTES --------
      • -------- This spell cannot be pre-leveled from the World Editor. (Select Unit -> Abilities -> Level) --------
      • -------- Yes, this spell does require four triggers. I cannot reduce it further without sacrificing efficiency. --------
      • -------- This spell was not made into vJASS or JASS due to two main reasons: --------
      • -------- JASS/vJASS is obnoxious to debug and GUI is more accepted by mapmakers, as its easier to use and simpler. --------
      • -------- If the hero has an abnormally high regeneration rate, this spell pretty much gives permanent invisibility. I tested it with melee heroes, not DotA heroes. --------
      • -------- --------
      • -------- Here is a list of abilities and units that either counter or reinforce the ability. --------
      • -------- --------
      • -------- --------
      • -------- // --------
      • -------- WEAKNESSES --------
      • -------- // --------
      • -------- --------
      • -------- Direct Counters: --------
      • -------- Starfall, Stampede, Locust --------
      • -------- --------
      • -------- Moderate Counters: --------
      • -------- Chain Lightning, Forked Lightning --------
      • -------- --------
      • -------- Slight Counters: --------
      • -------- Far Sight, Frost Nova, Storm Bolt, Death Coil, Firebolt, Death and Decay, Earthquake, Volcano --------
      • -------- --------
      • -------- Units: Shade, Troll Witch Doctor, Huntress, Flying Machines --------
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- // --------
      • -------- STRENGTHS --------
      • -------- // --------
      • -------- --------
      • -------- Direct Strengths: --------
      • -------- Big Bad Voodoo, Tranquility, Life Regeneration Aura, Healing Wards --------
      • -------- --------
      • -------- Moderate Strengths: --------
      • -------- Healing Wave, Lightning Shield, Healing Spray, Rejuvenation --------
      • -------- --------
      • -------- Slight Strengths: --------
      • -------- Invisibility, Cloud, Blink, Thorns Aura, Taunt, Cyclone --------
      • -------- --------
      • -------- Units: Healers, Siege Weapons, Ranged Units --------
      • -------- --------
      • -------- CONFIGURABLES --------
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- Dummy Unit Effect Type --------
      • Set Ghost_CONFIG_EffectUnitType = Ghost Field Effect
      • -------- --------
      • -------- --------
      • -------- Dummy Unit Ghosts (Visible Dummies) --------
      • -------- --------
      • -------- Level 1 --------
      • Set Ghost_CONFIG_DummyUnitA = Ghost (Level 1, Dummy Unit)
      • -------- Level 2 --------
      • Set Ghost_CONFIG_DummyUnitB = Ghost (Level 2, Dummy Unit)
      • -------- Level 3 --------
      • Set Ghost_CONFIG_DummyUnitC = Ghost (Level 3, Dummy Unit)
      • -------- --------
      • -------- --------
      • -------- Dummy Unit 'Portal' Effect --------
      • Set Ghost_CONFIG_EffectUnitTypeB = Ghost Field 'Portal' Effect
      • -------- --------
      • -------- --------
      • -------- Area of Effect = Ghost_CONFIG_AoE_Mult * LEVEL + Ghost_CONFIG_AoE_Base --------
      • -------- --------
      • -------- Area of Effect constant value. This value does not change with each level. (Preset: 600) --------
      • Set Ghost_CONFIG_AoE_Base = 600.00
      • -------- --------
      • -------- --------
      • -------- Area of Effect dependent value. This value it multiplied with each level and added to the constant value. (Preset: 200) --------
      • Set Ghost_CONFIG_AoE_Mult = 200.00
      • -------- --------
      • -------- --------
      • -------- The minimum that the effects will swirl into. (Preset: 600) --------
      • -------- This value is constant. --------
      • Set Ghost_CONFIG_DummyMinSwirl = 600.00
      • -------- --------
      • -------- --------
      • -------- The minimum that the effects will swirl into multiplier check. (Preset: 200) --------
      • -------- This is multiplied with every level. --------
      • Set Ghost_CONFIG_MinSwirlMult = 200.00
      • -------- --------
      • -------- --------
      • -------- The speed that the effects swirl in/out of. (Preset: 1) --------
      • Set Ghost_CONFIG_SwirlInSpeed = 1.00
      • -------- --------
      • -------- --------
      • -------- The speed that the ghosts swirl around the effects. (Preset: 1.1) --------
      • Set Ghost_CONFIG_GhostSwirlSpeed = 1.10
      • -------- --------
      • -------- --------
      • -------- The speed that the effects move. (Preset: .8) --------
      • Set Ghost_CONFIG_EffectSpeed = 0.80
      • -------- --------
      • -------- --------
      • -------- The rate that the lightning changes colors. (Preset: .01) --------
      • Set Ghost_CONFIG_LightningColorUp = 0.01
      • -------- --------
      • -------- --------
      • -------- The most radiant the lightning may become. (Preset: .8) --------
      • -------- This number is out of 1.00. --------
      • Set Ghost_CONFIG_LightningColorMax = 0.80
      • -------- --------
      • -------- --------
      • -------- How dull the lightning may become. (Preset: .4) --------
      • -------- This number is out of 1.00. --------
      • Set Ghost_CONFIG_LightningColorMin = 0.40
      • -------- --------
      • -------- --------
      • -------- Special Effect created when the spell is done. (Preset Abilities\Spells\NightElf\Blink\BlinkCaster.mdl) --------
      • Set Ghost_CONFIG_DispelEffect = Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • Custom script: call Preload(udg_Ghost_CONFIG_DispelEffect)
      • -------- --------
      • -------- --------
      • -------- First special effect created when the spell is canceled. (Preset Objects\Spawnmodels\Undead\UCancelDeath\UCancelDeath.mdl) --------
      • Set Ghost_CONFIG_CancelEffectA = Objects\Spawnmodels\Undead\UCancelDeath\UCancelDeath.mdl
      • Custom script: call Preload(udg_Ghost_CONFIG_CancelEffectA)
      • -------- --------
      • -------- --------
      • -------- Second special effect created when the spell is canceled. (Preset Units\NightElf\Wisp\WispExplode.mdl) --------
      • Set Ghost_CONFIG_CancelEffectB = Units\NightElf\Wisp\WispExplode.mdl
      • Custom script: call Preload(udg_Ghost_CONFIG_CancelEffectB)
      • -------- --------
      • -------- --------
      • -------- Area of Effect constant number. (Preset 0) --------
      • -------- This is caused when dummy units die. --------
      • Set Ghost_CONFIG_DamageAoEC = 0.00
      • -------- --------
      • -------- --------
      • -------- Area of Effect multiplier (Preset 0) --------
      • -------- This multiplies with each level. --------
      • Set Ghost_CONFIG_DamageAoEM = 0.00
      • -------- --------
      • -------- --------
      • -------- Area of Effect damage constant number. (Preset 0) --------
      • -------- This is caused when dummy units die. --------
      • Set Ghost_CONFIG_DamageC = 0.00
      • -------- --------
      • -------- --------
      • -------- Area of Effect damage multiplier. (Preset 0) --------
      • -------- This multiplies with each level. --------
      • Set Ghost_CONFIG_DamageM = 0.00
      • -------- --------
      • -------- --------
      • -------- Damage special effect. (Preset <Empty String>) --------
      • Set Ghost_CONFIG_DispelEffect = <Empty String>
      • Custom script: call Preload(udg_Ghost_CONFIG_DispelEffect)
      • -------- --------
      • -------- --------
      • -------- Bonus Mana Regeneration when inside the field (Preset .01) --------
      • -------- This value is added every loop and multiplies with each level. --------
      • Set Ghost_CONFIG_REGEN = 0.01
      • -------- --------
      • -------- --------
      • -------- Bonus range that allows the caster to move outside of the field before taking major negative effects. (Preset 550) --------
      • Set Ghost_CONFIG_BonusRange = 550.00
  • GhostSetUp
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Ghost Field (Dummy Learning Ability / Hero)
    • Actions
      • Set GhostUnit = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Ghost Field (Dummy Learning Ability / Hero) for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Add Ghost Field (Real Ability / Non-Hero) to GhostUnit
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Decimate Portal (Turn Off) for GhostUnit) Greater than 0
            • Then - Actions
              • Unit - Increase level of Decimate Portal (Turn Off) for GhostUnit
            • Else - Actions
              • Unit - Increase level of Ghost Field (Real Ability / Non-Hero) for GhostUnit
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- This adds the fake ability to the unit. --------
      • -------- This will scale regardless of the ability's maximum level and should not have to be updated. --------
      • -------- The spell's area of effect and ghost health will not be updated. However, the 'Decimate Portal' mana regain will be increased. --------
  • GhostCast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Decimate Portal (Turn Off)
          • (Ability being cast) Equal to Ghost Field (Real Ability / Non-Hero)
    • Actions
      • Set GhostUnit = (Triggering unit)
      • Custom script: set udg_Ghost_Handle = GetHandleId(udg_GhostUnit)
      • Set GP1 = (Position of GhostUnit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Ghost Field (Real Ability / Non-Hero)
        • Then - Actions
          • Set GhostPlayer = (Triggering player)
          • Set GhostLevelInteger = (Level of Ghost Field (Real Ability / Non-Hero) for GhostUnit)
          • Set GhostReal = (Facing of GhostUnit)
          • -------- ============ --------
          • -------- ============ --------
          • -------- Remove/Add Abilities --------
          • Unit - Remove Ghost Field (Real Ability / Non-Hero) from GhostUnit
          • Unit - Add Decimate Portal (Turn Off) to GhostUnit
          • Unit - Set level of Decimate Portal (Turn Off) for GhostUnit to GhostLevelInteger
          • -------- ============ --------
          • -------- ============ --------
          • -------- Hashtable shiz --------
          • -------- --------
          • -------- --------
          • -------- --------
          • -------- --------
          • -------- Hashtable values. First 1-8 reserved for dummies. --------
          • -------- --------
          • -------- --------
          • -------- This is the counter. It times all of the effects and what not. --------
          • Hashtable - Save 0 as 9 of Ghost_Handle in GhostHash
          • -------- This is the fade counter. It creates the opening effect of the missiles appearing and what not. --------
          • Hashtable - Save 100.00 as 10 of Ghost_Handle in GhostHash
          • -------- This is the area of effect value. This determines how large the portal will be. --------
          • Hashtable - Save (Ghost_CONFIG_AoE_Base + (Ghost_CONFIG_AoE_Mult x (Real(GhostLevelInteger)))) as 11 of Ghost_Handle in GhostHash
          • -------- This boolean determines if the next loop will destroy itself. --------
          • Hashtable - Save False as 12 of Ghost_Handle in GhostHash
          • -------- Point1 X/Y --------
          • Hashtable - Save (X of GP1) as 13 of Ghost_Handle in GhostHash
          • Hashtable - Save (Y of GP1) as 14 of Ghost_Handle in GhostHash
          • -------- Dummy Starting Turn Rate --------
          • Hashtable - Save Ghost_CONFIG_EffectSpeed as 15 of Ghost_Handle in GhostHash
          • -------- Dummy Min Swirl --------
          • Hashtable - Save (Ghost_CONFIG_DummyMinSwirl + (Ghost_CONFIG_MinSwirlMult x (Real(GhostLevelInteger)))) as 18 of Ghost_Handle in GhostHash
          • -------- Damage Area of Effect. Created when dummy units die. --------
          • Hashtable - Save (Ghost_CONFIG_DamageAoEC + (Ghost_CONFIG_DamageAoEM x (Real(GhostLevelInteger)))) as 43 of Ghost_Handle in GhostHash
          • -------- Damage. --------
          • Hashtable - Save (Ghost_CONFIG_DamageC + (Ghost_CONFIG_DamageM x (Real(GhostLevelInteger)))) as 44 of Ghost_Handle in GhostHash
          • -------- Regeneration Bonus (Mana) --------
          • Hashtable - Save (Ghost_CONFIG_REGEN x (Real(GhostLevelInteger))) as 45 of Ghost_Handle in GhostHash
          • -------- ============ --------
          • -------- --------
          • -------- --------
          • -------- --------
          • -------- Starz --------
          • For each (Integer GhostInteger) from 1 to 5, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Ghost Field 'Portal' Effect for GhostPlayer at GP1 facing ((Real(GhostInteger)) x 72.00) degrees
              • Set GhostUnit2 = (Last created unit)
              • Animation - Change GhostUnit2's animation speed to 150.00% of its original speed
              • Unit - Make GhostUnit2 Explode on death
              • Unit - Add a 1.60 second Generic expiration timer to GhostUnit2
              • -------- --------
              • -------- --------
          • -------- ============ --------
          • -------- ============ --------
          • -------- Add Unit to Group --------
          • Unit Group - Add GhostUnit to Ghost_Group
          • Set GhostCounter = (GhostCounter + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (GhostLOOP <gen> is on) Equal to False
            • Then - Actions
              • Trigger - Turn on GhostLOOP <gen>
            • Else - Actions
          • -------- ============ --------
          • -------- ============ --------
        • Else - Actions
          • Hashtable - Save True as 42 of Ghost_Handle in GhostHash
          • Special Effect - Create a special effect at GP1 using Ghost_CONFIG_CancelEffectA
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at GP1 using Ghost_CONFIG_CancelEffectB
          • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_GP1)
  • GhostLOOP
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Ghost_Group and do (Actions)
        • Loop - Actions
          • Set GhostUnit = (Picked unit)
          • Custom script: set udg_Ghost_Handle = GetHandleId(udg_GhostUnit)
          • Set GhostInteger2 = ((Load 9 of Ghost_Handle from GhostHash) + 1)
          • Hashtable - Save GhostInteger2 as 9 of Ghost_Handle in GhostHash
          • Set GhostReal2 = (Load 11 of Ghost_Handle from GhostHash)
          • Set GP1 = (Point((Load 13 of Ghost_Handle from GhostHash), (Load 14 of Ghost_Handle from GhostHash)))
          • -------- --------
          • -------- --------
          • -------- Invisiblity of Dummy Units --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GhostInteger2 Greater than 1
              • GhostInteger2 Less than 399
            • Then - Actions
              • Set GhostReal = ((Load 10 of Ghost_Handle from GhostHash) - 0.25)
              • Hashtable - Save GhostReal as 10 of Ghost_Handle in GhostHash
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GhostInteger2 Equal to 133
                • Then - Actions
                  • Unit - Add GhostSpells (Invisibility, Magic Immune, True Sight, Regen) to GhostUnit
                • Else - Actions
            • Else - Actions
              • Set GhostReal = (Load 10 of Ghost_Handle from GhostHash)
          • -------- Create Dummies --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GhostInteger2 Equal to 1
            • Then - Actions
              • For each (Integer GhostInteger) from 1 to 8, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • GhostInteger Less than or equal to 4
                    • Then - Actions
                      • -------- DUMMY UNIT EFECT --------
                      • Unit - Create 1 Ghost_CONFIG_EffectUnitType for GhostPlayer at GP1 facing ((Real(GhostInteger)) x 90.00) degrees
                    • Else - Actions
                      • -------- DUMMY UNIT GHOST --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • GhostLevelInteger Equal to 1
                        • Then - Actions
                          • Unit - Create 1 Ghost_CONFIG_DummyUnitA for GhostPlayer at GP1 facing (((Real(GhostInteger)) - 4.00) x 90.00) degrees
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • GhostLevelInteger Equal to 2
                            • Then - Actions
                              • Unit - Create 1 Ghost_CONFIG_DummyUnitB for GhostPlayer at GP1 facing (((Real(GhostInteger)) - 4.00) x 90.00) degrees
                            • Else - Actions
                              • Unit - Create 1 Ghost_CONFIG_DummyUnitC for GhostPlayer at GP1 facing (((Real(GhostInteger)) - 4.00) x 90.00) degrees
                  • Set GhostUnit2 = (Last created unit)
                  • Animation - Change GhostUnit2's vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
                  • Hashtable - Save Handle OfGhostUnit2 as GhostInteger of Ghost_Handle in GhostHash
              • Lightning - Create a Drain Mana lightning effect from source GP1 to target GP1
              • Hashtable - Save Handle Of(Last created lightning effect) as 20 of Ghost_Handle in GhostHash
              • Lightning - Create a Drain Mana lightning effect from source GP1 to target GP1
              • Hashtable - Save Handle Of(Last created lightning effect) as 21 of Ghost_Handle in GhostHash
              • Lightning - Create a Drain Mana lightning effect from source GP1 to target GP1
              • Hashtable - Save Handle Of(Last created lightning effect) as 22 of Ghost_Handle in GhostHash
              • Lightning - Create a Drain Mana lightning effect from source GP1 to target GP1
              • Hashtable - Save Handle Of(Last created lightning effect) as 23 of Ghost_Handle in GhostHash
            • Else - Actions
              • -------- Ghosts swirl around the effects. The effects will darken if the ghosts are destroyed. --------
              • For each (Integer GhostInteger) from 1 to 4, do (Actions)
                • Loop - Actions
                  • Set GhostUnit2 = (Load GhostInteger of Ghost_Handle in GhostHash)
                  • Animation - Change GhostUnit2's vertex coloring to (100.00%, 100.00%, 100.00%) with GhostReal% transparency
                  • Set GP2 = (Position of GhostUnit2)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Load (GhostInteger + 25) of Ghost_Handle from GhostHash) Equal to False
                    • Then - Actions
                      • Set GhostReal3 = (Load 16 of Ghost_Handle from GhostHash)
                      • Set GhostReal4 = (Load 15 of Ghost_Handle from GhostHash)
                      • Set GP3 = (GP1 offset by GhostReal3 towards (GhostReal4 + (Facing of GhostUnit2)) degrees)
                      • Custom script: call SetUnitPositionLoc(udg_GhostUnit2, udg_GP3)
                      • Custom script: call SetUnitFacing(udg_GhostUnit2, udg_GhostReal4 + GetUnitFacing(udg_GhostUnit2))
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Load 17 of Ghost_Handle from GhostHash) Equal to False
                        • Then - Actions
                          • Hashtable - Save (GhostReal3 + Ghost_CONFIG_SwirlInSpeed) as 16 of Ghost_Handle in GhostHash
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • GhostReal3 Greater than or equal to GhostReal2
                            • Then - Actions
                              • Hashtable - Save True as 17 of Ghost_Handle in GhostHash
                            • Else - Actions
                        • Else - Actions
                          • Hashtable - Save (GhostReal3 - Ghost_CONFIG_SwirlInSpeed) as 16 of Ghost_Handle in GhostHash
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • GhostReal3 Less than or equal to (Load 18 of Ghost_Handle from GhostHash)
                            • Then - Actions
                              • Hashtable - Save False as 17 of Ghost_Handle in GhostHash
                            • Else - Actions
                      • Set GhostReal5 = (Current flying height of GhostUnit2)
                      • -------- Ghost swirls --------
                      • Set GhostReal4 = ((Load 19 of Ghost_Handle from GhostHash) + 5.00)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • GhostReal4 Less than or equal to 400.00
                        • Then - Actions
                          • Hashtable - Save GhostReal4 as 19 of Ghost_Handle in GhostHash
                        • Else - Actions
                      • Set GhostUnit2 = (Load (GhostInteger + 4) of Ghost_Handle in GhostHash)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Or - Any (Conditions) are true
                            • Conditions
                              • (Load 42 of Ghost_Handle from GhostHash) Equal to True
                              • (GhostUnit is dead) Equal to True
                        • Then - Actions
                          • Unit - Explode GhostUnit2
                        • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (GhostUnit2 is dead) Equal to True
                        • Then - Actions
                          • Hashtable - Save True as (25 + GhostInteger) of Ghost_Handle in GhostHash
                        • Else - Actions
                      • Animation - Change GhostUnit2's vertex coloring to (100.00%, 100.00%, 100.00%) with GhostReal% transparency
                      • Set GP4 = (GP3 offset by GhostReal4 towards (Ghost_CONFIG_GhostSwirlSpeed + (Facing of GhostUnit2)) degrees)
                      • Custom script: call SetUnitPositionLoc(udg_GhostUnit2, udg_GP4)
                      • Custom script: call SetUnitFacing(udg_GhostUnit2, udg_Ghost_CONFIG_GhostSwirlSpeed + GetUnitFacing(udg_GhostUnit2))
                      • Set Ghost_Lightning = (Load (GhostInteger + 19) of Ghost_Handle in GhostHash)
                      • Set GhostReal4 = (Load (29 + GhostInteger) of Ghost_Handle from GhostHash)
                      • Lightning - Change color of Ghost_Lightning to (1.00 1.00 1.00) with GhostReal4 alpha
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Load (GhostInteger + 33) of Ghost_Handle from GhostHash) Equal to False
                        • Then - Actions
                          • Hashtable - Save (GhostReal4 + Ghost_CONFIG_LightningColorUp) as (GhostInteger + 29) of Ghost_Handle in GhostHash
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • GhostReal4 Greater than or equal to Ghost_CONFIG_LightningColorMax
                            • Then - Actions
                              • Hashtable - Save True as (GhostInteger + 33) of Ghost_Handle in GhostHash
                            • Else - Actions
                        • Else - Actions
                          • Hashtable - Save (GhostReal4 - Ghost_CONFIG_LightningColorUp) as (29 + GhostInteger) of Ghost_Handle in GhostHash
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • GhostReal4 Less than or equal to Ghost_CONFIG_LightningColorMin
                            • Then - Actions
                              • Hashtable - Save False as (GhostInteger + 33) of Ghost_Handle in GhostHash
                            • Else - Actions
                      • Custom script: call MoveLightningEx(udg_Ghost_Lightning, true, GetLocationX(udg_GP4), GetLocationY(udg_GP4), GetLocationZ(udg_GP4) + udg_GhostReal5, GetLocationX(udg_GP3), GetLocationY(udg_GP3), GetLocationZ(udg_GP3) + GetUnitFlyHeight(udg_GhostUnit2))
                      • Custom script: call RemoveLocation(udg_GP3)
                      • Custom script: call RemoveLocation(udg_GP4)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (GhostUnit2 is alive) Equal to True
                        • Then - Actions
                          • Set GhostReal4 = (Load (GhostInteger + 29) of Ghost_Handle from GhostHash)
                          • Set Ghost_Lightning = (Load (GhostInteger + 19) of Ghost_Handle in GhostHash)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • GhostReal4 Greater than or equal to 0.25
                            • Then - Actions
                              • Lightning - Change color of Ghost_Lightning to (1.00 1.00 1.00) with GhostReal4 alpha
                              • Hashtable - Save (GhostReal4 - Ghost_CONFIG_LightningColorUp) as (GhostInteger + 29) of Ghost_Handle in GhostHash
                            • Else - Actions
                              • Lightning - Destroy Ghost_Lightning
                              • Hashtable - Save ((Load 36 of Ghost_Handle from GhostHash) + 1) as 36 of Ghost_Handle in GhostHash
                              • Unit - Explode GhostUnit2
                              • Set GhostReal4 = (Facing of GhostUnit2)
                              • Unit - Create 1 Ghost Field 'Portal' Effect for Neutral Passive at GP2 facing GhostReal4 degrees
                              • Set GhostUnit2 = (Last created unit)
                              • Unit - Make GhostUnit2 Explode on death
                              • Unit - Add a 1.60 second Generic expiration timer to GhostUnit2
                              • Animation - Change GhostUnit2's animation speed to 200.00% of its original speed
                              • Unit - Create 1 Ghost Field 'Portal' Effect for Neutral Passive at GP2 facing (GhostReal4 + 90.00) degrees
                              • Set GhostUnit2 = (Last created unit)
                              • Unit - Make GhostUnit2 Explode on death
                              • Unit - Add a 1.60 second Generic expiration timer to GhostUnit2
                              • Animation - Change GhostUnit2's animation speed to 200.00% of its original speed
                              • Unit - Create 1 Ghost Field 'Portal' Effect for Neutral Passive at GP2 facing (GhostReal4 + 180.00) degrees
                              • Set GhostUnit2 = (Last created unit)
                              • Unit - Make GhostUnit2 Explode on death
                              • Unit - Add a 1.60 second Generic expiration timer to GhostUnit2
                              • Animation - Change GhostUnit2's animation speed to 200.00% of its original speed
                              • Unit - Create 1 Ghost Field 'Portal' Effect for Neutral Passive at GP2 facing (GhostReal4 + 270.00) degrees
                              • Set GhostUnit2 = (Last created unit)
                              • Unit - Make GhostUnit2 Explode on death
                              • Unit - Add a 1.60 second Generic expiration timer to GhostUnit2
                              • Animation - Change GhostUnit2's animation speed to 200.00% of its original speed
                              • -------- --------
                              • -------- --------
                              • -------- Damage --------
                              • Set GhostPlayer = (Owner of GhostUnit)
                              • Set GhostReal4 = (Load 44 of Ghost_Handle from GhostHash)
                              • Custom script: set bj_wantDestroyGroup = true
                              • Unit Group - Pick every unit in (Units within (Load 43 of Ghost_Handle from GhostHash) of GP2 matching ((((Matching unit) belongs to an ally of GhostPlayer) Equal to False) and (((Owner of (Matching unit)) Not equal to GhostPlayer) and ((((Matching unit) is Magic Immune) Equal to False) and and do (Actions)
                                • Loop - Actions
                                  • Set GhostUnit2 = (Picked unit)
                                  • Special Effect - Create a special effect attached to the origin of GhostUnit2 using Ghost_CONFIG_DamageEffect
                                  • Special Effect - Destroy (Last created special effect)
                                  • Unit - Cause GhostUnit to damage GhostUnit2, dealing GhostReal4 damage of attack type Spells and damage type Normal
                        • Else - Actions
                  • Custom script: call RemoveLocation(udg_GP2)
          • -------- Distance Check --------
          • Set GP2 = (Position of GhostUnit)
          • Set GhostReal3 = (Mana of GhostUnit)
          • Set GhostReal4 = (Distance between GP1 and GP2)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GhostReal4 Greater than or equal to GhostReal2
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GhostReal4 Greater than or equal to (GhostReal2 + Ghost_CONFIG_BonusRange)
                • Then - Actions
                  • Set GhostReal5 = 0.70
                  • Animation - Change GhostUnit's vertex coloring to (100.00%, 0.00%, 0.00%) with 0.00% transparency
                • Else - Actions
                  • Set GhostReal5 = 0.45
                  • Animation - Change GhostUnit's vertex coloring to (100.00%, 25.00%, 25.00%) with 0.00% transparency
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GhostReal3 Greater than 5.00
                • Then - Actions
                  • Unit - Set mana of GhostUnit to (GhostReal3 - (GhostReal5 x 0.35))
                • Else - Actions
                  • Unit - Set life of GhostUnit to ((Life of GhostUnit) - GhostReal5)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GhostInteger2 Greater than 245
                  • (Random integer number between 1 and 25) Equal to 1
                  • (Number of units in GhostDummyGroup) Less than or equal to 2
                • Then - Actions
                  • Set GP2 = (GP1 offset by (Random real number between 0.00 and (GhostReal2 - 300.00)) towards (Random angle) degrees)
                  • Set GP3 = (GP2 offset by 900.00 towards (Random angle) degrees)
                  • -------- //// --------
                  • Unit - Create 1 (Unit-type of GhostUnit) for Neutral Passive at GP2 facing (Random angle) degrees
                  • Set GhostUnit2 = (Last created unit)
                  • Unit - Change color of GhostUnit2 to (Color of (Owner of GhostUnit))
                  • Animation - Change GhostUnit2's vertex coloring to (100.00%, 100.00%, 100.00%) with 95.00% transparency
                  • -------- //// --------
                  • -------- //// --------
                  • Custom script: set udg_GhostInteger = GetHandleId(udg_GhostUnit2)
                  • Hashtable - Save 95.00 as 50 of GhostInteger in GhostHash
                  • Hashtable - Save (Random real number between 0.25 and 1.00) as 51 of GhostInteger in GhostHash
                  • Hashtable - Save False as 52 of GhostInteger in GhostHash
                  • Hashtable - Save (Random real number between 25.00 and 40.00) as 53 of GhostInteger in GhostHash
                  • Set GhostCounter = (GhostCounter + 1)
                  • -------- //// --------
                  • -------- //// --------
                  • Unit - Turn collision for GhostUnit2 Off
                  • Unit - Set GhostUnit2 movement speed to (Random real number between 125.00 and 300.00)
                  • Unit - Order GhostUnit2 to Move To GP3
                  • Unit - Make GhostUnit2 Explode on death
                  • Unit Group - Add GhostUnit2 to GhostDummyGroup
                  • Custom script: call UnitAddAbility(udg_GhostUnit2, 'Aloc')
                  • -------- //// --------
                  • -------- //// --------
                  • Custom script: call RemoveLocation(udg_GP2)
                  • Custom script: call RemoveLocation(udg_GP3)
                • Else - Actions
              • Animation - Change GhostUnit's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
              • Unit - Set mana of GhostUnit to (GhostReal3 + (Load 45 of Ghost_Handle from GhostHash))
          • -------- --------
          • -------- Destroy --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 36 of Ghost_Handle from GhostHash) Equal to 4
            • Then - Actions
              • Animation - Change GhostUnit's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
              • Special Effect - Create a special effect attached to the chest of GhostUnit using Ghost_CONFIG_DispelEffect
              • Special Effect - Destroy (Last created special effect)
              • Unit - Remove GhostSpells (Invisibility, Magic Immune, True Sight, Regen) from GhostUnit
              • Set GhostLevelInteger = (Level of Decimate Portal (Turn Off) for GhostUnit)
              • Unit - Remove Decimate Portal (Turn Off) from GhostUnit
              • Unit - Add Ghost Field (Real Ability / Non-Hero) to GhostUnit
              • Unit - Set level of Ghost Field (Real Ability / Non-Hero) for GhostUnit to GhostLevelInteger
              • Unit Group - Remove GhostUnit from Ghost_Group
              • Hashtable - Clear all child hashtables of child Ghost_Handle in GhostHash
              • -------- --------
              • Set GhostCounter = (GhostCounter - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GhostCounter Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
          • Custom script: call RemoveLocation(udg_GP1)
      • -------- //Effects --------
      • Unit Group - Pick every unit in GhostDummyGroup and do (Actions)
        • Loop - Actions
          • Set GhostUnit = (Picked unit)
          • Custom script: set udg_Ghost_Handle = GetHandleId(udg_GhostUnit)
          • Set GhostReal = (Load 50 of Ghost_Handle from GhostHash)
          • Set GhostBoolean = (Load 52 of Ghost_Handle from GhostHash)
          • Animation - Change GhostUnit's vertex coloring to (100.00%, 100.00%, 100.00%) with GhostReal% transparency
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 55 of Ghost_Handle from GhostHash) Equal to False
              • (Current order of GhostUnit) Not equal to (Order(move))
            • Then - Actions
              • Hashtable - Save True as 55 of Ghost_Handle in GhostHash
              • Set GhostInteger = (Random integer number between 1 and 5)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GhostInteger Equal to 1
                • Then - Actions
                  • Animation - Play GhostUnit's attack animation
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • GhostInteger Equal to 2
                    • Then - Actions
                      • Animation - Play GhostUnit's spell animation
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • GhostInteger Equal to 3
                        • Then - Actions
                          • Animation - Play GhostUnit's channel animation
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • GhostInteger Equal to 4
                            • Then - Actions
                              • Animation - Play GhostUnit's Stand - 1 animation
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • GhostInteger Equal to 5
                                • Then - Actions
                                  • Animation - Play GhostUnit's attack - 2 animation
                                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GhostBoolean Equal to True
            • Then - Actions
              • Hashtable - Save (GhostReal + (Load 51 of Ghost_Handle from GhostHash)) as 50 of Ghost_Handle in GhostHash
            • Else - Actions
              • Hashtable - Save (GhostReal - (Load 51 of Ghost_Handle from GhostHash)) as 50 of Ghost_Handle in GhostHash
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GhostReal Less than or equal to (Load 53 of Ghost_Handle from GhostHash)
            • Then - Actions
              • Hashtable - Save True as 52 of Ghost_Handle in GhostHash
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GhostBoolean Equal to True
              • GhostReal Greater than or equal to 99.00
            • Then - Actions
              • Unit Group - Remove GhostUnit from GhostDummyGroup
              • Unit - Remove GhostUnit from the game
              • Hashtable - Clear all child hashtables of child Ghost_Handle in GhostHash
              • Set GhostCounter = (GhostCounter - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GhostCounter Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
207551-albums4946-picture51516.png
207551-albums4946-picture51515.png
207551-albums4946-picture51514.png





Feedback please c:
 

Attachments

  • Ghost Field.w3x
    65.1 KB · Views: 89
Last edited:
Level 17
Joined
Apr 3, 2010
Messages
1,101
Really random idea if you wanna use would be nice to see.

Spell cast

= Zep Creates a circular field around of him X Radius. Where by for each unit in this region a Zep Clone is created. The Zep Clone deals X dmg and Takes X Dmg.

While Zep is still in this region marked out by (A form of marker system or effect maybe aura or something)

He will regullary switch between Images. (Swap position)

If zep leaves the region he will become a ghostlike figure and will gain invisibillity for Number of Clones *X seconds :L
 
Lol details baassee^^
I guess Pharaoh_ meant to hire the most unexperienced users in triggering as could get. Guys from modeling/texturing or terraining section would be brilliant here. They got 'commond knowledge', just not the coding one. But eh.. you cares?

Eye-candy? ^^

How did you end up to that conclusion?
 
Level 16
Joined
Apr 4, 2011
Messages
995
Thats the problem, find a judge ;) Meaby Spell contests should be approved after finding decent judges, not before? xD

@Pharaoh_ What a response. :p

@@@@@Offtop:
Don't you think that kinda of fsjal disease corrupts too many ppl? I don't wanna be here when any of spell mods changes his avatar into fsjal. Maker, Pharaoh_.. Bribe? I can't even imagen that xD

It's sad that fsjals bug you so much. They aren't as annoying as the ponies or as bad as the ducks >_>

On Topic, I am going to do my spell this weekend. FOR SERIOUS
 
Level 1
Joined
Sep 10, 2011
Messages
5
Made a GUI Spell, my first submission to hive.:thumbs_up:

Tooltip :
attachment.php


Effect :
It blinks you to the target location, then creates a shadow clone where u were, which taunts the foe, and images of yourself run around in all directions. While this happens, you are invisible and faster.

This can be used to escape, or just to increase the amount of damage dealt, as the clone can attack (the clone has 50% evasion, but that's optional). It will mainly confuse human enemies as the images run away and they think its our unit running away.
Can easily be countered if the opponent can see invisible units though...

Screenshots :


attachment.php



attachment.php



attachment.php

---------------------------------------------------
Uses 1 trigger to configure
Uses 2 triggers for execution
Uses 5 custom units for ability, excluding the casting unit.
Uses 3 extra custom abilities, other than Shadowstep itself.
Imported things have been credited in game quest.
---------------------------------------------------
Hope Its good enough.
The map named Shadowstep is a quest type map whereas the other one is the spell in a map with a lot of enemies.
 

Attachments

  • 1.jpg
    1.jpg
    317.5 KB · Views: 353
  • 2.jpg
    2.jpg
    326.2 KB · Views: 323
  • 3.jpg
    3.jpg
    341 KB · Views: 333
  • Ability Screenshot.jpg
    Ability Screenshot.jpg
    47.8 KB · Views: 356
  • Shadowstep.w3x
    133.5 KB · Views: 88
  • Zephyr Contest #8 - drkninja.w3x
    116.1 KB · Views: 76
Last edited:
Level 17
Joined
Apr 3, 2010
Messages
1,101
My idea = Alternate Dimension

The Illusionist releases his magic to create a temeperal shift wherebye he will jump into an alternate dimension becoming untargatable. In his place X echoes are created. Each Echo will deal 100%/Number of echoes dmg and Takes 100%*Number of echoes created. Although the power of the illusionist can only sustain Level of abillity * 3 echoes at any one time.

The illusionist after returning to reallity via casting a spell or attacking will cause any echoes to deal Y Damage to there surrounding area and he will deal Z-Timespentinalternatedimension damage.

He can only sustain this shift for S seconds.


Will upload it when i have created it ^^

The Variables will start at a default and can be manually changed
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
attachment.php
attachment.php

attachment.php


JASS:
//==========================================================================================
// ShadowDistraction v1.00 by watermelon_1234
//******************************************************************************************
// Libraries required: (Libraries with * are optional)
//  - DummyCaster       [url]http://www.thehelper.net/forums/showthread.php/133873-DummyCaster[/url]
//  - T32               [url]http://www.thehelper.net/forums/showthread.php/132538-Timer32[/url]
//  * BoundSentinel     [url]http://www.wc3c.net/showthread.php?t=102576[/url]
//##########################################################################################
// Importing:
//  1. Copy the abilities: Shadow Distraction, Blind (SD), Illusions (SD), and Invis (SD)
//  2. Copy the buff, Shadow Distraction
//  3. Copy the unit, Shadow (SD)
//  4. Implement the required libraries
//  5. Copy this trigger
//  6. Configure the spell
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Notes:
//  - N/A
//==========================================================================================
scope ShadowDistraction

//==========================================================================================
//                              CONSTANTS
//==========================================================================================

    globals
    
//------------------------------------------------------------------------------------------
//      Raw ID of spells and order ID configuration
//------------------------------------------------------------------------------------------

        private constant integer    SPELL_ID            = 'A000'    // Raw id of the Shadow Distraction ability      
        
        private constant integer    ILLUSION_SID        = 'A001'    // Raw id of the Illusion (SD) ability
        private constant integer    ILLUSION_OID        = 852274    // Order id of the Illusion (SD) ability
        
        private constant integer    INVIS_SID           = 'A002'    // Raw id of the Invis (SD) ability
        private constant integer    INVIS_OID           = 852069    // Order id of the Invis (SD) ability       
        
        private constant integer    BLIND_SID           = 'A003'    // Raw id of teh Blind (SD) ability
        private constant integer    BLIND_OID           = 852592    // Order id of the Blind (SD) ability
        
//------------------------------------------------------------------------------------------
//      General Settings for both shadow and illusion
//------------------------------------------------------------------------------------------
 
        private constant boolean    PRELOAD             = true      // Determines if the spell should preload the Shadow unit and abilities 
        private constant integer    MAX_IMAGES          = 6         // The max number of shadows/illusions that the spell will make
        private constant real       IMAGE_ANG_ROTATE    = bj_PI/4   // The radians the shadows/illusions will be rotated from their offset position

//------------------------------------------------------------------------------------------
//      Shadow settings
//------------------------------------------------------------------------------------------
        
        private constant integer    SHADOW_ID           = 'e000'    // Unit id of the Shadow unit
        private constant real       SHADOW_OFFSET       = 600.      // Offset that shadows will be created from target point
        private constant string     SHADOW_BIRTH_SFX    = "Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl" // The sfx played when a shadow is created
        private constant integer    SHADOW_WALK_INDEX   = 1         // Animation index played when the shadow is homing in on the target point
        private constant real       SHADOW_MOVE_SPEED   = 500.      // Movement speed of the shadows
        private constant boolean    EXACT_SHADOW_COORD  = true      // Ensures that shadows will be created exactly where they're supposed to be if true
        private constant boolean    RECYCLE_SHADOWS     = false     // Enables recycling for shadows instead of removing them, note that their facing may look awkward      
        
//------------------------------------------------------------------------------------------
//      Illusion settings
//------------------------------------------------------------------------------------------
       
        private constant real       ILLUS_OFFSET        = 125.      // Offset that illusions will be created from target point
        private constant integer    ILLUS_SHOW_INDEX    = 6         // Animation index played when the illusions are shown
        
    endglobals

//==========================================================================================
//                              OTHER CONFIGURATION
//==========================================================================================

    // Number of shadows/illusions per spell
    private constant function ImageNumber takes integer lvl returns integer
        return 3 + 1*lvl
    endfunction
    
//==========================================================================================
//                              END OF CONFIGURATION
//==========================================================================================
    
    private struct dat
        unit caster                         // Casting unit   
        player owner                        // Owner of caster
        integer lvl                         // Level of Shadow Distraction when it was cast
        integer count                       // Used to count how many illusions the spell has created
        boolean hasTarget                   // Checks if the spell has targetted an enemy unit and slightly changes how the spell works
        real x                              // x coord of target point
        real y                              // y coord of target point
        real dist = 0                       // Tracks the distance of the shadows so that they home in properly
        unit array shadows[MAX_IMAGES]      // Stores the shadows that will home in on the target point
        unit array illusions[MAX_IMAGES]    // Stores the illusions. They're created early so that they will have proper facing when shown
        
        static thistype data = 0            // Used to pass information from the struct to the illusions being created
        
        // Controls shadow movement and when to make the illusions appear
        method periodic takes nothing returns nothing
            local integer i = 0
            local real ux
            local real uy
            local real dx
            local real dy
            local real sx
            local real sy
            local real scale
            
            if .dist < SHADOW_OFFSET - ILLUS_OFFSET then
            
                set .dist = .dist + SHADOW_MOVE_SPEED * T32_PERIOD                
                
                call SetUnitOwner(DUMMY, .owner, false) // Make the blind spell properly target enemy units of the caster
                call UnitAddAbility(DUMMY, BLIND_SID)    
                call SetUnitAbilityLevel(DUMMY, BLIND_SID, .lvl)
                
                loop               
                    
                    // Moving the shadow
                    set ux = GetUnitX(.shadows[i])
                    set uy = GetUnitY(.shadows[i])                    
                    set dx = .x - ux
                    set dy = .y - uy
                    
                    set scale = (SHADOW_MOVE_SPEED*T32_PERIOD)/SquareRoot(dx*dx+dy*dy+0.1)
                    
                    set sx = ux+dx*scale
                    set sy = uy+dy*scale
                    
                    call SetUnitX(.shadows[i], sx)
                    call SetUnitY(.shadows[i], sy)
                    
                    call IssuePointOrderById(DUMMY, BLIND_OID, sx, sy) // Cast blind spell on the new coords
                    
                    set i = i + 1
                    exitwhen i == .count
                    
                endloop
                
                call UnitRemoveAbility(DUMMY, BLIND_SID)
                call SetUnitOwner(DUMMY, DUMMY_OWNER, false)
                
            else
                
                loop
                    
                    // Showing the illusion and playing the animation
                    call ShowUnit(.illusions[i], true)
                    call SetUnitX(.illusions[i], GetUnitX(.shadows[i]))
                    call SetUnitY(.illusions[i], GetUnitY(.shadows[i]))
                    call SetUnitAnimationByIndex(.illusions[i], ILLUS_SHOW_INDEX)
                    call QueueUnitAnimation(.illusions[i], "stand")
                    
                    static if RECYCLE_SHADOWS then
                        call ShowUnit(.shadows[i], false) // Done like this so it can work for all units without visual bugs
                    else
                        call RemoveUnit(.shadows[i])
                    endif
                    
                    set i = i + 1                    
                    exitwhen i == .count
                    
                endloop                
                
                // Only make the owner select the caster if the spell had a target unit and 
                // if the owner is not selecting anything else
                if .hasTarget and GetLocalPlayer() == .owner then                    
                    call GroupEnumUnitsSelected(bj_lastCreatedGroup, .owner, null)
                    if FirstOfGroup(bj_lastCreatedGroup) == null then
                        call SelectUnit(.caster, true) 
                    endif                    
                endif                
                
                call .stopPeriodic()
                call .destroy()
                
            endif
            
        endmethod
        
        implement T32x
        
        // Actual spell actions, creates the shadows and illusions, hides or makes the caster invisible as needed
        static method startSpell takes nothing returns nothing
            local thistype this = thistype.allocate()
            local integer i = 0
            local real ang            
            local real sx
            local real sy
            local integer num // Keeps track of how many times the illusion spell must be cast
            
            set .caster = GetTriggerUnit()    
            set .owner = GetTriggerPlayer()
            
            call UnitRemoveBuffs(.caster, true, true) // Dispel buffs from the user like Mirror Image
            
            set .lvl = GetUnitAbilityLevel(.caster, SPELL_ID)             
            
            // Sets DUMMY owner to .owner so that illusions will be created for the right owner 
            // and the invisibility spell will be treated as friendly
            call SetUnitOwner(DUMMY, .owner, false)                                                     
            
            set .hasTarget = GetSpellTargetUnit() != null
            
            if .hasTarget then
                // Makes the spell consider the caster as one of the illusions
                // Actual images made will be one less
                set .count = 1
                set .illusions[0] = .caster     
                
                set .x = GetUnitX(GetSpellTargetUnit())
                set .y = GetUnitY(GetSpellTargetUnit())  
                
                set num = ImageNumber(lvl) - 1
            else
                // Creates the actual number of illusions listed by the spell
                // and makes the caster invisible
                set .count = 0 
                set .x = GetSpellTargetX()
                set .y = GetSpellTargetY()
                
                call UnitAddAbility(DUMMY, INVIS_SID)
                call IssueTargetOrderById(DUMMY, INVIS_OID, .caster)
                call UnitRemoveAbility(DUMMY, INVIS_SID)
                
                set num = ImageNumber(lvl)  
            endif 
                                  
            // Creating the illusions
            
            set data = this // Since the spell will be cast instantly, a global can be used to pass info
                            // to the createIllusion method without conflicting
            
            call UnitAddAbility(DUMMY, ILLUSION_SID)
            call SetUnitAbilityLevel(DUMMY, ILLUSION_SID, .lvl)
            loop
                call IssueTargetOrderById(DUMMY, ILLUSION_OID, .caster)
                
                set i = i + 1
                exitwhen i == num
            endloop
            call UnitRemoveAbility(DUMMY, ILLUSION_SID)
            call SetUnitOwner(DUMMY, DUMMY_OWNER, false)   
            
            set data = 0 // So that the illusion summon actions only work for this spell
            
            set ang = bj_PI*2/.count * GetRandomInt(1, .count) + IMAGE_ANG_ROTATE
            
            // Illusion and Shadow settings
            set i = 0            
            loop      
            
                call SetUnitFacing(.illusions[i], 180 + ang * bj_RADTODEG)             
                call ShowUnit(.illusions[i], false)

                set sx = .x + SHADOW_OFFSET*Cos(ang)
                set sy = .y + SHADOW_OFFSET*Sin(ang)

                static if RECYCLE_SHADOWS then
                    if .shadows[i] == null then
                        set .shadows[i] = CreateUnit(.owner, SHADOW_ID, sx, sy, 180 + ang * bj_RADTODEG)
                    else
                        call ShowUnit(.shadows[i], true)
                        call UnitRemoveAbility(.shadows[i], 'Aloc')
                        call UnitAddAbility(.shadows[i], 'Aloc')
                        
                        call SetUnitFacing(.shadows[i], 180 + ang * bj_RADTODEG)
                        // Ensures that setting the shadow's coordinates won't be repeated if EXACT_SHADOW_COORD is true
                        static if not EXACT_SHADOW_COORD then 
                            call SetUnitX(.shadows[i], sx)
                            call SetUnitY(.shadows[i], sy)
                        endif
                    endif
                else
                    set .shadows[i] = CreateUnit(.owner, SHADOW_ID, sx, sy, 180 + ang * bj_RADTODEG)
                endif
                
                static if EXACT_SHADOW_COORD then
                    call SetUnitX(.shadows[i], sx)
                    call SetUnitY(.shadows[i], sy)
                endif
                
                call SetUnitAnimationByIndex(.shadows[i], SHADOW_WALK_INDEX)
                call DestroyEffect(AddSpecialEffect(SHADOW_BIRTH_SFX, sx, sy))   
                
                set ang = ang + bj_PI*2/.count
                
                set i = i + 1
                exitwhen i == .count
                
            endloop
            
            call .startPeriodic()
        endmethod
        
        // Stores created illusions from this spell into the unit array of the respective struct
        static method createIllusion takes nothing returns boolean
            if data != 0 then
                set data.illusions[data.count] = GetTriggerUnit()
                set data.count = data.count + 1
            endif
            return false
        endmethod

        static method spellActions takes nothing returns boolean
            if GetSpellAbilityId() == SPELL_ID then
                call thistype.startSpell()
            endif
            return false
        endmethod
        
        static method onInit takes nothing returns nothing
            local trigger t = CreateTrigger()
            call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
            call TriggerAddCondition(t, Condition(function thistype.spellActions))
            
            set t = CreateTrigger()
            call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SUMMON)
            call TriggerAddCondition(t, Condition(function thistype.createIllusion))
            
            set t = null            
            
            static if PRELOAD then
                set bj_lastCreatedUnit = CreateUnit(Player(15), SHADOW_ID, 0, 0, 0)
                
                call UnitAddAbility(bj_lastCreatedUnit, ILLUSION_SID)
                call UnitAddAbility(bj_lastCreatedUnit, INVIS_SID)
                call UnitAddAbility(bj_lastCreatedUnit, BLIND_SID)
                
                call RemoveUnit(bj_lastCreatedUnit)
            endif
        endmethod
        
    endstruct
endscope
EDIT: Made this my final submission.
 

Attachments

  • ShadowDistraction.jpg
    ShadowDistraction.jpg
    22.4 KB · Views: 329
  • Zephyr#8 watermelon_1234.w3x
    62.7 KB · Views: 69
  • ShadowDistractionTooltip.jpg
    ShadowDistractionTooltip.jpg
    63 KB · Views: 276
Last edited:
Level 8
Joined
Sep 20, 2011
Messages
583
i think i will join,even im not good at anything but its worth-it.il just need to manage my time and think about the model to use also the effects but i have an idea how i just really really need time. il use maiev to use the spell.wish i could make it but if not,i will just upload it in "spells" here in THW.
 
Level 17
Joined
Apr 3, 2010
Messages
1,101
Let god be my steel? Hey Pharoh are we allowed to use Illusion spells which are more varied than just Mirror image expansions. Such as swapping units over and enemies/allies?

Or making things appear from nowhere?

I.E Bunny out a hat?
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
After contest extension there is a mistake in description:
All submissions must be complete and submitted within 3 (three) weeks, after the launch of the contest, which begins on September 18th, 2011 and concludes on October 18th, 11:59 PM, 2011 UTC.
3 (three) weeks ->> 4 (four) weeks. If we stick to details tho, 4 weeks don't match month either ;>
 
Status
Not open for further replies.
Top