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

Brutal ability: Bear Grasp

This bundle is marked as awaiting update. A staff member has requested changes to it before it can be approved.
  • Like
Reactions: TheFrenchLeprechaun
This spell is made for Dwarven Knights model.
I planned to use on Zephyr contest #15, but decided to not do that.

The spell is based on the troll "Berserk" ability. The unit increases mount movement speed, and the bear-mount can:
  • grab a random enemy unit on the FRONT of caster.
  • eating it dealing damage and restore health
  • use it as a shield to do a ram attack (!) to deal damage to ground enemies (non-buildings) and knockback them.

To keep the effect and hold the grabbed unit the mount must ALWAYS move.
There are 3 triggers in the map + support folder triggers.
Support folder "TEST FOLDER" contains the "INIT" trigger and "HOW TO IMPORT" trigger.
These both triggers are used only for the test map.
The main folder named "BEAR GRASP" contains 3 main triggers.
"BEAR GRASP CONFIGURATION" - the trigger where You can set the ability parameters.
"BEAR GRASP USE" - the trigger which of the ability using.
"BEAR GRASP LOOP" - the trigger supports loop actions.
All parameters can be set in the "BEAR GRASP CONFIGURATION":
CREATE GROUPS, SETTING DAMAGES, SETTING CUSTOM BUFFS AND ABILITIES - Here you can set all starting parameters, but You may find prefix "_BASH" it means that the Bear damages grabbed unit by damage type without the prefix, but uses the grabbed body for ram attack which deals damage with the prefix "_BASH". So you have 2 different damage types.

PERIOD OF DAMAGING DEVOURED UNIT, SEC - While mount bear grabs unit the first starts to eat the lester and deal damage. This is the period of damage.
DAMAGE THE DEVOURED UNIT, PTS - Like it mentioned before it sets the damage to the grabbed unit.
HEAL WHILE DEALS DAMAGE TO THE DEVOURED UNIT, PTS - The grabbed unit is devoured. It means the bear heals itself.
STARTING DELAY, SEC - This parameter is important, because then the caster starts using the ability it instantly must move to not remove the Bear Grasp buff. This timer allows to give you a time to start moving after the using ability, grabbing the unit or bashing unit with the grabbed unit.
DISTANCE TO HOLD THE DEVOURED UNIT ON FRONT OF THE BEAR - Visual parameter. The bear holds the grabbed unit. This parameters sets the distance between the caster and the grabbed unit.
HEIGHT OF DEVOURED UNIT TO BE HOLD BY THE BEAR, PTS + HEIGHT OF THE BEAR ITSELF - The same like previous parameter, but it sets the height.
CATCH THE UNIT ANGLE, DEGREE - To grab an unit it must be on the front of the caster. This parameter sets the range of angle to grab unit. If you set, for example 120, it means that the bear grab unit in range (Facing Angle of bear +/- 120/2) or (Facing Angle of bear +/- 60))
CATCH THE UNIT DISTANCE, PTS - The same parameter, but it sets the distance to allow the grabbing.
RAM ATTACK DAMAGE BY BASHING ENEMIES WITH DEVOURED UNIT, PTS - The grabbed unit is used for the ram attack to deal damage to frontal enemies. This is basic damage.
RAM ATTACK DAMAGE BY BASHING ENEMIES WITH DEVOURED UNIT (DAMAGE DEPENDS ON LEVEL OF CATCHED UNIT (HERO), PTS/LEVEL - The stronger the enemy the larger additional damage will done. This value increases basic damage depending on level of the grabbed unit. For example, I set basic damage 25 and this value as 5, then ram attack damage will (25 + 5xlevel of unit)
KNOCKBACK SPEEDRATE (0=NO KNOCKBACK) - The ram attack causes knockback. It sets how fast knockbacked units will move. Set 0 to disable knockback.
KNOCKBACK DURATION, SEC (0=NO KNOCKBACK) - The ram attack causes knockback. It sets how long knockbacked units will move. Set 0 to disable knockback.
IMMUNE TO BEAR GRASP RAM ATTACK, SEC - Enable immune to unit after getting caused by the ram attack. This parameter must be slightly higher (or higher) than the KNOCKBACK DURATION value.
KNOCKBACK BASH DISTANCE, PTS - The ram attack knockbacks only frontal units. It sets the distance between the caster and enemy (not the grabbed enemy) to knockback it.
KNOCKBACK BASH ANGLE, DEGREE - The ram attack knockbacks only frontal units. This parameter sets the range of angle to knockback unit. If you set, for example 120, it means that the ram attacks knockback all units in range (Facing Angle of bear +/- 120/2) or (Facing Angle of bear +/- 60)).
-------------------------------------CONDITIONS--------------------------------------
Of course some units are hard to grab in a bear chew. So here are some parameters which allows the caster to set available targets to grab. This spell doesn't work against buildings.
MAX LEVEL OF CREATURE (-1=DISABLE GRASP 0=TAKE ALL LEVELS) IF NOT GIANT, MECHANISM OR HERO - set max parameter of non-mech, non-giant, non-hero unit. As You can see if You set -1 that disable grabbing for non-mech, non-giant, non-hero units; if you set 0 - it allows to grab all levels. If you set more than 0 it sets the max available level to grab.
CONDITION: GIANTS ALLOWED (-1=NO, 0=ANY LEVEL ELSE SET MAX ALLOWED LEVEL) - The same, but special condition for GIANT types.
CONDITION: HEROES ALLOWED (-1=NO, 0=ANY LEVEL ELSE SET MAX ALLOWED LEVEL) - The same, but special condition for HERO types.
CONDITION: MECHANISMS ALLOWED (-1=NO, 0=ANY LEVEL ELSE SET MAX ALLOWED LEVEL) - The same, but special condition for MECH types.
THE BONUS MOVEMENT SPEED AND DURATION OF THE EFFECT IS SET IN THE OBJECT EDITOR - This commentary told You to set bonus movement speed and duration of the effect in the Bear Grasp ability in the object editor.
  • HOW TO IMPORT
    • Events
    • Conditions
    • Actions
      • -------- 1. IMPORT CUSTOM 2 ABILITIES AND CUSTOM BUFF --------
      • -------- OPTIONAL: IMPORT DWARVEN KNIGHT MODEL --------
      • -------- 2. COPY ALL TRIGGERS FROM THE "BEAR GRASP" FOLDER. --------
      • -------- 3. SET RIGHT PARAMETERS IN THE "BEAR GRASP CONFIGURATION". --------
      • -------- 4. BE SURE ALL CUSTOM OBJECT WERE SET PROPERLY LIKE IN THE TEMPLATE --------
full

full

full
  • BEAR GRASP CONFIGURATION
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • -------- CREATE GROUPS, SETTING DAMAGES, SETTING CUSTOM BUFFS AND ABILITIES. --------
      • Hashtable - Create a hashtable
      • Set BGRASP_HASH = (Last created hashtable)
      • Custom script: set udg_BGRASP_GROUP = CreateGroup()
      • Unit Group - Remove all units from BGRASP_GROUP
      • Custom script: set udg_BGRASP_GROUP_IMMUNE = CreateGroup()
      • Unit Group - Remove all units from BGRASP_GROUP_IMMUNE
      • Custom script: set udg_BGRASP_GROUP_KNOCK = CreateGroup()
      • Unit Group - Remove all units from BGRASP_GROUP_KNOCK
      • Set BGRASP_DummyAbility = Dummy Transparency
      • Set BGRASP_MAINABILITY = Bear Grasp
      • Set BGRASP_BUFF = Bear Grasp
      • Set BGRASP_DAMAGETYPE = Force
      • Set BGRASP_DAMAGETYPE_BASH = Force
      • Set BGRASP_ATTACKTYPE = Normal
      • Set BGRASP_ATTACKTYPE_BASH = Spells
      • -------- CONFIGURATION --------
      • -------- YOU CAN ADD MORE ARRAY FOR A FEW ABILITY LEVELS --------
      • -------- PERIOD OF DAMAGING DEVOURED UNIT, SEC --------
      • Set BGRASP_PERIOD[1] = 0.20
      • Set BGRASP_PERIOD[2] = 0.15
      • Set BGRASP_PERIOD[3] = 0.10
      • -------- DAMAGE THE DEVOURED UNIT, PTS --------
      • Set BGRASP_DAMAGE[1] = 5.00
      • Set BGRASP_DAMAGE[2] = 6.00
      • Set BGRASP_DAMAGE[3] = 7.00
      • -------- HEAL WHILE DEALS DAMAGE TO THE DEVOURED UNIT, PTS --------
      • Set BGRASP_HEAL[1] = 5.00
      • Set BGRASP_HEAL[2] = 6.00
      • Set BGRASP_HEAL[3] = 7.00
      • -------- STARTING DELAY, SEC --------
      • Set BGRASP_DELAY[1] = 1.30
      • Set BGRASP_DELAY[2] = 1.30
      • Set BGRASP_DELAY[3] = 1.30
      • -------- DISTANCE TO HOLD THE DEVOURED UNIT ON FRONT OF THE BEAR --------
      • Set BGRASP_VISUALDISTANCEOFCATCH[1] = 100.00
      • Set BGRASP_VISUALDISTANCEOFCATCH[2] = 100.00
      • Set BGRASP_VISUALDISTANCEOFCATCH[3] = 100.00
      • -------- HEIGHT OF DEVOURED UNIT TO BE HOLD BY THE BEAR, PTS + HEIGHT OF THE BEAR ITSELF --------
      • Set BGRASP_VISUALHEIGHT[1] = 20.00
      • Set BGRASP_VISUALHEIGHT[2] = 20.00
      • Set BGRASP_VISUALHEIGHT[3] = 20.00
      • -------- CATCH THE UNIT ANGLE, DEGREE --------
      • Set BGRASP_BASH_ANGLERANGE[1] = 160.00
      • Set BGRASP_BASH_ANGLERANGE[2] = 160.00
      • Set BGRASP_BASH_ANGLERANGE[3] = 160.00
      • -------- CATCH THE UNIT DISTANCE, PTS --------
      • Set BGRASP_BASH_DISTANCEOFTAKING[1] = 150.00
      • Set BGRASP_BASH_DISTANCEOFTAKING[2] = 150.00
      • Set BGRASP_BASH_DISTANCEOFTAKING[3] = 150.00
      • -------- RAM ATTACK DAMAGE BY BASHING ENEMIES WITH DEVOURED UNIT, PTS --------
      • Set BGRASP_BASH_DAMAGE_BASIC[1] = 25.00
      • Set BGRASP_BASH_DAMAGE_BASIC[2] = 40.00
      • Set BGRASP_BASH_DAMAGE_BASIC[3] = 100.00
      • -------- RAM ATTACK DAMAGE BY BASHING ENEMIES WITH DEVOURED UNIT (DAMAGE DEPENDS ON LEVEL OF CATCHED UNIT (HERO), PTS/LEVEL --------
      • Set BGRASP_BASH_DAMAGE_DEPENDED[1] = 5.00
      • Set BGRASP_BASH_DAMAGE_DEPENDED[2] = 6.00
      • Set BGRASP_BASH_DAMAGE_DEPENDED[3] = 8.00
      • -------- IMMUNE TO DAMAGE AFTER GETTING DAMAGE FROM THE BASH, SEC --------
      • -------- KNOCKBACK SPEEDRATE (0=NO KNOCKBACK) --------
      • Set BGRASP_KNOCK_SPEEDRATE[1] = 850.00
      • Set BGRASP_KNOCK_SPEEDRATE[2] = 850.00
      • Set BGRASP_KNOCK_SPEEDRATE[3] = 850.00
      • -------- KNOCKBACK DURATION, SEC (0=NO KNOCKBACK) --------
      • Set BGRASP_KNOCK_DURATION[1] = 0.20
      • Set BGRASP_KNOCK_DURATION[2] = 0.20
      • Set BGRASP_KNOCK_DURATION[3] = 0.20
      • -------- IMMUNE TO BEAR GRASP RAM ATTACK, SEC --------
      • -------- (MUST BE SLIGHTLY HIGHER THAN KNOCKBACK DURATION IF THE KNOCKBACK IS ALLOWED FOR THE CURRENT LEVEL) --------
      • Set BGRASP_IMMUNE[1] = 0.21
      • Set BGRASP_IMMUNE[2] = 0.21
      • Set BGRASP_IMMUNE[3] = 0.21
      • -------- KNOCKBACK BASH DISTANCE, PTS --------
      • Set BGRASP_KNOCK_DISTANCEOFTAKING[1] = 140.00
      • Set BGRASP_KNOCK_DISTANCEOFTAKING[2] = 140.00
      • Set BGRASP_KNOCK_DISTANCEOFTAKING[3] = 140.00
      • -------- KNOCKBACK BASH ANGLE, DEGREE --------
      • Set BGRASP_KNOCK_ANGLERANGE[1] = 120.00
      • Set BGRASP_KNOCK_ANGLERANGE[2] = 120.00
      • Set BGRASP_KNOCK_ANGLERANGE[3] = 120.00
      • -------- MAX LEVEL OF CREATURE (-1=DISABLE GRASP 0=TAKE ALL LEVELS) IF NOT GIANT, MECHANISM OR HERO --------
      • Set BGRASP_MAXLEVEL[1] = 3
      • Set BGRASP_MAXLEVEL[2] = 5
      • Set BGRASP_MAXLEVEL[3] = 0
      • -------- CONDITION: GIANTS ALLOWED (-1=NO, 0=ANY LEVEL ELSE SET MAX ALLOWED LEVEL) --------
      • Set BGRASP_CONDIT_GIANTS[1] = -1
      • Set BGRASP_CONDIT_GIANTS[2] = 5
      • Set BGRASP_CONDIT_GIANTS[3] = 0
      • -------- CONDITION: HEROES ALLOWED (-1=NO, 0=ANY LEVEL ELSE SET MAX ALLOWED LEVEL) --------
      • Set BGRASP_CONDIT_HERO[1] = 3
      • Set BGRASP_CONDIT_HERO[2] = 5
      • Set BGRASP_CONDIT_HERO[3] = 0
      • -------- CONDITION: MECHANISMS ALLOWED (-1=NO, 0=ANY LEVEL ELSE SET MAX ALLOWED LEVEL) --------
      • Set BGRASP_CONDIT_MECHANISM[1] = -1
      • Set BGRASP_CONDIT_MECHANISM[2] = -1
      • Set BGRASP_CONDIT_MECHANISM[3] = -1
      • -------- THE BONUS MOVEMENT SPEED AND DURATION OF THE EFFECT IS SET IN THE OBJECT EDITOR --------
  • BEAR GRASP LOOP
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in BGRASP_GROUP) Greater than 0
        • Then - Actions
          • Set BGRASP_REAL[0] = 0.04
          • Unit Group - Pick every unit in BGRASP_GROUP and do (Actions)
            • Loop - Actions
              • Set BGRASP_UNIT[0] = (Picked unit)
              • Unit - Add BGRASP_DummyAbility to BGRASP_UNIT[0]
              • Custom script: set udg_BGRASP_INTEGER = GetHandleIdBJ( udg_BGRASP_UNIT[0])
              • Set BGRASP_POINT[0] = (Position of BGRASP_UNIT[0])
              • Set BGRASP_REAL[1] = (Load 3 of BGRASP_INTEGER from BGRASP_HASH)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 3 of BGRASP_INTEGER from BGRASP_HASH) Greater than 0.00
                • Then - Actions
                  • Set BGRASP_REAL[1] = (BGRASP_REAL[1] - BGRASP_REAL[0])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Load 3 of BGRASP_INTEGER from BGRASP_HASH) Less than or equal to 0.00
                    • Then - Actions
                      • Hashtable - Save (X of BGRASP_POINT[0]) as 1 of BGRASP_INTEGER in BGRASP_HASH
                      • Hashtable - Save (Y of BGRASP_POINT[0]) as 2 of BGRASP_INTEGER in BGRASP_HASH
                    • Else - Actions
                • Else - Actions
                  • Set BGRASP_REAL[1] = (X of BGRASP_POINT[0])
                  • Set BGRASP_REAL[2] = (Y of BGRASP_POINT[0])
              • Hashtable - Save BGRASP_REAL[1] as 3 of BGRASP_INTEGER in BGRASP_HASH
              • Custom script: call RemoveLocation( udg_BGRASP_POINT[0] )
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • (BGRASP_UNIT[0] is alive) Equal to True
                      • (BGRASP_UNIT[0] is hidden) Not equal to True
                      • (BGRASP_UNIT[0] has buff BGRASP_BUFF) Equal to True
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Load 3 of BGRASP_INTEGER from BGRASP_HASH) Greater than 0.00
                          • And - All (Conditions) are true
                            • Conditions
                              • (Load 3 of BGRASP_INTEGER from BGRASP_HASH) Less than or equal to 0.00
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • BGRASP_REAL[1] Not equal to (Load 1 of BGRASP_INTEGER from BGRASP_HASH)
                                  • BGRASP_REAL[2] Not equal to (Load 2 of BGRASP_INTEGER from BGRASP_HASH)
                • Then - Actions
                  • Set BGRASP_POINT[0] = (Position of BGRASP_UNIT[0])
                  • Hashtable - Save (X of BGRASP_POINT[0]) as 1 of BGRASP_INTEGER in BGRASP_HASH
                  • Hashtable - Save (Y of BGRASP_POINT[0]) as 2 of BGRASP_INTEGER in BGRASP_HASH
                  • Set BGRASP_UNIT[1] = (Load 0 of BGRASP_INTEGER in BGRASP_HASH)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • BGRASP_UNIT[1] Equal to No unit
                    • Then - Actions
                      • Set BGRASP_GROUPTEMP1 = (Units within (Load 4 of BGRASP_INTEGER from BGRASP_HASH) of BGRASP_POINT[0] matching ((((Matching unit) is in BGRASP_GROUP_IMMUNE) Not equal to True) and ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is alive) Equal to True) an
                      • Unit Group - Pick every unit in BGRASP_GROUPTEMP1 and do (Actions)
                        • Loop - Actions
                          • Set BGRASP_UNIT[2] = (Picked unit)
                          • Set BGRASP_POINT[1] = (Position of BGRASP_UNIT[2])
                          • Set BGRASP_REAL[1] = (Facing of BGRASP_UNIT[0])
                          • Set BGRASP_REAL[2] = (Angle from BGRASP_POINT[0] to BGRASP_POINT[1])
                          • Set BGRASP_REAL[3] = (BGRASP_REAL[1] - BGRASP_REAL[2])
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • BGRASP_REAL[3] Less than or equal to 0.00
                              • BGRASP_REAL[3] Greater than or equal to -90.00
                            • Then - Actions
                              • Set BGRASP_REAL[3] = (BGRASP_REAL[3] + 360.00)
                            • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • BGRASP_REAL[3] Greater than or equal to 360.00
                            • Then - Actions
                              • Set BGRASP_REAL[3] = (BGRASP_REAL[3] - 360.00)
                            • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • And - All (Conditions) are true
                                    • Conditions
                                      • BGRASP_REAL[3] Greater than or equal to (360.00 - ((Load 5 of BGRASP_INTEGER from BGRASP_HASH) / 2.00))
                                      • BGRASP_REAL[3] Less than or equal to 360.00
                                  • And - All (Conditions) are true
                                    • Conditions
                                      • BGRASP_REAL[3] Greater than or equal to 0.00
                                      • BGRASP_REAL[3] Less than or equal to (0.00 + ((Load 5 of BGRASP_INTEGER from BGRASP_HASH) / 2.00))
                            • Then - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (BGRASP_UNIT[2] is Mechanical) Equal to True
                                • Then - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • And - All (Conditions) are true
                                        • Conditions
                                          • Or - Any (Conditions) are true
                                            • Conditions
                                              • (Load 8 of BGRASP_INTEGER from BGRASP_HASH) Equal to 0
                                              • And - All (Conditions) are true
                                                • Conditions
                                                  • (Load 8 of BGRASP_INTEGER from BGRASP_HASH) Greater than 0
                                                  • (Level of BGRASP_UNIT[2]) Less than or equal to (Load 8 of BGRASP_INTEGER from BGRASP_HASH)
                                    • Then - Actions
                                    • Else - Actions
                                      • Unit Group - Remove BGRASP_UNIT[2] from BGRASP_GROUPTEMP1
                                • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (BGRASP_UNIT[2] is A Hero) Equal to True
                                  • (BGRASP_UNIT[2] is in BGRASP_GROUPTEMP1) Equal to True
                                • Then - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • And - All (Conditions) are true
                                        • Conditions
                                          • Or - Any (Conditions) are true
                                            • Conditions
                                              • (Load 7 of BGRASP_INTEGER from BGRASP_HASH) Equal to 0
                                              • And - All (Conditions) are true
                                                • Conditions
                                                  • (Load 7 of BGRASP_INTEGER from BGRASP_HASH) Greater than 0
                                                  • (Hero level of BGRASP_UNIT[2]) Less than or equal to (Load 7 of BGRASP_INTEGER from BGRASP_HASH)
                                    • Then - Actions
                                    • Else - Actions
                                      • Unit Group - Remove BGRASP_UNIT[2] from BGRASP_GROUPTEMP1
                                • Else - Actions
                              • Custom script: if ( IsUnitType(udg_BGRASP_UNIT[2], UNIT_TYPE_GIANT) == true ) then
                              • Custom script: else
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (BGRASP_UNIT[2] is in BGRASP_GROUPTEMP1) Equal to True
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Load 10 of BGRASP_INTEGER from BGRASP_HASH) Equal to 0
                                      • And - All (Conditions) are true
                                        • Conditions
                                          • (Load 10 of BGRASP_INTEGER from BGRASP_HASH) Greater than 0
                                          • (Level of BGRASP_UNIT[2]) Less than or equal to (Load 10 of BGRASP_INTEGER from BGRASP_HASH)
                                • Then - Actions
                                • Else - Actions
                                  • Unit Group - Remove BGRASP_UNIT[2] from BGRASP_GROUPTEMP1
                              • Custom script: endif
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (BGRASP_UNIT[2] is in BGRASP_GROUPTEMP1) Equal to True
                                • Then - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • Or - Any (Conditions) are true
                                        • Conditions
                                          • (Load 6 of BGRASP_INTEGER from BGRASP_HASH) Equal to 0
                                          • And - All (Conditions) are true
                                            • Conditions
                                              • (Load 6 of BGRASP_INTEGER from BGRASP_HASH) Greater than 0
                                              • (Level of BGRASP_UNIT[2]) Less than or equal to (Load 6 of BGRASP_INTEGER from BGRASP_HASH)
                                    • Then - Actions
                                    • Else - Actions
                                      • Unit Group - Remove BGRASP_UNIT[2] from BGRASP_GROUPTEMP1
                                • Else - Actions
                            • Else - Actions
                              • Unit Group - Remove BGRASP_UNIT[2] from BGRASP_GROUPTEMP1
                          • Custom script: call RemoveLocation( udg_BGRASP_POINT[1] )
                      • Custom script: set udg_BGRASP_UNIT[1] = FirstOfGroup(udg_BGRASP_GROUPTEMP1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • BGRASP_UNIT[1] Not equal to No unit
                        • Then - Actions
                          • Hashtable - Save BGRASP_DELAY[(Level of BGRASP_MAINABILITY for BGRASP_UNIT[0])] as 3 of BGRASP_INTEGER in BGRASP_HASH
                          • Hashtable - Save 0.00 as 24 of BGRASP_INTEGER in BGRASP_HASH
                          • Custom script: set udg_BGRASP_INTEGER2 = GetHandleIdBJ( udg_BGRASP_UNIT[1])
                          • Hashtable - Clear all child hashtables of child BGRASP_INTEGER2 in BGRASP_HASH
                          • Unit - Add BGRASP_DummyAbility to BGRASP_UNIT[1]
                          • Unit Group - Add BGRASP_UNIT[1] to BGRASP_GROUP_IMMUNE
                          • Unit Group - Remove BGRASP_UNIT[1] from BGRASP_GROUP_KNOCK
                          • Unit - Remove BGRASP_BUFF buff from BGRASP_UNIT[1]
                          • Hashtable - Save Handle OfBGRASP_UNIT[1] as 0 of BGRASP_INTEGER in BGRASP_HASH
                          • Custom script: call DestroyEffectBJ( AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\BattleRoar\\RoarCaster.mdl", udg_BGRASP_UNIT[1], "origin") )
                        • Else - Actions
                      • Custom script: call DestroyGroup( udg_BGRASP_GROUPTEMP1 )
                    • Else - Actions
                      • Do nothing
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • BGRASP_UNIT[1] Not equal to No unit
                    • Then - Actions
                      • Set BGRASP_REAL[1] = (Load 24 of BGRASP_INTEGER from BGRASP_HASH)
                      • Set BGRASP_REAL[1] = (BGRASP_REAL[1] + BGRASP_REAL[0])
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • BGRASP_REAL[1] Greater than or equal to (Load 23 of BGRASP_INTEGER from BGRASP_HASH)
                        • Then - Actions
                          • Set BGRASP_REAL[1] = 0.00
                          • Unit - Cause BGRASP_UNIT[0] to damage BGRASP_UNIT[1], dealing (Load 25 of BGRASP_INTEGER from BGRASP_HASH) damage of attack type BGRASP_ATTACKTYPE and damage type BGRASP_DAMAGETYPE
                          • Custom script: call DestroyEffectBJ( AddSpecialEffectTarget("Objects\\Spawnmodels\\Human\\HumanBlood\\BloodElfSpellThiefBlood.mdl", udg_BGRASP_UNIT[1], "chest") )
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (BGRASP_UNIT[1] is an illusion) Not equal to True
                            • Then - Actions
                              • Unit - Set life of BGRASP_UNIT[0] to ((Life of BGRASP_UNIT[0]) + (Load 26 of BGRASP_INTEGER from BGRASP_HASH))
                            • Else - Actions
                        • Else - Actions
                      • Hashtable - Save BGRASP_REAL[1] as 24 of BGRASP_INTEGER in BGRASP_HASH
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (BGRASP_UNIT[1] is alive) Equal to True
                          • (BGRASP_UNIT[1] is hidden) Not equal to True
                          • (BGRASP_UNIT[1] is visible to (Owner of BGRASP_UNIT[0])) Equal to True
                        • Then - Actions
                          • Set BGRASP_POINT[1] = (BGRASP_POINT[0] offset by (Load 11 of BGRASP_INTEGER from BGRASP_HASH) towards ((Facing of BGRASP_UNIT[0]) + 0.00) degrees)
                          • Unit - Move BGRASP_UNIT[1] instantly to BGRASP_POINT[1], facing ((Angle from BGRASP_POINT[0] to BGRASP_POINT[1]) + 90.00) degrees
                          • Custom script: call RemoveLocation( udg_BGRASP_POINT[1] )
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Level of Crow Form for BGRASP_UNIT[1]) Equal to 0
                            • Then - Actions
                              • Unit - Add Crow Form to BGRASP_UNIT[1]
                              • Unit - Remove Crow Form from BGRASP_UNIT[1]
                            • Else - Actions
                          • Set BGRASP_REAL[1] = ((0.00 + (Current flying height of BGRASP_UNIT[0])) + (Load 12 of BGRASP_INTEGER from BGRASP_HASH))
                          • Animation - Change BGRASP_UNIT[1] flying height to BGRASP_REAL[1] at 0.00
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (BGRASP_UNIT[1] is an illusion) Not equal to True
                            • Then - Actions
                              • Set BGRASP_GROUPTEMP1 = (Units within (Load 14 of BGRASP_INTEGER from BGRASP_HASH) of BGRASP_POINT[0] matching (((((Matching unit) is in BGRASP_GROUP_IMMUNE) Not equal to True) and (((Matching unit) is in BGRASP_GROUP_KNOCK) Not equal to True)) and ((((Matching unit) is A structure)
                              • Unit Group - Pick every unit in BGRASP_GROUPTEMP1 and do (Actions)
                                • Loop - Actions
                                  • Set BGRASP_UNIT[2] = (Picked unit)
                                  • Set BGRASP_POINT[1] = (Position of BGRASP_UNIT[2])
                                  • Set BGRASP_REAL[1] = (Facing of BGRASP_UNIT[0])
                                  • Set BGRASP_REAL[2] = (Angle from BGRASP_POINT[0] to BGRASP_POINT[1])
                                  • Set BGRASP_REAL[3] = (BGRASP_REAL[1] - BGRASP_REAL[2])
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • BGRASP_REAL[3] Less than or equal to 0.00
                                      • BGRASP_REAL[3] Greater than or equal to -90.00
                                    • Then - Actions
                                      • Set BGRASP_REAL[3] = (BGRASP_REAL[3] + 360.00)
                                    • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • BGRASP_REAL[3] Greater than or equal to 360.00
                                    • Then - Actions
                                      • Set BGRASP_REAL[3] = (BGRASP_REAL[3] - 360.00)
                                    • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • Or - Any (Conditions) are true
                                        • Conditions
                                          • And - All (Conditions) are true
                                            • Conditions
                                              • BGRASP_REAL[3] Greater than or equal to (360.00 - ((Load 5 of BGRASP_INTEGER from BGRASP_HASH) / 2.00))
                                              • BGRASP_REAL[3] Less than or equal to 360.00
                                          • And - All (Conditions) are true
                                            • Conditions
                                              • BGRASP_REAL[3] Greater than or equal to 0.00
                                              • BGRASP_REAL[3] Less than or equal to (0.00 + ((Load 5 of BGRASP_INTEGER from BGRASP_HASH) / 2.00))
                                    • Then - Actions
                                      • Custom script: call DestroyEffectBJ( AddSpecialEffectTarget("Abilities\\Spells\\Human\\Defend\\DefendCaster.mdl", udg_BGRASP_UNIT[0], "origin") )
                                      • Custom script: call DestroyEffectBJ( AddSpecialEffectTarget("Abilities\\Spells\\Other\\Stampede\\MissileDeath.mdl", udg_BGRASP_UNIT[2], "chest") )
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (BGRASP_UNIT[1] is A Hero) Equal to True
                                        • Then - Actions
                                          • Unit - Cause BGRASP_UNIT[0] to damage BGRASP_UNIT[2], dealing ((Load 27 of BGRASP_INTEGER from BGRASP_HASH) + ((Real((Hero level of BGRASP_UNIT[1]))) x (Load 28 of BGRASP_INTEGER from BGRASP_HASH))) damage of attack type BGRASP_ATTACKTYPE_BASH and damage type BGRASP_DAMAGETYPE_BASH
                                        • Else - Actions
                                          • Unit - Cause BGRASP_UNIT[0] to damage BGRASP_UNIT[2], dealing ((Load 27 of BGRASP_INTEGER from BGRASP_HASH) + ((Real((Level of BGRASP_UNIT[1]))) x (Load 28 of BGRASP_INTEGER from BGRASP_HASH))) damage of attack type BGRASP_ATTACKTYPE_BASH and damage type BGRASP_DAMAGETYPE_BASH
                                      • Custom script: set udg_BGRASP_INTEGER2 = GetHandleIdBJ( udg_BGRASP_UNIT[2])
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Load 15 of BGRASP_INTEGER from BGRASP_HASH) Greater than 0.00
                                        • Then - Actions
                                          • Hashtable - Save (Load 15 of BGRASP_INTEGER from BGRASP_HASH) as 22 of BGRASP_INTEGER2 in BGRASP_HASH
                                          • Unit Group - Add BGRASP_UNIT[2] to BGRASP_GROUP_IMMUNE
                                        • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Load 16 of BGRASP_INTEGER from BGRASP_HASH) Greater than 0.00
                                          • (Load 17 of BGRASP_INTEGER from BGRASP_HASH) Greater than 0.00
                                        • Then - Actions
                                          • Hashtable - Save (Load 16 of BGRASP_INTEGER from BGRASP_HASH) as 19 of BGRASP_INTEGER2 in BGRASP_HASH
                                          • Hashtable - Save (Load 17 of BGRASP_INTEGER from BGRASP_HASH) as 20 of BGRASP_INTEGER2 in BGRASP_HASH
                                          • Hashtable - Save BGRASP_REAL[2] as 21 of BGRASP_INTEGER2 in BGRASP_HASH
                                          • Unit Group - Add BGRASP_UNIT[2] to BGRASP_GROUP_KNOCK
                                          • Unit - Add BGRASP_DummyAbility to BGRASP_UNIT[2]
                                          • Hashtable - Save BGRASP_DELAY[(Level of BGRASP_MAINABILITY for BGRASP_UNIT[0])] as 3 of BGRASP_INTEGER in BGRASP_HASH
                                        • Else - Actions
                                    • Else - Actions
                                      • Unit Group - Remove BGRASP_UNIT[2] from BGRASP_GROUPTEMP1
                                  • Custom script: call RemoveLocation( udg_BGRASP_POINT[1] )
                              • Custom script: call DestroyGroup( udg_BGRASP_GROUPTEMP1 )
                            • Else - Actions
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Level of Crow Form for BGRASP_UNIT[1]) Equal to 0
                            • Then - Actions
                              • Unit - Add Crow Form to BGRASP_UNIT[1]
                              • Unit - Remove Crow Form from BGRASP_UNIT[1]
                            • Else - Actions
                          • Animation - Change BGRASP_UNIT[1] flying height to (Default flying height of BGRASP_UNIT[1]) at 0.00
                          • Unit - Remove BGRASP_DummyAbility from BGRASP_UNIT[1]
                          • Set BGRASP_POINT[0] = (Position of BGRASP_UNIT[1])
                          • Unit - Move BGRASP_UNIT[1] instantly to BGRASP_POINT[0]
                          • Custom script: call RemoveLocation( udg_BGRASP_POINT[0] )
                          • Hashtable - Save 0.00 as 24 of BGRASP_INTEGER in BGRASP_HASH
                          • Unit Group - Remove BGRASP_UNIT[1] from BGRASP_GROUP_IMMUNE
                          • Hashtable - Save Handle OfNo unit as 0 of BGRASP_INTEGER in BGRASP_HASH
                    • Else - Actions
                      • Do nothing
                  • Custom script: call RemoveLocation( udg_BGRASP_POINT[0] )
                • Else - Actions
                  • Unit Group - Remove BGRASP_UNIT[0] from BGRASP_GROUP
                  • Unit - Remove BGRASP_BUFF buff from BGRASP_UNIT[0]
                  • Set BGRASP_UNIT[1] = (Load 0 of BGRASP_INTEGER in BGRASP_HASH)
                  • Unit - Remove BGRASP_DummyAbility from BGRASP_UNIT[0]
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • BGRASP_UNIT[1] Not equal to No unit
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Level of Crow Form for BGRASP_UNIT[1]) Equal to 0
                        • Then - Actions
                          • Unit - Add Crow Form to BGRASP_UNIT[1]
                          • Unit - Remove Crow Form from BGRASP_UNIT[1]
                        • Else - Actions
                      • Animation - Change BGRASP_UNIT[1] flying height to (Default flying height of BGRASP_UNIT[1]) at 0.00
                      • Set BGRASP_POINT[0] = (Position of BGRASP_UNIT[1])
                      • Unit - Move BGRASP_UNIT[1] instantly to BGRASP_POINT[0]
                      • Custom script: call RemoveLocation( udg_BGRASP_POINT[0] )
                      • Unit Group - Remove BGRASP_UNIT[1] from BGRASP_GROUP_IMMUNE
                      • Unit - Remove BGRASP_DummyAbility from BGRASP_UNIT[1]
                      • Unit - Turn collision for BGRASP_UNIT[1] On
                      • Custom script: set udg_BGRASP_INTEGER2 = GetHandleIdBJ( udg_BGRASP_UNIT[1])
                      • Hashtable - Save Handle OfNo unit as 0 of BGRASP_INTEGER in BGRASP_HASH
                      • Hashtable - Clear all child hashtables of child BGRASP_INTEGER2 in BGRASP_HASH
                    • Else - Actions
                  • Hashtable - Clear all child hashtables of child BGRASP_INTEGER in BGRASP_HASH
              • Set BGRASP_UNIT[0] = No unit
              • Set BGRASP_UNIT[1] = No unit
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in BGRASP_GROUP_KNOCK) Greater than 0
        • Then - Actions
          • Set BGRASP_REAL[0] = 0.04
          • Unit Group - Pick every unit in BGRASP_GROUP_KNOCK and do (Actions)
            • Loop - Actions
              • Set BGRASP_UNIT[0] = (Picked unit)
              • Custom script: set udg_BGRASP_INTEGER = GetHandleIdBJ( udg_BGRASP_UNIT[0])
              • Set BGRASP_REAL[1] = (Load 19 of BGRASP_INTEGER from BGRASP_HASH)
              • Set BGRASP_REAL[1] = (BGRASP_REAL[1] - BGRASP_REAL[0])
              • Set BGRASP_POINT[0] = (Position of BGRASP_UNIT[0])
              • Set BGRASP_POINT[1] = (BGRASP_POINT[0] offset by ((Load 20 of BGRASP_INTEGER from BGRASP_HASH) x BGRASP_REAL[0]) towards (Load 21 of BGRASP_INTEGER from BGRASP_HASH) degrees)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 19 of BGRASP_INTEGER from BGRASP_HASH) Less than or equal to 0.00
                • Then - Actions
                  • Set BGRASP_REAL[1] = 0.00
                  • Unit Group - Remove BGRASP_UNIT[0] from BGRASP_GROUP_KNOCK
                  • Unit - Remove BGRASP_DummyAbility from BGRASP_UNIT[0]
                • Else - Actions
              • Hashtable - Save BGRASP_REAL[1] as 19 of BGRASP_INTEGER in BGRASP_HASH
              • Custom script: call DestroyEffectBJ( AddSpecialEffectLoc("Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl", udg_BGRASP_POINT[0]) )
              • Unit - Move BGRASP_UNIT[0] instantly to BGRASP_POINT[1]
              • Custom script: call RemoveLocation( udg_BGRASP_POINT[0] )
              • Custom script: call RemoveLocation( udg_BGRASP_POINT[1] )
              • Set BGRASP_UNIT[0] = No unit
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in BGRASP_GROUP_IMMUNE) Greater than 0
        • Then - Actions
          • Set BGRASP_REAL[0] = 0.04
          • Unit Group - Pick every unit in BGRASP_GROUP_IMMUNE and do (Actions)
            • Loop - Actions
              • Set BGRASP_UNIT[0] = (Picked unit)
              • Custom script: set udg_BGRASP_INTEGER = GetHandleIdBJ( udg_BGRASP_UNIT[0])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 22 of BGRASP_INTEGER from BGRASP_HASH) Greater than 0.00
                • Then - Actions
                  • Set BGRASP_REAL[1] = (Load 22 of BGRASP_INTEGER from BGRASP_HASH)
                  • Set BGRASP_REAL[1] = (BGRASP_REAL[1] - BGRASP_REAL[0])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • BGRASP_REAL[1] Less than or equal to 0.00
                    • Then - Actions
                      • Set BGRASP_REAL[1] = 0.00
                      • Unit Group - Remove BGRASP_UNIT[0] from BGRASP_GROUP_IMMUNE
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (BGRASP_UNIT[0] is in BGRASP_GROUP_KNOCK) Equal to True
                        • Then - Actions
                          • Unit Group - Remove BGRASP_UNIT[0] from BGRASP_GROUP_KNOCK
                          • Unit - Remove BGRASP_DummyAbility from BGRASP_UNIT[0]
                          • Set BGRASP_POINT[0] = (Position of BGRASP_UNIT[0])
                          • Unit - Move BGRASP_UNIT[0] instantly to BGRASP_POINT[0]
                          • Custom script: call RemoveLocation( udg_BGRASP_POINT[0] )
                        • Else - Actions
                      • Hashtable - Clear all child hashtables of child BGRASP_INTEGER in BGRASP_HASH
                    • Else - Actions
                      • Hashtable - Save BGRASP_REAL[1] as 22 of BGRASP_INTEGER in BGRASP_HASH
                • Else - Actions
              • Set BGRASP_UNIT[0] = No unit
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in BGRASP_GROUP) Equal to 0
          • (Number of units in BGRASP_GROUP_KNOCK) Equal to 0
          • (Number of units in BGRASP_GROUP_IMMUNE) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
