Code:
int flux_X_offsets[] = {0,2,4,6,1,3,5,
3,4,1,2,0,6,
5,1,3,5};
int flux_Y_offsets[] = {3,3,3,3,4,4,4,
1,0,1,0,0,0,
1,2,2,2}; //позиции в сетке
int flux_buildings[] = {0x1E,0x1F,0x20,0x21,0x22,0x23,0x24,
0x00,0x05,0x0E,0x07,0x0A,0x10,
21,18,17,24};//строения
int __stdcall HallBldFix(LoHook* h, HookContext* c)
{
if( o_TownMgr->town->type == 8)
{
c->edx = flux_buildings[c->ecx];
if (o_TownMgr->town->IsBuildingBuilt(9,1) && c->edx == 7) c->edx = 23; //а тут мы даем новое спецстроенне в клетке форта после постройки замка
return NO_EXEC_DEFAULT;
}
return EXEC_DEFAULT;
}
int __stdcall HallLocFix(LoHook* h, HookContext* c)
{
//148 3D0
*(int*)0x5CC933 = (int)flux_Y_offsets - c->ebp;
*(int*)0x5CC954 = (int)flux_X_offsets - c->ebp;
*(int*)0x5CC9A4 = (int)flux_Y_offsets - c->ebp;
*(int*)0x5CC9B5 = (int)flux_X_offsets - c->ebp;
*(int*)0x5CCA0F = (int)flux_Y_offsets - c->ebp;
*(int*)0x5CCA2D = (int)flux_X_offsets - c->ebp;
*(int*)0x5CCA79 = (int)flux_Y_offsets - c->ebp;
*(int*)0x5CCA9A = (int)flux_X_offsets - c->ebp;
return EXEC_DEFAULT;
}
..
//не строим домики (освобождаем строение 23)
*(char*)0x5BEFF6 = 99;
//окно холла
//*(char*)0x66D044 = 18; //количество строений в окне холла
//*(char*)0x836B30 = 18;
emerald->WriteLoHook(0x5CA8FC,(void*)HallLocFix);
emerald->WriteLoHook(0x460DE2,(void*)HallBldFix);