How does composing work?

03/02/2011 09:51 ßøøm#1
I'm wondering how it works and if i can change it.
I know two +1Stones = +1 and two +6Stones = +7.

Is there any place in the client i can check the points you need to make a certain item + i know +7 to +8 takes a shit tons of + stones or just 2 +8Stones to make +9 but yeah.

If you don't understand me let me know i'll try to complain my question better i guess.
03/02/2011 11:40 HackProvider#2
Go to database.cs and search for

Quote:
public static ushort[] ComposePts = new ushort[13] { 20, 20, 80, 240, 720, 2160, 6480, 19440, 58320, 2700, 5500, 9000, 29160 };
there you can see how many points you need for the next +

did i help ya?
03/02/2011 12:26 ßøøm#3
Quote:
Originally Posted by HackProvider View Post
Go to database.cs and search for



there you can see how many points you need for the next +

did i help ya?
Not really you clearly didn't read my thread correctly i didn't mention a source at all this was leaning towards the client not a public source.
03/02/2011 12:30 Syst3m_W1z4rd#4
I think it's controlled serverside how much composition points you need.
So to mkae a custom value for your client, I guess you would need to send a packet to the server telling that you're sending the value you want to.

Code:
Client -> Compose -> RecievePacket -> ChangePacket -> Server
Not sure if it's exactly like that, but would be my guess.
I don't think they store the values clientside.
03/02/2011 14:01 HackProvider#5
Sorry didnt understand you xd
03/02/2011 14:55 ßøøm#6
Quote:
Originally Posted by Syst3m_W1z4rd View Post
I think it's controlled serverside how much composition points you need.
So to mkae a custom value for your client, I guess you would need to send a packet to the server telling that you're sending the value you want to.

Code:
Client -> Compose -> RecievePacket -> ChangePacket -> Server
Not sure if it's exactly like that, but would be my guess.
I don't think they store the values clientside.
Interesting thank you.
03/02/2011 18:16 pro4never#7
Composition is a very simple concept.


Tq currently uses composition points (which I feel almost everyone knows lol)

You need X points to compose an item. The DISPLAY for points required is client side but the actual amount is controlled server side... generally you should be using the same values as client to avoid confusing people.

Each + item has it's own composition value (+1 = 10, etc).

When you try to compose an item the client sends the uid for the main item and minor item. Server checks if it's a valid item to be composed (not a potion or w/e and under +12) and that the minor item has a + and is the right kind. It then adds the composition points and if needed adds a +.

IE: adding +1 stone to +5 item will add 10 composition points but if it's at 5999/6000 required points it will become +6 with 9/12000 points or w/e. Simple enough to code, just need to keep it in mind when doing it.


So you said you're referring more to client side... Well all that happens is the client lets you place the two items into the composition window and it then sends it to server. Server then deletes the minor items and updates the main item (assuming it's a valid composition and everything).
03/02/2011 19:54 { Angelius }#8
it happens that i have been working on that composing thing 2 days ago and here is the whole shit that came out after 2 hours of thinking lmfao
PHP Code:
uint MainUID BitConverter.ToUInt32(Data8);
uint MinorUID BitConverter.ToUInt32(Data12);
Item Main = new Item(), Minor = new Item();

//Find if the player inventory contains the item here 
Main.CopyMinor.Copy;
uint OldPlus Main.Plus,//use this to an"AllUsers" message if the plus was over than 10 or w/e
NewProgress WorldTables.Stones[Minor.Plus],Progress Main.ProgressNextProgress WorldTables.ComposePts[Main.Plus];
                
bool Run true;
                while (
Run && Main.Plus 12)
                {
                    if (
NewProgress >  Math.Abs(Progress NextProgress)|| NewProgress == Math.Abs(Progress NextProgress))
                    {
                        
NewProgress -= (uint)Math.Abs(Progress NextProgress); Main.Plus++; Main.Progress 0Progress 0NextProgress WorldTables.ComposePts[Main.Plus];
                    }
                    else
                    {
                        
Run false; if (NewProgress ) { Main.Progress += NewProgress; }
//i dont know if i need to break here :P
                    
}
                }
//this is how I did it and you should know how to go from here 
PHP Code:
// they did post this one but any ways i'll post it again 
public static uint[] Stones = new uint[9] { 0104012036010803240972029160 };

