Пример #1
0
        public void SetQuestData(int QuestID, string pData, bool pSendPacket = true)
        {
            if (!Quests.ContainsKey(QuestID))
            {
                return;
            }

            Quests[QuestID].Data = pData;
            QuestPacket.SendQuestDataUpdate(Character, QuestID, pData);
        }
Пример #2
0
        public bool AddNewQuest(int QuestID, string Data = "")
        {
            if (Quests.ContainsKey(QuestID))
            {
                return(false);
            }

            Server.Instance.CharacterDatabase.RunQuery("INSERT INTO character_quests (id, charid, questid, data) VALUES (NULL, " + Character.ID.ToString() + ", " + QuestID + ", '" + MySqlHelper.EscapeString(Data) + "')");
            int ID = Server.Instance.CharacterDatabase.GetLastInsertId();

            Quests[QuestID] = new QuestData
            {
                ID      = ID,
                Data    = Data,
                QuestID = QuestID
            };
            QuestPacket.SendQuestDataUpdate(Character, QuestID, Data);
            return(true);
        }