• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Ability Trigger pushback

Status
Not open for further replies.
Level 1
Joined
Jun 21, 2009
Messages
282
Needing help with another trigger


Click this onto a enemy, 3 second casting time, its basically a push-back ability, about 800 pushback effect, make the unit get pushed back the direction your hero is facing, 3x strength damage, and kill trees. 1 enemy, not multiple units :grin: :grin: Rep+
 
Level 5
Joined
Dec 18, 2007
Messages
205
use the code at the link and call it via Custom Script:

call KnockbackEx(GetSpellTargetUnit(), 800., GetUnitFacing(GetTriggerUnit()), 1.5, 10., 0, "", "")

The spell should have "starts an effect of an ability" as the event, then just base it on channel and make the 3 seconds casting time.
 
Level 1
Joined
Jun 21, 2009
Messages
282
This is what I have so Far

Unit - A unit Starts the effect of an ability
(Ability being cast) Equal to Absorb Mana
Set Caster = (Triggering unit)
Set Target = (Target unit of ability being cast)
Set AngleLoop = (Facing of (Casting unit))
Set Duration = 2.00
Custom script: call KnockbackEx(GetSpellTargetUnit(), 800., GetUnitFacing(GetTriggerUnit()), 1.5, 10., 0, "", "")


How do I get t Distance = (400 + (100 x (Ability level of <Some Spell> for Caster))) ???
 
Level 5
Joined
Dec 18, 2007
Messages
205
change it to:

Custom script: call KnockbackEx(udg_Target, 800., udg_AngleLoop, udg_Duration, 10., 0, "", "")

replace the "800." with a real. (as you recognize to all your variables there is added the "udg_"-prefix, do this also to the new real variable that is oyur distance)

like this:

name of real: "Distance"

--> Custom script: call KnockbackEx(udg_Target, udg_Distance, udg_AngleLoop * bj_DEGTORAD, udg_Duration, 10., 0, "", "")

if you mean how to get such a distance use a real, then 400+100* IntegerToReal(Level of ability blaaaah for caster)
 
Last edited:
Level 1
Joined
Jun 21, 2009
Messages
282
Heres what I got

Unit - A unit Starts the effect of an ability
(Ability being cast) Equal to Storm Bolt
Set Caster = (Triggering unit)
Set Target = (Target unit of ability being cast)
Set Distance = (400.00 + (100.00 x (Real((Level of Storm Bolt for Caster)))))
Set AngleLoop = (Facing of (Casting unit))
Set Duration = 2.00
Custom script: call KnockbackEx(udg_Target, udg_Distance, udg_AngleLoop, udg_Duration, 10., 0, "", "")

Its not letting me enable it, what am I doing wrong?
 
Level 5
Joined
Dec 18, 2007
Messages
205
you must copy the code at the link to the top of your map (am i wrong?)

btw: do you need newgen to let libraries work properly, or does normal WE also accept liraries, scopes etc.

and btw: i updated my last post, forgot DEGTORAD
 
Level 5
Joined
Jan 27, 2007
Messages
154
Or you could always do the hard way by:

Making 2 triggers....

I was lazy to make a template so take my old rasengan template:

  • Events
    • Unit - A unit Is attacked
  • Conditions
    • ((Attacking unit) has buff Rasengan ) Equal to True
  • Actions
    • Animation - Play raunit's spell throw animation
    • Unit - Turn collision for (Attacked unit) Off
    • Set raunit = (Attacking unit)
    • Set ratarget = (Attacked unit)
    • Set raorig = (Position of (Attacking unit))
    • Set rapoint = (Position of (Attacked unit))
    • Set raangle = (Angle from raorig to rapoint)
    • Trigger - Turn on Rasengan Propel <gen>
And

Uncheck the Initially on for the second trigger..

  • Events
    • Time - Every 0.03 seconds of game time
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (ratarget is dead) Equal to False
        • ravar Less than or equal to 10.00
      • Then - Actions
        • Unit - Pause ratarget
        • Set rapoint = (Position of ratarget)
        • Set rapoint = (rapoint offset by radischk towards raangle degrees)
        • Unit - Move ratarget instantly to rapoint
        • Unit - Cause raunit to damage ratarget, dealing 30.00 damage of attack type Spells and damage type Normal
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of raunit) Equal to Naruto (Hermit)
          • Then - Actions
            • Set ravar = (ravar + 0.75)
          • Else - Actions
            • Set ravar = (ravar + 1.00)
        • Special Effect - Create a special effect at rapoint using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
        • Special Effect - Destroy (Last created special effect)
        • Custom script: call RemoveLocation(udg_rapoint)
        • Custom script: call RemoveLocation(udg_raorig)
      • Else - Actions
        • Unit - Turn collision for ratarget On
        • Unit - Unpause ratarget
        • Set ravar = 0.00
        • Unit - Remove Rasengan buff from raunit
        • Trigger - Turn off (This trigger)
I was also too lazy to check if this leakless...... just tweak the events and conditions and the variables as you please
 
Status
Not open for further replies.
Top