[HELP] Nobility Rank

06/15/2009 19:39 Mr_BanG#1
Hey!

This is Mr_BanG,

I would need some help on my PServer, there is a problem. Onto my client. A normal one. Not CoEmu V2 or any other type of servers. I need help on adding the nobility rank. If you don't know what it is, here you have a screnshot.

P.S : Its spanish so don't wonder why it's a random update on the normal CO.
(This is the reall CO. For there, the Spanish CO.):


[Only registered and activated users can see links. Click Here To Register...]


So, if there is any clue about how to install or update or add the nobility rank.
I know you have to edit the binary codes. Like: Client or Server .cs.
The type of server I have is a CoV2 source file.

So, any help will be good for my server, and for you the thanks button.



Mr_BanG

P.S : Mr_PoP there is no intention of me copying my user name from your idea. I noticed your user existed 1 day ago.



Thank You.

Mr_BanG
06/15/2009 19:41 _tao4229#2
Uhhh what?
06/15/2009 20:05 Kiyono#3
Quote:
Originally Posted by _tao4229 View Post
Uhhh what?
He wants someone to code Nobility.
06/15/2009 20:12 danielachraf#4
you can't add the nobility like real co on 5017 .. (The nobility window)
06/15/2009 21:44 Vortex.#5
Quote:
Originally Posted by danielachraf View Post
you can't add the nobility like real co on 5017 .. (The nobility window)
Your retarded, yes you can.
06/15/2009 22:03 Mr_BanG#6
Quote:
Originally Posted by danielachraf View Post
you can't add the nobility like real co on 5017 .. (The nobility window)

So is there like another type of client that I could use? I mean the newst one?
So I can upload the nobility?
06/15/2009 22:08 Mr_BanG#7
Quote:
Originally Posted by Vortex. View Post
Your retarded, yes you can.

How? Is there a tutorial? For a normal Client, a CoV2 - 5017 Client?
06/17/2009 18:38 BasicCoder#8
If there was a Tutorial of this EVERYONE would have it on their server..
07/31/2009 10:26 eddy94#9
First: Add this in the definitions of character.cs

Code:
public byte Rank = 0;
public uint Donation = 0;
Second: Add this above your welcome message

Code:
if (MyChar.Rank == 7)
SendPacket(General.MyPackets.String(MyChar.UID, 10, "letter1"));
if (MyChar.Rank == 6)
SendPacket(General.MyPackets.String(MyChar.UID, 10, "letter2"));
if (MyChar.Rank == 5)
SendPacket(General.MyPackets.String(MyChar.UID, 10, "letter3"));
if (MyChar.Rank == 4)
SendPacket(General.MyPackets.String(MyChar.UID, 10, "letter4"));
if (MyChar.Rank == 3)
SendPacket(General.MyPackets.String(MyChar.UID, 10, "letter5"));
if (MyChar.Rank == 2)
{
SendPacket(General.MyPackets.String(MyChar.UID, 10, "coronet3"));
SendPacket(General.MyPackets.String(MyChar.UID, 10, "letter6"));
}
if (MyChar.Rank == 1)
{
SendPacket(General.MyPackets.String(MyChar.UID, 10, "coronet4"));
SendPacket(General.MyPackets.String(MyChar.UID, 10, "letter7"));
}
Third: Search for public static void UpdateSpawn(Character Me)

and replace the WHOLE VOID with

Code:
public static void UpdateSpawn(Character Me)
{
foreach (DictionaryEntry DE in AllChars)
{
Character Charr = (Character)DE.Value;

if (Me.LocMap == Charr.LocMap)
if (MyMath.CanSee(Me.LocX, Me.LocY, Charr.LocX, Charr.LocY))
{
if (Me.MyGuild != null)
Charr.MyClient.SendPacket(General.MyPackets.GuildN ame(Me.GuildID, Me.MyGuild.GuildName));
Charr.MyClient.SendPacket(General.MyPackets.SpawnE ntity(Me));
if (Me.RBCount > 1)
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "2NDMetempsychosis"));
if (Me.MyGuild != null)
Charr.MyClient.SendPacket(General.MyPackets.GuildN ame(Me.GuildID, Me.MyGuild.GuildName));
if (Me.Rank == 7)
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "letter1"));
if (Me.Rank == 6)
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "letter2"));
if (Me.Rank == 5)
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "letter3"));
if (Me.Rank == 4)
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "letter4"));
if (Me.Rank == 3)
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "letter5"));
if (Me.Rank == 2)
{
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "coronet3"));
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "letter6"));
}
if (Me.Rank == 1)
{
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "coronet4"));
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "letter7"));
}
}
}
}
Fourth: Search for public static void SpawnMeToOthers(Character Me, bool Check)

and replace the WHOLE VOID with

Code:
public static void SpawnMeToOthers(Character Me, bool Check)
{
try
{
if (AllChars.Contains(Me.UID))
{
foreach (DictionaryEntry DE in AllChars)
{
Character SpawnTo = (Character)DE.Value;

if (Me != SpawnTo)
if (SpawnTo.MyClient.Online)
if (Me.LocMap == SpawnTo.LocMap)
if (MyMath.CanSee(Me.LocX, Me.LocY, SpawnTo.LocX, SpawnTo.LocY))
if (!MyMath.CanSee(Me.PrevX, Me.PrevY, SpawnTo.LocX, SpawnTo.LocY) || !Check)
{
if (Me.MyGuild != null)
SpawnTo.MyClient.SendPacket(General.MyPackets.Guil dName(Me.GuildID, Me.MyGuild.GuildName));

SpawnTo.MyClient.SendPacket(General.MyPackets.Spaw nEntity(Me));

if (Me.RBCount > 1)
SpawnTo.MyClient.SendPacket(General.MyPackets.Stri ng(Me.UID, 10, "2NDMetempsychosis"));

if (Me.MyGuild != null)
SpawnTo.MyClient.SendPacket(General.MyPackets.Guil dName(Me.GuildID, Me.MyGuild.GuildName));
if (Me.Rank == 7)
SpawnTo.MyClient.SendPacket(General.MyPackets.Stri ng(Me.UID, 10, "letter1"));
if (Me.Rank == 6)
SpawnTo.MyClient.SendPacket(General.MyPackets.Stri ng(Me.UID, 10, "letter2"));
if (Me.Rank == 5)
SpawnTo.MyClient.SendPacket(General.MyPackets.Stri ng(Me.UID, 10, "letter3"));
if (Me.Rank == 4)
SpawnTo.MyClient.SendPacket(General.MyPackets.Stri ng(Me.UID, 10, "letter4"));
if (Me.Rank == 3)
SpawnTo.MyClient.SendPacket(General.MyPackets.Stri ng(Me.UID, 10, "letter5"));
if (Me.Rank == 2)
{
SpawnTo.MyClient.SendPacket(General.MyPackets.Stri ng(Me.UID, 10, "coronet3"));
SpawnTo.MyClient.SendPacket(General.MyPackets.Stri ng(Me.UID, 10, "letter6"));
}
if (Me.Rank == 1)
{
SpawnTo.MyClient.SendPacket(General.MyPackets.Stri ng(Me.UID, 10, "coronet4"));
SpawnTo.MyClient.SendPacket(General.MyPackets.Stri ng(Me.UID, 10, "letter7"));
}
}

}
}
}
catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
}
Fifth: Search for public static void SpawnOthersToMe(Character Me, bool Check)

and replace the WHOLE VOID with

Code:
public static void SpawnOthersToMe(Character Me, bool Check)
{
try
{
if (AllChars.Contains(Me.UID))
{
foreach (DictionaryEntry DE in AllChars)
{
Character SpawnWho = (Character)DE.Value;

if (Me != SpawnWho)
if (SpawnWho.MyClient.Online)
if (Me.LocMap == SpawnWho.LocMap)
if (MyMath.CanSee(Me.LocX, Me.LocY, SpawnWho.LocX, SpawnWho.LocY))
if (!MyMath.CanSee(Me.PrevX, Me.PrevY, SpawnWho.LocX, SpawnWho.LocY) || Check == false)
{
if (SpawnWho.MyGuild != null)
Me.MyClient.SendPacket(General.MyPackets.GuildName (SpawnWho.GuildID, SpawnWho.MyGuild.GuildName));

Me.MyClient.SendPacket(General.MyPackets.SpawnEnti ty(SpawnWho));

if (SpawnWho.RBCount > 1)
Me.MyClient.SendPacket(General.MyPackets.String(Me .UID, 10, "2NDMetempsychosis"));

if (SpawnWho.MyGuild != null)
Me.MyClient.SendPacket(General.MyPackets.GuildName (SpawnWho.GuildID, SpawnWho.MyGuild.GuildName));
if (SpawnWho.Rank == 7)
Me.MyClient.SendPacket(General.MyPackets.String(Me .UID, 10, "letter1"));
if (SpawnWho.Rank == 6)
Me.MyClient.SendPacket(General.MyPackets.String(Me .UID, 10, "letter2"));
if (SpawnWho.Rank == 5)
Me.MyClient.SendPacket(General.MyPackets.String(Me .UID, 10, "letter3"));
if (SpawnWho.Rank == 4)
Me.MyClient.SendPacket(General.MyPackets.String(Me .UID, 10, "letter4"));
if (SpawnWho.Rank == 3)
Me.MyClient.SendPacket(General.MyPackets.String(Me .UID, 10, "letter5"));
if (SpawnWho.Rank == 2)
{
Me.MyClient.SendPacket(General.MyPackets.String(Me .UID, 10, "coronet3"));
Me.MyClient.SendPacket(General.MyPackets.String(Me .UID, 10, "letter6"));
}
if (SpawnWho.Rank == 1)
{
Me.MyClient.SendPacket(General.MyPackets.String(Me .UID, 10, "coronet4"));
Me.MyClient.SendPacket(General.MyPackets.String(Me .UID, 10, "letter7"));
}
}
}
}
}
catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
}
Sixth: search for public void Save()

