Everything past and including the '-Start of Equipment-' variable is Dangerous Stuff. Randomly editing them without understanding how it works can screw up your save. Back up your save file before trying to edit items or modify variables that have names that end with (No Equip).

You've been warned. I know you have, since you just read this line.

------------

This is a modified version of Dave Melanson's UGE module. I've included his readme.txt, since everything he wrote about his findings is still applicable, except where I've specifically noted.

I got this particular module a few years ago, and upon finding fan pages about Castle of the Winds(and learning it was now freely distributed), I spent about 4 days updating the documentation on what I'd already added, and adding more advanced features for items and gold modification that use inventory conditions to meet the need of it being consistently in the same place in the save, and easy to edit(once you understand the basics).


Additions I've made range from as benign as a set of missed location-on-level fields and text added to value names, to several item editing values with several pages of instructions and data tables with warnings strewn across them, and huge monster lists in a seperate file(castlist.txt) that have been assembled to meet my own personal whims of cheating.

------------

Long Descriptions for the seriously involved(A.K.A. all 5 people who're interested)

One variable to note is 'Normal Damage Res.'. It allows you to cut the damage down from all attacks not listed as other types of resistances. It appears to be either an addition that wasn't liked, or a cheating device used by the programmers. Look under the 'Item Effect #:' header, number 42, and you'll see the correct name of the resistance(It's not shown in the resistances window). This means whether it's a boulder or a rat bite, you're protected. Setting it to 999 makes you virtually invincible.

Resistances can go basically as high as you want, with the possibility of increasingly smaller amounts of protection that don't show up. Some of these resistances don't show up on the Attributes screen, but are valid simply because I've tested them or they have correlating Item Status modifiers. Negative numbers in a resistance slot makes you Vulnerable to equivalent degrees that positive numbers make you resistant.

------------

Beaten Castle 1(0/2):
This lets you enable yourself to load a Castle of the Winds 1 game as is, without actually beating it. For an extra-serious challange, start a new game with Castle 1 on expert, and immediately import it to Castle 2. No 6 levels at the start to help you on expert, and not even an Amulet of Kings for protection, with 1500 gold in a purse. Hard.

------------

Speed:
Complex system.
'Speed ???% / ...%':
This is the exact number shown before the % sign. 350% is 350% better speed. It is the value effected by 'Enchanted Boots of Speed'.
Higher values give Higher speed, and Lower values give Lower speed.

'Speed ...%/(PREV/x%)':
The calculation used with this one is 'Speed ???% / ...%' divided by (input / 100), or the numerical form of the percentage entered. Can't be 0.
Lower values give Higher speed, and Higher values give Lower speed.

'Speed ...%/(200%-x%)':
This is the raw numerical form of the second speed variable. Probably calculated from your weight. Higher values give Higher speed, and Lower values give Lower speed.

The sequence:
-1
1
-1
should give you more speed than you'll need, and about as much as you can get.
10 spaces a second.

100
100
50
is default.

Picking up or dropping items will recalculate the third value.

------------

'Intro Text (0/1)' through 'Lifthransir's Final'
'C1 *':
Setting these to 1 will enable the Castle of the Winds 1 dialogues of similar names.

The ones that don't start with 'C1' are Castle of the Winds 2 dialogues.

Reading 'C1 End Game Message' will be finish the game there, and let you save and import it into Castle of the Winds 2.

Reading 'Lifthransir's Final' will finish Castle of the Winds 2, as though you completed the game.

------------

Spells may be set to a cost of below -2, or above -1 to enable them to be cast. Setting a spell to 0 makes it free. Setting it to below -2 makes you gain that much mana for casting the spell.

------------

Everything past and including the '-Start of Equipment-' variable is Dangerous Stuff. Randomly editing without understanding how it works can screw up your save.
________________

(No Equip):
By No Equip, I mean you must be carring Absolutely NOTHING when you save. You can leave all the stuff in a pack in it, but you must put everything on the inventory screen equipment blocks on the floor before you can edit the following stats.

You should back up your game if you tend to be absent-minded about such rules, because editing random equipped-item data may cause the save to be ruined.

Room #(No Equip):
This is the room you will load up in. See Castlist.txt for the list of rooms for both games. Starting from the town, and using this to go to the bottom room, then using Rune of Return to get back to the top of the dungeon will greatly speed up the quest, because you can use Rune of Return again to go back to the level you switched to once you've reclaimed your equipment from the town.

Bank Gold(No Equip):
This is the gold you have, but don't need to carry. Set it to -1, and you can clean out all the stores indefinitely. As long as you don't add gold to the bank, it'll be nearly impossible to accidentally run out over the course of both games, even if you clear out all the stores every time you return to the town.

Difficulty(No Equip):
Simply allows you edit the difficulty of the game, and probably the amount of hit points for newly spawned enemies.

0-Easy
1-Medium
2-Difficult
3-Experts Only

________________

Item modification instructions:

All item modification variables start with an asterisk (*).
The (No Equip) variables overlap these addresses, because they are used in a completely different manner.

First, back up your game. Castle of the Winds 1 and 2 are very picky about items, and you can sometimes kill your save with the slip of a finger when editing items, or if you don't have a firm grasp of the item mechanics.

Next, get somewhere you'll be safe without any equipment on.(this could be in the middle of a pack of monsters if you're strong enough)

