1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  5. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  6. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  7. The results are out! Check them out.
    Dismiss Notice
  8. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  9. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Trigger Viewer

Pandarean Earthshaker v2.1.w3x
Variables
--- Hero Contest #2 ---
---- Entry by Aspard ----
Pandarean Earthshaker
---------------------------
----- README -----
----- README -----
---------------------------
--- Seismic Bounce ---
IsTerrainWalkable
Seismic Bounce
--- Heavy Smash ---
Heavy Smash Loop
--- Ground Fury ---
--- Ultimate! ---
Ground Fury
Ground Fury Loop
Ground Fury Stop
GUI Knockback System [Paladon]
---------------------------
Readme
Actions to apply Копировать
---------------------------
GUI Knockback Sytem
---------------------------
Cast A Knockback
Get Knockback
---------------------------
Jump System [Paladon]
---------------------------
Readme
Actions to apply
---------------------------
Jump System 1
Jump System 2
---------------------------
Damage Detect System
DDS Main
DDS Add Unit
DDS Init
--- This map Only ---
Commands
Information
Hero Creation
Tester Dies
ESC System
LevelMax
Initialization
Melee Initialization

		
Name Type Is Array Initial Value
DDS_Detect group No
GF_Caster unit Yes
GF_DummyLoc location Yes
GF_Effect effect Yes
GF_Hero unit No
GF_HeroEffect effect No
GF_HeroLoc location No
GF_Index integer Yes
GF_Integer integervar No
GF_MoveLoc location Yes
GF_Rect rect No
GF_Stop boolean Yes
GF_TargetLoc location Yes
GF_TempLoc location No
GF_Transp real Yes
GF_UnitDummy unit Yes
GF_UnitTarget unit Yes
HS_Boolean boolean Yes
HS_Group group No
HS_Index integer Yes
HS_Loc location No
HS_Rect rect No
HS_Unit unit Yes
JD_Angle real Yes
JD_Animations string Yes
JD_Distances real Yes
JD_Effect string Yes
JD_Group group No
JD_HighSettings real Yes
JD_Integers integer Yes
JD_JumpHigh real Yes
JD_ReachedDistance real Yes
JD_RealTimer real Yes
JD_SpeedUnits real Yes
JD_TempPoint location Yes
JD_TreesDestroy boolean Yes
JD_Unit unit Yes
JDA_Animation string No
JDA_AnimationSpeed real No
JDA_DestroyTrees_Dash boolean No
JDA_JumpHigh_Distance real No
JDA_SpecialEffect string No
JDA_Speed real No
JDA_TargetPoint location No
JDA_Unit unit No
KB_Angle real Yes
KB_Casters unit Yes
KB_CountBuffs integer No
KB_DestroyTrees boolean Yes
KB_EffectCounter integer Yes
KB_EffectCounter2 integer Yes
KB_Effects_1 string Yes
KB_Effects_2 string Yes
KB_GeneralIntegers integervar Yes
KB_KnockbackedUnits group No
KB_Levels integer Yes
KB_MaxDistance real Yes
KB_ReachedDistance real Yes
KB_ReducedReal real No
KB_ReduceSpeedReal real Yes
KB_SpecificSpeed real Yes
KB_StartPositions location Yes
KB_TempPoint location Yes
KB_TempReal real No
KB_TotalKnockUnits integer No
KB_Units unit Yes
KBA_Caster unit No
KBA_DestroyTrees boolean No
KBA_DistancePerLevel real No
KBA_Level integer No
KBA_SpecialEffects string Yes
KBA_Speed real No
KBA_StartingPosition location No
KBA_TargetUnit unit No
SB_AoE real No
SB_Damage real No
SB_Integer integervar No
SB_Jumps integer No
SB_Loc location No
SB_Region rect No
SB_Unit unit No
SB_X real No
SB_Y real No
SS_Loc location No
Temp_Group group No
TempLoc location No
Tester unit No
X real No
Y real No
Credits:
1) Paladon: For his Knockback and Jumping systems.
2) WILLTHEALLMIGHTY: For his Dirt Explosion model.
3) JetFangInferno: For his Bubble model.
4) Anitarf: IsTerrainWalkable library (fixed by Deuterium)
5) Xiliger: Damage Detection System

------------------
Hero Idea
------------------
The Pandareans are definetily the most famous race to expand in WarCraft 3 community. I hope, my contrubution won't be left unmarked by those fans and mapmakers.
Definetily, the idea of using this particular model came to me during looking through all WarCraft models (I didn't want to use custom one, dunno).

-------------
Spells
-------------
---------------------------
Seismic Bounce
---------------------------
The idea of this spell was inspired by somebody far-far ago, when Squiggy opened his own Spellfactory just after the closing of Paladon's and Dynasti's one. Someone made such a request and I young and unexperienced tryed to create it. Well, I failed. And left the idea of it. Now I remembered about it and with my last studyings of local variables I managed to reach the goal! So here is an epic spell with an outstanding quality, without leaks and MUI!

-------------------
Stoke Skin
--------------------
Definetily, being kinda of an "Earth Mage" makes any unit be able to protect himself the way of using this earth magic. So here is the spell: It's kinda of Liches "Frost Armor", but still has better defense rate (Should the stone protect better than the ice, huh?) and instead of reducing the movement speed of the attacking units, it gives them a chance (Melee only, of course!) to break their weapons by the stone!

-------------------------
Heavy Smash
-------------------------
This spell stands for a passive one. The idea is that the caster creates kinda a ground defections under the targeted unit, so he get stunned entirely, but the others around are just slowed...

Continue reading...
-------------------------
Heavy Smash
-------------------------
... The damage is balanced due to lack of damaging and disabling skills of hero as far as in comparison to Mountain King's "Bash" spell. The damage is higher just for the target, for all other units is lower. The duration for heroes is also shorter. So, balanced, I think.

-----------------------
Ground Fury
-----------------------
I think, that's a really epic job I made! After facing many different troubles and bugs I managed to reach the aim I've put for myself. The things begin from the MUIness and leakless of the spell up to the lovely special effects, hero animation, changing the transparency and flying height of the dummies to outstanding dummy movement system, knockback attachment and balanced damage! Also it fits hero great as far as the WarCraft 3!


Thanks for reading all this stuff.

------------- Implementation -------------
1) Copy next folders from Trigger Editor into your map: Pandarean Earthshaker; GUI Knockback System [Paladon]; Jump System [Paladon]; Damage Detect System.
2) Copy both units from the Object Editor or yous your own Dummy Unit, if you are sure is setted up quite good
3) Copy all the spells (5 items: 4 hero abilities and 1 dummy ability) from the Object Editor
4) Copy both effects from Object Editor
...
5) Make sure there are no misses or bugs overall in your Spells/Triggers, especially consisting Raw Codes etc
//TESH.scrollpos=0
//TESH.alwaysfold=0
// This library has been slightly edited by Deuterium
// for the sake of making it function with GUI flawlessly.

library IsTerrainWalkable initializer Init

//*****************************************************************
//*  IsTerrainWalkable
//*
//*  rewritten in vJass by: Anitarf
//*  original implementation: Vexorian
//*
//*  A function for checking if a point is pathable for ground
//*  units (it does so by attempting to move an item there and
//*  checking where it ended up), typically used to stop sliding
//*  units before they end up stuck in trees. If the point is not
//*  pathable, the function will also determine the nearest point
//*  that is (the point where the item ends up).
//*****************************************************************

    globals
        // this value is how far from a point the item may end up for the point to be considered pathable
        private constant real MAX_RANGE = 10.0
       
        // the following two variables are set to the position of the item after each pathing check
        // that way, if a point isn't pathable, these will be the coordinates of the nearest point that is
        // public real X = 0.0
        // public real Y = 0.0

   
// END OF CALIBRATION SECTION    
// ================================================================

        private rect r
        private item check
        private item array hidden
        private integer hiddenMax = 0
    endglobals

    private function Init takes nothing returns nothing
        set check = CreateItem('ciri',0,0)
        call SetItemVisible(check,false)
        set r = Rect(0.0,0.0,128.0,128.0)
    endfunction

    private function HideBothersomeItem takes nothing returns nothing
        if IsItemVisible(GetEnumItem()) then
            set hidden[hiddenMax]=GetEnumItem()
            call SetItemVisible(hidden[hiddenMax],false)
            set hiddenMax=hiddenMax+1
        endif
    endfunction

