Page 1 of 1

New CreateDFNItemList

Posted: Sun Aug 01, 2021 12:54 am
by dragon slayer
CreateDFNItemlist(mChar.socket, mChar, "ITMELIST 1", AMOUNT, "ITEM", true, COLOR);
basicly almost like dfn but will pull from the itemlists.

Re: New CreateDFNItemList

Posted: Sun Aug 01, 2021 12:31 pm
by Xuri
Feature request granted...
... because it is already possible. You just need to make sure that you add a "list object" instead of trying to reference the itemlists directly. Example:

Code: Select all

var myItem1 = CreateDFNItem( socket, socket.currentChar, "listobject33", 1, "ITEM", true );
The above will spawn a random item based on this "listobject" entry from itemlists.dfn...

Code: Select all

// Male Fancy Shoes & Boots
[listobject33]
{
itemlist=33
}
Which points to [ITEMLIST 33]:

Code: Select all

// Male Fancy Shoes & Boots
[ITEMLIST 33]
{
0x170b
0x170f
0x1711
}
The same can be done for the fishing itemlists in fishinglist.dfn, if you add the same type of "list objects" there. For example, to spawn items from this itemlist from fishinglist.dfn...

Code: Select all

//Random Treasure (Paintings)
[ITEMLIST fishtreasure]
{
0x0ec8
0x0ee7
0x0ea0
0x0ea1
0x0ea2
0x0ea5
0x0ea6
}
...you could add the following to the same file:

Code: Select all

[fishtreasure] // Name here can be anything, but helps if it identifies the itemlist
{
itemlist=fishtreasure
}
Finally, you could add items from that itemlist in a script:

Code: Select all

var myItem1 = CreateDFNItem( socket, socket.currentChar, "fishtreasure", 1, "ITEM", true );