I have made a code that changes the way new recruits come to city. Its now like in Heroes4, where creatures are coming every day, not every week.

It calculates all correctly, it means that growth will be always like in original game, but divided on seven days.

For example, if you have a growth of +6 per week in original heroes3, then you will get 6 creatures at day 1.

Original Heroes3:

Day1: 0 creatures

Day2: 0 creatures

Day3: 0 creatures

Day4: 0 creatures

Day5: 0 creatures

Day6: 0 creatures

Day7: 0 creatures

Day1: 6 creatures

With my code it is divided on seven days so it will look like:

Daily Growth Heroes3:

Day1: 0 creatures

Day2: 1 creature

Day3: 2 creatures

Day4: 2 creatures

Day5: 3 creatures

Day6: 4 creatures

Day7: 5 creatures

Day1: 6 creatures

So it handles perfectly creatures that should not come every day. If you have a creature that has growth +3/week then you will get one creature on day2, one creature on day5 and one creature on day1 of new week which will equal original heroes.

Its not hardcoded, its calculated using growth stats of every creature, so if you change for example Behemoth growth with !#MA to 14 then my code will still work correctly giving you 2 behemoths per day to recruit.

Code: Select all

`[ daily growth ]`

!#VRv9433:S0;

!#TM91:S8/255/7/255;

!#TM92:S9/255/7/255;

!?TM92;

!!VRv9433:S0; set as not decreased

!?TM91; fires every population - decrease population

!!FU&v4933=1:E; population has been already decreased

!!UN:U98/-1/?y-1;

!!VRv1:S-1;

!!VRv2:S-1;

!!VRv3:S-1;

!!DO28116/1/y-1/1&v9433=0:P;

!!VRv9433:S1; set as decreased

!?FU28116;

!!UN:U98/-1/-1/1;

!!CA1:O?y1;

!!CA1:T?y-1;

!!CA1:N?z1;

!!FU28112:Py-1/0; get 1st lvl monster

!!FU&v10=-1:E; exit if no monster found ?

!!FU28117:P0/v10; get prod to v360

!!CA1:M1/0/?v364/?v365; get recruits

!!VRv364:-v360; sub by growth

!!VRv365:-v360; sub by growth

!!CA1&y1<>-1:M1/0/v364/v365; update recruits

!!FU28112:Py-1/1; get 2nd lvl monster

!!FU&v10=-1:E; exit if no monster found ?

!!FU28117:P1/v10; get prod to v360

!!CA1:M1/1/?v364/?v365; get recruits

!!VRv364:-v360; sub by growth

!!VRv365:-v360; sub by growth

!!CA1&y1<>-1:M1/1/v364/v365; update recruits

!!FU28112:Py-1/2; get 3rd lvl monster

!!FU&v10=-1:E; exit if no monster found ?

!!FU28117:P2/v10; get prod to v360

!!CA1:M1/2/?v364/?v365; get recruits

!!VRv364:-v360; sub by growth

!!VRv365:-v360; sub by growth

!!CA1&y1<>-1:M1/2/v364/v365; update recruits

!!FU28112:Py-1/3; get 4th lvl monster

!!FU&v10=-1:E; exit if no monster found ?

!!FU28117:P3/v10; get prod to v360

!!CA1:M1/3/?v364/?v365; get recruits

!!VRv364:-v360; sub by growth

!!VRv365:-v360; sub by growth

!!CA1&y1<>-1:M1/3/v364/v365; update recruits

!!FU28112:Py-1/4; get 5th lvl monster

!!FU&v10=-1:E; exit if no monster found ?

!!FU28117:P4/v10; get prod to v360

!!CA1:M1/4/?v364/?v365; get recruits

!!VRv364:-v360; sub by growth

!!VRv365:-v360; sub by growth

!!CA1&y1<>-1:M1/4/v364/v365; update recruits

!!FU28112:Py-1/5; get 6th lvl monster

!!FU&v10=-1:E; exit if no monster found ?

!!FU28117:P5/v10; get prod to v360

!!CA1:M1/5/?v364/?v365; get recruits

!!VRv364:-v360; sub by growth

!!VRv365:-v360; sub by growth

!!CA1&y1<>-1:M1/5/v364/v365; update recruits

!!FU28112:Py-1/6; get 7th lvl monster

!!FU&v10=-1:E; exit if no monster found ?

!!FU28117:P6/v10; get prod to v360

!!CA1:M1/6/?v364/?v365; get recruits

!!VRv364:-v360; sub by growth

!!VRv365:-v360; sub by growth

!!CA1&y1<>-1:M1/6/v364/v365; update recruits

!?FU28117; get castle creature production (x1 = creature level, x2 = creature number , castle at v1/v2/v3)

