muffin v6.35 with old pdb
This commit is contained in:
parent
ac85599236
commit
b5d2cc6708
31 changed files with 958 additions and 958 deletions
|
|
@ -131,8 +131,8 @@ internal sealed class GameFunctions
|
|||
{
|
||||
foreach (IGameObject item in _objectTable)
|
||||
{
|
||||
Dalamud.Game.ClientState.Objects.Enums.ObjectKind objectKind = item.ObjectKind;
|
||||
bool flag = ((objectKind == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Player || objectKind - 8 <= Dalamud.Game.ClientState.Objects.Enums.ObjectKind.BattleNpc || objectKind == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Housing) ? true : false);
|
||||
Dalamud.Game.ClientState.Objects.Enums.ObjectKind e = item.ObjectKind;
|
||||
bool flag = ((e == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Player || e - 8 <= Dalamud.Game.ClientState.Objects.Enums.ObjectKind.BattleNpc || e == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Housing) ? true : false);
|
||||
if (!flag && (item == null || item.ObjectKind != Dalamud.Game.ClientState.Objects.Enums.ObjectKind.GatheringPoint || item.IsTargetable) && item.BaseId == dataId && (!kind.HasValue || kind.Value == item.ObjectKind))
|
||||
{
|
||||
return item;
|
||||
|
|
@ -186,9 +186,9 @@ internal sealed class GameFunctions
|
|||
if (gameObject != null)
|
||||
{
|
||||
_targetManager.Target = gameObject;
|
||||
long num = AgentInventoryContext.Instance()->UseItem(itemId, InventoryType.Invalid, 0u, 0);
|
||||
_logger.LogInformation("UseItem result on {DataId}: {Result}", dataId, num);
|
||||
if ((ulong)num <= 1uL)
|
||||
long e = AgentInventoryContext.Instance()->UseItem(itemId, InventoryType.Invalid, 0u, 0);
|
||||
_logger.LogInformation("UseItem result on {DataId}: {Result}", dataId, e);
|
||||
if ((ulong)e <= 1uL)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
@ -215,16 +215,16 @@ internal sealed class GameFunctions
|
|||
|
||||
public unsafe bool UseAction(EAction action)
|
||||
{
|
||||
uint num = (uint)(action & (EAction)65535);
|
||||
ActionType actionType = (((action & (EAction)65536) != (EAction)65536) ? ActionType.Action : ActionType.GeneralAction);
|
||||
if (actionType == ActionType.Action)
|
||||
uint elementId = (uint)(action & (EAction)65535);
|
||||
ActionType quest = (((action & (EAction)65536) != (EAction)65536) ? ActionType.Action : ActionType.GeneralAction);
|
||||
if (quest == ActionType.Action)
|
||||
{
|
||||
num = ActionManager.Instance()->GetAdjustedActionId(num);
|
||||
elementId = ActionManager.Instance()->GetAdjustedActionId(elementId);
|
||||
}
|
||||
if (ActionManager.Instance()->GetActionStatus(actionType, num, 3758096384uL, checkRecastActive: true, checkCastingActive: true, null) == 0)
|
||||
if (ActionManager.Instance()->GetActionStatus(quest, elementId, 3758096384uL, checkRecastActive: true, checkCastingActive: true, null) == 0)
|
||||
{
|
||||
bool flag = ActionManager.Instance()->UseAction(actionType, num, 3758096384uL, 0u, ActionManager.UseActionMode.None, 0u, null);
|
||||
_logger.LogInformation("UseAction {Action} (adjusted: {AdjustedActionId}) result: {Result}", action, num, flag);
|
||||
bool flag = ActionManager.Instance()->UseAction(quest, elementId, 3758096384uL, 0u, ActionManager.UseActionMode.None, 0u, null);
|
||||
_logger.LogInformation("UseAction {Action} (adjusted: {AdjustedActionId}) result: {Result}", action, elementId, flag);
|
||||
return flag;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -232,34 +232,34 @@ internal sealed class GameFunctions
|
|||
|
||||
public unsafe bool UseAction(IGameObject gameObject, EAction action, bool checkCanUse = true)
|
||||
{
|
||||
uint actionId = (uint)(action & (EAction)65535);
|
||||
ActionType actionType = (((action & (EAction)65536) != (EAction)65536) ? ActionType.Action : ActionType.GeneralAction);
|
||||
if (actionType == ActionType.GeneralAction)
|
||||
uint progress = (uint)(action & (EAction)65535);
|
||||
ActionType questId = (((action & (EAction)65536) != (EAction)65536) ? ActionType.Action : ActionType.GeneralAction);
|
||||
if (questId == ActionType.GeneralAction)
|
||||
{
|
||||
_logger.LogWarning("Can not use general action {Action} on target {Target}", action, gameObject);
|
||||
return false;
|
||||
}
|
||||
actionId = ActionManager.Instance()->GetAdjustedActionId(actionId);
|
||||
if (checkCanUse && !ActionManager.CanUseActionOnTarget(actionId, (GameObject*)gameObject.Address))
|
||||
progress = ActionManager.Instance()->GetAdjustedActionId(progress);
|
||||
if (checkCanUse && !ActionManager.CanUseActionOnTarget(progress, (GameObject*)gameObject.Address))
|
||||
{
|
||||
_logger.LogWarning("Can not use action {Action} (adjusted: {AdjustedActionId}) on target {Target}", action, actionId, gameObject);
|
||||
_logger.LogWarning("Can not use action {Action} (adjusted: {AdjustedActionId}) on target {Target}", action, progress, gameObject);
|
||||
return false;
|
||||
}
|
||||
Lumina.Excel.Sheets.Action row = _dataManager.GetExcelSheet<Lumina.Excel.Sheets.Action>().GetRow(actionId);
|
||||
Lumina.Excel.Sheets.Action step = _dataManager.GetExcelSheet<Lumina.Excel.Sheets.Action>().GetRow(progress);
|
||||
_targetManager.Target = gameObject;
|
||||
if (ActionManager.Instance()->GetActionStatus(actionType, actionId, gameObject.GameObjectId, checkRecastActive: true, checkCastingActive: true, null) == 0)
|
||||
if (ActionManager.Instance()->GetActionStatus(questId, progress, gameObject.GameObjectId, checkRecastActive: true, checkCastingActive: true, null) == 0)
|
||||
{
|
||||
bool flag;
|
||||
if (row.TargetArea)
|
||||
if (step.TargetArea)
|
||||
{
|
||||
Vector3 position = gameObject.Position;
|
||||
flag = ActionManager.Instance()->UseActionLocation(actionType, actionId, 3758096384uL, &position, 0u, 0);
|
||||
_logger.LogInformation("UseAction {Action} (adjusted: {AdjustedActionId}) on target area {Target} result: {Result}", action, actionId, gameObject, flag);
|
||||
flag = ActionManager.Instance()->UseActionLocation(questId, progress, 3758096384uL, &position, 0u, 0);
|
||||
_logger.LogInformation("UseAction {Action} (adjusted: {AdjustedActionId}) on target area {Target} result: {Result}", action, progress, gameObject, flag);
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = ActionManager.Instance()->UseAction(actionType, actionId, gameObject.GameObjectId, 0u, ActionManager.UseActionMode.None, 0u, null);
|
||||
_logger.LogInformation("UseAction {Action} (adjusted: {AdjustedActionId}) on target {Target} result: {Result}", action, actionId, gameObject, flag);
|
||||
flag = ActionManager.Instance()->UseAction(questId, progress, gameObject.GameObjectId, 0u, ActionManager.UseActionMode.None, 0u, null);
|
||||
_logger.LogInformation("UseAction {Action} (adjusted: {AdjustedActionId}) on target {Target} result: {Result}", action, progress, gameObject, flag);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
|
@ -268,10 +268,10 @@ internal sealed class GameFunctions
|
|||
|
||||
public bool IsObjectAtPosition(uint dataId, Vector3 position, float distance)
|
||||
{
|
||||
IGameObject gameObject = FindObjectByDataId(dataId);
|
||||
if (gameObject != null)
|
||||
IGameObject elementId = FindObjectByDataId(dataId);
|
||||
if (elementId != null)
|
||||
{
|
||||
return (gameObject.Position - position).Length() < distance;
|
||||
return (elementId.Position - position).Length() < distance;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -282,8 +282,8 @@ internal sealed class GameFunctions
|
|||
{
|
||||
return true;
|
||||
}
|
||||
PlayerState* ptr = PlayerState.Instance();
|
||||
if (ptr != null && !ptr->IsMountUnlocked(1u))
|
||||
PlayerState* questElements = PlayerState.Instance();
|
||||
if (questElements != null && !questElements->IsMountUnlocked(1u))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
@ -308,12 +308,12 @@ internal sealed class GameFunctions
|
|||
|
||||
private unsafe bool HasCharacterStatusPreventingMountOrSprint()
|
||||
{
|
||||
IPlayerCharacter localPlayer = _clientState.LocalPlayer;
|
||||
if (localPlayer == null)
|
||||
IPlayerCharacter elementId = _clientState.LocalPlayer;
|
||||
if (elementId == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
BattleChara* address = (BattleChara*)localPlayer.Address;
|
||||
BattleChara* address = (BattleChara*)elementId.Address;
|
||||
StatusManager* statusManager = address->GetStatusManager();
|
||||
if (!statusManager->HasStatus(565u) && !statusManager->HasStatus(404u) && !statusManager->HasStatus(416u) && !statusManager->HasStatus(2729u))
|
||||
{
|
||||
|
|
@ -324,12 +324,12 @@ internal sealed class GameFunctions
|
|||
|
||||
public unsafe bool HasStatus(EStatus statusId)
|
||||
{
|
||||
IPlayerCharacter localPlayer = _clientState.LocalPlayer;
|
||||
if (localPlayer == null)
|
||||
IPlayerCharacter elementId = _clientState.LocalPlayer;
|
||||
if (elementId == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
BattleChara* address = (BattleChara*)localPlayer.Address;
|
||||
BattleChara* address = (BattleChara*)elementId.Address;
|
||||
return address->GetStatusManager()->HasStatus((uint)statusId);
|
||||
}
|
||||
|
||||
|
|
@ -393,14 +393,14 @@ internal sealed class GameFunctions
|
|||
|
||||
public unsafe void OpenDutyFinder(uint contentFinderConditionId)
|
||||
{
|
||||
if (_contentFinderConditionToContentId.TryGetValue(contentFinderConditionId, out var value))
|
||||
if (_contentFinderConditionToContentId.TryGetValue(contentFinderConditionId, out var hasActiveQuest))
|
||||
{
|
||||
if (UIState.IsInstanceContentUnlocked(value))
|
||||
if (UIState.IsInstanceContentUnlocked(hasActiveQuest))
|
||||
{
|
||||
AgentContentsFinder.Instance()->OpenRegularDuty(contentFinderConditionId);
|
||||
return;
|
||||
}
|
||||
_logger.LogError("Trying to access a locked duty (cf: {ContentFinderId}, content: {ContentId})", contentFinderConditionId, value);
|
||||
_logger.LogError("Trying to access a locked duty (cf: {ContentFinderId}, content: {ContentId})", contentFinderConditionId, hasActiveQuest);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -591,21 +591,21 @@ internal sealed class GameFunctions
|
|||
{
|
||||
try
|
||||
{
|
||||
UIModule* uIModule = Framework.Instance()->GetUIModule();
|
||||
if (uIModule == null)
|
||||
UIModule* toTerritoryType = Framework.Instance()->GetUIModule();
|
||||
if (toTerritoryType == null)
|
||||
{
|
||||
_logger.LogError("UIModule is null, cannot execute command: {Command}", command);
|
||||
return;
|
||||
}
|
||||
Utf8String utf8String = new Utf8String(command);
|
||||
Utf8String toPosition = new Utf8String(command);
|
||||
try
|
||||
{
|
||||
uIModule->ProcessChatBoxEntry(&utf8String, (nint)utf8String.StringLength);
|
||||
toTerritoryType->ProcessChatBoxEntry(&toPosition, (nint)toPosition.StringLength);
|
||||
_logger.LogDebug("Executed chat command: {Command}", command);
|
||||
}
|
||||
finally
|
||||
{
|
||||
((IDisposable)utf8String/*cast due to .constrained prefix*/).Dispose();
|
||||
((IDisposable)toPosition/*cast due to .constrained prefix*/).Dispose();
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue