Ah, well, of course. There, all deffence is read into the attack parameter, and the defence is returned to 0. This code is from the display of the dialog that you are talking about
upd: I can give you the code with the hooker so that the defence is displayed. Necessary?
Thanks, is not for me, I wanted to reply to a request in
HC erm thread. So I think he wants the hook. I can give him the additional code except the hook

Even the hook was not needed
But please note! This is only in the display of the message
So, when dealing damage, deffence will not be taken into account.
Where did you place this code, in instructions or in battle scripts? I placed the first in both but no change, not sure what to do.
Valery, You probably put both the code. Only one is needed
Works, thanks.))
Also, I don't remember but there was a way to update stack stats right after casting a spell, was it BG1 then check if hero cast spell, or some other command?
The parameters should be updated instantly.
Is it better to specify the exact case...
For example if "hastle"
No, I mean to update scripted defense. You said that your script only shows visually defense, but real defense will still be zero, right? So I have to use !!BMx16: D[add defense] etc to update real defense (in combination with your code), or I misunderstood?
You said: "So, when dealing damage, deffence will not be taken into account. "
Such code changes should be place in
!?FU(OnGameEnter);
and restored in
!?FU(OnGameLeave);
(19.12.2017 19:03)Valery Wrote: [ -> ]No, I mean to update scripted defense. You said that your script only shows visually defense, but real defense will still be zero, right?
Yes!!
(19.12.2017 19:03)Valery Wrote: [ -> ]So I have to use !!BMx16: D[add defense] etc to update real defense (in combination with your code), or I misunderstood?
Will not works. The defence parameter will just go into the attack, and the defence will still remain 0.
Are you sure? because in the debug message when I reinitialized the defense on a frenzied stack, it returns the proper value, it just didn't show.
Valery, and before you set the defense it returned 0?
Good catch, indeed it returns always initial defense
Didn't think of that

Так-с. Так как пост на HC содержал немного другую формулировку - ответ запишу и сюда:
szaman Wrote:It's possible to make via ERM a script that makes NOT LOSING DEFENSE POINTS when casting frenzy spell?
Можно ли сделать через ERM скрипт, чтобы не терялись очки обороны при произнесении заклинания "Бешенство"?
Здравствуйте уважаемые обитатели форума! Недавно решил заняться скриптописанием на erm. Естественно начали возникать проблемы, но не такие серьёзные и по мере возможности и изучения я их решал. Но не в этом случае. Мне нужно, чтобы при каждом бое (неважно с вражеским героем или нейтралом) на войска накладывалась защита от магии огня. Вот что у меня получилось:
!?BA0;
!!BA:H0/?v30;
!!BA:H1/?v31;
!!HEv30&v30<>-2:N?v32;
!!HEv31&v31<>-2:N?v33;
!!VRv25&v30<>-2/v32=49:S0;
!!DO23/0/20/1&v30<>-2/v32=49:P;
!!VRv25&v31<>-2/v33=49:S21;
!!DO23/0/20/1&v31<>-2/v33=49:P;
!?FU23;
!!BMv25:M31/99/3;
!!VRv25:+1;
Вообщем-то запускаю карту, ошибок не выдаёт, но в бою заклинание не накладывает. Что не так сделал? Премного буду благодарен за помощь!