Beispiel #1
0
 public void Complete(MapleCharacter c, int npc, int selection, bool force)
 {
     try
     {
         var arg1          = m_autoPreComplete || CheckNpcOnMap(c, npc);
         var canbeComplete = CanComplete(c, npc);
         if (force || (arg1 && canbeComplete))
         {
             foreach (var action in CompleteActs)
             {
                 if (!action.Check(c))
                 {
                 }
             }
             foreach (var action in CompleteActs)
             {
                 action.Run(c, selection);
             }
             var oldStatus = c.GetQuest(this);
             var newStatus = new MapleQuestStatus(this, MapleQuestStatusType.Completed, npc);
             newStatus.Forfeited = oldStatus.Forfeited;
             c.UpdateQuest(newStatus);
         }
         else
         {
             c.DropMessage(PacketCreator.ServerMessageType.Popup, "你遇到任务错误.请稍后片刻。或请联系系统管理员");
         }
     }
     catch
     {
         c.Client.Send(PacketCreator.ServerNotice(PacketCreator.ServerMessageType.Popup, "系统发生错误.请联系系统管理员解决"));
     }
 }
Beispiel #2
0
 public void Start(MapleCharacter c, int npc, bool force)
 {
     try
     {
         var arg1 = force && CheckNpcOnMap(c, npc);
         var arg2 = m_autoStart || CheckNpcOnMap(c, npc);
         var arg3 = CanStart(c, npc);
         if (arg1 || (arg2 && arg3))
         {
             foreach (var action in StartActs)
             {
                 action.Run(c, null);
             }
             var oldStatus = c.GetQuest(this);
             var newStatus = new MapleQuestStatus(this, MapleQuestStatusType.Started, npc);
             newStatus.CompletionTime = oldStatus.CompletionTime;
             newStatus.Forfeited      = oldStatus.Forfeited;
             c.UpdateQuest(newStatus);
         }
     }
     catch
     {
         c.Client.Send(PacketCreator.ServerNotice(PacketCreator.ServerMessageType.Popup, "发生错误,请截图后联系管理员."));
     }
 }
Beispiel #3
0
        public void ForceComplete(MapleCharacter c, int npc)
        {
            var oldStatus = c.GetQuest(this);
            var newStatus = new MapleQuestStatus(this, MapleQuestStatusType.Completed, npc);

            newStatus.Forfeited = oldStatus.Forfeited;
            c.UpdateQuest(newStatus);
        }
Beispiel #4
0
        public void Forfeit(MapleCharacter c)
        {
            if (c.GetQuest(this).Status != MapleQuestStatusType.Started)
            {
                return;
            }
            var oldStatus = c.GetQuest(this);
            var newStatus = new MapleQuestStatus(this, MapleQuestStatusType.NotStarted);

            newStatus.Forfeited      = oldStatus.Forfeited + 1;
            newStatus.CompletionTime = oldStatus.CompletionTime;
            c.UpdateQuest(newStatus);
        }