177 lines
5.7 KiB
PHP
177 lines
5.7 KiB
PHP
<?php
|
|||
|
|
|
||
|
|
namespace Database\Seeders;
|
||
|
|
|
||
|
|
use App\Models\Item;
|
||
|
|
use Illuminate\Database\Seeder;
|
||
|
|
|
||
|
|
class ItemSeeder extends Seeder
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Run the database seeds.
|
||
|
|
*/
|
||
|
|
public function run(): void
|
||
|
|
{
|
||
|
|
$items = [
|
||
|
|
// Weapons
|
||
|
|
[
|
||
|
|
'name' => 'Knife',
|
||
|
|
'slug' => 'knife',
|
||
|
|
'description' => 'A basic knife for self-defense.',
|
||
|
|
'type' => 'weapon',
|
||
|
|
'value' => 100,
|
||
|
|
'buy_price' => 500,
|
||
|
|
'sell_price' => 250,
|
||
|
|
'requires_level' => 1,
|
||
|
|
'attack_bonus' => 5,
|
||
|
|
'defense_bonus' => 0,
|
||
|
|
'health_bonus' => 0,
|
||
|
|
'energy_bonus' => 0,
|
||
|
|
'is_tradeable' => true,
|
||
|
|
'is_usable' => false,
|
||
|
|
],
|
||
|
|
[
|
||
|
|
'name' => 'Baseball Bat',
|
||
|
|
'slug' => 'baseball-bat',
|
||
|
|
'description' => 'A sturdy bat that can deal serious damage.',
|
||
|
|
'type' => 'weapon',
|
||
|
|
'value' => 500,
|
||
|
|
'buy_price' => 2500,
|
||
|
|
'sell_price' => 1250,
|
||
|
|
'requires_level' => 3,
|
||
|
|
'attack_bonus' => 15,
|
||
|
|
'defense_bonus' => 0,
|
||
|
|
'health_bonus' => 0,
|
||
|
|
'energy_bonus' => 0,
|
||
|
|
'is_tradeable' => true,
|
||
|
|
'is_usable' => false,
|
||
|
|
],
|
||
|
|
[
|
||
|
|
'name' => 'Pistol',
|
||
|
|
'slug' => 'pistol',
|
||
|
|
'description' => 'A handgun for more serious encounters.',
|
||
|
|
'type' => 'weapon',
|
||
|
|
'value' => 2000,
|
||
|
|
'buy_price' => 10000,
|
||
|
|
'sell_price' => 5000,
|
||
|
|
'requires_level' => 10,
|
||
|
|
'attack_bonus' => 30,
|
||
|
|
'defense_bonus' => 0,
|
||
|
|
'health_bonus' => 0,
|
||
|
|
'energy_bonus' => 0,
|
||
|
|
'is_tradeable' => true,
|
||
|
|
'is_usable' => false,
|
||
|
|
],
|
||
|
|
|
||
|
|
// Armor
|
||
|
|
[
|
||
|
|
'name' => 'Leather Jacket',
|
||
|
|
'slug' => 'leather-jacket',
|
||
|
|
'description' => 'Basic protection from attacks.',
|
||
|
|
'type' => 'armor',
|
||
|
|
'value' => 200,
|
||
|
|
'buy_price' => 1000,
|
||
|
|
'sell_price' => 500,
|
||
|
|
'requires_level' => 1,
|
||
|
|
'attack_bonus' => 0,
|
||
|
|
'defense_bonus' => 5,
|
||
|
|
'health_bonus' => 0,
|
||
|
|
'energy_bonus' => 0,
|
||
|
|
'is_tradeable' => true,
|
||
|
|
'is_usable' => false,
|
||
|
|
],
|
||
|
|
[
|
||
|
|
'name' => 'Kevlar Vest',
|
||
|
|
'slug' => 'kevlar-vest',
|
||
|
|
'description' => 'Heavy body armor for serious protection.',
|
||
|
|
'type' => 'armor',
|
||
|
|
'value' => 1000,
|
||
|
|
'buy_price' => 5000,
|
||
|
|
'sell_price' => 2500,
|
||
|
|
'requires_level' => 8,
|
||
|
|
'attack_bonus' => 0,
|
||
|
|
'defense_bonus' => 25,
|
||
|
|
'health_bonus' => 0,
|
||
|
|
'energy_bonus' => 0,
|
||
|
|
'is_tradeable' => true,
|
||
|
|
'is_usable' => false,
|
||
|
|
],
|
||
|
|
|
||
|
|
// Consumables
|
||
|
|
[
|
||
|
|
'name' => 'First Aid Kit',
|
||
|
|
'slug' => 'first-aid-kit',
|
||
|
|
'description' => 'Restores 50 health when used.',
|
||
|
|
'type' => 'consumable',
|
||
|
|
'value' => 500,
|
||
|
|
'buy_price' => 2500,
|
||
|
|
'sell_price' => 1000,
|
||
|
|
'requires_level' => 1,
|
||
|
|
'attack_bonus' => 0,
|
||
|
|
'defense_bonus' => 0,
|
||
|
|
'health_bonus' => 50,
|
||
|
|
'energy_bonus' => 0,
|
||
|
|
'is_tradeable' => true,
|
||
|
|
'is_usable' => true,
|
||
|
|
],
|
||
|
|
[
|
||
|
|
'name' => 'Energy Drink',
|
||
|
|
'slug' => 'energy-drink',
|
||
|
|
'description' => 'Restores 30 energy when used.',
|
||
|
|
'type' => 'consumable',
|
||
|
|
'value' => 300,
|
||
|
|
'buy_price' => 1500,
|
||
|
|
'sell_price' => 750,
|
||
|
|
'requires_level' => 1,
|
||
|
|
'attack_bonus' => 0,
|
||
|
|
'defense_bonus' => 0,
|
||
|
|
'health_bonus' => 0,
|
||
|
|
'energy_bonus' => 30,
|
||
|
|
'is_tradeable' => true,
|
||
|
|
'is_usable' => true,
|
||
|
|
],
|
||
|
|
[
|
||
|
|
'name' => 'Mega Health Pack',
|
||
|
|
'slug' => 'mega-health-pack',
|
||
|
|
'description' => 'Restores all health when used.',
|
||
|
|
'type' => 'consumable',
|
||
|
|
'value' => 1500,
|
||
|
|
'buy_price' => 7500,
|
||
|
|
'sell_price' => 3000,
|
||
|
|
'requires_level' => 15,
|
||
|
|
'attack_bonus' => 0,
|
||
|
|
'defense_bonus' => 0,
|
||
|
|
'health_bonus' => 100,
|
||
|
|
'energy_bonus' => 0,
|
||
|
|
'is_tradeable' => true,
|
||
|
|
'is_usable' => true,
|
||
|
|
],
|
||
|
|
|
||
|
|
// Misc
|
||
|
|
[
|
||
|
|
'name' => 'Lockpick Set',
|
||
|
|
'slug' => 'lockpick-set',
|
||
|
|
'description' => 'Useful for picking locks.',
|
||
|
|
'type' => 'misc',
|
||
|
|
'value' => 200,
|
||
|
|
'buy_price' => 1000,
|
||
|
|
'sell_price' => 500,
|
||
|
|
'requires_level' => 5,
|
||
|
|
'attack_bonus' => 0,
|
||
|
|
'defense_bonus' => 0,
|
||
|
|
'health_bonus' => 0,
|
||
|
|
'energy_bonus' => 0,
|
||
|
|
'is_tradeable' => true,
|
||
|
|
'is_usable' => false,
|
||
|
|
],
|
||
|
|
];
|
||
|
|
|
||
|
|
foreach ($items as $item) {
|
||
|
|
Item::updateOrCreate(
|
||
|
|
['slug' => $item['slug']],
|
||
|
|
$item
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|