![]() |
Enchanting - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html) +--- Forum: Development (https://forum.cuberite.org/forum-13.html) +--- Thread: Enchanting (/thread-1321.html) |
RE: Enchanting - daniel0916 - 01-28-2014 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. RE: Enchanting - xoft - 01-28-2014 cEnchantmentsArray TheArray; TheArray.push_back(cEnchantments("Protection=1")); TheArray.push_back(cEnchantments("Respiration=2")); RE: Enchanting - daniel0916 - 01-31-2014 //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(). RE: Enchanting - daniel0916 - 02-01-2014 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. RE: Enchanting - tigerw - 02-01-2014 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 ![]() RE: Enchanting - NiLSPACE - 02-01-2014 (02-01-2014, 04:11 AM)tigerw Wrote: ... so xoft can better examine your code So everyone can examine your code. RE: Enchanting - daniel0916 - 02-01-2014 https://github.com/daniel0916/MCServer/commit/36120db400691be75199ff404e35f5c289b8818f RE: Enchanting - ThuGie - 02-01-2014 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 ![]() RE: Enchanting - daniel0916 - 02-01-2014 (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? RE: Enchanting - ThuGie - 02-01-2014 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. |