38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using ServerCommon;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace GameServer;
|
|
|
|
public class QuestInteriroMode : QuestBase
|
|
{
|
|
private Int32 m_count = 0;
|
|
public QuestInteriroMode(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, string typeName, int count) : base(targetType, eventNameType, 0, typeName, count.ToString(), string.Empty)
|
|
{
|
|
m_count = count;
|
|
if (count == 0)
|
|
{
|
|
m_condition_2 = string.Empty;
|
|
}
|
|
}
|
|
|
|
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
|
{
|
|
|
|
if (false == events.EventCondition1.Equals(m_condition_1)) return false;
|
|
if(events.EventCondition2.Equals(string.Empty)) return true;
|
|
|
|
if (false == int.TryParse(events.EventCondition2, out var cond2)) return false;
|
|
if (cond2 > m_count) return false;
|
|
return true;
|
|
}
|
|
|
|
public override async Task<Result> postProcess(Player player, QuestTaskUpdateHandler questTaskUpdateHandler)
|
|
{
|
|
return await QuestNotifyHelper.sendRedisQuestNotifyRequest(player, questTaskUpdateHandler);
|
|
}
|
|
}
|