function GetItemPotentialBuffs($internal_id, $locale)
{
    $db = ConnectCharacterDatabase($locale);
    $q = $db->query("\nSELECT\n\ti.itemid,\n\ti.potential1,\n\ti.potential2,\n\ti.potential3,\n\ti.potential4,\n\ti.potential5,\n\ti.potential6,\n\ti.nebulite1,\n\ti.nebulite2,\n\ti.nebulite3,\n\tii.reqlevel\nFROM\n\t`items` i\nLEFT JOIN\n\t`phpvana_iteminfo` ii\n\t\tON\n\tii.itemid = i.itemid\nWHERE\n\ti.`character_id` = " . intval($internal_id) . "\n\t\tAND\n\tslot < 0\n");
    $temp = array();
    while ($row = $q->fetch_assoc()) {
        $level = round($row['reqlevel'] / 10);
        if ($level == 0) {
            $level = 1;
        }
        $obj = array();
        for ($i = 1; $i <= 6; $i++) {
            if ($row['potential' . $i] == 0) {
                continue;
            }
            $potentialinfo = GetPotentialInfo($row['potential' . $i], $locale);
            $obj[] = $potentialinfo['levels'][$level];
        }
        for ($i = 1; $i <= 3; $i++) {
            if ($row['nebulite' . $i] == -1) {
                continue;
            }
            $nebinfo = GetNebuliteInfo($row['nebulite' . $i], $locale);
            $obj[] = $nebinfo['info'];
        }
        if (count($obj) > 0) {
            $temp[$row['itemid']] = $obj;
        }
    }
    $q->free();
    return $temp;
}
Example #2
0
<?php

require_once __DIR__ . '/../../inc/functions.ajax.php';
CheckSupportedTypes('description', 'name', 'nebuliteinfo', 'potentialinfo');
require_once __DIR__ . '/../../inc/classes/database.php';
require_once __DIR__ . '/../../inc/functions.php';
require_once __DIR__ . '/../../inc/functions.datastorage.php';
RetrieveInputGET('id');
if (!is_numeric($P['id'])) {
    JSONDie('Error');
}
$id = $P['id'];
if ($request_type == 'description') {
    $result = IGTextToWeb(GetMapleStoryString('item', $id, 'desc', CURRENT_LOCALE));
    JSONAnswer(array('result' => $result));
} elseif ($request_type == 'name') {
    $result = IGTextToWeb(GetMapleStoryString('item', $id, 'name', CURRENT_LOCALE));
    JSONAnswer(array('result' => $result));
} elseif ($request_type == 'nebuliteinfo') {
    $result = GetNebuliteInfo($id, CURRENT_LOCALE);
    JSONAnswer(array('result' => $result));
} elseif ($request_type == 'potentialinfo') {
    $result = GetPotentialInfo($id, CURRENT_LOCALE);
    JSONAnswer(array('result' => $result));
}