mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 10:52:22 +01:00
@@ -94,6 +94,14 @@ void AFortPawn::SetShield(float NewShield)
|
|||||||
this->ProcessEvent(SetShieldFn, &NewShield);
|
this->ProcessEvent(SetShieldFn, &NewShield);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AFortPawn::SetMaxShield(float NewShieldVal)
|
||||||
|
{
|
||||||
|
static auto SetMaxShieldFn = FindObject<UFunction>("/Script/FortniteGame.FortPawn.SetMaxShield");
|
||||||
|
|
||||||
|
if (SetMaxShieldFn)
|
||||||
|
this->ProcessEvent(SetMaxShieldFn, &NewShieldVal);
|
||||||
|
}
|
||||||
|
|
||||||
void AFortPawn::NetMulticast_Athena_BatchedDamageCuesHook(UObject* Context, FFrame* Stack, void* Ret)
|
void AFortPawn::NetMulticast_Athena_BatchedDamageCuesHook(UObject* Context, FFrame* Stack, void* Ret)
|
||||||
{
|
{
|
||||||
auto Pawn = (AFortPawn*)Context;
|
auto Pawn = (AFortPawn*)Context;
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ public:
|
|||||||
void SetHealth(float NewHealth);
|
void SetHealth(float NewHealth);
|
||||||
void SetMaxHealth(float NewHealthVal);
|
void SetMaxHealth(float NewHealthVal);
|
||||||
void SetShield(float NewShield);
|
void SetShield(float NewShield);
|
||||||
|
void SetMaxShield(float NewShieldVal);
|
||||||
static void NetMulticast_Athena_BatchedDamageCuesHook(UObject* Context, FFrame* Stack, void* Ret);
|
static void NetMulticast_Athena_BatchedDamageCuesHook(UObject* Context, FFrame* Stack, void* Ret);
|
||||||
static void MovingEmoteStoppedHook(UObject* Context, FFrame* Stack, void* Ret);
|
static void MovingEmoteStoppedHook(UObject* Context, FFrame* Stack, void* Ret);
|
||||||
|
|
||||||
|
|||||||
@@ -646,4 +646,60 @@ void AFortPlayerControllerAthena::UpdateTrackedAttributesHook(AFortPlayerControl
|
|||||||
|
|
||||||
if (ItemInstancesToRemove.size() > 0)
|
if (ItemInstancesToRemove.size() > 0)
|
||||||
WorldInventory->Update();
|
WorldInventory->Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AFortPlayerControllerAthena::ServerClientIsReadyToRespawnHook(AFortPlayerControllerAthena* PlayerControllerAthena)
|
||||||
|
{
|
||||||
|
AFortPlayerStateAthena* PlayerStateAthena = Cast<AFortPlayerStateAthena>(PlayerControllerAthena->GetPlayerState());
|
||||||
|
AFortGameModeAthena* GameModeAthena = Cast<AFortGameModeAthena>(GetWorld()->GetGameMode());
|
||||||
|
|
||||||
|
if (!PlayerStateAthena || !GameModeAthena)
|
||||||
|
return;
|
||||||
|
|
||||||
|
AFortGameStateAthena* GameStateAthena = Cast<AFortGameStateAthena>(GameModeAthena->GetGameState());
|
||||||
|
if (!GameStateAthena) return;
|
||||||
|
|
||||||
|
if (GameStateAthena->IsRespawningAllowed(PlayerStateAthena))
|
||||||
|
{
|
||||||
|
FFortRespawnData* RespawnData = PlayerStateAthena->GetRespawnData();
|
||||||
|
|
||||||
|
if (RespawnData->IsServerReady() && RespawnData->IsRespawnDataAvailable())
|
||||||
|
{
|
||||||
|
const FVector& RespawnLocation = RespawnData->GetRespawnLocation();
|
||||||
|
const FRotator& RespawnRotation = RespawnData->GetRespawnRotation();
|
||||||
|
|
||||||
|
// RestartPlayer doesn't work, idk why
|
||||||
|
static auto SpawnDefaultPawnAtTransformFn = FindObject<UFunction>(L"/Script/Engine.GameModeBase.SpawnDefaultPawnAtTransform");
|
||||||
|
|
||||||
|
FTransform SpawnTransform{};
|
||||||
|
SpawnTransform.Translation = RespawnLocation;
|
||||||
|
SpawnTransform.Rotation = RespawnRotation.Quaternion();
|
||||||
|
SpawnTransform.Scale3D = FVector(1, 1, 1);
|
||||||
|
|
||||||
|
struct { AController* NewPlayer; FTransform SpawnTransform; APawn* ReturnValue; }
|
||||||
|
AGameModeBase_SpawnDefaultPawnAtTransform_Params{ PlayerControllerAthena, SpawnTransform };
|
||||||
|
|
||||||
|
GameModeAthena->ProcessEvent(SpawnDefaultPawnAtTransformFn, &AGameModeBase_SpawnDefaultPawnAtTransform_Params);
|
||||||
|
|
||||||
|
AFortPlayerPawn* PlayerPawn = Cast<AFortPlayerPawn>(AGameModeBase_SpawnDefaultPawnAtTransform_Params.ReturnValue);
|
||||||
|
|
||||||
|
if (!PlayerPawn)
|
||||||
|
return;
|
||||||
|
|
||||||
|
PlayerPawn->SetOwner(PlayerControllerAthena);
|
||||||
|
|
||||||
|
PlayerControllerAthena->Possess(PlayerPawn);
|
||||||
|
|
||||||
|
PlayerPawn->SetMaxHealth(100);
|
||||||
|
PlayerPawn->SetHealth(100);
|
||||||
|
PlayerPawn->SetMaxShield(100);
|
||||||
|
PlayerPawn->SetShield(100);
|
||||||
|
|
||||||
|
PlayerControllerAthena->RespawnPlayerAfterDeath(true);
|
||||||
|
|
||||||
|
RespawnData->IsClientReady() = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
printf_s(__FUNCTION__"\n");
|
||||||
}
|
}
|
||||||
@@ -264,6 +264,7 @@ public:
|
|||||||
static void GetPlayerViewPointHook(AFortPlayerControllerAthena* PlayerController, FVector& Location, FRotator& Rotation);
|
static void GetPlayerViewPointHook(AFortPlayerControllerAthena* PlayerController, FVector& Location, FRotator& Rotation);
|
||||||
static void ServerReadyToStartMatchHook(AFortPlayerControllerAthena* PlayerController);
|
static void ServerReadyToStartMatchHook(AFortPlayerControllerAthena* PlayerController);
|
||||||
static void UpdateTrackedAttributesHook(AFortPlayerControllerAthena* PlayerController);
|
static void UpdateTrackedAttributesHook(AFortPlayerControllerAthena* PlayerController);
|
||||||
|
static void ServerClientIsReadyToRespawnHook(AFortPlayerControllerAthena* PlayerControllerAthena); // 1:1
|
||||||
|
|
||||||
static UClass* StaticClass()
|
static UClass* StaticClass()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,6 +30,18 @@ struct FFortRespawnData
|
|||||||
static auto bServerIsReadyOffset = FindOffsetStruct("/Script/FortniteGame.FortRespawnData", "bServerIsReady");
|
static auto bServerIsReadyOffset = FindOffsetStruct("/Script/FortniteGame.FortRespawnData", "bServerIsReady");
|
||||||
return *(bool*)(__int64(this) + bServerIsReadyOffset);
|
return *(bool*)(__int64(this) + bServerIsReadyOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FVector& GetRespawnLocation()
|
||||||
|
{
|
||||||
|
static auto RespawnLocationOffset = FindOffsetStruct("/Script/FortniteGame.FortRespawnData", "RespawnLocation");
|
||||||
|
return *(FVector*)(__int64(this) + RespawnLocationOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
FRotator& GetRespawnRotation()
|
||||||
|
{
|
||||||
|
static auto RespawnRotationOffset = FindOffsetStruct("/Script/FortniteGame.FortRespawnData", "RespawnRotation");
|
||||||
|
return *(FRotator*)(__int64(this) + RespawnRotationOffset);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FDeathInfo
|
struct FDeathInfo
|
||||||
|
|||||||
@@ -1285,6 +1285,13 @@ DWORD WINAPI Main(LPVOID)
|
|||||||
Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerController.ServerReadyToStartMatch"),
|
Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerController.ServerReadyToStartMatch"),
|
||||||
AFortPlayerControllerAthena::ServerReadyToStartMatchHook, (PVOID*)&AFortPlayerControllerAthena::ServerReadyToStartMatchOriginal, false);
|
AFortPlayerControllerAthena::ServerReadyToStartMatchHook, (PVOID*)&AFortPlayerControllerAthena::ServerReadyToStartMatchOriginal, false);
|
||||||
|
|
||||||
|
if (Fortnite_Version >= 14)
|
||||||
|
{
|
||||||
|
Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerControllerAthena.ServerClientIsReadyToRespawn"),
|
||||||
|
AFortPlayerControllerAthena::ServerClientIsReadyToRespawnHook, nullptr, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
auto ServerRequestSeatChangeFn = FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerControllerZone.ServerRequestSeatChange");
|
auto ServerRequestSeatChangeFn = FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerControllerZone.ServerRequestSeatChange");
|
||||||
|
|
||||||
if (ServerRequestSeatChangeFn)
|
if (ServerRequestSeatChangeFn)
|
||||||
|
|||||||
Reference in New Issue
Block a user