Ejemplo n.º 1
0
        $reqForQuest->createReport($lang['req_for_quest']);
    }
    //********************************************************************************
    // Give quest list
    //********************************************************************************
    $giveQuest =& new QuestReportGenerator('go_giver');
    $fields = array('QUEST_REPORT_LEVEL', 'QUEST_REPORT_NAME', 'QUEST_REPORT_REWARD');
    if ($giveQuest->Init($fields, $baseLink, 'qgLIST', $config['fade_limit'], 'name')) {
        $giveQuest->getGiveTakeList($entry);
        $giveQuest->createReport($lang['give_quest']);
    }
    //********************************************************************************
    // Take quest list
    //********************************************************************************
    $takeQuest =& new QuestReportGenerator('go_take');
    $fields = array('QUEST_REPORT_LEVEL', 'QUEST_REPORT_NAME', 'QUEST_REPORT_REWARD');
    if ($takeQuest->Init($fields, $baseLink, 'qtLIST', $config['fade_limit'], 'name')) {
        $takeQuest->getGiveTakeList($entry);
        $takeQuest->createReport($lang['take_quest']);
    }
    //********************************************************************************
    // Item loot
    //********************************************************************************
    if ($ajaxmode == 0) {
        if ($obj['type'] == GAMEOBJECT_TYPE_CHEST or $obj['type'] == GAMEOBJECT_TYPE_FISHINGHOLE) {
            $page_seek = init_pagePerMark($mark, "g_lootLIST", $page);
            $rows = getLootList($obj['data1'], "gameobject_loot_template", $totalRecords, $page_seek, $config['fade_limit']);
            renderLootTableList($rows, $lang['can_loot'], $page_seek, $totalRecords, $baseLink, "g_lootLIST");
        }
    }
}
Ejemplo n.º 2
0
function getLootList($lootId, $table, &$totalRecords, $offset = 0, $count = 0)
{
    global $dDB;
    $totalRecords = 0;
    $limit = "";
    if ($count) {
        $limit = "LIMIT {$offset}, {$count}";
    }
    $rows = $dDB->selectPage($totalRecords, "SELECT * FROM `{$table}`\n                                           WHERE `entry` = ?d\n                                           GROUP BY  IF (`mincountOrRef` < 0, `mincountOrRef`, `item`)\n                                           ORDER BY `groupid`, `ChanceOrQuestChance`>0, ABS(`ChanceOrQuestChance`) DESC {$limit}", $lootId);
    if (!$rows) {
        return 0;
    }
    foreach ($rows as &$loot) {
        // Group chance
        if ($loot['ChanceOrQuestChance'] == 0) {
            $group = $loot['groupid'];
            $chance = 0;
            $n = 0;
            foreach ($rows as &$g) {
                if ($g['groupid'] == $group) {
                    if ($g['ChanceOrQuestChance'] > 0) {
                        $chance += $g['ChanceOrQuestChance'];
                    } else {
                        $n++;
                    }
                }
            }
            $chance = round((100 - $chance) / $n, 3);
            foreach ($rows as &$g) {
                if ($g['groupid'] == $group && $g['ChanceOrQuestChance'] == 0) {
                    $g['ChanceOrQuestChance'] = $chance;
                }
            }
        }
        if ($loot['mincountOrRef'] < 0) {
            // Получаем список
            $subcount = 0;
            $loot['item'] = getLootList(-$loot['mincountOrRef'], "reference_loot_template", $subcount);
            $loot['maxcount'] = $dDB->selectCell("SELECT `maxcount` FROM `{$table}` WHERE `entry` = ?d AND `mincountOrRef` = ?d", $lootId, $loot['mincountOrRef']);
        }
    }
    return $rows;
}
Ejemplo n.º 3
0
     // Как с руды
     if ($item['Flags'] & ITEM_FLAGS_PROSPECTABLE) {
         $page_seek = init_pagePerMark($mark, "prospect_lootLIST", $page);
         $rows = getLootList($item['entry'], "prospecting_loot_template", $totalRecords, $page_seek, $config['fade_limit']);
         renderLootTableList($rows, $lang['contain_prospecting_loot'], $page_seek, $totalRecords, $baseLink, "prospect_lootLIST");
     }
     // Если растолочь
     if ($item['Flags'] & ITEM_FLAGS_MILLABLE) {
         $page_seek = init_pagePerMark($mark, "milling_lootLIST", $page);
         $rows = getLootList($item['entry'], "milling_loot_template", $totalRecords, $page_seek, $config['fade_limit']);
         renderLootTableList($rows, $lang['contain_milling_loot'], $page_seek, $totalRecords, $baseLink, "milling_lootLIST");
     }
     // Как дизэнчантом
     if ($item['DisenchantID']) {
         $page_seek = init_pagePerMark($mark, "disenchant_lootLIST", $page);
         $rows = getLootList($item['DisenchantID'], "disenchant_loot_template", $totalRecords, $page_seek, $config['fade_limit']);
         renderLootTableList($rows, $lang['contain_disenchant_loot'], $page_seek, $totalRecords, $baseLink, "disenchant_lootLIST");
     }
 }
 //********************************************************************************
 // Используется в качестве реагента
 //********************************************************************************
 $reagent_in =& new SpellReportGenerator();
 $fields = array('SPELL_REPORT_ICON', 'SPELL_REPORT_RECIPE', 'SPELL_REPORT_REAGENTS', 'SPELL_REPORT_CREATE');
 if ($reagent_in->Init($fields, $baseLink, 'reagentLIST', $config['fade_limit'], 'icon')) {
     $reagent_in->useRegent($entry);
     $reagent_in->createReport($lang['item_use_in_spell']);
 }
 //********************************************************************************
 // Spell loot
 //********************************************************************************
