Skip to content

Current questions and answers regarding the map editor.

User Avatar
#1134
Auto-translated
Vestnik, everything was replaced correctly, only the artifact ID was used instead of itemId ;) ... oh yes, very often you also need to additionally declare parameters inside the function, like this:
function MonsterFunction(hero)
    myHero = hero; -- additionally added the hero variable
    Trigger(OBJECT_TOUCH_TRIGGER, 'Monster', nil);
    -- artifact
    GiveArtefact(myHero, 53); -- added as an example the ID of an artifact (in this case, the Tear of Ashi)

    -- resource
    gold = GetPlayerResource(PLAYER_1, GOLD);
    SetPlayerResource(PLAYER_1, GOLD, gold + your amount);
end;

Trigger(OBJECT_TOUCH_TRIGGER, 'Monster', 'MonsterFunction');
Карты для Heroes V: Повелители орды:
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация