Script from James Vogan- -no more negative experience bug
Jim Vogan just emailed me this script which will disable the negative experience bug, which is a dead end if occurs.
note from James Vogan:
"The bug you describe probably occurs when the experience exceeds the maximum positive value that its (internal) variable can store. For example, one byte (8 bits) can store a number from 0 to 255 (11111111 in binary), but it is convenient to the value stored as from -128 to +127, by performing the "two's complement" (change all 0's to 1's and 1's to 0's, then add 1) to convert a positive number to a negative number, because any binary number and its two's-complement sum to zero (with a carry that overflows out of the byte). This makes integer subtraction easy (just add the two's complement of the number to be subtracted), but it means that, for example, if you are using 1-byte storage, adding 2 to 127 (00000010 to 01111111 in binary) produces -127 instead of 129."
In readable words

this bug will certainly occur when the experience received after a very big battle can't be handled by the game. Usually if you continue to play a map after the 12th month and the neutral creatures have an overgrowth. Your experience will go into the negative, all abilities will be lost and you will need certainly more than hundred battles to restore it. The script restore it automatically if lost.
Here it is:
ZVSE
** script to prevent creature experience reduction due to overflow. JHV,
2/3/2009
** uses v7090-v7103 to store troop ranks @ start of battle
** uses FU459-FU462
!?BA0&1000; start of (human) battle
!!BA:H0/?v1; get attacker hero #
!!BA:H1/?v2; get defender hero # (if any)
!!DO459/0/6/1&v1>-1/v1<156:Pv1; check stacks 0-6 for attacker
!!DO460/0/6/1&v2>-1/v2<156:Pv2; check stacks 0-6 for defender
!?FU459; get exp. rank of troop in slot x16 of hero x1, store in v[7090+x16]
!!HEx1:C0/x16/?y1/?y2/?y3/2; y1=type, y2=no., y3=experience
!!VRv5:S7090+x16;
!!VRvv5:Sy3;
!?FU460; get exp. rank of troop in slot x16 of hero x1, store in v[7097+x16]
!!HEx1:C0/x16/?y1/?y2/?y3/2; y1=type, y2=no., y3=experience
!!VRv5:S7097+x16;
!!VRv5:Sy3;
!?BA1&1000; end of (human) battle
!!BA:H0/?v1; get attacker hero #
!!BA:H1/?v2; get defender hero # (if any)
!!VRv3:C-1/-1; set v3 & v4 to -1
!!HEv1&v1>-1/v1<156:O?v3; get attacker's Owner - will be 0-7 if attacker won
!!HEv2&v2>-1/v2<156:O?v4; get defender's Owner - will be 0-7 if defender won
!!DO461/0/6/1&v3>-1/v3<8:Pv1; check stacks 0-6 for attacker
!!DO462/0/6/1&v4>-1/v4<8:Pv2; check stacks 0-6 for defender
!?FU461; get exp. rank of troop in slot x16 of hero x1, vs. v[7090+x16]
!!HEx1:C0/x16/?y1/?y2/?y3/2; y1=type, y2=no., y3=experience
!!FU&y2<1:E; quit if no troops left in slot
!!VRv5:S7090+x16;
!!VRy4:Svv5;
!!HEx1&y4>y3:C0/x16/d/d/11/12; set rank to 11 if negative experience was
gained (overflow occurred)
!?FU462; get exp. rank of troop in slot x16 of hero x1, vs. v[7097+x16]
!!HEx1:C0/x16/?y1/?y2/?y3/2; y1=type, y2=no., y3=experience
!!FU&y2<1:E; quit if no troops left in slot
!!VRv5:S7097+x16;
!!VRy4:Svv5;
!!HEx1&y4>y3:C0/x16/d/d/11/12; set rank to 11 if negative experience was
gained (overflow occurred)
!!IF&610:V616/1;
Jim used FU463 which is already claimed for the espionage script so I changed the functions to 459-462. Tested and no bugs so far.
For whom may be concerned.
____________
The difference between genius and stupidity is that genius has its limits. - Albert Einstein