~ Forums of Enroth ~

An Enroth diehard fan community
 
HomeHome  ChatChat  FAQFAQ  SearchSearch  RegisterRegister  Log inLog in  
Latest topics
» Ragoon's Graphics For HoMM3SW
by Ragoon Today at 11:57

» H3SW: General Graphics discussion
by robizeratul Today at 11:54

» Creature Quest – The New Adventure from JVC (feat some old NWC members)
by Galaad 2017-10-13, 20:34

» Modding Questions
by GodRage 2017-10-12, 18:32

» Introduce yourself
by Orzie 2017-10-12, 17:10

» [Ironfist ver 1.3.0] Sorrow's End map - Sprites of creatures missing on the adventure map
by Kristo 2017-10-12, 15:13

» [EN, RU][Offline] HoMM1 Main Tourney 2017-2 (Общий Турнир)
by Orzie 2017-10-11, 18:14

Poll
"Wait" in HoMM2?
Yes
80%
 80% [ 45 ]
No
20%
 20% [ 11 ]
Total Votes : 56
Most Viewed Topics
H3SW: General Graphics discussion
Ragoon's Graphics For HoMM3SW
H3SW General Discussion
H3SW: Dwelling Development
H3SW Map List: Work in progress
Dervish Faction General Concept
Enrothian Fan Art
H3SW Recruitment Point - Enroth Needs You!
Серия книг "Земли Меча и Магии"
Heroes of Might and Magic 3: The Succession Wars - General info

Share | 
 

 [Script System][Suggestions] GetMorale(hero) and more

View previous topic View next topic Go down 
AuthorMessage
Unknown_Hero
Minotaur
Minotaur
avatar

Messages : 344
Quality Points : 40
Registration Date : 2015-09-06

PostSubject: [Script System][Suggestions] GetMorale(hero) and more   2017-03-15, 05:36

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.
Back to top Go down
 
[Script System][Suggestions] GetMorale(hero) and more
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» [Script System][Suggestions] So, which expressions are the most desirable?
» James Connolly: A Working Class Hero
» One Woman in India dies every hour due to the dowry system
» Minecraft's Coordinate System
» Award system

Permissions in this forum:You cannot reply to topics in this forum
~ Forums of Enroth ~ :: Modding Guild :: Heroes of Might and Magic II: Project Ironfist :: Modding and Mapmaking-
Jump to: