I reversed a bit ChCliQuest structure, it's located at ControlledPlayerPtr + 0x65C.
But i can't find where is current quest step value is stored, maybe someone can help me.
My code:
Code:
public class Gw2Quest : NativeObject
{
public Gw2Quest(IntPtr ptr) : base(ptr)
{
}
public IntPtr ActiveQuestPtr
{
get { return Memory.Read<IntPtr>(NativePtr + 0x28); }
}
public IntPtr QuestDefPtr
{
get { return Memory.Read<IntPtr>(ActiveQuestPtr + 0x28); }
}
public IntPtr ActiveGoalPtr
{
get { return Memory.Read<IntPtr>(ActiveQuestPtr + 0x4); }
}
public int ActiveGoalId
{
get { return Memory.Read<int>(ActiveGoalPtr + 0x10); }
}
public string ActiveGoalDescription
{
get
{
var contentId = Memory.Read<int>(ActiveGoalPtr + 0x20);
if (contentId != 0)
{
return API.DecodeStringById(contentId);
}
return "Empty";
}
}
public string ActiveGoalDescriptionFull
{
get
{
var contentId = Memory.Read<int>(ActiveGoalPtr + 0x24);
if (contentId != 0)
{
return API.DecodeStringById(contentId);
}
return "Empty";
}
}
public string Name
{
get
{
var contentId = Memory.Read<int>(QuestDefPtr + 0x24);
if (contentId != 0)
{
return API.DecodeStringById(contentId);
}
return "Empty";
}
}
public int DataId
{
get { return Memory.Read<int>(QuestDefPtr + 0x20); }
}
public bool IsCompleted
{
get { return (Memory.Read<int>(ActiveQuestPtr + 0x40) & 1) == 1; }
}
public IEnumerable<int> QuestSteps
{
get
{
var activePtr = ActiveQuestPtr;
var v2 = Memory.Read<int>(activePtr + 0x30);
var v6 = v2 + (4 * Memory.Read<int>(activePtr + 0x38));
if (v2 >= v6)
{
yield break;
}
IntPtr v3 = IntPtr.Zero;
while (true)
{
v3 = Memory.Read<IntPtr>((IntPtr)v2);
if (v3 == IntPtr.Zero)
{
yield break;
}
var v4 = Core.Memory.Read<IntPtr>(v3 + 4);
if (v4 == IntPtr.Zero)
{
yield break;
}
v2 += 4;
yield return Core.Memory.Read<int>(v4 + 20);
if (v2 >= v6)
{
yield break;
}
}
}
}
}
And i also have some questions about ChCliReward. I've only found it's location at ControlledPlayerPtr + 0x714, but that's all. I'd like to know is there's a way to read current available rewards?
Thank you.