function contains(l: objects, t: text) :: boolean:
{_l::*} isn't set:
return false
else if {_l::*} contains {_t}:
return true
else:
return false
function langCheck(y: text, t: text):
yaml value {_y} from "skQuests-Lang" isn't set
set yaml value {_y} from "skQuests-Lang" to {_t}
function reloadLang():
langCheck("messages.complete", "Görevi başarıyla tamamladın!")
langCheck("messages.not-complete", "Bu görevi henüz tamamlamadın.")
langCheck("messages.completed", "Bu görev tamamlanmış!")
langCheck("messages.commands.title", "Komutlar")
langCheck("messages.commands.reload", "Görev dosyasını yeniler.")
langCheck("messages.commands.info", "Skript bilgilerini gösterir.")
langCheck("messages.commands.get", "Görev kitabını verir.")
langCheck("messages.info.title", "Skript Bilgileri")
langCheck("messages.info.developer", "Kodlayan")
langCheck("messages.info.version", "Sürüm")
langCheck("messages.book-given", "Görev kitabı başarıyla verildi!")
langCheck("messages.no-perm", "Bunun için yetkin yok.")
langCheck("messages.wrong-usage", "Hatalı kullanım.")
langCheck("messages.no-quest", "Görev bulunamadı.")
langCheck("messages.only-in-game", "Bu komut sadece oyun içinden kullanılabilir.")
langCheck("gui.title", "Görevler")
langCheck("gui.type", "Tür")
langCheck("gui.types.retrieve", "Toplama")
langCheck("gui.types.break", "Blok Kırma")
langCheck("gui.types.kill", "Öldürme")
langCheck("gui.requirements", "Gerekenler")
langCheck("gui.awards.text", "Ödüller")
langCheck("gui.awards.money", "Para")
langCheck("gui.click-to-complete", "Görevi bitirmek için tıkla!")
langCheck("gui.click-to-see-quests", "Görevleri görmek için tıkla!")
langCheck("gui.page.previous", "Önceki Sayfa")
langCheck("gui.page.next", "Sonraki Sayfa")
langCheck("gui.page.title", "Sayfa Bilgileri")
langCheck("gui.page.category", "Kategori")
langCheck("gui.page.page", "Sayfa")
langCheck("gui.close", "Kapat")
langCheck("gui.back", "Geri Dön")
langCheck("gui.locked", "Kilitli")
langCheck("gui.required-quests", "Gereken Görevler")
langCheck("parsing.error", "Hata")
langCheck("parsing.category.no-category", "Kategori bulunamadı")
langCheck("parsing.category.name", "Kategori ismi bulunamadı")
langCheck("parsing.category.icon", "Kategori ikonu bulunamadı")
langCheck("parsing.category.quest", "Kategoride görev bulunamadı")
langCheck("parsing.quest.type", "Görev türü bulunamadı")
langCheck("parsing.quest.name", "Görev adı bulunamadı")
langCheck("parsing.quest.icon", "Görev ikonu bulunamadı")
langCheck("parsing.quest.requirements", "Görev gerekenleri bulunamadı.")
langCheck("parsing.successful", "YAML dosyası başarıyla yüklendi!")
langCheck("parsing.not-successful", "YAML dosyası yüklenirken %%errors%% hata oluştu.")
langCheck("book.title", "Görev Kitabı")
function YAMLParse() :: objects:
yaml nodes with keys "" from "skQuests-Quests" isn't set:
add "&7[&askQuests&7] &c%yaml value ""parsing.error"" from ""skQuests-Lang""%: %yaml value ""parsing.category.no-category"" from ""skQuests-Lang""%" to {_return::*}
loop yaml nodes with keys "" from "skQuests-Quests":
yaml value "%loop-value%.name" from "skQuests-Quests" isn't set:
add "&7[&askQuests&7] &c%yaml value ""parsing.error"" from ""skQuests-Lang""%: %yaml value ""parsing.category.name"" from ""skQuests-Lang""% (%loop-value%)" to {_return::*}
yaml value "%loop-value%.icon" from "skQuests-Quests" isn't set:
add "&7[&askQuests&7] &c%yaml value ""parsing.error"" from ""skQuests-Lang""%: %yaml value ""parsing.category.icon"" from ""skQuests-Lang""% (%loop-value%)" to {_return::*}
yaml nodes with keys "%loop-value%.quests" from "skQuests-Quests" isn't set:
add "&7[&askQuests&7] &c%yaml value ""parsing.error"" from ""skQuests-Lang""%: %yaml value ""parsing.category.quest"" from ""skQuests-Lang""% (%loop-value%)" to {_return::*}
loop yaml nodes with keys "%loop-value%.quests" from "skQuests-Quests":
yaml value "%loop-value-1%.quests.%loop-value-2%.type" from "skQuests-Quests" isn't set:
add "&7[&askQuests&7] &c%yaml value ""parsing.error"" from ""skQuests-Lang""%: %yaml value ""parsing.quest.type"" from ""skQuests-Lang""% (%loop-value-1%.quests.%loop-value-2%)" to {_return::*}
yaml value "%loop-value-1%.quests.%loop-value-2%.name" from "skQuests-Quests" isn't set:
add "&7[&askQuests&7] &c%yaml value ""parsing.error"" from ""skQuests-Lang""%: %yaml value ""parsing.quest.name"" from ""skQuests-Lang""% (%loop-value-1%.quests.%loop-value-2%)" to {_return::*}
yaml value "%loop-value-1%.quests.%loop-value-2%.icon" from "skQuests-Quests" isn't set:
add "&7[&askQuests&7] &c%yaml value ""parsing.error"" from ""skQuests-Lang""%: %yaml value ""parsing.quest.icon"" from ""skQuests-Lang""% (%loop-value-1%.quests.%loop-value-2%)" to {_return::*}
yaml list "%loop-value-1%.quests.%loop-value-2%.requirements" from "skQuests-Quests" isn't set:
add "&7[&askQuests&7] &c%yaml value ""parsing.error"" from ""skQuests-Lang""%: %yaml value ""parsing.quest.requirements"" from ""skQuests-Lang""% (%loop-value-1%.quests.%loop-value-2%)" to {_return::*}
{_return::*} isn't set:
add "&7[&askQuests&7] &a%yaml value ""parsing.successful"" from ""skQuests-Lang""%" to {_return::*}
else:
set {_t} to "%yaml value ""parsing.not-successful"" from ""skQuests-Lang""%"
replace "%%errors%%" with "&l&c%size of {_return::*}%&c" in {_t}
add "&7[&askQuests&7] &c%{_t}%" to {_return::*}
return {_return::*}
load:
load yaml "plugins/Skript/scripts/skQuests/quests.yml" as "skQuests-Quests"
load yaml "plugins/Skript/scripts/skQuests/lang.yml" as "skQuests-Lang"
reloadLang()
save yaml "skQuests-Lang" without extra lines between nodes
wait 10 tick
loop YAMLParse():
send "%loop-value%" to console
join:
set {_p} to "%player%" in lower case
load yaml "plugins/Skript/scripts/skQuests/players/%{_p}%.yml" as "skQuests-Player-%{_p}%"
quit:
set {_p} to "%player%" in lower case
save yaml "skQuests-Player-%{_p}%" without extra lines between nodes
unload yaml "skQuests-Player-%{_p}%"
death:
attacker is a player
loop yaml nodes with keys "" from "skQuests-Quests":
loop yaml nodes with keys "%loop-value%.quests" from "skQuests-Quests":
delete {_ok}
loop yaml list "%loop-value-1%.quests.%loop-value-2%.quests" from "skQuests-Quests":
contains(yaml list "completed" from "skQuests-Player-%attacker's name in lower case%", "%loop-value-3%") is false
set {_ok} to 1
{_ok} isn't set
contains(yaml list "completed" from "skQuests-Player-%attacker's name in lower case%", "%loop-value-1%.%loop-value-2%") is false
yaml value "%loop-value-1%.quests.%loop-value-2%.type" from "skQuests-Quests" is "kill", "mobkill", "mob_kill" or "mob kill"
loop yaml list "%loop-value-1%.quests.%loop-value-2%.requirements" from "skQuests-Quests":
set {_l} to "%loop-value-3%"
set {_l::*} to {_l} split at " as "
set {_l2::*} to {_l::1} split at " "
{_l2::1} parsed as integer is set:
loop size of {_l2::*} times:
loop-number isn't 1
add {_l2::%loop-number%} to {_mob::*}
set {_mob} to join {_mob::*} with " "
type of victim is {_mob} parsed as entity type
yaml value "progress.%loop-value-1%.%loop-value-2%.%{_mob}%" from "skQuests-Player-%attacker's name in lower case%" is set:
{_l2::1} parsed as integer is bigger than yaml value "progress.%loop-value-1%.%loop-value-2%.%{_mob}%" from "skQuests-Player-%attacker's name in lower case%"
set yaml value "progress.%loop-value-1%.%loop-value-2%.%{_mob}%" from "skQuests-Player-%attacker's name in lower case%" to yaml value "progress.%loop-value-1%.%loop-value-2%.%{_mob}%" from "skQuests-Player-%attacker's name in lower case%" + 1
else:
set yaml value "progress.%loop-value-1%.%loop-value-2%.%{_mob}%" from "skQuests-Player-%attacker's name in lower case%" to 1
else:
type of victim is {_l::1} parsed as entity type
yaml value "progress.%loop-value-1%.%loop-value-2%.%{_l::1} parsed as entity type%" from "skQuests-Player-%attacker's name in lower case%" isn't set
set yaml value "progress.%loop-value-1%.%loop-value-2%.%{_l::1} parsed as entity type%" from "skQuests-Player-%attacker's name in lower case%" to 1
break:
loop yaml nodes with keys "" from "skQuests-Quests":
loop yaml nodes with keys "%loop-value%.quests" from "skQuests-Quests":
delete {_ok}
loop yaml list "%loop-value-1%.quests.%loop-value-2%.quests" from "skQuests-Quests":
contains(yaml list "completed" from "skQuests-Player-%player's name in lower case%", "%loop-value-3%") is false
set {_ok} to 1
{_ok} isn't set
contains(yaml list "completed" from "skQuests-Player-%player's name in lower case%", "%loop-value-1%.%loop-value-2%") is false
yaml value "%loop-value-1%.quests.%loop-value-2%.type" from "skQuests-Quests" is "break", "blockbreak", "block_break" or "block break"
loop yaml list "%loop-value-1%.quests.%loop-value-2%.requirements" from "skQuests-Quests":
set {_l} to "%loop-value-3%"
set {_l::*} to {_l} split at " as "
{_l::1} parsed as item is set
event-block is "%{_l::1}%" parsed as item
yaml value "progress.%loop-value-1%.%loop-value-2%.%1 of {_l::1} parsed as item%" from "skQuests-Player-%player's name in lower case%" is set:
first element out of {_l::1} split at " " parsed as integer is bigger than yaml value "progress.%loop-value-1%.%loop-value-2%.%1 of {_l::1} parsed as item%" from "skQuests-Player-%player's name in lower case%"
set yaml value "progress.%loop-value-1%.%loop-value-2%.%1 of {_l::1} parsed as item%" from "skQuests-Player-%player's name in lower case%" to yaml value "progress.%loop-value-1%.%loop-value-2%.%1 of {_l::1} parsed as item%" from "skQuests-Player-%player's name in lower case%" + 1
else:
set yaml value "progress.%loop-value-1%.%loop-value-2%.%1 of {_l::1} parsed as item%" from "skQuests-Player-%player's name in lower case%" to 1
function quest1(p: player, pa: integer):
yaml nodes with keys "" from "skQuests-Quests" is set:
size of yaml nodes with keys "" from "skQuests-Quests" is more than 45:
set {_size} to 6
else:
set {_size} to ceil(size of yaml nodes with keys "" from "skQuests-Quests"/9)+1
open virtual chest inventory with size {_size} named "&a%yaml value ""gui.title"" from ""skQuests-Lang""%" to {_p}
format gui slot numbers between {_size} * 9 - 9 and {_size} * 9 - 1 of {_p} with black stained glass named " "
{_pa} is 1:
format gui slot {_size} * 9 - 9 of {_p} with gunpowder named "&a<< &f%yaml value ""gui.page.previous"" from ""skQuests-Lang""%"
else:
format gui slot {_size} * 9 - 9 of {_p} with glowstone dust named "&a<< &f%yaml value ""gui.page.previous"" from ""skQuests-Lang""%" to run:
quest1(player, "%{_pa}-1%" parsed as integer)
size of yaml nodes with keys "" from "skQuests-Quests" is more than 45:
format gui slot {_size} * 9 - 1 of {_p} with redstone named "&f%yaml value ""gui.page.next"" from ""skQuests-Lang""% &a>>" to run:
quest1(player, "%{_pa}+1%" parsed as integer)
else:
format gui slot {_size} * 9 - 1 of {_p} with gunpowder named "&f%yaml value ""gui.page.next"" from ""skQuests-Lang""% &a>>"
format gui slot {_size} * 9 - 7 of {_p} with book named "&a%yaml value ""messages.info.title"" from ""skQuests-Lang""%" with lore "&a%yaml value ""messages.info.developer"" from ""skQuests-Lang""%: &fBartuzen||&a%yaml value ""messages.info.version"" from ""skQuests-Lang""%: &f0.2.2"
format gui slot {_size} * 9 - 5 of {_p} with red stained glass named "&c%yaml value ""gui.close"" from ""skQuests-Lang""%" to close
format gui slot {_size} * 9 - 3 of {_p} with sign item named "&a%yaml value ""gui.page.title"" from ""skQuests-Lang""%" with lore "&a%yaml value ""gui.page.page"" from ""skQuests-Lang""%: &f%{_pa}%"
loop yaml nodes with keys "" from "skQuests-Quests":
add 1 to {_c::2::1}
{_c::2::1} is between {_pa} * 45 - 44 and {_pa} * 45
set {_name} to yaml value "%loop-value%.name" from "skQuests-Quests"
set {_desc} to yaml value "%loop-value%.desc" from "skQuests-Quests"
{_desc} is set:
set {_desc} to "&f%{_desc}%||&a%yaml value ""gui.click-to-see-quests"" from ""skQuests-Lang""%"
else:
set {_desc} to "&a%yaml value ""gui.click-to-see-quests"" from ""skQuests-Lang""%"
add 1 to {_c::1::1}
format gui slot {_c::1::1}-1 of {_p} with yaml value "%loop-value%.icon" from "skQuests-Quests" parsed as item named "&a%{_name}%" with lore {_desc} to close then run function quest2({_p}, 1, "%loop-value%")
else:
send "&c%yaml value ""messagees.no-quest"" from ""skQuests-Lang""%" to {_p}
function quest2(p: player, pa: integer, cat: text):
yaml nodes with keys "%{_cat}%.quests" from "skQuests-Quests" is set:
size of yaml nodes with keys "%{_cat}%.quests" from "skQuests-Quests" is more than 45:
set {_size} to 6
else:
set {_size} to ceil(size of yaml nodes with keys "%{_cat}%.quests" from "skQuests-Quests"/9)+1
set {_cn} to yaml value "%{_cat}%.name" from "skQuests-Quests"
open virtual chest inventory with size {_size} named "&a%yaml value ""gui.title"" from ""skQuests-Lang""% (&f%{_cn}%&a)" to {_p}
format gui slot numbers between {_size} * 9 - 9 and {_size} * 9 - 1 of {_p} with black stained glass named " "
{_pa} is 1:
format gui slot {_size} * 9 - 9 of {_p} with gunpowder named "&a<< &f%yaml value ""gui.page.previous"" from ""skQuests-Lang""%"
else:
format gui slot {_size} * 9 - 9 of {_p} with glowstone dust named "&a<< &f%yaml value ""gui.page.previous"" from ""skQuests-Lang""%" to run:
quest2(player, "%{_pa}-1%" parsed as integer, {_cat})
size of yaml nodes with keys "%{_cat}%.quests" from "skQuests-Quests" is more than 45:
format gui slot {_size} * 9 - 1 of {_p} with redstone named "&f%yaml value ""gui.page.next"" from ""skQuests-Lang""% &a>>" to run:
quest2(player, "%{_pa}+1%" parsed as integer, {_cat})
else:
format gui slot {_size} * 9 - 1 of {_p} with gunpowder named "&f%yaml value ""gui.page.next"" from ""skQuests-Lang""% &a>>"
format gui slot {_size} * 9 - 7 of {_p} with book named "&a%yaml value ""messages.info.title"" from ""skQuests-Lang""%" with lore "&a%yaml value ""messages.info.developer"" from ""skQuests-Lang""%: &fBartuzen||&a%yaml value ""messages.info.version"" from ""skQuests-Lang""%: &f0.2.2"
format gui slot {_size} * 9 - 5 of {_p} with red stained glass named "&c%yaml value ""gui.back"" from ""skQuests-Lang""%" to run function quest1({_p}, 1)
format gui slot {_size} * 9 - 3 of {_p} with sign item named "&a%yaml value ""gui.page.title"" from ""skQuests-Lang""%" with lore "&a%yaml value ""gui.page.category"" from ""skQuests-Lang""%: &f%{_cn}%||&a%yaml value ""gui.page.page"" from ""skQuests-Lang""%: &f%{_pa}%"
loop yaml nodes with keys "%{_cat}%.quests" from "skQuests-Quests":
add 1 to {_c::2::2}
{_c::2::2} is between {_pa} * 45 - 44 and {_pa} * 45
add 1 to {_c::1::2}
delete {_ok} and {_lore::*}
loop yaml list "%{_cat}%.quests.%loop-value%.quests" from "skQuests-Quests":
contains(yaml list "completed" from "skQuests-Player-%{_p}'s name in lower case%", "%loop-value-2%") is false
set {_ok} to 1
{_ok} isn't set:
delete {_no}
set {_desc} to yaml value "%{_cat}%.quests.%loop-value%.desc" from "skQuests-Quests"
add "&f%{_desc}%" to {_lore::*}
yaml value "%{_cat}%.quests.%loop-value%.type" from "skQuests-Quests" is "retrieve":
add "&a%yaml value ""gui.type"" from ""skQuests-Lang""%: &f%yaml value ""gui.types.retrieve"" from ""skQuests-Lang""%||&e%yaml value ""gui.requirements"" from ""skQuests-Lang""%:" to {_lore::*}
loop yaml list "%{_cat}%.quests.%loop-value%.requirements" from "skQuests-Quests":
set {_l} to "%loop-value-2%"
set {_l::*} to {_l} split at " as "
{_l::1} parsed as item is set
contains(yaml list "completed" from "skQuests-Player-%{_p}'s name in lower case%", "%{_cat}%.%loop-value-1%") is false:
"%{_p}%" parsed as player has {_l::1} parsed as item:
add "&a- %last element out of {_l::*}%" to {_lore::*}
else:
add "&c- %last element out of {_l::*}% (%amount of {_l::1} parsed as item in {_p}'s inventory%)" to {_lore::*}
set {_no} to 1
else:
add "&a- %last element out of {_l::*}%" to {_lore::*}
else if yaml value "%{_cat}%.quests.%loop-value%.type" from "skQuests-Quests" is "break", "blockbreak", "block_break" or "block break":
add "&a%yaml value ""gui.type"" from ""skQuests-Lang""%: &f%yaml value ""gui.types.break"" from ""skQuests-Lang""%||&e%yaml value ""gui.requirements"" from ""skQuests-Lang""%:" to {_lore::*}
loop yaml list "%{_cat}%.quests.%loop-value%.requirements" from "skQuests-Quests":
set {_l} to "%loop-value-2%"
set {_l::*} to {_l} split at " as "
{_l::1} parsed as item is set
contains(yaml list "completed" from "skQuests-Player-%{_p}'s name in lower case%", "%{_cat}%.%loop-value-1%") is false:
first element out of {_l::1} split at " " parsed as integer is set:
set {_a} to first element out of {_l::1} split at " " parsed as integer
else:
set {_a} to 1
yaml value "progress.%{_cat}%.%loop-value-1%.%1 of {_l::1} parsed as item%" from "skQuests-Player-%{_p}'s name in lower case%" is {_a}:
add "&a- %last element out of {_l::*}%" to {_lore::*}
else:
set {_i} to yaml value "progress.%{_cat}%.%loop-value-1%.%1 of {_l::1} parsed as item%" from "skQuests-Player-%{_p}'s name in lower case%"
{_i} is set:
add "&c- %last element out of {_l::*}% (%{_i}%)" to {_lore::*}
else:
add "&c- %last element out of {_l::*}% (0)" to {_lore::*}
set {_no} to 1
else:
add "&a- %last element out of {_l::*}%" to {_lore::*}
else if yaml value "%{_cat}%.quests.%loop-value%.type" from "skQuests-Quests" is "kill", "mobkill", "mob_kill" or "mob kill":
add "&a%yaml value ""gui.type"" from ""skQuests-Lang""%: &f%yaml value ""gui.types.kill"" from ""skQuests-Lang""%||&e%yaml value ""gui.requirements"" from ""skQuests-Lang""%:" to {_lore::*}
loop yaml list "%{_cat}%.quests.%loop-value%.requirements" from "skQuests-Quests":
set {_l} to "%loop-value-2%"
set {_l::*} to {_l} split at " as "
{_l::1} parsed as entity type is set:
set {_mob} to {_l::1} parsed as entity type
else:
set {_l2::*} to {_l::1} split at " "
{_l2::1} parsed as integer is set
loop size of {_l2::*} times:
loop-number isn't 1
add {_l2::%loop-number%} to {_mob::*}
set {_mob} to join {_mob::*} with " "
{_mob} is set
contains(yaml list "completed" from "skQuests-Player-%{_p}'s name in lower case%", "%{_cat}%.%loop-value-1%") is false:
first element out of {_l::1} split at " " parsed as integer is set:
set {_a} to first element out of {_l::1} split at " " parsed as integer
else:
set {_a} to 1
yaml value "progress.%{_cat}%.%loop-value-1%.%{_mob}%" from "skQuests-Player-%{_p}'s name in lower case%" is {_a}:
add "&a- %last element out of {_l::*}%" to {_lore::*}
else:
set {_i} to yaml value "progress.%{_cat}%.%loop-value-1%.%{_mob}%" from "skQuests-Player-%{_p}'s name in lower case%"
{_i} is set:
add "&c- %last element out of {_l::*}% (%{_i}%)" to {_lore::*}
else:
add "&c- %last element out of {_l::*}% (0)" to {_lore::*}
set {_no} to 1
else:
add "&a- %last element out of {_l::*}%" to {_lore::*}
delete {_aw}
loop yaml list "%{_cat}%.quests.%loop-value%.complete.items" from "skQuests-Quests":
{_aw} isn't set:
set {_aw} to 1
add "&e%yaml value ""gui.awards.text"" from ""skQuests-Lang""%:" to {_lore::*}
set {_l} to "%loop-value-2%"
set {_l::*} to {_l} split at " as "
{_l::1} parsed as item is set
add "&a- %last element out of {_l::*}%" to {_lore::*}
delete {_money}
set {_money} to yaml value "%{_cat}%.quests.%loop-value%.complete.money" from "skQuests-Quests"
"%{_money}%" parsed as number is set:
{_aw} isn't set:
set {_aw} to 1
add "&e%yaml value ""gui.awards.text"" from ""skQuests-Lang""%:" to {_lore::*}
add "&a- %yaml value ""gui.awards.money"" from ""skQuests-Lang""%: &f%{_money}%" to {_lore::*}
set {_name} to yaml value "%{_cat}%.quests.%loop-value%.name" from "skQuests-Quests"
set {_id} to loop-value
contains(yaml list "completed" from "skQuests-Player-%{_p}'s name in lower case%", "%{_cat}%.%loop-value%") is false:
{_no} isn't set:
add "&a%yaml value ""gui.click-to-complete"" from ""skQuests-Lang""%" to {_lore::*}
set {_name} to "&a%{_name}%"
else:
set {_name} to "&c%{_name}%"
format gui slot {_c::1::2}-1 of {_p} with yaml value "%{_cat}%.quests.%loop-value%.icon" from "skQuests-Quests" parsed as item named "&a%{_name}%" with lore join {_lore::*} with "||" to close:
yaml value "%{_cat}%.quests.%{_id}%.type" from "skQuests-Quests" is "retrieve":
loop yaml list "%{_cat}%.quests.%{_id}%.requirements" from "skQuests-Quests":
set {_l} to "%loop-value-2%"
set {_l::*} to {_l} split at " as "
{_l::1} parsed as item is set
"%{_p}%" parsed as player doesn't have {_l::1} parsed as item
set {_no} to 1
{_no} isn't set:
yaml value "%{_cat}%.quests.%{_id}%.type" from "skQuests-Quests" is "break", "blockbreak", "block_break", "block break", "kill", "mobkill", "mob_kill" or "mob kill":
delete yaml value "progress.%{_cat}%.%{_id}%" from "skQuests-Player-%{_p}'s name in lower case%"
loop yaml list "%{_cat}%.quests.%{_id}%.requirements" from "skQuests-Quests":
set {_l} to "%loop-value-2%"
set {_l::*} to {_l} split at " as "
{_l::1} parsed as item is set
remove {_l::1} parsed as item from {_p}
add "%{_cat}%.%{_id}%" to yaml list "completed" from "skQuests-Player-%{_p}'s name in lower case%"
loop yaml list "%{_cat}%.quests.%{_id}%.complete.items" from "skQuests-Quests":
set {_l} to "%loop-value-2%"
set {_l::*} to {_l} split at " as "
{_l::1} parsed as item is set
"%{_p}%" parsed as player has space for {_l::1} parsed as item:
give {_l::1} parsed as item to {_p}
else:
drop {_l::1} parsed as item at {_p}
loop yaml list "%{_cat}%.quests.%{_id}%.complete.commands" from "skQuests-Quests":
set {_l} to loop-value-2
replace "%%player%%" with {_p}'s name in {_l}
replace "%%id%%" with "%{_cat}%.%{_id}%" in {_l}
execute command {_l}
set {_money} to yaml value "%{_cat}%.quests.%{_id}%.complete.money" from "skQuests-Quests"
"%{_money}%" parsed as number is set:
add "%{_money}%" parsed as number to {_p}'s balance
send "&a%yaml value ""messages.complete"" from ""skQuests-Lang""%" to {_p}
else:
send "&c%yaml value ""messages.not-complete"" from ""skQuests-Lang""%" to {_p}
else:
add "&a%yaml value ""messages.completed"" from ""skQuests-Lang""%" to {_lore::*}
set {_name} to "&a%{_name}%"
format gui slot {_c::1::2}-1 of {_p} with light green dye named "&a%{_name}%" with lore join {_lore::*} with "||"
else:
loop yaml list "%{_cat}%.quests.%loop-value%.quests" from "skQuests-Quests":
contains(yaml list "completed" from "skQuests-Player-%{_p}'s name in lower case%", "%loop-value-2%") is false
set {_l} to loop-value-2
delete {_name}
set {_name} to yaml value "%first element out of {_l} split at "".""%.quests.%last element out of {_l} split at "".""%.name" from "skQuests-Quests"
add "&c- %{_name}%" to {_lore::*}
format gui slot {_c::1::2}-1 of {_p} with barrier named "&c%yaml value ""gui.locked"" from ""skQuests-Lang""%" with lore "&e%yaml value ""gui.required-quests"" from ""skQuests-Lang""%:||%join {_lore::*} with ""||""%"
else:
send "&c%yaml value ""messagees.no-quest"" from ""skQuests-Lang""%" to {_p}
command /görev [<text>]:
aliases: görevler, quest, quests, q
executable by: console and player
trigger:
arg 1 isn't set:
executor is player:
quest1(player, 1)
else:
send "&8%yaml value ""messages.commands.title"" from ""skQuests-Lang""%"
send "&a/quests reload &8- &a%yaml value ""messages.commands.reload"" from ""skQuests-Lang""%"
send "&a/quests info &8- &a%yaml value ""messages.commands.info"" from ""skQuests-Lang""%"
send "&a/quests get &8- &a%yaml value ""messages.commands.get"" from ""skQuests-Lang""%"
else if arg 1 is "i", "info" or "bilgi":
send "&a%yaml value ""messages.info.title"" from ""skQuests-Lang""%"
send "&a%yaml value ""messages.info.developer"" from ""skQuests-Lang""%: &fBartuzen"
send "&a%yaml value ""messages.info.version"" from ""skQuests-Lang""%: &f0.2.2"
else if arg 1 is "rl", "rel", "reload" or "yenile":
executor is console:
set {_ok} to 1
player has permission "skquests.reload":
set {_ok} to 1
{_ok} is set:
reloadLang()
loop YAMLParse():
send "%loop-value%"
else:
send "&c%yaml value ""messages.no-perm"" from ""skQuests-Lang""%"
else if arg 1 is "get", "al", "book", "kitap", "give" or "ver":
executor is player:
player has permission "skquests.getbook":
give book named "&a&l%yaml value ""book.title"" from ""skQuests-Lang""%" to player
send "&a%yaml value ""messages.book-given"" from ""skQuests-Lang""%"
else:
send "&c%yaml value ""messages.no-perm"" from ""skQuests-Lang""%"
else:
send "&c%yaml value ""messages.only-in-game"" from ""skQuests-Lang""%"
else:
send "&8%yaml value ""messages.commands.title"" from ""skQuests-Lang""%"
send "&a/quests reload &8- &a%yaml value ""messages.commands.reload"" from ""skQuests-Lang""%"
send "&a/quests info &8- &a%yaml value ""messages.commands.info"" from ""skQuests-Lang""%"
send "&a/quests get &8- &a%yaml value ""messages.commands.get"" from ""skQuests-Lang""%"
rightclick with book:
name of player's tool is "&a&l%yaml value ""book.title"" from ""skQuests-Lang""%"
quest1(player, 1)
preparing craft:
loop integers between 1 and 9:
name of slot loop-number of event-inventory is "&a&l%yaml value ""book.title"" from ""skQuests-Lang""%"
delete slot 0 of event-inventory