public static function GetSimpleSpell($SpellID, $JSONP)
 {
     $SpellInfo = Spells::SpellInfo($SpellID);
     if ($SpellInfo) {
         $SpellData = Text::RemapArray($SpellInfo, ['SpellID', 'Name', 'Description', 'icon'], ['id', 'name', 'description', 'icon']);
         parent::Encode($SpellData, $JSONP);
     } else {
         parent::GenerateResponse(404, true);
     }
 }
Пример #2
0
 private static function GetItemSetSpellInfo($SpellID)
 {
     return Spells::SpellInfo($SpellID);
 }
Пример #3
0
             }
         } else {
             $Smarty->assign('Page', Page::Info('community', array('bodycss' => 'server-error', 'pagetitle' => '')));
             $Smarty->display('pages/character_notfound');
         }
     }
     break;
 case 'spell':
     if (Text::IsNull($_REQUEST['subcategory'])) {
         Page::GenerateErrorPage($Smarty, 404);
     } else {
         if (!Text::IsNull($_REQUEST['lastcategory']) && $_REQUEST['lastcategory'] == 'test') {
             Text::PrettyPrint(Spells::GetSpellByID($_REQUEST['subcategory']));
             Text::PrettyPrint(Spells::SpellInfo($_REQUEST['subcategory']));
         } elseif (!Text::IsNull($_REQUEST['lastcategory']) && $_REQUEST['lastcategory'] == 'tooltip') {
             $Smarty->assign('Spell', Spells::SpellInfo($_REQUEST['subcategory']));
             $Smarty->display('blocks/spell_tooltip');
         } else {
             header('Location: /');
         }
     }
     break;
 case 'quest':
     if (Text::IsNull($_REQUEST['subcategory'])) {
         Page::GenerateErrorPage($Smarty, 404);
     } else {
         if (!Text::IsNull($_REQUEST['lastcategory']) && $_REQUEST['lastcategory'] == 'tooltip') {
             $Smarty->assign('Quest', Items::QuestInfo($_REQUEST['subcategory']));
             $Smarty->display('blocks/quest_tooltip');
         } else {
             header('Location: /');
 public static function GetCharacterGlyphs($CharacterGuid)
 {
     $Statement = Characters::$CharConnection->prepare('SELECT * FROM character_glyphs WHERE guid = :guid');
     $Statement->bindParam(':guid', $CharacterGuid);
     $Statement->execute();
     $Result = $Statement->fetchAll(PDO::FETCH_ASSOC);
     $ArrayIndex = 0;
     foreach ($Result as $Glyphs) {
         unset($Result[$ArrayIndex]['guid']);
         unset($Result[$ArrayIndex]['talentGroup']);
         $ArrayIndex++;
     }
     $ArrayIndex = 0;
     foreach ($Result as $Glyph) {
         for ($i = 1; $i < 7; $i++) {
             if ($Glyph['glyph' . $i] != 0) {
                 $GlyphData = Spells::GetGlyphData($Glyph['glyph' . $i]);
                 $Result[$ArrayIndex]['glyph' . $i] = Spells::SpellInfo($GlyphData['spellid']);
                 $Result[$ArrayIndex]['glyph' . $i]['Name'] = str_replace('Glyph of', '', str_replace('Glyph of the', '', $Result[$ArrayIndex]['glyph' . $i]['Name']));
                 $Result[$ArrayIndex]['glyph' . $i]['icon'] = $GlyphData['icon'];
             }
         }
         $ArrayIndex++;
     }
     return $Result;
 }
 public static function GetItemSet($SetID, $JSONP)
 {
     $Statement = parent::$DBConnection->prepare('SELECT * FROM freedomcore_itemset WHERE itemsetID = :setid');
     $Statement->bindParam(':setid', $SetID);
     $Statement->execute();
     $Result = $Statement->fetch(PDO::FETCH_ASSOC);
     if ($Statement->rowCount() > 0) {
         $FinalArray = [];
         $FinalArray['id'] = $Result['itemsetID'];
         $FinalArray['name'] = $Result['name_loc0'];
         $i = 8;
         while ($i > 0) {
             if ($Result['bonus' . $i] != 0) {
                 $FinalArray['setBonuses'][] = ['description' => Spells::SpellInfo($Result['spell' . $i])['Description'], 'threshold' => $Result['bonus' . $i]];
             }
             $i--;
         }
         $SetItems = [];
         for ($i = 1; $i <= 10; $i++) {
             if ($Result['item' . $i] != 0) {
                 $SetItems[] = $Result['item' . $i];
             }
         }
         $FinalArray['items'] = $SetItems;
         parent::Encode($FinalArray, $JSONP);
     } else {
         parent::GenerateResponse(404, true);
     }
 }