~ Forums of Enroth ~

An Enroth diehard fan community
HomeHome  ChatChat  FAQFAQ  SearchSearch  RegisterRegister  Log inLog in  
Latest topics
» Experimenting with the Well
by Darmani Yesterday at 09:56

» HoM&M 2 Map suggestions?
by Orzie 2018-02-19, 08:45

» H3SW General Discussion
by Wayshan 2018-02-10, 07:14

» Design of H3SW page on www.moddb.com
by GodRage 2018-01-28, 06:55

» Cyborg: Artifacts
by Daleron 2018-01-25, 08:20

» H3SW: General Graphics discussion
by buffkaz 2018-01-21, 21:32

» Homm2 gog/dosbox balance mod
by Arstahd 2018-01-11, 17:56

"Wait" in HoMM2?
 82% [ 53 ]
 18% [ 12 ]
Total Votes : 65
Most Viewed Topics
H3SW: General Graphics discussion
Ragoon's Graphics For HoMM3SW
H3SW General Discussion
H3SW: Dwelling Development
H3SW Map List: Work in progress
Enrothian Fan Art
Dervish Faction General Concept
Серия книг "Земли Меча и Магии"
H3SW Recruitment Point - Enroth Needs You!

Share | 

 [Script System] GrantArtifact(hero, artifact)

Go down 

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

PostSubject: [Script System] GrantArtifact(hero, artifact)   2017-03-06, 06:21

Tested with Ironfist version 1.2.1+ (version of December 15, 2016).


GrantArtifact(hero, artifact)
hero: the hero to grant the artifact to (see, for example, GetHero).
artifact: the ID of the artifact to give (see section "Artifacts").

Grants the given artifact to the given hero.


With this script expression:

GrantArtifact(GetCurrentHero(), ARTIFACT_SPELL_SCROLL);

The hero gets the Spell Scroll.
But, by right clicking on the Spell Scroll, the following text is displayed: "Spell Scroll - This Spell Scroll gives your hero the ability to cast the '(null)' spell."

There is no way currently to set the spell available in the Spell Scroll.



"GrantArtifact" enhanced version:

GrantArtifact(hero, artifact, spell, text)
hero: the hero to grant the artifact to (see, for example, GetHero).
artifact: the ID of the artifact to give (see section "Artifacts").
spell: the ID of the spell(s) to be tied to this specific artifact. Can also be left empty.
text: replacement text displayed when the user views the information on the artifact by right-clicking on the artifact. Can also be left empty, the standard text will be displayed.

Grants the given artifact to the given hero. Spell(s) can optionally be tied to this artifact.
The spells are not written in the Magic Book. And if the hero gives this artifact to another hero or if he loses this artifact during a combat, he no longer knows spells related to the artifact (unless he has learned some or all of them in a Mage Guild).
And the hero who receives the artifact will be able to use the spells tied to the artifact.

Examples of use:

Standard use:
GrantArtifact(GetCurrentHero(), ARTIFACT_WHITE_PEARL);

Use with a Spell Scroll:

And waiting for the possibility to create our own artifacts, we can play with those already available. Smile

Use with a standard artifact:
textBookOfElements = "The Book of Elements doubles the effectiveness of all your summoning spells, and gives you the four Summon Elemental spells.";
GrantArtifact(GetCurrentHero(), ARTIFACT_BOOK_OF_ELEMENTS, spellsBookOfElements, textBookOfElements);
Back to top Go down
Master Modder
Master Modder

Messages : 177
Quality Points : 32
Registration Date : 2014-12-27

PostSubject: Re: [Script System] GrantArtifact(hero, artifact)   2017-03-13, 07:29

Back to top Go down
[Script System] GrantArtifact(hero, artifact)
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: