[Release] A Start For VIP

07/14/2009 18:05 f0am#1
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
07/14/2009 18:13 MeYuly14#2
good job
07/14/2009 18:13 danielachraf#3
Yes , i did that yesterday but i did another things different ... Pay in the site ... etc anyway it is easy
07/14/2009 18:17 f0am#4
Quote:
Originally Posted by danielachraf View Post
Yes , i did that yesterday but i did another things different ... Pay in the site ... etc anyway it is easy

Ha i beat you i did this 2 days ago for Temple...anyway this is for non donation servers
07/14/2009 18:19 AmbiguousStatement#5
I think VIP should just be VIP. Paying for it is gay. You gotta be a VERY FAWKIN IMPORTANT FAWKIN PERSON

Anyways nice release.
07/14/2009 18:21 Xanrry#6
Good Job!
07/14/2009 18:50 f0am#7
Thx! Next release will either be 1st and 2nd rb ( my way ) or iTBoT
07/14/2009 21:15 Arcotemple:)#8
Quote:
Originally Posted by f0am View Post
Ha i beat you i did this 2 days ago for Temple...anyway this is for non donation servers
thanks for giving me the code but i thought youwerent gonna give it out :(
i was supposed to be the only one with it :(
07/14/2009 22:26 damianpesta#9
Quote:
Originally Posted by Arcotemple:) View Post
thanks for giving me the code but i thought youwerent gonna give it out :(
i was supposed to be the only one with it :(
LOL , I could make it in less than 7 minutes.Just so you wouldnt be the only 1 ROFL .Yeah I am mean.
07/15/2009 01:34 f0am#10
Quote:
Originally Posted by damianpesta View Post
LOL , I could make it in less than 7 minutes.Just so you wouldnt be the only 1 ROFL .Yeah I am mean.
BS


( Big Shoes )


YEAH, BUT IM SUPER CREATIVE WITH MY CREATIVE MIND I HAVE CREATIVE IDEAS FOR THE CREATIVITY OF MY CREATIVE VIP MEMBERS.

If your counting how much i used Creative its 6.
07/15/2009 02:47 bazoka2020#11
i did all but i want to know how to add Control for npc
thats all help plz
07/15/2009 13:17 f0am#12
Quote:
Originally Posted by bazoka2020 View Post
i did all but i want to know how to add Control for npc
thats all help plz
Ok for adding dialog look for

Code:
If (CurrentNPC == 7500)
make sure its the dialog part so it will have the word like got many dragonballs? then place it above that npc

then search for it again and it should have like if (Control == 1) and place it above that npc.
07/15/2009 13:29 Yooha#13
what the VIP do?
07/15/2009 14:12 f0am#14
Quote:
Originally Posted by Yooha View Post
what the VIP do?
This was just a start, The rest is up to you now if you added this you can do MyChar.VIP
07/15/2009 18:18 raidenx123#15
Something to add:
In Character.cs search
Code:
Stamina < 100
And replace (Action == 250) with:
Code:
if (Action == 250)
                if (MyChar.VIP)
                {
                    if (Stamina < 130)
                        Stamina += 15;
                    if (Stamina > 130)
                        Stamina = 130;
                }
                else
                {
                    if (Stamina < 100)
                    {
                        Stamina += 8;
                        if (Stamina > 100)
                            Stamina = 100;
                        MyClient.SendPacket(General.MyPackets.Vital(UID, 9, Stamina));
                    }
And one error should pop-up about putting "}" put click the error and just put it there.

Now search
Code:
 Stamina = 100
And replace the whole code with:
Code:
if (revp[0] == LocMap)
                    {
                        if (MyChar.VIP)
                        {
                            Stamina = 130;
                            Teleport(revp[1], revp[2], revp[3]);
                            break;
                        }
                        else
                        {
                        Stamina = 100;
                        Teleport(revp[1], revp[2], revp[3]);
                        break;
                    }
                }
            }
And once again an error should occur about "}" and click the error, and add the "}" And now you see my point just keep searching
Code:
 Stamina = 100;
and do as I did my adding
Code:
 if (MyChar.VIP)
{
And changing the Stamina amount to 130 instead of 100 and then do
Code:
}
else
{
And do if they arent VIP