Register for your free account! | Forgot your password?

Go Back   elitepvpers > Conquer Online 2 > CO2 Main - Discussions / Questions
You last visited: Today at 05:45

  • Please register to post and access all features, it's quick, easy and FREE!


Making gold can donate only royalty from my server?

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2013
Posts: 1
Received Thanks: 0
Exclamation Making gold can donate only royalty from my server?

Making gold can donate only royalty from my server?

Here I show my Nobility.cs ....

-------------------------------------

using System;
using System.Linq;
using System.Collections.Generic;
using Conquer_Online_Server.Network.GamePackets;
using System.IO;
using Conquer_Online_Server.Client;
using Conquer_Online_Server.Database;
using System.Text;
using Conquer_Online_Server.Network;

namespace Conquer_Online_Server.Game.ConquerStructures
{
public class Nobility
{
public static SafeDictionary<uint, NobilityInformation> Board = new SafeDictionary<uint, NobilityInformation>(0x2710);
public static List<NobilityInformation> BoardList = new List<NobilityInformation>(0x2710);

public static void Handle(NobilityInfo information, GameState client)
{

{
uint dwParam;
bool flag;
byte num3;
MemoryStream stream;
BinaryWriter writer;
int num4;
switch (information.Type)
{
case 1:
{
dwParam = information.dwParam;
if (information.dwParam2 != 2)
{
break;
}
uint num2 = dwParam / 3000;
if (client.Entity.ConquerPoints >= num2)
{
client.Entity.ConquerPoints = Math.Max(0, client.Entity.ConquerPoints - (num2));
client.NobilityInformation.Donation += dwParam;
}
goto Label_00AF;
}
case 2:
flag = false;
num3 = 0;
stream = new MemoryStream();
writer = new BinaryWriter(stream);
writer.Write((ushort)0);
writer.Write((ushort)0x810);
writer.Write((uint)2);
writer.Write(information.wParam1);
writer.Write((ushort)5);
writer.Write((uint)0);
writer.Write((uint)0);
writer.Write((uint)0);
num4 = information.wParam1 * 10;
goto Label_02C2;

default:
return;
}
uint num6 = dwParam / 3000;
if (client.Entity.ConquerPoints >= num6)
{
client.Entity.ConquerPoints = Math.Max(0, client.Entity.ConquerPoints - (num6));
client.NobilityInformation.Donation += dwParam;
}
else if (client.Entity.Money >= dwParam)
{
client.Entity.Money -= dwParam;
client.NobilityInformation.Donation += dwParam;
}
Label_00AF:
if (!Board.ContainsKey(client.Entity.UID) && (client.NobilityInformation.Donation == dwParam))
{
Board.Add(client.Entity.UID, client.NobilityInformation);
NobilityTable.InsertNobilityInformation(client.Nob ilityInformation);
}
else
{
NobilityTable.UpdateNobilityInformation(client.Nob ilityInformation);
}
Sort(client.Entity.UID);
return;
Label_018B:
if (BoardList.Count > num4)
{
num3 = (byte)(num3 + 1);
writer.Write(BoardList[num4].EntityUID);
writer.Write((uint)BoardList[num4].Gender);
writer.Write(BoardList[num4].Mesh);
for (int i = 0; i < 20; i++)
{
if (BoardList[num4].Name.Length > i)
{
writer.Write((byte)BoardList[num4].Name[i]);
}
else
{
writer.Write((byte)0);
}
}
writer.Write(BoardList[num4].Donation);
writer.Write((uint)BoardList[num4].Rank);
writer.Write((uint)BoardList[num4].Position);
if ((((num4 == 1) && !flag) || ((num4 == 11) && !flag)) || ((((num4 == 0x15) && !flag) || ((num4 == 0x1f) && !flag)) || ((num4 == 0x29) && !flag)))
{
num4 -= 2;
num3 = 0;
flag = true;
}
}
num4++;
Label_02C2:
if (num4 < ((information.wParam1 * 10) + 10))
{
goto Label_018B;
}
flag = false;
int length = (int)stream.Length;
stream.Position = 0L;
writer.Write((ushort)length);
stream.Position = stream.Length;
writer.Write(Encoding.ASCII.GetBytes("TQServer"));
stream.Position = 0L;
byte[] buffer = new byte[stream.Length];
stream.Read(buffer, 0, buffer.Length);
Writer.WriteUInt32(num3, 12, buffer);
client.Send(buffer);
information.Type = 4;
ulong arg = 0L;
information.dwParam2 = 0;
if (client.NobilityInformation.Rank == NobilityRank.Prince)
{
arg = (BoardList[2].Donation - client.NobilityInformation.Donation) + ((ulong)1L);
}
if (client.NobilityInformation.Rank == NobilityRank.Duke)
{
arg = (BoardList[14].Donation - client.NobilityInformation.Donation) + ((ulong)1L);
}
if (client.NobilityInformation.Rank == NobilityRank.Earl)
{
arg = (BoardList[0x31].Donation - client.NobilityInformation.Donation) + ((ulong)1L);
}
Writer.WriteUInt64(arg, 8, information.ToArray());
information.dwParam3 = 60;
information.dwParam4 = uint.MaxValue;
client.Send(information);
writer.Close();
stream.Close();
}

}

public static void Sort(uint updateUID)
{

{
SortedDictionary<ulong, SortEntry<uint, NobilityInformation>> source = new SortedDictionary<ulong, SortEntry<uint, NobilityInformation>>();
foreach (NobilityInformation information in Board.Values)
{
if (source.ContainsKey(information.Donation))
{
SortEntry<uint, NobilityInformation> entry = source[information.Donation];
entry.Values.Add(information.EntityUID, information);
}
else
{
SortEntry<uint, NobilityInformation> entry2 = new SortEntry<uint, NobilityInformation>
{
Values = new Dictionary<uint, NobilityInformation>()
};
entry2.Values.Add(information.EntityUID, information);
source.Add(information.Donation, entry2);
}
}
SafeDictionary<uint, NobilityInformation> dictionary2 = new SafeDictionary<uint, NobilityInformation>(0x2710);
int num = 0;
foreach (KeyValuePair<ulong, SortEntry<uint, NobilityInformation>> pair in source.Reverse<KeyValuePair<ulong, SortEntry<uint, NobilityInformation>>>())
{
foreach (KeyValuePair<uint, NobilityInformation> pair2 in pair.Value.Values)
{
GameState state = null;
int position = pair2.Value.Position;
pair2.Value.Position = num;
NobilityRank serf = NobilityRank.Serf;
if (num >= 60)
{
if (pair2.Value.Donation >= 0xbebc200L)
{
serf = NobilityRank.Earl;
}
else if (pair2.Value.Donation >= 0x5f5e100L)
{
serf = NobilityRank.Baron;
}
else if (pair2.Value.Donation >= 0x1c9c380L)
{
serf = NobilityRank.Knight;
}
}
else if (num < 5)
{
serf = NobilityRank.King;
}
else if (num < 20)
{
serf = NobilityRank.Prince;
}
else
{
serf = NobilityRank.Duke;
}
NobilityRank rank = pair2.Value.Rank;
pair2.Value.Rank = serf;
if (Conquer_Online_Server.ServerBase.Kernel.GamePool. TryGetValue(pair2.Key, out state))
{
bool flag = false;
if (rank != serf)
{
flag = true;
}
else if (position != num)
{
flag = true;
}
if (flag || (state.Entity.UID == updateUID))
{
NobilityInfo buffer = new NobilityInfo
{
Type = 3,
dwParam = pair2.Key
};
buffer.UpdateString(pair2.Value);
state.SendScreen(buffer, true);
state.Entity.NobilityRank = pair2.Value.Rank;
}
}
dictionary2.Add(pair2.Key, pair2.Value);
num++;
}
}
Board = dictionary2;
BoardList = Board.Values.ToList<NobilityInformation>();
}

}
}
public class NobilityInformation
{
public string Name;
public uint EntityUID;
public uint Mesh;
public ulong Donation;
public byte Gender;
public int Position;
public NobilityRank Rank;
}

public enum NobilityRank : byte
{
Serf = 0,
Knight = 1,
Baron = 3,
Earl = 5,
Duke = 7,
Prince = 9,
King = 12
}
}



DarkBlaDe27 is offline  
Old 03/18/2013, 03:43   #2
 
elite*gold: 0
Join Date: Apr 2011
Posts: 30
Received Thanks: 3
It is really not tough you know ?
I don't know a thing about coding , I am just using common sense here.

"client.Entity.ConquerPoints = Math.Max(0, client.Entity.ConquerPoints - (num2));"
"client.NobilityInformation.Donation += dwParam;"

These two lines are for the Donation for CPs , Silver is already there...
Now you can either delete these lines or do something else with them its up to you.

OR If you are still clueless what to do.

Just replace this line
client.Entity.ConquerPoints = Math.Max(0, client.Entity.ConquerPoints - (num2));
WITH THIS
client.Entity.Money = Math.Max(0, client.Entity.ConquerPoints - (num2));


karuka is offline  
Reply



« Problems with Vip 6 Banks! (IMAGE HERE!) | miss ya packetbusters »

Similar Threads
S> 1200 DBs Royalty server
12/11/2011 - Conquer Online 2 Trading - 1 Replies
Royalty_EU is a classic co server with no shopping mall. All items such as stones +n, gourd, 2rb token and other can be only won from lottery and bought from other players who won it. So im selling 1200 DBs there (around 1200, well i got a bit less than 258 000 CPs) Selling everything for cheap or 2$ per db. Accepting ONLY epvp gold, webmoney, liberty reserve and western union.
B/T> Account or dbs on Royalty server
09/09/2011 - Conquer Online 2 Trading - 2 Replies
Hello all i have just sold out on my old server and would like to trade my dbs on other server for good account with items or just items on royalty server. Any1 interested? I have around 600-650 dbs on Pishu_EU for items on Royalty, let me know...
Classic Co royalty War/tro set for rs gold
02/18/2011 - Conquer Online 2 Trading - 0 Replies
Selling a full 2 socket 1/3/5- warrior set, and a pro tro armor and a club both 7- Basically, neck/ring/boots are 5- 2 sock. ring is perm phase 3. And i have 2 weapons one half to 7+ a sword 5- perm phase 5 hammer, and the same 6+ blade. And a club 7+ 7- super perm phase 6 hammer. Hum. oh yeah.. I also have a farming set which enables you to farm 120-110s in 1 hour. Okai. i'm looking for runescape gold only.. And my gears are worth alot, so have that in mind. Mm ok.. can be contacted on...
T> DBs on Dark for DB codes or DBs on Royalty server
05/13/2010 - Conquer Online 2 Trading - 0 Replies
Alright so here's the deal. I have a couple of DBs on Dark server that I need to get rid of. I'll be willing to pay you 7 DBs on Dark for every 5 DB you get me on Royalty, doesn't matter if you trade me the DBs on Royalty or get me the DBs in DB codes. So yeah, S> 7 DBs on Dark for 5 DBs on Royalty. PM me if you're interested in trading.



All times are GMT +1. The time now is 05:45.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.