~ Forums of Enroth ~
Would you like to react to this message? Create an account in a few clicks or log in to continue.

~ Forums of Enroth ~

The Enroth diehard fan community
 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  
Latest topics
» [H3SW v0.8.2] Witch Hunt
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby GodRage 2024-11-18, 22:56

» 5Kings1Ring
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby GodRage 2024-11-18, 22:54

» Polskie powitanie
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby rrravyn 2024-11-15, 09:53

» loading simplification
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby badtoper 2024-11-15, 04:37

» Easier Troop Management Between Garrison and Hero in Town
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby badtoper 2024-11-15, 04:05

» Improvements for Hero Management and Turn Confirmation
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby badtoper 2024-11-15, 01:57

» [H3SW v0.8.2] Desert Isle
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby Sir Albe 2024-10-31, 07:56

Poll
Global announcements should be:
Everlasting, 1 for each project.
[Script System][Suggestions] GetMorale(hero) and more Redbar110%[Script System][Suggestions] GetMorale(hero) and more Redbar12
 0% [ 0 ]
Temporary, when there is something new to announce.
[Script System][Suggestions] GetMorale(hero) and more Redbar11100%[Script System][Suggestions] GetMorale(hero) and more Redbar12
 100% [ 6 ]
Holalala... No idea where the Ultimate artifact is.
[Script System][Suggestions] GetMorale(hero) and more Redbar110%[Script System][Suggestions] GetMorale(hero) and more Redbar12
 0% [ 0 ]
Total Votes : 6
Most Viewed Topics
H3SW: General Graphics discussion
Ragoon's Graphics For HoMM3SW
Introduce yourself
H3SW General Discussion
H3SW Map List: Work in progress
H3SW: Dwelling Development
The Floody Land
Forum Admins Feed
Enrothian Fan Art
Heroes III: The Succession Wars v0.8.2 Beta

 

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

Go down 
AuthorMessage
Unknown_Hero
Mage
Mage
Unknown_Hero


Messages : 780
Quality Points : 78
Registration Date : 2015-09-06

[Script System][Suggestions] GetMorale(hero) and more Empty
PostSubject: [Script System][Suggestions] GetMorale(hero) and more   [Script System][Suggestions] GetMorale(hero) and more Icon_minitime2017-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
Back to top 
Page 1 of 1
 Similar topics
-
» [Script System][Suggestions] CountEmptyArmySlots(hero) and more
» [Script System][Suggestions] GetHeroMovepoints(hero) and more
» [Script System][Suggestions] GetHeroFaction(hero)
» [Script System][Suggestions] GetArmyInSlotCreature(hero, slot) and more
» [Script System][Suggestions] ToggleHeroAIArmySharing(hero, toggle) and more

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: