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);
     }
 }
 private static function ArgumentParser($SpellData, $Spell, $Argument, $Value, $MathEquation = false)
 {
     $Modifiers = array('+', '-', '/', '*', '%', '^');
     $Data = '';
     switch ($Argument) {
         case 's':
             if (is_numeric($Spell)) {
                 $SpellData = Spells::GetSpellByID($Spell);
             }
             if ($MathEquation == false) {
                 $BasePoints = $SpellData['effect1BasePoints'] + 1;
                 $Data = abs($BasePoints) . ($SpellData['effect1DieSides'] > 1 ? ' - ' . abs($BasePoints + $SpellData['effect1DieSides']) : '');
             } else {
                 $Equation = abs($SpellData['effect1BasePoints']) . $MathEquation;
                 eval("\$BasePoints = {$Equation};");
                 $Data = abs(floor($BasePoints)) . ($SpellData['effect1DieSides'] > 1 ? ' - ' . abs(floor($BasePoints) + $SpellData['effect1DieSides']) : '');
             }
             break;
         case 'm':
             if (is_numeric($Spell)) {
                 $SpellData = Spells::GetSpellByID($Spell);
             }
             if ($MathEquation) {
                 $Equation = abs($SpellData['effect1BasePoints']) . $MathEquation;
                 eval("\$BasePoints = {$Equation};");
                 $Data = abs($BasePoints);
             }
             break;
         case 'u':
             if (is_numeric($Spell)) {
                 $SpellData = Spells::GetSpellByID($Spell);
             }
             if (isset($SpellData['effect1Aura'])) {
                 $BasePoints = $SpellData['effect1Aura'] + 1;
             }
             $Data = abs($BasePoints);
             break;
         case 'd':
             if (is_numeric($Spell)) {
                 $SpellData = Spells::GetSpellDurationBySpellID($Spell);
                 $BasePoints = $SpellData['durationBase'] > 0 ? $SpellData['durationBase'] + 1 : 0;
             } else {
                 $BasePoints = Spells::GetSpellDurationByDurationID($SpellData['durationID']);
             }
             $Data = Spells::GetDuration($BasePoints) . ' ' . Items::$TM->GetConfigVars('Item_Spell_DS');
             break;
         case 'a':
             if (is_numeric($Spell)) {
                 $SpellData = Spells::GetSpellRadiusBySpellID($Spell);
             }
             $BasePoints = Spells::GetSpellRadiusByRadiusID($SpellData['effect' . trim($Value) . 'radius']);
             $Data = abs($BasePoints);
             break;
     }
     return $Data;
 }
Beispiel #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);
     }
 }