and ABOVE IT add..

Code:
public void SaveRank()
{
LastSave = DateTime.Now;
if (MyClient.There)
if (MyClient.Online)
{
DataBase.SaveChar(this);
DataBase.SaveRank(this);
}
}
public void SaveDonation()
{
LastSave = DateTime.Now;
if (MyClient.There)
if (MyClient.Online)
{
DataBase.SaveChar(this);
DataBase.SaveDonation(this);
}
}
Seventh: search for public static void SaveChar(Character Charr)

and ABOVE IT add ..

Code:
public static void SaveRank(Character Charr)
{
MySqlCommand Command = null;
Command = new MySqlCommand("UPDATE `Characters` SET `Rank` = '" + Charr.Rank + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
Command.ExecuteNonQuery();

}
public static void SaveDonation(Character Charr)
{
MySqlCommand Command = null;
Command = new MySqlCommand("UPDATE `Characters` SET `Donation` = '" + Charr.Donation + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
Command.ExecuteNonQuery();
}
Eighth : search for Charr.PrevMap = Convert.ToUInt16((uint)DR["PrevMap"]);

and BELOW IT add..

Code:
Charr.Donation = (uint)DR["Donation"];
Charr.Rank = Convert.ToByte((uint)DR["Rank"]);
Ninth : GO TO YOUR CHARACTER TABLE IN YOUR PHPMYADMIN OR WHEREEVER YOU STORE YOUR SQL FILES AND ADD THIS IN THE CHARACTER TABLE PART

Tenth: Add this NPC in your server...
Dialog Part

Code:
if (CurrentNPC == 8410) // Nobility Guy
{
if (MyChar.Rank > 2 && MyChar.Rank < 10)
{
SendPacket(General.MyPackets.NPCSay("Which rank would you like to become? Only thing you have to do is pay me!"));
SendPacket(General.MyPackets.NPCLink("King - 500 Millon", 1));
SendPacket(General.MyPackets.NPCLink("Queen - 300 Millon", 2));
SendPacket(General.MyPackets.NPCLink("Duke - 70 Millon", 3));
SendPacket(General.MyPackets.NPCLink("Prince - 50 Millon", 4));
SendPacket(General.MyPackets.NPCLink("Baron - 35 Millon", 5));
SendPacket(General.MyPackets.NPCLink("Knight - 15 Millon", 6));
SendPacket(General.MyPackets.NPCLink("Earl - 3 Millon", 7));
SendPacket(General.MyPackets.NPCLink("I'm too poor!", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
else if (MyChar.Rank == 1 && MyChar.Model == 1003 || MyChar.Rank == 1 && MyChar.Model == 1004)
{
SendPacket(General.MyPackets.NPCSay("Your a King! Why would you want to be anything else?"));
SendPacket(General.MyPackets.NPCLink("I'm too poor!", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
else if (MyChar.Rank == 2 && MyChar.Model == 2001 || MyChar.Rank == 2 && MyChar.Model == 2002)
{
SendPacket(General.MyPackets.NPCSay("Your a Queen! Why would you want to be anything else?"));
SendPacket(General.MyPackets.NPCLink("I'm too poor!", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}

}
Control Part

Code:
if (CurrentNPC == 8410)
{
if (Control == 1)
{
if (MyChar.Silvers >= 500000000 && MyChar.Model == 1003) // 500 Million
{
MyChar.Silvers -= 500000000;
SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
MyChar.Rank = 1;
MyChar.Donation += 500000000;
MyChar.SaveRank();
MyChar.SaveDonation();
World.UpdateSpawn(MyChar);
World.SendMsgToAll(" " + MyChar.Name + " is a King now! ", "SYSTEM", 2010);

}
else if (MyChar.Silvers < 500000000)
{
SendPacket(General.MyPackets.NPCSay("You dont have enough silvers to become this rank!"));
SendPacket(General.MyPackets.NPCLink("Oh sorry...", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
else if (MyChar.Model == 2001 || MyChar.Model == 2002 )
{
SendPacket(General.MyPackets.NPCSay("You are a lady, so you must become a Queen!"));
SendPacket(General.MyPackets.NPCLink("Oh sorry...", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
if (Control == 2)
{
if (MyChar.Silvers >= 500000000 && MyChar.Model == 1005) // 300 Million
{
MyChar.Silvers -= 500000000;
SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
MyChar.Rank = 2;
MyChar.Donation += 500000000;
MyChar.SaveRank();
MyChar.SaveDonation();
World.UpdateSpawn(MyChar);
World.SendMsgToAll(" " + MyChar.Name + " is a Queen now! ", "SYSTEM", 2010);
}
else if (MyChar.Silvers < 500000000)
{
SendPacket(General.MyPackets.NPCSay("You dont have enough silvers to become this rank!"));
SendPacket(General.MyPackets.NPCLink("Oh sorry...", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
else if (MyChar.Model == 1003 || MyChar.Model == 1004)
{
SendPacket(General.MyPackets.NPCSay("You are a man, so you must become a King!"));
SendPacket(General.MyPackets.NPCLink("Oh sorry...", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
if (Control == 3)
{
if (MyChar.Silvers >= 70000000) // 70 Million
{
MyChar.Silvers -= 70000000;
SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
MyChar.Rank = 3;
MyChar.Donation += 70000000;
MyChar.SaveRank();
MyChar.SaveDonation();
World.UpdateSpawn(MyChar);
}
else
{
SendPacket(General.MyPackets.NPCSay("You dont have enough silvers to become this rank!"));
SendPacket(General.MyPackets.NPCLink("Oh sorry...", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
if (Control == 4)
{
if (MyChar.Silvers >= 50000000) // 50 Million
{
MyChar.Silvers -= 50000000;
SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
MyChar.Rank = 4;
MyChar.Donation += 50000000;
MyChar.SaveRank();
MyChar.SaveDonation();
World.UpdateSpawn(MyChar);
}
else
{
SendPacket(General.MyPackets.NPCSay("You dont have enough silvers to become this rank!"));
SendPacket(General.MyPackets.NPCLink("Oh sorry...", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
if (Control == 5)
{
if (MyChar.Silvers >= 35000000) // 35 Million
{
MyChar.Silvers -= 35000000;
SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
MyChar.Rank = 5;
MyChar.Donation += 35000000;
MyChar.SaveRank();
MyChar.SaveDonation();
World.UpdateSpawn(MyChar);
}
else
{
SendPacket(General.MyPackets.NPCSay("You dont have enough silvers to become this rank!"));
SendPacket(General.MyPackets.NPCLink("Oh sorry...", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
if (Control == 6)
{
if (MyChar.Silvers >= 15000000) // 15 Million
{
MyChar.Silvers -= 15000000;
SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
MyChar.Rank = 6;
MyChar.Donation += 15000000;
MyChar.SaveRank();
MyChar.SaveDonation();
World.UpdateSpawn(MyChar);
}
else
{
SendPacket(General.MyPackets.NPCSay("You dont have enough silvers to become this rank!"));
SendPacket(General.MyPackets.NPCLink("Oh sorry...", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
if (Control == 7)
{
if (MyChar.Silvers >= 3000000) // 3 Million
{
MyChar.Silvers -= 3000000;
SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
MyChar.Rank = 7;
MyChar.Donation += 3000000;
MyChar.SaveRank();
MyChar.SaveDonation();
World.UpdateSpawn(MyChar);
}
else
{
SendPacket(General.MyPackets.NPCSay("You dont have enough silvers to become this rank!"));
SendPacket(General.MyPackets.NPCLink("Oh sorry...", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}

NO CREDITS FOR MEEE IT'S NOT MINE
07/31/2009 10:57 killermickle#10
@eddy, if you read the post hes looking for Nobility using the window like real co; not via a NPC.
07/31/2009 16:57 danielachraf#11
don't bump old threads