Guide to Magic.exe editing
Here's a little guide to editing Magic.exe with SkyMagic editor (also known as CardEditor or CardEditorLimited). In order to locate a certain card in Magic.exe, use the Search button on the CSV part of the editor and determine its ID value (let's take Disenchant, its id is 64). Now, go in the Magic.exe part and click on the leftmost Search button, insert the CSV id (64, in our case), and you'll see Disenchant among the list diplayed on the Left column. Double click on it and Disenchant entry will be displayed on the Right column. Now you could start the editing.
One important thing to know is that if you click just one time on the Left column, nothing will happen (otherwise, in the CSV part the Right column will immediately change). This could be easily used to copy entries. Let's suppose we want to copy Disenchant (ID 64) to ID 1000, overwriting anything that is there. So, locate Disenchant entry with the search button, double click on it on the Left column, then search again for ID 1000, CLICK JUST ONE TIME on Left column on it, change the "Card ID" field on the Right colun to 1000, click "Save" button on the bottom of the window and confirm, and you've copied Disenchant to a new ID.
Let's review all the fields together. Some numeric fiels use Hex values, you'll find an "(Hex)" after the name if it's the case :
"Secret Byte"(Hex) : It's so secret that I really don't know what is about. I suspect is linked to sound effects, but I'm not sure. Leave it alone.
"Card Name" : Pretty obvius. It's just a label and it's not currenly used by the code, so there is no restriction and you could use a name different from the one on the CSV.
"Card ID" : Very important, it's the CSV ID of the card.
"Card Type"(Hex) : There are 7 possibly type of cards :
- Land -> 01
- Creature -> 02
- Enchantment -> 04
- Sorcery -> 08
- Instant -> 10
- Interrupt -> 20
- Artifact -> 40
The values can be combined be combined by addition (an animated land wiould be 3, Land + Creature), just set it through the editor. Special cases are Creatures with Flash (12, Creature + Instant), Planeswalkers (4, as they're currently special Enchantments) and Special Effects cards (80, so the game will not recognize them as Permanents).
"Card SubType"(Hex) : There are a few subtypes code in Magic.exe, used mainly from the old, hardcode cards. But some are important to know, I'll list them all with notes of the most relevant.
- 00 -> Wall (be sure to set it if you're coding / inserting a Wall, otherwise it will be able to attack)
- 01 -> Merfolk
- 02 -> Zombie
- 03 -> Goblin
- 04 -> Dwarf
- 05 -> Efreet
- 06 -> Djinn
- 08 -> Rat
- 09 -> Artifact Land
- 0A -> Elephant
- 0B -> Mammoth
- 0C -> Dual Land type (if a land does not have this value, it won't be animated by cards like Living Lands and Kormus Bell. So if you'coding a land that has one or more basic land type, remember to set this value)
- 0D -> Basic Land (It's used ONLY for the 5 basic lands)
- 0E -> Legendary (Very important, is checked by all the card coded in C to see if a card is legendary, so remember to set it).
- 10 -> Enchant World
"Card Color"(Hex) : Pretty self-explanative, but there are some catches. For now, let's list the values.
- Colorless -> 01
- Black -> 02
- Blue -> 04
- Green -> 08
- Red -> 10
- White -> 20
Remember that artifact and land that gives mana look at this value to see what kind of mana the permanent could produce, so for example Mox Ruby has in this field 10 as Red, and not 1 as Colorless. As usual, the values could be combined thru addition. There is also a special value used only by Mishra's Workshop, 40, that apparently is used to implement the "restriction" on the mana generated.
"Card CC1" : The amount of Colored Mana in the Casting Cost of the card. So, for Balance you'll put 1 and for Progenitus you'll put 10.
"Card CC2" : The amount of Colorless Mana in the Casting Cost of the card. There is a special value, 255, that is the equivalent of "X" in the casting cost. Other stuff like "XX" or "XY" is not implemented and must be reproduced by coding. If you want to made a card uncastable by normal means (like Haakon, Stromgald Scourge), put 49 or more here.
"Card CC2" : This was unused by the original game, but now it's important for many new cards. Here's the list of values :
1 -> Casting cost can be modified (Hybrids, pitch spells and so on). Also used for cards that enable you to "play a spell for free from some zone" or "copy a spell".
2 -> Static Graveyard Abilities (Anger). It's also used for Bloodghast-like cards and cards that auto-reshuffle in the deck (like Darksteel Colossus or the Eldrazis).
3 -> Vanguar Avatars and Special Effects (EDH, Planechase etc.).
4 -> Cards that activates in hand (Cycling, Landcycling, Transmute and so on)
5 -> Cards that triggers in the upkeep when are in the graveyard ( Graveyard Upkeep Trigger ), like Nether Shadow, Ichorid and so on.
6 -> Cards that can be Dredged
9 -> Planeswalkers (if Enchantment) or Cards with Flashback (if not creature) / Unearth (if creature)
10 -> Cards with Retrace
11 -> Cards that generate an effect when discarded.
12 -> Cards that need the Storm Count (Dragonstorm, Vengevine and so on).
13 -> Trap cards, cards with Bloodthirst and in general cards that needs specific counts to be performed in order to work (check "zendikar.c" to see what counts are available).
14 -> Cards that need the special card Deadbox (stuff like Caller of the Claw, cards with Morbid, and in general cards that takes care of how many and what permanent went in Graveyards this turn).
"Card Power" and "Card Toughness" : Nothing really surprising here. The only known special value is 16384, used by cards that have "*" in these fields.
"Code Pointer"(Hex) : the actual point in the program (or in the DLL) where the ASM code of the cards begins. If for some reason you haven't the code pointer of a card coded in C and want to find it, browse the "src" folder and open "ManalinkEH.asm" with a text editor, do a search and find something like this "jmp near _card_name (the name of the card you're searching, all the spaces must be filled with the "_" character, also no puctuation is not allowed) ; XXXXXXX (an Hex value that is the Code Pointer)". The code pointer for any "vanilla" creature with only the Static Abilities that will follow is "00401000".
"Static Abilities 1"(Hex) : It's the first of 4 field that contains some of the static abilities of Creatures. Each one has its specific values:
01 -> Swampwalk
02 -> Islandwalk
04 -> Forestwalk
08 -> Mountainwalk
10 -> Plainswalk
20 -> Flying
40 -> Banding
80 -> Trample
"Static Abilities 2"(Hex) :
01 -> First Strike
02 -> Regeneration
04 -> Reach
08 -> Protection from Black
10 -> Protection from Blue
20 -> Protection from Green
40 -> Protection from Red
80 -> Protection from White
"Static Abilities 3"(Hex) :
01 -> Protection from Artifacts
02 -> Shroud
04 -> Unknown, probably Protection from Sorceris
08 -> Unknown, probably Protection from Instants
10 -> Unknown, probably Protection from Interrupts. Does not use this value, as it's borrowed for implementing Changelings.
20 -> Banding when Attacking but also Protection from Creatures
40 -> Unknown, probably Protection from Lands
80 -> Unknown, probably unused.
"Static Abilities 4"(Hex) :
01 -> Unknown, probably unused.
02 -> Unknown, probably unused.
04 -> Unknown, probably unused.
08 -> Unknown, probably unused.
10 -> Unknown, probably unused.
20 -> Infect
40 -> Double Strike
80 -> Unknown
"Extra Abilities 1"(Hex) : A field reserved for activated abilities and special values. Some values are still mysterious, although used by some cards.
01 -> Instant Ability (is fine for the majority of cards. Set this if your card is Indestructible or could auto-regenerate)
02 -> Interrupt Ability (it's needed for cards like Counterbalance, Null Brooch and in general permanents that can counter spells)
04 -> Damage Prevention (used for cards like Samite Healer)
08 -> Power Pumper (used only by the AI to better play cards like Shivan Dragon).
10 -> Toughness Pumper (used only by the AI to better play cards like Pearl Dragon. If you're inserting a card like Nantuko Shade, you need to set on this and the previous value).
20 -> Have Counters (used only by the AI to better play cards like Triskelion).
40 -> Unknown, probably linked by discard, as it's used by Disrupting Scepter.
80 -> Unknown, probably linked to instant card drawing, as it's used by Ancestral Recall.
"Reserved Infos"(Hex) : a mostly undecrypted field, it's a string of 12 Hex values ranging from 00 to FF : the first 3 appear to be used by the program for some special cases (if you don't use the correct Reserved Infos, a Counterspell will crash the game or Sphere of Resistence will have no effect), the others are probably hints for the AI. Here's a list of useful Infos taken from already coded cards :
Ancestral Recall: 010000FF0F020003000000
Animate Dead: 000000FF01010001000000
Army of Allah: 040000FF04040003000000
Azure Mage: 000000FF11010002000000
Brain Geyser: 010000FF01020002000000
Clone : 000000FF01020003000000
Conqueror's Pledge : 000000FF08010001000000
Control Magic: 000000FF01010001000000
Counterspell: 220000FF0F010001000000
Crusade: 000000FF01010001000000
Demonic Tutor: 010000FF01020002000000
Disenchant: 000000FF0F010003000000
Disintegrate: 000000FF01010003000000
Disrupting Scepter: 000000FF11010001000000
Double Land: 100000FF01020002000000
Drudge Skeletons: 000000FFF8010002000000
Dummy: 000000FF0F010000000000
Earthquake: 000000FF01010001000000
Equipment: 000000FF11010002000000
Fallen Angel : 000000FF48100003000000
Fog: 000000FF07010002000000
Generic Planeswalker that makes creatures : 004000FF11010002000000
Giant Growth: 020000FF04010003000000
Helm of Chatzuk: 000000FF31010002000000
Hymn to Tourach: 010000FF01010003000000
Icy Manipulator: 020000FFF1020003000000
IvoryCup: 00000002F1020001000000
Jade Statue: 00C000FF0F020002000000
Juggernaut : 000001FF08020001000000
Juggernaut: 000001FF08020001000000
Library of Leng: 000000FF080100FEFFFFFF
Library of Leng: 000000FF080100FEFFFFFF
Life Conservator: 000000FFF1010002000000
Lightning Bolt: 020000FF0F010003000000
Mana Flare: 000000FF010100FFFFFFFF
Marsh Viper: 000000FF080100FFFFFFFF
Millstone : 000000FFF80100FEFFFFFF
Mind Twist : 010000FF01010003000000
Mishra's Factory: 140000FF71010002000000
Moat: 000004FF0F100003000000
Mogg Fanatic: 000000FFF8010001000000
Mox (any): 110000FFF1020003000000
Nantuko Shade: 000000FF48010001000000
Nekrataal: 000000FF08010001000000
Nevinyrral's Disk: 000000FFF8010002000000
Pendelhaven: 100000FFF1010001000000
Pestilence: 000000FFF1010001000000
Prodigal Sorcerer: 000000FFF8010003000000
Raging goblin : 000000FF01010001000000
Rampant Growth: 000000FF08010001000000
Raise Dead: 000000FF01010001000000
Regrowth : 010000FF01020002000000
Royal Assassin : 000000FFF8010002000000
Samite Healer: 000000FFF8010002000000
Sacred Nectar: 000000FF0F010002000000
Shivan Dragon: 000000FF48010002000000
Sol Ring: 110000FFF1020002000000
Soul Net: 000000FF01010001000000
Sphere of Resistence: 000040FF01010002000000
Stone Rain: 000000FF010100FFFFFFFF
Strip Mine: 140000FFF1010001000000
Terror: 000000FF0F010003000000
The Hive: 000000FF11010002000000
Time Elemental: 000000FFF8010002000000
Twiddle: 000000FF0F010000000000
Unholy Strenght: 000000FF01010002000000
Vanilla creature with strong static abilities : 000000FF08010001000000
Wrath of God: 000000FF08010002000000
Wyuli Wolf: 000000FF28040001000000