public static 
ushort[] ComposePts = new ushort[13] { 20208024072021606480194405832027005500900033000 }; 
03/02/2011 20:42 ßøøm#9
Thanks to you all who helped!
03/02/2011 21:04 pro4never#10
Quote:
Originally Posted by { Angelius } View Post
it happens that i have been working on that composing thing 2 days ago and here is the whole shit that came out after 2 hours of thinking lmfao
PHP Code:
uint MainUID BitConverter.ToUInt32(Data8);
uint MinorUID BitConverter.ToUInt32(Data12);
Item Main = new Item(), Minor = new Item();

//Find if the player inventory contains the item here 
Main.CopyMinor.Copy;
uint OldPlus Main.Plus,//use this to an"AllUsers" message if the plus was over than 10 or w/e
NewProgress WorldTables.Stones[Minor.Plus],Progress Main.ProgressNextProgress WorldTables.ComposePts[Main.Plus];
                
bool Run true;
                while (
Run && Main.Plus 12)
                {
                    if (
NewProgress >  Math.Abs(Progress NextProgress)|| NewProgress == Math.Abs(Progress NextProgress))
                    {
                        
NewProgress -= (uint)Math.Abs(Progress NextProgress); Main.Plus++; Main.Progress 0Progress 0NextProgress WorldTables.ComposePts[Main.Plus];
                    }
                    else
                    {
                        
Run false; if (NewProgress ) { Main.Progress += NewProgress; }
//i dont know if i need to break here :P
                    
}
                }
//this is how I did it and you should know how to go from here 
PHP Code:
// they did post this one but any ways i'll post it again 
public static uint[] Stones = new uint[9] { 0104012036010803240972029160 };

public static 
ushort[] ComposePts = new ushort[13] { 20208024072021606480194405832027005500900033000 }; 

Here's how my composition on old hellmouth worked... I've modified it a bunch of times though so it could be missing some stuff... at first glance this should be right though.


Code:
public static void Composition(byte[] Packet, Client Client)
        {
            uint MainUID = BitConverter.ToUInt32(Packet, 8),//Gets MainItem UID
                MinorUID = BitConverter.ToUInt32(Packet, 12);//Gets Contribution UID
            Struct.ItemInfo MainItem = Client.InventoryItem(MainUID),//Retrieves iteminfo from Client of MainUID
                MinorItem = Client.InventoryItem(MinorUID);//Retrieves iteminfo from Client of MinorUID 
            if (MinorItem.Locked)
                return;
            if (MinorItem.Free)
                return;
            if (MinorItem.Suspicious)
                return;           
            uint Points = 0;
            switch (MinorItem.Plus)//Converts the MinorItems plus value into composition points
            {
                case 1: Points = 10; break;
                case 2: Points = 40; break;
                case 3: Points = 120; break;
                case 4: Points = 360; break;
                case 5: Points = 1080; break;
                case 6: Points = 3240; break;
                case 7: Points = 9720; break;
                case 8: Points = 29160; break;
            }      
            if (Points > 0 && MainItem.Plus < 12)
            {
            Client.RemoveInventory(MinorUID);//Removes Contribution      
                MainItem.Composition += Points;
                while (MainItem.Composition >= GetPlusReq(MainItem.Plus))
                {
                    MainItem.Composition -= GetPlusReq(MainItem.Plus);
                    MainItem.Plus++;                    
                }
                Client.Inventory[MainItem.UID] = MainItem;
                Database.UpdateItem(MainItem.UID, (int)MainItem.Composition, "Progress");
                Database.UpdateItem(MainItem.UID, (int)MainItem.Plus, "Plus");
                Client.Send(Packets.ItemInfo(MainItem, 3));
            }
        }
Code:
private static uint GetPlusReq(int p)
        {
            switch (p)
            {
                case 0:
                    {
                        return 20;
                    }
                case 1:
                    {
                        return 20;
                    }
                case 2:
                    {
                        return 80;
                    }
                case 3:
                    {
                        return 240;
                    }
                case 4:
                    {
                        return 720;
                    }
                case 5:
                    {
                        return 2160;
                    }
                case 6:
                    {
                        return 6480;
                    }
                case 7:
                    {
                        return 19440;
                    }
                case 8:
                    {
                        return 58320;
                    }
                case 9:
                    {
                        return 116640;
                    }
                case 10:
                    {
                        return 233280;
                    }
                case 11:
                    {
                        return 466560;
                    }
                default:
                    {
                        return 0;
                    }
            }
        }
ooh... arco wrote that part I guess ahaha but fairly obvious

Code:
 public Struct.ItemInfo InventoryItem(uint UID)
        {
            Struct.ItemInfo Item;
            Inventory.TryGetValue(UID, out Item);
            return Item;
        }
Not too hard really.