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

Knockback Gui, Mui V3

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
This time it is an actual MUI, GUI spell.

I improved the spell a lot better than last one.

This one is more stable, and creative.

I added a stop at walls. It already keeps you from going out of the map, and a little effect that makes the unit look like he falls backwards at the end.

All units move at a different distance.



[trigger=Knock Back AoE]
Knock Back AoE
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Knockback
Actions
Set KBP[0] = (Position of (Casting unit))
Set KBG = (Units within 256.00 of KBP[0] matching (((Owner of (Matching unit)) Not equal to (Owner of (Casting unit))) and ((((Matching unit) belongs to an ally of (Owner of (Casting unit))) Not equal to True) and ((((Matching unit) is A structure) Not equal to True) a
Unit Group - Pick every unit in KBG and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
KBC Equal to 0
Then - Actions
Trigger - Turn on Knock Back AoE Loop <gen>
Else - Actions
Set KBN = (KBN + 1)
Set KBC = (KBC + 1)
Set KBT[KBN] = True
Set KBU[KBN] = (Picked unit)
Unit - Pause K_Unit[K_Times]
Set KBP[1] = (Position of KBU[KBN])
Set KBD[KBN] = (Random real number between 400.00 and 800.00)
Set KBS[KBN] = 15.00
Set KBE[KBN] = (KBD[KBN] / KBS[KBN])
Set KBA[KBN] = (Angle from KBP[0] to KBP[1])
Set KBL[KBN] = 0
Animation - Play KBU[KBN]'s death animation
Animation - Change KBU[KBN]'s animation speed to 350.00% of its original speed
Custom script: call RemoveLocation(udg_KBP[1])
Custom script: call RemoveLocation(udg_KBP[0])
Custom script: call DestroyGroup(udg_KBG)[/trigger]

[trigger=Knock Back AoE Loop]Knock Back AoE Loop
Events
Time - Every 0.02 seconds of game time
Conditions
Actions
For each (Integer KB) from 1 to KBN, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
KBT[KB] Equal to True
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
KBD[KB] Less than or equal to 0.00
Then - Actions
Set KBT[KB] = False
Unit - Unpause KBU[KB]
Animation - Change KBU[KB]'s animation speed to 100.00% of its original speed
Animation - Reset KBU[KB]'s animation
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
KB Less than KBN
Then - Actions
Set KBT[KB] = KBT[KBN]
Set KBU[KB] = KBU[KBN]
Set KBD[KB] = KBD[KBN]
Set KBS[KB] = KBS[KBN]
Set KBE[KB] = KBE[KBN]
Set KBL[KB] = KBL[KBN]
Set KBA[KB] = KBA[KBN]
Else - Actions
Set KBN = (KBN - 1)
Set KB = KB
Set KBC = (KBC - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
KBN Equal to 0
Then - Actions
Trigger - Turn off Knock Back AoE Loop <gen>
Else - Actions
Else - Actions
Set KBD[KB] = (KBD[KB] - KBS[KB])
Set KBP[2] = (Position of KBU[KB])
Set KBS[KB] = (KBD[KB] / KBE[KB])
Set KBS[KB] = (KBS[KB] + 0.80)
Set KBP[3] = (KBP[2] offset by KBS[KB] towards KBA[KB] degrees)
Custom script: call SetUnitX(udg_KBU[udg_KB], GetLocationX(udg_KBP[3]))
Custom script: call SetUnitY(udg_KBU[udg_KB], GetLocationY(udg_KBP[3]))
Destructible - Pick every destructible within 150.00 of KBP[2] and do (Destructible - Kill (Picked destructible))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
KBL[KB] Equal to 7
Then - Actions
Set KBL[KB] = 0
Special Effect - Create a special effect at KBP[2] using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
Special Effect - Destroy (Last created special effect)
Else - Actions
Set KBL[KB] = (KBL[KB] + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
((Playable map area) contains KBP[3]) Not equal to True
(Terrain pathing at KBP[3] of type Walkability is off) Equal to True
Then - Actions
Set KBD[KB] = 0.00
Else - Actions
Custom script: call RemoveLocation(udg_KBP[2])
Custom script: call RemoveLocation(udg_KBP[3])
Else - Actions
[/trigger]



Keywords:
Knockback, Gui, Mui, V3, Knockback Gui, Knockback MUI, Knockback Gui Mui, Knockback Gui V3, Knockback Mui V3, Knockback Gui Mui V3, Knockback AoE, AoE
Contents

Gui, Mui Knockback (Map)

Reviews
14:58, 28th Jun 2010 TriggerHappy: We definitely do not need another one of these.

Moderator

M

Moderator

14:58, 28th Jun 2010
TriggerHappy:

We definitely do not need another one of these.
 
Level 15
Joined
Jul 6, 2009
Messages
889
The Hiveworkshop spell system most likely has a few GUI Knockback systems already in it. I don't know what purpose it serves posting "Just another knockback spell" does. We've seen it before, we don't need another one....

- Triggering Unit is faster than Casting Unit
- Why not just check if the unit in the group conditions are an enemy? Rather than seeing if they aren't the caster or the caster's allies.

Even if those are fixed, I still don't like it.
 
what is the diffrence between SetUnitX and SetUnitY ??

Think of a map as a huge coordinate plane. Each little individual point is a pair of coordinates. (Known as an ordered pair) SetUnitX modifies the X-position of the unit (left and right) and SetUnitY modifies the y-position of the unit (up and down). =)

The reason why people prefer to use SetUnitX and SetUnitY opposed to the GUI functions is that SetUnitX/Y doesn't stop the unit's current orders, whereas the GUI functions do. ;)

EDIT: In the periodic trigger, you have:
  • Set KB = KB
Which is a bit redundant. :p Also:

  • Set KBS[KB] = (KBD[KB] / KBE[KB])
  • Set KBS[KB] = (KBS[KB] + 0.80)
Can just be:
  • Set KBS[KB] = (KBD[KB] / KBE[KB]) + 0.80
 
Top