Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 4 - Lands of Axeoth > Thread: Heroes 4 Modding Revisited
Thread: Heroes 4 Modding Revisited This thread is 17 pages long: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 · «PREV
NimoStar
NimoStar


Responsible
Legendary Hero
Modding the Unmoddable
posted October 05, 2023 03:19 AM

Also, however, I am leaving out the most important reason

Having closed DLLs as the basis of modding is a giant backwards step in anything that was accomplished with the plugin being open sourced on public Github

For a moment we could live the dream of anyone making their mods however they wanted. And customizing them in plain text jsons

Now we will go back to the dark days of equilibris-like closed DLL modifications and nobody publishing or knowing how others did stuff.

Yes, the golden era of H4 modding has ended. Too brief it was.
____________
Never changing = never improving

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Albyx
Albyx


Known Hero
posted October 05, 2023 08:57 AM

Sources of Zer0 are available for more than 1 year now. People are creating their local PvE and PvP mods based on it in every Heroes 4 community I've seen now. If you have dedication modding is off limits!

Your pessimism is based on nothing, be positive

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
NimoStar
NimoStar


Responsible
Legendary Hero
Modding the Unmoddable
posted October 05, 2023 03:37 PM

close sourcing and gate keeping is not letting other people iterate, improve or variate

while you are iterating and variating on work made by others

Windows vs Linux
____________
Never changing = never improving

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
iliveinabox05
iliveinabox05


Honorable
Famous Hero
posted October 05, 2023 03:47 PM

Albyx said:
Sources of Zer0 are available for more than 1 year now. People are creating their local PvE and PvP mods based on it in every Heroes 4 community I've seen now. If you have dedication modding is off limits!

Your pessimism is based on nothing, be positive


Bro, don't feed the Troglodytes!

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
baronus
baronus


Legendary Hero
posted December 05, 2023 02:27 PM

But its only description of building!
Its more complicated.
First publicated by kkfkkkfk:
Town income

Scrap from my bilingual guide:

Dochod miasto - faktyczny/wykazywany
City income - in fact/ information cell

xxx 49a108/49a2ba e803 = 1000 => 1000
xxx 49a11c/49a2cd fa00 = .250 => .750
xxx 49a121/49a2d2 f401 = .500 => .500
* Trzeba też zmienić opis w tabelce txt.
* Needed changes in txt tables too.

You need change 3 things real income information about income building description.

Recommended values from my mod.
500
1000 x2
2000 x4

All economy must be ballanced eg. units costs!

Mine gives 1000 city 2000 IT think its best proportion. Now mine gives 2x income! Its too much. One minę gives you too powerfull boost.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
NimoStar
NimoStar


Responsible
Legendary Hero
Modding the Unmoddable
posted December 24, 2023 06:53 PM
Edited by NimoStar at 19:33, 24 Dec 2023.

Despite other people being all for secrecy and not sharing, I will still share any relevant findings so that modders may customize the game experience to their liking and experiment with new and altered mechanics

table.artifacts.txt (to convert towards .h4d)
(text editor 2.0 by NeoGenesis)


besides things in the slots I have already covered such as left_ring, right_ring, misc_1, misc_2, misc_3 and misc_4 which are unused by the game yet valid, there is another tag called "Invalid"

However, paradoxically, this artifact tag allows you to place the artifact on any slot. And it works!

In my mod, I am using it to enable the stacking of what used to be called Rings/Trinkets of Health (+50% base health)

This permits ubisoft-style "Boss" fights against heroes with lots of health (which is something the old user Nostradamus requested like 7/8 years ago, on 2016). Combined with my "Hero creature" graphical system, you could fight, say, a Black Dragon hero with a prodigious health stack.






all but two of these are needed to fill out all equipment slots

however, the newly renamed and re-graphiqued Zircons of Health are just the top of the iceberg

Many effects can be stacked, including +% effects.

