Ejemplo n.º 1
0
        private void AddCombatAction(LogLineEventArgs logInfo, string attacker, string victim, string theAttackType, bool critical, string special, Dnum damage, SwingTypeEnum swingType, string damageType)
        {
            DateTime now = logInfo.detectedTime;

            if (ActGlobals.oFormActMain.SetEncounter(now, attacker, victim))
            {
                // attempt to guess the party member's class
                if (GuessChanter)
                {
                    PartyMembers.SetClass(attacker, theAttackType);
                }

                // redirect attacks from pets/servants as coming from summoner
                if (SummonerRecordSet.IsSummonedPet(attacker))
                {
                    var summonerRecord = SummonerRecordSet.GetSummonerRecord(victim, attacker, now);
                    if (summonerRecord != null)
                    {
                        string pet = attacker;
                        if (AionData.Pet.IsTargettedPet(pet))
                        {
                            attacker      = summonerRecord.Actor;
                            theAttackType = summonerRecord.Skill;
                        }
                        else if (LinkPets)
                        {
                            attacker = summonerRecord.Actor;
                            if (summonerRecord.Duration <= 60)
                            {
                                theAttackType = summonerRecord.Skill;
                            }
                            else
                            {
                                theAttackType += "(" + pet + ")";
                            }
                        }
                    }
                }
                else if (SummonerRecordSet.IsSummonedPet(victim))
                {
                    if (AionData.Pet.IsPet(victim))
                    {
                        // handle player pets
                        if (AionData.Pet.PetDurations[victim] <= 60)
                        {
                            return;                                          // ignore damage done to short-duration temporary pets // TODO: this should be a checkbox as this will decrease the dps of the attacker
                        }
                        var summonerRecord = SummonerRecordSet.GetSummonerRecord(null, victim, now);
                        if (LinkPets)
                        {
                            ////return; // TODO: how do we treat damage done to spiritmaster's pets?
                        }
                    }
                    else
                    {
                        // handle monster/unknown pets
                        if (LinkPets)
                        {
                            // TODO: how do we treat damage done to mob's pets?
                        }
                        else
                        {
                            ////victim += " (inc)"; // TODO: this should be a checkbox if we want damage shown to mob pets
                        }
                    }
                }

                int globalTime = ActGlobals.oFormActMain.GlobalTimeSorter++;
                ActGlobals.oFormActMain.AddCombatAction((int)swingType, critical, special, attacker, theAttackType, damage, now, globalTime, victim, damageType);
            }
        }