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

[Trigger] Knockback Systems need fixes..

Status
Not open for further replies.
Level 14
Joined
Jul 19, 2007
Messages
772
Atm my map has about 4-5 different knockback systems made of different users that helped me create spells with knockbacks in my map but alot of people says it would slow down the map and make bugs.. I would like someone to fix these triggered knockback-spells with the knockback-effect to just 1 knockback system and I also would like the knockback-effect to not make knockbacked units to get passed threw trees and get stuck in them. Pls I would be glad if someone could help me with this!
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
:Sarcasm: :Irony: : Rude:
So, I guess we'll have to look for some Godly Divine Entity to reveal us your triggers and the systems you're currently using for your Knockback abilities.
:EndSarcasm: :EndIrony: : EndRude:

I mean, show us your triggers, post your map, give us the links to the systems you're currently using, etc. Anything is better than telling us you have a problem with 5 systems you want to mix, without telling us wich are.

Is there any other way you could think off for we to know what triggers/systems you use, and know the bugs those systems have, and know how to mix/fix them, etc.?...

I think i made my point :)
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
If you are using system, don't mix the systems that serves the same purpose, it is better to just use only one system of particular kind in your map.
It slows down your performance because there would be many event of periodic time occur.

You can take a look at my Frictional Knockback system (signature), it is a knockback system but with a decreasing acceleration, it is like a real knockback instead of a sudden break.
 
Level 14
Joined
Jul 19, 2007
Messages
772
:Sarcasm: :Irony: : Rude:
So, I guess we'll have to look for some Godly Divine Entity to reveal us your triggers and the systems you're currently using for your Knockback abilities.
:EndSarcasm: :EndIrony: : EndRude:

I mean, show us your triggers, post your map, give us the links to the systems you're currently using, etc. Anything is better than telling us you have a problem with 5 systems you want to mix, without telling us wich are.

Is there any other way you could think off for we to know what triggers/systems you use, and know the bugs those systems have, and know how to mix/fix them, etc.?...

I think i made my point :)
No but I can send the map and you can take a look to them if u want but so far the game isn't going buggy or slow but I want to be sure the game will not bug or something but I'm not good at triggering and understands nothing about JASS or what it's called thats why I'm asking for help.. It's also important if someone could fix the knockbacks to NOT make units to getting threw trees when knockbacked and gets stuck with in them. I know one of the knockback does not make units going threw trees but I can't see how they maked it like that..
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Well, there are systems already for that. You should post the map right here for everyone to look at, or post your Knockback triggers. You could/should also follow mckill2009 suggestion.
 
Level 14
Joined
Jul 19, 2007
Messages
772
Well, there are systems already for that. You should post the map right here for everyone to look at, or post your Knockback triggers. You could/should also follow mckill2009 suggestion.
Well, there are systems already for that. You should post the map right here for everyone to look at, or post your Knockback triggers. You could/should also follow mckill2009 suggestion.
I'm not going to post my map here becuase I don't want anyone to steal it, I'll just send it to someone who will help me..
Well I'll post the Knockback-triggers then.

