示例#1
0
function objectinfo2(&$Row, $level = 0)
{
    global $DB;
    // Номер объекта
    $object['entry'] = $Row['entry'];
    // Название объекта
    $object['name'] = localizedName($Row);
    // Тип объекта
    $object['type'] = $Row['type'];
    if ($level > 0) {
        // В зависимости от типа объекта, заполняем поля:
        switch ($object['type']) {
            case GAMEOBJECT_TYPE_DOOR:
                /*
                 * data0: startOpen (Boolean flag)
                 * data1: open (LockId from Lock.dbc)
                 * data2: autoClose (long unknown flag)
                 * data3: noDamageImmune (Boolean flag)
                 * data4: openTextID (Unknown Text ID)
                 * data5: closeTextID (Unknown Text ID)
                 */
                $object['lockid'] = $Row['data1'];
                break;
            case GAMEOBJECT_TYPE_BUTTON:
                /*
                 * data0: startOpen (State)
                 * data1: open (LockId from Lock.dbc)
                 * data2: autoClose (long unknown flag)
                 * data3: linkedTrap (gameobject_template.entry (Spawned GO type 6))
                 * data4: noDamageImmune (Boolean flag)
                 * data5: large? (Boolean flag)
                 * data6: openTextID (Unknown Text ID)
                 * data7: closeTextID (Unknown Text ID)
                 * data8: losOK (Boolean flag)
                 */
                $object['lockid'] = $Row['data1'];
            case GAMEOBJECT_TYPE_QUESTGIVER:
                /*
                 * data0: open (LockId from Lock.dbc)
                 * data1: questList (unknown ID)
                 * data2: pageMaterial (PageTextMaterial.dbc)
                 * data3: gossipID (unknown ID)
                 * data4: customAnim (unknown value from 1 to 4)
                 * data5: noDamageImmune (Boolean flag)
                 * data6: openTextID (Unknown Text ID)
                 * data7: losOK (Boolean flag)
                 * data8: allowMounted (Boolean flag)
                 * data9: large? (Boolean flag)
                 */
                $object['lockid'] = $Row['data0'];
                break;
            case GAMEOBJECT_TYPE_CHEST:
                /*
                 * data0: open (LockId from Lock.dbc)
                 * data1: chestLoot (gameobject_loot_template.entry) *This field is obtained from WDB data and is not to be changed*
                 * data2: chestRestockTime (time in seconds)
                 * data3: consumable (State: Boolean flag)
                 * data4: minRestock (Min successful loot attempts for Mining, Herbalism etc)
                 * data5: maxRestock (Max successful loot attempts for Mining, Herbalism etc)
                 * data6: lootedEvent (unknown ID)
                 * data7: linkedTrap (gameobject_template.entry (Spawned GO type 6))
                 * data8: questID (v_quest_template.entry of completed quest)
                 * data9: level (minimal level required to open this gameobject)
                 * data10: losOK (Boolean flag)
                 * data11: leaveLoot (Boolean flag)
                 * data12: notInCombat (Boolean flag)
                 * data13: log loot (Boolean flag)
                 * data14: openTextID (Unknown ID)
                 * data15: use group loot rules (Boolean flag)
                 */
                $object['lockid'] = $Row['data0'];
                $object['lootid'] = $Row['data1'];
                break;
            case GAMEOBJECT_TYPE_BINDER:
                /*	Object type not used */
                break;
            case GAMEOBJECT_TYPE_GENERIC:
                /*
                 * data0: floatingTooltip (Boolean flag)
                 * data1: highlight (Boolean flag)
                 * data2: serverOnly? (Always 0)
                 * data3: large? (Boolean flag)
                 * data4: floatOnWater (Boolean flag)
                 * data5: questID (Required active v_quest_template.entry to work)
                 */
                break;
            case GAMEOBJECT_TYPE_TRAP:
                /*
                 * data0: open (LockId from Lock.dbc)
                 * data1: level (npc equivalent level for casted spell)
                 * data2: radius (Distance)
                 * data3: spell (Spell Id from spell.dbc)
                 * data4: charges (0 or 1)
                 * data5: cooldown (time in seconds)
                 * data6:  ? (unknown flag)
                 * data7: startDelay? (time in seconds)
                 * data8: serverOnly? (always 0)
                 * data9: stealthed (Boolean flag)
                 * data10: large? (Boolean flag)
                 * data11: stealthAffected (Boolean flag)
                 * data12: openTextID (Unknown ID)
                 */
                $object['lockid'] = $Row['data0'];
                break;
            case GAMEOBJECT_TYPE_CHAIR:
                /*
                 * data0: chairslots (number of players that can sit down on it)
                 * data1: chairorientation? (number of usable side?)
                 */
                break;
            case GAMEOBJECT_TYPE_SPELL_FOCUS:
                /*
                 * data0: spellFocusType (from SpellFocusObject.dbc)
                 * data1: radius (Distance)
                 * data2: linkedTrap (gameobject_template.entry (Spawned GO type 6))
                 */
                break;
            case GAMEOBJECT_TYPE_TEXT:
                /*
                 * data0: pageID (page_text.entry)
                 * data1: language (from Languages.dbc)
                 * data2: pageMaterial (PageTextMaterial.dbc)
                 */
                $object['pageid'] = $Row['data0'];
                break;
            case GAMEOBJECT_TYPE_GOOBER:
                /*
                 * data0: open (LockId from Lock.dbc)
                 * data1: questID (Required active v_quest_template.entry to work)
                 * data2: eventID (Unknown Event ID)
                 * data3:  ? (unknown flag)
                 * data4: customAnim (unknown)
                 * data5: consumable (Boolean flag controling if gameobject will despawn or not)
                 * data6: cooldown (time is seconds)
                 * data7: pageID (page_text.entry)
                 * data8: language (from Languages.dbc)
                 * data9: pageMaterial (PageTextMaterial.dbc)
                 * data10: spell (Spell Id from spell.dbc)
                 * data11: noDamageImmune (Boolean flag)
                 * data12: linkedTrap (gameobject_template.entry (Spawned GO type 6))
                 * data13: large? (Boolean flag)
                 * data14: openTextID (Unknown ID)
                 * data15: closeTextID (Unknown ID)
                 * data16: losOK (Boolean flag)
                 */
                $object['lockid'] = $Row['data0'];
                $object['pageid'] = $Row['data7'];
                break;
            case GAMEOBJECT_TYPE_TRANSPORT:
                /* No data data used, all are always 0 */
                break;
            case GAMEOBJECT_TYPE_AREADAMAGE:
                /* Object type not used */
                break;
            case GAMEOBJECT_TYPE_CAMERA:
                /*
                 * data0: open (LockId from Lock.dbc)
                 * data1: camera (Cinematic entry from CinematicCamera.dbc)
                 */
                $object['lockid'] = $Row['data0'];
                break;
            case GAMEOBJECT_TYPE_MAP_OBJECT:
                /* No data data used, all are always 0 */
                break;
            case GAMEOBJECT_TYPE_MO_TRANSPORT:
                /*
                 * data0: taxiPathID (Id from TaxiPath.dbc)
                 * data1: moveSpeed
                 * data2: accelRate
                 */
                break;
            case GAMEOBJECT_TYPE_DUEL_ARBITER:
                /*	Only one Gameobject with this type (21680) and no data data */
                break;
            case GAMEOBJECT_TYPE_FISHINGNODE:
                /*	Only one Gameobject with this type (35591) and no data data */
                break;
            case GAMEOBJECT_TYPE_RITUAL:
                /*
                 * data0: casters?
                 * data1: spell (Spell Id from spell.dbc)
                 * data2: animSpell (Spell Id from spell.dbc)
                 * data3: ritualPersistent (Boolean flag)
                 * data4: casterTargetSpell (Spell Id from spell.dbc)
                 * data5: casterTargetSpellTargets (Boolean flag)
                 * data6: castersGrouped (Boolean flag)
                 */
                break;
            case GAMEOBJECT_TYPE_MAILBOX:
                /* No data data used, all are always 0 */
                break;
            case GAMEOBJECT_TYPE_AUCTIONHOUSE:
                /* data0: actionHouseID (From AuctionHouse.dbc ?) */
                break;
            case GAMEOBJECT_TYPE_GUARDPOST:
                /*	Object type not used */
                break;
            case GAMEOBJECT_TYPE_SPELLCASTER:
                /*
                 * data0: spell (Spell Id from spell.dbc)
                 * data1: charges
                 * data2: partyOnly (Boolean flag, need to be in group to use it)
                 */
                break;
            case GAMEOBJECT_TYPE_MEETINGSTONE:
                /*
                 * data0: minLevel
                 * data1: maxLevel
                 * data2: areaID (From AreaTable.dbc)
                 */
                break;
            case GAMEOBJECT_TYPE_FLAGSTAND:
                /*
                 * data0: open (LockId from Lock.dbc)
                 * data1: pickupSpell (Spell Id from spell.dbc)
                 * data2: radius (distance)
                 * data3: returnAura (Spell Id from spell.dbc)
                 * data4: returnSpell (Spell Id from spell.dbc)
                 * data5: noDamageImmune (Boolean flag)
                 * data6:  ?
                 * data7: losOK (Boolean flag)
                 */
                $object['lockid'] = $Row['data0'];
                break;
            case GAMEOBJECT_TYPE_FISHINGHOLE:
                /*
                 * data0: radius (distance)
                 * data1: chestLoot (gameobject_loot_template.entry)
                 * data2: minRestock
                 * data3: maxRestock
                 */
                $object['lootid'] = $Row['data1'];
                break;
            case GAMEOBJECT_TYPE_FLAGDROP:
                /*
                 * data0: open (LockId from Lock.dbc)
                 * data1: eventID (Unknown Event ID)
                 * data2: pickupSpell (Spell Id from spell.dbc)
                 * data3: noDamageImmune (Boolean flag)
                 */
                $object['lockid'] = $Row['data0'];
                break;
            case GAMEOBJECT_TYPE_MINI_GAME:
                /*	Object type not used
                				Reused in core for CUSTOM_TELEPORT
                					* data0: areatrigger_teleport.id
                			*/
                break;
            case GAMEOBJECT_TYPE_LOTTERY_KIOSK:
                /*	Object type not used */
                break;
            case GAMEOBJECT_TYPE_CAPTURE_POINT:
                /*
                 * data0: radius (Distance)
                 * data1: spell (Unknown ID, not a spell id in dbc file, maybe server only side spell)
                 * data2: worldState1
                 * data3: worldstate2
                 * data4: winEventID1 (Unknown Event ID)
                 * data5: winEventID2 (Unknown Event ID)
                 * data6: contestedEventID1 (Unknown Event ID)
                 * data7: contestedEventID2 (Unknown Event ID)
                 * data8: progressEventID1 (Unknown Event ID)
                 * data9: progressEventID2 (Unknown Event ID)
                 * data10: neutralEventID1 (Unknown Event ID)
                 * data11: neutralEventID2 (Unknown Event ID)
                 * data12: neutralPercent
                 * data13: worldstate3
                 * data14: minSuperiority
                 * data15: maxSuperiority
                 * data16: minTime (in seconds)
                 * data17: maxTime (in seconds)
                 * data18: large? (Boolean flag)
                 */
                break;
            case GAMEOBJECT_TYPE_AURA_GENERATOR:
                /*
                 * data0: startOpen (Boolean flag)
                 * data1: radius (Distance)
                 * data2: auraID1 (Spell Id from spell.dbc)
                 * data3: conditionID1 (Unknown ID)
                 */
                break;
            case GAMEOBJECT_TYPE_DUNGEON_DIFFICULTY:
                /*
                 * data0: mapID (From Maps.dbc)
                 * data1: difficulty (0 or 1)
                 */
                break;
            case GAMEOBJECT_TYPE_UNK:
                /*	Object type not used */
                break;
            case GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING:
                /*	Object type not used */
                break;
            case GAMEOBJECT_TYPE_GUILD_BANK:
                /*	No data data used, all are always 0 */
                break;
        }
        // Тип объекта и требуемый уровень скилла, и какого скилла
        if ($object['lockid']) {
            $lock_row = $DB->selectRow('
				SELECT *
				FROM ?_lock
				WHERE lockID=?d
				LIMIT 1
				', $object['lockid']);
            if ($lock_row) {
                for ($j = 1; $j <= 5; $j++) {
                    switch ($lock_row['type' . $j]) {
                        case 0:
                            // Не замок
                            break;
                        case 1:
                            // Ключ
                            $object['key'] = array();
                            $object['key'] = $DB->selectRow('SELECT entry as id, name, quality FROM item_template WHERE entry=?d LIMIT 1', $lock_row['lockproperties' . $j]);
                            break;
                        case 2:
                            // Скилл
                            switch ($lock_row['lockproperties' . $j]) {
                                case LOCK_PROPERTIES_FOOTLOCK:
                                    // Сундук
                                    $object['type'] = -5;
                                    $object['lockpicking'] = $lock_row['requiredskill' . $j];
                                    break;
                                case LOCK_PROPERTIES_HERBALISM:
                                    // Трава
                                    $object['type'] = -3;
                                    $object['herbalism'] = $lock_row['requiredskill' . $j];
                                    break;
                                case LOCK_PROPERTIES_MINING:
                                    // Руда
                                    $object['type'] = -4;
                                    $object['mining'] = $lock_row['requiredskill' . $j];
                                    break;
                                default:
                                    break;
                            }
                            break;
                        default:
                            break;
                    }
                }
            }
        }
        // Текст страниц
        if ($object['pageid']) {
            while ($object['pageid'] > 0) {
                $row = $DB->selectRow('
						SELECT text, next_page
							{, text_loc?d}
						FROM page_text p
							{LEFT JOIN (locales_page_text l) ON l.entry = p.entry AND ?}
						WHERE
							p.entry = ?d
						LIMIT 1
					', $_SESSION['locale'] ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] ? 1 : DBSIMPLE_SKIP, $object['pageid']);
                /*
                if($_SESSION['locale']>0)
                	$text = QuestReplaceStr($DB->selectCell('SELECT Text_loc?d FROM locales_page_text WHERE entry = ?d LIMIT 1', $_SESSION['locale'], $object['pageid']));
                if($text)
                	$next_page = $DB->selectCell('SELECT next_page FROM page_text WHERE entry = ?d LIMIT 1', $object['pageid']);
                else
                	list($text, $next_page) = $DB->selectRow('SELECT text AS \'0\', next_page AS \'1\' FROM page_text WHERE entry = ?d LIMIT 1', $object['pageid']);
                */
                $row['text'] = QuestReplaceStr(localizedName($row, 'text'));
                if (empty($row['text'])) {
                    break;
                }
                $object['pagetext'][] = $row['text'];
                $object['pageid'] = $row['next_page'];
            }
        }
        // Лут...
        if (isset($object['lootid'])) {
            $object['drop'] = array();
            if (!($object['drop'] = loot('gameobject_loot_template', $object['lootid']))) {
                unset($object['drop']);
            }
        }
    }
    switch ($object['type']) {
        case 9:
            $type = "Buch";
            break;
        case 3:
            $type = "Behälter";
            break;
        case 5:
            $type = "Schließkiste";
            break;
        case 3:
            $type = "Kräuter";
            break;
        case 4:
            $type = "Erzvorkommen";
            break;
        case 2:
            $type = "Quest";
            break;
        default:
            $type = '';
            break;
    }
    $x = '';
    $x .= "<table><tr><td><b class=\"q\">{$object['name']}</b></td></tr></table><table><tr><td>";
    $x .= "{$type}";
    $x .= "</td></tr></table>";
    $object['tooltip'] = $x;
    return $object;
}
示例#2
0
function iteminfo2(&$Row, $level = 0)
{
    global $DB;
    global $allitems;
    global $spell_cols;
    global $object_cols;
    $item = array();
    // Номер вещи
    $item['entry'] = $Row['entry'];
    // Название вещи
    $item['name'] = localizedName($Row);
    // Тип вещи
    $item['type'] = $Row['InventoryType'];
    $item['displayid'] = $Row['displayid'];
    // Уровень вещи
    $item['level'] = $Row['ItemLevel'];
    // Качество вещи...
    $item['quality'] = $Row['quality'];
    $item['quality2'] = 7 - $Row['quality'];
    // Требуемый уровень вещи:
    $item['reqlevel'] = $Row['RequiredLevel'];
    // Класс и подкласс вещи
    // TODO: немного неверное определение
    $item['classs'] = $Row['class'];
    $item['subclass'] = $Row['subclass'];
    $item['rclass'] = $Row['AllowableClass'];
    // Иконка вещи
    $item['iconname'] = $Row['iconname'];
    // Кол-во вещей в пачке
    $item['stackable'] = $Row['stackable'];
    // Стоимость вещи для покупки
    // DPS
    $dps = 0;
    if ($Row['class'] == 2) {
        for ($i = 1; $i <= 2; $i++) {
            $d_type = $Row['dmg_type' . $i];
            $d_min = $Row['dmg_min' . $i];
            $d_max = $Row['dmg_max' . $i];
            if ($d_max > 0 and $Row['class'] != 6) {
                $delay = $Row['delay'] / 1000;
                if ($delay > 0) {
                    $dps = $dps + round(($d_max + $d_min) / (2 * $delay), 1);
                }
            }
        }
        $item['dps'] = $dps;
        $item['speed'] = $Row['delay'] / 1000;
        if (!$item['speed']) {
            $item['speed'] = -1;
        }
    }
    // Armor
    $item['armor'] = $Row['armor'];
    $item['slot'] = $Row['InventoryType'];
    // Bag
    if ($Row['class'] == 1) {
        $item['slots'] = $Row['ContainerSlots'];
    }
    // Добавляем в глобальный массив allitems
    allitemsinfo2($Row, 0);
    if ($level > 0) {
        $item['BuyPrice'] = $Row['BuyPrice'];
        //
        $item['BagFamily'] = $Row['BagFamily'];
        $item['ContainerSlots'] = $Row['ContainerSlots'];
        $item['DisenchantID'] = $Row['DisenchantID'];
        // Навык энчанта для разборки вещи
        if ($Row['RequiredDisenchantSkill'] != -1) {
            $item['disenchantskill'] = $Row['RequiredDisenchantSkill'];
        }
        // Цена на продажу
        $item['sellgold'] = floor($Row['SellPrice'] / 10000);
        $item['sellsilver'] = floor($Row['SellPrice'] % 10000 / 100);
        $item['sellcopper'] = floor($Row['SellPrice'] % 100);
        // Цена за покупку
        $item['buygold'] = floor($Row['BuyPrice'] / 10000);
        $item['buysilver'] = floor($Row['BuyPrice'] % 10000 / 100);
        $item['buycopper'] = floor($Row['BuyPrice'] % 100);
        // Начинает квест
        if ($Row['startquest']) {
            $item['starts'] = array(GetDBQuestInfo($Row['startquest'], 0xffffff));
        }
        // Информационное окно
        $item['info'] = render_item_tooltip($Row);
        // Обучает
        $teaches = array();
        for ($j = 1; $j <= 4; $j++) {
            if ($Row['spellid_' . $j] == 483) {
                $teaches[] = spellinfo($Row['spellid_' . ($j + 1)]);
            }
        }
        if ($teaches) {
            $item['teaches'] = $teaches;
            unset($teaches);
            unset($spellrow);
        }
        // Открывает:
        // Тип замков, для которых этот предмет является ключем:
        $locks_row = $DB->selectCol('
			SELECT lockID
			FROM ?_lock
			WHERE
				(type1=1 AND lockproperties1=?d) OR
				(type2=1 AND lockproperties2=?d) OR
				(type3=1 AND lockproperties3=?d) OR
				(type4=1 AND lockproperties4=?d) OR
				(type5=1 AND lockproperties5=?d)
			', $item['entry'], $item['entry'], $item['entry'], $item['entry'], $item['entry']);
        if ($locks_row) {
            // Игровые объекты с таким типом замка:
            $item['unlocks'] = $DB->select('
				SELECT ?#
				FROM gameobject_template
				WHERE
					(
						((type IN (?a)) AND (data0 IN (?a)))
					OR
						((type IN (?a)) AND (data0 IN (?a)))
					)
				', $object_cols[0], array(GAMEOBJECT_TYPE_QUESTGIVER, GAMEOBJECT_TYPE_CHEST, GAMEOBJECT_TYPE_TRAP, GAMEOBJECT_TYPE_GOOBER, GAMEOBJECT_TYPE_CAMERA, GAMEOBJECT_TYPE_FLAGSTAND, GAMEOBJECT_TYPE_FLAGDROP), $locks_row, array(GAMEOBJECT_TYPE_DOOR, GAMEOBJECT_TYPE_BUTTON), $locks_row);
            if (!$item['unlocks']) {
                unset($item['unlocks']);
            }
        }
        unset($locks_row);
        // Текст страниц
        if ($Row['PageText']) {
            $pageid = $Row['PageText'];
            while ($pageid > 0) {
                $row = $DB->selectRow('
						SELECT text, next_page
							{, text_loc?d}
						FROM page_text p
							{LEFT JOIN (locales_page_text l) ON l.entry = p.entry AND ?}
						WHERE
							p.entry = ?d
						LIMIT 1
					', $_SESSION['locale'] ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] ? 1 : DBSIMPLE_SKIP, $pageid);
                $row['text'] = QuestReplaceStr(localizedName($row, 'text'));
                if (!empty($row['text'])) {
                    $item['pagetext'][] = $row['text'];
                }
                $pageid = $row['next_page'];
            }
        }
    }
    return $item;
}
示例#3
0
function GetQuestStrings(&$data)
{
    $data['Title'] = QuestReplaceStr(localizedName($data, 'Title'));
    $data['Objectives'] = QuestReplaceStr(htmlspecialchars(localizedName($data, 'Objectives')));
    $data['Details'] = QuestReplaceStr(htmlspecialchars(localizedName($data, 'Details')));
    $data['RequestItemsText'] = QuestReplaceStr(htmlspecialchars(localizedName($data, 'RequestItemsText')));
    $data['OfferRewardText'] = QuestReplaceStr(htmlspecialchars(localizedName($data, 'OfferRewardText')));
    $data['EndText'] = QuestReplaceStr(htmlspecialchars(localizedName($data, 'EndText')));
    for ($j = 0; $j <= 3; ++$j) {
        $data['ObjectiveText'][$j] = QuestReplaceStr(htmlspecialchars(localizedName($data, 'ObjectiveText' . $j)));
    }
}
示例#4
0
function GetQuestStrings(&$data)
{
    $data['Title'] = QuestReplaceStr(!empty($data['Title_loc']) ? $data['Title_loc'] : $data['Title']);
    $data['Objectives'] = QuestReplaceStr(htmlspecialchars(!empty($data['Objectives_loc']) ? $data['Objectives_loc'] : $data['Objectives']));
    $data['Details'] = QuestReplaceStr(htmlspecialchars(!empty($data['Details_loc']) ? $data['Details_loc'] : $data['Details']));
    $data['RequestItemsText'] = QuestReplaceStr(htmlspecialchars(!empty($data['RequestItemsText_loc']) ? $data['RequestItemsText_loc'] : $data['RequestItemsText']));
    $data['OfferRewardText'] = QuestReplaceStr(htmlspecialchars(!empty($data['OfferRewardText_loc']) ? $data['OfferRewardText_loc'] : $data['OfferRewardText']));
    $data['EndText'] = QuestReplaceStr(htmlspecialchars(!empty($data['EndText_loc']) ? $data['EndText_loc'] : $data['EndText']));
    for ($j = 0; $j <= 3; ++$j) {
        $data['ObjectiveText'][$j] = QuestReplaceStr(htmlspecialchars(!empty($data['ObjectiveText' . $j . '_loc']) ? $data['ObjectiveText' . $j . '_loc'] : $data['ObjectiveText' . $j]));
    }
}