Skip to content

Commit fc2ab20

Browse files
committed
add support of The Bulwark castle
1 parent 13620fc commit fc2ab20

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

Heroes3Editor/Models/Constants.cs

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ public class Skills
155155
{24, "Intelligence"},
156156
{25, "Sorcery"},
157157
{26, "Resistance"},
158-
{27, "First Aid"}
158+
{27, "First Aid"},
159+
{28, "Interference"},
160+
{29, "Runes"},
159161
};
160162

161163
private static readonly Dictionary<string, int> _codesByName = _namesByCode.ToDictionary(i => i.Value, i => i.Key);
@@ -165,6 +167,7 @@ public class Skills
165167
public string this[int key] => _namesByCode[key];
166168

167169
public int this[string key] => _codesByName[key];
170+
public int Count => _codesByName.Count;
168171
}
169172

170173
public class Weapons : BaseArtifact
@@ -330,7 +333,7 @@ public Neck()
330333
{0x69, "Pendant of Free Will" },
331334
{0x6A, "Pendant of Negativity" },
332335
{0x6B, "Pendant of Total Recall" },
333-
{0x6C, "Pendant of Courage" }
336+
{0x6C, "Pendant of Courage" },
334337
};
335338
_HOTANamesByCode = new Dictionary<byte, string>() {
336339
{0x8E, "Pendant of Reflection" },
@@ -828,14 +831,16 @@ public class Spells
828831
{66, "Summon_Fire_Elemental"},
829832
{67, "Summon_Earth_Elemental"},
830833
{68, "Summon_Water_Elemental"},
831-
{69, "Summon_Air_Elemental"}
834+
{69, "Summon_Air_Elemental"},
832835
};
833836

834837
private static readonly Dictionary<string, int> _codesByName = _namesByCode.ToDictionary(i => i.Value, i => i.Key);
835838

836839
public string this[int key] => _namesByCode[key];
837840

838841
public int this[string key] => _codesByName[key];
842+
843+
public int Count => _codesByName.Count;
839844
}
840845

841846
public class Creatures : BaseArtifact
@@ -1020,6 +1025,20 @@ public Creatures()
10201025
{183, "Crimson Couatls"},
10211026
{184, "Gantry"},
10221027
{185, "Juggernauts"},
1028+
{186, "Kobolds"},
1029+
{187, "Kobold Foreman"},
1030+
{188,"Mountain Rams"},
1031+
{189, "Argali"},
1032+
{190, "Snow Elves"},
1033+
{191, "Steel Elf"},
1034+
{192, "Yeti"},
1035+
{193, "Yeti Runemaster"},
1036+
{194, "Shamans"},
1037+
{195, "Great Shaman"},
1038+
{196, "Mammoths"},
1039+
{197, "War Mammoth"},
1040+
{198, "Jotunns"},
1041+
{199, "Jotunn Warlord"},
10231042
};
10241043
}
10251044
}

Heroes3Editor/Models/Game.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public Hero(string name, Game game, int bytePosition)
162162
Attributes[i] = _game.Bytes[BytePosition + Constants.HeroOffsets["Attributes"] + i];
163163

164164
NumOfSkills = _game.Bytes[BytePosition + Constants.HeroOffsets["NumOfSkills"]];
165-
for (int i = 0; i < 28; ++i)
165+
for (int i = 0; i < Constants.Skills.Count; ++i)
166166
{
167167
var skillSlotIndex = _game.Bytes[BytePosition + Constants.HeroOffsets["SkillSlots"] + i];
168168
if (skillSlotIndex != 0)
@@ -172,7 +172,7 @@ public Hero(string name, Game game, int bytePosition)
172172
}
173173
}
174174

175-
for (int i = 0; i < 70; ++i)
175+
for (int i = 0; i < Constants.Spells.Count; ++i)
176176
{
177177
if (_game.Bytes[BytePosition + Constants.HeroOffsets["Spells"] + i] == 1)
178178
Spells.Add(Constants.Spells[i]);

0 commit comments

Comments
 (0)