[Release] VIP Level (CoEmu v2)

12/06/2009 20:03 12tails#1
hi hi!!

i was doing it... very easy but let's release it : D

first add this at Character.cs:
Code:
public byte VipLevel = 0;
then go into Sctrucs, and open StatusType.cs and add this:
Code:
VIPLevel = 39,
now create a new class named VipLevel.cs:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoEmu_v2_GameServer.Entities;
using CoEmu_v2_GameServer.Connections;
using CoEmu_v2_GameServer.Structs;
using CoEmu_v2_GameServer.Packets;
using System.Timers;

namespace CoEmu_v2_GameServer.Handlers
{
    public partial class Handler
    {
        public static byte VipLevel2(byte viplevel, ClientSocket CSocket)
        {
            try
            {
                CSocket.Send(ConquerPacket.Status(CSocket.Client.ID, 2, viplevel, Struct.StatusTypes.VIPLevel));
            }
            catch { }
            return viplevel;
        }
    }
}
now go into packet processor and find case 1052: (login packet)
and find this:
Code:
CSocket.Send(ConquerPacket.CharacterInfo(CSocket));
after it add:
Code:
Handler.VipLevel2(CSocket.Client.VipLevel, CSocket);
and now for the vip warehouse add this at NpcTalk.cs:
Code:
   #region VIP Warehouse
                case 12:
                    {
                        if (LinkBack == 0 || LinkBack == 1)
                        {
                            CSocket.Send(ConquerPacket.General(CSocket.Client.ID, 341, 0, 0, 0, 0, (Struct.DataType)0x7e));
                        }
                        break;
                    }
                #endregion
// EDIT FORGOT ONE THING :X
add this at GetCharacter:
Code:
Client.VipLevel = Convert.ToByte(DR["VIP"]);
and make a new field for VIP:
Code:
Field: VIP
Lenght: 2
Type: int
Default: 0
//

this will save your VIP Level... so just add it on Database.cs
Code:
        public static void UpdateVIP(ClientSocket CSocket)
        {
            lock (DatabaseConnection.Connection)
            {
                MySqlCommand Cmd = new MySqlCommand("UPDATE `characters` SET `VIP` = " + CSocket.Client.VipLevel + " WHERE `CharID` = " + CSocket.Client.ID + "", DatabaseConnection.Connection);

                Cmd.ExecuteNonQuery();
            }
        }
now i've maked a simple npc to just upgrade your vip level....
Code:
#region VIP-Upgrader
                case 20345:
                    {
                        if (LinkBack == 0)
                        {
                            Text("Hello, I can upgrade your vip for 5000 cps. Do you want?", CSocket);
                            Link("Yes.", 1, CSocket);
                            Link("No thanks.", 255, CSocket);
                            Face(30, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            if (CSocket.Client.CPs >= 5000)
                            {
                                CSocket.Client.VipLevel++;
                                Database.Database.UpdateVIP(CSocket);
                                CSocket.Send(ConquerPacket.Status(CSocket.Client.ID, 2, CSocket.Client.VipLevel, Struct.StatusTypes.VIPLevel));
                                Text("Congratulations! Your vip has been upgraded!", CSocket);
                                Link("Thanks.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                            else { ErrorMsg("Sorry, you don't have 5000 cps!", CSocket); }
                        }
                        break;
                    }
                #endregion
//For the remote composition you've to add the Composition stove first....
//And for Remote Repair u must have the repair system... and then u can add this at packet processor in case 1009(Item/Ping Packet):

Code:
case 15:
//Send the repair here...
break;
if u got any problem please post it here... (and don't flame!)
12/06/2009 20:27 Basser#2
Well, you should have told them this is not complete, far from complete tbh.
However, thanks for contributing!
12/06/2009 20:42 12tails#3
//Edit
nothing is missing... only the features to be added like compose and item repair : D
12/06/2009 20:48 ~*NewDuuDe*~#4
I've noticed that in all of Tanel's sources GMs have remote WH (by pressing enter), so you should look into a LOTF source or something.
12/06/2009 20:53 Hitsugaya Toshiro#5
Nice release
12/06/2009 22:24 damianpesta#6
Quote:
Originally Posted by BERGHUIS1 View Post
I've noticed that in all of Tanel's sources GMs have remote WH (by pressing enter), so you should look into a LOTF source or something.
Isn't that a client?lol cause I guess its just a client edit.
12/07/2009 02:18 shadow8994#7
Sorry for double post it was by accident :p
12/07/2009 02:18 shadow8994#8
I don't get where to add this piece of code :P


Quote:
Client.VipLevel = Convert.ToByte(DR["VIP"]);
12/07/2009 02:29 Hitsugaya Toshiro#9
Quote:
Originally Posted by shadow8994 View Post
I don't get where to add this piece of code :P
Dont double post edit the old one
12/07/2009 20:14 Basser#10
Quote:
Originally Posted by shadow8994 View Post
I don't get where to add this piece of code :P
Where it loads characters, I guess.


Quote:
Originally Posted by 12tails View Post
//Edit
nothing is missing... only the features to be added like compose and item repair : D
Ehm, becoming VIP, a progress which will change your vip status, saving your new VIP statu, the features (as you said), and some other things.
12/07/2009 20:28 ImmuneOne#11
As bas said, this is far from completed.
I'm missing calculations for the vip levels, coded functions and extra things that are added for a vip.

I'll be happy to work a completed vip system out and release it in a while. I'll be all doing it on sunday if someone had some more requests please say it through a priviate message.
12/07/2009 20:31 Basser#12
Quote:
Originally Posted by ImmuneOne View Post
As bas said, this is far from completed.
I'm missing calculations for the vip levels, coded functions and extra things that are added for a vip.

I'll be happy to work a completed vip system out and release it in a while. I'll be all doing it on sunday if someone had some more requests please say it through a priviate message.
W00t.
I got Immune's support on this one =)
12/08/2009 00:43 Hitsugaya Toshiro#13
When its fully functional i will love that rofl
12/08/2009 09:39 12tails#14
ehhh sorry i wasn't at home : P

added some things to the first post : D
10/03/2010 22:49 Donyboi#15
Quote:
Originally Posted by 12tails View Post
hi hi!!

i was doing it... very easy but let's release it : D

first add this at Character.cs:
Code:
public byte VipLevel = 0;
then go into Sctrucs, and open StatusType.cs and add this:
Code:
VIPLevel = 39,
now create a new class named VipLevel.cs:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoEmu_v2_GameServer.Entities;
using CoEmu_v2_GameServer.Connections;
using CoEmu_v2_GameServer.Structs;
using CoEmu_v2_GameServer.Packets;
using System.Timers;

namespace CoEmu_v2_GameServer.Handlers
{
    public partial class Handler
    {
        public static byte VipLevel2(byte viplevel, ClientSocket CSocket)
        {
            try
            {
                CSocket.Send(ConquerPacket.Status(CSocket.Client.ID, 2, viplevel, Struct.StatusTypes.VIPLevel));
            }
            catch { }
            return viplevel;
        }
    }
}
now go into packet processor and find case 1052: (login packet)
and find this:
Code:
CSocket.Send(ConquerPacket.CharacterInfo(CSocket));
after it add:
Code:
Handler.VipLevel2(CSocket.Client.VipLevel, CSocket);
and now for the vip warehouse add this at NpcTalk.cs:
Code:
   #region VIP Warehouse
                case 12:
                    {
                        if (LinkBack == 0 || LinkBack == 1)
                        {
                            CSocket.Send(ConquerPacket.General(CSocket.Client.ID, 341, 0, 0, 0, 0, (Struct.DataType)0x7e));
                        }
                        break;
                    }
                #endregion
// EDIT FORGOT ONE THING :X
add this at GetCharacter:
Code:
Client.VipLevel = Convert.ToByte(DR["VIP"]);
and make a new field for VIP:
Code:
Field: VIP
Lenght: 2
Type: int
Default: 0
//

this will save your VIP Level... so just add it on Database.cs
Code:
        public static void UpdateVIP(ClientSocket CSocket)
        {
            lock (DatabaseConnection.Connection)
            {
                MySqlCommand Cmd = new MySqlCommand("UPDATE `characters` SET `VIP` = " + CSocket.Client.VipLevel + " WHERE `CharID` = " + CSocket.Client.ID + "", DatabaseConnection.Connection);

                Cmd.ExecuteNonQuery();
            }
        }
now i've maked a simple npc to just upgrade your vip level....
Code:
#region VIP-Upgrader
                case 20345:
                    {
                        if (LinkBack == 0)
                        {
                            Text("Hello, I can upgrade your vip for 5000 cps. Do you want?", CSocket);
                            Link("Yes.", 1, CSocket);
                            Link("No thanks.", 255, CSocket);
                            Face(30, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            if (CSocket.Client.CPs >= 5000)
                            {
                                CSocket.Client.VipLevel++;
                                Database.Database.UpdateVIP(CSocket);
                                CSocket.Send(ConquerPacket.Status(CSocket.Client.ID, 2, CSocket.Client.VipLevel, Struct.StatusTypes.VIPLevel));
                                Text("Congratulations! Your vip has been upgraded!", CSocket);
                                Link("Thanks.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                            else { ErrorMsg("Sorry, you don't have 5000 cps!", CSocket); }
                        }
                        break;
                    }
                #endregion
//For the remote composition you've to add the Composition stove first....
//And for Remote Repair u must have the repair system... and then u can add this at packet processor in case 1009(Item/Ping Packet):

Code:
case 15:
//Send the repair here...
break;
if u got any problem please post it here... (and don't flame!)
hi guys could some of this code be used to make a char on creation vip level 6 without having the Npc for it iam trying to make it so when the char gets created it automaticly gets vip 6 rather than have the client click the npc to get the VipLevel :confused: any pointers please :p