Implementing: Collections

EQ2Emulator Development forum.

Moderator: Team Members

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Implementing: Collections

Post by John Adams » Thu Apr 07, 2011 9:28 pm

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.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: Implementing Collections

Post by Scatman » Thu Apr 07, 2011 11:14 pm

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.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Implementing Collections

Post by John Adams » Thu Apr 07, 2011 11:36 pm

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 :D

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: Implementing Collections

Post by Zcoretri » Fri Apr 08, 2011 12:26 am

After laying down to go to sleep...mind was racing with ideas trying to figure out WTF I was doing wrong when the :idea: went on, lmao...
Collection.png
You do not have the required permissions to view the files attached to this post.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Implementing Collections

Post by John Adams » Fri Apr 08, 2011 8:56 am

Excellent. I hope Scatty gets to write some LUA again. Back to his roots!!! hahaha j/k ;)

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: Implementing Collections

Post by Zcoretri » Tue Apr 12, 2011 4:05 pm

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. :)

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Implementing Collections

Post by John Adams » Tue Apr 12, 2011 5:01 pm

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.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: Implementing Collections

Post by Scatman » Tue Apr 12, 2011 6:07 pm

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.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Implementing Collections

Post by John Adams » Wed Apr 13, 2011 7:34 am

John Adams wrote:I'll add the command skeleton and we can add to it as we go.
Committed this last night

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: Implementing Collections

Post by Zcoretri » Mon Apr 25, 2011 8:43 am

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 :mrgreen:

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.

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: Implementing Collections

Post by Zcoretri » Thu Apr 28, 2011 10:22 pm

My test collection...
You do not have the required permissions to view the files attached to this post.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: Implementing Collections

Post by Scatman » Thu Apr 28, 2011 10:51 pm

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
You do not have the required permissions to view the files attached to this post.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: Implementing Collections

Post by Scatman » Thu Apr 28, 2011 11:29 pm

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
You do not have the required permissions to view the files attached to this post.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Implementing Collections

Post by John Adams » Fri Apr 29, 2011 3:53 pm

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.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: Implementing Collections

Post by Scatman » Fri Apr 29, 2011 5:05 pm

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests