I think it's better to storage the enchantments and the level. Then it's easier to get the levels for the enchantments.
I use your typedef so this is using cEnchantments.
Can you give me a little example to add the enchantment with level? Then i can work faster.
cEnchantmentsArray TheArray;
TheArray.push_back(cEnchantments("Protection=1"));
TheArray.push_back(cEnchantments("Respiration=2"));
//Enchant Item
EnchantItem.m_Enchantments.AddFromString(enchantments[1].ToString());
//Set Enchanted Item to Window Slot
m_Player->GetWindow()->SetSlot(*m_Player, 0, EnchantItem);
The Item in the Slot isn't enchanted. Also not when i use directly a enchantment with .SetLevel().
Have anyone a idea how can i make the enchanting progress?
How can i get the enchantments who i should add? I have the available enchantments.
I think i need all enchanting levels and the player level of them for every enchanting. Should i make a map with this?
Hope someone has ideas.
I don't have an answer to that question, but I think you should really push your progress to a fork on GitHub so xoft can better examine your code

(02-01-2014, 04:11 AM)tigerw Wrote: [ -> ]... so xoft can better examine your code 
So everyone can examine your code.
Its quite amazing how your code look a ton like mine

.
I just started as i needed the new packet as well! and i wrote it a bit before you posted, a ton looks the same, though i work with hooks for plugin :p.
If i get the hook, i can finish enchant tru plugin

.
(02-01-2014, 05:10 AM)ThuGie Wrote: [ -> ]If i get the hook, i can finish enchant tru plugin
.
How do you know the enchantments which you are adding to the item?
I simply, do in lua
local Item2 = cItem(E_ITEM_DIAMOND_SWORD, 1, 0, "1=1")
And then Window:SetSlot(a_Player,SlotNum, Item2)
Ofcourse, when you show the options aka what level it has etc, you should store those,
For when you get the 0x11 packet, and then actually run the code above to apply the enchantment.