~ 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
» Songs of Conquest
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby Blake01 2024-04-07, 15:14

» ...to XP run...
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby CATMAN 2024-03-30, 03:16

» WARNING - The dreaded moment is here: Heroes 6 servers shutting down
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby Blake01 2024-03-29, 23:04

» Songs of Silence (HoMM like game)
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby Blake01 2024-03-27, 16:52

» Heroes Orchestra's 5th Birthday concerts with Paul Romero
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby rrravyn 2024-03-23, 22:45

» fheroes2 General Announcements
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby sirDranik 2024-03-17, 23:35

» Photo Gallery
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby Sir Albe 2024-03-07, 06:57

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
Forum Admins Feed
The Floody Land
Enrothian Fan Art
Heroes III: The Succession Wars v0.8.1 Beta

 

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

Go down 
AuthorMessage
Unknown_Hero
Mage
Mage
Unknown_Hero


Messages : 778
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] GetHeroMovepoints(hero) and more
» [Script System][Suggestions] CountEmptyArmySlots(hero) and more
» [Script System][Suggestions] ToggleHeroAIArmySharing(hero, toggle) and more
» [Script System][Suggestions] GetHeroXp(hero) and more
» [Script System][Suggestions] GetHeroFaction(hero)

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: