EQdkp Zero Point System integration

Description

This mod modifies EQdkp in such way, that the sum substracted from a raid attendee for buying an item is added to the whole of the attendees. So if an item drops worth 40 points in a 40 people raid, the one who buys it gets 40 points substracted and everyone on the raid (including the buyer) gets one point. More info on this system can be found here.

I made and tested this mod based on EQdkp Version 1.3.0. It worked fine for me and my old guild.

As I quit playing WoW and therefore have no need for this mod anymore, there will be no maintainance or future versions, but if you have any questions, feel free to use the discussions form below, and I'll try to answer them. Or get into contact with me.

Modification

There are only two places in one file where you need to modify something in order to get this to work:

In admin/additem.php:

After

//
// Remove the purchase value from members
//
$sql = 'UPDATE ' . MEMBERS_TABLE . '
        SET member_spent = member_spent - ' . stripslashes($this->old_item['item_value']) . '
        WHERE member_name IN (\'' . implode("', '", $this->old_item['item_buyers']) . '\')';
$db->query($sql);

add

// ***** BEGIN Zero Point System Hack
 
$sql = 'SELECT member_name 
	FROM ' . RAID_ATTENDEES_TABLE . '
	WHERE raid_id = ' . $this->old_item['raid_id'];
$query_attendees = $db->query($sql);
$num_attendees = $db->num_rows($query_attendees);
 
if ($num_attendees > 0) 
{
    $earned = round(($this->old_item['item_value'] * count($this->old_item['item_buyers'])) * 100 / $num_attendees) / 100;
 
    $attendees = array();
    $temp = $db->fetch_record_set($query_attendees);
 
    foreach ($temp as $attendent)
        $attendees[] = $attendent[0];
 
    $sql = 'UPDATE ' . MEMBERS_TABLE . '
            SET member_earned = member_earned - ' . $earned . '
            WHERE member_name IN (\'' . implode("', '", $attendees) . '\')';
    $db->query($sql);
}
 
// ***** END Zero Point System Hack

After

//
// Add charge to members
//
$sql = 'UPDATE ' . MEMBERS_TABLE . '
        SET member_spent = member_spent + ' . $_POST['item_value'] . '
        WHERE member_name IN (\'' . implode("', '", $_POST['item_buyers']) . '\')';
$db->query($sql);

add

// ***** BEGIN Zero Point System Hack
 
$sql = 'SELECT member_name 
	FROM ' . RAID_ATTENDEES_TABLE . '
	WHERE raid_id = ' . $_POST['raid_id'];
$query_attendees = $db->query($sql);
$num_attendees = $db->num_rows($query_attendees);
 
if ($num_attendees > 0) 
{
    $earned = round(($_POST['item_value'] * count($_POST['item_buyers'])) * 100 / $num_attendees) / 100;
 
    $attendees = array();
    $temp = $db->fetch_record_set($query_attendees);
 
    foreach ($temp as $attendent)
        $attendees[] = $attendent[0];
 
    $sql = 'UPDATE ' . MEMBERS_TABLE . '
            SET member_earned = member_earned + ' . $earned . '
	    WHERE member_name IN (\'' . implode("', '", $attendees) . '\')';
            $db->query($sql);
    }
 
// ***** END Zero Point System Hack

Besides this you also need to set up a value database for the several droppable items. Have fun with this ;-)

Discussion

TalisinTalisin, 2005/11/03 16:36

Hi,

thx for this nice hack but some problems i still have: If more then 5 guys assigned to the event nothing happens and everyone become points like a normal DKP system.

i cant find the reason why... so pls hlp me :)

Gina HaeussgeGina Haeussge, 2005/11/03 20:02

Hm.. that is a weird thing I can’t understand either (and can’t test right now, as I don’t have eqdkp setup and patched anywhere... will try to change this though and take a look, but can’t promise when I’ll get around to it). When I “developed” that hack I tested with a full 40 raid that actually had taken place, and everything worked just as smooth as it should (and the code shouldn’t even allow such “random” behaviour like you describe, simply two simple calculations and that’s it).

zer0c00lrulezzer0c00lrulez, 2005/11/04 19:27

Heya; i was interested in this; but the one thing that scares me is the posibility of burned points(rounded points). How bad could it get with say...10-15 raids of 40 people in MC; point burnouts would be frequent; think this mod would round up values too much?

Gina HaeussgeGina Haeussge, 2005/11/05 16:55

Don’t have any experience on this (as I said, I quit WoW and therefore can only say what people from my old guild experienced with the mod - which don’t seem to have been problems, as no one has tried to kill me so far ;-) ). How bad it could get of course depends on the item values you assign, the usual number of raid attendees and several other factors, but then you always have the possibility to make manual point adjustments via EQdkp, so if anything goes off by a point or two, no big problem.

No matter how you do it though, given a Zero-Sum-System you always have to find a way around rounding issues.

zer0c00lrulezzer0c00lrulez, 2005/11/05 22:27

Thanks man; ill try it out :)

zer0c00lrulezzer0c00lrulez, 2005/11/07 13:28

http://www.ugguild.net/dkp/

Working fine, installed it on friday we used it for our MC raid on saturday and trash mob event on sunday.

I’ll add an update or two, but so far the point burnout is not bad since we just started, Will update next week.

BTW Man, saved my ass a LOT of work there, thanks again. :)

Gina HaeussgeGina Haeussge, 2005/11/07 19:20

No problem, but please stop calling me “man”, as I’m not, at least not when I last checked ;-)

zer0c00lrulezzer0c00lrulez, 2005/11/12 20:50
:P

My bad, usualy programmers fit into “Cubicle Dude” Description, but this one time im wrong >:P

BTW we have continued to raid and the point burnout is not bad, its less than .01 point per raid(over 40 people) So my fears of point burnout are gone.

And if anyone needs a hand installing this just send me a mail at: zer0c00lrulez@hotmail.com

Ill try help out with whatever problem you cant solve.

DavidDavid, 2005/11/17 00:30

Hmm.. installed patched and uh... i make a raid. set items in it but the raid value is still 0 =/

Gina HaeussgeGina Haeussge, 2005/11/17 16:05

The raid value is irrelevant in a Zero Sum System. Points in the system are distributed by items that are bought which dropped on the raid.

Enter your comment (wiki syntax is allowed):
LCWMF
snippets/eqdkp.txt · Last modified: 2008/03/26 12:35 (external edit)