| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- <?php
- require_once($path["entity"] . "Entity.php");
- /**
- * Owned rune.
- *
- * Represents an object from the table 'rune'.
- */
- class Rune extends Entity{
- /**
- * Owner identifier.
- */
- public $uid;
- /**
- * Rune identifier.
- */
- public $id;
- /**
- * ID of the monster the rune is assigned to.
- */
- public $assigned_to;
- /**
- * Name of the set.
- */
- public $type;
- /**
- * Position of the rune type (1-6).
- */
- public $slot;
- /**
- * Rune stars.
- */
- public $stars;
- /**
- * Level of the rune.
- */
- public $level;
- /**
- * Rune quality.
- */
- public $quality;
- /**
- * Rune original quality.
- */
- public $original_quality;
- /**
- * Price of the rune.
- */
- public $value;
- /**
- * Current efficiency of the rune.
- */
- public $efficiency;
- /**
- * Maximum potential efficiency of the rune.
- */
- public $max_efficiency;
- /**
- * Main stat of the rune.
- */
- public $main_stat;
- /**
- * Main stat value of the rune.
- */
- public $main_stat_value;
- /**
- * Extra stat of the rune.
- */
- public $innate_stat;
- /**
- * Extra stat value of the rune.
- */
- public $innate_stat_value;
- /**
- * Number of substats.
- */
- public $substats;
- /**
- * Substat 1 of the rune.
- */
- public $substat_1;
- /**
- * Substat 1 value of the rune.
- */
- public $substat_1_value;
- /**
- * Ammount gained by the substat 1 enchant.
- */
- public $substat_1_craft;
- /**
- * Substat 2 of the rune.
- */
- public $substat_2;
- /**
- * Substat 2 value of the rune.
- */
- public $substat_2_value;
- /**
- * Ammount gained by the substat 2 enchant.
- */
- public $substat_2_craft;
- /**
- * Substat 3 of the rune.
- */
- public $substat_3;
- /**
- * Substat 3 value of the rune.
- */
- public $substat_3_value;
- /**
- * Ammount gained by the substat 3 enchant.
- */
- public $substat_3_craft;
- /**
- * Substat 4 of the rune.
- */
- public $substat_4;
- /**
- * Substat 4 value of the rune.
- */
- public $substat_4_value;
- /**
- * Ammount gained by the substat 4 enchant.
- */
- public $substat_4_craft;
- /**
- * Constructor.
- *
- * Searches the database and retrieves the information about the
- * rune, populating it and it's items.
- *
- * @param SQLite3 $db Connection to the database.
- * @param int $id Rune id.
- */
- public function __construct($db, $id){
- global $path;
- parent::__construct($db);
- $s =
- "SELECT " .
- " id, " .
- " assigned_to, " .
- " type, " .
- " slot, " .
- " stars, " .
- " level, " .
- " quality, " .
- " original_quality, " .
- " value, " .
- " efficiency, " .
- " max_efficiency, " .
- " main_stat, " .
- " main_stat_value, " .
- " innate_stat, " .
- " innate_stat_value, " .
- " substat_1, " .
- " substat_1_value, " .
- " substat_1_enchant, " .
- " substat_1_grind, " .
- " substat_2, " .
- " substat_2_value, " .
- " substat_2_enchant, " .
- " substat_2_grind, " .
- " substat_3, " .
- " substat_3_value, " .
- " substat_3_enchant, " .
- " substat_3_grind, " .
- " substat_4, " .
- " substat_4_value, " .
- " substat_4_enchant, " .
- " substat_4_grind " .
- "FROM rune " .
- "WHERE id = '$id'; ";
- $q = $this->db->query($s);
- $r = $q->fetchArray(SQLITE3_ASSOC);
- if ($r){
- $this->id = $r["id"];
- $this->assigned_to = $r["assigned_to"];
- $this->type = $r["type"];
- $this->slot = $r["slot"];
- $this->stars = $r["stars"];
- $this->level = $r["level"];
- $this->quality = $r["quality"];
- $this->original_quality = $r["original_quality"];
- $this->value = $r["value"];
- $this->efficiency = $r["efficiency"];
- $this->max_efficiency = $r["max_efficiency"];
- $this->main_stat = $r["main_stat"];
- $this->main_stat_value = $r["main_stat_value"];
- $this->innate_stat = $r["innate_stat"];
- $this->innate_stat_value = $r["innate_stat_value"];
- $this->substat_1 = $r["substat_1"];
- $this->substat_1_value = $r["substat_1_value"];
- $this->substat_1_enchant = $r["substat_1_enchant"];
- $this->substat_1_grind = $r["substat_1_grind"];
- $this->substat_2 = $r["substat_2"];
- $this->substat_2_value = $r["substat_2_value"];
- $this->substat_2_enchant = $r["substat_2_enchant"];
- $this->substat_2_grind = $r["substat_2_grind"];
- $this->substat_3 = $r["substat_3"];
- $this->substat_3_value = $r["substat_3_value"];
- $this->substat_3_enchant = $r["substat_3_enchant"];
- $this->substat_3_grind = $r["substat_3_grind"];
- $this->substat_4 = $r["substat_4"];
- $this->substat_4_value = $r["substat_4_value"];
- $this->substat_4_enchant = $r["substat_4_enchant"];
- $this->substat_4_grind = $r["substat_4_grind"];
- }
- }
- }
- ?>
|