Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cleaned up crafting script, now also sets class table according to wh…

…ich augment is relevant per class
  • Loading branch information...
commit 2e54267ac02e31ae15a088df14225b007481367f 1 parent 0b3d866
Mathijs Schmittmann authored
Showing with 44 additions and 13 deletions.
  1. +44 −13 admin/crafting.php
57 admin/crafting.php
View
@@ -1,17 +1,24 @@
<?
-// If you are reading this: Thank you Trion for making this so complicated!
-
-// Most information taken from https://sites.google.com/site/riftaugmentlist/single-primary-stat-chages
+// This script does three things:
+// - 1 Set the source info on world drops to other/unknown (these items are only in the DB so they can be equipped, not meant as upgrade suggestions)
+// - 2 Adjust the stats on items that were crafted with an augment, since Trion's XML just has the base stats only (Thanks Trion..)
+// - 3 Adjust the class table so that irrelevant augmented items aren't suggested (irrelevant meaning the augment added stats that dont add any score for that spec)
+//
+// Most information on the augment names and stats is taken from https://sites.google.com/site/riftaugmentlist/single-primary-stat-chages
-require("../dbconfig.php");
// make database connection and select database
+require("../dbconfig.php");
$link = mysql_connect($hostname, $username, $password) or die(mysql_error());
mysql_select_db($database, $link);
-// fetch all items
-$result = mysql_query("SELECT itemid,name,modified,slot,type FROM items");
+// Part 1:
+$sql = "UPDATE items SET source='other', sourcename='Unknown (Let us know!)' WHERE (name REGEXP 'of the Fortress$' OR name REGEXP 'of the Anointed$' OR name REGEXP 'of the Devout$' OR name REGEXP 'of the Sovereign$' OR name REGEXP 'of the Defender$' OR name REGEXP 'of the Stalwart$' OR name REGEXP 'of Valor$' OR name REGEXP 'of the Mythical$' OR name REGEXP 'of Fortune$' OR name REGEXP 'of the Warfront$' OR name REGEXP 'of the Tenacious$' OR name REGEXP 'of the Sinister$') AND source IS NULL";
+$result = mysql_query($sql);
+// Part 2:
+// fetch all items and set the correct stats
+$result = mysql_query("SELECT itemid,name,modified,slot,type FROM items");
while ($record = mysql_fetch_assoc($result))
{
$modified = $record['modified'];
@@ -120,14 +127,39 @@
}
}
-// set source info for world drops (these are hidden from suggestionlist by default)
-$sql = "UPDATE items SET source='other', sourcename='Unknown (Let us know!)' WHERE (name REGEXP 'of the Fortress$' OR name REGEXP 'of the Anointed$' OR name REGEXP 'of the Devout$' OR name REGEXP 'of the Sovereign$' OR name REGEXP 'of the Defender$' OR name REGEXP 'of the Stalwart$' OR name REGEXP 'of Valor$' OR name REGEXP 'of the Mythical$' OR name REGEXP 'of Fortune$' OR name REGEXP 'of the Warfront$' OR name REGEXP 'of the Tenacious$' OR name REGEXP 'of the Sinister$') AND source IS NULL";
-echo $sql."<br />";
-$result = mysql_query($sql);
-echo mysql_errno($link) . ": " . mysql_error($link). "\n";
+// Part 3:
+$result = mysql_query("SELECT itemid,sourcename FROM items WHERE source='crafting';");
+$roguedps_ignore = array("Pliable Griffon Hide","Hardy Satyr Horn","Polished Barghest Fang","Flawless Etherialite","Pulsing Golem Core","Lustrous Whelp Scale","Pristine Basilisk Tail","Peculiar Sobek Eye","Shimmering Naga Scale","Impenetrable Dragon Turtle Shell","Honed Deep One Tooth","Flawless Saintstone","Honed Gnar Pincer","Supple Gravemaker Hide","Quivering Hellhound Heart","Peculiar Bogling Eye","Luxurious Centaur Tail","Flawless Vitalium","Pristine Golem Core","Keen Bogling Eye");
+$roguetank_ignore = array("Pliable Griffon Hide","Flawless Etherialite","Pulsing Golem Core","Lustrous Whelp Scale","Peculiar Sobek Eye","Shimmering Naga Scale","Deadly Vespid Stinger","Flawless Saintstone","Honed Gnar Pincer","Lustrous Dragonian Scale","Pristine Golem Core");
+$mage_ignore = array("Flawless Vitalium","Flawless Thiefstone","Polished Demon Horn","Luminous Harpy Feather","Malevolent Wight Essence","Peculiar Bogling Eye","Quivering Hellhound Heart","Lustrous Dragonian Scale","Honed Deep One Tooth","Deadly Vespid Stinger","Barbed Razormaw Spine","Verdant Treant Bark","Pure Werewolf Blood","Flawless Adrenalite","Thick Troll Hide","Polished Barghest Fang","Hardy Satyr Horn");
+
+while ($record = mysql_fetch_assoc($result))
+{
+ $itemid = $record['itemid'];
+ $sql = "";
+
+ if(in_array($record['sourcename'],$roguedps_ignore))
+ {
+ $sql = "UPDATE class SET roguedps='0' WHERE itemid='".$itemid."';";
+ mysql_query($sql);
+ }
+ if(in_array($record['sourcename'],$roguetank_ignore))
+ {
+ $sql = "UPDATE class SET roguetank='0' WHERE itemid='".$itemid."';";
+ mysql_query($sql);
+ }
+ if(in_array($record['sourcename'],$mage_ignore))
+ {
+ $sql = "UPDATE class SET magedps='0', magesupport='0' WHERE itemid='".$itemid."';";
+ mysql_query($sql);
+ }
+}
+
mysql_close($link);
-// END OF MAIN CODE
+///////////////////////////////////////////////////////////////////////////////////////////////
+// Functions //
+///////////////////////////////////////////////////////////////////////////////////////////////
function addprimary($augment,$stat,$slot,$type,$itemid)
{
@@ -609,7 +641,6 @@ function adddouble($augment,$statone,$stattwo,$slot,$type,$itemid){
break;
}
- echo $augment." on a ".$slot." ".$type." increases ".$statone." with ".$valueone." and ".$stattwo." with ".$valuetwo." (".$itemid.")<br />";
$valueone += $currentvalueone;
$valuetwo += $currentvaluetwo;
mysql_query("UPDATE items SET modified='1', source='Crafting', sourcename='".$augment."', ".$statone."='".$valueone."', ".$stattwo."='".$valuetwo."' WHERE itemid='".$itemid."';");
Please sign in to comment.
Something went wrong with that request. Please try again.