// ================================================================
   
    function IsTerrainWalkable takes real x, real y returns boolean
        // first, hide any items in the area so they don't get in the way of our item
        call MoveRectTo(r, x,y)
        call EnumItemsInRect(r,null,function HideBothersomeItem)
        // try to move the check item and get it's coordinates
        call SetItemPosition(check,x,y)//this unhides the item...
        set udg_X = GetItemX(check)
        set udg_Y = GetItemY(check)
        call SetItemVisible(check,false)//...so we must hide it again
        // before returning, unhide any items that got hidden at the start
        loop
            exitwhen hiddenMax<=0
            set hiddenMax=hiddenMax-1
            call SetItemVisible(hidden[hiddenMax],true)
            set hidden[hiddenMax]=null
        endloop
        // return pathability status
        return (x-udg_X)*(x-udg_X)+(y-udg_Y)*(y-udg_Y) < MAX_RANGE*MAX_RANGE
    endfunction
endlibrary
Seismic Bounce
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Seismic Bounce
  Actions
    Custom script: local real r
    Custom script: local location l
    Custom script: local unit array u
    Custom script: local integer i = 1
    -------- SETTINGS --------
    -------- ----------- --------
    -------- Variable to set the damage --------
    -------- ----------- --------
    Set SB_Damage = (80.00 x (Real((Level of Seismic Bounce for (Triggering unit)))))
    Custom script: set r = udg_SB_Damage
    -------- ----------- --------
    -------- Variable to set the number of jumps --------
    -------- Attention! Setting this to non-fixed rate will result in spell ruin unless it's used more than one hero at a time! --------
    -------- ----------- --------
    Set SB_Jumps = 3
    -------- ----------- --------
    -------- Variable to set AoE of where the unit will jump --------
    -------- Attention! I don't recommend to set this variable to level-depending rate. --------
    -------- ----------- --------
    Set SB_AoE = 550.00
    -------- ----------- --------
    -------- END OF SETTINGS --------
    -------- ----------- --------
    -------- Setting the hero into variable in order to restore him at the end --------
    -------- So the local "u[0]" will be him --------
    -------- ----------- --------
    Set SB_Unit = (Triggering unit)
    Custom script: set u[0] = udg_SB_Unit
    -------- ----------- --------
    -------- Storing Casting Unit's loc into variable to create rect and determine the target place --------
    -------- ----------- --------
    Set SB_Loc = (Position of SB_Unit)
    -------- ----------- --------
    -------- Hiding and pausing hero to prevent him from attacking --------
    -------- ----------- --------
    Unit - Hide SB_Unit
    Unit - Pause SB_Unit
    -------- ----------- --------
    -------- And here jumps go themselves --------
    -------- ----------- --------
    For each (Integer SB_Integer) from 1 to SB_Jumps, do (Actions)
      Loop - Actions
        -------- ----------- --------
        -------- Creating dummy and adding model to it --------
        -------- And creating special effect on it to make it look like Panda --------
        -------- ----------- --------
        Unit - Create 1 Dummy for (Owner of SB_Unit) at SB_Loc facing Default building facing degrees
        Special Effect - Create a special effect attached to the chest of (Last created unit) using Units\Creeps\EarthPandarenBrewmaster\EarthPandarenBrewmaster_Missile.mdl
        -------- ----------- --------
        -------- Setting dumy into variable in order to use it in future --------
        -------- So the local "u[1]" will be him --------
        -------- ----------- --------
        Set SB_Unit = (Last created unit)
        Custom script: set u[1] = udg_SB_Unit
        -------- ----------- --------
        -------- Determining the target place of jump --------
        -------- ----------- --------
        Set SB_Region = (Region centered at SB_Loc with size (SB_AoE, SB_AoE))
        Set SB_Loc = (Random point in SB_Region)
        Custom script: set udg_SB_X = GetLocationX(udg_SB_Loc)
        Custom script: set udg_SB_Y = GetLocationY(udg_SB_Loc)
        Custom script: if not IsTerrainWalkable(udg_SB_X, udg_SB_Y) then
        Custom script: set udg_SB_X = udg_X
        Custom script: set udg_SB_Y = udg_Y
        Custom script: endif
        Custom script: set udg_SB_Loc = Location(udg_X, udg_Y)
        -------- ----------- --------
        -------- And changing the local variable to it --------
        -------- ----------- --------
        Custom script: set l = udg_SB_Loc
        -------- ----------- --------
        -------- Leak removing --------
        -------- ----------- --------
        Custom script: call RemoveRect( udg_SB_Region )
        -------- ----------- --------
        -------- Just for eye-candy turning the dummy face to the target point --------
        -------- ----------- --------
        Unit - Make SB_Unit face SB_Loc over 0 seconds
        -------- ----------- --------
        -------- Here goes Paladon's jump system --------
        -------- ----------- --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            JD_Integers[1] Equal to 0
          Then - Actions
            Trigger - Turn on Jump_System_2 <gen>
          Else - Actions
        Set JD_Integers[1] = (JD_Integers[1] + 1)
        Set JD_Integers[2] = (JD_Integers[2] + 1)
        Set JD_TempPoint[1] = (Position of SB_Unit)
        Set JD_Distances[JD_Integers[2]] = (Distance between JD_TempPoint[1] and SB_Loc)
        Set JD_ReachedDistance[JD_Integers[2]] = 0.00
        Set JD_SpeedUnits[JD_Integers[2]] = 10.00
        Set JD_Unit[JD_Integers[2]] = SB_Unit
        Set JD_Angle[JD_Integers[2]] = (Angle from JD_TempPoint[1] to SB_Loc)
        Set JD_Effect[JD_Integers[2]] = JDA_SpecialEffect
        Set JD_Animations[JD_Integers[2]] = stand
        Set JD_TreesDestroy[JD_Integers[2]] = True
        Set JD_HighSettings[JD_Integers[2]] = (1.00 x JD_Distances[JD_Integers[2]])
        Unit - Turn collision for SB_Unit Off
        Animation - Change SB_Unit's animation speed to (1.00 x 100.00)% of its original speed
        Animation - Play SB_Unit's stand animation
        Unit Group - Add SB_Unit to JD_Group
        Custom script: call RemoveLocation (udg_JD_TempPoint[1])
        -------- ----------- --------
        -------- End of Paladon's system --------
        -------- ----------- --------
        -------- Then goes loop waiting for the dummy unit near the location by his collison size --------
        -------- ----------- --------
        Custom script: loop
        Custom script: exitwhen (IsUnitInRangeLoc(u[1], l, 36.) == true)
        Custom script: call TriggerSleepAction(-1.)
        Custom script: endloop
        -------- ----------- --------
        -------- Then we return our dummy and location variables back --------
        -------- ----------- --------
        Custom script: set udg_SB_Loc = l
        Custom script: set udg_SB_Unit = u[1]
        -------- ----------- --------
        -------- Destroying special effected, which has been attached to a unit --------
        -------- ----------- --------
        Special Effect - Destroy (Last created special effect)
        -------- ----------- --------
        -------- Creating a special effect at the target point after "landing" --------
        -------- If the dummy units lands on water - the effect will be water explosion --------
        -------- Just for eye-candy and realism --------
        -------- ----------- --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Terrain pathing at SB_Loc of type Floatability is off) Equal to False
          Then - Actions
            Special Effect - Create a special effect at SB_Loc using Objects\Spawnmodels\Naga\NagaDeath\NagaDeath.mdl
          Else - Actions
            Special Effect - Create a special effect at SB_Loc using NewDirtEXNofire.mdx
        -------- ----------- --------
        -------- And here goes leak removing --------
        -------- ----------- --------
        Special Effect - Destroy (Last created special effect)
        -------- ----------- --------
        -------- And making Dummy unit to damage particular area at it --------
        -------- Restoring the damage for this particular unit --------
        -------- ----------- --------
        Custom script: set udg_SB_Damage = r
        -------- ----------- --------
        -------- Creating and destroying group --------
        -------- Using wantDestroyGroup to avoid leak --------
        -------- ----------- --------
        Custom script: set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units within 256.00 of SB_Loc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of SB_Unit)) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and (((Matching unit) is A ground unit) Equal to True)))))) and do (Actions)
          Loop - Actions
            Unit - Cause SB_Unit to damage (Picked unit), dealing SB_Damage damage of attack type Spells and damage type Normal
            Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\TreantMissile\TreantMissile.mdl
            Special Effect - Destroy (Last created special effect)
        -------- ----------- --------
        -------- Removing the dummy --------
        -------- ----------- --------
        Unit - Remove SB_Unit from the game
        -------- ----------- --------
        -------- Preventing bug, which ruins the number of jumps and the spell entirely if used by more than one unit --------
        -------- ----------- --------
        Custom script: set udg_SB_Integer = i
        Custom script: set i = i + 1
        -------- ----------- --------
        -------- And the loop begins again... --------
        -------- ----------- --------
    -------- ----------- --------
    -------- Moving hero to the new point --------
    -------- Making some cosmetic improvements --------
    -------- ----------- --------
    Custom script: set udg_SB_Unit = u[0]
    Unit - Move SB_Unit instantly to SB_Loc
    Unit - Unhide SB_Unit
    Unit - Unpause SB_Unit
    Selection - Add SB_Unit to selection for (Owner of SB_Unit)
    -------- ----------- --------
    -------- And making the spell leakless --------
    -------- ----------- --------
    Custom script: call RemoveLocation(l)
    Custom script: set l = null
    Custom script: set r = 0
    Custom script: set u[0] = null
    Custom script: set u[1] = null
