Files
KoreanSupermarket.sk
Code
1 327
KoreanSupermarket.sk
# ============================================
# Korean Supermarket (ํ๊ตญ ์ํผ๋ง์ผ)
# Place in: plugins/Skript/scripts/
# Reload with: /sk reload KoreanSupermarket
# Requires: Skript
# ============================================
options:
prefix: &c[&6ํ๊ตญ ๋งํธ&c]&r
currency: &6coins
shop-name: &6ํ๊ตญ ์ํผ๋ง์ผ &7(Korean Supermarket)
restock-interval: 30 # minutes
# ============================================
# SHOP INVENTORY & PRICES
# ============================================
# Format: {shop::stock::<item>} = amount
# {shop::price::<item>} = price
on script load:
send "{@prefix} &aKorean Supermarket loaded!" to console
call initShop()
function initShop():
# --- Rice & Grains (์ & ๊ณก๋ฌผ) ---
set {shop::price::rice} to 15
set {shop::name::rice} to "&f์ &7(Rice)"
set {shop::item::rice} to wheat seeds
set {shop::price::ramen} to 8
set {shop::name::ramen} to "&f๋ผ๋ฉด &7(Ramen)"
set {shop::item::ramen} to bowl
set {shop::price::tteok} to 20
set {shop::name::tteok} to "&f๋ก &7(Rice Cake)"
set {shop::item::tteok} to bread
# --- Vegetables (์ฑ์) ---
set {shop::price::kimchi} to 25
set {shop::name::kimchi} to "&cKimchi &7(๊น์น)"
set {shop::item::kimchi} to red mushroom
set {shop::price::cabbage} to 10
set {shop::name::cabbage} to "&a๋ฐฐ์ถ &7(Napa Cabbage)"
set {shop::item::cabbage} to cactus
set {shop::price::garlic} to 5
set {shop::name::garlic} to "&f๋ง๋ &7(Garlic)"
set {shop::item::garlic} to potato
set {shop::price::greenonion} to 6
set {shop::name::greenonion} to "&aํ &7(Green Onion)"
set {shop::item::greenonion} to sugar cane
set {shop::price::spinach} to 8
set {shop::name::spinach} to "&2์๊ธ์น &7(Spinach)"
set {shop::item::spinach} to fern
# --- Meat & Seafood (์ก๋ฅ & ํด์ฐ๋ฌผ) ---
set {shop::price::beef} to 45
set {shop::name::beef} to "&c์๊ณ ๊ธฐ &7(Beef)"
set {shop::item::beef} to raw beef
set {shop::price::pork} to 35
set {shop::name::pork} to "&f๋ผ์ง๊ณ ๊ธฐ &7(Pork)"
set {shop::item::pork} to raw porkchop
set {shop::price::chicken} to 30
set {shop::name::chicken} to "&e๋ญ๊ณ ๊ธฐ &7(Chicken)"
set {shop::item::chicken} to raw chicken
set {shop::price::fish} to 28
set {shop::name::fish} to "&b์์ &7(Fish)"
set {shop::item::fish} to raw salmon
set {shop::price::squid} to 32
set {shop::name::squid} to "&f์ค์ง์ด &7(Squid)"
set {shop::item::squid} to ink sac
# --- Drinks (์๋ฃ) ---
set {shop::price::soju} to 18
set {shop::name::soju} to "&b์์ฃผ &7(Soju)"
set {shop::item::soju} to glass bottle
set {shop::price::makgeolli} to 20
set {shop::name::makgeolli} to "&fMakgeolli &7(๋ง๊ฑธ๋ฆฌ)"
set {shop::item::makgeolli} to milk bucket
set {shop::price::sikhye} to 12
set {shop::name::sikhye} to "&eSikhye &7(์ํ)"
set {shop::item::sikhye} to honey bottle
set {shop::price::barleytea} to 10
set {shop::name::barleytea} to "&6๋ณด๋ฆฌ์ฐจ &7(Barley Tea)"
set {shop::item::barleytea} to potion
# --- Snacks (๊ณผ์) ---
set {shop::price::chipseu} to 14
set {shop::name::chipseu} to "&e์นฉ์ค &7(Chips)"
set {shop::item::chipseu} to cookie
set {shop::price::pepero} to 12
set {shop::name::pepero} to "&fPepero &7(๋นผ๋นผ๋ก)"
set {shop::item::pepero} to stick
set {shop::price::hotteok} to 16
set {shop::name::hotteok} to "&6ํธ๋ก &7(Hotteok)"
set {shop::item::hotteok} to pumpkin pie
# --- Condiments (์๋
) ---
set {shop::price::gochujang} to 22
set {shop::name::gochujang} to "&cGochujang &7(๊ณ ์ถ์ฅ)"
set {shop::item::gochujang} to red dye
set {shop::price::doenjang} to 20
set {shop::name::doenjang} to "&6Doenjang &7(๋์ฅ)"
set {shop::item::doenjang} to brown dye
set {shop::price::sesameOil} to 18
set {shop::name::sesameOil} to "&eParticle Oil &7(์ฐธ๊ธฐ๋ฆ)"
set {shop::item::sesameOil} to yellow dye
set {shop::price::soysauce} to 15
set {shop::name::soysauce} to "&8๊ฐ์ฅ &7(Soy Sauce)"
set {shop::item::soysauce} to black dye
# Set default stock for all items
loop {shop::price::*}:
set {_key} to loop-index
if {shop::stock::%{_key}%} is not set:
set {shop::stock::%{_key}%} to 64
# ============================================
# PLAYER BALANCE SYSTEM
# ============================================
function getBalance(p: player) :: integer:
if {balance::%{_p}%} is not set:
set {balance::%{_p}%} to 500
return {balance::%{_p}%}
function addBalance(p: player, amount: integer):
if {balance::%{_p}%} is not set:
set {balance::%{_p}%} to 500
add {_amount} to {balance::%{_p}%}
function removeBalance(p: player, amount: integer) :: boolean:
if {balance::%{_p}%} is not set:
set {balance::%{_p}%} to 500
if {balance::%{_p}%} >= {_amount}:
subtract {_amount} from {balance::%{_p}%}
return true
return false
# ============================================
# MAIN SHOP COMMAND
# ============================================
command /mart:
aliases: /supermarket, /hmart, /koreanshop
description: Open the Korean Supermarket
trigger:
openShopMenu(player)
command /mart help:
trigger:
send "{@prefix} &e=== Korean Supermarket Help ===" to player
send "&7/mart &f- Open the shop" to player
send "&7/mart buy <item> <amount> &f- Buy an item" to player
send "&7/mart sell <item> <amount> &f- Sell an item" to player
send "&7/mart list &f- List all items" to player
send "&7/mart balance &f- Check your balance" to player
send "&7/mart restock &f- Restock shop (Admin)" to player
command /mart balance:
trigger:
set {_bal} to getBalance(player)
send "{@prefix} &eYour balance: &6%{_bal}% {@currency}" to player
command /mart list:
trigger:
send "{@prefix} &e=== ์ํ ๋ชฉ๋ก (Item List) ===" to player
loop {shop::price::*}:
set {_key} to loop-index
set {_name} to {shop::name::%{_key}%}
set {_price} to {shop::price::%{_key}%}
set {_stock} to {shop::stock::%{_key}%}
send " &7- %{_name}% &8| &6%{_price}% coins &8| &aStock: %{_stock}%" to player
command /mart buy <text> <integer=1>:
trigger:
set {_item} to arg-1 in lower case
set {_amount} to arg-2
if {_amount} <= 0:
send "{@prefix} &cAmount must be at least 1." to player
stop
if {_amount} > 64:
send "{@prefix} &cYou can only buy up to 64 at a time." to player
stop
if {shop::price::%{_item}%} is not set: