*Setting up the server
*Adding accounts
*Adding monsters
*Adding NPCs
*Adding monsterspawns ( Will share an exclusive command that I created )
*Remove monsters
*Edit monsters
*Remove monsterspawns
*Remove NPCs
*How to make other people connect
*How to add commands into the server
* FINALLY,that almost everyone have trouble with at LOFT source,I will show how you add rebirth.
Setting up the server
1. Download the source
2. Go into COServerProject1\COServerProject\bin\Debug,open the file Config and put in your ip, dbusername,dbuserpass. Dbusername/pass,is your database username and pass (
)3. Start COServerProject.exe. Congratulations,your server is up if no bugs shows up.
4. Download 5017 client if you dont already have it. Go into your Server.dat in your patch 5017 client,and change the IP to your ip. You find your ip at

5. Done. Next is to create accounts.
Adding accounts
1. Go into your database (
)2. Go into the account field,and press Insert almost at the top of the page.
3. Now fill in your account ID,leave password blank, Logontype should be 2.
( If you want to create a GM account,set Status at 8.
4. Save,now you have created an account.
Adding monsters
1. Go into your database,and into monster field
2. Press insert,and start filling in the fields
PS: You need the correct monster information,you could either search for it,and you get some monster information,or I sell conquer's patch 5035 monster database,which have every monster information.
Adding NPCs
1. Go into your database,into NPC field
2. Press Insert,and fill in the fields,where it should be located at,etc. Please use the already added NPCs as a refference,so you see how they are created. Next you go into the source,and search for an NPC ,like this : if (CurrentNPC == 7500)
Then you find an NPC. Below that NPC field,create a new one. For example,if your going to create an NPC with NPC id 1212,you can do like this:
if (CurrentNPC == 1212) <-- npc id
{
SendPacket(General.MyPackets.NPCSay("Hello,what do you want me."));
SendPacket(General.MyPackets.NPCLink("Hi,can you please give me an dragonball?", 1));
SendPacket(General.MyPackets.NPCLink("Nothing,than ks.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
Okay. First the NPC asks something,you can see that by it says NPCSay before the actual message. After that,it gives you an option,NPCLink means an option. Notice the 1 after the message,means its option 1. And the last option,got number 255,means exit,and it close the chat. If player choose option one,it should give you an Dragonball. To make it give you this dragonball,you add a new npc text under,and it should look like this.
if (CurrentNPC == 1212) <-- npc id
{
if (Control == 1) <- Control == Option,so it checks if the option was 1.
{
MyChar.AddItem("1088000-0-0-0-0-0", 0, (uint)General.Rand.Next(99999999));
SendPacket(General.MyPackets.NPCSay("There you go,now you have your DragonBall in your backpack.."));
SendPacket(General.MyPackets.NPCLink("Thanks alot.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
There,now it gives you an DragonBall. The numbers you see at additem command,is like this:
First : ItemID
Second : ItemPlus
Third : ItemMinus
Fourth : EchantedHP
Fifth : ItemGem1
Sixth : ItemGem2
Now you got an working NPC at the spot you added it on in the database.
Adding monsterspawns
The normal way is very confusing so me,so I decided to make an /addspawn command instead,which I will share with you. Here it goes:
Search for example ; /recall,then it gets you to the command area. After /recall command,add this:
if (Splitter[0] == "/addspawn")
{
uint MobID = uint.Parse(Splitter[1]);
ushort Area = byte.Parse(Splitter[2]);
ushort Amount = ushort.Parse(Splitter[3]);
DataBase.NewSpawn(MyChar.LocMap, (ushort)(MyChar.LocX - Area), (ushort)(MyChar.LocY + Area), (ushort)(MyChar.LocX + Area), (ushort)(MyChar.LocY - Area), Amount, MobID);
}
Now when you done that,search for: public static void NoGuild(uint UID)
Under the } bracklet,add this :
public static bool NewSpawn(ushort Map, ushort XStart, ushort YStart, ushort XEnd, ushort YEnd, ushort SpawnNr, uint MobID)
{
try
{
MySqlCommand Command = new MySqlCommand("INSERT INTO mobspawns (SpawnWhatID,SpawnNr,XStart,YStart,XEnd,YEnd,Map) VALUES (" + MobID + "," + SpawnNr + "," + XStart + "," + YStart + "," + XEnd + "," + YEnd + "," + Map + ")", Connection);
Command.ExecuteNonQuery();
return true;
}
catch { return false; }
}
Great work dude! Now you added the addspawn command,which I think no other loft user has. Ingame,you type in talk box,like this : /addspawn MobID Area Amout .
Delete monsters,NPCs and monsterspawns.
This work is mostly in database. Just find them there,and delete them. If you going to delete an npc,remember to remove the talk part in source too,so it dont take unneccesery space.
Make others connect
Now you probally want your friends to connect to the server. Lets go to
, and login to your router. If you dont have the acc and pass to this,please ask your parents or check the paper you got when buying the router. Now,open ports so people can connect. The ports you are going to open are:*3306
*9958
*80
*5816
*9960
*5000
*5016
Now make an account for them,and let them enjoy the server
Create commands
You saw earlier the command part of the source. Now if you want to add commands into it,its a bit complicated. Well,I dont know what such of commands you like,so you can ask me and I help you with it. You can also use other commands already added as an refference. If you want to make the server PVP,easily just search after this : if (Status == 8 || Status == 7)
And delete it,but remember,now they got acces to ALL the commands,so you better delete them or something :P
REBIRTH!
Now to the part almost everyone has trouble with,the rebirth part. This isnt something you can do at the first day of your coding,you need a bit experience with it,and I will release this code to help you guys that are a bit nooby at coding,so you can studdy it alot.
Ok,lets go.
Go into Character.cs,and under all that public bool/ public Timer,etc,put this:
Quote:
public void ReBorn(byte ToJob)
{
try
{
RBCount++;
if (Level == 121)
StatP += 1;
else if (Level == 122)
StatP += 1;
else if (Level == 123)
StatP += 3;
else if (Level == 124)
StatP += 6;
else if (Level == 125)
StatP += 10;
else if (Level == 126)
StatP += 15;
else if (Level == 127)
StatP += 21;
else if (Level == 128)
StatP += 28;
else if (Level == 129)
StatP += 36;
else if (Level == 130)
StatP += 45;
MyClient.SendPacket(General.MyPackets.Vital(UID, 11, StatP));
Level = 15;
Skills.Clear();
Skill_Exps.Clear();
if (Job == 145)
{
if (ToJob == 41)
{
LearnSkill(1000, 0);
LearnSkill(1001, 0);
LearnSkill(1005, 0);
}
if (ToJob == 21)
{
LearnSkill(1000, 0);
LearnSkill(1001, 0);
LearnSkill(1005, 0);
}
if (ToJob == 11)
{
LearnSkill(1000, 0);
LearnSkill(1001, 0);
LearnSkill(1005, 0);
}
if (ToJob == 101)
{
LearnSkill(1120, 0);
}
}
if (Job == 15)
{
if (ToJob == 41)
{
LearnSkill(1110, 0);
LearnSkill(1190, 0);
}
if (ToJob == 21)
{
LearnSkill(1110, 0);
LearnSkill(1190, 0);
}
if (ToJob == 101)
{
LearnSkill(1110, 0);
LearnSkill(1190, 0);
}
}
if (Job == 25)
{
if (ToJob == 41)
{
LearnSkill(1020, 0);
}
if (ToJob == 101)
{
LearnSkill(1020, 0);
LearnSkill(1025, 0);
}
if (ToJob == 11)
{
LearnSkill(1020, 0);
LearnSkill(1320, 0);
}
if (ToJob == 11)
{
LearnSkill(1020, 0);
LearnSkill(1320, 0);
}
}
if (Job == 135)
{
if (ToJob == 41)
{
LearnSkill(1005, 0);
LearnSkill(1075, 0);
LearnSkill(1090, 0);
LearnSkill(1095, 0);
LearnSkill(1195, 0);
}
if (ToJob == 21)
{
LearnSkill(1005, 0);
LearnSkill(1075, 0);
LearnSkill(1090, 0);
LearnSkill(1095, 0);
LearnSkill(1195, 0);
}
if (ToJob == 11)
{
LearnSkill(1005, 0);
LearnSkill(1075, 0);
LearnSkill(1090, 0);
LearnSkill(1095, 0);
LearnSkill(1195, 0);
}
if (ToJob == 101)
{
LearnSkill(1175, 0);
LearnSkill(1075, 0);
LearnSkill(1050, 0);
}
}
Job = ToJob;
DataBase.GetStats(this);
GetEquipStats(1, true);
GetEquipStats(2, true);
GetEquipStats(3, true);
GetEquipStats(4, true);
GetEquipStats(5, true);
GetEquipStats(6, true);
GetEquipStats(7, true);
GetEquipStats(8, true);
MinAtk = Str;
MaxAtk = Str;
MaxHP = BaseMaxHP();
Potency = Level;
GetEquipStats(1, false);
GetEquipStats(2, false);
GetEquipStats(3, false);
GetEquipStats(4, false);
GetEquipStats(5, false);
GetEquipStats(6, false);
GetEquipStats(7, false);
GetEquipStats(8, false);
CurHP = MaxHP;
MyClient.SendPacket(General.MyPackets.Vital((long) UID, 7, Job));
MyClient.SendPacket(General.MyPackets.Vital((long) UID, 16, Str));
MyClient.SendPacket(General.MyPackets.Vital((long) UID, 17, Agi));
MyClient.SendPacket(General.MyPackets.Vital((long) UID, 15, Vit));
MyClient.SendPacket(General.MyPackets.Vital((long) UID, 14, Spi));
MyClient.SendPacket(General.MyPackets.Vital((long) UID, 2, MaxMana()));
MyClient.SendPacket(General.MyPackets.GeneralData( (long)UID, 0, 0, 0, 92));
MyClient.SendPacket(General.MyPackets.Vital((long) UID, 0, CurHP));
for (byte i = 1; i < 9; i++)
{
if (Equips[i] == null || Equips[i] == "") continue;
string I = Equips[i];
string[] II = I.Split('-');
uint IID = uint.Parse(II[0]);
byte Quality = (byte)Other.ItemQuality(IID);
if (i == 1)
{
string NewID = "";
if (Other.WeaponType(IID) == 111 || Other.WeaponType(IID) == 113 || Other.WeaponType(IID) == 114 || Other.WeaponType(IID) == 118 || Other.WeaponType(IID) == 117)
{
NewID = II[0].Remove(4, 2);
NewID = NewID + "0" + Quality.ToString();
Equips[i] = NewID + "-" + II[1] + "-" + II[2] + "-" + II[3] + "-" + II[4] + "-" + II[5];
II[0] = NewID;
MyClient.SendPacket(General.MyPackets.AddItem(Equi ps_UIDs[i], int.Parse(II[0]), byte.Parse(II[1]), byte.Parse(II[2]), byte.Parse(II[3]), byte.Parse(II[4]), byte.Parse(II[5]), i, 100, 100));
}
else if (Other.WeaponType(IID) == 112)
{
byte Type = byte.Parse(II[0][4].ToString());
byte Color = byte.Parse(II[0][3].ToString());
NewID = "11" + Type.ToString() + Color.ToString() + "0" + Quality.ToString();
Equips[i] = NewID + "-" + II[1] + "-" + II[2] + "-" + II[3] + "-" + II[4] + "-" + II[5];
II[0] = NewID;
MyClient.SendPacket(General.MyPackets.AddItem(Equi ps_UIDs[i], int.Parse(II[0]), byte.Parse(II[1]), byte.Parse(II[2]), byte.Parse(II[3]), byte.Parse(II[4]), byte.Parse(II[5]), i, 100, 100));
}
}
else if (i == 2)
{
string NewID = "";
NewID = II[0].Remove(3, 3);
NewID += "00" + Quality.ToString();
Equips[i] = NewID + "-" + II[1] + "-" + II[2] + "-" + II[3] + "-" + II[4] + "-" + II[5];
II[0] = NewID;
MyClient.SendPacket(General.MyPackets.AddItem(Equi ps_UIDs[i], int.Parse(II[0]), byte.Parse(II[1]), byte.Parse(II[2]), byte.Parse(II[3]), byte.Parse(II[4]), byte.Parse(II[5]), i, 100, 100));
}
else if (i == 3)
{
string NewID = "";
if (Other.WeaponType(IID) == 130 || Other.WeaponType(IID) == 131 || Other.WeaponType(IID) == 133 || Other.WeaponType(IID) == 134)
{
NewID = II[0].Remove(4, 2);
NewID = NewID + "0" + Quality.ToString();
Equips[i] = NewID + "-" + II[1] + "-" + II[2] + "-" + II[3] + "-" + II[4] + "-" + II[5];
II[0] = NewID;
MyClient.SendPacket(General.MyPackets.AddItem(Equi ps_UIDs[i], int.Parse(II[0]), byte.Parse(II[1]), byte.Parse(II[2]), byte.Parse(II[3]), byte.Parse(II[4]), byte.Parse(II[5]), i, 100, 100));
}
else if (Other.WeaponType(IID) == 135 || Other.WeaponType(IID) == 136 || Other.WeaponType(IID) == 138 || Other.WeaponType(IID) == 139)
{
byte Type = byte.Parse(II[0][2].ToString());
byte Color = byte.Parse(II[0][3].ToString());
Type -= 5;
NewID = "13" + Type.ToString() + Color.ToString() + "0" + Quality.ToString();
Equips[i] = NewID + "-" + II[1] + "-" + II[2] + "-" + II[3] + "-" + II[4] + "-" + II[5];
II[0] = NewID;
MyClient.SendPacket(General.MyPackets.AddItem(Equi ps_UIDs[i], int.Parse(II[0]), byte.Parse(II[1]), byte.Parse(II[2]), byte.Parse(II[3]), byte.Parse(II[4]), byte.Parse(II[5]), i, 100, 100));
}
}
else if (i == 4)
{
string NewID = "";
NewID = II[0].Remove(3, 3);
NewID += "02" + Quality.ToString();
Equips[i] = NewID + "-" + II[1] + "-" + II[2] + "-" + II[3] + "-" + II[4] + "-" + II[5];
II[0] = NewID;
MyClient.SendPacket(General.MyPackets.AddItem(Equi ps_UIDs[i], int.Parse(II[0]), byte.Parse(II[1]), byte.Parse(II[2]), byte.Parse(II[3]), byte.Parse(II[4]), byte.Parse(II[5]), i, 100, 100));
}
else if (i == 5)
{
string NewID = "";
if (Other.WeaponType(IID) == 900)
{
NewID = II[0].Remove(4, 2);
NewID += "0" + Quality.ToString();
Equips[i] = NewID + "-" + II[1] + "-" + II[2] + "-" + II[3] + "-" + II[4] + "-" + II[5];
II[0] = NewID;
MyClient.SendPacket(General.MyPackets.AddItem(Equi ps_UIDs[i], int.Parse(II[0]), byte.Parse(II[1]), byte.Parse(II[2]), byte.Parse(II[3]), byte.Parse(II[4]), byte.Parse(II[5]), i, 100, 100));
}
else if (Other.ItemType(IID) == 4 || Other.ItemType(IID) == 5)
{
NewID = II[0].Remove(3, 3);
NewID += "02" + Quality.ToString();
Equips[i] = NewID + "-" + II[1] + "-" + II[2] + "-" + II[3] + "-" + II[4] + "-" + II[5];
II[0] = NewID;
MyClient.SendPacket(General.MyPackets.AddItem(Equi ps_UIDs[i], int.Parse(II[0]), byte.Parse(II[1]), byte.Parse(II[2]), byte.Parse(II[3]), byte.Parse(II[4]), byte.Parse(II[5]), i, 100, 100));
}
}
else if (i == 6)
{
string NewID = "";
NewID = II[0].Remove(3, 3);
NewID += "01" + Quality.ToString();
Equips[i] = NewID + "-" + II[1] + "-" + II[2] + "-" + II[3] + "-" + II[4] + "-" + II[5];
II[0] = NewID;
MyClient.SendPacket(General.MyPackets.AddItem(Equi ps_UIDs[i], int.Parse(II[0]), byte.Parse(II[1]), byte.Parse(II[2]), byte.Parse(II[3]), byte.Parse(II[4]), byte.Parse(II[5]), i, 100, 100));
}
else if (i == 8)
{
string NewID = "";
NewID = II[0].Remove(3, 3);
NewID += "01" + Quality.ToString();
Equips[i] = NewID + "-" + II[1] + "-" + II[2] + "-" + II[3] + "-" + II[4] + "-" + II[5];
II[0] = NewID;
MyClient.SendPacket(General.MyPackets.AddItem(Equi ps_UIDs[i], int.Parse(II[0]), byte.Parse(II[1]), byte.Parse(II[2]), byte.Parse(II[3]), byte.Parse(II[4]), byte.Parse(II[5]), i, 100, 100));
}
}
MyClient.SendPacket(General.MyPackets.Vital(UID, 13, Level));
World.SendMsgToAll(Name + " has reborned!", "SYSTEM", 2011);
World.UpdateSpawn(this);
MyClient.Drop();
}
catch (Exception Exc) { Console.WriteLine(Exc); }
}
Now,go to the command area,and add a new command like this :
if (Splitter[0] == "/rb")
{
MyChar.ReBorn(byte.Parse(Splitter[1]));
}
Congratulations,you now added reborn. You can either add an Reborn npc or just use the command, /rb NewJobID,like , /rb 15 .
Yes,it reborns you,downgrade the gear,and all that shit.
Congratulations. You now have an decent server !
Please give me a Thanks for this huge post,and if any questions please ask at this Thread,and I try to help you.
Futher notice : I sell my source which have like everything conquer has,except the client,and I made it more stable. Also write here if your intresed.
- Emme






