[HELP]Composing.

12/07/2009 11:15 Arcо#1
Well as everybody had this problem when first using the 5165 source, players cannot make their gears any farther than +9.
I went through and tried so many things possible and came to 3 different outcomes.
1.The item would disappear.
I tweaked around with it then after that this result:
2.The item would not plus up, but the composition points would go retarded i.e. 26464/2700.
Tweaked around with it one more time then this:
3. Item would go to +12 but once you equipped it, it would go back to +9.

I tried so many things possible and now my last resort is to ask E*PvPers for help.
Anybody know a way to fix this.?
12/07/2009 12:18 Korvacs#2
With the code i probably could.
12/07/2009 12:20 Arcо#3
Quote:
Originally Posted by Korvacs View Post
With the code i probably could.

Well here's the entire Compose.cs.
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NewestCOServer.Game;

namespace NewestCOServer.PacketHandling
{
    public class Compose
    {
        public static void Handle(Main.GameClient GC, byte[] Data)
        {
            uint MainUID = BitConverter.ToUInt32(Data, 8);
            uint MinorUID1 = BitConverter.ToUInt32(Data, 12);

            Item MainI = GC.MyChar.FindInvItem(MainUID);
            Item MinorI = GC.MyChar.FindInvItem(MinorUID1);

            if (MainI.ID != 0 && MinorI.ID != 0 && MainI.Plus <= 12)
            {
                uint Progress = MainI.Progress;
                Progress += Database.StonePts[MinorI.Plus];

                GC.MyChar.RemoveItem(MainI);

                while (Progress >= Database.ComposePts[MainI.Plus] && MainI.Plus <= 12)
                {
                    Progress -= Database.ComposePts[MainI.Plus];
                    MainI.Plus++;
                }

                if (MainI.Plus == 12)
                    Progress = 0;
                MainI.Progress = (ushort)Progress;
                GC.MyChar.AddItem(MainI);
                GC.MyChar.RemoveItem(MinorI);
            }
        }
    
        static bool OfSameType(uint ID1, uint ID2)
        {
            ushort Part1 = (ushort)ItemIDManipulation.Part(ID1, 0, 3);
            ushort Part2 = (ushort)ItemIDManipulation.Part(ID2, 0, 3);

            if (ItemIDManipulation.Digit(ID1, 1) == ItemIDManipulation.Digit(ID2, 1) && (ItemIDManipulation.Digit(ID1, 1) == 4 || ItemIDManipulation.Digit(ID1, 1) == 5))
                return true;
            else if (Part1 == Part2)
                return true;
            else if (ItemIDManipulation.Digit(ID1, 5) == ItemIDManipulation.Digit(ID1, 3) && Part1 == 112)
                return true;
            else if (ItemIDManipulation.Digit(ID2, 5) == ItemIDManipulation.Digit(ID1, 3) && Part2 == 112)
                return true;
            else if (Part1 >= 135 && Part1 <= 139 && Part2 == Part1 - 5)
                return true;
            else if (Part2 >= 135 && Part2 <= 139 && Part1 == Part2 - 5)
                return true;
            return false;
        }
    }
}
Thanks for the help.
12/07/2009 12:51 Korvacs#4
Code:
            if (MainI.ID != 0 && MinorI.ID != 0 && MainI.Plus <= 12)
            {
                uint Progress = MainI.Progress;
                Progress += Database.StonePts[MinorI.Plus];

                GC.MyChar.RemoveItem(MainI);

                while (Progress >= Database.ComposePts[MainI.Plus] && MainI.Plus <= 12)
                {
                    MainI.Plus++;
                    if (Progress == Database.ComposePts[MainI.Plus])
                       break;
                }

                if (MainI.Plus == 12)
                    Progress = 0;
                MainI.Progress = (ushort)Progress;
                GC.MyChar.AddItem(MainI);
                GC.MyChar.RemoveItem(MinorI);
            }
That will work better, but for the +9 becomming +12, it appears to be something to do with either the AddItem command, or the packet itself, which is abit weird, i find it hard to beleive that something so basic would be so messed up.

Let us know if that works abit better.
12/07/2009 13:00 Arcо#5
Quote:
Originally Posted by Korvacs View Post
Code:
            if (MainI.ID != 0 && MinorI.ID != 0 && MainI.Plus <= 12)
            {
                uint Progress = MainI.Progress;
                Progress += Database.StonePts[MinorI.Plus];

                GC.MyChar.RemoveItem(MainI);

                while (Progress >= Database.ComposePts[MainI.Plus] && MainI.Plus <= 12)
                {
                    MainI.Plus++;
                    if (Progress == Database.ComposePts[MainI.Plus])
                       break;
                }

                if (MainI.Plus == 12)
                    Progress = 0;
                MainI.Progress = (ushort)Progress;
                GC.MyChar.AddItem(MainI);
                GC.MyChar.RemoveItem(MinorI);
            }
That will work better, but for the +9 becomming +12, it appears to be something to do with either the AddItem command, or the packet itself, which is abit weird, i find it hard to beleive that something so basic would be so messed up.

Let us know if that works abit better.

Nope didn't work the item just disappeared.
12/07/2009 13:04 Korvacs#6
Show me the AddItem function,

This is abit frustrating really, theres a really easy way to simply update an item, but i dont think this server has the functionality to do it atm.

Code:
            Server.packetServer.SendData(Packets.ItemInfomation(_Item, ItemCreationType.Update, Data.ConnectionID));
Thats how i would do it in mine for example.
12/07/2009 13:06 Arcо#7
Hmm someone jsut told me over msn that these lines might have something to do with it.
Code:
        public static ushort[] StonePts = new ushort[9] { 0, 10, 40, 120, 360, 1080, 3240, 9720, 29160 };
        public static ushort[] ComposePts = new ushort[12] { 20, 20, 80, 240, 720, 2160, 6480, 19440, 58320, 2700, 5500, 9000 };
12/07/2009 13:10 Korvacs#8
Ignore that, the item shouldnt disappear, lets fix that first, then sort out the composition.
12/07/2009 14:02 osamaazez#9
idk how to code it thanks any way but i need Compose.cs file and NPCs.txt and NPCDialog.cs
12/07/2009 14:02 osamaazez#10
thanks very match for this great post