# type yaml data = NICHT ZU EDITIEREN
# Boolean useEconomy = Aktiviere Geld
# List usedWorlds = Abbau/Töten wird in diesen Welten gezählt; 1. Eintrag all = in allen Welten
# List usedQuests = Diese Quests werden täglich ausgewählt, minumum:2
# Zahl notifyDistance = Alle x Aktionen erscheint eine Nachricht
# Text notifyMessage = Hier können Color-Codes eingefügt werden <&1> <&2> <&3>...
# Text notifyBack = Wenn der Spieler zum npc geschickt wird.
# Text cmd... = npc Nachrichten
# Text npc... = cmd Nachrichten
# Zahl qty = Wieviele Kills/Abbau ?
# Text message = Name der Aktion
# Text bMatName = Bringe, angezeigter item-name
# Item bMat = Bringe, interner item-name /quest hand
# Zahl bQty = Bringe, item x mal ...
# Text rItemName = Belohnung, angezeigter item-name
# Item rItem = Belohnung, interner item-name /quest hand
# Zahl rQty = = Belohnung, erhalte item x mal...
# Zahl rMoney = Belohnung, erhalte x geld
dailyConfig:
type: yaml data
useEconomy: true
usedWorlds:
- all
- world
- farmwelt
- world_nether
usedQuests:
- coal
- iron
- chicken
- skeleton
- zombie
notifyDistance: 2
notifyMessage:
- narrate "<&7><def[ownValue]>/<def[serverValue]> <def[messageSuffix]>."
notifyBack:
- narrate "<&7>Du hast genug <def[messageSuffix]>, kehre zum Auftraggeber zurück."
cmdHeader:
- narrate "-- Tagesquest --"
cmdDone:
- narrate "Aufgabe bereits abgeschlossen."
cmdMessage:
- narrate "<def[ownValue]> von <def[serverValue]> <def[messageSuffix]>."
cmdInfo:
- narrate "Heutige Aufgabe: '<def[object]>'"
npcGetItem:
- narrate "[+ <def[rQty]> <def[rItemName]> erhalten]"
npcGetMoney:
- narrate "[+ <def[rMoney]> <player.money.currency>]"
npcAskAnswer:
- narrate "Antworte: ja / nein"
npcGotQuest:
- narrate "[Aufgabe hinzugefügt: /quest ]"
coal:
qty: 14
message: KohleErz abgebaut
bMatName: Kohle
bMat: coal
bQty: 15
rItemName: ---
rItem: ---
rQty: 0
rMoney: 30
iron:
qty: 8
message: Eisen abgebaut
bMatName: Eisen
bMat: iron_ore
bQty: 8
rItemName: Smaragd
rItem: emerald
rQty: 4
rMoney: 15
chicken:
qty: 8
message: Hühner getötet
bMatName: Ei
bMat: egg
bQty: 8
rItemName: Baumstämme
rItem: oak_log
rQty: 32
rMoney: 10
zombie:
qty: 6
message: Zombies getötet
bMatName: Zombie Fleisch
bMat: rotten_flesh
bQty: 5
rItemName: Diamant
rItem: diamond
rQty: 1
rMoney: 15
skeleton:
qty: 8
message: Skelette getötet
bMatName: Knochen
bMat: bone
bQty: 10
rItemName: Eisenbarren
rItem: iron_ingot
rQty: 10
rMoney: 10
# *
# * DailyQuest, a daily quest for spigot
# * Copyright (C) BloodEko
# *
# * CHANGES BELOW MAY BREAK YOUR SERVER
# *
DailyNPC:
type: assignment
actions:
on click:
- ^if <player.has_flag[engaged.<npc>]> queue clear
- ^flag player engaged.<npc> d:60s
- ^define quest <server.flag[daily.quest]>
- ^define actionQty <s@dailyConfig.yaml_key[<def[quest]>.qty]>
- ^define actionMessage <s@dailyConfig.yaml_key[<def[quest]>.message]>
- if <player.has_flag[daily.value]> {
- define plValue <player.flag[daily.value]>
- if <def[plValue]> >= <def[actionQty]> {
- define bringQty <s@dailyConfig.yaml_key[<def[quest]>.bQty]>
- define bringMat <s@dailyConfig.yaml_key[<def[quest]>.bMat]>
- define bringMatName <s@dailyConfig.yaml_key[<def[quest]>.bMatName]>
- chat "Du hast alle <def[actionQty]> <def[actionMessage]>."
- wait 2
- if <pl.inventory.contains[<def[bringMat]>].qty[<def[bringQty]>]> {
- take <def[bringMat]> qty:<def[bringQty]>
- flag player daily:!
- flag player daily.done
- chat "Die <def[bringMatName]> <def[bringQty]> hast ebenso dabei."
- wait 2
- chat "Somit überreiche ich dir eine Belohnung."
- define rQty <s@dailyConfig.yaml_key[<def[quest]>.rQty]>
- define rItem <s@dailyConfig.yaml_key[<def[quest]>.rItem]>
- define rItemName <s@dailyConfig.yaml_key[<def[quest]>.rItemName]>
- define rMoney <s@dailyConfig.yaml_key[<def[quest]>.rMoney]>
- if <def[rQty]> > 0 {
- inject dailyConfig path:npcGetItem
- give <def[rItem]> qty:<def[rQty]>
}
- if <s@dailyConfig.yaml_key[useEconomy]> && <def[rMoney]> > 0 {
- inject dailyConfig path:npcGetMoney
- money give qty:<def[rMoney]>
}
} else {
- chat "Du hast die Aufgabe erfüllt."
- wait 2
- chat "Allerdings musst du mir noch <def[bringQty]> <def[bringMatName]> bringen."
}
} else {
- chat "Bisher hast du <def[plValue]> von <def[actionQty]> <def[actionMessage]>."
}
} else if <player.has_flag[daily.done]> {
- chat "Du hast die heutige Aufgabe bereits abgeschlossen."
} else {
- chat "Wie wäre es mit einer Aufgabe ?"
- wait 1
- inject dailyConfig path:npcAskAnswer
}
- flag player engaged.<npc>:!
on chat:
- ^if <player.has_flag[daily.value]>
|| <player.has_flag[daily.done]>
Line with no clear purpose - missing a -dash- or :colon:?
|| <player.has_flag[engaged.npc]> queue clear
Line with no clear purpose - missing a -dash- or :colon:?
- ^determine passively cancelled
- ^flag player engaged.<npc> d:60s
- choose <c.message>:
- case ja:
- chat "Dann mal sehen, was heute ansteht..."
- wait 2
- ^define quest <server.flag[daily.quest]>
- ^define actionQty <s@dailyConfig.yaml_key[<def[quest]>.qty]>
- ^define actionMessage <s@dailyConfig.yaml_key[<def[quest]>.message]>
- chat "Heute müssen <def[actionQty]> <def[actionMessage]> werden."
- wait 1
- ^define bringQty <s@dailyConfig.yaml_key[<def[quest]>.bQty]>
- ^define bringMatName <s@dailyConfig.yaml_key[<def[quest]>.bMatName]>
- chat "Davon müssen mir danach <def[bringQty]> <def[bringMatName]> gebracht werden."
- inject dailyConfig path:npcGotQuest
- flag player daily.value:0
- flag player daily.<def[quest]>
- case nein:
- ^chat "Gut.. wenn du keine Aufgabe haben möchtest..."
- wait 2
- chat "Ich bin hier, falls du es dir anders überlegst."
- default:
- chat "Wie bitte ??"
- flag player engaged.<npc>:!
DailyHandler:
type: world
events:
on server start:
- if !<server.has_flag[daily.start]> {
- flag server daily.start:<server.current_time_millis.div_int[1000]>
}
on player joins:
- if !<server.has_flag[daily.start]> {
- flag server daily.start:<server.current_time_millis.div_int[1000]>
} else if <player.is_op>
&& <server.current_time_millis.div_int[1000].sub[<server.flag[daily.start]>]> > 604800 {
Line with no clear purpose - missing a -dash- or :colon:?
- wait 2
- narrate "<&c>Die kostenlose Test-version von DailyQuest ist abgelaufen."
- narrate "<&c> DailyQuest ist keine Freeware."
- narrate "<&c> Deinstalliere es von deinem Server oder kaufe es unter"
- narrate "<&c> folgendem Link: <&n>http://bit.ly/2J782m5"
}
on system time hourly:
- webget "http://stats.denizenscript.com/tracker?script=144&version=1&players=<server.list_online_players.size>"
on quest command:
- determine passively fulfilled
- choose <c.args.size>:
- case 1:
- if !<player.is_op> queue clear
- choose <c.args.get[1]>:
- case reset:
- narrate "<&a>globalen Quest-Reset ausgelöst."
- inject DailyHandler path:resetQuests
- narrate "<&a>neue Quest: <&7><server.flag[daily.quest]>"
- case reload:
- execute as_player "denizen reload scripts"
- narrate "<&a>Reloaded daily quest settings."
- case spawn:
- inject locally spawnNPC
- case hand:
- narrate "<&a>interner Name itemInHand: <&f><pl.item_in_hand>"
- case install:
- inject locally spawnNPC
- inject DailyHandler path:defineQuest
- narrate "<&a>neue Quest: <&7><server.flag[daily.quest]>"
- case help:
- inject locally cmdSyntax
- case webTest:
- webget "http://stats.denizenscript.com/tracker?script=144&version=1&players=<server.list_online_players.size>"
- narrate "RESULT: <entry[r].result>"
- default:
- inject locally cmdSyntax
- default:
- inject dailyConfig path:cmdHeader
- if <player.has_flag[daily.done]> {
- inject dailyConfig path:cmdDone
} else if <player.has_flag[daily.value]> {
- define ownValue <player.flag[daily.value]>
- define serverQuest <server.flag[daily.quest]||x>
- define serverValue <s@dailyConfig.yaml_key[<def[serverQuest]>.qty]>
- define messageSuffix "<s@dailyConfig.yaml_key[<def[serverQuest]>.message]||UNKOWN abgebaut.>"
- inject dailyConfig path:cmdMessage
} else {
- define serverQuest <server.flag[daily.quest]||x>
- define object "<s@dailyConfig.yaml_key[<def[serverQuest]>.message].before[ ]>"
- inject dailyConfig path:cmdInfo
}
on system time 03:00:
- inject locally resetQuests
on player breaks coal_ore:
- if !<player.has_flag[daily.coal]> queue clear
- inject locally handleAction
on player breaks iron_ore:
- if !<player.has_flag[daily.iron]> queue clear
- inject locally handleAction
on player kills chicken:
- if !<player.has_flag[daily.chicken]> queue clear
- inject locally handleAction
on player kills skeleton:
- if !<player.has_flag[daily.skeleton]> queue clear
- inject locally handleAction
on player kills zombie:
- if !<player.has_flag[daily.zombie]> queue clear
- inject locally handleAction
cmdSyntax:
- narrate "-- Tagesquest Hilfe --"
- narrate "/quest - zeige Status"
- narrate "/quest reset - früzeitiger täglicher Reset"
- narrate "/quest reload - Aktualisiere Config"
- narrate "/quest spawn - spawne Questgeber"
- narrate "/quest hand - zeige intener Name, itemInHand"
- narrate "/quest install - Spawne NPC + neue Quest"
handleAction:
- if <s@dailyConfig.yaml_key[usedWorlds].get[1]> != all
&& !<s@dailyConfig.yaml_key[usedWorlds].contains[<pl.world.name>]> queue clear
Line with no clear purpose - missing a -dash- or :colon:?
- flag player daily.value:++
- define ownValue <player.flag[daily.value]>
- define serverQuest <server.flag[daily.quest]||x>
- define serverValue <s@dailyConfig.yaml_key[<def[serverQuest]>.qty]>
- if <def[ownValue].mod[<s@dailyConfig.yaml_key[notifyDistance]>]> == 0 {
- define messageSuffix "<s@dailyConfig.yaml_key[<def[serverQuest]>.message]||UNKOWN abgebaut.>"
- inject dailyConfig path:notifyMessage
- if <def[ownValue]> >= <def[serverValue]> && !<player.has_flag[daily.goBack]> {
- flag player daily.goBack
- inject dailyConfig path:notifyBack
}
}
resetQuests:
- foreach <server.get_players_flagged[daily.value]> {
- flag <def[value]> daily:!
}
- foreach <server.get_players_flagged[daily.done]> {
- flag <def[value]> daily:!
}
- inject locally defineQuest
defineQuest:
- flag server daily.quest:<s@dailyConfig.yaml_key[usedQuests].exclude[<server.flag[daily.quest]||x>].random>
spawnNPC:
- narrate "<&a>Spawne Questgeber an aktueller Position."
- create player Meister-Baldir <player.location> save:mynpc
- adjust <entry[mynpc].created_npc> skin:Baldyr
- assignment set script:DailyNPC npc:<entry[mynpc].created_npc>