Put all equipment that's in a slot on the Inventory screen on the Floor, except for either a Pack or an item with at least 1 special effect. (All enchanted items and most cursed/uncursed items have a special effect)

If you want to edit a pack, empty out the pack, or just use an empty pack/bag as the one you want modified.

Leave the item you want to edit in your free hand.

Save the game.

Use the Castle.mdl module to edit the game you just saved.

Important:
1. Packs don't use any variable with the word 'Effect' in it's name.
2. Don't edit any variables with 'Pack' in the name if you're not editing a Pack.

See the following sections for information on the procedures and variables, so you'll have the greatest chance of success at item editing.

Once you've modified an item to your liking, reload the save.

If Castle of the Winds crashes, restart it and try to load the game again. If it still crashes, you probably messed up the editing, and should restore the backup you made.

-------------------------------------------------

Before I get into anything else, I'm going to explain the
'**Item Copy Value'
(because it just seems tempting to use it without understanding the risks)

Less risky, more tedious procedure, 1 item at a time:
If you enable Bit 4 of an Item, you will be able to copy that item by moving it to the floor, but each item copied should be repaired before being used. The '**Item Copy Value' is the original number that will be decremented when you start pulling duplicates out.

If you intend to make copies of an item, record the value in '**Item Copy Value', enable Bit 4 in the item's status, pull off as many copies as you want with a value of 1 each, then repair your now-broken Weight and Bulk.

For the original, and each copy, you'll need to make that item the only one in your inventory, save, put in the original value, remove bit 4 from the item's status, load, and reconfigure your inventory with a new item to repair.

Obviously, you won't want to copy everything, but rare items, or 1-of-a-kind items are good subjects, like the amulet of kings, or the helm of storms.
--
The easy, but crashy way to copy packs full of items:
Note that it's possible to copy Packs with their contents.

If you intend to use this method, record the original pack's '**Item Copy Value' just in case, so you don't lose anything, or empty the pack when you're done and get rid of it in the junk store.

I note that packs should be empty before you edit their stats, and I stick to that, but filling up a pack with stuff you want and dragging the spare, broken packs to the floor so they can be be emptied into a different pack(or the ground) over and over is fine. Do so at the junk store, selling the copied packs, and you won't need to be bothered with repairing any packs, except the original. Packs with fixed weight and bulk as the pack to be copied, and the pack the items are moved to, can stave off the Weight and Bulk being broken until you've got as many of the items as you want.

If you use a pack with a Max Weight of 99999999, you're pretty much assured of the procedure working.

Duplicate your packs using a value of 9, even if the number it shows you taking out is negative. If you end up trying to move the pack to the Junk Store, and it shows 0 to move, reload, and use 99 instead. If the problem persists, you must be trying to copy a LOT of bulky damn stuff.

If the name of the pack gets glitchy, just empty it out into your storage pack, sell the original and all the copied packs to the junk store, and replace the pack.

A strange thing happens to the packs in the root level of a pack you copy. Until you save and reload, the packs reference the same exact place, so you can add or remove items from 1 pack, and the copies have the same items added or removed. This caused the game to crash for me when I tried to leave the town, but when I saved and quit, then reloaded, the packs were unique with their own item space and copies of all the items, and copies of the pack.

