[Release] Flower System (5165)

02/20/2010 20:47 ArtOfWar#16
When i add this code

Code:
#region Flowers
                        case 1150:
                            {
                                string ID = "";
                                for (byte x = 18; x < 25; x++)
                                {
                                    ID += Convert.ToChar(Data[x]).ToString();
                                }
                                uint TargetID = uint.Parse(ID);
                                Character TC = (Character)Game.World.H_Chars[TargetID];
                                GC.LocalMessage(2005, "Sending flowers to " + TargetID.ToString() + ", wait for the answer.");
                                if (Game.World.H_Chars.Contains(TargetID))
                                {
                                    //GC.AddSend(Packets.SendFlowerScreen(GC.MyChar.EntityID));
                                    TC.MyClient.AddSend(Packets.ReceiveFlower(TC.EntityID, 0, 0, 0).Get);
                                }
                                for (byte i = 0; i < 12; i++)
                                    Console.WriteLine(Data[i].ToString());
                                break;
                            }
                        case 1151:
                            {
                                Struct.Flowers F = GC.MyChar.Flowers;
                                string ToSend = " " + F.RedRoses.ToString() + " " + F.RedRoses2day.ToString() + " " + F.Lilies.ToString() + " " + F.Lilies2day.ToString() + " ";
                                ToSend += F.Orchads.ToString() + " " + F.Orchads2day.ToString() + " " + F.Tulips.ToString() + " " + F.Tulips2day.ToString();
                                GC.AddSend(Packets.FlowerPacket(ToSend));
                                break;
                            }
                        #endregion
I get errors with "Characters" and "Struct"
Any idea why?
02/20/2010 21:39 ramix#17
12taisl and .Arco is rigth the release is for help ppl can be full or not is only for hlp ppl...


and PM's GM's drop staffs is easy to fix go to dropitem code and you will find the problem...
02/20/2010 21:42 Arcо#18
Quote:
Originally Posted by Decker_ View Post
Off-topic:
Do you have a code that you can release that PM/GM's can drop things and people can see it?
Yes
02/20/2010 21:54 ~Yuki~#19
Epic!
02/20/2010 23:28 HardNotTo#20
Quote:
Originally Posted by Decker_ View Post
Not necessarily.
Everyone has there own opinions and my opinion is people shoudn't release stuff that is not completed.
I'm sure people would agree with me.

Off-topic:
Do you have a code that you can release that PM/GM's can drop things and people can see it?
does anyone ever agree with you?
02/20/2010 23:33 Arcо#21
Quote:
Originally Posted by HardNotTo View Post
does anyone ever agree with you?
Nope.
02/21/2010 02:03 HardNotTo#22
after working on some of the errors I had this is what im left with.

Code:
Error	7	'NewestCOServer.Game.World' does not contain a definition for 'Flowers'	C:\rock test server\rikardo updated\Database.cs	500	44	NewestCOServer
im not good at creating voids just yet...
02/21/2010 02:18 dillhack#23
lol 1 error here

Quote:
Error 1 'object' does not contain a definition for 'Get' and no extension method 'Get' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?) C:\Weird-CoV2\PacketHandler.cs 48 101 NewestCOServer
02/21/2010 04:22 hunterman01#24
Quote:
Originally Posted by HardNotTo View Post
after working on some of the errors I had this is what im left with.

Code:
Error	7	'NewestCOServer.Game.World' does not contain a definition for 'Flowers'	C:\rock test server\rikardo updated\Database.cs	500	44	NewestCOServer
im not good at creating voids just yet...
Code:
public int Flowers =0;
02/21/2010 11:19 12tails#25
Releasing updates... thats will make the flower system mostly complete... will just miss on how to save and the npc will be removed.... i've got how to get the item and amount + flower type : D

in a sec it'll be at first post : P
02/21/2010 19:12 killersub#26
lol since I'm like a super noob I don't know how to save/load the flowers in my server...
u have a mysql database I don't lol...

Code:
public static void SaveFlowerRank(Game.Character C)
        {
            MySqlConnection Conn = GetConnection();
            bool exist = false;
            string Name = C.Name;

            if (Name.Contains("[PM]"))
                Name.Replace("[PM]", "");

            try
            {
                lock (Conn)
                {
                    MySqlCommand Cmd = new MySqlCommand("SELECT * FROM `cq_flowers` WHERE `charuid2` = '" + C.Name + "'", Conn);
                    MySqlDataReader DR = Cmd.ExecuteReader();

                    while (DR.Read())
                    {
                        exist = true;
                    }
                    DR.Close();
                }
                lock (Conn)
                {
                    Struct.Flowers F = C.Flowers;
                    if (exist)
                    {
                        MySqlCommand Cmd = new MySqlCommand("UPDATE `cq_flowers` SET `redroses` = " + F.RedRoses + ", `redrosestoday` = " + F.RedRoses2day + ",`lilies` = " + F.Lilies + ",`liliestoday` = " + F.Lilies2day + ",`redrosestoday` = " + F.Tulips + ",`redrosestoday` = " + F.Tulips2day + ",`orchads` = " + F.Orchads + ",`orchadstoday` = " + F.Orchads2day + ", WHERE `charuid2` = \"" + Name + "\"", Conn);
                        Cmd.ExecuteNonQuery();
                    }
                    else
                    {
                        MySqlCommand Cmd = new MySqlCommand("INSERT INTO `cq_flowers` (redroses, redrosestoday, lilies, liliestoday, tulips, tulipstoday, orchads, orchadstoday, charuid, charuid2) VALUES (" + F.RedRoses + "," + F.RedRoses2day + "," + F.Lilies + "," + F.Lilies2day + "," + F.Tulips + "," + F.Tulips2day + "," + F.Orchads + "," + F.Orchads2day + "," + C.EntityID + ",'" + Name + "')", Conn);
                        Cmd.ExecuteNonQuery();
                    }
                }
                lock (Conn)
                {
                    string Save = DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day;
                    MySqlCommand Cmd = new MySqlCommand("UPDATE `cq_saves` SET `save_flower` = " + Save + " WHERE `type` = 0", Conn);
                    Cmd.ExecuteNonQuery();
                }
                Conn.Close();
            }
            catch (Exception ex) { Console.WriteLine(ex.ToString()); Conn.Close(); return; }
        }
I wanna put that into my database It's ini not mysql...

If anyone can fix this for me/tell me where to put it at...It'll be very helpful!
02/21/2010 19:26 Luiz01#27
Haiii 12tails my friend =D
stay doing this great job thanks :D
02/22/2010 03:41 -Shunsui-#28
Tommorrow (My TIme, Us East (UTC)) We will work On Saving It and Loading it, Also The thread will be updated to the normal Use of 5165 since hes already converted to MySql normal used tested on my source will be updated tommorow
02/22/2010 03:45 walmartboi#29
I'll post my .ini save flower script once it's done :D
02/22/2010 15:37 [GM]#30
FlowerName is underlined red in Packet Handler