Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
New here? I'm Roha — want a quick tour?
Hello,
please help me write a script.
Basically, the idea is that on the battlefield, in the battle window, a certain number of monsters appear.
After they are killed, 2 more squads are summoned, and their quantity is multiplied by 2.
The ideal option would be to have an escape key pressed,
the battle ends, and you receive a prize depending on the number of spawned enemies killed.
If this isn't possible, just have a certain number of spawns.
Here's another idea:
the battle ends after you lose more than half of your troops.
function DefenderCreatureMove(unit)
local last_mana = GetUnitManaPoints(unit);
SetUnitManaPoints(unit, 100);
sleep(30);
local player_units = GetCreatures(ATTACKER);
UnitCastAimedSpell(unit, SPELL_BLIND, player_units[0]);
sleep(1);
SetUnitManaPoints(unit, last_mana);
endfunction BlindAttackerUnit()
repeat sleep() until combatStarted()
local unit = GetCreatures(DEFENDER)[0]
local last_mana = GetUnitManaPoints(unit);
SetUnitManaPoints(unit, 100);
repeat sleep() until GetUnitManaPoints(unit) == 100
local player_unit = GetCreatures(ATTACKER)[0]
setATB(player_unit, 0)
UnitCastAimedSpell(unit, SPELL_BLIND, player_unit);
sleep(1);
SetUnitManaPoints(unit, last_mana);
end
startThread(BlindAttackerUnit)Here's a snippet from my script:
k=GetDifficulty();
dd=0;
urv=0;
function newDayF()
dd=GetDate(0);
if mod(dd, 14)==0 then
OpenCircleFog(1, 59, 1, 4, 1);
MoveCamera(1, 59, 1, 50, 1.2, 0, 0, 0);
CreateCaravan("Carav"..urv, 1, 1, 1, 59, 1, 12, 21);
sleep(2);
AddObjectCreatures("Carav"..urv, 131, 20+20*urv+10*(3-k));
AddObjectCreatures("Carav"..urv, 132, 17+17*urv+9*(3-k));
AddObjectCreatures("Carav"..urv, 133, 12+12*urv+6*(3-k));
AddObjectCreatures("Carav"..urv, 134, 6+6*urv+4*(3-k));
AddObjectCreatures("Carav"..urv, 135, 3+3*urv+3*(3-k));
AddObjectCreatures("Carav"..urv, 136, 5+2*urv-k);
AddObjectCreatures("Carav"..urv, 137, 1+urv);
urv=urv+1;
end;
end;
Trigger(0, "newDayF");