private async Task <bool> IsValidScriptAsync(ICharacterEntity character, QuestActionType type, int scriptId, int scriptStepId) { var script = _scripts.FirstOrDefault(s => (s.ScriptId == scriptId) && (s.ScriptStepId == scriptStepId)); if (script == null) { return(false); } return(script.StepType switch { "q_complete" => await ValidateQuestAsync(character, script.Argument1 ?? 0).ConfigureAwait(false), "quest" => await AddQuestAsync(character, type, script.Argument1 ?? 0).ConfigureAwait(false), "time" => await TimeAsync(script.Argument1 ?? 0).ConfigureAwait(false), "targetoff" => await TargetOffPacketAsync(script.Argument1 ?? 0, character).ConfigureAwait(false), "web" => true, "talk" => true, "openwin" => true, "opendual" => true, "move" => false, //todo handle "q_pay" => false, //todo handle "target" => false, //todo handle "run" => true, //todo handle _ => false, });
public WzQuestIntegerPairAction(QuestActionType type, Dictionary <int, int> data) : base(type) { Data = data; }
public WzQuestIntegerAction(QuestActionType type, int data) : base(type) { Data = data; }
public WzQuestAction(QuestActionType type) { Type = type; }
public PresenterAttribute(QuestActionType type) { Type = type; }