Item Lock hhhh

09/17/2010 08:56 Ian*#1
You ppl need to be careful with pastebin code.

FULLY WORK!!!
FULLY WORK!!!
FULLY WORK!!!
FULLY WORK!!!
FULLY WORK!!!

Quote:
This is my Item Lock that NOONE has, so don't release it.

Search for:
public void Send(Main.GameClient GC, bool Stats)

Replace the whole void with:

public void Send(Main.GameClient GC, bool Stats)
{
if (HeadGear.ID != 0) GC.AddSend(Packets.AddItem(HeadGear, 1));
if (Necklace.ID != 0) GC.AddSend(Packets.AddItem(Necklace, 2));
if (Armor.ID != 0) GC.AddSend(Packets.AddItem(Armor, 3));
if (RightHand.ID != 0) GC.AddSend(Packets.AddItem(RightHand, 4));
if (LeftHand.ID != 0) GC.AddSend(Packets.AddItem(LeftHand, 5));
if (Ring.ID != 0) GC.AddSend(Packets.AddItem(Ring, 6));
if (Gourd.ID != 0) GC.AddSend(Packets.AddItem(Gourd, 7));
if (Boots.ID != 0) GC.AddSend(Packets.AddItem(Boots, 8));
if (Garment.ID != 0) GC.AddSend(Packets.AddItem(Garment, 9));
if (Fan.ID != 0) GC.AddSend(Packets.AddItem(Fan, 10));
if (Tower.ID != 0) GC.AddSend(Packets.AddItem(Tower, 11));
if (Steed.ID != 0) GC.AddSend(Packets.AddItem(Steed, 12));

if (HeadGear.ID != 0 && HeadGear.Locked == 2)
GC.AddSend(Packets.ItemLock(HeadGear.UID, 1, 2, HeadGear.LockedDays));
if (Necklace.ID != 0 && Necklace.Locked == 2)
GC.AddSend(Packets.ItemLock(Necklace.UID, 1, 2, Necklace.LockedDays));
if (Armor.ID != 0 && Armor.Locked == 2)
GC.AddSend(Packets.ItemLock(Armor.UID, 1, 2, Armor.LockedDays));
if (RightHand.ID != 0 && RightHand.Locked == 2)
GC.AddSend(Packets.ItemLock(RightHand.UID, 1, 2, RightHand.LockedDays));
if (LeftHand.ID != 0 && LeftHand.Locked == 2)
GC.AddSend(Packets.ItemLock(LeftHand.UID, 1, 2, LeftHand.LockedDays));
if (Ring.ID != 0 && Ring.Locked == 2)
GC.AddSend(Packets.ItemLock(Ring.UID, 1, 2, Ring.LockedDays));
if (Gourd.ID != 0 && Gourd.Locked == 2)
GC.AddSend(Packets.ItemLock(Gourd.UID, 1, 2, Gourd.LockedDays));
if (Boots.ID != 0 && Boots.Locked == 2)
GC.AddSend(Packets.ItemLock(Boots.UID, 1, 2, Boots.LockedDays));
if (Garment.ID != 0 && Garment.Locked == 2)
GC.AddSend(Packets.ItemLock(Garment.UID, 1, 2, Garment.LockedDays));
if (Fan.ID != 0 && Fan.Locked == 2)
GC.AddSend(Packets.ItemLock(Fan.UID, 1, 2, Fan.LockedDays));
if (Tower.ID != 0 && Tower.Locked == 2)
GC.AddSend(Packets.ItemLock(Tower.UID, 1, 2, Tower.LockedDays));
if (Steed.ID != 0 && Steed.Locked == 2)
GC.AddSend(Packets.ItemLock(Steed.UID, 1, 2, Steed.LockedDays));

if (Stats)
{
GC.MyChar.EquipStats(1, true);
GC.MyChar.EquipStats(2, true);
GC.MyChar.EquipStats(3, true);
GC.MyChar.EquipStats(4, true);
GC.MyChar.EquipStats(5, true);
GC.MyChar.EquipStats(6, true);
GC.MyChar.EquipStats(7, true);
GC.MyChar.EquipStats(8, true);
GC.MyChar.EquipStats(9, true);
GC.MyChar.EquipStats(10, true);
GC.MyChar.EquipStats(11, true);
GC.MyChar.EquipStats(12, true);
GC.MyChar.LoadedEquipmentHPAdd = true;
}
}

