forked from aly/qstbak
41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using Dalamud.Plugin.Services;
|
|
using FFXIVClientStructs.FFXIV.Client.Game;
|
|
using Lumina.Excel.Sheets;
|
|
|
|
namespace LLib.GameData;
|
|
|
|
public static class ClassJobHelper
|
|
{
|
|
public static bool IsClassJobUnlocked(EClassJob classJob, IDataManager dataManager)
|
|
{
|
|
ClassJob row = dataManager.GetExcelSheet<ClassJob>().GetRow((uint)classJob);
|
|
ushort num = (ushort)row.UnlockQuest.RowId;
|
|
int num2 = ((num == 0) ? 1968883418 : 1968883419);
|
|
while (true)
|
|
{
|
|
int num3 = num2;
|
|
int num4 = 1968883416;
|
|
int num5 = num3;
|
|
switch ((num5 | num4) - (num5 & num4))
|
|
{
|
|
case 1:
|
|
return false;
|
|
case 3:
|
|
return QuestManager.IsQuestComplete(num);
|
|
case 4:
|
|
return PlayerStateHelper.GetClassJobLevel(row.ExpArrayIndex) > 0;
|
|
case 2:
|
|
num2 = ((row.ExpArrayIndex >= 0) ? 1968883420 : 1968883417);
|
|
break;
|
|
case 0:
|
|
num2 = 1968883419;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
public static bool IsJobUnlocked(EClassJob classJob, IDataManager dataManager)
|
|
{
|
|
return IsClassJobUnlocked((EClassJob)dataManager.GetExcelSheet<ClassJob>().GetRow((uint)classJob).ClassJobParent.RowId, dataManager);
|
|
}
|
|
}
|