1、进入时不要宝石
2、
8级兵种升级不会用掉生物
3、不会花费秘银
4、升级时花费很少
5、升级时攻、防、伤、命、速、生长率提升100%
ZVSE
_WARNING_#1=IMPORTANT! This file is not in a plain text format. NEVER use any editor except
ERM_S
for making any kind of changes!
ERMS_PoweredBy=ERM Scripter v. 2003.2.18.2257
** Emerald Tower Script Version 0.2 Created by Timothy Pulver
** Requires
WoG version 3.57 or later using ERM version 2.6 or later.
** WoGify Name: script44.erm
** This script makes all green roofed towers in the game (object type 63,
** subtype 65) into Emerald Towers where the Wizard who dwells there will
** improve any creature type in your army for a price. The price is a lot of
** resources of a specific type, depending on the improvement. In addition,
** one of the creatures of the type being improved must also be left for the
** Wizard.
** The improvement number is usually a percentage of the existing score. For
** example, 50% growth bonus, or 25% attack bonus. In addition to standard
** stat improvements, new special abilities may be added. Special abilities
** all cost Mithril.
** Each Emerald Tower may only be visited once per day. A maximum of 12
** types of creatures may be improved in any game, but each creature type
** may have many improvements made to it. A creature cannot be improved
** during a "Week of" that creature type, if the "Week of Monsters" script
** is active.
------------------------------------------------------------------------
Permanent Variables: z816-z841, v1240-v1252 (not v1253--used by Garrison script))
Temporary Variables: v1-v7, v360-v369, z1-z9, z480-z490
Temporary Flags: 1-4
Functions: 10900-10911
Timers: 38
Dialogues: 3
-----------------------------------------------------------------------
[Setup]
!#VRv1240:S0; [Initialize changed species counter to 0]
!#VRz816:S^Emerald Tower
(Not Visited)^;
!#VRz817:S^Emerald Tower
(Visited)^;
!#HT63/65:P0/816;
!#HT63/65:P1/817;
!#TM38:S8/999/7/255;
-----------------------------------------------------------------------
[Timer resets the Emerald Towers' non-visited status each day]
!?TM38;
!!UN:U63/65/?v1; [Number of Emerald Towers: v1]
!!DO10910/1/v1/1&v1>0:P; [Loop through all Emerald Towers]
-----------------------------------------------------------------------
[Reset non-visited status for each Emerald Tower]
!?FU10910;
!!UN:U63/65/x16/1; [Coordinates in v1/v2/v3]
!!POv1/v2/v3:N0; [Set PO:N to 0 to reset hint text]
-----------------------------------------------------------------------
[Tower with turret is trigger]
!?OB63/65;
!!PO998:N?v1; [Check if tower has been visited this week: v1=1 if visited]
!!IF&v1=1/1000:M^{Emerald Tower}
You knock on the gate and a small gnomish man answers.
"Go away! The Wizard's busy!" shouts the rude little gnome, slamming the gate in your face.^;
[Continue object trigger if Tower hasn't been visited yet this week]
!?OB63/65&v1=0;
!!IF&1000:Q2/5/7/2^{Emerald Tower}
You knock on the gate and a small gnomish man answers.
"Do you have an appointment with the Wizard?"
A sign above the door reads:
'APPOINTMENTS WITH THE WIZARD BOOKED FOR SEVEN GEMS'
Do you book an appointment?^;
!!OW&2:R-1/5/?y1; [Player's current gem total: y1]
!!VRz9:S^^;
!!VRz9&2/y1<0:S^You don't have enough gems. No gems, no appointment. ^;
!!IF&y1<0:V2/0; [Set flag 2 to false if player doesn't have at least 7 gems]
!!OW&2:R-1/5/d-0; [Remove seven gems from player's total]
!!IF&2/1000:M^The gnomish man takes the gems, glares at you and then
ushers you inside. The enormous foyer is gloomy and full of weird
paraphernalia, spider webs, and thousands of old dusty tomes.
Before you can poke about too much, the Wizard appears, dressed in
long flowing robes.^;
!!FU10900&2:P; [Choose species to improve]
!!IF&-2/1000:M^"%Z9No appointment, no entrance!" shouts the gnome, rudely slamming the gate in
your face.^;
-----------------------------------------------------------------------
!?FU10900;
[Build a listing of different creature types in hero's army (v360-v366), v1=total number]
[Store creature names in z480-z486]
!!FU10901:P;
!!VRz1:S^"Hmmph," says the Wizard. "What species do you wish to improve?"^;
!!VRz2:S^Nothing. I've changed my mind.^;
!!IF&v1>0/1000:G1/367/0/1/480/481/482/483/484/485/486/2/0/0/0/0;
!!IF&v1=0/1000:M^"You have no creatures with you so I'm afraid I can't help you. Goodbye."^;
[Determine which box was checked - store result (creature number) in v2]
!!VRv2:S0;
!!VRv2&v367=1:Sv360;
!!VRv2&v367=2:Sv361;
!!VRv2&v367=4:Sv362;
!!VRv2&v367=8:Sv363;
!!VRv2&v367=16:Sv364;
!!VRv2&v367=32:Sv365;
!!VRv2&v367=64:Sv366;
!!VRv2&v367=128:S-1;
!!IF:V4/1; [Set flag 4 to true]
!!IF&v2=-1/1000:Q4^{The Wizard seems annoyed.}
"You don't need my services? Fine! Then go away and stop wasting my precious time!"
Do you leave the Emerald Tower?^;
[Check for "Week of Monsters" script activated and if it's the monster of the week.]
[Flag 56 will be true if script is active, v170 is monster of the week]
!!UN&v2>=0:N3/3/v2/0; [Store monster name (singular) in z3]
!!UN&v2>=0:N3/4/v2/1; [Store monster name (plural) in z4]
!!IF&56/v170>=0/v170=v2/1000:Q4/21/v2/1^{The Wizard appears agitated.}
"This is a Week of the %Z3 and that interferes with my magic. I'm unable to enchant %Z4 right
now. Return next week."
Do you leave the Emerald Tower?^;
!!VRv2&56/v170>=0/v170=v2:S-1; [Set v2 to -1]
[Check if this is a new creature (if it is and if v1240>12, set v2 to -1)]
[If this is a new creature, set v6 to -1, if not new, set v6 to loop index number]
!!VRv6:S-1;
!!DO10908/1/v1240/1&v2>=0/v1240>0:P;
!!IF&v1240>=12/v6<0/v2>=0/1000:Q4^{The Wizard looks perturbed.}
"Oh no, this won't do at all. %V1240 species have already been enchanted in this land. Any more
and the magic will become unstable and very dangerous. I will not do it! Bring me a species
already enchanted and I can safely enchant it further, but do not ask me to enchant a new one."
Do you leave the Emerald Tower?^;
!!VRv2&v1240>=12/v6<0:S-1; [Set v2 to -1 if v1240 = 12 and creature isn't new]
!!FU10902&v2>=0:P; [Display improvement options]
!!FU10900&v2=-1/-4:P; [Choose species to improve]
-----------------------------------------------------------------------
[Store unique creature numbers in v360-v366 (-1 equals no creature)]
[v1=number of unique creature numbers in hero's army]
!?FU10901;
!!VRv1:S0;
!!VRv360:C-1/-1/-1/-1/-1/-1/-1;
!!VRz480:S^^;
!!VRz481:S^^;
!!VRz482:S^^;
!!VRz483:S^^;
!!VRz484:S^^;
!!VRz485:S^^;
!!VRz486:S^^;
!!HE-1:C0/0/?y1/?y2; [Slot 0]
!!VRv1&y2>0:+1;
!!VRv360&y2>0:Sy1;
!!UN&y2>0:N3/480/y1/1;
!!HE-1:C0/1/?y1/?y2; [Slot 1]
!!VRy4:S0;
!!VRy4&v1=1/y1=v360:S99;
!!VRv1&y2>0/y4<>99:+1;
!!VRy3&y2>0/y4<>99:S359 +v1;
!!VRy5&y2>0/y4<>99:S479 +v1;
!!UN&y2>0/y4<>99:N3/y5/y1/1;
!!VRvy3&y2>0/y4<>99:Sy1;
!!HE-1:C0/2/?y1/?y2; [Slot 2]
!!VRy4:S0;
!!VRy4&v1>=1/y1=v360:S99;
!!VRy4&v1=2/y1=v361:S99;
!!VRv1&y2>0/y4<>99:+1;
!!VRy3&y2>0/y4<>99:S359 +v1;
!!VRy5&y2>0/y4<>99:S479 +v1;
!!UN&y2>0/y4<>99:N3/y5/y1/1;
!!VRvy3&y2>0/y4<>99:Sy1;
!!HE-1:C0/3/?y1/?y2; [Slot 3]
!!VRy4:S0;
!!VRy4&v1>=1/y1=v360:S99;
!!VRy4&v1>=2/y1=v361:S99;
!!VRy4&v1=3/y1=v362:S99;
!!VRv1&y2>0/y4<>99:+1;
!!VRy3&y2>0/y4<>99:S359 +v1;
!!VRy5&y2>0/y4<>99:S479 +v1;
!!UN&y2>0/y4<>99:N3/y5/y1/1;
!!VRvy3&y2>0/y4<>99:Sy1;
!!HE-1:C0/4/?y1/?y2; [Slot 4]
!!VRy4:S0;
!!VRy4&v1>=1/y1=v360:S99;
!!VRy4&v1>=2/y1=v361:S99;
!!VRy4&v1>=3/y1=v362:S99;
!!VRy4&v1=4/y1=v363:S99;
!!VRv1&y2>0/y4<>99:+1;
!!VRy3&y2>0/y4<>99:S359 +v1;
!!VRy5&y2>0/y4<>99:S479 +v1;
!!UN&y2>0/y4<>99:N3/y5/y1/1;
!!VRvy3&y2>0/y4<>99:Sy1;
!!HE-1:C0/5/?y1/?y2; [Slot 5]
!!VRy4:S0;
!!VRy4&v1>=1/y1=v360:S99;
!!VRy4&v1>=2/y1=v361:S99;
!!VRy4&v1>=3/y1=v362:S99;
!!VRy4&v1>=4/y1=v363:S99;
!!VRy4&v1=5/y1=v364:S99;
!!VRv1&y2>0/y4<>99:+1;
!!VRy3&y2>0/y4<>99:S359 +v1;
!!VRy5&y2>0/y4<>99:S479 +v1;
!!UN&y2>0/y4<>99:N3/y5/y1/1;
!!VRvy3&y2>0/y4<>99:Sy1;
!!HE-1:C0/6/?y1/?y2; [Slot 6]
!!VRy4:S0;
!!VRy4&v1>=1/y1=v360:S99;
!!VRy4&v1>=2/y1=v361:S99;
!!VRy4&v1>=3/y1=v362:S99;
!!VRy4&v1>=4/y1=v363:S99;
!!VRy4&v1>=5/y1=v364:S99;
!!VRy4&v1=6/y1=v365:S99;
!!VRv1&y2>0/y4<>99:+1;
!!VRy3&y2>0/y4<>99:S359 +v1;
!!VRy5&y2>0/y4<>99:S479 +v1;
!!UN&y2>0/y4<>99:N3/y5/y1/1;
!!VRvy3&y2>0/y4<>99:Sy1;
-----------------------------------------------------------------------
[Choose the type of improvement]
!?FU10902;
!!UN:N3/3/v2/0;
!!MA:Av2/?y1; [Calculate 25% Attack bonus: y2]
!!VRy2:Sy1 :1;
!!VRy2&y2=0:S1;
!!MA:Dv2/?y1; [Calculate 25% Defense bonus: y3]
!!VRy3:Sy1 :1;
!!VRy3&y3=0:S1;
!!MA:Ev2/?y1; [Calculate 25% Damage bonus: y4]
!!VRy4:Sy1 :1;
!!VRy4&y4=0:S1;
!!MA:Pv2/?y1; [Calculate 25% Health bonus: y5]
!!VRy5:Sy1 :1;
!!VRy5&y5=0:S1;
!!MA:Sv2/?y1; [Calculate 25% Speed bonus: y6]
!!VRy6:Sy1 :1;
!!VRy6&y6=0:S1;
!!MA:Gv2/?y1; [Calculate 50% Growth bonus: y7]
!!VRy7:Sy1 :1;
!!VRy7&y7=0:S1;
!!MA:Nv2/?y8; [Determine number of shots: y8]
!!MA:Bv2/?y10; [Determine number of spell castings: y10]
!!VRz1:S^"How would you like the %Z3 species improved?"^;
!!VRz2:S^Forget it. I've changed my mind.^;
!!VRz480:S^+%Y2 ATTACK for 0 Sulfur^;
!!VRz481:S^+%Y3 DEFENSE for 0 Ore^;
!!VRz482:S^+%Y4 DAMAGE for 0 Gems^;
!!VRz483:S^+%Y5 HEALTH for 0 Crystal^;
!!VRz484:S^+%Y6 SPEED for 0 Mercury^;
!!VRz485:S^+%Y7 GROWTH for 0 Wood^;
!!VRz486&y8<24:S^24 SHOTS for 120 Gold^;
!!VRz486|y8<1/y8>=24:S^^;
!!VRz487&y10>0:S^+1 SPELL CASTING (per combat) for 20 Mithril^;
!!VRz487|y10<1/y10>12:S^^;
!!VRz488:S^A new SPECIAL ability^;
!!IF&1000:G1/368/0/1/480/481/482/483/484/485/486/487/488/2/0/0;
[Determine which box was checked (bonus type) - store result in v3]
!!VRv3:S0;
!!VRv3&v368=1:S2;
!!VRv3&v368=2:S3;
!!VRv3&v368=4:S4;
!!VRv3&v368=8:S5;
!!VRv3&v368=16:S6;
!!VRv3&v368=32:S7;
!!VRv3&v368=64:S8;
!!VRv3&v368=128:S9;
!!VRv3&v368=256:S10;
!!VRv3&v368=512:S-1;
!!VRv5:S0;
!!FU10906&v3=10:P; [Give choice of Special Bonus]
!!VRv4:S0;
!!FU10903&v3>1:P; [Ask player to pay for Bonus: v4=1 if player pays]
!!VRy9&v3>=2/v3<=7:Syv3; [Bonus amount: y9]
!!FU10905&v4=1:Py9; [Add bonus to creature type if player paid for it]
!!VRv1240&v4=1/v6<0:+1; [Increment Changed Creature Counter if v4=1 and v6<0]
!!FU10909&v4=1:P; [Change species name to reflect ability/bonus just gained]
!!PO998&v4=1:N1; [Set hint text to "visited"]
!!IF&v3=-1/1000:Q4^{The Wizard seems annoyed.}
"You don't need my services? Fine! Then go away and stop wasting my precious time!"
Do you leave the Emerald Tower?^;
!!VRv3&v3>1/v4=0/-4:S-1; [Set v3 to -1 if player can't pay but doesn't leave]
!!FU10900&v3=-1/-4:P; [Choose species to improve]
-----------------------------------------------------------------------
[Player pays for bonus]
[v2=creature type, v3=bonus type]
!?FU10903;
[Determine resource type and cost: y1=resource type, y2=resource amount]
!!VRy1&v3=2:S3; [Attack]
!!VRy2&v3=2:S0;
!!VRz1&v3=2:S^sulfur^;
!!VRy1&v3=3:S2; [Defense]
!!VRy2&v3=3:S0;
!!VRz1&v3=3:S^ore^;
!!VRy1&v3=4:S5; [Damage]
!!VRy2&v3=4:S0;
!!VRz1&v3=4:S^gems^;
!!VRy1&v3=5:S4; [Health]
!!VRy2&v3=5:S0;
!!VRz1&v3=5:S^crystal^;
!!VRy1&v3=6:S1; [Speed]
!!VRy2&v3=6:S0;
!!VRz1&v3=6:S^mercury^;
!!VRy1&v3=7:S0; [Growth]
!!VRy2&v3=7:S0;
!!VRz1&v3=7:S^wood^;
!!VRy1&v3=8:S6; [Shots]
!!VRy2&v3=8:S120;
!!VRz1&v3=8:S^gold^;
!!VRy1&v3=9:S7; [Spells]
!!VRy2&v3=9:S0;
!!VRz1&v3=9:S^mithril^;
!!VRy1&v3=10:S7; [Special]
!!VRy2&v3=10/v5=1:S0; [Flying]
!!VRy2&v3=10/v5=2:S0; [Extended Attack]
!!VRy2&v3=10/v5=3:S0; [Undead]
!!VRy2&v3=10/v5=4:S0; [No Morale]
!!VRy2&v3=10/v5=5:S0; [Two Attacks]
!!VRy2&v3=10/v5=6:S0; [Attack All Adjacent]
!!VRy2&v3=10/v5=7:S0; [No Retaliation]
!!VRy2&v3=10/v5=8:S0; [Immune to Mind Spells]
!!VRy2&v3=10/v5=9:S0; [Immune to Fire Spells]
!!VRy2&v3=10/v5=10:S0; [No Close Combat Penalty]
!!VRz1&v3=10:S^mithril^;
!!IF:V4/1; [Set flag 4 to true]
!!OW:R-1/y1/?y3; [Check if player can afford resource cost: y3=player's amount of resource]
!!IF&y2>y3/1000:Q4/y1/y2/2^{The Wizard seems annoyed.}
"You don't have enough %Z1. Go away and stop wasting my time!"
Do you leave the Emerald Tower?^;
[Calculate number of creatures that must be left: y7]
!!MA:Lv2/?y6; [Level of creature: y6]
!!VRy7&y6=0:S64;
!!VRy7&y6=1:S32;
!!VRy7&y6=2:S16;
!!VRy7&y6=3:S8;
!!VRy7&y6=4:S4;
!!VRy7&y6=5:S2;
!!VRy7&y6>=6:S1;
!!VRy7|v2=56/v2=57:S128;
!!VRz8&y7=1:Sz3; [One]
!!VRz8&y7>1:Sz4; [More than one]
!!VRz9&y7=1:S^s^; [One]
!!VRz9&y7>1:S^^; [More than one]
!!IF:V3/0;
!!VRy5:S65536 *y7; [Set number text for creature picture]
!!VRy5:+v2; [Set number text for creature picture]
!!IF&y3>=y2/1000:Q3/21/y5/2^"In addition to the %Y2 %Z1, I'll need %Y7 %Z8 for the magic ritual.
The %Z8 won't be returning to your army after."
"Agreed?"^;
!!VRv3&-3/y3>=y2:S-1; [If the player doesn't agree, set v3 to -1]
!!VRv7:S0;
!!DO10904/0/6/1&3:P; [See if hero has enough creatures of the type to be enchanted]
!!DO10911/0/6/1&v7>=y7/3:P0; [Remove the creatures (if enough)]
!!IF&v7<y7/3:Q4/21/y5/2^{The Wizard seems irritated.}
"This just isn't enough. I must have %Y7 of your %Z4 to complete the ritual. Now go away and stop
wasting my time or I'll turn you all into warty old toads!"
Do you leave the Emerald Tower?^; [If not enough creatures, display this]
!!UN&3:N3/4/v2/1;
!!IF&3/v7>=y7/1000:Q1/21/y5/y1/y2/1^The gnome takes your payment of %Y2 %Z1 and leads %Y7 of your
%Z4 away down a dark hallway. The %Z8 turn%Z9 to look at you with frightened eyes and whimper%Z9
softly before vanishing from sight into the gloomy depths of the sorcerer's lair.
"You can leave now," says the Wizard, brusquely. "The enchantment will be completed shortly."^;
!!VRy4&3/v7>=y7:Sy3 -y2; [y4 = player's new amount of resource after payment]
!!OW&3/v7>=y7:R-1/y1/y4; [Set player's resource amount to y4]
!!VRv4&3/v7>=y7:S1; [Set v4 to 1 to indicate the bonus should be given]
-----------------------------------------------------------------------
[Check if hero has enough creatures of specified type for "payment"]
[v2=creature type, x16=slot number]
[At end of loop, v7=total creatures of type v2 in hero's army]
!?FU10904;
!!HE-1:C0/x16/?y1/?y2; [y1=type, y2=number]
!!VRv7&y1=v2/y2>0:+y2; [Add number of creatures of right type in slot to v7 total]
-----------------------------------------------------------------------
[Add bonus to creature type]
[v2=creature type, v3=bonus type, x1=bonus amount]
!?FU10905;
!!MA&v3=2:Av2/dx1; [Attack bonus]
!!MA&v3=3:Dv2/dx1; [Defense bonus]
!!MA&v3=4:Ev2/dx1; [Damage high bonus]
!!MA&v3=4:Mv2/dx1; [Damage low bonus]
!!MA&v3=5:Pv2/dx1; [Health bonus]
!!MA&v3=6:Sv2/dx1; [Speed bonus]
!!MA&v3=7:Gv2/dx1; [Growth bonus]
!!MA&v3=8:Nv2/24; [Shots bonus]
!!MA&v3=9:Bv2/d1; [Spell casting bonus]
!!FU10907&v3=10:P; [Special]
-----------------------------------------------------------------------
[Choose Special Ability: v2=creature number]
!?FU10906;
!!VRz480:S^^; !!VRz481:S^^; !!VRz482:S^^; !!VRz483:S^^; !!VRz484:S^^;
!!VRz485:S^^; !!VRz486:S^^; !!VRz487:S^^; !!VRz488:S^^; !!VRz489:S^^; !!VRz490:S^^;
!!MA:Xv2/?v369; [Existing special abilities of monster v2: v369]
!!VRy1:Sv369; [Flying]
!!VRy1:&2;
!!VRz480&y1=0:S^Ignore Obstacles (Flying) for 25 Mithril^;
!!VRz480&y1=2:S^^;
!!VRy1:Sv369; [Extended Attack]
!!VRy1:&8;
!!VRz481&y1=0:S^Extended 2-hex Attack Depth (Breath attack) for 15 Mithril^;
!!VRz481&y1=8:S^^;
!!VRy1:Sv369; [Undead]
!!VRy1:&262144;
!!VRz482&y1=0:S^Undead for 20 Mithril^;
!!VRz482&y1=262144:S^^;
!!VRy1:Sv369; [No Morale]
!!VRy1:&131072;
!!VRz483&y1=0:S^Unaffected by Morale for 15 Mithril^;
!!VRz483&y1=131072:S^^;
!!VRy1:Sv369; [Two Attacks]
!!VRy1:&32768;
!!VRz484&y1=0:S^Two Attacks for 30 Mithril^;
!!VRz484&y1=32768:S^^;
!!VRy1:Sv369; [Attack All Adjacent]
!!VRy1:&524288;
!!VRz485&y1=0:S^Attack all Adjacent Creatures for 25 Mithril^;
!!VRz485&y1=524288:S^^;
!!VRy1:Sv369; [No Retaliation]
!!VRy1:&65536;
!!VRz486&y1=0:S^No Retaliation for 25 Mithril^;
!!VRz486&y1=65536:S^^;
!!VRy1:Sv369; [Immune to Mind Spells]
!!VRy1:&1024;
!!VRz487&y1=0:S^Immune to Mind Spells for 20 Mithril^;
!!VRz487&y1=1024:S^^;
!!VRy1:Sv369; [Immune to Fire Spells]
!!VRy1:&16384;
!!VRz488&y1=0:S^Immune to Fire Spells for 15 Mithril^;
!!VRz488&y1=16384:S^^;
!!VRy1:Sv369; [No Close Combat Penalty]
!!VRy2:Sv369;
!!VRy1:&4096; (Check No Close Combat Penalty)
!!VRy2:&4; (Check Shooter)
!!VRz489&y1=0/y2=4:S^No Close Combat Penalty for 15 Mithril^;
!!VRz489|y1=4096/y2=0:S^^;
!!VRz1:S^"What new ability do you wish to bestow upon %Z4?"^;
!!VRz2:S^Forget it. I've changed my mind.^;
!!IF&1000:G1/368/0/1/480/481/482/483/484/485/486/487/488/489/2/0;
[Determine which box was checked - store result in v5]
!!VRv5:S0;
!!VRv5&v368=1:S1;
!!VRv5&v368=2:S2;
!!VRv5&v368=4:S3;
!!VRv5&v368=8:S4;
!!VRv5&v368=16:S5;
!!VRv5&v368=32:S6;
!!VRv5&v368=64:S7;
!!VRv5&v368=128:S8;
!!VRv5&v368=256:S9;
!!VRv5&v368=512:S10;
!!VRv5&v368=1024:S-1;
!!VRv3&v5=-1:S-1; [If player changes his or her mind, set v3 to -1]
-----------------------------------------------------------------------
[Add Special Ability: v2=creature number, v5=bonus number]
!?FU10907;
!!MA&v5=1:Xv2/d2; [Add Flying]
!!MA&v5=2:Xv2/d8; [Add Extended Attack]
!!MA&v5=3:Xv2/d262144; [Add Undead]
!!MA&v5=4:Xv2/d131072; [Add Unaffected by Morale]
!!MA&v5=5:Xv2/d32768; [Add Two Attacks]
!!MA&v5=6:Xv2/d524288; [Add Attack All Adjacent]
!!MA&v5=7:Xv2/d65536; [Add No Retaliation]
!!MA&v5=8:Xv2/d1024; [Add Immunity to Mind Spells]
!!MA&v5=9:Xv2/d16384; [Add Immunity to Fire Spells]
!!MA&v5=10:Xv2/d4096; [Add No Close Combat Penalty]
-----------------------------------------------------------------------
[Check if this is a new creature species to be enchanted]
[If new, v6=-1, if not new, set v6 to loop index number (x16)]
!?FU10908;
!!VRy1:S1240 +x16; [Index of v variable, holding creature numbers]
!!VRv6&vy1=v2:Sx16; [If not new, set v6 to loop index number (x16)]
!!VRx16&vy1=v2:S99; [If not new, exit loop]
-----------------------------------------------------------------------
[Change species name to reflect ability or bonus just gained]
[v2=creature number, v3=standard bonus type, v5=special bonus type (if v3=10 or v5>0)]
[v6=loop index number, v1240=changed creature counter]
!?FU10909;
!!VRy1:S1 R2; [y1=random number from 1 to 3]
!!UN:G1/v2/0/0; [Restore original singular name of species]
!!UN:G1/v2/1/0; [Restore original plural name of species]
[If a new species, store creature number in v(1240+v1240)]
!!VRy4:S1240 +v1240;
!!VRvy4&v6<0:Sv2;
[Set index number for singular name z variable (y2) and plural name z variable (y3)]
!!VRy2&v6<0:Sv1240 *2;
!!VRy2&v6>0:Sv6 *2;
!!VRy2:+816;
!!VRy3:Sy2 +1;
[Store standard singular species name in z6 variable, plural in z7]
!!UN:N3/6/v2/0;
!!UN:N3/7/v2/1;
[Generate descriptor word to preface name: z5]
!!VRz5&v3=2/y1=1:S^Mean^; [Attack]
!!VRz5&v3=2/y1=2:S^Mighty^;
!!VRz5&v3=2/y1=3:S^Fierce^;
!!VRz5&v3=3/y1=1:S^Thick-skinned^; [Defense]
!!VRz5&v3=3/y1=2:S^Steadfast^;
!!VRz5&v3=3/y1=3:S^Toughened^;
!!VRz5&v3=4/y1=1:S^Sharp and Pointy^; [Damage]
!!VRz5&v3=4/y1=2:S^Powerful^;
!!VRz5&v3=4/y1=3:S^Dangerous^;
!!VRz5&v3=5/y1=1:S^Bulky^; [Health]
!!VRz5&v3=5/y1=2:S^Sturdy^;
!!VRz5&v3=5/y1=3:S^Reinforced^;
!!VRz5&v3=6/y1=1:S^Speedy^; [Speed]
!!VRz5&v3=6/y1=2:S^Fast^;
!!VRz5&v3=6/y1=3:S^Quick^;
!!VRz5&v3=7/y1=1:S^Fertile^; [Growth]
!!VRz5&v3=7/y1=2:S^Prolific^;
!!VRz5&v3=7/y1=3:S^Promiscuous^;
!!VRz5&v3=8/y1=1:S^Loaded^; [Shots]
!!VRz5&v3=8/y1=2:S^Well-stocked^;
!!VRz5&v3=8/y1=3:S^Energized^;
!!VRz5&v3=9/y1=1:S^Enchanted^; [Spells]
!!VRz5&v3=9/y1=2:S^Magical^;
!!VRz5&v3=9/y1=3:S^Mystical^;
!!VRz5&v5=1/y1=1:S^Floating^; [Flying]
!!VRz5&v5=1/y1=2:S^Airborne^;
!!VRz5&v5=1/y1=3:S^Flying^;
!!VRz5&v5=2/y1=1:S^Garlic Breath^; [Extended Attack]
!!VRz5&v5=2/y1=2:S^Bad Breath^;
!!VRz5&v5=2/y1=3:S^Dragon Breath^;
!!VRz5&v5=3/y1=1:S^Dead^; [Undead]
!!VRz5&v5=3/y1=2:S^Undead^;
!!VRz5&v5=3/y1=3:S^Soulless^;
!!VRz5&v5=4/y1=1:S^Unflappable^; [No Morale]
!!VRz5&v5=4/y1=2:S^Stoic^;
!!VRz5&v5=4/y1=3:S^Imperturbable^;
!!VRz5&v5=5/y1=1:S^Energetic^; [Two Attacks]
!!VRz5&v5=5/y1=2:S^Furious^;
!!VRz5&v5=5/y1=3:S^Frenzied^;
!!VRz5&v5=6/y1=1:S^Snappy^; [Attack All Adjacent]
!!VRz5&v5=6/y1=2:S^Deadly^;
!!VRz5&v5=6/y1=3:S^Ferocious^;
!!VRz5&v5=7/y1=1:S^Vicious^; [No Retaliation]
!!VRz5&v5=7/y1=2:S^Overwhelming^;
!!VRz5&v5=7/y1=3:S^Savage^;
!!VRz5&v5=8/y1=1:S^Stubborn^; [Immune to Mind Spells]
!!VRz5&v5=8/y1=2:S^Strong-willed^;
!!VRz5&v5=8/y1=3:S^Strong-minded^;
!!VRz5&v5=9/y1=1:S^Soggy^; [Immune to Fire Spells]
!!VRz5&v5=9/y1=2:S^Non-Combustible^;
!!VRz5&v5=9/y1=3:S^Fire Resistant^;
!!VRz5&v5=10/y1=1:S^Fist Fighting^; [No Close Combat Penalty]
!!VRz5&v5=10/y1=2:S^Brawling^;
!!VRz5&v5=10/y1=3:S^Sparring^;
[Set new names for species]
!!VRzy2:S^%Z5 %Z6^; [Singular]
!!UN:G1/v2/0/y2;
!!VRzy3:S^%Z5 %Z7^; [Plural]
!!UN:G1/v2/1/y3;
-----------------------------------------------------------------------
[Remove creatures of specified type from hero's army for "payment"]
[v2=creature type, x1=number of creatures needed, x16=slot number]
!?FU10911;
!!HE-1:C0/x16/?y1/?y2; [y1=type, y2=number]
!!HE-1&y1=v2/y2>0/y2<=x1:C0/x16/-1/0; [Remove entire stack if less than or equal to # needed]
!!VRy4&y1=v2/y2>0/y2<=x1:Sx1 -y2; [Reduce x1 (y4) by amount in stack]
!!VRy3&y1=v2/y2>x1:Sx1 *-1; [Store negative value of x1 in y3]
!!HE-1&y1=v2/y2>x1:C0/x16/d/dy3; [Remove x1 (y3) troops from stack if more than # needed]
!!VRy4&y1=v2/y2>x1:S0; [Reduce x1 (y4) to 0]
!!VRx1&y1=v2/y2>0:Sy4; [Set x1 to y4]
** End of Script **