db->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($this->db, $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"]; } } /** * Gets a stat name from the maps. * * @param int $stat Stat id. * @return string Stat name (Uppercase) */ private function stat_name($stat){ global $RUNE_STAT; switch ($stat){ case $RUNE_STAT["HP"]: return "HP"; case $RUNE_STAT["HP%"]: return "HP%"; case $RUNE_STAT["ATK"]: return "ATK"; case $RUNE_STAT["ATK%"]: return "ATK%"; case $RUNE_STAT["DEF"]: return "DEF"; case $RUNE_STAT["DEF%"]: return "DEF%"; case $RUNE_STAT["SPD"]: return "SPD"; case $RUNE_STAT["CRR"]: return "CRR"; case $RUNE_STAT["CRD"]: return "CRD"; case $RUNE_STAT["RES"]: return "RES"; case $RUNE_STAT["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){ global $QUALITY; switch ($q){ case $QUALITY["NORMAL"]: return "NORMAL"; case $QUALITY["MAGIC"]: return "MAGIC"; case $QUALITY["RARE"]: return "RARE"; case $QUALITY["HERO"]: return "HERO"; case $QUALITY["LEGEND"]: return "LEGEND"; default: return ""; } } } ?>