A mapmaker/modder may choose to make a map-specific mod where you collect Staffs of Mayhem (+50% damage to certain spells) which may be placed on any slot in order to give a serious boost to your direct damage spells, which would be needed for a final battle, for example. Maybe stacking five St. Ranan's Staff gives you 100% army resurrection after combat? Add Swords of the Gods for a yes-godly amount of creature damage? (this certainly works) I haven't given enough thought or testing to all possibilities, but they are there, and I am releasing this knowledge for anyone to ponder or utilize.
____________
Never changing = never improving

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
karmakeld
karmakeld


Responsible
Supreme Hero
posted December 26, 2023 12:06 PM

Nice work Nimo.
Indeed it opens up new possibilities, like boss battles.
Curious to see the results, when you've had time to test other +% bonuses.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
NimoStar
NimoStar


Responsible
Legendary Hero
Modding the Unmoddable
posted December 28, 2023 07:03 PM
Edited by NimoStar at 19:52, 28 Dec 2023.

So far, I surmise that the stacking works on the following attributes:

* Attack and defense bonuses for the hero (Swords, shields, armors)
* +% attack and defense for the creatures (Ring of Defense, Ring of Warlords, Axe of Legends/Left-ends, etc.)
* +% effect on spells (Scarab of Summoning, Staff/Rod of Mayhem)
* Charm/wand spell point regeneration stacks with the ones of its own type, but this is of limited use (at most, you can cast the same wand-spell each turn)

Indefinite staking doesn't work for the following attributes:
* Skill-less enhancements have at most limited staking (Necklace of Charm x2, Stateman's Medal x1, Amulet of the Undertaker x1)
* Spell-like effects (Wards, fire aura, fire protection, regeneration) never stack.

Of course, these other non-stackable attributes could be enhanced via exe hacking, but the offsets for those are not published.
____________
Never changing = never improving

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
nevon
nevon

Tavern Dweller
posted March 22, 2024 05:33 PM

Offset for Angelfeather Cloak's 300hp

I found the offset for the hard-coded 300HP of the Heavenly Shield provided by the Angelfeather Cloak artifact!

22484295 (25e847 in hex) in h4mod.exe.

I'm using a fresh install of the non-HD Equilibris 3.60 beta on top of HoMM 4 complete edition from GoG. I haven't checked if the offsets are the same in the base game or in Equi 3.5.

That 300 HP is in a 32-bit little-endian integer so the bytes you're looking for are 2c 01 00 00. I've verified that setting it as high as 45 23 01 00 works (for a modest 74565 HP of Heavenly Shield at the start of combat).

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Karmakeld
Karmakeld


Responsible
Supreme Hero
posted March 24, 2024 09:29 AM

nevon said:
I found the offset for the hard-coded 300HP of the Heavenly Shield provided by the Angelfeather Cloak artifact!

22484295 (25e847 in hex) in h4mod.exe.

I'm using a fresh install of the non-HD Equilibris 3.60 beta on top of HoMM 4 complete edition from GoG. I haven't checked if the offsets are the same in the base game or in Equi 3.5.

That 300 HP is in a 32-bit little-endian integer so the bytes you're looking for are 2c 01 00 00. I've verified that setting it as high as 45 23 01 00 works (for a modest 74565 HP of Heavenly Shield at the start of combat).


Dang, speaking of boss like battles..
But nice, thx.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
nevon
nevon

Tavern Dweller
posted April 01, 2024 01:50 AM
Edited by nevon at 12:05, 08 Apr 2024.

Artifact offsets (for Gathering Storm artifacts)

I have now mapped out most of the artifacts which were added by Gathering Storm, and all of their combos.

I've also confirmed that a few of these offsets are the same in the base game (`heroes4.exe` instead of Equilibris' `h4mod.exe`).

Turns out the bonuses/spells/abilities of these artifacts are hard-coded in the machine code, as "immediate" values in instructions setting up arguments on the stack for specific function calls.