First Knockback-trigger.
  • Knockback Initialize
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Knockback_Hash = (Last created hashtable)
      • -------- -------------------- --------
      • -------- -------------------- --------
      • -------- How long the knockback lasts in seconds --------
      • -------- -------------------- --------
      • Set Knockback_Time = 1.00
      • -------- -------------------- --------
      • -------- Initial speed of the knockback --------
      • -------- -------------------- --------
      • Set Knockback_Speed = 30.00
      • -------- -------------------- --------
      • -------- Does the spell do damage over time --------
      • -------- -------------------- --------
      • Set Knockback_DoT = False
      • -------- -------------------- --------
      • -------- Does the ability add special effect on the unit --------
      • -------- -------------------- --------
      • Set Knockback_Effect = False
      • -------- -------------------- --------
      • -------- Do units rotate while knocked back --------
      • -------- -------------------- --------
      • Set Knockback_Rotate = True
      • -------- -------------------- --------
      • -------- If this is true, the spell pushes, if false, it pulls --------
      • -------- -------------------- --------
      • Set Knockback_Push = True
      • -------- -------------------- --------
      • -------- -------------------- --------
  • Knockback
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Knockback_Group and do (Actions)
        • Loop - Actions
          • Set Temp_Unit_1 = (Picked unit)
          • Set Temp_Real_1 = (Load (Key loop) of (Key (Picked unit)) from Knockback_Hash)
          • -------- -------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Temp_Real_1 Less than or equal to (Knockback_Time x (1.00 / 0.03))
            • Then - Actions
              • Set Temp_Loc_1 = (Position of Temp_Unit_1)
              • -------- -------------------- --------
              • Set Temp_Real_2 = (Load (Key angle) of (Key (Picked unit)) from Knockback_Hash)
              • -------- -------------------- --------
              • Set Temp_Real_3 = (Knockback_Speed x (Power(0.90, Temp_Real_1)))
              • -------- -------------------- --------
              • Set Temp_Real_4 = (X of Temp_Loc_1)
              • Set Temp_Real_5 = (Y of Temp_Loc_1)
              • -------- -------------------- --------
              • Set Temp_Real_4 = ((X of Temp_Loc_1) + (Temp_Real_3 x (Cos(Temp_Real_2))))
              • Set Temp_Real_5 = ((Y of Temp_Loc_1) + (Temp_Real_3 x (Sin(Temp_Real_2))))
              • -------- -------------------- --------
              • Set Temp_Loc_2 = (Point(Temp_Real_4, Temp_Real_5))
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Terrain pathing at Temp_Loc_2 of type Walkability is off) Equal to False
                • Then - Actions
                  • Custom script: call SetUnitX(udg_Temp_Unit_1, udg_Temp_Real_4)
                  • Custom script: call SetUnitY(udg_Temp_Unit_1, udg_Temp_Real_5)
                • Else - Actions
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Knockback_Rotate Equal to True
                  • (Random integer number between 1 and 4) Equal to 1
                • Then - Actions
                  • Unit - Make Temp_Unit_1 face ((Facing of Temp_Unit_1) - 180.00) over 0.00 seconds
                • Else - Actions
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Knockback_DoT Equal to True
                • Then - Actions
                  • Set Temp_Unit_2 = (Load (Key caster) of (Key (Picked unit)) in Knockback_Hash)
                  • Set Temp_Real_2 = (Load (Key dmg) of (Key (Picked unit)) from Knockback_Hash)
                  • Unit - Cause Temp_Unit_2 to damage Temp_Unit_1, dealing Temp_Real_2 damage of attack type Spells and damage type Normal
                • Else - Actions
              • -------- -------------------- --------
              • Hashtable - Save (Temp_Real_1 + 1.00) as (Key loop) of (Key (Picked unit)) in Knockback_Hash
              • -------- -------------------- --------
              • Custom script: call RemoveLocation(udg_Temp_Loc_1)
              • Custom script: call RemoveLocation(udg_Temp_Loc_2)
            • Else - Actions
              • -------- -------------------- --------
              • Special Effect - Destroy (Load (Key effect_1) of (Key (Picked unit)) in Knockback_Hash)
              • -------- -------------------- --------
              • Unit Group - Remove Temp_Unit_1 from Knockback_Group
              • -------- -------------------- --------
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Knockback_Hash
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in Knockback_Group) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions

Second Knockback-trigger.
  • Knockback Initialize Copy
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Knockback_Hash = (Last created hashtable)
      • -------- -------------------- --------
      • -------- Does the spell do damage over time --------
      • -------- -------------------- --------
      • Set Knockback_DoT = False
      • -------- -------------------- --------
      • -------- Does the ability add special effect on the unit --------
      • -------- -------------------- --------
      • Set Knockback_Effect = True
      • -------- -------------------- --------
      • -------- Do units rotate while knocked back --------
      • -------- -------------------- --------
      • Set Knockback_Rotate = False
      • -------- -------------------- --------
      • -------- -------------------- --------
  • Knockback Copy
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Knockback_Group and do (Actions)
        • Loop - Actions
          • Set Temp_Unit_1 = (Picked unit)
          • Set Temp_Real_1 = (Load (Key loop) of (Key (Picked unit)) from Knockback_Hash)
          • Set Temp_Real_3 = ((Load (Key speed) of (Key (Picked unit)) from Knockback_Hash) x (Power(0.98, Temp_Real_1)))
          • -------- -------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Temp_Real_3 Greater than 0.10
            • Then - Actions
              • Set Temp_Loc_1 = (Position of Temp_Unit_1)
              • -------- -------------------- --------
              • Set Temp_Real_2 = (Load (Key angle) of (Key (Picked unit)) from Knockback_Hash)
              • -------- -------------------- --------
              • Set Temp_Real_4 = ((X of Temp_Loc_1) + (Temp_Real_3 x (Cos(Temp_Real_2))))
              • Set Temp_Real_5 = ((Y of Temp_Loc_1) + (Temp_Real_3 x (Sin(Temp_Real_2))))
              • -------- -------------------- --------
              • Set Temp_Loc_2 = (Point(Temp_Real_4, Temp_Real_5))
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Terrain pathing at Temp_Loc_2 of type Walkability is off) Equal to False
                • Then - Actions
                  • Custom script: call SetUnitX(udg_Temp_Unit_1, udg_Temp_Real_4)
                  • Custom script: call SetUnitY(udg_Temp_Unit_1, udg_Temp_Real_5)
                • Else - Actions
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Knockback_Rotate Equal to True
                  • (Random integer number between 1 and 4) Equal to 1
                • Then - Actions
                  • Unit - Make Temp_Unit_1 face ((Facing of Temp_Unit_1) - 180.00) over 0.00 seconds
                • Else - Actions
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Knockback_DoT Equal to True
                • Then - Actions
                  • Set Temp_Unit_2 = (Load (Key caster) of (Key (Picked unit)) in Knockback_Hash)
                  • Set Temp_Real_2 = (Load (Key damage) of (Key (Picked unit)) from Knockback_Hash)
                  • Unit - Cause Temp_Unit_2 to damage Temp_Unit_1, dealing Temp_Real_2 damage of attack type Spells and damage type Normal
                • Else - Actions
              • -------- -------------------- --------
              • Hashtable - Save Temp_Real_3 as (Key speed) of (Key (Picked unit)) in Knockback_Hash
              • Hashtable - Save (Temp_Real_1 + 1.00) as (Key loop) of (Key (Picked unit)) in Knockback_Hash
              • -------- -------------------- --------
              • Custom script: call RemoveLocation(udg_Temp_Loc_1)
              • Custom script: call RemoveLocation(udg_Temp_Loc_2)
            • Else - Actions
              • -------- -------------------- --------
              • Special Effect - Destroy (Load (Key effect_1) of (Key (Picked unit)) in Knockback_Hash)
              • -------- -------------------- --------
              • Unit Group - Remove Temp_Unit_1 from Knockback_Group
              • -------- -------------------- --------
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Knockback_Hash
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in Knockback_Group) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
Third Knockback-trigger.
  • Charge Init
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- ------------------------- --------
      • -------- Create hashtable for storing data --------
      • -------- ------------------------- --------
      • Hashtable - Create a hashtable
      • Set EC_Hash = (Last created hashtable)
      • -------- ------------------------- --------
      • -------- Base damage --------
      • -------- ------------------------- --------
      • Set EC_Reals[0] = 20.00
      • -------- ------------------------- --------
      • -------- Level bonus damage --------
      • -------- ------------------------- --------
      • Set EC_Reals[1] = 55.00
      • -------- ------------------------- --------
      • -------- Initial speed of the charge --------
      • -------- ------------------------- --------
      • Set EC_Reals[2] = 8.00
      • -------- ------------------------- --------
      • -------- Max speed of the charge --------
      • -------- ------------------------- --------
      • Set EC_Reals[3] = 25.00
      • -------- ------------------------- --------
      • -------- Knockback range --------
      • -------- ------------------------- --------
      • Set EC_Reals[4] = 192.00
      • -------- ------------------------- --------
      • -------- Knockback max speed --------
      • -------- ------------------------- --------
      • Set EC_Reals[5] = 30.00
      • -------- ------------------------- --------
      • -------- Charge acceleration multiplier ( 1 = no acceleration) --------
      • -------- ------------------------- --------
      • Set EC_Reals[6] = 1.20
      • -------- ------------------------- --------
  • Charge
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Charge
    • Actions
      • Set Temp_Unit_1 = (Triggering unit)
      • Set Temp_Loc_1 = (Position of Temp_Unit_1)
      • Set Temp_Loc_2 = (Target point of ability being cast)
      • -------- ------------------------- --------
      • Unit - Turn collision for Temp_Unit_1 Off
      • -------- ------------------------- --------
      • Set Temp_Real_1 = (Distance between Temp_Loc_1 and Temp_Loc_2)
      • Set Temp_Real_2 = (EC_Reals[0] + (EC_Reals[1] x (Real((Level of (Ability being cast) for Temp_Unit_1)))))
      • -------- ------------------------- --------
      • Special Effect - Create a special effect attached to the left foot of Temp_Unit_1 using Abilities\Weapons\Bolt\BoltImpact.mdl
      • Hashtable - Save Handle Of(Last created special effect) as (Key effect_1) of (Key (Triggering unit)) in EC_Hash
      • Special Effect - Create a special effect attached to the right foot of Temp_Unit_1 using Abilities\Weapons\Bolt\BoltImpact.mdl
      • Hashtable - Save Handle Of(Last created special effect) as (Key effect_2) of (Key (Triggering unit)) in EC_Hash
      • Special Effect - Create a special effect attached to the left hand of Temp_Unit_1 using Abilities\Weapons\Bolt\BoltImpact.mdl
      • Hashtable - Save Handle Of(Last created special effect) as (Key effect_3) of (Key (Triggering unit)) in EC_Hash
      • Special Effect - Create a special effect attached to the right hand of Temp_Unit_1 using Abilities\Weapons\Bolt\BoltImpact.mdl
      • Hashtable - Save Handle Of(Last created special effect) as (Key effect_4) of (Key (Triggering unit)) in EC_Hash
      • -------- ------------------------- --------
      • Hashtable - Save 0.00 as (Key distance) of (Key (Triggering unit)) in EC_Hash
      • Hashtable - Save EC_Reals[2] as (Key speed) of (Key (Triggering unit)) in EC_Hash
      • Hashtable - Save Temp_Real_2 as (Key damage) of (Key (Triggering unit)) in EC_Hash
      • Hashtable - Save Temp_Real_1 as (Key distance_max) of (Key (Triggering unit)) in EC_Hash
      • Hashtable - Save (Angle from Temp_Loc_1 to Temp_Loc_2) as (Key angle) of (Key (Triggering unit)) in EC_Hash
      • -------- ------------------------- --------
      • Custom script: call RemoveLocation(udg_Temp_Loc_1)
      • Custom script: call RemoveLocation(udg_Temp_Loc_2)
      • -------- ------------------------- --------
      • Unit Group - Add Temp_Unit_1 to EC_Group
      • -------- ------------------------- --------
      • Trigger - Turn on Charge Loop <gen>
  • Charge Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in EC_Group and do (Actions)
        • Loop - Actions
          • Set Temp_Unit_1 = (Picked unit)
          • Set Temp_Real_1 = (Load (Key distance) of (Key (Picked unit)) from EC_Hash)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Temp_Unit_1 is alive) Equal to True
              • Temp_Real_1 Less than (Load (Key distance_max) of (Key (Picked unit)) from EC_Hash)
            • Then - Actions
              • Set Temp_Loc_1 = (Position of Temp_Unit_1)
              • -------- -------------------- --------
              • Set Temp_Real_2 = (Load (Key angle) of (Key (Picked unit)) from EC_Hash)
              • Set Temp_Real_3 = ((Load (Key speed) of (Key (Picked unit)) from EC_Hash) x EC_Reals[6])
              • -------- -------------------- --------
              • Set Temp_Real_4 = ((X of Temp_Loc_1) + (Temp_Real_3 x (Cos(Temp_Real_2))))
              • Set Temp_Real_5 = ((Y of Temp_Loc_1) + (Temp_Real_3 x (Sin(Temp_Real_2))))
              • -------- -------------------- --------
              • Set Temp_Loc_2 = (Point(Temp_Real_4, Temp_Real_5))
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Terrain pathing at Temp_Loc_2 of type Walkability is off) Equal to False
                • Then - Actions
                  • Custom script: call SetUnitX(udg_Temp_Unit_1, udg_Temp_Real_4)
                  • Custom script: call SetUnitY(udg_Temp_Unit_1, udg_Temp_Real_5)
                  • Set Temp_Real_4 = (Distance between Temp_Loc_1 and Temp_Loc_2)
                • Else - Actions
                  • Hashtable - Save Temp_Real_3 as (Key speed) of (Key (Picked unit)) in EC_Hash
                  • Set Temp_Real_4 = 5000.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Temp_Real_3 Less than EC_Reals[5]
                • Then - Actions
                  • Hashtable - Save Temp_Real_3 as (Key speed) of (Key (Picked unit)) in EC_Hash
                • Else - Actions
              • Hashtable - Save (Temp_Real_1 + Temp_Real_4) as (Key distance) of (Key (Picked unit)) in EC_Hash
              • -------- -------------------- --------
              • Set Temp_Real_3 = (Load (Key damage) of (Key (Picked unit)) from EC_Hash)
              • -------- -------------------- --------
              • Set Temp_Group_1 = (Units within EC_Reals[4] of Temp_Loc_2 matching ((((Matching unit) is alive) Equal to True) and (((((Matching unit) is A structure) Equal to False) and (((Matching unit) is in Knockback_Group) Equal to False)) and (((Owner of (Matching unit)) is an enemy of
              • Unit Group - Pick every unit in Temp_Group_1 and do (Actions)
                • Loop - Actions
                  • Set Temp_Real_1 = (Facing of Temp_Unit_1)
                  • Set Temp_Unit_2 = (Picked unit)
                  • Set Temp_Loc_3 = (Position of Temp_Unit_2)
                  • -------- -------------------- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Cos((Temp_Real_1 - (Angle from Temp_Loc_2 to Temp_Loc_3)))) Greater than (Cos(90.00))
                    • Then - Actions
                      • Set Temp_Real_1 = (Temp_Real_1 - 90.00)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Cos((Temp_Real_1 - (Angle from Temp_Loc_2 to Temp_Loc_3)))) Greater than (Cos(90.00))
                        • Then - Actions
                          • Set Temp_Real_4 = -30.00
                        • Else - Actions
                          • Set Temp_Real_4 = 30.00
                      • Special Effect - Create a special effect attached to the chest of Temp_Unit_2 using Abilities\Weapons\ChimaeraLightningMissile\ChimaeraLightningMissile.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect attached to the origin of Temp_Unit_2 using Abilities\Spells\Other\Tornado\Tornado_Target.mdl
                      • -------- -------------------- --------
                      • Unit - Cause Temp_Unit_1 to damage Temp_Unit_2, dealing Temp_Real_3 damage of attack type Hero and damage type Normal
                      • -------- -------------------- --------
                      • Hashtable - Save 1.00 as (Key loop) of (Key (Picked unit)) in Knockback_Hash
                      • Hashtable - Save EC_Reals[5] as (Key speed) of (Key (Picked unit)) in Knockback_Hash
                      • Hashtable - Save Handle Of(Last created special effect) as (Key effect_1) of (Key (Picked unit)) in Knockback_Hash
                      • Hashtable - Save ((Angle from Temp_Loc_1 to Temp_Loc_2) + Temp_Real_4) as (Key angle) of (Key (Picked unit)) in Knockback_Hash
                      • -------- -------------------- --------
                      • Unit Group - Add Temp_Unit_2 to Knockback_Group
                      • -------- -------------------- --------
                      • Custom script: call RemoveLocation(udg_Temp_Loc_3)
                    • Else - Actions
              • Trigger - Turn on Knockback <gen>
              • Custom script: call DestroyGroup(udg_Temp_Group_1)
              • Custom script: call RemoveLocation(udg_Temp_Loc_1)
              • Custom script: call RemoveLocation(udg_Temp_Loc_2)
            • Else - Actions
              • Special Effect - Destroy (Load (Key effect_1) of (Key (Picked unit)) in EC_Hash)
              • Special Effect - Destroy (Load (Key effect_2) of (Key (Picked unit)) in EC_Hash)
              • Special Effect - Destroy (Load (Key effect_3) of (Key (Picked unit)) in EC_Hash)
              • Special Effect - Destroy (Load (Key effect_4) of (Key (Picked unit)) in EC_Hash)
              • -------- -------------------- --------
              • Unit - Turn collision for Temp_Unit_1 On
              • -------- -------------------- --------
              • Unit Group - Remove Temp_Unit_1 from EC_Group
              • -------- -------------------- --------
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in EC_Hash
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (EC_Group is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
Fourth Knockback-trigger.
JASS:
//TESH.scrollpos=0
//TESH.alwaysfold=0
//The rawcode of the spell
constant function TB_SID takes nothing returns integer
    return 'A076'
endfunction

//The rawcode of the dummy unit (Tornado)
constant function TB_DID takes nothing returns integer
    return 'h018'
endfunction

//The rawcode of the slow-ability
constant function TB_SlowID takes nothing returns integer
    return 'A075'
endfunction

//The movement speed of the knockbacks
constant function TB_SPEED takes nothing returns real
    return 18.0
endfunction

//A timer intervall. Better do not change
constant function TB_INTERVALL takes nothing returns real
    return 0.02
endfunction

//The collision size of the Tornado. Enemies in that range will be affected
constant function TB_COLLISION takes nothing returns real
    return 110.0
endfunction

//This is how far an enemy is knocked when hit by the Tornado
constant function TB_ENEMY_DISTANCE takes real level returns real
    return level * 220 + 350
endfunction

//Howlong the enemies are affected by the slow
constant function TB_SlowDuration takes real level returns real
    return level * 0 + 4
endfunction

//Calculates the damage. It´s related to the level of the ability and the
//intellegence of the casting hero.
function TB_GetDamage takes unit u returns real

    local integer level = GetUnitAbilityLevel(u,TB_SID())
    local real damage = level*1.75*GetHeroInt(u,true)
    return damage
    
endfunction

//This will slow down the enemies. You can change the model though.
function TB_SlowEffect takes unit u returns effect

    local string SFX = "Abilities\\Spells\\Other\\Tornado\\Tornado_Target.mdl"
    local string ATTATCH = "overhead"
    call SetUnitVertexColor(u,90,90,255,200)
    call UnitAddAbility(u,TB_SlowID())
    return AddSpecialEffectTarget(SFX,u,ATTATCH)
    
endfunction

//Special effect being displayed when a unit is knocked away.
function TB_SpecialEffect takes real x, real y returns nothing

    local string s = "Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl"
    call DestroyEffect(AddSpecialEffect(s,x,y))
    
endfunction

//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////

//Will remove the slow effect after the deisered time.
function TB_RemoveSlow takes nothing returns nothing

    local timer t = GetExpiredTimer()
    local integer id = GetHandleId(t)
    //Get the timer and the id
    local unit u = LoadUnitHandle(udg_TB_HASHTABLE ,id,0)
        
    //Reset the affected unit
    call SetUnitVertexColor(u,255,255,255,255)
    call UnitRemoveAbility(u,TB_SlowID())
    call DestroyEffect(LoadEffectHandle(udg_TB_HASHTABLE ,id,5))
    
    //Clean up stuff
    call FlushChildHashtable(udg_TB_HASHTABLE ,id)
    call PauseTimer(t)
    call DestroyTimer(t)
    
    set t = null
    set u = null

endfunction

//Checks if a unit is outside the map or not.
function TB_IsOutOfMap takes widget w, real x, real y returns boolean

    local real array p
    
    set p[0] = 64.0
    set p[1] = GetRectMaxX(bj_mapInitialPlayableArea) - p[0]
    set p[2] = GetRectMaxY(bj_mapInitialPlayableArea) - p[0]
    set p[3] = GetRectMinX(bj_mapInitialPlayableArea) + p[0]
    set p[4] = GetRectMinY(bj_mapInitialPlayableArea) + p[0]
    
    return x >= p[1] or x <= p[3] or y >= p[2] or y <= p[4]
    
endfunction

//Callback which will move the an affected unit
function TB_EnemyKnock takes nothing returns nothing

    local timer t = GetExpiredTimer()
    local integer id = GetHandleId(t)
    //Getting the timer + id
    local unit u = LoadUnitHandle(udg_TB_HASHTABLE ,id,0)
    local real x = GetWidgetX(u) + LoadReal(udg_TB_HASHTABLE ,id,1)
    local real y = GetWidgetY(u) + LoadReal(udg_TB_HASHTABLE ,id,2)
    local real d = LoadReal(udg_TB_HASHTABLE ,id,3) - TB_SPEED()
    //Getting the stuff attatched to it and doing some calcs
        
    //Moving the unit
    call SetUnitX(u,x)
    call SetUnitY(u,y)
    call TB_SpecialEffect(x,y)
    call SaveReal(udg_TB_HASHTABLE ,id,3,d)
    
    //Checks if the knockback is over
    if d <= .0 or TB_IsOutOfMap(u,x,y) then
        call SaveBoolean(udg_TB_HASHTABLE ,GetHandleId(u),8,false)
        call PauseTimer(t)
        call TimerStart(t,TB_SlowDuration(LoadInteger(udg_TB_HASHTABLE ,id,6)),false, function TB_RemoveSlow)
    endif
    
    set t = null
    set u = null
    
endfunction

//A function which will deal with all enemies near a tornado
function TB_EnemyDetect takes nothing returns boolean

    local integer id = LoadInteger(udg_TB_HASHTABLE ,0,0)
    //Getting the id of the corresponding timer.
    local unit u = GetFilterUnit()
    local unit d = null
    local timer t = null
    local real x
    local real y
    local real rad
    local real dmg
    local integer lv
        
    //If the unit fits our conditions...
    if IsUnitEnemy(u,LoadPlayerHandle(udg_TB_HASHTABLE ,id,4)) and not(LoadBoolean(udg_TB_HASHTABLE ,GetHandleId(u),8) or IsUnitType(u,UNIT_TYPE_DEAD) or IsUnitType(u,UNIT_TYPE_STRUCTURE) or IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE) ) then
        
        set lv = LoadInteger(udg_TB_HASHTABLE ,id,6)
        set d = LoadUnitHandle(udg_TB_HASHTABLE ,id,0)
        set x = GetWidgetX(u) - GetWidgetX(d)
        set y = GetWidgetY(u) - GetWidgetY(d)
        set rad = Atan2(x,y)
        set dmg = LoadReal(udg_TB_HASHTABLE ,id,7)
        //.... we do some calcs for starting the knockback
        
        set t = CreateTimer()
        set id = GetHandleId(t)
                                
        call SaveUnitHandle(udg_TB_HASHTABLE ,id,0,u)
        call SaveReal(udg_TB_HASHTABLE ,id,1,Cos(rad)*TB_SPEED())
        call SaveReal(udg_TB_HASHTABLE ,id,2,Sin(rad)*TB_SPEED())
        call SaveReal(udg_TB_HASHTABLE ,id,3,TB_ENEMY_DISTANCE(LoadInteger(udg_TB_HASHTABLE ,id,6)))
        call SaveInteger(udg_TB_HASHTABLE ,id,6,lv)
        call SaveEffectHandle(udg_TB_HASHTABLE ,id,5,TB_SlowEffect(u))
        call SaveBoolean(udg_TB_HASHTABLE ,GetHandleId(u),8,true)
        call SetUnitAbilityLevel(u,TB_SlowID(),lv)
        //Creating a timer and attatching stuff to it
        
        //1.Deal damage   2. Start the knockback   3. Cleanup
        call UnitDamageTarget(d,u,dmg,false,false,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_UNKNOWN,WEAPON_TYPE_WHOKNOWS)
        
        call TimerStart(t,TB_INTERVALL(),true, function TB_EnemyKnock)
        
        set d = null
        set t = null
        
    endif
    
    set u = null
    return false
    
endfunction

//Call back for a timer which moves a tornadom (similar to the MoveEnemiy func but not equal)
function TB_TornadoMove takes nothing returns nothing

    local timer t = GetExpiredTimer()
    local integer id = GetHandleId(t)
    local unit u = LoadUnitHandle(udg_TB_HASHTABLE ,id,0)
    local real x = GetWidgetX(u) + LoadReal(udg_TB_HASHTABLE ,id,1)
    local real y = GetWidgetY(u) + LoadReal(udg_TB_HASHTABLE ,id,2)
    local real d = LoadReal(udg_TB_HASHTABLE ,id,3) - TB_SPEED()
    //Getting timer and stuff...doing calcs
    
    call SaveInteger(udg_TB_HASHTABLE ,0,0,id)
    call GroupClear(LoadGroupHandle(udg_TB_HASHTABLE,1,1))
    call GroupEnumUnitsInRange(LoadGroupHandle(udg_TB_HASHTABLE,1,1),x,y,TB_COLLISION(), Filter( function TB_EnemyDetect))  
    //Looking for units near the tornado    
    
    //Moving the tornado
    call SetUnitX(u,x)
    call SetUnitY(u,y)
    call SaveReal(udg_TB_HASHTABLE ,id,3,d)
    
    //If the tornado is near it´s end we stop this thing
    if d <= .0 or TB_IsOutOfMap(u,x,y) then
        call PauseTimer(t)
        call DestroyTimer(t)
        call KillUnit(u)
        call FlushChildHashtable(udg_TB_HASHTABLE ,id)
    endif
    
    set t = null
    set u = null

endfunction

//The function which starts this whole thing off
function TB_onCast takes nothing returns nothing

    local timer t = CreateTimer()
    local unit  c = GetTriggerUnit()
    local location l = GetSpellTargetLoc()
    local real x = GetWidgetX(c)
    local real y = GetWidgetY(c)
    local integer id = GetHandleId(t)
    local unit u = CreateUnit(GetOwningPlayer(c),TB_DID(),x,y,0)
    local real r
    //Getting various data
    
    set x = GetLocationX(l)-x
    set y = GetLocationY(l)-y
    set r = Atan2(y,x)
        
    call SaveUnitHandle(udg_TB_HASHTABLE ,id,0,u)
    call SaveReal(udg_TB_HASHTABLE ,id,1,Cos(r)*TB_SPEED())
    call SaveReal(udg_TB_HASHTABLE ,id,2,Sin(r)*TB_SPEED())
    call SaveReal(udg_TB_HASHTABLE ,id,3,SquareRoot(x*x+y*y))
    //Doing some calcs and attatching some stuff to it
    
    call SavePlayerHandle(udg_TB_HASHTABLE ,id,4,GetOwningPlayer(u))
    call SaveInteger(udg_TB_HASHTABLE ,id,6,GetUnitAbilityLevel(c,TB_SID()))
    call SaveReal(udg_TB_HASHTABLE ,id,7,TB_GetDamage(c))
    //Attatching other things
        
    call TimerStart(t,TB_INTERVALL(),true, function TB_TornadoMove)
    //Start the tornado
    
    //Cleanup
    call RemoveLocation(l)
    set t = null
    set c = null
    set l = null
    set u = null

endfunction

//Checks if the correct spell is casted
function TB_onCheck takes nothing returns boolean
    return GetSpellAbilityId() == TB_SID()
endfunction

//Trigger restier and onInit stuff
function InitTrig_Wind_of_the_South takes nothing returns nothing

    local trigger trig = CreateTrigger()
    
    set udg_TB_HASHTABLE = InitHashtable()
    call SaveGroupHandle(udg_TB_HASHTABLE ,1,1,CreateGroup())
    
    call TriggerRegisterAnyUnitEventBJ(trig,EVENT_PLAYER_UNIT_SPELL_CAST)
    call TriggerAddAction(trig, function TB_onCast)
    call TriggerAddCondition(trig, Filter( function TB_onCheck))
    
    set trig = null
    
endfunction

The Knockback-Trigger of the Spell that does not get units threw trees..
  • 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
                    • Then - Actions
                    • 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
  • True Shot
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to True Shot
    • Actions
      • Set KBA_Caster = (Triggering unit)
      • Set KBA_TargetUnit = (Target unit of ability being cast)
      • Set KBA_StartingPosition = (Position of (Triggering unit))
      • Set KBA_Level = (Level of (Ability being cast) for (Triggering unit))
      • Set KBA_Speed = 7.00
      • Set KBA_DistancePerLevel = 150.00
      • Set KBA_SpecialEffects[1] = Abilities\Spells\Undead\OrbOfDeath\OrbOfDeathMissile.mdl
      • Set KBA_SpecialEffects[2] = Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
      • Set KBA_DestroyTrees = False
      • Wait 0.00 seconds
      • Trigger - Run Cast A Knockback <gen> (checking conditions)
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing ((2.00 x (Real(KBA_Level))) x ((Real((Agility of (Casting unit) (Include bonuses)))) + 0.00)) damage of attack type Spells and damage type Normal
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Great, now... Remove all those systems, and use just the one that fits you most.

They all do pretty much the same; the thing is you're using ABILITIES with an already implemend specific KnockBack System, so, each ability will have it's own. When you understand how these abilities works, you can just use one system for all of them.
 
Level 14
Joined
Jul 19, 2007
Messages
772
Great, now... Remove all those systems, and use just the one that fits you most.

They all do pretty much the same; the thing is you're using ABILITIES with an already implemend specific KnockBack System, so, each ability will have it's own. When you understand how these abilities works, you can just use one system for all of them.
I do not dare doing it by myself becuase I'm not sure the spells will work after it and the knockbacks are meant to be a little different in each spell..
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
That's why I said "Pick the one that suits you the most". If you read through them, and understand what they do, you would be able to create your own specific KnockBack system that does exactly what you want the way you want.

Spells will work as long as you adjust them to work with the choosen sytem (or adjust the system to work with the abilities)
 
Level 14
Joined
Jul 19, 2007
Messages
772
That's why I said "Pick the one that suits you the most". If you read through them, and understand what they do, you would be able to create your own specific KnockBack system that does exactly what you want the way you want.

Spells will work as long as you adjust them to work with the choosen sytem (or adjust the system to work with the abilities)
I don't know who suits the most and I don't think the JASS Knockback System or the one that doesn't make units gets threw trees should be changed becuase they are abit more complicated than the other 3 ones.. Would be nice if someone could fix the 3 first Knockback-systems to just 1 Knockback System to for the 3 Spells for it and a System the unables Knockbacked units to get passed threw trees and gets stuck with them.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Lets say you want a system where you set
1. Bash Distance
2. Bash Duration
4. Bash Damage
3. A Boolean to know if it throws trees downs or not

So, the Unit will be moved from it's start position to StartPosition+BasDistance. The time that will take for the unit to move from point A to point B will be equal to BashDuration, and the BashDamage will be dealt in fractions that totalizes the BashDamage at the end of the Bashduration, AND, if you want that particular ability to throw down trees, set a boolean to "True" and if you don't want the Ability to throw trees down, but just stop the Bash Moving/Duration/Damage , set it to false.

Is that what you want? Or you prefer to do the whole Bash damage at the start of the Bash? Is there something else you need?

Something like
JASS:
call BashUnit(YourUnit, YourDistance, YourDuration, YourDamage, TreesDownBoolean)
 
Status
Not open for further replies.
Top