public void UpdateActiveBounty()
{
var activeBounty = new BountyInfoCache();
BountyInfo ZetaActiveBounty=null;
using(ZetaDia.Memory.AcquireFrame())
{
ZetaActiveBounty = ZetaDia.ActInfo.ActiveBounty;
}
if (ZetaActiveBounty != null)
{
activeBounty = new BountyInfoCache(ZetaDia.ActInfo.ActiveBounty);
if ((ActiveBounty == null || ActiveBounty.QuestSNO != activeBounty.QuestSNO) && activeBounty.QuestSNO != 0)
{
ActiveBounty = activeBounty;
Logger.Write(LogLevel.Bounty, "Active Bounty Changed To {0}", ActiveBounty.QuestSNO);
//nullify Cache Entry then set it if Cache contains it.
CurrentBountyCacheEntry = null;
}
else if (activeBounty.QuestSNO == 0)
{//nullify when active bounty is nothing
ActiveBounty = null;
}
return;
}
RefreshActiveQuests();
if (ActiveQuests.ContainsKey(ADVENTUREMODE_RIFTID) && ActiveQuests[ADVENTUREMODE_RIFTID].State!= QuestState.NotStarted)
{
if (ActiveBounty!=null && ActiveBounty.QuestSNO == ADVENTUREMODE_RIFTID)
{
((QuestInfoCache)ActiveBounty).Refresh();
}
else
{
ActiveBounty = ActiveQuests[ADVENTUREMODE_RIFTID];
Logger.Write(LogLevel.Bounty, "Active Bounty Changed To Rifting");
}
}
else if(ActiveQuests.ContainsKey(ADVENTUREMODE_GREATERRIFT_TRIAL) && ActiveQuests[ADVENTUREMODE_GREATERRIFT_TRIAL].State!= QuestState.NotStarted)
{
if (ActiveBounty != null && ActiveBounty.QuestSNO == ADVENTUREMODE_GREATERRIFT_TRIAL)
{
((QuestInfoCache)ActiveBounty).Refresh();
}
else
{
ActiveBounty = ActiveQuests[ADVENTUREMODE_GREATERRIFT_TRIAL];
Logger.Write(LogLevel.Bounty, "Active Bounty Changed To Rift Trial");
}
}
else
{
Logger.Write(LogLevel.Bounty, "Active Bounty Is Null!");
}
}