Upload from upload_mods.ps1
This commit is contained in:
31
Harmony/Harmony_NetPackageQuestEntitySpawn.cs
Normal file
31
Harmony/Harmony_NetPackageQuestEntitySpawn.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
namespace Harmony.NetPackageQuestEntitySpawnPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(NetPackageQuestEntitySpawn))]
|
||||
[HarmonyPatch("ProcessPackage")]
|
||||
public class ProcessPackagePatch
|
||||
{
|
||||
public static bool Prefix(NetPackageQuestEntitySpawn __instance, World _world, GameManager _callbacks)
|
||||
{
|
||||
if (_world == null)
|
||||
return false;
|
||||
if (__instance.entityType == -1)
|
||||
{
|
||||
EntityPlayer entity = GameManager.Instance.World.GetEntity(__instance.entityIDQuestHolder) as EntityPlayer;
|
||||
|
||||
RebirthVariables.gameStage = entity.gameStage;
|
||||
|
||||
if (RebirthUtilities.ScenarioSkip())
|
||||
{
|
||||
//Log.Out("NetPackageQuestEntitySpawnPatches-ProcessPackage START: " + entity.biomeStandingOn.m_sBiomeName + $" ({entity.position})");
|
||||
string biomeName = RebirthUtilities.GetBiomeName(entity);
|
||||
RebirthUtilities.SetHiveSpawnGroup(biomeName);
|
||||
}
|
||||
|
||||
__instance.entityType = EntityGroups.GetRandomFromGroup(GameStageDefinition.GetGameStage(__instance.gamestageGroup).GetStage(entity.PartyGameStage).GetSpawnGroup(0).groupName, ref NetPackageQuestEntitySpawn.lastClassId);
|
||||
}
|
||||
QuestActionSpawnEnemy.SpawnQuestEntity(__instance.entityType, __instance.entityIDQuestHolder);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user