• 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.

[Trigger] "Charge" trigger

Status
Not open for further replies.
Level 15
Joined
Dec 12, 2006
Messages
1,664
Hello, I wondered if someone could make me a "charge" trigger, where a unit would: Run very fast to a target (not instantly, but INCREDIBLY fast) and when he got to his target unit, he stunned him for 5 seconds. I KNOW this is possible in GUI, because I've seen it in WoW: Molten Core (the map for Warcraft). Any ideas on how to recreate it?
 
Level 6
Joined
Nov 28, 2007
Messages
203
I got an idea that should absolutely work. Just w8 a min or five.. (Editing this post)

[EDIT]:
This should be it:
  • Charge
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Charge
    • Actions
      • For each (Integer A) from 1 to 50, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Triggering unit)) Not equal to (Integer A)
            • Then - Actions
              • Unit - Set the custom value of (Triggering unit) to (Integer A)
            • Else - Actions
      • Set Charge_Caster[(Custom value of (Triggering unit))] = (Position of (Triggering unit))
      • Set Charge_Target[(Custom value of (Triggering unit))] = (Position of (Target unit of ability being cast))
      • Set Range_Between_Units[(Custom value of (Triggering unit))] = (Distance between Charge_Caster[(Custom value of (Triggering unit))] and Charge_Target[(Custom value of (Triggering unit))])
      • Unit - Order (Triggering unit) to Stop
      • Unit - Make (Triggering unit) face Charge_Target[(Custom value of (Triggering unit))] over 0.00 seconds
      • For each (Integer A) from 1 to 100, do (Actions)
        • Loop - Actions
          • Set RemovablePoint = (Charge_Caster[(Custom value of (Triggering unit))] offset by (Range_Between_Units[(Custom value of (Triggering unit))] / 100.00) towards (Facing of (Triggering unit)) degrees)
          • Unit - Move (Triggering unit) instantly to RemovablePoint
          • Custom script: call RemoveLocation(udg_RemovablePoint)
          • Wait 0.01 seconds
      • Wait 1.01 seconds
      • Custom script: call RemoveLocation(udg_Charge_Caster[GetUnitUserData(GetTriggerUnit())])
      • Custom script: call RemoveLocation(udg_Charge_Target[GetUnitUserData(GetTriggerUnit())])
      • Unit - Set the custom value of (Triggering unit) to 0
Extras: It's MUI (With 50 units. change the first "For each.." to more if u want it to be for more units), the unit is charging over 1 second (Tell me if u want me to change) and there are no leaks, with my knowledge.

[EDIT2]:
Forgot the variables ^^ here they are: RemoveLocation (point), Range_Between_Units
[*] (real array), Charge_Caster[] (point array), Charge_Target[] (point array)

[EDIT3]: hmm.. i tested it now.. didn't work. the unit just stopped and faced the target :/ trying to fix it

[EDIT4]: got the prob now.. can't solve it thou.. need to use JASS to make this spell, sadly. Else it will look very weird.. :S Still working on fixing it with GUI ^^

[EDIT5]: yey.. got an idea ^^ gonna test it and put it here

