Code:
//********************************************************функция патча монстров
procedure PatchMonsters;
const
Places96:array[0..8] of DWord=($47E17C, $47E299, $47E38D, $47E3B6, $4976BB, $497759, $497F88, $49804F, $4B784E);
Places95:array[0..3] of DWord=($40EF05, $47AA5F, $497567, $497D89);
Places91:array[0..1] of DWord=($40E0BD, $40E0ED);
// Release monsters hints
PatchPtr1 = pointer($48CC81);
StdData1:array[0..3] of byte=
($8B, $70, $14, // mov esi, [eax+14h]
$90); // nop
NewData1:array[0..3] of byte=
($8B, $74, $06, $14); //mov esi, [eax+esi+14h]
// Event, Pandora, Seer Task Add/Edit:Странная проверка, мешающая монстрам 8 ур
PatchPtr2 = pointer($40E0E0);
StdData2:array[0..1] of byte=($F7, $D8); // neg eax
NewData2:array[0..1] of byte=($B0, $01); // mov esi, [eax+esi+14h]
// Release monsters hints on map
PatchPtr3 = pointer($488A9B);
StdData3:array[0..2] of byte=($79, $14, $90);
NewData3:array[0..2] of byte=($7C, $08, $14);
var i:integer;
begin
//заглушить загрузку crtrait0.txt
DoPatch1(PDWord($45C722),Byte($90));
DoPatch4(PDWord($45C723),Dword($90909090));
//перенести таблицу со структурой монстров (57DEA0h)
DoPatch4(PDWord($582298),Dword(MonList)); //BASE
//увеличить лимит монстров (150->MaxMon+1)
for i:=0 to high(places96) do DoPatch4(ptr(places96[i]), MaxMon+1);
//увеличить лимит монстров (149->MaxMon)
for i:=0 to high(places95) do DoPatch4(ptr(places95[i]), MaxMon);
//увеличить лимит монстров (145->MaxMon+1)
for i:=0 to high(places91) do DoPatch4(ptr(places91[i]), MaxMon+1);
DoPatch(PatchPtr1,@NewData1[0],SizeOf(NewData1));
DoPatch(PatchPtr2,@NewData2[0],SizeOf(NewData2));
DoPatch(PatchPtr3,@NewData3[0],SizeOf(NewData3));
end;