Connection ErrorBad RequestThis page went staleSession ExpiredSign in requiredForbiddenNot FoundToo Many RequestsServer ErrorBad GatewayService UnavailableGateway TimeoutHTTP Version Not Supported
Session Expired
Your session has expired. Please log in to continue.
Sign in required
You need an account to do that. Sign in or create one — it only takes a minute.
This page went stale
Your security token was rejected, usually because the page sat open too long or you signed in elsewhere. Nothing was saved. Reload the page and try again.
Request Failed
We encountered an issue while processing your request.
Please check your internet connection and try again.
_BlackKnight_, for example, if a player strictly plays as a Knight, and the AI strictly plays as a Demon, then:
-- table of correspondences, only added a couple of creatures, the rest by analogy
creatures_conversion_table =
{
{CREATURE_PEASANT, CREATURE_FAMILIAR},
{CREATURE_MILITIAMAN, CREATURE_IMP},
{CREATURE_LANDLORD, CREATURE_QUASIT},
};
-- checking function, without the wrapper regarding when to call it
-- the names of the player's and AI's heroes are passed as input.
function CheckCreaturesConversion(hero_player, hero_enemy)
for i, cr in creatures_conversion_table do
local cr_num = GetHeroCreatures(hero_player, cr[1]);
if (cr_num > 0) then
AddHeroCreatures(hero_enemy, cr[2], cr_num);
end
end
end
If the castles are random, then, of course, everything will be a little more complicated.
I haven't checked the code; I might have made a mistake somewhere.
РПГ-сценарий для HoMM5: Путь героя ЧаВо по созданию карт для HoMM5: ЧаВо