Heavy Smash Loop
  Events
    Time - Every 0.02 seconds of game time
  Conditions
  Actions
    For each (Integer HS_Index[2]) from 1 to HS_Index[1], do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            HS_Boolean[HS_Index[2]] Equal to False
          Then - Actions
            Animation - Change HS_Unit[HS_Index[2]] flying height to ((Current flying height of HS_Unit[HS_Index[2]]) + 6.00) at 0.00
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Current flying height of HS_Unit[HS_Index[2]]) Greater than or equal to 156.00
              Then - Actions
                Set HS_Boolean[HS_Index[2]] = True
              Else - Actions
          Else - Actions
            Animation - Change HS_Unit[HS_Index[2]] flying height to ((Current flying height of HS_Unit[HS_Index[2]]) - 12.00) at 0.00
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Current flying height of HS_Unit[HS_Index[2]]) Less than or equal to 13.00
              Then - Actions
                Animation - Change HS_Unit[HS_Index[2]] flying height to 0.00 at 0.00
                Unit - Unpause HS_Unit[HS_Index[2]]
                Unit Group - Remove HS_Unit[HS_Index[2]] from HS_Group
                -------- Indexing --------
                Set HS_Index[0] = (HS_Index[0] - 1)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    HS_Index[0] Equal to 0
                  Then - Actions
                    Set HS_Index[1] = 0
                    Trigger - Turn off (This trigger)
                  Else - Actions
              Else - Actions
Ground Fury
  Events
    Unit - A unit Begins casting an ability
  Conditions
    (Ability being cast) Equal to Ground Fury
  Actions
    Custom script: local effect e
    Custom script: local unit u
    Custom script: local rect r
    Custom script: local integer i = 1
    Custom script: local integer index = udg_GF_Index[0]
    -------- ----------- --------
    -------- Storing hero into local variable --------
    -------- ----------- --------
    Set GF_Hero = (Triggering unit)
    Custom script: set u = udg_GF_Hero
    -------- ----------- --------
    -------- Indexing to make the spell REALLY channeling --------
    -------- ----------- --------
    Set GF_Caster[GF_Index[0]] = (Triggering unit)
    Set GF_Stop[GF_Index[0]] = False
    Set GF_Index[0] = (GF_Index[0] + 1)
    Set GF_Index[5] = (GF_Index[5] + 1)
    -------- ----------- --------
    -------- Creating a rect where the boulders shall be spawned --------
    -------- ----------- --------
    Set GF_HeroLoc = (Position of GF_Hero)
    Set GF_Rect = (Region centered at GF_HeroLoc with size (200.00, 200.00))
    Custom script: set r = udg_GF_Rect
    -------- ----------- --------
    -------- Creating a lovely special effected attached to the hero --------
    -------- Just fot eye-candy --------
    -------- ----------- --------
    Special Effect - Create a special effect at GF_HeroLoc using Abilities\Spells\Undead\UnholyAura\UnholyAura.mdl
    Set GF_HeroEffect = (Last created special effect)
    Custom script: set e = udg_GF_HeroEffect
    -------- ----------- --------
    -------- Setting bj_wantDestroyGroup to true in order to prevent a group leak --------
    -------- ----------- --------
    Custom script: set bj_wantDestroyGroup = true
    -------- ----------- --------
    -------- Picking every unit in a range mathcing conditions --------
    -------- ----------- --------
    Unit Group - Pick every unit in (Units within 600.00 of GF_HeroLoc matching ((((Matching unit) belongs to an enemy of (Owner of GF_Hero)) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and (((Matching unit) is A structure) Equal to False)))))) and do (Actions)
      Loop - Actions
        -------- ----------- --------
        -------- Indexing --------
        -------- ----------- --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            GF_Index[1] Equal to 0
          Then - Actions
            Trigger - Turn on Ground_Fury_Loop <gen>
          Else - Actions
        Set GF_Index[1] = (GF_Index[1] + 1)
        Set GF_Index[2] = (GF_Index[2] + 1)
        -------- ----------- --------
        -------- End of Indexing --------
        -------- ----------- --------
        -------- Setting a random place in our rect to create a boulder here --------
        -------- ----------- --------
        Set GF_TempLoc = (Random point in GF_Rect)
        -------- ----------- --------
        -------- Storing picked unit into the variable to make the spell MUI --------
        -------- ----------- --------
        Set GF_UnitTarget[GF_Index[2]] = (Picked unit)
        -------- ----------- --------
        -------- Creating dummy unit for owner of casting unit --------
        -------- This will be our boulder --------
        -------- ----------- --------
        Unit - Create 1 Dummy for (Owner of GF_Hero) at GF_TempLoc facing Default building facing degrees
        -------- ----------- --------
        -------- Changing the flying height for this one unit group instantly, so the first picked units --------
        -------- are knockbacked as soon as the spell starts --------
        -------- Also changing the size of the unit for eye-candy --------
        -------- ----------- --------
        Animation - Change (Last created unit) flying height to 100.00 at 0.00
        Animation - Change (Last created unit)'s size to (95.00%, 95.00%, 95.00%) of its original size
        -------- ----------- --------
        -------- Storing last created unit into the variable to make the spell MUI --------
        -------- ----------- --------
        Set GF_UnitDummy[GF_Index[2]] = (Last created unit)
        -------- ----------- --------
        -------- Creating a "boulder" attachment to the last created unit to make him look like boulder --------
        -------- Also storing thie special effect into the variable to prevent leaks in future --------
        -------- ----------- --------
        Special Effect - Create a special effect attached to the origin of GF_UnitDummy[GF_Index[2]] using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
        Set GF_Effect[GF_Index[2]] = (Last created special effect)
        -------- ----------- --------
        -------- Leak removing --------
        -------- ----------- --------
        Custom script: call RemoveLocation(udg_GF_TempLoc)
    -------- ----------- --------
    -------- Leak removing --------
    -------- ----------- --------
    Custom script: call RemoveLocation(udg_GF_HeroLoc)
    -------- ----------- --------
    -------- And here we go the looping of our spell --------
    -------- ----------- --------
    For each (Integer GF_Integer) from 1 to 29, do (Actions)
      Loop - Actions
        -------- ----------- --------
        -------- Wait for eye-candy, balance and entire realisation of the spell idea --------
        -------- ----------- --------
        Wait 0.50 seconds
        -------- ----------- --------
        -------- Setting this in order to check, if the caster has already stopped casting an ability --------
        -------- ----------- --------
        Custom script: set udg_GF_Index[3] = index
        -------- ----------- --------
        -------- If so, we stop this trigger, destroy special effect and remove leaks --------
        -------- ----------- --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            GF_Stop[GF_Index[3]] Equal to True
          Then - Actions
            -------- ----------- --------
            -------- Put here all things u want to happen when the spell ends --------
            -------- ----------- --------
            Custom script: set udg_GF_HeroEffect = e
            Special Effect - Destroy GF_HeroEffect
            Set GF_Index[5] = (GF_Index[5] - 1)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                GF_Index[5] Equal to 0
              Then - Actions
                Set GF_Index[0] = (GF_Index[0] - 1)
              Else - Actions
            Set GF_Caster[GF_Index[3]] = GF_Caster[GF_Index[0]]
            Set GF_Stop[GF_Index[3]] = GF_Stop[GF_Index[0]]
            Custom script: set e = null
            Custom script: set i = 0
            Custom script: set r = null
            Custom script: set u = null
            Custom script: set index = 0
            Skip remaining actions
            -------- ----------- --------
          Else - Actions
        -------- ----------- --------
        -------- If no, we continue --------
        -------- ----------- --------
        -------- Here we set our hero back (Cause of the wait) --------
        -------- ----------- --------
        Custom script: set udg_GF_Hero = u
        -------- ----------- --------
        -------- The same we do for his casting location --------
        -------- And region --------
        -------- ----------- --------
        Set GF_HeroLoc = (Position of GF_Hero)
        Custom script: set udg_GF_Rect = r
        -------- ----------- --------
        -------- Group leak preventing --------
        -------- ----------- --------
        Custom script: set bj_wantDestroyGroup = true
        -------- ----------- --------
        -------- And here we check, if there are any enemy units around the caster --------
        -------- If now, we aren't going to spawn more boulders --------
        -------- ----------- --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Number of units in (Units within 600.00 of GF_HeroLoc matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of GF_Hero)) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and (((Matching unit) is A structure) Equal to False))))))) Greater than 0
          Then - Actions
            -------- ----------- --------
            -------- Indexing --------
            -------- ----------- --------
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                GF_Index[1] Equal to 0
              Then - Actions
                Trigger - Turn on Ground_Fury_Loop <gen>
              Else - Actions
            Set GF_Index[1] = (GF_Index[1] + 1)
            Set GF_Index[2] = (GF_Index[2] + 1)
            -------- ----------- --------
            -------- End of Indexing --------
            -------- ----------- --------
            -------- Next we determine locaion of where the boulder should be spawned --------
            -------- ----------- --------
            Set GF_TempLoc = (Random point in GF_Rect)
            -------- ----------- --------
            -------- And the target, which our unit should hit and knockback --------
            -------- ----------- --------
            Set GF_UnitTarget[GF_Index[2]] = (Random unit from (Units within 600.00 of GF_HeroLoc matching ((((Matching unit) belongs to an enemy of (Owner of GF_Hero)) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and (((Matching unit) is A structure) Equal to False)))))))
            -------- ----------- --------
            -------- The dummy himself goes next --------
            -------- Along with storing him into the variable --------
            -------- ----------- --------
            Unit - Create 1 Dummy for (Owner of GF_Hero) at GF_TempLoc facing Default building facing degrees
            Set GF_UnitDummy[GF_Index[2]] = (Last created unit)
            -------- ----------- --------
            -------- Here we set the size of the dummy unit just for eye-candy --------
            -------- And making the dummy unit look like a boulder --------
            -------- ----------- --------
            Animation - Change (Last created unit)'s size to (95.00%, 95.00%, 95.00%) of its original size
            Special Effect - Create a special effect attached to the origin of GF_UnitDummy[GF_Index[2]] using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
            Set GF_Effect[GF_Index[2]] = (Last created special effect)
            -------- ----------- --------
            -------- Leak removing --------
            -------- ----------- --------
            Custom script: call RemoveLocation(udg_GF_TempLoc)
          Else - Actions
        -------- ----------- --------
        -------- Removing leak --------
        -------- ----------- --------
        Custom script: call RemoveLocation(udg_GF_HeroLoc)
        -------- ----------- --------
        -------- We higher the Integer in order to prevent different bugs with number of boulders --------
        -------- ----------- --------
        Custom script: set udg_GF_Integer = i
        Custom script: set i = i + 1
    -------- ----------- --------
    -------- Here we destroy the special effect --------
    -------- ----------- --------
    Custom script: set udg_GF_HeroEffect = e
    Special Effect - Destroy GF_HeroEffect
    -------- ----------- --------
    -------- And here are some indexing manipulations --------
    -------- Both for channeling spell, MUIness and leak removing --------
    -------- ----------- --------
    Custom script: set udg_GF_Index[3] = index
    Set GF_Index[5] = (GF_Index[5] - 1)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        GF_Index[5] Equal to 0
      Then - Actions
        Set GF_Index[0] = (GF_Index[0] - 1)
      Else - Actions
    Set GF_Caster[GF_Index[3]] = GF_Caster[GF_Index[0]]
    Set GF_Stop[GF_Index[3]] = GF_Stop[GF_Index[0]]
    Custom script: set e = null
    Custom script: set i = 0
    Custom script: set r = null
    Custom script: set u = null
    Custom script: set index = 0
Ground Fury Loop
  Events
    Time - Every 0.01 seconds of game time
  Conditions
  Actions
    -------- ----------- --------
    -------- And here we go as always with Indexing --------
    -------- ----------- --------
    For each (Integer GF_Index[4]) from 1 to GF_Index[2], do (Actions)
      Loop - Actions
        -------- ----------- --------
        -------- First of all we check, if the unit has the needed flying height --------
        -------- I made the boulders uppear from the earth with 100% transparency --------
        -------- So they will get at the 100 flying height, becoming visible up to 100% --------
        -------- After reaching this height, they shall start triggering their main aim --------
        -------- ----------- --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Current flying height of GF_UnitDummy[GF_Index[4]]) Greater than or equal to 100.00
          Then - Actions
            -------- ----------- --------
            -------- So the flying height is okay --------
            -------- But the dummy is still not near the targeted unit --------
            -------- So we get the locations of both units --------
            -------- ----------- --------
            Set GF_DummyLoc[GF_Index[4]] = (Position of GF_UnitDummy[GF_Index[4]])
            Set GF_TargetLoc[GF_Index[4]] = (Position of GF_UnitTarget[GF_Index[4]])
            -------- ----------- --------
            -------- If the distance is equal or lower than the collison of the dummy --------
            -------- Then we make him to disappear, damaging and knockbacking the targetd unit --------
            -------- If not, we move him by 12 points closer to the target --------
            -------- ----------- --------
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Distance between GF_DummyLoc[GF_Index[4]] and GF_TargetLoc[GF_Index[4]]) Greater than 36.00
              Then - Actions
                -------- ----------- --------
                -------- The dummy was too far from the target --------
                -------- ----------- --------
                -------- Next we set the position where the dummy should be moved --------
                -------- ----------- --------
                Set GF_MoveLoc[GF_Index[4]] = (GF_DummyLoc[GF_Index[4]] offset by 12.00 towards (Angle from GF_DummyLoc[GF_Index[4]] to GF_TargetLoc[GF_Index[4]]) degrees)
                -------- ----------- --------
                -------- Just for eye-candy we make the unit face that point --------
                -------- ----------- --------
                Unit - Make GF_UnitDummy[GF_Index[4]] face GF_MoveLoc[GF_Index[4]] over 0 seconds
                -------- ----------- --------
                -------- And move him there --------
                -------- ----------- --------
                Unit - Move GF_UnitDummy[GF_Index[4]] instantly to GF_MoveLoc[GF_Index[4]]
                -------- ----------- --------
                -------- Leak removing --------
                -------- ----------- --------
                Custom script: call RemoveLocation(udg_GF_MoveLoc[udg_GF_Index[4]])
                Custom script: call RemoveLocation(udg_GF_DummyLoc[udg_GF_Index[4]])
                Custom script: call RemoveLocation(udg_GF_TargetLoc[udg_GF_Index[4]])
              Else - Actions
                -------- ----------- --------
                -------- The unit has come close to the target enough --------
                -------- So we can trigger our last things for him --------
                -------- ----------- --------
                -------- Firstly, we make him deal damage to the target unit --------
                -------- ----------- --------
                Unit - Cause GF_UnitDummy[GF_Index[4]] to damage GF_UnitTarget[GF_Index[4]], dealing 45.00 damage of attack type Spells and damage type Normal
                -------- ----------- --------
                -------- And then knockback it --------
                -------- ----------- --------
                -------- Paladon's Knockback System goes here --------
                -------- ----------- --------
                Set KBA_Caster = GF_UnitDummy[GF_Index[4]]
                Set KBA_TargetUnit = GF_UnitTarget[GF_Index[4]]
                Set KBA_StartingPosition = GF_DummyLoc[GF_Index[4]]
                Set KBA_Level = 1
                Set KBA_Speed = 7.00
                Set KBA_DistancePerLevel = 150.00
                Set KBA_SpecialEffects[1] = Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
                Set KBA_SpecialEffects[2] = Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
                Set KBA_DestroyTrees = True
                -------- ----------- --------
                -------- This check is made in order to prevent unit from moving the corpse --------
                -------- ----------- --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (GF_UnitTarget[GF_Index[4]] is alive) Equal to True
                  Then - Actions
                    Trigger - Run Cast_A_Knockback <gen> (checking conditions)
                  Else - Actions
                -------- ----------- --------
                -------- End of Paladon's Knockback system --------
                -------- ----------- --------
                -------- Then we destroy special effect on unit in order to prevent leak --------
                -------- ----------- --------
                Special Effect - Destroy GF_Effect[GF_Index[4]]
                -------- ----------- --------
                -------- And finally remove the dummy from the game --------
                -------- ----------- --------
                Unit - Remove GF_UnitDummy[GF_Index[4]] from the game
                -------- ----------- --------
                -------- Leak removing --------
                -------- ----------- --------
                Custom script: call RemoveLocation(udg_GF_MoveLoc[udg_GF_Index[4]])
                Custom script: call RemoveLocation(udg_GF_DummyLoc[udg_GF_Index[4]])
                Custom script: call RemoveLocation(udg_GF_TargetLoc[udg_GF_Index[4]])
                -------- ----------- --------
                -------- Indexing --------
                -------- ----------- --------
                Set GF_Index[1] = (GF_Index[1] - 1)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    GF_Index[1] Equal to 0
                  Then - Actions
                    Set GF_Index[2] = 0
                    Trigger - Turn off (This trigger)
                  Else - Actions
                -------- ----------- --------
                -------- End of Indexing --------
                -------- ----------- --------
          Else - Actions
            -------- ----------- --------
            -------- Here we change the flying height --------
            -------- ----------- --------
            Animation - Change GF_UnitDummy[GF_Index[4]] flying height to ((Current flying height of GF_UnitDummy[GF_Index[4]]) + 0.50) at 0.00
            -------- ----------- --------
            -------- Here we change the transparency of the unit --------
            -------- ----------- --------
            Animation - Change GF_UnitDummy[GF_Index[4]]'s vertex coloring to (100%, 100%, 100%) with (100.00 - (GF_Transp[GF_Index[4]] + 1.00))% transparency
            -------- ----------- --------
            -------- And we need this variable to make the transparency go lower and lower --------
            -------- ----------- --------
            Set GF_Transp[GF_Index[4]] = (GF_Transp[GF_Index[4]] + 1.00)
