Пример #1
0
                         $Smarty->display('fragments/boss/' . str_replace('.frag', '', $_REQUEST['datatype']));
                     }
                 } else {
                     header('Location: /zone/' . $ZoneInfo['link_name']);
                 }
             }
         }
     }
     break;
 case 'npc':
     if (Text::IsNull($_REQUEST['subcategory'])) {
         Page::GenerateErrorPage($Smarty, 404);
     } else {
         if ($_REQUEST['lastcategory'] == 'tooltip') {
             Manager::LoadExtension('Zones', $ClassConstructor);
             $NPCInfo = Zones::GetNPCInfo($_REQUEST['subcategory']);
             $Smarty->assign('NPC', $NPCInfo);
             $Smarty->display('blocks/npc_tooltip');
         } else {
             header('Location: /');
         }
     }
     break;
 case 'forum':
     $Smarty->translate('Forums');
     Manager::LoadExtension('Forums', $ClassConstructor);
     if (Text::IsNull($_REQUEST['subcategory'])) {
         $Smarty->assign('Forums', Forums::GetForums());
         $Smarty->assign('Page', Page::Info('forum', array('bodycss' => 'forums forums-home', 'pagetitle' => $Smarty->GetConfigVars('Forum_Page_Title') . ' - ')));
         $Smarty->display('pages/forums_list_categories');
     } else {
 public static function GetNPCInfo($NPCID)
 {
     $Statement = Zones::$WConnection->prepare('
         SELECT
             ct.entry,
             ct.difficulty_entry_1,
             ct.difficulty_entry_2,
             ct.difficulty_entry_3,
             ct.name,
             ct.subname,
             ct.minlevel,
             ct.maxlevel,
             ct.rank,
             ct.lootid,
             ct.HealthModifier * cls.basehp0 as health,
             ct.type,
             ct.ScriptName
         FROM
             creature_template ct
         LEFT JOIN creature_classlevelstats cls ON
                 ct.unit_class = cls.class
             AND
                 ct.maxlevel = cls.level
         WHERE
             entry = :npc
     ');
     $Statement->bindParam(':npc', $NPCID);
     $Statement->execute();
     $Result = $Statement->fetch(PDO::FETCH_ASSOC);
     $Result['type'] = Zones::NPCType($Result['type']);
     $Result['health'] = Text::NiceNumbers($Result['health']);
     for ($i = 1; $i <= 3; $i++) {
         if ($Result['difficulty_entry_' . $i] != 0) {
             $Result['difficulty_entry_' . $i] = Zones::GetNPCInfo($Result['difficulty_entry_' . $i]);
         }
     }
     return $Result;
 }