public override void CheckSuccess(CombatData combatData, AgentData agentData, FightData fightData, HashSet <AgentItem> playerAgents) { var raidRewardsTypes = new HashSet <int> { 55821, 60685, 914, 22797 }; List <RewardEvent> rewards = combatData.GetRewardEvents(); RewardEvent reward = rewards.FirstOrDefault(x => raidRewardsTypes.Contains(x.RewardType)); if (reward != null) { fightData.SetSuccess(true, reward.Time); } else { switch (GenericFallBackMethod) { case FallBackMethod.Death: SetSuccessByDeath(combatData, fightData, playerAgents, true, GetSuccessCheckIds()); break; case FallBackMethod.CombatExit: SetSuccessByCombatExit(new HashSet <int>(GetSuccessCheckIds()), combatData, fightData, playerAgents); break; default: break; } } }
public override void CheckSuccess(CombatData combatData, AgentData agentData, FightData fightData, HashSet <AgentItem> playerAgents) { // check reward NPC mainTarget = Targets.Find(x => x.ID == GenericTriggerID); if (mainTarget == null) { throw new InvalidOperationException("Error Encountered: Main target of the fight not found"); } RewardEvent reward = combatData.GetRewardEvents().LastOrDefault(); AbstractDamageEvent lastDamageTaken = combatData.GetDamageTakenData(mainTarget.AgentItem).LastOrDefault(x => (x.Damage > 0) && playerAgents.Contains(x.From.GetFinalMaster())); if (lastDamageTaken != null) { if (reward != null && lastDamageTaken.Time - reward.Time < 100) { fightData.SetSuccess(true, Math.Min(lastDamageTaken.Time, reward.Time)); } else { SetSuccessByDeath(combatData, fightData, playerAgents, true, GenericTriggerID); if (fightData.Success) { fightData.SetSuccess(true, Math.Min(fightData.FightEnd, lastDamageTaken.Time)); } } } }
internal override void CheckSuccess(CombatData combatData, AgentData agentData, FightData fightData, IReadOnlyCollection <AgentItem> playerAgents) { RewardEvent reward = combatData.GetRewardEvents().FirstOrDefault(x => x.RewardType == 55821); if (reward != null) { fightData.SetSuccess(true, reward.Time); } }
internal override void CheckSuccess(CombatData combatData, AgentData agentData, FightData fightData, IReadOnlyCollection <AgentItem> playerAgents) { IReadOnlyList <RewardEvent> rewards = combatData.GetRewardEvents(); RewardEvent reward = rewards.FirstOrDefault(x => x.RewardType == 29453); if (reward != null) { fightData.SetSuccess(true, reward.Time); } else { SetSuccessByDeath(combatData, fightData, playerAgents, true); } }
internal override void CheckSuccess(CombatData combatData, AgentData agentData, FightData fightData, IReadOnlyCollection <AgentItem> playerAgents) { var raidRewardsTypes = new HashSet <int>(); ulong build = combatData.GetBuildEvent().Build; if (build < 97235) { raidRewardsTypes = new HashSet <int> { // Old types, on each kill 55821, 60685 }; } else { raidRewardsTypes = new HashSet <int> { // New types, once per week 22797 }; } IReadOnlyList <RewardEvent> rewards = combatData.GetRewardEvents(); RewardEvent reward = rewards.FirstOrDefault(x => raidRewardsTypes.Contains(x.RewardType)); if (reward != null) { fightData.SetSuccess(true, reward.Time); } else { switch (GenericFallBackMethod) { case FallBackMethod.Death: SetSuccessByDeath(combatData, fightData, playerAgents, true, GetSuccessCheckIds()); break; case FallBackMethod.CombatExit: SetSuccessByDeath(combatData, fightData, playerAgents, true, GetSuccessCheckIds()); if (!fightData.Success) { SetSuccessByCombatExit(new HashSet <int>(GetSuccessCheckIds()), combatData, fightData, playerAgents); } break; default: break; } } }
public override void CheckSuccess(CombatData combatData, AgentData agentData, FightData fightData, HashSet<AgentItem> playerAgents) { var strikeRewardIDs = new HashSet<ulong> { 993 }; List<RewardEvent> rewards = combatData.GetRewardEvents(); RewardEvent reward = rewards.FirstOrDefault(x => strikeRewardIDs.Contains(x.RewardID)); if (reward != null) { fightData.SetSuccess(true, reward.Time); } else { SetSuccessByDeath(combatData, fightData, playerAgents, true); } }
internal override void CheckSuccess(CombatData combatData, AgentData agentData, FightData fightData, IReadOnlyCollection <AgentItem> playerAgents) { // check reward NPC mainTarget = Targets.FirstOrDefault(x => x.ID == GenericTriggerID); if (mainTarget == null) { throw new MissingKeyActorsException("Main target of the fight not found"); } RewardEvent reward = combatData.GetRewardEvents().LastOrDefault(); AbstractHealthDamageEvent lastDamageTaken = combatData.GetDamageTakenData(mainTarget.AgentItem).LastOrDefault(x => (x.HealthDamage > 0) && playerAgents.Contains(x.From.GetFinalMaster())); if (lastDamageTaken != null) { if (reward != null && Math.Abs(lastDamageTaken.Time - reward.Time) < 100) { fightData.SetSuccess(true, Math.Min(lastDamageTaken.Time, reward.Time)); } else { SetSuccessByDeath(combatData, fightData, playerAgents, true, GenericTriggerID); } } }