| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- require_once($path["entity"] . "Entity.php");
- /**
- * A rune set.
- *
- * Represents an object from the table 'k_rune_set'.
- */
- class K_Rune_Set extends Entity{
- /**
- * Set identifier.
- */
- public $id;
- /**
- * Set name.
- */
- public $name;
- /**
- * Required number of runes to activate the set.
- */
- public $amount;
- /**
- * Set description.
- */
- public $description;
- /**
- * Constructor.
- *
- * Searches the database and retrieves the information about the
- * skill level, populating it and it's items.
- *
- * @param SQLite3 $db Connection to the database.
- * @param int $skill Effect identifier.
- */
- public function __construct($db, $id){
- global $path;
- parent::__construct($db);
- $s =
- "SELECT " .
- " id, " .
- " name, " .
- " amount, " .
- " description " .
- "FROM k_rune_set " .
- "WHERE id = $id;";
- $q = $this->db->query($s);
- $r = $q->fetchArray(SQLITE3_ASSOC);
- if ($r){
- $this->id = $r["id"];
- $this->name = $r["name"];
- $this->amount = $r["amount"];
- $this->description = $r["description"];
- }
- }
- public function get_image(){
- global $base_dir;
- global $path;
- if (file_exists($base_dir . "img/layout/rune/" . str_pad($this->id, 2, '0', STR_PAD_LEFT) . ".png")){
- return $path["img"]["layout"] . "rune/" . str_pad($this->id, 2, '0', STR_PAD_LEFT) . ".png";
- }
- else{
- return $path["img"]["layout"] . "unknown.png";
- }
- }
- }
- ?>
|