/**
 *
 * @param type $row
 * @return type 
 */
function spellinfo2(&$row)
{
    global $DB;
    global $item_cols;
    if ($row) {
        $spell = array();
        $spell['entry'] = $row['spellID'];
        $spell['quality'] = '@';
        $spell['name'] = $row['spellname_loc' . $_SESSION['locale']];
        $spell['rank'] = $row['rank_loc' . $_SESSION['locale']];
        $spell['level'] = $row['levelspell'];
        $spell['school'] = $row['resistancesID'];
        // TODO: Что за cat?
        $spell['cat'] = 0;
        // Скилл
        //		if(!(isset($row['skillID'])))
        //		$skillrow = list($row['skillID'],$row['req_skill_value'],$row['min_value'],$row['max_value']);//$DB->selectRow('SELECT skillID, req_skill_value, min_value, max_value  FROM ?_aowow_skill_line_ability WHERE spellID=?d LIMIT 1', $spell['entry']);
        if (isset($row['skillID'])) {
            //			if($skillrow['req_skill_value'] != 1)
            //				$spell['learnedat'] = $skillrow['req_skill_value'];
            // TODO: На каком уровне скилла можно обучиться спеллу (поле learnedat)
            if ($row['min_value'] and $row['max_value']) {
                $spell['colors'] = array();
                $spell['colors'][0] = '';
                $spell['colors'][1] = $row['min_value'];
                $spell['colors'][2] = floor(($row['max_value'] + $row['min_value']) / 2);
                $spell['colors'][3] = $row['max_value'];
            }
            $spell['skill'] = $row['skillID'];
        }
        // Реагенты
        $spell['reagents'] = array();
        $i = 0;
        global $allitems;
        for ($j = 1; $j <= 8; $j++) {
            if ($row['reagent' . $j]) {
                $spell['reagents'][$i] = array();
                // ID реагента
                $spell['reagents'][$i]['entry'] = $row['reagent' . $j];
                // Доп данные о реагенте
                // Если данных для этой вещи ещё нет:
                allitemsinfo($spell['reagents'][$i]['entry'], 0);
                // Количество реагентов
                $spell['reagents'][$i]['count'] = $row['reagentcount' . $j];
                $i++;
            }
        }
        // Создает вещь:
        $i = 0;
        for ($j = 1; $j <= 3; $j++) {
            if (isset($row['effect' . $j . 'id']) && $row['effect' . $j . 'id'] == 24) {
                $spell['creates'][$i] = array();
                $spell['creates'][$i]['entry'] = $row['effect' . $j . 'itemtype'];
                $spell['creates'][$i]['count'] = $row['effect' . $j . 'BasePoints'] + 1;
                if (!isset($allitems[$spell['creates'][$i]['entry']])) {
                    $createrow = $DB->selectRow('
						SELECT ?#
						FROM ?_item_template, ?_aowow_icons
						WHERE
							entry=?d
							AND id=displayid
						LIMIT 1', $item_cols[0], $spell['creates'][$i]['entry']);
                    allitemsinfo2($createrow, 0);
                }
                if (!isset($allitems[$spell['creates'][$i]['entry']])) {
                    // Если так и не существует - нет соответствующей записи в таблице вещей
                    $spell['quality'] = 6;
                } else {
                    $spell['quality'] = 6 - $allitems[$spell['creates'][$i]['entry']]['quality'];
                }
                $i++;
            }
        }
        allspellsinfo2($row, 0);
        return $spell;
    } else {
        return;
    }
}
Example #2
0
                if ($row['reagent' . $j]) {
                    $item['reagentfor'][$numRow]['reagents'][]['entry'] = $row['reagent' . $j];
                    $item['reagentfor'][$numRow]['reagents'][count($item['reagentfor'][$numRow]['reagents']) - 1]['count'] = $row['reagentcount' . $j];
                    allitemsinfo($row['reagent' . $j], 0);
                }
            }
            for ($j = 1; $j <= 3; $j++) {
                if ($row['effect' . $j . 'itemtype']) {
                    $item['reagentfor'][$numRow]['creates'][]['entry'] = $row['effect' . $j . 'itemtype'];
                    $item['reagentfor'][$numRow]['creates'][count($item['reagentfor'][$numRow]['creates']) - 1]['count'] = 1 + $row['effect' . $j . 'BasePoints'];
                    allitemsinfo($row['effect' . $j . 'itemtype'], 0);
                    @($item['reagentfor'][$numRow]['quality'] = 6 - $allitems[$row['effect' . $j . 'itemtype']]['quality']);
                }
            }
            // Добавляем в таблицу спеллов
            allspellsinfo2($row);
        }
        unset($quality);
    }
    unset($rows_r);
    // Создается из...
    $rows_cf = $DB->select('
		SELECT ?#, s.spellID
		FROM ?_udwbase_spell s, ?_udwbase_spellicons i
		WHERE
			((s.effect1itemtype=?d
			OR s.effect2itemtype=?d
			OR s.effect3itemtype=?)
			AND (i.id = s.spellicon))
		', $spell_cols[2], $item['entry'], $item['entry'], $item['entry']);
    if ($rows_cf) {
            allspellsinfo2($tmp);
        }
        unset($tmp);
    }
    // Спелл, кастуемый на игрока в награду за выполнение
    if ($quest['RewSpellCast'] > 0 || $quest['RewSpell'] > 0) {
        $tmp = $DB->SelectRow('
			SELECT ?#, s.spellname_loc' . $_SESSION['locale'] . '
			FROM ?_aowow_spell s, ?_aowow_spellicons si
			WHERE
				s.spellID=?d
				AND si.id=s.spellicon
			LIMIT 1', $spell_cols[0], $quest['RewSpell'] > 0 ? $quest['RewSpell'] : $quest['RewSpellCast']);
        if ($tmp) {
            $quest['spellreward'] = array('name' => $tmp['spellname_loc' . $_SESSION['locale']], 'entry' => $tmp['spellID']);
            allspellsinfo2($tmp);
        }
        unset($tmp);
    }
    // Создания, необходимые для квеста
    //$quest['creaturereqs'] = array();
    //$quest['objectreqs'] = array();
    $quest['coreqs'] = array();
    for ($i = 0; $i <= 4; ++$i) {
        //echo $quest['ReqCreatureOrGOCount'.$i].'<br />';
        if ($quest['ReqCreatureOrGOId' . $i] != 0 && $quest['ReqCreatureOrGOCount' . $i] != 0) {
            if ($quest['ReqCreatureOrGOId' . $i] > 0) {
                // Необходимо какое-либо взамодействие с созданием
                $quest['coreqs'][$i] = array_merge(creatureinfo($quest['ReqCreatureOrGOId' . $i]), array('req_type' => 'npc'));
            } else {
                // необходимо какое-то взаимодействие с объектом
Example #4
0
     $spell['cooldown'] = $row['cooldown'] / 1000;
 }
 // Время действия спелла
 if ($row['durationBase'] > 0) {
     $spell['duration'] = $row['durationBase'] / 1000 . ' ' . $smarty->get_config_vars('seconds');
 } else {
     $spell['duration'] = '<span class="q0">n/a</span>';
 }
 // Школа
 $spell['school'] = $row['school'];
 // Диспелл
 $spell['dispel'] = $row['dispel'];
 // Механика
 $spell['mechanic'] = $row['mechanic'];
 // Информация о спелле
 $spell['info'] = allspellsinfo2($row, 2);
 // Инструменты
 $spell['tools'] = array();
 $i = 0;
 for ($j = 1; $j <= 2; $j++) {
     if ($row['tool' . $j]) {
         $tool_row = allitemsinfo($row['tool' . $j], 0);
         $spell['tools'][$i] = array('name' => $tool_row['name'], 'quality' => $tool_row['quality'], 'entry' => $row['tool' . $j]);
         $i++;
     }
 }
 // Реагенты
 $spell['reagents'] = array();
 $i = 0;
 for ($j = 1; $j <= 8; $j++) {
     if ($row['reagent' . $j]) {