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!
You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
Triggers
Market.w3m
Variables
Variables
Initialization
--------------INIT-------------
Melee Initialization
Resources
Copy everything below
--------------MARKET-------------
StartupMarket
MarketSellLumber
MarketBuyLumber
MarketPricesCheck1
MarketPricesCheck2
--------------CHANGELOG-------------
Enter map-specific custom script code below. This text will be included in the map script after variables are declared and before any trigger code except Custom Script Item. Custom Script Item will merge into map script after globals variables declaration with the list order in trigger view.
Name
Type
is_array
initial_value
lumber_const
integer
No
lumber_cost_buy
integer
No
lumber_cost_fluctuation
integer
No
lumber_cost_max
integer
No
lumber_cost_min
integer
No
lumber_cost_sell
integer
No
Default melee game initialization for all players
Melee Initialization
Events
Map initialization
Conditions
Actions
Melee Game - Use melee time of day (for all players)
Melee Game - Limit Heroes to 1 per Hero-type (for all players)
Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
Melee Game - Create starting units (for all players)
Resources
Events
Time - Elapsed game time is 0.10 seconds
Conditions
Actions
Player - Set Player 1 (Red) . Current gold to 5000
Player - Set Player 1 (Red) . Current lumber to 5000
Player - Set Player 2 (Blue) . Current gold to 5000
Player - Set Player 2 (Blue) . Current lumber to 5000
StartupMarket
Events
Time - Elapsed game time is 0.10 seconds
Conditions
Actions
-------- VARIABLES --------
-------- INITIAL COSTS --------
-------- Costs will vary on purchase and sale --------
-------- NEVER make fluctuations bigger than minimum cost --------
Set Variable Set lumber_cost_fluctuation = "2"
-------- LOWER AND UPPER COST LIMITS --------
Set Variable Set lumber_cost_min = "18"
Set Variable Set lumber_cost_max = "350"
-------- DESCRIPTIONS IN-GAME --------
Quest - Create a Required quest titled Market with the description The market works as it follows:-Type "-market" to check prices.-Market prices works globally, meaning a player can inflate or deprecate the prices, and the other players will be affected.-Your main structure can buy or sell lumber for gold.-You can buy 100 lumber by 125 gold initially, and on each purchase the gold cost rises.-You can sell 100 lumber by 75 gold, and on each sale the gold cost diminshes.-The upper limit for lumber cost is 351-The lower limit for lumber cost is 17 , using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
Quest - Create a Required quest titled Credits with the description Made by LordHatchet95 , using icon path ReplaceableTextures\CommandButtons\BTNSpy.blp
MarketSellLumber
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Sell Lumber
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
lumber_cost_sell Less than or equal to ((Owner of (Casting unit)) Current lumber)
Then - Actions
Player - Set (Owner of (Casting unit)) . Current lumber to (((Owner of (Casting unit)) Current lumber) - lumber_const)
Player - Add lumber_cost_sell to (Owner of (Casting unit)) . Current gold
Game - Display to (Player group((Owner of (Casting unit)))) for 4.00 seconds the text: (You sold + ((String(lumber_const)) + ( lumber by + ((String(lumber_cost_sell)) + gold.))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
lumber_cost_sell Greater than lumber_cost_min
Then - Actions
Set Variable Set lumber_cost_sell = (lumber_cost_sell - lumber_cost_fluctuation)
Set Variable Set lumber_cost_buy = (lumber_cost_buy - lumber_cost_fluctuation)
Else - Actions
Else - Actions
Game - Display to (Player group((Owner of (Casting unit)))) for 4.00 seconds the text: Not enough lumber to sell for gold.
MarketBuyLumber
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Buy Lumber
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
lumber_cost_buy Less than or equal to ((Owner of (Casting unit)) Current gold)
Then - Actions
Player - Add 100 to (Owner of (Casting unit)) . Current lumber
Player - Set (Owner of (Casting unit)) . Current gold to (((Owner of (Casting unit)) Current gold) - lumber_cost_buy)
Game - Display to (Player group((Owner of (Casting unit)))) for 4.00 seconds the text: (You bought + ((String(lumber_const)) + ( lumber by + ((String(lumber_cost_buy)) + gold.))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
lumber_cost_buy Less than lumber_cost_max
Then - Actions
Set Variable Set lumber_cost_sell = (lumber_cost_sell + lumber_cost_fluctuation)
Set Variable Set lumber_cost_buy = (lumber_cost_buy + lumber_cost_fluctuation)
Else - Actions
Else - Actions
Game - Display to (Player group((Owner of (Casting unit)))) for 4.00 seconds the text: Not enough gold for buying lumber.
MarketPricesCheck1
Events
Player - Player 1 (Red) types a chat message containing -market (Unexpected type: 'stringnoformat') as An exact match
Conditions
Actions
Game - Display to Player Group - Player 1 (Red) for 5.00 seconds the text: ((String(lumber_const)) + ( lumber cost on purchase: + (String(lumber_cost_buy))))
Game - Display to Player Group - Player 1 (Red) for 5.00 seconds the text: ((String(lumber_const)) + ( lumber cost on sale: + (String(lumber_cost_sell))))
MarketPricesCheck2
Events
Player - Player 2 (Blue) types a chat message containing -market (Unexpected type: 'stringnoformat') as An exact match
Conditions
Actions
Game - Display to Player Group - Player 2 (Blue) for 5.00 seconds the text: ((String(lumber_const)) + ( lumber cost on purchase: + (String(lumber_cost_buy))))
Game - Display to Player Group - Player 2 (Blue) for 5.00 seconds the text: ((String(lumber_const)) + ( lumber cost on sale: + (String(lumber_cost_sell))))
v1.0 (06-01-2022)
-Created map
-Added Buy Lumber and Sell Lumber to each race's main hall.
-Made prices fluctuate to certain limits.
-Separated some values into variables for easier modification.
-Added check prices with -market.
-THIS MAP IS NOT INTENDED FOR GAMEPLAY! Its intended for sharing the market system, and testing it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.