Almost all of these are preceded by `6a` (if the number or spell ID or ability ID fits in a signed byte). This is an x86 "push" instruction which uses the next byte as its "immediate" value to push. A couple are preceded by `68` - this is also a push instruction, but uses four bytes of immediate value - this is used for numbers and IDs that are larger than 127 (7F in hex). A couple cases I found were prefixed by `c7 46 0c` (this copies the next four bytes of immediate value to a spot starting at 12 bytes past the current top of the stack, so it's still setting up function arguments on the stack, just in a different order).

Some of the values have constant factors applied to them. Armor and Attack (but not Damage!) bonuses in the code are actually 10x bigger than their in-game displayed values, so +15 armor is actually +150 armor in the code, +5 is actually +50, and so on. Combat movement is more extreme: it has a 300x multiplier. So +1 combat movement is actually +300 in the code, +2 movement is +600, and so on.

Some of the bonuses are separate arguments for the same function call. For examples:

1. When an artifact applies a spell, the spell ID is one argument, and one of the other arguments is a number which is used by some spells (so Angelfeather Cloak has the 300 and the Heavenly Shield spell ID right next to each other).
2. Giving spell points and increasing spell point regeneration is done in the same function call - artifacts which only give spell points and no spell point regeneration are actually still granting +0 spell point regeneration, and you can mod that +0 to a +1 or +100 or whatever. (Negative numbers seem to sometimes work to reduce mana regen, but I didn't take the time to figure out exactly when/how it works.)
3. Armor bonuses have two boolean arguments - one controls if the bonus amount is added to melee armor, the other to ranged armor.
4. Same for Attack (but not Damage) bonuses - two booleans, one controls if the bonus is applied to melee attacks, the other to ranged attacks.
5. Similarly, adventure movement % bonuses have two booleans, one controls if the bonus applies to water movement and the other to land movement.

Oh, and those artifacts which reduce the cost of spells by -2? That code is just using -2 as an argument (FE in hexadecimal, sign-extended and two-complement), so you're not limited to just "2", you can make it any number, and you can even make an artifact increase spell cost by setting that to a positive number.

So, here's the list, in this format:

(instruction bytes) value bytes -- what it defines
offset of first value byte in decimal
offset of first value byte in hexadecimal

(6a) 6d -- Archmage Hat Blur
2483396
0x25e4c4

(6a) 02 -- Archmage Hat +2 sp regen
2483412
0x25e4d4

(6a) 0a -- Archmage Hat +10 sp
2483418
0x25e4da

(68) 2c 01 00 00 -- Angelfeather 300 HP (for Heavenly Shield)
2484295
0x25e847

(6a) 10 -- Angelfeather Heavenly Shield
2484302
0x25e84e

(6a) 2e -- Angelfeather Flight
2484325
0x25e865

(6a) 00 -- Angelfeather +0 sp regen
2484351
0x25e87f

(6a) 0a -- Angelfeather +10 sp
2484353
0x25e881

(68) 96 00 00 00 -- Harmonic Chainmail +15 armor (+150)
2482677
0x25e1f5

(6a) 01 -- Harmonic Chainmail +armor applies to ranged armor (if 00 instead of 01, the armor buff does not apply to ranged)
2482684
0x25e1fc

(6a) 01 -- Harmonic Chainmail +armor applies to melee armor (if 00 instead of 01, the armor buff does not apply to melee)
2482686
0x25e1fe

(68) 94 00 00 00 -- Harmonic Chainmail Mirth
2482717
0x25e21d

(6a) 05 -- Necklace of Muses +5 sp regen
2482820
0x25e284

(6a) 0f -- Necklace of Muses +15 sp
2482826
0x25e28a

(6a) 00 -- Wayfaring Boots +% movement does not apply on water
2483783
0x25e647

(6a) 01 -- Wayfaring Boots +% movement does apply on land
2483785
0x25e649

(6a) 19 -- Wayfaring Boots +25% movement
2483787
0x25e64b

(6a) 00 -- Wayfaring Boots +0 sp regen
2483813
0x25e665

(6a) 0a -- Wayfaring Boots +10 sp
2483815
0x25e667

(6a) 64 -- cloak of darkness defense +10 (+100)
2499329
0x262301

(c7 46 0c) 19 00 00 00 -- cloak of darkness dark magic +25%
2499439
0x26236f

(6a) 77 -- cloak of darkness life ward
2499572
0x2623f4

(6a) 0a -- ring of light damage +10
2499835
0x2624fb

(c7 46 0c) 19 00 00 00 -- ring of light light magic +25%
2499939
0x262563

(6a) 76 -- ring of light death ward
2500071
0x2625e7

(68) fa 00 00 00 -- Tiger armor +25 armor (+250)
2500321
0x2626e1

(6a) 02 -- tiger armor speed +2
2500409
0x262739

(68) 58 02 00 00 00 -- tiger armor +2 movement (+600)
2500491
0x26278b

(6a) 32 -- Tiger helm +5 armor (+50)
2500769
0x2628a1

(6a) 05 -- Tiger helm +5 damage
2500864
0x262900

(6a) 18 -- Tiger helm negate first strike
2500936
0x262948

(68) fa 00 00 00 -- Frost Hammer +25 attack (+250)
2501202
0x262a52

(6a) 31 -- frost hammer freezing attack
2501304
0x262ab8

(c7 46 0c) 19 00 00 00 -- necklace of balance order&chaos magic +25%
2501628
0x26cbfc

(6a) fe -- flame of chaos -2 spell cost
2502494
0x262f5e

(6a) 79 -- flame of chaos order ward
2502634
0x262fea

(6a) 14 -- flame of chaos cold resistance
2502703
0x26302f

(6a) fe -- ice scales -2 spell cost
2502974
0x26313e

(6a) 75 -- ice scales chaos ward
2503114
0x2631ca

(6a) 28 -- ice scales fire resistance
2503183
0x26320f

(68) 90 00 00 00 -- Aiffe's Mandolin spellbook song of peace
2502013
0x262d7d

(6a) 63 -- Aiffe's Mandolin spellbook mass fervor (mass mirth)
2502103
0x262dd7

(6a) 22 -- Aiffe's mandolin spellbook unholy song
2502186
0x262e2b

(6a) 00 -- Ring of Flares +0 spell point regen
2503828
0x263494

(6a) 0a -- Ring of Flares +10 spell points
2503839
0x26349f

(6a) fe -- Ring of Flares -2 spell cost
2503958
0x263516

Unfortunately, if the code uses the instruction `6a` to specify a spell ID, you can only overwrite that ID byte with spell IDs 00-7F. To make an artifact apply spells with ID 80 and above, you need more bytes. For example, Harmonic Chainmail uses `68` with 4 bytes of immediate value, since Mirth has ID 94. Of course, you could for example replace the `68 2c 01 00 00 6a 00 6a 10` which sets up Angelfeather Cloak's Heavenly Shield with, say, `6a 00 6a 00 68 89 00 00 00` to make it start the hero under the effect of Sanctuary instead (reusing the extra bytes which heavenly shield uses for its large argument for the ID of a spell with a small/zero argument). More generally, you can rewrite other buffs which have enough bytes so long as you also change the function address they jump to.

(In Equilibris 3.6 beta, they did something really weird as part of the "twinned wards" change, so modding the code that grants the ward spell effect on Ice Scales (but not Flame of Chaos), Ring of Light, and Cloak of Darkness just doesn't do anything - but modding those in the base game works fine, and I presume it also works fine on Equilibris 3.5.)

-= Combos =-

(6a) 35 -- Ring of Light + Cloak of Darkness: Guardian Angel
2498098
0x261e32

(6a) 4a -- Ice Scales + Flame of Chaos + Necklace of Balance: Magic Mirror
2498262
0x261ed6

(6a) 38 -- Tiger+Hammer: Regeneration (ability, not spell)
2498408
0x261f68

(6a) 21 -- Tiger+Hammer: Dragon Strength
2498479
0x261faf

(68) 90 00 00 00 -- Harmonic+Muses+Mandolin: song of peace
2498641
0x262051

(The `6a 01` right before that Song of Peace ID push is actually pushing a boolean which controls if this is spell is applied on melee attack. And the `57` right before that is pushing another boolean (from a register which always contains zero at this point in the code), which controls if this spell is applied on ranged attack.)

(6a) 52 -- Angelfeather+Disruption+Wayfaring+Hat+Flares: ignore magic resistance (ability, not spell)
2498844
0x26211c


-= Function Addressess =-

Not an exhaustive list, but here are some function addresses which at least two of the above artifact setup instruction sequences call to set up a buff or grant an ability or spell effect:

2490112 +Spell Points (and regen)
0x25ff00

2516272 +Armor
0x266530

2516320 Spell
0x266560

2517200 +Damage
0x2668d0

2484608 Ability
0x25e980

The function calls are not entirely interchangeable, even after you change the number of arguments and replace any unused bytes with no-ops (byte `90`). In some cases when rewriting a buff to instead grant an ability or effect, I had do add `8b c8` (copy eax into ecx) before a call. But in other cases even that didn't work. It seems that every spell-effect granting call can be changed into an ability granting call (ability function just takes one less argument, it seems, so overwrite one of the `6a 00` with `90 90`, change the spell ID to the desired ability ID, change the call offset, and you're good to go) and several of the +damage/+armor/+attack buffs can be replaced with spell or ability grants (but not all - for example, overwriting the armor buff of the Tiger Helm to a spell grant worked fine, but changing the armor buff of the Harmonic Chainmail didn't, and I haven't yet had the motivation+time to interpret the machine code enough to figure out why).


-= Misc. blah blah =-

If I don't know when I'll have time+energy+motivation to write up more of a guide with examples, or some educational "how I figured this out"/"how you could figure this out on your own"... I'd like to, but let's keep expectations low. A few fun parting notes:

1. the unlimited shots ability works on a hero when granted by an artifact - hero gets "inf" shots in combat UI and doesn't seem to ever run out.

2. the Phoenix' Rebirth ability will revive a hero over and over so long as the hero has enough mana - with basic modding you too can now face tank seven Hand of Death per turn (Tiger Helm's Negate First Strike is the easiest to try this with, since that's already granting an ability, just need to overwrite that 18 byte with 37) - but the hero might have negative HP on the adventure map afterwards (possibly depends on having HP-increasing buffs like Dragon Strength on at the same time, I haven't thoroughly checked), and then you must heal before the next battle or the hero won't even spawn in.

3. Tiger Armor is the most convenient modding artifact to give teleport movement to a hero - you can overwrite the armor buff to give the teleport ability, and overwrite the number in its combat movement buff to be much larger. Heroes don't have fancy teleport graphics so they just instantly disappear and repear when they teleport, which depending on your tastes might feel either like an unfinished product or like a really cool way to make the hero look like they move faster than your eyes can follow.

4. You can apply negative spell effects to your heroes with artifacts too. The most amusing version of this is Hypnotize: the hero starts combat hypnotized and it never runs out and can't be dispelled. Could be a neat surprise in a custom campaign - one of your heroes suddenly turns on you at the start of a pivotal fight in the story (for example, mod archmage's hat to do this, then have a script remove all other head artifacts from the hero, add the hat once you've ensured the head is free, add back the head items you took - a fully general solution is annoying to write but possible with some variables and conditionals). But you could also use this for tradeoffs - maybe an artifact gives a nice buff but also hits your hero with Sorrow/Curse/Aging/Spell Shackle/Forgetfulness, etc.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
nevon
nevon

Tavern Dweller
posted April 01, 2024 09:06 AM bonus applied by Galaad on 03 Apr 2024.
Edited by nevon at 17:54, 02 Apr 2024.

More Artifacts (mostly ability- and spell- granting ones) (and some unknowns)

I've mapped out some more artifacts' offsets and relevant information, by looking for calls to a couple of the known function addresses (some of them listed in my last post).


-= Effect Targets =-

This is pushed either right before an ability ID push when calling the function at 2484608 (0x25e980), or right before a spell ID push when calling the function at 2516320 (0x266560), and controls who the effect is applied to:

00 -- self (the hero who has this artifact equipped)
01 -- enemy creatures
02 -- enemy heroes
03 -- friendly creatures
04 -- friendly heroes (but not self)
05 -- applies to all (friend or foe, hero or creature, self or not)
06 -- all except self
07 -- same as 6
08 -- same as 6 (didn't check higher numbers)


-= Artifacts =-

These are all of the ones I found by looking for function calls directly to the address 2484608 (0x25e980) to grant an ability (excluding ones already listed in my last post) (plus one that I happened to find nearby as I was looking through these):

(6a) 35 -- arrow of slaying: ranged giant slayer
2464347
0x259a5b

(6a) 36 -- arrow of stunning: ranged stun
2464495
0x259aef

(6a) 36 -- ???: ranged stun
2465440
0x259ea0

(6a) 33 -- ???: ranged
2465493
0x259ed5

(6a) 47 -- ???: melee stun
2465546
0x259f0a

(6a) 33 -- ???: ranged
2466262
0x25a1d6

(6a) 38 -- breastplate of regeneration: regeneration
2466647
0x25a357

(68) c8 00 00 00 -- breastplate of regeneration: +20 armor
2466698
0x25a38a

(6a) 01 -- breastplate of regeneration: +armor applies to ranged
2466705
0x25a391

(6a) 01 -- breastplate of regeneration: +armor applies to melee
2466707
0x25a393

(6a) 16 -- brimstone breastplate: fire shield
2466887
0x25a447

(68) c8 00 00 00 -- brimstone breastplate: +20 armor
2466938
0x25a47a

(6a) 01 -- brimstone breastplate: +armor applies to melee
2466945
0x25a481

(6a) 01 -- brimstone breastplate: +armor applies to melee
2466947
0x25a483

(6a) 03 -- Spear of the Centaur: affects friendly creatures
2467812
0x25a7e4

(6a) 2f -- Spear of the Centaur: normal melee
2467814
0x25a7e6

(6a) 33 -- Spear of the Centaur: ranged
2467867
0x25a81b

(6a) 50 -- Spear of the Centaur: +8 attack
2467918
0x25a84e

(6a) 01 -- Spear of the Centaur: +attack applies to ranged
2467922
0x25a852

(6a) 01 -- Spear of the Centaur: +attack applies to melee
2467924
0x25a854

(6a) 20 -- Cloak of Distraction: Ignore Zones of Control
2468633
0x25ab19

(6a) 33 -- Crossbow: ranged
2469351
0x25ade7

(6a) 24 -- Crossbow: long range
2469404
0x25ae1c

(6a) 1e -- Crossbow: +3 attack
2469455
0x25ae4f

(6a) 01 -- Crossbow: +attack applies to ranged
2469459
0x25ae53

(6a) 00 -- Crossbow: +attack does NOT apply to melee
2469461
0x25ae55

(6a) 2d -- Crown of Enchantment: negate mind immunity
2469679
0x25af2f

(6a) 33 -- ???: ranged
2470244
0x25b164

(6a) 35 -- ???: ranged giant slayer
2470297
0x25b199

(6a) 33 -- Emerald Bow: ranged
2471965
0x25b81d

(68) 2c 01 00 00 -- Emerald Bow: +30 (+300) attack
2472016
0x25b850

(6a) 01 -- Emerald Bow: +attack applies to ranged
2472023
0x25b857

(6a) 00 -- Emerald Bow: +attack does NOT apply to melee
2472025
0x25b859

(6a) 02 -- Flaming Arrow: area attack
2472742
0x25bb26

(6a) 2b -- Giant Slayer: melee giant slayer
2473440
0x25bde0

(6a) 1e -- Giant Slayer: +3 melee defense
2473459
0x25bdf3

(6a) 1e -- Giant Slayer: +3 melee attack
2473465
0x25bdf9

(6a) 05 -- Ring of Greater Negation: affects all
2474020
0x25c024

(6a) 3f -- Ring of Greater Negation: magic vulnerability
2474022
0x25c026

(53) -- ???: ??? (the ability ID is in a register, ebx I think; we know by the preceding `6a 00` that this effect is applied to the hero wearing the artifact and no one else)
2510179
0x264d63

(6a) 33 -- ???: ranged
2510613
0x264f15

(6a) 64 -- ???: +10 attack (I think, I didn't check carefully)
2510650
0x264f3a

(6a) 01 -- ???: +attack applies to ranged (I think, didn't check carefully)
2510654
0x264f3e

(6a) 00 -- ???: +attack does NOT apply to melee (I think, didn't check carefully)
2510656
0x264f40

(6a) 10 --- ???: death ward (ability, not spell) (this one's strange, it's preceded by `6a 00` so it applies to the wearer, but I don't see code nearby to apply armor bonus that I'd expect from Armor of Death, and none of the other ward armors/armors show up in a hardcoded call to 2484608 (0x25e980) like this one does, and in fact I'm pretty sure those apply spells rather than abilities - so this might be one of the many unused/unfinished artifacts that exist in the code?)
2510938
0x26505a

---

And now here's artifacts which directly call the function at 2516320 (0x266560) to grant a spell effect (again except ones mentioned in my last post):

(6a) 24 -- Amulet of Fear: aura of fear
2463157
0x2595b5

(68) b8 00 00 00 -- ???: water walk (Water Walk is an unfinished adventure map spell left inside the game - presumably this is code for an unfinished artifact that grants it)
2465955
0x25a0a3

(6a) 28 -- Dragon Scale Armor: fire resistance
2471003
0x25b45b

(6a) 02 -- Fizbin of Misfortune: apply to enemy heroes
2472505
0x25ba39

(6a) 66 -- Fizbin of Misfortune: misfortune
2472507
0x25ba3b

(6a) 01 -- Fizbin of Misfortune: apply to enemy creatures
2472560
0x25ba70

(6a) 66 -- Fizbin of Misfortune: misfortune
2472562
0x25ba72

(68) 94 00 00 00 -- ???: mirth
2509745
0x264bb1

(6a) 4a -- ???: magic mirror
2510060
0x264cec

---

Also while looking through the above I spotted:

(6a) 02 -- Circlet of Wisdom: +2 spell point regen
2468479
0x25aa7f

(6a) 0a -- Circlet of Wisdom: +10 spell points
2468485
0x25aa85


-= Thoughts =-

This clearly isn't all of them.

We can probably find most of them without even resorting to fully reading and understanding the machine code by continuing to do what I'm doing: finding all other spots in the code which jump to addresses which we see known artifacts' code jumping to.

To find the two batches of artifacts in this post, I used a script like this (I mostly use WSL, so that's why the path starts with "/mnt/c", so just change as needed):

```
#!/usr/bin/env python3

with open("/mnt/c/GOG Games/HoMM 4 Complete/h4mod.exe", "rb") as file:
   data = file.read()

chunks = data.split(b"xe8")

position = len(chunks[0])
for index, chunk in enumerate(chunks[1:-1]):
   position += 1
   offset = int.from_bytes(chunk[0:4], byteorder='little', signed=True)
   address = position + 4 + offset
   if address == 2484608:
       print(position, chunk[0:4].hex(' '))
   position += len(chunk)
```

This finds all `e8` instructions (one of x86's CALL instructions) which jump to a specific offset/address in the binary (hardcoded to 2484608 in this example). So if you are able to run a basic Python 3 script, you could pick up where I left off by just replacing that known address with the next one of interest. I would assume the fancy reversing tools like IDA Pro can do something like this too.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
baronus
baronus


Legendary Hero
posted April 02, 2024 10:34 PM

Hoho great discoveries!
A lot of content.

It needs a Quality Point for you! Moderator!!!

I can give you adress for other thing:
http://heroescommunity.com/viewthread.php3?TID=24397&pagenumber=4
lion's shield has defence modalities for both troops and heroes, i found +40% defence for troops: 0065C627

Maybe in that area we have more artifacts?

Very good work!

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Galaad
Galaad

Hero of Order
Li mort as morz, li vif as vis
posted April 03, 2024 12:30 AM

baronus said:
Hoho great discoveries!
A lot of content.

It needs a Quality Point for you! Moderator!!!


Granted.

And so, welcome to the forums, nevon.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: Next Thread » This thread is 17 pages long: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 · «PREV
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0987 seconds