[Release]How to create CPBags (LOFT Source!!)

02/13/2010 13:33 irritantgassie#1
I know the most people are still running loft source so here is the code

Search in Character.cs for:
Code:
else if (ItemParts[0] == "723723")
Add this code down there
Code:
                else if (ItemParts[0] == "729910")//CPMiniBag
                {
                    CPs += 1000;
                    MyClient.SendPacket(General.MyPackets.Vital(UID, 3, CPs));
                    RemoveItem(ItemUID);
                    MyClient.SendPacket(General.MyPackets.SendMsg(MyClient.MessageId, "SYSTEM", Name, "You got 1000 cps from the CPMiniBag, This will not be showed go to market and u have them", 2005));
                }
                else if (ItemParts[0] == "729911")//CPBag
                {
                    CPs += 3000;
                    MyClient.SendPacket(General.MyPackets.Vital(UID, 3, CPs));
                    RemoveItem(ItemUID);
                    MyClient.SendPacket(General.MyPackets.SendMsg(MyClient.MessageId, "SYSTEM", Name, "You got 3000 cps from the CPBag, This will not be showed go to market and u have them", 2005));
                }
                else if (ItemParts[0] == "729912")//CPBackpack
                {
                    CPs += 5000;
                    MyClient.SendPacket(General.MyPackets.Vital(UID, 3, CPs));
                    RemoveItem(ItemUID);
                    MyClient.SendPacket(General.MyPackets.SendMsg(MyClient.MessageId, "SYSTEM", Name, "You got 5000 cps from the CPBackpack, This will not be showed go to market and u have them", 2005));
                }
To let the Pheasants drop this cpbag search in Entities.cs for:
Code:
if (Name != "SkyRockMonster" && Name != "SkyHawk" && Name != "SkyBandit" && Name != "SkyBull" && Name != "SkyDevil")
Replace it with:
Code:
if (Name != "Pheasant")
Down there u see this:
Code:
                    {
                        if (Other.ChanceSuccess(1))
                        {
                            string Item = "1060101-0-0-0-0-0";
                            DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                            World.ItemDrops(item);
                        }
                    }
                    if (Other.ChanceSuccess(1))
                    {
                        string Item = "1060100-0-0-0-0-0";
                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }
                    if (Other.ChanceSuccess(0))
                    {
                        string Item = "721533-0-0-0-0-0";
                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }
                    if (Other.ChanceSuccess(0))
                    {
                        string Item = "721536-0-0-0-0-0";
                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }
                    if (Other.ChanceSuccess(0))
                    {
                        string Item = "723038-0-0-0-0-0";
                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }
                    if (Other.ChanceSuccess(0))
                    {
                        string Item = "722019-0-0-0-0-0";
                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }
                    if (Other.ChanceSuccess(0))
                    {
                        string Item = "722312-0-0-0-0-0";
                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }
                    if (Other.ChanceSuccess(0))
                    {
                        string Item = "722313-0-0-0-0-0";
                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }
Replace that with:
Code:
                    {
                        if (Other.ChanceSuccess(90))
                        {
                            string Item = "729910-0-0-0-0-0";
                            DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                            World.ItemDrops(item);
                        }
                    }
                    if (Other.ChanceSuccess(80))
                    {
                        string Item = "729910-0-0-0-0-0";
                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }
                    if (Other.ChanceSuccess(70))
                    {
                        string Item = "729911-0-0-0-0-0";
                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }
                    if (Other.ChanceSuccess(0))
                    {
                        string Item = "729911-0-0-0-0-0";
                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }
                    if (Other.ChanceSuccess(0))
                    {
                        string Item = "729912-0-0-0-0-0";
                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }
                    if (Other.ChanceSuccess(0))
                    {
                        string Item = "729912-0-0-0-0-0";
                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }
                    if (Other.ChanceSuccess(0))
                    {
                        string Item = "729912-0-0-0-0-0";
                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }
                    if (Other.ChanceSuccess(0))
                    {
                        string Item = "729912-0-0-0-0-0";
                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }

Now we gonna make the item...

Go to your client map and extract the files (Found at the end of the post!!)
Now u have the pictures.
Now go to the map "ini" and search for itemtype.dat. Download the itemtype thing (at the end of the post), And create a txt file named itemtype.txt, then put above in the itemtype thing in itemtype.dat and down there itemtype.txt then puss "Do It".

Now open itemtype.txt and go down add these 3 lines:
Code:
729910 CPMiniBag 0 0 0 0 0 0 0 0 8 0 0 7403510 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 Giftbox Right~click~on~it~to~obtain~1000CP.
729911 CPBag 0 0 0 0 0 0 0 0 8 0 0 7403520 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 Giftbox Right~click~on~it~to~obtain~3000~CPs.
729912 CPBackpack 0 0 0 0 0 0 0 0 8 0 0 7403530 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 Giftbox Right~click~on~it~to~obtain~5000~CPs.
Go to your source folder to debug and open ItemNamesToId.ini with notepad and add these 3 lines:
Code:
CPMiniBag=729910
CPBag=729911
CPBackpack=729912
Now run the source, kill a Pheasant and they will drop a CPBackPack or CPBag or a CPMiniBag

If this tutorial helped you press thanks!!
02/13/2010 13:34 Korvacs#2
Moved.