Events can be positive or negative, there are 27 events that may appear.

If AI gets event during his turn, then player will be informed about this.

List of events:

01. Freelancers

One of your hero is offered to buy some random creatures for gold. The number depend on current day, so for example you will get 9 harpies on day5 but if this would happen on day40 then you would be offered by 40+ harpies.

02. Scholar

One of your heroes is offered to buy a spell. Cost depends on spell level.

03. Treasury

You are getting some random resources.

04. Hero

A randomly choosen hero comes to one of your cities and offers to join your forces for free. Heroes always have starting armies, but they can be more experienced than level 1.

05. Scout

If you pay 5000 gold coins to scout, then all enemy towns will be revealed on map (shroud removed).

06. Artifact Seller

One of your heroes is offered to buy a random artifact for a gold. Price depends on artifact level.

07. Summoner

One of your heroes meets a summoner which offers him teleport to one of your cities for free (like expert town portal).

08. Cartographer

If you pay some gold, then shroud will be removed in one part of map. Sometimes cartographer offers you to reveal all map but this is very costly (around 20-25k).

09. Trainer

One of your heroes meets a trainer that can train your hero. He offers you from 1000 to 15,000 experience, while one experience point costs 1 gold piece.

10. Assassins

Assassins are coming to your town. If you recruit them, you must use them in one turn on monster stack on map. When you ctrl+click monster and use it, a part of monsters in this stack is killed (from 50 to 90%) allowing you to easy kill.

11. Rebellion

One of your city is under rebellion. You are losing control of that city, which becomes neutral.

12. Recruits

Some recruits are coming to your city, so you can buy them from their dwellings.

13. Plague

One of your cities is under plague. It means that half of unbought creatures from dwellings are dead.

14. Illness

One of your heroes is ill and act in this turn.

15. Avenger

One of your heroes is attacked by 8 lvl monster. If you manage to kill monster, you will get some gold for it.

16. Alchemist

One of your heroes spell points will be replenished to full.

17. Move it!

One of your heroes can walk on twice distance than normally, it means that for one turn she/he will have double move points.

18. Out of mana

Game chooses one of your heroes and drains all spell points from him.

19. Storm

One of your heroes will be damaged with lightings what destroys some of his creatures.

20. Finger of Death

One of your heroes must try to resist a spell which some angry gods are casting on you. If you don't manage to resist spell, then your hero instantly dies. The higher level of hero -> more chance to resist Finger of Death.

21. Godlike Strength / Ultimate Defense / Wrathful Spellpower / Divine Knowledge

One of your heroes gains +1-3 attack/defense/spellpower or knowdlege permamently.

22. Dragon Shade

One of your heroes is attacked by single dracolich.

23. Ghost

A stack of ghosts spawns near your hero possibly blocking his way.

24. Gremlin Bombers

You are offered to hire gremlin bombers for 5000 golds. If you hire them, then you must Ctrl+Click an enemy city, gremlins will try to sneak there and blow up city. Chance depends on city level, Capitol+Castle city has around 30% chance of being destroyed. If city is destroyed, it cannot be claimed anymore and becomes neutral.

25. Headhunters

You are offered to hire headhunters. They are normal monsters but price is only 10% of their real price. They wont join your army, but if you hire them, you must Ctrl+Click enemy hero in this turn and those monsters will attack him and try to kill him.

26. God of Wrath

Your heroes are defended by a god of wrath. During this turn, your enemies will be struck with lighting bolts in battle.

Code: Select all

`[turn events]`

