db->query($s); $r = $q->fetchArray(SQLITE3_ASSOC); $this->id = $r["id"]; $this->attribute = $r["attribute"]; $this->amount = $r["amount"]; $this->area = $r["area"]; $this->element = $r["element"]; } public function get_image(){ global $base_dir; global $path; if (file_exists($base_dir . "img/content/skill_leader/" . str_pad($this->id, 4, '0', STR_PAD_LEFT) . ".png")){ return $path["img"]["content"] . "skill_leader/" . str_pad($this->id, 4, '0', STR_PAD_LEFT) . ".png"; } else{ return $path["img"]["layout"] . "unknown.png"; } } public function create_description(){ $s = "Increases the " . $this->attribute . " of ally monsters "; if (strlen($this->element) > 0){ $s = $s . " with " . $this->element . " attribute "; } $s = $s . " by " . $this->amount . "%"; switch ($this->area){ case "Dungeon": $s = $s . " in the Dungeons"; break; case "Arena": $s = $s . " in the Arena"; break; case "Guild": $s = $s . " in Guild content"; break; } $s = $s . "."; return $s; } } ?>