• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

MUI Drag or Grab v1.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
I developped a GUI system in that allow you to make dragging or grabing abilities with many configurable options.System is made for single target spells.
Spell that can be made by the system :

Abduct, Dragging type abilites : the caster abduct it's target and drag it behind him while moving.

Grab, Hanging type abilities : the caster hang itself on the target dealing damage.

Hook, Pull type abilities : The caster pull the target toward it's position.

Grapplin type abilities : The Caster pull itself toward the target.

How to import :
-Copy and paste "Drag or Grab" trigger folder in your map triggers.
  • Configurable helper
    • Events
    • Conditions
    • Actions
      • -------- ---------------------------------------------- --------
      • -------- Wether or not the spell will use a lightning effect --------
      • Set DBLeashBool[DBMaxIndex] = False
      • -------- ---------------------------------------------- --------
      • -------- Wether or not the spell will use speed modifier on dragging unit can be slow or speed boost --------
      • Set DBSpeedModBool[DBMaxIndex] = True
      • -------- ---------------------------------------------- --------
      • -------- Make the dragged unit invulnerable or not during the effect --------
      • Set DBMakeInvulnerable[DBMaxIndex] = True
      • -------- ---------------------------------------------- --------
      • -------- Disable dragged unit attack or not during effect --------
      • Set DBDisableAttack[DBMaxIndex] = True
      • -------- ---------------------------------------------- --------
      • -------- Disable dragged unit movement and other command (spam stop order) during effect --------
      • Set DBDisableMove[DBMaxIndex] = True
      • -------- ---------------------------------------------- --------
      • -------- The unit dragging ( the dragged unit will will be pulled by the unit ) --------
      • Set DBDraggingUnit[DBMaxIndex] = (Target unit of ability being cast)
      • -------- ---------------------------------------------- --------
      • -------- The unit that will be dragged --------
      • Set DBDraggedUnit[DBMaxIndex] = (Triggering unit)
      • -------- ---------------------------------------------- --------
      • -------- Damage source unit --------
      • Set DBDamagerUnit[DBMaxIndex] = (Triggering unit)
      • -------- ---------------------------------------------- --------
      • -------- The unit that will recieve damage --------
      • Set DBDamagedUnit[DBMaxIndex] = (Target unit of ability being cast)
      • -------- ---------------------------------------------- --------
      • -------- Damage per seconds dealt to damaged unit during effect --------
      • Set DBDamagePS[DBMaxIndex] = 50.00
      • -------- ---------------------------------------------- --------
      • -------- Attack type used by damager unit --------
      • Set DBAttackType[DBMaxIndex] = Normal
      • -------- ---------------------------------------------- --------
      • -------- Damage type dealt by damager unit --------
      • Set DBDamageType[DBMaxIndex] = Normal
      • -------- ---------------------------------------------- --------
      • -------- Amound of HP restored per seconds to the damager unit during the effect --------
      • Set DBHealPS[DBMaxIndex] = 25.00
      • -------- ---------------------------------------------- --------
      • -------- Duration in seconds of the effect --------
      • Set DBDuration[DBMaxIndex] = 8.00
      • -------- ---------------------------------------------- --------
      • -------- Lightning effect used if DBLeashbool is enabled --------
      • Set DBLightningType[DBMaxIndex] = Drain Life
      • -------- ---------------------------------------------- --------
      • -------- Max distance allowed between dragged and dragging units --------
      • Set DBMaxDistance[DBMaxIndex] = 120.00
      • -------- ---------------------------------------------- --------
      • -------- Min distance allowed between dragger and dragging units --------
      • Set DBMinDistance[DBMaxIndex] = 30.00
      • -------- ---------------------------------------------- --------
      • -------- Speed of charge effect used when ability range is greater than Maxdistance --------
      • Set DBChargingSpeed[DBMaxIndex] = 50.00
      • -------- ---------------------------------------------- --------
      • -------- Path and file string of the effect used --------
      • Set DBEffectString[DBMaxIndex] = war3mapImported\BloodJaw.mdx
      • -------- ---------------------------------------------- --------
      • -------- Attachement point where the effect will attach ( head, chest, overhead etc...) --------
      • Set DBAttachString[DBMaxIndex] = head
      • -------- ---------------------------------------------- --------
      • -------- Unit where the effect will attach --------
      • Set DBEffectTarget[DBMaxIndex] = (Triggering unit)
      • -------- ---------------------------------------------- --------
      • -------- Speed modifier used if DBSpeedModBoll equal true (negative for slow, positive for boost) --------
      • Set DBSpeedMod[DBMaxIndex] = -300.00
      • -------- ---------------------------------------------- --------
  • [/HIDDEN]
  • AbomDB
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dismember (Neutral Hostile)
    • Actions
      • -------- Indexing --------
      • Set DBMaxIndex = (DBMaxIndex + 1)
      • -------- Configurable --------
      • Set DBLeashBool[DBMaxIndex] = False
      • Set DBSpeedModBool[DBMaxIndex] = True
      • Set DBDraggingUnit[DBMaxIndex] = (Target unit of ability being cast)
      • Set DBDraggedUnit[DBMaxIndex] = (Triggering unit)
      • Set DBDamagePS[DBMaxIndex] = 50.00
      • Set DBHealPS[DBMaxIndex] = 25.00
      • Set DBDuration[DBMaxIndex] = 8.00
      • Set DBLightningType[DBMaxIndex] = Drain Life
      • Set DBMaxDistance[DBMaxIndex] = 120.00
      • Set DBMinDistance[DBMaxIndex] = 30.00
      • Set DBChargingSpeed[DBMaxIndex] = 50.00
      • Set DBEffectString[DBMaxIndex] = war3mapImported\BloodJaw.mdx
      • Set DBAttachString[DBMaxIndex] = head
      • Set DBEffectTarget[DBMaxIndex] = (Triggering unit)
      • Set DBDamageType[DBMaxIndex] = Normal
      • Set DBAttackType[DBMaxIndex] = Normal
      • Set DBDamagerUnit[DBMaxIndex] = (Triggering unit)
      • Set DBDamagedUnit[DBMaxIndex] = (Target unit of ability being cast)
      • Set DBSpeedMod[DBMaxIndex] = -300.00
      • Set DBMakeInvulnerable[DBMaxIndex] = True
      • Set DBDisableAttack[DBMaxIndex] = True
      • Set DBDisableMove[DBMaxIndex] = True
      • -------- Run init trigger at the end of configuration --------
      • Trigger - Run DBInit <gen> (ignoring conditions)
      • -------- Optional can delete --------
      • Animation - Play (Triggering unit)'s stand channel animation
  • DBInit
    • Events
    • Conditions
    • Actions
      • Unit - Order DBDraggedUnit[DBMaxIndex] to Stop
      • Special Effect - Create a special effect attached to the DBAttachString[DBMaxIndex] of DBEffectTarget[DBMaxIndex] using DBEffectString[DBMaxIndex]
      • Set DBSpecialEffect[DBMaxIndex] = (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DBDisableAttack[DBMaxIndex] Equal to True
        • Then - Actions
          • Unit - Add Cargo Hold (Orc Burrow) to DBDraggedUnit[DBMaxIndex]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DBMakeInvulnerable[DBMaxIndex] Equal to True
        • Then - Actions
          • Unit - Make DBDamagerUnit[DBMaxIndex] Invulnerable
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DBLeashBool[DBMaxIndex] Equal to True
        • Then - Actions
          • Set DBDraggedLoc[DBMaxIndex] = (Position of (Triggering unit))
          • Set DBDraggingLoc[DBMaxIndex] = (Position of (Target unit of ability being cast))
          • Lightning - Create a DBLightningType[DBMaxIndex] lightning effect from source DBDraggedLoc[DBMaxIndex] to target DBDraggingLoc[DBMaxIndex]
          • Set DBLightning[DBMaxIndex] = (Last created lightning effect)
          • Custom script: call RemoveLocation( udg_DBDraggingLoc[udg_DBMaxIndex] )
          • Custom script: call RemoveLocation( udg_DBDraggedLoc[udg_DBMaxIndex] )
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DBSpeedModBool[DBMaxIndex] Equal to True
        • Then - Actions
          • Unit - Set DBDraggingUnit[DBMaxIndex] movement speed to ((Default movement speed of DBDraggingUnit[DBMaxIndex]) + DBSpeedMod[DBMaxIndex])
        • Else - Actions
      • Unit - Turn collision for DBDraggedUnit[DBMaxIndex] Off
      • Unit - Add Ghost (Visible) to DBDraggedUnit[DBMaxIndex]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DBLoop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on DBLoop <gen>
        • Else - Actions
  • DBLoop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer DBCurrentIndex) from 1 to DBMaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DBDamagedUnit[DBCurrentIndex] is alive) Equal to True
              • DBDuration[DBCurrentIndex] Greater than 0.00
            • Then - Actions
              • Set DBDraggingLoc[DBCurrentIndex] = (Position of DBDraggingUnit[DBCurrentIndex])
              • Set DBDraggedLoc[DBCurrentIndex] = (Position of DBDraggedUnit[DBCurrentIndex])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DBLeashBool[DBCurrentIndex] Equal to True
                • Then - Actions
                  • Lightning - Move DBLightning[DBCurrentIndex] to source DBDraggedLoc[DBCurrentIndex] and target DBDraggingLoc[DBCurrentIndex]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DBDisableMove[DBCurrentIndex] Equal to True
                • Then - Actions
                  • Unit - Order DBDraggedUnit[DBCurrentIndex] to Stop
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between DBDraggedLoc[DBCurrentIndex] and DBDraggingLoc[DBCurrentIndex]) Greater than (DBMaxDistance[DBCurrentIndex] + 15.00)
                • Then - Actions
                  • Set DBChargeLoc[DBCurrentIndex] = (DBDraggedLoc[DBCurrentIndex] offset by DBChargingSpeed[DBCurrentIndex] towards (Angle from DBDraggedLoc[DBCurrentIndex] to DBDraggingLoc[DBCurrentIndex]) degrees)
                  • Custom script: call SetUnitX(( udg_DBDraggedUnit[udg_DBCurrentIndex] ), GetLocationX( udg_DBChargeLoc[udg_DBCurrentIndex] ))
                  • Custom script: call SetUnitY(( udg_DBDraggedUnit[udg_DBCurrentIndex] ), GetLocationY( udg_DBChargeLoc[udg_DBCurrentIndex] ))
                  • Custom script: call SetUnitFacing(( udg_DBDraggedUnit[udg_DBCurrentIndex] ), AngleBetweenPoints(udg_DBDraggedLoc[udg_DBCurrentIndex], udg_DBDraggingLoc[udg_DBCurrentIndex]))
                  • Custom script: call RemoveLocation( udg_DBChargeLoc[udg_DBCurrentIndex] )
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Distance between DBDraggedLoc[DBCurrentIndex] and DBDraggingLoc[DBCurrentIndex]) Less than DBMinDistance[DBCurrentIndex]
                    • Then - Actions
                      • Set DBEffectLoc[DBCurrentIndex] = (DBDraggingLoc[DBCurrentIndex] offset by (DBMinDistance[DBCurrentIndex] x -1.00) towards (Angle from DBDraggedLoc[DBCurrentIndex] to DBDraggingLoc[DBCurrentIndex]) degrees)
                      • Custom script: call SetUnitX(( udg_DBDraggedUnit[udg_DBCurrentIndex] ), GetLocationX( udg_DBEffectLoc[udg_DBCurrentIndex] ))
                      • Custom script: call SetUnitY(( udg_DBDraggedUnit[udg_DBCurrentIndex] ), GetLocationY( udg_DBEffectLoc[udg_DBCurrentIndex] ))
                      • Custom script: call SetUnitFacing(( udg_DBDraggedUnit[udg_DBCurrentIndex] ), AngleBetweenPoints(udg_DBDraggedLoc[udg_DBCurrentIndex], udg_DBDraggingLoc[udg_DBCurrentIndex]))
                      • Custom script: call RemoveLocation( udg_DBEffectLoc[udg_DBCurrentIndex] )
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Distance between DBDraggedLoc[DBCurrentIndex] and DBDraggingLoc[DBCurrentIndex]) Greater than DBMaxDistance[DBCurrentIndex]
                        • Then - Actions
                          • Set DBEffectLoc[DBCurrentIndex] = (DBDraggingLoc[DBCurrentIndex] offset by (DBMaxDistance[DBCurrentIndex] x -1.00) towards (Angle from DBDraggedLoc[DBCurrentIndex] to DBDraggingLoc[DBCurrentIndex]) degrees)
                          • Custom script: call SetUnitX(( udg_DBDraggedUnit[udg_DBCurrentIndex] ), GetLocationX( udg_DBEffectLoc[udg_DBCurrentIndex] ))
                          • Custom script: call SetUnitY(( udg_DBDraggedUnit[udg_DBCurrentIndex] ), GetLocationY( udg_DBEffectLoc[udg_DBCurrentIndex] ))
                          • Custom script: call SetUnitFacing(( udg_DBDraggedUnit[udg_DBCurrentIndex] ), AngleBetweenPoints(udg_DBDraggedLoc[udg_DBCurrentIndex], udg_DBDraggingLoc[udg_DBCurrentIndex]))
                          • Custom script: call RemoveLocation( udg_DBEffectLoc[udg_DBCurrentIndex] )
                        • Else - Actions
                  • Set DBDuration[DBCurrentIndex] = (DBDuration[DBCurrentIndex] - 0.03)
                  • Unit - Cause DBDamagerUnit[DBCurrentIndex] to damage DBDamagedUnit[DBMaxIndex], dealing (DBDamagePS[DBCurrentIndex] / 33.00) damage of attack type DBAttackType[DBCurrentIndex] and damage type DBDamageType[DBCurrentIndex]
                  • Unit - Set life of DBDamagerUnit[DBCurrentIndex] to ((Life of DBDamagerUnit[DBCurrentIndex]) + (DBHealPS[DBCurrentIndex] / 33.00))
              • Custom script: call RemoveLocation( udg_DBDraggedLoc[udg_DBCurrentIndex] )
              • Custom script: call RemoveLocation( udg_DBDraggingLoc[udg_DBCurrentIndex] )
            • Else - Actions
              • Unit - Remove Ghost (Visible) from DBDraggedUnit[DBCurrentIndex]
              • Special Effect - Destroy DBSpecialEffect[DBCurrentIndex]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DBLeashBool[DBCurrentIndex] Equal to True
                • Then - Actions
                  • Lightning - Destroy DBLightning[DBCurrentIndex]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DBSpeedModBool[DBCurrentIndex] Equal to True
                • Then - Actions
                  • Unit - Set DBDraggingUnit[DBCurrentIndex] movement speed to (Default movement speed of DBDraggingUnit[DBCurrentIndex])
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DBMakeInvulnerable[DBCurrentIndex] Equal to True
                • Then - Actions
                  • Unit - Make DBDamagerUnit[DBCurrentIndex] Vulnerable
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DBDisableAttack[DBCurrentIndex] Equal to True
                • Then - Actions
                  • Unit - Remove Cargo Hold (Orc Burrow) from DBDraggedUnit[DBCurrentIndex]
                • Else - Actions
              • Unit - Turn collision for DBDraggedUnit[DBCurrentIndex] On
              • -------- Optional feature remover --------
              • Animation - Play DBDraggedUnit[DBCurrentIndex]'s stand animation
              • Animation - Reset DBDraggedUnit[DBCurrentIndex]'s body-part facing
              • Animation - Change DBDraggedUnit[DBCurrentIndex]'s animation speed to 100.00% of its original speed
              • -------- Deindexing --------
              • Set DBMinDistance[DBCurrentIndex] = DBMinDistance[DBMaxIndex]
              • Set DBMaxDistance[DBCurrentIndex] = DBMaxDistance[DBMaxIndex]
              • Set DBDamagePS[DBCurrentIndex] = DBDamagePS[DBMaxIndex]
              • Set DBHealPS[DBCurrentIndex] = DBHealPS[DBMaxIndex]
              • Set DBLeashBool[DBCurrentIndex] = DBLeashBool[DBMaxIndex]
              • Set DBLeashBool[DBMaxIndex] = False
              • Set DBSpeedModBool[DBCurrentIndex] = DBSpeedModBool[DBMaxIndex]
              • Set DBSpeedModBool[DBMaxIndex] = False
              • Set DBMakeInvulnerable[DBCurrentIndex] = DBMakeInvulnerable[DBMaxIndex]
              • Set DBMakeInvulnerable[DBMaxIndex] = False
              • Set DBDisableAttack[DBCurrentIndex] = DBDisableAttack[DBMaxIndex]
              • Set DBDisableAttack[DBMaxIndex] = False
              • Set DBAttackType[DBCurrentIndex] = DBAttackType[DBMaxIndex]
              • Set DBDamageType[DBCurrentIndex] = DBDamageType[DBMaxIndex]
              • Set DBDisableMove[DBCurrentIndex] = DBDisableMove[DBMaxIndex]
              • Set DBDisableMove[DBMaxIndex] = False
              • Set DBLightning[DBCurrentIndex] = DBLightning[DBMaxIndex]
              • Set DBSpecialEffect[DBCurrentIndex] = DBSpecialEffect[DBMaxIndex]
              • Set DBDraggedUnit[DBCurrentIndex] = DBDraggedUnit[DBMaxIndex]
              • Set DBDraggedUnit[DBMaxIndex] = No unit
              • Set DBDraggingUnit[DBCurrentIndex] = DBDraggingUnit[DBMaxIndex]
              • Set DBDraggingUnit[DBMaxIndex] = No unit
              • Set DBDamagerUnit[DBCurrentIndex] = DBDamagerUnit[DBMaxIndex]
              • Set DBDamagerUnit[DBMaxIndex] = No unit
              • Set DBDamagedUnit[DBCurrentIndex] = DBDamagedUnit[DBMaxIndex]
              • Set DBDamagedUnit[DBMaxIndex] = No unit
              • Set DBChargingSpeed[DBCurrentIndex] = DBChargingSpeed[DBMaxIndex]
              • Set DBEffectTarget[DBCurrentIndex] = DBEffectTarget[DBMaxIndex]
              • Set DBEffectTarget[DBMaxIndex] = No unit
              • Set DBDuration[DBCurrentIndex] = DBDuration[DBMaxIndex]
              • Set DBDuration[DBMaxIndex] = 0.00
              • Set DBMaxIndex = (DBMaxIndex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DBMaxIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
Give credit to me if you use this in your map.

Keywords:
drag, grab, brag, lasso, chain, abduct, capture, kidnap, hook, graplin, single, target, mui
Contents

Grab or Drag (Map)

Reviews
12th Dec 2015 IcemanBo: For long time as NeedsFix. Rejected. 03:35, 24th Jan 2015 IcemanBo: http://www.hiveworkshop.com/forums/spells-569/mui-drag-grab-v1-0-a-259348/#post2643998
If you add/remove default abilities be aware that units might already have this ability, you are operating with.
Adding in this case is redundant, but won't bring unwanted results. Removing will. So don't remove the ability, if unit already had it before.

All your point variables don't need to be arrays. You always create/remove them.

All variables[maxIndex] should be set again to false, 0, 0.00, etc again onDeindex. Else our system might might hold "old" values for further registration, when the variable[index] won't be re-initialisized again.

onDeindex, also decrement the currentIndex by 1, as you deindex dynamicly. You poetentialy would skip one instance after deindex at the moment.

You potentialy modify the unit's movement speed in "DBInit" trigger. Should not you use "current movement speed" as base, instead of "default movement speed", as it the movement speed can change at game time?

Please add import instructions. Please add a version number, so we can differ the versions.

I think the system might be useful. :)
 
Level 10
Joined
May 25, 2021
Messages
376
Hmmm.... I wonder how we can give this variable a custom lightning effect while having the original lightning effects in a same map.

I can only create and use a new lightning effect without changing the original ones by using a series of editing blp, slk, Art - Lightning Effects.

But in this trigger, new added lightning effects do NOT appear on its list, only the original ones. I know with a custom path for an imported custom lightning blp file (e.g. "ReplaceableTextures\Weather\DrainLightning.blp"), I can have that custom lightning effect, but the original lightning effect of the Life Drain ability (DrainLightning.blp) will also be changed while I still wish to use a normal Life Drain of the Dark Ranger Hero. So messy.

  • Set DBLightningType[DBMaxIndex] = Magic Leash
 
Top