Ground Fury Stop
  Events
    Unit - A unit Stops casting an ability
  Conditions
    (Ability being cast) Equal to Ground Fury
  Actions
    -------- ----------- --------
    -------- We shall find the caster and stop casting ability by looping through all of them --------
    -------- ----------- --------
    For each (Integer GF_Index[6]) from 0 to (GF_Index[0] - 1), do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            GF_Caster[GF_Index[6]] Equal to (Triggering unit)
          Then - Actions
            -------- ----------- --------
            -------- And here we make this --------
            -------- In the main trigger this will influence on the trigger stopping --------
            -------- ----------- --------
            Set GF_Stop[GF_Index[6]] = True
            -------- ----------- --------
            -------- Just to prevent useless looping further --------
            -------- ----------- --------
            Skip remaining actions
          Else - Actions

----------------------------------------------------------------------------Paladon presents----------------------------------------------------------------------------



GUI Knockback System v.1.60


1-What this system allows you to make:
This system allows you to attach a knockback effect to whatever you want.
You can easily specify speed, range and other knockback effects.
The specified values only apply for the spell you specified them, so other spells using the knockback effect are completely autonomic and their values are free selectable.

2-How to imort the system into your map?
The system consists of the two triggers 'Cast A Knockback' and 'Get Knockback' as well as every variable with the 'KB_' and the 'KBA_' prefix.
You don´t need any of the custom units, spells, buffs, items or whatever.
Just copy the both named triggers into your map as well as the variables.

3-How to attach finally a knockback?
To attach the imported system to a spell, create a new spell and apply the actions of the 'Actions to apply' trigger for every unit which shall receive the knockback.
That´s all you need.

I recommend you to check the samples. I created three samples using different options.

Please give me credits for the system if you use it in your map or own spell ;)

Actions to apply Копировать
  Events
  Conditions
  Actions
    -------- This is the caster of the knockback. --------
    -------- If you use spells, it´s mostly the 'triggering unit' or the 'casting unit'. --------
    Set KBA_Caster = (Triggering unit)
    -------- --------
    -------- This is the unit knocked back. Set this variable to the unit which should receive the knockback. --------
    -------- Use for example 'Target unit of ability being cast' or 'picked unit', 'attacking unit', 'casting unit', 'triggering unit' or whatever. --------
    Set KBA_TargetUnit = (Target unit of ability being cast)
    -------- --------
    -------- This is the location from where the unit should be knocked back. --------
    -------- Don´t set this location to the position of the unit which should be knocked back. --------
    Set KBA_StartingPosition = (Position of (Casting unit))
    -------- --------
    -------- This saves the level of the spell. --------
    -------- If the level shouldn´t influence the knockback, set the variable to 1. --------
    Set KBA_Level = (Level of (Ability being cast) for (Triggering unit))
    -------- --------
    -------- This determines the speed of the knockback. --------
    -------- If you set the speed to 0, the unit won´t move. --------
    Set KBA_Speed = 7.00
    -------- --------
    -------- This determines the distance knockbacked per level of the spell. --------
    -------- If the level shouldn´t influence the knockback, simply set this variable to the distance you wish. --------
    Set KBA_DistancePerLevel = 150.00
    -------- --------
    -------- The following both variables store the path of the effects used. --------
    -------- Effect[1] is more often used than Effect[2]. --------
    Set KBA_SpecialEffects[1] = Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
    Set KBA_SpecialEffects[2] = Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
    -------- --------
    -------- Set the following variable to 'false' to allow trees to survive a collision with a knocked unit. --------
    -------- Set the following variable to 'true' to kill trees upon collision with a knocked unit. --------
    Set KBA_DestroyTrees = True
    -------- --------
    -------- After setting the needed variables we start the knockback. --------
    Trigger - Run Cast_A_Knockback <gen> (checking conditions)
    -------- Done. The unit knockbacked if the trigger triggers. --------
The both following triggers are the GUI Knockback System. Without these both triggers the system won´t work.
Simply copy and paste the variables with the prefix 'KB_' and 'KBA_'into your map. Then copy and paste the both triggers into your map.
Check the 'Readme' and 'Sample Readme' for more information.
Cast A Knockback
  Events
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (KBA_TargetUnit is in KB_KnockbackedUnits) Equal to True
      Then - Actions
        Unit Group - Remove KBA_TargetUnit from KB_KnockbackedUnits
        Set KB_CountBuffs = (KB_CountBuffs - 1)
        For each (Integer KB_GeneralIntegers[2]) from 1 to KB_TotalKnockUnits, do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                KB_Units[KB_GeneralIntegers[1]] Equal to KBA_TargetUnit
              Then - Actions
                Set KB_GeneralIntegers[1] = KB_GeneralIntegers[2]
                Set KB_GeneralIntegers[2] = KB_TotalKnockUnits
              Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            KB_TotalKnockUnits Greater than KB_GeneralIntegers[1]
          Then - Actions
            Set KB_Levels[KB_GeneralIntegers[1]] = KB_Levels[KB_TotalKnockUnits]
            Set KB_Units[KB_GeneralIntegers[1]] = KB_Units[KB_TotalKnockUnits]
            Set KB_Angle[KB_GeneralIntegers[1]] = KB_Angle[KB_TotalKnockUnits]
            Set KB_MaxDistance[KB_GeneralIntegers[1]] = KB_MaxDistance[KB_TotalKnockUnits]
            Set KB_ReachedDistance[KB_GeneralIntegers[1]] = KB_ReachedDistance[KB_TotalKnockUnits]
            Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = KB_ReduceSpeedReal[KB_TotalKnockUnits]
            Set KB_SpecificSpeed[KB_GeneralIntegers[1]] = KB_SpecificSpeed[KB_TotalKnockUnits]
            Set KB_Effects_1[KB_GeneralIntegers[1]] = KB_Effects_1[KB_TotalKnockUnits]
            Set KB_Effects_2[KB_GeneralIntegers[1]] = KB_Effects_2[KB_TotalKnockUnits]
            Set KB_DestroyTrees[KB_GeneralIntegers[1]] = KB_DestroyTrees[KB_TotalKnockUnits]
            Set KB_EffectCounter[KB_GeneralIntegers[1]] = KB_EffectCounter[KB_TotalKnockUnits]
            Set KB_EffectCounter2[KB_GeneralIntegers[1]] = KB_EffectCounter2[KB_TotalKnockUnits]
            Set KB_GeneralIntegers[1] = (KB_GeneralIntegers[1] - 1)
          Else - Actions
        Set KB_Units[KB_TotalKnockUnits] = No unit
        Set KB_TotalKnockUnits = (KB_TotalKnockUnits - 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            KB_CountBuffs Equal to 0
          Then - Actions
            Set KB_TotalKnockUnits = 0
            Trigger - Turn off Get_Knockback <gen>
          Else - Actions
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        KB_CountBuffs Equal to 0
      Then - Actions
        Trigger - Turn on Get_Knockback <gen>
      Else - Actions
    Set KB_CountBuffs = (KB_CountBuffs + 1)
    Set KB_TotalKnockUnits = (KB_TotalKnockUnits + 1)
    Set KB_Casters[KB_TotalKnockUnits] = KBA_Caster
    Set KB_Levels[KB_TotalKnockUnits] = KBA_Level
    Set KB_Units[KB_TotalKnockUnits] = KBA_TargetUnit
    Set KB_StartPositions[KB_TotalKnockUnits] = KBA_StartingPosition
    Set KB_TempPoint[KB_TotalKnockUnits] = (Position of KBA_TargetUnit)
    Set KB_Angle[KB_TotalKnockUnits] = (Angle from KB_StartPositions[KB_TotalKnockUnits] to KB_TempPoint[KB_TotalKnockUnits])
    Set KB_MaxDistance[KB_TotalKnockUnits] = (KBA_DistancePerLevel x (Real(KBA_Level)))
    Set KB_ReachedDistance[KB_TotalKnockUnits] = 0.00
    Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = 0.00
    Set KB_SpecificSpeed[KB_TotalKnockUnits] = KBA_Speed
    Set KB_Effects_1[KB_TotalKnockUnits] = KBA_SpecialEffects[1]
    Set KB_Effects_2[KB_TotalKnockUnits] = KBA_SpecialEffects[2]
    Set KB_DestroyTrees[KB_TotalKnockUnits] = KBA_DestroyTrees
    Set KB_EffectCounter[KB_GeneralIntegers[1]] = 0
    Set KB_EffectCounter2[KB_GeneralIntegers[1]] = 0
    Unit Group - Add KBA_TargetUnit to KB_KnockbackedUnits
    Custom script: call RemoveLocation (udg_KBA_StartingPosition)
    Custom script: call RemoveLocation (udg_KB_TempPoint [udg_KB_TotalKnockUnits] )
    Custom script: call RemoveLocation (udg_KB_StartPositions [udg_KB_TotalKnockUnits] )
Get Knockback
  Events
    Time - Every 0.02 seconds of game time
  Conditions
  Actions
    For each (Integer KB_GeneralIntegers[1]) from 1 to KB_TotalKnockUnits, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (KB_Units[KB_GeneralIntegers[1]] is in KB_KnockbackedUnits) Equal to True
          Then - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                KB_ReachedDistance[KB_GeneralIntegers[1]] Greater than or equal to KB_MaxDistance[KB_GeneralIntegers[1]]
              Then - Actions
                Unit Group - Remove KB_Units[KB_GeneralIntegers[1]] from KB_KnockbackedUnits
                Set KB_CountBuffs = (KB_CountBuffs - 1)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    KB_TotalKnockUnits Greater than KB_GeneralIntegers[1]
                  Then - Actions
                    Set KB_Levels[KB_GeneralIntegers[1]] = KB_Levels[KB_TotalKnockUnits]
                    Set KB_Units[KB_GeneralIntegers[1]] = KB_Units[KB_TotalKnockUnits]
                    Set KB_Angle[KB_GeneralIntegers[1]] = KB_Angle[KB_TotalKnockUnits]
                    Set KB_MaxDistance[KB_GeneralIntegers[1]] = KB_MaxDistance[KB_TotalKnockUnits]
                    Set KB_ReachedDistance[KB_GeneralIntegers[1]] = KB_ReachedDistance[KB_TotalKnockUnits]
                    Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = KB_ReduceSpeedReal[KB_TotalKnockUnits]
                    Set KB_SpecificSpeed[KB_GeneralIntegers[1]] = KB_SpecificSpeed[KB_TotalKnockUnits]
                    Set KB_Effects_1[KB_GeneralIntegers[1]] = KB_Effects_1[KB_TotalKnockUnits]
                    Set KB_Effects_2[KB_GeneralIntegers[1]] = KB_Effects_2[KB_TotalKnockUnits]
                    Set KB_DestroyTrees[KB_GeneralIntegers[1]] = KB_DestroyTrees[KB_TotalKnockUnits]
                    Set KB_EffectCounter[KB_GeneralIntegers[1]] = KB_EffectCounter[KB_TotalKnockUnits]
                    Set KB_EffectCounter2[KB_GeneralIntegers[1]] = KB_EffectCounter2[KB_TotalKnockUnits]
                    Set KB_GeneralIntegers[1] = (KB_GeneralIntegers[1] - 1)
                  Else - Actions
                Set KB_Units[KB_TotalKnockUnits] = No unit
                Set KB_TotalKnockUnits = (KB_TotalKnockUnits - 1)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    KB_CountBuffs Equal to 0
                  Then - Actions
                    Set KB_TotalKnockUnits = 0
                    Trigger - Turn off (This trigger)
                  Else - Actions
              Else - Actions
                Set KB_ReducedReal = ((KB_SpecificSpeed[KB_GeneralIntegers[1]] / KB_MaxDistance[KB_GeneralIntegers[1]]) x KB_ReachedDistance[KB_GeneralIntegers[1]])
                Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = (KB_ReducedReal - (KB_ReduceSpeedReal[KB_GeneralIntegers[1]] x 0.10))
                Set KB_TempReal = ((KB_SpecificSpeed[KB_GeneralIntegers[1]] - KB_ReduceSpeedReal[KB_GeneralIntegers[1]]) x 2.00)
                Set KB_TempPoint[1] = (Position of KB_Units[KB_GeneralIntegers[1]])
                Set KB_TempPoint[2] = (KB_TempPoint[1] offset by KB_TempReal towards KB_Angle[KB_GeneralIntegers[1]] degrees)
                Set KB_EffectCounter[KB_GeneralIntegers[1]] = (KB_EffectCounter[KB_GeneralIntegers[1]] + 1)
                Set KB_EffectCounter2[KB_GeneralIntegers[1]] = (KB_EffectCounter2[KB_GeneralIntegers[1]] + 1)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    KB_DestroyTrees[KB_GeneralIntegers[1]] Equal to True
                  Then - Actions
                    Destructible - Pick every destructible within 200.00 of KB_TempPoint[2] and do (Actions)
                      Loop - Actions
                        Destructible - Kill (Picked destructible)
                  Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    KB_EffectCounter[KB_GeneralIntegers[1]] Equal to 6
                  Then - Actions
                    Set KB_EffectCounter[KB_GeneralIntegers[1]] = 0
                    Special Effect - Create a special effect at KB_TempPoint[1] using KB_Effects_1[KB_GeneralIntegers[1]]
                    Special Effect - Destroy (Last created special effect)
                  Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    KB_EffectCounter2[KB_GeneralIntegers[1]] Equal to 8
                  Then - Actions
                    Set KB_EffectCounter2[KB_GeneralIntegers[1]] = 0
                    Special Effect - Create a special effect at KB_TempPoint[1] using KB_Effects_2[KB_GeneralIntegers[1]]
                    Special Effect - Destroy (Last created special effect)
                  Else - Actions
                Unit - Move KB_Units[KB_GeneralIntegers[1]] instantly to KB_TempPoint[2]
                Custom script: call RemoveLocation (udg_KB_TempPoint[1])
                Custom script: call RemoveLocation (udg_KB_TempPoint[2])
                Set KB_ReachedDistance[KB_GeneralIntegers[1]] = (KB_ReachedDistance[KB_GeneralIntegers[1]] + KB_TempReal)
          Else - Actions

----------------------------------------------------------------------------Paladon presents----------------------------------------------------------------------------



Jump n´ Dash System v.0.90


1-What this system allows you to make:
This system allows you easily create spells with jump effects. You can attach the jump effect to whatever, whenever you want.
You can easily specify speed, range, effects, and other values.
The specified values only apply for the spell you specified them, so other spells using the system are completely autonomic and their values are free selectable.

2-How to imort the system into your map?
The system consists of the two triggers 'Jump System 1' and 'Jump System 2' as well as every variable with the 'JD_' and the 'JDA_' prefix.
You don´t need any of the custom units, spells, buffs, items or whatever. The custom object editor data is created for the sample spells only.
Just copy the both named triggers into your map as well as the variables.
It´s recommendable to check the box 'Automatically create unknown variables while pasting trigger data' located at File->Presettings->General.

3-How to attach finally a das or a jump?
To attach the imported system to a spell, create a new spell and apply the actions of the 'Actions to apply' trigger for every unit which shall receive the wished effect.
That´s all you need.

I recommend you to check the sample.

Please give me credits for the system if you use it in your map or own spell ;)

Actions to apply
  Events
  Conditions
  Actions
    -------- This are the actions to apply in your spell to use an effect of this system. --------
    -------- --------
    Set JDA_JumpHigh_Distance = 1.00
    -------- This variable returns the base value of the high of the jump. --------
    -------- The Jump´s high is calculated by the distance jumped and by this value. --------
    -------- The higher this value is, the higher is the jump. I recommend to leave it at 1.00 . --------
    -------- --------
    Set JDA_DestroyTrees_Dash = True
    -------- !Don´t pay attention to this variable if you have choosen the Jump effect! --------
    -------- This variable returns whether the hero should destroy trees while dashing. --------
    -------- Set this variable toTrue to destroy trees in the dashing unit´s way. --------
    -------- --------
    Set JDA_TargetPoint = (Target point of ability being cast)
    -------- This returns where the target position of the Jump/Dash should be. --------
    -------- --------
    Set JDA_Unit = (Triggering unit)
    -------- This returns the unit which shall jump/dash. --------
    -------- --------
    Set JDA_Speed = 10.00
    -------- This returns the speed of the jump/dash. --------
    -------- --------
    Set JDA_SpecialEffect = Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
    -------- This returns the path for the used special effect. --------
    -------- --------
    Set JDA_Animation = slam
    -------- This returns the animation of the unit jumping/dashing. --------
    -------- --------
    Set JDA_AnimationSpeed = 0.60
    -------- This returns the animation speed of the jumping/dashing unit. --------
    -------- --------
    Trigger - Run Jump_System_1 <gen> (checking conditions)
    -------- After setting all needed variables, this calls the system to execute the choosen effects on the choosen unit/units. --------
    -------- --------
Jump System 1
  Events
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        JD_Integers[1] Equal to 0
      Then - Actions
        Trigger - Turn on Jump_System_2 <gen>
      Else - Actions
    Set JD_Integers[1] = (JD_Integers[1] + 1)
    Set JD_Integers[2] = (JD_Integers[2] + 1)
    Set JD_TempPoint[1] = (Position of JDA_Unit)
    Set JD_Distances[JD_Integers[2]] = (Distance between JD_TempPoint[1] and JDA_TargetPoint)
    Set JD_ReachedDistance[JD_Integers[2]] = 0.00
    Set JD_SpeedUnits[JD_Integers[2]] = JDA_Speed
    Set JD_Unit[JD_Integers[2]] = JDA_Unit
    Set JD_Angle[JD_Integers[2]] = (Angle from JD_TempPoint[1] to JDA_TargetPoint)
    Set JD_Effect[JD_Integers[2]] = JDA_SpecialEffect
    Set JD_Animations[JD_Integers[2]] = JDA_Animation
    Set JD_TreesDestroy[JD_Integers[2]] = JDA_DestroyTrees_Dash
    Set JD_HighSettings[JD_Integers[2]] = (JDA_JumpHigh_Distance x JD_Distances[JD_Integers[2]])
    Unit - Turn collision for JDA_Unit Off
    Animation - Change JDA_Unit's animation speed to (JDA_AnimationSpeed x 100.00)% of its original speed
    Animation - Play JDA_Unit's JDA_Animation animation
    Unit Group - Add JDA_Unit to JD_Group
    Unit - Add Storm Crow Form to JDA_Unit
    Unit - Remove Storm Crow Form from JDA_Unit
    Custom script: call RemoveLocation (udg_JD_TempPoint[1])
    Custom script: call RemoveLocation (udg_JDA_TargetPoint)
Jump System 2
  Events
    Time - Every 0.02 seconds of game time
  Conditions
  Actions
    For each (Integer JD_Integers[3]) from 1 to JD_Integers[2], do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (JD_Unit[JD_Integers[3]] is in JD_Group) Equal to True
          Then - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                JD_ReachedDistance[JD_Integers[3]] Less than JD_Distances[JD_Integers[3]]
              Then - Actions
                Animation - Queue JD_Unit[JD_Integers[3]]'s JD_Animations[JD_Integers[3]] animation
                Set JD_TempPoint[1] = (Position of JD_Unit[JD_Integers[3]])
                Set JD_TempPoint[2] = (JD_TempPoint[1] offset by JD_SpeedUnits[JD_Integers[3]] towards JD_Angle[JD_Integers[3]] degrees)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    JD_TreesDestroy[JD_Integers[3]] Equal to True
                  Then - Actions
                    Destructible - Pick every destructible within 150.00 of JD_TempPoint[2] and do (Kill (Picked destructible))
                  Else - Actions
                Unit - Move JD_Unit[JD_Integers[3]] instantly to JD_TempPoint[2]
                Set JD_ReachedDistance[JD_Integers[3]] = (JD_ReachedDistance[JD_Integers[3]] + JD_SpeedUnits[JD_Integers[3]])
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Random integer number between 1 and 5) Equal to 1
                  Then - Actions
                    Special Effect - Create a special effect attached to the chest of JD_Unit[JD_Integers[3]] using JD_Effect[JD_Integers[3]]
                    Special Effect - Destroy (Last created special effect)
                  Else - Actions
                Set JD_RealTimer[JD_Integers[3]] = (JD_RealTimer[JD_Integers[3]] + (180.00 / (JD_Distances[JD_Integers[3]] / JD_SpeedUnits[JD_Integers[3]])))
                Set JD_JumpHigh[JD_Integers[3]] = ((Sin(JD_RealTimer[JD_Integers[3]])) x JD_HighSettings[JD_Integers[3]])
                Animation - Change JD_Unit[JD_Integers[3]] flying height to JD_JumpHigh[JD_Integers[3]] at 1000000000.00
                Custom script: call RemoveLocation (udg_JD_TempPoint[1])
                Custom script: call RemoveLocation (udg_JD_TempPoint[2])
              Else - Actions
                Unit - Turn collision for JD_Unit[JD_Integers[3]] On
                Unit Group - Remove JD_Unit[JD_Integers[3]] from JD_Group
                Animation - Change JD_Unit[JD_Integers[3]]'s animation speed to 100.00% of its original speed
                Animation - Reset JD_Unit[JD_Integers[3]]'s animation
                Set JD_RealTimer[JD_Integers[3]] = 0.00
                Set JD_Integers[1] = (JD_Integers[1] - 1)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    JD_Integers[1] Equal to 0
                  Then - Actions
                    Set JD_Integers[2] = 0
                    Trigger - Turn off (This trigger)
                  Else - Actions
          Else - Actions
