File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed
Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 11using System ;
2+ using System . Collections . Generic ;
23using ff14bot ;
34using ff14bot . Managers ;
4- using LlamaLibrary . Memory . Attributes ;
55using LlamaLibrary . Memory ;
66
77namespace LlamaLibrary . RemoteAgents
88{
99 public class AgentAchievement : AgentInterface < AgentAchievement > , IAgent
1010 {
1111 public IntPtr RegisteredVtable => AgentAchievementOffsets . VTable ;
12-
1312
1413 protected AgentAchievement ( IntPtr pointer ) : base ( pointer )
1514 {
1615 }
1716
1817 public byte Status => Core . Memory . NoCacheRead < byte > ( Pointer + AgentAchievementOffsets . Status ) ;
18+
19+ private static readonly Dictionary < string , int > VFunctionIds = new ( )
20+ {
21+ { "Show" , 3 } ,
22+ { "Hide" , 5 } ,
23+ { "IsAgentActive" , 6 } ,
24+ { "GetAddonId" , 9 } ,
25+ } ;
26+
27+ private bool IsAgentActive => Core . Memory . CallInjected64 < byte > ( VFunctionAddress ( "IsAgentActive" ) , Pointer ) == 1 ;
28+
29+ public bool IsOpen => IsAgentActive ;
30+
31+ private IntPtr VFunctionAddress ( string function )
32+ {
33+ var index = VFunctionIds [ function ] ;
34+
35+ return Core . Memory . Read < IntPtr > ( Core . Memory . Read < IntPtr > ( Pointer ) + 0x8 * index ) ;
36+ }
37+
38+
1939 }
2040}
You can’t perform that action at this time.
0 commit comments