Kill Trigger

cr4xzZz

Also known as azwraith_ftL.
Reaction score
51
I've made a trigger which displays a Hero's death (just like in DotA): Player X has killed Player Y for Z gold. The problem is that when an illusion kills an enemy Hero, the kill isn't displayed. How can I fix that?

Code:
Kill Enemy
    Events
        Unit - A unit Dies
    Conditions
        ((Killing unit) is A Hero) Equal to True
        ((Dying unit) is A Hero) Equal to True
        ((Killing unit) belongs to an enemy of (Owner of (Dying unit))) Equal to True
        (Owner of (Killing unit)) Not equal to Neutral Hostile
    Actions
        Set GoldGiving = ((Random integer number between 80 and 100) + 125)
        Player - Add (GoldGiving - 125) to (Owner of (Killing unit)) Current gold
        Game - Display to (All players) the text: ((((Player_Colors[(Player number of (Owner of (Killing unit)))] + (Name of (Owner of (Killing unit)))) + (Player_EndTag +  has just killed )) + (((Player_Colors[(Player number of (Owner of (Dying unit)))] + (Name of (Owner of (Dying unit)))) + Player_EndTag)
 

N2o)

Retired.
Reaction score
51
((Killing unit) is A Hero) Equal to True Or ((Killing unit) is An Illusion) Equal to True

Try that, it should work.
 

BlackNerubia

New Member
Reaction score
12
Code:
Kill Enemy
    Events
        Unit - A unit Dies
    Conditions
        ((Killing unit) is A Hero) Equal to True
        ((Dying unit) is A Hero) Equal to True
        ((Killing unit) belongs to an enemy of (Owner of (Dying unit))) Equal to True
        (Owner of (Killing unit)) Not equal to Neutral Hostile
    Actions
        Set GoldGiving = ((Random integer number between 80 and 100) + 125)
        Player - Add (GoldGiving - 125) to (Owner of (Killing unit)) Current gold
        Game - Display to (All players) the text: ((((Player_Colors[(Player number of (Owner of (Killing unit)))] + (Name of (Owner of (Killing unit)))) + (Player_EndTag +  has just killed )) + (((Player_Colors[(Player number of (Owner of (Dying unit)))] + (Name of (Owner of (Dying unit)))) + Player_EndTag)

From the looks of it, think about this, if a "Illusion" Kills a hero, an illusion isnt truly a hero, so all you need to do is take this out if im not mistaken

((Killing unit) is A Hero) Equal to True
 

cr4xzZz

Also known as azwraith_ftL.
Reaction score
51
> ((Killing unit) is A Hero) Equal to True Or ((Killing unit) is An Illusion) Equal to True
omg, completely forgot about Or statement...

> ((Killing unit) is A Hero) Equal to True
If I remove that what will happen if a creep kills a Hero? :rolleyes: I need to be displayed only Hero kills.

+rep n2o)

EDIT: But if the Killing Illusion is NOT a hero? :/
 

N2o)

Retired.
Reaction score
51
I released that after i posted, im not sure, i suppose you could do a unit-type comparison.
 

BlackNerubia

New Member
Reaction score
12
If i remember right, illusions are considered summons

(((Killing unit) is Summoned) Equal to True) or (((Killing unit) is A Hero) Equal to True)


should do the trick if im not mistaken
 

cr4xzZz

Also known as azwraith_ftL.
Reaction score
51
(((Killing unit) is Summoned) Equal to True)

Then what if the dying unit gets killed by Far Seer's wolves? :/

Will unit-type comparision work in this situation?
(Killing unit is a Hero Equal to True Or (Killing unit is An illusion Equal to True and Unit-type of Killing unit Equal to <SomeUnit>))
(watch the "( )")
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top