[Trigger] -Kick and and a question.

Status
Not open for further replies.
Level 4
Joined
Sep 25, 2009
Messages
49
Hey how would i go about making a -Kick command >< i can't figure it out.

and also how do i make my game so that allys cannot attack each other?
 
  • Kick
    • Events
      • Player - Player 1 (Red) types a chat message containing -kick as An exact match
    • Conditions
      • (Substring((Entered chat string), 1, 5)) Equal to -kick
    • Actions
      • Game - Victory (Player((Integer((Substring((Entered chat string), 7, 7)))))) (Skip dialogs, Skip scores)
This should kick player red if you type -kick 1.
I'll try and see if there's a way to use colors instead.

PS: There is, but its inefficient, too many condition checks.
 
allies cant attack:

  • No teamkilling
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True
    • Actions
      • Unit - Order (Attacking unit) to Stop
 
^it may work but still after the first hit.
try this one.
  • No teamkill
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • ((Triggering unit) belongs to an ally of (Owner of (Target unit of issued order))) Equal to True
    • Actions
      • Unit - Order (Triggering unit) to Stop
 
^it may work but still after the first hit.
try this one.
  • No teamkill
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • ((Triggering unit) belongs to an ally of (Owner of (Target unit of issued order))) Equal to True
    • Actions
      • Unit - Order (Triggering unit) to Stop

What if you cast a spell on your ally?

Hashjie's method is the best way to do it in GUI.
 
Yeah....I got it working so that they cannot attack using regular attack, but they're able to use a spell on the other players hero, How can i fix that?
 
Ok.. Thats simple, create a new trigger with this Events, Conditions and Actions:
  • DontCastSpellsOnAllies
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Target unit of ability being cast) belongs to an ally of (Owner of (Triggering unit))) Equal to True
    • Actions
      • Unit - Order (Triggering unit) to Stop
To allow healing you can do this:
  • DontCastSpellsOnAllies
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) belongs to an ally of (Owner of (Triggering unit))) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Ability being cast) Equal to Healing Wave
                  • (Ability being cast) Equal to Holy Light
            • Then - Actions
            • Else - Actions
              • Unit - Order (Triggering unit) to Stop
        • Else - Actions
This will probly only works on Channeling spells, with casting time.
 
Status
Not open for further replies.
Back
Top