Rune.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <?php
  2. require_once($path["entity"] . "Entity.php");
  3. /**
  4. * Owned rune.
  5. *
  6. * Represents an object from the table 'rune'.
  7. */
  8. class Rune extends Entity{
  9. /**
  10. * Owner identifier.
  11. */
  12. public $uid;
  13. /**
  14. * Rune identifier.
  15. */
  16. public $id;
  17. /**
  18. * ID of the monster the rune is assigned to.
  19. */
  20. public $assigned_to;
  21. /**
  22. * Name of the set.
  23. */
  24. public $type;
  25. /**
  26. * Position of the rune type (1-6).
  27. */
  28. public $slot;
  29. /**
  30. * Rune stars.
  31. */
  32. public $stars;
  33. /**
  34. * Level of the rune.
  35. */
  36. public $level;
  37. /**
  38. * Rune quality.
  39. */
  40. public $quality;
  41. /**
  42. * Rune original quality.
  43. */
  44. public $original_quality;
  45. /**
  46. * Price of the rune.
  47. */
  48. public $value;
  49. /**
  50. * Current efficiency of the rune.
  51. */
  52. public $efficiency;
  53. /**
  54. * Maximum potential efficiency of the rune.
  55. */
  56. public $max_efficiency;
  57. /**
  58. * Main stat of the rune.
  59. */
  60. public $main_stat;
  61. /**
  62. * Main stat value of the rune.
  63. */
  64. public $main_stat_value;
  65. /**
  66. * Extra stat of the rune.
  67. */
  68. public $innate_stat;
  69. /**
  70. * Extra stat value of the rune.
  71. */
  72. public $innate_stat_value;
  73. /**
  74. * Number of substats.
  75. */
  76. public $substats;
  77. /**
  78. * Substat 1 of the rune.
  79. */
  80. public $substat_1;
  81. /**
  82. * Substat 1 value of the rune.
  83. */
  84. public $substat_1_value;
  85. /**
  86. * Ammount gained by the substat 1 enchant.
  87. */
  88. public $substat_1_craft;
  89. /**
  90. * Substat 2 of the rune.
  91. */
  92. public $substat_2;
  93. /**
  94. * Substat 2 value of the rune.
  95. */
  96. public $substat_2_value;
  97. /**
  98. * Ammount gained by the substat 2 enchant.
  99. */
  100. public $substat_2_craft;
  101. /**
  102. * Substat 3 of the rune.
  103. */
  104. public $substat_3;
  105. /**
  106. * Substat 3 value of the rune.
  107. */
  108. public $substat_3_value;
  109. /**
  110. * Ammount gained by the substat 3 enchant.
  111. */
  112. public $substat_3_craft;
  113. /**
  114. * Substat 4 of the rune.
  115. */
  116. public $substat_4;
  117. /**
  118. * Substat 4 value of the rune.
  119. */
  120. public $substat_4_value;
  121. /**
  122. * Ammount gained by the substat 4 enchant.
  123. */
  124. public $substat_4_craft;
  125. /**
  126. * Constructor.
  127. *
  128. * Searches the database and retrieves the information about the
  129. * rune, populating it and it's items.
  130. *
  131. * @param SQLite3 $db Connection to the database.
  132. * @param int $id Rune id.
  133. */
  134. public function __construct($db, $id){
  135. global $path;
  136. parent::__construct($db);
  137. $s =
  138. "SELECT " .
  139. " id, " .
  140. " assigned_to, " .
  141. " type, " .
  142. " slot, " .
  143. " stars, " .
  144. " level, " .
  145. " quality, " .
  146. " original_quality, " .
  147. " value, " .
  148. " efficiency, " .
  149. " max_efficiency, " .
  150. " main_stat, " .
  151. " main_stat_value, " .
  152. " innate_stat, " .
  153. " innate_stat_value, " .
  154. " substat_1, " .
  155. " substat_1_value, " .
  156. " substat_1_enchant, " .
  157. " substat_1_grind, " .
  158. " substat_2, " .
  159. " substat_2_value, " .
  160. " substat_2_enchant, " .
  161. " substat_2_grind, " .
  162. " substat_3, " .
  163. " substat_3_value, " .
  164. " substat_3_enchant, " .
  165. " substat_3_grind, " .
  166. " substat_4, " .
  167. " substat_4_value, " .
  168. " substat_4_enchant, " .
  169. " substat_4_grind " .
  170. "FROM rune " .
  171. "WHERE id = '$id'; ";
  172. $q = $this->db->query($s);
  173. $r = $q->fetchArray(SQLITE3_ASSOC);
  174. if ($r){
  175. $this->id = $r["id"];
  176. $this->assigned_to = $r["assigned_to"];
  177. $this->type = $r["type"];
  178. $this->slot = $r["slot"];
  179. $this->stars = $r["stars"];
  180. $this->level = $r["level"];
  181. $this->quality = $r["quality"];
  182. $this->original_quality = $r["original_quality"];
  183. $this->value = $r["value"];
  184. $this->efficiency = $r["efficiency"];
  185. $this->max_efficiency = $r["max_efficiency"];
  186. $this->main_stat = $r["main_stat"];
  187. $this->main_stat_value = $r["main_stat_value"];
  188. $this->innate_stat = $r["innate_stat"];
  189. $this->innate_stat_value = $r["innate_stat_value"];
  190. $this->substat_1 = $r["substat_1"];
  191. $this->substat_1_value = $r["substat_1_value"];
  192. $this->substat_1_enchant = $r["substat_1_enchant"];
  193. $this->substat_1_grind = $r["substat_1_grind"];
  194. $this->substat_2 = $r["substat_2"];
  195. $this->substat_2_value = $r["substat_2_value"];
  196. $this->substat_2_enchant = $r["substat_2_enchant"];
  197. $this->substat_2_grind = $r["substat_2_grind"];
  198. $this->substat_3 = $r["substat_3"];
  199. $this->substat_3_value = $r["substat_3_value"];
  200. $this->substat_3_enchant = $r["substat_3_enchant"];
  201. $this->substat_3_grind = $r["substat_3_grind"];
  202. $this->substat_4 = $r["substat_4"];
  203. $this->substat_4_value = $r["substat_4_value"];
  204. $this->substat_4_enchant = $r["substat_4_enchant"];
  205. $this->substat_4_grind = $r["substat_4_grind"];
  206. }
  207. }
  208. }
  209. ?>