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. Hero data is stored in 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 === Hero data is written as follows: <span style="color:orange">GG</span>000000 <span style="color:red">RR</span>000000 <span style="color:blue">HH</span>000000 <span style="color:green">SO</span>000000 <span style="color:turquoise">OL</span>000000 <span style="color:teal">ST</span>000000 <span style="color:pink">TL</span>000000 <span style="color:brown">SB</span>000000 <span style="color:grey">SP</span>000000 <span style="color:gold">U1</span>000000 <span style="color:gold">U2</span>000000 <span style="color:gold">U3</span>000000 PS000000 PL000000 <span style="color:silver">R0 </span><span style="color:silver">AS </span><span style="color:silver">CO</span> 00, where: * <span style="color:orange">GG</span> = Gender: 00 is male, 01 is female. * <span style="color:red">RR</span> = [[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. * <span style="color:blue">HH</span> = [[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. * <span style="color:green">SO</span> = First skill (ref. ID). * <span style="color:turquoise">OL</span> = First skill's proficiency level (00 = Basic, * 01 = Advanced, 02 = Expert). * <span style="color:teal">ST</span> = Second skill (ref. ID). If there is no second skill, instead, FFFFFFFF is used, replacing ST and the zeroes following it. * <span style="color:pink">TL</span> = Second skill level. If there is no second skill, 00 is used (Basic). * <span style="color:brown">SB</span> = Spell Book. 00 = absent, 01 = present. * <span style="color:grey">SP</span> = Spell (ref. ID). If no spell is present, FFFFFFFF is used instead. * <span style="color:gold">U1</span>, <span style="color:gold">U2</span>, <span style="color:gold">U3</span> = Starting army unit reference IDs. * PS = Small Portrait DWORD pointer, which leads to plain text name of the portrait in the H3bitmap.lod. * PL = Large Portrait, same as above. * <span style="color:silver">R0</span> = allowed in RoE maps by default. 00 = false, 01 = true. * <span style="color:silver">AS</span> = Present by default in all non-RoE maps. 00 = false, 01 = true. * <span style="color:silver">CO</span> = Campaign-only. 00 = false, 01 = true. === Hero Specialties === Hero specialties are written one by one in the same order as heroes appear in, starting from 0x00278420. The specialties look as follows: <span style="color:red">TT</span>000000 <span style="color:black">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 <span style="color:red">TT</span> - Specialty type. 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), f.e. 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, that 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). <span style="color:black">ID</span> = 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). <span style="color:blue">AA</span> = Attack bonus for Static Unit specialists (and Mutare). <span style="color:blue">DD</span> = Defense bonus for Static Unit specialists (and Mutare). <span style="color:blue">DM</span> = Damage bonus for Static Unit specialists (and probably Mutare). <span style="color:gold">U4</span> = 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.) <span style="color:gold">U5</span> = Resulting unit ref. ID from the upgrade (only for Unit Upgrade specialists). Note, that using a Unit Upgrade specialist, reference ID of unupgraded creatures ought to be used. F.e., 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 unupgraded creatures. Note, that many "possible" specialties don't exist and simply won't do anything; examples include Tactics specialty, Teleport specialty, etc. === Editing HotA Heroes === Hota heroes are coded in the HotA.dat, in the following order: (names written in quotes are coded in plain text) 07 000000 "hero<ref_id>" 12 000000 "Heroes\hero_<ref_id>.str" FACTION "#large_portrait_file_name.pcx" 0c000000 "#small_portrait_file_name.pcx" XX 000000 "Specialty_Name" YY 000000 "Specialty Bonus: Object" ZZ000000 "{Full Object}" 0d 0a 0d 0a (number of 0a 0d repetitions may differ) "specialty_description" PP000000 "HeroName" QQQQQQQQ "Biography" 00000000 01 5c 0000 (number of zeroes may vary) GG000000 RR000000 HH000000 SO000000 OL000000 ST000000 TL000000 SB000000 SP000000 U1000000 U2000000 U3000000 PS000000 PL000000 R0 AS C0 00 00000000 00000000 1m000000 1M000000 2m000000 2M000000 3m000000 3M000000 08000000 I8000000 TT000000 ID000000 AA000000 DD000000 DM000000 U4000000 U5000000, where: * FACTION = 09 000000 00000000 0b 000000 for Cove heroes and 09 000000 00000000 00000000 07 000000 for Factory heroes, * #large_portrait_file_name.pcx, #small_portrait_file_name.pcx: # and the appropriate file name, f.e. #HPLP06.pcx * XX = {{unk}} * Specialty_Name is f.e. "Sea Dogs" or "Nix". * YY = {{unk}} * Specialty Bonus: Object refers to the following types of text: "Spell Bonus: Air Shield", "Creature Bonus: Sea Dogs", etc. * ZZ = {{unk}} * {Full Object} is a text in curly parentheses {} stating again the specialty, f.e. "{Estates}", or "{Pirates, Corsairs and Sea Dogs}". * specialty_description: Plain text description. * PP = Hero's name's length. * QQQQQQQQ = {{unk}}, seems to be some sort of an ID as it seems to be unique for each hero; it is not, however, the reference ID. All QQ values are around 300 (dec). * 1m = minimum number of the first creature type in hero's starting army * 1M = maximum number of the first creature type in hero's starting army * 2m = minimum number of the second creature type in hero's starting army * 2M = maximum number of the second creature type in hero's starting army * 3m = minimum number of the third creature type in hero's starting army * 3M = maximum number of the third creature type in hero's starting army * I8 = reference ID + 8 for heroes before ref ID 178 and reference ID + 7 for heroes after ref ID 178 (essentially, 0xb9 is skipped) Heroes in HotA.dat start at 0x23dd and end at 0x9886. 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. === Altering Hero specialties === ==== 00 - Skill Specialty ==== The code for skill specialties works as follows: <span style="color:red">XXXXXXXX</span> D805 <span style="color:blue">YYYYYYYY</span> D8 4D FC where <span style="color:red">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 XXXXXXXX DWORD pointer, added to the YYYYYYYY 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-writen by the Hota.dll. ==== 01 - Unit Specialty ==== The scaling factor for a unit specialty is a DWORD pointing to a 5% value (in IEEE-754), located at 0x0e6548. Setting the unit IDs to an upgraded unit will ensure only the upgraded units are affected by the specialty. 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 its only possible to make all resource specialists increase resource gain by 2, unless a complete re-write of the function is performed). ==== 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 - +100% damage (Luna). Note that Hota.dll overwrites this +100% damage with a much more sensible 25%. : 01 - +50% damage (Ciele). : 02 - Tier bonus A (+3/+3/+2/+2/+1/+1/+0), such as Weakness specialty or Haste specialty. : 03 - Static bonus +2 (Aenain) : 04 - This one is only used by Fortune (Daremyth, Melodia). In contrary to what BTB claims, it sets the value of the spells effect to 3, regardless of spell's level. : 05 - Tier bonus B (+4/+3/+2/+1/+0/+0/+0), only used by Coronius as far as I know. : 06 - Scaling bonus. 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 specialty remotely usable, but we still want it to be a tier-based specialty. We can change the bonuses the spell provides for each unit tier in a 28-byte long table that starts at 0x23eaa8. Each 4 bytes corresponds to the next unit level. A similar table for Coronius' specialty type starts at 0x23eac4 (immediately afterwards) and works the same way. ===== Changing the static bonus ===== At 0x0e62e6 the value 0x02 determines the static bonus (such as the one Disrupting Ray specialists get). ===== Changing the scaling bonus ===== At 0x0e631f the DWORD pointer finds an IEEE-754 double precision value for 3% (base game). Replacing this pointer with another one finds a different % bonus. 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 * Teleport * Remove Obstacle. ==== 04 - Unit (static) ==== Only Xeron is specified to add speed thanks to his static unit specialty. This is (most likely) saved at the following address: 0x4b1b3 {{unk}}. 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 is specified within her specialty block.
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
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information