!!MA:Gx2/?v360; get growth to v360

!!FU28115:Px1; check if correct lvl built

!!VRv360&-2:S0; set to 0 if not built

!!FU&-2:E; exit (return 0)

!!VRv361:Sv360 :2;

!!CA1:B3/9; check if castle is built

!!VRv360&1:+v360; double production if castle

!!CA1:B3/8; check if citadel is built

!!VRv360&1:+v361; 50% production if citadel

!!CA1:B3/26; check if grail is built

!!VRv360&1:*2;

!?TM35; fires every day for every color

!!OW:C?y-2;

!!UN:U98/-1/?y-1;

!!DO28111/1/y-1/1:Py-2; for every castle with y-2 color

!?FU28111;

!!UN:U98/-1/x16/1; store coors to v1/v2/v3

!!CA1:O?y-1; store castle owner to y-1

!!FU28114&y-1=x1:P;

!?FU28114; add daily prod

!!VRv4:Sv1 -1; po4 stores first 4 lvl

!!VRv5:Sv2;

!!VRv6:Sv3;

!!VRv7:Sv1 +1; po7 stores last 3 lvls

!!VRv8:Sv2;

!!VRv9:Sv3;

!!CA1:T?y-1;

!!CA1:N?z1;

!!FU28112:Py-1/0;

!!FU&v10=-1:E; exit if no monster found ?

!!UN:N3/2/v10/0;

!!MA:Gv10/?y-2;

!!VRy-3:Sy-2 :2;

!!FU28115:P0; check if 1lvl built

!!VRy-2&-2:S0; set to 0 if not built

!!CA1:B3/9; check if castle is built

!!VRy-2&1:+y-2; double production if castle

!!CA1:B3/8; check if citadel is built

!!VRy-2&1:+y-3; 50% production if citadel

!!PO4:V0/?y-4;

!!VRy-2:*100 :7;

!!VRy-4:+y-2; add daily production

!!VRy-5:Sy-4 :100;

!!PO4&y-5<=0:V0/y-4; set new value to city

!!CA1:M1/0/dy-5/dy-5; add new monsters to city

!!VRy-5:*100; x100 it

!!VRy-4:-y-5; sub y-5 from y-4

!!PO4:V0/y-4; set new value

!!FU28112:Py-1/1;

!!FU&v10=-1:E; exit if no monster found ?

!!UN:N3/2/v10/0;

!!MA:Gv10/?y-2;

!!VRy-3:Sy-2 :2;

!!FU28115:P1; check if 2lvl built

!!VRy-2&-2:S0; set to 0 if not built

!!CA1:B3/9; check if castle is built

!!VRy-2&1:+y-2; double production if castle

!!CA1:B3/8; check if citadel is built

!!VRy-2&1:+y-3; 50% production if citadel

!!PO4:V1/?y-4;

!!VRy-2:*100 :7;

!!VRy-4:+y-2; add daily production

!!VRy-5:Sy-4 :100;

!!PO4&y-5<=0:V1/y-4; set new value to city

!!CA1:M1/1/dy-5/dy-5; add new monsters to city

!!VRy-5:*100; x100 it

!!VRy-4:-y-5; sub y-5 from y-4

!!PO4:V1/y-4; set new value

!!FU28112:Py-1/2; *** edit ***

!!FU&v10=-1:E; exit if no monster found ?

!!UN:N3/2/v10/0;

!!MA:Gv10/?y-2;

!!VRy-3:Sy-2 :2;

!!FU28115:P2; check if 3lvl built *** edit ***

!!VRy-2&-2:S0; set to 0 if not built

!!CA1:B3/9; check if castle is built

!!VRy-2&1:+y-2; double production if castle

!!CA1:B3/8; check if citadel is built

!!VRy-2&1:+y-3; 50% production if citadel

!!PO4:V2/?y-4; *** edit ***

!!VRy-2:*100 :7;

!!VRy-4:+y-2; add daily production

!!VRy-5:Sy-4 :100;

!!PO4&y-5<=0:V2/y-4; set new value to city *** edit ***

!!CA1:M1/2/dy-5/dy-5; add new monsters to city *** edit ***

!!VRy-5:*100; x100 it

!!VRy-4:-y-5; sub y-5 from y-4

!!PO4:V2/y-4; set new value *** edit ***

!!FU28112:Py-1/3; *** edit ***

!!FU&v10=-1:E; exit if no monster found ?

!!UN:N3/2/v10/0;

!!MA:Gv10/?y-2;

!!VRy-3:Sy-2 :2;

!!FU28115:P3; check if 4lvl built *** edit ***

!!VRy-2&-2:S0; set to 0 if not built

