How to make a deny system?

shawtybaby

New Member
Reaction score
3
Hello, I want a similar deny system like the one in DotA.

in dota, there's an anti-kill system. but the ''deny system'' allows players to kill an allied unit with less than 100 HP or so.

How can I make such a system? :confused: i've tried different if/then/else conditions.

Code:
deny TK
    Events
        Unit - A unit Is attacked
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (((Owner of (Attacked unit)) is an ally of (Owner of (Attacking unit))) Equal to True) and (((Attacked unit) is A Hero) Equal to True)
            Then - Actions
                Unit - Order (Attacking unit) to Stop
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Life of (Attacked unit)) Less than or equal to 100.00
                    Then - Actions
                        Skip remaining actions
                    Else - Actions
                        Do nothing
 

Alphabet

New Member
Reaction score
12
Code:
deny TK
    Events
        Unit - A unit Is attacked
    Conditions
        (((Owner of (Attacked unit)) is an ally of (Owner of (Attacking unit))) Equal to True) and (((Attacked unit) is A Hero) Equal to True)
        (Life of (Attacked unit)) [b]Greater[/b] than or equal to 100.00
    Actions
        Unit - Order (Attacking unit) to Stop
That should do. If it doesn't work, pause the unit before ordering it to stop and unpause it after ordering it to stop.
 

oorosco

New Member
Reaction score
23
Ummm why such weird code? WHy not have the if be like this,
unit life percentage is equal to or less than 10%
owner of attacking unit is ally to owner of attacked unit
then
order attacking unit to stop
else
if attacked unit is equal to a hero
attacking unit is ally of attacked unit
then order attacking unit to stop
else
---
 

Romek

Super Moderator
Reaction score
963
Ummm why such weird code? WHy not have the if be like this,
unit life percentage is equal to or less than 10%
owner of attacking unit is ally to owner of attacked unit
then
order attacking unit to stop
else
if attacked unit is equal to a hero
attacking unit is ally of attacked unit
then order attacking unit to stop
else
---

No. The one below is better.

Code:
deny TK
    Events
        Unit - A unit Is attacked
    Conditions
        (((Owner of (Attacked unit)) is an ally of (Owner of (Attacking unit))) Equal to True) and (((Attacked unit) is A Hero) Equal to True)
        (Life of (Attacked unit)) [b]Greater[/b] than or equal to 100.00
    Actions
        Unit - Order (Attacking unit) to Stop
That should do. If it doesn't work, pause the unit before ordering it to stop and unpause it after ordering it to stop.

You sure about the Hero thing? :p
Otherwise, that code should work fine.
Unless you want a percentage :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top