@php $seoBaseTitle = (string) ($meta['name'] ?? $meta['title'] ?? ($meta['raw']['mName'] ?? 'Monster')); $seoTitle = $seoBaseTitle . ' • Vortex Sky X Wiki'; $gameName = $game ?? 'Vortex Sky X'; $seoDescription = 'Monster details, stats, drops, and level for ' . $seoBaseTitle . ' in ' . $gameName . '.'; @endphp {{ $seoTitle }} @include('wiki.partials.seo', [ 'title' => $seoTitle, 'description' => $seoDescription, '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']['mName'] ?? 'Monster')); $raw = is_array($meta['raw'] ?? null) ? $meta['raw'] : []; $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'), '.'); }; $collectParts = function ($value) use (&$collectParts, $toNumber, $formatNumber): array { if (is_array($value)) { $parts = []; foreach ($value as $entry) { $parts = array_merge($parts, $collectParts($entry)); } return $parts; } $num = $toNumber($value); if ($num !== null) { return $num > 0 ? [$formatNumber($num)] : []; } $txt = trim((string) $value); return $txt !== '' ? [$txt] : []; }; $toDisplayValue = function ($value) use ($collectParts): ?string { $parts = $collectParts($value); return count($parts) ? implode(' / ', $parts) : null; }; $formatMinMax = function ($value) use ($toNumber, $formatNumber): ?string { if (!is_array($value) || count($value) < 2) return null; $min = $value[0] ?? null; $max = $value[1] ?? null; $minNum = $toNumber($min); $maxNum = $toNumber($max); if ($minNum === null || $maxNum === null) return null; if ($minNum <= 0 && $maxNum <= 0) return null; return $formatNumber(max(0, $minNum)) . ' - ' . $formatNumber(max(0, $maxNum)); }; $baseRows = []; $addBaseRow = function (string $label, $value) use (&$baseRows, $toDisplayValue): void { $display = $toDisplayValue($value); if ($display === null) return; $baseRows[] = ['label' => $label, 'value' => $display]; }; $addBaseRow('Monster ID', $meta['id'] ?? $raw['mIndex'] ?? null); $addBaseRow('Level', $meta['level'] ?? $raw['mLevel'] ?? null); $addBaseRow('Item Level', $meta['item_level'] ?? $raw['mItemLevel'] ?? null); $addBaseRow('Martial Item Level', $meta['martial_item_level'] ?? $raw['mMartialItemLevel'] ?? null); $addBaseRow('Type', $meta['type'] ?? $raw['mType'] ?? null); $summonTime = $formatMinMax($raw['mSummonTime'] ?? null); if ($summonTime !== null) { $baseRows[] = ['label' => 'Summon Time (Min-Max)', 'value' => $summonTime . ' (Seconds)']; } $radiusInfo = $formatMinMax($raw['mRadiusInfo'] ?? null); if ($radiusInfo !== null) { $baseRows[] = ['label' => 'Radius (Min-Max)', 'value' => $radiusInfo]; } $stats = []; $addStat = function (string $label, $value, string $suffix = '') use (&$stats, $toDisplayValue): void { $display = $toDisplayValue($value); if ($display === null) return; $stats[] = ['label' => $label, 'value' => $display . $suffix]; }; $addStat('Life', $raw['mLife'] ?? null); $addStat('Attack Power', $raw['mAttackPower'] ?? null); $addStat('Defense Power', $raw['mDefensePower'] ?? null); $addStat('Hitrate', $raw['mAttackSuccess'] ?? null); $addStat('Dodge', $raw['mAttackBlock'] ?? null); $critical = $toDisplayValue($raw['mCritical'] ?? null); if ($critical !== null) { $stats[] = ['label' => 'Critical', 'value' => $critical . ' (%)']; } $elementAtk = $toDisplayValue($raw['mElementAttackPower'] ?? null); if ($elementAtk !== null) { $stats[] = ['label' => 'Element Attack Power', 'value' => $elementAtk]; } $elementDefense = $raw['mElementDefensePower'] ?? null; if (is_array($elementDefense)) { $labels = ['Light', 'Dark', 'Shadow']; $lines = []; foreach ($labels as $idx => $element) { $val = $elementDefense[$idx] ?? null; $display = $toDisplayValue($val); if ($display === null) continue; $lines[] = $display . ' (' . $element . ')'; } if (count($lines)) { $stats[] = ['label' => 'Element Defense Power', 'value_html' => implode('', array_map(fn($line) => '
' . e($line) . '
', $lines))]; } } $dropMoneyInfo = $raw['mDropMoneyInfo'] ?? null; if (is_array($dropMoneyInfo) && count($dropMoneyInfo) >= 3) { $min = $dropMoneyInfo[1] ?? null; $max = $dropMoneyInfo[2] ?? null; $minNum = $toNumber($min); $maxNum = $toNumber($max); if (($minNum !== null && $minNum > 0) || ($maxNum !== null && $maxNum > 0)) { $stats[] = [ 'label' => 'Drop Money (Min-Max)', 'value' => $formatNumber(max(0, (float) ($minNum ?? 0))) . ' - ' . $formatNumber(max(0, (float) ($maxNum ?? 0))) . ' Silver', ]; } } $chatLines = []; $rawChat = $meta['chat'] ?? []; if (is_array($rawChat)) { foreach ($rawChat as $line) { $line = trim((string) $line); if ($line !== '') $chatLines[] = $line; } } $dropLines = []; $rawDrops = $meta['drops'] ?? []; if (is_array($rawDrops)) { foreach ($rawDrops as $line) { $line = trim((string) $line); if ($line === '') continue; if (strcasecmp($line, 'Gear drop ranges') === 0) continue; if (preg_match('/^Lv\.\s*\d+\s*~\s*\d+\s+Common$/i', $line)) { $line .= ' Equipment'; } $dropLines[] = $line; } } $detailRows = []; $usedKeys = [ 'mIndex' => true, 'mName' => true, 'mItemLevel' => true, 'mMartialItemLevel' => true, 'mType' => true, 'mSpecialType' => true, 'mAttackType' => true, 'mDamageType' => true, 'mDataSortNumber3D' => true, 'mSummonTime' => true, 'mRadiusInfo' => true, 'mLife' => true, 'mAttackPower' => true, 'mDefensePower' => true, 'mAttackSuccess' => true, 'mAttackBlock' => true, 'mCritical' => true, 'mElementAttackPower' => true, 'mElementDefensePower' => true, 'mDropMoneyInfo' => true, ]; foreach ($raw as $key => $value) { if (isset($usedKeys[$key])) continue; $display = $toDisplayValue($value); if ($display === null) continue; $label = preg_replace('/^m(?=[A-Z])/', '', (string) $key); $label = preg_replace('/(? trim((string) $label), 'value' => $display]; } @endphp

{{ $name }}

@if(count($baseRows))
Base Details
@foreach($baseRows as $row)
{{ $row['label'] }} {{ $row['value'] }}
@endforeach
@endif @if(count($stats))
Stats
@foreach($stats as $row)
{{ $row['label'] }} @if(!empty($row['value_html'])) {!! $row['value_html'] !!} @else {{ $row['value'] }} @endif
@endforeach
@endif @if(count($detailRows))
Details
@foreach($detailRows as $row)
{{ $row['label'] }} {{ $row['value'] }}
@endforeach
@endif @if(count($dropLines))
Drops
@foreach($dropLines as $line)
{{ $line }}
@endforeach
@endif @if(count($chatLines))
Chat
@foreach($chatLines as $line)
{{ $line }}
@endforeach
@endif