Currently, there is no way to check/change the Morale or Luck of a hero.
*
GetMorale(hero)
hero: the hero you want to check (see, for example, GetHero).
Returns the Morale value that the hero has.
*
GetMoraleModifier(hero, name)
hero: the hero you want to check (see, for example, GetHero).
name: the internal name of the Morale modifier.
Returns "true" if the hero is affected by the specified Morale modifier, returns "false" otherwise.
*
SetMoraleModifier(name, quantity, text)
name: the internal name of the Morale modifier.
quantity: the quantity of Morale points you want to add as modifier. Can be set with positive or negative values and can be set to "0".
text: the text displayed when the user views the hero's morale information by right-clicking on the morale sprite.
When the value of quantity is set to "0", it provides maximum Morale to the hero (just like the artifact "Battle Garb of Anduran" provides maximum Morale).
Sets a new Morale modifier.
*
AddMoraleModifier(hero, name, duration)
hero: the hero to which you want to add the Morale modifier (see, for example, GetHero).
name: the internal name of the Morale modifier.
duration: the duration during which the added Morale modifier will be active. After this time the added Morale modifier will be removed. Can be set from "0" and beyond.
- "0" for "permanent", the added Morale modifier will never be removed.
- "1" and beyond (counts as "day"), the added Morale modifier will be removed at the end of the number of the specified days (turns).
Adds the specified Morale modifier to the specified hero for the specified duration.
Example of use:
hero = GetHero(GetPlayer(0), 1);
name = "MoraleDragaduneControl";
text = "Castle Dragadune is under control +1";
SetMoraleModifier(name, 1, text);
AddMoraleModifier(hero, MoraleDragaduneControl, 0);
When the player right clicks on the sprite of the hero's morale, the following text is displayed:
"Good Morale
Good morale may give your armies extra attacks in combat.
Current Morale Modifiers:
All warlock troops + 1
Castle Dragadune is under control +1"
*
RemoveMoraleModifier(hero, name, duration)
Hero: the hero to which you want to remove the Morale modifier (see, for example, GetHero).
Name: the internal name of the Morale modifier.
Duration: the duration for which the Morale modifier will be canceled. After this time, the Morale modifier will be active again. Can be set from "0" and beyond.
- "0" for "permanent", the Morale modifier will no longer be active again.
- "1" and beyond (counts as "day"), the Morale modifier change will be canceled at the end of the specified number of days (turns).
Removes the specified Morale modifier for the specified hero for the specified duration.
*
GetLuck(hero)
hero: the hero you want to check (see, for example, GetHero).
Returns the Luck value that the hero has.
*
GetLuckModifier(hero, name)
hero: the hero you want to check (see, for example, GetHero).
name: the internal name of the Luck modifier.
Returns "true" if the hero is affected by the specified Luck modifier, returns "false" otherwise.
*
SetLuckModifier(name, quantity, text)
name: the internal name of the Luck modifier.
quantity: the quantity of Luck points you want to add as modifier. Can be set with positive or negative values and can be set to "0".
text: text displayed when the user views the hero's luck information by right-clicking on the luck sprite.
When the value of quantity is set to "0", it provides maximum Luck to the hero (just like the artifact "Battle Garb of Anduran" provides maximum Luck).
Sets a new Luck modifier.
*
AddLuckModifier(hero, name, duration)
hero: the hero to which you want to add the Luck modifier (see, for example, GetHero).
name: the internal name of the Luck modifier.
duration: the duration during which the added Luck modifier will be active. After this time the added Luck modifier will be removed. Can be set from "0" and beyond.
- "0" for "permanent", the added Luck modifier will never be removed.
- "1" and beyond (counts as "day"), the added Luck modifier will be removed at the end of the number of the specified days (turns).
Adds the specified Luck modifier to the specified hero for the specified duration.
*
RemoveLuckModifier(hero, name, duration)
Hero: the hero to which you want to remove the Luck modifier (see, for example, GetHero).
Name: the internal name of the Luck modifier.
Duration: the duration for which the Luck modifier will be canceled. After this time, the Luck modifier will be active again. Can be set from "0" and beyond.
- "0" for "permanent", the Luck modifier will no longer be active again.
- "1" and beyond (counts as "day"), the Luck modifier change will be canceled at the end of the specified number of days (turns).
Removes the specified Luck modifier for the specified hero for the specified duration.