Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Quest: Romeo & Juliet #283

Draft
wants to merge 41 commits into
base: develop
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
df37ec6
initial romeo and juliet implementation
hallowatcher Mar 26, 2021
6486b40
Merge branch 'fix-plugin-imports' into romeo-and-juliet
hallowatcher Apr 7, 2021
3284166
add staircases plugin, add missing spawns
hallowatcher Apr 7, 2021
ab1a40a
add stage 2
hallowatcher Apr 8, 2021
b1a1de7
fix quest requirement when providing stages variable
hallowatcher Apr 8, 2021
e27b974
fix wrapText function, fetch widths from filestore
hallowatcher Apr 8, 2021
3376a08
fix empty remaining lines, lint
hallowatcher Apr 8, 2021
d6156a1
fix standard colors
hallowatcher Apr 9, 2021
0f6761d
add quest item object
hallowatcher Apr 9, 2021
33fca6e
Merge branch 'develop' into romeo-and-juliet
hallowatcher Apr 9, 2021
9664d53
Merge remote-tracking branch 'rune-js/develop' into romeo-and-juliet
hallowatcher Apr 12, 2021
ae36e1f
refactor quest file, add draul leptoc dialogue
hallowatcher Apr 12, 2021
63158b9
add Father Lawrence spawn and first dialogue
hallowatcher Apr 12, 2021
729c031
add index of for stages array
Apr 13, 2021
28923dd
add packet to disable the minimap, disable minimap during cutscene
Apr 13, 2021
3f71045
Merge remote-tracking branch 'rune-js/develop' into romeo-and-juliet
hallowatcher Apr 13, 2021
ef09427
bonkers commit, i might revert this one. dunno what im doing
hallowatcher Apr 14, 2021
c2dec7f
refactor romeo's dialogue
hallowatcher Apr 14, 2021
d7046c9
rename permanent dialogue packet
hallowatcher Apr 14, 2021
346f1a6
finish romeo and juliet last cutscene
hallowatcher Apr 15, 2021
97eb534
refactor dialogue handlers
Apr 15, 2021
3cd446d
fix setting face direction after npc spawn
Apr 15, 2021
b0e6f4f
fix dialogues
Apr 15, 2021
54da115
add cutscene options
Apr 15, 2021
c2dcd5f
Merge remote-tracking branch 'rune-js/develop' into romeo-and-juliet
hallowatcher Apr 15, 2021
f40643d
add proper parent npc spawn for juliet
hallowatcher Apr 16, 2021
9b3f9d7
merge
hallowatcher Apr 16, 2021
8c79550
Merge remote-tracking branch 'rune-js/develop' into romeo-and-juliet
hallowatcher Apr 16, 2021
c1fcf75
calculate juliet's visibility based on player settings
hallowatcher Apr 16, 2021
295bae9
Merge remote-tracking branch 'rune-js/develop' into romeo-and-juliet
hallowatcher Apr 17, 2021
3b5a458
fix some dialogues
hallowatcher Apr 17, 2021
8476473
add apothecary initial dialogue
hallowatcher Apr 18, 2021
9cc71fd
add resident sleeper npcs in the church
hallowatcher Apr 18, 2021
8f0193e
add stage 2 - 3
hallowatcher Apr 18, 2021
5cd0e39
set player as busy during a cutscene, add partial father lawrence cut…
hallowatcher Apr 18, 2021
650c99a
rename juliet parent/child
hallowatcher Apr 19, 2021
d0d3ab0
add generic way to change npc name in dialogues
hallowatcher Apr 19, 2021
d91858e
fix emotes
hallowatcher Apr 19, 2021
2fe9edc
Merge branch 'fix-map-loading' into romeo-and-juliet
hallowatcher Apr 20, 2021
192e0fe
Merge remote-tracking branch 'rune-js/develop' into romeo-and-juliet
hallowatcher Apr 21, 2021
f9a71e4
Merge branch 'develop' into romeo-and-juliet
hallowatcher Jun 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
207 changes: 207 additions & 0 deletions src/plugins/quests/romeo-and-juliet-quest.plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
import { randomBetween } from '@engine/util/num';
import { dialogue, Emote, execute, goto } from '@engine/world/actor/dialogue';
import { Quest } from '@engine/world/actor/player/quest';

const journalHandler = {
0: `I can start this quest by speaking to <col=800000>Romeo</col> in
<col=800000>Varrock</col> central square by the <col=800000>fountain.</col>`,
1: `<str=800000>I have agreed to find Juliet for Romeo and tell her how he feels.\nFor some reason he can't just do this by himself.</str>\n
I should go and speak to <col=800000>Juliet</col>. I can find her
<col=800000>west</col> of <col=800000>Varrock.</col>`
};

const startQuestAction = async details => {
const { player, npc } = details;
const participants = [player, { npc, key: 'romeo' }];

// Romeo starts with a random line
const randomDialog = randomBetween(0, 5);
switch (randomDialog) {
case 0:
await dialogue(participants, [
romeo => [Emote.WORRIED, `Blub! Blub...where is my Juliet? Have you seen her?`]
]);
break;

case 1:
await dialogue(participants, [
romeo => [Emote.WORRIED, `Looking for a blonde girl, goes by the name of Juliet..quite pretty...haven't seen her have you?`]
]);
break;

case 2:
await dialogue(participants, [
romeo => [Emote.WORRIED, `Juliet, Juliet, wherefore art thou Juliet? Have you seen my Juliet?`]
]);
break;

case 3:
await dialogue(participants, [
romeo => [Emote.WORRIED, `Oh woe is me that I cannot find my Juliet! You haven't seen Juliet have you?`]
]);
break;

case 4:
await dialogue(participants, [
romeo => [Emote.WORRIED, `Sadness surrounds me now that Juliet's father forbids us to meet. Have you seen my Juliet?`]
]);
break;

case 5:
await dialogue(participants, [romeo => [Emote.WORRIED, `What is to become of me and my darling Juliet, I cannot find her anywhere, have you seen her?`]]);
break;
}

await dialogue(participants, [
options => [
`Yes, I have seen her actually!`, [
player => [Emote.GENERIC, `Yes, I have seen her actually!`],
player => [Emote.WONDERING, `At least, I think it was her... Blonde? A bit stressed?`],
romeo => [Emote.SHOCKED, `Golly...yes, yes...you make her sound very interesting!`],
romeo => [Emote.WONDERING, `And I'll bet she's a bit of a fox!`],
player => [Emote.WONDERING, `Well, I guess she could be considered attractive...`],
romeo => [Emote.HAPPY, `I'll bet she is! Wooooooooo!`],
romeo => [Emote.GENERIC, `Sorry, all that jubilation has made me forget what we were talking about.`],
player => [Emote.GENERIC, `You were asking me about Juliet? You seemed to know her?`],
romeo => [Emote.HAPPY, `Oh yes, Juliet!`],
romeo => [Emote.HAPPY, `The fox...could you tell her that she is the love of my long and that I life to be with her?`],
player => [Emote.WONDERING, `What? Surely you mean that she is the love of your life and that you long to be with her?`],
romeo => [Emote.HAPPY, `Oh yeah...what you said...tell her that, it sounds much better! Oh you're so good at this!`]
],
`No sorry, I haven't seen her.`, [
player => [Emote.GENERIC, `No sorry, I haven't seen her.`],
romeo => [Emote.SAD, `Oh...well, that's a shame...I was rather hoping you had.`],
player => [Emote.WONDERING, `Why? Is she a fugitive? Does she owe you some money or something?`],
romeo => [Emote.WONDERING, `Hmmm, she might do? Perhaps she does? How do you know?`],
player => [Emote.ANGRY, `I don't know? I was asking 'YOU' how 'YOU' know Juliet!`],
romeo => [Emote.HAPPY, `Ahh, yes Juliet, she's my one true love. Well, one of my one true loves! If you see her, could you tell her that she is the love of my long and that I life to be with her?`],
player => [Emote.WONDERING, `What? Surely you mean that she is the love of your life and that you long to be with her?`],
romeo => [Emote.HAPPY, `Oh yeah...what you said...tell her that, it sounds much better! Oh you're so good at this!`]
],
`Perhaps I could help to find her for you? `, [
player => [Emote.WONDERING, `Perhaps I can help find her for you? What does she look like?`],
romeo => [Emote.HAPPY, `Oh would you? That would be great! She has this sort of hair...`],
player => [Emote.WONDERING, `Hair...check..`], romeo => [Emote.HAPPY, `...and she these...great lips...`],
player => [Emote.WONDERING, `Lips...right.`], romeo => [Emote.HAPPY, `Oh and she has these lovely shoulders as well..`],
player => [Emote.GENERIC, `Shoulders...right, so she has hair, lips and shoulders...that should cut it down a bit.`],
romeo => [Emote.HAPPY, `Oh yes, Juliet is very different...please tell her that she is the love of my long and that I life to be with her?`],
player => [Emote.WONDERING, `What? Surely you mean that she is the love of your life and that you long to be with her?`],
romeo => [Emote.HAPPY, `Oh yeah...what you said...tell her that, it sounds much better! Oh you're so good at this!`]
]
]
]);

await dialogue(participants, [
options => [
`Yes, ok, I'll let her know.`, [
execute(() => {
player.setQuestProgress('rs:romeo_and_juliet', 1);
}),
player => [Emote.GENERIC, `Yes, ok, I'll let her know.`],
romeo => [Emote.HAPPY, `Oh great! And tell her that I want to kiss her a give.`],
player => [Emote.ANGRY, `You mean you want to give her a kiss!`],
romeo => [Emote.HAPPY, `Oh you're good...you are good!`],
romeo => [Emote.HAPPY, `I see I've picked a true professional...!`],
moreInfo()
],
`Sorry Romeo, I've got better things to do right now but maybe later?`, [
player => [Emote.GENERIC, `Sorry Romeo, I've got better things to do right now but maybe later?`],
romeo => [Emote.SAD, `Oh, ok, well, I guess my Juliet and I can spend some time apart. And as the old saying goes, 'Absinthe makes the heart glow longer'.`],
player => [Emote.WONDERING, `Don't you mean that, 'Absence makes the...`],
player => [Emote.GENERIC, `Actually forget it...`],
romeo => [Emote.WONDERING, `Ok!`]
]
]
]);
};

