3,15d2 < ////////////////////////////////////////////////////////////////// < // main formula for NDKP // < // // < // Authored by: Alcaras // < // last updated by: Asia // < // property of Nurfed Guild // < // // < // Copyright 2005 Nurfed Guild // < // Unless otherwise noted, all code contained within this // < // this software (NDKP) are copyrighted and may not be used // < // copied, or duplicated in any form without consent from // < // Nurfed Officers. // < ////////////////////////////////////////////////////////////////// 26c13 < $casters=array('Paladin','Shaman','Priest','Mage','Warlock','Druid'); --- > $casters=array('Shaman','Priest','Mage','Warlock','Druid'); 28d14 < $semis = array('Paladin','Druid','Shaman'); #melee/caster types 33d18 < //if weapon slot less than 2 hand pull it for comparison 35c20 < //If Melee find all One Handers are needed --- > //If Melee find all One Handers 39c24 < //if Item is Held only want to compare to other helds --- > //if Item is Held only want to uc from other Held 42d26 < //if Item is a shiled only want to compare to other shield 46d29 < //default to all other types of weapons, trinkets 51,54c34,37 < //Database query < //selects all items equal to the current item and which has been looted < //prior to the current raid date < $sql = "select d.* , i.slot, i.class_restrictions, i.dkp_value, i.shaman_dkp, r.raid_date --- > > > $sql = "select d.* , i.slot, i.class_restrictions, i.dkp_value, i.shaman_dkp, > i.melee_dkp, r.raid_date 66c49 < // get True DKP Value of current item --- > // get True DKP 68,69c51,52 < if($item["shaman_dkp"] > 0) { // Apply ShamanDKP if Druid/Shaman/Paladin < if(in_array($player["class"],$semis)) { --- > if($item["shaman_dkp"]>0) { // Apply ShamanDKP if Druid/Shaman > if($player["class"]=="Shaman" || $player["class"]=="Druid") { 80c63 < if($item["hunter_dkp"]>0) { //Apply Hunter DKP --- > if($item["hunter_dkp"]>0) { 85d67 < 90,91c72,77 < //Verbose -> Print out the Item we're considering < echo "\nConsidering " . $item["name"] . "\n"; --- > // Spit out Item Name > if($raid[raid_id] == 59) { > echo "\nGuild Bank Purchase " . $item["name"] . "\n"; > } else { > echo "\nConsidering " . $item["name"] . "\n"; > } 97d82 < //get dkp values of items to be compared 100,109d84 < if($rawr["shaman_dkp"] > 0) { < if(in_array($player["class"],$semis)) { < $rdkpv = $rawr["shaman_dkp"]; < } < } < if($rawr["melee_dkp"]>0) { < if($player["class"]=="Rogue" || $player["class"]=="Warrior") { < $rdkpv = $rawr["melee_dkp"]; < } < } 111,139c86 < if($rawr["hunter_dkp"]>0) { < if($player["class"]=="Hunter") { < $rdkpv = $rawr["hunter_dkp"]; < } < } < < //Compare items if more than 2 of the same type or default to full price < //Compare Fingers and Trinkets < if($item["slot"]=="Finger" || $item["slot"]=="Trinket") { < $qry1=mysql_query("select d.*,i.name, i.dkp_value as dkp, r.* from drops d < left join raids r on d.raid_id=r.raid_id < left join items i on d.item_id=i.item_id < where player_id='".$player["player_id"]."' < and r.raid_date < '" . $raid["raid_date"] . "' < and $slottext order by r.raid_date asc") or die(mysql_error()); < //If more than 2 items grab the 2nd highest dkp value and compare to current < if(mysql_num_rows($qry1) > 2) { < while($e=mysql_fetch_object($qry1)) { < $dkpf[]=$e->dkp; < } < rsort($dkpf); < $lowShadow=$dkpf[1]; < $rdkpv = $lowShadow; < } < } < //compare all one - main and off hand items < if($item["slot"]=="One-Hand" || $item["slot"]=="Main Hand" || $item["slot"]=="Off-Hand") { < //Find low shadow only if melee, casters default to current value < if(in_array($player["class"],$melees)) { --- > if($item["slot"]=="Finger" || $item["slot"]=="Trinket") { 153a101,130 > } > if($item["slot"]=="One-Hand" || $item["slot"]=="Main Hand" || $item["slot"]=="Off-Hand") { > //upgrade melee only if 2 or more of these items > if(in_array($player["class"],$melees)) { > $qry1=mysql_query("select d.*,i.name, i.dkp_value as dkp, r.* from drops d > left join raids r on d.raid_id=r.raid_id > left join items i on d.item_id=i.item_id > where player_id='".$player["player_id"]."' > and r.raid_date < '" . $raid["raid_date"] . "' > and $slottext order by r.raid_date asc") or die(mysql_error()); > if(mysql_num_rows($qry1) > 2) { > while($e=mysql_fetch_object($qry1)) { > $dkpf[]=$e->dkp; > } > rsort($dkpf); > $lowShadow=$dkpf[1]; > $rdkpv = $lowShadow; > } > } > } > if($rawr["shaman_dkp"]>0) { > if($player["class"]=="Shaman" || $player["class"]=="Druid") { > $rdkpv = $rawr["shaman_dkp"]; > } > } > if($rawr["melee_dkp"] > 0) { > if($player["class"]=="Rogue" || $player["class"]=="Warrior") { > $rdkpv = $rawr["melee_dkp"]; > echo "Found DKPV: $dkpv for $item[name]\n"; > } 155d131 < } 157,161c133,143 < $diff[$i] = $dkpv - $rdkpv; < if($v) { < echo "$rdkpv vs. $dkpv : " . $diff[$i] . "\n"; < } < $i++; --- > if($rawr["hunter_dkp"]>0) { > if($player["class"]=="Hunter") { > $rdkpv = $rawr["hunter_dkp"]; > } > } > > $diff[$i] = $dkpv - $rdkpv; > if($v) { > echo "$rdkpv vs. $dkpv : " . $diff[$i] . "\n"; > } > $i++; 166c148 < --- > 168c150 < //skip this item until later --- > 179d160 < //Fingers and Trinkets 190c171 < echo " $player[name] charged full cost: $dkpv - " . $item["name"] . "\n"; --- > echo "$player[name] charged full cost: $dkpv - " . $item["name"] . "\n"; 193,196c174,175 < //Melee One-Main-Off Hands < } else if($item["slot"] == "One-Hand" || $item["slot"] == "Main Hand" || < $item["slot"] == 'Off-Hand' && in_array($player["class"],$melees)) { < echo "Identified Melee one-hand ($item[slot]) and $player[class]\n"; --- > } else if(($item["slot"] == "One-Hand" || $item["slot"] == "Main Hand" || $item["slot"] == 'Off-Hand') && ($player["class"] == 'Warrior' || $player["class"] == "Rogue" || $player["class"] == 'Hunter')) { > echo "identified one-hand ($item[slot]) and $player[class]\n"; 209d187 < echo "Normal: ($item[slot]) and $player[class]\n"; 218c196 < return $dkpv; --- > return $dkpv; 220a199 > 256c235 < echo "\n". $player["name"] . " purchased at full price "; --- > echo "\n". $player["name"] . " purchased at full price\n"; 261,262c240 < if($poet[$item["component_of"]][$player["name"]]==1) { < //only if this is the first thing --- > if($poet[$item["component_of"]][$player["name"]]==1) { //only if this is the first thing 287a266 > //echo $sqlspend . "\n";