Discussion on [Release] Extremely basic (but working/bugless) C# Source within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
Ok here is a code that i have been working on for + item restriction (as seen on AcidCO) I figured since i am using Hybrid's source that i should post it here and hopes that more people will take interest in this growing source.
private static void LoadEquips(GameClient Client)
{
IniFile rdr = new IniFile(DatabasePath + @"\Equips\" + Client.Username + ".ini");
for (sbyte i = 0; i < Client.Equipment.Count; i++)
{
ItemDataPacket LoadedEquip;
if (ItemDataPacket.Parse(rdr.ReadString("Equips", "Item[" + i.ToString() + "]", String.Empty), out LoadedEquip))
{
Client.Equip(LoadedEquip, (ushort)(i + 1));
}
}
}
Ok this is the code i have been working on for loading gears this code "does not work" I been working on this since yesterday anyone have any idea what is wrong? Ive rewrote it 3 times and either way i write it it still don't load. When it saves it looks like this
Code:
[Equips]
Item[2]=137310 0 0 0 0 0
Ill keep taking cracks at it. Good luck to anyone else working with this soure
Need some help here been working on this since yesterday with talking npc's just using the code that was there and i think i got it figured out just need someone to confirm my theory?
Quote:
case 900100:
{
dialog(Client, new string[] {
"AVATAR 30",
"TEXT Hello i am a testing NPC!",
"OPTION-1 Ok Good Bye!",
});
break;
}
All i did was add that before the default. But i got a couple of questions i am not sure about with the code that is already in the source is that good enough npc code? If it is how can i add another "page of talking? thanks ill keep taking a crack at it to figure it if i can.
Can a mod merge my my 2 posts forgot that i just replied to Djago sorry
case 900100:
{
if(OptionID == 0)
dialog(Client, new string[] {
"AVATAR 30",
"TEXT Hello i am a testing NPC!",
"OPTION-1 Ok Good Bye!",
});
else if(OptionID == 1)
dialog(Client, new string[] {
"AVATAR 30",
"TEXT Hello this is the second page i`ve been working on for ages!",
"OPTION-255 Ok Good Bye!",
});
break;
}
When you click on a npc... the OptionID will be automaticaly 0, the first "page" you`ll get.
Also, there is a kinda bug while adding the optionid which will be sent and i posted the way to fix some weeks ago(i think).
Here`s the link:
why would I? I mean its not a big difference. It works the same...
anyway as you wish
Code:
switch(OptionID)
{
case 0:{dialog(Client, new string[] {
"AVATAR 30",
"TEXT Howdy! Would you like some money?",
"OPTION-1 Ohh, yea I need some."
"OPTION-255 No, thank you."
});} break;
case 1:{dialog(Client, new string[] {
"AVATAR 30",
"TEXT Here it is!",
"OPTION-255 Okay. Thanks."
});
Client.Money += 1000;
SyncPacket Package = new SyncPacket(1);
Package.UID = Client.Identifier;
Package[0] = SyncPacket.Data.Create(SyncPacket.Money, Client.Money);
Client.Send(Package.Serialize()); }break;
}
Okay, got spawned a mob, mobspawns should be easy now.
Here comes the attack packet (although I`m not even 10% sure that it works since I never really worked with them). If something is missing or isn`t correct, correct me as you wish :P
1.) Create a file with the name Attack Packet.cs
2.) Copy this in it
Quote:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConquerServer_Basic
{
public class AttackPacket : IClassPacket
{
private byte[] Packet;
public uint UID
{
get { return BitConverter.ToUInt32(Packet, 8); }
set { PacketBuilder.WriteUInt32(value, Packet, 8); }
}
public uint Target
{
get { return BitConverter.ToUInt32(Packet, 12); }
set { PacketBuilder.WriteUInt32(value, Packet, 12); }
}
public ushort TargetX
{
get { return BitConverter.ToUInt16(Packet, 16); }
set { PacketBuilder.WriteUInt32(value, Packet, 16); }
}
public ushort TargetY
{
get { return BitConverter.ToUInt16(Packet, 18); }
set { PacketBuilder.WriteUInt32(value, Packet, 18); }
}
public uint AttackType
{
get { return BitConverter.ToUInt32(Packet, 20); }
set { PacketBuilder.WriteUInt32(value, Packet, 20); }
}
public uint Damage
{
get { return BitConverter.ToUInt32(Packet, 24); }
set { PacketBuilder.WriteUInt32(value, Packet, 24); }
}
public void Deserialize(byte[] Bytes)
{
Packet = Bytes;
}
public byte[] Serialize()
{
return this.Packet;
}
}
}
[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