Daxter 1 Report post Posted January 4 Hi, I have two questions to which need help understanding: What is the difference between MakeItem and GiveItem? Give takes one more parameter, but how relevant is that? Is there any place I can find all "codes" for item attributes, like 16 is for rightful BD equips, etc? Quote Share this post Link to post Share on other sites
Daxter 1 Report post Posted January 7 (edited) Bump Can anyone help with (at least) the item quality part? Function name, or list of values. From what I've gathered 4 seems to be the default, but there's also 96? And from 101+ it's used for gem levels Edited January 7 by Daxter Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted January 9 Hello @Daxter, MakeItem() as a result returns two variables (a tuple): success flag (boolean) and position of the created item in the character's bag: r1,r2 = MakeItem(role, <Item ID>, <Amount>, <Quality/Type>) -- if r1 == 1 then the item <Item ID> x <Amount> of quality <Quality/Type> is successfully added to the inventory/bag. -- r2 contains the number of the inventory slot in which the created item is placed if r1 == 1 GiveItem() returns just a success flag: r1 = GiveItem(role, 0, <Item ID>, <Amount>, <Quality/Type>) -- The second parameter is an NPC descriptor, usually it equals 0. You can see examples of using both functions in GameServer scripts. On 1/8/2024 at 1:41 AM, Daxter said: Bump Can anyone help with (at least) the item quality part? Function name, or list of values. From what I've gathered 4 seems to be the default, but there's also 96? And from 101+ it's used for gem levels It depends on the type of item (gem, fairy, etc). For regular items, I think you can use value 4. 1 Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
Daxter 1 Report post Posted January 10 (edited) 17 hours ago, V3ct0r said: Hello @Daxter, MakeItem() as a result returns two variables (a tuple): success flag (boolean) and position of the created item in the character's bag: r1,r2 = MakeItem(role, <Item ID>, <Amount>, <Quality/Type>) -- if r1 == 1 then the item <Item ID> x <Amount> of quality <Quality/Type> is successfully added to the inventory/bag. -- r2 contains the number of the inventory slot in which the created item is placed if r1 == 1 GiveItem() returns just a success flag: r1 = GiveItem(role, 0, <Item ID>, <Amount>, <Quality/Type>) -- The second parameter is an NPC descriptor, usually it equals 0. You can see examples of using both functions in GameServer scripts. Thanks, that's a lot clearer now. When you mention GameServer scripts, are you referring to the source code? I'm not very knowledgeable in C++, so I admit i haven't looked into it 17 hours ago, V3ct0r said: It depends on the type of item (gem, fairy, etc). For regular items, I think you can use value 4. Right, but there's nothing like a list of outcomes to consult? So I'll have to look it up in other scripts? For instance, the level 40+ Newbie Chest: function ItemUse_XRBOX7( role, Item ) local job = GetChaAttr(role, ATTR_JOB) local lv = GetChaAttr(role, ATTR_LV) local cha_type = GetChaTypeID ( role ) local cha_type = GetChaTypeID ( role ) local Item_CanGet = GetChaFreeBagGridNum ( role ) if Item_CanGet < 5 then SystemNotice(role ,"To open a Newbie Chest requires 5 empty slots") UseItemFailed ( role ) return end if lv < 40 then SystemNotice(role ,"Currently lower than Lv 40. Unable to use item!") UseItemFailed ( role ) elseif job == 9 then GiveItem ( role , 0 , 450 , 1 , 4 ) GiveItem ( role , 0 , 295 , 1 , 95 ) GiveItem ( role , 0 , 4 , 1 , 95 ) GiveItem ( role , 0 , 302 , 1 , 95 ) local r1,r2 =MakeItem ( role , 22 , 1 , 11 ) local Item1 = GetChaItem ( role , 2 , r2 ) Serpentine Sword (ID 4) comes gemmed from the chest, meaning Item Quality 95 = random basic gem? And if I were to change the possible gems to include when quality = 95, would that be defined in a script or is defined via GameServer? Edited January 10 by Daxter Accidental early post Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted January 10 7 hours ago, Daxter said: When you mention GameServer scripts, are you referring to the source code? I'm not very knowledgeable in C++, so I admit i haven't looked into it No, I refer to GameServer lua scripts, which are located in the GameServer/resource/script/ directory. Analysis of the source code of these functions in C++ can, of course, give more understanding of the specifics of their operation. If you just need to give an item to the player, use the GiveItem() function. If you need to create an item, get and set its attributes, then use the MakeItem() function in conjunction with the GetChaItem(), GetItemAttr() and SetItemAttr() functions. 7 hours ago, Daxter said: Right, but there's nothing like a list of outcomes to consult? So I'll have to look it up in other scripts? Look at function Creat_Item(item, item_type, item_lv, item_event) from \GameServer\resource\script\calculate\AttrCalculate.lua. The item_event parameter is the quality/type of the item being created. This function performs some manipulations with the item, depending on the parameter. For Type = 95 it will be: elseif item_event == QUEST_AWARD_SCBOX then count = CreateItemAttrCount ( item_type , item_lv , item_event , quality , Item_Attr_95 ) 1 Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites