Skip to content
This repository
tree: a943598a3c
Fetching contributors…

Cannot retrieve contributors at this time

file 274 lines (246 sloc) 13.476 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274
<?

/////////////////////////////////////////////////////////////////////////////////
// Configuration for Rift-Upgrades //
/////////////////////////////////////////////////////////////////////////////////
// Version: ROGUE TANK //
/////////////////////////////////////////////////////////////////////////////////

$spec = "roguetank";
// spec name used in title on index.php
$title = "Rogue Tank";
// form name used on index.php, used to separate stored values (cookies) between classes/specs
$formname = "formroguetank";

/////////////////////////////////////////////////////////////////////////////////
// WEAPON SLOTS //
/////////////////////////////////////////////////////////////////////////////////
// Note: Only need to enter 'twohanded','onehand','mainhand' or 'offhand' , rest is already setup during import.

// Slot types equippable in mainhand for this class (mainhand,onehand,twohanded)
$mainhand = "slot='mainhand' or slot='onehand'";

// Slot types equippable in offhand for this class (onehand,offhand)
$offhand = "slot='onehand'";

/////////////////////////////////////////////////////////////////////////////////
// STATS //
/////////////////////////////////////////////////////////////////////////////////

// Note: currently only softcaps for non-threshold stats are calculated! Hardcap is not used at the moment, but can be defined.

// format for stats array is:
// [0] initial value (meaning class base stats usually)
// [1] db field (must be the same as array index value)
// [2] name (pretty name for stats used in the user interface)
// [3] show in totals? (0 = no, 1 = yes)
// [4] show in suggestion list? (0 = no, 1 = yes)
// [5] has a threshold? (0 = no, 1 = yes)
// [6] softcap (0 = no softcap)
// [7] softcap weight (will be multiplied by normal stat weight)
// [8] hardcap (0 = no softcap)

$stats = array (
"strength" => array ("35","strength","Strength",1,0,0,0,0,0),
"dexterity" => array ("71","dexterity","Dexterity",1,0,0,0,0,0),
"attackpower" => array ("0","attackpower","Attack Power",1,0,0,0,0,0),
"dodge" => array ("0","dodge","Dodge",1,0,0,0,0,0),
"parry" => array ("0","parry","Parry",1,0,1,0,0,0),
"toughness" => array ("0","toughness","Toughness",1,1,1,0,0,0),
"endurance" => array ("107","endurance","Endurance",1,0,0,0,0,0),
"hit" => array ("0","hit","Hit",1,1,1,0,0,0),
"health" => array ("1835","health","Health",1,0,0,0,0,0),
"dps" => array ("0","dps","",0,0,0,0,0,0)
);
// string for use in queries
$statslist = "strength,dexterity,attackpower,dodge,parry,toughness,endurance,hit,dps";

// add stats that are derived from other stats
function stats_derive($stats)
{
$stats["attackpower"][0] += ($stats["strength"][0] + $stats["dexterity"][0]) / 2;
$stats["dodge"][0] += $stats["dexterity"][0];
$stats["parry"][0] += $stats["strength"][0];
$stats["health"][0] += $stats["endurance"][0] * 9;
return $stats;
}

// remove stats that are derived from other stats, used when checking if threshold has been reached
function stats_derive_remove($stats)
{
$stats["attackpower"][0] -= ($stats["strength"][0]+$stats["dexterity"][0]) / 2;
$stats["dodge"][0] -= $stats["dexterity"][0];
$stats["parry"][0] -= $stats["strength"][0];
$stats["health"][0] -= $stats["endurance"][0] * 9;
return $stats;
}

// scoring of stats that do not have a threshold
function score_stats($stats,$slot)
{
$score = $stats["attackpower"][0] * $_POST['attackpowerweight'];
$score += $stats["dodge"][0] * $_POST['dodgeweight'];
$score += $stats["endurance"][0] * $_POST['enduranceweight'];

if($slot == "offhand")
$score += $stats["dps"][0] * $_POST['ohdpsweight'];
else if($slot == "mainhand")
$score += $stats["dps"][0] * $_POST['mhdpsweight'];
else if($slot == "ranged")
$score += $stats["dps"][0] * $_POST['rngdpsweight'];

return $score;
}

/////////////////////////////////////////////////////////////////////////////////
// TALENTS & BUFFS //
/////////////////////////////////////////////////////////////////////////////////

function talents_calculate($stats)
{
if($_POST['combatexpertise']>0) $stats["hit"][0] = $stats["hit"][0] + 5 * $_POST['combatexpertise'];
return $stats;
}

