Exemple #1
0
        // Main method
        public ushort TryFindSrc(AbstractActor a, long time, long extension, ParsedLog log)
        {
            int sbCheck = CheckSoulbeast(a, extension, log);

            if (sbCheck != -1)
            {
                return((ushort)sbCheck);
            }
            HashSet <long> idsToCheck = new HashSet <long>();

            if (DurationToIDs.TryGetValue(extension, out idsToCheck))
            {
                List <CastLog> cls = GetExtensionSkills(log, time, idsToCheck);
                if (cls.Count == 1)
                {
                    CastLog item = cls.First();
                    // Imbued Melodies check
                    int tempestCheck = CheckTempest(item, time, extension, log);
                    if (tempestCheck != -1)
                    {
                        return((ushort)tempestCheck);
                    }
                    return(item.SrcInstId);
                }
            }
            return(0);
        }
Exemple #2
0
 private int CheckTempest(CastLog item, long time, long extension, ParsedLog log)
 {
     if (extension == ImbuedMelodies && log.PlayerListBySpec.TryGetValue("Tempest", out List <Player> tempests))
     {
         HashSet <ushort> magAuraApplications = new HashSet <ushort>(log.CombatData.GetBoonData(5684).Where(x => x.IsBuffRemove == ParseEnum.BuffRemove.None && Math.Abs(x.Time - log.FightData.ToLogSpace(time)) < 50 && x.SrcInstid != item.SrcInstId).Select(x => x.SrcInstid));
         foreach (Player tempest in tempests)
         {
             if (magAuraApplications.Contains(tempest.InstID))
             {
                 return(0);
             }
         }
     }
     return(-1);
 }
        protected virtual void SetCastLogs(ParsedLog log)
        {
            CastLog curCastLog = null;

            foreach (CombatItem c in log.CombatData.GetCastData(InstID, FirstAware, LastAware))
            {
                ParseEnum.StateChange state = c.IsStateChange;
                if (state == ParseEnum.StateChange.Normal)
                {
                    if (c.IsActivation.StartCasting())
                    {
                        // Missing end activation
                        long time = log.FightData.ToFightSpace(c.Time);
                        if (curCastLog != null)
                        {
                            int actDur = curCastLog.SkillId == SkillItem.DodgeId ? 750 : curCastLog.ExpectedDuration;
                            curCastLog.SetEndStatus(actDur, ParseEnum.Activation.Unknown, time);
                            curCastLog = null;
                        }
                        curCastLog = new CastLog(time, c.SkillID, c.Value, c.IsActivation, Agent, InstID);
                        CastLogs.Add(curCastLog);
                    }
                    else
                    {
                        if (curCastLog != null)
                        {
                            if (curCastLog.SkillId == c.SkillID)
                            {
                                int actDur = curCastLog.SkillId == SkillItem.DodgeId ? 750 : c.Value;
                                curCastLog.SetEndStatus(actDur, c.IsActivation, log.FightData.FightDuration);
                                curCastLog = null;
                            }
                        }
                    }
                }
                else if (state == ParseEnum.StateChange.WeaponSwap)
                {
                    long    time    = log.FightData.ToFightSpace(c.Time);
                    CastLog swapLog = new CastLog(time, SkillItem.WeaponSwapId, (int)c.DstAgent, c.IsActivation, Agent, InstID);
                    if (CastLogs.Count > 0 && (time - CastLogs.Last().Time) < 10 && CastLogs.Last().SkillId == SkillItem.WeaponSwapId)
                    {
                        CastLogs[CastLogs.Count - 1] = swapLog;
                    }
                    else
                    {
                        CastLogs.Add(swapLog);
                    }
                    swapLog.SetEndStatus(50, ParseEnum.Activation.Unknown, log.FightData.FightDuration);
                }
            }
            long cloakStart = 0;

            foreach (long time in log.CombatData.GetBuffs(InstID, 40408, FirstAware, LastAware).Select(x => log.FightData.ToFightSpace(x.Time)))
            {
                if (time - cloakStart > 10)
                {
                    CastLog dodgeLog = new CastLog(time, SkillItem.DodgeId, 0, ParseEnum.Activation.Unknown, Agent, InstID);
                    dodgeLog.SetEndStatus(50, ParseEnum.Activation.Unknown, log.FightData.FightDuration);
                    CastLogs.Add(dodgeLog);
                }
                cloakStart = time;
            }
            CastLogs.Sort((x, y) => x.Time.CompareTo(y.Time));
        }