Hey guys. Litteraly bored,so I decided to code like points,this is how it work:
What point does:
You can trade them for items,such as:
DB
Met
Experience
VPS
Blessing
some more...
You can also sell them to an NPC.
How to get them:
PKing others
Be in the winning guild of GW
Participing in Lottery
How to loose:
Getting PKed by another player.
Lets start!
Search for :
public void SaveHB()
Above it ,add:
Code:
public void SavePoints()
{
LastSave = DateTime.Now;
if (MyClient.There)
if (MyClient.Online)
{
DataBase.SaveChar(this);
DataBase.SavePoints(this);
}
}
Search for:
public static void Ban
above it , add:
Code:
public static void SavePoints(Character Charr)
{
MySqlCommand Command = null;
Command = new MySqlCommand("UPDATE `Characters` SET `Points` = '" + Charr.Points + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
Command.ExecuteNonQuery();
}
Search for
if (CurrentNPC == 9812)
Until you get to the CODE for it,above it add:
Code:
if (CurrentNPC == 3900)
{
if (Control == 1)
{
SendPacket(General.MyPackets.NPCSay("Which to buy points? This is what I give for your items."));
SendPacket(General.MyPackets.NPCLink("50 points for one million silvers.", 3));
SendPacket(General.MyPackets.NPCLink("50 points for 140 CPs.", 4));
SendPacket(General.MyPackets.NPCLink("10 points for 5000 VPs", 5));
SendPacket(General.MyPackets.NPCLink("15 points for an Meteor", 6));
SendPacket(General.MyPackets.NPCLink("35 points for an DragonBall", 7));
SendPacket(General.MyPackets.NPCLink("Nothing,thanks.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
if (Control == 2)
{
SendPacket(General.MyPackets.NPCSay("Which to sell points? This is what I give for your points."));
SendPacket(General.MyPackets.NPCLink("10000 VPs for 100 points", 8));
SendPacket(General.MyPackets.NPCLink("EXP. worth of 10 ExpBalls for 300 points.", 9));
SendPacket(General.MyPackets.NPCLink("DragonBall for 75 points", 10));
SendPacket(General.MyPackets.NPCLink("3-days-blessing for 750 points", 11));
SendPacket(General.MyPackets.NPCLink("Random amout of silvers for 500 points", 12));
SendPacket(General.MyPackets.NPCLink("Nothing,thanks.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
if (Control == 3)
{
if (MyChar.Silvers >= 1000000)
{
MyChar.Points += 50;
MyChar.Silvers -= 1000000;
SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
if (Control == 4)
{
if (MyChar.CPs >= 140)
{
MyChar.Points += 50;
MyChar.CPs -= 140;
SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
if (Control == 5)
{
if (MyChar.VP >= 5000)
{
MyChar.Points += 10;
MyChar.VP -= 5000;
MyChar.MyClient.SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
if (Control == 6)
{
if (MyChar.InventoryContains(1088001, 1))
{
MyChar.Points += 15;
MyChar.RemoveItem(1088001);
}
}
if (Control == 7)
{
if (MyChar.InventoryContains(1088000, 1))
{
MyChar.Points += 35;
MyChar.RemoveItem(1088000);
}
}
if (Control == 8)
{
if (MyChar.Points >= 100)
{
MyChar.VP += 10000 ;
MyChar.Points -= 100;
MyChar.MyClient.SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
if (Control == 9)
{
if (MyChar.Points >= 900)
{
if (MyChar.Level < 100)
MyChar.AddExp((ulong)(12950000 + MyChar.Level * 400000), false);
else if (MyChar.Level < 110)
MyChar.AddExp((ulong)(13950000 + MyChar.Level * 700000), false);
else if (MyChar.Level < 115)
MyChar.AddExp((ulong)(15950000 + MyChar.Level * 900000), false);
else if (MyChar.Level < 120)
MyChar.AddExp((ulong)(18950000 + MyChar.Level * 1100000), false);
else if (MyChar.Level < 125)
MyChar.AddExp((ulong)(20950000 + MyChar.Level * 1400000), false);
else if (MyChar.Level < 130)
MyChar.AddExp((ulong)(23950000 + MyChar.Level * 1700000), false);
else if (MyChar.Level < 135)
MyChar.AddExp((ulong)(28950000 + MyChar.Level * 1900000), false);
MyChar.Points -= 900;
SendPacket(General.MyPackets.Vital((long)MyChar.UID, 5, MyChar.Exp));
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
if (Control == 10)
{
if (MyChar.Points >= 75)
{
MyChar.AddItem("1088000-0-0-0-0-0", 0, (uint)General.Rand.Next(36457836));
MyChar.Points -= 75;
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
if (Control == 11)
{
if (MyChar.Points >= 750)
{
if (!MyChar.Blessed)
{
MyChar.HBStart = DateTime.Now;
MyChar.HBEnd = DateTime.Now.AddDays(3);
MyChar.WhichBless = 1;
MyChar.Blessed = true;
MyChar.MyClient.SendPacket(General.MyPackets.Vital(MyChar.UID, 18, (3 * 24 * 60 * 60)));
MyChar.MyClient.SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
World.UpdateSpawn(MyChar);
MyChar.SaveHB();
MyChar.MyClient.SendPacket(General.MyPackets.String(MyChar.UID, 10, "zf2-e128"));
MyChar.Points -= 750;
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
else
{
MyChar.MyClient.SendPacket(General.MyPackets.SendMsg(MyChar.MyClient.MessageId, "SYSTEM", MyChar.Name, "You already have Heavens Blessing!", 2005));
}
}
}
if (Control == 12)
{
if (MyChar.Points >= 500)
{
int AddSilv = General.Rand.Next(10000000, 20000000);
MyChar.Silvers += (uint)AddSilv;
MyChar.Points -= 500;
SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
MyChar.SavePoints();
}
Search for : if (CurrentNPC == 390)
Above it ,add:
Code:
if (CurrentNPC == 3900)//PointNPC1
{
SendPacket(General.MyPackets.NPCSay("Hello,I am the points NPC. I can give you points for your items, or vice versa"));
SendPacket(General.MyPackets.NPCSay("Your current points is : " + MyChar.Points));
SendPacket(General.MyPackets.NPCSay("Look at my options,intresed in any?"));
SendPacket(General.MyPackets.NPCLink("I'd like to buy points", 1));
SendPacket(General.MyPackets.NPCLink("I'd like to sell points", 2));
SendPacket(General.MyPackets.NPCLink("Nevermind", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
Search for :
User.BlueName = true;
you will find two, under both,add this:
Code:
User.Points += 25;
Player.Points -= 25;
User.MyClient.SendPacket(General.MyPackets.SendMsg(User.MyClient.MessageId, "SYSTEM", User.Name, "You took 25 points from your target!", 2005));
User.MyClient.SendPacket(General.MyPackets.SendMsg(Player.MyClient.MessageId, "SYSTEM", Player.Name, "You lost 25 points by dying!", 2005));
Search for : else if (ItemParts[0] == "723700"
Under it , add:
Code:
else if (ItemParts[0] == "780001")//PointCardS
{
Points += 40;
MyClient.SendPacket(General.MyPackets.SendMsg(MyClient.MessageId, "SYSTEM", Name, "You gained 40 Points! You now have " + Points + " Points.", 2005));
RemoveItem(ItemUID);
}
else if (ItemParts[0] == "780000")//PointCard
{
Points += 120;
MyClient.SendPacket(General.MyPackets.SendMsg(MyClient.MessageId, "SYSTEM", Name, "You gained 120 Points! You now have " + Points + " Points.", 2005));
RemoveItem(ItemUID);
}
In Character.cs , add:
Code:
public uint Points = 0;
OH MY GOD,GOTTA SLEEP,IM DYING. Now add an npc with id 3900 somewhere and add a new Points for it in character table in database.
Never tested the code,ever never,so you test it.. GOODNIGHT!!
I fooled around with a private server some time ago, and made a similar system, although you didn't get "Points" for PKing, you gained CPs. Monsters didn't drop Meteors and DragonBalls, and they didn't give XP, they only dropped items.
You could make a very cool PvP based server with similar systems.
Nice thinking, Emme.
Emme you make a good work , but your points don't save..
You have to add points to your database class where it reads char info when char is loading.
It should save the info fine if ya added it right but there is no code to retrieve it when each character logs in you need to go to your database class
and find where it loads all character info and add points to it then it will load them everytime.
This also needs to be done with emme's heavensblessing to work right otherwise it will save the info but not load what was saved when u log off and back on.
Or better yet better way is to have server read ALL your char info when logging in with simpler variables then standard lotf has but i won't go into that now.
[Release] Custom Quest 09/11/2010 - CO2 PServer Guides & Releases - 11 Replies Hello.
This is a cool little quest I made.
Credits go to me and -Shunsui-.
I hope you like it!
Add these codes to NPCDialog.cs:
#region Ghost
case 67435:
{
if (Control == 0)
[Release] Another Custom Quest 04/23/2010 - CO2 PServer Guides & Releases - 6 Replies Hello
I made this quest all by myself
It is pretty good I guess
Add these to NPCDialog.cs:
#region Shirly Quest
case 778867:
{
if (Control == 0)
{
idea, vote points 05/23/2009 - RF Online - 0 Replies hiya all:bandit:
u all know it... ure voting for ur private server to get some game points... but i want more... always wait 12 hours after 1 vote?! thats shitty... i was trying to bypass this waiting time with some proxys... but fail... some1 have any idea?
peace out:bandit:
[RELEASE] Custom Monsters 11/14/2008 - EO PServer Guides & Releases - 5 Replies Hi, I Edited how most of the monsters look In-game Some look realy cool ^^ everything works fine for me.. so i dont think there are any bugs xD i hope at least Someone likes it. Lol i cant upload any Pictures because my net is slow as Hell! If someone can upload an image of some of the monsters i'll give em a Thanks lol xD I'm Murtah by the way. Oh, This is for server owners.. just add the Three cq_monstertype's into ya My Folder and the monsterface into your Ini Folder of your client :P you...
And Idea For Pking Without Gaining Pk Points 08/22/2007 - Conquer Online 2 - 7 Replies Ok, this is just an idea, maybe you could edit the file that controles monsters, so it makes you seem as a monster, then you can kill someone as a "monster" therefore gaining no pk points, this is just an idea.