!!CA1:B3/9; check if castle is built

!!VRy-2&1:+y-2; double production if castle

!!CA1:B3/8; check if citadel is built

!!VRy-2&1:+y-3; 50% production if citadel

!!PO4:V3/?y-4; *** edit ***

!!VRy-2:*100 :7;

!!VRy-4:+y-2; add daily production

!!VRy-5:Sy-4 :100;

!!PO4&y-5<=0:V3/y-4; set new value to city *** edit ***

!!CA1:M1/3/dy-5/dy-5; add new monsters to city *** edit ***

!!VRy-5:*100; x100 it

!!VRy-4:-y-5; sub y-5 from y-4

!!PO4:V3/y-4; set new value *** edit ***

!!FU28112:Py-1/4; *** edit ***

!!FU&v10=-1:E; exit if no monster found ?

!!UN:N3/2/v10/0;

!!MA:Gv10/?y-2;

!!VRy-3:Sy-2 :2;

!!FU28115:P4; check if 5lvl built *** edit ***

!!VRy-2&-2:S0; set to 0 if not built

!!CA1:B3/9; check if castle is built

!!VRy-2&1:+y-2; double production if castle

!!CA1:B3/8; check if citadel is built

!!VRy-2&1:+y-3; 50% production if citadel

!!PO7:V0/?y-4; *** edit ***

!!VRy-2:*100 :7;

!!VRy-4:+y-2; add daily production

!!VRy-5:Sy-4 :100;

!!PO7&y-5<=0:V0/y-4; set new value to city *** edit ***

!!CA1:M1/4/dy-5/dy-5; add new monsters to city *** edit ***

!!VRy-5:*100; x100 it

!!VRy-4:-y-5; sub y-5 from y-4

!!PO7:V0/y-4; set new value *** edit ***

!!FU28112:Py-1/5; *** edit ***

!!FU&v10=-1:E; exit if no monster found ?

!!UN:N3/2/v10/0;

!!MA:Gv10/?y-2;

!!VRy-3:Sy-2 :2;

!!FU28115:P5; check if 5lvl built *** edit ***

!!VRy-2&-2:S0; set to 0 if not built

!!CA1:B3/9; check if castle is built

!!VRy-2&1:+y-2; double production if castle

!!CA1:B3/8; check if citadel is built

!!VRy-2&1:+y-3; 50% production if citadel

!!PO7:V1/?y-4; *** edit ***

!!VRy-2:*100 :7;

!!VRy-4:+y-2; add daily production

!!VRy-5:Sy-4 :100;

!!PO7&y-5<=0:V1/y-4; set new value to city *** edit ***

!!CA1:M1/5/dy-5/dy-5; add new monsters to city *** edit ***

!!VRy-5:*100; x100 it

!!VRy-4:-y-5; sub y-5 from y-4

!!PO7:V1/y-4; set new value *** edit ***

!!FU28112:Py-1/6; *** edit ***

!!FU&v10=-1:E; exit if no monster found ?

!!UN:N3/2/v10/0;

!!MA:Gv10/?y-2;

!!VRy-3:Sy-2 :2;

!!FU28115:P6; check if 5lvl built *** edit ***

!!VRy-2&-2:S0; set to 0 if not built

!!CA1:B3/9; check if castle is built

!!VRy-2&1:+y-2; double production if castle

!!CA1:B3/8; check if citadel is built

!!VRy-2&1:+y-3; 50% production if citadel

!!PO7:V2/?y-4; *** edit ***

!!VRy-2:*100 :7;

!!VRy-4:+y-2; add daily production

!!VRy-5:Sy-4 :100;

!!PO7&y-5<=0:V2/y-4; set new value to city *** edit ***

!!CA1:M1/6/dy-5/dy-5; add new monsters to city *** edit ***

!!VRy-5:*100; x100 it

!!VRy-4:-y-5; sub y-5 from y-4

!!PO7:V2/y-4; set new value *** edit ***

!?FU28112; get monster number to v10 (x1 = town type, x2 = level)

!!VRv10:S-1;s

!!DO28113/0/173/1:Px1/x2;

!?FU28113; ...

!!MA:Lx16/?y-1;

!!MA:Ox16/?y-2;

!!VRv10&x1=y-2/x2=y-1:Sx16;

!?FU28115; check if x1 level dwelling (upgraded or not) is built

!!IF:V2/0; not built initially

!!VRy1:Sx1 +30;

!!CA1:B3/y1; check if unupg is built

!!IF&1:V2/1; set flag if yes

!!FU&1:E; exit if yes

!!VRy1:+7;

!!CA1:B3/y1; check if upg is built

!!IF&1:V2/1; set flag if yes

!!FU&1:E; exit if yes