Rune.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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. * Rune identifier.
  11. */
  12. public $id;
  13. /**
  14. * Rune official identifier.
  15. */
  16. public $com2us_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. * Remaining substats to gain.
  51. */
  52. public $substat_upgrades_remaining;
  53. /**
  54. * Current efficiency of the rune.
  55. */
  56. public $efficiency;
  57. /**
  58. * Maximum potential efficiency of the rune.
  59. */
  60. public $max_efficiency;
  61. /**
  62. * Main stat of the rune.
  63. */
  64. public $main_stat;
  65. /**
  66. * Main stat value of the rune.
  67. */
  68. public $main_stat_value;
  69. /**
  70. * Extra stat of the rune.
  71. */
  72. public $innate_stat;
  73. /**
  74. * Extra stat value of the rune.
  75. */
  76. public $innate_stat_value;
  77. /**
  78. * Number of substats.
  79. */
  80. public $substats;
  81. /**
  82. * Substat 1 of the rune.
  83. */
  84. public $substat_1;
  85. /**
  86. * Substat 1 value of the rune.
  87. */
  88. public $substat_1_value;
  89. /**
  90. * Ammount gained by the substat 1 enchant.
  91. */
  92. public $substat_1_craft;
  93. /**
  94. * Substat 2 of the rune.
  95. */
  96. public $substat_2;
  97. /**
  98. * Substat 2 value of the rune.
  99. */
  100. public $substat_2_value;
  101. /**
  102. * Ammount gained by the substat 2 enchant.
  103. */
  104. public $substat_2_craft;
  105. /**
  106. * Substat 3 of the rune.
  107. */
  108. public $substat_3;
  109. /**
  110. * Substat 3 value of the rune.
  111. */
  112. public $substat_3_value;
  113. /**
  114. * Ammount gained by the substat 3 enchant.
  115. */
  116. public $substat_3_craft;
  117. /**
  118. * Substat 4 of the rune.
  119. */
  120. public $substat_4;
  121. /**
  122. * Substat 4 value of the rune.
  123. */
  124. public $substat_4_value;
  125. /**
  126. * Ammount gained by the substat 4 enchant.
  127. */
  128. public $substat_4_craft;
  129. /**
  130. * Constructor.
  131. *
  132. * Searches the database and retrieves the information about the
  133. * rune, populating it and it's items.
  134. *
  135. * @param SQLite3 $db Connection to the database.
  136. * @param int $id Rune id.
  137. */
  138. public function __construct($db, $id){
  139. global $path;
  140. parent::__construct($db);
  141. $s =
  142. "SELECT " .
  143. " id, " .
  144. " com2us_id, " .
  145. " assigned_to, " .
  146. " type, " .
  147. " slot, " .
  148. " stars, " .
  149. " level, " .
  150. " quality, " .
  151. " original_quality, " .
  152. " value, " .
  153. " substat_upgrades_remaining, " .
  154. " efficiency, " .
  155. " max_efficiency, " .
  156. " main_stat, " .
  157. " main_stat_value, " .
  158. " innate_stat, " .
  159. " innate_stat_value, " .
  160. " substat_1, " .
  161. " substat_1_value, " .
  162. " substat_1_craft, " .
  163. " substat_2, " .
  164. " substat_2_value, " .
  165. " substat_2_craft, " .
  166. " substat_3, " .
  167. " substat_3_value, " .
  168. " substat_3_craft, " .
  169. " substat_4, " .
  170. " substat_4_value, " .
  171. " substat_4_craft " .
  172. "FROM rune " .
  173. "WHERE id = '$id'; ";
  174. $q = $this->db->query($s);
  175. $r = $q->fetchArray(SQLITE3_ASSOC);
  176. if ($r){
  177. $this->id = $r["id"];
  178. $this->com2us_id = $r["com2us_id"];
  179. $this->assigned_to = $r["assigned_to"];
  180. $this->type = $r["type"];
  181. $this->slot = $r["slot"];
  182. $this->stars = $r["stars"];
  183. $this->level = $r["level"];
  184. //$this->runeset = $r["runeset"];
  185. $this->quality = $r["quality"];
  186. $this->original_quality = $r["original_quality"];
  187. $this->value = $r["value"];
  188. $this->substat_upgrades_remaining = $r["substat_upgrades_remaining"];
  189. $this->efficiency = $r["efficiency"];
  190. $this->max_efficiency = $r["max_efficiency"];
  191. $this->main_stat = $r["main_stat"];
  192. $this->main_stat_value = $r["main_stat_value"];
  193. $this->innate_stat = $r["innate_stat"];
  194. $this->innate_stat_value = $r["innate_stat_value"];
  195. $this->substat_1 = $r["substat_1"];
  196. $this->substat_1_value = $r["substat_1_value"];
  197. $this->substat_1_craft = $r["substat_1_craft"];
  198. $this->substat_2 = $r["substat_2"];
  199. $this->substat_2_value = $r["substat_2_value"];
  200. $this->substat_2_craft = $r["substat_2_craft"];
  201. $this->substat_3 = $r["substat_3"];
  202. $this->substat_3_value = $r["substat_3_value"];
  203. $this->substat_3_craft = $r["substat_3_craft"];
  204. $this->substat_4 = $r["substat_4"];
  205. $this->substat_4_value = $r["substat_4_value"];
  206. $this->substat_4_craft = $r["substat_4_craft"];
  207. }
  208. }
  209. }
  210. ?>