// talents for stats that are derived from other stats, such as attack/spellpower and crit
function talents_calculate_derived($stats)
{
if($_POST['enduring']>0) $stats["health"][0] += $stats["health"][0]/100 * $_POST['enduring'];
if($_POST['goodhealth']>0) $stats["health"][0] += $stats["health"][0]/100 * $_POST['goodhealth'] * 2;
if($_POST['unseenfury']>0) $stats["attackpower"][0] += $stats["attackpower"][0]/100 * $_POST['unseenfury'] * 3;
return $stats;
}

function buffs_calculate($stats)
{
return $stats;
}

function buffs_calculate_derived($stats)
{
return $stats;
}

// function that reverses all stat modifications done, order: derived buffs , derived talents, derived stats, base buffs, base talents
function modifications_undo($stats)
{
if($_POST['unseenfury']>0) $stats["attackpower"][0] -= $stats["attackpower"][0]/100 * $_POST['unseenfury']*3;
if($_POST['goodhealth']>0) $stats["health"][0] -= $stats["health"][0]/100 * 2 * $_POST['goodhealth'];
if($_POST['enduring']>0) $stats["health"][0] -= $stats["health"][0]/100 * $_POST['enduring'];
$stats = stats_derive_remove($stats);
if($_POST['combatexpertise']>0) $stats["hit"][0] = $stats["hit"][0] - 5 * $_POST['combatexpertise'];
return $stats;
}

/////////////////////////////////////////////////////////////////////////////////
// RUNES //
/////////////////////////////////////////////////////////////////////////////////

// Runes available in form. For value, only use the db field strings
function display_runes($slot)
{
switch($slot) {
case "helmet":
?><option value="11-dexterity,8-endurance">11 dex 8 end</option>
<option value="7-dexterity,3-strength">7 dex 3 str</option>
<option value="13-strength">13 str</option>
<option value="5-attackpower,18-hit">5 ap 18 hit</option><?
break;
case "shoulders":
?><option value="9-endurance,9-dodge">9 end 9 dodge</option>
<option value="7-endurance,7-dodge">7 end 7 dodge</option>
<option value="13-dexterity">13 dex</option>
<option value="10-dexterity">10 dex</option><?
break;
case "chest":
?><option value="20-toughness">20 tough</option>
<option value="15-toughness">15 tough</option>
<option value="11-endurance">11 end</option>
<option value="13-dexterity">13 dex</option>
<option value="5-dexterity,6-attackpower">5 dex 6 ap</option>
<option value="10-dexterity">10 dex</option><?
break;
case "gloves":
?><option value="6-parry">6 parry</option><?
break;
case "belt":
?><option value="10-dexterity,6-endurance">10 dex 6 end</option>
<option value="8-endurance">8 end</option>
<option value="5-dexterity,5-strength">5 dex 5 str</option><?
break;
case "legs":
?><option value="9-endurance,9-dodge">9 end 9 dodge</option>
<option value="7-endurance,7-dodge">7 end 7 dodge</option>
<option value="12-dexterity,9-endurance">12 dex 9 end</option>
<option value="9-dexterity,5-endurance">9 dex 5 end</option>
<option value="3-dexterity,6-strength">3 dex 6 str</option>
<option value="5-attackpower,18-hit">5 ap 18 hit</option><?
break;
case "feet":
?><option value="11-endurance">11 end</option>
<option value="8-endurance">8 end</option><?
break;
case "mainhand":
case "offhand":
case "ranged":
?><option value="10-dexterity">10 dex</option>
<option value="9-attackpower">9 ap</option>
<option value="13-hit">13 hit</option>
<option value="9-hit">9 hit</option><?
break;
}
}

/////////////////////////////////////////////////////////////////////////////////
// FORM HTML //
/////////////////////////////////////////////////////////////////////////////////

// Part of the form that allows users to enter thresholds. ID/Name should be <stat>target where <stat> is the exact name of the db-field.
function display_thresholds()
{
?>
<p><label for="hittarget">Hit target</label><input type="text" id="hittarget" name="hittarget" size="6" value="0"></input>(T1 Expert = 50, T2 Expert = 100, T1 Raid = 200, T2 Raid = 300)</p>
<p><label for="toughnesstarget">Toughness target</label><input type="text" id="toughnesstarget" name="toughnesstarget" size="6" value="0"></input>(T1 Expert = 50, T2 Expert = 100, T1 Raid = 150, T2 Raid = 200)</p>
<input type="hidden" id="parrytarget" name="parrytarget" size="6" value="1235" ></input>
<?
}


// Part of the form that allows users to set talents that have a direct effect on their stats and therefore total scoring. Name should be the same value used in talents_calculate()
function display_talents()
{
?>
<label for="enduring0">Enduring</label>
<input type="radio" id="enduring0" name="enduring" value="0" /> 0
<input type="radio" id="enduring1" name="enduring" value="1" /> 1
<input type="radio" id="enduring2" name="enduring" value="2" /> 2
<input type="radio" id="enduring3" name="enduring" value="3" /> 3
<input type="radio" id="enduring4" name="enduring" value="4" /> 4
<input type="radio" id="enduring5" name="enduring" value="5" /> 5 &nbsp; &nbsp; (1-5% health from Ranger)<br />
<label for="unseenfury0">Unseen Fury</label>
<input type="radio" id="unseenfury0" name="unseenfury" value="0" /> 0
<input type="radio" id="unseenfury1" name="unseenfury" value="1" /> 1
<input type="radio" id="unseenfury2" name="unseenfury" value="2" /> 2
<input type="radio" id="unseenfury3" name="unseenfury" value="3" /> 3
<input type="radio" id="unseenfury4" name="unseenfury" value="4" /> 4
<input type="radio" id="unseenfury5" name="unseenfury" value="5" /> 5 &nbsp; &nbsp; (3-15% ap from Riftstalker) <br />
<label for="combatexpertise0">Combat Expertise</label>
<input type="radio" id="combatexpertise0" name="combatexpertise" value="0" /> 0
<input type="radio" id="combatexpertise1" name="combatexpertise" value="1" /> 1
<input type="radio" id="combatexpertise2" name="combatexpertise" value="2" /> 2
<input type="radio" id="combatexpertise3" name="combatexpertise" value="3" /> 3
<input type="radio" id="combatexpertise4" name="combatexpertise" value="4" /> 4
<input type="radio" id="combatexpertise5" name="combatexpertise" value="5" /> 5 &nbsp; &nbsp; (5-25 hit from Blade Dancer)<br />
<label for="goodhealth0">Good Health</label>
<input type="radio" id="goodhealth0" name="goodhealth" value="0" /> 0
<input type="radio" id="goodhealth1" name="goodhealth" value="1" /> 1
<input type="radio" id="goodhealth2" name="goodhealth" value="2" /> 2
<input type="radio" id="goodhealth3" name="goodhealth" value="3" /> 3
<input type="radio" id="goodhealth4" name="goodhealth" value="4" /> 4
<input type="radio" id="goodhealth5" name="goodhealth" value="5" /> 5 &nbsp; &nbsp; (2-10% health from Bard)<br />
<?
}

// Part of the form where the user can set weights. ID/Name should be <stat>weight
// For stats with a threshold, there should be a <stat>aboveweight field to define the weight when the stat is above the threshold
// Values here are the default stats which are displayed when the user uses the tool for the first time
function display_weights()
{
?><table>
<tr>
<td><label for="mhdpsweight">MH DPS</label></td><td><input type="text" id="mhdpsweight" name="mhdpsweight" size="5" value="15.00"></input></td>
<td><label for="ohdpsweight">OH DPS</label></td><td><input type="text" id="ohdpsweight" name="ohdpsweight" size="5" value="4.00"></input></td>
<td><label for="rngdpsweight">Ranged DPS</label></td><td><input type="text" id="rngdpsweight" name="rngdpsweight" size="5" value="15.00"></input></td>
</tr>
<tr>
<td><label for="toughnessweight">Toughness</label></td><td><input type="text" id="toughnessweight" name="toughnessweight" size="5" value="2.00"></input></td>
<td><label for="toughnessaboveweight">Toughness &gt; target</label></td><td><input type="text" id="toughnessaboveweight" name="toughnessaboveweight" size="5" value="0.00"></input></td>
<td><label for="parryweight">Parry</label></td><td><input type="text" id="parryweight" name="parryweight" size="5" value="0.50"></input></td>
</tr>
<tr>
<td><label for="hitweight">Hit</label></td><td><input type="text" id="hitweight" name="hitweight" size="5" value="2.00"></input></td>
<td><label for="hitaboveweight">Hit &gt; target</label></td><td><input type="text" id="hitaboveweight" name="hitaboveweight" size="5" value="0.00"></input></td>
<td><label for="dodgeweight">Dodge</label></td><td><input type="text" id="dodgeweight" name="dodgeweight" size="5" value="2.00"></input></td>
</tr>
<tr>
<td><label for="attackpowerweight">Attack Power</label></td><td><input type="text" id="attackpowerweight" name="attackpowerweight" size="5" value="0.00"></input></td>
<td><label for="enduranceweight">Endurance</label></td><td><input type="text" id="enduranceweight" name="enduranceweight" size="5" value="1.00"></input></td>
</tr>
</table>
<input type="hidden" id="parryaboveweight" name="parryaboveweight" value="0.00"></input>
<?
}

?>
Something went wrong with that request. Please try again.