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

Force Spells [GUI]

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Please, don't worry about the other triggers (I'm translating into English.)
This spellpack contains:
Shockwave and Fire Knock

In the READ ME you can see how to convert Fire Knock in a unpassive spell.


The Caster creates a Shockwave to damage and knock all units in a line.
Level 1 - 200 Distance.
Level 2 - 400 Distance.
Level 3 - 500 Distance.
Level 4 - 650 Distance.
  • PS Init
    • Events
      • Unt - A unit Starts the effect....
    • Condtions
      • (Ability being cast) Igual a Shockwave
    • Actions
      • -------- --------------------------- --------
      • -------- The Dinamic Indexing. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PS_Index1 Igual a 0
        • Then do - Actions
          • Trigger - Turn on PS Loop <gen>
        • Others - Actions
      • Set PS_Index1 = (PS_Index1 + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PS_Index1 Mayor que PS_RecycleIndex
        • Then do - Actions
          • Set PS_Index2[PS_Index1] = PS_Index1
          • Set PS_RecycleIndex = PS_Index1
        • Others - Actions
      • -------- --------------------------- --------
      • -------- I make this to read more easily. --------
      • Set PS_CurrentIndex = PS_Index2[PS_Index1]
      • -------- --------------------------- --------
      • -------- This are the verification to enable or disable the knock of Shockwave. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Shockwave for (Triggering unit)) More than 2
        • Then do - Actions
          • Set PS_KnockVerify[PS_CurrentIndex] = True
        • Others - Actions
          • Set PS_KnockVerify[PS_CurrentIndex] = False
      • -------- --------------------------- --------
      • Set PS_Caster[PS_CurrentIndex] = (Triggering unit)
      • -------- --------------------------- --------
      • -------- Is the area to destroy trees and damage units. --------
      • Set PS_Area[PS_CurrentIndex] = 200.00
      • -------- --------------------------- --------
      • Set PS_DestroyTrees[PS_CurrentIndex] = True
      • -------- --------------------------- --------
      • -------- I use a little damage ( this repeat every 0.03 seconds: (0.03 x 50) x second = 90.) --------
      • Set PS_Damage[PS_CurrentIndex] = 50.00
      • -------- --------------------------- --------
      • Set PS_CurrentDistance[PS_CurrentIndex] = 0.00
      • -------- --------------------------- --------
      • -------- I don't know to describe this. --------
      • Set PS_LessDistance[PS_CurrentIndex] = 0.50
      • -------- --------------------------- --------
      • -------- I don't know where I use a little number. --------
      • Set PS_MaxDistance[PS_CurrentIndex] = 10.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Conditions
          • (Level of (Ability being cast) for (Triggering unit)) More than 1
        • Actions
          • For each (Integer A) from 1 to (Level of Shockwave for (Triggering unit)), do (Actions)
            • Loop - Actions
              • Set PS_MaxDistance[PS_CurrentIndex] = (PS_MaxDistance[PS_CurrentIndex] + 5.00)
        • Actions
      • -------- --------------------------- --------
      • -------- The velocity of Shockwave --------
      • Set PS_Velocity[PS_CurrentIndex] = 20.00
      • -------- --------------------------- --------
      • Set PS_LeakPoint = (Position of (Triggering unit))
      • Unit - Create 1 Shockwave for (Triggering player) at PS_LeakPoint facing (Facing of (Triggering unit)) degrees
      • Set PS_Shockwave[PS_CurrentIndex] = (Last created unit)
      • -------- --------------------------- --------
      • -------- Clearing a leak. --------
      • Custom script: call RemoveLocation (udg_PS_LeakPoint)
      • -------- --------------------------- --------
  • PS Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer PS_Index3) from 1 to PS_Index1, do (Actions)
        • Loop - Actions
          • Set PS_CurrentIndex = PS_Index2[PS_Index3]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Conditions
              • PS_CurrentDistance[PS_CurrentIndex] Less than or Equal to PS_MaxDistance[PS_CurrentIndex]
            • Actions
              • Set PS_CurrentDistance[PS_CurrentIndex] = (PS_CurrentDistance[PS_CurrentIndex] + PS_LessDistance[PS_CurrentIndex])
              • Set PS_LeakPoint = ((Position of PS_Shockwave[PS_CurrentIndex]) offset by PS_Velocity[PS_CurrentIndex] towards (Facing of PS_Shockwave[PS_CurrentIndex]) degrees)
              • -------- --------------------------- --------
              • -------- You can read? --------
              • Unit - Move PS_Shockwave[PS_CurrentIndex] instantly to PS_LeakPoint
              • -------- --------------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Conditions
                  • PS_DestroyTrees[PS_CurrentIndex] Equala to True
                • Actions
                  • Destructible - Pick every destructible within PS_Area[PS_CurrentIndex] of PS_LeakPoint and do (Destructible - Kill (Picked destructible))
                • Actions
              • -------- --------------------------- --------
              • -------- Clearing a leak. --------
              • Custom script: set bj_wantDestroyGroup=true
              • -------- --------------------------- --------
              • Unit Group - Pick every unit in (Units within PS_Area[PS_CurrentIndex] of PS_LeakPoint matching ((((Matching unit) is A building) Igual a False) and ((((Matching unit) is flying) Igual a False) and (((Matching unit) belongs to an enemy of (Owner of PS_Caster[PS_CurrentIndex and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • Conditions
                      • PS_KnockVerify[PS_CurrentIndex] Igual a True
                    • Actions
                      • -------- --------------------------- --------
                      • -------- Clearing a leak. --------
                      • Custom script: call RemoveLocation (udg_PS_LeakPoint)
                      • -------- --------------------------- --------
                      • Set PS_LeakPoint = ((Position of (Picked unit)) offset by (PS_Velocity[PS_CurrentIndex] - (PS_Velocity[PS_CurrentIndex] x 2.00)) towards (Angle from (Position of (Picked unit)) to (Position of PS_Shockwave[PS_CurrentIndex])) degrees)
                      • Unit - Move (Picked unit) instantly to PS_LeakPoint
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • Conditions
                          • (Random integer number between 1 and 5) Igual a 1
                        • Actions
                          • Special effect - Create a special effect at PS_LeakPoint using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
                          • Special effect - Destroy (Last created special effect)
                        • Actions
                      • -------- --------------------------- --------
                      • -------- Clearing a leak. --------
                      • Custom script: call RemoveLocation (udg_PS_LeakPoint)
                      • -------- --------------------------- --------
                    • Actions
                      • -------- --------------------------- --------
                      • -------- Clearing a leak. --------
                      • Custom script: call RemoveLocation (udg_PS_LeakPoint)
                      • -------- --------------------------- --------
                  • Unit - Order PS_Caster[PS_CurrentIndex] to damage (Picked unit) for PS_Damage[PS_CurrentIndex] using attack type Spell and damage type Force.
            • Actions
              • -------- --------------------------- --------
              • -------- Destroy the Shockwave and removing one caster from casting. --------
              • Unit - Kill PS_Shockwave[PS_CurrentIndex]
              • -------- --------------------------- --------
              • Set PS_Index2[PS_Index3] = PS_Index2[PS_Index1]
              • Set PS_Index2[PS_Index1] = PS_CurrentIndex
              • Set PS_Index1 = (PS_Index1 - 1)
              • Set PS_Index3 = (PS_Index3 - 1)
              • -------- --------------------------- --------
              • -------- If aren't any caster, close the trigger. --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Conditions
                  • PS_Index1 Equal to 0
                • Actions
                  • Detonador - Turn off (This trigger)
                • Actions
              • -------- --------------------------- --------


The Caster has a chance to Knock the attacked unit. When Knocked creates a fire around and damage all nearbly units..
Level 1: Knock 300 (I hope).
Level 2: Knock 400 (I hope).
Level 3: Knock 475 (I hope).
Level 4: Knock 550 (I hope).

  • FK Init
    • Events
      • Unit - A unit Es atacado
    • Conditions
      • (Level of Fire Knock for (Attacking unit)) More than or Equal to 1
    • Actions
      • -------- --------------------------- --------
      • -------- First, add the probability. --------
      • Set FK_Probability = (Random real number between 0.00 and 100.00)
      • Set FK_ProbabilityVerify = 10.00
      • -------- --------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Conditions
          • (Level of Fire Knock for (Attacking unit)) More than 1
        • Actions
          • -------- --------------------------- --------
          • -------- If the caster has got the level up to 1, add more probability. --------
          • For each (Integer A) from 1 to ((Level of Fire Knock for (Attacking unit)) - 1), do (Set FK_ProbabilityVerify = (FK_ProbabilityVerify + 5.00))
          • -------- --------------------------- --------
        • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Conditions
          • FK_Probability Less than or Equal to FK_ProbabilityVerify
        • Actions
          • -------- --------------------------- --------
          • -------- The Dinamic Indexing. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Conditions
              • FK_Index1 = 0
            • Actions
              • Trigger - Turn on FK Loop <gen>
            • Actions
          • Set FK_Index1 = (FK_Index1 + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Conditions
              • FK_Index1 Mayor que FK_RecycleIndex
            • Actions
              • Set FK_Index2[FK_Index1] = PS_Index1
              • Set FK_RecycleIndex = PS_Index1
            • Actions
          • -------- --------------------------- --------
          • Set FK_CurrentIndex = FK_Index2[FK_Index1]
          • -------- --------------------------- --------
          • Set FK_Knockbacked[FK_CurrentIndex] = (Attacked unit)
          • Set FK_Knockbacker[FK_CurrentIndex] = (Attacking unit)
          • -------- --------------------------- --------
          • -------- I don't know to say this. --------
          • Set FK_Angle[FK_CurrentIndex] = (Angle from (Position of FK_Knockbacked[FK_CurrentIndex]) to (Position of FK_Knockbacker[FK_CurrentIndex]))
          • -------- --------------------------- --------
          • -------- The velocity of Knock. (Use first of number a [ - ]) --------
          • Set FK_Velocity = -11.00
          • -------- --------------------------- --------
          • -------- Only little numbers. --------
          • Set FK_MaxDistance[FK_CurrentIndex] = (30.00 + (10.00 x (Real((Level of Fire Knock for FK_Knockbacker[PS_CurrentIndex])))))
          • -------- --------------------------- --------
          • -------- Area for damage and trees. --------
          • Set FK_DamageArea[FK_CurrentIndex] = 200.00
          • -------- --------------------------- --------
          • Set FK_DestroyTrees[FK_CurrentIndex] = True
          • Unit - Turn collision for FK_Knockbacked[FK_CurrentIndex] Closed
        • Actions
  • FK Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer FK_Index3) from 1 to FK_Index1, do (Actions)
        • Loop - Actions
          • Set FK_CurrentIndex = FK_Index2[FK_Index3]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Conditions
              • FK_MaxDistance[FK_CurrentIndex] More than 0.00
            • Conditions
              • Set FK_MaxDistance[FK_CurrentIndex] = (FK_MaxDistance[FK_CurrentIndex] - 1.00)
              • Set FK_LeakPoint = ((Position of FK_Knockbacked[FK_CurrentIndex]) offset by FK_Velocity towards FK_Angle[FK_CurrentIndex] degrees)
              • -------- --------------------------- --------
              • Unidad - Move FK_Knockbacked[FK_CurrentIndex] instantly to FK_LeakPoint
              • -------- --------------------------- --------
              • -------- Dmg --------
              • Unit - Order FK_Knockbacker[FK_CurrentIndex] to damage FK_Knockbacked[FK_CurrentIndex] for 2.50 using attack type Spell and damage type Fire.
              • -------- --------------------------- --------
              • -------- A nice special effect. --------
              • Special Effect - Create a special effect attached to the chest of FK_Knockbacked[FK_CurrentIndex] using Abilities\Weapons\RedDragonBreath\RedDragonMissile.mdl
              • Special Effect - Destroy (Last created special effect)
              • -------- --------------------------- --------
              • -------- Clearing a leak. --------
              • Custom script: set bj_wantDestroyGroup=true
              • -------- --------------------------- --------
              • Unit Group - Pick every unit in (Units within FK_DamageArea[FK_CurrentIndex] of FK_LeakPoint matching ((((Matching unit) is A building) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((((Matching unit) is Flying unit) Equal to False) or ((Matching unit) Not Equal to enemy of Owner of FK_Knockbacker[FK_CurrentIndex] and do (Actions)
                • Loop - Actions
                  • -------- --------------------------- --------
                  • -------- Dmg --------
                  • Unt - Order FK_Knockbacker[FK_CurrentIndex] to damage (Picked unit) for 2.50 using attack type Spell and damage type Fire.
                  • -------- --------------------------- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • Conditions
                      • (Random integer number between 1 and 5) Equal to 1
                    • Actions
                      • -------- --------------------------- --------
                      • -------- Another nice special effect. --------
                      • Special effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\PhoenixMissile\Phoenix_Missile.mdl
                      • Special effect - Destroy (Last created special effect)
                      • -------- --------------------------- --------
                    • Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Conditions
                  • FK_DestroyTrees[FK_CurrentIndex] Equal to True
                • Actions
                  • Destructible - Pick every destructible within FK_DamageArea[FK_CurrentIndex] of FK_LeakPoint and do (Destructible - Kill (Picked destructible))
                • Actions
              • -------- --------------------------- --------
              • -------- Clearing a leak. --------
              • Custom script: call RemoveLocation (udg_FK_LeakPoint)
              • -------- --------------------------- --------
            • Actions
              • -------- --------------------------- --------
              • -------- Reseting the collision of Knockbacked and removing one caster from casting. --------
              • Unit - Turn collision for FK_Knockbacked[FK_CurrentIndex] Open
              • Set FK_Index2[FK_Index3] = FK_Index2[FK_Index1]
              • Set FK_Index2[FK_Index1] = FK_CurrentIndex
              • Set FK_Index1 = (FK_Index1 - 1)
              • Set FK_Index3 = (FK_Index3 - 1)
              • -------- --------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Conditions
          • FK_Index1 Igual a 0
        • Actions
          • Trigger - Turn off (This trigger)
        • Actions
Version 1.00b:
Added a damage system for Fire Knock.

Credits: Weep for GDD.

Keywords:
spells, spell, pack, knock, force, shock, shockwave, Philipe.
Contents

Philipe's test map - Force Spells (Map)

Reviews
12.12 IcemanBo: For long time as NeedsFix. Rejected. Bribe: The indexing structure seems to have gotten mixed up. It's not done correctly. Recycle if last recycled != 0, create new if recycled == 0. I don't know why you're comparing "PS_Index1...

Moderator

M

Moderator

12.12
IcemanBo: For long time as NeedsFix. Rejected.

Bribe:

The indexing structure seems to have gotten mixed up. It's not done correctly. Recycle if last recycled != 0, create new if recycled == 0. I don't know why you're comparing "PS_Index1 Greater than PS_RecycleIndex"

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
    • (Level of A000 for (Triggering unit)) Greater than 2
  • Then - Actions
    • Set PS_KnockVerify[PS_CurrentIndex] = true
  • Else - Actions
    • Set PS_KnockVerify[PS_CurrentIndex] = false
Instead of that, just do "Set PS_KnockVerify[PS_CurrentIndex] = (Level of A000 for (Triggering unit)) Greater than 2"

(Level of (Ability being cast) for (Triggering unit)) you should set this into a variable because you reference it a lot. Reference the variable instead.

PS Loop leaks (Position of PS_Shockwave[PS_CurrentIndex]), (Position of (Picked unit)) x2 and (Position of PS_Shockwave[PS_CurrentIndex])

FK Init can be abused by pressing the "stop" button really quickly as "Unit is attacked" is really abusable.

(Level of A001 for (Attacking unit)) store into a variable

(Position of FK_Knockbacked[FK_CurrentIndex]) leaks and (Position of FK_Knockbacker[FK_CurrentIndex]) leaks

FK Loop

(Position of FK_Knockbacked[FK_CurrentIndex]) leaks.

##Needs Fix##
 
since this only have two spells, I think you would have no problem obtaining an in-game screenie...

This:
  • For each (Integer A) from 1 to ((Level of Fire Knock for (Attacking unit)) - 1), do (Set FK_ProbabilityVerify = (FK_ProbabilityVerify + 5.00))
could be changed to:
  • Set FK_ProbabilityVerify = (FK_ProbabilityVerify + (5.00*((Level of Fire Knock for (Attacking unit)) - 1))
Though I would suggest a reconstruction of the whole trigger since the event:
  • Unit - A units is attacked
is abusable... so you better learn how to use a damage detection system...

And pleas post the knockback loop too...
 
Top