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.
*
Suggestions:"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:GrantArtifact(GetCurrentHero(), ARTIFACT_SPELL_SCROLL, SPELL_ANTI_MAGIC);
And waiting for the possibility to create our own artifacts, we can play with those already available.
Use with a standard artifact:spellsBookOfElements = {SPELL_SUMMON_EARTH_ELEMENTAL, SPELL_SUMMON_AIR_ELEMENTAL, SPELL_SUMMON_FIRE_ELEMENTAL, SPELL_SUMMON_WATER_ELEMENTAL};
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);