DDS Main
  Events
  Conditions
  Actions
    -------- ---------------------------------------------------------------- --------
    -------- TriggeringUnit() is the unit taking damage. --------
    -------- ---------------------------------------------------------------- --------
    -------- DamageSource() is the unit dealing damage --------
    -------- ---------------------------------------------------------------- --------
    -------- EventDamage() is the damage being dealt --------
    -------- ---------------------------------------------------------------- --------
    -------- Stone Skin (Breaking Weapon) --------
    -------- ---------------------------------------------------------------- --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        ((Triggering unit) has buff Stone Skin) Equal to True
        (Random integer number between 1 and 100) Less than or equal to 21
        ((Damage source) is A melee attacker) Equal to True
      Then - Actions
        -------- ----------- --------
        -------- Setting the location of attacking unit into variable in order to use it in future --------
        -------- ----------- --------
        Set SS_Loc = (Position of (Damage source))
        -------- ----------- --------
        -------- Creating dummy unit --------
        -------- ----------- --------
        Unit - Create 1 Dummy for (Owner of (Triggering unit)) at SS_Loc facing Default building facing degrees
        -------- ----------- --------
        -------- Adding the damage decreasing ability to him --------
        -------- ----------- --------
        Unit - Add Broken Weapon (Dummy) to (Last created unit)
        -------- ----------- --------
        -------- Ordering him to use it --------
        -------- ----------- --------
        Unit - Order (Last created unit) to Undead Necromancer - Cripple (Damage source)
        -------- ----------- --------
        -------- And removing him --------
        -------- ----------- --------
        Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
        -------- ----------- --------
        -------- Removing leaks --------
        -------- ----------- --------
        Custom script: call RemoveLocation(udg_SS_Loc)
      Else - Actions
    -------- ---------------------------------------------------------------- --------
    -------- Heavy Smash (Passive) --------
    -------- ---------------------------------------------------------------- --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of Heavy Smash for (Damage source)) Greater than 0
        (Random integer number between 1 and 100) Less than or equal to (6 x (Level of Heavy Smash for (Damage source)))
        ((((Triggering unit) is A structure) Equal to False) and (((Triggering unit) is in HS_Group) Equal to False)) and ((((Triggering unit) is Magic Immune) Equal to False) and ((((Triggering unit) is Mechanical) Equal to False) and ((((Triggering unit) is A ground unit) Equal to True) and ((((Triggering unit) is alive) Equal to True) and (((Triggering unit) belongs to an enemy of (Owner of (Damage source))) Equal to True)))))
      Then - Actions
        -------- ----------- --------
        -------- Just for eye-candy we play lovely attack animation for our hero --------
        -------- ----------- --------
        Animation - Play (Damage source)'s attack slam animation
        -------- ----------- --------
        Set HS_Loc = (Position of (Triggering unit))
        Special Effect - Create a special effect at HS_Loc using NewDirtEXNofire.mdx
        Special Effect - Destroy (Last created special effect)
        -------- ----------- --------
        Set HS_Rect = (Region centered at HS_Loc with size (250.00, 250.00))
        Custom script: set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units in HS_Rect matching ((((Matching unit) belongs to an enemy of (Owner of (Damage source))) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is Mechanical) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and (((((Matching unit) is A structure) Equal to False) and (((Matching unit) is A ground unit) Equal to True)) and (((Matching unit) is in HS_Group) Equal to False))))))) and do (Actions)
          Loop - Actions
            Unit - Create 1 Dummy for (Owner of (Damage source)) at HS_Loc facing Default building facing degrees
            Unit - Cause (Last created unit) to damage (Picked unit), dealing (30.00 x (Real((Level of Heavy Smash for (Damage source))))) damage of attack type Spells and damage type Normal
            Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                ((Picked unit) is alive) Equal to True
              Then - Actions
                -------- Indexing --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    HS_Index[0] Equal to 0
                  Then - Actions
                    Trigger - Turn on Heavy_Smash_Loop <gen>
                  Else - Actions
                Set HS_Index[0] = (HS_Index[0] + 1)
                Set HS_Index[1] = (HS_Index[1] + 1)
                -------- End of Indexing --------
                Set HS_Boolean[HS_Index[1]] = False
                Set HS_Unit[HS_Index[1]] = (Picked unit)
                Unit - Pause HS_Unit[HS_Index[1]]
                Unit Group - Add HS_Unit[HS_Index[1]] to HS_Group
                Unit - Add Storm Crow Form to HS_Unit[HS_Index[1]]
                Unit - Remove Storm Crow Form from HS_Unit[HS_Index[1]]
              Else - Actions
        Custom script: call RemoveLocation(udg_HS_Loc)
        Custom script: call RemoveRect(udg_HS_Rect)
      Else - Actions
DDS Add Unit
  Events
    Unit - A unit enters (Playable map area)
  Conditions
    ((Entering unit) is in DDS_Detect) Equal to False
  Actions
    Trigger - Add to DDS_Main <gen> the event ((Entering unit) Takes damage)
    Unit Group - Add (Entering unit) to DDS_Detect
DDS Init
  Events
    Map initialization
  Conditions
  Actions
    Set Temp_Group = (Units in (Playable map area))
    Unit Group - Pick every unit in Temp_Group and do (Actions)
      Loop - Actions
        Trigger - Add to DDS_Main <gen> the event ((Picked unit) Takes damage)
        Unit Group - Add (Picked unit) to DDS_Detect
    Custom script: call DestroyGroup(udg_Temp_Group)
Information
  Events
    Time - Elapsed game time is 1.00 seconds
  Conditions
  Actions
    Game - Display to (All players) the text: ----------------------------------------------------------------------------------------------------------Here is |cffffcc00Aspard|r's entry for Hero Contest #2 on TheHiveWorkshop.comI would be glad to present my hero: |cffffcc00Pandarean Earthshaker|rTo test the hero type-in |cffffcc00-CreateHero|rThanks for playing this map!You can find some interesting information in the trigger editor in Readme.----------------------------------------------------------------------------------------------------------
Hero Creation
  Events
    Player - Player 1 (Red) types a chat message containing -CreateHero as An exact match
  Conditions
  Actions
    Set TempLoc = (Center of HeroCreation <gen>)
    Unit - Create 1 Pandarean Earthshaker for Player 1 (Red) at TempLoc facing Default building facing degrees
    Set Tester = (Last created unit)
    Game - Display to (All players) the text: ----------------------------------------------------------------------------------------------------------To set the level of hero to ten, type-in |cffffcc00-levelmax|r.To restore hero and set cooldowns to zero press |cffffcc00ESC|r.----------------------------------------------------------------------------------------------------------
    Camera - Pan camera for Player 1 (Red) to TempLoc over 0 seconds
    Selection - Clear selection for Player 1 (Red)
    Selection - Add Tester to selection for Player 1 (Red)
    Trigger - Turn on ESC_System <gen>
    Trigger - Turn on LevelMax <gen>
    Trigger - Turn on Tester_Dies <gen>
    Trigger - Turn off (This trigger)
    Custom script: call RemoveLocation(udg_TempLoc)
Tester Dies
  Events
    Unit - A unit Dies
  Conditions
    (Unit-type of (Dying unit)) Equal to Pandarean Earthshaker
  Actions
    Set TempLoc = (Center of HeroCreation <gen>)
    Hero - Instantly revive Tester at TempLoc, Show revival graphics
    Custom script: call RemoveLocation(udg_TempLoc)
ESC System
  Events
    Player - Player 1 (Red) skips a cinematic sequence
  Conditions
  Actions
    Unit - Set life of Tester to 100%
    Unit - Set mana of Tester to 100%
    Unit - Reset ability cooldowns for Tester
LevelMax
  Events
    Player - Player 1 (Red) types a chat message containing -levelmax as An exact match
  Conditions
  Actions
    Hero - Set Tester Hero-level to 10, Show level-up graphics
Default melee game initialization for all players
Melee Initialization
  Events
    Map initialization
  Conditions
  Actions
    Melee Game - Use melee time of day (for all players)
    Melee Game - Limit Heroes to 1 per Hero-type (for all players)
    Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
    Melee Game - Set starting resources (for all players)
    Melee Game - Remove creeps and critters from used start locations (for all players)
    Melee Game - Create starting units (for all players)
    Melee Game - Run melee AI scripts (for computer players)
    Melee Game - Enforce victory/defeat conditions (for all players)