Ver código fonte

Rift Raid run logger. Modifications across the site to refer to enchantments (they are no longer called craft, rune_craft, grinds, etc). SWEX plugin modified to read Rift Raid battles.

Iñigo Valentin 5 anos atrás
pai
commit
859c0baf0a

+ 3 - 3
application/API/v3/profile/PUT.php

@@ -555,7 +555,7 @@
         // Authenticate
         $uid = $json->{"wizard_id"};
         $uname = $json->{"wizard_info"}->{"wizard_name"};
-        $statement = $db->prepare("SELECT COUNT(uid) AS c FROM player WHERE uid = :uid AND api_key = :api_key';");
+        $statement = $db->prepare("SELECT COUNT(uid) AS c FROM player WHERE uid = :uid AND api_key = :api_key;");
         $statement->bindValue(":uid", $uid);
         $statement->bindValue(":api_key", $key);
         if (1 != $statement->execute()->fetchArray(SQLITE3_ASSOC)["c"]){
@@ -591,7 +591,7 @@
             "building",
             "decoration",
             "inventory",
-            "rune_craft"
+            "enchantment"
         ];
         foreach ($tables_to_clear as $table){
             $statement = $db->prepare("DELETE FROM $table WHERE uid = :uid;");
@@ -1020,7 +1020,7 @@
         // Parse enchantments
         foreach ($json->{"rune_craft_item_list"} as $item){
             $statement = $db->prepare("
-              INSERT INTO rune_craft (
+              INSERT INTO enchantment (
                 uid,
                 id,
                 type,

+ 430 - 23
application/API/v3/run/POST.php

@@ -171,34 +171,170 @@
      *
      * @param SQLiteConn $db Database connection.
      * @param int $uid Player UID.
+     * @param int $id Run ID.
      * @param JSON[] $json List of received JSONs.
      */
-    function log_cairos_run($db, $uid, $json){
-        // Only the result request and response JSONs are needed:
-        $response = $json["result_res"];
-        if ($json["result_req"] === null){
-            return ("400 Result request is required to parse Cairos runs.");
+    function log_rift_raid_run($db, $id, $uid, $json){
+        // Only the start and result requests JSONs are needed:
+        $result = $json["result_res"];
+        if ($json["start_res"] === null){
+            return ("400 Start response is required to parse Rift Raid runs.");
         }
-        $request = $json["result_req"];
+        $start = $json["start_res"];
 
-        // Check if already in DB
-        $dtime = $response->{"tvaluelocal"};
-        $statement = $db->prepare("SELECT count(id) AS c FROM run WHERE uid = :uid AND dtime = :dtime;");
+        // Prepare the "run" insert.
+        $statement = $db->prepare("
+          INSERT INTO run (
+            uid,
+            id,
+            dtime,
+            area_type,
+            area,
+            stage,
+            difficulty,
+            win,
+            time,
+            mana,
+            energy,
+            crystal,
+            guild_points,
+            helper,
+            score,
+            rank
+          ) VALUES (
+            :uid,
+            :id,
+            :dtime,
+            :area_type,
+            :area,
+            :stage,
+            :difficulty,
+            :win,
+            :time,
+            :mana,
+            :energy,
+            :crystal,
+            :guild_points,
+            :helper,
+            :score,
+            :rank
+          );
+        ");
+
+        // Bind data and insert
         $statement->bindValue(":uid", $uid);
-        $statement->bindValue(":dtime", $dtime);
-        if (0 != $statement->execute()->fetchArray(SQLITE3_ASSOC)["c"]){
-            return ("409 Run already in database.");
+        $statement->bindValue(":id", $id);
+        $statement->bindValue(":dtime", $result->{"tvaluelocal"});
+        $statement->bindValue(":area_type", AREA_TYPE_ID::RIFT_RAID);
+        $statement->bindValue(":area", AREA_TYPE_ID::RIFT_RAID);
+        $statement->bindValue(":stage", $start->{"battle_info"}->{"stage_id"});
+        $statement->bindValue(":difficulty", null);
+        $statement->bindValue(":win", $result->{"win_lose"});
+        if ($result->{"win_lose"} == 1){
+            $statement->bindValue(":time", $result->{"clear_time"}->{"current_time"});
+        }
+        else{
+            $statement->bindValue(":time", 1);
+        }
+        $statement->bindValue(":mana", 0); // If reward is mana, i will be updated later
+        $statement->bindValue(":energy", 0);
+        $statement->bindValue(":crystal", 0);
+        $statement->bindValue(":guild_points", 0);
+        $statement->bindValue(":helper", 0);
+        $statement->bindValue(":score", null);
+        $statement->bindValue(":rank", null);
+        $statement->execute();
+
+        // Parse various types of reward
+        if ($result->{"win_lose"} == 1 && array_key_exists("battle_reward_list", $result)){
+            foreach ($result->{"battle_reward_list"} as $reward_list){
+                if ($reward_list->{"wizard_id"} == $uid){
+                    $reward = $reward_list->{"reward_list"}[0];
+                    $reward_type = $reward->{"item_master_type"};
+                    switch ($reward_type){
+                        case INVENTORY_TYPE_ID::MONSTER: // Unit
+                            $statement = $db->prepare("INSERT INTO run_drop_unit (run, unit) VALUES (:run, :unit);");
+                            $statement->bindValue(":run", $id);
+                            $statement->bindValue(":unit", $reward->{"item_master_id"});
+                            $statement->execute();
+                            break;
+                        case INVENTORY_TYPE_ID::SCROLL:
+                        case INVENTORY_TYPE_ID::ESSENCES:
+                            $statement = $db->prepare("INSERT INTO run_drop_item (run, item, amount) VALUES (:run, :item, :amount);");
+                            $statement->bindValue(":run", $id);
+                            $statement->bindValue(":item", $reward->{"item_master_id"});
+                            $statement->bindValue(":amount", $reward->{"item_quantity"});
+                            $statement->execute();
+                            break;
+                        case INVENTORY_TYPE_ID::ENCHANTMENT:
+                            $statement = $db->prepare("
+                              INSERT INTO run_drop_enchantment (run, id, type, quality, rune, stat, value) 
+                              VALUES (:run, :id, :type, :quality, :rune, :stat, :value);
+                            ");
+                            $statement->bindValue(":run", $id);
+                            $statement->bindValue(":id", $reward->{"runecraft_item_id"});
+                            $statement->bindValue(":type", $reward->{"runecraft_type"});
+                            $statement->bindValue(":quality", $reward->{"runecraft_rank"});
+                            $statement->bindValue(":rune", $reward->{"runecraft_set_id"});
+                            $statement->bindValue(":stat", $reward->{"runecraft_effect_id"});
+                            $statement->bindValue(":value", 0);
+                            $statement->execute();
+                            break;
+                        case 102: //: Mana
+                            $statement = $db->prepare("UPDATE run SET mana = :mana WHERE run = :run;");
+                            $statement->bindValue(":run", $id);
+                            $statement->bindValue(":id", $reward->{"runecraft_item_id"});
+                            $statement->execute();
+                            break;
+                    }
+                }
+            }
         }
 
-        // Get new ID
-        $q = $db->query("SELECT max(id) + 1 AS id FROM run;");
-        $r = $q->fetchArray(SQLITE3_ASSOC);
-        if ($r){
-            $id = $r["id"];
+        // Parse party
+        foreach ($start->{"battle_info"}->{"user_list"} as $user){
+            if ($user->{"wizard_id"} == $uid){
+                foreach ($user->{"deck_list"} as $unit){
+                    $statement = $db->prepare("
+                      INSERT INTO run_party 
+                        (run, unit, k_unit, leader, front)
+                      VALUES
+                        (:run, :unit, :k_unit, :leader, :front);"
+                    );
+                    $statement->bindValue(":run", $id);
+                    $statement->bindValue(":unit", $unit->{"unit_info"}->{"unit_id"});
+                    $statement->bindValue(":k_unit", $unit->{"unit_info"}->{"unit_master_id"});
+                    $statement->bindValue(":leader", $unit->{"leader"});
+                    if (intval($unit->{"index"}) <= 4){
+                        $statement->bindValue(":front", 1);
+                    }
+                    else{
+                        $statement->bindValue(":front", 0);
+                    }
+                    $statement->execute();
+                }
+            }
         }
-        else{
-            $id = 1;
+
+        // Return success
+        return "201 Created.";
+    }
+
+    /**
+     * Parses the JSONs relateds to a cairos run and saves the data.
+     *
+     * @param SQLiteConn $db Database connection.
+     * @param int $uid Player UID.
+     * @param int $id Run ID.
+     * @param JSON[] $json List of received JSONs.
+     */
+    function log_cairos_run($db, $id, $uid, $json){
+        // Only the result request and response JSONs are needed:
+        $response = $json["result_res"];
+        if ($json["result_req"] === null){
+            return ("400 Result request is required to parse Cairos runs.");
         }
+        $request = $json["result_req"];
 
         // Prepare the "run" insert.
         $statement = $db->prepare("
@@ -242,7 +378,7 @@
         // Bind data and insert
         $statement->bindValue(":uid", $uid);
         $statement->bindValue(":id", $id);
-        $statement->bindValue(":dtime", $dtime);
+        $statement->bindValue(":dtime", $response->{"tvaluelocal"});
         $statement->bindValue(":area_type", AREA_TYPE_ID::CAIROS_DUNGEON);
         $statement->bindValue(":area", $request->{"dungeon_id"});
         $statement->bindValue(":stage", $request->{"stage_id"});
@@ -432,6 +568,248 @@
         return "201 Created.";
     }
 
+    /**
+     * Parses the JSONs relateds to a Dimension Hole run and saves the data.
+     *
+     * @param SQLiteConn $db Database connection.
+     * @param int $uid Player UID.
+     * @param int $id Run ID.
+     * @param JSON[] $json List of received JSONs.
+     */
+    function log_dimension_hole_run($db, $id, $uid, $json){
+        // Only the result request and response JSONs are needed:
+        $response = $json["result_res"];
+        if ($json["result_req"] === null){
+            return ("400 Result request is required to parse Cairos runs.");
+        }
+        $request = $json["result_req"];
+
+        // Prepare the "run" insert.
+        $statement = $db->prepare("
+          INSERT INTO run (
+            uid,
+            id,
+            dtime,
+            area_type,
+            area,
+            stage,
+            difficulty,
+            win,
+            time,
+            mana,
+            energy,
+            crystal,
+            guild_points,
+            helper,
+            score,
+            rank
+          ) VALUES (
+            :uid,
+            :id,
+            :dtime,
+            :area_type,
+            :area,
+            :stage,
+            :difficulty,
+            :win,
+            :time,
+            :mana,
+            :energy,
+            :crystal,
+            :guild_points,
+            :helper,
+            :score,
+            :rank
+          );
+        ");
+
+        // Bind data and insert
+        $statement->bindValue(":uid", $uid);
+        $statement->bindValue(":id", $id);
+        $statement->bindValue(":dtime", $response->{"tvaluelocal"});
+        $statement->bindValue(":area_type", AREA_TYPE_ID::DIMENSIONAL_HOLE);
+        $statement->bindValue(":area", $response->{"dungeon_id"});
+        $statement->bindValue(":stage", $response->{"difficulty"}); // Difficulty is stage
+        $statement->bindValue(":difficulty", null);
+        $statement->bindValue(":win", $response->{"win_lose"});
+        $statement->bindValue(":time", $response->{"clear_time"}->{"current_time"});
+        if (array_key_exists("mana", $response->{"reward"})){
+            $statement->bindValue(":mana", $response->{"reward"}->{"mana"});
+        }
+        else{
+            $statement->bindValue(":mana", 0);
+        }
+        if (array_key_exists("energy", $response->{"reward"})){
+            $statement->bindValue(":energy", $response->{"reward"}->{"energy"});
+        }
+        $statement->bindValue(":energy", 0);
+        if (array_key_exists("crystal", $response->{"reward"})){
+            $statement->bindValue(":crystal", $response->{"reward"}->{"crystal"});
+        }
+        else{
+            $statement->bindValue(":crystal", 0);
+        }
+        $statement->bindValue(":guild_points", 0);
+        $statement->bindValue(":helper", 0); // TODO Where is this information??
+        $statement->bindValue(":score", null);
+        $statement->bindValue(":rank", null);
+        $statement->execute();
+
+        // Parse various types of reward
+        if (array_key_exists("changed_item_list", $response)){
+            foreach ($response->{"changed_item_list"} as $drop){
+                $reward_type = $drop->{"type"};
+                switch ($reward_type){
+                    case INVENTORY_TYPE_ID::CRAFT_STUFF:
+                        $statement = $db->prepare("INSERT INTO run_drop_item (run, item, amount) VALUES (:run, :item, :amount);");
+                        $statement->bindValue(":run", $id);
+                        $statement->bindValue(":item", $drop->{"view"}->{"item_master_id"});
+                        $statement->bindValue(":amount", $drop->{"view"}->{"item_quantity"});
+                        $statement->execute();
+                        break;
+                    case INVENTORY_TYPE_ID::RUNE:
+                        // TODO: Investigate with no awaken dungeons
+                        /*$rune = $response->{"changed_item_list"}[0]->{"info"};
+                        $statement = $db->prepare("
+                          INSERT INTO run_drop_rune (
+                            run,
+                            id,
+                            type,
+                            slot,
+                            stars,
+                            ancient,
+                            quality,
+                            value,
+                            efficiency,
+                            max_efficiency,
+                            main_stat,
+                            main_stat_value,
+                            innate_stat,
+                            innate_stat_value,
+                            substat_1,
+                            substat_1_value,
+                            substat_2,
+                            substat_2_value,
+                            substat_3,
+                            substat_3_value,
+                            substat_4,
+                            substat_4_value
+                          ) VALUES (
+                            :run,
+                            :id,
+                            :type,
+                            :slot,
+                            :stars,
+                            :ancient,
+                            :quality,
+                            :value,
+                            :efficiency,
+                            :max_efficiency,
+                            :main_stat,
+                            :main_stat_value,
+                            :innate_stat,
+                            :innate_stat_value,
+                            :substat_1,
+                            :substat_1_value,
+                            :substat_2,
+                            :substat_2_value,
+                            :substat_3,
+                            :substat_3_value,
+                            :substat_4,
+                            :substat_4_value
+                        );
+                        ");
+                        $statement->bindValue(":run", $id);
+                        $statement->bindValue(":id", $rune->{"rune_id"});
+                        $statement->bindValue(":type", $rune->{"set_id"});
+                        $statement->bindValue(":slot", $rune->{"slot_no"});
+                        $statement->bindValue(":value", $rune->{"sell_value"});
+                        if ($rune->{"class"} > 10){
+                            // Ancient rune
+                            $statement->bindValue(":ancient", 1);
+                            $statement->bindValue(":stars", intval($rune->{"class"}) - 10);
+                            $statement->bindValue(":quality", intval($rune->{"rank"}) - 10);
+                        }
+                        else{
+                            // Non Ancient rune
+                            $statement->bindValue(":ancient", 0);
+                            $statement->bindValue(":stars", $rune->{"class"});
+                            $statement->bindValue(":quality", $rune->{"rank"});
+                        }
+                        $efficiency = calculate_efficiency($rune);
+                        $max_efficiency = calculate_maximum_efficiency($rune);
+                        $statement->bindValue(":efficiency", $efficiency);
+                        $statement->bindValue(":max_efficiency", $max_efficiency);
+                        $statement->bindValue(":main_stat", $rune->{"pri_eff"}[0]);
+                        $statement->bindValue(":main_stat_value", $rune->{"pri_eff"}[1]);
+                        if ($rune->{"prefix_eff"}[0] > 0){
+                            $statement->bindValue(":innate_stat", $rune->{"prefix_eff"}[0]);
+                            $statement->bindValue(":innate_stat_value", $rune->{"prefix_eff"}[1]);
+                        }
+                        else{
+                            $statement->bindValue(":innate_stat", null);
+                            $statement->bindValue(":innate_stat_value", 0);
+                        }
+                        if (sizeof($rune->{"sec_eff"}) > 0){
+                            $statement->bindValue(":substat_1", $rune->{"sec_eff"}[0][0]);
+                            $statement->bindValue(":substat_1_value", $rune->{"sec_eff"}[0][1]);
+                        }
+                        else{
+                            $statement->bindValue(":substat_1", null);
+                            $statement->bindValue(":substat_1_value", 0);
+                        }
+                        if (sizeof($rune->{"sec_eff"}) > 1){
+                            $statement->bindValue(":substat_2", $rune->{"sec_eff"}[1][0]);
+                            $statement->bindValue(":substat_2_value", $rune->{"sec_eff"}[1][1]);
+                        }
+                        else{
+                            $statement->bindValue(":substat_2", null);
+                            $statement->bindValue(":substat_2_value", 0);
+                        }
+                        if (sizeof($rune->{"sec_eff"}) > 2){
+                            $statement->bindValue(":substat_3", $rune->{"sec_eff"}[2][0]);
+                            $statement->bindValue(":substat_3_value", $rune->{"sec_eff"}[2][1]);
+                        }
+                        else{
+                            $statement->bindValue(":substat_3", null);
+                            $statement->bindValue(":substat_3_value", 0);
+                        }
+                        if (sizeof($rune->{"sec_eff"}) > 3){
+                            $statement->bindValue(":substat_4", $rune->{"sec_eff"}[3][0]);
+                            $statement->bindValue(":substat_4_value", $rune->{"sec_eff"}[3][1]);
+                        }
+                        else{
+                            $statement->bindValue(":substat_4", null);
+                            $statement->bindValue(":substat_4_value", 0);
+                        }
+                        $statement->execute();*/
+                        break;
+                }
+            }
+        }
+
+        // Parse party
+        $leader = 1;
+        foreach ($response->{"unit_list"} as $unit){
+            $statement = $db->prepare("
+              INSERT INTO run_party 
+                (run, unit, k_unit, leader, front)
+              VALUES
+                (:run, :unit, :k_unit, :leader, :front);"
+            );
+            $statement->bindValue(":run", $id);
+            $statement->bindValue(":unit", $unit->{"unit_id"});
+            $statement->bindValue(":k_unit", $unit->{"unit_master_id"});
+            $statement->bindValue(":leader", $leader);
+            $leader = 0;
+            $statement->bindValue(":front", 0);
+            $statement->execute();
+        }
+
+        // Return success
+        return "201 Created.";
+    }
+
     global $db;
 
     try{
@@ -507,7 +885,7 @@
         $command = $json["result_res"]->{"command"};
 
         // Authenticate
-        $statement = $db->prepare("SELECT COUNT(uid) AS c FROM player WHERE uid = :uid AND api_key = :api_key';");
+        $statement = $db->prepare("SELECT COUNT(uid) AS c FROM player WHERE uid = :uid AND api_key = :api_key;");
         $statement->bindValue(":uid", $uid);
         $statement->bindValue(":api_key", $key);
         if (1 != $statement->execute()->fetchArray(SQLITE3_ASSOC)["c"]){
@@ -518,7 +896,9 @@
 
         // Check for implemented command
         $accepted_commands = [
-            "BattleDungeonResult_V2" // Dungeon RUN
+            "BattleDungeonResult_V2", // Dungeon Run
+            "BattleDimensionHoleDungeonResult_v2", // Dimension Hole Run
+            "BattleRiftOfWorldsRaidResult" // Rift Raid Run
         ];
         if (!in_array($command, $accepted_commands)){
             header("HTTP/1.1 405 Command not implemented.");
@@ -526,11 +906,38 @@
             return 405;
         }
 
+        // Check if already in DB
+        $dtime = $json["result_res"]->{"tvaluelocal"};
+        $statement = $db->prepare("SELECT count(id) AS c FROM run WHERE uid = :uid AND dtime = :dtime;");
+        $statement->bindValue(":uid", $uid);
+        $statement->bindValue(":dtime", $dtime);
+        if (0 != $statement->execute()->fetchArray(SQLITE3_ASSOC)["c"]){
+            header("HTTP/1.1 409 Run already in database.");
+            syslog(LOG_INFO, "[APIv3] HTTP/1.1 409 Run already in database.");
+            return 409;
+        }
+
+        // Get new ID
+        $q = $db->query("SELECT max(id) + 1 AS id FROM run;");
+        $r = $q->fetchArray(SQLITE3_ASSOC);
+        if ($r){
+            $id = $r["id"];
+        }
+        else{
+            $id = 1;
+        }
+
         // Run parsing function
         $result = "500 Unknown Error";
         switch($command){
             case "BattleDungeonResult_V2":
-                $result = log_cairos_run($db, $uid, $json);
+                $result = log_cairos_run($db, $id, $uid, $json);
+                break;
+            case "BattleDimensionHoleDungeonResult_v2":
+                $result = log_dimension_hole_run($db, $id, $uid, $json);
+                break;
+            case "BattleRiftOfWorldsRaidResult":
+                $result = log_rift_raid_run($db, $id, $uid, $json);
                 break;
         }
 

+ 2 - 2
application/Constant.php

@@ -1019,9 +1019,9 @@
         const RAINBOWMON = 25;   # Possibly material monsters in general. Appears when wish returns a rainbowmon.
 
         /**
-         * Rune Craft.
+         * Enchantment.
          */
-        const RUNE_CRAFT = 27;
+        const ENCHANTMENT = 27;
 
         /**
          * Craft Stuff.

+ 3 - 3
application/Controller.php

@@ -288,9 +288,9 @@
                         require_once(PATH::PAGE . "Report_Skillup_Page.php");
                         $page = new Report_Skillup_Page($pars[1]);
                     }
-                    elseif (strtoupper($pars[1]) == "RUNECRAFT"){
-                        require_once(PATH::PAGE . "Report_Runecraft_Page.php");
-                        $page = new Report_Runecraft_Page($pars[1]);
+                    elseif (strtoupper($pars[1]) == "RUNE_ENCHANTMENT"){
+                        require_once(PATH::PAGE . "Report_Rune_Enchantment_Page.php");
+                        $page = new Report_Rune_Enchantment_Page($pars[1]);
                     }
                 }
                 elseif (strtoupper($pars[0]) == "OPTIMIZER"){

+ 41 - 26
application/entity/Rune_Craft.php → application/entity/Enchantment.php

@@ -1,6 +1,6 @@
 <?php
     /**
-     * Rune craft items entity file.
+     * Enchantments items entity file.
      *
      * Creates the entity and makes it available.
      *
@@ -14,13 +14,13 @@
     require_once(PATH::ENTITY . "K_Rune_Set.php");
 
     /**
-     * Owned rune craft item.
+     * Owned enchantments.
      *
-     * Represents an object from the table 'rune_craft'.
+     * Represents an object from the table 'enchantment'.
      *
      * @category Entity
      */
-    class Rune_Craft extends Entity{
+    class Enchantment extends Entity{
 
         /**
          * @var int Owner identifier.
@@ -116,30 +116,30 @@
 
             $s = "
               SELECT
-                rune_craft.id AS id,
-                rune_craft.quality As quality,
-                rune_craft.rune AS rune,
-                rune_craft.stat AS stat,
-                rune_craft.value AS value,
-                rune_craft.amount AS amount,
-                k_rune_craft_type.name AS name,
-                k_rune_craft_type.gem AS gem,
-                k_rune_craft_type.inmemorial AS inmemorial,
-                k_rune_craft_type.ancient AS ancient,
-                k_rune_craft_range.min AS min,
-                k_rune_craft_range.max AS max
+                enchantment.id AS id,
+                enchantment.quality As quality,
+                enchantment.rune AS rune,
+                enchantment.stat AS stat,
+                enchantment.value AS value,
+                enchantment.amount AS amount,
+                k_enchantment_type.name AS name,
+                k_enchantment_type.gem AS gem,
+                k_enchantment_type.inmemorial AS inmemorial,
+                k_enchantment_type.ancient AS ancient,
+                k_enchantment_range.min AS min,
+                k_enchantment_range.max AS max
               FROM
-                rune_craft,
-                k_rune_craft_type,
-                k_rune_craft_range
+                enchantment,
+                k_enchantment_type,
+                k_enchantment_range
               WHERE
-                rune_craft.id = $id AND
-                rune_craft.type = k_rune_craft_type.id AND
-                k_rune_craft_type.gem = k_rune_craft_range.gem AND
-                k_rune_craft_type.gem = k_rune_craft_range.gem AND
-                k_rune_craft_type.ancient = k_rune_craft_range.ancient AND
-                rune_craft.quality = k_rune_craft_range.quality AND
-                rune_craft.stat = k_rune_craft_range.stat;
+                enchantment.id = $id AND
+                enchantment.type = k_enchantment_type.id AND
+                k_enchantment_type.gem = k_enchantment_range.gem AND
+                k_enchantment_type.gem = k_enchantment_range.gem AND
+                k_enchantment_type.ancient = k_enchantment_range.ancient AND
+                enchantment.quality = k_enchantment_range.quality AND
+                enchantment.stat = k_enchantment_range.stat;
             ";
             $q = $db->query($s);
             $r = $q->fetchArray(SQLITE3_ASSOC);
@@ -224,5 +224,20 @@
             }
         }
 
+        /**
+         * Calculates name variables.
+         */
+        public function refresh_names(){
+            $this->stat_name = $this->stat_name($this->stat);
+            $this->quality_name = $this->quality_name($this->quality);
+            $this->name = $this->rune->name . " " . $this->stat;
+            if ($this->inmemorial == 0){
+                $this->name = $this->rune->name . " " . $this->stat;
+            }
+            else{
+                $this->name = "Inmemorial " . $this->stat;
+            }
+        }
+
     }
 ?>

+ 3 - 3
application/entity/K_Area.php

@@ -88,6 +88,9 @@
                 // Hall of Heroes
                 return APPLICATION::img("AREA", "HOH");
             }
+            elseif ($this->type == AREA_TYPE_ID::RIFT_RAID){
+                return APPLICATION::img("UNIT", 44007);
+            }
             elseif (
                 $this->type == AREA_TYPE_ID::SCENARIO ||
                 $this->type == AREA_TYPE_ID::ARENA ||
@@ -159,9 +162,6 @@
                         break;
                 }
             }
-            elseif ($this->type == AREA_TYPE_ID::RIFT_RAID){
-                return APPLICATION::img("UNIT", 44007);
-            }
             elseif ($this->type == AREA_TYPE_ID::DIMENSIONAL_HOLE){
                 switch ($this->id){
                     case DUNGEON_ID::FOREST_OF_ROARING_BEASTS:

+ 1 - 1
application/entity/Player.php

@@ -336,7 +336,7 @@
                   inventory
                 WHERE
                   inventory.uid = '$UID' AND
-                  inventory.type = " . INVENTORY_TYPE_ID::RUNE_CRAFT . " AND
+                  inventory.type = " . INVENTORY_TYPE_ID::ENCHANTMENT . " AND
                   amount > 0
                 ORDER BY inventory.id;
             ";

+ 63 - 18
application/entity/Run.php

@@ -14,6 +14,7 @@
     require_once(PATH::ENTITY . "Unit.php");
     require_once(PATH::ENTITY . "K_Unit.php");
     require_once(PATH::ENTITY . "Rune.php");
+    require_once(PATH::ENTITY . "Enchantment.php");
     require_once(PATH::ENTITY . "Inventory.php");
     require_once(PATH::ENTITY . "K_Area.php");
     require_once(PATH::ENTITY . "K_Rune_Set.php");
@@ -146,7 +147,12 @@
         /**
          * @var \Rune[] List of Runes dropped.
          */
-        public $rune= [];
+        public $rune = [];
+
+        /**
+         * @var \Enchantment[] List of Enchantments dropped.
+         */
+        public $enchantment = [];
 
         /**
          * Constructor.
@@ -166,6 +172,7 @@
                   id,
                   uid,
                   dtime,
+                  area_type,
                   area,
                   stage,
                   difficulty,
@@ -185,23 +192,7 @@
             $this->id = $r["id"];
             $this->uid = $r["uid"];
             $this->dtime = $r["dtime"];
-            $type = 0;
-            if (APPLICATION::valid_id("RAID_RIFT_DUNGEON_ID", $r["area"]) && $r["stage"] < 1){
-                $type = AREA_TYPE_ID::RIFT_RAID_DUNGEON;
-            }
-            elseif (APPLICATION::valid_id("SCENARIO_ID", $r["area"])){
-                $type = AREA_TYPE_ID::SCENARIO;
-            }
-            elseif (APPLICATION::valid_id("ELEMENTAL_RIFT_DUNGEON_ID", $r["area"]) && $r["stage"] < 1){
-                $type = AREA_TYPE_ID::RIFT_DUNGEON;
-            }
-            elseif (APPLICATION::valid_id("CAIROS_DUNGEON_ID", $r["area"])){
-                $type = AREA_TYPE_ID::CAIROS_DUNGEON;
-            }
-            elseif (APPLICATION::valid_id("DIMENSION_DUNGEON_ID", $r["area"])){
-                $type = AREA_TYPE_ID::DIMENSIONAL_HOLE;
-            }
-            $this->area = new K_Area($r["area"], $type);
+            $this->area = new K_Area($r["area"], $r["area_type"]);
             $this->stage = $r["stage"];
             $this->difficulty = $r["difficulty"];
             $this->win = $r["win"];
@@ -363,6 +354,60 @@
                 }
                 array_push($this->rune, $rune);
             }
+            $s = "
+              SELECT
+                run_drop_enchantment.id AS id,
+                type,
+                run_drop_enchantment.quality AS quality,
+                rune,
+                run_drop_enchantment.stat AS stat,
+                value,
+                k_enchantment_type.inmemorial AS inmemorial,
+                k_enchantment_type.ancient AS ancient,
+                k_enchantment_range.min AS min,
+                k_enchantment_range.max AS max
+              FROM
+                run_drop_enchantment,
+                k_enchantment_type,
+                k_enchantment_range
+              WHERE
+                run = $this->id AND
+                run_drop_enchantment.type = k_enchantment_type.id AND
+                k_enchantment_type.gem = k_enchantment_range.gem AND
+                k_enchantment_type.gem = k_enchantment_range.gem AND
+                k_enchantment_type.ancient = k_enchantment_range.ancient AND
+                run_drop_enchantment.quality = k_enchantment_range.quality AND
+                run_drop_enchantment.stat = k_enchantment_range.stat;
+              ;
+            ";
+            $q = $db->query($s);
+            while ($r = $q->fetchArray(SQLITE3_ASSOC)){
+                $enchantment = new Enchantment($r["id"]);
+                if (!isset($enchantment->id)){
+                    $enchantment->id = $r["id"];
+                    if ($r["type"] == CRAFT_ID::ENCHANT_GEM || $r["type"] == CRAFT_ID::IMMEMORIAL_GEM){
+                        $enchantment->gem = 1;
+                    }
+                    else{
+                        $enchantment->gem = 0;
+                    }
+                    $enchantment->quality = $r["quality"];
+                    $enchantment->value = 0;
+                    $enchantment->stat = $r["stat"];
+                    $enchantment->ancient = $r["ancient"];
+                    $enchantment->inmemorial = $r["inmemorial"];
+                    $enchantment->rune = new K_Rune_Set($r["rune"]);
+                    $enchantment->min = $r["min"];
+                    $enchantment->max = $r["max"];
+                    $enchantment->value = $r["value"];
+                    $enchantment->amount = 0;
+                    $enchantment->refresh_names();
+                }
+                else{
+                    $enchantment->amount = 0;
+                }
+                array_push($this->enchantment, $enchantment);
+            }
         }
 
     }

+ 24 - 22
application/helper/HTML_Helper.php

@@ -19,7 +19,7 @@
     require_once(PATH::ENTITY . "K_Decoration.php");
     require_once(PATH::ENTITY . "Rune.php");
     require_once(PATH::ENTITY . "Artifact.php");
-    require_once(PATH::ENTITY . "Rune_Craft.php");
+    require_once(PATH::ENTITY . "Enchantment.php");
     require_once(PATH::ENTITY . "Inventory.php");
 
     /**
@@ -559,16 +559,16 @@
         /**
          * Generates a grindstone or gem panel.
          * 
-         * @param Rune_Craft craft Entity to get the info from.
+         * @param Enchantment Entity to get the info from.
          * @return string HTML content for a rune panel. Empty on error.
          */
-        public static function craft_panel($craft) {
-            if (!($craft instanceof Rune_Craft)){
+        public static function enchantment_panel($enchantment) {
+            if (!($enchantment instanceof Enchantment)){
                 return "";
             }
             $html = "";
-            if ($craft->gem == 1){
-                if ($craft->inmemorial == 1){
+            if ($enchantment->gem == 1){
+                if ($enchantment->inmemorial == 1){
                     $base = URL::IMG["GRIND"] . "gem_inmemorial.png";
                 }
                 else{
@@ -576,37 +576,39 @@
                 }
             }
             else{
-                if ($craft->inmemorial == 1){
+                if ($enchantment->inmemorial == 1){
                     $base = URL::IMG["GRIND"] . "grind_inmemorial.png";
                 }
                 else{
                     $base = URL::IMG["GRIND"] . "grind.png";
                 }
             }
-            if ($craft->inmemorial == 0 && isset($craft->rune)){
-                $icon = "<img class='craft_icon' src='" . $craft->rune->get_image() . "'/>\n";
+            if ($enchantment->inmemorial == 0 && isset($enchantment->rune)){
+                $icon = "<img class='enchantment_icon' src='" . $enchantment->rune->get_image() . "'/>\n";
             }
             else{
                 $icon = "";
             }
-            if (in_array($craft->stat_name, array("CRR", "CRD", "RES", "ACC", "HP%", "ATK%", "DEF%"))){
-                $stat_name = str_replace("%", "", $craft->stat_name);
-                $stat_value = "+" . $craft->min . "~" . $craft->max . "%";
+            if (in_array($enchantment->stat_name, array("CRR", "CRD", "RES", "ACC", "HP%", "ATK%", "DEF%"))){
+                $stat_name = str_replace("%", "", $enchantment->stat_name);
+                $stat_value = "+" . $enchantment->min . "~" . $enchantment->max . "%";
             }
             else{
-                $stat_name = $craft->stat_name;
-                $stat_value = "+" . $craft->min . "~" . $craft->max;
+                $stat_name = $enchantment->stat_name;
+                $stat_value = "+" . $enchantment->min . "~" . $enchantment->max;
             }
-            $html .= "<div class='craft_panel craft_quality_" . strtolower($craft->quality_name) . " rune_ancient_" . $craft->ancient . "'>\n";
-            $html .= "<img class='craft_base' src='" . $base . "'/>\n";
+            $html .= "<div class='enchantment_panel enchantment_quality_" . strtolower($enchantment->quality_name) . " enchantment_ancient_" . $enchantment->ancient . "'>\n";
+            $html .= "<img class='enchantment_base' src='" . $base . "'/>\n";
             $html .= $icon;
-            $html .= "<span class='craft_stat'>\n";
-            $html .= "<span class='craft_stat_name'>" . $stat_name . "</span>\n";
-            $html .= "<span class='craft_stat_value'>" . $stat_value . "</span>\n";
-            $html .= "</span>\n";
-            $html .= "<span class='craft_amount'>\n";
-            $html .= "x" . $craft->amount . "\n";
+            $html .= "<span class='enchantment_stat'>\n";
+            $html .= "<span class='enchantment_stat_name'>" . $stat_name . "</span>\n";
+            $html .= "<span class='enchantment_stat_value'>" . $stat_value . "</span>\n";
             $html .= "</span>\n";
+            if ($enchantment->amount > 0){
+                $html .= "<span class='enchantment_amount'>\n";
+                $html .= "x" . $enchantment->amount . "\n";
+                $html .= "</span>\n";
+            }
             $html .= "</div>\n";
             return $html;
         }

+ 6 - 6
application/page/Enchantments_Page.php

@@ -13,7 +13,7 @@
      */
     require_once(PATH::PAGE . "Page.php");
     require_once(PATH::ENTITY . "Custom_Filter.php");
-    require_once(PATH::ENTITY . "Rune_Craft.php");
+    require_once(PATH::ENTITY . "Enchantment.php");
 
     /**
      * Enchantment list page model.
@@ -23,12 +23,12 @@
     class Enchantments_Page extends Page{
 
         /**
-         * @var \Rune_Craft[] Owned enchantment gems.
+         * @var \Enchantment[] Owned enchantment gems.
          */
         public $gems = [];
 
         /**
-         * @var \Rune_Craft[] Owned enchantment grindstones.
+         * @var \Enchantment[] Owned enchantment grindstones.
          */
         public $grindstones = [];
 
@@ -58,7 +58,7 @@
             }
             $q = $db->query($s);
             while ($r = $q->fetchArray(SQLITE3_ASSOC)){
-                $enchantment = new Rune_Craft($r["id"]);
+                $enchantment = new Enchantment($r["id"]);
                 //if ($enchantment->gem == true){
                 //   array_push($this->gems, $enchantment);
                 //}
@@ -162,7 +162,7 @@
             $s = "
               SELECT
                 id
-              FROM rune_craft
+              FROM enchantment
               WHERE uid = '$UID' AND (
                 $cond
               )
@@ -182,7 +182,7 @@
             global $UID;
             $s = "
               SELECT id
-              FROM rune_craft
+              FROM enchantment
               WHERE
                 uid = '$UID' AND
                 quality >= " . $this->filters["MIN_QUALITY"] . " AND

+ 49 - 50
application/page/Report_Runecraft_Page.php → application/page/Report_Rune_Enchantment_Page.php

@@ -13,14 +13,14 @@
     require_once(PATH::PAGE . "Page.php");
     require_once(PATH::ENTITY . "Unit.php");
     require_once(PATH::ENTITY . "Rune.php");
-    require_once(PATH::ENTITY . "Rune_Craft.php");
+    require_once(PATH::ENTITY . "Enchantment.php");
 
     /**
      * Upgradeable runes report page model.
      *
      * @category Page
      */
-    class Report_Runecraft_Page extends Page{
+    class Report_Rune_Enchantment_Page extends Page{
 
         /**
          * @var mixed[] List of available upgrades.
@@ -32,7 +32,7 @@
          *     upgrade = [
          *       [
          *         rune (Rune),
-         *         craft = [(Rune_Craft)]
+         *         enchant = [(Enchantment)]
          *       ]
          *     ]
          *   ]
@@ -100,7 +100,7 @@
          */
         public function __construct(){
             global $db;
-            $this->view = PATH::VIEW . "report_runecraft.php";
+            $this->view = PATH::VIEW . "report_rune_enchantment.php";
             $this->parse_filters();
             $s = $this->build_query();
             $q = $db->query($s);
@@ -124,7 +124,7 @@
                     ];
                     $rupgrade = [
                         "rune" => new Rune($r["rune"]),
-                        "craft" => [],
+                        "enchantment" => [],
                     ];
                 }
                 if ($r["rune"] != $prev_rune){
@@ -134,18 +134,18 @@
                     $prev_rune = $r["rune"];
                     $rupgrade = [
                         "rune" => new Rune($r["rune"]),
-                        "craft" => [],
+                        "enchantment" => [],
                     ];
                 }
-                $rune_craft = new Rune_craft($r["craft"]);
-                array_push($rupgrade["craft"], $rune_craft);
+                $enchantment= new Enchantment($r["enchantment"]);
+                array_push($rupgrade["enchantment"], $enchantment);
             }
             // Last entries
             array_push($upgrade["upgrade"], $rupgrade);
             array_push($this->upgrades, $upgrade);
-            $this->title = "Rune craft - SWDB";
-            $this->description = "Find runes that can be upgraded via crafting.";
-            $this->canonical = URL::BASE . "report/runecraft/";
+            $this->title = "Rune enchantment - SWDB";
+            $this->description = "Find runes that can be upgraded via enchantments.";
+            $this->canonical = URL::BASE . "report/rune_enchantment/";
         }
 
         /**
@@ -154,7 +154,6 @@
          * min_stars (1-6) and in_storage (on/off).
          */
         private function parse_filters(){
-            //$this->filters = FILTER::RUNECRAFT;
             // Monster
             if (isset($_GET["monster_min_stars"]) && intval($_GET["monster_min_stars"]) > 0 && intval($_GET["monster_min_stars"]) < 7){
                 $this->filters["MONSTER_MIN_STARS"] = $_GET["monster_min_stars"];
@@ -256,20 +255,20 @@
                 SELECT
                   unit.id AS unit,
                   rune.id AS rune,
-                  rune_craft.id AS craft
+                  enchantment.id AS enchantment
                 FROM
                   unit,
                   k_unit,
                   rune,
-                  rune_craft,
-                  k_rune_craft_type
+                  enchantment,
+                  k_enchantment_type
                 WHERE
                   unit.uid = '$UID' AND
                   rune.uid = '$UID' AND
-                  rune_craft.uid = '$UID' AND
+                  enchantment.uid = '$UID' AND
                   unit.id = rune.assigned_to AND
                   unit.unit = k_unit.id AND
-                  rune_craft.type = k_rune_craft_type.id AND
+                  enchantment.type = k_enchantment_type.id AND
                   unit.stars >= " . $this->filters["RUNE_MIN_STARS"] . " AND
                   unit.stars <= " . $this->filters["RUNE_MAX_STARS"] . " AND
                   -- RUNE FILTERS
@@ -286,10 +285,10 @@
                   rune.max_efficiency >= " . $this->filters["RUNE_MIN_MAX_EFFICIENCY"] . " AND
                   rune.max_efficiency <= " . $this->filters["RUNE_MAX_MAX_EFFICIENCY"] . " AND
                   (
-                    rune.type = rune_craft.rune OR 
-                    k_rune_craft_type.inmemorial = 1
+                    rune.type = enchantment.rune OR 
+                    k_enchantment_type.inmemorial = 1
                   ) AND
-                  k_rune_craft_type.ancient = rune.ancient AND
+                  k_enchantment_type.ancient = rune.ancient AND
                 ";
             if (strlen($this->filters["MONSTER_NAME"]) > 0){
                 $s = $s . " upper(k_unit.name) LIKE upper('%" . $this->filters["MONSTER_NAME"] . "%') AND ";
@@ -305,13 +304,13 @@
                 $s = $s . "-1) AND ";
             }
             $s .= "
-                rune_craft.stat <> rune.main_stat AND
-                rune_craft.stat <> rune.innate_stat AND
+                enchantment.stat <> rune.main_stat AND
+                enchantment.stat <> rune.innate_stat AND
                   (
-                    k_rune_craft_type.gem = 1 AND
+                    k_enchantment_type.gem = 1 AND
                     (
                       -- GEM FILTERS
-                      rune_craft.quality >= " . $this->filters["GEM_MIN_QUALITY"] . " AND
+                      enchantment.quality >= " . $this->filters["GEM_MIN_QUALITY"] . " AND
             ";
             if (count($this->filters["GEM_STAT_FROM"]) > 0){
                 $in = "(";
@@ -327,19 +326,19 @@
                     $in = $in . "$t, ";
                 }
                 $in = $in . "-1)";
-                $s .= " rune_craft.stat IN $in AND ";
+                $s .= " enchantment.stat IN $in AND ";
             }
             $s .= "
                       (
-                        rune_craft.stat <> rune.substat_1 AND
-                        rune_craft.stat <> rune.substat_2 AND
-                        rune_craft.stat <> rune.substat_3 AND
-                        rune_craft.stat <> rune.substat_4
+                        enchantment.stat <> rune.substat_1 AND
+                        enchantment.stat <> rune.substat_2 AND
+                        enchantment.stat <> rune.substat_3 AND
+                        enchantment.stat <> rune.substat_4
                       )
                     )
                   ) |
                   (
-                    k_rune_craft_type.gem = 0 AND
+                    k_enchantment_type.gem = 0 AND
                     (
                       -- GRINDSTONE FILTERS
             ";
@@ -349,34 +348,34 @@
                     $in = $in . "$t, ";
                 }
                 $in = $in . "-1)";
-                $s .= " rune_craft.stat IN $in AND ";
+                $s .= " enchantment.stat IN $in AND ";
             }
             $s .= "
-                      rune_craft.quality >= " . $this->filters["GRIND_MIN_QUALITY"] . " AND
+                      enchantment.quality >= " . $this->filters["GRIND_MIN_QUALITY"] . " AND
                       (
                         (
-                          rune_craft.stat = rune.substat_1 AND
-                          rune_craft.stat <> rune.substat_2 AND
-                          rune_craft.stat <> rune.substat_3 AND
-                          rune_craft.stat <> rune.substat_4
+                          enchantment.stat = rune.substat_1 AND
+                          enchantment.stat <> rune.substat_2 AND
+                          enchantment.stat <> rune.substat_3 AND
+                          enchantment.stat <> rune.substat_4
                         ) OR
                         (
-                          rune_craft.stat <> rune.substat_1 AND
-                          rune_craft.stat = rune.substat_2 AND
-                          rune_craft.stat <> rune.substat_3 AND
-                          rune_craft.stat <> rune.substat_4
+                          enchantment.stat <> rune.substat_1 AND
+                          enchantment.stat = rune.substat_2 AND
+                          enchantment.stat <> rune.substat_3 AND
+                          enchantment.stat <> rune.substat_4
                         ) OR
                         (
-                          rune_craft.stat <> rune.substat_1 AND
-                          rune_craft.stat <> rune.substat_2 AND
-                          rune_craft.stat = rune.substat_3 AND
-                          rune_craft.stat <> rune.substat_4
+                          enchantment.stat <> rune.substat_1 AND
+                          enchantment.stat <> rune.substat_2 AND
+                          enchantment.stat = rune.substat_3 AND
+                          enchantment.stat <> rune.substat_4
                         ) OR
                         (
-                          rune_craft.stat <> rune.substat_1 AND
-                          rune_craft.stat <> rune.substat_2 AND
-                          rune_craft.stat <> rune.substat_3 AND
-                          rune_craft.stat = rune.substat_4
+                          enchantment.stat <> rune.substat_1 AND
+                          enchantment.stat <> rune.substat_2 AND
+                          enchantment.stat <> rune.substat_3 AND
+                          enchantment.stat = rune.substat_4
                         )
                       )
                     )
@@ -392,8 +391,8 @@
                   rune.level DESC,
                   rune.id, 
                   rune.slot, 
-                  rune_craft.quality DESC,
-                  rune_craft.stat DESC;
+                  enchantment.quality DESC,
+                  enchantment.stat DESC;
                 ";
             return $s;
         }

BIN
application/sw.sqlite


+ 1 - 1
application/view/enchantments.php

@@ -273,7 +273,7 @@
 <?php
                         }
 ?>
-                        <?=HTML::craft_panel($grindstone)?>
+                        <?=HTML::enchantment_panel($grindstone)?>
 <?php
                     }
 ?>

+ 1 - 1
application/view/report.php

@@ -75,7 +75,7 @@
                         Shows monsters with runes that can be grinded or enchanted.
                         It list the grindstones and gems that are available for each rune.
                     </p>
-                    <a class='a_button' href='/<?=$UID?>/report/runecraft/'>
+                    <a class='a_button' href='/<?=$UID?>/report/rune_enchantment/'>
                         Go
                     </a>
                 </article>

+ 6 - 6
application/view/report_runecraft.php → application/view/report_rune_enchantment.php

@@ -1,11 +1,11 @@
 <?php
     /**
-     * Rune craft report view.
+     * Rune Enchantment report view.
      *
      * Contains the view layout and ome code to present the data.
      *
      * @category View
-     * @property_read Report_Runecraft_Page $page The page model.
+     * @property_read Report_Rune_Enchantment_Page $page The page model.
      */
 ?>
 <!DOCTYPE html>
@@ -17,7 +17,7 @@
         <link rel='shortcut icon' href='<?=$page->favicon?>'/>
         <!-- CSS files -->
         <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>ui.css'/>
-        <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>report_runecraft.css'/>
+        <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>report_rune_enchantment.css'/>
         <!-- Meta tags -->
         <link rel='canonical' href='<?=$page->canonical?>'/>
         <link rel='author' href='<?=$page->author?>'/>
@@ -102,7 +102,7 @@
             <h2>
                 Report filters
             </h2>
-            <form action='/<?=$UID?>/report/runecraft/' method='get' id='filter_runecraft' class='filter'>
+            <form action='/<?=$UID?>/report/runeenchantment/' method='get' id='filter_runeenchantment' class='filter'>
                 <table>
                     <tr>
                         <td colspan='2' class='header'>
@@ -483,9 +483,9 @@
                                 </td>
                                 <td class='upgrades'>
 <?php
-                                    foreach ($rupgrade["craft"] as $craft){
+                                    foreach ($rupgrade["enchantment"] as $enchantment){
     ?>
-                                        <?=HTML::craft_panel($craft)?>
+                                        <?=HTML::enchantment_panel($enchantment)?>
 <?php
                                     }
     ?>

+ 9 - 1
application/view/runs.php

@@ -324,7 +324,7 @@
 ?>
                                     <?=date("Y/m/d H:i:s", $run->dtime);//date_format($date, "Y/m/d H:i:s")?>
                                 </td>
-                                <td class='team <?=$class_frontline?>'>
+                                <td class='team'>
 <?php
                                     if ($run->helper == 1){
                                         $enable_save = false;
@@ -480,6 +480,14 @@
                                             <img class='item' title='Rune' src='<?=URL::IMG["RUNE"]?>base.png'/>
                                             <?=HTML::rune_table($rune)?>
                                         </div>
+<?php
+                                    }
+                                    foreach ($run->enchantment as $enchantment){
+?>
+                                        <div class='item item_enchantment'>
+                                            <img class='item' title='Enchantment' src='<?=URL::IMG["RUNE"]?>base.png'/>
+                                            <?=HTML::enchantment_panel($enchantment)?>
+                                        </div>
 <?php
                                     }
 ?>

+ 234 - 234
install_data/install_base.sql

@@ -257,7 +257,7 @@ INSERT INTO k_inventory_type VALUES(11,'Essences','');
 INSERT INTO k_inventory_type VALUES(12,'Monster Piece','');
 INSERT INTO k_inventory_type VALUES(15,'UNKNOWN','Appears in inventory_info with qty 0');
 INSERT INTO k_inventory_type VALUES(19,'Guild Monster Piece','');
-INSERT INTO k_inventory_type VALUES(27,'Rune Craft','');
+INSERT INTO k_inventory_type VALUES(27,'Enchantment','');
 INSERT INTO k_inventory_type VALUES(29,'Craft Stuff','');
 INSERT INTO k_inventory_type VALUES(61,'Enhancing Monster','');
 CREATE TABLE k_inventory(
@@ -663,28 +663,28 @@ INSERT INTO k_artifact_effect VALUES (406, '[Skill 3] Recovery +{}%');
 INSERT INTO k_artifact_effect VALUES (407, '[Skill 1] Accuracy +{}%');
 INSERT INTO k_artifact_effect VALUES (408, '[Skill 2] Accuracy +{}%');
 INSERT INTO k_artifact_effect VALUES (409, '[Skill 3] Accuracy +{}%');
-CREATE TABLE k_craft(
+CREATE TABLE k_enchantment(
     id INT NOT NULL PRIMARY KEY,
     name TEXT UNIQUE
 );
-INSERT INTO k_craft VALUES(1,'Enchant_gem');
-INSERT INTO k_craft VALUES(2,'Grindstone');
-INSERT INTO k_craft VALUES(3,'Immemorial_gem');
-INSERT INTO k_craft VALUES(4,'Immemorial_grindstone');
-CREATE TABLE k_rune_craft_type(
+INSERT INTO k_enchantment VALUES(1,'Enchant_gem');
+INSERT INTO k_enchantment VALUES(2,'Grindstone');
+INSERT INTO k_enchantment VALUES(3,'Immemorial_gem');
+INSERT INTO k_enchantment VALUES(4,'Immemorial_grindstone');
+CREATE TABLE k_enchantment_type(
     id INT NOT NULL PRIMARY KEY,
     name TEXT NOT NULL UNIQUE,
     gem INT NOT NULL CHECK(gem IN (1, 0)),
     inmemorial INT NOT NULL CHECK(inmemorial IN (1, 0)),
     ancient INT NOT NULL CHECK(ancient IN (1, 0))
 );
-INSERT INTO k_rune_craft_type VALUES(1,'Enchant Gem',1,0,0);
-INSERT INTO k_rune_craft_type VALUES(2,'Grindstone',0,0,0);
-INSERT INTO k_rune_craft_type VALUES(3,'Inmemorial Gem',1,1,0);
-INSERT INTO k_rune_craft_type VALUES(4,'Inmemorial Grindstone',0,1,0);
-INSERT INTO k_rune_craft_type VALUES(5,'Ancient Gem',1,0,1);
-INSERT INTO k_rune_craft_type VALUES(6,'Ancient Grindstone',0,0,1);
-CREATE TABLE k_rune_craft_range(
+INSERT INTO k_enchantment_type VALUES(1,'Enchant Gem',1,0,0);
+INSERT INTO k_enchantment_type VALUES(2,'Grindstone',0,0,0);
+INSERT INTO k_enchantment_type VALUES(3,'Inmemorial Gem',1,1,0);
+INSERT INTO k_enchantment_type VALUES(4,'Inmemorial Grindstone',0,1,0);
+INSERT INTO k_enchantment_type VALUES(5,'Ancient Gem',1,0,1);
+INSERT INTO k_enchantment_type VALUES(6,'Ancient Grindstone',0,0,1);
+CREATE TABLE k_enchantment_range(
     gem INT NOT NULL CHECK(gem IN (1, 0)),
     ancient INT NOT NULL CHECK(ancient IN (1, 0)),
     quality INT NOT NULL REFERENCES k_quality(id),
@@ -692,226 +692,226 @@ CREATE TABLE k_rune_craft_range(
     min INT NOT NULL CHECK(min > 0),
     max INT NOT NULL CHECK(max > 0)
 );
-INSERT INTO k_rune_craft_range VALUES(0,0,1,1,80,120);
-INSERT INTO k_rune_craft_range VALUES(0,0,2,1,100,200);
-INSERT INTO k_rune_craft_range VALUES(0,0,3,1,180,250);
-INSERT INTO k_rune_craft_range VALUES(0,0,4,1,230,450);
-INSERT INTO k_rune_craft_range VALUES(0,0,5,1,430,550);
-INSERT INTO k_rune_craft_range VALUES(0,0,1,2,1,3);
-INSERT INTO k_rune_craft_range VALUES(0,0,2,2,2,5);
-INSERT INTO k_rune_craft_range VALUES(0,0,3,2,3,6);
-INSERT INTO k_rune_craft_range VALUES(0,0,4,2,4,7);
-INSERT INTO k_rune_craft_range VALUES(0,0,5,2,5,10);
-INSERT INTO k_rune_craft_range VALUES(0,0,1,3,4,8);
-INSERT INTO k_rune_craft_range VALUES(0,0,2,3,6,12);
-INSERT INTO k_rune_craft_range VALUES(0,0,3,3,10,18);
-INSERT INTO k_rune_craft_range VALUES(0,0,4,3,12,22);
-INSERT INTO k_rune_craft_range VALUES(0,0,5,3,18,30);
-INSERT INTO k_rune_craft_range VALUES(0,0,1,4,1,3);
-INSERT INTO k_rune_craft_range VALUES(0,0,2,4,2,5);
-INSERT INTO k_rune_craft_range VALUES(0,0,3,4,3,6);
-INSERT INTO k_rune_craft_range VALUES(0,0,4,4,4,7);
-INSERT INTO k_rune_craft_range VALUES(0,0,5,4,5,10);
-INSERT INTO k_rune_craft_range VALUES(0,0,1,5,4,8);
-INSERT INTO k_rune_craft_range VALUES(0,0,2,5,6,12);
-INSERT INTO k_rune_craft_range VALUES(0,0,3,5,10,18);
-INSERT INTO k_rune_craft_range VALUES(0,0,4,5,12,22);
-INSERT INTO k_rune_craft_range VALUES(0,0,5,5,18,30);
-INSERT INTO k_rune_craft_range VALUES(0,0,1,6,1,3);
-INSERT INTO k_rune_craft_range VALUES(0,0,2,6,2,5);
-INSERT INTO k_rune_craft_range VALUES(0,0,3,6,3,6);
-INSERT INTO k_rune_craft_range VALUES(0,0,4,6,4,7);
-INSERT INTO k_rune_craft_range VALUES(0,0,5,6,5,10);
-INSERT INTO k_rune_craft_range VALUES(0,0,1,8,1,2);
-INSERT INTO k_rune_craft_range VALUES(0,0,2,8,1,2);
-INSERT INTO k_rune_craft_range VALUES(0,0,3,8,2,3);
-INSERT INTO k_rune_craft_range VALUES(0,0,4,8,3,4);
-INSERT INTO k_rune_craft_range VALUES(0,0,5,8,4,5);
-INSERT INTO k_rune_craft_range VALUES(0,0,1,9,1,2);
-INSERT INTO k_rune_craft_range VALUES(0,0,2,9,1,3);
-INSERT INTO k_rune_craft_range VALUES(0,0,3,9,2,4);
-INSERT INTO k_rune_craft_range VALUES(0,0,4,9,3,5);
-INSERT INTO k_rune_craft_range VALUES(0,0,5,9,4,6);
-INSERT INTO k_rune_craft_range VALUES(0,0,1,10,1,3);
-INSERT INTO k_rune_craft_range VALUES(0,0,2,10,2,4);
-INSERT INTO k_rune_craft_range VALUES(0,0,3,10,2,5);
-INSERT INTO k_rune_craft_range VALUES(0,0,4,10,3,5);
-INSERT INTO k_rune_craft_range VALUES(0,0,5,10,4,7);
-INSERT INTO k_rune_craft_range VALUES(0,0,1,11,1,3);
-INSERT INTO k_rune_craft_range VALUES(0,0,2,11,2,4);
-INSERT INTO k_rune_craft_range VALUES(0,0,3,11,2,5);
-INSERT INTO k_rune_craft_range VALUES(0,0,4,11,3,7);
-INSERT INTO k_rune_craft_range VALUES(0,0,5,11,4,8);
-INSERT INTO k_rune_craft_range VALUES(0,0,1,12,1,3);
-INSERT INTO k_rune_craft_range VALUES(0,0,2,12,2,4);
-INSERT INTO k_rune_craft_range VALUES(0,0,3,12,2,5);
-INSERT INTO k_rune_craft_range VALUES(0,0,4,12,3,7);
-INSERT INTO k_rune_craft_range VALUES(0,0,5,12,4,8);
-INSERT INTO k_rune_craft_range VALUES(1,0,1,1,100,150);
-INSERT INTO k_rune_craft_range VALUES(1,0,2,1,130,220);
-INSERT INTO k_rune_craft_range VALUES(1,0,3,1,200,310);
-INSERT INTO k_rune_craft_range VALUES(1,0,4,1,290,420);
-INSERT INTO k_rune_craft_range VALUES(1,0,5,1,400,580);
-INSERT INTO k_rune_craft_range VALUES(1,0,1,2,2,4);
-INSERT INTO k_rune_craft_range VALUES(1,0,2,2,3,7);
-INSERT INTO k_rune_craft_range VALUES(1,0,3,2,5,9);
-INSERT INTO k_rune_craft_range VALUES(1,0,4,2,7,11);
-INSERT INTO k_rune_craft_range VALUES(1,0,5,2,9,13);
-INSERT INTO k_rune_craft_range VALUES(1,0,1,3,8,12);
-INSERT INTO k_rune_craft_range VALUES(1,0,2,3,10,16);
-INSERT INTO k_rune_craft_range VALUES(1,0,3,3,15,23);
-INSERT INTO k_rune_craft_range VALUES(1,0,4,3,20,30);
-INSERT INTO k_rune_craft_range VALUES(1,0,5,3,28,40);
-INSERT INTO k_rune_craft_range VALUES(1,0,1,4,2,4);
-INSERT INTO k_rune_craft_range VALUES(1,0,2,4,3,7);
-INSERT INTO k_rune_craft_range VALUES(1,0,3,4,5,9);
-INSERT INTO k_rune_craft_range VALUES(1,0,4,4,7,11);
-INSERT INTO k_rune_craft_range VALUES(1,0,5,4,9,13);
-INSERT INTO k_rune_craft_range VALUES(1,0,1,5,8,12);
-INSERT INTO k_rune_craft_range VALUES(1,0,2,5,10,16);
-INSERT INTO k_rune_craft_range VALUES(1,0,3,5,15,23);
-INSERT INTO k_rune_craft_range VALUES(1,0,4,5,20,30);
-INSERT INTO k_rune_craft_range VALUES(1,0,5,5,28,40);
-INSERT INTO k_rune_craft_range VALUES(1,0,1,6,2,4);
-INSERT INTO k_rune_craft_range VALUES(1,0,2,6,3,7);
-INSERT INTO k_rune_craft_range VALUES(1,0,3,6,5,9);
-INSERT INTO k_rune_craft_range VALUES(1,0,4,6,7,11);
-INSERT INTO k_rune_craft_range VALUES(1,0,5,6,9,13);
-INSERT INTO k_rune_craft_range VALUES(1,0,1,8,1,3);
-INSERT INTO k_rune_craft_range VALUES(1,0,2,8,2,4);
-INSERT INTO k_rune_craft_range VALUES(1,0,3,8,3,6);
-INSERT INTO k_rune_craft_range VALUES(1,0,4,8,5,8);
-INSERT INTO k_rune_craft_range VALUES(1,0,5,8,7,10);
-INSERT INTO k_rune_craft_range VALUES(1,0,1,9,1,3);
-INSERT INTO k_rune_craft_range VALUES(1,0,2,9,2,4);
-INSERT INTO k_rune_craft_range VALUES(1,0,3,9,3,5);
-INSERT INTO k_rune_craft_range VALUES(1,0,4,9,4,7);
-INSERT INTO k_rune_craft_range VALUES(1,0,5,9,6,9);
-INSERT INTO k_rune_craft_range VALUES(1,0,1,10,2,4);
-INSERT INTO k_rune_craft_range VALUES(1,0,2,10,3,5);
-INSERT INTO k_rune_craft_range VALUES(1,0,3,10,4,6);
-INSERT INTO k_rune_craft_range VALUES(1,0,4,10,5,8);
-INSERT INTO k_rune_craft_range VALUES(1,0,5,10,7,10);
-INSERT INTO k_rune_craft_range VALUES(1,0,1,11,2,4);
-INSERT INTO k_rune_craft_range VALUES(1,0,2,11,3,6);
-INSERT INTO k_rune_craft_range VALUES(1,0,3,11,5,8);
-INSERT INTO k_rune_craft_range VALUES(1,0,4,11,6,9);
-INSERT INTO k_rune_craft_range VALUES(1,0,5,11,8,11);
-INSERT INTO k_rune_craft_range VALUES(1,0,1,12,2,4);
-INSERT INTO k_rune_craft_range VALUES(1,0,2,12,3,6);
-INSERT INTO k_rune_craft_range VALUES(1,0,3,12,5,8);
-INSERT INTO k_rune_craft_range VALUES(1,0,4,12,6,9);
-INSERT INTO k_rune_craft_range VALUES(1,0,5,12,8,11);
-INSERT INTO k_rune_craft_range VALUES(0,1,1,1,80,120);
-INSERT INTO k_rune_craft_range VALUES(0,1,2,1,100,200);
-INSERT INTO k_rune_craft_range VALUES(0,1,3,1,180,250);
-INSERT INTO k_rune_craft_range VALUES(0,1,4,1,230,450);
-INSERT INTO k_rune_craft_range VALUES(0,1,5,1,430,550);
-INSERT INTO k_rune_craft_range VALUES(0,1,1,2,1,3);
-INSERT INTO k_rune_craft_range VALUES(0,1,2,2,2,5);
-INSERT INTO k_rune_craft_range VALUES(0,1,3,2,3,6);
-INSERT INTO k_rune_craft_range VALUES(0,1,4,2,4,7);
-INSERT INTO k_rune_craft_range VALUES(0,1,5,2,5,10);
-INSERT INTO k_rune_craft_range VALUES(0,1,1,3,4,8);
-INSERT INTO k_rune_craft_range VALUES(0,1,2,3,6,12);
-INSERT INTO k_rune_craft_range VALUES(0,1,3,3,10,18);
-INSERT INTO k_rune_craft_range VALUES(0,1,4,3,12,22);
-INSERT INTO k_rune_craft_range VALUES(0,1,5,3,18,30);
-INSERT INTO k_rune_craft_range VALUES(0,1,1,4,1,3);
-INSERT INTO k_rune_craft_range VALUES(0,1,2,4,2,5);
-INSERT INTO k_rune_craft_range VALUES(0,1,3,4,3,6);
-INSERT INTO k_rune_craft_range VALUES(0,1,4,4,4,7);
-INSERT INTO k_rune_craft_range VALUES(0,1,5,4,5,10);
-INSERT INTO k_rune_craft_range VALUES(0,1,1,5,4,8);
-INSERT INTO k_rune_craft_range VALUES(0,1,2,5,6,12);
-INSERT INTO k_rune_craft_range VALUES(0,1,3,5,10,18);
-INSERT INTO k_rune_craft_range VALUES(0,1,4,5,12,22);
-INSERT INTO k_rune_craft_range VALUES(0,1,5,5,18,30);
-INSERT INTO k_rune_craft_range VALUES(0,1,1,6,1,3);
-INSERT INTO k_rune_craft_range VALUES(0,1,2,6,2,5);
-INSERT INTO k_rune_craft_range VALUES(0,1,3,6,3,6);
-INSERT INTO k_rune_craft_range VALUES(0,1,4,6,4,7);
-INSERT INTO k_rune_craft_range VALUES(0,1,5,6,5,10);
-INSERT INTO k_rune_craft_range VALUES(0,1,1,8,1,2);
-INSERT INTO k_rune_craft_range VALUES(0,1,2,8,1,2);
-INSERT INTO k_rune_craft_range VALUES(0,1,3,8,2,3);
-INSERT INTO k_rune_craft_range VALUES(0,1,4,8,3,4);
-INSERT INTO k_rune_craft_range VALUES(0,1,5,8,4,5);
-INSERT INTO k_rune_craft_range VALUES(0,1,1,9,1,2);
-INSERT INTO k_rune_craft_range VALUES(0,1,2,9,1,3);
-INSERT INTO k_rune_craft_range VALUES(0,1,3,9,2,4);
-INSERT INTO k_rune_craft_range VALUES(0,1,4,9,3,5);
-INSERT INTO k_rune_craft_range VALUES(0,1,5,9,4,6);
-INSERT INTO k_rune_craft_range VALUES(0,1,1,10,1,3);
-INSERT INTO k_rune_craft_range VALUES(0,1,2,10,2,4);
-INSERT INTO k_rune_craft_range VALUES(0,1,3,10,2,5);
-INSERT INTO k_rune_craft_range VALUES(0,1,4,10,3,5);
-INSERT INTO k_rune_craft_range VALUES(0,1,5,10,4,7);
-INSERT INTO k_rune_craft_range VALUES(0,1,1,11,1,3);
-INSERT INTO k_rune_craft_range VALUES(0,1,2,11,2,4);
-INSERT INTO k_rune_craft_range VALUES(0,1,3,11,2,5);
-INSERT INTO k_rune_craft_range VALUES(0,1,4,11,3,7);
-INSERT INTO k_rune_craft_range VALUES(0,1,5,11,4,8);
-INSERT INTO k_rune_craft_range VALUES(0,1,1,12,1,3);
-INSERT INTO k_rune_craft_range VALUES(0,1,2,12,2,4);
-INSERT INTO k_rune_craft_range VALUES(0,1,3,12,2,5);
-INSERT INTO k_rune_craft_range VALUES(0,1,4,12,3,7);
-INSERT INTO k_rune_craft_range VALUES(0,1,5,12,4,8);
-INSERT INTO k_rune_craft_range VALUES(1,1,1,1,100,150);
-INSERT INTO k_rune_craft_range VALUES(1,1,2,1,130,220);
-INSERT INTO k_rune_craft_range VALUES(1,1,3,1,200,310);
-INSERT INTO k_rune_craft_range VALUES(1,1,4,1,290,420);
-INSERT INTO k_rune_craft_range VALUES(1,1,5,1,400,580);
-INSERT INTO k_rune_craft_range VALUES(1,1,1,2,2,4);
-INSERT INTO k_rune_craft_range VALUES(1,1,2,2,3,7);
-INSERT INTO k_rune_craft_range VALUES(1,1,3,2,5,9);
-INSERT INTO k_rune_craft_range VALUES(1,1,4,2,7,11);
-INSERT INTO k_rune_craft_range VALUES(1,1,5,2,9,13);
-INSERT INTO k_rune_craft_range VALUES(1,1,1,3,8,12);
-INSERT INTO k_rune_craft_range VALUES(1,1,2,3,10,16);
-INSERT INTO k_rune_craft_range VALUES(1,1,3,3,15,23);
-INSERT INTO k_rune_craft_range VALUES(1,1,4,3,20,30);
-INSERT INTO k_rune_craft_range VALUES(1,1,5,3,28,40);
-INSERT INTO k_rune_craft_range VALUES(1,1,1,4,2,4);
-INSERT INTO k_rune_craft_range VALUES(1,1,2,4,3,7);
-INSERT INTO k_rune_craft_range VALUES(1,1,3,4,5,9);
-INSERT INTO k_rune_craft_range VALUES(1,1,4,4,7,11);
-INSERT INTO k_rune_craft_range VALUES(1,1,5,4,9,13);
-INSERT INTO k_rune_craft_range VALUES(1,1,1,5,8,12);
-INSERT INTO k_rune_craft_range VALUES(1,1,2,5,10,16);
-INSERT INTO k_rune_craft_range VALUES(1,1,3,5,15,23);
-INSERT INTO k_rune_craft_range VALUES(1,1,4,5,20,30);
-INSERT INTO k_rune_craft_range VALUES(1,1,5,5,28,40);
-INSERT INTO k_rune_craft_range VALUES(1,1,1,6,2,4);
-INSERT INTO k_rune_craft_range VALUES(1,1,2,6,3,7);
-INSERT INTO k_rune_craft_range VALUES(1,1,3,6,5,9);
-INSERT INTO k_rune_craft_range VALUES(1,1,4,6,7,11);
-INSERT INTO k_rune_craft_range VALUES(1,1,5,6,9,13);
-INSERT INTO k_rune_craft_range VALUES(1,1,1,8,1,3);
-INSERT INTO k_rune_craft_range VALUES(1,1,2,8,2,4);
-INSERT INTO k_rune_craft_range VALUES(1,1,3,8,3,6);
-INSERT INTO k_rune_craft_range VALUES(1,1,4,8,5,8);
-INSERT INTO k_rune_craft_range VALUES(1,1,5,8,7,10);
-INSERT INTO k_rune_craft_range VALUES(1,1,1,9,1,3);
-INSERT INTO k_rune_craft_range VALUES(1,1,2,9,2,4);
-INSERT INTO k_rune_craft_range VALUES(1,1,3,9,3,5);
-INSERT INTO k_rune_craft_range VALUES(1,1,4,9,4,7);
-INSERT INTO k_rune_craft_range VALUES(1,1,5,9,6,9);
-INSERT INTO k_rune_craft_range VALUES(1,1,1,10,2,4);
-INSERT INTO k_rune_craft_range VALUES(1,1,2,10,3,5);
-INSERT INTO k_rune_craft_range VALUES(1,1,3,10,4,6);
-INSERT INTO k_rune_craft_range VALUES(1,1,4,10,5,8);
-INSERT INTO k_rune_craft_range VALUES(1,1,5,10,7,10);
-INSERT INTO k_rune_craft_range VALUES(1,1,1,11,2,4);
-INSERT INTO k_rune_craft_range VALUES(1,1,2,11,3,6);
-INSERT INTO k_rune_craft_range VALUES(1,1,3,11,5,8);
-INSERT INTO k_rune_craft_range VALUES(1,1,4,11,6,9);
-INSERT INTO k_rune_craft_range VALUES(1,1,5,11,8,11);
-INSERT INTO k_rune_craft_range VALUES(1,1,1,12,2,4);
-INSERT INTO k_rune_craft_range VALUES(1,1,2,12,3,6);
-INSERT INTO k_rune_craft_range VALUES(1,1,3,12,5,8);
-INSERT INTO k_rune_craft_range VALUES(1,1,4,12,6,9);
-INSERT INTO k_rune_craft_range VALUES(1,1,5,12,8,11);
+INSERT INTO k_enchantment_range VALUES(0,0,1,1,80,120);
+INSERT INTO k_enchantment_range VALUES(0,0,2,1,100,200);
+INSERT INTO k_enchantment_range VALUES(0,0,3,1,180,250);
+INSERT INTO k_enchantment_range VALUES(0,0,4,1,230,450);
+INSERT INTO k_enchantment_range VALUES(0,0,5,1,430,550);
+INSERT INTO k_enchantment_range VALUES(0,0,1,2,1,3);
+INSERT INTO k_enchantment_range VALUES(0,0,2,2,2,5);
+INSERT INTO k_enchantment_range VALUES(0,0,3,2,3,6);
+INSERT INTO k_enchantment_range VALUES(0,0,4,2,4,7);
+INSERT INTO k_enchantment_range VALUES(0,0,5,2,5,10);
+INSERT INTO k_enchantment_range VALUES(0,0,1,3,4,8);
+INSERT INTO k_enchantment_range VALUES(0,0,2,3,6,12);
+INSERT INTO k_enchantment_range VALUES(0,0,3,3,10,18);
+INSERT INTO k_enchantment_range VALUES(0,0,4,3,12,22);
+INSERT INTO k_enchantment_range VALUES(0,0,5,3,18,30);
+INSERT INTO k_enchantment_range VALUES(0,0,1,4,1,3);
+INSERT INTO k_enchantment_range VALUES(0,0,2,4,2,5);
+INSERT INTO k_enchantment_range VALUES(0,0,3,4,3,6);
+INSERT INTO k_enchantment_range VALUES(0,0,4,4,4,7);
+INSERT INTO k_enchantment_range VALUES(0,0,5,4,5,10);
+INSERT INTO k_enchantment_range VALUES(0,0,1,5,4,8);
+INSERT INTO k_enchantment_range VALUES(0,0,2,5,6,12);
+INSERT INTO k_enchantment_range VALUES(0,0,3,5,10,18);
+INSERT INTO k_enchantment_range VALUES(0,0,4,5,12,22);
+INSERT INTO k_enchantment_range VALUES(0,0,5,5,18,30);
+INSERT INTO k_enchantment_range VALUES(0,0,1,6,1,3);
+INSERT INTO k_enchantment_range VALUES(0,0,2,6,2,5);
+INSERT INTO k_enchantment_range VALUES(0,0,3,6,3,6);
+INSERT INTO k_enchantment_range VALUES(0,0,4,6,4,7);
+INSERT INTO k_enchantment_range VALUES(0,0,5,6,5,10);
+INSERT INTO k_enchantment_range VALUES(0,0,1,8,1,2);
+INSERT INTO k_enchantment_range VALUES(0,0,2,8,1,2);
+INSERT INTO k_enchantment_range VALUES(0,0,3,8,2,3);
+INSERT INTO k_enchantment_range VALUES(0,0,4,8,3,4);
+INSERT INTO k_enchantment_range VALUES(0,0,5,8,4,5);
+INSERT INTO k_enchantment_range VALUES(0,0,1,9,1,2);
+INSERT INTO k_enchantment_range VALUES(0,0,2,9,1,3);
+INSERT INTO k_enchantment_range VALUES(0,0,3,9,2,4);
+INSERT INTO k_enchantment_range VALUES(0,0,4,9,3,5);
+INSERT INTO k_enchantment_range VALUES(0,0,5,9,4,6);
+INSERT INTO k_enchantment_range VALUES(0,0,1,10,1,3);
+INSERT INTO k_enchantment_range VALUES(0,0,2,10,2,4);
+INSERT INTO k_enchantment_range VALUES(0,0,3,10,2,5);
+INSERT INTO k_enchantment_range VALUES(0,0,4,10,3,5);
+INSERT INTO k_enchantment_range VALUES(0,0,5,10,4,7);
+INSERT INTO k_enchantment_range VALUES(0,0,1,11,1,3);
+INSERT INTO k_enchantment_range VALUES(0,0,2,11,2,4);
+INSERT INTO k_enchantment_range VALUES(0,0,3,11,2,5);
+INSERT INTO k_enchantment_range VALUES(0,0,4,11,3,7);
+INSERT INTO k_enchantment_range VALUES(0,0,5,11,4,8);
+INSERT INTO k_enchantment_range VALUES(0,0,1,12,1,3);
+INSERT INTO k_enchantment_range VALUES(0,0,2,12,2,4);
+INSERT INTO k_enchantment_range VALUES(0,0,3,12,2,5);
+INSERT INTO k_enchantment_range VALUES(0,0,4,12,3,7);
+INSERT INTO k_enchantment_range VALUES(0,0,5,12,4,8);
+INSERT INTO k_enchantment_range VALUES(1,0,1,1,100,150);
+INSERT INTO k_enchantment_range VALUES(1,0,2,1,130,220);
+INSERT INTO k_enchantment_range VALUES(1,0,3,1,200,310);
+INSERT INTO k_enchantment_range VALUES(1,0,4,1,290,420);
+INSERT INTO k_enchantment_range VALUES(1,0,5,1,400,580);
+INSERT INTO k_enchantment_range VALUES(1,0,1,2,2,4);
+INSERT INTO k_enchantment_range VALUES(1,0,2,2,3,7);
+INSERT INTO k_enchantment_range VALUES(1,0,3,2,5,9);
+INSERT INTO k_enchantment_range VALUES(1,0,4,2,7,11);
+INSERT INTO k_enchantment_range VALUES(1,0,5,2,9,13);
+INSERT INTO k_enchantment_range VALUES(1,0,1,3,8,12);
+INSERT INTO k_enchantment_range VALUES(1,0,2,3,10,16);
+INSERT INTO k_enchantment_range VALUES(1,0,3,3,15,23);
+INSERT INTO k_enchantment_range VALUES(1,0,4,3,20,30);
+INSERT INTO k_enchantment_range VALUES(1,0,5,3,28,40);
+INSERT INTO k_enchantment_range VALUES(1,0,1,4,2,4);
+INSERT INTO k_enchantment_range VALUES(1,0,2,4,3,7);
+INSERT INTO k_enchantment_range VALUES(1,0,3,4,5,9);
+INSERT INTO k_enchantment_range VALUES(1,0,4,4,7,11);
+INSERT INTO k_enchantment_range VALUES(1,0,5,4,9,13);
+INSERT INTO k_enchantment_range VALUES(1,0,1,5,8,12);
+INSERT INTO k_enchantment_range VALUES(1,0,2,5,10,16);
+INSERT INTO k_enchantment_range VALUES(1,0,3,5,15,23);
+INSERT INTO k_enchantment_range VALUES(1,0,4,5,20,30);
+INSERT INTO k_enchantment_range VALUES(1,0,5,5,28,40);
+INSERT INTO k_enchantment_range VALUES(1,0,1,6,2,4);
+INSERT INTO k_enchantment_range VALUES(1,0,2,6,3,7);
+INSERT INTO k_enchantment_range VALUES(1,0,3,6,5,9);
+INSERT INTO k_enchantment_range VALUES(1,0,4,6,7,11);
+INSERT INTO k_enchantment_range VALUES(1,0,5,6,9,13);
+INSERT INTO k_enchantment_range VALUES(1,0,1,8,1,3);
+INSERT INTO k_enchantment_range VALUES(1,0,2,8,2,4);
+INSERT INTO k_enchantment_range VALUES(1,0,3,8,3,6);
+INSERT INTO k_enchantment_range VALUES(1,0,4,8,5,8);
+INSERT INTO k_enchantment_range VALUES(1,0,5,8,7,10);
+INSERT INTO k_enchantment_range VALUES(1,0,1,9,1,3);
+INSERT INTO k_enchantment_range VALUES(1,0,2,9,2,4);
+INSERT INTO k_enchantment_range VALUES(1,0,3,9,3,5);
+INSERT INTO k_enchantment_range VALUES(1,0,4,9,4,7);
+INSERT INTO k_enchantment_range VALUES(1,0,5,9,6,9);
+INSERT INTO k_enchantment_range VALUES(1,0,1,10,2,4);
+INSERT INTO k_enchantment_range VALUES(1,0,2,10,3,5);
+INSERT INTO k_enchantment_range VALUES(1,0,3,10,4,6);
+INSERT INTO k_enchantment_range VALUES(1,0,4,10,5,8);
+INSERT INTO k_enchantment_range VALUES(1,0,5,10,7,10);
+INSERT INTO k_enchantment_range VALUES(1,0,1,11,2,4);
+INSERT INTO k_enchantment_range VALUES(1,0,2,11,3,6);
+INSERT INTO k_enchantment_range VALUES(1,0,3,11,5,8);
+INSERT INTO k_enchantment_range VALUES(1,0,4,11,6,9);
+INSERT INTO k_enchantment_range VALUES(1,0,5,11,8,11);
+INSERT INTO k_enchantment_range VALUES(1,0,1,12,2,4);
+INSERT INTO k_enchantment_range VALUES(1,0,2,12,3,6);
+INSERT INTO k_enchantment_range VALUES(1,0,3,12,5,8);
+INSERT INTO k_enchantment_range VALUES(1,0,4,12,6,9);
+INSERT INTO k_enchantment_range VALUES(1,0,5,12,8,11);
+INSERT INTO k_enchantment_range VALUES(0,1,1,1,80,120);
+INSERT INTO k_enchantment_range VALUES(0,1,2,1,100,200);
+INSERT INTO k_enchantment_range VALUES(0,1,3,1,180,250);
+INSERT INTO k_enchantment_range VALUES(0,1,4,1,230,450);
+INSERT INTO k_enchantment_range VALUES(0,1,5,1,430,550);
+INSERT INTO k_enchantment_range VALUES(0,1,1,2,1,3);
+INSERT INTO k_enchantment_range VALUES(0,1,2,2,2,5);
+INSERT INTO k_enchantment_range VALUES(0,1,3,2,3,6);
+INSERT INTO k_enchantment_range VALUES(0,1,4,2,4,7);
+INSERT INTO k_enchantment_range VALUES(0,1,5,2,5,10);
+INSERT INTO k_enchantment_range VALUES(0,1,1,3,4,8);
+INSERT INTO k_enchantment_range VALUES(0,1,2,3,6,12);
+INSERT INTO k_enchantment_range VALUES(0,1,3,3,10,18);
+INSERT INTO k_enchantment_range VALUES(0,1,4,3,12,22);
+INSERT INTO k_enchantment_range VALUES(0,1,5,3,18,30);
+INSERT INTO k_enchantment_range VALUES(0,1,1,4,1,3);
+INSERT INTO k_enchantment_range VALUES(0,1,2,4,2,5);
+INSERT INTO k_enchantment_range VALUES(0,1,3,4,3,6);
+INSERT INTO k_enchantment_range VALUES(0,1,4,4,4,7);
+INSERT INTO k_enchantment_range VALUES(0,1,5,4,5,10);
+INSERT INTO k_enchantment_range VALUES(0,1,1,5,4,8);
+INSERT INTO k_enchantment_range VALUES(0,1,2,5,6,12);
+INSERT INTO k_enchantment_range VALUES(0,1,3,5,10,18);
+INSERT INTO k_enchantment_range VALUES(0,1,4,5,12,22);
+INSERT INTO k_enchantment_range VALUES(0,1,5,5,18,30);
+INSERT INTO k_enchantment_range VALUES(0,1,1,6,1,3);
+INSERT INTO k_enchantment_range VALUES(0,1,2,6,2,5);
+INSERT INTO k_enchantment_range VALUES(0,1,3,6,3,6);
+INSERT INTO k_enchantment_range VALUES(0,1,4,6,4,7);
+INSERT INTO k_enchantment_range VALUES(0,1,5,6,5,10);
+INSERT INTO k_enchantment_range VALUES(0,1,1,8,1,2);
+INSERT INTO k_enchantment_range VALUES(0,1,2,8,1,2);
+INSERT INTO k_enchantment_range VALUES(0,1,3,8,2,3);
+INSERT INTO k_enchantment_range VALUES(0,1,4,8,3,4);
+INSERT INTO k_enchantment_range VALUES(0,1,5,8,4,5);
+INSERT INTO k_enchantment_range VALUES(0,1,1,9,1,2);
+INSERT INTO k_enchantment_range VALUES(0,1,2,9,1,3);
+INSERT INTO k_enchantment_range VALUES(0,1,3,9,2,4);
+INSERT INTO k_enchantment_range VALUES(0,1,4,9,3,5);
+INSERT INTO k_enchantment_range VALUES(0,1,5,9,4,6);
+INSERT INTO k_enchantment_range VALUES(0,1,1,10,1,3);
+INSERT INTO k_enchantment_range VALUES(0,1,2,10,2,4);
+INSERT INTO k_enchantment_range VALUES(0,1,3,10,2,5);
+INSERT INTO k_enchantment_range VALUES(0,1,4,10,3,5);
+INSERT INTO k_enchantment_range VALUES(0,1,5,10,4,7);
+INSERT INTO k_enchantment_range VALUES(0,1,1,11,1,3);
+INSERT INTO k_enchantment_range VALUES(0,1,2,11,2,4);
+INSERT INTO k_enchantment_range VALUES(0,1,3,11,2,5);
+INSERT INTO k_enchantment_range VALUES(0,1,4,11,3,7);
+INSERT INTO k_enchantment_range VALUES(0,1,5,11,4,8);
+INSERT INTO k_enchantment_range VALUES(0,1,1,12,1,3);
+INSERT INTO k_enchantment_range VALUES(0,1,2,12,2,4);
+INSERT INTO k_enchantment_range VALUES(0,1,3,12,2,5);
+INSERT INTO k_enchantment_range VALUES(0,1,4,12,3,7);
+INSERT INTO k_enchantment_range VALUES(0,1,5,12,4,8);
+INSERT INTO k_enchantment_range VALUES(1,1,1,1,100,150);
+INSERT INTO k_enchantment_range VALUES(1,1,2,1,130,220);
+INSERT INTO k_enchantment_range VALUES(1,1,3,1,200,310);
+INSERT INTO k_enchantment_range VALUES(1,1,4,1,290,420);
+INSERT INTO k_enchantment_range VALUES(1,1,5,1,400,580);
+INSERT INTO k_enchantment_range VALUES(1,1,1,2,2,4);
+INSERT INTO k_enchantment_range VALUES(1,1,2,2,3,7);
+INSERT INTO k_enchantment_range VALUES(1,1,3,2,5,9);
+INSERT INTO k_enchantment_range VALUES(1,1,4,2,7,11);
+INSERT INTO k_enchantment_range VALUES(1,1,5,2,9,13);
+INSERT INTO k_enchantment_range VALUES(1,1,1,3,8,12);
+INSERT INTO k_enchantment_range VALUES(1,1,2,3,10,16);
+INSERT INTO k_enchantment_range VALUES(1,1,3,3,15,23);
+INSERT INTO k_enchantment_range VALUES(1,1,4,3,20,30);
+INSERT INTO k_enchantment_range VALUES(1,1,5,3,28,40);
+INSERT INTO k_enchantment_range VALUES(1,1,1,4,2,4);
+INSERT INTO k_enchantment_range VALUES(1,1,2,4,3,7);
+INSERT INTO k_enchantment_range VALUES(1,1,3,4,5,9);
+INSERT INTO k_enchantment_range VALUES(1,1,4,4,7,11);
+INSERT INTO k_enchantment_range VALUES(1,1,5,4,9,13);
+INSERT INTO k_enchantment_range VALUES(1,1,1,5,8,12);
+INSERT INTO k_enchantment_range VALUES(1,1,2,5,10,16);
+INSERT INTO k_enchantment_range VALUES(1,1,3,5,15,23);
+INSERT INTO k_enchantment_range VALUES(1,1,4,5,20,30);
+INSERT INTO k_enchantment_range VALUES(1,1,5,5,28,40);
+INSERT INTO k_enchantment_range VALUES(1,1,1,6,2,4);
+INSERT INTO k_enchantment_range VALUES(1,1,2,6,3,7);
+INSERT INTO k_enchantment_range VALUES(1,1,3,6,5,9);
+INSERT INTO k_enchantment_range VALUES(1,1,4,6,7,11);
+INSERT INTO k_enchantment_range VALUES(1,1,5,6,9,13);
+INSERT INTO k_enchantment_range VALUES(1,1,1,8,1,3);
+INSERT INTO k_enchantment_range VALUES(1,1,2,8,2,4);
+INSERT INTO k_enchantment_range VALUES(1,1,3,8,3,6);
+INSERT INTO k_enchantment_range VALUES(1,1,4,8,5,8);
+INSERT INTO k_enchantment_range VALUES(1,1,5,8,7,10);
+INSERT INTO k_enchantment_range VALUES(1,1,1,9,1,3);
+INSERT INTO k_enchantment_range VALUES(1,1,2,9,2,4);
+INSERT INTO k_enchantment_range VALUES(1,1,3,9,3,5);
+INSERT INTO k_enchantment_range VALUES(1,1,4,9,4,7);
+INSERT INTO k_enchantment_range VALUES(1,1,5,9,6,9);
+INSERT INTO k_enchantment_range VALUES(1,1,1,10,2,4);
+INSERT INTO k_enchantment_range VALUES(1,1,2,10,3,5);
+INSERT INTO k_enchantment_range VALUES(1,1,3,10,4,6);
+INSERT INTO k_enchantment_range VALUES(1,1,4,10,5,8);
+INSERT INTO k_enchantment_range VALUES(1,1,5,10,7,10);
+INSERT INTO k_enchantment_range VALUES(1,1,1,11,2,4);
+INSERT INTO k_enchantment_range VALUES(1,1,2,11,3,6);
+INSERT INTO k_enchantment_range VALUES(1,1,3,11,5,8);
+INSERT INTO k_enchantment_range VALUES(1,1,4,11,6,9);
+INSERT INTO k_enchantment_range VALUES(1,1,5,11,8,11);
+INSERT INTO k_enchantment_range VALUES(1,1,1,12,2,4);
+INSERT INTO k_enchantment_range VALUES(1,1,2,12,3,6);
+INSERT INTO k_enchantment_range VALUES(1,1,3,12,5,8);
+INSERT INTO k_enchantment_range VALUES(1,1,4,12,6,9);
+INSERT INTO k_enchantment_range VALUES(1,1,5,12,8,11);
 CREATE TABLE k_decoration_level(
     decoration INT NOT NULL REFERENCES k_decoration(id),
     level INT NOT NULL CHECK(level BETWEEN 1 AND 10),

+ 3 - 3
install_data/install_data.sql

@@ -219,7 +219,7 @@ CREATE TABLE guild_member(
     in_war INT NOT NULL CHECK(in_war IN (0, 1)),
     has_defense INT NOT NULL CHECK(has_defense IN (0, 1))
 );
-CREATE TABLE rune_craft(
+CREATE TABLE enchantment(
     uid INT NOT NULL REFERENCES player(id),
     id INT NOT NULL PRIMARY KEY,
     type INT NOT NULL,
@@ -237,10 +237,10 @@ CREATE TABLE run_party(
     front INT NOT NULL DEFAULT 0,
     PRIMARY KEY (run, unit)
 );
-CREATE TABLE run_drop_rune_craft(
+CREATE TABLE run_drop_enchantment(
     run INT NOT NULL REFERENCES run(id),
     id INT NOT NULL PRIMARY KEY,
-    type INT NOT NULL REFERENCES k_rune_craft_type(id), -- TODO: Duplicated??
+    type INT NOT NULL REFERENCES k_enchantment(id), -- TODO: Duplicated??
     quality INT NOT NULL REFERENCES k_quality(id),
     rune INT NOT NULL REFERENCES k_rune_set(id),
     stat INT NOT NULL REFERENCES k_rune_stat(id),

+ 0 - 0
public/css/report_runecraft.css → public/css/report_rune_enchantment.css


+ 12 - 0
public/css/runs.css

@@ -150,6 +150,18 @@ table#runs td.reward div.item_rune:hover table.rune{
     display: block;
 }
 
+table#runs td.reward div.item_enchantment div.enchantment_panel{
+    display: none;
+    position: absolute;
+    right: 1.8em;
+    bottom: 0;
+    font-size: 75%;
+}
+
+table#runs td.reward div.item_enchantment:hover div.enchantment_panel{
+    display: block;
+}
+
 table#runs td.action img.save_team{
     width: 1em;
     height: 1em;

+ 19 - 19
public/css/ui.css

@@ -1073,9 +1073,9 @@ table.artifact td.details table.table_details span.quality.quality_legend{backgr
 
 
 /**
- * Craft item panel
+ * Enchantment panel
  */
-div.craft_panel{
+div.enchantment_panel{
     width: 4em;
     height: 4em;
     border: 0.1em solid #3c2929;
@@ -1084,22 +1084,22 @@ div.craft_panel{
     text-align: center;
     display: inline-block;
 }
-div.craft_panel.craft_quality_normal{ /* Normal */
+div.enchantment_panel.enchantment_quality_normal{ /* Normal */
     background-image: repeating-radial-gradient(#ffffff, #cccccc 30%, #ffffff 60%);
 }
-div.craft_panel.craft_quality_magic{ /* Magic */
+div.enchantment_panel.enchantment_quality_magic{ /* Magic */
     background-image: repeating-radial-gradient(#aaffaa, #88cc88 30%, #aaffaa 60%);
 }
-div.craft_panel.craft_quality_rare{ /* Rare */
+div.enchantment_panel.enchantment_quality_rare{ /* Rare */
     background-image: repeating-radial-gradient(#aaaaff, #8888cc 30%, #aaaaff 60%);
 }
-div.craft_panel.craft_quality_hero{ /* Hero */
+div.enchantment_panel.enchantment_quality_hero{ /* Hero */
     background-image: repeating-radial-gradient(#ffaacc, #cc88aa 30%, #ffaacc 60%);
 }
-div.craft_panel.craft_quality_legend{ /* Legend */
+div.enchantment_panel.enchantment_quality_legend{ /* Legend */
     background-image: repeating-radial-gradient(#f48200, #b76201 30%, #f48200 60%);
 }
-div.craft_panel img.craft_base{
+div.enchantment_panel img.enchantment_base{
     position: absolute;
     width: 4em;
     height: 4em;
@@ -1107,20 +1107,20 @@ div.craft_panel img.craft_base{
     top: 0.1em;
     left: 0.5em;
 }
-div.craft_panel img.craft_icon{
+div.enchantment_panel img.enchantment_icon{
     position: absolute;
     width: 1.5em;
     height: 1.5em;
     top: 0.8em;
     left: 1.25em;
 }
-div.craft_panel.craft_ancient_1 img.craft_base{filter: brightness(150%) contrast(90%) saturate(100%) drop-shadow(0 0 0.3em #ffffff) drop-shadow(0 0 0.1em #ffffff);}
-div.craft_panel.craft_quality_normal img.craft_base{filter: sepia(100%) saturate(500%) grayscale(100%);}
-div.craft_panel.craft_quality_magic img.craft_base{filter: sepia(100%) saturate(500%) hue-rotate(60deg);}
-div.craft_panel.craft_quality_rare img.craft_base{filter: sepia(100%) saturate(500%) hue-rotate(120deg);}
-div.craft_panel.craft_quality_hero img.craft_base{filter: sepia(100%) saturate(500%) hue-rotate(230deg);}
-div.craft_panel.craft_quality_legend img.craft_base{filter: sepia(100%) saturate(500%) hue-rotate(330deg);}
-div.craft_panel span.craft_stat{
+div.enchantment_panel.enchantment_ancient_1 img.enchantment_base{filter: brightness(150%) contrast(90%) saturate(100%) drop-shadow(0 0 0.3em #ffffff) drop-shadow(0 0 0.1em #ffffff);}
+div.enchantment_panel.enchantment_quality_normal img.enchantment_base{filter: sepia(100%) saturate(500%) grayscale(100%);}
+div.enchantment_panel.enchantment_quality_magic img.enchantment_base{filter: sepia(100%) saturate(500%) hue-rotate(60deg);}
+div.enchantment_panel.enchantment_quality_rare img.enchantment_base{filter: sepia(100%) saturate(500%) hue-rotate(120deg);}
+div.enchantment_panel.enchantment_quality_hero img.enchantment_base{filter: sepia(100%) saturate(500%) hue-rotate(230deg);}
+div.enchantment_panel.enchantment_quality_legend img.enchantment_base{filter: sepia(100%) saturate(500%) hue-rotate(330deg);}
+div.enchantment_panel span.enchantment_stat{
     display: block;
     width: 100%;
     text-align: center;
@@ -1130,17 +1130,17 @@ div.craft_panel span.craft_stat{
     bottom: 0;
     font-family: monospace;
 }
-div.craft_panel span.craft_stat span.craft_stat_name{
+div.enchantment_panel span.enchantment_stat span.enchantment_stat_name{
     display: block;
     margin: 0;
 }
-div.craft_panel span.craft_stat span.craft_stat_value{
+div.enchantment_panel span.enchantment_stat span.enchantment_stat_value{
     display: block;
     font-weight: bold;
     margin: 0;
 }
 
-div.craft_panel span.craft_amount{
+div.enchantment_panel span.enchantment_amount{
     display: block;
     position: absolute;
     top: 0;

+ 15 - 9
swex-plugin/swdb.js

@@ -82,6 +82,7 @@ module.exports = {
             case 'BattleDimensionHoleDungeonStart':
             case 'BattleTrialTowerStart_v2':
             case 'BattleRiftDungeonStart':
+            case 'BattleRiftOfWorldsRaidStart':
                 this.eventStartReq = req;
                 this.eventStartRes = res;
                 break;
@@ -111,24 +112,29 @@ module.exports = {
                 params['result_response'] = JSON.stringify(res);
                 params['result_request'] = JSON.stringify(req);
                 break;
+            case 'BattleDimensionHoleDungeonResult_v2':
+                apiCommand = "run/";
+                method = "POST";
+                success = "Dimension Hole run logged sucesfully!"
+                params['result_response'] = JSON.stringify(res);
+                params['result_request'] = JSON.stringify(req);
+                break;
+            case 'BattleRiftOfWorldsRaidResult':
+                apiCommand = "run/";
+                method = "POST";
+                success = "Rift Rarid run logged sucesfully!"
+                params['result_response'] = JSON.stringify(res);
+                params['start_response'] = JSON.stringify(this.eventStartRes);
+                break;
             case 'BattleScenarioResult':
                 //command = "log_run_scenario";
                 //success = "Scenario run logged sucesfully!"
                 start = true;
                 break;
-            case 'BattleDimensionHoleDungeonResult':
-                //command = "log_run_dh";
-                //success = "Dimension Hole run logged sucesfully!"
-                break;
             case 'BattleTrialTowerResult_v2':
                 //command = "log_run_toa";
                 //success = "TOA run logged sucesfully!"
                 break;
-            case 'BattleRiftDungeonResult':
-                //command = "log_run_rift_dungeon";
-                //success = "Rift Dungeon run logged sucesfully!"
-                start = true;
-                break;
         }
         if (apiCommand != ""){
             this.command(apiCommand, method, params, success);