const romeoSecondTalk = async details => {
const { player, npc } = details;
const participants = [player, { npc, key: 'romeo' }];
await dialogue(participants, [
player => [Emote.GENERIC, `Hello again, remember me?`],
romeo => [Emote.WONDERING, `Of course, yes....how are.. you....ermmm...`],
player => [Emote.ANGRY, `You haven't got a clue who I am do you?`],
romeo => [Emote.GENERIC, `Not a clue my friend, but you seem to have a friendly face...a little blood stained, and perhaps in need of a wash, but friendly none the less.`],
player => [Emote.ANGRY, `You asked me to look for Juliet for you!`],
romeo => [Emote.HAPPY, `Ah yes, Juliet...my sweet darling...what news?`],
player => [Emote.WONDERING, `Nothing so far, but I need to ask a few questions? `],
moreInfo()
]);
};

const moreInfo = () => {
return (options, tag_MORE_INFO) => [
`Where can I find Juliet?`, [
player => [Emote.WONDERING, `Where can I find Juliet?`],
romeo => [Emote.WONDERING, `Why do you ask?`],
player => [Emote.ANGRY, `So that I can try and find her for you!`],
romeo => [Emote.WONDERING, `Ah yes....quite right. Hmmm, let me think now.`],
romeo => [Emote.WONDERING, `She may still be locked away at her Father's house on the sest vide of Warrock.`],
romeo => [Emote.HAPPY, `Oh, I remember how she loved it when I would sing up to her balcony! She would reward me with her own personal items...`],
player => [Emote.WONDERING, `What, she just gave you her stuff?`],
romeo => [Emote.GENERIC, `Well, not exactly give...more like 'throw with considerable force'...she's always a kidder that Juliet!`],
goto('tag_MORE_INFO')
],
`Is there anything else you can tell me about Juliet?`, [
player => [Emote.WONDERING, `Is there anything else you can tell me about Juliet?`],
romeo => [Emote.HAPPY, `Oh, there is so much to tell...she is my true love, we intend to spend together forever...I can tell you so much about her..`],
player => [Emote.GENERIC, `Great!`], romeo => [Emote.WONDERING, `Ermmm.....`],
romeo => [Emote.WONDERING, `So much can I tell you...`],
player => [Emote.HAPPY, `Yes..`],
romeo => [Emote.WONDERING, `So much to tell...why, where do I start!`],
player => [Emote.GENERIC, `Yes..yes! Please go on...don't let me interrupt...`],
romeo => [Emote.WONDERING, `Ermmm.....`],
romeo => [Emote.WONDERING, `...`],
player => [Emote.WONDERING, `You can't remember can you?`],
romeo => [Emote.SAD, `Not a thing sorry....`],
goto('tag_MORE_INFO')
],
`Ok, thanks.`, [
player => [Emote.GENERIC, `Ok, thanks.`]
]
];
};

export default {
pluginId: 'rs:romeo_and_juliet',
quests: [
new Quest({
id: 'rs:romeo_and_juliet',
questTabId: 37,
name: `Romeo & Juliet`,
points: 5,
journalHandler,
onComplete: {
questCompleteWidget: {
rewardText: ['5 Quest Points'],
itemId: 1891,
modelZoom: 240,
modelRotationX: 180,
modelRotationY: 180
}
}
})
],
hooks: [{
type: 'npc_interaction',
questRequirement: {
questId: 'rs:romeo_and_juliet',
stage: 0
},
npcs: 'rs:romeo',
options: 'talk-to',
walkTo: true,
handler: startQuestAction
}, {
type: 'npc_interaction',
questRequirement: {
questId: 'rs:romeo_and_juliet',
stage: 1
},
npcs: 'rs:romeo',
options: 'talk-to',
walkTo: true,
handler: romeoSecondTalk
}]
};