• 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] How to give gold depend player of force

Status
Not open for further replies.
Level 1
Joined
Jul 3, 2012
Messages
5
I need trigger Give Starting Gold when Map Initialization, get player count in that force and give (x Gold/player count in force 1)... In a word, that give gold like DotA map...
Someone help me!
 
Level 15
Joined
Jul 6, 2009
Messages
889
  • Initialisation
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set BaseGold = 4150
      • Set SentinelCount = (Number of players in Sentinel)
      • Player Group - Pick every player in Sentinel and do (Actions)
        • Loop - Actions
          • Player - Set (Picked player) Current gold to (BaseGold / SentinelCount)
Assuming you don't add the players that aren't playing into the force, it will work.
 
Level 1
Joined
Jul 3, 2012
Messages
5
My map has 2 force, each force has 5 player, if 3 player are playing then give 4150/3=1383 each player, thanks for your help, but i don't sure it will work for players aren't playing @@
 
Level 1
Joined
Jul 3, 2012
Messages
5
Yay! my map is type hero defense like DotA, if don't add non-playing players into the force then need some trigger. like this jass, but i need trigger...
JASS:
function Trig_Started_Actions takes nothing returns nothing
    call SetTimeOfDay( 12 )
    // team 1
    call AdjustPlayerStateBJ( ( 4500 / CountPlayersInForceBJ(GetPlayersAllies(Player(0))) ), Player(1), PLAYER_STATE_RESOURCE_GOLD )
    call AdjustPlayerStateBJ( ( 4500 / CountPlayersInForceBJ(GetPlayersAllies(Player(0))) ), Player(2), PLAYER_STATE_RESOURCE_GOLD )
    call AdjustPlayerStateBJ( ( 4500 / CountPlayersInForceBJ(GetPlayersAllies(Player(0))) ), Player(3), PLAYER_STATE_RESOURCE_GOLD )
    call AdjustPlayerStateBJ( ( 4500 / CountPlayersInForceBJ(GetPlayersAllies(Player(0))) ), Player(4), PLAYER_STATE_RESOURCE_GOLD )
    call AdjustPlayerStateBJ( ( 4500 / CountPlayersInForceBJ(GetPlayersAllies(Player(0))) ), Player(5), PLAYER_STATE_RESOURCE_GOLD )
    // team 2
    call AdjustPlayerStateBJ( ( 4500 / CountPlayersInForceBJ(GetPlayersAllies(Player(6))) ), Player(7), PLAYER_STATE_RESOURCE_GOLD )
    call AdjustPlayerStateBJ( ( 4500 / CountPlayersInForceBJ(GetPlayersAllies(Player(6))) ), Player(8), PLAYER_STATE_RESOURCE_GOLD )
    call AdjustPlayerStateBJ( ( 4500 / CountPlayersInForceBJ(GetPlayersAllies(Player(6))) ), Player(9), PLAYER_STATE_RESOURCE_GOLD )
    call AdjustPlayerStateBJ( ( 4500 / CountPlayersInForceBJ(GetPlayersAllies(Player(6))) ), Player(10), PLAYER_STATE_RESOURCE_GOLD )
    call AdjustPlayerStateBJ( ( 4500 / CountPlayersInForceBJ(GetPlayersAllies(Player(6))) ), Player(11), PLAYER_STATE_RESOURCE_GOLD )
endfunction
 
Status
Not open for further replies.
Top