Skip to content
User Avatar
#2981
Auto-translated
Botojan, I can only offer a couple of comments; I'm not sure how critical they are in your specific case.
if newowner == PLAYER_1 == nil then
I wouldn't recommend using such a complex syntax. There's a high chance of making a mistake.
""Bobruisk"", ""TownCaptured""
I'm not entirely sure if double-double quotes like that will be processed correctly.
for i = 1, 14 do
total = total + GetHeroCreatures( heroname, i ) * costs;
end;
The link to the Haven castle is within the loop from 1 to 14 – these are the IDs of the creatures in that castle. Look for the IDs you need in the documentation.
AddHeroCreatures( heroname, 15 + i, factor[i + 15] * coeff );
Similarly, the magic number 15 is an offset to the IDs of the Dungeon creatures.
РПГ-сценарий для HoMM5: Путь героя
ЧаВо по созданию карт для HoMM5: ЧаВо

Statistics

Welcome our newest member: leyu