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

Shadow Paralysis v1.4

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: Meatmuffin
228981-albums7784-picture91912.png

228981-albums7784-picture91914.png

228981-albums7784-picture91915.png

228981-albums7784-picture91917.png



  • REQUIRED VARIABLES
    • Events
    • Conditions
    • Actions
      • -------- [SETUP AT MAP INITIALIZATION] --------
      • Set AbilityId = Shadow Paralysis
      • Set DummyId = Chicken
      • Set OrderId = channel
      • Set Attack_Type = Spells
      • Set Damage_Type = Magic
      • Set AssignedDPS[1] = 3.00
      • Set AssignedDPS[2] = 6.00
      • Set AssignedDPS[3] = 9.00
      • Set AssignedMPS[1] = 10.00
      • Set AssignedMPS[2] = 20.00
      • Set AssignedMPS[3] = 30.00
      • -------- [SETUP AT ABILITY TRIGGER] --------
      • Set AssignedCaster = No unit
      • Set AssignedDistance = 0.00
      • Set AssignedTarget = (Target point of ability being cast)


  • SP Call
    • Events
    • Conditions
    • Actions
      • Set SP_Integer[0] = (SP_Integer[0] + 1)
      • Set SP_Caster[SP_Integer[0]] = AssignedCaster
      • Set SP_Target[SP_Integer[0]] = AssignedTarget
      • Set SP_StartDistance[SP_Integer[0]] = (Position of SP_Caster[SP_Integer[0]])
      • Set SP_EndDistance[SP_Integer[0]] = AssignedDistance
      • Set SP_Level[SP_Integer[0]] = (Level of AbilityId for SP_Caster[SP_Integer[0]])
      • Set SP_DPS[SP_Integer[0]] = AssignedDPS[SP_Level[SP_Integer[0]]]
      • Set SP_MPS[SP_Integer[0]] = AssignedMPS[SP_Level[SP_Integer[0]]]
      • Set SP_Angle[SP_Integer[0]] = (Angle from SP_StartDistance[SP_Integer[0]] to SP_Target[SP_Integer[0]])
      • Set SP_Last[SP_Integer[0]] = SP_Caster[SP_Integer[0]]
      • Set SP_Group[SP_Integer[0]] = (Random 0 units from (Units in (Playable map area)))
      • Set SP_Paralyzed[SP_Integer[0]] = (Random 0 units from (Units in (Playable map area)))
      • Set SP_LastPoint[SP_Integer[0]] = (Position of SP_Last[SP_Integer[0]])
      • Set SP_Player[SP_Integer[0]] = (Owner of SP_Caster[SP_Integer[0]])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SP_Integer[0] Equal to 1
        • Then - Actions
          • Trigger - Turn on SP Loop <gen>
        • Else - Actions


  • SP Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer SP_Integer[1]) from 1 to SP_Integer[0], do (Actions)
        • Loop - Actions
          • Set SP_CurDPS[SP_Integer[1]] = (SP_DPS[SP_Level[SP_Integer[1]]] x 0.03)
          • Set SP_CurMPS[SP_Integer[1]] = (SP_MPS[SP_Level[SP_Integer[1]]] x 0.03)
          • Set SP_LastPoint[SP_Integer[1]] = (Position of SP_Last[SP_Integer[1]])
          • Unit - Set mana of SP_Caster[SP_Integer[1]] to ((Mana of SP_Caster[SP_Integer[1]]) - SP_CurMPS[SP_Integer[1]])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between SP_StartDistance[SP_Integer[1]] and SP_LastPoint[SP_Integer[1]]) Less than SP_EndDistance[SP_Integer[1]]
            • Then - Actions
              • Set SP_Point[SP_Integer[1]] = (SP_LastPoint[SP_Integer[1]] offset by 35.00 towards SP_Angle[SP_Integer[1]] degrees)
              • Unit - Create 1 DummyId for SP_Player[SP_Integer[1]] at SP_Point[SP_Integer[1]] facing Default building facing degrees
              • Set SP_Last[SP_Integer[1]] = (Last created unit)
              • Unit Group - Add SP_Last[SP_Integer[1]] to SP_Group[SP_Integer[1]]
              • Custom script: call RemoveLocation(udg_SP_Point[udg_SP_Integer[1]])
            • Else - Actions
              • Custom script: call RemoveLocation(udg_SP_LastPoint[udg_SP_Integer[1]])
          • Unit Group - Pick every unit in SP_Group[SP_Integer[1]] and do (Actions)
            • Loop - Actions
              • Set SP_Picked = (Picked unit)
              • Set TempPoint = (Position of SP_Picked)
              • Set TempGroup = (Units within 85.00 of TempPoint)
              • Unit Group - Pick every unit in TempGroup and do (Actions)
                • Loop - Actions
                  • Set TempPicked = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (TempPicked is A structure) Equal to False
                      • (TempPicked is in SP_Paralyzed[SP_Integer[1]]) Equal to False
                      • (TempPicked is alive) Equal to True
                      • TempPicked Not equal to SP_Caster[SP_Integer[1]]
                      • (Unit-type of TempPicked) Not equal to DummyId
                      • (TempPicked belongs to an enemy of SP_Player[SP_Integer[1]]) Equal to True
                    • Then - Actions
                      • Unit - Pause TempPicked
                      • Animation - Change TempPicked's animation speed to 0.00% of its original speed
                      • Unit Group - Add TempPicked to SP_Paralyzed[SP_Integer[1]]
                    • Else - Actions
                  • Set TempPicked = No unit
              • Custom script: call DestroyGroup(udg_TempGroup)
              • Custom script: call RemoveLocation(udg_TempPoint)
              • Set SP_Picked = No unit
          • Unit Group - Pick every unit in SP_Paralyzed[SP_Integer[1]] and do (Actions)
            • Loop - Actions
              • Set SP_Temp = (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (SP_Temp is alive) Equal to True
                • Then - Actions
                  • Unit - Cause SP_Caster[SP_Integer[1]] to damage SP_Temp, dealing SP_CurDPS[SP_Integer[1]] damage of attack type Attack_Type and damage type Damage_Type
                • Else - Actions
                  • Unit Group - Remove SP_Temp from SP_Paralyzed[SP_Integer[1]]
                  • Animation - Change SP_Temp's animation speed to 100.00% of its original speed
              • Set SP_Temp = No unit
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Mana of SP_Caster[SP_Integer[1]]) Less than SP_MPS[SP_Level[SP_Integer[1]]]
            • Then - Actions
              • Unit - Order SP_Caster[SP_Integer[1]] to Stop
            • Else - Actions


  • SP EndCall
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to AbilityId
    • Actions
      • For each (Integer SP_Integer[2]) from 1 to SP_Integer[0], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SP_Caster[SP_Integer[2]] Equal to (Triggering unit)
            • Then - Actions
              • Unit Group - Pick every unit in SP_Group[SP_Integer[2]] and do (Actions)
                • Loop - Actions
                  • Set SP_Picked = (Picked unit)
                  • Unit - Remove SP_Picked from the game
                  • Set SP_Picked = No unit
              • Unit Group - Pick every unit in SP_Paralyzed[SP_Integer[2]] and do (Actions)
                • Loop - Actions
                  • Set SP_Temp = (Picked unit)
                  • Unit - Unpause SP_Temp
                  • Animation - Change SP_Temp's animation speed to 100.00% of its original speed
                  • Set SP_Temp = No unit
              • Custom script: call DestroyGroup(udg_SP_Group[udg_SP_Integer[2]])
              • Custom script: call DestroyGroup(udg_SP_Paralyzed[udg_SP_Integer[2]])
              • Set SP_Angle[SP_Integer[2]] = SP_Angle[SP_Integer[0]]
              • Set SP_Caster[SP_Integer[2]] = SP_Caster[SP_Integer[0]]
              • Set SP_DPS[SP_Integer[2]] = SP_DPS[SP_Integer[0]]
              • Set SP_EndDistance[SP_Integer[2]] = SP_EndDistance[SP_Integer[0]]
              • Set SP_Group[SP_Integer[2]] = SP_Group[SP_Integer[0]]
              • Set SP_Group2[SP_Integer[2]] = SP_Group2[SP_Integer[0]]
              • Set SP_Last[SP_Integer[2]] = SP_Last[SP_Integer[0]]
              • Set SP_Level[SP_Integer[2]] = SP_Level[SP_Integer[0]]
              • Set SP_MPS[SP_Integer[2]] = SP_MPS[SP_Integer[0]]
              • Set SP_Player[SP_Integer[2]] = SP_Player[SP_Integer[0]]
              • Set SP_Point[SP_Integer[2]] = SP_Point[SP_Integer[0]]
              • Set SP_StartDistance[SP_Integer[2]] = SP_StartDistance[SP_Integer[0]]
              • Set SP_Target[SP_Integer[2]] = SP_Target[SP_Integer[0]]
              • Set SP_Integer[2] = SP_Integer[0]
              • Set SP_Caster[SP_Integer[0]] = No unit
              • Set SP_Last[SP_Integer[0]] = No unit
              • Set SP_Integer[0] = (SP_Integer[0] - 1)
              • Set SP_Integer[1] = (SP_Integer[1] - 1)
              • Set SP_Integer[2] = (SP_Integer[2] - 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SP_Integer[0] Equal to 0
        • Then - Actions
          • Trigger - Turn off SP Loop <gen>
        • Else - Actions



Usage:
* Note: Be sure to enable "Automatically create unknown variables while pasting trigger data" on the General tab of your World Editor Preferences.
- Copy the whole Shadow Paralysis folder to your map.
- Configure everything listed in the REQUIRED VARIABLES section.


* v1.0 - initial release
* v1.1 - Reworked the whole code.
* v1.2 - Fixed some leaks on SP Loop Trigger.
* v1.3 - Fixed issues with SP EndCall and is now fully MUI.
* v1.4 - Optimized several variables and also added few configurations.


"Don't forget! Credits for use."

Keywords:
Naruto,Shadow,channel,MUI
Contents

ShadowParalysis (Map)

Reviews
12th Dec 2015 IcemanBo: For long time as NeedsFix. Rejected. 14:32, 5th Jan 2015 Maker: Check my reply in this thread.

Moderator

M

Moderator

12th Dec 2015
IcemanBo: For long time as NeedsFix. Rejected.

14:32, 5th Jan 2015
Maker: Check my reply in this thread.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Only use and all condition blocks inside an or all condition block.

Anything used twice or more should be stored in a variable and the variable should be used. Example: Picked unit should be stored.

These leak locations.
  • (Distance between (Position of SP_Caster[SP_Loop_Integer]) and (Position of SP_DummyVar[SP_Loop_Integer])) Less than SP_Distance[SP_Loop_Integer]
  • Set SP_SpawnPoint[SP_Loop_Integer] = ((Position of SP_DummyVar[SP_Loop_Integer]) offset by 35.00 towards SP_Angle[SP_Loop_Integer] degrees)
  • Set SP_Detector[SP_Loop_Integer] = (Units within DetectRadius of (Position of SP_Shadow[SP_Loop_Integer]))
  • Set SP_Angle[SP_Index] = (Angle from (Position of SP_Caster[SP_Index]) to SP_Target[SP_Index])
You also never remove the locations that you set so all of them leak.

Never use Integer A/B. Create an integer variable and use that for your looping.

Also abilities should be able to have multiple levels.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
  • Custom Script: call SetUnitPropWindow( SP_Shadow[SP_Loop_Integer], 0)
To enable movement once more, do
  • Custom script: call GetUnitDefaultWindow( SP_Shadow[SP_Loop_Integer] )

You have to get the units prop window first and set it to a variable then you have to set the units prop window.

Getting the units default prop window is bugged and can cause unwanted results.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
You have location leaks.

You store picked unit in a variable above this but you should use it in these conditions.
  • ((Picked unit) is A structure) Equal to False
  • ((Picked unit) is in SP_Paralyzed[SP_Integer[1]]) Equal to False
  • ((Picked unit) is alive) Equal to True
  • (Picked unit) Not equal to SP_Caster[SP_Integer[1]]
  • (Unit-type of (Picked unit)) Not equal to DummyId
  • ((Picked unit) belongs to an enemy of (Owner of SP_Caster[SP_Integer[1]])) Equal to True
This should be in your de-indexing code.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • SP_Integer[0] Equal to 0
  • Then - Actions
  • Trigger - Turn off (This trigger)
  • Else - Actions
You should include a changelog so people know what you fixed.
Never rename a version from 1.0 to 1.0[reworked] What is your next version ? 1.0[reworked again] ?
Just name it v1.1
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
There are some leaks.
  • Set SP_Angle[SP_Integer[0]] = (Angle from (Position of SP_Caster[SP_Integer[0]]) to SP_Target[SP_Integer[0]])
  • (Distance between SP_StartDistance[SP_Integer[1]] and (Position of SP_Last[SP_Integer[1]])) Less than SP_EndDistance[SP_Integer[1]]
  • Set SP_Point[SP_Integer[1]] = ((Position of SP_Last[SP_Integer[1]]) offset by 35.00 towards SP_Angle[SP_Integer[1]] degrees)
    • Set SP_Group2[SP_Integer[1]] = (Units within 45.00 of (Position of SP_Picked[SP_Integer[1]]))
This should be stored in a variable as it will most likely be used more than once.
  • (SP_DPS[SP_Level[SP_Integer[1]]] x 0.03)
  • /// And this.
  • (SP_MPS[SP_Level[SP_Integer[1]]] x 0.03)
  • /// And this.
    • (Owner of SP_Caster[SP_Integer[1]]))
You should use a tempGroup instead of SP_Group2[SP_Integer[1]]
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
-Paralysis spell should not pause units

-Set SP_Group[SP_Integer[0]] = (Random 0 units from (Units in (Playable map area)))
^That is an unnecessarily heavy action and created leaks that are unavoidable with GUI. Use
Custom script : Set udg_SP_Group[udg_SP_Integer[0]] = CreateGroup()

-Use leak LastPoint

Needs Fix
 
Level 5
Joined
May 14, 2013
Messages
48
-Paralysis spell should not pause units

-Set SP_Group[SP_Integer[0]] = (Random 0 units from (Units in (Playable map area)))
^That is an unnecessarily heavy action and created leaks that are unavoidable with GUI. Use
Custom script : Set udg_SP_Group[udg_SP_Integer[0]] = CreateGroup()

-Use leak LastPoint

Needs Fix
Can you direct me to an alternative method of pausing units? All I know about it is in GUI... Thanks.
 
Top