query($s); $r = $q->fetchArray(SQLITE3_ASSOC); if ($r){ $this->id = $r["id"]; $this->gem = $r["gem"]; $this->quality = $r["quality"]; $this->quality_name = $this->quality_name($r["quality"]); $this->stat = $r["stat"]; $this->stat_name = $this->stat_name($r["stat"]); $this->ancient = $r["ancient"]; $this->inmemorial = $r["inmemorial"]; if ($this->inmemorial == 0){ $this->rune = new K_Rune_Set($r["rune"]); $this->name = $this->rune->name . " " . $r["stat"]; } else{ $this->name = "Inmemorial " . $r["stat"]; } $this->min = $r["min"]; $this->max = $r["max"]; $this->value = $r["value"]; $this->amount = $r["amount"]; } } /** * Gets a stat name from the maps. * * @param int $stat Stat id. * @return string Stat name (Uppercase) */ private function stat_name($stat){ switch ($stat){ case RUNE_STAT_ID::HP: return "HP"; case RUNE_STAT_ID::HP_P: return "HP%"; case RUNE_STAT_ID::ATK: return "ATK"; case RUNE_STAT_ID::ATK_P: return "ATK%"; case RUNE_STAT_ID::DEF: return "DEF"; case RUNE_STAT_ID::DEF_P: return "DEF%"; case RUNE_STAT_ID::SPD: return "SPD"; case RUNE_STAT_ID::CRR: return "CRR"; case RUNE_STAT_ID::CRD: return "CRD"; case RUNE_STAT_ID::RES: return "RES"; case RUNE_STAT_ID::ACC: return "ACC"; default: return ""; } } /** * Gets a stat name from the maps. * * @param int $q Quality id. * @return string Quality (Uppercase) */ private function quality_name($q){ switch ($q){ case QUALITY_ID::NORMAL: return "NORMAL"; case QUALITY_ID::MAGIC: return "MAGIC"; case QUALITY_ID::RARE: return "RARE"; case QUALITY_ID::HERO: return "HERO"; case QUALITY_ID::LEGEND: return "LEGEND"; default: return ""; } } } ?>