You last visited: Today at 22:37
Advertisement
Help Needed Hellmouth Source
Discussion on Help Needed Hellmouth Source within the CO2 Private Server forum part of the Conquer Online 2 category.
05/06/2012, 19:07
#1
elite*gold: 0
Join Date: Mar 2009
Posts: 67
Received Thanks: 3
Help Needed Hellmouth Source
Quote:
Originally Posted by
Kiyono
It's not the reborn system, this just makes you able to see reborn stats.
Since it's too much work to just post the parts I changed, here's my PlayerInfo packet:
Code:
using System.Text;
using Albetros.Core.Enum;
namespace Albetros.Game.Packet
{
public unsafe struct PlayerInfoPacket
{
public uint Id;
public uint Lookface;
public ushort Hair;
public uint Money;
public uint EMoney;
public ulong Experience;
public uint Unknown1;
public uint Unknown2;
public uint Unknown3;
public uint Unknown4;
public uint Unknown5;
public ushort Strength;
public ushort Agility;
public ushort Vitality;
public ushort Spirit;
public ushort AdditionalPoint;
public ushort Life;
public ushort Mana;
public short Pk;
public byte Level;
public byte Profession;
public byte Metempsychosis;
public byte OriProfession;
public byte Unknown7;
public byte SecProfession;
public byte NamesDisplayed;
public byte Unknown18;
public byte Unknown19;
public uint Unknown9;
public uint Unknown10;
public uint Unknown11;
public ushort Unknown87;
public PlayerTitle Title;
public byte Unknown90;
public uint Unknown91;
public uint Unknown95;
public uint Unknown99;
public uint Unknown103;
public byte Unknown107;
public NetStringPacker StringPacker;
public static PlayerInfoPacket Create(Player player)
{
var packet = new PlayerInfoPacket();
packet.Id = player.UID;
packet.Lookface = player.Mesh;
packet.Hair = player.Hair;
packet.Money = player.Money ;
packet.EMoney = player.CP;
packet.Experience = player.Experience;
packet.Strength = player.Strength;
packet.Agility = player.Agility;
packet.Vitality = player.Vitality;
packet.Spirit = player.Spirit;
packet.AdditionalPoint = player.StatPoint;
packet.Life = (ushort) player.Health;
packet.Mana = (ushort) player.Mana;
packet.Pk = 0;
packet.Level = player.Level;
packet.Profession = player.Profession;
packet.OriProfession = player.OriProfession;
packet.SecProfession = player.SecProfession;
packet.Metempsychosis = player.Reborn;
packet.NamesDisplayed = 1;
packet.Title = player.Title;
packet.StringPacker = new NetStringPacker();
packet.StringPacker.AddString(player.Name);
packet.StringPacker.AddString(string.Empty);
packet.StringPacker.AddString(player.Spouse);
return packet;
}
public static implicit operator PlayerInfoPacket(byte* ptr)
{
var packet = new PlayerInfoPacket();
packet.Id = *((uint*)(ptr + 4));
packet.Lookface = *((uint*)(ptr + 8));
packet.Hair = *((ushort*)(ptr + 12));
packet.Money = *((uint*)(ptr + 14));
packet.EMoney = *((uint*)(ptr + 18));
packet.Experience = *((ulong*)(ptr + 22));
packet.Unknown1 = *((uint*)(ptr + 30));
packet.Unknown2 = *((uint*)(ptr + 34));
packet.Unknown3 = *((uint*)(ptr + 38));
packet.Unknown4 = *((uint*)(ptr + 42));
packet.Unknown5 = *((uint*)(ptr + 46));
packet.Strength = *((ushort*)(ptr + 50));
packet.Agility = *((ushort*)(ptr + 52));
packet.Vitality = *((ushort*)(ptr + 54));
packet.Spirit = *((ushort*)(ptr + 56));
packet.AdditionalPoint = *((ushort*)(ptr + 58));
packet.Life = *((ushort*)(ptr + 60));
packet.Mana = *((ushort*)(ptr + 62));
packet.Pk = *((short*)(ptr + 64));
packet.Level = *(ptr + 66);
packet.Profession = *(ptr + 67);
packet.OriProfession = *(ptr + 68);
packet.SecProfession = *(ptr + 69);
packet.Unknown7 = *(ptr + 70);
packet.Metempsychosis = *(ptr + 71);
packet.NamesDisplayed = *(ptr + 72);
packet.Unknown18 = *(ptr + 73);
packet.Unknown19 = *(ptr + 74);
packet.Unknown9 = *((uint*)(ptr + 75));
packet.Unknown10 = *((uint*)(ptr + 79));
packet.Unknown11 = *((uint*)(ptr + 83));
packet.Unknown87 = *((ushort*)(ptr + 87));
packet.Title = *((PlayerTitle*)(ptr + 89));
packet.Unknown90 = *(ptr + 90);
packet.Unknown91 = *((uint*)(ptr + 91));
packet.Unknown95 = *((uint*)(ptr + 95));
packet.Unknown99 = *((uint*)(ptr + 99));
packet.Unknown103 = *((uint*)(ptr + 103));
packet.Unknown107 = *(ptr + 107);
packet.StringPacker = new NetStringPacker(ptr + 108);
return packet;
}
public static implicit operator byte[](PlayerInfoPacket packet)
{//108
var buffer = new byte[112 + packet.StringPacker.Length + 8];
fixed (byte* ptr = buffer)
{
PacketBuilder.AppendHeader(ptr, buffer.Length, 1006);
*((uint*)(ptr + 4)) = packet.Id;
//new ushort for what?
*((uint*)(ptr + 10)) = packet.Lookface;
*((ushort*)(ptr + 14)) = packet.Hair;
*((uint*)(ptr + 16)) = packet.Money;
*((uint*)(ptr + 20)) = packet.EMoney;
*((ulong*)(ptr + 24)) = packet.Experience;
*((uint*)(ptr + 32)) = packet.Unknown1;
*((uint*)(ptr + 36)) = packet.Unknown2;
*((uint*)(ptr + 40)) = packet.Unknown3;
*((uint*)(ptr + 44)) = packet.Unknown4;
*((uint*)(ptr + 48)) = packet.Unknown5;
*((ushort*)(ptr + 52)) = packet.Strength;
*((ushort*)(ptr + 54)) = packet.Agility;
*((ushort*)(ptr + 56)) = packet.Vitality;
*((ushort*)(ptr + 58)) = packet.Spirit;
*((ushort*)(ptr + 60)) = packet.AdditionalPoint;
*((ushort*)(ptr + 62)) = packet.Life;
*((ushort*)(ptr + 64)) = packet.Mana;
*((short*)(ptr + 66)) = packet.Pk;
*(ptr + 68) = packet.Level;
*(ptr + 69) = packet.Profession;
*(ptr + 70) = packet.OriProfession;
*(ptr + 71) = packet.SecProfession;
*(ptr + 72) = packet.Unknown7;
*(ptr + 73) = packet.Metempsychosis;
*(ptr + 74) = packet.NamesDisplayed;
*(ptr + 75) = packet.Unknown18;
*(ptr + 76) = packet.Unknown19;
*((uint*)(ptr + 77)) = packet.Unknown9;
*((uint*)(ptr + 81)) = packet.Unknown10;
*((uint*)(ptr + 85)) = packet.Unknown11;
*((ushort*)(ptr + 89)) = packet.Unknown87;
*((PlayerTitle*)(ptr + 91)) = packet.Title;
*(ptr + 92) = packet.Unknown90;
*((uint*)(ptr + 93)) = packet.Unknown91;
*((uint*)(ptr + 97)) = packet.Unknown95;
*((uint*)(ptr + 101)) = packet.Unknown99;
*((uint*)(ptr + 105)) = packet.Unknown103;
*(ptr + 109) = packet.Unknown107;
PacketBuilder.AppendNetStringPacker(ptr + 110, packet.StringPacker);
}
return buffer;
}
public override string ToString()
{
var builder = new StringBuilder();
builder.AppendFormat("{0} {1} {2} {3} {4} {5}\r\n", Id, Lookface, Hair, Money, EMoney, Experience);
builder.AppendFormat("{0} {1} {2} {3} {4}\r\n", Unknown1, Unknown2, Unknown3, Unknown4, Unknown5);
builder.AppendFormat("{0} {1} {2} {3} {4} {5} {6} {7}\r\n", Strength, Agility, Vitality, Spirit, AdditionalPoint, Life, Mana, Pk);
builder.AppendFormat("{0} {1} {2} {3} {4} {5} {6} {7} {8}\r\n", Level, Profession, OriProfession, SecProfession, Unknown7, Metempsychosis, NamesDisplayed, Unknown18, Unknown19);
builder.AppendFormat("{0} {1} {2} {3} {4} {5} {6} {7} {8}\r\n", Unknown9, Unknown10, Unknown11, Unknown87, Unknown91, Unknown95, Unknown99, Unknown103, Unknown107);
for (byte i = 0; i < StringPacker.Count; i++)
{
string str;
if (StringPacker.GetString(i, out str))
{
builder.AppendLine(string.IsNullOrEmpty(str) ? "null" : str);
}
}
return builder.ToString();
}
}
}
Player.cs
Code:
public byte OriProfession
{
get { return _oriprof; }
set { _oriprof = value; }
}
public byte SecProfession
{
get { return _secprof; }
set { _secprof = value; }
}
SpawnPlayer packet
Code:
using Albetros.Core.Enum;
namespace Albetros.Game.Packet
{
/*
* 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
* _______________________________________________
* 00 | dc 00 1e 27 21 4c 2a 00 32 80 2f 00 76 31 00 00 ...'!L*.2./.v1..
* 10 | c8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
* 20 | 00 00 06 00 04 00 4d c9 01 00 0f d0 02 00 84 13 ......M.........
* 30 | 02 00 a1 4f 09 00 a1 4f 09 00 4d 7e 05 00 60 7e ...O...O..M~..`~
* 40 | 05 00 e0 93 04 00 00 00 00 00 00 00 00 00 d1 01 ................
* 50 | a6 01 77 01 06 fa 00 00 00 00 00 00 01 70 00 00 ..w..........p..
* 60 | 00 00 00 00 00 00 00 00 00 00 00 00 00 d6 ac f0 ................
* 70 | 01 00 00 00 00 04 00 00 00 03 00 49 01 00 00 06 ...........I....
* 80 | 00 2e 03 00 00 ad 2e 84 00 64 00 00 00 13 00 44 .........d.....D
* 90 | 0c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
* a0 | 00 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
* b0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
* c0 | 00 00 00 00 00 00 00 00 00 87 00 00 00 41 00 00 .............A..
* d0 | 00 00 00 03 05 7e 43 70 53 7e 00 00 54 51 53 65 .....~CpS~..TQSe
* | 72 76 65 72 rver
*
* offset | desc
* 4 lookface
* 8 id
* 12 guild id
* 14 guild rank
* 22 effect1
* 30 effect2
* 38 helmet type
* 42 garment type
* 46 armor type
* 50 weaponr type
* 54 weaponl type
* 58 accessory type
* 62 accessory type
* 66 mount type
* 74 life (monster)
* 78 hair
* 80 position x
* 82 position y
* 84 direction
* 85 action
* 92 rebirth
* 93 level
* 117 armor color
* 119 shield color
* 121 helmet color
* 123 quiz points
* 161 title
* 176 helmet artifact id
* 180 armor artifact id
* 184 weaponr artifact id
* 188 weaponl artifact id
* 205 profession
* 212 string list
*/
public unsafe struct SpawnPlayerPacket
{
public uint Lookface;
public uint Id;
public uint GuildId;
public GuildRank GuildRank;
public uint Unknown18;
public ulong Effect1;
public ulong Effect2;
public uint HelmetType;
public uint GarmentType;
public uint CropType;
public uint ArmorType;
public uint WeaponLType;
public uint WeaponRType;
public uint AccessoryRType;
public uint AccessoryLType;
public uint MountType;
public uint Unknown70;
public uint MountArmor;
public ushort Life;
public ushort MobLevel;
public ushort Hair;
public ushort PositionX;
public ushort PositionY;
public byte Direction;
public byte Action;
public ushort Unknown86;
public uint Unknown88;
public byte Rebirth;
public ushort Level;
public byte Unknown95;
public uint Away;
public NobilityType Nobility;
public uint Unknown100;
public uint Unknown104;
public uint Unknown108;
public uint Unknown112;
public byte Unknown116;
public ushort ArmorColor;
public ushort ShieldColor;
public ushort HelmetColor;
public uint MountColor;
public byte MountPlus;
public uint QuizPoints;
public ushort Unknown127;
public uint Unknown129;
public uint Unknown133;
public uint Unknown137;
public ushort Unknown141;
public ushort Unknown143;
public bool Boss;
public PlayerTitle Title;
public uint HelmetArtifactType;
public uint ArmorArtifactType;
public uint WeaponRArtifactType;
public uint WeaponLArtifactType;
public byte Profession;
public byte OriProfession;
public byte SecProfession;
public NetStringPacker Strings;
public static SpawnPlayerPacket Create(Monster entity)
{
var packet = new SpawnPlayerPacket();
packet.Strings = new NetStringPacker();
packet.Lookface = entity.BaseMonster.Mesh;
packet.Id = entity.UID;
packet.PositionX = entity.X;
packet.PositionY = entity.Y;
packet.Boss = entity.Boss;
packet.Direction = entity.Direction;
packet.MobLevel = entity.BaseMonster.Level;
packet.Life = entity.Boss ? (ushort)((long)entity.Health * 10000 / entity.MaxHealth) :(ushort) entity.Health;
packet.Effect1 = entity._stateff1;
packet.Strings.AddString(entity.BaseMonster.Name);
packet.Strings.AddString(string.Empty);
packet.Strings.AddString(string.Empty);
return packet;
}
public static SpawnPlayerPacket Create(AI entity)
{
var packet = new SpawnPlayerPacket();
packet.Lookface = entity.Mesh;
packet.Id = entity.UID;
packet.Effect1 = entity.StatusEffect1;
packet.Effect2 = entity.StatusEffect2;
if (entity.HeadGear != null)
{
packet.HelmetType = entity.HeadGear.StaticID;
packet.HelmetColor = entity.HeadGear.Color;
if (entity.HeadGear.ArtifactData != null)
packet.HelmetArtifactType = entity.HeadGear.ArtifactData.ArtifactID;
}
if (entity.Armor != null)
{
packet.ArmorType = entity.Armor.StaticID;
packet.ArmorColor = entity.Armor.Color;
if (entity.Armor.ArtifactData != null)
packet.ArmorArtifactType = entity.Armor.ArtifactData.ArtifactID;
}
if (entity.WeaponL != null)
{
packet.WeaponLType = entity.WeaponL.StaticID;
packet.ShieldColor = entity.WeaponL.Color;
if (entity.WeaponL.ArtifactData != null)
packet.WeaponLArtifactType = entity.WeaponL.ArtifactData.ArtifactID;
}
if (entity.WeaponR != null)
{
packet.WeaponRType = entity.WeaponR.StaticID;
if (entity.WeaponR.ArtifactData != null)
packet.WeaponRArtifactType = entity.WeaponR.ArtifactData.ArtifactID;
}
if (entity.Garment != null)
{
packet.GarmentType = entity.Garment.StaticID;
}
if (entity.Mount != null)
{
packet.MountType = entity.Mount.StaticID;
packet.MountColor = entity.Mount.SocketProgress;
packet.MountPlus = entity.Mount.Plus;
if (entity.SteedArmor != null)
packet.MountArmor = entity.SteedArmor.StaticID;
}
packet.Life = (ushort)entity.Health;
packet.Hair = entity.Hair;
packet.PositionX = entity.X;
packet.PositionY = entity.Y;
packet.Direction = entity.Direction;
packet.Action = (byte)entity.Action;
packet.Rebirth = entity.Reborn;
packet.Level = entity.Level;
packet.Away = entity.Away ? 1u : 0u;
packet.QuizPoints = entity.QuizPoints;
packet.Title = entity.Title;
packet.Strings = new NetStringPacker();
packet.Strings.AddString(entity.Name);
packet.Strings.AddString(string.Empty);
packet.Strings.AddString(string.Empty);
return packet;
}
public static SpawnPlayerPacket Create(Player entity)
{
var packet = new SpawnPlayerPacket();
packet.Lookface = entity.Mesh;
packet.Id = entity.UID;
packet.Profession = entity.Profession;
packet.OriProfession = entity.OriProfession;
packet.SecProfession = entity.SecProfession;
packet.GuildId = entity.GuildId;
packet.Nobility = entity.Nobility;
packet.GuildRank = entity.GuildRank;
packet.Effect1 = entity.StatusEffect1;
packet.Effect2 = entity.StatusEffect2;
if (entity.Equipment.Headgear != null)
{
packet.HelmetType = entity.Equipment.Headgear.StaticID;
packet.HelmetColor = entity.Equipment.Headgear.Color;
if (entity.Equipment.Headgear.ArtifactData != null)
packet.HelmetArtifactType = entity.Equipment.Headgear.ArtifactData.ArtifactID;
}
if (entity.Equipment.Armor != null)
{
packet.ArmorType = entity.Equipment.Armor.StaticID;
packet.ArmorColor = entity.Equipment.Armor.Color;
if (entity.Equipment.Armor.ArtifactData != null)
packet.ArmorArtifactType = entity.Equipment.Armor.ArtifactData.ArtifactID;
}
if (entity.Equipment.WeaponL != null)
{
packet.WeaponLType = entity.Equipment.WeaponL.StaticID;
packet.ShieldColor = entity.Equipment.WeaponL.Color;
if (entity.Equipment.WeaponL.ArtifactData != null)
packet.WeaponLArtifactType = entity.Equipment.WeaponL.ArtifactData.ArtifactID;
if (entity.Equipment.AccessoryL != null)
packet.AccessoryLType = entity.Equipment.AccessoryL.StaticID;
}
if (entity.Equipment.WeaponR != null)
{
packet.WeaponRType = entity.Equipment.WeaponR.StaticID;
if (entity.Equipment.WeaponR.ArtifactData != null)
packet.WeaponRArtifactType = entity.Equipment.WeaponR.ArtifactData.ArtifactID;
if (entity.Equipment.AccessoryR != null)
packet.AccessoryRType = entity.Equipment.AccessoryR.StaticID;
}
if (entity._disguiseGarment != null)
packet.GarmentType = entity._disguiseGarment.StaticID;
else if (entity.Equipment.Garment != null)
packet.GarmentType = entity.Equipment.Garment.StaticID;
if (entity.Equipment.Steed != null)
{
packet.MountType = entity.Equipment.Steed.StaticID;
packet.MountColor = entity.Equipment.Steed.SocketProgress;
packet.MountPlus = entity.Equipment.Steed.Plus;
if (entity.Equipment.SteedArmor != null)
packet.MountArmor = entity.Equipment.SteedArmor.StaticID;
}
packet.Life = (ushort)entity.Health;
packet.Hair = entity.Hair;
packet.PositionX = entity.X;
packet.PositionY = entity.Y;
packet.Direction = entity.Direction;
packet.Action = (byte)entity.Action;
packet.Rebirth = entity.Reborn;
packet.Level = entity.Level;
packet.Away = entity.Away ? 1u : 0u;
packet.QuizPoints = entity.QuizPoints;
packet.Title = entity.Title;
packet.Strings = new NetStringPacker();
packet.Strings.AddString(entity.Name);
packet.Strings.AddString(string.Empty);
packet.Strings.AddString(string.Empty);
return packet;
}
public static implicit operator byte[](SpawnPlayerPacket packet)
{//216
var buffer = new byte[220 + packet.Strings.Length + 8];
fixed (byte* ptr = buffer)
{
PacketBuilder.AppendHeader(ptr, buffer.Length, 10014);
*((uint*) (ptr + 4)) = packet.Lookface;
*((uint*) (ptr + 8)) = packet.Id;
*((uint*) (ptr + 12)) = packet.GuildId;
*((GuildRank*) (ptr + 16)) = packet.GuildRank;
*((uint*) (ptr + 18)) = packet.Unknown18;
*((ulong*) (ptr + 22)) = packet.Effect1;
*((ulong*) (ptr + 30)) = packet.Effect2;
//all up 2
*((uint*)(ptr + 40)) = packet.HelmetType;
*((uint*)(ptr + 44)) = packet.GarmentType;
*((uint*) (ptr + 48)) = packet.ArmorType;
*((uint*) (ptr + 52)) = packet.WeaponLType;
*((uint*) (ptr + 56)) = packet.WeaponRType;
*((uint*) (ptr + 60)) = packet.AccessoryRType;
*((uint*) (ptr + 64)) = packet.AccessoryLType;
*((uint*) (ptr + 68)) = packet.MountType;
*((uint*)(ptr + 72)) = packet.MountArmor;
*((uint*)(ptr + 76)) = packet.Unknown70;
*((ushort*)(ptr + 80)) = packet.Life;
*((ushort*)(ptr + 82)) = packet.MobLevel;
*((ushort*)(ptr + 84)) = packet.Hair;
*((ushort*)(ptr + 86)) = packet.PositionX;
*((ushort*)(ptr + 88)) = packet.PositionY;
*(ptr + 90) = packet.Direction;
*(ptr + 91) = packet.Action;
*((ushort*) (ptr + 92)) = packet.Unknown86;
*((uint*) (ptr + 94)) = packet.Unknown88;
*(ptr + 98) = packet.Rebirth;
*((ushort*) (ptr + 99)) = packet.Level;
*((uint*)(ptr + 102)) = packet.Away;
*(ptr + 119) = (byte) packet.Nobility;
*((ushort*)(ptr + 123)) = packet.ArmorColor;
*((ushort*)(ptr + 125)) = packet.ShieldColor;
*((ushort*)(ptr + 127)) = packet.HelmetColor;
*((byte*)(ptr + 133)) = packet.MountPlus;
*((uint*)(ptr + 139)) = packet.MountColor;
*((PlayerTitle*)(ptr + 167)) = packet.Title;
if (packet.Boss)
*((byte*)(ptr + 181)) = 1;
*((uint*)(ptr + 182)) = packet.HelmetArtifactType;
*((uint*)(ptr + 186)) = packet.ArmorArtifactType;
*((uint*)(ptr + 190)) = packet.WeaponLArtifactType;
*((uint*)(ptr + 194)) = packet.WeaponRArtifactType;
*((byte*)(ptr + 207)) = packet.OriProfession;
*((byte*)(ptr + 209)) = packet.SecProfession;
*((byte*)(ptr + 211)) = packet.Profession;
PacketBuilder.AppendNetStringPacker(ptr + 218, packet.Strings);
}
return buffer;
}
}
}
Database -> Char loading
Code:
public static bool PullLogin(Player user)
{
MySqlCommand command = new MySqlCommand(MySqlCommandType.SELECT);
command.Select("Characters").Where("UID", user.UID);
MySqlReader reader = new MySqlReader(command);
if (reader.Read())
{
user.Spouse = reader.ReadString("Spouse");
user.Name = reader.ReadString("Name");
user.Experience = reader.ReadUInt64("Experience");
user.Profession = reader.ReadByte("Profession1");
user.OriProfession = reader.ReadByte("Profession2");
user.SecProfession = reader.ReadByte("Profession3");
user.Reborn = reader.ReadByte("Reborns");
user.Level = reader.ReadByte("Level");
user.Strength = reader.ReadUInt16("Strength");
user.Agility = reader.ReadUInt16("Agility");
user.Vitality = reader.ReadUInt16("Vitality");
user.Spirit = reader.ReadUInt16("Spirit");
user.StatPoint = reader.ReadUInt16("StatPoints");
user.Health = reader.ReadUInt16("Health");
user.Mana = reader.ReadUInt16("Mana");
Enum.TryParse(reader.ReadString("Language"), out user.Lang);
user.MapID = reader.ReadUInt32("Map");
user.PreviousMap = reader.ReadUInt32("PreviousMap");
user.X = reader.ReadUInt16("X");
user.Y = reader.ReadUInt16("Y");
user.Money = reader.ReadUInt32("Money");
user.WarehouseMoney = reader.ReadUInt32("WhMoney");
user.CP = reader.ReadUInt32("Cp");
user.VirtuePoints = reader.ReadUInt32("VirtuePoints");
user.Body = reader.ReadUInt16("Mesh");
user.Face = reader.ReadUInt16("Avatar");
user.Hair = reader.ReadUInt16("Hair");
user.Title = (PlayerTitle) reader.ReadByte("Title");
user.LastPatch = reader.ReadUInt16("LastPatch");
user.NobilityDonation = reader.ReadInt64("Donation");
try
{
user.ExpBoostEnds = DateTime.Parse(reader.ReadString("ExpTimeExpires"));
user.LuckyTimeEnds = DateTime.Parse(reader.ReadString("LuckyTimeExpires"));
user.BlessingEnds = DateTime.Parse(reader.ReadString("HeavenBlessExpires"));
}
catch { }
PullArenaStatistics(user);
}
return !string.IsNullOrEmpty(user.Name);
}
Database -> save character
Code:
{
MySqlCommand command = new MySqlCommand(MySqlCommandType.UPDATE);
command.Update("Characters")
.Set("X", player.X)
.Set("Y", player.Y)
.Set("Map", player.MapID)
.Set("Profession1", player.Profession)
.Set("Profession2", player.OriProfession)
.Set("Profession3", player.SecProfession)
.Set("Level", player.Level)
.Set("Health", player.Health)
.Set("Mana", player.Mana)
.Set("Strength", player.Strength)
.Set("StatPoints", player.StatPoint)
.Set("Agility", player.Agility)
.Set("Spirit", player.Spirit)
.Set("Vitality", player.Vitality)
.Set("Mesh", player.Body)
.Set("Avatar", player.Face)
.Set("Hair", player.Hair)
.Set("Name", player.Name)
.Set("Money", player.Money)
.Set("Experience", player.Experience)
.Set("Cp", player.CP)
.Set("Title", (byte)player.Title)
.Where("UID", player.UID)
.Execute();
}
Then you need to change the characters table and add fields for Profession2 and Profession3.
And Pro, any help with my empty buffer problem?
Sorry to get that back from a long time ago. But I got some weird problems with it.
And I don't know where to put the last 2 either.
//Edit. Got rid of 5 error's, but know I got an Unreachable code detected from: user.Send(PlayerInfoPacket.Create(user));
Don't know what is wrong with that?
Changed the second reborn in the source database so the newly created char wouldn't become second reborn in the database. Changed it to 0 and then rebuild it, but after that. Still the same problem.
05/06/2012, 21:04
#2
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,383
No offense but if you're not sure where to place this then how do you expect to code the rest of the reborn system?
This is not a full reborn system, it just displays the number of times you've been reborned. I suggest you take some time to learn some basic C#. Read an ebook or two and write some small coding projects to get comfortable using the language.
Once that's done you can come back and worry about editing albetros. Without a decent knowledge of programming, the source will be basically useless to you as you won't be able to fix/add any of the missing features.
05/06/2012, 21:50
#3
elite*gold: 0
Join Date: Mar 2009
Posts: 67
Received Thanks: 3
Quote:
Originally Posted by
pro4never
No offense but if you're not sure where to place this then how do you expect to code the rest of the reborn system?
This is not a full reborn system, it just displays the number of times you've been reborned. I suggest you take some time to learn some basic C#. Read an ebook or two and write some small coding projects to get comfortable using the language.
Once that's done you can come back and worry about editing albetros. Without a decent knowledge of programming, the source will be basically useless to you as you won't be able to fix/add any of the missing features.
I know,
I toke a second look at it. I had done this a few months ago. But that's not it, I know how to code. But it didn't showed me that I was second reborn in client.
05/06/2012, 21:54
#4
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,383
Well with any errors you cannot compile the source meaning none of the changes you made had any effect on the .exe files...
The errors are really simple. You're never defining variables
05/07/2012, 19:35
#5
elite*gold: 0
Join Date: Mar 2009
Posts: 67
Received Thanks: 3
Quote:
Originally Posted by
pro4never
Well with any errors you cannot compile the source meaning none of the changes you made had any effect on the .exe files...
The errors are really simple. You're never defining variables
Thanks for help, ran a second look on it and I made an bad mistake on the first packet you'd gave. Saved it on a wrong .cs and closed it afterwards. Not quit genius, so I re-downloaded the source and did it good then.
Now I've got a problem with the DropRule and added also a Drop_itemtype one. I made one and I putted it on a mob. Restarted server and Client. But the mob doesn't seem to get the droprule or it is just not dropping it. I had killed 200 of those and still nothing.
I need it for the Thieves, so I can make one quest complete. I also made the droprate 9999999. But then still nothing.
05/07/2012, 19:48
#6
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
Quote:
Originally Posted by
warzie005
Thanks for help, ran a second look on it and I made an bad mistake on the first packet you'd gave. Saved it on a wrong .cs and closed it afterwards. Not quit genius, so I re-downloaded the source and did it good then.
Now I've got a problem with the DropRule and added also a Drop_itemtype one. I made one and I putted it on a mob. Restarted server and Client. But the mob doesn't seem to get the droprule or it is just not dropping it. I had killed 200 of those and still nothing.
I need it for the Thieves, so I can make one quest complete. I also made the droprate 9999999. But then still nothing.
I'm pretty sure that pro said that it was an unfinished feature.
05/07/2012, 20:08
#7
elite*gold: 0
Join Date: Mar 2009
Posts: 67
Received Thanks: 3
Quote:
Originally Posted by
Kiyono
I'm pretty sure that pro said that it was an unfinished feature.
Sorry Kiyono,
Didn't looked through the whole guide. Only looked for the source and the things I needed. I shall look through everything. But thanks anyway.
Similar Threads
Hellmouth source Help
10/03/2011 - CO2 Private Server - 6 Replies
As a request from fang, opening a new topic about this in the right forum.
Ok, first off i'll apologize if i annoy anyone for posting this, but i have quite literally been searching every topic on this site for hours looking for a answer.
I installed my Client, patched it to 5355 like im suppose to, changed the settings.ini in bin/debug to my hamachi ip, database 5310, did the same for loaderset.
I open hellmouth, i get this:
Global Damage reduction: '0.8'
Help me IN HellMouth Source
07/21/2011 - CO2 Private Server - 10 Replies
i did every thing changed ip like hamachi ip but and open hellmouth to open my server but i got one problem and it's
YouTube - Rec#04
Help in the hellmouth source
03/20/2011 - CO2 Private Server - 0 Replies
Need a of codes for itens Souls :o
New Npc for HellMouth source
03/08/2011 - CO2 PServer Guides & Releases - 3 Replies
Closed #
All times are GMT +2. The time now is 22:38 .