Skip to content
#2351
Auto-translated
Here, it seems to be written correctly:

function hire1(hero)
hire1_hero = hero
MessageBox("path to the message text in Unicode format");
QuestionBox("path to the question text", "hire1_ok");
end

function hire1_ok()
local gold = GetPlayerResource(PLAYER_1, GOLD)
if gold >= hiring_cost then
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "region_name", nil);
SetPlayerResource(PLAYER_1, GOLD, gold - hiring_cost);
AddHeroCreatures(hire1_hero, creature_type, quantity);
else
-- you can add a message about insufficient funds here
end
end;


Added 2 minutes ago
And yes, for "creature_type", you need to find the creature ID.

Statistics

Welcome our newest member: Emil

Users Online 2 users 1055 guests