• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Leaving player -> gold devided among allys ??

Status
Not open for further replies.
Level 3
Joined
Jun 1, 2013
Messages
47
Hello,

Ive tried different triggers to accomplish this but I just cant make it work properly.

How it should work:

1) When ally leaves game, his current gold shall be devided equally among his allys

2) No double reward: Leaving player must not keep his gold after he leaves, cause allys can control and build units for the leaving players.

I hope any of you can create it for me, or maybe already has such a trigger ready to go. Thanks alot !


The following trigger I tried out last but it doesnt work (see Point 1 and 2 above):

Your 2nd request is a little confusing, but I think this is how I would do the first one... I literally wrote it out in this little box, so I'm not sure if it will work :D
  • Map Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set playerColor[1] = |c00FF0303
      • Set playerColor[2] = |c000042FF
      • Set playerColor[3] = |c001CE6B9
      • Set playerColor[4] = |c00540081
      • Set playerColor[5] = |c00FFFC01
      • Set playerColor[6] = |c00FEBA0E
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set tempPlayer = (Picked player)
          • Set tempInt = (Player number of leavingPlayer)
          • Set playerName[tempInt] = (Name of tempPlayer)
  • Player Leave
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
      • Player - Player 5 (Yellow) leaves the game
      • Player - Player 6 (Orange) leaves the game
    • Conditions
    • Actions
      • Set leavingPlayer = (Triggering player)
      • Set tempInt = (Player number of leavingPlayer)
      • Game - Display to (All players) the text: (playerName[tempInt] + has left the game!)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set tempPlayer = (Picked player)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (tempPlayer is an ally of leavingPlayer) Equal to True
              • (tempPlayer slot status) Equal to Is playing
            • Then - Actions
              • Player Group - Add tempPlayer to tempPlayerGroup
              • Set numberOfAlly = (numberOfAlly + 1)
            • Else - Actions
      • Set tempInt = ((leavingPlayer Current gold) / numberOfAlly)
      • Player Group - Pick every player in tempPlayerGroup and do (Actions)
        • Loop - Actions
          • Set tempPlayer = (Picked player)
          • Player - Add tempInt to tempPlayer Current gold
          • Player Group - Remove tempPlayer from tempPlayerGroup
          • Set numberOfAlly = (numberOfAlly - 1)
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
Hmm yy_aux messaged me about this, and I gave him the exact function that does this. I mentioned that I forgot to put the feature that removes the gold when we were talking over chat. I'm not sure if this was before or after he messaged me, but here you go! Make sure to place it after "Set tempInt = ((leavingPlayer Current gold) / numberOfAlly)."

  • Player - Set leavingPlayer Current gold to 0
 
Status
Not open for further replies.
Top