Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 23:31

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Adding new table for quest.

Discussion on Adding new table for quest. within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
LordGragen.'s Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 606
Received Thanks: 68
Adding new table for quest.

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

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();

        }
    }
}
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

Code:
#region Quest Reset
                            if (DateTime.Now.Hour == 03 && DateTime.Now.Minute >= 00)
                            {
                                Database.QuestTable.ResetQuests(client.Entity);

                            }
                            #endregion
and here is when they done the quest how it send the 1 to navicat.


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;
navicat part




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
LordGragen. is offline  
Old 04/08/2013, 21:57   #2
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Surely it wont add anyvalue ...
PHP 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();

        }
    }

u havent made Insert Function .. Set Method is used to update The inserted value inside the database and since u havent inserted any value so it wont work ... btw u need to load the quest table everytime the player login
shadowman123 is offline  
Reply


Similar Threads Similar Threads
Quest-Table kaputt
05/03/2012 - Metin2 Private Server - 4 Replies
Hallo ich habe ein problem bei meinem Metin2 Pserver! Wenn ich mich einlogge und auf die Alte Frau klicke, kommt die Meldung "Spiel wird Beendet". Und wenn ich bei Navicat unter Player die Quest Tabelle öffnen will, kommt die Fehlermeldung: "145 - Table'./player/quest' is marked as crashed and should be repaired. Was soll ich tun? Oder kann mir jemand das bitte villeicht über TeamViewer machen? THX im Vorraus ;)
Adding monster killing quest
02/25/2011 - CO2 Private Server - 1 Replies
Hello :) on my server its a leveling zone with MobVictim as name! how can i add a quest npc, that gives you 1kk cps if you kill 2500 MobVictim's ? plz help me... Thanks :)
hi we want in Ultimatia Source (The_Legend) server moon box quest can any one adding
11/13/2008 - CO2 Private Server - 1 Replies
hi we want in Ultimatia Source (The_Legend) server moon box quest can any one adding the code here with steps pleas Thnx and we r use Power Source



All times are GMT +1. The time now is 23:32.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.