Skip to content

Commit

Permalink
1.0.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
paissaheavyindustries committed Jul 3, 2024
1 parent 5b84a74 commit 5403b10
Show file tree
Hide file tree
Showing 21 changed files with 422 additions and 404 deletions.
34 changes: 17 additions & 17 deletions Lemegeton/Content/Debugger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text;
using System.IO;
using static Lemegeton.Core.State;
using GameObject = Dalamud.Game.ClientState.Objects.Types.GameObject;
using GameObject = Dalamud.Game.ClientState.Objects.Types.IGameObject;
using GameObjectPtr = FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject;
using CharacterStruct = FFXIVClientStructs.FFXIV.Client.Game.Character.Character;
using Vector3 = System.Numerics.Vector3;
Expand Down Expand Up @@ -106,12 +106,12 @@ protected override bool ExecutionImplementation()
break;
}
StringBuilder sb = new StringBuilder();
sb.AppendLine(String.Format("ID: {0} ({1})", go.ObjectId.ToString(), go.ObjectId.ToString("X8")));
sb.AppendLine(String.Format("ID: {0} ({1})", go.GameObjectId.ToString(), go.GameObjectId.ToString("X8")));
sb.AppendLine(String.Format("Addr: {0} ({1})", go.Address.ToString(), go.Address.ToString("X8")));
Character ch = null;
if (go is Character)
ICharacter ch = null;
if (go is ICharacter)
{
ch = (Character)go;
ch = (ICharacter)go;
}
if (ch != null)
{
Expand All @@ -121,9 +121,9 @@ protected override bool ExecutionImplementation()
{
sb.AppendLine(String.Format("Name: {0}", go.Name.ToString()));
}
if (go is BattleChara)
if (go is IBattleChara)
{
BattleChara bc = (BattleChara)go;
IBattleChara bc = (IBattleChara)go;
sb.AppendLine(String.Format("HP: {0}/{1}", bc.CurrentHp, bc.MaxHp));
if (ch != null)
{
Expand Down Expand Up @@ -307,17 +307,17 @@ private void CheckAmResult()
{
ret = true;
currentSign = AutomarkerSigns.SignEnum.None;
foreach (KeyValuePair<AutomarkerSigns.SignEnum, uint> kp2 in _state.SoftMarkers)
foreach (KeyValuePair<AutomarkerSigns.SignEnum, ulong> kp2 in _state.SoftMarkers)
{
if (kp2.Value == expectedActor.ObjectId)
if (kp2.Value == expectedActor.GameObjectId)
{
currentSign = kp2.Key;
}
}
}
else
{
ret = _state.GetCurrentMarker(expectedActor.ObjectId, out currentSign);
ret = _state.GetCurrentMarker(expectedActor.GameObjectId, out currentSign);
}
if (ret == false)
{
Expand Down Expand Up @@ -626,13 +626,13 @@ private string FormatGameObject(GameObject go)
{
if (IncludeLocation == true)
{
return go == null ? "null" : String.Format("{0}({1} - {2}) at {3} pos {4},{5},{6} rot {7}", go.ObjectId.ToString("X"), go.Name.ToString(), go.ObjectKind, go.Address.ToString("X"),
return go == null ? "null" : String.Format("{0}({1} - {2}) at {3} pos {4},{5},{6} rot {7}", go.GameObjectId.ToString("X"), go.Name.ToString(), go.ObjectKind, go.Address.ToString("X"),
go.Position.X, go.Position.Y, go.Position.Z, go.Rotation
);
}
else
{
return go == null ? "null" : String.Format("{0}({1} - {2}) at {3}", go.ObjectId.ToString("X"), go.Name.ToString(), go.ObjectKind, go.Address.ToString("X"));
return go == null ? "null" : String.Format("{0}({1} - {2}) at {3}", go.GameObjectId.ToString("X"), go.Name.ToString(), go.ObjectKind, go.Address.ToString("X"));
}
}

Expand Down Expand Up @@ -711,9 +711,9 @@ private void MonitorOmens()
{
continue;
}
if (go is Character)
if (go is ICharacter)
{
Character ch = (Character)go;
ICharacter ch = (ICharacter)go;
unsafe
{
CharacterStruct* chs = (CharacterStruct*)ch.Address;
Expand Down Expand Up @@ -773,9 +773,9 @@ private void MonitorVFXs()
{
continue;
}
if (go is Character)
if (go is ICharacter)
{
Character ch = (Character)go;
ICharacter ch = (ICharacter)go;
unsafe
{
CharacterStruct* chs = (CharacterStruct*)ch.Address;
Expand Down Expand Up @@ -1095,7 +1095,7 @@ private void OnCombatantAdded(GameObject go)
}
}

private void OnCombatantRemoved(uint actorId, nint addr)
private void OnCombatantRemoved(ulong actorId, nint addr)
{
if (GoodToLog() == false)
{
Expand Down
58 changes: 29 additions & 29 deletions Lemegeton/Content/EwCritAloalo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public class SpringCrystal : Core.ContentItem
[AttributeOrderNumber(2000)]
public System.Action Test { get; set; }

internal uint _midCrystalId = 0;
internal ulong _midCrystalId = 0;
private List<PointF> _points = new List<PointF>();

public SpringCrystal(State state) : base(state)
Expand All @@ -138,17 +138,17 @@ public void TestFunctionality()
return;
}
_state.InvokeZoneChange(1179);
_midCrystalId = _state.cs.LocalPlayer.ObjectId;
_midCrystalId = _state.cs.LocalPlayer.GameObjectId;
}

internal void FeedMidCrystal(GameObject go)
internal void FeedMidCrystal(IGameObject go)
{
if (Active == false)
{
return;
}
_midCrystalId = go.ObjectId;
Log(State.LogLevelEnum.Debug, null, "Registered mid crystal {0}", go.ObjectId);
_midCrystalId = go.GameObjectId;
Log(State.LogLevelEnum.Debug, null, "Registered mid crystal {0}", go.GameObjectId);
}

protected override bool ExecutionImplementation()
Expand All @@ -162,7 +162,7 @@ protected override bool ExecutionImplementation()
{
return false;
}
GameObject go = _state.GetActorById(_midCrystalId);
IGameObject go = _state.GetActorById(_midCrystalId);
if (go == null)
{
Reset();
Expand Down Expand Up @@ -239,7 +239,7 @@ private enum SafeZoneEnum
private uint _lalaStatus = 0;
private uint _lalaAction = 0;
private uint _lalaHeadmarker = 0;
private uint _lalaId = 0;
private ulong _lalaId = 0;

public LalaRotation(State state) : base(state)
{
Expand All @@ -265,7 +265,7 @@ public void TestFunctionality()
}
_state.InvokeZoneChange(1179);
Random r = new Random();
_lalaId = _state.cs.LocalPlayer.ObjectId;
_lalaId = _state.cs.LocalPlayer.GameObjectId;
_lalaStatus = (uint)(r.Next(0, 2) == 0 ? StatusLalaThree : StatusLalaFive);
_lalaHeadmarker = (uint)(r.Next(0, 2) == 0 ? HeadmarkerLalaCW : HeadmarkerLalaCCW);
switch (r.Next(0, 4))
Expand Down Expand Up @@ -389,7 +389,7 @@ protected override bool ExecutionImplementation()
{
return true;
}
GameObject go = _state.GetActorById(_lalaId);
IGameObject go = _state.GetActorById(_lalaId);
Vector3 t1, t2;
Vector3 p1 = go.Position;
Vector3 p2, p3;
Expand Down Expand Up @@ -512,7 +512,7 @@ internal void FeedStatus(uint actorId, uint statusId, bool gained)
{
return;
}
if (actorId != _state.cs.LocalPlayer.ObjectId)
if (actorId != _state.cs.LocalPlayer.GameObjectId)
{
return;
}
Expand Down Expand Up @@ -547,7 +547,7 @@ internal void FeedHeadmarker(uint actorId, uint headMarkerId)
{
return;
}
if (actorId != _state.cs.LocalPlayer.ObjectId)
if (actorId != _state.cs.LocalPlayer.GameObjectId)
{
return;
}
Expand Down Expand Up @@ -618,7 +618,7 @@ protected override bool ExecutionImplementation()
{
return true;
}
GameObject go = _state.cs.LocalPlayer;
IGameObject go = _state.cs.LocalPlayer;
Vector3 t1, t2;
Vector3 p1 = go.Position;
Vector3 p2, p3, p4;
Expand Down Expand Up @@ -731,7 +731,7 @@ internal void FeedStatus(uint actorId, uint statusId, bool gained)
{
return;
}
if (actorId != _state.cs.LocalPlayer.ObjectId)
if (actorId != _state.cs.LocalPlayer.GameObjectId)
{
return;
}
Expand Down Expand Up @@ -759,7 +759,7 @@ internal void FeedHeadmarker(uint actorId, uint headMarkerId)
{
return;
}
if (actorId != _state.cs.LocalPlayer.ObjectId)
if (actorId != _state.cs.LocalPlayer.GameObjectId)
{
return;
}
Expand Down Expand Up @@ -798,7 +798,7 @@ protected override bool ExecutionImplementation()
{
return true;
}
GameObject go = _state.cs.LocalPlayer;
IGameObject go = _state.cs.LocalPlayer;
Vector3 t1, t2;
Vector3 p1 = go.Position;
Vector3 p2, p3, p4, p5;
Expand Down Expand Up @@ -876,7 +876,7 @@ private enum BulletStateEnum
Load
}

private uint _staticeId = 0;
private ulong _staticeId = 0;
private BulletStateEnum[] _bullets = new BulletStateEnum[8];
private int _bulletIndex = 0;
private int _bulletsSpent = 0;
Expand Down Expand Up @@ -932,7 +932,7 @@ public void TestFunctionality()
}
return;
}
_staticeId = _state.cs.LocalPlayer.ObjectId;
_staticeId = _state.cs.LocalPlayer.GameObjectId;
_state.InvokeZoneChange(1179);
Random r = new Random();
for (int i = 0; i < 8; i++)
Expand Down Expand Up @@ -979,7 +979,7 @@ protected override bool ExecutionImplementation()
return false;
}
int bulletsToDraw = 8 - _bulletsSpent;
GameObject go = _state.GetActorById(_staticeId);
IGameObject go = _state.GetActorById(_staticeId);
Vector3 pos = new Vector3(go.Position.X, go.Position.Y + 3.0f, go.Position.Z);
Vector3 t1 = _state.plug._ui.TranslateToScreen(pos.X, pos.Y, pos.Z);
float radius = 15.0f;
Expand Down Expand Up @@ -1040,7 +1040,7 @@ public class StaticePresentTether : Core.ContentItem
[AttributeOrderNumber(2000)]
public System.Action Test { get; set; }

private uint _trackerId = 0;
private ulong _trackerId = 0;

public StaticePresentTether(State state) : base(state)
{
Expand All @@ -1062,14 +1062,14 @@ public void TestFunctionality()
return;
}
_state.InvokeZoneChange(1179);
GameObject me = _state.cs.LocalPlayer as GameObject;
foreach (GameObject go in _state.ot)
IGameObject me = _state.cs.LocalPlayer as IGameObject;
foreach (IGameObject go in _state.ot)
{
if (go.ObjectKind != Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Player && go.ObjectKind != Dalamud.Game.ClientState.Objects.Enums.ObjectKind.BattleNpc)
{
continue;
}
if (go.ObjectId == me.ObjectId)
if (go.GameObjectId == me.GameObjectId)
{
continue;
}
Expand All @@ -1085,7 +1085,7 @@ public void TestFunctionality()
continue;
}
Random r = new Random();
_trackerId = go.ObjectId;
_trackerId = go.GameObjectId;
Log(State.LogLevelEnum.Debug, null, "Testing from {0} to {1}", me, go);
return;
}
Expand All @@ -1097,7 +1097,7 @@ internal void FeedTether(uint src, uint dest)
{
return;
}
if (_trackerId == 0 && dest == _state.cs.LocalPlayer.ObjectId)
if (_trackerId == 0 && dest == _state.cs.LocalPlayer.GameObjectId)
{
_trackerId = src;
}
Expand All @@ -1110,7 +1110,7 @@ protected override bool ExecutionImplementation()
{
return false;
}
GameObject go = _state.GetActorById(_trackerId);
IGameObject go = _state.GetActorById(_trackerId);
if (go == null)
{
_trackerId = 0;
Expand Down Expand Up @@ -1271,19 +1271,19 @@ private void _state_OnAction(uint src, uint dest, ushort actionId)
}
}

private void _state_OnCombatantRemoved(uint actorId, nint addr)
private void _state_OnCombatantRemoved(ulong actorId, nint addr)
{
if (actorId == _springCrystal._midCrystalId)
{
_springCrystal.Reset();
}
}

private void _state_OnCombatantAdded(GameObject go)
private void _state_OnCombatantAdded(IGameObject go)
{
if (go is Character)
if (go is ICharacter)
{
Character ch = go as Character;
ICharacter ch = go as ICharacter;
if (ch.NameId == 12606 || ch.NameId == 12607)
{
float x = Math.Abs(go.Position.X);
Expand Down
8 changes: 4 additions & 4 deletions Lemegeton/Content/GenericDeepDungeon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ protected override bool ExecutionImplementation()
me = _state.plug._ui.TranslateToScreen(me.X, me.Y, me.Z);
float defSize = ImGui.GetFontSize();
float mul = 20.0f / defSize;
foreach (GameObject go in _state.ot)
foreach (IGameObject go in _state.ot)
{
if (go.ObjectKind == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.BattleNpc && go.SubKind == 5 && go.IsDead == false)
{
BattleChara bc = (BattleChara)go;
IBattleChara bc = (IBattleChara)go;
if (bc.CurrentHp > 0 && (_state.GetStatusFlags(bc) & Dalamud.Game.ClientState.Objects.Enums.StatusFlags.Hostile) != 0 && bc.ClassJob.Id == 0)
{
double dist = Vector3.Distance(_state.cs.LocalPlayer.Position, go.Position);
Expand Down Expand Up @@ -138,7 +138,7 @@ protected override bool ExecutionImplementation()
Vector2 pt = new Vector2();
float defSize = ImGui.GetFontSize();
float mul = 20.0f / defSize;
foreach (GameObject go in _state.ot)
foreach (IGameObject go in _state.ot)
{
// 2007187 dead return
// 2009506 hoh return
Expand Down Expand Up @@ -238,7 +238,7 @@ protected override bool ExecutionImplementation()
float defSize = ImGui.GetFontSize();
float mul = 20.0f / defSize;
Vector4 itemcol = GoldColor;
foreach (GameObject go in _state.ot)
foreach (IGameObject go in _state.ot)
{
if (
(go.ObjectKind == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Treasure)
Expand Down
6 changes: 3 additions & 3 deletions Lemegeton/Content/Hack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Lemegeton.Core;
using System;
using System.Numerics;
using GameObject = Dalamud.Game.ClientState.Objects.Types.GameObject;
using GameObject = Dalamud.Game.ClientState.Objects.Types.IGameObject;
using GameObjectPtr = FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject;
using Vector3 = System.Numerics.Vector3;

Expand Down Expand Up @@ -53,11 +53,11 @@ public System.Action Teleport
protected override bool ExecutionImplementation()
{
ImDrawListPtr draw;
uint myid = _state.cs.LocalPlayer.ObjectId;
ulong myid = _state.cs.LocalPlayer.GameObjectId;
int plys = 0;
foreach (GameObject go in _state.ot)
{
if (go.ObjectKind == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Player && go.ObjectId != myid)
if (go.ObjectKind == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Player && go.GameObjectId != myid)
{
plys++;
}
Expand Down
Loading

0 comments on commit 5403b10

Please sign in to comment.