{{-- resources/views/wiki/items/show.blade.php --}} @php $seoBaseTitle = (string) ($meta['name'] ?? $meta['title'] ?? ($meta['raw']['iName'] ?? 'Item')); $seoTitle = $seoBaseTitle . ' • Vortex Sky X Wiki'; $rawDescription = $meta['description'] ?? ($meta['desc'] ?? ($meta['raw']['iDesc'] ?? '')); if (is_array($rawDescription)) { $rawDescription = implode(' ', array_filter(array_map('trim', $rawDescription))); } $seoDescription = trim((string) $rawDescription); $gameName = $game ?? 'Vortex Sky X'; if ($seoDescription === '') { $seoDescription = 'Item details, stats, and how to obtain ' . $seoBaseTitle . ' in ' . $gameName . '.'; } $icon = (string) ($meta['icon'] ?? ''); $seoImage = $icon !== '' ? (str_starts_with($icon, 'http') ? $icon : url($icon)) : asset('images/WebLogo.png'); @endphp {{ $seoTitle }} @include('wiki.partials.seo', [ 'title' => $seoTitle, 'description' => $seoDescription, 'image' => $seoImage, 'type' => 'article', 'game' => $game ?? null, ]) @vite(['resources/css/app.css', 'resources/js/app.js']) @include('wiki.partials.header', ['databaseMenu' => $databaseMenu]) @php $name = (string) ($meta['name'] ?? $meta['title'] ?? ($meta['raw']['iName'] ?? 'Item')); $icon = (string) ($meta['icon'] ?? ''); $modelUrl = $meta['model_url'] ?? null; $toNumber = function ($value): ?float { if (is_int($value) || is_float($value)) return (float) $value; if (is_string($value)) { $trim = trim($value); if ($trim !== '' && is_numeric($trim)) return (float) $trim; } return null; }; $formatNumber = function (float $value): string { if (abs($value - round($value)) < 0.0000001) { return (string) (int) round($value); } $txt = number_format($value, 4, '.', ''); return rtrim(rtrim($txt, '0'), '.'); }; $formatSilver = function ($value) use ($toNumber): ?string { $num = $toNumber($value); if ($num === null || $num < 1) return null; return number_format((int) round($num), 0, '.', ',') . ' Silver'; }; $collectVisibleParts = function ($value) use (&$collectVisibleParts, $toNumber, $formatNumber): array { if (is_array($value)) { $parts = []; foreach ($value as $entry) { $parts = array_merge($parts, $collectVisibleParts($entry)); } return $parts; } if (is_bool($value)) { return $value ? ['Yes'] : []; } $num = $toNumber($value); if ($num !== null) { return $num >= 1 ? [$formatNumber($num)] : []; } $txt = trim((string) $value); return $txt !== '' ? [$txt] : []; }; $toDisplayValue = function ($value) use ($collectVisibleParts): ?string { $parts = $collectVisibleParts($value); if (count($parts) === 0) return null; return implode(' / ', $parts); }; $normalizeLabel = function (string $key): string { $label = preg_replace('/^i(?=[A-Z])/', '', $key); $label = str_replace('Sucess', 'Success', (string) $label); $label = preg_replace('/(? trim((string) $v), $rawDesc))); } elseif (is_string($rawDesc) && trim($rawDesc) !== '') { $descLines = [trim($rawDesc)]; } $factionValue = trim((string) ($meta['faction'] ?? '')); $equipFaction = wiki_item_faction_from_equip($raw['iEquipInfo'] ?? null); if ($factionValue === '' || strcasecmp($factionValue, 'All Factions') === 0) { if ($equipFaction !== 'All Factions') { $factionValue = $equipFaction; } } if ($factionValue === '') { $factionValue = 'All Factions'; } $factionClass = match (mb_strtolower($factionValue)) { 'guanyin' => 'wk-f-guanyin', 'fujin' => 'wk-f-fujin', 'jinong' => 'wk-f-jinong', 'nangin' => 'wk-f-nangin', 'all factions' => 'wk-f-all-factions', default => '', }; $baseRows = []; $addBaseRow = function (string $label, $value, string $valueClass = '', string $valueStyle = '') use (&$baseRows, $toDisplayValue): void { $display = $toDisplayValue($value); if ($display === null) return; $baseRows[] = [ 'label' => $label, 'value' => $display, 'class' => $valueClass, 'style' => $valueStyle, ]; }; $addBaseRow('Faction', $factionValue, $factionClass); $addBaseRow('Category', $meta['category'] ?? null); $rarityValue = (string) ($meta['type'] ?? ($meta['rarity'] ?? '')); $rarityKey = strtolower(trim($rarityValue)); $rarityLabel = $rarityKey !== '' ? ucfirst($rarityKey) : ''; $rarityClass = $rarityKey !== '' ? 'wk-q-' . $rarityKey : ''; $rarityColor = match ($rarityKey) { 'unique' => '#ebab0b9d', 'rare' => '#ffd24a', 'elite' => '#b86bff', 'legendary' => '#ff8a2a', 'celestial' => '#76d7ff', default => '#ffffff', }; $addBaseRow('Rarity', $rarityLabel !== '' ? $rarityLabel : null, $rarityClass, 'color:' . $rarityColor . ';'); $levelCombined = null; $baseLevel = $raw['iLevel'] ?? null; $martialLevel = $raw['iMartialLevel'] ?? null; $baseNum = $toNumber($baseLevel); $martialNum = $toNumber($martialLevel); if ($baseNum !== null || $martialNum !== null) { $levelCombined = ($baseNum ?? 0) + ($martialNum ?? 0); } $levelRequirementValue = $levelCombined ?? $raw['iLevelLimit'] ?? ($meta['level_requirement'] ?? $baseLevel); $addBaseRow('Level Requirement', $levelRequirementValue); $addBaseRow('Buy Price', $formatSilver($raw['iBuyCost'] ?? null)); $addBaseRow('Sell Price', $formatSilver($raw['iSellCost'] ?? null)); $addBaseRow('CP Price', $raw['iBuyCPCost'] ?? null); $addBaseRow('CP Cost', $raw['iBuyCPCost'] ?? null); $detailRowsByLabel = []; $addDetailRow = function (string $label, $value) use (&$detailRowsByLabel, $toDisplayValue): void { $display = $toDisplayValue($value); if ($display === null) return; $rowKey = mb_strtolower(trim($label)); if ($rowKey === '') return; $detailRowsByLabel[$rowKey] = [ 'label' => $label, 'value' => $display, ]; }; $allowedActionRows = []; $addAllowedAction = function (string $label, $value) use (&$allowedActionRows, $toNumber): void { $num = $toNumber($value); if ($num === null || $num < 1) return; $allowedActionRows[] = [ 'label' => $label, 'status' => ((int) $num) === 2 ? 'allowed' : 'denied', ]; }; $rawDetailMap = [ 'iStrength' => 'Strength', 'iWisdom' => 'Dexterity', 'iVitality' => 'Vitality', 'iKi' => 'Chi', 'iLuck' => 'Luck', 'iAttackPower' => 'Attack Power', 'iDefensePower' => 'Defense Power', 'iAttackSucess' => 'Hitrate', 'iAttackBlock' => 'Dodge', 'iCritical' => 'Critical (%)', 'iElementAttackPower' => 'Element Attack Power', 'iElementDefensePower' => 'Element Defense Power', 'iCapeInfo' => 'Cape Info', 'iCalabashCapacity' => 'Calabash Capacity', 'iBottleBuffDuration' => 'Bottle Buff Duration', 'iBottleDamageBonus' => 'Bottle Damage Bonus', ]; foreach ($rawDetailMap as $rawKey => $label) { if (array_key_exists($rawKey, $raw)) { if ($rawKey === 'iCritical') { $val = $raw[$rawKey]; $display = $toDisplayValue($val); if ($display !== null) { $detailRowsByLabel['critical'] = [ 'label' => 'Critical', 'value' => $display . ' (%)', ]; } } elseif ($rawKey === 'iCapeInfo') { $val = $raw[$rawKey]; if (is_array($val)) { $val0 = $toDisplayValue($val[0] ?? null); if ($val0 !== null) { $detailRowsByLabel['chi consumption decrease'] = [ 'label' => 'Chi Consumption Decrease', 'value' => $val0 . ' (%)', ]; } $val1 = $toDisplayValue($val[1] ?? null); if ($val1 !== null) { $detailRowsByLabel['critical defense rate'] = [ 'label' => 'Critical Defense Rate', 'value' => $val1 . ' (%)', ]; } $val2 = $toDisplayValue($val[2] ?? null); if ($val2 !== null) { $detailRowsByLabel['all skill levels increased'] = [ 'label' => 'All Skill Levels Increased', 'value' => '+' . $val2, ]; } } else { $display = $toDisplayValue($val); if ($display !== null) { $detailRowsByLabel['chi consumption decrease'] = [ 'label' => 'Chi Consumption Decrease', 'value' => $display . ' (%)', ]; } } } elseif ($rawKey === 'iElementAttackPower') { $val = $raw[$rawKey]; $elementByFaction = match (mb_strtolower($factionValue)) { 'guanyin' => 'Light', 'fujin' => 'Shadow', 'jinong' => 'Dark', 'nangin' => 'Bright', default => '', }; if (is_array($val)) { $picked = null; foreach ($val as $entry) { $display = $toDisplayValue($entry); if ($display !== null) { $picked = $display; break; } } if ($picked !== null) { $detailRowsByLabel['element attack power'] = [ 'label' => 'Element Attack Power', 'value' => $elementByFaction !== '' ? ($picked . ' (' . $elementByFaction . ')') : $picked, ]; } } else { $display = $toDisplayValue($val); if ($display !== null) { $detailRowsByLabel['element attack power'] = [ 'label' => 'Element Attack Power', 'value' => $elementByFaction !== '' ? ($display . ' (' . $elementByFaction . ')') : $display, ]; } } } elseif ($rawKey === 'iElementDefensePower') { $val = $raw[$rawKey]; if (is_array($val)) { $labels = ['Light', 'Dark', 'Shadow']; $lines = []; foreach ($labels as $idx => $element) { $v = $val[$idx] ?? null; $display = $toDisplayValue($v); if ($display === null) continue; $lines[] = $display . ' (' . $element . ')'; } if (count($lines)) { $detailRowsByLabel['element defense power'] = [ 'label' => 'Element Defense Power', 'value_html' => implode('', array_map(fn($line) => '
' . e($line) . '
', $lines)), ]; } } else { $addDetailRow($label, $val); } } elseif ($rawKey === 'iBottleBuffDuration') { $val = $raw[$rawKey]; $display = $toDisplayValue($val); if ($display !== null) { $detailRowsByLabel['bottle buff duration'] = [ 'label' => 'Bottle Buff Duration', 'value' => $display . ' (Seconds)', ]; } } elseif ($rawKey === 'iBottleDamageBonus') { $val = $raw[$rawKey]; $display = $toDisplayValue($val); if ($display !== null) { $detailRowsByLabel['bottle damage bonus'] = [ 'label' => 'Bottle Damage Bonus', 'value' => $display . ' (%)', ]; $num = $toNumber($val); if ($num !== null && $num > 0) { $detailRowsByLabel['bottle defense debuff'] = [ 'label' => 'Bottle Defense Debuff', 'value' => '-' . $formatNumber($num * 3) . ' (%)', ]; } } } else { $addDetailRow($label, $raw[$rawKey]); } } } $gainSkillId = $raw['iGainSkillNumber'] ?? null; $gainSkillDisplay = $toDisplayValue($gainSkillId); if ($gainSkillDisplay !== null) { $gainSkillSlug = wiki_skill_slug_from_id($game, $gainSkillId); if ($gainSkillSlug) { $gainSkillName = wiki_skill_name_from_id($game, $gainSkillId); $gainSkillLabel = $gainSkillName ? $gainSkillName : $gainSkillDisplay; $gainSkillUrl = '/wiki/' . rawurlencode($game) . '/skills/' . rawurlencode($gainSkillSlug); $detailRowsByLabel['gain skill number'] = [ 'label' => 'Gain Skill Number', 'value_html' => '' . e($gainSkillLabel) . '', ]; } else { $detailRowsByLabel['gain skill number'] = [ 'label' => 'Gain Skill Number', 'value' => $gainSkillDisplay, ]; } } if (array_key_exists('iPotionType', $raw) && strcasecmp((string) ($meta['category'] ?? ''), 'Stackable Small') === 0) { $potion = $raw['iPotionType']; if (is_array($potion)) { $addDetailRow('Vitality', $potion[0] ?? null); $addDetailRow('Chi', $potion[1] ?? null); } else { $addDetailRow('Potion Type', $potion); } } $addAllowedAction('Allowed to Sell to NPC', $raw['iCheckNPCSell'] ?? null); $addAllowedAction('Allowed to Drop', $raw['iCheckAvatarDrop'] ?? null); $addAllowedAction('Allowed to Trade', $raw['iCheckAvatarTrade'] ?? null); $addAllowedAction('Allowed to Sell at Personal Shop', $raw['iCheckAvatarShop'] ?? null); $addAllowedAction('Enchantable', $raw['iCheckImprove'] ?? null); $addAllowedAction('Over Enchantable', $raw['iCheckHighImprove'] ?? null); $addAllowedAction('Upgradeable', $raw['iCheckHighItem'] ?? null); $addAllowedAction('Downgradeable', $raw['iCheckLowItem'] ?? null); $addAllowedAction('Allowed to Exchange', $raw['iCheckExchange'] ?? null); $addAllowedAction('Set Item', $raw['iCheckItemSet'] ?? null); $gearCategories = ['weapon', 'armor', 'gloves', 'boots', 'ring', 'neck', 'necklace']; $categoryValue = trim((string) ($meta['category'] ?? '')); $isGearPiece = $categoryValue !== '' && in_array(mb_strtolower($categoryValue), $gearCategories, true); $rarityRank = match (mb_strtolower(trim((string) ($meta['type'] ?? ($meta['rarity'] ?? ''))))) { 'common' => 0, 'unique' => 1, 'rare' => 2, 'elite' => 3, 'legendary' => 4, 'celestial' => 5, default => 0, }; $levelReqNum = $toNumber($levelRequirementValue); $canGenerateStars = $isGearPiece && $rarityRank >= 2 && ($levelReqNum !== null && $levelReqNum >= 105); if (!$canGenerateStars) { $nameMatch = mb_strtolower($name); if (str_contains($nameMatch, 'neck')) { $isGearPiece = true; $canGenerateStars = $rarityRank >= 2 && ($levelReqNum !== null && $levelReqNum >= 105); } } $allowedActionRows[] = [ 'label' => 'Can Generate Stars', 'status' => $canGenerateStars ? 'allowed' : 'denied', ]; $allowedActionRows[] = [ 'label' => 'Randomizes Base', 'status' => $canGenerateStars ? 'allowed' : 'denied', ]; if (array_key_exists('iLastAttackBonusInfo', $raw)) { $bonus = $raw['iLastAttackBonusInfo']; if (is_array($bonus)) { $val0 = $toDisplayValue($bonus[0] ?? null); if ($val0 !== null) { $detailRowsByLabel['last attack bonus chance'] = [ 'label' => 'Last Attack Bonus Chance', 'value' => $val0 . ' (%)', ]; } $val1 = $toDisplayValue($bonus[1] ?? null); if ($val1 !== null) { $detailRowsByLabel['deathblow exp obtain amount'] = [ 'label' => 'Deathblow Exp Obtain Amount', 'value' => $val1 . ' (%)', ]; } } else { $val = $toDisplayValue($bonus); if ($val !== null) { $detailRowsByLabel['last attack bonus chance'] = [ 'label' => 'Last Attack Bonus Chance', 'value' => $val . ' (%)', ]; } } } if (array_key_exists('iBonusSkillInfo', $raw) && is_array($raw['iBonusSkillInfo'])) { $bonusSkillLines = []; foreach ($raw['iBonusSkillInfo'] as $entry) { if (!is_array($entry)) continue; $skillId = isset($entry[0]) && is_numeric((string) $entry[0]) ? (int) $entry[0] : 0; $amount = $entry[1] ?? null; $amountNum = $toNumber($amount); if ($skillId <= 0) continue; if ($amountNum !== null && $amountNum < 1) continue; $skillName = wiki_skill_name_from_id($game, $skillId) ?? ('Skill ' . $skillId); $amountTxt = $amountNum !== null ? $formatNumber($amountNum) : trim((string) $amount); if ($amountTxt === '') $amountTxt = '1'; $skillSlug = wiki_skill_slug_from_id($game, $skillId); $skillUrl = $skillSlug ? '/wiki/' . rawurlencode($game) . '/skills/' . rawurlencode($skillSlug) : ''; $label = '+' . $amountTxt . ' ' . $skillName; $factionClass = wiki_skill_faction_class_from_id($game, $skillId); if ($skillUrl !== '') { $bonusSkillLines[] = '
' . e($label) . '
'; } else { $bonusSkillLines[] = '
' . e($label) . '
'; } } if (count($bonusSkillLines)) { $detailRowsByLabel['bonus skill'] = [ 'label' => 'Bonus Skill', 'value_html' => implode('', $bonusSkillLines), ]; } } $legacyStats = is_array($meta['stats'] ?? null) ? $meta['stats'] : []; foreach ($legacyStats as $k => $v) { $addDetailRow($normalizeLabel((string) $k), $v); } $legacyEffects = is_array($meta['effects'] ?? null) ? $meta['effects'] : []; $legacyEffects = array_values(array_filter(array_map(fn($v) => trim((string) $v), $legacyEffects))); if (count($legacyEffects)) { $addDetailRow('Effects', $legacyEffects); } $legacySources = is_array($meta['sources'] ?? null) ? $meta['sources'] : []; $legacySources = array_values(array_filter(array_map(fn($v) => trim((string) $v), $legacySources))); if (count($legacySources)) { $addDetailRow('Sources', $legacySources); } $detailRows = array_values($detailRowsByLabel); @endphp

{{ $name }}

@if($icon !== '')
{{ $name }} @if($modelUrl) @endif
@endif @if(count($descLines))
Description
@foreach($descLines as $line)
{{ $line }}
@endforeach
@endif @if(count($baseRows))
Base Details
@foreach($baseRows as $row)
{{ $row['label'] }} {{ $row['value'] }}
@endforeach
@endif @if(count($detailRows))
Details
@foreach($detailRows as $row)
{{ $row['label'] }} @if(isset($row['value_html'])) {!! $row['value_html'] !!} @else {{ $row['value'] }} @endif
@endforeach
@endif @if(count($allowedActionRows))
Action Rules
@foreach($allowedActionRows as $row)
{{ $row['label'] }} @if($row['status'] === 'allowed') @else @endif
@endforeach
@endif @if(!empty($html))
{!! $html !!}
@endif