How to make a Team Sell system?

shawtybaby

New Member
Reaction score
3
i've tried to search on the forums, and couldn't find any threads with answers.

for starters, team sell is when a player leaves his/her hero will become shared to other allied players and if the items from the player who has left is sold _from_its_ inventory, the cash from the sold items will be split among team players.

I only need the team sell system, not the leave'n'controll-a-hero-system ;)

Any help here? is this something that can be done with or without triggers?

thanks for your time.
 

ZiggyMcjoney

Data editor?! AAAHHHHH!
Reaction score
95
The only way I can think of doing it would be to set the Custom Value for EVERY item at map initialization to the amount of money it sells for.

Code:
Events
 Map initialization

Actions
 Set the custom value for <Your Item> to <The value of the item>

Do that for every item.

Then, when the player leaves the game, use the custom value to detect how much gold the items are worth, and split that among every player.

That'll be agonizing if you have a large list of items, but I'm not sure if theres another way to do it.
 

Flare

Stops copies me!
Reaction score
662
Code:
teamsell
    Events
        Unit - A unit Pawns an item (to shop)
    Conditions
        ((Owner of (Triggering unit)) slot status) Equal to Has left the game
    Actions
        Set tempplayergroup = (All players matching ((((Matching player) controller) Equal to User) and ((((Matching player) slot status) Equal to Is playing) and (((Matching player) is an ally of (Owner of (Triggering unit))) Equal to True))))
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Player - Add ((Integer(Item value, you will need to assign this to an item's custom value, or a global array. Custom value would probably be a better option.)) / (Number of players in tempplayergroup)) to (Picked player) Current gold
        Custom script:   call DestroyForce (udg_tempplayergroup)

When a unit buys an item, assign it a custom value based on the items selling price (lets say an item sells for 50g, give the item a custom value of 50)

@ziggy: custom value only applies to a specific item, so your method wont work for items that dont exist at map init (i.e. anything that can be bought or drops from a creep)
 

Romek

Super Moderator
Reaction score
963
I have an easier way:
When the player leaves, either remove the gold [set to 0] or split it between the players.. or w/e you want.
Then order the her of the player who left to sell the items, and use a trigger to split that players gold between the other players :)
 

X-maul

AKA: Demtrod
Reaction score
201
Code:
Player Leaves
    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
        Player - Player 7 (Green) leaves the game
        Player - Player 8 (Pink) leaves the game
        Player - Player 9 (Gray) leaves the game
        Player - Player 10 (Light Blue) leaves the game
        Player - Player 11 (Dark Green) leaves the game
        Player - Player 12 (Brown) leaves the game
    Conditions
    Actions
        Player - Divert 8% of the Gold income of (Triggering player) to Player 1 (Red)
        Player - Divert 8% of the Gold income of (Triggering player) to Player 2 (Blue)
        Player - Divert 8% of the Gold income of (Triggering player) to Player 3 (Teal)
        Player - Divert 8% of the Gold income of (Triggering player) to Player 4 (Purple)
        Player - Divert 8% of the Gold income of (Triggering player) to Player 5 (Yellow)
        Player - Divert 8% of the Gold income of (Triggering player) to Player 6 (Orange)
        Player - Divert 8% of the Gold income of (Triggering player) to Player 7 (Green)
        Player - Divert 8% of the Gold income of (Triggering player) to Player 8 (Pink)
        Player - Divert 8% of the Gold income of (Triggering player) to Player 9 (Gray)
        Player - Divert 8% of the Gold income of (Triggering player) to Player 10 (Light Blue)
        Player - Divert 8% of the Gold income of (Triggering player) to Player 11 (Dark Green)
        Player - Divert 8% of the Gold income of (Triggering player) to Player 12 (Brown)
also you could do this, its an easyer way... but it would make you get the gold from the player that he would get for killing creeps and that stuff
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top