-
Notifications
You must be signed in to change notification settings - Fork 83
wip adding shilo npc dialogue and shops etc #950
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
Open
MrSlayerGod
wants to merge
9
commits into
GregHib:main
Choose a base branch
from
MrSlayerGod:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+98
−0
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c0f2313
wip adding shilo npc dialogue and shops etc
MrSlayerGod 6b88cbd
updated dialogues
MrSlayerGod 53cad80
Merge branch 'GregHib:main' into main
MrSlayerGod a75b6f8
Merge branch 'GregHib:main' into main
MrSlayerGod 2b58c22
Merge branch 'GregHib:main' into main
MrSlayerGod 55d6c4b
Merge branch 'GregHib:main' into main
MrSlayerGod 7581684
Merge branch 'GregHib:main' into main
MrSlayerGod ffed709
updated dialogues and codes
MrSlayerGod 6fc8a74
Merge branch 'GregHib:main' into main
MrSlayerGod File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
game/src/main/kotlin/content/area/karamja/shilo_village/Fernahei.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| package content.area.karamja.shilo_village | ||
|
|
||
| import content.entity.npc.shop.openShop | ||
| import content.entity.player.dialogue.Happy | ||
| import content.entity.player.dialogue.Neutral | ||
| import content.entity.player.dialogue.type.choice | ||
| import content.entity.player.dialogue.type.npc | ||
| import world.gregs.voidps.engine.Script | ||
|
|
||
|
|
||
| class Fernahei : Script { | ||
| init { | ||
| npcOperate("Talk-to", "fernahei_shilo_village") { | ||
| npc<Happy>("Welcome to Fernahei's Fishing Shop Bwana! Would you like to see my items?") | ||
| choice { | ||
| option<Neutral>("Yes please!") { | ||
| openShop("fernaheis_fishing_hut") | ||
| } | ||
| option<Neutral>("No, but thanks for the offer.") { | ||
| npc<Happy>("That's fine and thanks for your interest.") | ||
| } | ||
| } | ||
| } | ||
| npcOperate("Trade", "fernahei_shilo_village") { | ||
| openShop("fernaheis_fishing_hut") | ||
| } | ||
| } | ||
| } |
70 changes: 70 additions & 0 deletions
70
game/src/main/kotlin/content/area/karamja/shilo_village/Yohnus.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| package content.area.karamja.shilo_village | ||
|
|
||
| import content.entity.obj.door.enterDoor | ||
| import content.entity.player.dialogue.Happy | ||
| import content.entity.player.dialogue.Neutral | ||
| import content.entity.player.dialogue.Quiz | ||
| import content.entity.player.dialogue.type.choice | ||
| import content.entity.player.dialogue.type.npc | ||
| import content.entity.player.dialogue.type.player | ||
| import world.gregs.voidps.engine.Script | ||
| import world.gregs.voidps.engine.inv.inventory | ||
| import world.gregs.voidps.engine.inv.transact.TransactionError | ||
| import world.gregs.voidps.engine.inv.transact.operation.RemoveItem.remove | ||
|
|
||
| class Yohnus : Script { | ||
|
|
||
| init { | ||
| npcOperate("Talk-to", "yohnus_shilo_village") { | ||
| npc<Neutral>("Sorry but the blacksmiths is closed. But I can let you use the furnace at the cost of 20 gold pieces.") | ||
| choice { | ||
| option<Neutral>("Use Furnace - 20 Gold") { | ||
| inventory.transaction { | ||
| remove("coins", 20) | ||
| } | ||
| when (inventory.transaction.error) { | ||
| TransactionError.None -> { | ||
| this["yohnus_paid"] = true | ||
| npc<Happy>("Thanks Bwana! Enjoy the facilities!") | ||
| } | ||
| else -> npc<Neutral>("Sorry, you don't have enough coins.") | ||
| } | ||
| } | ||
| option<Neutral>("No thanks!") { | ||
| player<Neutral>("No thanks!") | ||
| npc<Neutral>("Very well Bwana, have a nice day.") | ||
| } | ||
| } | ||
| } | ||
| objectOperate("Open", "blacksmiths_door_closed") { (target) -> | ||
| if (tile.y > target.tile.y) { | ||
| enterDoor(target) | ||
| return@objectOperate | ||
| } | ||
| if (!inventory.contains("coins", 20) && !this["yohnus_paid", false]) { | ||
| npc<Quiz>( | ||
| "yohnus_shilo_village", | ||
| "Sorry but the blacksmiths is closed. But I can let you use the furnace at the cost of 20 gold pieces." | ||
| ) | ||
| return@objectOperate | ||
| } | ||
| if (this["yohnus_paid", false]) { | ||
| clear("yohnus_paid") | ||
| enterDoor(target) | ||
| return@objectOperate | ||
| } | ||
| inventory.transaction { | ||
| remove("coins", 20) | ||
| } | ||
| when (inventory.transaction.error) { | ||
| TransactionError.None -> { | ||
| npc<Quiz>("yohnus_shilo_village", "Thanks Bwana! Enjoy the facilities!") | ||
| enterDoor(target) | ||
| } | ||
| else -> { | ||
| npc<Quiz>("yohnus_shilo_village", "Sorry, you don't have enough coins.") | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably go to the choice dialogue here or the dialogue should be something different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://runescape.wiki/w/Transcript:Yohnus
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the
(Continues above.)means it'll show the choice dialogueThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what needs to change and what needs to move then thanks ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull out the other dialogue into a method:
And call that here with