1, "stamina"=>1, "spirit"=>1, "strength"=>1, "agility"=>1, "crit_spell"=>14, "hit_spell"=>10, "crit_single"=>14*.4, "resist_fire"=>1, "resist_frost"=>1, "resist_shadow"=>1, "resist_nature"=>1, "resist_arcane"=>1, "damage_all"=>5/6, "damage_single"=>7/10, "healing"=>5/11, "regen_mana"=>5/2, "regen_health"=>4, "crit_melee"=>14, "attack_power"=>0.5, "hit_melee"=>10, "defense"=>3/2, "parry"=>20, "dodge"=>12, "armor_class"=>0); function apply_values($item) { global $formulas; global $multiplier; $formula = $formulas; $dkp_value = 0; while(list($stat, $mult) = each($formula)) { if ($item[$stat]>=0) { $dkp_value += pow($mult*$item[$stat],1.5); } else { $dkp_value -= pow($mult*abs($item[$stat]),1.5); } } if($item["lowend"]>0) { $dkp_value += pow(apply_weapon($item),1.5); } if($item["proc_mult"]>0) { $dkp_value += pow($item["proc_mult"],1.5); } $dkp_value = pow($dkp_value,2/3); return $dkp_value*$multiplier; } function apply_weapon($item) { global $multiplier; if($item["armor_type"]=="Wand") { return 0; } $shadows = array("Ranged" => array("dps"=>20/6, "sub"=>30.7), "Main Hand" => array("dps"=>20/6, "sub"=>41.3), "One-Hand" => array("dps"=>20/6, "sub"=>41.3), "Off-Hand" => array("dps"=>20/6, "sub"=>41.3), "Two-Hand" => array("dps"=>20/6, "sub"=>55.5)); $shm = $item["slot"]; $dps = ($item["topend"]+$item["lowend"])/$item["speed"]/2; $dps -= $shadows[$shm]["sub"]; $dkp = $dps * $shadows[$shm]["dps"]; return max($dkp*$multiplier,0); } function apply_shield($item) { global $multiplier; $ac = $item["armor_class"]; if($item["armor_type"] != "shield") { $ac += 2153; } $mac = 6500 - 2153 + $ac; $miti = $mac / ($mac + (85 * 60) + 400); $miti -= 1; $miti /= (1 - 0.5416); $miti += 1; $miti *= 100; $dkp = max($miti,0); return $dkp*$multiplier; } function apply_quest($item) { $sql = "select * from NDKP_items where item_id=" . $item["reward_one"]; $result = mysql_query($sql); $reward_one = mysql_fetch_array($result); $sql = "select * from NDKP_items where item_id=" . $item["reward_two"]; $result = mysql_query($sql); $reward_two = mysql_fetch_array($result); $sql = "select * from NDKP_items where item_id=" . $item["reward_three"]; $result = mysql_query($sql); $reward_three = mysql_fetch_array($result); $sql = "select * from NDKP_items where item_id=" . $item["reward_four"]; $result = mysql_query($sql); $reward_four = mysql_fetch_array($result); $sql = "select * from NDKP_items where item_id=" . $item["reward_five"]; $result = mysql_query($sql); $reward_five = mysql_fetch_array($result); $r[1] = obtain_dkp_value($reward_one); $r[2] = obtain_dkp_value($reward_two); $r[3] = obtain_dkp_value($reward_three); $r[4] = obtain_dkp_value($reward_four); $r[5] = obtain_dkp_value($reward_five); return max($r); }//*/ function apply_trinket($item) { if($item[time_used] > 0) { $usability = round(($item[time_used] / $item[cooldown])*100,3); $addPvp = $usability + 100; $endResult = $addPvp / 2; return $endResult; } else { return 100; } } function obtain_dkp_value($item) { require(str_replace('admin','',getCWD())."/config/siteSettings.php"); if($item["preset_dkp"]>0) { $cost=$item["preset_dkp"]; return $cost; } $cost = 0; $cost += apply_values($item); /*if($item["lowend"]>0) { $cost += apply_weapon($item); } if($item["armor_class"] > 0) { $cost += apply_shield($item); }//*/ if($item["quest_trigger"]>0) { $cost = apply_quest($item); }//*/ if($item[slot] == 'Trinket') { $tr_factor = apply_trinket($item); $tr_percent = $tr_factor/100; $cost = $cost * $tr_percent; } return round($cost); } function castweap($item) { $cweap = $item["intellect"] + $item["crit_spell"] + $item["hit_spell"] + $item["crit_single"] + $item["damage_all"] + $item["damage_single"] + $item["healing"] + $item["regen_mana"]; return ($cweap > 0); } ?>