Ejemplo n.º 4
0
        $npc->addColumnConfig('NPC_REPORT_DUNGEON', array('class' => 'small', 'sort' => '', 'text' => $lang['map'], 'draw' => 'r_npcDungeon', 'sort_str' => '', 'fields' => ''));
        if (!$area_data) {
            $npc->onMap($map);
        } else {
            $npc->onArea($area_data);
        }
        $npc->createReport($lang['zone_npc_in']);
    }
    //********************************************************************************
    // GO в зоне
    //********************************************************************************
    $go =& new GameobjectReportGenerator('position');
    $fields = array('GO_REPORT_NAME', 'GO_REPORT_TYPE', 'GO_REPORT_DUNGEON');
    if ($go->Init($fields, $baseLink, 'goLIST', $config['fade_limit'], 'name')) {
        $go->addColumnConfig('GO_REPORT_DUNGEON', array('class' => 'small', 'sort' => '', 'text' => $lang['map'], 'draw' => 'r_objDungeon', 'sort_str' => '', 'fields' => ''));
        if (!$area_data) {
            $go->onMap($map);
        } else {
            $go->onArea($area_data);
        }
        $go->createReport($lang['zone_go_in']);
    }
    //********************************************************************************
    // Fishing in area
    //********************************************************************************
    if ($ajaxmode == 0) {
        $page_seek = init_pagePerMark($mark, "fishing_lootLIST", $page);
        $rows = getLootList($entry, "fishing_loot_template", $totalRecords, $page_seek, $config['fade_limit']);
        renderLootTableList($rows, $lang['contain_fishing_loot'], $page_seek, $totalRecords, $baseLink, "fishing_lootLIST");
    }
}
Ejemplo n.º 5
0
 // Pickpocket loot
 //**************************************************
 if ($ajaxmode == 0) {
     if ($cr['pickpocketloot']) {
         $page_seek = init_pagePerMark($mark, "pickpocketLIST", $page);
         $rows = getLootList($cr['pickpocketloot'], "pickpocketing_loot_template", $totalRecords, $page_seek, $config['fade_limit']);
         renderLootTableList($rows, $lang['can_pickpocketing'], $page_seek, $totalRecords, $baseLink, "pickpocketLIST");
     }
 }
 //**************************************************
 // Skining loot
 //**************************************************
 if ($ajaxmode == 0) {
     if ($cr['skinloot']) {
         $page_seek = init_pagePerMark($mark, "skinLIST", $page);
         $rows = getLootList($cr['skinloot'], "skinning_loot_template", $totalRecords, $page_seek, $config['fade_limit']);
         if ($cr['type_flags'] & CREATURE_TYPEFLAGS_HERBLOOT) {
             renderLootTableList($rows, $lang['give_herb'], $page_seek, $totalRecords, $baseLink, "skinLIST");
         } else {
             if ($cr['type_flags'] & CREATURE_TYPEFLAGS_MININGLOOT) {
                 renderLootTableList($rows, $lang['give_mining'], $page_seek, $totalRecords, $baseLink, "skinLIST");
             } else {
                 if ($cr['type_flags'] & CREATURE_TYPEFLAGS_ENGINEERLOOT) {
                     renderLootTableList($rows, $lang['give_engineer'], $page_seek, $totalRecords, $baseLink, "skinLIST");
                 } else {
                     renderLootTableList($rows, $lang['give_skin'], $page_seek, $totalRecords, $baseLink, "skinLIST");
                 }
             }
         }
     }
 }