Discussion on [Release] Extremely basic (but working/bugless) C# Source within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
In the Packets folder create a new file called GemSocket Packet.cs and replace the code there with below :
Code:
using System;
namespace ConquerServer_Basic
{
class GemSocketPacket : IClassPacket
{
private byte[] Packet;
public const byte AddSocket = 0,
RemoveSocket = 1;
/// <summary>
/// No idea what this is for, has no use.
/// </summary>
public uint PlayerID
{
get { return BitConverter.ToUInt32(Packet, 4); }
}
public uint ItemUID
{
get { return BitConverter.ToUInt32(Packet, 8); }
}
public uint GemID
{
get { return BitConverter.ToUInt32(Packet, 12); }
}
public byte Socket
{
get { return Packet[16]; }
}
public byte Mode
{
get { return Packet[18]; }
}
public void Deserialize(byte[] Data)
{
Packet = Data;
}
public byte[] Serialize()
{
throw new NotImplementedException();
}
}
}
Oh btw anyone who knows, what is there a packet to update the item stats? Or do I really have to do like I did in this example and first remove it and then add it with new stats? >_>
I've added in selling to all the NPCs' Shops now.
-Selling items works
-Correct Sell price for all Items (Based on Item's Price, Item's Current Durability and Item's Max durability)(TQ Style).
-NPC range check added
Same goes with Repairing items.
Although one problem. Does anyone have the item update packet or know what it is. I know I'm having a blonde moment and it's 11:24pm lol.....
i could be wrong but i had a look in the source and found this
UpdateItem = 0x03
Item Packet.cs line 29
Yeah [UpdateItem = 0x03] is the Item Update packet thanks
Btw,
-DragonBall quality upgrading is now implemented.
-Item Usage is now implemented
-Item's Durability is implemented (Save/Loads from Database)
-Buying Items from NPCs is now implemented
-Selling Items to NPCs is now implemented
-Repairing Items at NPCs is now implemented
Although I need help with the chance of upgrading:
Normal -> Refined ?%
Refined -> Unique ?%
Unique -> Elite ?%
Elite -> Super ?%
What I'm thinking is that ill just upload my source or give it to Infamous (to implement in Rev4) because there is too much to add in. lol
Infamous can decide.
@ sparkie:
I originally wanted to write my server in C++, but I was working with Ultimation at the time and I had already made him learn a basic understanding of C#; And Delphi was out of the question so we went with C#.
A lot of my source however relies on functions and methods that'd be commonly used in C++ such as memcpy, and pointer logic.
:P
@tarouka:
I stayed away for pointers cause I know pointers in C#, isn't really for most people, the vast majority of people should really just stay away from them. I didn't use them because I didn't want to confuse people, have people wind up with access violations, etc.
This isn't a 'Grade A' release, but this will allow you to edit the Auth Port, Game Port and Server IP through a Config.ini file instead of through the entire project and then having to re-build it. =d
So here we go. Step 1: Insert into "Program.cs" the following code under public class Program (underneath the brackets):
Code:
public static IniFile Config;
public static UInt16 AuthPort, GamePort;
public static string IPAddress;
Step 4: Adding CONFIG.INI -> Right click in the Debug/Release folder, and click New -> Text Document. Call it Config.ini Add the following into the file:
Step 4.1: Then click on Save As... and name it Config.ini; IF you have Hide Common Shortcuts enabled, underneath FILE NAME, there should be FILE TYPE. Hit the scroll down bar and select All File Types. Hit Save and complete.
(If you don't have "Text Document", go to Start -> Notepad -> insert in the above -> then save as (in your Debug/Relese folder) -> "Config.ini" -> If needed, look at Step 4.1)
Step 5: Still in Main, replace authSocket.Port = 9958; to
Code:
authSocket.Port = AuthPort;
and change gameSocket.Port = 5816; to
Code:
gameSocket.Port = GamePort;
**Unneeded Step** : If you want to display the AuthPort/GamePort/Server IP within your Console window, all you add into Main() is:
Oke...so after some addings in this source (no bugs yet ^^) , i wanted to add some npc dialogs and confronted some troubles with the OptionIDs that were sended.
Idk if its bug or it was coded to be this way but...anyway i found a way out
[Huge-Release] All-In-One Basic NPC Scripts For The 5165 Source! 02/19/2010 - CO2 PServer Guides & Releases - 30 Replies Well I'm sorry that I spammed the whole forum full of my posts So pro4never and .Ryu gave me the idea of making this All-In-One thread about all my NPC's! THESE ARE UPDATED DAILY!
NOTE: TO PEOPLE... SOME OF THE CODES ARE NOT MADE BY ME! I USUALLY JUST FIXED/UPDATED THE BASIC ONES! SORRY I'M LEARNING ON HOW TO CODE!
1. Birth-Island-NPC's(The NPC text is not from "REAL CONQUER" SORRY!...)
#region BirthOldGeneralYang
case 425:
{
[RELEASE] Basic LOTF Source 09/03/2009 - CO2 PServer Guides & Releases - 17 Replies hey this is a basic lotf source edited based off shadowco, if you dont like it then dont post here... flames will be told on!!! :D i will tell on you to the mods if you flame
What it has...
- LuckyTime
- Guard
- 24/7 GW