Once you've got enough stuff, remove everything but the original pack(if you still have it), and repair the pack values with the original pack value you recorded.

If you save and re-load a save without exiting the program, or try to go to a different screen, the game will sometimes crash, but just restarting the program will fix the problem.

-------------------------------------------------

Item Status:

For non-pack items(broken packs/belts are still packs):
0-Unidentified, normal
1-normal
2-Unidentified, enchanted
3-enchanted
4-Unidentified, cursed
5-cursed
6-Unidentified, Uncursed(Unused value, but still works)
7-Uncursed

For Pack-type items(All Packs, Bags, and Belts, including broken ones):
These values can be set both in Castle of the Winds 1 and 2, allowing for the ultimate pack of holding to be made out of any pack or bag.

129-This makes the pack normal
145-This gives a pack Fixed Weight, which no item naturally has alone
161-This gives a pack Fixed Bulk, like chests have
177-This gives a pack Fixed Weight and Fixed Bulk. These pack can be nested
179-This gives a pack Fixed Weight and Fixed Bulk, and makes it enchanted

In windows calculator(scientific mode, Bin), you type byte 8 first, byte 1 last.
You can also add up the numbers in the 128, 64, etc column to get a decimal number to be put in the '*Item Status' address.

Bit 8 (128) = Is a Pack (For packs/bags/belts/purse ONLY)
Bit 7  (64) = Is a Belt, Don't bother changing this, it'll be buggy
Bit 6  (32) = Use Fixed Bulk pack value (For packs/bags/belts/purse ONLY)
Bit 5  (16) = Use Fixed Weight pack value (For packs/bags/belts/purse ONLY)
Bit 4   (8) = Is Copper/Silver/Gold/Platinum. Only change for Item Copying.
Bit 3   (4) = Cursed/Uncursed (If Bit 3 and Bit 2 are set, it's Uncursed)
Bit 2   (2) = Enchanted/Uncursed (If Bit 3 and Bit 2 are set, it's Uncursed)
Bit 1   (1) = Identified

Example values:
Identified Enchanted pack that uses Fixed Weight and Bulk: 179 (10110011)
Identified Enchanted item: 3 (00000011)

-------------------------------------------------

Wand Charges(65532):
This can edit the number of charges a wand or a staff has.

Take the number of charges you want to have(up to 16383), multiply it by 4, and set that as the number in '*Wand Charges(65532)'.

65532 gives 16383 charges

-------------------------------------------------

Effect Act. Capable:
This determines if the item can even be activated. Weapons tend to have a default value of 131.

84-Potions/Scrolls, 1 Activation(Better to use rings for more fancy effects)
100-Wands/Staffs, Limited Activation(Makes it a "Charged Object", which can't be named)

131=For status changing attributes, or no attributes.
134=Infinite item activations, including for wands/staffs/potions/scrolls
135?

-------------------------------------------------

Effect # Act. Type:
This determines how an item gets activated.

4-When Weilded(For only some of the status effects, mapping levels won't work well with this)
12-When Weilded(For only some of the status effects, mapping levels won't work well with this)
16-When Activated(Should work for anything, such as learning spells, more resitant to X thing, Mapping Levels, etc.)
80-When Activated(Once every X hours, edit '*Effect # Hours')

-------------------------------------------------

Effect # Power Lvl.:
Level of power for Item Effects(Ex. Map Quadrant vs. Map Level) and what spell is cast using items.

100 is generally a decent number, unless you're looking for a specific effect, like for summoning a specific monster.

-------------------------------------------------

Effect # Hours:
This is the number of hours you have to wait between activations of an object's ability.

Multiply the number of hours you want by 4(Up to 16383), and enter it there.
65532 gives 16383 charges

The number is only used if '*Effect # Act. Type' is 80.

-------------------------------------------------

Item Effect #:
Not all items or weapons have 3 different effects, some even have 4.
If you want 3 item effects, get something that already has 3 item effects. If you want 1 item effect, use an item with 1 effect on it already, like a cape, bracers, or gauntlets. Since Enchanted Capes of Protection seem readily available, you should edit a cape, and name it something distinguishable, like Cape of Mapping for a level mapping cape. Rings also seem good candidates, since you can wear 2 of them.

If you make 2 effects on an item capable of being activated, both will be activated when the item is.

Some items have Item Effects of a null type, like wool cloaks having 56, which is labeled as 'none'. These items can be edited to have an effect, despite not having one normally.

Castle of the Winds 1 & 2 list:

Positive Effects:
0-No effect
1-increases the character's chance to hit
   0-9: 'Increases', 10-14: Strongly, 15-?: Very Strongly
2-increases the character's damage
3-increases the character's armor value
4-increases the character's Strength
5-increases the character's Intelligence
6-increases the character's Constitution
7-increases the character's Dexterity
8-9: none
10-increases the characters hit points
11-increases the characters Level
12-34: none
35-Makes the character resistant to Fire
36-Makes the character resistant to Cold
37-Makes the character resistant to Lightning
38-Makes the character resistant to Acid
39-Makes the character resistant to Fear
40-Makes the character resistant to Drain Life
41-Makes the character resistant to Confusion
42-Makes the character resistant to Normal Damage
43-Makes the character resistant to poison
44-Makes the character resistant to disease
45-Makes the character resistant to magic
46-56: none
(57-Bad)
58=Map Quadrant/Floor(If '*Effect # Power Lvl.' isn't 1, Map Floor. Remember to set both 'Act.' values, or you'll either be unable to activate it, or it will have no effect)
59-none
60-Makes character Faster(Used with Boots of Speed)
61-none
62-Makes character Levitate
63-91: none
92-casts Detect Objects, when activated
93-casts Detect Monsters(when activated, permanant effect...perhaps, Detect Mons. Helm.)
94-none
95-casts Detect Traps, when activated
96-99: none
100-Casts 'Heal x Wounds','*Effect Power Lvl.' determines the amount healed. 
     Power Level: 0-20: Minor, 21-40: Medium, 41-60: Major, 61-99: 'Healing', 100: All(no spell counterpart)
101-102: none
103-Gain a level permanantly
104-Learn X Spell(Power Level affects what spell, used by Spellbooks)
105-Cast X Spell(Power Level affects what spell, used by Scolls)
106-109: none
110-Restores your Strength
111-Restores your Intelligence
112-Restores your Constitution
113-Restores your Dexterity
114-Restores X amount of Mana
     Power Level: 0-40: a Medium, 41-60: a Large, 61-99: a Very Large, 100: All
115-Restores temporarily drained statistics(Potion of Restoration)
116-119: none
120-Neutralize Poison
121-123: none
124-When activated, summons a monster(Summons monster of choice. Set '*Effect # Sum. Mons.', see CastList.txt for list of values)
125-When activated, summons an undead monster
126-When activated, creates a return field around the player(Rune of Return)
127-129: none
130-Enchanted Against Electrically Based Monsters(Effect Power Lvl. = "1")
131-Enchanted Against Magic Using Monsters(Effect Power Lvl. = "1")
132-Enchanted Against Giants(Effect Power Lvl. = "1")
133-Enchanted Against Dragons(Effect Power Lvl. = "1")
134-Enchanted Against Elementals(Effect Power Lvl. = "1")
135-150: none

Negative Effects:
57-Makes the character much heavier

-------------------------------------------------

Spell Slot Modifier Values are used for changing spells with item effects 104 & 105
Create Traps, Haste Monster, Teleport Away and Clone Monster can be equipped to an item for the ability to use the spell at will by activating the item.

Putting the items in a belt on the belt slot allows you to activate any item in the belt without the item getting in the way of your equipment, like a scroll or potion that's been modified to never run out, and always give the desired effect.

-------------------------------------------------
Spell Slot Modifier Values(Also used for changing spells with item effect 104 & 105)
0-Heal Minor Wounds
1-Detect Objects
2-Light
3-Magic Arrow
4-Phase Door
5-Shield
6-Clairvoyance
7-Cold Bolt
8-Detect Monsters
9-Detect Traps
10-Identify
11-Levitation
12-Neutralize Poison
13-Cold Ball
14-Heal Medium Wounds
15-Fire Bolt
16-Lightning Bolt
17-Remove Curse
18-Resist Fire
19-Resist Cold
20-Resist Lightning
21-Resist Acid
22-Resist Fear
23-Sleep Monster
24-Slow Monster
25-Teleport
26-Rune of Return
27-Heal Major Wounds
28-Fireball
29-Ball Lightning
30-Healing
31-Transmogrify Monster
32-Create Traps(Must use UGE to put this in the spell menu to use it)
33-Haste Monster(Must use UGE to put this in the spell menu to use it)
34-Teleport Away(Must use UGE to put this in the spell menu to use it)
35-Clone Monster(Must use UGE to put this in the spell menu to use it)

-------------------------------------------------

Item Class, Item Subclass:

This defines what the item actually is, and defines unspecified item stats, like weight and bulk, among other things.

This has only been significantly tested by me in Castle of the Winds 2 saves, but everything on this list I've tried so far has worked in Castle of the Winds 1 saves.

I ripped off a pre-made list from
http://wind.prohosting.com/cotwrpg/cheats.html
and completed it using Castle of the Winds 2 saves.
I also fixes some names by removing phrases that are dependant on other variables, such as Enchanted, and 0 charges.

It's so much easier to take some of the grunt work someone else has done.

When dealing with Weapons and helmets, this changes the actual item type. When dealing with potions and such, you only change the name and the icon.

Only change an Item Subclass to another Item Subclass within the same Item Class. When you're dealing with a piece of equipment that has no special properties, you may be able to get away with changing it to another class of equipment, but I wouldn't make a habit of it.

Changing the Subclass of a pack has no real effect, but turning a 'Small Pack' with the ultimate pack setup into a 'Large Pack of Holding' does make it hard to lose in a mess of small packs.

Also, if you change the '*Item Subclass' value on a Helm of Storms to 7, then you can grab all your items, use Rune of Return to go back to the surface, drop your items and change the helmet's '*Item Subclass' value back to 8, and not have anything bad happen. Combined with the ability to warp to rooms so that Rune of Return can move you to the bottom level easily, you can make short work of this game in any number of ways.



The list of items is so large that I've decided to move the complete list to castlist.txt. Item Classes that can be consistenly useful are still listed here too.

Item Class value, Item Subclass value, Item Name

Note: This will change the item stats and strength
06 00 Broken Sword
06 01 Club
06 02 Dagger
06 03 Hammer
06 04 Hand Axe
06 05 Quarter Staff
06 06 Spear
06 07 Short Sword
06 08 Mace
06 09 Flail
06 10 Axe
06 11 War Hammer
06 12 Long Sword
06 13 Battle Axe
06 14 Broad Sword
06 15 Morning Star
06 16 Bastard Sword
06 17 Two Handed Sword

Note: This will change the item stats and strength
07 00 Suit of Rusty Armor
07 01 Suit of Leather Armor
07 02 Suit of Studded Leather Armor
07 03 Suit of Ring Mail
07 04 Suit of Scale Mail
07 05 Suit of Chain Mail
07 06 Suit of Splint Mail
07 07 Suit of Plate Mail
07 08 Suit of Plate Armor
07 09 Suit of Meteoric Steel Plate Armor
07 10 Suit of Elven Chain Mail

Note: This will change the item stats and strength
08 00 A Broken Shield
08 01 Small Wooden Shield
08 02 Medium Wooden Shield
08 03 Small Iron Shield
08 04 Large Wooden Shield
08 05 Medium Iron Shield
08 06 Small Steel Shield
08 07 Large Iron Shield
08 08 Medium Steel Shield
08 09 Large Steel Shield
08 10 Small Meteoric Steel Shield
08 11 Medium Meteoric Steel Shield
08 12 Large Meteoric Steel Shield
08 13 Shield of Deflection

Note: This will change the item stats and strength
09 00 Broken Helmet
09 01 Leather Helmet
09 02 Iron Helmet
09 03 Steel Helmet
09 04 Meteoric Steel Helmet
09 05 Helmet of See Invisible
09 06 Helmet of Teleportation
09 07 Helmet of Detect Monsters
09 08 Helm of Storms

Note: This won't change what the item does.
16 00 Broken Pack
16 01 Small Pack
16 02 Small Bag
16 03 Medium Pack
16 04 Medium Bag
16 05 Small Chest
16 06 Large Pack
16 07 Large Bag
16 08 Medium Chest
16 09 Large Chest
16 10 Small Pack Of Holding
16 11 Medium Pack Of Holding
16 12 Large Pack Of Holding
16 13 Purse

Note: Only values up to platinum are valid
18 01 copper
18 02 silver
18 03 gold
18 04 platinum
