Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
youneuoy committed Sep 18, 2024
2 parents fb3f5b9 + de38576 commit 485dfa4
Show file tree
Hide file tree
Showing 31 changed files with 1,336 additions and 416 deletions.
542 changes: 535 additions & 7 deletions M2TWEOP Code/M2TWEOP library/Injects.cpp

Large diffs are not rendered by default.

265 changes: 265 additions & 0 deletions M2TWEOP Code/M2TWEOP library/Injects.h
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,271 @@ class onAddSettlementToDiplomacyScroll
LPVOID funcAddress;
};

class onPartialConstructionPush
:public AATemplate
{
public:
onPartialConstructionPush(MemWork* mem, LPVOID addr, int ver);
~onPartialConstructionPush() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onAddBuilding
:public AATemplate
{
public:
onAddBuilding(MemWork* mem, LPVOID addr, int ver);
~onAddBuilding() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onRemoveBuilding
:public AATemplate
{
public:
onRemoveBuilding(MemWork* mem, LPVOID addr, int ver);
~onRemoveBuilding() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onGetBuildingById
:public AATemplate
{
public:
onGetBuildingById(MemWork* mem, LPVOID addr, int ver);
~onGetBuildingById() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onConflictTest
:public AATemplate
{
public:
onConflictTest(MemWork* mem, LPVOID addr, int ver);
~onConflictTest() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onConflictTest2
:public AATemplate
{
public:
onConflictTest2(MemWork* mem, LPVOID addr, int ver);
~onConflictTest2() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onCheckBuildUpgrade
:public AATemplate
{
public:
onCheckBuildUpgrade(MemWork* mem, LPVOID addr, int ver);
~onCheckBuildUpgrade() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onCheckBuildUpgrade2
:public AATemplate
{
public:
onCheckBuildUpgrade2(MemWork* mem, LPVOID addr, int ver);
~onCheckBuildUpgrade2() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onCheckSettHasBuilding
:public AATemplate
{
public:
onCheckSettHasBuilding(MemWork* mem, LPVOID addr, int ver);
~onCheckSettHasBuilding() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class getPossibleConstructions
:public AATemplate
{
public:
getPossibleConstructions(MemWork* mem, LPVOID addr, int ver);
~getPossibleConstructions() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onSetCqFlags
:public AATemplate
{
public:
onSetCqFlags(MemWork* mem, LPVOID addr, int ver);
~onSetCqFlags() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onSetCqFlags2
:public AATemplate
{
public:
onSetCqFlags2(MemWork* mem, LPVOID addr, int ver);
~onSetCqFlags2() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onRemoveCqFlags
:public AATemplate
{
public:
onRemoveCqFlags(MemWork* mem, LPVOID addr, int ver);
~onRemoveCqFlags() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onRemoveCqFlags2
:public AATemplate
{
public:
onRemoveCqFlags2(MemWork* mem, LPVOID addr, int ver);
~onRemoveCqFlags2() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onAddBuildingCapsAfterConstruction
:public AATemplate
{
public:
onAddBuildingCapsAfterConstruction(MemWork* mem, LPVOID addr, int ver);
~onAddBuildingCapsAfterConstruction() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onAddBuildingCapsAfterConstruction2
:public AATemplate
{
public:
onAddBuildingCapsAfterConstruction2(MemWork* mem, LPVOID addr, int ver);
~onAddBuildingCapsAfterConstruction2() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onAddBuildingCapsAfterConstruction3
:public AATemplate
{
public:
onAddBuildingCapsAfterConstruction3(MemWork* mem, LPVOID addr, int ver);
~onAddBuildingCapsAfterConstruction3() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onAddBuildingCapsAfterConstruction4
:public AATemplate
{
public:
onAddBuildingCapsAfterConstruction4(MemWork* mem, LPVOID addr, int ver);
~onAddBuildingCapsAfterConstruction4() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onAddBuildingCapsAfterConstruction5
:public AATemplate
{
public:
onAddBuildingCapsAfterConstruction5(MemWork* mem, LPVOID addr, int ver);
~onAddBuildingCapsAfterConstruction5() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onGetDefensesBuilding
:public AATemplate
{
public:
onGetDefensesBuilding(MemWork* mem, LPVOID addr, int ver);
~onGetDefensesBuilding() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};


class onIsBuildingTypePresentAtMinLevel
:public AATemplate
{
public:
onIsBuildingTypePresentAtMinLevel(MemWork* mem, LPVOID addr, int ver);
~onIsBuildingTypePresentAtMinLevel() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onGetBuildingByIdConst
:public AATemplate
{
public:
onGetBuildingByIdConst(MemWork* mem, LPVOID addr, int ver);
~onGetBuildingByIdConst() = default;

void SetNewCode();
private:
LPVOID funcAddress;
};

class onDecideMissionTarget
:public AATemplate
{
Expand Down
26 changes: 26 additions & 0 deletions M2TWEOP Code/M2TWEOP library/functionsOffsets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ void codes::initCodes(int gameVer)
offsets.deleteFortFuncOne = 0x00BB5B80;
offsets.deleteFortFuncTwo = 0x004BCA80;
offsets.createFortFunc = 0x00714760;
offsets.createsFort = 0x8B8C00;
offsets.addToFortsArray = 0x4BD330;
offsets.mercEOPValue = 0x0190B928;

offsets.getUnitByLabel = 0x0A945A0;
Expand Down Expand Up @@ -316,6 +318,17 @@ void codes::initCodes(int gameVer)
offsets.releaseCultureSettlement = 0x8B9C50;
offsets.createCultureFort = 0x8B9B10;
offsets.createCultureCasEntry = 0x8B88C0;
offsets.getEntriesByFaction = 0x8A8300;
offsets.createSettlementConditionContext = 0x609690;
offsets.isBuildingTypePresent = 0x6089C0;
offsets.canSettlementUpgrade = 0x5DB410;
offsets.isLevelAvailableForLevel = 0x5FE0D0;
offsets.evaluateBuildingGuard = 0x5FCC60;
offsets.createConstructionOption = 0x5FAD70;
offsets.createConvertSett = 0x5FAC00;
offsets.createBuildingSett = 0x5FAB60;
offsets.buildQueueConflictTest = 0x5EB100;
offsets.removeBuildingSelection = 0x5FA3A0;
}


Expand Down Expand Up @@ -449,6 +462,8 @@ void codes::initCodes(int gameVer)
offsets.deleteFortFuncOne = 0x00bafef0;
offsets.deleteFortFuncTwo = 0x004bd010;
offsets.createFortFunc = 0x00714E60;
offsets.createsFort = 0x8B95F0;
offsets.addToFortsArray = 0x4BD8C0;
offsets.mercEOPValue = 0x018C27C8;

offsets.getUnitByLabel = 0x0A95600;
Expand Down Expand Up @@ -634,5 +649,16 @@ void codes::initCodes(int gameVer)
offsets.releaseCultureSettlement = 0x8BA640;
offsets.createCultureFort = 0x8BA500;
offsets.createCultureCasEntry = 0x8B92B0;
offsets.getEntriesByFaction = 0x8A8CE0;
offsets.createSettlementConditionContext = 0x00609A40;
offsets.isBuildingTypePresent = 0x00608D70;
offsets.canSettlementUpgrade = 0x005DB8D0;
offsets.isLevelAvailableForLevel = 0x005FE4C0;
offsets.evaluateBuildingGuard = 0x005FD050;
offsets.createConstructionOption = 0x005FB160;
offsets.createConvertSett = 0x005FAFF0;
offsets.createBuildingSett = 0x005FAF50;
offsets.buildQueueConflictTest = 0x005EB560;
offsets.removeBuildingSelection = 0x005FA790;
}
}
13 changes: 13 additions & 0 deletions M2TWEOP Code/M2TWEOP library/functionsOffsets.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,17 @@ class codes
DWORD getStringFromTable = NULL;
DWORD scriptCommandOne = NULL;
DWORD scriptCommandTwo = NULL;
DWORD getEntriesByFaction = NULL;
DWORD createSettlementConditionContext = NULL;
DWORD isBuildingTypePresent = NULL;
DWORD canSettlementUpgrade = NULL;
DWORD isLevelAvailableForLevel = NULL;
DWORD evaluateBuildingGuard = NULL;
DWORD createConstructionOption = NULL;
DWORD createConvertSett = NULL;
DWORD createBuildingSett = NULL;
DWORD buildQueueConflictTest = NULL;
DWORD removeBuildingSelection = NULL;


DWORD autoResolveFunc = NULL;
Expand All @@ -137,6 +148,8 @@ class codes
DWORD deleteFortFuncOne = NULL;
DWORD deleteFortFuncTwo = NULL;
DWORD createFortFunc = NULL;
DWORD createsFort = NULL;
DWORD addToFortsArray = NULL;
DWORD mercEOPValue = NULL;
DWORD makeConditionFunc = NULL;
DWORD getEquipmentPreferencesFunc = NULL;
Expand Down
Loading

0 comments on commit 485dfa4

Please sign in to comment.