Editing
Hex Editing - Guide
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= Heroes = Heroes are very easy to edit. Non-Hota hero data is stored in h3hota HD.exe as two sets, one containing general hero data and the other containing only hero specialties. Heroes are generally ordered by their faction (Castle, Rampart, Tower, etc.) and then their class (might or magic). Following standard heroes, are all campaign heroes. == Hero Data == {| class="wikitable" |- ! colspan=99 | Hex String (Start: 0x279DD0, End: 0x27D5DF, Bytes per hero: 0x5c = 92) |- | colspan=99 | <span style="color:orange">GG</span>000000 <span style="color:orange">RR</span>000000 <span style="color:blue">HH</span>000000 <span style="color:green">SO</span>000000 <span style="color:green">OL</span>000000 <span style="color:lightgreen">ST</span>000000 <span style="color:lightgreen">TL</span>000000 <span style="color:brown">SB</span>000000 <span style="color:brown">SP</span>000000 <span style="color:gold">U1</span>000000 <span style="color:gold">U2</span>000000 <span style="color:gold">U3</span>000000 <span style="color:teal">PS</span>000000 <span style="color:teal">PL</span>000000 <span style="color:silver">R0 AS CO</span> 00 |- ! colspan=99 | Description {{HEXrow|c=orange |GG| Gender: 00: male, 01: female.}} {{HEXrow|c=orange |RR| [[Hero race|Race]]. These are listed alphabetically, from Demon to Vampire. This has no in-game effect or visibility and the extensions preferred to default everyone to human, except [[Gelu]] who gets to be an elf.}} {{HEXrow|c=blue |HH| [[Hero class|Class]]: Classes go in order of factions, and within a faction the might class is listed first. Therefore, 00: Knight, 01: Cleric, 02: Ranger, 03: Druid, etc. Note, that HotA classes essentially "follow" this encoding.}} {{HEXrow|c=green |SO| 1st [[Secondary skill]] ([[Reference IDs#Secondary Skill Reference IDs|ref. ID]]).}} {{HEXrow|c=green |OL| 1st [[Secondary skill]]'s proficiency level (00: Basic, 01: Advanced, 02: Expert).}} {{HEXrow|c=lightgreen|ST| 2nd [[Secondary skill]] ([[Reference IDs#Secondary Skill Reference IDs|ref. ID]]). If there is no second skill, instead, FFFFFFFF is used, replacing ST and the zeroes following it.}} {{HEXrow|c=lightgreen|TL| 2nd [[Secondary skill]] level. If there is no second skill, 00 is used (Basic).}} {{HEXrow|c=brown |SB| Spell Book. 00: absent, 01: present.}} {{HEXrow|c=brown |SP| Starting [[Spell]] ([[Reference IDs#Spell Reference IDs|ref. ID]]). If no spell is present, FFFFFFFF is used instead.}} {{HEXrow|c=gold |U1<br>U2<br>U3| Starting [[creature]] reference IDs.}} {{HEXrow|c=teal |PS| Small Portrait DWORD pointer, which leads to plain text name of the portrait in the H3bitmap.lod.}} {{HEXrow|c=teal |PL| Large Portrait, same as above.}} {{HEXrow|c=silver |R0| Present by default in all RoE maps. 00: false, 01: true.}} {{HEXrow|c=silver |AS| Present by default in all non-RoE maps. 00: false, 01: true.}} {{HEXrow|c=silver |CO| Campaign-only. 00: false, 01: true.}} |} === Editing HotA Heroes === Hota heroes are coded in the HotA.dat. Names written in quotes are coded in plain text. Note, that for editing text itself it's best to use programs such as [https://github.com/sake12/HotA-editor/releases HotA Editor], instead of a direct hex-editing. {| class="wikitable" |- ! colspan=99 | Hex String (Start: 2406, End: 0x9886) |- | colspan=99 | <span_stle="color:blue">"<Length1>"</span> <span style="color:orange">"hero<ref_id>"</span><span_stle="color:blue">"<Length2>"</span> <span style="color:red">"Heroes\hero_<ref_id>.str"</span> <span style="color:orange">FACTION</span> <span_stle="color:blue">"<Length3>"</span> <span style="color:teal">"#large_portrait_file_name.pcx"</span> <span_stle="color:blue">"<Length4>"</span> <span style="color:teal">"#small_portrait_file_name.pcx"</span> <span_stle="color:blue">"<Length5>"</span> <span style="color:turquoise">"Specialty_Name"</span> <span_stle="color:blue">"<Length6>"</span> <span style="color:turquoise">"Specialty Bonus: Object"</span> <span_stle="color:blue">"<Length7>"</span> <span style="color:turquoise">"{Full Object}"</span> 0d 0a 0d 0a (number of 0a 0d repetitions may differ, and they correspond to line spacing in text) <span style="color:turquoise">"specialty_description"</span> <span style="color:blue">Length8</span> <span style="color:orange">"HeroName"</span> <span style="color:blue">Length9</span> <span style="color:orange">"Biography"</span> 00 00 00 00 01 5C <span style="color:red">GG</span>000000 <span style="color:red">RR</span>000000 <span style="color:red">HH</span>000000 <span style="color:red">SO</span>000000 <span style="color:red">OL</span>000000 <span style="color:red">ST</span>000000 <span style="color:red">TL</span>000000 <span style="color:red">SB</span>000000 <span style="color:red">SP</span>000000 <span style="color:red">U1</span>000000 <span style="color:red">U2</span>000000 <span style="color:red">U3</span>000000 <span style="color:red">PS</span>000000 <span style="color:red">PL</span>000000 <span style="color:red">RR AS C0 00</span> 00000000 00000000 <span style="color:gold">1m</span>000000 <span style="color:gold">1M</span>000000 <span style="color:gold">2m</span>000000 <span style="color:gold">2M</span>000000 <span style="color:gold">3m</span>000000 <span style="color:gold">3M</span>000000 08000000 <span style="color:orange">I8</span>000000 <span style="color:red">TT</span>000000 <span style="color:red">ID</span>000000 <span style="color:red">AA</span>000000 <span style="color:red">DD</span>000000 <span style="color:red">DM</span>000000 <span style="color:red">U4</span>000000 <span style="color:red">U5</span>000000 |- ! colspan=99 | Description {{HEXrow|c=blue |Length1| Length of the hero<ref_id> string}} {{HEXrow|c=orange |hero<ref_id>| The hero's reference id in decimal, f.e. hero154}} {{HEXrow|c=blue |Length2| Length of the Heroes\hero_<ref_id>.str.string}} {{HEXrow|c=red |Heroes\hero_<ref_id>.str| {{unk}}}} {{HEXrow|c=orange |FACTION| Cove heroes: 09 000000 00000000 <br>Factory heroes: 09 000000 00000000 00000000 }} {{HEXrow|c=blue |Length3| Length of the large hero portrait name (including the .pcx extension) {{HEXrow|c=teal |#large_portrait_file_name.pcx| # and the appropriate file name, e.g. #HPLP06.pcx. Note that some heroes don't have the portraits specified in the hero data, and instead in the portrait sections, described below.}} {{HEXrow|c=blue |Length4| Length of the small hero portrait name (including the .pcx extension)}} {{HEXrow|c=teal #small_portrait_file_name.pcx| # and the appropriate file name, e.g. #HPLP06.pcx. Note that some heroes don't have the portraits specified in the hero data, and instead in the portrait sections, described below.}} {{HEXrow|c=blue |Length5| Length of the specialty name}} {{HEXrow|c=turquoise |Specialty_Name| e.g. "Sea Dogs" or "Nix"}} {{HEXrow|c=blue |Length6| Length of the specialty bonus}} {{HEXrow|c=turquoise |Specialty Bonus: Object| Refers to the following types of text: "Spell Bonus: Air Shield", "Creature Bonus: Sea Dogs", etc.}} {{HEXrow|c=blue |Length7| Length of the Full Object and specialty description strings, including the line-spacing coded using "0Dh 0Ah"}} {{HEXrow|c=turquoise |{Full Object}| Text in curly parentheses {} stating again the specialty, e.g. "{Estates}", or "{Pirates, Corsairs and Sea Dogs}".}} {{HEXrow|c=turquoise |specialty_description| Text string describing the hero specialty.}} {{HEXrow|c=blue |Length8| Hero's name's length.}} {{HEXrow|c=orange |HeroName| Text string of the hero's name.}} {{HEXrow|c=blue |Length9| Hero's biography's length.}} {{HEXrow|c=orange |Biography| Text string containing the hero's biography.}} {{HEXrow|c=orange |GG| Gender: 00: male, 01: female.}} {{HEXrow|c=orange |RR| [[Hero race|Race]]. These are listed alphabetically, from Demon to Vampire. This has no in-game effect or visibility and the extensions preferred to default everyone to human, except [[Gelu]] who gets to be an elf.}} {{HEXrow|c=blue |HH| [[Hero class|Class]]: Classes go in order of factions, and within a faction the might class is listed first. Therefore, 00: Knight, 01: Cleric, 02: Ranger, 03: Druid, etc. Note, that HotA classes essentially "follow" this encoding.}} {{HEXrow|c=green |SO| 1st [[Secondary skill]] ([[Reference IDs#Secondary Skill Reference IDs|ref. ID]]).}} {{HEXrow|c=green |OL| 1st [[Secondary skill]]'s proficiency level (00: Basic, 01: Advanced, 02: Expert).}} {{HEXrow|c=lightgreen|ST| 2nd [[Secondary skill]] ([[Reference IDs#Secondary Skill Reference IDs|ref. ID]]). If there is no second skill, instead, FFFFFFFF is used, replacing ST and the zeroes following it.}} {{HEXrow|c=lightgreen|TL| 2nd [[Secondary skill]] level. If there is no second skill, 00 is used (Basic).}} {{HEXrow|c=brown |SB| Spell Book. 00: absent, 01: present.}} {{HEXrow|c=brown |SP| Starting [[Spell]] ([[Reference IDs#Spell Reference IDs|ref. ID]]). If no spell is present, FFFFFFFF is used instead.}} {{HEXrow|c=gold |U1<br>U2<br>U3| Starting [[creature]] reference IDs.}} {{HEXrow|c=teal |PS| Small Portrait DWORD pointer, which leads to plain text name of the portrait in the H3bitmap.lod.}} {{HEXrow|c=teal |PL| Large Portrait, same as above.}} {{HEXrow|c=silver |R0| Present by default in all RoE maps. 00: false, 01: true.}} {{HEXrow|c=silver |AS| Present by default in all non-RoE maps. 00: false, 01: true.}} {{HEXrow|c=silver |CO| Campaign-only. 00: false, 01: true.}} {{HEXrow|c=gold |1m| minimum number of the first creature type in hero's starting army}} {{HEXrow|c=gold |1M| maximum number of the first creature type in hero's starting army}} {{HEXrow|c=gold |2m| minimum number of the second creature type in hero's starting army}} {{HEXrow|c=gold |2M| maximum number of the second creature type in hero's starting army}} {{HEXrow|c=gold |3m| minimum number of the third creature type in hero's starting army}} {{HEXrow|c=gold |3M| maximum number of the third creature type in hero's starting army}} {{HEXrow|c=orange |I8| reference ID + 8 for heroes before ref ID 178 and reference ID + 7 for heroes after ref ID 178 (essentially, 0xb9 is skipped)}} {{HEXrow|c=red |TT| specialty type} {{HEXrow|c=red |ID| relevant ID (skill, spell, unit, resource, etc.)} {{HEXrow|c=red |AA| attack bonus for static unit specialties}} {{HEXrow|c=red |DD| defense bonus for static unit specialties}} {{HEXrow|c=red |DM| damage bonus for static unit specialties}} {{HEXrow|c=red |U4| 2nd unit to be upgraded with the upgrade specialty type}} {{HEXrow|c=red |U5| unit obtained from the upgrade specialty}} |} == Hero Specialties == Hero specialties are written one by one in the same order as heroes appear in. Note: Many "possible" specialties don't exist and simply won't do anything; examples include Tactics specialty, Teleport specialty, etc. {| class="wikitable" |- ! colspan=99 | Hex String (Start: 0x00278420, End: 0x279C73, Bytes per hero: 0x28 = 40) |- | colspan=99 | <span style="color:turquoise">TT</span>000000 <span style="color:orange">ID</span>000000 <span style="color:blue">AA</span>000000 <span style="color:blue">DD</span>000000 <span style="color:blue">DM</span>000000 <span style="color:gold">U4</span>000000 <span style="color:gold">U5</span>000000 |- ! colspan=99 | Description {{HEXrow|c=turquoise |TT| Specialty type. Specialty types are described in greater detail in the sections below. The following specialty types exist: * 00: Skill specialty (+5% skill effect per level) * 01: Basic Unit specialty (+1 speed, +1 Attack and Defense every <unit level> levels) * 02: Resource (+1 gems per day, etc.) * 03: Spell (+3% efficiency per level for most spells, sometimes special bonuses instead) * 04: Static Unit specialty (static bonus to attack, defense, damage, speed, or any combination of them), e.g. Xeron, Kalt, Haart Lich, etc. * 05: Speed (Sir Mullich only) * 06: Unit Upgrade specialty (Gelu, Dracon, Bidley, etc.) * 07: Dragon Specialty (Mutare, Mutare Drake) * 08: Frederick's Automaton Explosion specialty. Note: Setting the first byte (TT000000) to FFFFFFFF will ensure the hero has no specialty. This is only used for Adrienne (yes, she ''technically'' has no hero specialty).}} {{HEXrow|c=orange |ID| Reference ID of the specialized in Skill, Unit, Resource or Spell. (Not needed for Dragon and Speed specialties, where it is 00 and an unnecessary, unused 02, respectively).}} {{HEXrow|c=blue |AA| Attack bonus for Static Unit specialists (and Mutare).}} {{HEXrow|c=blue |DD| Defense bonus for Static Unit specialists (and Mutare).}} {{HEXrow|c=blue |DM| Damage bonus for Static Unit specialists (and probably Mutare).}} {{HEXrow|c=gold |U4| Second unit (ref. ID) that can be upgraded (only used by Unit Upgrade specialists; otherwise left as 00. Note, that using the same unit twice for Unit Upgrade specialty essentially removes second unit from being upgradable; meanwhile using 00 sets the ID to Pikemen.<br>Note: When using a Unit Upgrade specialist, the reference ID of un-upgraded creatures ought to be used. e.g. Gelu references Archers and Wood Elves, but code naturally allows also for their upgrades to be improved with his specialty. This does not occur the other way around; specifying ID or U2 as an upgraded creature, will make the upgrade impossible for un-upgraded creatures. )}} {{HEXrow|c=gold |U5| Resulting unit ref. ID from the upgrade (only for Unit Upgrade specialists).}} |} === 00 - Skill Specialty === The code for skill specialties works as follows: <span style="color:turquoise">XXXXXXXX</span> D805 <span style="color:blue">YYYYYYYY</span> D8 4D FC where <span style="color:turquoise">XXXXXXXX</span> is a DWORD pointer to a 5% value (in IEEE-754), <span style="color:blue">YYYYYYYY</span> is a DWORD pointer to a value of 1 (again, in IEEE-754). ==== How it works ==== The number of levels is multiplied by the <span style="color:turquoise">XXXXXXXX</span> DWORD pointer, added to the <span style="color:blue">YYYYYYYY</span> DWORD pointer and then the skill bonus is multiplied by it (D8 4D FC). If we want to change the % gain per level, we only need to change the XX value. If we want to instead make the bonus additive (say x% per level, regardless of how much skill itself adds), we can replace the D805YYYYYYYY with 909090909090 (NOP) and replace the D8 4D FC with D8 45 FC. Therefore it is possible to have a different bonus for one skill than another. ==== Offsets ==== The offsets for each skill specialty bonus are as follows: : Archery - 0x0E4420 : Armorer - 0x0E45C9 : Diplomacy - 0x0E483C : Eagle Eye - 0x0E46E0 : Estates - 0x0E464F : First Aid - 0x0E4BD9 : Intelligence - 0x0E4B69 : Leadership - 0x0E3C81 : Learning - 0x0E4AF9 : Logistics - 0x0E4F1E : Luck - 0x0E3A2B : Mysticism - 0x0E41FE : Necromancy - 0x0E3F92 : Offense - 0x0E4569 : Resistance - 0x0E499C : Scouting - 0x0E432E : Sorcery - 0x0E5B61 ==== Exceptions ==== Specialties for integer-bonuses (Luck, Logistics, Scouting) only have their effect when a full integer is gained from their % bonus. Diplomacy specialty only affects surrender costs. Learning specialty is fully over-written by the Hota.dll. {{unk}} === 01 - Unit Specialty === The scaling factor for a unit specialty is a DWORD pointing to a 5% value (in IEEE-754), located at 0x0e6548. Note that Hota.dll is hooked at this point, replacing the DWORD pointer with a unit level test followed by a different DWORD for level 1 than the one for level 2-7 units, all somewhere in HotA.dll. Setting the unit IDs to an upgraded unit will ensure only the upgraded units are affected by the specialty. This is the cause for the Shadow of Death {{sod}} bugged Catherine and Roland specialties. Ballista and Cannon specialty are Unit specialties. === 02 - Resource Specialty === The amount of resources obtained from a gold specialty is saved at 0x0E4681 (as 350). The code for other resource specialties is possible to edit, but it checks for each resource together and then adds 1 to their growth. Therefore, it is not possible to make a single type of resource be given in a different amount by a specific specialist, without significant changes to the code. === 03 - Spell Specialists === ==== Spell specialty types ==== Spell specialty type table starts at 0x0e6358 (with Fire Wall specialty). Each consecutive byte is then the next spell by spell ID (Firewall, Earthquake, Magic Arrow, etc.) up to Slayer. Each spell specialty can take 6 types: : 00 - +25% damage (Luna) : 01 - +50% damage (Ciele). : 02 - Tier bonus A, such as Haste, Bloodlust or Stone skin specialties. Yes, all three of these types of specialties have the same bonus here; they are then overwritten in the Hota.dll. Their tables are relatively easy to find in said file, since they just include all bonuses listed one by one, for units level 1-7. : 03 - Static bonus +10 (Aenain) : 04 - This one is only used by Fortune (Daremyth, Melodia). In contrary to what BTB claims, it sets the value of the spell's effect to 3, regardless of the spell's level or the values in SPTRAITS.txt. It can be used to f.e. set the value of extra Counterstrikes from the [[Counterstrike]] spell to 3, or, should its value be increased, affect another value used by a spell. : 05 - Tier bonus B (+20/+20/+16/+16/+12/+12/+8), only used by Coronius as far as I know. Specific value of the bonus is determined by a table in Hota.dll : 06 - Scaling bonus (10% per level, overwritten for Astra and Uland to be 10% per 8-n, where n is the level, in the Hota.dll). HotA.dll changes almost all of these bonuses, meaning that while the specific spell's specialty type can be changed, an entire specialty type can't be edited without editing HotA.dll If a spell does not belong to the spell table, the scaling bonus is applied (for example this applies to the Hypnotize specialist, Astral). "But what if we want to change the specialty type for a spell like Hypnotize?" We can extend the table by changing 0x0e6296 (equal to 0x2a by default) to a different value, which corresponds to the number of spells in the table -1. If we extend the table, the next specialties will be those for the next spells by spell ID. We have a total of 13 bytes of nop (90), so the last spell specialty we can code this way is Summon Air Elemental. Remember to update all specialties created this way! You shouldn't just leave the nops (90) in the middle of the table! "But what about Victoria, the Land Mine specialist?", you may ask. Well, I'm here to give answers: The command '''lea eax, [esi-0Dh]''' located at 0x0e6291 finds the spell ID of firewall (0d) and chooses it as the first spell on the list of specialties ''(remember? The one that starts at 0x0e6358?)''. By changing it to '''lea eax, [esi-0Bh]''', we can change the first spell ID to 0x0B, or Land Mine. ''Notice, that this reduces the last spell specialty to Summon Earth Elemental, but I doubt anyone will miss the Summon Water Elemental and Summon Air Elemental specialties.'' Next, we have to increase the number of spells in the list by 2 (located at 0x0e6296), and then move the entire spell specialty table, 2 bytes each, because now it starts at 0x0e6358 with Land Mine (and still follows by spell ID). "And what about Eovacius? And Zilare?" Haven't looked at them yet but I believe they may be hard-coded. The specialty types can be changed by altering their commands. Each specialty type (00, 01, and so on) have a DWORD pointer to their appropriate code located in a 28-byte long table starting at 0x0e633c. ==== Changing Tier bonuses ==== Let's say we want to make Olema's Weakness even stronger. The table for the bonus, defined at 0x23eaa8, is overwritten in Hota.dll, where each 4 bytes correspond to respective unit's level. A similar table for Coronius' specialty type starts at 0x23eac4 (immediately afterwards) and works the same way (and is also overwritten by Hota.dll). ==== Changing the static bonus ==== At 0x0e62e6 the value 0x02 determines the static bonus (such as the one Disrupting Ray specialists get). It is overwritten in Hota.dll ==== Changing the scaling bonus ==== At 0x0e631f the DWORD pointer finds an IEEE-754 double precision value for 3% (base game). The value is overwritten in Hota.dll. If you don't want the scaling specialties to divide their bonus by unit level, replace f7 f9 at 0xe630b with 90 90 (nop-ing out the division). ==== Specialties that don't work ==== Several specialties don't work because no specialty type can increase their bonus: * Curse * Anti-Magic * Dispel * Slow {{unk}}, but it would probably be way too strong anyway; * Berserk * Blind {{unk}} * Teleport * Remove Obstacle. === 04 - Unit (static) === Only Xeron is specified to add speed thanks to his static unit specialty. Setting the unit IDs to an upgraded unit will ensure only the upgraded units are affected by the specialty. === 05 - Speed specialty === Sir Mullich's unit specialty amount (0x02) is located at 0x0E6669. === 06 - Unit Upgrade specialty === These specialties calculate the upgrade cost automatically, with the same function that calculates upgrade costs in all other cases. If "unupgraded" unit is more expensive than the upgraded one, the message about necessary costs wil appear, but no cost will be stated and the conversion will be free. Setting the unit IDs to an upgraded unit will ensure only the upgraded units are affected by the specialty. === 07 - Dragon specialty === I believe Mutare's bonus used to be specified within her specialty block, and now is overwritten by Hota.dll
Summary:
Please note that all contributions to Heroes 3 wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Purge
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information