[EDIT5]: my other version did work, but i found another version by Phish-Paste here: http://www.hiveworkshop.com/resources_new/spells/861/
The triggers are:
  • Charge
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Charge
    • Actions
      • Set ChargeUnitArray[1] = (Casting unit)
      • Set ChargeUnitArray[2] = (Target unit of ability being cast)
      • Set ChargePointArray[1] = (Position of ChargeUnitArray[1])
      • Set ChargePointArray[2] = (Position of ChargeUnitArray[2])
      • Set ChargeRealArray[1] = (Distance between ChargePointArray[1] and ChargePointArray[2])
      • Unit - Make ChargeUnitArray[1] face ChargeUnitArray[2] over 0.00 seconds
      • Wait 0.10 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between ChargePointArray[1] and ChargePointArray[2]) Less than or equal to 350.00
        • Then - Actions
          • Game - Display to (All players controlled by a ((Owner of ChargeUnitArray[1]) controller) player) for 10.00 seconds the text: Too Close To Charge...
          • Unit - Order ChargeUnitArray[1] to Stop
          • Custom script: call RemoveLocation(udg_ChargePointArray[1])
          • Custom script: call RemoveLocation(udg_ChargePointArray[2])
          • Set ChargeUnitArray[1] = No unit
          • Set ChargeUnitArray[2] = No unit
        • Else - Actions
          • Wait 0.10 seconds
          • Unit - Pause ChargeUnitArray[1]
          • Unit - Turn collision for ChargeUnitArray[1] Off
          • Unit - Make ChargeUnitArray[1] Invulnerable
          • Trigger - Turn on Charge Dash <gen>
          • Custom script: call RemoveLocation(udg_ChargePointArray[1])
          • Custom script: call RemoveLocation(udg_ChargePointArray[2])
  • Charge Dash
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set ChargePointArray[1] = (Position of ChargeUnitArray[1])
      • Set ChargePointArray[2] = (Position of ChargeUnitArray[2])
      • Unit - Move ChargeUnitArray[1] instantly to (ChargePointArray[1] offset by 40.00 towards (Facing of ChargeUnitArray[1]) degrees)
      • Unit - Make ChargeUnitArray[1] face ChargeUnitArray[2] over 0.00 seconds
      • Set ChargeRealArray[1] = (Distance between ChargePointArray[1] and ChargePointArray[2])
      • Special Effect - Create a special effect at ChargePointArray[1] using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_ChargePointArray[1])
      • Custom script: call RemoveLocation(udg_ChargePointArray[2])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ChargeRealArray[1] Less than or equal to 100.00
        • Then - Actions
          • Unit - Make ChargeUnitArray[1] Vulnerable
          • Unit - Unpause ChargeUnitArray[1]
          • Unit - Turn collision for ChargeUnitArray[1] On
          • Unit - Turn collision for ChargeUnitArray[2] Off
          • Trigger - Turn off (This trigger)
          • Trigger - Turn on Knock Back <gen>
          • Set ChargeRealArray[2] = 325.00
          • Set ChargeRealArray[3] = 0.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (ChargeUnitArray[2] is dead) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Unit - Make ChargeUnitArray[1] Vulnerable
          • Unit - Unpause ChargeUnitArray[1]
          • Unit - Turn collision for ChargeUnitArray[1] On
          • Unit - Turn collision for ChargeUnitArray[2] On
          • Set ChargeUnitArray[1] = No unit
          • Set ChargeUnitArray[2] = No unit
          • Custom script: call RemoveLocation(udg_ChargePointArray[1])
          • Custom script: call RemoveLocation(udg_ChargePointArray[2])
        • Else - Actions
  • Knock Back
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set ChargePointArray[1] = (Position of ChargeUnitArray[2])
      • Set ChargeRealArray[3] = (ChargeRealArray[3] + 25.00)
      • Special Effect - Create a special effect at ChargePointArray[1] using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Move ChargeUnitArray[2] instantly to (ChargePointArray[1] offset by 25.00 towards (Facing of ChargeUnitArray[1]) degrees)
      • Custom script: call RemoveLocation(udg_ChargePointArray[1])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ChargeRealArray[3] Greater than or equal to ChargeRealArray[2]
        • Then - Actions
          • Unit - Unpause ChargeUnitArray[1]
          • Unit - Turn collision for ChargeUnitArray[2] On
          • Trigger - Turn off (This trigger)
          • Unit - Cause ChargeUnitArray[1] to damage ChargeUnitArray[2], dealing (100.00 x (Real((Level of Charge for ChargeUnitArray[1])))) damage of attack type Spells and damage type Normal
          • Trigger - Turn off Charge Dash <gen>
          • Set ChargeUnitArray[1] = No unit
          • Set ChargeUnitArray[2] = No unit
          • Custom script: call RemoveLocation(udg_ChargePointArray[1])
          • Custom script: call RemoveLocation(udg_ChargePointArray[2])
        • Else - Actions
The ability he's using is Storm Bolt.
 
Last edited:
Status
Not open for further replies.
Top