private function loadPetItems() { $query = Emulator::getDatabase()->query("SELECT * FROM pet_items;"); foreach ($query as $item) { $baseItem = Emulator::getGameEnvironment()->getItemManager()->getItem((int) $item->item_id); if ($baseItem == null) { continue; } } }
public function load($set) { $this->id = (int) $set->id; $this->spriteId = (int) $set->sprite_id; $this->name = $set->item_name; $this->type = $set->type; $this->width = (int) $set->width; $this->length = (int) $set->length; $this->height = (double) $set->stack_height; $this->allowStack = (bool) $set->allow_stack == 1; $this->allowWalk = (bool) $set->allow_walk == 1; $this->allowSit = (bool) $set->allow_sit == 1; $this->allowLay = (bool) $set->allow_lay == 1; $this->allowRecyle = (bool) $set->allow_recycle == 1; $this->allowMarketplace = (bool) $set->allow_marketplace_sell == 1; $this->allowGift = (bool) $set->allow_gift == 1; $this->allowInventoryStack = (bool) $set->allow_inventory_stack == 1; $this->interactionType = Emulator::getGameEnvironment()->getItemManager()->getItemInteraction(strtolower($set->interaction_type)); $this->stateCount = (int) $set->interaction_modes_count; $this->effectM = (int) $set->effect_id_male; $this->effectF = (int) $set->effect_id_female; if ($this->interactionType->getType() == null) { //null will be InteractionVendingMachine::class $this->vendingItems = array(); foreach (explode(",", str_replace(";", ",", $set->vending_ids)) as $s) { $this->vendingItems[] = (int) str_replace(" ", "", $s); } } if ($this->interactionType->getType() == null) { //null will be InteractionMultiHeight::class $this->multiHeights = array(); if (strpos($set->multiheight, ";") !== false) { foreach (explode(",", str_replace(";", ",", $set->multiheight)) as $s) { $this->multiHeights[] = (double) str_replace(" ", "", $s); } } } }
private function loadRecycler() { unset($this->prizes); $this->prizes = array(); $query = Emulator::getDatabase()->query("SELECT * FROM recycler_prizes;"); foreach ($query as $prize) { $item = Emulator::getGameEnvironment()->getItemManager()->getItem((int) $prize->item_id); if ($item != null) { if (!isset($this->prizes[(int) $prize->rarity])) { $this->prizes[(int) $prize->rarity] = array(); } $this->prizes[(int) $prize->rarity][] = $item; } } }