Contents

Bear Grasp (Map)

Reviews
KILLCIDE
Needs Fixed Level 1 of the ability does not grab units. Level 2 & 3 work fine for whatever reason You really should document this. I don't understand more than half the values you cache in the loop and what their purpose is Suggestions Is the 0.01...
Level 9
Joined
Jun 22, 2012
Messages
472
Very creative and interactive spell! +rep

But check out the uploaded pics, in the loop sometimes you handle the 'Dummy transparency' instead of 'BGRASP_DummyAbility', that's annoying when importing :p.
 

Attachments

  • Capture1.PNG
    Capture1.PNG
    34.1 KB · Views: 79
  • Capture2.PNG
    Capture2.PNG
    33.5 KB · Views: 93
Level 37
Joined
Jul 22, 2015
Messages
3,485

Needs Fixed

  • Level 1 of the ability does not grab units. Level 2 & 3 work fine for whatever reason
  • You really should document this. I don't understand more than half the values you cache in the loop and what their purpose is

Suggestions

  • Is the 0.01 elapsed game timer just to reduce map loading time?
  • You don't have to create non-array groups on map init as they are already created. You're technically leaking by doing this. With that in mind, you don't have to remove "all units" given all you're doing is creating the group
  • Why not just put the condition of the (Ability being cast) inside the default conditions block instead of making an additional If/Then/Else?
  • GetHandleIdBJ() -> GetHandleId()
  • Why are you saving the handle of no unit as 0 in the hash?
  • Periodic loop timer should be configurable
  • Instead of using CountUnitsInGroup() every callback, just use an integer counter that you increment whenever you add a unit to the group and decrement when you remove them
  • You don't have to use And - All (Conditions) are true as the default Conditions is already like that. You only see this when it's inside an Or - Any (Conditions) are true block
  • GetUnitsInRangeOfLocAll() has a reference leak that cannot be removed if you use the GUI function
  • (Matching unit) is really ugly when you are filtering units. Please take a look at Convenient Unit Group Filtering in GUI
  • DestroyEffectBJ() -> DestroyEffect()
  • When you damage units, the special effect and it's attachment point should be configurable
  • Is it necessary to be caching values that are constants (ex: the amount of life you give to BGRASP_UNIT[1])? You can just save the ability level and refer to the array directly
  • Seperating your loop into 3 seperate loops is your best course of action. As of right now, it is horrendous reading through your code. The lack of documentation does not help either
  • I recommend you use any of the knockback systems in our database. Your knockback is okay, but it looks really rigid

Status

Awaiting Update
 
Top