Help with a spell +rep

Weegee

Go Weegee!
Reaction score
103
Hi. How can i get a trigger so when a unit is attacked if he has a certain buff that he is knocked back? I already know how to do a clean Knockback trigger in GUI (if u don't believe me i could show u). The only problem I am having is finding the condition to check if the attacked unit has a certain buff. TY to helpers and I will +rep people who help :thup:
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Code:
((Attacked unit) has buff 'YourBuff') Equal to True
this is what you are searching for, its a boolean -> unit -> unit has specific buff
 

R@i_no_Wyrm

New Member
Reaction score
43
Boolean comparison - attacked unit has buff (lol) equal to true


P.S. :read ace's thread title section.

Edit : me too, too late.
 

Weegee

Go Weegee!
Reaction score
103
TY all since u all helped +rep to all

Edit: Ok i seem to be having problems squeezing it in there how about how do i make a number that randomly goes to a number that is between 0-25%? and if it hits 25% the activates?
 

WarToast

Active Member
Reaction score
3
TY all since u all helped +rep to all

Edit: Ok i seem to be having problems squeezing it in there how about how do i make a number that randomly goes to a number that is between 0-25%? and if it hits 25% the activates?

Create an integer variable. I called mine RandomNumber in this example.

Code:
Action
Set RandomNumber = (Random integer number between 1 and 25)

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        RandomNumber Equal to 25
    Then - Actions
      
    Else - Actions
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
for 25% chance it got to be:
Code:
Action
Set RandomNumber = (Random integer number between 1 and 4)

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        RandomNumber Equal to 1
    Then - Actions
      
    Else - Actions
or if you want you could also do it like this:
Code:
Action
Set RandomNumber = (Random integer number between 1 and 100)

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        RandomNumber Less or Equal to 25
    Then - Actions
      
    Else - Actions
 

WarToast

Active Member
Reaction score
3
TY all since u all helped +rep to all

Edit: Ok i seem to be having problems squeezing it in there how about how do i make a number that randomly goes to a number that is between 0-25%? and if it hits 25% the activates?

I understood that as 1 in 25. ;)
 

Weegee

Go Weegee!
Reaction score
103
k ty ill see if +rep works twice lol

It worked but there is a delay. Here's the trigger...

Code:
Unit - A unit Is attacked

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        ((Attacked unit) has buff Stunned (Pause)) Equal to True
    Then - Actions
        Set Unit_Casted = (Attacked unit)
        Set Unit_Caster = (Attacking unit)
        Trigger - Turn on GUI knockback 2 <gen>
    Else - Actions
        Do nothing


Code:
Time - Every 0.03 seconds of game time


Actions
    Unit - Move Unit_Casted instantly to ((Position of Unit_Casted) offset by 5.00 towards (Facing of Unit_Caster) degrees)
    Destructible - Pick every destructible within 120.00 of (Position of Unit_Casted) and do (Destructible - Kill (Picked destructible))
    Wait 0.50 seconds
    Unit - Remove set_unit_Dummy from the game
    Trigger - Turn off (This trigger)

When a Unit has this certain buff it will be knocked back but it takes to long NEED HELP +rep to who ever helps


Edit:to let u know i cant +rep u guys again for helping lol
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
I dont understand, what takes too long? is your unit not sliding fast enough or does the effect last too long?

BtW, your trigger leaks here:
Code:
Unit - Move Unit_Casted instantly to ([B](Position of Unit_Casted)[/B] offset by 5.00 towards (Facing of Unit_Caster) degrees)
    Destructible - Pick every destructible within 120.00 of [B](Position of Unit_Casted)[/B] and do (Destructible - Kill (Picked destructible))

and you havent set 'Unit - Remove set_unit_Dummy from the game' the unit you re removing here Oo
 

R@i_no_Wyrm

New Member
Reaction score
43
you dare to use wait = not recommended.

Try to take some sliding system some mods had made.

It is not MUI....

Fixing = make some count system that'll turn da trigger off after it reached some time.
Removing dummies 4 what?
It will cause the target to move alongside the facing od the caster that may change over time. sure bout that?

@Dr.Jack
Well, it is attacking condition after all, it will clash.
 

Dr.Jack

That's Cap'n to you!
Reaction score
108
Clearing the leaks should help.
The fact that he using wait shouldn't disturb.
Note it is not MUI nor MPI.
 

Weegee

Go Weegee!
Reaction score
103
I know about that and the leaks ok ill fix those later the problem is that when a unit is stunned it like waits 2 seconds THEN it moves them i want it so it moves when they are stunned without a wait

O and for the wait trigger i know it screws it up lol ill fix it better later

Edit: for the dummy thing i forgot to remove that so forget about that i used to have a dummy lol but now i have the unit be damaged off of the skill itself

@ Accname

i need help with the leaks lol what am i supposed to do with that anyway?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Code:
Slide
    Events
        Time - Every 0.05 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) has buff Betäubt (Pause)) Equal to True
                    Then - Actions
                        Set StunPoint = ((Position of (Picked unit)) offset by -5.00 towards (Facing of (Picked unit)) degrees)
                        Unit - Move (Picked unit) instantly to StunPoint
                        Custom script: call RemoveLocation (udg_StunPoint)
                    Else - Actions

i did it that way, you just got to set the unit group stunned somewhere, like
Code:
Set Stunned = (Units in (Playable map area))

Edit: I added my test map maybe it ll help you.
 

Weegee

Go Weegee!
Reaction score
103
k thx ill try it =D

Yours works much better lol Ill give u credit in my map =D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top