@extends('admin.layout') @section('admin-title') Forages @endsection @section('admin-content') {!! breadcrumbs(['Admin Panel' => 'admin', 'Forages' => 'admin/data/forages', ($table->id ? 'Edit' : 'Create') . ' Forage' => $table->id ? 'admin/data/forages/edit/' . $table->id : 'admin/data/forages/create']) !!}

{{ $table->id ? 'Edit' : 'Create' }} Forage @if ($table->id) Delete Forage @endif

{!! Form::open(['url' => $table->id ? 'admin/data/forages/edit/' . $table->id : 'admin/data/forages/create', 'files' => true]) !!}

Basic Information

{!! Form::label('Name') !!} {!! add_help('This is the name you will use to identify this table internally. This name will not be shown to users and does not have to be unique, but a name that can be easily identified is recommended.') !!} {!! Form::text('name', $table->name, ['class' => 'form-control']) !!}
{!! Form::label('Display Name') !!} {!! add_help('This is the name that will be shown to users, for example when displaying the rewards for doing a prompt. This is for display purposes and can be something more vague than the above, e.g. "A Random Rare Item"') !!} {!! Form::text('display_name', $table->getOriginal('display_name'), ['class' => 'form-control']) !!}
@if ($table->has_image)
@endif {!! Form::label('Page Image (Optional)') !!} {!! add_help('Displays above the forage button.') !!}
{!! Form::file('image') !!}
Recommended size: 100px x 100px
{!! Form::label('Stamina Cost') !!} {!! Form::number('stamina_cost', $table->stamina_cost ?? 1, ['class' => 'form-control']) !!}
{!! Form::checkbox('has_cost', 1, $table->has_cost, ['class' => 'form-check-input mr-2 has-cost', 'data-toggle' => 'toggle']) !!} {!! Form::label('has_cost', 'Has Cost (Currency)', ['class' => 'form-check-label ml-3']) !!}
{!! Form::label('Currency') !!} {!! Form::select('currency_id', $forage_currencies, $table->currency_id, ['class' => 'form-control']) !!}
{!! Form::label('Quantity') !!} {!! Form::number('currency_quantity', $table->currency_quantity ?? 1, ['class' => 'form-control']) !!}

{!! Form::checkbox('is_active', 1, $table->is_active, ['class' => 'form-check-input mr-2', 'data-toggle' => 'toggle']) !!} {!! Form::label('is_active', 'Active (visible to users)', ['class' => 'form-check-label ml-3']) !!}
{!! Form::label('active_until', 'Active Until (Optional)') !!} {!! Form::text('active_until', $table->active_until, ['class' => 'form-control mr-2 datepicker']) !!}

Loot

These are the potential rewards from rolling on this forage, similar to loot tables. You can add items, currencies or a loot table. @if (!$table->id) You can test loot rolling after the loot table is created. @endif

You can add any kind of currencies (both user- and character-attached), but be sure to keep track of which are being distributed! Character-only currencies cannot be given to users.

Add Loot
@if ($table->id) @foreach ($table->loot as $loot) @endforeach @endif
Loot Type Reward Quantity Weight {!! add_help('A higher weight means a reward is more likely to be rolled. Weights have to be integers above 0 (round positive number, no decimals) and do not have to add up to be a particular number.') !!} Chance
{!! Form::select('rewardable_type[]', ['Item' => 'Item', 'Currency' => 'Currency', 'LootTable' => 'Loot Table', 'None' => 'None'], $loot->rewardable_type, ['class' => 'form-control reward-type', 'placeholder' => 'Select Reward Type']) !!} @if ($loot->rewardable_type == 'Item') {!! Form::select('rewardable_id[]', $items, $loot->rewardable_id, ['class' => 'form-control item-select selectize', 'placeholder' => 'Select Item']) !!} @elseif($loot->rewardable_type == 'Currency') {!! Form::select('rewardable_id[]', $currencies, $loot->rewardable_id, ['class' => 'form-control currency-select selectize', 'placeholder' => 'Select Currency']) !!} @elseif($loot->rewardable_type == 'LootTable') {!! Form::select('rewardable_id[]', $tables, $loot->rewardable_id, ['class' => 'form-control table-select selectize', 'placeholder' => 'Select Loot Table']) !!} @elseif($loot->rewardable_type == 'None') {!! Form::select('rewardable_id[]', [1 => 'No reward given.'], $loot->rewardable_id, ['class' => 'form-control']) !!} @endif {!! Form::text('quantity[]', $loot->quantity, ['class' => 'form-control']) !!} {!! Form::text('weight[]', $loot->weight, ['class' => 'form-control loot-weight']) !!} Remove
{!! Form::submit($table->id ? 'Edit' : 'Create', ['class' => 'btn btn-primary']) !!}
{!! Form::close() !!}
{!! Form::select('rewardable_type[]', ['Item' => 'Item', 'Currency' => 'Currency', 'LootTable' => 'Loot Table', 'None' => 'None'], null, ['class' => 'form-control reward-type', 'placeholder' => 'Select Reward Type']) !!} {!! Form::text('quantity[]', 1, ['class' => 'form-control']) !!} {!! Form::text('weight[]', 1, ['class' => 'form-control loot-weight']) !!} Remove
{!! Form::select('rewardable_id[]', $items, null, ['class' => 'form-control item-select', 'placeholder' => 'Select Item']) !!} {!! Form::select('rewardable_id[]', $currencies, null, ['class' => 'form-control currency-select', 'placeholder' => 'Select Currency']) !!} {!! Form::select('rewardable_id[]', $tables, null, ['class' => 'form-control table-select', 'placeholder' => 'Select Loot Table']) !!} {!! Form::select('rewardable_id[]', [1 => 'No reward given.'], null, ['class' => 'form-control none-select']) !!}
@if ($table->id && $table->loot()->count())

Test Roll

If you have made any modifications to the loot table contents above, be sure to save it (click the Edit button) before testing.

Please note that due to the nature of probability, as long as there is a chance, there will always be the possibility of rolling improbably good or bad results. This is not indicative of the code being buggy or poor game balance. Be cautious when adjusting values based on a small sample size, including but not limited to test rolls and a small amount of user reports.

{!! Form::label('quantity', 'Number of Rolls') !!} {!! Form::text('quantity', 1, ['class' => 'form-control', 'id' => 'rollQuantity']) !!}
Test Roll
@endif @endsection @section('scripts') @parent @endsection