Checking code before I put it into my source

07/30/2009 15:01 TehPwnzor#1
#request close
Got nobility working
07/30/2009 15:05 danielachraf#2
Based off CoMy's source ??? this is a poorly coded loft and also he copied and pasted from here.. USE Search
07/30/2009 15:06 TehPwnzor#3
yeah i know i was just checking if it was all right
07/31/2009 13:18 TehPwnzor#4
sorry for the doublle post but i need to bump this

#BUMP

somebody please help
07/31/2009 13:50 ~Yuki~#5
Its alright :)
07/31/2009 14:02 TehPwnzor#6
and for the database
it should be
PHP Code:
      Rank      int(10)           UNSIGNED      Notnull      9 
and
PHP Code:
      Donation      int(10)           UNSIGNED      Notnull      0 
right?
07/31/2009 14:21 ~Yuki~#7
try it if it errors its not :)
07/31/2009 17:23 n0mansland#8
Why is everyone using CoMy >.<?

Anyway.. I'm sure you figured out the problem by now.. but yea, you'll have to add Donation and Rank into your database.. Also, are you forgetting the
Code:
Public Static Void SaveDonation
Part? or you just didn't add it in here..

Personally I wouldn't use that code.. but if it works it works.. Unless you plan on adding/changing some things.. Looks like they haven't added the extra potency part.
07/31/2009 17:27 danielachraf#9
Why are you asking until you copied and pasted here from the other thread? make yourself a coder or something like that ?
07/31/2009 21:45 TehPwnzor#10
nah i already had the saverank void and blah blah
hmm i got ti all coded now all i need to do is code in somethin so royalty get bonus potency
07/31/2009 21:54 killermickle#11
In the King/Queen parts of the NPC control the MyChar.Model's are incorrect. Hopefully this will correct the issue. If not, feel free to point and laugh at me. I would also lose the last else if myself, and just have else becuase im picky as they get.

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

                                }
                                else if (MyChar.CPs < 1000000)
                                {
                                    SendPacket(General.MyPackets.NPCSay("You dont have enough CPs to become a King!"));
                                    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.CPs > 1000000 && MyChar.Model != 1003 && MyChar.Model != 1004) // 1 Million
                                {
                                    MyChar.CPs -= 1000000;
                                    SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                    MyChar.Rank = 2;
                                    MyChar.Donation += 1000000;
                                    MyChar.SaveRank();
                                    MyChar.SaveDonation();
                                    World.UpdateSpawn(MyChar);
                                    World.SendMsgToAll(" " + MyChar.Name + " is a Queen now! ", "SYSTEM", 2010);
                                }
                                else if (MyChar.CPs < 1000000)
                                {
                                    SendPacket(General.MyPackets.NPCSay("You dont have enough CPs to become a Queen!"));
                                    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.CPs >= 750000) // 750 Thousand
                                {
                                    MyChar.CPs -= 750000;
                                    SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                    MyChar.Rank = 3;
                                    MyChar.Donation += 750000;
                                    MyChar.SaveRank();
                                    MyChar.SaveDonation();
                                    World.UpdateSpawn(MyChar);
                                    World.SendMsgToAll(" " + MyChar.Name + " is a Prince now! ", "SYSTEM", 2010);
                                }
                                else
                                {
                                    SendPacket(General.MyPackets.NPCSay("You dont have enough CPs to become a Prince!"));
                                    SendPacket(General.MyPackets.NPCLink("Oh sorry...", 255));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                            }
                            if (Control == 4)
                            {
                                if (MyChar.CPs >= 600000) // 600 Thousand
                                {
                                    MyChar.CPs -= 600000;
                                    SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                    MyChar.Rank = 4;
                                    MyChar.Donation += 600000;
                                    MyChar.SaveRank();
                                    MyChar.SaveDonation();
                                    World.UpdateSpawn(MyChar);
                                    World.SendMsgToAll(" " + MyChar.Name + " is a Duke now! ", "SYSTEM", 2010);
                                }
                                else
                                {
                                    SendPacket(General.MyPackets.NPCSay("You dont have enough CPs to become a Duke!"));
                                    SendPacket(General.MyPackets.NPCLink("Oh sorry...", 255));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                            }
                            if (Control == 5)
                            {
                                if (MyChar.CPs >= 500000) // 500 Thousand
                                {
                                    MyChar.CPs -= 500000;
                                    SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                    MyChar.Rank = 5;
                                    MyChar.Donation += 500000;
                                    MyChar.SaveRank();
                                    MyChar.SaveDonation();
                                    World.UpdateSpawn(MyChar);
                                    World.SendMsgToAll(" " + MyChar.Name + " is an Earl now! ", "SYSTEM", 2010);
                                }
                                else
                                {
                                    SendPacket(General.MyPackets.NPCSay("You dont have enough CPs to become an Earl!"));
                                    SendPacket(General.MyPackets.NPCLink("Oh sorry...", 255));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                            }
                            if (Control == 6)
                            {
                                if (MyChar.CPs >= 350000) // 350 Thousand
                                {
                                    MyChar.CPs -= 350000;
                                    SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                    MyChar.Rank = 6;
                                    MyChar.Donation += 350000;
                                    MyChar.SaveRank();
                                    MyChar.SaveDonation();
                                    World.UpdateSpawn(MyChar);
                                    World.SendMsgToAll(" " + MyChar.Name + " is a Knight now! ", "SYSTEM", 2010);
                                }
                                else
                                {
                                    SendPacket(General.MyPackets.NPCSay("You dont have enough CPs to become a Knight!"));
                                    SendPacket(General.MyPackets.NPCLink("Oh sorry...", 255));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                            }
                        }