====== EQdkp Zero Point System integration ====== ===== Description ===== This mod modifies [[http://www.eqdkp.com|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 [[http://forums.elitistjerks.com/index.php?showtopic=7812|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 [[personal:contact|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~~