• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Can't figure this out...

Status
Not open for further replies.
Level 4
Joined
May 18, 2004
Messages
60
  • Mob Experience Rate
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Dying unit)) Equal to Neutral Hostile) or ((Owner of (Dying unit)) Equal to Player 12 (Brown))
    • Actions
      • Rect - Center Players Cleric Share Exp Zone <gen> on (Position of (Dying unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Killing unit) is A Hero) Equal to True
        • Then - Actions
          • Hero - Add (Point-value of (Dying unit)) experience to (Killing unit), Show level-up graphics
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Does Players_Cleric_Share_Exp contain a unit of Type Cleric) Equal to True
            • Then - Actions
              • Unit Group - Pick every unit in (Units in Players_Cleric_Share_Exp) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Picked unit)) Equal to Cleric
                      • (Owner of (Picked unit)) Not equal to (Owner of (Killing unit))
                      • (Hero level of (Picked unit)) Less than (Hero level of (Killing unit))
                    • Then - Actions
                      • Hero - Add ((Point-value of (Dying unit)) / 2) experience to (Picked unit), Show level-up graphics
                    • Else - Actions
                      • Do nothing
            • Else - Actions
              • Do nothing
        • Else - Actions
          • Do nothing
It's suppose to award the cleric half of the exp of another players kills if he is in range of the killing unit and is a lower level than the killing unit... But it doesn't work...

Can anyone see what I'm doing wrong cause it's driving me crazy?
 
Level 5
Joined
Dec 18, 2007
Messages
205
It could be the move rect action. this isn't a good method. You could just check whether a clereic is in X range of the killing unit.
And after the
  • Hero - Add (Point-value of (Dying unit)) experience to (Killing unit), Show level-up graphics
don't make an IF.
Just pick all the units in X range and then check whether a cleric is there.
Oh and you could remove the 'Do Nothing's because they are not needed.

Try that and reply.

greetz
 
Level 4
Joined
May 18, 2004
Messages
60
  • Mob Experience Rate
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Dying unit)) Equal to Neutral Hostile) or ((Owner of (Dying unit)) Equal to Player 12 (Brown))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Killing unit) is A Hero) Equal to True
        • Then - Actions
          • Hero - Add (Point-value of (Dying unit)) experience to (Killing unit), Show level-up graphics
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Is (Killing unit) near Heros_Tier1_Cleric[(Integer A)] and withing a range of 500.00) Equal to True
                  • (Hero level of Heros_Tier1_Cleric[(Integer A)]) Less than (Hero level of (Killing unit))
                • Then - Actions
                  • Hero - Add ((Point-value of (Dying unit)) / 2) experience to Heros_Tier1_Cleric[(Integer A)], Show level-up graphics
                  • Game - Display to (Owner of Heros_Tier1_Cleric[(Integer A)]), at offset (0.00, 0.00) the text: The shared exp trig...
                • Else - Actions
        • Else - Actions
This is the only way I can do it with the method you described. You can't do unit of type in range either, it has to be a specific unit. There is no function to see if unit is in range of another unit, unless I missed it...

And how would I pick units in X range of another unit to see if Cleric is there?
 
Level 5
Joined
Dec 18, 2007
Messages
205
So you cannot use this method?

  • Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Dying unit)) Equal to Neutral Hostile) or ((Owner of (Dying unit)) Equal to Player 12 (Brown))
      • ((Killing unit) is A Hero) Equal to True
    • Actions
      • Hero - Add (Point-value of (Dying unit)) experience to (Killing unit), Show level-up graphics
      • Unit Group - Pick every unit in (Units within 1000.00 of (Position of (Killing unit))) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • IF - Conditions
              • (Unit-type of (Picked unit)) Equal to Cleric
              • (Owner of (Picked unit)) not Equal to (Owner of (Killing unit))
              • (Hero level of (Picked unit)) Less than (Hero level of (Killing unit))
            • THEN - Actions
              • Hero - Add ((Point-value of (Dying unit)) / 2) experience to (Picked unit), Show level-up graphics
            • ELSE - Actions
 
Level 4
Joined
May 18, 2004
Messages
60
That's funny, I thought of the same thing but did it a little different:

  • Mob Experience Rate
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Dying unit)) Equal to Neutral Hostile) or ((Owner of (Dying unit)) Equal to Player 12 (Brown))
      • ((Killing unit) is A Hero) Equal to True
    • Actions
      • Hero - Add (Point-value of (Dying unit)) experience to (Killing unit), Show level-up graphics
      • Unit Group - Pick every unit in (Units within 500.00 of (Position of (Killing unit)) matching ((Unit-type of (Picked unit)) Equal to Cleric)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Hero level of (Picked unit)) Less than (Hero level of (Killing unit))
              • (Owner of (Picked unit)) Not equal to (Owner of (Killing unit))
            • Then - Actions
              • Hero - Add ((Point-value of (Dying unit)) / 2) experience to (Picked unit), Show level-up graphics
              • Game - Display to Player 1 (Red), at offset (0.00, 0.00) the text: The shared exp trig...
            • Else - Actions
It should work the same right?

