public IState GetNextState() { if (Playfield.ModelIdentity.Instance != Constants.InfernoId && Playfield.ModelIdentity.Instance != Constants.NewInfMissionId) { return(new IdleState()); } if ((!DynelManager.Exists(Constants.QuestStarterName) && !DynelManager.Exists(Constants.SpiritNPCName))) { Chat.WriteLine("Couldn't find quest starter or spirit"); return(new ExitMissionState()); } if (!Mission.List.Exists(x => x.DisplayName.Contains(InfBuddy.ActiveGlobalSettings.GetMissionName()))) { Chat.WriteLine($"Couldn't find mission {InfBuddy.ActiveGlobalSettings.GetMissionName()}"); return(new ExitMissionState()); } if (_target != null) { return(new FightState(_target)); } return(null); }
private void NpcDialog_AnswerListChanged(object s, Dictionary <int, string> options) { SimpleChar dialogNpc = DynelManager.GetDynel((Identity)s).Cast <SimpleChar>(); if (dialogNpc.Name == Constants.QuestGiverName) { foreach (KeyValuePair <int, string> option in options) { if (option.Value == "Is there anything I can help you with?" || (ActiveGlobalSettings.MissionFaction == MissionFaction.Clan && option.Value == "I will defend against the Unredeemed!") || (ActiveGlobalSettings.MissionFaction == MissionFaction.Omni && option.Value == "I will defend against the Redeemed!") || (ActiveGlobalSettings.MissionFaction == MissionFaction.Neut && option.Value == "I will defend against the creatures of the brink!") || (ActiveGlobalSettings.MissionDifficulty == MissionDifficulty.Easy && option.Value == "I will deal with only the weakest aversaries") || //Brink missions have a typo (ActiveGlobalSettings.MissionDifficulty == MissionDifficulty.Easy && option.Value == "I will deal with only the weakest adversaries") || (ActiveGlobalSettings.MissionDifficulty == MissionDifficulty.Medium && option.Value == "I will challenge these invaders, as long as there aren't too many") || (ActiveGlobalSettings.MissionDifficulty == MissionDifficulty.Hard && option.Value == "I will purge the temple of any and all assailants")) { NpcDialog.SelectAnswer(dialogNpc.Identity, option.Key); } } } else if (dialogNpc.Name == Constants.QuestStarterName) { foreach (KeyValuePair <int, string> option in options) { if (option.Value == "Yes, I am ready.") { NpcDialog.SelectAnswer(dialogNpc.Identity, option.Key); } } } }
public IState GetNextState() { if (!DynelManager.Exists(QuestStarterName)) { return(new DefendSpiritState()); } return(null); }
public IState GetNextState() { if (!InfBuddy.Running) { return(null); } //We have no possible action if you aren't in a team. if (!DynelManager.LocalPlayer.IsInTeam()) { return(null); } if (Playfield.ModelIdentity.Instance == Constants.InfernoId) { //The provided navmesh is rather small in scope so we will take no action if we are not near Ergo. if (DynelManager.LocalPlayer.Position.DistanceFrom(Constants.ErgoVicinity) > 100f) { return(null); } if (Mission.Exists(InfBuddy.ActiveGlobalSettings.GetMissionName())) { return(new MoveToEntranceState()); } else { return(new MoveToQuestGiverState()); } } else if (Playfield.ModelIdentity.Instance == Constants.NewInfMissionId) { if (DynelManager.Exists(Constants.QuestStarterName)) { return(new MoveToQuestStarterState()); } if (DynelManager.Exists(Constants.SpiritNPCName)) { return(new DefendSpiritState()); } if (InfBuddy.Config.IsLeech) { return(new LeechState()); } } return(null); }
public override void Update() { if (_fightTarget != null && Time.NormalTime > _nextTargetPathUpdate) { if (!DynelManager.IsValid(_fightTarget) || !_fightTarget.IsAlive) { _fightTarget = null; } else { NavigateToCombatPosition(); } } base.Update(); }