Example #1
0
 /**
  * Return itemset's effects when wearing all items
  *
  * @param string $items
  * @param string $bonus
  */
 public function bonusComplete($itemsetId, $bonus)
 {
     $effectLib = new Effect();
     $effectsArray = [111, 112, 115, 116, 117, 118, 119, 121, 122, 123, 123, 124, 125, 126, 128, 138, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 162, 168, 169, 171, 174, 175, 176, 177, 178, 179, 182, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249];
     $items = ItemTemplateManager::where('panoplie', $itemsetId)->get();
     $k = 0;
     $bonus = explode(';', $bonus);
     $last = $bonus[count($items) - 2];
     $lastEffects = explode(',', $last);
     $html = '<div class="ak-container ak-content-list ak-displaymode-col"><div class="row ak-container">';
     foreach ($effectsArray as $effectId) {
         $min = 0;
         $max = 0;
         /**
          * Gestion des bonus de panoplies
          */
         foreach ($lastEffects as $lastEffect) {
             list($id, $value) = explode(':', $lastEffect);
             if ($id == $effectId) {
                 $min += $value;
                 $max += $value;
             }
         }
         /**
          * Gestion des bonus des items
          */
         foreach ($items as $item) {
             if (!empty($item->statsTemplate)) {
                 $bonusEffects = explode(',', $item->statsTemplate);
                 foreach ($bonusEffects as $bonus) {
                     if (!empty($bonus)) {
                         list($id, $minValue, $maxValue) = explode('#', $bonus);
                         if (hexdec($id) == $effectId) {
                             $min += hexdec($minValue);
                             $max += $maxValue != 0 ? hexdec($maxValue) : hexdec($minValue);
                         }
                     }
                 }
             }
         }
         if ($min != 0 && $max != 0) {
             $html .= '<div class="ak-column ak-container col-sm-6"><div class="ak-list-element"><div class="ak-main"><div class="ak-main-content"><div class="ak-content"><div class="ak-title">' . $effectLib->get($effectId, $min, $max) . '</div></div><div class="ak-aside"><span class="ak-tooltip ak-icon-small ' . $effectLib->icon($effectId) . '" data-hasqtip="19"></span><script type="application/json">{"manual":true,"tooltip":{"content":{"title":"","text":"' . $effectLib->name($effectId) . '"},"style":{"classes":"ak-tooltip-content"}},"forceOnTouch":true}</script></div></div></div></div></div>';
             $k++;
             if ($k % 2 == 0) {
                 $html .= '<div class="clearfix  visible-sm visible-md visible-lg"></div>';
             }
         }
     }
     $html .= '</div></div>';
     return $html;
 }
Example #2
0
 /**
  * Return icon of primary bonus of item's effect
  *
  * @param string $statsTemplate
  */
 public function primaryBonus($statsTemplate)
 {
     $effectLib = new Effect();
     $effectArray = [];
     $text = '';
     if (!empty($statsTemplate)) {
         $effects = explode(',', $statsTemplate);
         foreach ($effects as $effect) {
             if (!empty($effect)) {
                 list($effectId) = explode('#', $effect);
                 if (in_array(hexdec($effectId), [111, 115, 117, 118, 119, 123, 126, 128])) {
                     $text .= '<span class="ak-tooltip ak-icon-small ' . $effectLib->icon(hexdec($effectId)) . '" data-hasqtip="26"></span><script type="application/json">{"manual":true,"tooltip":{"content":{"title":"","text":"' . $effectLib->name(hexdec($effectId)) . '"},"style":{"classes":"ak-tooltip-content"}},"forceOnTouch":true}</script>';
                 }
             }
         }
     }
     return $text;
 }
Example #3
0
 /**
  * Get item's effect
  *
  * @param string $statsTemplate
  */
 public function template($statsTemplate)
 {
     $effectLib = new Effect();
     $string = '';
     $effectsArray = [91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 110, 110, 111, 112, 115, 116, 117, 118, 119, 121, 122, 123, 124, 125, 126, 127, 128, 138, 145, 152, 153, 154, 155, 156, 157, 158, 159, 171, 174, 175, 176, 177, 178, 179, 182, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 240, 241, 242, 243, 244, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264];
     if (!empty($statsTemplate)) {
         $explode = explode(',', $statsTemplate);
         foreach ($explode as $bonus) {
             if (!empty($bonus)) {
                 list($type, $min, $max) = explode('#', $bonus);
                 if (in_array(hexdec($type), $effectsArray)) {
                     $string .= $effectLib->get(hexdec($type), hexdec($min), hexdec($max));
                 }
             }
         }
     }
     return $string;
 }