Exemple #1
0
 public function allTypes($items)
 {
     $itemLib = new Item();
     $data = [];
     $string = '';
     foreach ($items as $item) {
         if (!in_array($item->type, $data)) {
             array_push($data, $item->type);
             $string .= '<option value=".type_' . $item->type . '">' . $itemLib->type($item->type) . '</option>';
         }
     }
     return $string;
 }
Exemple #2
0
 /**
  * Get item's image of token
  *
  * @param string $itemString
  */
 public function getItems($itemString)
 {
     $itemLib = new Item();
     $html = '';
     $itemArray = [];
     if (!empty($itemString)) {
         $items = explode(',', $itemString);
         foreach ($items as $item) {
             if (!empty($item)) {
                 array_push($itemArray, $item);
             }
         }
         $objects = ItemTemplateManager::whereIn('id', $itemArray)->orderByRaw('RAND()')->take(6)->get();
         foreach ($objects as $object) {
             $html .= $itemLib->generateTooltip($object->id, $object->name, $object->level, $object->type, $object->icon, $object->statsTemplate, 52);
         }
     }
     return $html;
 }
Exemple #3
0
 /**
  * Generate item's tooltip
  *
  * @param int $icon
  * @param int $type
  * @param string $name
  * @param int $level
  * @param string $effect
  * @param int $pos
  */
 private function _getTooltip($icon, $type, $name, $level, $effect, $pos)
 {
     $itemLib = new itemLibrary();
     return '<a class="hover_boxjs" data="#item_' . $pos . '"><span class="ak-linker"><img src="' . asset('imgs/items/' . $icon . '.png') . '"></span></a><div id="item_' . $pos . '" style="display:none;"><div class="ak-top"><div class="ak-encyclo-detail-illu ak-illu"><embed src="' . asset('swf/items/' . $icon . '.swf') . '" width="100" height="100" wmode="transparent"></div><div class="ak-detail"><div class="ak-name">' . $name . '</div><div class="ak-type">' . $itemLib->type($type) . '</div><div class="ak-level">Niveau ' . $level . '</div></div></div><div class="ak-encyclo-detail"><div class="ak-container ak-tabs-container"><div class="ak-container ak-tabs-body tab-content"><div id="tab1" class="ak-tab"><div class="ak-content-list ak-tabs-inner-content ak-displaymode-col">' . $itemLib->getEffectOnCharacter($effect) . '</div></div></div></div></div></div>';
 }