mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 10:52:22 +01:00
Some Event Fixes, 18.10 Crash fix, random crash after a few minutes for s17+
This commit is contained in:
@@ -205,6 +205,28 @@ bool AActor::IsPendingKillPending()
|
|||||||
return IsActorBeingDestroyed() || !IsValidChecked(this);
|
return IsActorBeingDestroyed() || !IsValidChecked(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UObject* AActor::AddComponentByClass(UClass* Class)
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
UClass* Class;
|
||||||
|
bool bManualAttachment;
|
||||||
|
FTransform RelativeTransform;
|
||||||
|
bool bDeferredFinish;
|
||||||
|
UObject* ReturnValue;
|
||||||
|
} params;
|
||||||
|
params.Class = Class;
|
||||||
|
params.bManualAttachment = false;
|
||||||
|
params.RelativeTransform = FTransform();
|
||||||
|
params.bDeferredFinish = true;
|
||||||
|
|
||||||
|
static UFunction* AddComp = FindObject<UFunction>("/Script/Engine.Actor:AddComponentByClass");
|
||||||
|
|
||||||
|
this->ProcessEvent(AddComp, ¶ms);
|
||||||
|
|
||||||
|
return params.ReturnValue;
|
||||||
|
}
|
||||||
|
|
||||||
float& AActor::GetNetUpdateFrequency()
|
float& AActor::GetNetUpdateFrequency()
|
||||||
{
|
{
|
||||||
static auto NetUpdateFrequencyOffset = GetOffset("NetUpdateFrequency");
|
static auto NetUpdateFrequencyOffset = GetOffset("NetUpdateFrequency");
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ public:
|
|||||||
void ForceNetUpdate();
|
void ForceNetUpdate();
|
||||||
bool IsNetStartupActor();
|
bool IsNetStartupActor();
|
||||||
bool IsPendingKillPending();
|
bool IsPendingKillPending();
|
||||||
|
UObject* AddComponentByClass(UClass* Class);
|
||||||
float& GetNetUpdateFrequency();
|
float& GetNetUpdateFrequency();
|
||||||
float& GetMinNetUpdateFrequency();
|
float& GetMinNetUpdateFrequency();
|
||||||
const AActor* GetNetOwner() const;
|
const AActor* GetNetOwner() const;
|
||||||
|
|||||||
@@ -159,7 +159,20 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll
|
|||||||
|
|
||||||
auto& StartingItems = ((AFortGameModeAthena*)GameMode)->GetStartingItems();
|
auto& StartingItems = ((AFortGameModeAthena*)GameMode)->GetStartingItems();
|
||||||
|
|
||||||
NewPlayerAsAthena->AddPickaxeToInventory();
|
if (Globals::bGoingToPlayEvent && Fortnite_Version >= 16.00)
|
||||||
|
{
|
||||||
|
auto WID = Cast<UFortWorldItemDefinition>(FindObject("WID_EventMode_Activator", nullptr, ANY_PACKAGE)); // Empty Hands
|
||||||
|
|
||||||
|
bool bShouldUpdate = false;
|
||||||
|
WorldInventory->AddItem(WID, &bShouldUpdate, 1);
|
||||||
|
|
||||||
|
if (bShouldUpdate)
|
||||||
|
WorldInventory->Update();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NewPlayerAsAthena->AddPickaxeToInventory();
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < StartingItems.Num(); ++i)
|
for (int i = 0; i < StartingItems.Num(); ++i)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -211,9 +211,305 @@ void ActivatePhaseAtIndexHook(UObject* SpecialEventScript, int Index)
|
|||||||
static auto OnRep_ReplicatedActivePhaseIndexFn = FindObject<UFunction>("/Script/SpecialEventGameplayRuntime.SpecialEventScript.OnRep_ReplicatedActivePhaseIndex");
|
static auto OnRep_ReplicatedActivePhaseIndexFn = FindObject<UFunction>("/Script/SpecialEventGameplayRuntime.SpecialEventScript.OnRep_ReplicatedActivePhaseIndex");
|
||||||
SpecialEventScript->ProcessEvent(OnRep_ReplicatedActivePhaseIndexFn);
|
SpecialEventScript->ProcessEvent(OnRep_ReplicatedActivePhaseIndexFn);
|
||||||
|
|
||||||
|
auto ClientConnections = GetWorld()->GetNetDriver()->GetClientConnections();
|
||||||
|
|
||||||
|
// Rift Tour
|
||||||
|
if (Fortnite_Version == 17.30)
|
||||||
|
{
|
||||||
|
auto EventPlaylist = GetEventPlaylist();
|
||||||
|
|
||||||
|
struct { UObject* GameState; UObject* Playlist; FGameplayTagContainer PlaylistContextTags; } OnReadyParams{ Cast<AFortGameStateAthena>(GetWorld()->GetGameState()), EventPlaylist };
|
||||||
|
|
||||||
|
{
|
||||||
|
if (Index == 0) // Start of Event
|
||||||
|
{
|
||||||
|
auto MasterScripting = FindObject<UObject>("/Buffet/Levels/Buffet_P.Buffet_P:PersistentLevel.BP_Event_Master_Scripting_2");
|
||||||
|
|
||||||
|
auto AllSatelliteDishes = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FindObject<UClass>("/Game/Athena/Apollo/Environments/BuildingActors/Complex/Props/Apollo_Complex_Satellite_Dish_Top_01.Apollo_Complex_Satellite_Dish_Top_01_C"));
|
||||||
|
|
||||||
|
for (int i = 0; i < AllSatelliteDishes.Num(); i++)
|
||||||
|
{
|
||||||
|
AllSatelliteDishes.At(i)->K2_DestroyActor();
|
||||||
|
}
|
||||||
|
|
||||||
|
MasterScripting->ProcessEvent(MasterScripting->FindFunction("EnableTheMutator"));
|
||||||
|
|
||||||
|
for (int i = 0; i < ClientConnections.Num(); i++)
|
||||||
|
{
|
||||||
|
auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn();
|
||||||
|
auto CurrentController = ClientConnections.At(i)->GetPlayerController();
|
||||||
|
|
||||||
|
CurrentController->AddComponentByClass(FindObject<UClass>("/Script/SpecialEventGameplayRuntime.FortControllerComponent_SpecialEvent"));
|
||||||
|
CurrentPawn->AddComponentByClass(FindObject<UClass>("/Script/BuffetRuntime.FortSpecialRelevancyPawnAttachComponent"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Index == 1) // Memories, BP_Buffet_PhaseScripting_Phase1_C
|
||||||
|
{
|
||||||
|
//EventPawn->TeleportTo(FVector(-963.630f, 25453.090f, 359392.125f), EventPawn->GetActorRotation());
|
||||||
|
|
||||||
|
auto Phase1Scripting = FindObject("/Buffet/Levels/Buffet_Part_3.Buffet_Part_3:PersistentLevel.BP_Buffet_PhaseScripting_Phase1_2");
|
||||||
|
|
||||||
|
auto TeleportRef = Phase1Scripting->Get<AActor*>(Phase1Scripting->GetOffset("TeleportRef"));
|
||||||
|
|
||||||
|
//EventPawn->TeleportTo(TeleportRef->GetActorLocation(), EventPawn->GetActorRotation());
|
||||||
|
|
||||||
|
for (int i = 0; i < ClientConnections.Num(); i++)
|
||||||
|
{
|
||||||
|
auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn();
|
||||||
|
|
||||||
|
//CurrentPawn->TeleportTo(TeleportRef->GetActorLocation(), CurrentPawn->GetActorRotation());
|
||||||
|
|
||||||
|
//Globals::PawnTeleportRotDefault = CurrentPawn->GetActorRotation();
|
||||||
|
|
||||||
|
CurrentPawn->ForceNetUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Index == 2) // Slide
|
||||||
|
{
|
||||||
|
auto Script = FindObject<UObject>("/Buffet/Levels/Buffet_Part_4.Buffet_Part_4.PersistentLevel.BP_Buffet_PhaseScripting_Paint_4");
|
||||||
|
|
||||||
|
Script->Get<bool>(Script->GetOffset("bRaceStarted")) = true;
|
||||||
|
Script->ProcessEvent(Script->FindFunction("OnRep_bRaceStarted"));
|
||||||
|
|
||||||
|
Script->ProcessEvent(Script->FindFunction("OnReady_4E0ADA484A9A29A99CA6DD97BE645F09"), &OnReadyParams);
|
||||||
|
|
||||||
|
for (int i = 0; i < ClientConnections.Num(); i++)
|
||||||
|
{
|
||||||
|
auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn();
|
||||||
|
auto CurrentController = ClientConnections.At(i)->GetPlayerController();
|
||||||
|
|
||||||
|
auto PlayerComponent = CurrentPawn->AddComponentByClass(FindObject<UClass>("/Buffet/Gameplay/Blueprints/WrapWorldPrototype/BP_Buffet_Paint_PlayerComponent.BP_Buffet_Paint_PlayerComponent_C"));
|
||||||
|
CurrentPawn->AddComponentByClass(FindObject<UClass>("/Buffet/Gameplay/Blueprints/WrapWorldPrototype/BP_Buffet_Paint_IntroTrackFinder.BP_Buffet_Paint_IntroTrackFinder_C"));
|
||||||
|
auto MovementComponent = CurrentPawn->AddComponentByClass(FindObject<UClass>("/Buffet/Gameplay/Blueprints/WrapWorldPrototype/BP_Buffet_Paint_MovementComponent.BP_Buffet_Paint_MovementComponent_C"));
|
||||||
|
|
||||||
|
PlayerComponent->Get<UObject*>(PlayerComponent->GetOffset("MovementComponent")) = MovementComponent;
|
||||||
|
|
||||||
|
PlayerComponent->ProcessEvent(PlayerComponent->FindFunction("InitializePaintComponent"));
|
||||||
|
PlayerComponent->ProcessEvent(PlayerComponent->FindFunction("InitializeMovementComponent"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Index == 4) // Storm King
|
||||||
|
{
|
||||||
|
auto StormScript = FindObject<AActor>("/Buffet/Levels/Buffet_Part_6.Buffet_Part_6:PersistentLevel.BP_Buffet_PhaseScripting_4");
|
||||||
|
|
||||||
|
auto DefaultPlane = FindObject("/Buffet/Gameplay/Blueprints/WolfMother/BP_PlanePrototype.Default__BP_PlanePrototype_C");
|
||||||
|
|
||||||
|
{
|
||||||
|
auto WID = Cast<UFortWorldItemDefinition>(FindObject("WID_Buffet_BeatMatchingBoomBox", nullptr, ANY_PACKAGE)); // Storm King weapon thing
|
||||||
|
|
||||||
|
for (int i = 0; i < ClientConnections.Num(); i++)
|
||||||
|
{
|
||||||
|
auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn();
|
||||||
|
auto CurrentController = (AFortPlayerControllerAthena*)ClientConnections.At(i)->GetPlayerController();
|
||||||
|
|
||||||
|
auto WorldInventory = CurrentController->GetWorldInventory();
|
||||||
|
|
||||||
|
bool bShouldUpdate = false;
|
||||||
|
WorldInventory->AddItem(WID, &bShouldUpdate, 1);
|
||||||
|
|
||||||
|
if (bShouldUpdate)
|
||||||
|
WorldInventory->Update();
|
||||||
|
|
||||||
|
SendMessageToConsole(CurrentController, L"Gave WID_Buffet_BeatMatchingBoomBox!");
|
||||||
|
}
|
||||||
|
|
||||||
|
auto AllWeps = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FindObject<UClass>("/Buffet/Gameplay/Blueprints/WolfMother/BeatmatchingWeapon/B_Buffet_BeatMatchingWeaponPrototype.B_Buffet_BeatMatchingWeaponPrototype_C"));
|
||||||
|
|
||||||
|
for (int i = 0; i < AllWeps.Num(); i++)
|
||||||
|
{
|
||||||
|
auto CurrentWep = AllWeps.At(i);
|
||||||
|
|
||||||
|
if (CurrentWep != nullptr)
|
||||||
|
{
|
||||||
|
CurrentWep->Get<AActor*>(CurrentWep->GetOffset("Phase4ScriptingRef")) = StormScript;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Index == 5) // Ariana Knocked
|
||||||
|
{
|
||||||
|
auto ReviveScripting = FindObject("/Buffet/Levels/Buffet_Reflect.Buffet_Reflect:PersistentLevel.BP_Buffet_PhaseScripting_Revive_2");
|
||||||
|
|
||||||
|
auto ManualTeleportLocation = ReviveScripting->Get<FVector>(ReviveScripting->GetOffset("ManualTeleportLocation"));
|
||||||
|
|
||||||
|
auto ManualTeleportRotation = ReviveScripting->Get<FRotator>(ReviveScripting->GetOffset("Manual_Teleport_Rotation"));
|
||||||
|
|
||||||
|
for (int i = 0; i < ClientConnections.Num(); i++)
|
||||||
|
{
|
||||||
|
auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Index == 6) // Ariana
|
||||||
|
{
|
||||||
|
for (int i = 0; i < ClientConnections.Num(); i++)
|
||||||
|
{
|
||||||
|
auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn();
|
||||||
|
|
||||||
|
CurrentPawn->AddComponentByClass(FindObject<UClass>("/Buffet/Gameplay/Blueprints/Stars/BP_Buffet_Stars_PlayerComponent.BP_Buffet_Stars_PlayerComponent_C"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Index == 7) // Ariana Dance
|
||||||
|
{
|
||||||
|
auto ReviveScripting = FindObject("/Buffet/Levels/Buffet_Reflect.Buffet_Reflect:PersistentLevel.BP_Buffet_PhaseScripting_Revive_2");
|
||||||
|
|
||||||
|
auto ReflectScripting = FindObject("/Buffet/Levels/Buffet_Reflect.Buffet_Reflect:PersistentLevel.BP_Buffet_PhaseScripting_Reflect_2");
|
||||||
|
|
||||||
|
auto ManualTeleportRotation = ReviveScripting->Get<FRotator>(ReviveScripting->GetOffset("Manual_Teleport_Rotation"));
|
||||||
|
|
||||||
|
for (int i = 0; i < ClientConnections.Num(); i++)
|
||||||
|
{
|
||||||
|
auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn();
|
||||||
|
|
||||||
|
CurrentPawn->AddComponentByClass(FindObject<UClass>("/BuffetPlaylist/Playlist/BuffetCharacterMovementMutatorComponent.BuffetCharacterMovementMutatorComponent_C"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Index == 8) // Bubbles
|
||||||
|
{
|
||||||
|
auto BubblesScripting = FindObject<UObject>("/Buffet/Levels/Buffet_Bubbles.Buffet_Bubbles:PersistentLevel.BP_Buffet_PhaseScripting_Bubble_4");
|
||||||
|
|
||||||
|
BubblesScripting->Get<bool>(BubblesScripting->GetOffset("bUsePlayerMovementMode")) = false;
|
||||||
|
|
||||||
|
BubblesScripting->Get<AActor*>(BubblesScripting->GetOffset("FollowActor")) = FindObject<AActor>("/Buffet/Levels/Buffet_Bubbles.Buffet_Bubbles:PersistentLevel.BP_Buffet_BubbleFollowActor_2");
|
||||||
|
}
|
||||||
|
if (Index == 9) // Clouds
|
||||||
|
{
|
||||||
|
for (int i = 0; i < ClientConnections.Num(); i++)
|
||||||
|
{
|
||||||
|
auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn();
|
||||||
|
|
||||||
|
auto RemoveComponent = CurrentPawn->GetComponentByClass(FindObject<UClass>("/Buffet/Gameplay/Blueprints/Stars/BP_Buffet_Stars_PlayerComponent.BP_Buffet_Stars_PlayerComponent_C"));
|
||||||
|
|
||||||
|
CurrentPawn->ProcessEvent(CurrentPawn->FindFunction("K2_DestroyComponent"), RemoveComponent);
|
||||||
|
|
||||||
|
CurrentPawn->AddComponentByClass(FindObject<UClass>("/Buffet/Gameplay/Blueprints/Llama/BP_Buffet_Llama_PlayerComponent.BP_Buffet_Llama_PlayerComponent_C"));
|
||||||
|
CurrentPawn->AddComponentByClass(FindObject<UClass>("/Buffet/Gameplay/Blueprints/PostEvent/LlamaSpeedControlComponent.LlamaSpeedControlComponent_C"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Index == 10) // Escher
|
||||||
|
{
|
||||||
|
for (int i = 0; i < ClientConnections.Num(); i++)
|
||||||
|
{
|
||||||
|
auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn();
|
||||||
|
|
||||||
|
CurrentPawn->TeleportTo(FVector(36.34f, 1044.07f, 504.50f), CurrentPawn->GetActorRotation());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Fortnite_Version == 18.40)
|
||||||
|
{
|
||||||
|
if (Index == 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < ClientConnections.Num(); i++)
|
||||||
|
{
|
||||||
|
auto CurrentController = (AFortPlayerControllerAthena*)ClientConnections.At(i)->GetPlayerController();
|
||||||
|
|
||||||
|
static auto StormEffectClass = FindObject<UClass>(L"/Game/Athena/SafeZone/GE_OutsideSafeZoneDamage.GE_OutsideSafeZoneDamage_C");
|
||||||
|
auto PlayerState = CurrentController->GetPlayerStateAthena();
|
||||||
|
PlayerState->GetAbilitySystemComponent()->RemoveActiveGameplayEffectBySourceEffect(StormEffectClass, 1, PlayerState->GetAbilitySystemComponent());
|
||||||
|
}
|
||||||
|
|
||||||
|
auto AssultWID = Cast<UFortWorldItemDefinition>(FindObject("WID_Guava_Assault_AutoHigh_Athena_SR_Ore_T03", nullptr, ANY_PACKAGE));
|
||||||
|
auto RevolveWID = Cast<UFortWorldItemDefinition>(FindObject("WID_Guava_Pistol_SixShooter_Athena_SR_Ore_T03", nullptr, ANY_PACKAGE));
|
||||||
|
|
||||||
|
for (int i = 0; i < ClientConnections.Num(); i++)
|
||||||
|
{
|
||||||
|
auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn();
|
||||||
|
auto CurrentController = (AFortPlayerControllerAthena*)ClientConnections.At(i)->GetPlayerController();
|
||||||
|
|
||||||
|
auto WorldInventory = CurrentController->GetWorldInventory();
|
||||||
|
|
||||||
|
bool bShouldUpdate = true;
|
||||||
|
WorldInventory->AddItem(AssultWID, &bShouldUpdate, 1);
|
||||||
|
WorldInventory->AddItem(RevolveWID, &bShouldUpdate, 1);
|
||||||
|
|
||||||
|
|
||||||
|
if (bShouldUpdate)
|
||||||
|
WorldInventory->Update();
|
||||||
|
|
||||||
|
SendMessageToConsole(CurrentController, L"Gave Event Weapons!");
|
||||||
|
}
|
||||||
|
|
||||||
|
auto AllSatelliteDishes = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FindObject<UClass>("/Game/Athena/Apollo/Environments/BuildingActors/Complex/Props/Apollo_Complex_Satellite_Dish_Top_01.Apollo_Complex_Satellite_Dish_Top_01_C"));
|
||||||
|
|
||||||
|
for (int i = 0; i < AllSatelliteDishes.Num(); i++)
|
||||||
|
{
|
||||||
|
AllSatelliteDishes.At(i)->K2_DestroyActor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ActivatePhaseAtIndexOriginal(SpecialEventScript, Index);
|
return ActivatePhaseAtIndexOriginal(SpecialEventScript, Index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void (*AttemptFinishPhaseOriginal)(AActor* SpecialEventScript, FGameplayTag PhaseTag);
|
||||||
|
void AttemptFinishPhaseHook(AActor* SpecialEventScript, FGameplayTag PhaseTag)
|
||||||
|
{
|
||||||
|
LOG_INFO(LogDev, "SpecialEventScript::AttemptFinishPhase PhaseTag: {}", PhaseTag.TagName.ToString());
|
||||||
|
|
||||||
|
static auto ReplicatedActivePhaseIndexOffset = SpecialEventScript->GetOffset("ReplicatedActivePhaseIndex"); // Sets what Map/Phase were replicating to clients.
|
||||||
|
auto LastTag = PhaseTag.TagName.ToString();
|
||||||
|
|
||||||
|
static auto OnRep_ReplicatedActivePhaseIndexFn = FindObject<UFunction>("/Script/SpecialEventGameplayRuntime.SpecialEventScript.OnRep_ReplicatedActivePhaseIndex");
|
||||||
|
|
||||||
|
auto Connections = GetWorld()->GetNetDriver()->GetClientConnections();
|
||||||
|
|
||||||
|
if (LastTag == "Kiwi.Phase.Islands") // PrisonBlocks (Event Start)
|
||||||
|
{
|
||||||
|
SpecialEventScript->Get<int32>(ReplicatedActivePhaseIndexOffset) = 1;
|
||||||
|
|
||||||
|
for (int i = 0; i < Connections.Num(); i++)
|
||||||
|
{
|
||||||
|
auto CurrentPawn = Cast<AFortPlayerPawn>(Connections.At(i)->GetPlayerController()->GetPawn());
|
||||||
|
|
||||||
|
CurrentPawn->TeleportTo(FVector(34640.0f, 32350.0f, 100600.0f), CurrentPawn->GetActorRotation());
|
||||||
|
|
||||||
|
CurrentPawn->ServerChoosePart(EFortCustomPartType::Backpack, FindObject("/Kiwi/Gameplay/Blueprints/Backpack/CP_Backpack_Kiwi.CP_Backpack_Kiwi"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (LastTag == "Kiwi.Phase.Prison") // Kevin
|
||||||
|
{
|
||||||
|
SpecialEventScript->Get<int32>(ReplicatedActivePhaseIndexOffset) = 2;
|
||||||
|
}
|
||||||
|
if (LastTag == "Kiwi.Phase.ObservationRoom") // Hangar
|
||||||
|
{
|
||||||
|
SpecialEventScript->Get<int32>(ReplicatedActivePhaseIndexOffset) = 3;
|
||||||
|
}
|
||||||
|
if (LastTag == "Kiwi.Phase.Hanger") // Ending
|
||||||
|
{
|
||||||
|
SpecialEventScript->Get<int32>(ReplicatedActivePhaseIndexOffset) = 4;
|
||||||
|
}
|
||||||
|
SpecialEventScript->ProcessEvent(OnRep_ReplicatedActivePhaseIndexFn);
|
||||||
|
|
||||||
|
return AttemptFinishPhaseOriginal(SpecialEventScript, PhaseTag);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Used to teleport the pawn in some events, not used in all parts of rift tour for some reason.
|
||||||
|
static void (*TeleportPlayerPawnOriginal)(UObject* Context, FFrame& Stack, void* Ret);
|
||||||
|
void TeleportPlayerPawnHook(UObject* Context, FFrame& Stack, void* Ret)
|
||||||
|
{
|
||||||
|
LOG_INFO(LogEvent, "Teleported PlayerPawn!");
|
||||||
|
|
||||||
|
UObject* WorldContextObject;
|
||||||
|
AFortPlayerPawn* PlayerPawn; //(Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
|
||||||
|
FVector DestLocation; //(Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
|
||||||
|
FRotator DestRotation; //(Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
|
||||||
|
bool bIgnoreCollision; //(Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
|
||||||
|
bool bIgnoreSupplementalKillVolumeSweep; //(Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
|
||||||
|
|
||||||
|
Stack.StepCompiledIn(&WorldContextObject);
|
||||||
|
Stack.StepCompiledIn(&PlayerPawn);
|
||||||
|
Stack.StepCompiledIn(&DestLocation);
|
||||||
|
Stack.StepCompiledIn(&DestRotation);
|
||||||
|
Stack.StepCompiledIn(&bIgnoreCollision);
|
||||||
|
Stack.StepCompiledIn(&bIgnoreSupplementalKillVolumeSweep);
|
||||||
|
|
||||||
|
PlayerPawn->TeleportTo(DestLocation, DestRotation);
|
||||||
|
|
||||||
|
return TeleportPlayerPawnOriginal(Context, Stack, Ret);
|
||||||
|
}
|
||||||
|
|
||||||
static __int64 (*FlowStep_SetPhaseToActiveOriginal)(AActor* SpecialEventPhase);
|
static __int64 (*FlowStep_SetPhaseToActiveOriginal)(AActor* SpecialEventPhase);
|
||||||
|
|
||||||
__int64 FlowStep_SetPhaseToActiveHook(AActor* SpecialEventPhase)
|
__int64 FlowStep_SetPhaseToActiveHook(AActor* SpecialEventPhase)
|
||||||
@@ -297,14 +593,17 @@ void ChangeLevels()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (FindGIsServer())
|
if (Fortnite_Version != 18.10)
|
||||||
{
|
{
|
||||||
*(bool*)FindGIsServer() = true;
|
if (FindGIsServer())
|
||||||
}
|
{
|
||||||
|
*(bool*)FindGIsServer() = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (FindGIsClient())
|
if (FindGIsClient())
|
||||||
{
|
{
|
||||||
*(bool*)FindGIsClient() = false;
|
*(bool*)FindGIsClient() = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bShouldRemoveLocalPlayer)
|
if (bShouldRemoveLocalPlayer)
|
||||||
@@ -523,7 +822,8 @@ DWORD WINAPI Main(LPVOID)
|
|||||||
Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x3E5496C), (PVOID)ReturnTrueHook, nullptr); // 7FF638A0496C
|
Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x3E5496C), (PVOID)ReturnTrueHook, nullptr); // 7FF638A0496C
|
||||||
Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x3E54A68), (PVOID)ReturnTrueHook, nullptr); // 7FF638A04A68
|
Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x3E54A68), (PVOID)ReturnTrueHook, nullptr); // 7FF638A04A68
|
||||||
// Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + ), (PVOID)ReturnFalseHook, nullptr);
|
// Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + ), (PVOID)ReturnFalseHook, nullptr);
|
||||||
Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x3E4D768), (PVOID)ActivatePhaseAtIndexHook, (PVOID*)&ActivatePhaseAtIndexOriginal); // 07FF6389FD768
|
Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x3E4D768), (PVOID)ActivatePhaseAtIndexHook, (PVOID*)&ActivatePhaseAtIndexOriginal); // 07FF6389FD768
|
||||||
|
Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x3E4DFA4), (PVOID)AttemptFinishPhaseHook, (PVOID*)&AttemptFinishPhaseOriginal);
|
||||||
}
|
}
|
||||||
else if (Fortnite_Version == 18.40)
|
else if (Fortnite_Version == 18.40)
|
||||||
{
|
{
|
||||||
@@ -535,6 +835,24 @@ DWORD WINAPI Main(LPVOID)
|
|||||||
Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x41624C8), (PVOID)ActivatePhaseAtIndexHook, (PVOID*)&ActivatePhaseAtIndexOriginal); // 7FF79E3E24C8
|
Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x41624C8), (PVOID)ActivatePhaseAtIndexHook, (PVOID*)&ActivatePhaseAtIndexOriginal); // 7FF79E3E24C8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Globals::bGoingToPlayEvent)
|
||||||
|
{
|
||||||
|
if (Fortnite_Version >= 17.30)
|
||||||
|
{
|
||||||
|
Hooking::MinHook::Hook(FindObject<UObject>("/Script/FortniteGame.Default__FortMissionLibrary"), FindObject<UFunction>(L"/Script/FortniteGame.FortMissionLibrary:TeleportPlayerPawn"), TeleportPlayerPawnHook,
|
||||||
|
(PVOID*)&TeleportPlayerPawnOriginal, false, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Fortnite_Version >= 17.00) // Fixes random crash that happens a couple minutes after server starts for s17+
|
||||||
|
{
|
||||||
|
uintptr_t ServerCrashFix = Memcury::Scanner::FindPattern("48 89 5C 24 10 48 89 6C 24 20 56 57 41 54 41 56 41 57 48 81 EC ? ? ? ? 65 48 8B 04 25 ? ? ? ? 4C 8B F9").Get();
|
||||||
|
|
||||||
|
LOG_INFO(LogDev, "ServerCrashFix: 0x{:x}", ServerCrashFix);
|
||||||
|
|
||||||
|
Hooking::MinHook::Hook((PVOID)ServerCrashFix, (PVOID)ReturnFalseHook, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
if (Fortnite_Version == 6.21)
|
if (Fortnite_Version == 6.21)
|
||||||
|
|||||||
@@ -756,6 +756,42 @@ static inline void StartEvent()
|
|||||||
auto SpecialEventScriptMeshActorClass = FindObject<UClass>("/Script/SpecialEventGameplayRuntime.SpecialEventScriptMeshActor");
|
auto SpecialEventScriptMeshActorClass = FindObject<UClass>("/Script/SpecialEventGameplayRuntime.SpecialEventScriptMeshActor");
|
||||||
auto AllSpecialEventScriptMeshActors = UGameplayStatics::GetAllActorsOfClass(GetWorld(), SpecialEventScriptMeshActorClass);
|
auto AllSpecialEventScriptMeshActors = UGameplayStatics::GetAllActorsOfClass(GetWorld(), SpecialEventScriptMeshActorClass);
|
||||||
|
|
||||||
|
if (Fortnite_Version == 17.50)
|
||||||
|
{
|
||||||
|
auto Scripting = FindObject<UObject>("/Kiwi/Levels/Kiwi_P.Kiwi_P:PersistentLevel.BP_Kiwi_Master_Scripting_2");
|
||||||
|
|
||||||
|
float SecondsSinceEventBegan = 0;
|
||||||
|
|
||||||
|
auto EventPlaylist = GetEventPlaylist();
|
||||||
|
|
||||||
|
struct { UObject* GameState; UObject* Playlist; FGameplayTagContainer PlaylistContextTags; } OnReadyParams{ Cast<AFortGameStateAthena>(GetWorld()->GetGameState()), EventPlaylist };
|
||||||
|
if (EventPlaylist)
|
||||||
|
{
|
||||||
|
static auto GameplayTagContainerOffset = EventPlaylist->GetOffset("GameplayTagContainer");
|
||||||
|
OnReadyParams.PlaylistContextTags = EventPlaylist->Get<FGameplayTagContainer>(GameplayTagContainerOffset);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OnReadyParams.PlaylistContextTags = FGameplayTagContainer();
|
||||||
|
}
|
||||||
|
auto BB = FindObject<UFunction>("/Kiwi/Gameplay/BP_Kiwi_Master_Scripting.BP_Kiwi_Master_Scripting_C.OnReady_F1A32853487CB7603278E6847A5F2625");
|
||||||
|
Scripting->ProcessEvent(BB, &OnReadyParams);
|
||||||
|
|
||||||
|
auto eventscript = FindObject("/Kiwi/Levels/Kiwi_P.Kiwi_P:PersistentLevel.Kiwi_EventScript_2");
|
||||||
|
auto CC = FindObject<UFunction>("/Kiwi/Gameplay/Kiwi_EventScript.Kiwi_EventScript_C.OnReady_F51BF8E143832CE6C552938B26BEFA93");
|
||||||
|
auto DD = FindObject<UFunction>("/Kiwi/Gameplay/Kiwi_EventScript.Kiwi_EventScript_C.LoadKiwiAssets");
|
||||||
|
auto StartEventAtIndex = FindObject<UFunction>("/Script/SpecialEventGameplayRuntime.SpecialEventScript.StartEventAtIndex");
|
||||||
|
auto BP_OnScriptReady = FindObject<UFunction>("/Kiwi/Gameplay/Kiwi_EventScript.Kiwi_EventScript_C.BP_OnScriptReady");
|
||||||
|
|
||||||
|
// eventscript->ProcessEvent(CC, &bbparms);
|
||||||
|
eventscript->ProcessEvent(DD, &OnReadyParams);
|
||||||
|
eventscript->ProcessEvent(BP_OnScriptReady, &OnReadyParams);
|
||||||
|
eventscript->ProcessEvent(StartEventAtIndex, &SecondsSinceEventBegan);
|
||||||
|
|
||||||
|
static auto StartEvent = FindObject<UFunction>("/Kiwi/Gameplay/BP_Kiwi_Master_Scripting.BP_Kiwi_Master_Scripting_C.startevent");
|
||||||
|
Scripting->ProcessEvent(StartEvent, &SecondsSinceEventBegan);
|
||||||
|
}
|
||||||
|
|
||||||
if (AllSpecialEventScriptMeshActors.Num() > 0)
|
if (AllSpecialEventScriptMeshActors.Num() > 0)
|
||||||
{
|
{
|
||||||
auto SpecialEventScriptMeshActor = AllSpecialEventScriptMeshActors.at(0);
|
auto SpecialEventScriptMeshActor = AllSpecialEventScriptMeshActors.at(0);
|
||||||
|
|||||||
@@ -347,6 +347,9 @@ static inline uint64 FindInitHost()
|
|||||||
if (!addr) // s18
|
if (!addr) // s18
|
||||||
addr = Memcury::Scanner::FindPattern("48 8B C4 48 89 58 10 48 89 70 18 48 89 78 20 55 41 56 41 57 48 8D 68 A1 48 81 EC ? ? ? ? 48 8B F1 4C 8D 35 ? ? ? ? 4D").Get();
|
addr = Memcury::Scanner::FindPattern("48 8B C4 48 89 58 10 48 89 70 18 48 89 78 20 55 41 56 41 57 48 8D 68 A1 48 81 EC ? ? ? ? 48 8B F1 4C 8D 35 ? ? ? ? 4D").Get();
|
||||||
|
|
||||||
|
if (Fortnite_Version == 18.10)
|
||||||
|
addr = Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 74 24 ? 55 57 41 56 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B F1 48 8D 1D ? ? ? ? 4C 8B C3 48 8D 4D D7 45").Get();
|
||||||
|
|
||||||
return addr;
|
return addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -902,6 +902,23 @@ static inline void MainUI()
|
|||||||
StartEvent();
|
StartEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Fortnite_Version == 18.40)
|
||||||
|
{
|
||||||
|
if (ImGui::Button("Remove Storm Effect"))
|
||||||
|
{
|
||||||
|
auto ClientConnections = GetWorld()->GetNetDriver()->GetClientConnections();
|
||||||
|
|
||||||
|
for (int i = 0; i < ClientConnections.Num(); i++)
|
||||||
|
{
|
||||||
|
auto CurrentController = (AFortPlayerControllerAthena*)ClientConnections.At(i)->GetPlayerController();
|
||||||
|
|
||||||
|
static auto StormEffectClass = FindObject<UClass>(L"/Game/Athena/SafeZone/GE_OutsideSafeZoneDamage.GE_OutsideSafeZoneDamage_C");
|
||||||
|
auto PlayerState = CurrentController->GetPlayerStateAthena();
|
||||||
|
PlayerState->GetAbilitySystemComponent()->RemoveActiveGameplayEffectBySourceEffect(StormEffectClass, 1, PlayerState->GetAbilitySystemComponent());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Fortnite_Version == 8.51)
|
if (Fortnite_Version == 8.51)
|
||||||
{
|
{
|
||||||
if (ImGui::Button("Unvault DrumGun"))
|
if (ImGui::Button("Unvault DrumGun"))
|
||||||
|
|||||||
Reference in New Issue
Block a user