[FU28101 : Store random current owner's hero in V1]

!?FU28101; store random owner hero in v1

!!VRv1:S-1;

!!VRv5:S0;

!!VRv6:S0;

!!DO28102/0/155/1:P;

!!VRv5:-1;

!!VRv7:S1 Rv5;

!!DO28103/0/155/1:Pv7;

!?FU28102; get heroes count

!!HEx16:O?y1;

!!OW:C?y2;

!!VRv5&y1=y2:+1;

!?FU28103; select hero with count = x1

!!HEx16:O?y1;

!!OW:C?y2;

!!VRv6&y1=y2:+1;

!!VRv1&v6=x1/y1=y2:Sx16;

!?FU28120; store specified owner hero in v1 (x1)

!!VRv1:S-1;

!!VRv5:S0;

!!VRv6:S0;

!!DO28121/0/155/1:Px1;

!!VRv5:-1;

!!VRv7:S1 Rv5;

!!DO28122/0/155/1:Pv7/x1;

!?FU28121; get heroes count

!!HEx16:O?y1;

!!VRv5&y1=x1:+1;

!?FU28122; select hero with count = x1

!!HEx16:O?y1;

!!VRv6&y1=x2:+1;

!!VRv1&v6=x1/y1=x2:Sx16;

[FU28104 : Store random current owner's castle in V1]

!?FU28104; store random owner castle in v1

!!VRv1:S-1;

!!VRv2:S-1;

!!VRv3:S-1;

!!VRv8:S-1;

!!VRv9:S-1;

!!VRv10:S-1;

!!VRv5:S0;

!!VRv6:S0;

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

!!DO28105/1/v7/1:P;

!!VRv5:-1;

!!VRv4:S1 Rv5;

!!DO28106/1/v7/1:Pv4;

!?FU28105; get castle count

!!UN:U98/-1/x16/8; store castle coors in v8/v9/v10

!!CAv8/v9/v10:O?y1;

!!OW:C?y2;

!!VRv5&y1=y2:+1; inc counter if its his castle

!?FU28106; select castle with number x1

!!UN:U98/-1/x16/8; store castle coors in v8/v9/v10

!!CAv8/v9/v10:O?y1;

!!OW:C?y2;

!!VRv6&y1=y2:+1; inc counter if its his castle

!!VRv1&v6=x1/y1=y2:Sv8;

!!VRv2&v6=x1/y1=y2:Sv9;

!!VRv3&v6=x1/y1=y2:Sv10;

!?FU28107; equip x1 hero with random artifact

!!VRy-1:S7 R133;

!!HEx1:A4/y-1;

!?FU28108; discover castle for rnd player with chance of 30%

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

!!OW:C?y-1;

!!UN:Sv8/v9/v10/y-1/6;

!!UN:Lv8/v9/v10/500;

!#TM95:S1/300/1/255;

!?TM95;

!!VRv9432:S0; assassins = 0

!!VRv9434:S0; grem. bombers = 0

!!VRv9435:S-1; headhunter type = -1

!!VRv9436:S-1; headhunter count = -1

!!VRv9444:S0; god help = 0

!!VRv9446:S0; necro help = 0

!!VRv9429:S1 R2600;

!!VRv9430:S0 T100;

!!VRv9429&v9430>25:S0;

!!OW:I-1/?v9431; get ai to v9431 (1 = ai)

!?TM95&v9429>=2500/v9429<2600; [ 26. god help ]

!!FU28104:P; select random city

!!FU&v1=-1:E;

!!UN:Lv1/v2/v3/2000;

!!CA1:N?z1;

!!OW:C?y-65;

!!IF&v9431=1:Q1/10/y-65/4^{GOD OF WRATH}^;

!!IF&v9431=0:M^{GOD OF WRATH}

A gods are willing to help you with your journey today. They will destroy enemy stacks with divine lightnings in battle.^;

!!VRv9444:S1;

!?BA0;

!!BA:A?y-99;

!!FU&y-99=1:E; exit if ai

!!FU&v9444=0:E; exit if not godwrath

!!BA:B22; change background

!?BG0;

!!BA:A?y-99;

!!FU&y-99=1:E; exit if ai

!!FU&v9444=0:E; exit if not godwrath

!!VRy-1:S0 R1000;

!!FU&y-1>300:E; exit if not 30%

!!FU$RandomStack$:P1/1/0;

!!FU&y-100=-1:E; exit if not valid stack

!!BG:N?y-3;

!!FU&y-3=y-100:E; exit if striking current stack to move

!!VRz1:S^Sorry, I did it^;

!!VRz2:S^LIGHTBLT.WAV^;

!!BU:Mz1;

!!SN:Pz2;

!!VRy-2:Sc *20;

!!VRy-2:+125;

!!BMy-100:V37;

!!BMy-100:Ky-2;

!!BU:R;

!?TM95&v9429>=2400/v9429<2500; [ 25. headhunters ]

!!FU28104:P;

!!FU&v1=-1:E;

!!UN:Lv1/v2/v3/2000;

!!CA1:N?z1;

!!VRv361:S0 T173; [ generate random unit ]

!!VRv361&v361=145:S192; [ catapult ]

!!VRv361&v361=146:S193; [ ballista ]

!!VRv361&v361=147:S194; [ ammo cart ]

!!VRv361&v361=148:S195; [ arrow tower woot ]

!!VRv361&v361=149:S196; [ first aid tent ]

!!VRv361&v361=122:S192; [ placeholder ]

!!VRv361&v361=124:S194; [ placeholder ]

!!VRv361&v361=128:S196; [ placeholder ]

!!MA:Lv361/?v362; get creature level to v362

!!MA:Cv361/6/?v5; get cost to v5

!!VRy-2:S7 -v362;

!!VRy-1:Sc +10 :5;

!!VRy-1&y-1<1:S1;

!!VRy-1:*y-2;

!!VRy-1:Ty-1;

!!VRv5:*y-1 :12; cost x count / 20

!!OW:C?y-65;

!!IF&v9431=1:Q1/10/y-65/4^{HEADHUNTERS}^;

!!IF:V1/0;

!!IF&v9431=0:Q1/6/v5/21/v361/2^{HEADHUNTERS}

A pack of headhunters (%Y-1 total) came to your city %Z1. They don't want to join your army, but they can hunt down one enemy hero for you. Do you want to use their services?^;

!!IF&v9431=1:V1/1; always yes for ai

!!FU&-1:E; exit if clicked no

!!OW:R-1/6/?y-2;

!!VRy-2:-v5;

!!IF&y-2<0&v9431=0:M^You dont have enough gold!^;

!!FU&y-2<0:E; exit if dont have enough cash

!!OW:R-1/6/y-2;

!!VRv9435:Sv361; set v9435 to type

!!VRv9436:Sy-1; set v9436 to count

!!IF&v9431=0:M^{HEADHUNTERS}

You have recruited headhunters. They are ready to attack one of your enemies but they MUST be used in this turn. Just CTRL+Click enemy hero and watch as it dies.^;

!!FU&v9431=0:E; exit if not AI

!!VRv5:S-1;

!!DO28119/1/32/1:P;

!!FU&v5=-1:E; exit if cannot select

!!FU28120:Pv5; select random hero in owner

!!FU&v1=-1:E; exit if cannot select

!!HEv1:P?v8/?v9/?v10;

!!HEv1:Pv8/v9/v10/1;

!!HEv1:O?y-20;

!!HEv1:B0/?z1;

!!UN:Lv8/v9/v10/2000;

!!OW:Iy-20/?y-21;

!!IF&y-21=0:M^{HEADHUNTERS}

%Z1 has been attacked by headhunters!^;

!!HEv1:Tv8/v9/v10/v9435/v9436;

!?FU28119; select random owner that i am not in team with

!!OW:T-1/?y-1; get my team to y-1

!!VRy-2:S0 R6;

!!OW:Ty-2/?y-3; get his team to y-3

!!OW:Iy-2/d/?y-4; get isalive to y-4

!!VRv5&y-1<>y-3/y-4=0:Sy-2; select if its not in same team and alive

!?CM5;

!!FU&v9435=-1:E; exit if cannot headhunt

!!CM:F?y-1;

!!FU&y-1<>4:E; exit if not ctrl+click

!!CM:P?v1/?v2/?v3; get position to v1/v2/v3

!!OBv1/v2/v3:T?y-7;

!!FU&y-7<>34:E;

!!HEv1/v2/v3:N?y-6;

!!FU&y-6<0:E; exit if no hero

!!HEy-6:O?y-10;

!!HEy-6:B0/?z1;

!!FU&y-10=y-11:E; exit if attacking yourself (no exping)

!!IF:V1/0;

!!IF:Q1/21/v9435/2^{Headhunters}

Do you want headhunters to attack that hero?^;

!!FU&-1:E; exit if not

!!IF:Q1/10/y-10/1^{Headhunters}

%Z1 will be defending himself now...^;

!!UN:Lv1/v2/v3/1000;

!!VRv360:Sv1;

!!VRv361:Sv2;

!!VRv362:Sv3;

!!HEy-6:Tv1/v2/v3/v9435/v9436; fight

!!VRv9435:S-1;

!!VRv9436:S-1; disable head hunters

!!UN:Lv360/v361/v362/1000;

!?TM95&v9429>=2300/v9429<2400; [ 24. gremlin bombers ]

!!FU28104:P;

!!FU&v1=-1:E;

!!UN:Lv1/v2/v3/2000;

!!CA1:N?z1;

!!OW:C?y-65;

!!IF&v9431=1:Q1/10/y-65/4^{GREMLIN BOMBER}^;

!!FU&v9431=1:E;

!!VRz2:S^Gremlin Bombers^;

!!UN:G1/28/1/2;

!!IF:V1/0;

!!IF&v9431=0:Q1/6/5000/21/28/2^{GREMLIN BOMBER}

A pack of Gremlin bombers came to %Z1 town. They are asking if you would want to hire them. Their specialization is blowing up castles. They can destroy choosen enemy castle entirely, but its hard job and success is not guaranted. Chance of success is 40% in castle with Capitol, 70% in castle with City Hall and 90% in castle with Town Hall. Do you want to hire them for 5000 gold coins?^;

!!UN:G1/28/1/0;

!!FU&-1:E; exit if no

!!IF:M^{GREMLIN BOMBER}

Gremlin Bombers are ready. You MUST use it in this turn or they will be lost. To use Gremlin Bombers just CTRL+Click on any of enemy town.^;

!!VRv9434:S1;

!?CM5; clicking on map

!!FU&v9434=0:E; exit if cannot bomb

!!CM:F?y-1;

!!FU&y-1<>4:E; exit if not ctrl+click

!!CM:P?v1/?v2/?v3; get position to v1/v2/v3

!!OBv1/v2/v3:T?y-6;

!!FU&y-6<>98:E; exit if not clicked a town

!!CA1:O?y-3;

!!OW:C?y-4;

!!FU&y-3=y-4:E; dont destroy ourselves

!!CA1:N?z1;

!!IF:V1/0;

!!IF:Q1^{Gremlin Bombers}

Do you want to try blow up %Z1 city?^;

!!FU&-1:E; exit if no

!!VRy-1:S1000; 100% for bare city

!!CA1:B3/11;

!!VRy-1&1:S900; 90% if town hall

!!CA1:B3/12;

!!VRy-1&1:S700; 70% if city hall

!!CA1:B3/13;

!!VRy-1&1:S400; 40% if capitol

!!VRy-2:S0 T1000;

!!IF&y-2>y-1:M^{Gremlin Bombers}

Your Gremlin Bombers have trying to sneak to %Z1 but they have been sighted and killed, thus no explosions today.^;

!!FU&y-2>y-1:E;

!!IF:M^{Gremlin Bombers}

Your Gremlin Bombers have trying to sneak to %Z1 and they have successed.^;

!!UN:Lv1/v2/v3/2000;

!!CA1:I-1;

!!CA1:O-1;

!!OB1:S;

!!TRv1/v2/v3:E1 P0;

!!UN:Lv1/v2/v3/300;

!!IF:M^{Boom!}

After a while, city is up in smokes and explosions!^;

!!VRv9434:S0;

!?TM95&v9429>=2200/v9429<2300; [ 23. ghost ]

!!FU:E; disable

!!FU28101:P;

!!FU&v1=-1:E;

!!VRv360:Sc;

!!FU&v360<2:E; exit if day 1

!!VRv360:S12 R4 Tc;

!!HEv1:P?v8/?v9/?v10;

!!HEv1:Pv8/v9/v10;

!!UN:Lv8/v9/v10/2000;

!!OW:C?y-65;

!!VRy-1:S-1 R2;

!!VRv8:+y-1;

!!VRy-1:S-1 R2;

!!VRv9:+y-1;

!!TRv8/v9/v10:P?y-50;

!!FU&y-50=0:E; exit if cannot place here

!!HEv1:P?y-30/?y-31/?y-31;

!!FU&y-30=v8/y-31=v9:E; exit if wants to place on hero

!!IF&v9431=1:Q1/10/y-65/4^{GHOST}^;

!!HEv1:B0/?z1;

!!IF&v9431=0:Q1/21/159/1^{GHOST}

When {%Z1} was resting with army, noone have realized that they are sleeping on old graveyard. It looks like ghosts didnt enjoyed it and want to scare you from here.^;

!!UN:Iv8/v9/v10/54/159;

!!MOv8/v9/v10:Gv360;

!!MOv8/v9/v10:R10/1;

!!MOv8/v9/v10:U1;

!?TM95&v9429>=2100/v9429<2200; [ 22. dragon ]

!!FU28101:P;

!!FU&v1=-1:E;

!!VRv360:Sc;

!!FU&v360<2:E; exit if day 1

!!HEv1:P?v8/?v9/?v10;

!!HEv1:Pv8/v9/v10;

!!UN:Lv8/v9/v10/2000;

!!OW:C?y-65;

!!IF&v9431=1:Q1/10/y-65/4^{DRAGON SHADE}^;

!!HEv1:B0/?z1;

!!IF&v9431=0:Q1/21/196/1^{DRAGON SHADE}

When %Z1 was travelling with his army, large dragon-shaped shadow appeared on ground. You have looked upwards and you saw powerful dracolich flying towards you and your army!^;

!!VRv360:Sv1;

!!HEv1:Tv8/v9/v10/196/1; battle with 1 dracolich

!!HEv360:O?y-1;

!!OW&y-1=y-65:R-1/6/d20000;

!!FU&v9431=1:E; exit if ai

!!IF&y-1=y-65:Q1/6/20000/1^{Battle spoils}

After defeating that magical creature, you loot it and found large amounts of gold!^;

!?TM95&v9429>=2000/v9429<2100; [ 21. stat boost ]

!!FU28101:P;

!!FU&v1=-1:E;

!!HEv1:P?v8/?v9/?v10;

!!HEv1:Pv8/v9/v10;

!!UN:Lv8/v9/v10/2000;

!!VRy-1:S1 R3; 1-4

!!OW:C?y-65;

!!IF&v9431=1/y-1=1:Q1/10/y-65/4^{GODLIKE STRENGTH}^;

!!IF&v9431=1/y-1=2:Q1/10/y-65/4^{ULTIMATE DEFENSE}^;

!!IF&v9431=1/y-1=3:Q1/10/y-65/4^{WRATHFUL SPELLPOWER}^;

!!IF&v9431=1/y-1=4:Q1/10/y-65/4^{DIVINE KNOWLEDGE}^;

!!HEv1:B0/?z1;

!!VRv2:S1 T2;

!!HEv1&y-1=1:Fdv2/d/d/d;

!!HEv1&y-1=2:Fd/dv2/d/d;

!!HEv1&y-1=3:Fd/d/dv2/d;

!!HEv1&y-1=4:Fd/d/d/dv2;

!!FU&v9431=1:E; exit if ai

!!IF&y-1=1:Q1/31/v2/1^{GODLIKE STRENGTH}

%Z1 has meet a monk which is superior in hand to hand combat and offered him a rest for night. In thanks, monk have teached %Z1 and his army some good fighting techniques.^;

!!IF&y-1=2:Q1/32/v2/1^{ULTIMATE DEFENSE}

%Z1 has meet a monk which is superior in evading attacks and offered him a rest for night. In thanks, monk have teached %Z1 and his army some good defending techniques.^;

!!IF&y-1=3:Q1/33/v2/1^{WRATHFUL SPELLPOWER}

%Z1 has meet a monk which is superior in spellcasting and offered him a rest for night. In thanks, monk have teached %Z1 how to use his spells more effectively.^;

!!IF&y-1=4:Q1/34/v2/1^{DIVINE KNOWLEDGE}

%Z1 has meet a monk which is superior in concentration and offered him a rest for night. In thanks, monk have teached %Z1 and his army how to concentrate more about magic.^;

!?TM95&v9429>=1900/v9429<2000; [ 20. death ]

!!FU28101:P; random hero

!!FU&v1=-1:E; exit if no hero

!!HEv1:P?v8/?v9/?v10;

!!UN:Lv8/v9/v10/2000;

!!HEv1:Pv8/v9/v10;

!!OW:C?y-65;

!!IF&v9431=1:Q1/10/y-65/4^{FINGER OF DEATH}^;

!!HEv1:B0/?z1;

!!IF&v9431=0:M^{FINGER OF DEATH}

It looks like angry god is casting magical spell on %Z1. If it connects, your hero will die with his all army.^;

!!UN:Lv8/v9/v10/500;

!!HEv1:Ed/?v360; get hero level

!!VRv360:T20 +2; +random 1-20

!!VRv361:S0 R20; random 1-20

!!IF&v9431=0/v360>=v361:Q1/11/3/1^{FINGER OF DEATH}

Your hero successfully resisted spell!^;

!!FU&v360>=v361:E; exit

!!IF&v9431=0:Q1/13/3/1^{FINGER OF DEATH}

Spell-resist failed, it means that %Z1 is out of here.^;

!!HEv1&v9431=0:K;

!!HEv1&v9431=1:Tv8/v9/v10/196/9999;

!!VRv360:S0 T1000;

!!FU&v360<500:E;

!!OW:V-1/v1/d;

!?TM95&v9429>=1800/v9429<1900; [ 19. storm ]

!!FU28101:P; random hero

!!FU&v1=-1:E; exit if no hero present

!!HEv1:P?v8/?v9/?v10;

!!UN:Lv8/v9/v10/2000;

!!HEv1:Pv8/v9/v10;

!!OW:C?y-65;

!!IF&v9431=1:Q1/10/y-65/4^{STORM}^;

!!HEv1:B0/?z1;

!!VRy-2:S25 R20 *c;

!!VRy-1:Sy-2 :2 Ty-2;

!!VRz2:S^{STORM}

Lightnings are striking %Z1 ^;

!!VRv360:S0; initialize variable

!!FU28118:P0/y-1;

!!FU28118:P1/y-1;

!!FU28118:P2/y-1;

!!FU28118:P3/y-1;

!!FU28118:P4/y-1;

!!FU28118:P5/y-1;

!!FU28118:P6/y-1;

!!VRz2&v360=0:+^but you suffer no losses.^;

!!VRz2&v360=1:+^it looks like gods turned angry on you!^;

!!IF&v9431=0:Q1/13/3/1^%Z2^;

!?FU28118; strike hero creature x1 with x2 damage points

!!HEv1:C0/x1/?v361/?v362; [v361 = creature type, v362 = creature count]

!!FU&v361=-1|v362<=0:E; exit if no creature here

!!MA:Pv361/?v363; [v363 = signle creature hp]

!!VRv364:Sx2 :v363; [ get kill count ]

!!FU&v364<=0:E; [ exit if havent killed anything ]

!!VRv362:-v364;

!!VRv361&v362<=0:S-1;

!!VRv362&v362<=0:S0;

!!HEv1:C0/x1/v361/v362;

!!VRz2&v360=0:+^killing ^; add killing if killed something

!!VRv360:S1; set killed flag

!!UN&v364>1/v361>=0:N3/3/v361/1;

!!UN&v364=1/v361>=0:N3/3/v361/0;

!!VRz2:+^%V364 %Z3, ^;

!?TM95&v9429>=1700/v9429<1800; [ 18. out of mana ]

!!FU28101:P; random hero

!!FU&v1=-1:E; exit if no hero

!!HEv1:P?v8/?v9/?v10;

!!HEv1:Pv8/v9/v10;

!!UN:Lv8/v9/v10/2000;

!!HEv1:I0;

!!HEv1:B0/?z1;

!!OW:C?y-66;

!!IF&v9431=1:Q1/10/y-66/-1/-1/4^{OUT OF MANA}^;

!!IF&v9431=0:Q1/35/0/1^{OUT OF MANA}

%Z1 felt and hit large stone with his head. It affected all of his today concentration making %Z1 to lose all spell points.^;

!?TM95&v9429>=1600/v9429<1700; [ 17. move ]

!!FU28101:P; random hero

!!FU&v1=-1:E; exit if no hero

!!HEv1:P?v8/?v9/?v10;

!!HEv1:Pv8/v9/v10;

!!UN:Lv8/v9/v10/2000;

!!HEv1:W?y-1;

!!HEv1:Wdy-1; add 100% of move points

!!HEv1:B0/?z1;

!!OW:C?y-66;

!!IF&v9431=1:Q1/10/y-66/-1/-1/4^{MOVE IT!}^;

!!FU&v9431=1:E; exit if ai

!!IF:M^{MOVE IT!}

Your troops have received great morale watching you as great leader. %Z1 and his army can move as twice as far in this round.^;

!?TM95&v9429>=1500/v9429<1600; [ 16. mana ]

!!FU28101:P; random hero

!!FU&v1=-1:E; exit if no hero

!!HEv1:P?v8/?v9/?v10;

!!HEv1:Pv8/v9/v10;

!!UN:Lv8/v9/v10/2000;

!!HEv1:B0/?z1;

!!HEv1:Fd/d/d/?y-1;

!!HEv1:S24/?v6;

!!VRv5&v6=0:S10;

!!VRv5&v6=1:S12;

!!VRv5&v6=2:S15;

!!VRv5&v6=3:S20;

!!VRy-1:*v5;

!!HEv1:Iy-1;

!!OW:C?y-66;

!!IF&v9431=1:Q1/10/y-66/-1/-1/4^{ALCHEMIST}^;

!!IF&v9431=0:Q1/35/y-1/1^{ALCHEMIST}

%Z1 has meet an alchemist. After some kindly talk, alchemist have given you a magical potion that restored full of your mana points.^;

!?TM95&v9429>=1400/v9429<1500; [ 15. challenge ]

!!FU28101:P;

!!FU&v1=-1:E; exit if no hero

!!VRy-1:Sc;

!!FU&y-1<=20:E; exit if day <= 20

!!FU28110:P;

!!HEv1:P?v8/?v9/?v10;

!!HEv1:Pv8/v9/v10;

!!UN:Lv8/v9/v10/2000;

!!UN:N3/1/v5/0;

!!OW:A-1/v1;

!!IF&v9431=0:Q1/21/v5/1^{AVENGER}

You and your army were attacked by %Z1!^;

!!OW:C?y-66;

!!IF&v9431=1:Q1/10/y-66/-1/-1/4^{AVENGER}^;

!!VRy-5:Sv1;

!!HEv1:Tv8/v9/v10/v5/1;

!!HEy-5:O?v6;

!!FU&v6=-1:E; exit if he lost

!!VRy-1:S4 R9 *1000;

!!IF&v9431=0:Q1/6/y-1/1^{Battle Spoils}

After defeating creature, you loot from him %Y-1 gold coins!^;

!!OW:R-1/6/dy-1;

!?FU28110; create 7LVL monster

!!VRy-2:S0 R9;

!!VRy-1&y-2=0:S12; ** ange **

!!VRy-1&y-2=1:S26; ** green/gold draggy **

!!VRy-1&y-2=2:S40; ** titan **

!!VRy-1&y-2=3:S54; ** devils **

!!VRy-1&y-2=4:S68; ** bones **

!!VRy-1&y-2=5:S82; ** draggy **

!!VRy-1&y-2=6:S96; ** behe **

!!VRy-1&y-2=7:S110; ** hydre **

!!VRy-1&y-2=8:S130; ** birds **

!!VRy-1&y-2=9:S132; ** neut dragons **

!!VRy-1&y-2=9:R3;

!!VRy-1&y-2<>9:T1; ** randomly upgrade

!!VRv5:Sy-1;

!?TM95&v9429>=1300/v9429<1400; [ 14. illness ]

!!FU28101:P; select hero

!!FU&v1=-1:E; exit if no hero

!!HEv1:P?v8/?v9/?v10;

!!HEv1:Pv8/v9/v10;

!!UN:Lv8/v9/v10/2000;

!!HEv1:W0; set move to 0

!!FU&v9431=1:E;

!!HEv1:B0/?z1;

!!OW:C?y-66;

!!IF&v9431=1:Q1/10/y-66/-1/-1/4^{ILLNESS}^;

!!IF:M^{ILLNESS}

It looks like %Z1 is ill. He must rest one day and recouperate in order to walk again.^;

!?TM95&v9429>=1200/v9429<1300; [ 13. plague ]

!!FU28104:P; select castle

!!FU&v1=-1:E; exit if no castle

!!UN:Lv1/v2/v3/2000;

!!CAv1/v2/v3:N?z1;

!!IF&v9431=0:M^{PLAGUE}

The %Z1 town is under plague! All population from %Z1 is halved!^;

!!OW:C?y-66;

!!IF&v9431=1:Q1/10/y-66/-1/-1/4^{PLAGUE}^;

!!CAv1/v2/v3:M1/0/?v4/?v5;

!!VRv4: :2;

!!VRv5: :2;

!!CAv1/v2/v3:M1/0/v4/v5;

!!CAv1/v2/v3:M1/1/?v4/?v5;

!!VRv4: :2;

!!VRv5: :2;

!!CAv1/v2/v3:M1/1/v4/v5;

!!CAv1/v2/v3:M1/2/?v4/?v5;

!!VRv4: :2;

!!VRv5: :2;

!!CAv1/v2/v3:M1/2/v4/v5;

!!CAv1/v2/v3:M1/3/?v4/?v5;

!!VRv4: :2;

!!VRv5: :2;

!!CAv1/v2/v3:M1/3/v4/v5;

!!CAv1/v2/v3:M1/4/?v4/?v5;

!!VRv4: :2;

!!VRv5: :2;

!!CAv1/v2/v3:M1/4/v4/v5;

!!CAv1/v2/v3:M1/5/?v4/?v5;

!!VRv4: :2;

!!VRv5: :2;

!!CAv1/v2/v3:M1/5/v4/v5;

!!CAv1/v2/v3:M1/6/?v4/?v5;

!!VRv4: :2;

!!VRv5: :2;

!!CAv1/v2/v3:M1/6/v4/v5;

!?TM95&v9429>=1100/v9429<1200; [ 12. recruits ]

!!FU28104:P; select castle

!!FU&v1=-1:E; exit if no castle

!!VRy-1:S0 R6; set monster level

!!VRy-2:S30 +y-1; set building

!!VRv6:S1; exit = 1

!!VRv360:S0;

!!CAv1/v2/v3:B3/y-2; check if its built

!!VRv6&1:S0;

!!VRy-2:+7;

!!CAv1/v2/v3:B3/y-2; check if its built

!!VRv6&1:S0;

!!VRv360&1:S1; v7 = upgraded

!!FU&v6=1:E; exit if not built

!!VRy-5&y-1=0:S15 R15; level1: 15-30

!!VRy-5&y-1=1:S10 R15; level2: 10-25

!!VRy-5&y-1=2:S8 R10; level3: 8-18

!!VRy-5&y-1=3:S6 R6; level4: 6-12

!!VRy-5&y-1=4:S4 R6; level5: 4-10

!!VRy-5&y-1=5:S2 R4; level6: 2-6

!!VRy-5&y-1=6:S1 R2; level7: 1-3

!!CAv1/v2/v3:M1/y-1/dy-5/dy-5; add creatures

!!CAv1/v2/v3:T?y-6; get town type to y-6

!!FU&v9431=1:E; exit if ai

!!CAv1/v2/v3:N?z1; Z1 = name

!!VRv5:S-1;

!!DO28109/0/131/1:Py-6/y-1;

!!FU&v5=-1:E; exit if cannot find monster (though should be impossible)

!!VRv5&v360=0:-1;

!!UN:N3/2/v5/1; Z2 = monster name

!!UN:Lv1/v2/v3/2000;

!!OW:C?y-66;

!!IF&v9431=1:Q1/10/y-66/-1/-1/4^{RECRUITS}^;

!!IF:Q1/21/v5/1^{RECRUITS}

There are new recruits in %Z1 town! You can now recruit addtional %Y-5 %Z2 from %Z1!^;

!?FU28109; get monster from castle type (x1) and level (x2) into v5

!!MA:Lx16/?y-1;

!!MA:Ox16/?y-2;

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

!?TM95&v9429>=1000/v9429<1100; [ 11. rebellion ]

!!FU28104:P; select castle

!!FU&v1=-1:E; exit if no castle

!!VRv5:Sc;

!!FU&v5<18:E; exit if day is less than 28th

!!CAv1/v2/v3:B3/13;

!!FU&1:E; exit if he has capitol

!!UN:Lv1/v2/v3/2000;

!!OW:C?y-66;

!!IF&v9431=1:Q1/10/y-66/-1/-1/4^{REBELLION}^;

!!IF&v9431=0:M^{REBELLION}

It looks like your city is in rebellion! You are losing control of your own city!^;

!!UN:Lv1/v2/v3/500;

!!CAv1/v2/v3:O-1; release owner

!!UN:Lv1/v2/v3/1000;

!?TM95&v9429>=900/v9429<1000; [ 10. sabotage ]

!!FU28104:P; select castle

!!FU&v1=-1:E; exit if no castle

!!FU&v9431=1:E; exit if ai

!!UN:Lv1/v2/v3/2000;

!!CAv1/v2/v3:N?z1;

!!IF:V1/0;

!!VRz2:S^Assassins^;

!!UN:G1/143/1/2;

!!IF&v9431=0:Q1/6/1000/21/143/2^{ASSASSINS}

Assassins have come to %Z1 castle. They are offering you their services. They can kill some of wandering monster stack for gold. Do you want to pay them 1000 gold coins for that?^;

!!UN:G1/143/1/0;

!!FU&-1:E; exit if no

!!OW:R-1/6/?y-1;

!!IF&y-1<1000:M^You don't have enough gold!^;

!!FU&y-1<1000:E; exit if no cash

!!OW:R-1/6/d-1000; decrease gold

!!IF:M^You have paid assassins and they are ready. You must choose a wandering stack {IN THIS TURN} and Ctrl+Click them.^;

!!VRv9432:S1; set assassins

!?CM5; clicking on map

!!FU&v9432=0:E; exit if cannot assassinate

!!CM:F?y-1;

!!FU&y-1<>4:E; exit if not ctrl+click

!!CM:P?v1/?v2/?v3; get position to v1/v2/v3

!!OBv1/v2/v3:T?y-6;

!!FU&y-6<>54:E; exit if not clicked a monster

!!MOv1/v2/v3:G?y-1; get number of monsters to y-1

!!FU&y-1<=0|y-1>4000:E; exit if no monster or 4096 monsters

!!VRy-2:S40 T50; set y-2 to 40~90

!!VRy-3:S100 -y-2; set y-3 to 100-(y-2)

!!VRy-1:*y-3 :100;

!!VRy-1&y-1<=0:S1;

!!MOv1/v2/v3:G?y-4;

!!OBv1/v2/v3:U?y-5;

!!UN:N3/1/y-5/1;

!!VRy-4:-y-1;

!!IF:V1/0;

!!IF:Q1^{Assassins}

Do you want to assassinate %Z1?^;

!!FU&-1:E; exit if no

!!IF:M^{Assassins}

Good job! Now %Z1 are going down by %Y-4. You should take then down now easily!^;

!!MOv1/v2/v3:Gy-1;

!!VRv9432:S0; turn off assassination

!?TM95&v9429>=800/v9429<900; [ 09. trainer ]

!!FU28101:P;

!!FU&v1=-1:E;

!!HEv1:P?v8/?v9/?v10;

!!HEv1:Pv8/v9/v10;

!!HEv1:B0/?z1;

!!UN:Lv8/v9/v10/2000;

!!VRy-1:S1 R14 *1000;

!!IF:V1/0;

!!OW:C?y-66;

!!IF&v9431=1:Q1/10/y-66/-1/-1/4^{TRAINER}^;

!!IF&v9431=0:Q1/6/y-1/17/y-1/2^{TRAINER}

While adventuring, {%Z1} has meet a trainer. He trains heroes very rapidly, but his services cost very much. He offers you %Y-1 experience for %Y-1 gold coins. Do you want to train?^;

!!IF&v9431=1:V1/1; always yes for ai

!!FU&-1:E; exit if no

!!OW:R-1/6/?y-2; get cash

!!IF&y-2<y-1/v9431=0:M^You don't have enough gold!^;

!!FU&y-2<y-1:E; exit if no cash

!!HEv1:Edy-1; give exp

!!VRy-2:-y-1; reduce cash

!!OW:R-1/6/y-2; set cash

!?TM95&v9429>=700/v9429<800; [ 08. map ]

!!FU28104:P; [ select rnd castle ]

!!FU&v1=-1:E; [ exit if no castle ]

!!UN:Lv1/v2/v3/2000;

!!CAv1/v2/v3:N?z1;

!!UN:X?v360/?v361;

!!VRv1:S0 Rv360;

!!VRv2:S0 Rv360;

!!VRv3:S0 Tv361;

!!VRv4:S6;

!!VRv5:S2 +c;

!!VRv4:Rv5;

!!VRv5:S325 *v4 +2000;

!!IF:V1/0;

!!OW:C?y-66;

!!IF&v9431=1:Q1/10/y-66/-1/-1/4^{CARTOGRAPHER}^;

!!IF&v9431=0:Q1/6/v5/8/52/2^{CARTOGRAPHER}

An experienced Cartographer approached to {%Z1} city. He want to sell you some maps of this land, and that all for %V5 gold coins. Do you want to buy maps?^;

!!IF&v9431=1:V1/1;

!!FU&-1:E; exit if clicked no

!!OW:R-1/6/?v6;

!!IF&v6<v5/v9431=0:M^You don't have enough gold!^;

!!FU&v6<v5:E; exit if not got the cash

!!VRv6:-v5;

!!OW:R-1/6/v6; deduct cash

!!OW:C?y-2;

!!UN:Lv1/v2/v3/100; show it

!!UN:Sv1/v2/v3/y-2/v4; open area

!!UN:Lv1/v2/v3/2000; center screen and thats all

!?TM95&v9429>=600/v9429<700/v9431=0; [ 07. summoner ]

!!FU28101:P; [v1 = our random hero]

!!FU&v1=-1:E; [ exit if no hero ]

!!HEv1:P?v8/?v9/?v10;

!!HEv1:Pv8/v9/v10;

!!HEv1:B0/?z1;

!!UN:Lv8/v9/v10/2000;

!!IF:V1/0;

!!OW:C?y-66;

!!IF&v9431=1:Q1/10/y-66/-1/-1/4^{SUMMONER}^;

!!IF&v9431=0:Q1^{SUMMONER}

%Z1 meets a magic summoner. He is very kindly and he wants to make you a favor. He offers you teleport to one of your cities for free. Do you want to use his service?^;

!!VRy-1:S0 T1000;

!!IF&v9431=1/y-1<1200:V1/1;

!!FU&-1:E; exit if choosen "no"

!!OW&v9431=0:A-1/v1;

!!HEv1&v9431=0:S17/?y-2;

!!HEv1&v9431=0:S17/3; set master earth magic

!!OW&v9431=0:S1/9; cast town portal

!!HEv1&v9431=0:S17/y-2; bring his skill back

!!FU&v9431=0:E; exit if no ai

!!FU28104:P; select city

!!FU&v1=-1:E; exit if no city

!!HEv1:Pv1/v2/v3/1; tp to city

!?TM95&v9429>=500/v9429<600; [ 06. artifact ]

!!FU28101:P; [v1 = our random hero]

!?TM95&v9429>=500/v9429<600/v1<>-1; continue only if hero specified

!!VRy-1:S7 T121;

!!UN:Ay-1/3/?y-2; store art level in y-2

!!VRv5&y-2=1:S100;

!!VRv5&y-2=2:S300;

!!VRv5&y-2=4:S2500;

!!VRv5&y-2=8:S8000;

!!VRv5&y-2=16:S15000;

!!VRv6:Sv5 Rv5;

!!HEv1:B0/?z1;

!!HEv1:P?v8/?v9/?v10;

!!HEv1:Pv8/v9/v10;

!!UN:Lv8/v9/v10/2000;

!!OW:C?y-66;

!!IF&v9431=1:Q1/10/y-66/-1/-1/4^{ARTIFACT SELLER}^;

!!IF:V1/0;

!!IF&v9431=0:Q1/6/v6/8/y-1/2^{ARTIFACT SELLER}

An artifact seller comes to %Z1 hero. He wants to sell you an artifact for %V6 gold coins. Do you agree?^;

!!IF&v9431=1:V1/1;

!!FU&-1:E; exit if no

!!OW:R-1/6/?v4;

!!VRv4:-v6;

!!OW&v4>=0:R-1/6/v4;

!!HEv1&v4>=0:A4/y-1;

!!IF&v4<0/v9431=0:M^You don't have enough gold!^;

!?TM95&v9429>=400/v9429<500; [ 05. scout ]

!!FU28104:P;

!?TM95&v9429>=400/v9429<500/v1<>-1; he has city

!!CAv1/v2/v3:N?z1;

!!UN:Lv1/v2/v3/2000;

!!OW:C?y-66;

!!IF&v9431=1:Q1/10/y-66/-1/-1/4^{SCOUT}^;

!!IF:V1/0;

!!IF&v9431=0:Q1/6/4000/8/53/2^{SCOUT}

An freelancer scout comes to your town %Z1. He offers you an information about some of enemy and neutral towns for 4000 gold apiece. Do you agree?^;

!!IF&v9431=1:V1/1;

!?TM95&v9429>=400/v9429<500/v1<>-1/1;

!!OW:R-1/6/?v360;

!!VRv360:-4000;

!!OW&v360>=0:R-1/6/v360;

!!IF&v9431=0/v360<0:M^You don't have enough money!^;

!?TM95&v9429>=400/v9429<500/v1<>-1/1/v360>=0;

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

!!DO28108/1/v7/1:P;

!?TM95&v9429>=300/v9429<400; [ 04. random hero ]

!!VRv8:S-1;

!!VRv9:S-1;

!!VRv10:S-1;

!!FU28104:P;

!?TM95&v9429>=300/v9429<400/v1<>-1; if he has castle

!!OW:H-1/360/0;

!?TM95&v9429>=300/v9429<400/v1<>-1/v360<8; if he has hero-slot

!!VRv361:S0 T155;

!!HEv361:O?v362;

!?TM95&v9429>=300/v9429<400/v1<>-1/v360<8/v362=-1; if that hero is free

!!UN:Lv1/v2/v3/1000;

!!IF:V1/0;

!!HEv361:B0/?z2;

!!UN:Lv1/v2/v3/1000;

!!CAv1/v2/v3:N?z1;

!!IF&v9431=0:Q1^{HERO}

Suddenly a hero named %Z2 comes to %Z1 town. He is offering his services for you. Do you want to hire him?^;

!!IF&v9431=1:V1/1;

!?TM95&v9429>=300/v9429<400/v1<>-1/v360<8/v362=-1/1;

!!OW:C?y2;

!!VRy-1:Sv1 +1;

!!VRy1:S200 T20000;

!!VRy3:S0 R4;

!!VRy4:S0 R4;

!!VRy5:S0 R4;

!!VRy6:S0 R4;

!!VRy7:Sy1 :3000;

!!HEv361:Ey1;

!!HEv361:Fdy3/dy4/dy5/dy6;

!!HEv361:Py-1/v2/v3;

!!HEv361:Oy2;

!!VRy7:T3;

!!HEv361:Py-1/v2/v3;

!!UN:Ly-1/v2/v3/500;

!!OW:C?y-66;

!!IF&v9431=1:Q1/10/y-66/-1/-1/4^{HERO}^;

!?TM95&v9429>=200/v9429<300; [ 03. resources ]

!!FU28104:P; [ get random castle ]

!?TM95&v9429>=200/v9429<300/v1<>-1; [ if castle is present ]

!!VRy1:S0 T7;

!!VRy2:S1 T12;

!!VRy2&y1=6:*400;

!!UN:Lv1/v2/v3/2000;

!!CAv1/v2/v3:N?z1;

!!OW:C?y-66;

!!IF&v9431=1:Q1/10/y-66/-1/-1/4^{TREASURY}^;

!!IF&v9431=0/y1<>6:Q1/y1/y2/1^{TREASURY}

Your workers from %Z1 town have managed to get addtional resources.^;

!!IF&v9431=0/y1=6:Q1/y1/y2/1^{TAXES}

Your are dealing with taxes in %Z1 town, and you have earned %Y2 gold coins from that.^;

!!OW:R-1/y1/dy2;

!?TM95&v9429>=100/v9429<200; [ 02. spell ]

!!FU$spell$:P0/0/0/0/1/0; [ generate random spell ]

!!FU7779:Py-99; y-99 is spell

!!FU28101:P;

!!VRv5&y-96=1:S200;

!!VRv5&y-96=2:S600;

!!VRv5&y-96=3:S1500;

!!VRv5&y-96=4:S4000;

!!VRv5&y-96=5:S9000;

!!VRv5:Tv5; v5 is cost

!!VRv7:Sy-99;

!?TM95&v9429>=100/v9429<200/v1<>-1; if hero selected

!!VRy-99:Sv7;

!!HEv1:B0/?z1;

!!HEv1:P?v8/?v9/?v10;

!!HEv1:Pv8/v9/v10;

!!UN:Lv8/v9/v10/500;

!!UN:N1/2/y-99;

!!OW:C?y-66;

!!IF&v9431=1:Q8/10/y-66/-1/-1/4^{SCHOLAR}^;

!!IF:V1/0; clear flag

!!IF&v9431=0:Q1/6/v5/9/y-99/2^{SCHOLAR}

A scholar came to %Z1. He says that he is walking over world and teaching spells. He can teach you %Z2 spell for %V5 gold coins. Do you agree?^;

!!IF&v9431=1:V1/1;

!?TM95&v9429>=100/v9429<200/v1<>-1/1; if clicked yes

!!VRy-99:Sv7;

!!OW:R-1/6/?v6;

!!VRv7:Sv6 -v5;

!!IF&v7<0/v9431=0:M^You don't have enought money!^;

!!FU&v7<0:E;

!!HEv1&v7>=0:My-99/1;

!!OW:R-1/6/v7;

!?TM95&v9429>0/v9429<100; [ 01. troops ]

!!VRv361:S0 T173; [ generate random unit ]

!!VRv361&v361=145:S192; [ catapult ]

!!VRv361&v361=146:S193; [ ballista ]

!!VRv361&v361=147:S194; [ ammo cart ]

!!VRv361&v361=148:S195; [ arrow tower woot ]

!!VRv361&v361=149:S196; [ first aid tent ]

!!VRv361&v361=122:S192; [ placeholder ]

!!VRv361&v361=124:S194; [ placeholder ]

!!VRv361&v361=128:S196; [ placeholder ]

!!MA:Lv361/?v362; get creature level to v362

!!VRy1:Sc;

!!VRy2:Sy1 :7 +1;

!!VRy3:S7 -v362 *y2;

!!VRv363:S1 Ry3;

!?TM95&v9429>0/v9429<100; [place units to hero]

!!FU28101:P; [v1 = our random hero]

!?TM95&v9429>0/v9429<100/v1<>-1;

!!MA:Cv361/6/?y3;

!!VRv364:Sy3 *v363;

!!HEv1:P?v365/?v366/?v367;

!!HEv1:B0/?z2;

!!UN:Lv365/v366/v367/500;

!!HEv1:Pv365/v366/v367/1;

!!OW:C?y-66;

!!IF&v9431=1:Q8/10/y-66/-1/-1/4^{FREELANCERS}^;

!!UN:N3/1/v361/1;

[ cost v364 gold , deduct money, add to v1 hero creature #v361 with count v363 ]

!!IF:V1/0;

!!VRy5:S65536 *v363 +v361;

!!IF&v9431=0:Q1/6/v364/21/y5/2^{FREELANCERS}

Attention of {%Z2} was attracted with walking %V363 %Z1. They are freelancers looking for new job and would join to you for %V364 gold. Do you want to hire them?^;

!!IF&v9431=1:V1/1;

!!OW:R-1/6/?v365;

!!IF&1/v9431=0/v365<v364:M^You don't have enough gold!^;

!!VRv5:Sv365 -v364;

!!OW&1/v365>=v364:R-1/6/v5;

!!HEv1&1/v9431=0/v365=>v364:C2/v361/v363/1;

!!HEv1&1/v9431=1/v365=>v364:C2/v361/v363/0;