[Release] A Start For VIP

07/22/2009 03:16 xXxTwiztedKidxXx#31
#Bump Please Its a Good Vip Start
07/22/2009 11:46 Arcotemple:)#32
lol making benefits for it snt all that hard
07/23/2009 21:13 Pyro-G#33
EVERY SINGLE NPC I add to my server doesn't say anything...I add them right I know that but in game I click on it and it wont do anything or it will say the first line but if I click on 1 of the options it closes...It's really starting to piss me off because idk why its doing that. With this NPC too. I can click on it and it will say do you wanna become a vi[ blah blah blah but no matter what I click after that it just closes...Anyone know why?
07/23/2009 22:42 WTFoRK#34
Quote:
Originally Posted by Pyro-G View Post
EVERY SINGLE NPC I add to my server doesn't say anything...I add them right I know that but in game I click on it and it wont do anything or it will say the first line but if I click on 1 of the options it closes...It's really starting to piss me off because idk why its doing that. With this NPC too. I can click on it and it will say do you wanna become a vi[ blah blah blah but no matter what I click after that it just closes...Anyone know why?
Lol , get sum1 from epvp to check if they are allrite , if they r not then tell em 2 tell u wtf is wrong wiv em.
07/24/2009 03:02 ELB@Sh@BeCkh@M#35
Quote:
Originally Posted by f0am View Post
This is for LOTF.





Character.cs Definition..

Code:
public byte VIP = 0;
Ctrl+F and find
Code:
 public void Save()
Above place

Code:
        public void SaveVIP()
        {
            if (MyClient.There)
                if (MyClient.Online)
                    DataBase.SaveVIP(this);
        }
Next Ctrl + F and find
Code:
 public static void SaveChar(Character Charr)
and above place

Code:
        public static void SaveVIP(Character Charr)
        {
            try
            {
                MySqlCommand Command = new MySqlCommand("UPDATE `Characters` SET `VIP` = '" + Charr.VIP + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
                Command.ExecuteNonQuery();
            }
            catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
        }
Next search for
Code:
Charr.RBCount = Convert.ToByte((uint)DR["RBCount"]);
under it place

Code:
Charr.VIP= Convert.ToByte((uint)DR["VIP"]);
Dialog for npc
Code:
                            if (CurrentNPC == 1200) // Vip Grants
                            {
                                SendPacket(General.MyPackets.NPCSay("Would you like to become a VIP Member?"));
                                SendPacket(General.MyPackets.NPCLink("What does a VIP get?", 1));
                                SendPacket(General.MyPackets.NPCLink("Yes!", 2));
                                SendPacket(General.MyPackets.NPCLink("What's my VIP Level?", 4));
                                SendPacket(General.MyPackets.NPCLink("Hell No!", 255));
                                SendPacket(General.MyPackets.NPCSetFace(30));
                                SendPacket(General.MyPackets.NPCFinish());
                            }
Control for npc

Code:
                            #region VIP Grant
                            if (CurrentNPC == 1200) // Vip Grants
                            {
                                if (Control == 1) // info about vip
                                {
                                    SendPacket(General.MyPackets.NPCSay("You get special permissions and special deals and more!"));
                                    SendPacket(General.MyPackets.NPCLink("Awesome!", 255));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                                if (Control == 2) // checks vip classes makes them vip
                                {
                                    if (MyChar.VIP == 0) // checks vip level 0
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Would you like to become a VIP Member ( Level 1 ) It costs 4500 CPs. "));
                                        SendPacket(General.MyPackets.NPCLink("Yes", 3));
                                        SendPacket(General.MyPackets.NPCLink("Nope", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                    else if (MyChar.VIP == 1) // checks vip level 1
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Would you like to upgrade to VIP Member ( Level 2 ) It costs 9500 CPs. "));
                                        SendPacket(General.MyPackets.NPCLink("Yes", 3));
                                        SendPacket(General.MyPackets.NPCLink("Nope", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                    else if (MyChar.VIP == 2) // checks vip level 2
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Would you like to upgrade to VIP Member ( Level 3 ) It costs 14500 CPs. "));
                                        SendPacket(General.MyPackets.NPCLink("Yes", 3));
                                        SendPacket(General.MyPackets.NPCLink("Nope", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                    else if (MyChar.VIP == 3) // checks vip level 3
                                    {
                                        SendPacket(General.MyPackets.NPCSay("You are already a VIP Member ( Level 3 ), You can't go higher."));
                                        SendPacket(General.MyPackets.NPCLink("Nice..", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }

                                }
                                if (Control == 3) // Changes VIP level
                                {
                                    if (MyChar.VIP == 0) // checks vip level 0
                                    {
                                        if (MyChar.CPs >= 4500) // checks cps 
                                        {
                                            MyChar.CPs -= 4500;
                                            SendPacket(General.MyPackets.Vital((long)MyChar.UID, 30, MyChar.CPs));
                                            MyChar.VIP = 1; // sets vip
                                            MyChar.SaveVIP(); // saves vip
                                            SendPacket(General.MyPackets.NPCSay("Congratulations you are now a VIP Member ( Level 1 )"));
                                            SendPacket(General.MyPackets.NPCLink("Woohoo!", 255));
                                            SendPacket(General.MyPackets.NPCSetFace(30));
                                            SendPacket(General.MyPackets.NPCFinish());
                                        }
                                        else
                                        {
                                            SendPacket(General.MyPackets.NPCSay("You do not have enough CPs!"));
                                            SendPacket(General.MyPackets.NPCLink("Damn", 255));
                                            SendPacket(General.MyPackets.NPCSetFace(30));
                                            SendPacket(General.MyPackets.NPCFinish());
                                        }

                                    }
                                    else if (MyChar.VIP == 1) // checks vip level 1
                                    {
                                        if (MyChar.CPs >= 9500) // checks cps 
                                        {
                                            MyChar.CPs -= 9500;
                                            SendPacket(General.MyPackets.Vital((long)MyChar.UID, 30, MyChar.CPs));
                                            MyChar.VIP = 2; // sets vip
                                            MyChar.SaveVIP(); // saves vip
                                            SendPacket(General.MyPackets.NPCSay("Congratulations you are now a VIP Member ( Level 2 )"));
                                            SendPacket(General.MyPackets.NPCLink("Woohoo!", 255));
                                            SendPacket(General.MyPackets.NPCSetFace(30));
                                            SendPacket(General.MyPackets.NPCFinish());
                                        }
                                        else
                                        {
                                            SendPacket(General.MyPackets.NPCSay("You do not have enough CPs!"));
                                            SendPacket(General.MyPackets.NPCLink("Damn", 255));
                                            SendPacket(General.MyPackets.NPCSetFace(30));
                                            SendPacket(General.MyPackets.NPCFinish());
                                        }
                                    }
                                    else if (MyChar.VIP == 2) // checks vip level 2
                                    {
                                        if (MyChar.CPs >= 14500) // checks cps 
                                        {
                                            MyChar.CPs -= 14500;
                                            SendPacket(General.MyPackets.Vital((long)MyChar.UID, 30, MyChar.CPs));
                                            MyChar.VIP = 3; // sets vip
                                            MyChar.SaveVIP(); // saves vip
                                            SendPacket(General.MyPackets.NPCSay("Congratulations you are now a VIP Member ( Level 3 )"));
                                            SendPacket(General.MyPackets.NPCLink("Woohoo!", 255));
                                            SendPacket(General.MyPackets.NPCSetFace(30));
                                            SendPacket(General.MyPackets.NPCFinish());
                                        }
                                        else
                                        {
                                            SendPacket(General.MyPackets.NPCSay("You do not have enough CPs!"));
                                            SendPacket(General.MyPackets.NPCLink("Damn", 255));
                                            SendPacket(General.MyPackets.NPCSetFace(30));
                                            SendPacket(General.MyPackets.NPCFinish());
                                        }
                                    }
                                }
                                if (Control == 4) // tells current vip level
                                {
                                    SendPacket(General.MyPackets.NPCSay("Your VIP Level is " + MyChar.VIP + " ."));
                                    SendPacket(General.MyPackets.NPCLink("Hmm, Upgrade Time!", 2));
                                    SendPacket(General.MyPackets.NPCLink("Cool!", 255));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                            }
                            #endregion

And finally add this into the characters table structure part

Code:
Field - VIP
Type - INT
Attributes - Unsigned
NULL - not null
Default - 0

Any problems ask, if you ask if this is for coemu you obviously didn't read the thread
Can you tell us,If this VIP working on Binary 5065 ?? if that so just let us how to make it working with binary 5065??
07/24/2009 04:46 f0am#36
I dont know how to do binary sorry, i dont want to start :D
07/24/2009 04:56 ELB@Sh@BeCkh@M#37
Quote:
Originally Posted by f0am View Post
I dont know how to do binary sorry, i dont want to start :D
Damn, Ok buudy thank you anyway :)
07/24/2009 05:03 f0am#38
np, good luck =]
08/10/2009 19:05 Jay1029#39
#Bump
Can someone help meh out plox? I'm getting an error in my colsole

System.InvalidCastException: Specified cast is not valid. at COServer_Project.Database.GetCharInfo<Character Charr, String UserName> in D:\Documents and Settings\Jordyn\Desktop\LOTF Source\Source\CoServerProject\Databae.cs:Line 1301

It seems to work though, I can get VIP Level to 3 and all but IDK if I benefits from it. Can someone help me with that error AND tell me some of the benefits VIP gives you so I can check? =D Thanks
//Edit: Um..When I log an account in it's ok at first but if I log out and log back in the char is invisible and cant move or do anything...Ever since I added the code. Any ideas?
08/10/2009 21:42 danielachraf#40
can you read the error that you wrote ?! (Ctrl+G) and write the line and look arround and try to fix your problems .. If you want to learn C# try to fix the errors by yourself
08/10/2009 22:06 Krissta:#41
Quote:
Originally Posted by danielachraf View Post
can you read the error that you wrote ?! (Ctrl+G) and write the line and look around and try to fix your problems .. If you want to learn C# try to fix the errors by yourself
I'm sick of you and your shit. STFU and stop posting useless shit in peoples threads. You don't think he read his own error before writing it out? Use your fat head next time dumb ass.
08/11/2009 01:40 raidenx123#42
Quote:
Posts: 3
3 posts and already sick of him o.o
08/11/2009 01:46 InfamousNoone#43
Quote:
Originally Posted by Krissta: View Post
I'm sick of you and your shit. STFU and stop posting useless shit in peoples threads. You don't think he read his own error before writing it out? Use your fat head next time dumb ass.
I'm sick and tired of dumbasses and their shit. STFU and stop posting (all together). No I don't think he read his error because it is exactly what it's called, but it expects you to know programmatical terms. Oh what? You don't know what a cast is? Maybe you should learn some programming before trying to run a server. Just a thought.

InvalidCastException, Invalid Cast Exception. What's wrong? An invalid cast took place. What's an invalid cast? Here's an example, you figure it out.
Code:
int integer = 22;
object obj = integer;
string str = (string)obj; // invalidcastexception
08/11/2009 12:06 killermickle#44
Its a nice idea, My VIP is simply status 2 xD.
08/11/2009 13:29 Andrew.A#45
I use CoEmuV2 but nice release