Search for:
public bool locked;

Replace that with:
public byte Locked;
public uint LockedDays;

Search for:
public static COPacket Movement(uint UID, byte Dir)
{
byte[] Packet = new byte[8 + 16];
COPacket P = new COPacket(Packet);

P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)10005);
P.WriteInt32((byte)(Dir + 8 * Program.Rnd.Next(7)));
P.WriteInt32(UID);
P.WriteInt32((uint)Environment.TickCount);

return P;
}

Above that add:
public static COPacket ItemLock(uint ItemID, byte Value1, byte Value2, uint Value3)
{
byte[] Packet = new byte[8 + 16];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)2048);
P.WriteInt32(ItemID);
P.WriteByte(Value1);
P.WriteByte(Value2);
P.WriteInt32(Value3);
return P;
}
Search for:
case 2064:

Above that add:
case 2048:
{
uint UID;
fixed (byte* p = Data)
UID = *((uint*)(p + 4));
switch (Data[8])
{
case 0:
{
Item I = GC.MyChar.FindInvItem(UID);
if (I.ID != 0)
{
if (I.Locked != 1)
{
GC.MyChar.Inventory.Remove(I);
I.Locked = 1;
GC.AddSend(Packets.ItemLock(UID, 1, I.Locked, I.LockedDays));
GC.MyChar.Inventory.Add(I);
}
else
GC.LocalMessage(2005, "The item is already locked.");
}
break;
}
case 1:
{
Item I = GC.MyChar.FindInvItem(UID);
if (I.ID != 0)
{
if (I.Locked == 1)
{
GC.MyChar.Inventory.Remove(I);
DateTime datetounlock = DateTime.Now;
datetounlock = datetounlock.AddDays(7);
I.LockedDays = Convert.ToUInt32(datetounlock.ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture) );
I.Locked = 2;
GC.AddSend(Packets.ItemLock(UID, 1, I.Locked, I.LockedDays));
GC.MyChar.Inventory.Add(I);
}
}
break;
}
}
break;
}

Last, replace your whole Teleport.cs with this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NewestCOServer.PacketHandling
{
public class Teleport
{
public static void Handle(Main.GameClient GC, byte[] Data)
{
if (!GC.LoginDataSent)
{

GC.AddSend(Packets.Packet1012Time(GC.MyChar.Entity ID));
GC.AddSend(Packets.GeneralData(GC.MyChar.Loc.Map, GC.MyChar.Loc.Map, GC.MyChar.Loc.X, GC.MyChar.Loc.Y, 0x4a));
GC.AddSend(Packets.GeneralData(GC.MyChar.EntityID, 0xffffffff, GC.MyChar.Loc.X, GC.MyChar.Loc.Y, 0x68));
if (GC.MyChar.Loc.Map == 1036)
GC.AddSend(Packets.MapStatus(GC.MyChar.Loc.Map, 30));
else
GC.AddSend(Packets.MapStatus(GC.MyChar.Loc.Map, 32));
foreach (Game.Item I in GC.MyChar.Inventory)
{
GC.AddSend(Packets.AddItem(I, 0));
if (I.Locked == 2)
GC.AddSend(Packets.ItemLock(I.UID, 1, 2, I.LockedDays));
}
GC.MyChar.Equips.Send(GC, true);

foreach (Game.Prof P in GC.MyChar.Profs.Values)
GC.AddSend(Packets.Prof(P));
foreach (Game.Skill S in GC.MyChar.Skills.Values)
GC.AddSend(Packets.Skill(S));
if (GC.MyChar.MyGuild != null)
{
GC.AddSend(Packets.GuildInfo(GC.MyChar.MyGuild, GC.MyChar));
GC.AddSend(Packets.String(GC.MyChar.MyGuild.GuildI D, (byte)Game.StringType.GuildName, GC.MyChar.MyGuild.GuildName));
}
foreach (Features.Guild G in Features.Guilds.AllTheGuilds.Values)
GC.AddSend(Packets.String(G.GuildID, (byte)Game.StringType.GuildName, G.GuildName));
GC.MyChar.PKPoints = GC.MyChar.PKPoints;
GC.MyChar.Nobility.Rank = GC.MyChar.Nobility.Rank;

GC.LocalMessage(2000, "Welcome to NewestCOServer");
GC.LocalMessage(2000, "Enjoy.");
if (Game.World.KOBoard[0].Name == GC.MyChar.Name)
GC.LocalMessage(2000, "You are the 1st place on the KO board, you gain 2 times more exp than others.");
if (Game.World.CurrentBC.Message != null)
GC.AddSend(Packets.ChatMessage(GC.MessageID, Game.World.CurrentBC.Name, "ALL", Game.World.CurrentBC.Message, 2500, 0));
}
}
}
}

