hey guys so since my project is going to have alot of quests i was thiking to make a new table in navicat "quest" insited of saving them in enitity table, just to make it more clean.
but i been having small problems,
last night i coded few stuff which i tested didnt work proper, then thx to sedat we fixed few stuff.
now there is this 1 thing i am stuck not sure what will it be and any kind of help will be nice.
so first here is the questtable.cs
so everytime a person is done with the quest it will add 1 inside of the navicat, but since my quests can be done 1 time a day i added a timer which will reset all the quests every 24 hours.
program.cs
and here is when they done the quest how it send the 1 to navicat.
here is the last part of the npc
navicat part
[Only registered and activated users can see links. Click Here To Register...]
but somehow when the quest is done its not saving the 1, its not sending anything to the database. any help will be grateful.
#request close
problem solve
but i been having small problems,
last night i coded few stuff which i tested didnt work proper, then thx to sedat we fixed few stuff.
now there is this 1 thing i am stuck not sure what will it be and any kind of help will be nice.
so first here is the questtable.cs
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Rise_Of_Medusa.Game;
using SubSonic;
namespace Rise_Of_Medusa.Database
{
public class QuestTable
{
public static void ResetQuests(Game.Entity client)
{
MySqlCommand Do = new MySqlCommand(MySqlCommandType.UPDATE);
Do.Update("quest").Set("StoneFindingQuest", 0).Where("EntityName", client.Name).Execute();
}
public static void FinishQuest(Game.Entity client)
{
MySqlCommand Do = new MySqlCommand(MySqlCommandType.UPDATE);
Do.Update("quest").Set("StoneFindingQuest", 1).Where("EntityName", client.Name).Execute();
}
}
}
program.cs
Code:
#region Quest Reset
if (DateTime.Now.Hour == 03 && DateTime.Now.Minute >= 00)
{
Database.QuestTable.ResetQuests(client.Entity);
}
#endregion
here is the last part of the npc
Code:
case 2:
{
if (client.Inventory.Contains(729306, 1))
{
client.Inventory.DeleteItem(729306, 1);
Database.QuestTable.FinishQuest(client.Entity);
client.Entity.Money += 10000000;
dialog.Text("Nice you did it.");
}
}
break;
[Only registered and activated users can see links. Click Here To Register...]
but somehow when the quest is done its not saving the 1, its not sending anything to the database. any help will be grateful.
#request close
problem solve