Skip to content
User Avatar
#3218
Auto-translated
Lol Nikita
diff=GetDifficulty();
function bitva_1(heroname, objectname)
if heroname == "Raelag" then
StartCombat(heroname, nil, 3, 6, 5+2*diff, 6, 5+2*diff, 6, 5+2*diff, nil);
sleep(5);
RemoveObject('q7');
RemoveObject('q8');
RemoveObject('q9');
end;
end;
Trigger(OBJECT_TOUCH_TRIGGER,'q7','bitva_1');
Trigger(OBJECT_TOUCH_TRIGGER,'q8','bitva_1');
Trigger(OBJECT_TOUCH_TRIGGER,'q9','bitva_1');
I think I did it right, but the hero ends up with 9 lamellar armor, and I need 7. As I understand it, 5+2*diff means 5 lamellar armor + the amount multiplied by the difficulty. If the difficulty is Recruit, then diff=1, and it turns out that on Recruit there will be 7 lamellar armor, if the difficulty is Warrior, then diff=2, and there are already 5+2*2=9. Can you please explain what the error is here? Thank you in advance.

Added 25 minutes ago
I would also like to ask something else. Does the OpenCircleFog function exist? It reveals the fog of war, and with it you can reveal part of the map. Is it possible to use some function to make it not reveal, but close the fog of war, thus preventing the hero from seeing certain places that he has already visited, and so that this part of the map is not visible on the minimap in the lower left corner of the game?
Sorry, I made a mistake out of habit. On Recruit, diff will be 0, on Warrior 1, on Veteran 2, on Hero 3, so on Recruit there will be 5 lamellar armor in each stack, on Warrior - 7, on Veteran 9, and on Hero 11. But using a simple GetDifficulty for calculations is often inconvenient due to its zero value on Recruit, so I recommend changing
diff = GetDifficulty();
to
diff = GetDifficulty()+1
. If you really need 7 on the Hero, then write inside the function before Start Combat
diff= GetDifficulty()+1;
...

...
local amount=0;
local i=1;
for i,4 do
if diff == i then
amount=i;
end;
end;
...
It seems that this is correct, but I'm not 100% sure...
And in the formula for calculating the number of lamellar armor, put 3+amount. If it doesn't work (and I can't guarantee 100% that what I wrote is correct - I'm working from my phone and therefore relying on my memory), just bluntly write the conditions

diff=GetDifficulty()+1;
...

...
local amount=0;
if diff == 1 then
amount=5;
end;
if diff == 2 then
amount=5;
end;
if diff == 3 then
amount=6;
end;
if diff == 4 then
amount=7
end;
And in the formula for calculating the number of lamellar armor, just write amount.
Choose any method.

Regarding closing the fog of war, I have never seen such a thing, so I declare that such a function does not exist. But I am not immune to errors, maybe it does exist. Then try either
CloseCircleFog(x, y, floor, radius, PLAYER_ID); 
or ask Jack_of_shadows in a private message
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________

Statistics

Welcome our newest member: leyu