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.
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

99 linhas
3.7 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, $_GET['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. #experimental stuff
  25. if ($whatdropped == "1"){
  26. //code for white blue purple etc
  27. $sqlweaprare = "SELECT * FROM `listrarity` ORDER BY `rareid` ASC";
  28. if (!$result = $con->query($sqlweaprare)){
  29. die ('There was an error running the query [' . $con->error . ']');
  30. }
  31. echo '<SELECT NAME="rare">';
  32. while ($row = $result->fetch_array()){
  33. $rareid = $row['rareid'];
  34. $rarity = $row['rarity'];
  35. echo '<OPTION VALUE="' . $rareid . '">' . $rarity . '</OPTION>';
  36. }
  37. echo '</SELECT>, ';
  38. //code for weapon attribute requirment
  39. $sqlweapreq = "SELECT * FROM `listreq` ORDER BY `req` ASC";
  40. if (!$result = $con->query($sqlweapreq)){
  41. die ('There was an error running the query [' . $con->error . ']');
  42. }
  43. echo 'req<SELECT NAME="requirement">';
  44. while ($row = $result->fetch_array()){
  45. $reqid = $row['req'];
  46. echo '<OPTION VALUE="' . $reqid . '">' . $reqid . '</OPTION>';
  47. }
  48. echo '</SELECT>';
  49. //code for what attribute the weapon is (command, axe mastery, energy storage, etc
  50. $sqlweapattr = "SELECT * FROM `listattribute` ORDER BY `weapattrid` ASC";
  51. if (!$result = $con->query($sqlweapattr)){
  52. die ('There was an error running the query [' . $con->error . ']');
  53. }
  54. echo '<SELECT NAME="attribute">';
  55. while ($row = $result->fetch_array()){
  56. $attrid = $row['weapattrid'];
  57. $weapattr = $row['weaponattribute'];
  58. echo '<OPTION VALUE="' . $attrid . '">' . $weapattr . '</OPTION>';
  59. //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.
  60. }
  61. echo '</SELECT>';
  62. //code for what the weapon is - staff, dagger, scythe, wand, sword, etc
  63. $sqlweaptype = "SELECT * FROM `listtype` ORDER BY `weaponid` ASC";
  64. if (!$result = $con->query($sqlweaptype)){
  65. die ('There was an error running the query [' . $con->error . ']');
  66. }
  67. echo '<SELECT NAME="weapon">';
  68. while ($row = $result->fetch_array()){
  69. $typeid = $row['weaponid'];
  70. $weapon = $row['weapontype'];
  71. echo '<OPTION VALUE="' . $typeid . '">' . $weapon . '</OPTION>';
  72. //need to figure out how to display the options for weapon, material, or rune
  73. }
  74. echo '</SELECT>';
  75. } else if ($whatdropped == "2"){
  76. echo 'run material code';
  77. } else if ($whatdropped == "3"){
  78. echo 'run rune code';
  79. } else {
  80. echo '<FORM><SELECT NAME="gwdrop" onchange="this.form.submit()">';
  81. echo '<OPTION SELECTED DISABLED>choose one</OPTION>';
  82. echo '<OPTION VALUE="1">weapon</OPTION>';
  83. echo '<OPTION VALUE="2">material</OPTION>';
  84. echo '<OPTION VALUE="3">rune</OPTION></SELECT>';
  85. echo '<NOSCRIPT><INPUT TYPE="SUBMIT" VALUE="SUBMIT"></NOSCRIPT></FORM>';
  86. }
  87. echo ' and |code for gold dropped here| gold pieces';
  88. echo ' <BR /><BR />';
  89. echo 'End result: a Gold r9 Swordsmanship Sword <BR />'; //need to arrange code blocks around to achieve this
  90. echo 'Reload the page with no GET data? <A HREF="gw-record.php">RELOAD</A>';
  91. ?>