Page 1 of 3
Implementing: Collections
Posted: Thu Apr 07, 2011 9:28 pm
by John Adams
Zcoretri and I had a discussion tonight about what might be easier for us to learn from, since Tradeskills was a big too big of a challenge right off the bat (no offense to anyone

)
Z thought Collections might be cool, so we're going to take a look into that.
SCAT! Can you let me know if a new CPP/H is needed for Collections code, or if you want to put the code into an existing file. Otherwise, let's take a look at how to get Collections implemented. Might be easier.
Other options:
- Raiding - tho no population, so just for fun

Instances - might need to do this first before raiding anyway
Weather - Where's my god damn rain???
We will definitely be getting back to Tradeskills soon, but there are a few things we need to figure out first.
Re: Implementing Collections
Posted: Thu Apr 07, 2011 11:14 pm
by Scatman
I'm not just saying this to put off work, but it's easier to get an idea of what kind of code is needed after seeing the structs. Structs may sometimes define the object themselves.
I >>think<< this should just be an expansion off quests. But we'll see.
Re: Implementing Collections
Posted: Thu Apr 07, 2011 11:36 pm
by John Adams
And Scat, regarding our PMs... Definitely, re-write Instancing if you do not want to waste time figuring out what Image was doing. No reason we cannot do more than 1 system at a time here, keep us busy while waiting for Z to ask for tables and code

Re: Implementing Collections
Posted: Fri Apr 08, 2011 12:26 am
by Zcoretri
After laying down to go to sleep...mind was racing with ideas trying to figure out WTF I was doing wrong when the

went on, lmao...
Collection.png
Re: Implementing Collections
Posted: Fri Apr 08, 2011 8:56 am
by John Adams
Excellent. I hope Scatty gets to write some LUA again. Back to his roots!!! hahaha j/k

Re: Implementing Collections
Posted: Tue Apr 12, 2011 4:05 pm
by Zcoretri
I think we are ready to move forward on this. Need help with DB tables...
Code: Select all
CREATE TABLE `collections` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`collection_name` VARCHAR(512) NOT NULL DEFAULT 'Unknown',
`collection_category` VARCHAR(512) NOT NULL DEFAULT 'Unknown',
`level` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
)
Code: Select all
CREATE TABLE `collection_items` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`collection_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`item_name` VARCHAR(255) NOT NULL DEFAULT 'Unknown',
`item_id` INT(11) NOT NULL DEFAULT '0',
`item_crc` INT(11) NOT NULL DEFAULT '0',
`item_index` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
)
Don't know how to go about creating the character tables.
I found 2 commands related to collections.
/collection_additem
- takes two parameters, collection_id, slot
/collection_filter_matchitem
- takes one parameter, slot
One of the things we need to figure out is how to run the collection_additem command when you examine a collection item from your inventory, but scatman probably already knows how to do this.

Re: Implementing Collections
Posted: Tue Apr 12, 2011 5:01 pm
by John Adams
Your 2 new tables are committed. Minor Version 4.
I'll add the command skeleton and we can add to it as we go.
As for the character tables, I thought Scat mentioned these might be handled like Quests, so wasn't sure if he planned to use the character_quest* tables.
Re: Implementing Collections
Posted: Tue Apr 12, 2011 6:07 pm
by Scatman
It's most likely a flag that needs to be set in the packet that sends all the menu items when you right-click an item (just like 'use'). And it'll also probably need to be a tinyint(3) in the database, or maybe we could just make another xref table for items that are apart of collections.
It'd probably be a better idea to investigate first.
Re: Implementing Collections
Posted: Wed Apr 13, 2011 7:34 am
by John Adams
John Adams wrote:I'll add the command skeleton and we can add to it as we go.
Committed this last night
Re: Implementing Collections
Posted: Mon Apr 25, 2011 8:43 am
by Zcoretri
Scatman wrote:It's most likely a flag that needs to be set in the packet that sends all the menu items when you right-click an item (just like 'use'). And it'll also probably need to be a tinyint(3) in the database, or maybe we could just make another xref table for items that are apart of collections.
It'd probably be a better idea to investigate first.
Can you expand on this scat? What packet gets sent when you right click on an item?
I have been toying with this stuff over a week now, could use a little help
Code: Select all
<Data ElementName="collection_needed" Type="int8" IfVariableSet="footer_collectable_0" />
I have determined that sending '0' here will display that you already have this item in your collection in the examine window.
Right now it is hard coded to always send a 1.
Code: Select all
packet->setSubstructDataByName("footer", "collection_needed", 1); //TODO: set collection_needed information properly
I have been experimenting and succesfully been able to get this to work for items in your inventory, but not for items on the broker.
Re: Implementing Collections
Posted: Thu Apr 28, 2011 10:22 pm
by Zcoretri
My test collection...
Re: Implementing Collections
Posted: Thu Apr 28, 2011 10:51 pm
by Scatman
Client 5040
Code: Select all
Name: num_collections Index: 0 Type: int16 Data: 01
Array: Data:
Name: unknown_0 Index: 0 Type: int8 Data: 01
Name: collection_name_0 Index: 0 Type: EQ2_16BitString Data: collection name
Name: collection_category_0 Index: 0 Type: EQ2_16BitString Data: category
Name: unknown2_0 Index: 0 Type: int8 Data: 00
Name: unknown2_0 Index: 1 Type: int8 Data: 00
Name: collection_id_0 Index: 0 Type: int32 Data: 01
Name: level_0 Index: 0 Type: int8 Data: 05
Name: unknown3_0 Index: 0 Type: int8 Data: 00
Name: num_items_0 Index: 0 Type: int16 Data: 02
Array: Data:
Name: item_icon0_0 Index: 0 Type: int16 Data: 611
Name: item_name0_0 Index: 0 Type: EQ2_16BitString Data: Blah poop
Name: item_flag0_0 Index: 0 Type: int8 Data: 00
Name: item_icon0_1 Index: 0 Type: int16 Data: 611
Name: item_name0_1 Index: 0 Type: EQ2_16BitString Data: Blah poop 2
Name: item_flag0_1 Index: 0 Type: int8 Data: 00
Name: new_collection_flag Index: 0 Type: int8 Data: 01
Re: Implementing Collections
Posted: Thu Apr 28, 2011 11:29 pm
by Scatman
Ok, well now that I wrote the sending process to actually send a player's collections they have, it works..so /shrug.
Zcor and I now have collections sending to the client from the database based on what collections your player currently has. next step is just to do the updates and rewards

woohoo! bed time
Which reminds me, we'll need a field (maybe another table?) for rewards. I know you can get an item, but can you get multiple items as a reward? Can you get coin? etc
Re: Implementing Collections
Posted: Fri Apr 29, 2011 3:53 pm
by John Adams
Scatman wrote:Which reminds me, we'll need a field (maybe another table?) for rewards. I know you can get an item, but can you get multiple items as a reward? Can you get coin? etc
Not sure if this will be legal, but we could use (custom) item SETS if rewards from Collections are more than 1 item.
If they are just 1 item and/or coin, simply add reward_item_id and reward_coin for the total copper awarded to `collections` table.
Let me know what you need.
Re: Implementing Collections
Posted: Fri Apr 29, 2011 5:05 pm
by Scatman
Well that's just it. I was asking the community about it. I faintly remember getting more than one item as a reward sometimes for the higher level collections. Just want to see what exactly is going on, on live.