diff --git a/README.md b/README.md index adb7c2e..0d35f9f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ # denizen-scripts +DenizenScript scripts (and data) folders of SakuraFalls. -DenizenScript "scripts" folder of SakuraFalls \ No newline at end of file +# How to use +You should just be able to drag & drop this into your +DenizenScript folder on your server. Enjoy! diff --git a/data/.DS_Store b/data/.DS_Store new file mode 100644 index 0000000..6cb1ce3 Binary files /dev/null and b/data/.DS_Store differ diff --git a/data/phones/.DS_Store b/data/phones/.DS_Store new file mode 100644 index 0000000..30213e1 Binary files /dev/null and b/data/phones/.DS_Store differ diff --git a/data/phones/songs/.DS_Store b/data/phones/songs/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/data/phones/songs/.DS_Store differ diff --git a/data/phones/songs/A DARK ZONE.nbs b/data/phones/songs/A DARK ZONE.nbs new file mode 100644 index 0000000..8dce2f1 Binary files /dev/null and b/data/phones/songs/A DARK ZONE.nbs differ diff --git a/data/phones/songs/ASGORE.nbs b/data/phones/songs/ASGORE.nbs new file mode 100644 index 0000000..ef535f9 Binary files /dev/null and b/data/phones/songs/ASGORE.nbs differ diff --git a/data/phones/songs/Adventure Board.nbs b/data/phones/songs/Adventure Board.nbs new file mode 100644 index 0000000..7c6c4f5 Binary files /dev/null and b/data/phones/songs/Adventure Board.nbs differ diff --git a/data/phones/songs/Africa.nbs b/data/phones/songs/Africa.nbs new file mode 100644 index 0000000..4ed82cb Binary files /dev/null and b/data/phones/songs/Africa.nbs differ diff --git a/data/phones/songs/An Enigmatic Encounter.nbs b/data/phones/songs/An Enigmatic Encounter.nbs new file mode 100644 index 0000000..dffc9d4 Binary files /dev/null and b/data/phones/songs/An Enigmatic Encounter.nbs differ diff --git a/data/phones/songs/Another One Bites the Dust.nbs b/data/phones/songs/Another One Bites the Dust.nbs new file mode 100644 index 0000000..9ed8a62 Binary files /dev/null and b/data/phones/songs/Another One Bites the Dust.nbs differ diff --git a/data/phones/songs/Attack of the Killer Queen.nbs b/data/phones/songs/Attack of the Killer Queen.nbs new file mode 100644 index 0000000..cc75857 Binary files /dev/null and b/data/phones/songs/Attack of the Killer Queen.nbs differ diff --git a/data/phones/songs/Bad Apple.nbs b/data/phones/songs/Bad Apple.nbs new file mode 100644 index 0000000..a85f5ef Binary files /dev/null and b/data/phones/songs/Bad Apple.nbs differ diff --git a/data/phones/songs/Battle! Vs Championship Trainer.nbs b/data/phones/songs/Battle! Vs Championship Trainer.nbs new file mode 100644 index 0000000..7156702 Binary files /dev/null and b/data/phones/songs/Battle! Vs Championship Trainer.nbs differ diff --git a/data/phones/songs/Beware the Forest's Mushrooms.nbs b/data/phones/songs/Beware the Forest's Mushrooms.nbs new file mode 100644 index 0000000..0f1ea5a Binary files /dev/null and b/data/phones/songs/Beware the Forest's Mushrooms.nbs differ diff --git a/data/phones/songs/Big Shot.nbs b/data/phones/songs/Big Shot.nbs new file mode 100644 index 0000000..0488304 Binary files /dev/null and b/data/phones/songs/Big Shot.nbs differ diff --git a/data/phones/songs/Bohemian Rhapsody.nbs b/data/phones/songs/Bohemian Rhapsody.nbs new file mode 100644 index 0000000..83db7f1 Binary files /dev/null and b/data/phones/songs/Bohemian Rhapsody.nbs differ diff --git a/data/phones/songs/Bonetrousle.nbs b/data/phones/songs/Bonetrousle.nbs new file mode 100644 index 0000000..dfe0ee5 Binary files /dev/null and b/data/phones/songs/Bonetrousle.nbs differ diff --git a/data/phones/songs/Bowser's Road.nbs b/data/phones/songs/Bowser's Road.nbs new file mode 100644 index 0000000..77660f9 Binary files /dev/null and b/data/phones/songs/Bowser's Road.nbs differ diff --git a/data/phones/songs/Cyber World?.nbs b/data/phones/songs/Cyber World?.nbs new file mode 100644 index 0000000..e1f4e08 Binary files /dev/null and b/data/phones/songs/Cyber World?.nbs differ diff --git a/data/phones/songs/Death by Glamour.nbs b/data/phones/songs/Death by Glamour.nbs new file mode 100644 index 0000000..3e974cc Binary files /dev/null and b/data/phones/songs/Death by Glamour.nbs differ diff --git a/data/phones/songs/Field of Hopes and Dreams.nbs b/data/phones/songs/Field of Hopes and Dreams.nbs new file mode 100644 index 0000000..4394de1 Binary files /dev/null and b/data/phones/songs/Field of Hopes and Dreams.nbs differ diff --git a/data/phones/songs/Finale.nbs b/data/phones/songs/Finale.nbs new file mode 100644 index 0000000..a02a7db Binary files /dev/null and b/data/phones/songs/Finale.nbs differ diff --git a/data/phones/songs/Flight of The Bumblebee.nbs b/data/phones/songs/Flight of The Bumblebee.nbs new file mode 100644 index 0000000..a8829ca Binary files /dev/null and b/data/phones/songs/Flight of The Bumblebee.nbs differ diff --git a/data/phones/songs/GLACEIR.nbs b/data/phones/songs/GLACEIR.nbs new file mode 100644 index 0000000..bd58bd3 Binary files /dev/null and b/data/phones/songs/GLACEIR.nbs differ diff --git a/data/phones/songs/He's A Pirate.nbs b/data/phones/songs/He's A Pirate.nbs new file mode 100644 index 0000000..47bec5f Binary files /dev/null and b/data/phones/songs/He's A Pirate.nbs differ diff --git a/data/phones/songs/Hotel California.nbs b/data/phones/songs/Hotel California.nbs new file mode 100644 index 0000000..7e8e31a Binary files /dev/null and b/data/phones/songs/Hotel California.nbs differ diff --git a/data/phones/songs/Icirrus City.nbs b/data/phones/songs/Icirrus City.nbs new file mode 100644 index 0000000..25aa728 Binary files /dev/null and b/data/phones/songs/Icirrus City.nbs differ diff --git a/data/phones/songs/It's TV Time!.nbs b/data/phones/songs/It's TV Time!.nbs new file mode 100644 index 0000000..c347235 Binary files /dev/null and b/data/phones/songs/It's TV Time!.nbs differ diff --git a/data/phones/songs/Kirby's Dreamland.nbs b/data/phones/songs/Kirby's Dreamland.nbs new file mode 100644 index 0000000..43984e6 Binary files /dev/null and b/data/phones/songs/Kirby's Dreamland.nbs differ diff --git a/data/phones/songs/Madness.nbs b/data/phones/songs/Madness.nbs new file mode 100644 index 0000000..1442149 Binary files /dev/null and b/data/phones/songs/Madness.nbs differ diff --git a/data/phones/songs/Moonlight Sonata.nbs b/data/phones/songs/Moonlight Sonata.nbs new file mode 100644 index 0000000..a338d7b Binary files /dev/null and b/data/phones/songs/Moonlight Sonata.nbs differ diff --git a/data/phones/songs/Papers Please.nbs b/data/phones/songs/Papers Please.nbs new file mode 100644 index 0000000..aa20516 Binary files /dev/null and b/data/phones/songs/Papers Please.nbs differ diff --git a/data/phones/songs/Pokemon Theme.nbs b/data/phones/songs/Pokemon Theme.nbs new file mode 100644 index 0000000..e4f0e32 Binary files /dev/null and b/data/phones/songs/Pokemon Theme.nbs differ diff --git a/data/phones/songs/Princess of China.nbs b/data/phones/songs/Princess of China.nbs new file mode 100644 index 0000000..8273e79 Binary files /dev/null and b/data/phones/songs/Princess of China.nbs differ diff --git a/data/phones/songs/Rat Dance.nbs b/data/phones/songs/Rat Dance.nbs new file mode 100644 index 0000000..f8e0213 Binary files /dev/null and b/data/phones/songs/Rat Dance.nbs differ diff --git a/data/phones/songs/Ruins.nbs b/data/phones/songs/Ruins.nbs new file mode 100644 index 0000000..e2cb640 Binary files /dev/null and b/data/phones/songs/Ruins.nbs differ diff --git a/data/phones/songs/SMB3 Athletic.nbs b/data/phones/songs/SMB3 Athletic.nbs new file mode 100644 index 0000000..142be77 Binary files /dev/null and b/data/phones/songs/SMB3 Athletic.nbs differ diff --git a/data/phones/songs/Servants of the Scourge.nbs b/data/phones/songs/Servants of the Scourge.nbs new file mode 100644 index 0000000..3c8176e Binary files /dev/null and b/data/phones/songs/Servants of the Scourge.nbs differ diff --git a/data/phones/songs/Slider.nbs b/data/phones/songs/Slider.nbs new file mode 100644 index 0000000..8c1022c Binary files /dev/null and b/data/phones/songs/Slider.nbs differ diff --git a/data/phones/songs/Smells Like Teen Spirit.nbs b/data/phones/songs/Smells Like Teen Spirit.nbs new file mode 100644 index 0000000..3415909 Binary files /dev/null and b/data/phones/songs/Smells Like Teen Spirit.nbs differ diff --git a/data/phones/songs/Stardust Speedway (Past).nbs b/data/phones/songs/Stardust Speedway (Past).nbs new file mode 100644 index 0000000..4206ee5 Binary files /dev/null and b/data/phones/songs/Stardust Speedway (Past).nbs differ diff --git a/data/phones/songs/TV WORLD.nbs b/data/phones/songs/TV WORLD.nbs new file mode 100644 index 0000000..27d4091 Binary files /dev/null and b/data/phones/songs/TV WORLD.nbs differ diff --git a/data/phones/songs/The Entertainer.nbs b/data/phones/songs/The Entertainer.nbs new file mode 100644 index 0000000..221fe98 Binary files /dev/null and b/data/phones/songs/The Entertainer.nbs differ diff --git a/data/phones/songs/Through the Fire and Flames.nbs b/data/phones/songs/Through the Fire and Flames.nbs new file mode 100644 index 0000000..a946fee Binary files /dev/null and b/data/phones/songs/Through the Fire and Flames.nbs differ diff --git a/data/phones/songs/Wii Shop.nbs b/data/phones/songs/Wii Shop.nbs new file mode 100644 index 0000000..58d2cf4 Binary files /dev/null and b/data/phones/songs/Wii Shop.nbs differ diff --git a/data/phones/texts/.DS_Store b/data/phones/texts/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/data/phones/texts/.DS_Store differ diff --git a/data/phones/texts/0014a4d4-3beb-4165-b819-9f2f0fe11bae_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml b/data/phones/texts/0014a4d4-3beb-4165-b819-9f2f0fe11bae_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml new file mode 100644 index 0000000..45d66b7 --- /dev/null +++ b/data/phones/texts/0014a4d4-3beb-4165-b819-9f2f0fe11bae_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml @@ -0,0 +1,7 @@ +messages: + time&at2023&fs12&fs15_21&co43&co12&co0705_Z: + origin: sender + value: its me + time&at2023&fs12&fs15_21&co43&co29&co0255_Z: + origin: receiver + value: try loading the texts to see how fast they load :) diff --git a/data/phones/texts/0014a4d4-3beb-4165-b819-9f2f0fe11bae_b78fb3c7-4d0c-43d6-8959-91904e8e02ab.yml b/data/phones/texts/0014a4d4-3beb-4165-b819-9f2f0fe11bae_b78fb3c7-4d0c-43d6-8959-91904e8e02ab.yml new file mode 100644 index 0000000..7753b83 --- /dev/null +++ b/data/phones/texts/0014a4d4-3beb-4165-b819-9f2f0fe11bae_b78fb3c7-4d0c-43d6-8959-91904e8e02ab.yml @@ -0,0 +1,10 @@ +messages: + time&at2023&fs12&fs15_21&co43&co52&co0505_Z: + origin: sender + value: meow + time&at2023&fs12&fs15_21&co44&co01&co0555_Z: + origin: sender + value: colosalty is ur contact name + time&at2023&fs12&fs15_21&co45&co08&co0454_Z: + origin: receiver + value: your Kyoi in my phone now diff --git a/data/phones/texts/136dd01d-b56c-4f1b-b21b-13e2be636fb0_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml b/data/phones/texts/136dd01d-b56c-4f1b-b21b-13e2be636fb0_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml new file mode 100644 index 0000000..5199d71 --- /dev/null +++ b/data/phones/texts/136dd01d-b56c-4f1b-b21b-13e2be636fb0_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml @@ -0,0 +1,10 @@ +messages: + time&at2024&fs12&fs19_04&co11&co47&co0702_Z: + origin: sender + value: HELLO + time&at2024&fs12&fs19_04&co12&co05&co0252_Z: + origin: receiver + value: sup + time&at2024&fs12&fs19_04&co12&co11&co0502_Z: + origin: receiver + value: can you open your phone and see how fast the messages load? diff --git a/data/phones/texts/366837a1-3777-4484-bcdd-ae1de590dc07_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml b/data/phones/texts/366837a1-3777-4484-bcdd-ae1de590dc07_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml new file mode 100644 index 0000000..3ef39fc --- /dev/null +++ b/data/phones/texts/366837a1-3777-4484-bcdd-ae1de590dc07_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml @@ -0,0 +1,7 @@ +messages: + time&at2024&fs12&fs28_22&co12&co40&co0482_Z: + origin: receiver + value: hello baby + time&at2024&fs12&fs28_22&co13&co23&co0732_Z: + origin: receiver + value: hi diff --git a/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_0014a4d4-3beb-4165-b819-9f2f0fe11bae.yml b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_0014a4d4-3beb-4165-b819-9f2f0fe11bae.yml new file mode 100644 index 0000000..241f24c --- /dev/null +++ b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_0014a4d4-3beb-4165-b819-9f2f0fe11bae.yml @@ -0,0 +1,7 @@ +messages: + time&at2023&fs12&fs15_21&co43&co12&co0755_Z: + origin: receiver + value: its me + time&at2023&fs12&fs15_21&co43&co29&co0155_Z: + origin: sender + value: try loading the texts to see how fast they load :) diff --git a/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_136dd01d-b56c-4f1b-b21b-13e2be636fb0.yml b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_136dd01d-b56c-4f1b-b21b-13e2be636fb0.yml new file mode 100644 index 0000000..ce05657 --- /dev/null +++ b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_136dd01d-b56c-4f1b-b21b-13e2be636fb0.yml @@ -0,0 +1,10 @@ +messages: + time&at2024&fs12&fs19_04&co11&co47&co0802_Z: + origin: receiver + value: HELLO + time&at2024&fs12&fs19_04&co12&co05&co0153_Z: + origin: sender + value: sup + time&at2024&fs12&fs19_04&co12&co11&co0402_Z: + origin: sender + value: can you open your phone and see how fast the messages load? diff --git a/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_366837a1-3777-4484-bcdd-ae1de590dc07.yml b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_366837a1-3777-4484-bcdd-ae1de590dc07.yml new file mode 100644 index 0000000..6dfed2e --- /dev/null +++ b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_366837a1-3777-4484-bcdd-ae1de590dc07.yml @@ -0,0 +1,7 @@ +messages: + time&at2024&fs12&fs28_22&co12&co40&co0432_Z: + origin: sender + value: hello baby + time&at2024&fs12&fs28_22&co13&co23&co0682_Z: + origin: sender + value: hi diff --git a/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml new file mode 100644 index 0000000..27bd924 --- /dev/null +++ b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml @@ -0,0 +1,28 @@ +messages: + time&at2023&fs05&fs23_05&co29&co47&co0781_+03&co00: + origin: sender + value: so anyway + time&at2023&fs05&fs23_05&co29&co47&co0840_+03&co00: + origin: receiver + value: yeah whats up + time&at2023&fs05&fs23_05&co29&co49&co0785_+03&co00: + origin: sender + value: hru bubba + time&at2023&fs05&fs23_05&co29&co49&co0881_+03&co00: + origin: receiver + value: im good hru? u seemed sad today + time&at2023&fs05&fs23_05&co32&co54&co0228_+03&co00: + origin: sender + value: yea but as you can imagine, it kinda sucked + time&at2023&fs05&fs23_05&co32&co54&co0328_+03&co00: + origin: receiver + value: ah i see + time&at2023&fs05&fs23_05&co33&co02&co0678_+03&co00: + origin: sender + value: i don't even wanna mention it. + time&at2023&fs05&fs23_05&co33&co02&co0778_+03&co00: + origin: receiver + value: mkay + time&at2023&fs05&fs23_05&co46&co07&co0279_+03&co00: + origin: receiver + value: why are u ignoring me... diff --git a/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_678a58f0-d9e1-4349-9e40-1b7bb01f7da4.yml b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_678a58f0-d9e1-4349-9e40-1b7bb01f7da4.yml new file mode 100644 index 0000000..34211d6 --- /dev/null +++ b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_678a58f0-d9e1-4349-9e40-1b7bb01f7da4.yml @@ -0,0 +1,4 @@ +messages: + time&at2024&fs06&fs26_22&co03&co58&co0493_Z: + origin: sender + value: hello habibi <333 diff --git a/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_9975efa7-ba0c-42fb-ac32-97af181e6495.yml b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_9975efa7-ba0c-42fb-ac32-97af181e6495.yml new file mode 100644 index 0000000..295dbbc --- /dev/null +++ b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_9975efa7-ba0c-42fb-ac32-97af181e6495.yml @@ -0,0 +1,37 @@ +messages: + time&at2023&fs12&fs16_18&co44&co32&co0949_Z: + origin: sender + value: '*cums in his ass 6 times* AWWW BABY YOUR ASS IS SO GOOD WTFFFF' + time&at2023&fs12&fs16_18&co46&co28&co0449_Z: + origin: receiver + value: dicks + time&at2023&fs12&fs16_18&co47&co27&co0299_Z: + origin: receiver + value: dicks + time&at2023&fs12&fs16_18&co47&co27&co0749_Z: + origin: receiver + value: dicks + time&at2023&fs12&fs16_18&co47&co28&co0099_Z: + origin: receiver + value: dicks + time&at2023&fs12&fs16_18&co47&co30&co0549_Z: + origin: receiver + value: dicks + time&at2023&fs12&fs16_18&co47&co30&co0899_Z: + origin: receiver + value: dicks + time&at2023&fs12&fs16_18&co47&co31&co0249_Z: + origin: receiver + value: dicks + time&at2023&fs12&fs16_18&co47&co31&co0648_Z: + origin: receiver + value: dicks + time&at2023&fs12&fs16_18&co47&co31&co0999_Z: + origin: receiver + value: dicks + time&at2023&fs12&fs16_18&co50&co38&co0999_Z: + origin: sender + value: better? + time&at2023&fs12&fs16_18&co50&co47&co0549_Z: + origin: sender + value: test diff --git a/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_b421a0ff-8813-450b-935b-253273d60860.yml b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_b421a0ff-8813-450b-935b-253273d60860.yml new file mode 100644 index 0000000..ca7f1a8 --- /dev/null +++ b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_b421a0ff-8813-450b-935b-253273d60860.yml @@ -0,0 +1,31 @@ +messages: + time&at2025&fs03&fs10_16&co06&co23&co0654_Z: + origin: receiver + value: Test + time&at2025&fs03&fs10_16&co06&co24&co0004_Z: + origin: receiver + value: Test + time&at2025&fs03&fs10_16&co06&co24&co0254_Z: + origin: receiver + value: Test + time&at2025&fs03&fs10_16&co07&co22&co0003_Z: + origin: sender + value: hello + time&at2025&fs03&fs10_16&co07&co29&co0053_Z: + origin: receiver + value: Test + time&at2025&fs03&fs10_16&co07&co29&co0254_Z: + origin: receiver + value: Test + time&at2025&fs03&fs10_16&co07&co29&co0453_Z: + origin: receiver + value: Test + time&at2025&fs03&fs10_16&co07&co29&co0653_Z: + origin: receiver + value: Test + time&at2025&fs03&fs10_16&co07&co34&co0410_Z: + origin: receiver + value: Test + time&at2025&fs03&fs10_16&co07&co35&co0253_Z: + origin: receiver + value: Test diff --git a/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_b6de9919-dbb6-41ba-ae60-42dc9607c9ab.yml b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_b6de9919-dbb6-41ba-ae60-42dc9607c9ab.yml new file mode 100644 index 0000000..bd4341a --- /dev/null +++ b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_b6de9919-dbb6-41ba-ae60-42dc9607c9ab.yml @@ -0,0 +1,23 @@ +messages: + time&at2023&fs12&fs02_02&co08&co02&co0017_Z: + origin: sender + value: Oh, really? Go load this conversation. See how fast it is. + time&at2023&fs12&fs02_02&co08&co16&co0267_Z: + origin: sender + value: It's in your phone - right click it. + time&at2023&fs12&fs02_02&co09&co03&co0316_Z: + origin: sender + value: oh hey, it's instant + time&at2023&fs12&fs02_02&co09&co14&co0067_Z: + origin: sender + value: /ac 3772221480 dar + time&at2023&fs12&fs02_02&co09&co16&co0567_Z: + origin: sender + value: or something.. + time&at2023&fs12&fs02_02&co09&co28&co0817_Z: + origin: sender + value: maybe change your ringtone, too. + time&at2023&fs12&fs02_02&co16&co09&co0316_Z: + origin: sender + value: Hey, we have more text messages by now. Try loading them, they should surely + be slower to load now, right????????? diff --git a/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_b6fd1de5-b171-4dc8-9ffd-b8daed7683b7.yml b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_b6fd1de5-b171-4dc8-9ffd-b8daed7683b7.yml new file mode 100644 index 0000000..bf84b71 --- /dev/null +++ b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_b6fd1de5-b171-4dc8-9ffd-b8daed7683b7.yml @@ -0,0 +1,5 @@ +messages: + time&at2024&fs12&fs12_01&co55&co59&co0229_Z: + origin: sender + value: Hey, this is a text message. This won't call you, it'll just send it as + is diff --git a/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_b78fb3c7-4d0c-43d6-8959-91904e8e02ab.yml b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_b78fb3c7-4d0c-43d6-8959-91904e8e02ab.yml new file mode 100644 index 0000000..754bd72 --- /dev/null +++ b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_b78fb3c7-4d0c-43d6-8959-91904e8e02ab.yml @@ -0,0 +1,16 @@ +messages: + time&at2023&fs12&fs11_18&co11&co36&co0205_Z: + origin: sender + value: hi + time&at2023&fs12&fs15_21&co32&co32&co0155_Z: + origin: receiver + value: '>:)' + time&at2023&fs12&fs15_21&co34&co27&co0305_Z: + origin: receiver + value: chicken nugget + time&at2023&fs12&fs19_18&co46&co15&co0228_Z: + origin: sender + value: hallo kkrneger + time&at2024&fs07&fs01_17&co05&co11&co0246_Z: + origin: receiver + value: Potato diff --git a/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_b98fac04-bd68-4fcc-beea-3329c5889538.yml b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_b98fac04-bd68-4fcc-beea-3329c5889538.yml new file mode 100644 index 0000000..ed2751a --- /dev/null +++ b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_b98fac04-bd68-4fcc-beea-3329c5889538.yml @@ -0,0 +1,25 @@ +messages: + time&at2024&fs04&fs21_23&co52&co29&co0273_Z: + origin: receiver + value: test + time&at2024&fs04&fs21_23&co53&co02&co0773_Z: + origin: sender + value: nice + time&at2024&fs12&fs17_00&co28&co45&co0662_Z: + origin: sender + value: Sup + time&at2024&fs12&fs17_00&co28&co48&co0712_Z: + origin: receiver + value: meow + time&at2024&fs12&fs17_00&co28&co51&co0562_Z: + origin: sender + value: so, check how fast the messages load + time&at2024&fs12&fs17_00&co28&co55&co0762_Z: + origin: receiver + value: rare + time&at2024&fs12&fs17_00&co29&co12&co0512_Z: + origin: sender + value: open the phone & click on our conversation + time&at2024&fs12&fs17_00&co29&co16&co0464_Z: + origin: sender + value: you'll see it's p much instant diff --git a/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_c59ee3a6-a066-4de4-bd0e-d22db1b6d818.yml b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_c59ee3a6-a066-4de4-bd0e-d22db1b6d818.yml new file mode 100644 index 0000000..8988bcb --- /dev/null +++ b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_c59ee3a6-a066-4de4-bd0e-d22db1b6d818.yml @@ -0,0 +1,13 @@ +messages: + time&at2025&fs07&fs28_21&co23&co36&co0695_Z: + origin: sender + value: Hello + time&at2025&fs07&fs28_21&co23&co50&co0947_Z: + origin: sender + value: How are you + time&at2025&fs07&fs28_21&co57&co26&co0645_Z: + origin: sender + value: pupici + time&at2025&fs07&fs28_21&co58&co02&co0745_Z: + origin: receiver + value: pupicei diff --git a/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_c619da4e-a039-4567-8bef-8f0119b86d17.yml b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_c619da4e-a039-4567-8bef-8f0119b86d17.yml new file mode 100644 index 0000000..6e8cb0d --- /dev/null +++ b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_c619da4e-a039-4567-8bef-8f0119b86d17.yml @@ -0,0 +1,7 @@ +messages: + time&at2024&fs04&fs21_02&co45&co39&co0245_Z: + origin: sender + value: sup + time&at2024&fs04&fs21_02&co45&co43&co0245_Z: + origin: receiver + value: sup diff --git a/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_f6042456-6429-4a18-bcf1-7b2bbd83b650.yml b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_f6042456-6429-4a18-bcf1-7b2bbd83b650.yml new file mode 100644 index 0000000..f681ff3 --- /dev/null +++ b/data/phones/texts/607ddcbd-36a0-4575-99d4-f6bf45670c81_f6042456-6429-4a18-bcf1-7b2bbd83b650.yml @@ -0,0 +1,10 @@ +messages: + time&at2024&fs09&fs07_14&co45&co32&co0035_Z: + origin: sender + value: hi girl + time&at2024&fs09&fs07_14&co48&co11&co0988_Z: + origin: sender + value: Hi + time&at2024&fs09&fs07_14&co48&co19&co0285_Z: + origin: sender + value: Hi diff --git a/data/phones/texts/678a58f0-d9e1-4349-9e40-1b7bb01f7da4_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml b/data/phones/texts/678a58f0-d9e1-4349-9e40-1b7bb01f7da4_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml new file mode 100644 index 0000000..80df361 --- /dev/null +++ b/data/phones/texts/678a58f0-d9e1-4349-9e40-1b7bb01f7da4_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml @@ -0,0 +1,4 @@ +messages: + time&at2024&fs06&fs26_22&co03&co58&co0593_Z: + origin: receiver + value: hello habibi <333 diff --git a/data/phones/texts/9975efa7-ba0c-42fb-ac32-97af181e6495_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml b/data/phones/texts/9975efa7-ba0c-42fb-ac32-97af181e6495_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml new file mode 100644 index 0000000..291e1b6 --- /dev/null +++ b/data/phones/texts/9975efa7-ba0c-42fb-ac32-97af181e6495_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml @@ -0,0 +1,37 @@ +messages: + time&at2023&fs12&fs16_18&co44&co32&co0999_Z: + origin: receiver + value: '*cums in his ass 6 times* AWWW BABY YOUR ASS IS SO GOOD WTFFFF' + time&at2023&fs12&fs16_18&co46&co28&co0349_Z: + origin: sender + value: dicks + time&at2023&fs12&fs16_18&co47&co27&co0199_Z: + origin: sender + value: dicks + time&at2023&fs12&fs16_18&co47&co27&co0649_Z: + origin: sender + value: dicks + time&at2023&fs12&fs16_18&co47&co27&co0999_Z: + origin: sender + value: dicks + time&at2023&fs12&fs16_18&co47&co30&co0449_Z: + origin: sender + value: dicks + time&at2023&fs12&fs16_18&co47&co30&co0799_Z: + origin: sender + value: dicks + time&at2023&fs12&fs16_18&co47&co31&co0148_Z: + origin: sender + value: dicks + time&at2023&fs12&fs16_18&co47&co31&co0549_Z: + origin: sender + value: dicks + time&at2023&fs12&fs16_18&co47&co31&co0903_Z: + origin: sender + value: dicks + time&at2023&fs12&fs16_18&co50&co39&co0098_Z: + origin: receiver + value: better? + time&at2023&fs12&fs16_18&co50&co47&co0648_Z: + origin: receiver + value: test diff --git a/data/phones/texts/b421a0ff-8813-450b-935b-253273d60860_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml b/data/phones/texts/b421a0ff-8813-450b-935b-253273d60860_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml new file mode 100644 index 0000000..0faa228 --- /dev/null +++ b/data/phones/texts/b421a0ff-8813-450b-935b-253273d60860_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml @@ -0,0 +1,31 @@ +messages: + time&at2025&fs03&fs10_16&co06&co23&co0603_Z: + origin: sender + value: Test + time&at2025&fs03&fs10_16&co06&co23&co0953_Z: + origin: sender + value: Test + time&at2025&fs03&fs10_16&co06&co24&co0204_Z: + origin: sender + value: Test + time&at2025&fs03&fs10_16&co07&co22&co0053_Z: + origin: receiver + value: hello + time&at2025&fs03&fs10_16&co07&co28&co0954_Z: + origin: sender + value: Test + time&at2025&fs03&fs10_16&co07&co29&co0153_Z: + origin: sender + value: Test + time&at2025&fs03&fs10_16&co07&co29&co0353_Z: + origin: sender + value: Test + time&at2025&fs03&fs10_16&co07&co29&co0603_Z: + origin: sender + value: Test + time&at2025&fs03&fs10_16&co07&co34&co0398_Z: + origin: sender + value: Test + time&at2025&fs03&fs10_16&co07&co35&co0153_Z: + origin: sender + value: Test diff --git a/data/phones/texts/b6de9919-dbb6-41ba-ae60-42dc9607c9ab_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml b/data/phones/texts/b6de9919-dbb6-41ba-ae60-42dc9607c9ab_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml new file mode 100644 index 0000000..906e057 --- /dev/null +++ b/data/phones/texts/b6de9919-dbb6-41ba-ae60-42dc9607c9ab_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml @@ -0,0 +1,23 @@ +messages: + time&at2023&fs12&fs02_02&co08&co02&co0117_Z: + origin: receiver + value: Oh, really? Go load this conversation. See how fast it is. + time&at2023&fs12&fs02_02&co08&co16&co0367_Z: + origin: receiver + value: It's in your phone - right click it. + time&at2023&fs12&fs02_02&co09&co03&co0417_Z: + origin: receiver + value: oh hey, it's instant + time&at2023&fs12&fs02_02&co09&co14&co0167_Z: + origin: receiver + value: /ac 3772221480 dar + time&at2023&fs12&fs02_02&co09&co16&co0667_Z: + origin: receiver + value: or something.. + time&at2023&fs12&fs02_02&co09&co28&co0917_Z: + origin: receiver + value: maybe change your ringtone, too. + time&at2023&fs12&fs02_02&co16&co09&co0417_Z: + origin: receiver + value: Hey, we have more text messages by now. Try loading them, they should surely + be slower to load now, right????????? diff --git a/data/phones/texts/b6fd1de5-b171-4dc8-9ffd-b8daed7683b7_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml b/data/phones/texts/b6fd1de5-b171-4dc8-9ffd-b8daed7683b7_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml new file mode 100644 index 0000000..83d5c99 --- /dev/null +++ b/data/phones/texts/b6fd1de5-b171-4dc8-9ffd-b8daed7683b7_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml @@ -0,0 +1,5 @@ +messages: + time&at2024&fs12&fs12_01&co55&co59&co0329_Z: + origin: receiver + value: Hey, this is a text message. This won't call you, it'll just send it as + is diff --git a/data/phones/texts/b78fb3c7-4d0c-43d6-8959-91904e8e02ab_0014a4d4-3beb-4165-b819-9f2f0fe11bae.yml b/data/phones/texts/b78fb3c7-4d0c-43d6-8959-91904e8e02ab_0014a4d4-3beb-4165-b819-9f2f0fe11bae.yml new file mode 100644 index 0000000..91dd4ea --- /dev/null +++ b/data/phones/texts/b78fb3c7-4d0c-43d6-8959-91904e8e02ab_0014a4d4-3beb-4165-b819-9f2f0fe11bae.yml @@ -0,0 +1,10 @@ +messages: + time&at2023&fs12&fs15_21&co43&co52&co0555_Z: + origin: receiver + value: meow + time&at2023&fs12&fs15_21&co44&co01&co0655_Z: + origin: receiver + value: colosalty is ur contact name + time&at2023&fs12&fs15_21&co45&co08&co0355_Z: + origin: sender + value: your Kyoi in my phone now diff --git a/data/phones/texts/b78fb3c7-4d0c-43d6-8959-91904e8e02ab_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml b/data/phones/texts/b78fb3c7-4d0c-43d6-8959-91904e8e02ab_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml new file mode 100644 index 0000000..67df456 --- /dev/null +++ b/data/phones/texts/b78fb3c7-4d0c-43d6-8959-91904e8e02ab_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml @@ -0,0 +1,16 @@ +messages: + time&at2023&fs12&fs11_18&co11&co36&co0255_Z: + origin: receiver + value: hi + time&at2023&fs12&fs15_21&co32&co32&co0055_Z: + origin: sender + value: '>:)' + time&at2023&fs12&fs15_21&co34&co27&co0205_Z: + origin: sender + value: chicken nugget + time&at2023&fs12&fs19_18&co46&co15&co0327_Z: + origin: receiver + value: hallo kkrneger + time&at2024&fs07&fs01_17&co05&co11&co0147_Z: + origin: sender + value: Potato diff --git a/data/phones/texts/b98fac04-bd68-4fcc-beea-3329c5889538_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml b/data/phones/texts/b98fac04-bd68-4fcc-beea-3329c5889538_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml new file mode 100644 index 0000000..8304a44 --- /dev/null +++ b/data/phones/texts/b98fac04-bd68-4fcc-beea-3329c5889538_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml @@ -0,0 +1,25 @@ +messages: + time&at2024&fs04&fs21_23&co52&co29&co0223_Z: + origin: sender + value: test + time&at2024&fs04&fs21_23&co53&co02&co0873_Z: + origin: receiver + value: nice + time&at2024&fs12&fs17_00&co28&co45&co0762_Z: + origin: receiver + value: Sup + time&at2024&fs12&fs17_00&co28&co48&co0613_Z: + origin: sender + value: meow + time&at2024&fs12&fs17_00&co28&co51&co0662_Z: + origin: receiver + value: so, check how fast the messages load + time&at2024&fs12&fs17_00&co28&co55&co0662_Z: + origin: sender + value: rare + time&at2024&fs12&fs17_00&co29&co12&co0612_Z: + origin: receiver + value: open the phone & click on our conversation + time&at2024&fs12&fs17_00&co29&co16&co0512_Z: + origin: receiver + value: you'll see it's p much instant diff --git a/data/phones/texts/c59ee3a6-a066-4de4-bd0e-d22db1b6d818_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml b/data/phones/texts/c59ee3a6-a066-4de4-bd0e-d22db1b6d818_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml new file mode 100644 index 0000000..b8086ec --- /dev/null +++ b/data/phones/texts/c59ee3a6-a066-4de4-bd0e-d22db1b6d818_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml @@ -0,0 +1,13 @@ +messages: + time&at2025&fs07&fs28_21&co23&co36&co0745_Z: + origin: receiver + value: Hello + time&at2025&fs07&fs28_21&co23&co51&co0045_Z: + origin: receiver + value: How are you + time&at2025&fs07&fs28_21&co57&co26&co0745_Z: + origin: receiver + value: pupici + time&at2025&fs07&fs28_21&co58&co02&co0645_Z: + origin: sender + value: pupicei diff --git a/data/phones/texts/c619da4e-a039-4567-8bef-8f0119b86d17_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml b/data/phones/texts/c619da4e-a039-4567-8bef-8f0119b86d17_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml new file mode 100644 index 0000000..3437e5e --- /dev/null +++ b/data/phones/texts/c619da4e-a039-4567-8bef-8f0119b86d17_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml @@ -0,0 +1,7 @@ +messages: + time&at2024&fs04&fs21_02&co45&co39&co0295_Z: + origin: receiver + value: sup + time&at2024&fs04&fs21_02&co45&co43&co0145_Z: + origin: sender + value: sup diff --git a/data/phones/texts/c619da4e-a039-4567-8bef-8f0119b86d17_f5e06a85-c689-4bcb-9b77-cb1ac5cc0133.yml b/data/phones/texts/c619da4e-a039-4567-8bef-8f0119b86d17_f5e06a85-c689-4bcb-9b77-cb1ac5cc0133.yml new file mode 100644 index 0000000..b47ce49 --- /dev/null +++ b/data/phones/texts/c619da4e-a039-4567-8bef-8f0119b86d17_f5e06a85-c689-4bcb-9b77-cb1ac5cc0133.yml @@ -0,0 +1,4 @@ +messages: + time&at2024&fs04&fs21_03&co21&co08&co0895_Z: + origin: receiver + value: What the flip flop diff --git a/data/phones/texts/f5e06a85-c689-4bcb-9b77-cb1ac5cc0133_c619da4e-a039-4567-8bef-8f0119b86d17.yml b/data/phones/texts/f5e06a85-c689-4bcb-9b77-cb1ac5cc0133_c619da4e-a039-4567-8bef-8f0119b86d17.yml new file mode 100644 index 0000000..2995f0f --- /dev/null +++ b/data/phones/texts/f5e06a85-c689-4bcb-9b77-cb1ac5cc0133_c619da4e-a039-4567-8bef-8f0119b86d17.yml @@ -0,0 +1,4 @@ +messages: + time&at2024&fs04&fs21_03&co21&co08&co0845_Z: + origin: sender + value: What the flip flop diff --git a/data/phones/texts/f6042456-6429-4a18-bcf1-7b2bbd83b650_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml b/data/phones/texts/f6042456-6429-4a18-bcf1-7b2bbd83b650_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml new file mode 100644 index 0000000..b082601 --- /dev/null +++ b/data/phones/texts/f6042456-6429-4a18-bcf1-7b2bbd83b650_607ddcbd-36a0-4575-99d4-f6bf45670c81.yml @@ -0,0 +1,10 @@ +messages: + time&at2024&fs09&fs07_14&co45&co32&co0085_Z: + origin: receiver + value: hi girl + time&at2024&fs09&fs07_14&co48&co12&co0085_Z: + origin: receiver + value: Hi + time&at2024&fs09&fs07_14&co48&co19&co0385_Z: + origin: receiver + value: Hi diff --git a/scripts/.DS_Store b/scripts/.DS_Store new file mode 100644 index 0000000..6d43443 Binary files /dev/null and b/scripts/.DS_Store differ diff --git a/scripts/animations/animations_commands.dsc b/scripts/animations/animations_commands.dsc new file mode 100644 index 0000000..609fd24 --- /dev/null +++ b/scripts/animations/animations_commands.dsc @@ -0,0 +1,80 @@ +animations_command_animationmode: + debug: false + type: command + name: animationmode + description: Animate your hands in a certain direction. + usage: /animationmode + aliases: + - am + permission: animations.command.animationmode + tab completions: + 1: + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if != air: + - narrate "<&c>You must run this command with an empty hand." + - stop + - define arrow + - adjust def:arrow custom_model_data:1 + - adjust def:arrow display:<&f> + - flag <[arrow]> animations:true + - if !]>: + - narrate "<&c>Your inventory is too full. You must have one empty slot in your inventory!" + - stop + - define bow + - adjust def:bow "display:<&f>Hold right-click to Animate" + - adjust def:bow custom_model_data:1 + - flag <[bow]> animations:true + - inventory set slot:hand origin:<[bow]> + - give <[arrow]> + - narrate format:formats_prefix "Hold right-click to animate your hands!" + +animations_command_raisehand: + debug: false + type: command + name: raisehand + description: Animate your hand so it looks like you're raising it. + usage: /raisehand + aliases: + - rh + permission: animations.command.raisehand + tab completions: + 1: + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if != air: + - narrate "<&c>You must run this command with an empty hand." + - stop + - define trident + - adjust def:trident custom_model_data:1 + - adjust def:trident "display:<&f>Hold right-click to Raise Hand" + - flag <[trident]> animations:true + - inventory set slot:hand origin:<[trident]> + - narrate format:formats_prefix "Hold right-click to raise your hand!" + +animations_command_handshake: + debug: false + type: command + name: handshake + description: Animate your hand so it looks like you're handshaking. + usage: /handshake + permission: animations.command.handshake + tab completions: + 1: + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if != air: + - narrate "<&c>You must run this command with an empty hand." + - stop + - define shield + - adjust def:shield custom_model_data:1 + - adjust def:shield "display:<&f>Hold right-click to Handshake" + - flag <[shield]> animations:true + - inventory set slot:hand origin:<[shield]> + - narrate format:formats_prefix "Hold right-click to handshake!" diff --git a/scripts/animations/animations_world.dsc b/scripts/animations/animations_world.dsc new file mode 100644 index 0000000..feda8fd --- /dev/null +++ b/scripts/animations/animations_world.dsc @@ -0,0 +1,34 @@ +animations_world: + debug: false + type: world + events: + # common + on player joins: + - foreach key:slot as:item: + - if <[item].has_flag[animations]>: + - inventory set slot:<[slot]> origin:air + on player scrolls their hotbar: + - if : + - take flagged:animations quantity:255 + on player clicks item in inventory: + - if : + - determine cancelled passively + - inventory set slot:hand origin:air + - inventory update + on player drops item: + - if : + - remove + # animationmode + on player shoots bow: + - if : + - determine cancelled passively + - take flagged:animations quantity:255 + # raisehand + on trident launched: + - if : + - determine cancelled passively + - take flagged:animations quantity:255 player: + # shield + on player lowers item: + - if : + - take flagged:animations quantity:255 diff --git a/scripts/announcers/announcers_commands.dsc b/scripts/announcers/announcers_commands.dsc new file mode 100644 index 0000000..5155b3e --- /dev/null +++ b/scripts/announcers/announcers_commands.dsc @@ -0,0 +1,57 @@ +announcers_command_intercom: + debug: false + type: command + name: intercom + description: Broadcast a message through the intercom. + usage: /intercom (message) + permission: announcers.command.intercom + tab completions: + 1: <<>message<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 0: + - narrate "<&c>Please enter a message!" + - stop + - define message + - announce "<&6>[<&c><&l>INTERCOM<&6>] <&7><&o>() <&f>]> says <&dq><[message]><&dq>" + +announcers_command_collegeintercom: + debug: false + type: command + name: collegeintercom + description: Broadcast a message through the college intercom. + usage: /collegeintercom (message) + permission: announcers.command.collegeintercom + tab completions: + 1: <<>message<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 0: + - narrate "<&c>Please enter a message!" + - stop + - define message + - define recipients ]> + - narrate targets:<[recipients]> "<&6>[<&c><&l>COLLEGE INTERCOM<&6>] <&7><&o>() <&f>]> says <&dq><[message]><&dq>" + +announcers_command_advert: + debug: false + type: command + name: advert + description: Broadcast a message for your shop. + usage: /advert (message) + permission: announcers.command.advert + tab completions: + 1: <<>message<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 0: + - narrate "<&c>Please enter a message!" + - stop + - define message + - announce "<&6>[<&2>Advert<&6>]<&f>: <&7><&o>() <&f>]> - <[message]>" diff --git a/scripts/apartments/apartments_commands.dsc b/scripts/apartments/apartments_commands.dsc new file mode 100644 index 0000000..177f313 --- /dev/null +++ b/scripts/apartments/apartments_commands.dsc @@ -0,0 +1,147 @@ +apartments_command_apartmentaddmember: + debug: false + type: command + name: apartmentaddmember + description: Add a member to the apartment you are currently in. + usage: /apartmentaddmember (player) + aliases: + - aptaddmember + - aptam + permission: apartments.command.apartmentaddmember + tab completions: + 1: + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - define apartment ]> + - if <[apartment]> == null: + - narrate "<&c>You can only use this command inside apartments." + - stop + - define owner ]> + - if != <[owner]>: + - narrate "<&c>You do not own this apartment!" + - stop + - if <= 0: + - narrate "<&c>Invalid use. Please try / (player)" + - stop + - define target ].if_null[null]> + - if <[target]> == null: + - narrate "<&c>A player with the username could not be found." + - stop + - if <[target]> == : + - narrate "<&c>You cannot add yourself as a member!" + - stop + - run apartments_add_member def.apartment:<[apartment]> def.member:<[target]> + - narrate format:formats_prefix "<&a>Added <&7><[target].name> to your apartment (<&b>member<&7>)." + +apartments_command_apartmentaddmoderator: + debug: false + type: command + name: apartmentaddmoderator + description: Adds a moderator to the apartment you are currently in. + usage: /apartmentaddmoderator (player) + aliases: + - aptaddmod + permission: apartments.command.apartmentaddmod + tab completions: + 1: + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - define apartment ]> + - if <[apartment]> == null: + - narrate "<&c>You can only use this command inside apartments." + - stop + - define owner ]> + - if != <[owner]>: + - narrate "<&c>You do not own this apartment!" + - stop + - if <= 0: + - narrate "<&c>Invalid use. Please try / (player)" + - stop + - define target ].if_null[null]> + - if <[target]> == null: + - narrate "<&c>A player with the username could not be found." + - stop + - if <[target]> == : + - narrate "<&c>You cannot add yourself as a moderator!" + - stop + - run apartments_add_moderator def.apartment:<[apartment]> def.moderator:<[target]> + - narrate format:formats_prefix "<&a>Added <&7><[target].name> to your apartment (<&6>moderator<&7>)." + +apartments_command_apartmentremoveaccess: + debug: false + type: command + name: apartmentremoveaccess + description: Removes all access for a player from the apartment you are currently in. + usage: /apartmentremoveaccess (player) + aliases: + - aptremoveaccess + - aptrm + permission: apartments.command.apartmentremoveaccess + tab completions: + # TODO: use the procedural tab-complete to handle this correctly! + 1: + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - define apartment ]> + - if <[apartment]> == null: + - narrate "<&c>You can only use this command inside apartments." + - stop + - define owner ]> + - if != <[owner]>: + - narrate "<&c>You do not own this apartment!" + - stop + - if <= 0: + - narrate "<&c>Invalid use. Please try / (player)" + - stop + - define target ].if_null[null]> + - if <[target]> == null: + - narrate "<&c>A player with the username could not be found." + - stop + - if <[target]> == : + - narrate "<&c>You cannot remove your own access!" + - stop + - if <[target].location.in_region[<[apartment].id>]>: + - run apartments_end_edit def.player:<[target]> + - run apartments_remove_access def.apartment:<[apartment]> def.member:<[target]> + - narrate format:formats_prefix "<&c>Removed <&7>member <[target].name> from your apartment." + +apartments_command_apartmenteditmode: + debug: false + type: command + name: apartmenteditmode + description: Toggle edit mode for the apartment you are currently in. + usage: /apartmenteditmode + aliases: + - apteditmode + - editmode + permission: apartments.command.apartmenteditmode + tab completions: + 1: + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + # toggle off + - if : + - run apartments_end_edit def.player: + - narrate format:formats_prefix "<&e>Exiting <&6>Edit Mode..." + - stop + # toggle on + - define apartment ]> + - if <[apartment]> == null: + - narrate "<&c>You can only use this command inside apartments." + - stop + - define owner ]> + - if != <[owner]>: + - define access_level |]> + - if <[access_level]> != moderator: + - narrate "<&c>You must own this apartment or be an apartment moderator to enable editing here!" + - stop + - run apartments_begin_edit def.apartment:<[apartment]> def.player: + - narrate format:formats_prefix "<&a>Entering <&6>Edit Mode..." diff --git a/scripts/apartments/apartments_tasks.dsc b/scripts/apartments/apartments_tasks.dsc new file mode 100644 index 0000000..96a2e39 --- /dev/null +++ b/scripts/apartments/apartments_tasks.dsc @@ -0,0 +1,111 @@ +apartments_at: + debug: false + type: procedure + definitions: location + script: + - determine <[location].regions.filter_tag[<[filter_value].id.starts_with[apt-]>].get[1].if_null[null]> + +apartments_owner: + debug: false + type: procedure + definitions: apartment + script: + - determine <[apartment].owners.get[1].if_null[null]> + +apartments_access: + debug: false + type: procedure + definitions: player|location + script: + - define apartment ]> + - if <[apartment]> == null: + - determine true + - define owner ]> + - if <[owner]> == null: + - determine false + - if <[owner]> == <[player]>: + - determine true + - define access <[owner].flag[apartments_access].get[<[apartment]>].get[<[player]>].if_null[null]> + - if <[access]> == null: + - determine false + - determine true + +apartments_access_level: + debug: false + type: procedure + definitions: player|location + script: + - define apartment ]> + - if <[apartment]> == null: + - determine null + - define owner ]> + - if <[owner]> == null: + - determine none + - if <[owner]> == <[player]>: + - determine owner + - define access <[owner].flag[apartments_access].get[<[apartment]>].get[<[player]>].if_null[null]> + - if <[access]> == null: + - determine none + - determine <[access]> + +apartments_add_member: + debug: false + type: task + definitions: apartment|member + script: + - define owner ]> + - if <[owner]> == null: + - stop + - define access_all <[owner].flag[apartments_access].get[<[apartment]>].if_null[].with[<[member]>].as[member]> + - flag <[owner]> apartments_access:<[owner].flag[apartments_access].if_null[].with[<[apartment]>].as[<[access_all]>]> + - execute as_server "as addfriend <[member].name> <[apartment].id>" + +apartments_add_moderator: + debug: false + type: task + definitions: apartment|moderator + script: + - define owner ]> + - if <[owner]> == null: + - stop + - execute as_server "rg addmember <[apartment].id> <[moderator].name> -w <[apartment].world.name>" + - define access_all <[owner].flag[apartments_access].get[<[apartment]>].if_null[].with[<[moderator]>].as[moderator]> + - flag <[owner]> apartments_access:<[owner].flag[apartments_access].if_null[].with[<[apartment]>].as[<[access_all]>]> + - execute as_server "as addfriend <[moderator].name> <[apartment].id>" + +apartments_remove_access: + debug: false + type: task + definitions: apartment|member + script: + - define owner ]> + - if <[owner]> == null: + - stop + - execute as_server "rg removemember <[apartment].id> <[member].name> -w <[apartment].world.name>" + - define access_all <[owner].flag[apartments_access].get[<[apartment]>].if_null[].exclude[<[member]>]> + - flag <[owner]> apartments_access:<[owner].flag[apartments_access].if_null[].with[<[apartment]>].as[<[access_all]>]> + - execute as_server "as delfriend <[member].name> <[apartment].id>" + +apartments_begin_edit: + debug: false + type: task + definitions: apartment|player + script: + - definemap apartments_edit_data: + apartment: <[apartment]> + inventory: <[player].inventory.map_slots> + - flag <[player]> apartments_edit:<[apartments_edit_data]> + - inventory clear player:<[player]> + - adjust <[player]> gamemode:creative + +apartments_end_edit: + debug: false + type: task + definitions: player + script: + - define apartments_edit_data <[player].flag[apartments_edit]> + - inventory clear player:<[player]> + - foreach <[apartments_edit_data].get[inventory]> key:slot as:item: + - inventory set origin:<[item]> slot:<[slot]> player:<[player]> + - adjust <[player]> gamemode:survival + - flag <[player]> apartments_edit:! diff --git a/scripts/apartments/apartments_world.dsc b/scripts/apartments/apartments_world.dsc new file mode 100644 index 0000000..53d9619 --- /dev/null +++ b/scripts/apartments/apartments_world.dsc @@ -0,0 +1,156 @@ +apartments_world: + debug: false + type: world + events: + ## session safety + on player joins: + - if : + - run apartments_end_edit def.player: + ## extra details + on delta time secondly every:2: + - actionbar "<&6>Editing apartment <&7>[]" targets: per_player + ## invalid access + on player right clicks block: + - if : + - stop + - if == null: + - stop + - if !|]>: + - determine cancelled + ## + ## complex creative safety cases + ## + # do not allow leaving actual apartment region + on player walks: + - if !: + - stop + - define apartment + - if !]>: + - determine cancelled + # forbid trying to touch non-blocks in creative inventory + on player clicks item in inventory: + - if !: + - stop + - if != CREATIVE: + - determine cancelled + - if != CRAFTING: + - determine cancelled + - if && : + - stop + - determine cancelled passively + - wait 1t + - inventory update destination: + - adjust item_on_cursor: + # handle container drops & illegal block breaks + on player breaks block bukkit_priority:monitor: + - if : + - stop + # // careful: == null here; everywhere else it's != null + - if ]> == null: + - stop + - if : + - if == creative: + - if > 0: + - narrate "<&c>This container has items inside. You must clear it first before you can break it." + - determine cancelled + - ratelimit 1t + - define contents + - if <[contents].is_empty>: + - stop + - define half + - if <[half]> == right: + - define contents <[contents].get[1].to[27]> + - else if <[half]> == left: + - define contents <[contents].get[28].to[54]> + - foreach <[contents]> as:item: + - drop <[item]> delay:10t + # forbid block update and physics inside apartments + on block physics: + - if != null: + - stop + - if ]> != null: + - determine cancelled passively + - foreach as:entity: + - remove <[entity]> + # forbid block update and physics for half blocks + on player breaks block: + # // careful: == null here; everywhere else it's != null + - if ]> == null: + - stop + - define half + - if <[half]> != null && !: + - if == air: + - if <[half]> != left && <[half]> != right: + - modifyblock ]> air no_physics + # forbid blocks that have NBT data - such as prefilled chests + on player places block: + # // careful: == null here; everywhere else it's != null + - if ]> == null: + - stop + - if : + - stop + - if : + - stop + - if ].size.if_null[0]> > 0: + - determine cancelled + ## + ## simple creative safety cases + ## + # forbid picking up and dropping items + on player drops item: + - if : + - stop + - if : + - determine cancelled + on player picks up item: + - if : + - stop + - if : + - determine cancelled + # forbid water flow in apartment regions + - if ]> != null: + - determine cancelled + # forbid sapling/other growing things in apartment regions + on structure grows: + - if ]> != null: + - determine cancelled + on plant grows: + - if ]> != null: + - determine cancelled + # forbid any items dropping even if broken in apartment regions + on block drops item from breaking: + - if ]> != null: + - determine cancelled + # forbid any tnt in apartment regions + on tnt primes: + - if ]> != null: + - determine cancelled + # forbid gravity on blocks inside apartments + on block falls: + - if ]> != null: + - determine cancelled + # forbid shulker box usage inside apartments + on player places *shulker_box: + - if ]> != null: + - if !: + - determine cancelled + # forbid mob spawner usage inside apartments + on player places *spawner: + - if : + - stop + - if ]> != null: + - determine cancelled + # prevent lectern grab + on player takes item from lectern: + - if : + - stop + - if !|]>: + - determine cancelled + # prevent redstone in apartments + after redstone recalculated: + - if ]> != null: + - adjustblock power:0 no_physics + # prevent piston use in apartments + on piston extends: + - if ]> != null: + - determine cancelled diff --git a/scripts/automoney/automoney_world.dsc b/scripts/automoney/automoney_world.dsc new file mode 100644 index 0000000..c5df9a3 --- /dev/null +++ b/scripts/automoney/automoney_world.dsc @@ -0,0 +1,12 @@ +automoney_world: + debug: false + type: world + events: + on delta time minutely every:1: + - foreach as:player: + - define last_payment <[player].flag[automoney_last].if_null[]> + - define time_passed ]> + - if <[time_passed].is_more_than[]>: + - flag <[player]> automoney_last: + - money give players:<[player]> quantity:500 + - narrate format:formats_prefix targets:<[player]> "Thanks for being online! You have received ¥500." diff --git a/scripts/carry/carry_commands.dsc b/scripts/carry/carry_commands.dsc new file mode 100644 index 0000000..a659faf --- /dev/null +++ b/scripts/carry/carry_commands.dsc @@ -0,0 +1,66 @@ +carry_command_carry: + debug: false + type: command + name: carry + description: Carry another player on your shoulders! + usage: /carry [who?] + permission: carry.command.carry + tab completions: + 1: ].parse[name]> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if !: + - narrate "<&c>You're already carrying someone!" + - stop + - define target + - if <[target]> == null: + - define target ].if_null[null]> + - if <[target]> == null: + - narrate "<&c>Please look at the player to carry or specify their username." + - stop + - else: + - if <[target].location.distance[]> > 5: + - narrate "<&c>That player is too far away!" + - stop + - if <[target].is_npc>: + - narrate "<&c>Please look at the player to carry or specify their username." + - stop + - if <[target]> == : + - narrate "<&c>You cannot carry yourself!" + - stop + - if <[target].is_inside_vehicle>: + - narrate "<&c>This player is already being carried!" + - stop + - define player + - clickable usages:1 until:10s save:carry: + - if !: + - narrate "<&c>That player is already carrying someone!" + - stop + - if <[target].is_inside_vehicle>: + - narrate targets:<[target]> "<&c>You're already being carried!" + - stop + - adjust <[player]> passengers:<[player].passengers.include[<[target]>]> + - narrate format:formats_prefix "Sent a carry request to <&e>]>" + # + - narrate format:formats_prefix targets:<[target]> "<&e>]> <&7> would like to carry you." + - narrate targets:<[target]> "<&l>[ACCEPT]].on_click[]>" + +carry_command_uncarry: + debug: false + type: command + name: uncarry + description: Stop carrying someone. + usage: /uncarry + permission: carry.command.uncarry + tab completions: + 1: + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if : + - narrate "<&c>You're not carrying anyone!" + - stop + - adjust passengers: diff --git a/scripts/character/character_commands.dsc b/scripts/character/character_commands.dsc new file mode 100644 index 0000000..28f3029 --- /dev/null +++ b/scripts/character/character_commands.dsc @@ -0,0 +1,102 @@ +character_command_rpname: + debug: false + type: command + name: rpname + description: Sets your roleplay name. + usage: /rpname (name) + permission: character.command.rpname + tab completions: + 1: <<>name<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 0: + - narrate "<&c>Please enter a RP name!" + - stop + - define name + - if <[name].length> > 24: + - narrate "<&c>Your RP name must not be longer than 24 characters." + - stop + - if !<[name].regex_matches[^[a-zA-Z0-9\-. <&sq>]+$]>: + - narrate "<&c>Your RP name must only contain alphanumeric characters, spaces, dots, dashes, and single quotes." + - stop + - define used_already ].if_null[null]> + - if <[used_already]> != null: + - if <[used_already]> != : + - narrate "<&c>This RP name is already taken!" + - stop + - define new_rpnames ]> + - if : + - define new_rpnames <[new_rpnames].exclude[]> + - define new_rpnames <[new_rpnames].with[<[name]>].as[]> + - flag character_rpname:<[name]> + - flag server character_rpnames:<[new_rpnames]> + - narrate format:formats_prefix "Set your RP Name to <&e><[name]><&7>." + +character_command_setdescription: + debug: false + type: command + name: setdescription + aliases: + - setdesc + description: Sets your roleplay description. + usage: /setdescription (description) + permission: character.command.setdescription + tab completions: + 1: <<>description<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 0: + - narrate "<&c>Please enter a description!" + - stop + - define description + - flag character_description:<[description]> + - narrate format:formats_prefix "Changed your description! View it with /viewdescription." + +character_command_viewdescription: + debug: false + type: command + name: viewdescription + aliases: + - viewdesc + description: Sets your roleplay description. + usage: /viewdescription + permission: character.command.viewdescription + tab completions: + 1: + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - define name ]> + - define description ]> + - narrate format:formats_prefix "<&e> <&7>Character Info" + - narrate "<&7>Your name<&c>: <&f><[name]>" + - narrate "<&7>Your description<&c>: <&f><[description]>" + +character_command_findname: + debug: false + type: command + name: findname + aliases: + - fn + description: Find name of player based on RP name. + usage: /findname (rpname) + permission: character.command.findname + tab completions: + 1: <<>rpname<>> + script: + - if <= 0: + - narrate "<&c>Please enter a RP name!" + - stop + - define query + - define found_player ].get[<[query]>].if_null[null]> + - if <[found_player]> == null: + - narrate format:formats_prefix "No player with this RP name could be found." + - stop + - else: + - define found_player ]> + - narrate format:formats_prefix "The actual name of <[query]> is <&e><[found_player].name>" diff --git a/scripts/character/character_tasks.dsc b/scripts/character/character_tasks.dsc new file mode 100644 index 0000000..f025e6b --- /dev/null +++ b/scripts/character/character_tasks.dsc @@ -0,0 +1,13 @@ +character_get_name: + debug: false + type: procedure + definitions: player + script: + - determine <[player].flag[character_rpname].if_null[<[player].name>]> + +character_get_description: + debug: false + type: procedure + definitions: player + script: + - determine <[player].flag[character_description].if_null[No<&sp>description<&sp>set.]> diff --git a/scripts/character/character_world.dsc b/scripts/character/character_world.dsc new file mode 100644 index 0000000..f276903 --- /dev/null +++ b/scripts/character/character_world.dsc @@ -0,0 +1,15 @@ +character_world: + debug: false + type: world + events: + on player right clicks player: + - define target + - if <[target].is_npc>: + - stop + - determine cancelled passively + - ratelimit 1s + - define name ]> + - define description ]> + - narrate format:formats_prefix "<&e><[target].name> <&7>Character Info" + - narrate "<&7>Name<&c>: <&f><[name]>" + - narrate "<&7>Description<&c>: <&f><[description]>" diff --git a/scripts/chat/chat_commands.dsc b/scripts/chat/chat_commands.dsc new file mode 100644 index 0000000..e8b2d1a --- /dev/null +++ b/scripts/chat/chat_commands.dsc @@ -0,0 +1,418 @@ +chat_command_ooc: + debug: false + type: command + name: ooc + usage: /ooc (message) + description: Sends a message in global OOC. + permission: chat.command.chat.ooc + tab completions: + 1: <<>message<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 0: + - if !: + - if == ooc: + - narrate "<&c>You are currently switched to OOC chat, so you cannot disable it." + - stop + - flag chat_disableooc:true + - narrate format:formats_prefix "Disabled OOC chat." + - else: + - flag chat_disableooc:! + - narrate format:formats_prefix "Enabled OOC chat." + - stop + - else if : + - narrate "<&c>You cannot use OOC chat while it is disabled. Please enable it first." + - stop + - run chat_channel_ooc def.player: def.message: + +chat_command_looc: + debug: false + type: command + name: looc + usage: /looc (message) + description: Sends a message in local LOOC. + permission: chat.command.chat.looc + tab completions: + 1: <<>message<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 0: + - narrate "<&c>Please enter a message!" + - stop + - run chat_channel_looc def.player: def.message: + +chat_command_me: + debug: false + type: command + name: me + usage: /me (message) + description: Sends a message in IC, 1st person action. + permission: chat.command.chat.me + tab completions: + 1: <<>message<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 0: + - narrate "<&c>Please enter a message!" + - stop + - run chat_channel_ic_me def.player: def.message: + +chat_command_meclose: + debug: false + type: command + name: meclose + usage: /meclose (message) + aliases: + - mec + description: Sends a message in IC, 1st person action, close range. + permission: chat.command.chat.mec + tab completions: + 1: <<>message<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 0: + - narrate "<&c>Please enter a message!" + - stop + - run chat_channel_ic_mec def.player: def.message: + +chat_command_melong: + debug: false + type: command + name: melong + usage: /melong (message) + aliases: + - mel + description: Sends a message in IC, 1st person action, long range. + permission: chat.command.chat.mel + tab completions: + 1: <<>message<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 0: + - narrate "<&c>Please enter a message!" + - stop + - run chat_channel_ic_mel def.player: def.message: + +chat_command_whisper: + debug: false + type: command + name: whisper + usage: /whisper (message) + aliases: + - w + description: Sends a message in IC, whispering. + permission: chat.command.chat.whisper + tab completions: + 1: <<>message<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 0: + - narrate "<&c>Please enter a message!" + - stop + - run chat_channel_ic_whisper def.player: def.message: + +chat_command_yell: + debug: false + type: command + name: yell + usage: /yell (message) + aliases: + - y + description: Sends a message in IC, yelling. + permission: chat.command.chat.yell + tab completions: + 1: <<>message<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 0: + - narrate "<&c>Please enter a message!" + - stop + - run chat_channel_ic_yell def.player: def.message: + +chat_command_my: + debug: false + type: command + name: my + usage: /my (message) + description: Sends a message in IC, 1st person possessive. + permission: chat.command.chat.my + tab completions: + 1: <<>message<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 0: + - narrate "<&c>Please enter a message!" + - stop + - run chat_channel_ic_my def.player: def.message: + +chat_command_it: + debug: false + type: command + name: it + usage: /it (message) + description: Sends a message in IC, 3rd person action. + permission: chat.command.chat.it + tab completions: + 1: <<>message<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 0: + - narrate "<&c>Please enter a message!" + - stop + - run chat_channel_ic_it def.player: def.message: + +chat_command_itclose: + debug: false + type: command + name: itclose + usage: /itclose (message) + aliases: + - itc + description: Sends a message in IC, 3rd person action, close range. + permission: chat.command.chat.itc + tab completions: + 1: <<>message<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 0: + - narrate "<&c>Please enter a message!" + - stop + - run chat_channel_ic_itc def.player: def.message: + +chat_command_itl: + debug: false + type: command + name: itlong + usage: /itlong (message) + aliases: + - itl + description: Sends a message in IC, 3rd person action, long range. + permission: chat.command.chat.itl + tab completions: + 1: <<>message<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 0: + - narrate "<&c>Please enter a message!" + - stop + - run chat_channel_ic_itl def.player: def.message: + +chat_command_languageadd: + debug: false + type: command + name: languageadd + usage: /languageadd (player) (language) + aliases: + - langadd + description: Allows a user to speak a new language. + permission: chat.command.admin.languageadd + tab completions: + 1: + 2: + script: + - if < 2: + - narrate "<&c>Invalid use. Please try / (player) (language)." + - stop + - define player ].if_null[null]> + - if <[player]> == null: + - narrate "<&c>A player with name was not found." + - stop + - define language + - define known + - if !<[known].contains[<[language]>]>: + - narrate "<&c>Language <[language]> is not a known language." + - stop + - flag <[player]> chat_languages:<[player].flag[chat_languages].if_null[].include[<[language]>].deduplicate> + - narrate format:formats_prefix "Player <&e><[player].name> <&7>may now speak in <[language]>." + +chat_command_languageremove: + debug: false + type: command + name: languageremove + usage: /languageremove (player) (language) + aliases: + - langremove + - langrem + description: Removes a language that a player knows. + permission: chat.command.admin.languageremove + tab completions: + 1: + 2: + script: + - if < 2: + - narrate "<&c>Invalid use. Please try / (player) (language)." + - stop + - define player ].if_null[null]> + - if <[player]> == null: + - narrate "<&c>A player with name was not found." + - stop + - define language + - define known + - if !<[known].contains[<[language]>]>: + - narrate "<&c>Language <[language]> is not a known language." + - stop + - flag <[player]> chat_languages:<[player].flag[chat_languages].if_null[].exclude[<[language]>]> + - narrate format:formats_prefix "Player <&e><[player].name> <&7>cannot speak <[language]> any longer." + +chat_command_language: + debug: false + type: command + name: language + usage: /language (language) (message) + aliases: + - lang + description: Sends a message in IC, in a language. + permission: chat.command.chat.language + tab completions: + 1: ]> + 2: <<>message<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 1: + - narrate "<&c>Invalid use. Please use / (language) (message)." + - stop + - define language + - if !].if_null[false]>: + - narrate "<&c>Your character cannot speak in <[language]>." + - stop + - run chat_channel_ic_language def.player: def.message: def.language:<[language]> + +chat_command_languagewhisper: + debug: false + type: command + name: languagewhisper + usage: /languagewhisper (language) (message) + aliases: + - langwhisper + - langw + description: Sends a message in IC, in a language, whispering. + permission: chat.command.chat.languagewhisper + tab completions: + 1: ]> + 2: <<>message<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 1: + - narrate "<&c>Invalid use. Please use / (language) (message)." + - stop + - define language + - if !].if_null[false]>: + - narrate "<&c>Your character cannot speak in <[language]>." + - stop + - run chat_channel_ic_languagewhisper def.player: def.message: def.language:<[language]> + +chat_command_languageyell: + debug: false + type: command + name: languageyell + usage: /languageyell (language) (message) + aliases: + - langyell + - langy + description: Sends a message in IC, in a language, yelling. + permission: chat.command.chat.languageyell + tab completions: + 1: ]> + 2: <<>message<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 1: + - narrate "<&c>Invalid use. Please use / (language) (message)." + - stop + - define language + - if !].if_null[false]>: + - narrate "<&c>Your character cannot speak in <[language]>." + - stop + - run chat_channel_ic_languageyell def.player: def.message: def.language:<[language]> + +## +## Channel switch +## + +chat_command_channelswitch: + debug: false + type: command + name: channelswitch + usage: /channelswitch (channel) + aliases: + - chsw + description: Changes your main channel. + permission: chat.command.channelswitch + tab completions: + 1: + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 0: + - narrate "<&c>Invalid use. Please use / (channel)." + - stop + - define channel + - choose <[channel]>: + - case ic: + - flag chat_channel:ic + - narrate format:formats_prefix "Changed channel to IC." + - stop + - case ooc: + - if : + - narrate "<&c>You currently have OOC disabled. Use /ooc first to enable it." + - stop + - flag chat_channel:ooc + - narrate format:formats_prefix "Changed channel to OOC." + - stop + - narrate "<&c>Unknown channel <[channel]>. Please try: ic, ooc." + +## +## Chat Color +## + +chat_command_chatcolor: + debug: false + type: command + name: chatcolor + usage: /chatcolor (color) + description: Changes the chat color for your actions. + permission: chat.command.chatcolor + tab completions: + 1: + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 0: + - narrate "<&c>Invalid use. Please use / (color)." + - stop + - define color + - if !]>: + - narrate "<&c>You must choose a color from this list: " + - stop + - flag chat_color:].hex>].parse_color> + - narrate format:formats_prefix "Changed chat color to ].hex>].parse_color><[color]>." diff --git a/scripts/chat/chat_data.dsc b/scripts/chat/chat_data.dsc new file mode 100644 index 0000000..4a2f6b2 --- /dev/null +++ b/scripts/chat/chat_data.dsc @@ -0,0 +1,142 @@ +chat_data_languages: + debug: false + type: data + # all languages allowed by Google Translate + known: + - Afrikaans + - Akan + - Albanian + - Amharic + - Arabic + - Armenian + - Assamese + - Aymara + - Azerbaijani + - Bambara + - Basque + - Belarusian + - Bengali + - Bhojpuri + - Bosnian + - Bulgarian + - Burmese + - Catalan + - Cebuano + - Chewa + - Chinese + - Corsican + - Croatian + - Czech + - Danish + - Dhivehi + - Dogri + - Dutch + #- English + - Esperanto + - Estonian + - Ewe + - Filipino + - Finnish + - French + - Galician + - Georgian + - German + - Goan Konkani + - Greek + - Guarani + - Gujarati + - Haitian Creole + - Hausa + - Hawaiian + - Hebrew + - Hindi + - Hmong + - Hungarian + - Icelandic + - Igbo + - Ilocano + - Indonesian + - Irish + - Italian + #- Japanese + - Javanese + - Kannada + - Kazakh + - Khmer + - Kinyarwanda + - Konkani + - Korean + - Krio + - Kurdish + - Kyrgyz + - Lao + - Latin + - Latvian + - Lingala + - Lithuanian + - Luganda + - Luxembourgish + - Macedonian + - Maithili + - Malagasy + - Malay + - Malayalam + - Maldivian + - Maltese + - Māori + - Marathi + - Meitei + - Mizo + - Mongolian + - Nepali + - Northern Sotho + - Norwegian + - Nyanja + - Odia + - Oromo + - Pashto + - Persian + - Polish + - Portuguese + - Punjabi + - Quechua + - Romanian + - Russian + - Samoan + - Sanskrit + - Scottish Gaelic + - Serbian + - Shona + - Sindhi + - Sinhala + - Slovak + - Slovene + - Somali + - Sotho + - Southern Quechua + - Spanish + - Sundanese + - Swahili + - Swedish + - Tagalog + - Tajik + - Tamil + - Tatar + - Telugu + - Thai + - Tigrinya + - Tsonga + - Turkish + - Turkmen + - Twi + - Ukrainian + - Urdu + - Uyghur + - Uzbek + - Vietnamese + - Welsh + - West Frisian + - Xhosa + - Yiddish + - Yoruba + - Zulu diff --git a/scripts/chat/chat_tasks.dsc b/scripts/chat/chat_tasks.dsc new file mode 100644 index 0000000..d1ca7dd --- /dev/null +++ b/scripts/chat/chat_tasks.dsc @@ -0,0 +1,266 @@ +chat_name_ooc: + debug: false + type: procedure + definitions: player + script: + - determine ].if_null[<&7>].parse_color><[player].name> + +chat_special_group: + debug: false + type: procedure + definitions: player + script: + - define result ].if_null[<&f>].parse_color> + - if <[result].strip_color.length> > 0: + - define result <[result]><&sp> + - determine <[result]> + +chat_roles_group: + debug: false + type: procedure + definitions: player + script: + - determine ].if_null[<&f>].parse_color><&f> + +chat_channel_ooc: + debug: false + type: task + definitions: player|message + script: + - define message <[message].strip_color.replace[&\].with[&].unescaped> + - define final "<&8>[<&7><&l>OOC<&8>] ]>]><&7>: <&l><[message]>" + - narrate targets:]> <[final]> + - announce to_console <[final]> + +chat_channel_looc: + debug: false + type: task + definitions: player|message + script: + - define message <[message].strip_color.replace[&\].with[&].unescaped> + - define final "<&8>[<&7>LOOC<&8>] ]><&7>]> ]><&7>: <[message]>" + - narrate targets:<[player].location.find_players_within[10]> <[final]> + - announce to_console <[final]> + +chat_allowed_colors: + debug: false + type: procedure + script: + - determine + +chat_tokenize_actions: + debug: false + type: procedure + definitions: message|initializer|actioncolor|speechcolor|separator|forcecaps + script: + - define result + - define index 1 + - if <[message].starts_with[*]>: + - define index 2 + - else: + - define result <[actioncolor]><[initializer]> + - foreach <[message].split[*]> as:token: + - if <[token].trim.parse_color.strip_color.length> <= 0: + - foreach next + - if <[index].is_odd>: + - if <[forcecaps]>: + - define token <[token].replace[&\].with[&].unescaped.to_uppercase> + - define result "<[result]> <[separator]><[speechcolor]><[token].trim><[separator]>" + - else: + - define result "<[result]> <[actioncolor]><[token].trim>" + - define index <[index].add[1]> + - determine <[result].trim> + +chat_channel_ic: + debug: false + type: task + definitions: player|message + script: + - if <[message].starts_with[*]> && <[message].split[*].size> == 2: + - if <[message].ends_with[*]>: + - run chat_channel_ic_me def.player:<[player]> def.message:<[message].substring[2,<[message].length.sub[1]>]> + - else: + - run chat_channel_ic_me def.player:<[player]> def.message:<[message].substring[2,<[message].length>]> + - stop + - if !<[player].has_permission[chat.colors]>: + - define message <[message].strip_color> + - define tokenized |]>says<&7>:|]>|<&f>|<&f><&dq><&f>|false].replace[&\].with[&].unescaped> + - define final "<&color[#b8b9ba]>]> <&f>]>]> ]> <[tokenized]>" + - narrate targets:<[player].location.find_players_within[10]> <[final]> + - announce to_console <[final]> + +chat_channel_ic_me: + debug: false + type: task + definitions: player|message + script: + - define message <[message].replace[&\].with[&].unescaped> + - if !<[player].has_permission[chat.colors]>: + - define message <[message].strip_color> + - define final "<&e>*** <&f>]> ]>]> ]> ]><&o><[message]>" + - narrate targets:<[player].location.find_players_within[10]> <[final]> + - announce to_console <[final]> + +chat_channel_ic_mec: + debug: false + type: task + definitions: player|message + script: + - define message <[message].replace[&\].with[&].unescaped> + - if !<[player].has_permission[chat.colors]>: + - define message <[message].strip_color> + - define final "<&e>* <&f>]> ]>]> ]> ]><&o><[message]>" + - narrate targets:<[player].location.find_players_within[3]> <[final]> + - announce to_console <[final]> + +chat_channel_ic_mel: + debug: false + type: task + definitions: player|message + script: + - define message <[message].replace[&\].with[&].unescaped> + - if !<[player].has_permission[chat.colors]>: + - define message <[message].strip_color> + - define final "<&e>**** <&f>]> ]>]> ]> ]><&o><[message]>" + - narrate targets:<[player].location.find_players_within[25]> <[final]> + - announce to_console <[final]> + +chat_channel_ic_whisper: + debug: false + type: task + definitions: player|message + script: + - if <[message].starts_with[*]> && <[message].split[*].size> == 2: + - if <[message].ends_with[*]>: + - run chat_channel_ic_mec def.player:<[player]> def.message:<[message].substring[2,<[message].length.sub[1]>]> + - else: + - run chat_channel_ic_mec def.player:<[player]> def.message:<[message].substring[2,<[message].length>]> + - stop + - if !<[player].has_permission[chat.colors]>: + - define message <[message].strip_color> + - define tokenized |whispers|<&8>|<&7>|<&6><&sq>|false].replace[&\].with[&].unescaped> + - define final "<&color[#d1d1d1]>]> <&f>]>]> ]> <[tokenized]>" + - narrate targets:<[player].location.find_players_within[3]> <[final]> + - announce to_console <[final]> + +chat_channel_ic_yell: + debug: false + type: task + definitions: player|message + script: + - if <[message].starts_with[*]> && <[message].split[*].size> == 2: + - if <[message].ends_with[*]>: + - run chat_channel_ic_mel def.player:<[player]> def.message:<[message].substring[2,<[message].length.sub[1]>]> + - else: + - run chat_channel_ic_mel def.player:<[player]> def.message:<[message].substring[2,<[message].length>]> + - stop + - if !<[player].has_permission[chat.colors]>: + - define message <[message].strip_color> + - define tokenized |yells|<&6>|<&f>|<&6><&sq>|true].replace[&\].with[&].unescaped> + - define final "<&f>]> ]>]> ]> <[tokenized]>" + - narrate targets:<[player].location.find_players_within[25]> <[final]> + - announce to_console <[final]> + +chat_channel_ic_my: + debug: false + type: task + definitions: player|message + script: + - define message <[message].replace[&\].with[&].unescaped> + - if !<[player].has_permission[chat.colors]>: + - define message <[message].strip_color> + - define possession_name ]> + - if <[possession_name].to_lowercase.ends_with[s]>: + - define possession_name <[possession_name]><&sq> + - else: + - define possession_name <[possession_name]><&sq>s + - define final "<&e>*** <&f>]> ]>]> <[possession_name]> <&f><[message]>" + - narrate targets:<[player].location.find_players_within[10]> <[final]> + - announce to_console <[final]> + +chat_channel_ic_it: + debug: false + type: task + definitions: player|message + script: + - define message <[message].replace[&\].with[&].unescaped> + - if !<[player].has_permission[chat.colors]>: + - define message <[message].strip_color> + - define final "<&6>*** <&e><[message]> <&7>(]>)" + - narrate targets:<[player].location.find_players_within[10]> <[final]> + - announce to_console <[final]> + +chat_channel_ic_itc: + debug: false + type: task + definitions: player|message + script: + - define message <[message].replace[&\].with[&].unescaped> + - if !<[player].has_permission[chat.colors]>: + - define message <[message].strip_color> + - define final "<&6>* <&e><[message]> <&7>(]>)" + - narrate targets:<[player].location.find_players_within[3]> <[final]> + - announce to_console <[final]> + +chat_channel_ic_itl: + debug: false + type: task + definitions: player|message + script: + - define message <[message].replace[&\].with[&].unescaped> + - if !<[player].has_permission[chat.colors]>: + - define message <[message].strip_color> + - define final "<&6>**** <&e><[message]> <&7>(]>)" + - narrate targets:<[player].location.find_players_within[25]> <[final]> + - announce to_console <[final]> + +chat_channel_ic_language: + debug: false + type: task + definitions: player|message|language + script: + - define message <[message].replace[&\].with[&].unescaped> + - if !<[player].has_permission[chat.colors]>: + - define message <[message].strip_color> + - define final_known "<&6>[<&7>L<&6>] <&f>]> ]>]> ]> ]>says <&f><&dq><&o><[message]><&f><&dq> in <[language]>" + - define final_unknown "<&6>[<&7>L<&6>] <&f>]> ]>]> ]> ]>says something in <[language]>" + - define all <[player].location.find_players_within[10]> + - define speakers <[all].filter_tag[<[filter_value].flag[chat_languages].contains[<[language]>].if_null[false]>]> + - define others <[all].exclude[<[speakers]>]> + - narrate targets:<[speakers]> <[final_known]> + - narrate targets:<[others]> <[final_unknown]> + - announce to_console <[final_known]> + +chat_channel_ic_languagewhisper: + debug: false + type: task + definitions: player|message|language + script: + - define message <[message].replace[&\].with[&].unescaped> + - if !<[player].has_permission[chat.colors]>: + - define message <[message].strip_color> + - define final_known "<&6>[<&7>L<&6>] <&f>]> ]>]> ]> <&f>whispers <&dq><&o><[message]><&f><&dq> in <[language]>" + - define final_unknown "<&6>[<&7>L<&6>] <&f>]> ]>]> ]> <&f>whispers something in <[language]>" + - define all <[player].location.find_players_within[3]> + - define speakers <[all].filter_tag[<[filter_value].flag[chat_languages].contains[<[language]>].if_null[false]>]> + - define others <[all].exclude[<[speakers]>]> + - narrate targets:<[speakers]> <[final_known]> + - narrate targets:<[others]> <[final_unknown]> + - announce to_console <[final_known]> + +chat_channel_ic_languageyell: + debug: false + type: task + definitions: player|message|language + script: + - define message <[message].replace[&\].with[&].unescaped> + - if !<[player].has_permission[chat.colors]>: + - define message <[message].strip_color> + - define final_known "<&6>[<&7>L<&6>] <&f>]> ]>]> ]> <&f>yells <&dq><&o><[message].to_uppercase><&f><&dq> in <[language]>" + - define final_unknown "<&6>[<&7>L<&6>] <&f>]> ]>]> ]> <&f>yells something in <[language]>" + - define all <[player].location.find_players_within[25]> + - define speakers <[all].filter_tag[<[filter_value].flag[chat_languages].contains[<[language]>].if_null[false]>]> + - define others <[all].exclude[<[speakers]>]> + - narrate targets:<[speakers]> <[final_known]> + - narrate targets:<[others]> <[final_unknown]> + - announce to_console <[final_known]> diff --git a/scripts/chat/chat_world.dsc b/scripts/chat/chat_world.dsc new file mode 100644 index 0000000..4c23dab --- /dev/null +++ b/scripts/chat/chat_world.dsc @@ -0,0 +1,11 @@ +chat_world: + debug: false + type: world + events: + on player chats: + - determine cancelled passively + - define channel + - if <[channel]> == ic: + - run chat_channel_ic def.player: def.message: + - else if <[channel]> == ooc: + - run chat_channel_ooc def.player: def.message: diff --git a/scripts/furniture/furniture_commands.dsc b/scripts/furniture/furniture_commands.dsc new file mode 100644 index 0000000..5410cf9 --- /dev/null +++ b/scripts/furniture/furniture_commands.dsc @@ -0,0 +1,14 @@ +furniture_command_furniture: + debug: false + type: command + name: furniture + usage: /furniture + description: Opens the furniture menu. + permission: furniture.command.furniture + tab completions: + 1: + script: + - if != player: + - narrate "<&c>You can only use this command as a player." + - stop + - run furniture_menu def.player: diff --git a/scripts/furniture/furniture_config.dsc b/scripts/furniture/furniture_config.dsc new file mode 100644 index 0000000..5bf4390 --- /dev/null +++ b/scripts/furniture/furniture_config.dsc @@ -0,0 +1,47 @@ +furniture_config: + debug: false + type: data + # Furniture using note block states + noteblock: + # note_block, custom_model_data = 1 when held + 1: + represents: Locker (East) + is: piano,1,false + 2: + represents: Locker (South) + is: piano,2,false + 3: + represents: Locker (West) + is: piano,3,false + 4: + represents: Locker (North) + is: piano,4,false + # Furniture using custom_block.dsc library + custom_block: + # iron_horse_armor, custom_model_data = 1 when held + iron_horse_armor,1: + represents: School Chair + collision: skeleton_skull + iron_horse_armor,2: + represents: TV + collision: barrier + iron_horse_armor,3: + represents: Book (open) + collision: warped_trapdoor + iron_horse_armor,4: + represents: Book + collision: warped_trapdoor + iron_horse_armor,5: + represents: Book Stack + collision: skeleton_skull + iron_horse_armor,6: + represents: Desk Lamp + collision: red_sandstone_wall + iron_horse_armor,7: + represents: Clipboard + collision: warped_trapdoor + # List of collision blocks - disables interaction without perms + collision_blocks: + #- skeleton_skull + #- red_sandstone_Wall + - warped_trapdoor diff --git a/scripts/furniture/furniture_tasks.dsc b/scripts/furniture/furniture_tasks.dsc new file mode 100644 index 0000000..15a55e6 --- /dev/null +++ b/scripts/furniture/furniture_tasks.dsc @@ -0,0 +1,92 @@ +furniture_cmd_to_noteblock: + debug: false + type: procedure + definitions: cmd + script: + - define data + - if !<[data].contains[<[cmd]>]>: + - determine null + - define noteblock_data <[data].get[<[cmd]>].get[is].split[,]> + - define instrument <[noteblock_data].get[1]> + - define note <[noteblock_data].get[2]> + - define switched <[noteblock_data].get[3]> + - determine ;note=<[note]>;switched=<[switched]>]]> + +furniture_custom_block_any: + debug: false + type: procedure + definitions: material|cmd + script: + - define data + - determine <[data].contains[<[material].name>,<[cmd]>]> + +furniture_cmd_to_custom_block_collision: + debug: false + type: procedure + definitions: material|cmd + script: + - define data + - if !<[data].contains[<[material].name>,<[cmd]>]>: + - determine null + - determine <[data].get[<[material].name>,<[cmd]>].get[collision]> + +furniture_all_items_sorted: + debug: false + type: procedure + script: + - define items + - foreach key:noteblock_cmd as:noteblock_data: + - define noteblock <[noteblock_data].get[represents]>;custom_model_data=<[noteblock_cmd]>]]> + - define items <[items].include[<[noteblock]>]> + - foreach key:custom_block_item_details as:custom_block_data: + - define custom_block_type_cmd_split <[custom_block_item_details].split[,]> + - define custom_item [display=<&f><[custom_block_data].get[represents]>;custom_model_data=<[custom_block_type_cmd_split].get[2]>;hides=all]]> + - define items <[items].include[<[custom_item]>]> + - define items <[items].sort_by_value[display]> + - determine <[items]> + +furniture_menu: + debug: false + type: task + definitions: player|page + script: + - define page <[page].if_null[0]> + - define items ].to[<[page].add[1].mul[45]>]> + - define contents + - foreach <[items]> as:item: + - definemap item_entry: + item: <[item]> + script: furniture_menu_give + definitions: + player: <[player]> + item: <[item]> + - define contents <[contents].with[<[loop_index]>].as[<[item_entry]>]> + - if <[page]> > 0: + - define contents_extra: + 49: + item: <<><<>]]> + script: furniture_menu + definitions: + player: <[player]> + page: <[page].sub[1]> + - define contents <[contents].include[<[contents_extra]>]> + - if <[page].add[1].mul[27]> < <[contents].size>: + - define contents_extra: + 51: + item: <>><>>]]> + script: furniture_menu + definitions: + player: <[player]> + page: <[page].add[1]> + - define contents <[contents].include[<[contents_extra]>]> + - run menu_open def.player:<[player]> "def.title:<&b> 邑邑<&f>邑邑邑邑鄊" def.size:54 def.contents:<[contents]> + +furniture_menu_give: + debug: false + type: task + definitions: player|item + script: + - if !<[player].inventory.can_fit[<[item]>]>: + - narrate targets:<[player]> "<&c>You do not have enough space in your inventory!" + - stop + - give player:<[player]> <[item]> quantity:1 diff --git a/scripts/furniture/furniture_world.dsc b/scripts/furniture/furniture_world.dsc new file mode 100644 index 0000000..b395b23 --- /dev/null +++ b/scripts/furniture/furniture_world.dsc @@ -0,0 +1,105 @@ +# NOTE BLOCK HANDLERS +furniture_world_noteblock: + debug: false + type: world + events: + on player places note_block: + - if > 0: + - define noteblock ]> + - if <[noteblock]> != null: + - modifyblock <[noteblock]> no_physics + - stop + - adjustblock note:0 + - adjustblock instrument:piano + - adjustblock switched:false + on player right clicks note_block: + - if !: + - determine cancelled + on player breaks block: + - if : + - run furniture_world_note_block_undo_update def.at: + - if : + - run furniture_world_note_block_undo_update def.at: + on player places block: + - if : + - run furniture_world_note_block_undo_update def.at: + - if : + - run furniture_world_note_block_undo_update def.at: + +furniture_world_note_block_undo_update: + debug: false + type: task + definitions: at + script: + - define old_material <[at].material> + - modifyblock <[at]> <[old_material]> no_physics delayed + +# CUSTOM BLOCK HANDLERS +furniture_world_custom_block: + debug: false + type: world + events: + on player right clicks block: + - if ! && !: + - stop + - if : + - stop + - if !|]>: + - stop + - ratelimit 5t + - determine cancelled passively + # + - define cursor_solid + - if <[cursor_solid]> == null: + - stop + - define block_face_normal ;fluids=false;nonsolids=false]> + - define target_block <[cursor_solid].add[<[block_face_normal]>]> + - if <[target_block].material.is_solid>: + - stop + # + - define material [custom_model_data=] + # + - define pitch ].pass[0].fail[180]> + - define yaw + - if <[yaw]> == 1: + - define yaw 90 + - if <[yaw]> == 2: + - define yaw 180 + - if <[yaw]> == 3: + - define yaw -90 + - if <[yaw]> == 4: + - define yaw 0 + # + - define collision_block |]> + - modifyblock <[target_block]> <[collision_block]> no_physics + # + - run custom_block_create def.at:<[target_block]> def.material:<[material]> def.pitch:<[pitch]> def.yaw:<[yaw]> + - animate animation:ARM_SWING + - playsound sound:BLOCK_STONE_PLACE sound_category:blocks pitch:0.7 + on player breaks block: + - if ]> == null: + - stop + - if ! && !: + - determine cancelled passively + - stop + - run custom_block_destroy def.at: + # + # WORLDEDIT COMPATIBILITY + # + on custom event id:worldedit_edit: + - announce to_ops "Actor: ; Locations: " + +# COLLISION BLOCK HANDLERS +furniture_world_collision_block: + debug: false + type: world + events: + on player right clicks block bukkit_priority:high: + - if == null: + - stop + - if ! && !: + - stop + - if : + - stop + - if ].if_null[false]>: + - determine cancelled diff --git a/scripts/guns/guns_commands.dsc b/scripts/guns/guns_commands.dsc new file mode 100644 index 0000000..07feedd --- /dev/null +++ b/scripts/guns/guns_commands.dsc @@ -0,0 +1,29 @@ +guns_command_unstun: + debug: false + type: command + name: unstun + description: Unstun a shot or tased player. + usage: /unstun + aliases: + - untase + permission: guns.command.unstun + tab completions: + default: PressEnter + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - define target + - if <[target]> == null: + - narrate "<&c>Please look towards the player you want to unstun." + - stop + - if <[target].is_npc>: + - narrate "<&c>Please look towards the player you want to unstun." + - stop + - if !<[target].has_flag[guns_frozen]>: + - narrate "<&c>This player is not stunned!" + - stop + - animate <[target]> animation:stop_sitting + - flag <[target]> guns_frozen:! + - narrate format:formats_prefix "You have unstunned ]>." + - narrate format:formats_prefix "You have been unstunned." targets:<[target]> diff --git a/scripts/guns/guns_tasks.dsc b/scripts/guns/guns_tasks.dsc new file mode 100644 index 0000000..6f9f22c --- /dev/null +++ b/scripts/guns/guns_tasks.dsc @@ -0,0 +1,10 @@ +guns_unfreeze: + debug: false + definitions: player + type: task + script: + - waituntil max:60s <[player].is_online.not.or[<[player].has_flag[guns_frozen].not>]> + - if !<[player].has_flag[guns_frozen]>: + - stop + - animate <[player]> animation:stop_sitting + - flag <[player]> guns_frozen:! diff --git a/scripts/guns/guns_world.dsc b/scripts/guns/guns_world.dsc new file mode 100644 index 0000000..bcd4a37 --- /dev/null +++ b/scripts/guns/guns_world.dsc @@ -0,0 +1,65 @@ +guns_world_common: + debug: false + type: world + events: + after player join: + - if !: + - stop + - animate animation:sit + - run guns_unfreeze path:script def: + - narrate format:formats_prefix "You logged off before you were unstunned. You will remain stunned for 60 seconds." + on player teleports: + - if : + - determine cancelled passively + +guns_world_gun: + debug: false + type: world + events: + on player right clicks block: + - if !: + - stop + - ratelimit 1s + # - playsound custom sound:your_custom_sound + - playsound sound:entity_arrow_shoot + - define target + - if <[target]> == null: + - define location + - if <[location]> == null: + - define location + - playeffect effect:redstone at:].distance[0.1]> special_data:0.5|white visibility:16 quantity:6 offset:0,0,0 + - stop + - playeffect effect:redstone at:].distance[0.1]> special_data:0.5|white visibility:16 quantity:6 offset:0,0,0 + - if <[target].entity_type> != player: + - stop + - if <[target].has_flag[guns_frozen]>: + - stop + - animate <[target]> animation:sit + - flag <[target]> guns_frozen:true + - run guns_unfreeze path:script def:<[target]> + - narrate format:formats_prefix "You shot ]>" + - narrate format:formats_prefix "You have been shot by ]>" targets:<[target]> + +guns_world_taser: + debug: false + type: world + events: + on player right clicks block: + - if !: + - stop + - ratelimit 1s + - define target + - if <[target]> == null: + - stop + - if <[target].entity_type> != player: + - stop + - if <[target].has_flag[guns_frozen]>: + - stop + - playeffect effect:redstone at:].distance[0.1]> special_data:0.5|white visibility:16 quantity:6 offset:0,0,0 + # - playsound custom sound:your_custom_sound + - playsound sound:entity_armor_stand_hit + - animate <[target]> animation:sit + - flag <[target]> guns_frozen:true + - run guns_unfreeze path:script def:<[target]> + - narrate format:formats_prefix "You tased ]>" + - narrate format:formats_prefix "You have been tased by ]>" targets:<[target]> diff --git a/scripts/lib/anvil_input.dsc b/scripts/lib/anvil_input.dsc new file mode 100644 index 0000000..6aca0ab --- /dev/null +++ b/scripts/lib/anvil_input.dsc @@ -0,0 +1,62 @@ +# +# Anvil Input +# A library that lets you use anvil inputs instead of chat inputs. +# + +# +# Requests input from the player with the given prompt, and then applies +# the result to the callback. +# +# The callback is a task with two definitions: a player, and the input. +# The callback is called an filled automatically by this task once the anvil +# input is complete. +# +anvil_input: + debug: false + type: task + definitions: player|prompt|callback + script: + - if !<[player].is_online>: + - stop + - define inventory 邑邑邑邑]]> + - define rename <[prompt]>]]> + - flag <[rename]> anvil_input:true + - inventory set slot:1 origin:<[rename]> destination:<[inventory]> + - flag <[player]> anvil_input:<[callback]> + - inventory open destination:<[inventory]> player:<[player]> + +# Handles anvil input events +anvil_input_world: + debug: false + type: world + events: + on player prepares anvil craft item: + - if !: + - stop + - determine 0 passively + - wait 1t + - take flagged:anvil_input quantity:9999 + on player clicks in anvil: + - if !: + - stop + - determine cancelled passively + - if != 3: + - stop + - define result ]>].strip_color> + - define callback + - flag anvil_input:! + - playsound sound:input.ok custom + - run <[callback]> def.player: def.input:<[result]> + - inventory close + - wait 1t + - take flagged:anvil_input quantity:9999 + - adjust item_on_cursor: + on player closes anvil: + - if !: + - stop + - flag anvil_input:! + - wait 1t + - take flagged:anvil_input quantity:9999 + - narrate "<&c>Cancelled input..." + on player join: + - take flagged:anvil_input quantity:9999 diff --git a/scripts/lib/ball.dsc b/scripts/lib/ball.dsc new file mode 100644 index 0000000..e51f63b --- /dev/null +++ b/scripts/lib/ball.dsc @@ -0,0 +1,149 @@ +# Ball Library +# A library that manages & controls "bouncing balls", i.e. some kind of game ball +# which has gravity, movement, collision, and so on. +# It also efficiently handles everything and adds custom event handlers that other +# plugins can handle. + + +# Creates a new ball with the given id, at the given location, with the given +# collision size and using the given display item, and some gravity multiplier. +# Only one ball with a given id can exist at one time. If this method is called +# while another ball with this id exists, it will be removed automatically. +ball_create: + debug: false + type: task + definitions: id|location|size|display_item|gravity_multiplier + script: + - ~run ball_remove def.id:<[id]> + - spawn slime[silent=true;size=<[size]>;has_ai=false;visible=false] <[location].with_pitch[0].with_yaw[0]> save:ball_collision + - define ball_collision + - define size <[ball_collision].bounding_box.get[1].sub[<[ball_collision].location>].x.abs.add[0.01]> + - spawn armor_stand[invulnerable=true;has_ai=false;gravity=false;visible=false] <[location].with_pitch[0].with_yaw[0].below[<[size].add[1]>]> save:ball_display + - define ball_display + - adjust <[ball_display]> equipment:]> + - flag <[ball_collision]> ball:<[id]> + - flag <[ball_collision]> ball_display:<[ball_display]> + - flag <[ball_collision]> ball_velocity:]> + - flag <[ball_collision]> ball_size:<[size]> + - flag <[ball_collision]> ball_gravity:<[gravity_multiplier]> + - flag <[ball_display]> ball:<[id]> + - flag server ball:].with[<[id]>].as[<[ball_collision]>]> + - determine <[ball_collision]> + +# Removes a ball by id. If that ball does not exist, it will silently fail. +ball_remove: + debug: false + type: task + definitions: id + script: + - if ].contains[<[id]>]>: + - remove ].flag[ball_display]> + - remove ]> + - flag server ball:]> + +# Gets a ball by id. +ball_get: + debug: false + type: procedure + definitions: id + script: + - determine ].get[<[id]>]> + +# Adds a vector to the ball's current velocity +# This has the effect of "pushing" the ball in that direction. +ball_vector_add: + debug: false + type: task + definitions: ball|vector + script: + - flag <[ball]> ball_velocity:<[ball].flag[ball_velocity].add[<[vector]>]> + +# Handling a ball's event: +# Create a world script and add the following event +# // on custom event id:ball_move: +# The following context is provided: +# - (EleemntTag) - the ball's ID. +# - (EntityTag) - the ball entity with current state in its flag_map +# - (LocationTag) - the ball's current location +# - (LocationTag) - the ball's computed next location, which may be reflected if it bounced +# - (LocationTag) - the ball's current velocity +# - (LocationTag) - the ball's next computed velocity +# - (ElementTag) - true if the ball bounced, false otherwise +# - (ElementTag) - true if the ball bounced or is on the ground, false otherwise +# You can cancel the event as any other event, or you can "determine output:" containing: +# - element 1 (LocationTag): the next location for the ball for when it gets moved +# - element 2 (LocationTag): the next velocity for the next processing tick + +## Do not change! This handles updating the ball's physics as well as movement. +ball_internal_physics_update: + debug: false + type: world + events: + on tick: + - foreach ]> key:id as:ball: + - run ball_internal_physics_update_ball def.ball:<[ball]> + on entity damaged: + - if : + - determine cancelled passively + on player right clicks entity: + - if : + - determine cancelled passively + +ball_internal_physics_update_ball: + debug: false + type: task + definitions: ball + script: + - define velocity <[ball].flag[ball_velocity]> + - define gravity <[ball].flag[ball_gravity].mul[0.035]> + - define now <[ball].location> + - define next <[ball].location.add[<[velocity]>]> + - define yaw <[next].direction[<[now]>].yaw.sub[180].if_null[0]> + - define pitch ].normalize>].represented_angle.to_degrees.sub[90].if_null[0]> + - define now <[now].with_yaw[<[yaw]>].with_pitch[<[pitch]>]> + - define size <[ball].flag[ball_size]> + - define trace <[now].ray_trace[range=<[now].distance[<[next]>].add[<[size]>]>].if_null[null]> + - define bounced false + - if <[trace]> != null: + - define bounced true + - define normal <[trace].direction.vector> + - define direction <[next].sub[<[now]>]> + - define dot <[direction].x.mul[<[normal].x>].add[<[direction].y.mul[<[normal].y>]>].add[<[direction].z.mul[<[normal].z>]>]> + - define reflection <[direction].sub[<[normal].mul[<[dot].mul[2]>]>].mul[0.65]> + - define next <[trace].add[<[reflection]>]> + - define velocity <[reflection]> + - if ]> > 200: + - playsound <[now]> sound:BLOCK_STONE_BREAK pitch:1.8 + - flag <[ball]> ball_sound_time: + - define grounded false + - if !<[ball].location.below[<[size].div[4]>].material.is_solid>: + - define velocity <[velocity].mul[0.99]> + - define velocity <[velocity].add[0,-<[gravity]>,0]> + - else: + - define velocity <[velocity].mul[0.75]> + - define next <[next].with_y[<[next].above[<[size].add[0.25]>].block.y>]> + - define grounded true + - if <[next].sub[<[now]>].vector_length_squared> >= 0.01: + - definemap event_context: + ball_id: <[ball].flag[ball]> + ball: <[ball]> + now: <[now]> + next: <[next]> + velocity_t0: <[ball].flag[ball_velocity]> + velocity_t1: <[velocity]> + bounced: <[bounced]> + ground: <[grounded]> + - customevent id:ball_move context:<[event_context]> save:move_event + - if : + - if : + - stop + - if !: + - define changes + - define next <[changes].get[1].if_null[<[next]>]> + - define velocity <[changes].get[2].if_null[<[velocity]>]> + - flag <[ball]> ball_velocity:<[velocity]> + - if <[size]> <= 2: + - teleport <[ball].flag[ball_display]> <[next].below[<[size].add[0.7]>]> + - else: + - teleport <[ball].flag[ball_display]> <[next].below[<[size].add[0.7]>]> + - teleport <[ball]> <[next]> diff --git a/scripts/lib/custom_block.dsc b/scripts/lib/custom_block.dsc new file mode 100644 index 0000000..2d33d0b --- /dev/null +++ b/scripts/lib/custom_block.dsc @@ -0,0 +1,179 @@ +# +# Custom Block - a lib/framework to create custom blocks with display entities easily. +# Note: this prioritizes being very fast even for many blocks, players, and without lag even on Vanilla. +# As a result, the range and scope of this is limited to that; you should *really* use note-blocks or +# tripwire block states for most things if you can help it. A mix of both is best! +# +# You should change the computations to handle more chunks instead of just a 3x3 area if you don't expect +# too many players, if your CPU is particularly powerful and fast, and if you don't mind client-side lag. +# +# This library will automatically "render" only the custom blocks in a certain range around the player. +# By default, this is a 3x3 chunk area around the player; the item displays have a 0.75 view-range. +# This will not show the custom entities particularly far, but it will ensure very good FPS & TPS. +# The algorithm should be fairly fast, especially for Denizen; likely a pure Java algorithm would +# have better performance but not by much, since the `fakespawn` and `flag` utils of Denizen are +# hard to beat. +# + +# API +custom_block_create: + debug: false + type: task + definitions: at|material|pitch|yaw|headless + script: + - define pitch <[pitch].if_null[0]> + - define yaw <[yaw].if_null[0]> + - define world <[at].world.name> + - define chunk_x <[at].chunk.x> + - define chunk_z <[at].chunk.z> + # + - define entry_key custom_block_<[world]>,<[chunk_x]>,<[chunk_z]> + - define at <[at].center> + - define where <[at].x>,<[at].y>,<[at].z> + - define value_key <[where]>,<[pitch]>,<[yaw]>,<[material]> + # + - define block_set ].if_null[]> + - if <[block_set].filter_tag[<[filter_value].starts_with[<[where]>]>].size> > 0: + - debug error "[Custom Block Lib] Duplicate block add: <[where]>,<[world]>! Call custom_block_destroy first" + - stop + - define block_set <[block_set].include[<[value_key]>]> + - flag server <[entry_key]>:<[block_set]> + # + - if <[headless].if_null[false]>: + - stop + - define players + - repeat 3 from:<[chunk_x].sub[1]> as:i: + - repeat 3 from:<[chunk_z].sub[1]> as:k: + - define chunk ,<[k]>,<[world]>]> + - foreach <[chunk].players> as:player: + - define players <[players].include[<[player]>].deduplicate> + - foreach <[players]> as:player: + - run custom_block_render def.player:<[player]> + +custom_block_destroy: + debug: false + type: task + definitions: at|headless + script: + - define world <[at].world.name> + - define chunk_x <[at].chunk.x> + - define chunk_z <[at].chunk.z> + - define entry_key custom_block_<[world]>,<[chunk_x]>,<[chunk_z]> + # + - define at <[at].center> + - define where <[at].x>,<[at].y>,<[at].z> + # + - define block_set ].if_null[]> + - define block_set_length <[block_set].size> + - define block_set <[block_set].filter_tag[<[filter_value].starts_with[<[where]>].not>]> + - if <[block_set].size> == <[block_set_length]>: + - debug error "[Custom Block Lib] Tried removing inexistent custom block: <[where]>,<[world]>" + - stop + - if <[block_set].size> == 0: + - flag server <[entry_key]>:! + - else: + - flag server <[entry_key]>:<[block_set]> + # + - if <[headless].if_null[false]>: + - stop + - define players + - repeat 3 from:<[chunk_x].sub[1]> as:i: + - repeat 3 from:<[chunk_z].sub[1]> as:k: + - define chunk ,<[k]>,<[world]>]> + - foreach <[chunk].players> as:player: + - define players <[players].include[<[player]>].deduplicate> + - foreach <[players]> as:player: + - run custom_block_render def.player:<[player]> + +custom_block_at: + debug: false + type: procedure + definitions: at + script: + - define world <[at].world.name> + - define chunk_x <[at].chunk.x> + - define chunk_z <[at].chunk.z> + - define entry_key custom_block_<[world]>,<[chunk_x]>,<[chunk_z]> + # + - define at <[at].center> + - define where <[at].x>,<[at].y>,<[at].z> + # + - if !]>: + - determine null + - define block_set ]> + - foreach <[block_set]> as:cblock: + - if <[cblock].starts_with[<[where]>]>: + - determine <[cblock].split[,].get[6]> + - determine null + +# Render routine +custom_block_flush: + debug: false + type: task + definitions: player|complete + script: + - define complete <[complete].if_null[false]> + - define prerendered <[player].flag[custom_block_prerendered].if_null[]> + - if <[complete]>: + - foreach <[player].fake_entities> as:fentity: + - if <[fentity].custom_name.contains[__CustomBlock__].if_null[false]>: + - fakespawn <[fentity]> cancel player:<[player]> + - else: + - foreach <[player].fake_entities> as:fentity: + - if <[fentity].custom_name.contains[__CustomBlock__].if_null[false]>: + - if !<[prerendered].contains[<[fentity].location.escaped>]>: + - fakespawn <[fentity]> cancel player:<[player]> + +custom_block_render: + debug: false + type: task + definitions: player + script: + - define world <[player].location.world.name> + - define chunk_x <[player].location.chunk.x> + - define chunk_z <[player].location.chunk.z> + - define player_y <[player].location.y> + - flag <[player]> custom_block_lrx:<[chunk_x]> + - flag <[player]> custom_block_lrz:<[chunk_z]> + - flag <[player]> custom_block_lry:<[player_y]> + - define prerendered <[player].flag[custom_block_prerendered].if_null[]> + - define valid + - repeat 3 from:<[chunk_x].sub[1]> as:i: + - repeat 3 from:<[chunk_z].sub[1]> as:k: + - define entry_key custom_block_<[world]>,<[i]>,<[k]> + - if ]>: + - foreach ]> as:cblock: + - define cblock <[cblock].split[,]> + - if <[cblock].get[2].sub[<[player_y]>].abs> > 24: + - foreach next + - define at ,<[cblock].get[2]>,<[cblock].get[3]>,<[cblock].get[4]>,<[cblock].get[5]>,<[world]>]> + - define valid <[valid].with[<[at].escaped>].as[true]> + - if <[prerendered].contains[<[at].escaped>]>: + - foreach next + - define of <[cblock].get[6]> + - define display + - adjust def:display item:]> + - adjust def:display display:fixed + - adjust def:display view_range:0.75 + - adjust def:display custom_name:__CustomBlock__ + - fakespawn <[display]> <[at]> player:<[player]> duration:-1 + - define prerendered <[prerendered].with[<[at].escaped>].as[true]> + - define prerendered <[prerendered].filter_tag[<[valid].contains[<[filter_key]>]>]> + - flag <[player]> custom_block_prerendered:<[prerendered]> + - run custom_block_flush def.player:<[player]> + +custom_block_world: + debug: false + type: world + events: + after player joins: + - flag custom_block_prerendered:! + - run custom_block_flush def.player: def.complete:true + - ~run custom_block_render def.player: + on player walks: + - ratelimit 5t + - if == : + - if == : + - if ].abs> <= 8: + - stop + - ~run custom_block_render def.player: diff --git a/scripts/lib/formats.dsc b/scripts/lib/formats.dsc new file mode 100644 index 0000000..2c0b19e --- /dev/null +++ b/scripts/lib/formats.dsc @@ -0,0 +1,8 @@ +# +# Common Formats - change these to change everywhere! +# + +formats_prefix: + debug: false + type: format + format: <&8>[<&color[#ff96ee]>Sakura<&color[#e8e8e8]>Falls<&8>] <&7><[text]> diff --git a/scripts/lib/gui_restore.dsc b/scripts/lib/gui_restore.dsc new file mode 100644 index 0000000..9fd1ff8 --- /dev/null +++ b/scripts/lib/gui_restore.dsc @@ -0,0 +1,63 @@ +# +# GUI Restore - deletes & restores inventories that start with +# some specific special chars (usually color codes) +# (but also anvils because of anvil_input.dsc) +# + +gui_restore_config: + debug: false + type: data + special_chars: <&f>邑邑邑邑 + +gui_restore_set_later: + debug: false + type: task + definitions: player|slot|item + script: + - flag <[player]> gui_restore_later:<[player].flag[gui_restore_later].if_null[].with[<[slot]>].as[<[item]>]> + +gui_restore_save: + debug: false + type: task + definitions: player + script: + - if <[player].has_flag[gui_restore]>: + - run gui_restore_load def.player: + - flag <[player]> gui_restore:<[player].inventory.map_slots> + - define equipment <[player].inventory.equipment_map> + - inventory clear player:<[player]> + - foreach <[equipment]> key:slot as:item: + - inventory set slot:<[slot]> origin:<[item]> player:<[player]> + - foreach <[player].flag[gui_restore_later].if_null[]> key:slot as:item: + - inventory set slot:<[slot]> origin:<[item]> player:<[player]> + +gui_restore_load: + debug: false + type: task + definitions: player + script: + - if !<[player].has_flag[gui_restore]>: + - stop + - flag <[player]> gui_restore_later:! + - inventory clear player:<[player]> + - foreach <[player].flag[gui_restore]> key:slot as:item: + - inventory set slot:<[slot]> origin:<[item]> player:<[player]> + - flag <[player]> gui_restore:! + +gui_restore_world: + debug: false + type: world + events: + on player joins: + - if : + - flag gui_restore_later:! + - if : + - run gui_restore_load def.player: + on player opens inventory bukkit_priority:lowest: + - if ]>: + - run gui_restore_save def.player: + - if == anvil: + - run gui_restore_save def.player: + on player closes inventory bukkit_priority:lowest: + - if : + - run gui_restore_load def.player: diff --git a/scripts/lib/menu.dsc b/scripts/lib/menu.dsc new file mode 100644 index 0000000..9775786 --- /dev/null +++ b/scripts/lib/menu.dsc @@ -0,0 +1,100 @@ +# +# Utility for creating menus with click handlers on them. +# It also provides a way to make paged menus more easily. +# + +# opens a menu with a title, of size, based on the contents. +# the size must be a multiple of 9 +# +# the contents should be a map pairing the slot to three keys +# the 'item' key is the item's display in the menu +# the 'script' key is the script to call when clicked +# the 'definitions' key is a map pairing definition name to value +# if the script is null, then no script is called on interaction +# if the definitions are null, the script is called without definitions +# at the end, after opening, this task determines the opened inventory. +# +# the fill argument can be ommitted, or is an item which fills any +# slots not specified in the contents map +menu_open: + debug: false + type: task + definitions: player|title|size|contents|fill + script: + - define display_key ].remove[1].parse_tag[<&ss><[parse_value]><&sp>].separated_by[]> + - define inventory <[display_key]>;size=<[size]>]]> + # fill + - foreach <[contents]> key:slot as:data: + - define item <[data].get[item].if_null[null]> + # bad item + - if <[item]> == null: + - foreach next + # fit other data + - define script <[data].get[script].if_null[null]> + - define definitions <[data].get[definitions].if_null[null]> + # flag item accordingly + - if <[script]> != null: + - flag <[item]> _menu_script:<[script]> + - if <[definitions]> != null: + - flag <[item]> _menu_definitions:<[definitions]> + # set in inventory + - inventory set slot:<[slot]> origin:<[item]> destination:<[inventory]> + # has fill attribute? + - if <[fill].if_null[null]> != null: + - repeat <[size]> as:slot: + - if !<[contents].contains[<[slot]>]>: + - inventory set slot:<[slot]> origin:<[fill]> destination:<[inventory]> + # open inventory and return + - inventory open player:<[player]> destination:<[inventory]> + - determine <[inventory]> + +# checks if the passed menu parameter is actually +# a menu or not based on its display key +menu_is: + debug: false + type: procedure + definitions: inventory + script: + - if <[inventory].title.length.sub[22]> < 1: + - determine false + - define display_key <[inventory].title.substring[<[inventory].title.length.sub[22]>].replace[<&sp>].with[].from_secret_colors> + - determine <[display_key].equals[menu]> + +# determines the title of a menu ignoring its display key +# this also strips any colors to avoid annoyances +# useful for other handlers elsewhere +menu_title: + debug: false + type: procedure + definitions: inventory + script: + - determine <[inventory].title.substring[0,<[inventory].title.length.sub[25]>].strip_color.if_null[Unknown]> + +# handles basic clicks in menu inventories +menu_click_handler: + debug: false + type: world + events: + on player clicks item in inventory: + # ignore non-gui clicks + ## as of 1.20.4 + - if != CHEST: + - stop + # ignore non menus + - if !]>: + - stop + # valid menu, stop all events + - determine cancelled passively + # ignore out of bounds clicks + - if > : + - stop + # handle click if any + - define script + - if <[script]> != null: + - define definitions + - if <[definitions]> == null: + # run plain script + - run <[script]> + - else: + # run scripts with definitions + - run <[script]> defmap:<[definitions]> diff --git a/scripts/lib/textbox.dsc b/scripts/lib/textbox.dsc new file mode 100644 index 0000000..6884398 --- /dev/null +++ b/scripts/lib/textbox.dsc @@ -0,0 +1,317 @@ +# +# Textbox - a lib/framework to display an Undertale/RPG style text box. +# Requires resource pack to be set up correctly. +# The magic character is U+9300, i.e 錀, which you can change in the code. +# + +# Writes into the text box display. +# You should provide at most 3 lines into the textbox (though other values are technically allowed). +# Lines are split using $$nl: line3s should be simple text, not a list directly. +# Optionally, provide an avatar_unicode character that should be placed next to the textbox. +textbox_write: + debug: false + type: task + definitions: player|queue|line3s|avatar_unicode + script: + - define avatar_unicode <[avatar_unicode].if_null[null]> + - if <[player].flag[textbox_state].if_null[null]> == writing: + - stop + - if !<[player].is_online>: + - if <[queue].if_null[null]> != null: + - debug log "[Textbox] Write; cancelled queue <[queue].numeric_id><&at><[queue].script.name> for <[player].name>; offline player." + - queue stop <[queue]> + - run textbox_flush def.player:<[player]> + - stop + - if !<[player].is_on_ground> && != spectator: + - if <[player].location.below.material.is_solid>: + - teleport <[player]> <[player].location.below.above.with_y[<[player].location.below.above.y.round_down>]> + - else: + - stop + - waituntil <[player].flag[textbox_state].if_null[null]> == null max:5s + - ~run textbox_flush def.player:<[player]> + - if !<[player].is_online>: + - if <[queue].if_null[null]> != null: + - debug log "[Textbox] Write; cancelled queue <[queue].numeric_id><&at><[queue].script.name> for <[player].name>; offline player." + - queue stop <[queue]> + - run textbox_flush def.player:<[player]> + - stop + - define lines <[line3s].split[$$nl].parse_tag[<[parse_value].trim>]> + - flag <[player]> textbox_state:writing + - flag <[player]> textbox_input:<[lines]> + - flag <[player]> textbox_lines:<[lines].size> + - bossbar create textbox_<[player].uuid>_ui players:<[player]> title:錀 + - bossbar create textbox_<[player].uuid>_1 players:<[player]> title: + - bossbar create textbox_<[player].uuid>_2 players:<[player]> title: + - bossbar create textbox_<[player].uuid>_3 players:<[player]> title: + - wait 1t + - if <[avatar_unicode]> != null: + - bossbar create textbox_<[player].uuid>_avatar players:<[player]> title:<[avatar_unicode]> + - foreach <[lines]> as:line: + - if <[player].flag[textbox_state].if_null[null]> != writing: + - stop + - if !<[player].is_online>: + - stop + - repeat <[line].length>: + - if <[player].flag[textbox_state].if_null[null]> != writing: + - stop + - if !<[player].is_online>: + - stop + - bossbar update textbox_<[player].uuid>_<[loop_index]> title:<[line].substring[1,<[value]>]> + - if <[value].sub[1].mod[3]> == 0: + - playsound sound:textbox.text <[player]> custom pitch: + - wait 1t + - if <[line].substring[<[value].add[1]>,<[value].add[1]>].trim.length.if_null[1]> == 0: + - if <[line].substring[<[value]>,<[value]>]> == ".": + - wait 2t + - if <[line].substring[<[value]>,<[value]>]> == "!": + - wait 2t + - if <[line].substring[<[value]>,<[value]>]> == "?": + - wait 2t + - if <[line].substring[<[value]>,<[value]>]> == "-": + - wait 2t + - if <[line].substring[<[value]>,<[value]>]> == ",": + - wait 2t + - wait + - if <[player].flag[textbox_state].if_null[null]> != writing: + - if <[queue].if_null[null]> != null && <[player].flag[textbox_state].if_null[null]> != continue: + - debug log "[Textbox] Write; cancelled queue <[queue].numeric_id><&at><[queue].script.name> for <[player].name>; state mismatch." + - queue stop <[queue]> + - run textbox_flush def.player:<[player]> + - stop + - if !<[player].is_online>: + - if <[queue].if_null[null]> != null: + - debug log "[Textbox] Write; cancelled queue <[queue].numeric_id><&at><[queue].script.name> for <[player].name>; offline player." + - queue stop <[queue]> + - run textbox_flush def.player:<[player]> + - stop + - flag <[player]> textbox_state:continue + +# Skips the textbox and fills in the text quickly - i.e. text mashing +textbox_skip: + debug: false + type: task + definitions: player + script: + - if <[player].flag[textbox_state].if_null[null]> != writing: + - stop + - repeat <[player].flag[textbox_lines]>: + - if !_<[value]>]>: + - bossbar create textbox_<[player].uuid>_<[value]> players:<[player]> title: + - define lines <[player].flag[textbox_input]> + - foreach <[lines]> as:line: + - bossbar update textbox_<[player].uuid>_<[loop_index]> title:<[line]> + - flag <[player]> textbox_state:continue + +# Clears textbox and flushes all flag memory values +textbox_flush: + debug: false + type: task + definitions: player + script: + - if _ui]>: + - bossbar remove textbox_<[player].uuid>_ui + - repeat 3: + - if _<[value]>]>: + - bossbar remove textbox_<[player].uuid>_<[value]> + - if _avatar]>: + - bossbar remove textbox_<[player].uuid>_avatar + - if _top]>: + - bossbar remove textbox_<[player].uuid>_top + - bossbar remove textbox_<[player].uuid>_mid + - bossbar remove textbox_<[player].uuid>_bottom + - flag <[player]> textbox_state:! + - flag <[player]> textbox_input:! + - flag <[player]> textbox_lines:! + - flag <[player]> textbox_choices:! + - wait 10t + +# Handle textbox events +# Internal only! +textbox_world: + debug: false + type: world + events: + # Skip the text and close the textbox by right click + on player right clicks block bukkit_priority:lowest: + - ratelimit 5t + - if == OFF_HAND: + - stop + - inject textbox_handle_click + on player right clicks entity bukkit_priority:lowest: + - ratelimit 5t + - if == OFF_HAND: + - stop + - inject textbox_handle_click + on player animates arm_swing: + - ratelimit 5t + - inject textbox_handle_click + # Disallow block breaking (because skip is done via clicking, even in Creative Mode) + on player breaks block: + - define state + - if <[state]> == writing || <[state]> == continue: + - determine cancelled + # Disallow damage when textbox is active + on player damages entity: + - define state + - if <[state]> == writing || <[state]> == continue: + - determine cancelled + # Flush if rejoin + on player joins: + - run textbox_flush def.player: + # No movement on text + on player walks: + - define state + - if <[state]> == writing || <[state]> == continue: + - if != : + - determine cancelled + - if <[state]> == choice: + - if != : + - determine cancelled passively + - ratelimit 5t + # + - define reference + - define left <[reference].left[0.001]> + - define right <[reference].right[0.001]> + - define up <[reference].forward[0.001]> + - define down <[reference].backward[0.001]> + # + - define min <[left].sub[].vector_length_squared> + - define min_dir left + # + - define right_check <[right].sub[].vector_length_squared> + - if <[right_check]> < <[min]> : + - define min <[right_check]> + - define min_dir right + # + - define up_check <[up].sub[].vector_length_squared> + - if <[up_check]> < <[min]> : + - define min <[up_check]> + - define min_dir top + # + - define down_check <[down].sub[].vector_length_squared> + - if <[down_check]> < <[min]> : + - define min <[down_check]> + - define min_dir bottom + # + - run textbox_internal_choice_select def.player: def.choice_dir:<[min_dir]> + +# Internal only! +textbox_handle_click: + debug: false + type: task + script: + - define state + - if <[state]> == writing: + - determine cancelled passively + - run textbox_skip def.player: + - ratelimit 5t + - else if <[state]> == continue: + - determine cancelled passively + - playsound sound:textbox.close custom + - ~run textbox_flush def.player: + - ratelimit 10t + - else if <[state]> == choice: + - determine cancelled passively + - playsound sound:input.ok custom + - flag textbox_choice_select: + - ~run textbox_flush def.player: + - ratelimit 10t + +# Writes into the text box display. +# You should provide at least 2 and up to 4 choices. +# The choices are defined in the top, left, right, and bottom directions. +# The choices map has this structure: +# choices: +# left: +# text: 'Some Choice 1' +# task: task_to_continue_to_1 +# right: +# text: 'Some Choice 2' +# task: task_to_continue_to_2 +# ... +# When selected, the task receives the player as input in the <[player]> definition. +# The task also receives the direction that was picked in <[choice]>: top, bottom, left or right +textbox_choice: + debug: false + type: task + definitions: player|queue|choices + script: + - if <[player].flag[textbox_state].if_null[null]> == choice: + - stop + - if !<[player].is_online>: + - if <[queue].if_null[null]> != null: + - debug log "[Textbox] Choice; cancelled queue <[queue].numeric_id><&at><[queue].script.name> for <[player].name>; offline" + - queue stop <[queue]> + - run textbox_flush def.player:<[player]> + - stop + - if !<[player].is_on_ground> && != spectator: + - if <[player].location.below.material.is_solid>: + - teleport <[player]> <[player].location.below.above.with_y[<[player].location.below.above.y.round_down>]> + - else: + - stop + - waituntil <[player].flag[textbox_state].if_null[null]> == null + - ~run textbox_flush def.player:<[player]> + - flag <[player]> textbox_state:choice + - flag <[player]> textbox_choices:].with[current].as[left]> + - define first_choice left + - if <[choices].keys.contains[top]>: + - define first_choice top + - if !<[choices].keys.contains[left]>: + - define first_choice <[choices].keys.first> + - run textbox_internal_choice_select def.player:<[player]> def.choice_dir:<[first_choice]> + - waituntil <[player].flag[textbox_choice_select].if_null[null]> != null || !<[player].is_online> + - if !<[player].is_online>: + - if <[queue].if_null[null]> != null: + - debug log "[Textbox] Choice; cancelled queue <[queue].numeric_id><&at><[queue].script.name> for <[player].name>; offline" + - queue stop <[queue]> + - run textbox_flush def.player:<[player]> + - stop + - define result <[player].flag[textbox_choice_select]> + - flag <[player]> textbox_choice_select:! + - determine <[result]> + +# Internal only! +textbox_internal_choice_select: + debug: false + type: task + definitions: player|choice_dir + script: + - if !_top]>: + - bossbar create textbox_<[player].uuid>_ui players:<[player]> title:錀 + - bossbar create textbox_<[player].uuid>_top players:<[player]> title: + - bossbar create textbox_<[player].uuid>_mid players:<[player]> title: + - bossbar create textbox_<[player].uuid>_bottom players:<[player]> title: + - define choices <[player].flag[textbox_choices].get[data]> + # + - define left <&0><&l><[choices].get[left].get[text].if_null[null]> + - define right <&0><&l><[choices].get[right].get[text].if_null[null]> + - define top <&0><&l><[choices].get[top].get[text].if_null[null]> + - define bottom <&0><&l><[choices].get[bottom].get[text].if_null[null]> + # + - if <[choice_dir]> == left: + - if <[left]> == <&0><&l>null: + - stop + - define left "<&4>❤ <&0><&l><[left]>" + - else if <[choice_dir]> == right: + - if <[right]> == <&0><&l>null: + - stop + - define right "<&4>❤ <&0><&l><[right]>" + - else if <[choice_dir]> == top: + - if <[top]> == <&0><&l>null: + - stop + - define top "<&4>❤ <&0><&l><[top]>" + - else: + - if <[bottom]> == <&0><&l>null: + - stop + - define bottom "<&4>❤ <&0><&l><[bottom]>" + # + - define mid_padding ].repeat[].sub[<[right].strip_color.length>]>]> + # + - if <[top]> != <&0><&l>null: + - bossbar update textbox_<[player].uuid>_top title:<[top]> + - if <[left]> != <&0><&l>null || <[right]> != <&0><&l>null: + - bossbar update textbox_<[player].uuid>_mid title:<[left]><[mid_padding]><[right]> + - if <[bottom]> != <&0><&l>null: + - bossbar update textbox_<[player].uuid>_bottom title:<[bottom]> + - flag <[player]> textbox_choices:].with[current].as[<[choice_dir]>]> + - playsound BLOCK_NOTE_BLOCK_BIT <[player]> pitch:2 diff --git a/scripts/liteprofilesutils/liteprofilesutils_command.dsc b/scripts/liteprofilesutils/liteprofilesutils_command.dsc new file mode 100644 index 0000000..a56bfb9 --- /dev/null +++ b/scripts/liteprofilesutils/liteprofilesutils_command.dsc @@ -0,0 +1,26 @@ +liteprofilesutils_command_profiles: + debug: false + type: command + name: profiles + description: Manage your profiles, neatly. + aliases: + - accountmenu + - pfm + usage: /profiles + tab completions: + 1: + permission: liteprofilesutils.command.profiles + script: + - if != player: + - narrate "<&c>Run this command as a player" + - stop + - define player + - clickable save:accept usages:1 until:30s: + - flag <[player]> liteprofiles_legacy_menu:! + - run liteprofilesutils_show_menu def.player:<[player]> + - narrate + - narrate format:formats_prefix "Our profile system lets you own multiple 'unique accounts' by tricking the server to hand you new unique IDs, which may cause the server to incorrectly save your inventory, ranks, or other data." + - narrate + - narrate "<&c>[<&4><&l>!<&c>] <&7>Consider this feature <&6>experimental<&7>; take screenshots of your items and ranks if you are concerned." + - narrate <&l>[ I UNDERSTAND ]].on_click[]> + - narrate diff --git a/scripts/liteprofilesutils/liteprofilesutils_data.dsc b/scripts/liteprofilesutils/liteprofilesutils_data.dsc new file mode 100644 index 0000000..ef3258d --- /dev/null +++ b/scripts/liteprofilesutils/liteprofilesutils_data.dsc @@ -0,0 +1,12 @@ +liteprofilesutils_data: + debug: false + type: data + rank-sync: + - owner + - admin + - media + sync-op: true + join-leave: + join: <&8>[<&a>+<&8>] <&7> + leave: <&8>[<&c>-<&8>] <&7> + welcome: <&8>[<&6><&l>!<&8>] <&e>Welcome ! diff --git a/scripts/liteprofilesutils/liteprofilesutils_tasks.dsc b/scripts/liteprofilesutils/liteprofilesutils_tasks.dsc new file mode 100644 index 0000000..22cfc65 --- /dev/null +++ b/scripts/liteprofilesutils/liteprofilesutils_tasks.dsc @@ -0,0 +1,126 @@ +liteprofilesutils_load_data: + debug: false + type: task + script: + - ~yaml load:../LiteProfiles/data.yml id:liteprofiles_data + +liteprofilesutils_get_master_uuid: + debug: false + type: procedure + definitions: player + script: + - determine ]> + +liteprofilesutils_get_profile_limit: + debug: false + type: procedure + definitions: player + script: + - determine ]> + +liteprofilesutils_get_profile_count: + debug: false + type: procedure + definitions: player + script: + - determine ].sub[1]> + +liteprofilesutils_show_menu: + debug: false + type: task + definitions: player + script: + - ~run liteprofilesutils_load_data + - define masteruuid ]> + - define profilelimit ]> + - define profilecount ]> + - define contents + # master uuid + - define masteritem + - define mastername ]>]> + - if <[mastername]> == null: + - define mastername "Unnamed Character" + - adjust def:masteritem display:<&f><[mastername]> + - adjust def:masteritem lore:Master Profile|<&f>|<&8>UUID:|<&8><[masteruuid]>]> + - flag <[masteritem]> liteprofiles:]> + - define contents <[contents].include[<[masteritem]>]> + # slave uuids + - define sortedslaveitems + - foreach ].keys.exclude[active].exclude[<[masteruuid]>]> as:slaveuuid: + - define slaveitem + - define slavename ]>]> + - if <[slavename]> == null: + - define slavename "Unnamed Character" + - adjust def:slaveitem display:<&f><[slavename]> + - adjust def:slaveitem lore:Alt Profile|<&f>|<&8>UUID:|<&8><[slaveuuid]>]> + - flag <[slaveitem]> liteprofiles:]> + - define sortedslaveitems <[sortedslaveitems].include[<[slaveitem]>]> + - define sortedslaveitems <[sortedslaveitems].sort_by_value[display]> + - define contents <[contents].include[<[sortedslaveitems]>]> + # free slots + - if <[profilecount]> < <[profilelimit].sub[1]>: + - define freeitem + - adjust def:freeitem "display:<&b>Free Slot" + - adjust def:freeitem lore:Click here to create a new profile]> + - flag <[freeitem]> liteprofiles: + - define contents <[contents].include[<[freeitem]>]> + - repeat <[profilelimit].sub[<[profilecount]>]>: + - define unuseditem + - adjust def:unuseditem "display:<&7>Free Slot" + - define contents <[contents].include[<[unuseditem]>]> + # show + - run liteprofiles_legacy_menus_open def.player:<[player]> def.id:liteprofiles def.page:0 def.contents:<[contents]> + +# # # # # # # # # # # # # # # # # # # # # # # # # +# LEGACY MENU LIBRARY PROVIDED IN LITEPROFILES # +# # # # # # # # # # # # # # # # # # # # # # # # # +# buttons +liteprofiles_legacy_menus_button_previous: + debug: false + type: item + material: ender_pearl + display name: <&a><<><<> + +liteprofiles_legacy_menus_button_next: + debug: false + type: item + material: ender_eye + display name: <&a><>><>> + +# generate menu +liteprofiles_legacy_menus_open: + debug: false + type: task + definitions: player|id|page|contents + script: + - define inventory 邑邑邑邑鄈;size=18]]> + - foreach <[contents].get[<[page].mul[9].add[1]>].to[<[page].add[1].mul[9]>].if_null[]> as:item: + - inventory set origin:<[item]> destination:<[inventory]> slot:<[loop_index]> + - if <[page]> > 0: + - inventory set origin: destination:<[inventory]> slot:13 + - if <[contents].size> > <[page].add[1].mul[9]>: + - inventory set origin: destination:<[inventory]> slot:15 + - flag <[player]> liteprofiles_legacy_menu:].with[page].as[<[page]>].with[contents].as[<[contents]>]> + - define profilelimit ]> + - inventory set origin:How to use;lore=<&7>Your master profile is your original UUID (your main account).|<&7>You will see your other profiles in the menu. Click on any button|<&7>to change to that profile.|<&f>|<&7>You may also create new profiles if you have free slots.|<&7>You currently own <&e><[profilelimit]> profiles<&7>. You may obtain more|<&7>with donation ranks or for animal characters.]]> destination:<[inventory]> slot:10 + - inventory open player:<[player]> destination:<[inventory]> + +# menu button handler +liteprofiles_legacy_menus_button_handler: + debug: false + type: world + events: + on player clicks in inventory: + - if != <&f>邑邑邑邑鄈: + - stop + - determine cancelled passively + # if air ignore, means button doesnt exist or is to be handled elsewhere + # 13 prev 15 next everything else ignore + - if == 13: + - if : + - define data + - run liteprofiles_legacy_menus_open def.player: def.id:<[data].get[id]> def.page:<[data].get[page].sub[1]> def.contents:<[data].get[contents]> + - if == 15: + - if : + - define data + - run liteprofiles_legacy_menus_open def.player: def.id:<[data].get[id]> def.page:<[data].get[page].add[1]> def.contents:<[data].get[contents]> \ No newline at end of file diff --git a/scripts/liteprofilesutils/liteprofilesutils_world.dsc b/scripts/liteprofilesutils/liteprofilesutils_world.dsc new file mode 100644 index 0000000..be7d75d --- /dev/null +++ b/scripts/liteprofilesutils/liteprofilesutils_world.dsc @@ -0,0 +1,95 @@ +liteprofilesutils_world: + debug: false + type: world + events: + ## load YAML data + after server start: + - ~run liteprofilesutils_load_data + ## patch join/leave & rank sync + on player quits: + - define masteruuid ]> + - define profilelimit + # + - flag server liteprofilesutils_lastseengroups:].with[<[masteruuid]>].as[]> + # + - define lastbestlimit ]> + - flag server liteprofilesutils_lastbestlimit:<[lastbestlimit].with[<[masteruuid]>].as[<[profilelimit].max[<[lastbestlimit].get[<[masteruuid]>].if_null[1]>]>]> + # + - define joinleavedata + - announce <[joinleavedata].get[leave].parsed> + on player joins: + - define masteruuid ]> + # sync groups, O(scary) + - define syncgroupdata + - define lastseengroups ].if_null[]> + - if <[lastseengroups].is_empty>: + - goto joinmessage + - foreach <[lastseengroups].include[]> as:trygroup: + - define ok false + - foreach <[syncgroupdata]> as:matchgroup: + - if <[trygroup].advanced_matches[<[matchgroup]>]>: + - define ok true + - foreach stop + - if !<[ok]>: + - foreach next + - if <[lastseengroups].contains[<[trygroup]>]>: + - if !]>: + - group add <[trygroup]> + - else: + - if ]>: + - group remove <[trygroup]> + - if !: + - group add default + # sync best perm level + - define bestlimit ].if_null[1]> + - if !]>: + - permission add liteprofiles.limit.<[bestlimit]> + # sync op + - if ].is_op>: + - adjust is_op:true + - else: + - adjust is_op:false + # sync whitelist + - if ].whitelisted>: + - adjust whitelisted:true + - else: + - adjust whitelisted:false + # adjust join message + - mark joinmessage + - define joinleavedata + - if == <[masteruuid]>: + - if ].contains[]>: + - announce <[joinleavedata].get[welcome].parsed> + - flag server liteprofilesutils_welcome:].include[]> + - announce <[joinleavedata].get[join].parsed> + ## prevent /profile remove + on command: + - if == profile || == account || == pf: + - if == remove: + - determine cancelled passively + - narrate "<&c>You are forbidden from performing this operation." + ## GUI menu + on player clicks in inventory bukkit_priority:low: + - if != <&f>邑邑邑邑鄈: + - stop + - if != liteprofiles: + - stop + - if > 45: + - stop + - if : + - stop + # logic + - define data + - if <[data]> == null: + - stop + - if <[data].get[type]> == master: + - define value <[data].get[value]> + - inventory close + - execute as_player "profile use <[value]>" + - else if <[data].get[type]> == slave: + - define value <[data].get[value]> + - inventory close + - execute as_player "profile use <[value]>" + - else if <[data].get[type]> == free: + - execute as_player "profile add" + - run liteprofilesutils_show_menu def.player: diff --git a/scripts/misc/compatibility_check.dsc b/scripts/misc/compatibility_check.dsc new file mode 100644 index 0000000..bff5525 --- /dev/null +++ b/scripts/misc/compatibility_check.dsc @@ -0,0 +1,38 @@ +compatibility_check_compare_versions: + debug: false + type: procedure + definitions: version1|version2 + script: + - define v1split <[version1].split[.]> + - define v2split <[version2].split[.]> + - foreach <[v1split]> as:v1splitpart: + - define v2splitpart <[v2split].get[<[loop_index]>].if_null[0]> + - if <[v1splitpart]> > <[v2splitpart]>: + - determine 1 + - if <[v1splitpart]> < <[v2splitpart]>: + - determine -1 + - if <[v2split].size> > <[v1split].size>: + - determine -1 + - determine 0 + +compatibility_check_world: + debug: false + type: world + events: + after player joins: + - define player_version + - define server_version + - if |<[server_version]>]> == -1: + - wait 5s + - if !: + - stop + - narrate "" + - narrate "<&c><&l>[<&4><&l>!<&c><&l>] <&c>You are using an outdated Minecraft version!" + - narrate "<&6>Your version: <&f><[player_version]>" + - narrate "<&6>Server version: <&f><[server_version]>" + - narrate "" + - narrate "<&f>You can still play, however we strongly encourage you to consider <&e>updating your game<&f>." + - narrate "<&f>We will not offer bug support if you are using an outdated version!" + - narrate "" + - narrate "<&7>(Your ViaVersion protocol: )" + - narrate "" \ No newline at end of file diff --git a/scripts/payto/.DS_Store b/scripts/payto/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/scripts/payto/.DS_Store differ diff --git a/scripts/payto/payto_commands.dsc b/scripts/payto/payto_commands.dsc new file mode 100644 index 0000000..be48986 --- /dev/null +++ b/scripts/payto/payto_commands.dsc @@ -0,0 +1,34 @@ +payto_command_payto: + debug: false + type: command + name: payto + usage: /payto (amount) + description: Pays the player you're looking at. + permission: essentials.pay + tab completions: + 1: <<>amount<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if <= 0: + - narrate "<&c>Please enter an amount to pay!" + - stop + - define amount + - if !: + - narrate "<&c>You must enter a number to pay!" + - stop + - if < : + - narrate "<&c>You don't have ." + - stop + - define target + - if <[target]> == null: + - narrate "<&c>Please look at a player to send money to." + - stop + - if <[target].is_npc>: + - narrate "<&c>Please look at a player to send money to." + - stop + - clickable usages:1 until:1m save:pay: + - execute as_player "pay <[target].name> <[amount]>" + - narrate format:formats_prefix "<&7>Would you like to pay <&6><[amount].as_money><&7> to <&6>]>" + - narrate "<&l>[CLICK HERE]].on_click[]>" diff --git a/scripts/phones/phones_commands.dsc b/scripts/phones/phones_commands.dsc new file mode 100644 index 0000000..49f0126 --- /dev/null +++ b/scripts/phones/phones_commands.dsc @@ -0,0 +1,544 @@ +## CALL +phones_commands_phonecall: + debug: false + type: command + name: phonecall + aliases: + - call + description: Call using a phone! + usage: /phonecall (number/contact/message) + permission: phones.command.phonecall + tab complete: + - if : + - determine + - if : + - determine message<>>]> + - determine ]> + script: + # checks... + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - define incall ]> + # mid call? + - if !<[incall]>: + # waiting call? + - if : + - narrate "<&c>Please wait for the call to be accepted, or unequip to cancel the call." + - stop + # no + - if < 1: + - narrate "<&c>Invalid use. First, call a number. Please try / (number/contact)." + - stop + # definitions + - define receiver + - define target |<[receiver]>]> + - if !: + - narrate "<&c>Please hold a phone in your hand, and ensure it is powered on." + - stop + # invalid number/contact + - if <[target]> == null: + - narrate "<&c>Invalid phone number or contact <[receiver]>. Please try again." + - stop + # lmao + - if == <[target]>: + - narrate "<&c>You can't call yourself!" + - stop + # blocked + - if ].if_null[false]>: + - narrate "<&c>The receiver is currently in your blocked numbers." + - stop + - if <[target].flag[phones].get[blocked].contains[].if_null[false]>: + - narrate "<&c>The receiver is unable to be contacted at this time. Try again later." + - stop + # not online/no phone/phone is off/etc... + - if !]>: + - narrate "<&c>The receiver is unable to be contacted at this time. Try again later." + - stop + # mid call... + - if <[target].has_flag[phones_call]>: + - narrate "<&c>The receiver is currently busy. Try again later." + - stop + # call... + - define relative |]> + - define player + # if accepted, go in + - clickable save:accept until:30s: + - if !<[target].item_in_hand.flag[phones].if_null[false]>: + - narrate targets:<[target]> "<&c>Please hold a phone before accepting the call, and ensure it is powered on." + - stop + - nbs stop targets:<[target]> + - clickable cancel:<[player].flag[phones_call_clickable]> + - flag <[target]> phones_call:<[player]> + - flag <[player]> phones_call:<[target]> + - flag <[player]> phones_call_clickable:! + - flag <[target]> phones_is_maybe_called:! + - narrate targets:<[player]> "<&2>*** <&a><[receiver]> <&a>picked up the phone." + - narrate targets:<[target]> "<&2>*** <&a>You picked up the phone." + - define callgroup |<[target]>]> + - narrate targets:<[callgroup]> <&f> + - narrate targets:<[callgroup]> "<&7>Talk using <&e>/call (message)<&7>." + - narrate targets:<[callgroup]> "<&e>Unequip <&7>your phone to <&c>end <&7>the call." + - narrate targets:<[callgroup]> <&f> + # + # before accepted + - if !<[target].has_flag[phones_is_maybe_called]>: + - nbs file:data/phones/songs/<[target].flag[phones].get[ringtone].if_null[Bad Apple]> play targets:<[target]> + - narrate targets:<[target]> "<&6>*** <&e>You're being called by <&e><[relative]><&7>." + - narrate targets:<[target]> "<&hover[<&a>Click to accept call from <[relative]>...]><&l>[ ACCEPT ]].on_click[]><&end_hover>" + # wait... + - flag phones_call:<[target]> + - flag phones_call_clickable: + - flag <[target]> phones_is_maybe_called:true expire:30s + - narrate "<&6>*** <&e>You started to ring <&7><[receiver]>" + - narrate "<&7>Unequip your phone to cancel the call." + - else: + # yes + - if < 1: + - narrate "<&c>Invalid use. You are mid-call - please try / (message)." + - narrate "<&7>Note: you can unequip the phone to end the current call." + - stop + # definitions + - define target + - define message + # speak... + - define final "<&6>[<&7>P<&6>] <&f>]> ]>]> ]> <&f>says <&dq><[message]><&f><&dq> over the phone." + - narrate targets:].deduplicate> <[final]> + +## callw, cally use similar routines +phones_command_call_common_routine: + debug: false + type: task + script: + # checks... + - if != player: + - narrate "<&c>Please run this command as a player." + - define continue false + - stop + - define incall ]> + # mid call? + - if !<[incall]>: + # waiting call? + - if : + - narrate "<&c>Please wait for the call to be accepted, or unequip to cancel the call." + - define continue false + - stop + # no + - narrate "<&c>Invalid use. First, call a number. Please try /call (number/contact)." + - define continue false + - else: + # yes + - if < 1: + - narrate "<&c>Invalid use. You are mid-call - please try / (message)." + - narrate "<&7>Note: you can unequip the phone to end the current call." + - define continue false + - stop + # definitions + - define target + - define message + +phones_command_phonecallwhisper: + debug: false + type: command + name: phonecallwhisper + aliases: + - callwhisper + - callw + description: Whisper over the phone while in a call. + usage: /phonecallwhisper (message) + permission: phones.command.phonecallwhisper + tab complete: + - if : + - determine + - if : + - determine message<>>]> + - determine + script: + - define continue true + - inject phones_command_call_common_routine + - if !<[continue]>: + - stop + # speak... + - define final "<&6>[<&7>P<&6>] <&f>]> ]>]> ]> <&8>whispers <&6><&sq><&7><[message]><&6><&sq> <&8>over the phone." + - narrate targets:].deduplicate> <[final]> + +phones_command_phonecallyell: + debug: false + type: command + name: phonecallyell + aliases: + - callyell + - cally + description: Yell over the phone while in a call. + usage: /phonecallyell (message) + permission: phones.command.phonecallyell + tab complete: + - if : + - determine + - if : + - determine message<>>]> + - determine + script: + - define continue true + - inject phones_command_call_common_routine + - if !<[continue]>: + - stop + # speak... + - define final "<&6>[<&7>P<&6>] <&f>]> ]>]> ]> <&6>yells <&sq><&f><[message].to_uppercase><&6><&sq> over the phone." + - narrate targets:].deduplicate> <[final]> + +## langcall, langcallw, langcally use similar routines +phones_command_call_language_common_routine: + debug: false + type: task + script: + # checks... + - if != player: + - narrate "<&c>Please run this command as a player." + - define continue false + - stop + - define incall ]> + # mid call? + - if !<[incall]>: + # waiting call? + - if : + - narrate "<&c>Please wait for the call to be accepted, or unequip to cancel the call." + - define continue false + - stop + # no + - narrate "<&c>Invalid use. First, call a number. Please try /call (number/contact)." + - define continue false + - else: + # yes + - if < 2: + - narrate "<&c>Invalid use. You are mid-call - please try / (language) (message)." + - narrate "<&7>Note: you can unequip the phone to end the current call." + - define continue false + - stop + # definitions + - define target + - define language + - if !].if_null[false]>: + - narrate "<&c>Your character cannot speak in <[language]>." + - define continue false + - stop + - define message + +phones_command_phonelangcall: + debug: false + type: command + name: phonelangcall + aliases: + - langcall + description: Speak over the phone in a different language. + usage: /phonelangcall (language) (message) + permission: phones.command.phonelangcall + tab complete: + - if : + - determine + - if : + - if <= 0: + - determine ]> + - if <= 1: + - determine message<>>]> + - determine + script: + - define continue true + - inject phones_command_call_language_common_routine + - if !<[continue]>: + - stop + # speak... + - define final_known "<&6>[<&7>P<&6>] <&f>]> ]>]> ]> <&f>says <&dq><&o><[message]><&f><&dq> in <[language]> over the phone." + - define final_unknown "<&6>[<&7>P<&6>] <&f>]> ]>]> ]> <&f>says something in <[language]> over the phone." + - define all ].deduplicate> + - define speakers <[all].filter_tag[<[filter_value].flag[chat_languages].contains[<[language]>].if_null[false]>]> + - define others <[all].exclude[<[speakers]>]> + - narrate targets:<[speakers]> <[final_known]> + - narrate targets:<[others]> <[final_unknown]> + +phones_command_phonelangcallwhisper: + debug: false + type: command + name: phonelangcallwhisper + aliases: + - langcallwhisper + - langcallw + description: Whisper over the phone in a different language. + usage: /phonelangcallwhisper (language) (message) + permission: phones.command.phonelangcallwhisper + tab complete: + - if : + - determine + - if : + - if <= 0: + - determine ]> + - if <= 1: + - determine message<>>]> + - determine + script: + - define continue true + - inject phones_command_call_language_common_routine + - if !<[continue]>: + - stop + # speak... + - define final_known "<&6>[<&7>P<&6>] <&f>]> ]>]> ]> <&f>whispers <&dq><&o><[message]><&f><&dq> in <[language]> over the phone." + - define final_unknown "<&6>[<&7>P<&6>] <&f>]> ]>]> ]> <&f>whispers something in <[language]> over the phone." + - define all ].deduplicate> + - define speakers <[all].filter_tag[<[filter_value].flag[chat_languages].contains[<[language]>].if_null[false]>]> + - define others <[all].exclude[<[speakers]>]> + - narrate targets:<[speakers]> <[final_known]> + - narrate targets:<[others]> <[final_unknown]> + +phones_command_phonelangcallyell: + debug: false + type: command + name: phonelangcallyell + aliases: + - langcallyell + - langcally + description: Yell over the phone in a different language. + usage: /phonelangcallyell (language) (message) + permission: phones.command.phonelangcallyell + tab complete: + - if : + - determine + - if : + - if <= 1: + - determine ]> + - if <= 2: + - determine message<>>]> + - determine + script: + - define continue true + - inject phones_command_call_language_common_routine + - if !<[continue]>: + - stop + # speak... + - define final_known "<&6>[<&7>P<&6>] <&f>]> ]>]> ]> <&f>yells <&dq><&o><[message].to_uppercase><&f><&dq> in <[language]> over the phone." + - define final_unknown "<&6>[<&7>P<&6>] <&f>]> ]>]> ]> <&f>yells something in <[language]> over the phone." + - define all ].deduplicate> + - define speakers <[all].filter_tag[<[filter_value].flag[chat_languages].contains[<[language]>].if_null[false]>]> + - define others <[all].exclude[<[speakers]>]> + - narrate targets:<[speakers]> <[final_known]> + - narrate targets:<[others]> <[final_unknown]> + +## PHONE UTILITIES +phones_commands_phonenumber: + debug: false + type: command + name: phonenumber + aliases: + - number + - pn + description: View your phone number. + usage: /phonenumber + permission: phones.command.phonenumber + script: + # checks... + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + # ok + - define number + - narrate format:formats_prefix ]> + +## PHONE CONTACTS +phones_commands_phonecontacts: + debug: false + type: command + name: phonecontacts + aliases: + - contacts + description: View your contacts. + usage: /phonecontacts (page) + permission: phones.command.contacts + tab completions: + 1: <<>page<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - define contacts ]> + - if <[contacts].is_empty>: + - run phones_contacts_print def.player: def.page:0 + - stop + - define page 0 + - if >= 1: + - define page + - if !<[page].is_integer>: + - narrate "<&c>The page must be an integer between 1 and <[contacts].size.sub[1].div_int[6].add[1]>." + - stop + - define page <[page].sub[1]> + - if <[page]> < 0 || <[page]> > <[contacts].size.sub[1].div_int[6]>: + - narrate "<&c>The page must be an integer between 1 and <[contacts].size.sub[1].div_int[6].add[1]>." + - stop + - run phones_contacts_print def.player: def.page:<[page]> + +phones_commands_phoneaddcontact: + debug: false + type: command + name: phoneaddcontact + aliases: + - addcontact + - ac + description: Add a contact. + usage: /phoneaddcontact (number) (name) + permission: phones.command.phoneaddcontact + tab completions: + 1: <<>number<>> + 2: <<>unique name<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if < 2: + - narrate "<&c>Invalid use. Please try / (number) (name)." + - stop + - define number + - define isnumber <[number].regex_matches[^[0-9]+$]> + - if !<[isnumber]> || !]>: + - narrate "<&c>Number <&c>is not a valid number. Did you type it correctly?" + - stop + - define name + - define isvalid <[name].regex_matches[^[a-z_]+$]> + - if !<[isvalid]>: + - narrate "<&c>Name <&c>is invalid. Contact names must only contain alphabetical characters and/or the underscore (_) character." + - stop + - if ].if_null[false]>: + - narrate "<&c>You already have a contact named <[name]><&c>. Please pick a new name or manage your contacts from your home screen." + - stop + - define target ]> + - if <[target]> == : + - narrate "<&c>You can't add yourself as a contact!" + - stop + - if ].if_null[false]>: + - define found + - foreach key:whoname as:who: + - if <[who]> == <[target]>: + - define found <[whoname]> + - foreach stop + - narrate "<&c>You already have this contact added, using the contact name: <[found]><&c>." + - stop + - define contacts ]> + - define contacts <[contacts].with[<[name]>].as[<[target]>]> + - flag phones:]> + - narrate format:formats_prefix "Added new contact <[name]> <&7>, targetting phone number <[number]>." + +phones_commands_phoneremovecontact: + debug: false + type: command + name: phoneremovecontact + aliases: + - removecontact + - rc + description: Remove a contact. + usage: /phoneremovecontact (number) (name) + permission: phones.command.phoneremovecontact + tab completions: + 1: ]> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if < 1: + - narrate "<&c>Invalid use. Please try / (name)." + - stop + - define name + - if !].if_null[false]>: + - narrate "<&c>You do not have a contact named <[name]>." + - stop + - define contacts ]> + - define contacts <[contacts].exclude[<[name]>]> + - flag phones:]> + - narrate format:formats_prefix "Removed contact <&e><[name]><&7>." + +## TEXT MESSAGES +phones_commands_phonetext: + debug: false + type: command + name: phonetext + aliases: + - text + description: Text a number or a contact! + usage: /phonetext (number/contact) (message) + permission: phones.command.phonetext + tab completions: + 1: ]> + 2: <<>message<>> + script: + # checks... + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if < 2: + - narrate "<&c>Invalid use. Please try / (number/contact) (message)." + - stop + # definitions + - define receiver + - define message + - define target |<[receiver]>]> + # no phone + - if !: + - narrate "<&c>Please hold a phone in your hand, and ensure it is powered on." + - stop + # invalid number/contact + - if <[target]> == null: + - narrate "<&c>Invalid phone number or contact <&e><[receiver]><&c>. Please try again." + - stop + # lmao + - if == <[target]>: + - narrate "<&c>You can't text yourself!" + - stop + # blocked + - if ].if_null[false]>: + - narrate "<&c>The receiver is currently in your blocked numbers." + - stop + - if <[target].flag[phones].get[blocked].contains[].if_null[false]>: + - narrate "<&c>The receiver is unable to be contacted at this time. Try again later." + - stop + # send text... + - run phones_texts_store def.player: def.target:<[target]> def.contents:<[message]> + +## BLOCKED +phones_commands_phoneblock: + debug: false + type: command + name: phoneblock + aliases: + - phoneunblock + - phblock + - phunblock + description: Add a contact. + usage: /phoneblock (number)) + permission: phones.command.phoneblock + tab completions: + 1: number<>>].include[].if_null[]>]> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if < 1: + - narrate "<&c>Invalid use. Please try / (number)." + - stop + # + - define number + - define isnumber <[number].regex_matches[^[0-9]+$]> + - if !<[isnumber]> || !]>: + - narrate "<&c>Number <&c>is not a valid number. Did you type it correctly?" + - stop + # + - define target ]> + - if <[target]> == : + - narrate "<&c>You can't block your own phone number!" + - stop + # + - if !].if_null[false]>: + - define blocked ]> + - define blocked <[blocked].include[<[target]>]> + - flag phones:]> + - narrate format:formats_prefix "<&c>Blocked <&7>phone number <&e><[number]><&7>." + - else: + - define blocked ]> + - define blocked <[blocked].exclude[<[target]>]> + - flag phones:]> + - narrate format:formats_prefix "<&a>Unblocked <&7>phone number <&e><[number]><&7>." diff --git a/scripts/phones/phones_tasks.dsc b/scripts/phones/phones_tasks.dsc new file mode 100644 index 0000000..feb2cdb --- /dev/null +++ b/scripts/phones/phones_tasks.dsc @@ -0,0 +1,455 @@ +#### +## GENERAL STUFF +#### + +phones_get_owner: + debug: false + type: procedure + definitions: player|receiver + script: + - define receiver <[receiver].replace[(].with[].replace[)].with[].replace[-].with[]> + - define isnumber <[receiver].regex_matches[^[0-9]+$]> + - define target null + - if <[isnumber]>: + - define target ].if_null[null]> + - else: + - define target <[player].flag[phones].get[contacts].get[<[receiver]>].if_null[null]> + - determine <[target]> + +phones_has_phone: + debug: false + type: procedure + definitions: player + script: + - if !<[player].is_online>: + - determine false + - foreach <[player].inventory.map_slots> key:slot as:item: + - if <[item].flag[phones].if_null[false]>: + - determine true + - determine false + +phones_relative_name: + debug: false + type: procedure + definitions: player|who + script: + - if <[player].flag[phones].get[contacts].values.contains[<[who]>].if_null[false]>: + - determine <[player].flag[phones].get[contacts].filter_tag[<[filter_value].equals[<[who]>]>].keys.get[1]> + - determine <[who].flag[phones].get[number]> + +phones_clean_message: + debug: false + type: procedure + definitions: message + script: + - define clean + # remove channel marker + - if <[message].starts_with[#]>: + - define message <[message].substring[3]> + # format actions + - foreach <[message].split[*]> as:section: + - if <[section].trim.length> == 0: + - foreach next + - if <[loop_index].is_odd>: + - define clean "<[clean]> <&f><&dq><[section].trim><&f><&dq>" + - else: + - define clean "<[clean]> <&e><[section].trim>" + # good + - determine <[clean].trim> + + +phones_get_contact_state: + debug: false + type: procedure + definitions: player|target + script: + - if <[target].flag[phones].get[contacts].values.contains[<[player]>].if_null[false]>: + - if <[target].is_online>: + - if ]>: + - determine online + - determine offline + - determine invisible + +phones_nicer_format: + debug: false + type: procedure + definitions: number + script: + - determine "<&7>(+81) <&e>(<[number].substring[1,3]>)-<[number].substring[4,6]>-<[number].substring[7,10]>" + +phones_get_number: + debug: false + type: procedure + definitions: player + script: + - determine <[player].flag[phones].get[number]> + +#### +## GUIS +#### + +phones_gui_home: + debug: false + type: task + definitions: player + script: + - define inventory "邑邑邑邑鄀<&0>邒]]>" + # settings + - define settings + - adjust def:settings "display:<&6>Settings" + - inventory set destination:<[inventory]> slot:13 origin:<[settings]> + # contacts + - define contacts + - adjust def:contacts "display:<&6>Contacts" + - inventory set destination:<[inventory]> slot:14 origin:<[contacts]> + # texts + - define texts + - adjust def:texts "display:<&6>Messages" + - define notifications_textmessages <[player].flag[phones_notifications].get[textmessages].values.size.if_null[null]> + - if <[notifications_textmessages]> != null && <[notifications_textmessages]> != 0: + - if <[notifications_textmessages]> > 99: + - define notifications_textmessages 99+ + - adjust texts lore:● <&7>You have <&6><[notifications_textmessages]> <&7>unread|<&7>text conversations.]> + - inventory set destination:<[inventory]> slot:15 origin:<[texts]> + # music + - define music + - adjust def:music "display:<&6>Blocky Music <&3>♫" + - adjust def:music "lore:<&7>(music from <&e>noteblock.world<&7>)" + - inventory set destination:<[inventory]> slot:22 origin:<[music]> + # number + - define number + - adjust def:number "display:<&6>Your Number" + - adjust def:number lore:]>||<&7>You may also view your number|<&7>using /phonenumber.]> + - flag <[number]> phones_target_skull_uuid:<[player].uuid> + - inventory set destination:<[inventory]> slot:41 origin:<[number]> + # + - inventory open player:<[player]> destination:<[inventory]> + - run phones_target_skulls_update def.player:<[player]> + +# --- +# --- contacts related +# --- + +phones_contacts_print: + debug: false + type: task + definitions: player|page + script: + - define contacts <[player].flag[phones].get[contacts].if_null[]> + - if <[contacts].is_empty>: + - narrate targets:<[player]> format:formats_prefix "You don't have any contacts." + - stop + - define contactslist <[contacts].keys.get[<[page].mul[6].add[1]>].to[<[page].add[1].mul[6]>].if_null[]> + - narrate targets:<[player]> format:formats_prefix "<&e>OpenPhones Contacts<&nl>" + # show contacts + - foreach <[contactslist]> as:receiver: + - define target <[contacts].get[<[receiver]>]> + # state + - define contactstate |<[target]>]> + - if <[contactstate]> == invisible: + - define contactstate <&7>⏺ + - else if <[contactstate]> == online: + - define contactstate <&a>⏺ + - else if <[contactstate]> == offline: + - define contactstate <&c>⏺ + # + - define contact "<[contactstate]> <&e>]>]> <&7><&o>(<[receiver]>)" + - narrate <[contact]> + # page buttons + - define prevpage <&7><<>-- + - define nextpage <&7>--<>> + - if <[page]> > 0: + - clickable usages:1 until:60s save:prev: + - execute as_player "phonecontacts <[page]>" + - define prevpage "<<>--].on_click[]>" + - if <[contacts].size> > <[page].add[1].mul[6]>: + - clickable usages:1 until:60s save:next: + - execute as_player "phonecontacts <[page].add[2]>" + - define nextpage "--<>>].on_click[]>" + - narrate targets:<[player]> "<&nl><[prevpage]> <&6>Page <[page].add[1]>/<[contacts].size.sub[1].div[6].round_down.add[1]> <[nextpage]>" + +# --- +# --- texts related +# --- + +phones_texts_store: + debug: false + type: task + definitions: player|target|contents + script: + - narrate targets:<[player]> format:formats_prefix "Sending..." + # + - define playertexts phones_texts_<[player].uuid>_<[target].uuid> + - if _<[target].uuid>.yml]>: + - ~yaml id:<[playertexts]> load:data/phones/texts/<[player].uuid>_<[target].uuid>.yml + - else: + - ~yaml id:<[playertexts]> create + - yaml id:<[playertexts]> set messages.:]> + - ~yaml savefile:data/phones/texts/<[player].uuid>_<[target].uuid>.yml id:<[playertexts]> + - ~yaml id:phones_texts_<[player].uuid>_<[target].uuid> unload + # + - define targettexts phones_texts_<[target].uuid>_<[player].uuid> + - if _<[player].uuid>.yml]>: + - ~yaml id:<[targettexts]> load:data/phones/texts/<[target].uuid>_<[player].uuid>.yml + - else: + - ~yaml id:<[targettexts]> create + - yaml id:<[targettexts]> set messages.:]> + - ~yaml savefile:data/phones/texts/<[target].uuid>_<[player].uuid>.yml id:<[targettexts]> + - ~yaml id:phones_texts_<[target].uuid>_<[player].uuid> unload + # send + - define relative |<[target]>]> + - narrate targets:<[player]> "<&6>[<&7>T<&6>] <&e>You ➠ <[relative]> <&2>sent '<[contents]>' via text" + # notify or send + - if <[target].is_online>: + - if <[target].item_in_hand.has_flag[phones]>: + - define inverserelative |<[player]>]> + - narrate targets:<[target]> "<&6>[<&7>T<&6>] <&e><[inverserelative]> ➠ You <&2>sent '<[contents]>' via text" + - else: + - narrate targets:<[target]> "<&6>[<&7>T<&6>] <&e>You received a text message." + - else: + - define notifications <[target].flag[phones_notifications].if_null[]> + - define textnotifications <[notifications].get[textmessages].if_null[]> + - define textnotifications <[textnotifications].with[<[player]>].as[<[textnotifications].get[<[player]>].if_null[0].add[1]>]> + - define notifications <[notifications].with[textmessages].as[<[textnotifications]>]> + - flag <[target]> phones_notifications:<[notifications]> + +phones_texts_print: + debug: false + type: task + definitions: player|target|page + script: + - narrate targets:<[player]> format:formats_prefix "Loading..." + # + - define playertexts phones_texts_<[player].uuid>_<[target].uuid> + - ~yaml id:<[playertexts]> load:data/phones/texts/<[player].uuid>_<[target].uuid>.yml + - define messages_size ].read[messages].size> + - define message_keys ].read[messages].keys.reverse.get[<[page].mul[5].add[1]>].to[<[page].add[1].mul[5]>].if_null[]> + - define messages + - foreach <[message_keys]> as:timestamp: + - define messages <[messages].with[]>].as[].read[messages.<[timestamp]>]>]> + - ~yaml id:phones_texts_<[player].uuid>_<[target].uuid> unload + # + - define relative |<[target]>]> + - narrate targets:<[player]> format:formats_prefix "<&e>Messages with <[relative]><&nl>" + - foreach <[messages]> key:timestamp as:message: + - define when ].formatted> + - if <[message].get[origin]> == sender: + - narrate targets:<[player]> "<&7>You: <&f><[message].get[value]> <&7>(<[when]> ago)" + - else: + - narrate targets:<[player]> "<&e><[relative]><&7>: <&f><[message].get[value]> <&7>(<[when]> ago)" + # page buttons + - define prevpage <&7><<>-- + - define nextpage <&7>--<>> + - if <[page]> > 0: + - clickable usages:1 until:60s save:prev: + - run phones_texts_print def.player:<[player]> def.target:<[target]> def.page:<[page].sub[1]> + - define prevpage "<<>--].on_click[]>" + - if <[messages_size]> > <[page].add[1].mul[5]>: + - clickable usages:1 until:60s save:next: + - run phones_texts_print def.player:<[player]> def.target:<[target]> def.page:<[page].add[1]> + - define nextpage "--<>>].on_click[]>" + - narrate targets:<[player]> "<&nl><[prevpage]> <&6>Page <[page].add[1]>/<[messages_size].sub[1].div[5].round_down.add[1]> <[nextpage]>" + # clear notifications? + - if <[player].flag[phones_notifications].get[textmessages].get[<[target]>].if_null[0]> > 0: + - define notifications <[player].flag[phones_notifications].if_null[]> + - define textnotifications <[notifications].get[textmessages].if_null[]> + - define textnotifications <[textnotifications].exclude[<[target]>]> + - define notifications <[notifications].with[textmessages].as[<[textnotifications]>]> + - flag <[player]> phones_notifications:<[notifications]> + +phones_gui_texts: + debug: false + type: task + definitions: player|page + script: + - define inventory "邑邑邑邑鄀<&1>邒]]>" + - define textslist ]].parse[split[_].get[2].split[.].get[1]].parse_tag[]>].get[<[page].mul[16].add[1]>].to[<[page].add[1].mul[16]>].if_null[]> + # show contacts/numbers + - foreach <[textslist]> as:target: + - define receiver |<[target]>]> + - define textsender + - adjust def:textsender display:<&e><[receiver]> + - adjust def:textsender "lore:Click to view your conversation.]>" + # notifications + - define notifications_text <[player].flag[phones_notifications].get[textmessages].get[<[target]>].if_null[null]> + - if <[notifications_text]> != null: + - if <[notifications_text]> > 99: + - define notifications_text 99+ + - adjust def:textsender "lore:<[textsender].lore.include[|<&7>You have <&6><[notifications_text]> <&7>unread messages.]>" + # + - flag <[textsender]> phones:<[target]> + - flag <[textsender]> phones_target_skull_uuid:<[target].uuid> + - inventory set destination:<[inventory]> slot:<[loop_index].sub[1].div[3].round_down.mul[9].add[4].add[<[loop_index].sub[1].mod[3]>]> origin:<[textsender]> + # back + - define back + - adjust def:back display:<&7>Back + - inventory set destination:<[inventory]> slot:50 origin:<[back]> + # page buttons + - if <[page]> > 0: + - define prevpage + - adjust def:prevpage "display:<&a>Previous Page" + - inventory set destination:<[inventory]> slot:49 origin:<[prevpage]> + - if <[textslist].size> > <[page].add[1].mul[16]>: + - define nextpage + - adjust def:nextpage "display:<&a>Next Page" + - inventory set destination:<[inventory]> slot:51 origin:<[nextpage]> + # + - inventory open player:<[player]> destination:<[inventory]> + - run phones_target_skulls_update def.player:<[player]> + +# each skull you want to change has to be flagged with phones_target_skull_uuid:<[target].uuid> +phones_target_skulls_update: + debug: false + type: task + definitions: player + script: + - define inventory <[player].open_inventory> + - foreach <[inventory].map_slots> key:slot as:item: + - if <[item].has_flag[phones_target_skull_uuid]>: + - if <[inventory].viewers.if_null[].is_empty>: + - stop + - define uuid <[item].flag[phones_target_skull_uuid]> + - inventory adjust slot:<[slot]> skull_skin:<[uuid]>|].skin_blob.if_null[0000]>|].name> destination:<[inventory]> + +#### +## NOTIFICATIONS +#### + +phones_notify_text_messages: + debug: false + type: task + definitions: player|delayseconds + script: + - wait <[delayseconds]>s + - if !<[player].is_online>: + - stop + - define notifications_textmessages <[player].flag[phones_notifications].get[textmessages].values.filter[equals[0].not].sum.if_null[null]> + - if <[notifications_textmessages]> == null || <[notifications_textmessages]> == 0: + - stop + - if <[notifications_textmessages]> > 99: + - define notifications_textmessages 99+ + - narrate targets:<[player]> format:formats_prefix "You have <&6><[notifications_textmessages]> <&7>unread text conversations." + +#### +## MUSIC APP +#### + +phones_music_play: + debug: false + type: task + definitions: player|songfile + script: + - if <[player].nbs_is_playing>: + - nbs stop targets:<[player]> + - nbs file:data/phones/songs/<[songfile]> play targets:<[player]> + - narrate targets:<[player]> format:formats_prefix "Playing song..." + +phones_music_stop: + debug: false + type: task + definitions: player + script: + - if !<[player].nbs_is_playing>: + - narrate targets:<[player]> format:formats_prefix "No song is playing right now." + - stop + - nbs stop targets:<[player]> + - narrate targets:<[player]> format:formats_prefix "Stopped song." + +phones_gui_music: + debug: false + type: task + definitions: player|page|ringtone + script: + # ringtone selection mode? + - define ringtone <[ringtone].if_null[false]> + # make inventory + - define inventory "邑邑邑邑鄀<&2>邒]]>" + - if <[ringtone]>: + - define inventory "邑邑邑邑鄀<&4>邒]]>" + - define songsize + - define songsonpage ].pass[15].fail[14]> + - define songlist ].add[1]>].to[<[page].add[1].mul[<[songsonpage]>]>].if_null[]> + # show songs + - foreach <[songlist]> as:songname: + - define song + - adjust def:song display:<&e><[songname]> + - adjust def:song "lore:Click to start playing.]>" + - flag <[song]> phones:<[songname]> + - inventory set destination:<[inventory]> slot:<[loop_index].sub[1].div[3].round_down.mul[9].add[4].add[<[loop_index].sub[1].mod[3]>]> origin:<[song]> + # stop + - if !<[ringtone]>: + - define stop + - adjust def:stop display:<&c>Stop + - inventory set destination:<[inventory]> slot:42 origin:<[stop]> + # back + - define back + - adjust def:back display:<&7>Back + - inventory set destination:<[inventory]> slot:50 origin:<[back]> + # page buttons + - if <[page]> > 0: + - define prevpage + - adjust def:prevpage "display:<&a>Previous Page" + - inventory set destination:<[inventory]> slot:49 origin:<[prevpage]> + - if <[songsize]> > <[page].add[1].mul[<[songsonpage]>]>: + - define nextpage + - adjust def:nextpage "display:<&a>Next Page" + - inventory set destination:<[inventory]> slot:51 origin:<[nextpage]> + # + - inventory open player:<[player]> destination:<[inventory]> + +### +## SETTINGS +### +phones_gui_settings: + debug: false + type: task + definitions: player + script: + - define inventory "邑邑邑邑鄀<&3>邒]]>" + # ringtone + - define ringtone + - adjust def:ringtone display:<&6>Ringtone + - adjust def:ringtone "lore:<&7>(music from <&e>noteblock.world<&7>)" + - inventory set destination:<[inventory]> slot:4 origin:<[ringtone]> + # blocked + - define blocked + - adjust def:blocked "display:<&6>Blocked Numbers" + - inventory set destination:<[inventory]> slot:5 origin:<[blocked]> + # back + - define back + - adjust def:back display:<&7>Back + - inventory set destination:<[inventory]> slot:50 origin:<[back]> + # + - inventory open player:<[player]> destination:<[inventory]> + +phones_gui_settings_blocked: + debug: false + type: task + definitions: player|page + script: + - define inventory "邑邑邑邑鄀<&5>邒]]>" + - define blockedlist <[player].flag[phones].get[blocked].get[<[page].mul[16].add[1]>].to[<[page].add[1].mul[16]>].if_null[]> + # show blocked numbers + - foreach <[blockedlist]> as:target: + - define blockednumber ]> + - define blocked + - adjust def:blocked display:<&e><[blockednumber]> + - adjust def:blocked lore:You may use /phoneunblock to unblock this number.]> + - flag <[blocked]> phones_target_skull_uuid:<[target].uuid> + - inventory set destination:<[inventory]> slot:<[loop_index].sub[1].div[3].round_down.mul[9].add[4].add[<[loop_index].sub[1].mod[3]>]> origin:<[blocked]> + # back + - define back + - adjust def:back display:<&7>Back + - inventory set destination:<[inventory]> slot:50 origin:<[back]> + # page buttons + - if <[page]> > 0: + - define prevpage + - adjust def:prevpage "display:<&a>Previous Page" + - inventory set destination:<[inventory]> slot:49 origin:<[prevpage]> + - if <[blockedlist].size> > <[page].add[1].mul[16]>: + - define nextpage + - adjust def:nextpage "display:<&a>Next Page" + - inventory set destination:<[inventory]> slot:51 origin:<[nextpage]> + # + - inventory open player:<[player]> destination:<[inventory]> + - run phones_target_skulls_update def.player:<[player]> diff --git a/scripts/phones/phones_world.dsc b/scripts/phones/phones_world.dsc new file mode 100644 index 0000000..41f69b2 --- /dev/null +++ b/scripts/phones/phones_world.dsc @@ -0,0 +1,185 @@ +phones_world: + debug: false + type: world + events: + ## assign new random number & handle notifications + after player joins: + - run phones_notify_text_messages def.player: def.delayseconds:5 + # + - if : + - stop + - define number + - while ].contains[377<[number]>]>: + - define number + - define number 377<[number]> + - flag phones:]> + - flag server phones:].with[<[number]>].as[]> + ## phone drop, phone unequip, player logs off etc. + on player drops item: + - if : + - if : + - determine cancelled + - if : + - nbs stop targets: + - inject phones_inject_end_call + on player scrolls their hotbar: + - if ].has_flag[phones]>: + - inject phones_inject_end_call + on player quits: + - inject phones_inject_end_call + after player clicks in inventory: + - if !: + - inject phones_inject_end_call + ## boot up/down phone + on player left clicks block: + - if !: + - stop + - if != : + - stop + - determine cancelled passively + - if : + - flag phones_chat_input:! + - define state + - inventory flag slot:hand phones:<[state]> + - if <[state]>: + - narrate format:formats_prefix "Powered <&a>on <&7>your phone." + # + - run phones_notify_text_messages def.player: def.delayseconds:2 + - else: + - narrate format:formats_prefix "Powered <&c>off <&7>your phone." + - nbs stop targets: + - inject phones_inject_end_call + ## phone GUI + on player right clicks block: + - if !: + - stop + - determine cancelled passively + - if : + - narrate "<&c>You are currently in the middle of a call (stop holding the phone to end the call)." + - stop + - if : + - flag phones_chat_input:! + - if !: + - narrate "<&c>Please turn on your phone (left click) to view the home screen." + - stop + - run phones_gui_home def.player: + +# used in ending a call because code repeats a lot +phones_inject_end_call: + debug: false + type: task + script: + - if : + - flag phones_is_maybe_called:! + - nbs stop + - if !: + - stop + - define callwho + - define iswaiting + - flag phones_call:! + - if <[iswaiting]>: + - clickable cancel: + - flag phones_call_clickable:! + - if <[callwho].flag[phones_call].if_null[null]> == : + - narrate targets:<[callwho]> format:formats_prefix "Call was ended by the other side." + - flag <[callwho]> phones_call:! + - else: + - nbs stop targets:<[callwho]> + - narrate targets:<[callwho]> format:formats_prefix "The person on the other side hung up before you answered." + - narrate format:formats_prefix "You ended the call." + +## only gui handling +phones_world_gui: + debug: false + type: world + events: + on player clicks in inventory: + - if !: + - stop + - determine cancelled passively + - if > : + - stop + - define title + # Home Page + - if <[title]> == <&0>邒: + - if == 13: + - run phones_gui_settings def.player: + - if == 14: + - inventory close + - run phones_contacts_print def.player: def.page:0 + - else if == 15: + - flag phones_gui_page:0 + - run phones_gui_texts def.player: def.page:0 + - else if == 22: + - flag phones_gui_page:0 + - run phones_gui_music def.player: def.page:0 def.ringtone:false + - else if <[title]> == <&1>邒: + - if == ender_pearl: + - define page + - flag phones_gui_page:<[page]> + - run phones_gui_texts def.player: def.page:<[page]> + - else if == ender_eye: + - define page + - flag phones_gui_page:<[page]> + - run phones_gui_texts def.player: def.page:<[page]> + - else if == 50: + - run phones_gui_home def.player: + - else if == player_head: + - inventory close + - run phones_texts_print def.player: def.target: def.page:0 + # Music + - else if <[title]> == <&2>邒: + - if == ender_pearl: + - define page + - flag phones_gui_page:<[page]> + - run phones_gui_music def.player: def.page:<[page]> def.ringtone:false + - else if == ender_eye: + - define page + - flag phones_gui_page:<[page]> + - run phones_gui_music def.player: def.page:<[page]> def.ringtone:false + - else if == 50: + - run phones_gui_home def.player: + - else if == 42: + - inventory close + - run phones_music_stop def.player: + - else if == jukebox: + - inventory close + - run phones_music_play def.player: def.songfile: + # Settings + - else if <[title]> == <&3>邒: + - if == 4: + - flag phones_gui_page:0 + - run phones_gui_music def.player: def.page:0 def.ringtone:true + - if == 5: + - flag phones_gui_page:0 + - run phones_gui_settings_blocked def.player: def.page:0 + - else if == 50: + - run phones_gui_home def.player: + # Ringtone Select + - else if <[title]> == <&4>邒: + - if == ender_pearl: + - define page + - flag phones_gui_page:<[page]> + - run phones_gui_music def.player: def.page:<[page]> def.ringtone:true + - else if == ender_eye: + - define page + - flag phones_gui_page:<[page]> + - run phones_gui_music def.player: def.page:<[page]> def.ringtone:true + - else if == 50: + - run phones_gui_settings def.player: + - else if == jukebox: + - flag phones:]> + - run phones_gui_settings def.player: + - narrate format:formats_prefix "Changed your ringtone to <&e><&7>." + # Blocked + - else if <[title]> == <&5>邒: + - if == ender_pearl: + - define page + - flag phones_gui_page:<[page]> + - run phones_gui_settings_blocked def.player: def.page:<[page]> + - else if == ender_eye: + - define page + - flag phones_gui_page:<[page]> + - run phones_gui_settings_blocked def.player: def.page:<[page]> + - else if == 50: + - run phones_gui_settings def.player: diff --git a/scripts/rankup/rankup_commands.dsc b/scripts/rankup/rankup_commands.dsc new file mode 100644 index 0000000..5e2f03c --- /dev/null +++ b/scripts/rankup/rankup_commands.dsc @@ -0,0 +1,40 @@ +rankup_command_playtime: + debug: false + type: command + name: playtime + description: Check your total playtime. + usage: /playtime + permission: rankup.command.playtime + tab completions: + 1: + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - narrate format:formats_prefix "You've played for <&a>]>" + +rankup_command_grade: + debug: false + type: command + name: grade + description: Check to see when you'll grade up next. + usage: /grade + permission: rankup.command.grade + tab completions: + 1: + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if : + - yaml load:../Autorank/data/Total_time.yml id:autorank_totaltime + - if : + - yaml load:../Autorank/Paths.yml id:autorank_paths + - define activepath ].if_null[null]> + - if <[activepath]> == null || <[activepath].length> <= 0: + - narrate format:formats_prefix "You have completed all grades!" + - stop + - define timeneeded ].get[requirements].get[time].get[value]>]> + - define timepassed ]>m]> + - define difference <[timeneeded].sub[<[timepassed]>]> + - narrate format:formats_prefix "You need <&a><[difference].formatted> <&7>more till reaching <&a><[activepath].substring[1,5].to_lowercase> <[activepath].substring[6,7]>" diff --git a/scripts/rankup/rankup_world.dsc b/scripts/rankup/rankup_world.dsc new file mode 100644 index 0000000..d780367 --- /dev/null +++ b/scripts/rankup/rankup_world.dsc @@ -0,0 +1,10 @@ +rankup_world: + debug: false + type: world + events: + after server start: + - yaml load:../Autorank/data/Total_time.yml id:autorank_totaltime + - yaml load:../Autorank/Paths.yml id:autorank_paths + on delta time minutely every:1: + - yaml load:../Autorank/data/Total_time.yml id:autorank_totaltime + - yaml load:../Autorank/Paths.yml id:autorank_paths diff --git a/scripts/requestsearch/requestsearch_commands.dsc b/scripts/requestsearch/requestsearch_commands.dsc new file mode 100644 index 0000000..d0bdca6 --- /dev/null +++ b/scripts/requestsearch/requestsearch_commands.dsc @@ -0,0 +1,33 @@ +requestsearch_command_requestsearch: + debug: false + type: command + name: requestsearch + description: Command to search someone's inventory. + usage: /requestsearch + aliases: + - rs + - patdown + permission: invreq.patdown + tab completions: + 1: + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - define target + - if <[target]> == null: + - narrate "<&c>Please look at the player you want to search." + - stop + - if <[target].is_npc>: + - narrate "<&c>Please look at the player you want to search." + - stop + - define player + - narrate format:formats_prefix "<&e>Sent an inventory search request to ]>" + - clickable usages:1 save:yes: + - narrate targets:<[target]> format:formats_prefix "Your inventory is being searched..." + - inventory player:<[player]> open destination:<[target].inventory> + - clickable usages:1 save:no: + - narrate targets:<[player]> format:formats_prefix "Your inventory search request was denied." + - narrate targets:<[target]> "You denied the inventory search request." + - narrate format:formats_prefix targets:<[target]> "<&e>Do you allow ]><&e> to access your belongings?" + - narrate targets:<[target]> "<&f> <&e> <&f> [<&a>Accept<&7>]].on_click[]><&f> <&e> <&f> [<&c>Deny<&7>]].on_click[]>" diff --git a/scripts/rolls/rolls_commands.dsc b/scripts/rolls/rolls_commands.dsc new file mode 100644 index 0000000..dbffc6b --- /dev/null +++ b/scripts/rolls/rolls_commands.dsc @@ -0,0 +1,26 @@ +roll_command_roll: + debug: false + type: command + name: roll + usage: /roll [amount?] + description: Rolls a dice, optionally with an amount. + permission: roll.command.roll + tab completions: + 1: <<>amount<>> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - define amount 100 + - if >= 1: + - define amount + - if !<[amount].is_integer>: + - narrate "<&c>The amount must be an integer between 2 and 200." + - stop + - if <[amount]> < 2 || <[amount]> > 200: + - narrate "<&c>The amount must be an integer between 2 and 200." + - stop + - define roll ]> + - define final "<&f>]> ]>]> ]> <&6>rolls <&f><[roll]> <&6>out of <&f><[amount]>" + - narrate targets: <[final]> + - announce to_console <[final]> diff --git a/scripts/sports/football/sports_football_tasks.dsc b/scripts/sports/football/sports_football_tasks.dsc new file mode 100644 index 0000000..47311be --- /dev/null +++ b/scripts/sports/football/sports_football_tasks.dsc @@ -0,0 +1,113 @@ +sports_football_join: + debug: false + type: task + definitions: id|player|team + script: + - define extra ].get[extra_data]> + - if <[team]> == red: + - teleport <[player]> <[extra].get[red_start]> + - else if <[team]> == blue: + - teleport <[player]> <[extra].get[blue_start]> + - run sports_football_update_glow def.id:<[id]> + - define count ]> + - if <[count]> == 2: + - define teams ]> + - repeat 3: + - title targets:<[teams].get[red].include[<[teams].get[blue]>]> title:<&6>]> fade_in:0 fade_out:0 stay:1s + - wait 1s + - if ]> < 2: + - stop + - run sports_football_restart_game def.id:<[id]> + - if <[count]> < 2: + - run sports_football_idle_game def.id:<[id]> + +sports_football_leave: + debug: false + type: task + definitions: id|player + script: + - define extra ].get[extra_data]> + - teleport <[player]> <[extra].get[exit]> + - glow <[player]> reset + - if ]> <= 1: + - run sports_football_idle_game def.id:<[id]> + +sports_football_redistribute: + debug: false + type: task + definitions: id|player|from|to + script: + - define extra ].get[extra_data]> + - if <[to]> == red: + - teleport <[player]> <[extra].get[red_start]> + - narrate targets:<[player]> format:formats_prefix "You were auto-balanced to the <&c>red team" + - else if <[to]> == blue: + - teleport <[player]> <[extra].get[blue_start]> + - narrate targets:<[player]> format:formats_prefix "You were auto-balanced to the <&9>blue team" + - run sports_football_update_glow def.id:<[id]> + +sports_football_restart_game: + debug: false + type: task + definitions: id + script: + - define arena ]> + - define extra <[arena].get[extra_data]> + - run sports_arena_redistribute def.id:<[id]> + - define teams ]> + - run sports_football_update_glow def.id:<[id]> + - foreach <[teams].get[red]> as:red_player: + - teleport <[red_player]> <[extra].get[red_start]> + - foreach <[teams].get[blue]> as:blue_player: + - teleport <[blue_player]> <[extra].get[blue_start]> + - run sports_arena_set_status def.id:<[id]> def.status:normal + - run ball_create def.id:sports_football def.location:<[extra].get[ball_start]> def.size:<[arena].get[ball_size]> def.display_item:<[arena].get[ball_display]> def.gravity_multiplier:<[arena].get[ball_gravity]> + - glow ]> true for:<[teams].get[red].include[<[teams].get[blue]>]> + - narrate targets:<[teams].get[red].include[<[teams].get[blue]>]> format:formats_prefix "Next round..." + - title targets:<[teams].get[red].include[<[teams].get[blue]>]> "title:<&e>Next Round" fade_in:0 fade_out:0 stay:1s + - playsound <[teams].get[red].include[<[teams].get[blue]>]> sound:BLOCK_NOTE_BLOCK_PLING pitch:1 volume:30 + +sports_football_update_glow: + debug: false + type: task + definitions: id + script: + - define teams ]> + - foreach <[teams].get[red]> as:red_player: + - glow <[red_player]> true for:<[teams].get[red]> + - glow <[red_player]> false for:<[teams].get[blue]> + - foreach <[teams].get[blue]> as:blue_player: + - glow <[blue_player]> true for:<[teams].get[blue]> + - glow <[blue_player]> false for:<[teams].get[red]> + +sports_football_idle_game: + debug: false + type: task + definitions: id + script: + - define extra ].get[extra_data]> + - define teams ]> + - run sports_arena_set_status def.id:<[id]> def.status:waiting + - run ball_remove def.id:<[id]> + - teleport <[teams].get[red].include[<[teams].get[blue]>]> <[extra].get[ball_start]> + - narrate targets:<[teams].get[red].include[<[teams].get[blue]>]> format:formats_prefix "Not enough players. Waiting..." + - title targets:<[teams].get[red].include[<[teams].get[blue]>]> title:<&7>Waiting fade_in:0 fade_out:0 stay:3s + - playsound <[teams].get[red].include[<[teams].get[blue]>]> sound:BLOCK_NOTE_BLOCK_HAT pitch:1 volume:30 + +sports_football_score_goal: + debug: false + type: task + definitions: id|team + script: + - run sports_arena_set_status def.id:<[id]> def.status:goal + - define teams ]> + - if <[team]> == red: + - title targets:<[teams].get[red].include[<[teams].get[blue]>]> "title:<&c>Goal for Red" fade_in:0 fade_out:0 stay:2s + - narrate targets:<[teams].get[red].include[<[teams].get[blue]>]> format:formats_prefix "<&c>Red team <&7>scored a goal!" + - if <[team]> == blue: + - title targets:<[teams].get[red].include[<[teams].get[blue]>]> "title:<&9>Goal for Blue" fade_in:0 fade_out:0 stay:2s + - narrate targets:<[teams].get[red].include[<[teams].get[blue]>]> format:formats_prefix "<&9>Blue team <&7>scored a goal!" + - playsound <[teams].get[red].include[<[teams].get[blue]>]> sound:BLOCK_NOTE_BLOCK_PLING pitch:2 volume:30 + - playsound <[teams].get[red].include[<[teams].get[blue]>]> sound:ENTITY_FIREWORK_ROCKET_TWINKLE_FAR pitch:1 volume:30 + - wait 3s + - run sports_football_restart_game def.id:<[id]> diff --git a/scripts/sports/football/sports_football_world.dsc b/scripts/sports/football/sports_football_world.dsc new file mode 100644 index 0000000..5b97b92 --- /dev/null +++ b/scripts/sports/football/sports_football_world.dsc @@ -0,0 +1,55 @@ +sports_football_world: + debug: false + type: world + events: + ## ball click + on player damages entity bukkit_priority:low: + - ratelimit 10t + - if !: + - stop + - if !: + - stop + - if !: + - stop + - define arena_id + - if !<[arena_id].starts_with[sports_football]>: + - stop + - if ]> != normal: + - stop + - define min_y + - if <[min_y]> < 0: + - define min_y 0 + - define velo + - define kick ].add[0,0.25,0].add[<[velo]>]> + - if : + - define kick + - if !: + - define kick + - run ball_vector_add def.ball: def.vector:<[kick]> + ## out of bounds & ball collision + on player walks: + - if !: + - stop + - define arena_id + - if !<[arena_id].starts_with[sports_football]>: + - stop + - if ]> != normal: + - stop + # ball collision + - define ball ]> + - if > <[ball].location.y>: + - if ]> < 0.5: + - run ball_vector_add def.ball:<[ball]> def.vector:<[ball].location.sub[].normalize.mul[0.5].add[0,0.05,0]> + - ratelimit 10t + ## goal scoring + on custom event id:ball_move bukkit_priority:low: + - if !: + - stop + - define arena_id + - if ]> != normal: + - stop + - define extra ].get[extra_data]> + - if <[extra].get[red_goal].contains[]> || <[extra].get[red_goal].contains[]>: + - run sports_football_score_goal def.id:<[arena_id]> def.team:blue + - else if <[extra].get[blue_goal].contains[]> || <[extra].get[blue_goal].contains[]>: + - run sports_football_score_goal def.id:<[arena_id]> def.team:red diff --git a/scripts/sports/sports_tasks.dsc b/scripts/sports/sports_tasks.dsc new file mode 100644 index 0000000..b9a5d7e --- /dev/null +++ b/scripts/sports/sports_tasks.dsc @@ -0,0 +1,217 @@ +sports_arena_register: + debug: false + type: task + definitions: id|cuboid|max_per_team|ball_display|ball_size|ball_gravity|on_join_task|on_leave_task|on_redistribute_task|default_status|extra_data + script: + - definemap arena: + id: <[id]> + cuboid: <[cuboid]> + max_per_team: <[max_per_team]> + ball_display: <[ball_display]> + ball_size: <[ball_size]> + ball_gravity: <[ball_gravity]> + on_join_task: <[on_join_task]> + on_leave_task: <[on_leave_task]> + on_redistribute_task: <[on_redistribute_task]> + default_status: <[default_status]> + extra_data: <[extra_data]> + - flag server sports_arenas:].with[<[id]>].as[<[arena]>]> + - flag server sports_status:].with[<[id]>].as[<[default_status]>]> + +sports_arena_update_property: + debug: false + type: task + definitions: id|property|new_value + script: + - define arena ].get[<[id]>]> + - if !<[arena].keys.contains[<[property]>]>: + - narrate "<&c> Could not update arena property: <[property]> is an inexistent property." + - stop + - define arena <[arena].with[<[property]>].as[<[new_value]>]> + - flag server sports_arenas:].with[<[id]>].as[<[arena]>]> + +sports_arena_exists: + debug: false + type: procedure + definitions: id + script: + - determine ].if_null[false]> + +sports_arena_cleanup: + debug: false + type: task + definitions: id + script: + - define on_leave_task ].get[on_leave_task]> + - foreach ].get[red].if_null[]> as:player: + - run <[on_leave_task]> def.id:<[id]> def.player:<[player]> + - foreach ].get[blue].if_null[]> as:player: + - run <[on_leave_task]> def.id:<[id]> def.player:<[player]> + - flag server sports_teams:].exclude[<[id]>]> + - define default_status ].get[default_status]> + - flag server sports_status:].with[<[id]>].as[<[default_status]>]> + +sports_arena_unregister: + debug: false + type: task + definitions: id + script: + - run sports_arena_cleanup def.id:<[id]> + - flag server sports_arenas:].exclude[<[id]>]> + - flag server sports_status:].exclude[<[id]>]> + +sports_arena: + debug: false + type: procedure + definitions: id + script: + - determine ].get[<[id]>]> + +sports_arena_can_join: + debug: false + type: procedure + definitions: id|team + script: + - define max_per_team ].get[max_per_team]> + - define teams ].if_null[].with[blue].as[]>]> + - define red <[teams].get[red]> + - define blue <[teams].get[blue]> + - if <[red].size> >= <[max_per_team]> && <[blue].size> >= <[max_per_team]>: + - determine false + - else if <[red].size> >= <[max_per_team]>: + - determine blue + - else if <[blue].size> >= <[max_per_team]>: + - determine red + - determine any + +sports_arena_player_count: + debug: false + type: procedure + definitions: id + script: + - define teams ].if_null[].with[blue].as[]>]> + - define red <[teams].get[red]> + - define blue <[teams].get[blue]> + - determine <[red].size.add[<[blue].size>]> + +sports_arena_teams: + debug: false + type: procedure + definitions: id + script: + - define teams ].if_null[].with[blue].as[]>]> + - define red <[teams].get[red]> + - define blue <[teams].get[blue]> + - determine ].with[blue].as[<[blue]>]> + +# team is "red" or "blue" +sports_arena_join: + debug: false + type: task + definitions: id|player|team + script: + - define teams ].if_null[].with[blue].as[]>]> + - define teams <[teams].with[<[team]>].as[<[teams].get[<[team]>].include[<[player]>].deduplicate>]> + - flag <[player]> sports:].with[team].as[<[team]>]> + - flag server sports_teams:].with[<[id]>].as[<[teams]>]> + - define on_join_task ].get[on_join_task]> + - run <[on_join_task]> def.id:<[id]> def.player:<[player]> def.team:<[team]> + +sports_arena_join_auto: + debug: false + type: task + definitions: id|player + script: + - define teams ].if_null[].with[blue].as[]>]> + - define red <[teams].get[red]> + - define blue <[teams].get[blue]> + - define on_join_task ].get[on_join_task]> + - if <[red].size> < <[blue].size>: + - define teams <[teams].with[red].as[<[red].include[<[player]>].deduplicate>]> + - flag <[player]> sports:].with[team].as[red]> + - flag server sports_teams:].with[<[id]>].as[<[teams]>]> + - run <[on_join_task]> def.id:<[id]> def.player:<[player]> def.team:red + - else: + - define teams <[teams].with[blue].as[<[blue].include[<[player]>].deduplicate>]> + - flag <[player]> sports:].with[team].as[blue]> + - flag server sports_teams:].with[<[id]>].as[<[teams]>]> + - run <[on_join_task]> def.id:<[id]> def.player:<[player]> def.team:blue + +sports_arena_leave: + debug: false + type: task + definitions: id|player + script: + - define teams ].if_null[].with[blue].as[]>]> + - define teams <[teams].with[red].as[<[teams].get[red].exclude[<[player]>]>]> + - define teams <[teams].with[blue].as[<[teams].get[blue].exclude[<[player]>]>]> + - flag <[player]> sports:! + - flag server sports_teams:].with[<[id]>].as[<[teams]>]> + - define on_leave_task ].get[on_leave_task]> + - run <[on_leave_task]> def.id:<[id]> def.player:<[player]> + +sports_arena_redistribute: + debug: false + type: task + definitions: id + script: + - define teams ].if_null[].with[blue].as[]>]> + - define red <[teams].get[red]> + - define blue <[teams].get[blue]> + - if <[red].size.sub[1]> > <[blue].size>: + - define random <[red].random> + - define teams <[teams].with[red].as[<[red].exclude[<[random]>].deduplicate>]> + - define teams <[teams].with[blue].as[<[blue].include[<[random]>].deduplicate>]> + - flag <[random]> sports:].with[team].as[red]> + - flag server sports_teams:].with[<[id]>].as[<[teams]>]> + - define on_redistribute_task ].get[on_redistribute_task]> + - run <[on_redistribute_task]> def.id:<[id]> def.player:<[random]> def.from:red def.to:blue + - determine red + - if <[blue].size.sub[1]> > <[red].size>: + - define random <[blue].random> + - define teams <[teams].with[blue].as[<[blue].exclude[<[random]>].deduplicate>]> + - define teams <[teams].with[red].as[<[red].include[<[random]>].deduplicate>]> + - flag <[random]> sports:].with[team].as[blue]> + - flag server sports_teams:].with[<[id]>].as[<[teams]>]> + - define on_redistribute_task ].get[on_redistribute_task]> + - run <[on_redistribute_task]> def.id:<[id]> def.player:<[random]> def.from:blue def.to:red + - determine blue + - determine none + +sports_arena_set_status: + debug: false + type: task + definitions: id|status + script: + - flag server sports_status:].with[<[id]>].as[<[status]>]> + +sports_arena_get_status: + debug: false + type: procedure + definitions: id + script: + - determine ].get[<[id]>]> + +sports_arena_enter_arena_prompt: + debug: false + type: task + definitions: id|player + script: + - ratelimit <[player]> 2s + - clickable save:join_arena usages:1 until:30s: + - if <[player].has_flag[sports]>: + - stop + - run sports_arena_join_auto def.id:<[id]> def.player:<[player]> + - narrate targets:<[player]> format:formats_prefix "Join this game? <&l>[YES]].on_click[]>" + +sports_arena_exit_arena_prompt: + debug: false + type: task + definitions: id|player + script: + - ratelimit <[player]> 2s + - clickable save:leave_arena usages:1 until:30s: + - if !<[player].has_flag[sports]>: + - stop + - run sports_arena_leave def.id:<[id]> def.player:<[player]> + - narrate targets:<[player]> format:formats_prefix "Leave this game? <&l>[YES]].on_click[]>" diff --git a/scripts/sports/sports_world.dsc b/scripts/sports/sports_world.dsc new file mode 100644 index 0000000..f07a9ff --- /dev/null +++ b/scripts/sports/sports_world.dsc @@ -0,0 +1,83 @@ +sports_arena_collision_world: + debug: false + type: world + events: + on custom event id:ball_move: + - if !: + - stop + - define arena ]> + - define cuboid <[arena].get[cuboid]> + - define corners <[cuboid].corners> + # axis-aligned boundary reflection algorithm + - define min <[corners].get[1]> + - define max <[corners].get[8]> + - define damping 0.75 + - define new_next + - define new_velocity + - define bounced false + - define min_x <[min].x> + - define max_x <[max].x> + - define min_y <[min].y> + - define max_y <[max].y> + - define min_z <[min].z> + - define max_z <[max].z> + # X + - if <[new_next].x> < <[min_x]>: + - define new_next <[new_next].with_x[<[min_x]>]> + - define new_velocity <[new_velocity].with_x[<[new_velocity].x.mul[-<[damping]>]>]> + - define bounced true + - if <[new_next].x> > <[max_x]>: + - define new_next <[new_next].with_x[<[max_x]>]> + - define new_velocity <[new_velocity].with_x[<[new_velocity].x.mul[-<[damping]>]>]> + - define bounced true + # Y + - if <[new_next].y> < <[min_y]>: + - define new_next <[new_next].with_y[<[min_y]>]> + - define new_velocity <[new_velocity].with_y[<[new_velocity].y.mul[-<[damping]>]>]> + - define bounced true + - if <[new_next].y> > <[max_y]>: + - define new_next <[new_next].with_y[<[max_y]>]> + - define new_velocity <[new_velocity].with_y[<[new_velocity].y.mul[-<[damping]>]>]> + - define bounced true + # Z + - if <[new_next].z> < <[min_z]>: + - define new_next <[new_next].with_z[<[min_z]>]> + - define new_velocity <[new_velocity].with_z[<[new_velocity].z.mul[-<[damping]>]>]> + - define bounced true + - if <[new_next].z> > <[max_z]>: + - define new_next <[new_next].with_z[<[max_z]>]> + - define new_velocity <[new_velocity].with_z[<[new_velocity].z.mul[-<[damping]>]>]> + - define bounced true + # update to bounce + - if <[bounced]>: + - determine output:<[new_next]> passively + - determine output:<[new_velocity]> passively + on player walks: + - if !: + - define arenas + - foreach <[arenas]> as:arena: + - if <[arena].get[cuboid].contains[]> && !<[arena].get[cuboid].contains[]>: + - if == survival || == adventure: + - determine cancelled passively + - run sports_arena_enter_arena_prompt def.id:<[arena].get[id]> def.player: + - stop + - else: + - define arena_id + - define arena ]> + - if !<[arena].get[cuboid].contains[]> && !<[arena].get[cuboid].contains[]>: + - if == survival || == adventure: + - determine cancelled passively + - run sports_arena_exit_arena_prompt def.id:<[arena_id]> def.player: + on player quits: + - if !: + - stop + - define arena_id + - run sports_arena_leave def.id:<[arena_id]> def.player: + +sports_arena_cleanup_world: + debug: false + type: world + events: + after server start: + - foreach as:arena: + - run sports_arena_cleanup def.id:<[arena].get[id]> diff --git a/scripts/sports/volleyball/sports_volleyball_tasks.dsc b/scripts/sports/volleyball/sports_volleyball_tasks.dsc new file mode 100644 index 0000000..e3f468d --- /dev/null +++ b/scripts/sports/volleyball/sports_volleyball_tasks.dsc @@ -0,0 +1,100 @@ +sports_volleyball_join: + debug: false + type: task + definitions: id|player|team + script: + - define extra ].get[extra_data]> + - if <[team]> == red: + - teleport <[player]> <[extra].get[red_start]> + - else if <[team]> == blue: + - teleport <[player]> <[extra].get[blue_start]> + - define count ]> + - if <[count]> == 2: + - define teams ]> + - repeat 3: + - title targets:<[teams].get[red].include[<[teams].get[blue]>]> title:<&6>]> fade_in:0 fade_out:0 stay:1s + - wait 1s + - if ]> < 2: + - stop + - run sports_volleyball_restart_game def.id:<[id]> def.side:red + - stop + - if <[count]> < 2: + - run sports_volleyball_idle_game def.id:<[id]> + +sports_volleyball_leave: + debug: false + type: task + definitions: id|player + script: + - define extra ].get[extra_data]> + - teleport <[player]> <[extra].get[exit]> + - glow <[player]> reset + - define ball ].if_null[null]> + - if ]> <= 1: + - run sports_volleyball_idle_game def.id:<[id]> + +sports_volleyball_redistribute: + debug: false + type: task + definitions: id|player|from|to + script: + - define extra ].get[extra_data]> + - if <[to]> == red: + - teleport <[player]> <[extra].get[red_start]> + - narrate targets:<[player]> format:formats_prefix "You were auto-balanced to the <&c>red team" + - else if <[to]> == blue: + - teleport <[player]> <[extra].get[blue_start]> + - narrate targets:<[player]> format:formats_prefix "You were auto-balanced to the <&9>blue team" + +sports_volleyball_restart_game: + debug: false + type: task + definitions: id|side + script: + - define arena ]> + - define extra <[arena].get[extra_data]> + - run sports_arena_redistribute def.id:<[id]> + - define teams ]> + - foreach <[teams].get[red]> as:red_player: + - teleport <[red_player]> <[extra].get[red_start]> + - foreach <[teams].get[blue]> as:blue_player: + - teleport <[blue_player]> <[extra].get[blue_start]> + - run sports_arena_set_status def.id:<[id]> def.status:].pass[red_start].fail[blue_start]> + - define ball_start ].pass[<[extra].get[red_ball_start]>].fail[<[extra].get[blue_ball_start]>]> + - run ball_create def.id:<[id]> def.location:<[ball_start]> def.size:<[arena].get[ball_size]> def.display_item:<[arena].get[ball_display]> def.gravity_multiplier:<[arena].get[ball_gravity]> + - narrate targets:<[teams].get[red].include[<[teams].get[blue]>]> format:formats_prefix "Next round..." + - title targets:<[teams].get[red].include[<[teams].get[blue]>]> "title:<&e>Next Round" fade_in:0 fade_out:0 stay:1s + - playsound <[teams].get[red].include[<[teams].get[blue]>]> sound:BLOCK_NOTE_BLOCK_PLING pitch:1 volume:30 + +sports_volleyball_idle_game: + debug: false + type: task + definitions: id + script: + - define extra ].get[extra_data]> + - define teams ]> + - run sports_arena_set_status def.id:<[id]> def.status:waiting + - run ball_remove def.id:<[id]> + - teleport <[teams].get[red]> <[extra].get[red_start]> + - teleport <[teams].get[blue]> <[extra].get[blue_start]> + - narrate targets:<[teams].get[red].include[<[teams].get[blue]>]> format:formats_prefix "Not enough players. Waiting..." + - title targets:<[teams].get[red].include[<[teams].get[blue]>]> title:<&7>Waiting fade_in:0 fade_out:0 stay:3s + - playsound <[teams].get[red].include[<[teams].get[blue]>]> sound:BLOCK_NOTE_BLOCK_HAT pitch:1 volume:30 + +sports_volleyball_score_goal: + debug: false + type: task + definitions: id|team + script: + - run sports_arena_set_status def.id:<[id]> def.status:goal + - define teams ]> + - if <[team]> == red: + - title targets:<[teams].get[red].include[<[teams].get[blue]>]> "title:<&c>Point for Red" fade_in:0 fade_out:0 stay:2s + - narrate targets:<[teams].get[red].include[<[teams].get[blue]>]> format:formats_prefix "<&c>Red team <&7>scored a goal!" + - if <[team]> == blue: + - title targets:<[teams].get[red].include[<[teams].get[blue]>]> "title:<&9>Point for Blue" fade_in:0 fade_out:0 stay:2s + - narrate targets:<[teams].get[red].include[<[teams].get[blue]>]> format:formats_prefix "<&9>Blue team <&7>scored a goal!" + - playsound <[teams].get[red].include[<[teams].get[blue]>]> sound:BLOCK_NOTE_BLOCK_PLING pitch:2 volume:30 + - playsound <[teams].get[red].include[<[teams].get[blue]>]> sound:ENTITY_FIREWORK_ROCKET_TWINKLE_FAR pitch:1 volume:30 + - wait 3s + - run sports_volleyball_restart_game def.id:<[id]> def.side:].pass[red].fail[blue]> diff --git a/scripts/sports/volleyball/sports_volleyball_world.dsc b/scripts/sports/volleyball/sports_volleyball_world.dsc new file mode 100644 index 0000000..4863a39 --- /dev/null +++ b/scripts/sports/volleyball/sports_volleyball_world.dsc @@ -0,0 +1,67 @@ +sports_volleyball_world: + debug: false + type: world + events: + ## ball click + on player damages entity bukkit_priority:low: + - ratelimit 10t + - define ball + - if !<[ball].has_flag[ball]>: + - stop + - if <[ball].entity_type> == armor_stand: + - define ball ]> + - if !<[ball].flag[ball].starts_with[sports_volleyball]>: + - stop + - if !: + - stop + - define arena_id + - if !<[arena_id].starts_with[sports_volleyball]>: + - stop + - define status ]> + - if <[status]> == normal: + - if ].distance_squared[<[ball].location>]> > 22: + - stop + - define y + - if <[y]> < 0.45: + - define y 0.45 + - if <[y]> > 0.95: + - define y 0.95 + - define kick ]> + - if : + - define kick + - if !: + - define kick + - define kick <[kick].add[]> + - define kick <[kick].add[]>]> + - run ball_vector_add def.ball:<[ball]> def.vector:<[kick]> + - flag <[ball]> sports_volleyball_delay_score:! + - else if <[status]> == blue_start || <[status]> == red_start: + - run sports_arena_set_status def.id:<[arena_id]> def.status:normal + - define kick + - run ball_vector_add def.ball:<[ball]> def.vector:<[kick]> + - playsound <[ball].location> sound:BLOCK_STONE_BREAK pitch:1.8 + ## point scored + on custom event id:ball_move bukkit_priority:low: + - if !: + - stop + - define arena_id + - if ]> != normal: + - define status ]> + - if <[status]> == blue_start || <[status]> == red_start: + - determine cancelled + - stop + - if !: + - if !: + - stop + - flag sports_volleyball_delay_score: + - stop + - else: + - if ]> < 300: + - stop + - define extra ].get[extra_data]> + - define red_start <[extra].get[red_start]> + - define blue_start <[extra].get[blue_start]> + - if ]> < ]>: + - run sports_volleyball_score_goal def.id:<[arena_id]> def.team:blue + - else: + - run sports_volleyball_score_goal def.id:<[arena_id]> def.team:red diff --git a/scripts/storyboard/ch1/ch1_1_preassign.dsc b/scripts/storyboard/ch1/ch1_1_preassign.dsc new file mode 100644 index 0000000..264d595 --- /dev/null +++ b/scripts/storyboard/ch1/ch1_1_preassign.dsc @@ -0,0 +1,238 @@ +ch1_1_preassign: + debug: false + type: world + events: + on player joins: + - if |preassign]> == null: + - run storyboard_npc_memalloc "def:|marie|player||Marie Ayashibayomi|true|" + - run storyboard_npc_set_assignment def.player: def.name:marie def.assignment:ch1_1_marie_assign + - run storyboard_player_state_set def.player: def.key:preassign def.value:true + +ch1_1_marie_assign: + debug: false + type: assignment + actions: + on assignment: + - trigger name:click state:true + interact scripts: + - ch1_1_marie_interact + +# TODO: this seems like the wrong place +ch1_1_define_phone: + debug: false + type: task + script: + - define phone + - adjust def:phone "display:<&e>Flip Phone" + - adjust def:phone custom_model_data:2 + - flag <[phone]> phones:true + - determine <[phone]> + +ch1_1_marie_interact: + debug: false + type: interact + steps: + 1: + click trigger: + script: + - if != null: + - stop + - engage player duration:999999s + - ~run textbox_write def.player: def.queue: "def.line3s:* Hey there, ]>!" def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I'm so happy to see ya!" def.avatar_unicode: + - definemap choices: + left: + text: Likewise + right: + text: My name? + - ~run textbox_choice def.player: def.queue: def.choices:<[choices]> save:result + - define choice + - if <[choice]> == right: + - ~run textbox_write def.player: def.queue: "def.line3s:* Oh, right." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Let's just say a little bird$$nltold me it, wink wink!" def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* So, what do you think?$$nlThis town's looking neat, no?" def.avatar_unicode: + - definemap choices: + left: + text: Yeah + right: + text: Don't know + - ~run textbox_choice def.player: def.queue: def.choices:<[choices]> save:result + - define choice + - if <[choice]> == left: + - ~run textbox_write def.player: def.queue: "def.line3s:* Right???$$nlOh man." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Golly me! I just love$$nlit here." def.avatar_unicode: + - else: + - ~run textbox_write def.player: def.queue: "def.line3s:* That's alright, you got this!$$nlYou'll fit right in, I'm sure of it." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I'm actually really fond of this$$nltown, although it's a little small." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* You're new anyway, you probably need$$nlsomebody to show you around a little,$$nlno?" def.avatar_unicode: + - definemap choices: + top: + text: It would help + bottom: + text: You talk a lot + - ~run textbox_choice def.player: def.queue: def.choices:<[choices]> save:result + - define choice + - define displeased false + - if <[choice]> == top: + - ~run textbox_write def.player: def.queue: "def.line3s:* Oh welp, I had a feeling." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Don't worry dearie, I've gotcha$$nlaaaall covered!" def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I'll be in front of the Academy." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* You know, like... the big building." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* The one with the big gates." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* You cannot miss it!$$nlSee you there!" def.avatar_unicode: + - else: + - define displeased true + - ~run textbox_write def.player: def.queue: "def.line3s:* Oh.." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Um.." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Yeah, I, uh.." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Actually.." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I'll be in front of the Academy." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Sorry." def.avatar_unicode: + - run storyboard_player_freeze def.player: + - ~walk + - run storyboard_npc_movement_commit def.player: def.name:marie def.new_location: + - run storyboard_player_unfreeze def.player: + - if !<[displeased]>: + - run storyboard_npc_state_set def.player: def.name:marie def.key:opinion def.value:1 + - else: + - run storyboard_npc_state_set def.player: def.name:marie def.key:opinion def.value:-1 + - zap 2 + - disengage player + 2: + click trigger: + script: + - if != null: + - stop + - engage player duration:999999s + - define displeased false + - define opinion |marie|opinion]> + - ~run ch1_1_define_phone save:result + - define phone + - if <[opinion]> == null: + - define opinion 1 + - if <[opinion]> == 1: + - ~run textbox_write def.player: def.queue: "def.line3s:* Alrighty, here we are!!" def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Sorry, sorry." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I'll calm myself down now." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I've got to show ya things$$nland I can't be all jumpy!" def.avatar_unicode: + - else: + - ~run textbox_write def.player: def.queue: "def.line3s:* Oh. Hey." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Need something?" def.avatar_unicode: + - definemap choices: + left: + text: I'm sorry + right: + text: No, bye + - ~run textbox_choice def.player: def.queue: def.choices:<[choices]> save:result + - define choice + - if <[choice]> == right: + - ~run textbox_write def.player: def.queue: "def.line3s:* Mkay." def.avatar_unicode: + - wait 1s + - disengage player + - stop + - ~run textbox_write def.player: def.queue: "def.line3s:* Hm. Are you now?" def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* You know, that was kind of$$nlmean of you." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Why should I help you, anyway?" def.avatar_unicode: + - definemap choices: + top: + text: I'll change my ways + bottom: + text: You're right, I'm pretending + - ~run textbox_choice def.player: def.queue: def.choices:<[choices]> save:result + - define choice + - if <[choice]> == top: + - ~run textbox_write def.player: def.queue: "def.line3s:* Well." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* . . ." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Okay, look, if you insist." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I'll try to pretend that$$nlnever happened." def.avatar_unicode: + - else: + - define displeased true + - ~run textbox_write def.player: def.queue: "def.line3s:* Well." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I should've guessed." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* So look, I'll cut it short." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I was going to show you around$$nland then give you a flip phone." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* But honestly, I don't care$$nlabout that anymore, so why don't$$nlyou just take the phone instead?" def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Makes things easier." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:$$nl(You got the flip phone.)" + - give <[phone]> + - run storyboard_player_freeze def.player: + - ~walk + - run storyboard_npc_memfree def.player: def.name:marie + - run storyboard_player_unfreeze def.player: + - goto done + - ~run textbox_write def.player: def.queue: "def.line3s:* As promised, I'll show you around." def.avatar_unicode: + - if <[opinion]> == 1: + - ~run textbox_write def.player: def.queue: "def.line3s:* You should pay attention$$nlbecause it's going to help you out!" def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I hope so at least!" def.avatar_unicode: + - else: + - ~run textbox_write def.player: def.queue: "def.line3s:* You can pay attention, but$$nlhonestly I don't care." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Anyway, follow me." def.avatar_unicode: + - ~walk speed:1 + - ~run storyboard_waituntil_safe def.player: def.queue: def.condition:[player].location.distance_squared[].is_less_than[10] + - ~run textbox_write def.player: def.queue: "def.line3s:* So this is the academy." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Really big place." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Nobody really likes the <&4><&l>dean<&0><&l>, or$$nlwell, so I hear." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Grumpy, rich... You get the idea." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Although, they did something right." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Behind this building, there are$$nlsome <&o>sport fields." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* A lot of people really enjoy them." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I'll take you there soon, but$$nllet's walk through the academy a bit." def.avatar_unicode: + - ~walk speed:1 + - ~walk speed:1 + - ~walk speed:1 + - ~run storyboard_waituntil_safe def.player: def.queue: def.condition:[player].location.distance_squared[].is_less_than[10] + - ~run textbox_write def.player: def.queue: "def.line3s:* So, anyway, the <&4><&l>dean<&0><&l> really went$$nlextra with this." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* No, but really...$$nlA decorative garden at the$$nlentrance...?" def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Anyway, let's keep going." def.avatar_unicode: + - ~walk speed:1 + - ~walk speed:1 + - ~walk speed:1 + - ~run storyboard_waituntil_safe def.player: def.queue: def.condition:[player].location.distance_squared[].is_less_than[10] + - ~run textbox_write def.player: def.queue: "def.line3s:* It is pretty, is it not?" def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Maybe they had a point." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Though I think people would appreciate$$nlit if they stopped being as snarky." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Not everyone in this town is kind and$$nlnice to you, you know?" def.avatar_unicode: + - if <[opinion]> != 1: + - ~run textbox_write def.player: def.queue: "def.line3s:* <&o>I can think of one, at least." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* So it's best you are careful." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* You never know who you'll run into." def.avatar_unicode: + - ~walk speed:1 + - ~walk speed:1 + - ~walk speed:1 + - ~walk speed:1 + - ~run storyboard_waituntil_safe def.player: def.queue: def.condition:[player].location.distance_squared[].is_less_than[10] + - ~run textbox_write def.player: def.queue: "def.line3s:* Well, here are the sport fields." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I heard they're quite fun to play at!" def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Though I suppose you'll need a friend,$$nlso maybe go together with someone!" def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I'm sure you can call someone on$$nlthe phone!" def.avatar_unicode: + - define should_give_phone + - if <[should_give_phone]>: + - ~run textbox_write def.player: def.queue: "def.line3s:* ..." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* What?!" def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* You don't have a phone?" def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Hey, I know." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I'll just give you a flip phone!" def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* You can call, text, play music..." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Give it a try!" def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:$$nl(You got the flip phone.)" + - fakeitem <[phone]> slot:hand + - ~run textbox_write def.player: def.queue: "def.line3s:* Oh, and..." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* We can continue at the Central Park." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I hear it's really easy to get there!" def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:$$nl(You remember something about /spawn)" + - ~run textbox_write def.player: def.queue: "def.line3s:* Well then, toodles!" def.avatar_unicode: + - run storyboard_player_freeze def.player: + - ~walk speed:2 + - run storyboard_player_unfreeze def.player: + - run storyboard_npc_movement_commit def.player: def.name:marie def.new_location: + - inventory update + - if <[should_give_phone]>: + - give <[phone]> + - mark done + - if !<[displeased]>: + - run storyboard_npc_state_set def.player: def.name:marie def.key:opinion def.value:<[opinion].add[1]> + - else: + - run storyboard_npc_state_set def.player: def.name:marie def.key:opinion def.value:<[opinion].sub[1]> + - inventory update + - zap 3 + - disengage player diff --git a/scripts/storyboard/data/storyboard_npc_dump.dsc b/scripts/storyboard/data/storyboard_npc_dump.dsc new file mode 100644 index 0000000..d2dafbd --- /dev/null +++ b/scripts/storyboard/data/storyboard_npc_dump.dsc @@ -0,0 +1,24 @@ +storyboard_skin_dump: + debug: false + type: data + marie: + a: ewogICJ0aW1lc3RhbXAiIDogMTcwNjgwNTQ4MjM3OSwKICAicHJvZmlsZUlkIiA6ICJhODJkZTliNjZhYjE0OGZhOTQ3OGY0OWJiZjg5OTk1YyIsCiAgInByb2ZpbGVOYW1lIiA6ICJmdWhyM3JibDRiIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2Q5OTI3MTA4ZDI4MmQ0NTYxMmM5YWZmZGQ4NDA2ODAzYWNjYmY5ZWY5N2MyMzA4NDgwNGQ3YzYwNjAyNTlkZGMiLAogICAgICAibWV0YWRhdGEiIDogewogICAgICAgICJtb2RlbCIgOiAic2xpbSIKICAgICAgfQogICAgfQogIH0KfQ==;to+5mawLkRklTI+r+N5HE/aMJPRtBYAzccTCAWfDhcH/6qpV3t25tsokGhZIfwyzn34ckycN0+Qo/HwIHpK4BYljf4TfnEI1/zLoH7V4oPnVjlwOuZuFT30OVlTo6z2vaWm3ZvhzAYsW6prt51CBZY2sGu76cBtbck7qOVUCdVzo+998dXWz19NF6mfZk11wKEsMeTWId9xB6KsNhZeqYrUr1R+PTzLl9fgsexPJ2WqZFpk1sGVzxdsxdjDxB4tDin9hulfnCq3Ar4xP+N8d1k6DMeudFaD6HltNRyfRr5nxIq7IyBU4dLG/aakUyasgVsU00v68+yzTA90sga8NSv9b1C0YTv91HcCIGbwmAoqGxuDibafkDTpEMfLAjRSIA4lxzJqZXCXssuTCzWnQVgS4OCm+MAwB08uX6uPMdL0EJwX3vMeiajQrX4P0oViKO4H0KwQnMXMOx5PqLDdFtWiBOE0NGTdJ1BqBfNbg4h3tNIv08y3hqUgUj/owfRnJ9X5EXibH2qk5+p4pHa15oDgM2Q6mSn4tkofR5nymvV8/YhtQLG9LJgeHsn6gY4ndWWk3zM3Gx3TOsDozrYs0hIfBSdLo6FJ0+7I2N/ga1Zj3Rj40d8EwGzrJrIY7v5Cz3zLnH8b70eUdAtGwW67/Qx1x/tmykKS1nfS9CGQW91M=;Marie + +storyboard_avatar_dump: + debug: false + type: data + marie: + normal: 錁 + neutral: 錂 + happy: 錃 + upset: 錄 + surprised: 錅 + ummm: 錆 + sweat: 錇 + ugh: 錈 + oof: 錉 + emika: + normal: 錑 + smirk: 錒 + smile: 錓 + unimpressed: 錔 \ No newline at end of file diff --git a/scripts/storyboard/dialogue/dialogue_npc_kobayashi.dsc b/scripts/storyboard/dialogue/dialogue_npc_kobayashi.dsc new file mode 100644 index 0000000..8960882 --- /dev/null +++ b/scripts/storyboard/dialogue/dialogue_npc_kobayashi.dsc @@ -0,0 +1,47 @@ +dialogue_npc_kobayashi_assign: + debug: false + type: assignment + actions: + on assignment: + - trigger name:click state:true + interact scripts: + - dialogue_npc_kobayashi + +dialogue_npc_kobayashi: + debug: false + type: interact + steps: + 1: + click trigger: + script: + - if != null: + - stop + - engage player + - ~run textbox_write def.player: def.queue: "def.line3s:Heya, sorry luv." + - ~run textbox_write def.player: def.queue: "def.line3s:We're currently under renovations, luv." + - definemap choices: + left: + text: Why? + right: + text: Unfortunate + - ~run textbox_choice def.player: def.queue: def.choices:<[choices]> save:result + - define choice + - if <[choice]> == left: + - ~run textbox_write def.player: def.queue: "def.line3s:What?$$nlWhy?" + - ~run textbox_write def.player: def.queue: "def.line3s:Well, look, I can't tell you that, luv.$$nl It's against Hospital Policy." + - definemap choices: + left: + text: Sorry + right: + text: Don't care + - ~run textbox_choice def.player: def.queue: def.choices:<[choices]> save:result + - define choice + - if <[choice]> == left: + - ~run textbox_write def.player: def.queue: "def.line3s:No worries, luv!" + - else: + - ~run textbox_write def.player: def.queue: "def.line3s:What?$$nlYou don't care?" + - ~run textbox_write def.player: def.queue: "def.line3s:I'm afraid I can't treat that, luv." + - else: + - ~run textbox_write def.player: def.queue: "def.line3s:Indeed, luv." + - wait 1s + - disengage player diff --git a/scripts/storyboard/dialogue/dialogue_npc_patchouli.dsc b/scripts/storyboard/dialogue/dialogue_npc_patchouli.dsc new file mode 100644 index 0000000..4291ed0 --- /dev/null +++ b/scripts/storyboard/dialogue/dialogue_npc_patchouli.dsc @@ -0,0 +1,25 @@ +dialogue_npc_patchouli_assign: + debug: false + type: assignment + actions: + on assignment: + - trigger name:click state:true + interact scripts: + - dialogue_npc_patchouli + +dialogue_npc_patchouli: + debug: false + type: interact + steps: + 1: + click trigger: + script: + - if != null: + - stop + - engage player + - ~run textbox_write def.player: def.queue: "def.line3s:. . ." + - ~run textbox_write def.player: def.queue: "def.line3s:. . ." + - ~run textbox_write def.player: def.queue: "def.line3s:She is fast asleep." + - wait 1s + - disengage player + - ratelimit 10t diff --git a/scripts/storyboard/dialogue/dialogue_npc_ryuko.dsc b/scripts/storyboard/dialogue/dialogue_npc_ryuko.dsc new file mode 100644 index 0000000..d2343cb --- /dev/null +++ b/scripts/storyboard/dialogue/dialogue_npc_ryuko.dsc @@ -0,0 +1,31 @@ +dialogue_npc_ryuko_assign: + debug: false + type: assignment + actions: + on assignment: + - trigger name:click state:true + interact scripts: + - dialogue_npc_ryuko + +dialogue_npc_ryuko: + debug: false + type: interact + steps: + 1: + click trigger: + script: + - if != null: + - stop + - engage player + - ~run textbox_write def.player: def.queue: "def.line3s:* Hey, what's up?!" + - ~run textbox_write def.player: def.queue: "def.line3s:* I hang out here a lot.$$nlI love to stay fit, be athletic." + - ~run textbox_write def.player: def.queue: "def.line3s:* Kicking balls is great!$$nl $$nl* uh.." + - ~run textbox_write def.player: def.queue: "def.line3s:* Anyway, the Academy sorta ran out of$$nlof tennis rackets." + - ~run textbox_write def.player: def.queue: "def.line3s:* Something about them being broken$$nland rusty, apparently." + - ~run textbox_write def.player: def.queue: "def.line3s:* If you ask me, that's a bunch of crap!$$nlI think <&4><&l>the dean<&0><&l> is just no fun." + - ~run textbox_write def.player: def.queue: "def.line3s:* I think they don't want us playing.$$nlIt wouldn't be the first time." + - ~run textbox_write def.player: def.queue: "def.line3s:* I also haven't seen anyone play any$$nlbasketball recently, so I'm not sure$$nlwhat that's about." + - ~run textbox_write def.player: def.queue: "def.line3s:* They should resolve this as soon as$$nlpossible before the students start a$$nlrebellion." + - wait 1s + - disengage player + - ratelimit 10t diff --git a/scripts/storyboard/intro/intro_books.dsc b/scripts/storyboard/intro/intro_books.dsc new file mode 100644 index 0000000..553d70b --- /dev/null +++ b/scripts/storyboard/intro/intro_books.dsc @@ -0,0 +1,10 @@ +intro_book: + debug: false + type: book + title: Intro Book + author: bqkitcat + signed: true + text: + - Welcome to SakuraFallsWe encourage you to enable the resource pack for the best experience.Please read the next page for more information. + - TutorialYou are going through the introductory tutorial. We will help you pick a character name and description, as well as your starting role.Please read everything! It will help a lot. + - QuestionsPlease type /ticket create in chat if you are having issues with the tutorial.Send messages with /ooc (message) for everyone online.You can also contact us on Discord, too, by <&click[https://discord.gg/bvDvQbT4s8].type[OPEN_URL]>clicking here<&end_click> diff --git a/scripts/storyboard/intro/intro_interactions.dsc b/scripts/storyboard/intro/intro_interactions.dsc new file mode 100644 index 0000000..9f90f15 --- /dev/null +++ b/scripts/storyboard/intro/intro_interactions.dsc @@ -0,0 +1,200 @@ +# Posters +intro_interact_posters: + debug: false + type: world + events: + on player right clicks block: + - if !: + - stop + - determine cancelled passively + - if : + - stop + - run intro_interact_posters_task + +intro_interact_posters_task: + debug: false + type: task + script: + - ~run textbox_write def.player: def.queue: "def.line3s:Book-related posters are on the wall." + - ~run textbox_write def.player: def.queue: "def.line3s:<&o><&dq>Screw that. I'm running away.<&dq>" + - ~run textbox_write def.player: def.queue: "def.line3s:<&o><&dq>Where?<&dq>" + - ~run textbox_write def.player: def.queue: "def.line3s:<&o><&dq>Dunno. Do you want to come?<&dq>" + - ~run textbox_write def.player: def.queue: "def.line3s:<&o><&dq>Yes,<&dq> I said without thinking." + +# Cirno +intro_interact_cirno: + debug: false + type: world + events: + on player right clicks block: + - if !: + - stop + - determine cancelled passively + - if : + - stop + - run intro_interact_cirno_task + +intro_interact_cirno_task: + debug: false + type: task + script: + - ~run textbox_write def.player: def.queue: "def.line3s:A quality, soft plushie of a beloved$$nlcharacter." + - ~run textbox_write def.player: def.queue: "def.line3s:It seems familiar, as if there are a$$nlsubstantial amount of images circulating$$nlaround with this character." + +# Laptop +intro_interact_laptop: + debug: false + type: world + events: + on player right clicks block: + - if !: + - stop + - determine cancelled passively + - if : + - stop + - run intro_interact_laptop_task + +intro_interact_laptop_task: + debug: false + type: task + script: + - ~run textbox_write def.player: def.queue: "def.line3s:It looks like a game is booted up.$$nlYou can see a city, and it looks like..." + - ~run textbox_write def.player: def.queue: "def.line3s:. . ." + - ~run textbox_write def.player: def.queue: "def.line3s:It's you!$$nl. . .$$nlWell, it's your character." + - ~run textbox_write def.player: def.queue: "def.line3s:You should give your character$$nla cool name, right?" + - waituntil max:5s + - ~run textbox_flush def.player: + - run anvil_input def.player: "def.prompt:Character Name" def.callback:intro_interact_laptop_task_name_callback + +intro_interact_laptop_task_name_callback: + debug: false + type: task + definitions: player|input + script: + - define __player <[player]> + - define name <[input].substring[1,24]> + - execute as_player player:<[player]> "rpname <[name]>" + - ~run textbox_write def.player: def.queue: "def.line3s:<[name]>" + - ~run textbox_write def.player: def.queue: "def.line3s:How nice!" + - ~run textbox_write def.player: def.queue: "def.line3s:Let's give them a description.$$nlDescribe their physical attributes." + - waituntil max:5s + - ~run textbox_flush def.player: + - run anvil_input def.player: "def.prompt:Description" def.callback:intro_interact_laptop_task_description_callback + +intro_interact_laptop_task_description_callback: + debug: false + type: task + definitions: player|input + script: + - define __player <[player]> + - execute as_player player:<[player]> "setdesc <[input]>" + - ~run textbox_write def.player: def.queue: "def.line3s:Great, your character's almost ready." + - ~run textbox_write def.player: def.queue: "def.line3s:Lastly, your character can start$$nlout as a student or as$$nlan adult." + - ~run textbox_write def.player: def.queue: "def.line3s:Both options are great, and it's$$nlmostly a matter of preference." + - ~run textbox_write def.player: def.queue: "def.line3s:For complete beginners, we recommend$$nlstarting out as a student." + - waituntil max:5s + - ~run textbox_flush def.player: + - run intro_interact_laptop_task_role_menu def.player: + +intro_interact_laptop_task_role_menu: + debug: false + type: task + definitions: player + script: + - definemap contents: + 1: + item: <&l>» <&e>Choose your starting role;lore=<&7>Your role gives you different roleplay opportunities and gameplay.|<&7>You can make a new character after the tutorial if you are unsure.]]> + 4: + item: 鐀;lore=<&7><&o>A new student at Tatsuru Academy, ready to learn|<&7><&o>and live a highschooler's life.]]> + script: intro_interact_laptop_task_role_callback + definitions: + player: <[player]> + input: no + 6: + item: 鐃;lore=<&7><&o>Freshly moved into Atarashikibo, on your way to|<&7><&o>find a job and a meaning.]]> + script: intro_interact_laptop_task_role_callback + definitions: + player: <[player]> + input: yes + - run menu_open def.player:<[player]> "def.title:<&f>邑邑邑邑酐<&a><&sp><&b><&sp><&c><&sp>" def.size:9 def.contents:<[contents]> + +intro_interact_laptop_task_role_callback: + debug: false + type: task + definitions: player|input + script: + - inventory close player:<[player]> + - define __player <[player]> + - define adult <[input].to_lowercase.trim.equals[yes]> + - if <[adult]>: + - execute as_server "lp user parent add adult" + - ~run textbox_write def.player: def.queue: "def.line3s:An adult it shall be.$$nlIf this is wrong, let us know." + - else: + - execute as_server "lp user parent add grade-10" + - ~run textbox_write def.player: def.queue: "def.line3s:A student it shall be.$$nlIf this is wrong, let us know." + - ~run textbox_write def.player: def.queue: "def.line3s:You should now be ready to start!" + - ~run textbox_write def.player: def.queue: "def.line3s:Have fun!" + - waituntil max:5s + - cast BLINDNESS duration:infinite no_ambient hide_particles no_icon + - wait 1s + - ~run textbox_write def.player: def.queue: "def.line3s:* Though..." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I feel obligated to ask." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Have you heard of <&o>IC<&0><&l> and <&o>OOC<&0><&l>?" def.avatar_unicode: + - definemap choices: + left: + text: Not really + right: + text: Yeah + - ~run textbox_choice def.player: def.queue: def.choices:<[choices]> save:result + - define choice + - if <[choice]> == left: + - ~run textbox_write def.player: def.queue: "def.line3s:* Ah..." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* You see, this WORLD..." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* This... <&o>representation<&0><&l>." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* You exist beyond it." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I'm talking about you, ." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Your character.$$nlYour VESSEL.$$nl" def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* They do not." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* You, , are <&o>out of character<&0><&l>." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Your VESSEL...$$nl$$nlThey are <&o>in character<&0><&l>." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* So, when your VESSEL speaks..." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* That is not <&o>you<&0><&l>." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Your VESSEL has different feelings,$$nlemotions, and experiences." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* What those are is for you to decide." def.avatar_unicode: + - else: + - ~run textbox_write def.player: def.queue: "def.line3s:* Ah..." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* So you know they stand for$$nl<&o>in character<&0><&l> and <&o>out of character." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* You are probably familiar with$$nlthis WORLD." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* You are probably familiar with$$nlroleplaying, too." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I apologise for doubting you$$nllike that." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* . . ." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* In this world, we get to choose who$$nlwe are, at least sort of." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Maybe we cannot decide what the$$nloutcome will be, but we can try." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* , I..." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I think your choices are important,$$nlregardless." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I think you should try your best to$$nldo what your heart tells you." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Wouldn't you agree?" def.avatar_unicode: + - definemap choices: + left: + text: Correct + right: + text: ... + - ~run textbox_choice def.player: def.queue: def.choices:<[choices]> save:result + - define choice + - if <[choice]> == left: + - ~run textbox_write def.player: def.queue: "def.line3s:* I'm glad you understand." def.avatar_unicode: + - else: + - ~run textbox_write def.player: def.queue: "def.line3s:* Ah..." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I see." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* Very well. You are truly ready." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* When you are finally linked to$$nlour WORLD, you will see <&o>Marie<&0><&l>." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* She has talked to many others just$$nllike you." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* So, you should probably talk to her." def.avatar_unicode: + - ~run textbox_write def.player: def.queue: "def.line3s:* I'll be on my way.$$nlGood luck!" def.avatar_unicode: + - waituntil max:5s + - ~run textbox_flush def.player: + - adjust remove_effects + - adjust show_to_players + - flag intro:done + - execute as_player player: "spawn" + diff --git a/scripts/storyboard/intro/intro_world.dsc b/scripts/storyboard/intro/intro_world.dsc new file mode 100644 index 0000000..bd98964 --- /dev/null +++ b/scripts/storyboard/intro/intro_world.dsc @@ -0,0 +1,18 @@ +intro_world: + debug: false + type: world + events: + after player joins: + - define intro + - if <[intro]> != done: + - adjust hide_from_players + - adjust remove_effects + - run textbox_flush def.player: + - if <[intro]> == null: + - teleport + - flag intro:progress + - adjust show_book:intro_book + on player teleports bukkit_priority:lowest: + - if == progress: + - determine cancelled passively + - narrate "<&c>You may not teleport at this time." diff --git a/scripts/storyboard/tasks/storyboard_npc_tasks.dsc b/scripts/storyboard/tasks/storyboard_npc_tasks.dsc new file mode 100644 index 0000000..3bda479 --- /dev/null +++ b/scripts/storyboard/tasks/storyboard_npc_tasks.dsc @@ -0,0 +1,255 @@ +# +# Storyboard NPC Tasks +# +# Adds a complex set of per-player state managed NPC routines which +# allow for the creation of RPG-like stories, similar to Undertale. +# +# The routines and state system is also as memory efficient and lazy +# as possible. It utilizes Denizen and Citizens to their best, taking +# advantage of Denizen's innate scripting possibilites. +# + +# Allocates an NPC with a given name at some location for the current player. +# +# Optionally, specify a display name, display name visibility, and a skin_blob. +# Generate Skin Blobs using https://mineskin.org - it cannot be done automatically +# at this time. +# +# If the NPC is reallocated from player state, it will try to re-fill these values. +# You can specify new values to change these. +# Note it will only try to fill these optional values, not "name", "type", and "at". +# +# The name of the NPC must be unique - this is not the same as the display +# name of the NPC; rather it is an internal name, so it's recommended to +# keep it lowercase. +# +# If the NPC is not allocated but was saved in the player's mem state, it +# will be created and its state will be restored. +# If the NPC is already allocated, it will simply teleport the NPC. +# +# All NPCs are memfree'd when a player leaves, which does not reduce storage +# overhead, but does greatly reduce overhead when hiding/showing per-player NPCs. +# They are automatically memalloc'ed when a player rejoins. +storyboard_npc_memalloc: + debug: false + type: task + definitions: player|name|type|at|display_name|show_name|skin_blob + script: + - define registry registry_<[player].uuid> + - define npc_id npc_<[player].uuid>_<[name]> + - if !].if_null[].contains[<[npc_id]>]>: + - define npcs <[player].flag[storyboard_state].get[npcs].if_null[]> + - create <[type]> <[npc_id]> <[at]> registry:<[registry]> save:npc + - define npc + - define npc_state + - define assignment null + - if <[npcs].contains[<[name]>]>: + - define npc_data <[npcs].get[<[name]>]> + - define npc_state <[npc_data].get[state]> + - if <[display_name].if_null[null]> == null: + - define display_name <[npc_data].get[display_name]> + - if <[show_name].if_null[null]> == null: + - define show_name <[npc_data].get[show_name]> + - if <[skin_blob].if_null[null]> == null: + - define skin_blob <[npc_data].get[skin_blob]> + - define assignment <[npc_data].get[assignment].if_null[null]> + - else: + - if <[display_name].if_null[null]> == null: + - define display_name <[display_name].if_null[<[name].to_sentence_case>]> + - if <[show_name].if_null[null]> == null: + - define show_name <[show_name].if_null[true]> + - if <[skin_blob].if_null[null]> == null: + - define skin_blob <[skin_blob].if_null[null]> + - definemap npc_data: + name: <[name]> + type: <[type]> + at: <[at]> + state: <[npc_state]> + display_name: <[display_name]> + show_name: <[show_name]> + skin_blob: <[skin_blob]> + allocated: true + assignment: <[assignment]> + - define npcs <[npcs].with[<[name]>].as[<[npc_data]>]> + - flag <[player]> storyboard_state:<[player].flag[storyboard_state].if_null[].with[npcs].as[<[npcs]>]> + - adjust <[npc]> auto_update_skin:false + - adjust <[npc]> name_visible:false + - lookclose <[npc]> state:true range:4 + - if !<[show_name]>: + - adjust <[npc]> hologram_lines: + - else: + - adjust <[npc]> "hologram_lines:<&f>鐓 <[display_name]>" + - if <[skin_blob]> != null: + - adjust <[npc]> skin_blob:<[skin_blob]> + - if <[assignment]> != null: + - assignment set script:<[assignment]> to:<[npc]> + - wait 2t + - run storyboard_npc_internal_show_to_player def.player:<[player]> def.npc:<[npc]> + - else: + - define index ].find[<[npc_id]>]> + - define npc ,<[registry]>]> + - teleport <[npc]> <[at]> + +# Retrieves an NPC from the player's unique NPC registry by name. +storyboard_npc_by_name: + debug: false + type: procedure + definitions: player|name + script: + - define registry registry_<[player].uuid> + - define npc_id npc_<[player].uuid>_<[name]> + - determine ].filter_tag[<[filter_value].name.equals[<[npc_id]>]>].get[1]> + +# Frees an NPC from memory, but does not destroy its state. +# +# This is often done automatically when the player leaves the server, however it may +# be useful for programmers to manually call this routine for optimization purposes. +# +# If you don't want the server to reallocate the NPC on player join, provide +# the reallocate definition as 'reallocate' (or just don't provide it). +storyboard_npc_memfree: + debug: false + type: task + definitions: player|name|reallocate + script: + - define npc |<[name]>]> + - define reallocate <[reallocate].if_null[false]> + - define npcs <[player].flag[storyboard_state].get[npcs].if_null[]> + - define npc_data <[npcs].get[<[name]>]> + - define npc_data <[npc_data].with[allocated].as[<[reallocate]>]> + - define npcs <[npcs].with[<[name]>].as[<[npc_data]>]> + - flag <[player]> storyboard_state:<[player].flag[storyboard_state].if_null[].with[npcs].as[<[npcs]>]> + - remove <[npc]> + +# Destroys an NPC from memory, which destroys its state. +# Further memalloc's will re-create the NPC with new state data. +# Use this when you are 100% done with using an NPC. +# If you only want to remove an NPC until later, but keep its state, +# consider calling storyboard_npc_memfree instead. +storyboard_npc_memdestroy: + debug: false + type: task + definitions: player|name + script: + - define npcs <[player].flag[storyboard_state].get[npcs].if_null[]> + - define npcs <[npcs].exclude[<[name]>]> + - flag <[player]> storyboard_state:<[player].flag[storyboard_state].if_null[].with[npcs].as[<[npcs]>]> + - define npc |<[name]>]> + - remove <[npc]> + +# Flags the NPC by name, mapping the given key to the given value. +storyboard_npc_state_set: + debug: false + type: task + definitions: player|name|key|value + script: + - define npc |<[name]>]> + - define npcs <[player].flag[storyboard_state].get[npcs].if_null[]> + - define npc_data <[npcs].get[<[name]>]> + - define state <[npc_data].get[state].if_null[]> + - define state <[state].with[<[key]>].as[<[value]>]> + - define npc_data <[npc_data].with[state].as[<[state]>]> + - define npcs <[npcs].with[<[name]>].as[<[npc_data]>]> + - flag <[player]> storyboard_state:<[player].flag[storyboard_state].if_null[].with[npcs].as[<[npcs]>]> + +# Gets a state value from the NPC by name and key; effectively like reading a flag. +# If the given key does not exist/is not set, determines null. +storyboard_npc_state_get: + debug: false + type: procedure + definitions: player|name|key + script: + - define npcs <[player].flag[storyboard_state].get[npcs].if_null[]> + - define npc_data <[npcs].get[<[name]>]> + - define state <[npc_data].get[state].if_null[]> + - determine <[state].get[<[key]>].if_null[null]> + +# Deletes a flag from the NPC by name and key. +storyboard_npc_state_clear: + debug: false + type: task + definitions: player|name|key + script: + - define npc |<[name]>]> + - define npcs <[player].flag[storyboard_state].get[npcs].if_null[]> + - define npc_data <[npcs].get[<[name]>]> + - define state <[npc_data].get[state].if_null[]> + - define state <[state].exclude[<[key]>]> + - define npc_data <[npc_data].with[state].as[<[state]>]> + - define npcs <[npcs].with[<[name]>].as[<[npc_data]>]> + - flag <[player]> storyboard_state:<[player].flag[storyboard_state].if_null[].with[npcs].as[<[npcs]>]> + +# Sets an NPCs assignment, which also persists across memfrees. +storyboard_npc_set_assignment: + debug: false + type: procedure + definitions: player|name|assignment + script: + - define npc |<[name]>]> + - define npcs <[player].flag[storyboard_state].get[npcs].if_null[]> + - define npc_data <[npcs].get[<[name]>]> + - define npc_data <[npc_data].with[assignment].as[<[assignment]>]> + - define npcs <[npcs].with[<[name]>].as[<[npc_data]>]> + - flag <[player]> storyboard_state:<[player].flag[storyboard_state].if_null[].with[npcs].as[<[npcs]>]> + - assignment set script:<[assignment]> to:<[npc]> + +# Moves an NPC to a new location, both physically, and in memory also. +# When an NPC is moved by normal teleports or the walk command, its location isn't stored. +# Use this to either commit its final position, or teleport it after a cutscene. +storyboard_npc_movement_commit: + debug: false + type: procedure + definitions: player|name|new_location + script: + - define npc |<[name]>]> + - define npcs <[player].flag[storyboard_state].get[npcs].if_null[]> + - define npc_data <[npcs].get[<[name]>]> + - define npc_data <[npc_data].with[at].as[<[new_location]>]> + - define npcs <[npcs].with[<[name]>].as[<[npc_data]>]> + - flag <[player]> storyboard_state:<[player].flag[storyboard_state].if_null[].with[npcs].as[<[npcs]>]> + - teleport <[npc]> <[new_location]> + +## Internal only! +storyboard_npc_internal_auto_memory_management: + debug: false + type: world + events: + after player joins: + - define npcs ]> + - foreach <[npcs]> key:name as:data: + - if <[data].get[allocated]> == reallocate: + - define name <[data].get[name]> + - define type <[data].get[type]> + - define at <[data].get[at]> + - run storyboard_npc_memalloc def.player: def.name:<[name]> def.type:<[type]> def.at:<[at]> + on player quits: + - define registry registry_ + - define npcs ].if_null[]> + - define substr_length _].length.add[1]> + - foreach <[npcs]> as:npc: + - define name <[npc].name.substring[<[substr_length]>]> + - run storyboard_npc_memfree def.player: def.name:<[name]> def.reallocate:reallocate + +storyboard_npc_internal_show_to_player: + debug: false + type: task + definitions: player|npc + script: + - adjust <[npc]> hide_from_players + - adjust <[player]> show_entity:<[npc]> + - foreach <[npc].hologram_npcs.if_null[]> as:hologram: + - adjust <[hologram]> hide_from_players + - adjust <[player]> show_entity:<[hologram]> + +storyboard_npc_internal_auto_display_entities: + debug: false + type: world + events: + on player joins bukkit_priority:high: + - foreach ]> as:target: + - define registry registry_<[target].uuid> + - define npcs ].if_null[]> + - foreach <[npcs]> as:npc: + - adjust hide_entity:<[npc]> + - foreach <[npc].hologram_npcs.if_null[]> as:hologram: + - adjust hide_entity:<[hologram]> diff --git a/scripts/storyboard/tasks/storyboard_player_tasks.dsc b/scripts/storyboard/tasks/storyboard_player_tasks.dsc new file mode 100644 index 0000000..9023fbd --- /dev/null +++ b/scripts/storyboard/tasks/storyboard_player_tasks.dsc @@ -0,0 +1,70 @@ +# +# Storyboard Player Tasks +# +# Adds a set of tasks for managing player storyboard state. +# Pretty common in use. +# +# Note: These actions are **committed** - so should be executed LAST in a script. +# This allows the actions to "rollback" in case the server crashes/player disconnects. +# + +# Sets a named key to any value in the player state. +storyboard_player_state_set: + debug: false + type: task + definitions: player|key|value + script: + - define state <[player].flag[storyboard_state].get[state].if_null[]> + - define state <[state].with[<[key]>].as[<[value]>]> + - flag <[player]> storyboard_state:<[player].flag[storyboard_state].if_null[].with[state].as[<[state]>]> + +# Removes a named key from player state. +# If the key doesn't exist, silently fails. +storyboard_player_state_clear: + debug: false + type: task + definitions: player|key + script: + - define state <[player].flag[storyboard_state].get[state].if_null[]> + - define state <[state].exclude[<[key]>]> + - flag <[player]> storyboard_state:<[player].flag[storyboard_state].if_null[].with[state].as[<[state]>]> + +# Gets a named key from player state. +# If the key doesn't exist, "null" is returned. +storyboard_player_state_get: + debug: false + type: procedure + definitions: player|key + script: + - define state <[player].flag[storyboard_state].get[state].if_null[]> + - determine <[state].get[<[key]>].if_null[null]> + +# Freezes a player in place by setting their speed to 0. +# On relogs, automatically 'unfreezes' them. +# See the complementary task storyboard_player_unfreeze +storyboard_player_freeze: + debug: false + type: task + definitions: player + script: + - flag storyboard_freeze_speed: + - adjust walk_speed:0 + +# Unfreezes a player. Always happens automatically on relogs. +# See the complementary task storyboard_player_freeze +storyboard_player_unfreeze: + debug: false + type: task + definitions: player + script: + - adjust walk_speed: + - flag storyboard_freeze_speed:! + +## Internal only! +storyboard_player_freeze_check: + debug: false + type: world + events: + on player joins: + - if : + - run storyboard_player_unfreeze def.player: diff --git a/scripts/storyboard/util/storyboard_player_utils.dsc b/scripts/storyboard/util/storyboard_player_utils.dsc new file mode 100644 index 0000000..6014ff1 --- /dev/null +++ b/scripts/storyboard/util/storyboard_player_utils.dsc @@ -0,0 +1,27 @@ +# +# Storyboard Player Utils +# Various optional utils which tend to be pretty helpful. +# + +# Gets the player character's first name (or what should be the first name). +storyboard_character_first_name: + debug: false + type: procedure + definitions: player + script: + - determine <[player].flag[character_rpname].split.first.to_sentence_case.if_null[<<>?<>>]> + +# Effectively like a permanent waituntil, except checks if player's online, etc.; if not, kills the queue. +storyboard_waituntil_safe: + debug: false + type: task + definitions: player|queue|condition + script: + - while true: + - define condition_parsed <[condition]><>>].parsed> + - if <[condition_parsed]> || !<[player].is_online>: + - while stop + - wait 10t + - if !<[player].is_online>: + - queue stop <[queue]> + - debug log "[Storyboard] Cancelled queue <[queue].numeric_id><&at><[queue].script.name> for <[player].name>; offline" \ No newline at end of file diff --git a/scripts/stroll/stroll_commands.dsc b/scripts/stroll/stroll_commands.dsc new file mode 100644 index 0000000..66204f8 --- /dev/null +++ b/scripts/stroll/stroll_commands.dsc @@ -0,0 +1,16 @@ +stroll_command_stroll: + debug: false + type: command + name: stroll + usage: /stroll + description: Makes you walk a lil slower, until you run or sneak. + permission: stroll.command.stroll + tab completions: + 1: + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - flag stroll_speed: + - adjust walk_speed:0.1 + - narrate format:formats_prefix "You are now strolling. Sprint or sneak to stop strolling." diff --git a/scripts/stroll/stroll_world.dsc b/scripts/stroll/stroll_world.dsc new file mode 100644 index 0000000..be98563 --- /dev/null +++ b/scripts/stroll/stroll_world.dsc @@ -0,0 +1,12 @@ +stroll_world: + debug: false + type: world + events: + on player toggles sneaking: + - if : + - adjust walk_speed: + - flag stroll_speed:! + on player toggles sprinting: + - if : + - adjust walk_speed: + - flag stroll_speed:! diff --git a/scripts/suspension/suspension_commands.dsc b/scripts/suspension/suspension_commands.dsc new file mode 100644 index 0000000..1354bce --- /dev/null +++ b/scripts/suspension/suspension_commands.dsc @@ -0,0 +1,17 @@ +suspension_command_suspension: + debug: false + type: command + name: suspension + description: Check how long you have until suspension expires. + usage: /suspension + permission: suspension.command.suspension + tab completions: + 1: + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if : + - narrate format:formats_prefix "You are suspended for <&e>]><&7>." + - else: + - narrate format:formats_prefix "You are not suspended." diff --git a/scripts/tabcomplete/tabcomplete_data.dsc b/scripts/tabcomplete/tabcomplete_data.dsc new file mode 100644 index 0000000..4fabf9e --- /dev/null +++ b/scripts/tabcomplete/tabcomplete_data.dsc @@ -0,0 +1,78 @@ +tabcomplete_config: + debug: false + type: data + groups: + default: + commands: + - plugins + - sit + - lay + - crawl + - call + - text + - ooc + - looc + - chsw + - channelswitch + - spawn + - balance + - bal + - stroll + - roll + - findname + - fn + - rpname + - setdesc + - viewdescription + - viewdesc + - setdescription + - carry + - uncarry + - apartmentaddmember + - aptaddmember + - aptam + - apartmentaddmoderator + - aptaddmod + - apartmentremoveaccess + - aptremoveaccess + - aptrm + - apartmenteditmode + - apteditmode + - editmode + - grade + - playtime + - wardrobe + - ticket + - langcall + - langcally + - langcallw + - cally + - callw + - yell + - y + - whisper + - w + - me + - mel + - melong + - mec + - meclose + - itc + - itclose + - itl + - itlong + - it + - my + - language + - lang + - languagewhisper + - langwhisper + - langw + - languageyell + - langyell + - langy + - payto + - ticket + - chatcolor + - spawn + - profiles diff --git a/scripts/tabcomplete/tabcomplete_tasks.dsc b/scripts/tabcomplete/tabcomplete_tasks.dsc new file mode 100644 index 0000000..c3f8225 --- /dev/null +++ b/scripts/tabcomplete/tabcomplete_tasks.dsc @@ -0,0 +1,11 @@ +tabcomplete_fetch: + debug: false + type: procedure + definitions: player + script: + - define result + - define data + - foreach <[data]> key:group as:group_data: + - if <[group]> == default || <[player].has_permission[<[group_data].get[permission].if_null[true]>]>: + - define result <[result].include[<[group_data].get[commands].if_null[]>]> + - determine <[result]> diff --git a/scripts/tabcomplete/tabcomplete_world.dsc b/scripts/tabcomplete/tabcomplete_world.dsc new file mode 100644 index 0000000..c27b635 --- /dev/null +++ b/scripts/tabcomplete/tabcomplete_world.dsc @@ -0,0 +1,9 @@ +tabcomplete_world: + debug: false + type: world + events: + on player receives commands: + - if : + - if : + - stop + - determine ]> diff --git a/scripts/templatetools/templatetools_commands.dsc b/scripts/templatetools/templatetools_commands.dsc new file mode 100644 index 0000000..21ee5f0 --- /dev/null +++ b/scripts/templatetools/templatetools_commands.dsc @@ -0,0 +1,130 @@ +templatetools_command_templatetools: + debug: false + type: command + name: templatetools + description: TemplateTools info. + usage: /templatetools + aliases: + - tt + permission: templatetools.command.tt + tab completions: + 1: + script: + - narrate format:templatetools_formats_main "TemplateTools (Denizen impl.) v1.0.0.0" + - narrate format:templatetools_formats_main "Author: unsafemalloc" + +templatetools_command_ttpack: + debug: false + type: command + name: ttpack + description: Changes pack for Template Tool usage. + usage: /ttpack (pack) + permission: templatetools.command.ttpack + tab completions: + 1: ]> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if != 1: + - narrate "<&c>Invalid use. Please try / (pack)." + - stop + - if !]>: + - narrate "<&c>There is no such pack: " + - stop + - flag templatetools_pack: + - flag templatetools_pack_index:1 + - ~run templatetools_schematic_set_index def.player: + - run templatetools_preview_queue def.player: def.schematic: + - narrate format:templatetools_formats_main "Set TemplateTools pack to (use /ttschematic to select a schematic)" + +templatetools_command_ttschematic: + debug: false + type: command + name: ttschematic + description: Changes schematic for Template Tool usage. + usage: /ttschematic (schematic) + permission: templatetools.command.ttschematic + tab completions: + 1: ]> + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if != 1: + - narrate "<&c>Invalid use. Please try / (schematic)." + - stop + - if !: + - narrate "<&c>Please select a template pack first using /ttpack." + - stop + - if !].contains[]>: + - narrate "<&c>There is no such schematic: " + - stop + - if ]>: + - ~schematic unload name:templatetools_ + - schematic load name:templatetools_ filename:/ + - flag templatetools_schematic:templatetools_ + - narrate format:templatetools_formats_main "Set TemplateTools schematic to (you can preview it using a Spider Eye)" + +templatetools_command_ttundo: + debug: false + type: command + name: ttundo + description: Undoes last operation. + usage: /ttundo + permission: templatetools.command.ttundo + tab completions: + 1: + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - if ].is_empty>: + - narrate format:templatetools_formats_main "Nothing left to undo." + - stop + - run templatetools_pop_undo def.player: + - narrate format:templatetools_formats_main "Undid previous operation." + +templatetools_command_ttsetcursor: + debug: false + type: command + name: ttsetcursor + aliases: + - ttsc + description: Sets blocks in WorldEdit selection using the material you're looking at. + usage: /ttsetcursor + permission: templatetools.command.ttsetcursor + tab completions: + 1: + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - define material + - if <[material]> == null: + - narrate "<&c>Invalid material. Please look at a material to set first!" + - stop + - define we_selection + - if <[we_selection]> == null: + - narrate "<&c>You must first make a WorldEdit selection." + - stop + - ~modifyblock <[we_selection]> <[material]> no_physics + - narrate format:templatetools_formats_main "Set cursor blocks (<[we_selection].volume.if_null[?]>)." + +templatetools_command_that: + debug: false + type: command + name: that + description: TemplateTools info. + usage: /that + permission: templatetools.command.that + tab completions: + 1: + script: + - define material + - if <[material]> == null: + - narrate "<&c>Nothing to copy." + - define item ].if_null[null]>: + - narrate "<&c>Nothing to copy." + - inventory set slot:hand origin:<[item]> + - narrate format:templatetools_formats_main "Copied <[material].name>." \ No newline at end of file diff --git a/scripts/templatetools/templatetools_formats.dsc b/scripts/templatetools/templatetools_formats.dsc new file mode 100644 index 0000000..502aa0c --- /dev/null +++ b/scripts/templatetools/templatetools_formats.dsc @@ -0,0 +1,4 @@ +templatetools_formats_main: + debug: false + type: format + format: <&8>(<&b><&l>TT<&8>) <&7><[text]> diff --git a/scripts/templatetools/templatetools_tasks.dsc b/scripts/templatetools/templatetools_tasks.dsc new file mode 100644 index 0000000..6bd7c9b --- /dev/null +++ b/scripts/templatetools/templatetools_tasks.dsc @@ -0,0 +1,183 @@ +templatetools_available_packs: + debug: false + type: procedure + script: + - determine ]> + +templatetools_pack_length: + debug: false + type: procedure + definitions: player + script: + - if !<[player].has_flag[templatetools_pack]>: + - determine 0 + - determine ].size> + +templatetools_pack_increment: + debug: false + type: task + definitions: player + script: + - define pack_length ]> + - if <[pack_length]> == 0: + - stop + - define index <[player].flag[templatetools_pack_index].add[1]> + - if <[index]> > <[pack_length]>: + - define index 1 + - flag <[player]> templatetools_pack_index:<[index]> + +templatetools_pack_decrement: + debug: false + type: task + definitions: player + script: + - define pack_length ]> + - if <[pack_length]> == 0: + - stop + - define index <[player].flag[templatetools_pack_index].sub[1]> + - if <[index]> < 1: + - define index <[pack_length]> + - flag <[player]> templatetools_pack_index:<[index]> + +templatetools_available_schematics: + debug: false + type: procedure + definitions: player + script: + - if !<[player].has_flag[templatetools_pack]>: + - determine + - determine ].parse_tag[<[parse_value].replace_text[regex:.schem$].with[]>].if_null[].alphanumeric> + +templatetools_schematic_set_index: + debug: false + type: task + definitions: player + script: + - define schematics ]> + - if ]>: + - ~schematic unload name:<[player].flag[templatetools_schematic]> + - schematic load name:templatetools_<[player].uuid> filename:<[player].flag[templatetools_pack]>/<[schematics].get[<[player].flag[templatetools_pack_index]>]> + - actionbar "<&e>Schematic <[player].flag[templatetools_pack_index]>: <&f><[schematics].get[<[player].flag[templatetools_pack_index]>]>" targets:<[player]> + +templatetools_preview_queue: + debug: false + type: task + definitions: player|schematic + script: + - if <[player].has_flag[templatetools_preview_queue]>: + - stop + - flag <[player]> templatetools_preview_queue:true expire:0.5s + - wait 0.5s + - if !]>: + - stop + - waituntil ].width.if_null[-1]> != -1 max:2s + - flag <[player]> templatetools_preview_queue:! + - run templatetools_preview def.player:<[player]> def.schematic:<[schematic]> + +templatetools_preview_show: + debug: false + type: task + definitions: player|schematic + script: + - define cursor_on <[player].cursor_on.if_null[null]> + - if <[cursor_on]> == null: + - stop + - if !]>: + - stop + - define cuboid ].cuboid[<[cursor_on]>]> + - define middle <[cuboid].center> + - define smallest_y <[cuboid].corners.get[first].y> + - if <[cuboid].corners.get[last].y> < <[smallest_y]>: + - define smallest_y <[cuboid].corners.get[last].y> + - define difference_y <[cursor_on].y.sub[<[smallest_y]>]> + - define cursor_on <[cursor_on].sub[0,<[difference_y].sub[1]>,0]> + - define fakedlocations + - if !<[player].item_in_hand.advanced_matches[spider_eye]>: + - run templatetools_preview_clear def.player:<[player]> + - stop + - define halfwidth ].width.div[2]> + - define halflength ].length.div[2]> + - repeat ].width> from:0 as:x: + - repeat ].height> from:0 as:y: + - repeat ].length> from:0 as:z: + - define location ,<[y]>,<[z]>,<[player].world.name>]> + - define block ].block[<[location]>]> + - if <[block].name> == air: + - repeat next + - define fakedlocation <[cursor_on].add[<[location]>].sub[<[halfwidth]>,0,<[halflength]>].add[1,0,1]> + - showfake ].block[<[location]>]> <[fakedlocation]> players:<[player]> duration:1h + - define fakedlocations <[fakedlocations].include[<[fakedlocation]>]> + - flag <[player]> templatetools_preview_region:<[fakedlocations]> + +templatetools_preview_clear: + debug: false + type: task + definitions: player + script: + - if !<[player].has_flag[templatetools_preview_region]>: + - stop + - showfake cancel <[player].flag[templatetools_preview_region]> + - flag <[player]> templatetools_preview_region:! + +templatetools_preview: + debug: false + type: task + definitions: player|schematic + script: + - ~run templatetools_preview_clear def.player:<[player]> + - run templatetools_preview_show def.player:<[player]> def.schematic:<[schematic]> + +templatetools_preview_paste: + debug: false + type: task + definitions: player|schematic + script: + - define cursor_on <[player].cursor_on.if_null[null]> + - if <[cursor_on]> == null: + - stop + - define cuboid ].cuboid[<[cursor_on]>]> + - define middle <[cuboid].center> + - define smallest_y <[cuboid].corners.get[first].y> + - if <[cuboid].corners.get[last].y> < <[smallest_y]>: + - define smallest_y <[cuboid].corners.get[last].y> + - define difference_y <[cursor_on].y.sub[<[smallest_y]>]> + - define cursor_on <[cursor_on].sub[0,<[difference_y].sub[1]>,0]> + - if !<[player].item_in_hand.advanced_matches[spider_eye]>: + - run templatetools_preview_clear def.player:<[player]> + - stop + - define halfwidth ].width.div[2]> + - define halflength ].length.div[2]> + - define count 0 + - define undodata + - repeat ].width> from:0 as:x: + - repeat ].height> from:0 as:y: + - repeat ].length> from:0 as:z: + - define location ,<[y]>,<[z]>,<[player].world.name>]> + - define block ].block[<[location]>]> + - if <[block].name> == air: + - repeat next + - define fakedlocation <[cursor_on].add[<[location]>].sub[<[halfwidth]>,0,<[halflength]>].add[1,0,1]> + - define previousmaterial <[fakedlocation].material> + - modifyblock ].block[<[location]>]> <[fakedlocation]> no_physics + - define undodata <[undodata].with[<[fakedlocation]>].as[<[previousmaterial]>]> + - define count <[count].add[1]> + - run templatetools_push_undo def.player:<[player]> def.data:<[undodata]> + - determine <[count]> + +templatetools_push_undo: + debug: false + type: task + definitions: player|data + script: + - flag <[player]> templatetools_undo:<[player].flag[templatetools_undo].if_null[].include[<[data]>]> + +templatetools_pop_undo: + debug: false + type: task + definitions: player + script: + - if <[player].flag[templatetools_undo].if_null[].is_empty>: + - stop + - foreach <[player].flag[templatetools_undo].last> key:location as:material: + - modifyblock <[material]> <[location]> no_physics + - flag <[player]> templatetools_undo:<[player].flag[templatetools_undo].remove[last]> diff --git a/scripts/templatetools/templatetools_world.dsc b/scripts/templatetools/templatetools_world.dsc new file mode 100644 index 0000000..ac8c9ed --- /dev/null +++ b/scripts/templatetools/templatetools_world.dsc @@ -0,0 +1,98 @@ +templatetools_world_cleanup: + debug: false + type: world + events: + after server start: + - foreach ]> as:schematic: + - schematic unload name:<[schematic]> + - foreach as:player: + - flag <[player]> templatetools_undo:! + +templatetools_world_preview: + debug: false + type: world + events: + on player walks: + - if !: + - stop + - if !: + - stop + - if !: + - stop + - if !: + - stop + - run templatetools_preview_queue def.player: def.schematic: + on player scrolls their hotbar: + - if !: + - stop + - if !: + - stop + - if : + - if !: + - stop + - determine cancelled passively + - if > : + - if == 1 && == 9: + - run templatetools_pack_increment def.player: + - else: + - run templatetools_pack_decrement def.player: + - else: + - if == 9 && == 1: + - run templatetools_pack_decrement def.player: + - else: + - run templatetools_pack_increment def.player: + - run templatetools_schematic_set_index def.player: + - run templatetools_preview_queue def.player: def.schematic: + - else: + - if !: + - stop + - if ].material.name> == spider_eye: + - run templatetools_preview_queue def.player: def.schematic: + - else: + - run templatetools_preview_clear def.player: + after player clicks in inventory: + - if !: + - stop + - if !: + - stop + - if !: + - stop + - if : + - run templatetools_preview def.player: def.schematic: + - determine cancelled passively + - else: + - run templatetools_preview_clear def.player: + on player left clicks block: + - if !: + - stop + - if !: + - stop + - if !: + - stop + - if !: + - stop + - determine cancelled passively + - if : + - schematic rotate name: angle:90 + - run templatetools_preview_queue def.player: def.schematic: + - actionbar "<&e>Rotated schematic 90 degrees." + - else: + - run templatetools_preview_paste def.player: def.schematic: save:return + - define count + - narrate format:templatetools_formats_main "Placed schematic (<[count]>)." + +templatetools_world_redtorchtool: + debug: false + type: world + events: + on player right clicks block: + - if !: + - stop + - if !: + - stop + - if : + - stop + - determine cancelled passively + - if != null: + - switch no_physics + - narrate format:templatetools_formats_main "Switched block state." \ No newline at end of file diff --git a/scripts/timebar/timebar_data.dsc b/scripts/timebar/timebar_data.dsc new file mode 100644 index 0000000..6761171 --- /dev/null +++ b/scripts/timebar/timebar_data.dsc @@ -0,0 +1,8 @@ +timebar_worlds: + debug: false + type: data + world: Atarashikibo + atarashikibo: Atarashikibo + matsuhama: Matsuhama [ DEBUG ] + noshoko: Noshoko + pussyschool: Pussy \ No newline at end of file diff --git a/scripts/timebar/timebar_tasks.dsc b/scripts/timebar/timebar_tasks.dsc new file mode 100644 index 0000000..ed653f7 --- /dev/null +++ b/scripts/timebar/timebar_tasks.dsc @@ -0,0 +1,52 @@ +# use in PAPI: %denizen_% +timebar_format: + debug: false + type: procedure + script: + - define time ]> + # typical format + - define result "<&6>☀ <&f><[time].format[HH:mm, E.]>" + # dawn, morning, noon, afternoon, evening, night + - define period Dawn + - if <[time].hour> < 6 || <[time].hour> >= 22: + - define period Night + - else if <[time].hour> < 12: + - define period Morning + - else if <[time].hour> < 15: + - define period Noon + - else if <[time].hour> < 18: + - define period Afternoon + - else if <[time].hour> < 22: + - define period Evening + - define result "<[result]> <&e>🔔 <&f><[period]>" + # map name + - define location ]> + - define regions ]> + - if <[regions].size> > 0: + - define location <[regions].get[1].id.replace[zone_].with[].split[_].parse[to_sentence_case].space_separated> + - define result "<[result]> <&c>📌 <&f><[location]>" + # result + - determine <[result]> + +timebar_increment: + debug: false + type: task + script: + - define time ]> + - define time <[time].add[5s]> + - flag server timebar_time:<[time]> + - run timebar_sync_sun + +timebar_sync_sun: + debug: false + type: task + script: + - define time ]> + - define hour <[time].hour> + - define minute <[time].minute> + - define second <[time].second> + # calculate as floor((hour - 6) * 1000 + minute * (1000 / 60) + second * (1000 / 60 / 60)) + - define thousanddivsixty + - define total_ticks <[hour].sub[6].mul[1000].add[<[minute].mul[<[thousanddivsixty]>]>].add[<[second].mul[<[thousanddivsixty].div[60]>]>].round_down> + - foreach as:world: + - adjust <[world]> time:<[total_ticks]> diff --git a/scripts/timebar/timebar_world.dsc b/scripts/timebar/timebar_world.dsc new file mode 100644 index 0000000..c669910 --- /dev/null +++ b/scripts/timebar/timebar_world.dsc @@ -0,0 +1,6 @@ +timebar_world: + debug: false + type: world + events: + on delta time secondly every:1: + - run timebar_increment diff --git a/scripts/vehicles/vehicles_config.dsc b/scripts/vehicles/vehicles_config.dsc new file mode 100644 index 0000000..a21666f --- /dev/null +++ b/scripts/vehicles/vehicles_config.dsc @@ -0,0 +1,14 @@ +vehicles_config: + debug: false + type: data + vehicles: + mx5: + name: <&6>MX5 + material: diamond_horse_armor + custom-model-data: 1 + driver-offset: 0,-1.25,0 + passengers: + - 0,-1.25,1 + acceleration: 0.03 + max-speed: 2.25 + turn-speed-percentage: 0.01 diff --git a/scripts/vehicles/vehicles_tasks.dsc b/scripts/vehicles/vehicles_tasks.dsc new file mode 100644 index 0000000..440f0f4 --- /dev/null +++ b/scripts/vehicles/vehicles_tasks.dsc @@ -0,0 +1,118 @@ +vehicle_relative_location: + debug: false + type: procedure + definitions: location|relative + script: + - define relative <[relative].split[,]> + - define location <[location].forward_flat[<[relative].get[1]>]> + - define location <[location].above[<[relative].get[2]>]> + - define location <[location].left[<[relative].get[3]>]> + - determine <[location]> + +vehicle_create: + debug: false + type: task + definitions: vehicle_id|owner|location + script: + - define location <[location].with_pitch[0]> + # + - define vehicle_id <[vehicle_id].to_lowercase> + - define vehicle + - define vehicle_data ]> + - define vehicle <[vehicle].with[id].as[<[vehicle_id]>]> + - define vehicle <[vehicle].with[owner].as[<[owner]>]> + - define vehicle <[vehicle].with[acceleration].as[<[vehicle_data].get[acceleration]>]> + - define vehicle <[vehicle].with[max_speed].as[<[vehicle_data].get[max-speed]>]> + - define vehicle <[vehicle].with[turn_speed_percentage].as[<[vehicle_data].get[turn-speed-percentage]>]> + # + - define vehicle_item [custom_model_data=<[vehicle_data].get[custom-model-data]>]]> + - define vehicle <[vehicle].with[name].as[<[vehicle_data].get[name].parsed>]> + - define vehicle <[vehicle].with[item].as[<[vehicle_item]>]> + # + - spawn armor_stand <[location]> persistent reason:custom save:model + - define model_entity + - adjust <[model_entity]> invulnerable:true + - adjust <[model_entity]> visible:false + - adjust <[model_entity]> equipment:]> + - flag <[model_entity]> vehicles:model + - define vehicle <[vehicle].with[model_entity].as[<[model_entity]>]> + # + - define driver_offset <[vehicle_data].get[driver-offset]> + - define driver_location |<[driver_offset]>]> + - spawn armor_stand <[driver_location]> persistent reason:custom save:driver + - define driver_entity + - adjust <[driver_entity]> invulnerable:true + - adjust <[driver_entity]> visible:false + - adjust <[driver_entity]> gravity:false + - flag <[driver_entity]> vehicles:driver + - flag <[driver_entity]> vehicles_data:<[model_entity]> + - define vehicle <[vehicle].with[driver_entity].as[<[driver_entity]>]> + - define vehicle <[vehicle].with[driver_offset].as[<[driver_offset]>]> + # + - define passenger_entities + - foreach <[vehicle_data].get[passengers]> as:passenger_offset: + - define passenger_location |<[passenger_offset]>]> + - spawn armor_stand <[location].add[<[passenger_offset]>]> persistent reason:custom save:passenger<[loop_index]> + - define passenger_entity ].spawned_entity> + - adjust <[passenger_entity]> invulnerable:true + - adjust <[passenger_entity]> visible:false + - adjust <[passenger_entity]> gravity:false + - flag <[passenger_entity]> vehicles:passenger + - flag <[passenger_entity]> vehicles_data:<[model_entity]> + - define passenger_entities <[passenger_entities].with[<[passenger_entity]>].as[<[passenger_offset]>]> + - define vehicle <[vehicle].with[passenger_entities].as[<[passenger_entities]>]> + # + - flag <[model_entity]> vehicles_data:<[vehicle]> + - flag <[model_entity]> vehicles_last_location:<[model_entity].location.add[0,1,0]> + - flag server vehicles:].include[<[model_entity]>]> + - determine <[model_entity]> + +vehicle_destroy: + debug: false + type: task + definitions: vehicle_entity + script: + - define vehicle <[vehicle_entity].flag[vehicles_data].if_null[null]> + - if <[vehicle]> == null: + - debug error "Vehicle entity <[vehicle_entity]> is not a vehicle!" + - stop + - remove <[vehicle].get[driver_entity]> + - remove <[vehicle].get[passenger_entities].keys> + - remove <[vehicle_entity]> + +vehicle_find_snap_location: + debug: false + type: procedure + definitions: next_location + script: + - if <[next_location].above[0.15].material.is_solid>: + - if !<[next_location].above.material.is_solid>: + - determine <[next_location].above[0.5]> + - else: + - determine collide + - determine null + +vehicle_pickup: + debug: false + type: task + definitions: vehicle_entity + script: + - define owner <[vehicle_entity].flag[vehicles_data].get[owner]> + - define item <[vehicle_entity].flag[vehicles_data].get[item]> + - adjust def:item display:<[vehicle_entity].flag[vehicles_data].get[name]> + - flag <[item]> vehicles:<[vehicle_entity].flag[vehicles_data].get[id]> + - if <[owner].inventory.can_fit[<[item]>]>: + - give <[item]> player:<[owner]> + - run vehicle_destroy def.vehicle_entity:<[vehicle_entity]> + - flag <[owner]> vehicles:! + - if <[owner].is_online>: + - narrate targets:<[owner]> format:formats_prefix "Picked up previous vehicle!" + - else: + - if <[owner].is_online>: + - narrate "<&c>You don't have enough space in your inventory to pick up the vehicle!" + - else: + # praying there's nothing there... will special-flag just in case + - flag <[owner]> vehicles_i_need_help: + - inventory set slot:18 origin:<[item]> player:<[owner]> + - run vehicle_destroy def.vehicle_entity:<[vehicle_entity]> + - flag <[owner]> vehicles:! diff --git a/scripts/vehicles/vehicles_world.dsc b/scripts/vehicles/vehicles_world.dsc new file mode 100644 index 0000000..1debb15 --- /dev/null +++ b/scripts/vehicles/vehicles_world.dsc @@ -0,0 +1,146 @@ +vehicles_world: + debug: false + type: world + events: + # cleanup lost vehicles + after server start: + - flag server vehicles:! + - foreach as:world: + - foreach <[world].entities> as:entity: + - if <[entity].has_flag[vehicles]>: + - run vehicle_pickup def.vehicle_entity:<[entity]> + on player quits: + - if : + - define vehicle + - run vehicle_pickup def.vehicle_entity:<[vehicle]> + # vehicle tick + on tick: + - ratelimit server 1t + - define remove + - foreach ]> as:vehicle: + - if !<[vehicle].is_spawned>: + - define remove <[remove].include[<[vehicle]>]> + - foreach next + - run vehicle_world_parallel_loop def.vehicle:<[vehicle]> + - flag server vehicles:].exclude[<[remove]>]> + # vehicle safety + on armor_stand damaged: + - if : + - determine cancelled + # add passenger on click or pickup vehicle + on player right clicks armor_stand bukkit_priority:lowest: + - if !: + - stop + - determine cancelled passively + - if : + - stop + - if == model: + - define driver_entity + - if <[driver_entity].has_passenger>: + - stop + - if != && !: + - stop + - if : + - run vehicle_pickup def.vehicle_entity: + - else: + - adjust <[driver_entity]> passenger: + - else if == driver: + - define model_entity + - if : + - stop + - if <[model_entity].flag[vehicles_data].get[owner]> != && !: + - stop + - if : + - run vehicle_pickup def.vehicle_entity:<[model_entity]> + - else: + - adjust passenger: + - else if == passenger: + - adjust passenger: + # vehicle control + on player steers armor_stand: + - if != driver: + - stop + - define vehicle + - flag <[vehicle]> vehicles_player_input:].with[sideways].as[]> + # place vehicle down + on player right clicks block: + - if : + - determine cancelled passively + - if : + - narrate "<&c>You have spawned a vehicle already. Want to pick it up?" + - define vehicle + - clickable save:pickup until:1m usages:1: + - run vehicle_pickup def.vehicle_entity:<[vehicle]> + - narrate <&e>]> + - stop + - ~run vehicle_create def.vehicle_id: def.owner: def.location: save:result + - define vehicle + - flag vehicles:<[vehicle]> + - if != creative: + - take iteminhand + +vehicle_world_parallel_loop: + debug: false + type: task + definitions: vehicle + script: + - if !<[vehicle].flag[vehicles_data].get[driver_entity].has_passenger>: + - flag <[vehicle]> vehicles_player_input:! + - define vehicles_player_input <[vehicle].flag[vehicles_player_input].if_null[null]> + - define forward <[vehicles_player_input].get[forward].if_null[0]> + - define sideways <[vehicles_player_input].get[sideways].if_null[0]> + - if <[forward]> != 0: + - define speed <[vehicle].flag[vehicles_speed].if_null[0]> + - define speed <[speed].add[<[vehicle].flag[vehicles_data].get[acceleration].mul[<[forward]>]>]> + - define max <[vehicle].flag[vehicles_data].get[max_speed]> + - if <[speed]> < <[max].mul[-1].div[3]>: + - define speed <[max].mul[-1].div[3]> + - if <[speed]> > <[max]>: + - define speed <[max]> + - flag <[vehicle]> vehicles_speed:<[speed]> + - if <[sideways]> != 0: + - define speed <[vehicle].flag[vehicles_speed].if_null[0]> + - if <[speed].abs> > 0.1: + - define max_speed <[vehicle].flag[vehicles_data].get[max_speed]> + - define speed_turn_coefficient <[speed].div[<[max_speed]>].mul[0.25].add[0.85]> + - define turn_speed <[vehicle].flag[vehicles_data].get[turn_speed_percentage].mul[360].mul[<[speed_turn_coefficient]>]> + - define turn_speed <[turn_speed].mul[<[sideways]>].mul[-1].mul[].pass[-1].fail[1]>]> + - rotate <[vehicle]> duration:1t yaw:<[turn_speed]> + - define speed <[vehicle].flag[vehicles_speed].if_null[0]> + - if <[speed].abs> < 0.1: + - define speed 0 + - else: + - define speed <[speed].div[1.015]> + - if <[speed]> >= 0: + - define ray_cast_location <[vehicle].location.above[0.5].ray_trace[range=<[speed].abs>].if_null[null]> + - else: + - define backwards <[vehicle].location.direction.vector.mul[-1]> + - define ray_cast_location <[vehicle].location.with_pitch[<[backwards].pitch>].with_yaw[<[backwards].yaw>].above[0.5].ray_trace[range=<[speed].abs>].if_null[null]> + - if <[ray_cast_location]> != null: + - define new_location <[ray_cast_location].with_pitch[<[vehicle].location.pitch>].with_yaw[<[vehicle].location.yaw>]> + - define speed <[speed].div[1.075]> + - else: + - define new_location <[vehicle].location.forward_flat[<[speed]>]> + - define snap ]> + - if <[snap]> != null: + - if <[snap]> == collide: + - define new_location <[vehicle].location> + - define speed <[speed].div[1.1]> + - else: + - define new_location <[snap]> + - if !<[new_location].below[0.25].material.is_solid>: + - define new_location <[new_location].add[0,-]>].min[0.25].sub[0.001]>,0]> + - if <[vehicle].flag[vehicles_speed].if_null[0]> != 0: + - if <[speed].abs> > 0: + - teleport <[vehicle]> <[new_location]> cause:plugin offthread_repeat:8 + - flag <[vehicle]> vehicles_speed:<[speed]> + - if <[vehicle].flag[vehicles_data].get[driver_entity].has_passenger>: + - playsound <[new_location]> custom sound:vehicle.engine pitch:]> + - if <[vehicle].flag[vehicles_last_location]> == <[new_location]>: + - stop + - define driver_entity <[vehicle].flag[vehicles_data].get[driver_entity]> + - define driver_offset <[vehicle].flag[vehicles_data].get[driver_offset]> + - teleport <[driver_entity]> |<[driver_offset]>]> cause:plugin offthread_repeat:8 + - foreach <[vehicle].flag[vehicles_data].get[passenger_entities]> key:passenger_entity as:passenger_offset: + - teleport <[passenger_entity]> |<[passenger_offset]>]> cause:plugin offthread_repeat:8 + - flag <[vehicle]> vehicles_last_location:<[vehicle].location> diff --git a/scripts/wardrobe/wardrobe_commands.dsc b/scripts/wardrobe/wardrobe_commands.dsc new file mode 100644 index 0000000..02f6d90 --- /dev/null +++ b/scripts/wardrobe/wardrobe_commands.dsc @@ -0,0 +1,14 @@ +wardrobe_command_wardrobe: + debug: false + type: command + name: wardrobe + usage: /wardrobe + description: View and manage your skins in the wardrobe. + permission: wardrobe.command.wardrobe + tab completions: + 1: + script: + - if != player: + - narrate "<&c>Please run this command as a player." + - stop + - run wardrobe_menu def.player: diff --git a/scripts/wardrobe/wardrobe_tasks.dsc b/scripts/wardrobe/wardrobe_tasks.dsc new file mode 100644 index 0000000..137446c --- /dev/null +++ b/scripts/wardrobe/wardrobe_tasks.dsc @@ -0,0 +1,127 @@ +#### +## TARGET LIBRARY UTILITY FOR FILLING HEADS IN GUI ASYNC +#### + +# asynchronously and slowly updates all player skulls in any inventory +# each skull you want to change has to be flagged with wardrobe_skull_texture:<[target].uuid> +wardrobe_skull_texture_update: + debug: false + type: task + definitions: player + speed: 2t + script: + - define inventory <[player].open_inventory> + - foreach <[inventory].map_slots> key:slot as:item: + - if <[item].has_flag[wardrobe_skull_texture]>: + - if <[inventory].viewers.if_null[].is_empty>: + - stop + - define texture <[item].flag[wardrobe_skull_texture]> + - run wardrobe_skull_texture_update_single def.inventory:<[inventory]> def.slot:<[slot]> def.texture:<[texture]> +# dont use by itself - always use wardrobe_skull_texture_update +# creates a new queue to prevent overloading the main task +wardrobe_skull_texture_update_single: + debug: false + type: task + definitions: inventory|slot|texture + script: + - inventory adjust slot:<[slot]> skull_skin:<[texture]> destination:<[inventory]> + +## + +wardrobe_max_skins: + debug: false + type: procedure + definitions: player + script: + - define max 9 + - while <[max]> > 3: + - if <[player].has_permission[wardrobe.skins.<[max]>]>: + - determine <[max]> + - define max <[max].sub[1]> + - determine <[max]> + +wardrobe_texture_decode: + debug: false + type: procedure + definitions: skin_blob + script: + - determine <[skin_blob].split[;].get[1].base64_decode.substring[197,298]> + +wardrobe_save_latest: + debug: false + type: task + definitions: player + script: + - define latest_texture ]> + - define textures <[player].flag[wardrobe_all].values.if_null[]> + - if <[textures].contains[<[latest_texture]>]>: + - narrate targets:<[player]> "<&c>You already have your latest Minecraft skin saved in your wardrobe." + - stop + - flag <[player]> wardrobe_all:<[player].flag[wardrobe_all].if_null[].with[<[player].flag[wardrobe_latest]>].as[<[latest_texture]>]> + - narrate format:formats_prefix "Saved latest Minecraft skin in your wardrobe." + +wardrobe_delete: + debug: false + type: task + definitions: player|skin_blob + script: + - flag <[player]> wardrobe_all:<[player].flag[wardrobe_all].exclude[<[skin_blob]>]> + - narrate format:formats_prefix "Deleted saved skin." + +wardrobe_apply: + debug: false + type: task + definitions: player|skin_blob + script: + - adjust <[player]> skin_blob:<[skin_blob]> + - flag <[player]> wardrobe_current:<[skin_blob]> + - narrate format:formats_prefix "Applied saved skin from wardrobe." + +wardrobe_clear: + debug: false + type: task + definitions: player + script: + - adjust <[player]> skin:<[player].name> + - flag <[player]> wardrobe_current:! + - narrate format:formats_prefix "Cleared current skin. You are now using your latest Minecraft skin instead." + +wardrobe_menu: + debug: false + type: task + definitions: player + script: + - define inventory 邑邑邑邑鄇]]> + # + - define max ]> + - define position 31 + - define i 0 + - foreach <[player].flag[wardrobe_all].if_null[]> key:skin_blob as:texture: + - define skinitem + - adjust def:skinitem "display:<&e>Skin #<[loop_index]>" + - adjust def:skinitem lore:Left click to <&a>apply|<&7>Right click to <&c>delete]> + - flag <[skinitem]> wardrobe:<[skin_blob]> + - flag <[skinitem]> wardrobe_skull_texture:<[skin_blob].split[;].get[1]> + - inventory set slot:<[position]> origin:<[skinitem]> destination:<[inventory]> + - define position <[position].add[1]> + - define i <[i].add[1]> + - if <[i].mod[3]> == 0: + - define position <[position].add[6]> + - repeat ].sub[<[i]>]>: + - define unusedskin + - adjust def:unusedskin "display:<&7>Unused Skin Slot" + - adjust def:unusedskin lore:Click to <&e>save <&7>your latest Minecraft skin.]> + - inventory set slot:<[position]> origin:<[unusedskin]> destination:<[inventory]> + - define position <[position].add[1]> + - define i <[i].add[1]> + - if <[i].mod[3]> == 0: + - define position <[position].add[6]> + # + - define clearitem + - adjust def:clearitem "display:<&f>Clear Skin" + - run gui_restore_set_later def.player:<[player]> def.slot:13 def.item:<[clearitem]> + - run gui_restore_set_later def.player:<[player]> def.slot:14 def.item:<[clearitem]> + - run gui_restore_set_later def.player:<[player]> def.slot:15 def.item:<[clearitem]> + # + - inventory open destination:<[inventory]> + - run wardrobe_skull_texture_update def.player:<[player]> diff --git a/scripts/wardrobe/wardrobe_world.dsc b/scripts/wardrobe/wardrobe_world.dsc new file mode 100644 index 0000000..70a47d5 --- /dev/null +++ b/scripts/wardrobe/wardrobe_world.dsc @@ -0,0 +1,30 @@ +wardrobe_world: + debug: false + type: world + events: + on player joins: + - flag wardrobe_latest: + - if : + - adjust skin_blob: + on player clicks in inventory: + - if !: + - stop + - determine cancelled passively + # - if > : + # - stop + - if : + - run wardrobe_save_latest def.player: + - inventory close + - wait 1t + - run wardrobe_menu def.player: + - else if : + - if == right: + - run wardrobe_delete def.player: def.skin_blob: + - inventory close + - wait 1t + - run wardrobe_menu def.player: + - else: + - run wardrobe_apply def.player: def.skin_blob: + - inventory close + - else if : + - run wardrobe_clear def.player: