Adding Experience (disabled in 1.2)
Adds however much experience you specify.
So, for example:
gives your selected hero 22 000 xp.
Changing Hero Stats
@ChangeHeroStat("Heam", STAT_SPELL_POWER, 15);
OR @ChangeHeroStat("Heam", 3, 15);
...adds 15 to the Spell Power of the Sylvan campaign hero Findan.
Note: It used to set the value to 15, not add 15, prior to the 1.1 patch.
So, the code is:
@ChangeHeroStat("Name", STAT_NAME, #);
OR @ChangeHeroStat("Name", #, #);
The other stats you can edit are (with their numerical equivalents for the two # code variant):
|Hero Stats||Explicit code||# Code variant|
|Maximum Movement Points||-||9|
Note 1: yes, it's STAT_DEFENCE with a capital C.
Note 2: even by modifying your Move Points (or Mana Points) to something like 9999, it will only be filled up to max. You will only be able to travel as far as your hero can normally travel before you're empty again. To travel further, you'll have to input the command again, the quickest way being the up arrow key, which cycles through your most recent commands in the console.
Also, to effectively use this code, you will likely have to refer to the Hero Names Chart.
Clearing Resources (disabled in 1.2)
Who knows? It may come in handy...or not. All your resources are set to 0.
Adding Gold Only (disabled in 1.2)
Note: Your current gold is set to this value, but all your other resources = 0.
Adding Gold and Resources (disabled in 1.2)
This sets all your resources to 100, and your gold to 100 000.
Note: This does not add to your total. If you have more than 100 resources and 100 000 gold, the quantities are lowered to this amount.
Adding Specific Gold and Resources
@SetPlayerResource(#, 0-6, #);
This sets one specific type of resource for a specified player to reflect your given value.
@SetPlayerResource(1, 2, 50);
...gives red player 50 mercury.
The first # variable determines whose resources you are modifying (see the list of players codes below).
The 0-6 variable corresponds to the type of resource you want to set (see the list of resources codes below).
The last # variable is your given amount — however much wood, ore, mercury, crystal, sulfur, gems, or gold you want.
In single player scenarios and campaign missions, you are always PLAYER_1, regardless of colour. Here is how the colours correspond to player numbers in the game, for your single player, custom games:
Here are the resources codes in the game:
Seeing Movement Points
The following command has been disabled in version 1.2, but there is a workaround.
This shows your hero's movement points, the number and amount of points it takes to travel your current path (if you've set one).
You can also use this more complex @command variant, which still works in version 1.2:
OR @print(GetHeroStat("Name", 7));
Revealing the Map
@OpenCircleFog(0, 0, 0, 9999, PLAYER_1);
...reveals the above ground map for red player in a custom, single player game that is not a scenario. In single player scenarios and campaign missions, you are always PLAYER_1, regardless of colour.
@OpenCircleFog(0, 0, 1, 9999, PLAYER_1);
...reveals the underground map for PLAYER_1—the changed variable is the last of three 0s.
Here is how the colours correspond to player numbers in the game, for your single player, custom games:
So, the code is:
@OpenCircleFog(0, 0, 0 or 1, 9999, PLAYER_#);
Instant Win and Lose
These are self-explanatory, and no, it's not a typo--it is indeed spelled "Loose."
Thanks to Curio for creating these pages!