when command "/rpg":
if arg 1 == "start":
if [Link].rpg_started != true:
set [Link].rpg_started to true
set [Link] to 1
set [Link] to 0
set [Link].exp_max to 100
set [Link] to 100
set [Link].hp_max to 100
set [Link] to 10
set [Link] to 5
set [Link] to 0
message player "RPGを開始しました"
else:
message player "すでにRPGは開始されています"
if arg 1 == "status":
message player "===== RPG STATUS ====="
message player "LEVEL: {[Link]}"
message player "EXP: {[Link]}/{[Link].exp_max}"
message player "HP: {[Link]}/{[Link].hp_max}"
message player "ATK: {[Link]}"
message player "DEF: {[Link]}"
message player "GOLD: {[Link]}"
if arg 1 == "hunt":
if [Link] <= 0:
message player "HPが0です"
else:
set temp.enemy_hp to random 30 120
set temp.enemy_atk to random 5 20
set temp.enemy_def to random 2 10
while temp.enemy_hp > 0 and [Link] > 0:
set [Link] to [Link] - temp.enemy_def
if [Link] < 1:
set [Link] to 1
subtract temp.enemy_hp [Link]
set [Link] to temp.enemy_atk - [Link]
if [Link] < 1:
set [Link] to 1
subtract [Link] [Link]
if [Link] > 0:
set temp.get_exp to random 20 60
set temp.get_gold to random 10 40
add [Link] temp.get_exp
add [Link] temp.get_gold
message player "敵を倒した"
message player "EXP +{temp.get_exp}"
message player "GOLD +{temp.get_gold}"
else:
set [Link] to 1
subtract [Link] 10
message player "敗北した"
if arg 1 == "heal":
if [Link] >= 20:
subtract [Link] 20
set [Link] to [Link].hp_max
message player "HPを全回復した"
else:
message player "GOLDが足りません"
if arg 1 == "levelup":
while [Link] >= [Link].exp_max:
subtract [Link] [Link].exp_max
add [Link] 1
add [Link].hp_max 20
add [Link] 5
add [Link] 3
set [Link] to [Link].hp_max
set [Link].exp_max to [Link].exp_max + 50
message player "レベルアップ"
if arg 1 == "shop":
message player "1: 剣 +10ATK (100G)"
message player "2: 鎧 +10DEF (100G)"
message player "3: 最大HP +50 (150G)"
if arg 1 == "buy":
if arg 2 == "1":
if [Link] >= 100:
subtract [Link] 100
add [Link] 10
message player "剣を購入"
if arg 2 == "2":
if [Link] >= 100:
subtract [Link] 100
add [Link] 10
message player "鎧を購入"
if arg 2 == "3":
if [Link] >= 150:
subtract [Link] 150
add [Link].hp_max 50
set [Link] to [Link].hp_max
message player "最大HP増加"
if arg 1 == "reset":
set [Link] to 1
set [Link] to 0
set [Link].exp_max to 100
set [Link] to 100
set [Link].hp_max to 100
set [Link] to 10
set [Link] to 5
set [Link] to 0
message player "RPGデータをリセット"
if arg 1 == "boss":
set temp.boss_hp to 500
set temp.boss_atk to 30
set temp.boss_def to 15
while temp.boss_hp > 0 and [Link] > 0:
set [Link] to [Link] - temp.boss_def
if [Link] < 1:
set [Link] to 1
subtract temp.boss_hp [Link]
set [Link] to temp.boss_atk - [Link]
if [Link] < 1:
set [Link] to 1
subtract [Link] [Link]
if [Link] > 0:
add [Link] 300
add [Link] 200
message player "ボス討伐成功"
else:
set [Link] to 1
subtract [Link] 50
message player "ボスに敗北"