Code:
CREATE TABLE IF NOT EXISTS `shared_tasks` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`taskid` int(10) unsigned NOT NULL,
`leader` varchar(64) NOT NULL,
PRIMARY KEY (`id`),
KEY `taskid` (`taskid`,`leader`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `shared_task_activities` (
`id` int(10) unsigned NOT NULL,
`activityid` int(10) unsigned NOT NULL,
`donecount` int(10) unsigned NOT NULL,
`completed` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`,`activityid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `shared_task_members` (
`id` int(10) unsigned NOT NULL,
`member` varchar(64) NOT NULL,
`charid` int(10) unsigned NOT NULL DEFAULT '0',
`level` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`,`member`),
UNIQUE KEY `member` (`member`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
EDIT: Looks like I added some columns to the tasks table:
I think sharedtype was 4 for Norrath's Keepers (Radiant crystal reward) and 5 for Dark Reign (Ebon crystals). The lockactivity column was to lock a task from adding new members after that activity was completed.
Code:
mysql> describe tasks;
+---------------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+---------------------+------+-----+---------+-------+
| id | int(11) unsigned | NO | PRI | 0 | |
| duration | int(11) unsigned | NO | | 0 | |
| title | varchar(100) | NO | | | |
| description | text | NO | | NULL | |
| reward | varchar(64) | NO | | | |
| rewardid | int(11) unsigned | NO | | 0 | |
| cashreward | int(11) unsigned | NO | | 0 | |
| xpreward | int(10) unsigned | NO | | 0 | |
| crystalreward | int(10) unsigned | NO | | 0 | |
| sharedtype | tinyint(1) unsigned | NO | | 0 | |
| rewardmethod | tinyint(3) unsigned | NO | | 2 | |
| startzone | int(11) | NO | | 0 | |
| minlevel | tinyint(3) unsigned | NO | | 0 | |
| maxlevel | tinyint(3) unsigned | NO | | 0 | |
| repeatable | tinyint(1) unsigned | NO | | 1 | |
| minmembers | tinyint(3) | NO | | 0 | |
| maxmembers | tinyint(3) | NO | | 0 | |
| lockactivity | tinyint(3) unsigned | NO | | 100 | |
+---------------+---------------------+------+-----+---------+-------+
18 rows in set (0.00 sec)
I haven't looked at that code in over two years, but as I said in a previous post, I was trying to retrofit shared tasks into code that wasn't designed for it, and so the code felt a bit fugly and 'hackish' to me. I can't remember specifics.