Just a web script to help track when, where, and what you got from the free treasures scattered about Nightfall in the game Guild Wars.
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

99 righe
4.0 KiB

  1. <TITLE>What Dropped?</TITLE>
  2. <?php
  3. include_once 'gw-connect.php';
  4. $con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
  5. #$toonid = mysqli_real_escape_string($con, $_POST['playerid']); //enable this after character selection is working
  6. $toonid = 'Chrissi Chan';
  7. #$location = mysqli_real_escape_string($con, $_POST['locationid']); //enable this after location selection is working
  8. $location = 4;
  9. $whatdropped = mysqli_real_escape_string($con, $_POST['gwdrop']);
  10. if ($con->connect_errno > 0){
  11. die ('Unable to connect to database [' . $db->connect_errno . ']');
  12. }
  13. echo 'At ';
  14. $sqlmaplocation = "SELECT `location`, `wikilink` FROM `treasurelocation` WHERE `treasureid` = $location";
  15. if (!$result = $con->query($sqlmaplocation)){
  16. die ('There was an error running the query [' . $con->error . ']');
  17. }
  18. while ($row = $result->fetch_array()){
  19. $locname = $row['location'];
  20. $loclink = $row['wikilink'];
  21. echo '<A HREF="' . $loclink . '">' . $locname . '</A>';
  22. }
  23. echo ' a ';
  24. if ($whatdropped == "1"){
  25. //code for white blue purple etc
  26. $sqlweaprare = "SELECT * FROM `listrarity` ORDER BY `rareid` ASC";
  27. if (!$result = $con->query($sqlweaprare)){
  28. die ('There was an error running the query [' . $con->error . ']');
  29. }
  30. echo '<SELECT NAME="rare">';
  31. while ($row = $result->fetch_array()){
  32. $rareid = $row['rareid'];
  33. $rarity = $row['rarity'];
  34. echo '<OPTION VALUE="' . $rareid . '">' . $rarity . '</OPTION>';
  35. }
  36. echo '</SELECT>, ';
  37. //code for weapon attribute requirment
  38. $sqlweapreq = "SELECT * FROM `listreq` ORDER BY `req` ASC";
  39. if (!$result = $con->query($sqlweapreq)){
  40. die ('There was an error running the query [' . $con->error . ']');
  41. }
  42. echo 'req<SELECT NAME="requirement">';
  43. while ($row = $result->fetch_array()){
  44. $reqid = $row['req'];
  45. echo '<OPTION VALUE="' . $reqid . '">' . $reqid . '</OPTION>';
  46. }
  47. echo '</SELECT>';
  48. //code for what attribute the weapon is (command, axe mastery, energy storage, etc
  49. $sqlweapattr = "SELECT * FROM `listattribute` ORDER BY `weapattrid` ASC";
  50. if (!$result = $con->query($sqlweapattr)){
  51. die ('There was an error running the query [' . $con->error . ']');
  52. }
  53. echo '<SELECT NAME="attribute">';
  54. while ($row = $result->fetch_array()){
  55. $attrid = $row['weapattrid'];
  56. $weapattr = $row['weaponattribute'];
  57. echo '<OPTION VALUE="' . $attrid . '">' . $weapattr . '</OPTION>';
  58. //need to add a nested while loop, to preselect the weapon with the attribute, or somehow java it? An r9 Axe of Energy Storage combo doesn't exist.
  59. }
  60. echo '</SELECT>';
  61. //code for what the weapon is - staff, dagger, scythe, wand, sword, etc
  62. $sqlweaptype = "SELECT * FROM `listtype` ORDER BY `weaponid` ASC";
  63. if (!$result = $con->query($sqlweaptype)){
  64. die ('There was an error running the query [' . $con->error . ']');
  65. }
  66. echo '<SELECT NAME="weapon">';
  67. while ($row = $result->fetch_array()){
  68. $typeid = $row['weaponid'];
  69. $weapon = $row['weapontype'];
  70. echo '<OPTION VALUE="' . $typeid . '">' . $weapon . '</OPTION>';
  71. }
  72. echo '</SELECT>';
  73. } else if ($whatdropped == "2"){
  74. //code for what rare material dropped
  75. $sqlraremat = "SELECT * FROM `materials` ORDER BY `materialid` ASC";
  76. if (!$result = $con->query($sqlraremat)){
  77. die ('There was an error running the query [' . $con->error . ']');
  78. }
  79. echo '<SELECT NAME="rarematerial">';
  80. while ($row = $result->fetch_array()){
  81. $matid = $row['materialid'];
  82. $raremat = $row['material'];
  83. echo '<OPTION VALUE="' . $matid . '">' . $raremat . '</OPTION>';
  84. }
  85. echo '</SELECT> ';
  86. } else if ($whatdropped == "3"){
  87. echo 'run rune code';
  88. } else {
  89. echo '<FORM METHOD="POST"><SELECT NAME="gwdrop" onchange="this.form.submit()">';
  90. echo '<OPTION SELECTED DISABLED>choose one</OPTION>';
  91. echo '<OPTION VALUE="1">weapon</OPTION>';
  92. echo '<OPTION VALUE="2">material</OPTION>';
  93. echo '<OPTION VALUE="3">rune</OPTION></SELECT>';
  94. echo '<NOSCRIPT><INPUT TYPE="SUBMIT" VALUE="SUBMIT"></NOSCRIPT></FORM>';
  95. }
  96. echo ' and |code for gold dropped here| gold pieces';
  97. echo ' <BR /><BR />';
  98. echo 'Reload the page with no GET data? <A HREF="gw-record.php">RELOAD</A>';
  99. ?>