~ 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 ~

An Enroth diehard fan community
 
HomeHome  SearchSearch  RegisterRegister  Log inLog in  
Latest topics
» Immortal Realms: Vampire Wars (HoMM like game)
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby Unknown_Hero 2020-09-18, 23:10

» They talked about fheroes2!
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby sirDranik 2020-09-13, 02:51

» GoG Homm2 vs fheroes2 comparison review
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby sirDranik 2020-09-11, 01:19

» Resurrection of fheroes2 with 0.8 version
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby Tibor0803 2020-09-08, 06:32

» [Enhancement] Enhancement for the information displayed when the player right clicks on an object
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby sirDranik 2020-09-07, 20:45

» Free Heroes of Might and Magic II (fheroes2) General Announcements
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby ihhub 2020-09-05, 02:34

» [Enhancement] Enhancement for Scouting secondary skill
[Script System][Suggestions] GetMorale(hero) and more Icon_minitimeby Unknown_Hero 2020-09-03, 21:26

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
H3SW General Discussion
H3SW Map List: Work in progress
H3SW: Dwelling Development
Heroes III: The Succession Wars v0.8.1 Beta
Heroes of Might and Magic 3: The Succession Wars - General info & Announcements
Project Ironfist announcements
Introduce yourself
Welcome fellow Enrothians!

 

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

Go down 
AuthorMessage
Unknown_Hero
Mage
Mage
Unknown_Hero

Messages : 724
Quality Points : 74
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

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: