• 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.

Repick System

Status
Not open for further replies.
Level 5
Joined
Jan 5, 2019
Messages
108
Can anyone help me with setting up a simple repick system, so the player can type -repick and get his gold/lumber/food back and re-buy a new hero from his alter ? :)
 
From the words gold, lumber, food and altar; I guees this is for melee like.
Problem is the techtree req, no idea how to reset that.
But this allows to buy a new hero for free can also be the same hero.
  • Initialisierung
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
      • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Trigger - Add to Repick <gen> the event (Player - (Picked player) types a chat message containing -repick as An exact match)
          • Player - Set (Picked player) Available free Heroes to 1
  • Repick
    • Events
    • Conditions
    • Actions
      • Set Group = (Units owned by (Triggering player))
      • Custom script: set udg_Unit = FirstOfGroup(udg_Group)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit is A Hero) Equal to True
        • Then - Actions
          • -------- Drop Inventory --------
          • For each (Integer B) from 1 to 6, do (Actions)
            • Loop - Actions
              • Hero - Drop the item from slot (Integer B) of Unit
          • Set UnitType = (Unit-type of Unit)
          • Unit - Remove Unit from the game
          • -------- Remove Gold & Lumber cost from next hero --------
          • Player - Set (Triggering player) Available free Heroes to 1
          • -------- Allow this hero again --------
          • Custom script: call SetPlayerTechMaxAllowed(GetTriggerPlayer(), udg_UnitType, GetPlayerTechMaxAllowed(GetTriggerPlayer(), udg_UnitType) + 1)
          • -------- Allow any hero again --------
          • Custom script: call SetPlayerTechMaxAllowed(GetTriggerPlayer(), 'HERO', GetPlayerTechMaxAllowed(GetTriggerPlayer(), 'HERO') + 1)
        • Else - Actions
      • Custom script: call DestroyGroup(udg_Group)
 

Attachments

  • Repick.w3x
    18.4 KB · Views: 36
Level 5
Joined
Jan 5, 2019
Messages
108
From the words gold, lumber, food and altar; I guees this is for melee like.
Problem is the techtree req, no idea how to reset that.
But this allows to buy a new hero for free can also be the same hero.
  • Initialisierung
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
      • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Trigger - Add to Repick <gen> the event (Player - (Picked player) types a chat message containing -repick as An exact match)
          • Player - Set (Picked player) Available free Heroes to 1
  • Repick
    • Events
    • Conditions
    • Actions
      • Set Group = (Units owned by (Triggering player))
      • Custom script: set udg_Unit = FirstOfGroup(udg_Group)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit is A Hero) Equal to True
        • Then - Actions
          • -------- Drop Inventory --------
          • For each (Integer B) from 1 to 6, do (Actions)
            • Loop - Actions
              • Hero - Drop the item from slot (Integer B) of Unit
          • Set UnitType = (Unit-type of Unit)
          • Unit - Remove Unit from the game
          • -------- Remove Gold & Lumber cost from next hero --------
          • Player - Set (Triggering player) Available free Heroes to 1
          • -------- Allow this hero again --------
          • Custom script: call SetPlayerTechMaxAllowed(GetTriggerPlayer(), udg_UnitType, GetPlayerTechMaxAllowed(GetTriggerPlayer(), udg_UnitType) + 1)
          • -------- Allow any hero again --------
          • Custom script: call SetPlayerTechMaxAllowed(GetTriggerPlayer(), 'HERO', GetPlayerTechMaxAllowed(GetTriggerPlayer(), 'HERO') + 1)
        • Else - Actions
      • Custom script: call DestroyGroup(udg_Group)

Your a God Thanks Mate :) Worked like a charm
 
Status
Not open for further replies.
Top