From 2217592ebdc2baca1e1587e4697c5796b7819bc2 Mon Sep 17 00:00:00 2001 From: WildEgo Date: Thu, 13 Nov 2025 10:32:39 +0000 Subject: [PATCH] add: Offline shop. --- ..._private_shop_column_to_accounts_table.php | 28 +++++++ ...dd_private_shop_column_to_player_table.php | 40 ++++++++++ ...11_10_145200_create_private_shop_table.php | 43 ++++++++++ ..._145205_create_private_shop_item_table.php | 74 ++++++++++++++++++ ...create_private_shop_sale_history_table.php | 78 +++++++++++++++++++ 5 files changed, 263 insertions(+) create mode 100644 database/migrations/2025_11_10_144911_add_private_shop_column_to_accounts_table.php create mode 100644 database/migrations/2025_11_10_145025_add_private_shop_column_to_player_table.php create mode 100644 database/migrations/2025_11_10_145200_create_private_shop_table.php create mode 100644 database/migrations/2025_11_10_145205_create_private_shop_item_table.php create mode 100644 database/migrations/2025_11_10_145218_create_private_shop_sale_history_table.php diff --git a/database/migrations/2025_11_10_144911_add_private_shop_column_to_accounts_table.php b/database/migrations/2025_11_10_144911_add_private_shop_column_to_accounts_table.php new file mode 100644 index 0000000..1698f47 --- /dev/null +++ b/database/migrations/2025_11_10_144911_add_private_shop_column_to_accounts_table.php @@ -0,0 +1,28 @@ +dateTime('premium_privateshop_expire')->useCurrent()->after('money_drop_rate_expire'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('account', function (Blueprint $table) { + $table->dropColumn('premium_privateshop_expire'); + }); + } +}; diff --git a/database/migrations/2025_11_10_145025_add_private_shop_column_to_player_table.php b/database/migrations/2025_11_10_145025_add_private_shop_column_to_player_table.php new file mode 100644 index 0000000..f439efc --- /dev/null +++ b/database/migrations/2025_11_10_145025_add_private_shop_column_to_player_table.php @@ -0,0 +1,40 @@ +integer('private_shop_unlocked_slot') + ->default(0) + ->after('level_step'); + }); + + Schema::table('player_deleted', function (Blueprint $table) { + $table->integer('private_shop_unlocked_slot') + ->default(0) + ->after('level_step'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('player', function (Blueprint $table) { + $table->dropColumn('private_shop_unlocked_slot'); + }); + + Schema::table('player_deleted', function (Blueprint $table) { + $table->dropColumn('private_shop_unlocked_slot'); + }); + } +}; diff --git a/database/migrations/2025_11_10_145200_create_private_shop_table.php b/database/migrations/2025_11_10_145200_create_private_shop_table.php new file mode 100644 index 0000000..b144161 --- /dev/null +++ b/database/migrations/2025_11_10_145200_create_private_shop_table.php @@ -0,0 +1,43 @@ +unsignedInteger('owner_id')->primary(); + $table->string('owner_name', 25); + $table->enum('state', ['CLOSED', 'OPEN', 'MODIFY'])->default('CLOSED'); + $table->string('title', 33); + $table->tinyInteger('title_type'); + $table->integer('vnum'); + $table->integer('x'); + $table->integer('y'); + $table->integer('map_index'); + $table->tinyInteger('channel'); + $table->integer('port')->nullable(); + $table->bigInteger('gold'); + $table->integer('cheque'); + $table->tinyInteger('page_count')->default(1); + $table->integer('premium_time')->default(0); + $table->integer('unlocked_slots')->default(0); + + $table->foreign('owner_id')->references('id')->on('player')->cascadeOnDelete(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('private_shop'); + } +}; diff --git a/database/migrations/2025_11_10_145205_create_private_shop_item_table.php b/database/migrations/2025_11_10_145205_create_private_shop_item_table.php new file mode 100644 index 0000000..be01f52 --- /dev/null +++ b/database/migrations/2025_11_10_145205_create_private_shop_item_table.php @@ -0,0 +1,74 @@ +bigIncrements('id'); + $table->unsignedInteger('owner_id')->default(0); + $table->unsignedSmallInteger('pos')->default(0); + $table->unsignedTinyInteger('count')->default(0); + $table->unsignedInteger('vnum')->default(0); + $table->unsignedBigInteger('gold')->default(0); + $table->unsignedInteger('cheque')->default(0); + $table->unsignedInteger('checkin')->default(0); + $table->unsignedInteger('refine_element')->default(0); + $table->unsignedInteger('transmutation')->default(0); + + $table->unsignedInteger('socket0')->default(0); + $table->unsignedInteger('socket1')->default(0); + $table->unsignedInteger('socket2')->default(0); + $table->unsignedInteger('socket3')->default(0); + $table->unsignedInteger('socket4')->default(0); + + $table->tinyInteger('attrtype0')->default(0); + $table->smallInteger('attrvalue0')->default(0); + $table->tinyInteger('attrtype1')->default(0); + $table->smallInteger('attrvalue1')->default(0); + $table->tinyInteger('attrtype2')->default(0); + $table->smallInteger('attrvalue2')->default(0); + $table->tinyInteger('attrtype3')->default(0); + $table->smallInteger('attrvalue3')->default(0); + $table->tinyInteger('attrtype4')->default(0); + $table->smallInteger('attrvalue4')->default(0); + $table->tinyInteger('attrtype5')->default(0); + $table->smallInteger('attrvalue5')->default(0); + $table->tinyInteger('attrtype6')->default(0); + $table->smallInteger('attrvalue6')->default(0); + + $table->tinyInteger('apply_type0')->default(0); + $table->smallInteger('apply_value0')->default(0); + $table->tinyInteger('apply_path0')->default(0); + $table->tinyInteger('apply_type1')->default(0); + $table->smallInteger('apply_value1')->default(0); + $table->tinyInteger('apply_path1')->default(0); + $table->tinyInteger('apply_type2')->default(0); + $table->smallInteger('apply_value2')->default(0); + $table->tinyInteger('apply_path2')->default(0); + $table->tinyInteger('apply_type3')->default(0); + $table->smallInteger('apply_value3')->default(0); + $table->tinyInteger('apply_path3')->default(0); + + $table->index('owner_id', 'owner_id_idx'); + $table->index('vnum', 'item_vnum_index'); + + $table->foreign('owner_id')->references('id')->on('player')->cascadeOnDelete(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('private_shop_item'); + } +}; diff --git a/database/migrations/2025_11_10_145218_create_private_shop_sale_history_table.php b/database/migrations/2025_11_10_145218_create_private_shop_sale_history_table.php new file mode 100644 index 0000000..d4255c0 --- /dev/null +++ b/database/migrations/2025_11_10_145218_create_private_shop_sale_history_table.php @@ -0,0 +1,78 @@ +bigIncrements('id'); + $table->unsignedInteger('owner_id')->default(0); + $table->unsignedInteger('customer_id'); + $table->string('customer_name', 26); + $table->dateTime('time'); + $table->bigInteger('item_id'); + $table->unsignedTinyInteger('count')->default(0); + $table->unsignedInteger('vnum')->default(0); + $table->unsignedBigInteger('gold')->default(0); + $table->unsignedInteger('cheque')->default(0); + $table->unsignedInteger('checkin')->default(0); + $table->unsignedInteger('refine_element')->default(0); + $table->unsignedInteger('transmutation')->default(0); + + $table->unsignedInteger('socket0')->default(0); + $table->unsignedInteger('socket1')->default(0); + $table->unsignedInteger('socket2')->default(0); + $table->unsignedInteger('socket3')->default(0); + $table->unsignedInteger('socket4')->default(0); + + $table->tinyInteger('attrtype0')->default(0); + $table->smallInteger('attrvalue0')->default(0); + $table->tinyInteger('attrtype1')->default(0); + $table->smallInteger('attrvalue1')->default(0); + $table->tinyInteger('attrtype2')->default(0); + $table->smallInteger('attrvalue2')->default(0); + $table->tinyInteger('attrtype3')->default(0); + $table->smallInteger('attrvalue3')->default(0); + $table->tinyInteger('attrtype4')->default(0); + $table->smallInteger('attrvalue4')->default(0); + $table->tinyInteger('attrtype5')->default(0); + $table->smallInteger('attrvalue5')->default(0); + $table->tinyInteger('attrtype6')->default(0); + $table->smallInteger('attrvalue6')->default(0); + + $table->tinyInteger('apply_type0')->default(0); + $table->smallInteger('apply_value0')->default(0); + $table->tinyInteger('apply_path0')->default(0); + $table->tinyInteger('apply_type1')->default(0); + $table->smallInteger('apply_value1')->default(0); + $table->tinyInteger('apply_path1')->default(0); + $table->tinyInteger('apply_type2')->default(0); + $table->smallInteger('apply_value2')->default(0); + $table->tinyInteger('apply_path2')->default(0); + $table->tinyInteger('apply_type3')->default(0); + $table->smallInteger('apply_value3')->default(0); + $table->tinyInteger('apply_path3')->default(0); + + $table->index('owner_id', 'owner_id_idx'); + $table->index('vnum', 'item_vnum_index'); + + $table->foreign('owner_id')->references('id')->on('player')->cascadeOnDelete(); + $table->foreign('customer_id')->references('id')->on('player')->cascadeOnDelete(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('private_shop_sale_history'); + } +};