Actually, for the full trigger I would have to do:

  • Mob Experience Rate Global Distrubtion
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Dying unit)) Equal to Neutral Hostile) or ((Owner of (Dying unit)) Equal to Player 12 (Brown))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Killing unit) is A Hero) Equal to True
        • Then - Actions
          • Hero - Add (Point-value of (Dying unit)) experience to (Killing unit), Show level-up graphics
          • Unit Group - Pick every unit in (Units within 1000.00 of (Position of (Killing unit))) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is A Hero) Equal to True
                  • (Hero level of (Picked unit)) Less than (Hero level of (Killing unit))
                  • (Owner of (Picked unit)) Not equal to (Owner of (Killing unit))
                • Then - Actions
                  • Hero - Add ((Point-value of (Dying unit)) / 2) experience to (Picked unit), Show level-up graphics
                • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Killing unit) is Summoned) Equal to True
            • Then - Actions
              • Unit Group - Pick every unit in (Units within 1000.00 of (Position of (Killing unit))) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is A Hero) Equal to True
                      • ((Picked unit) is owned by (Owner of (Killing unit))) Equal to True
                    • Then - Actions
                      • Hero - Add (Point-value of (Dying unit)) experience to (Picked unit), Show level-up graphics
                    • Else - Actions
            • Else - Actions
Changed it to global distribution to all heroes in range and tested and works. Thanks bud :)
 
Last edited:
Level 5
Joined
Dec 18, 2007
Messages
205
your script is exactly the same. You just added the summoned condition, so the owner will get the xp.
then hf with mapping.
greetz
 
Level 4
Joined
May 18, 2004
Messages
60
Ok, so I actually wanna change this a lil bit but don't know how.

  • Mob Experience Rate Global Distrubtion
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Dying unit)) Equal to Neutral Hostile) or ((Owner of (Dying unit)) Equal to Player 12 (Brown))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Killing unit) is A Hero) Equal to True
        • Then - Actions
          • Hero - Add (Point-value of (Dying unit)) experience to (Killing unit), Show level-up graphics
          • Unit Group - Pick every unit in (Units within 1000.00 of (Position of (Killing unit))) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is A Hero) Equal to True
                  • (Hero level of (Picked unit)) Less than (Hero level of (Killing unit))
                  • (Owner of (Picked unit)) Not equal to (Owner of (Killing unit))
                • Then - Actions
                  • Hero - Add ((Point-value of (Dying unit)) / 2) experience to (Picked unit), Show level-up graphics
                • Else - Actions
        • Else - Actions
Code:
(Hero level of (Picked unit)) Less than (Hero level of (Killing unit))

How do I make this say if picked unit is 10 levels lower then killing unit??

Doing it this way prevents power leveling when I add in save/load code or if someone wants to change class and level up free as well.

So... I thought I had it solved and I don't see why...
I added in
Code:
(Hero level of (Killing unit)) Greater than or equal to ((Hero level of (Picked unit)) + 10)
And it's still not working, it's awarding exp regardless.... Help?
 
Last edited:
Level 4
Joined
May 18, 2004
Messages
60
Change 'Hero level of (killing unit)' into

Arithmetic: ... - ...
Hero Level of (killing unit) - 10

This should result in:
(Hero level of (Picked unit)) Less than ((Hero level of (Killing unit)) - 10)

Def changed it to:

  • (Hero level of (Picked unit)) Less than or equal to ((Hero level of (Killing unit)) - 10)
And it still doesn't work... I have a test setup to have a lv 50 hero kill a neutral hostile unit near me and I'm level 1 and it still awards me exp :(
 
Level 4
Joined
May 18, 2004
Messages
60
OK!!! Got it to work.. God that took forever.

This is what made it work:

  • (Hero level of (Killing unit)) Less than or equal to ((Hero level of (Picked unit)) + 10)
Thanks for the help ")

So, final trigger looks like:

  • Mob Experience Rate Global Distrubtion
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Dying unit)) Equal to Neutral Hostile) or ((Owner of (Dying unit)) Equal to Player 12 (Brown))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Killing unit) is A Hero) Equal to True
        • Then - Actions
          • Hero - Add (Point-value of (Dying unit)) experience to (Killing unit), Show level-up graphics
          • Unit Group - Pick every unit in (Units within 1000.00 of (Position of (Killing unit))) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is A Hero) Equal to True
                  • (Hero level of (Picked unit)) Less than (Hero level of (Killing unit))
                  • (Hero level of (Killing unit)) Less than or equal to ((Hero level of (Picked unit)) + 10)
                  • (Owner of (Picked unit)) Not equal to (Owner of (Killing unit))
                • Then - Actions
                  • Hero - Add ((Point-value of (Dying unit)) / 2) experience to (Picked unit), Show level-up graphics
                • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Killing unit) is Summoned) Equal to True
            • Then - Actions
              • Unit Group - Pick every unit in (Units within 1000.00 of (Position of (Killing unit))) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is A Hero) Equal to True
                      • ((Picked unit) is owned by (Owner of (Killing unit))) Equal to True
                    • Then - Actions
                      • Hero - Add (Point-value of (Dying unit)) experience to (Picked unit), Show level-up graphics
                    • Else - Actions
            • Else - Actions
 
Status
Not open for further replies.
Top