Done.

Remember, do not release this.
[Only registered and activated users can see links. Click Here To Register...]

hhhhhhhhhhhhhhhhhhhhhhhhh

have fun
09/17/2010 09:00 _DreadNought_#2
That was justin's code afaik.
09/17/2010 09:22 -Fáng-#3
I have it.. lol
and mine's more efficient! :p
But lol at you finding that on pastebin xP
09/17/2010 09:22 dowhatuwant#4
olollollololololo Ian, u made me laugh serious ^^
09/17/2010 20:19 _DreadNought_#5
Quote:
Originally Posted by ImmuneOne View Post
I don't think anyone cares.

/brag.

What's so funny?


Hello?
Agreed. Just letting people know. Lub yoo <3
09/17/2010 22:14 Arcо#6
Give credits to he who found it!!!!
-Arco ;)
09/20/2010 07:35 salem rey#7
Is this really work? it will save ?
09/20/2010 07:54 Arcо#8
Yup yup.
09/20/2010 12:02 alaa410#9
can you make Item Lock to my in my computer by teamviewer
09/20/2010 16:39 CØĐ£Ř||Mã©hÍñє#10
great keep going xD
09/20/2010 19:19 ZeRo-ToLeRaNcE#11
i have add this guide and all is going good i think but i have an error, because it was an bool and now an byte. in packets.cs for example:

Code:
public static COPacket AddItem(Game.Item I, byte Pos)
        {
            byte[] Packet = new byte[8 + 48];
            COPacket P = new COPacket(Packet);
            try
            {
                P.WriteInt16((ushort)(Packet.Length - 8));
                P.WriteInt16((ushort)0x3f0);
                P.WriteInt32(I.UID);
                P.WriteInt32(I.ID);
                P.WriteInt16(I.CurDur);
                P.WriteInt16(I.MaxDur);
                P.WriteInt16(1);
                P.WriteInt16(Pos);
                P.WriteInt32(I.TalismanProgress);
                P.WriteByte((byte)I.Soc1);
                P.WriteByte((byte)I.Soc2);
                P.WriteInt16((ushort)I.Effect);
                P.WriteByte(I.Plus);
                P.WriteByte(I.Bless);
                if (I.FreeItem)
                    P.WriteByte(1);
                else
                    P.WriteByte(0);
                P.WriteByte(I.Enchant);
                P.Move(6);
                [COLOR="Red"]if (I.Locked)[/COLOR]
                  P.WriteInt16(3);
                else P.WriteInt16(0);
                if (I.Color == 0)
                    I.Color = (Game.Item.ArmorColor)new Random().Next(1, 9);
                P.WriteInt32((uint)I.Color);
                P.WriteInt32(I.Progress);
            }
            catch (Exception Exc) { Program.WriteLine(Exc); }
            return P;
        }
i think it has to be someting like : if (I.Locked == 1)

because i see he write an 1 for false and 2 for true if i have right.
but what i try to do in the packets, in the game it is going wrong if i want to lock it. it lock the item then he tell me to unlock and it is still unlocked etc.

and after an relog all settings are gone.

HELP HELP
09/20/2010 20:36 peterpiper99#12
It's pretty shitty he released this.
09/20/2010 21:18 _DreadNought_#13
Not really. It's a lesson to pastbiner's
09/20/2010 22:23 peterpiper99#14
He has no respect, he's a idiot.
09/20/2010 22:59 Fish*#15
Quote:
Originally Posted by peterpiper99 View Post
He has no respect, he's a idiot.
or maybe the one who gave him it is an idiot