Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions build-logic/src/main/kotlin/ScriptMetadataTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ abstract class ScriptMetadataTask : DefaultTask() {
continue
}
val psiFile: KtFile = instance.findFile(localFile) as KtFile
val classes = psiFile.collectDescendantsOfType<KtClass>()
val classes = psiFile
.collectDescendantsOfType<KtClass>()
.filter { clazz -> clazz.superTypeListEntries.any { type -> type.text == "Script" } }
val packageName = psiFile.packageFqName.asString()
if (change.changeType == ChangeType.MODIFIED) {
for (name in classes.map { it.name }) {
Expand All @@ -79,10 +81,8 @@ abstract class ScriptMetadataTask : DefaultTask() {
if (change.changeType == ChangeType.MODIFIED || change.changeType == ChangeType.ADDED) {
for (ktClass in classes) {
val className = ktClass.name ?: "Anonymous"
if (ktClass.superTypeListEntries.any { it.text == "Script" }) {
lines.add("$packageName.$className")
scripts++
}
lines.add("$packageName.$className")
scripts++
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions data/area/misthalin/varrock/cooks_guild/cooks_guild.vars.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[pie_task]
format = "string"
persist = true

[pie_task_amount]
format = "int"
persist = true
2 changes: 1 addition & 1 deletion data/area/misthalin/varrock/varrock.npcs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ id = 5066

[valaine]
id = 536
shop = "varrock_general_store"
shop = "valaines_shop_of_champions"
examine = "A champion saleswoman!"

[scavvo]
Expand Down
2 changes: 1 addition & 1 deletion data/client/structs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ tan_your_hide_task = 1562
handicrafts_task = 1563
handy_dandy_task = 1531
just_cant_get_the_staff_task = 1532
the_restless_ghost_task = 1249
the_restless_ghost = 1249
click_your_heels_three_times_task = 1533
come_and_have_a_go_task = 1534
reach_out_and_touch_someone_task = 1535
Expand Down
12 changes: 6 additions & 6 deletions data/entity/obj/door/door.objs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,11 @@ examine = "A door to a grand place."
id = 1575
examine = "A door to a grand place."

[door_28_opened]
[door_champions_guild_opened]
id = 2033
examine = "This is someone's bedroom door."

[door_28_closed]
[door_champions_guild_closed]
id = 1805
examine = "The door to the Champions' Guild."

Expand Down Expand Up @@ -814,10 +814,10 @@ id = 34233
id = 2706
examine = "A nicely fitted door."

[door_81_opened]
[door_cooks_guild_opened]
id = 15502

[door_81_closed]
[door_cooks_guild_closed]
id = 2712
examine = "The entrance to the Cooking Guild."

Expand Down Expand Up @@ -2828,10 +2828,10 @@ examine = "A strong metal door."
id = 26706
examine = "A strong metal door."

[door_490_opened]
[door_cooks_guild_achievement_opened]
id = 26811

[door_490_closed]
[door_cooks_guild_achievement_closed]
id = 26810
examine = "The door is closed."

Expand Down
2 changes: 1 addition & 1 deletion data/entity/player/modal/tab/tab.varcs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
id = 168
format = "list"
default = "Inventory"
values = [ "CombatStyles", "TaskSystem", "Stats", "QuestJournals", "Inventory", "WornEquipment", "PrayerList", "MagicSpellbook", "FriendsList", "IgnoreList", "Options", "ClanChat", "Emotes", "MusicPlayer", "Notes" ]
values = [ "CombatStyles", "TaskSystem", "Stats", "QuestJournals", "Inventory", "WornEquipment", "PrayerList", "MagicSpellbook", "FollowerDetails", "FriendsList", "IgnoreList", "ClanChat", "Options", "Emotes", "MusicPlayer", "Notes" ]
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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.entity.character.player.skill.Skill
import world.gregs.voidps.engine.entity.character.player.skill.level.Level
import world.gregs.voidps.engine.entity.character.player.skill.level.Level.has
import world.gregs.voidps.engine.entity.character.player.skill.level.Level.hasMax
import world.gregs.voidps.engine.inv.equipment
Expand Down Expand Up @@ -49,8 +50,9 @@ class CraftingGuild : Script {
}
option<Idle>("That's fine.") {
inventory.transaction {
val trimmed = Skill.entries.any { it != Skill.Crafting && levels.getMax(it) >= Level.MAX_LEVEL }
remove("coins", 99000)
add("crafting_cape")
add("crafting_cape${if (trimmed) "_t" else ""}")
add("crafting_hood")
}
when (inventory.transaction.error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import world.gregs.voidps.engine.entity.character.jingle
import world.gregs.voidps.engine.entity.character.player.Player
import world.gregs.voidps.engine.entity.character.player.name
import world.gregs.voidps.engine.entity.character.player.skill.Skill
import world.gregs.voidps.engine.entity.character.player.skill.level.Level
import world.gregs.voidps.engine.entity.character.player.skill.level.Level.hasMax
import world.gregs.voidps.engine.event.AuditLog
import world.gregs.voidps.engine.inv.inventory
Expand Down Expand Up @@ -149,7 +150,8 @@ class Kaqemeex : Script {
}
option<Happy>("Okay, here's 99,000 coins.") {
inventory.transaction {
add("herblore_cape")
val trimmed = Skill.entries.any { it != Skill.Herblore && levels.getMax(it) >= Level.MAX_LEVEL }
add("herblore_cape${if (trimmed) "_t" else ""}")
add("herblore_hood")
remove("coins", 99000)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class LumbridgeChurch : Script {
}
}

itemOnObjectOperate("muddy_skull", "coffin_restless_ghost_2") {
itemOnObjectOperate("muddy_skull", "coffin_restless_ghost_2,restless_ghost_coffin") {
returnSkull()
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package content.area.misthalin.varrock.champions_guild

import content.entity.obj.door.enterDoor
import content.entity.player.dialogue.Angry
import content.entity.player.dialogue.Neutral
import content.entity.player.dialogue.type.npc
import world.gregs.voidps.engine.Script
import world.gregs.voidps.engine.client.message

class ChampionsGuild : Script {

Check warning on line 10 in game/src/main/kotlin/content/area/misthalin/varrock/champions_guild/ChampionsGuild.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Class "ChampionsGuild" is never used
init {
objectOperate("Open", "door_champions_guild_closed") { (target) ->
if (get("quest_points", 0) < 32) {
npc<Angry>("guildmaster", "You have not proved yourself worthy to enter here yet.")
message("The door won't open - you need at least 32 Quest Points.")
return@objectOperate
}
val entered = tile.y >= 3363
enterDoor(target)
if (entered) {
npc<Neutral>("guildmaster", "Greetings bold adventurer. Welcome to the guild of Champions.")
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package content.area.misthalin.varrock.champions_guild

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 world.gregs.voidps.engine.Script

class Guildmaster : Script {

Check warning on line 9 in game/src/main/kotlin/content/area/misthalin/varrock/champions_guild/Guildmaster.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Class "Guildmaster" is never used
init {
npcOperate("Talk-to", "guildmaster") {
npc<Neutral>("Greetings!")
choice {
option<Quiz>("What is this place?") {
npc<Neutral>("This is the Champions' Guild. Only adventurers who have proved themselves worthy by gaining influence from quests are allowed in here.")
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package content.area.misthalin.varrock.champions_guild

import content.entity.npc.shop.openShop
import content.entity.player.dialogue.Confused
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 world.gregs.voidps.engine.Script

class Scavvo : Script {

Check warning on line 12 in game/src/main/kotlin/content/area/misthalin/varrock/champions_guild/Scavvo.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Class "Scavvo" is never used
init {
npcOperate("Talk-to", "scavvo") { (target) ->
npc<Happy>("'Ello matey! D'ya wanna buy some exciting new toys?")
choice {
option<Confused>("No, toys are for kids.") {
}
option("Let's have a look then.") {
openShop(target.def["shop", ""])
}
option<Happy>("Ooh, goody goody, toys!") {
openShop(target.def["shop", ""])
}
option<Quiz>("Why do you sell most rune armour but not platebodies?") {
npc<Neutral>("Oh, you have to complete a special quest in order to wear rune platemail. You should talk to the Guildmaster downstairs about that.")
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package content.area.misthalin.varrock.champions_guild

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 Valaine : Script {

Check warning on line 10 in game/src/main/kotlin/content/area/misthalin/varrock/champions_guild/Valaine.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Class "Valaine" is never used
init {
npcOperate("Talk-to", "valaine") { (target) ->
npc<Happy>("Hello there. Want to have a look at what we're selling today?")
choice {
option("Yes please.") {
openShop(target.def["shop", ""])
}
option<Neutral>("No thank you.")
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package content.area.misthalin.varrock.cooks_guild

import content.entity.obj.door.enterDoor
import content.entity.player.dialogue.Neutral
import content.entity.player.dialogue.Quiz
import content.entity.player.dialogue.type.npc
import content.entity.player.dialogue.type.statement
import world.gregs.voidps.engine.Script
import world.gregs.voidps.engine.entity.character.player.equip.equipped
import world.gregs.voidps.engine.entity.character.player.skill.Skill
import world.gregs.voidps.network.login.protocol.visual.update.player.EquipSlot

class CooksGuild : Script {

Check warning on line 13 in game/src/main/kotlin/content/area/misthalin/varrock/cooks_guild/CooksGuild.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Class "CooksGuild" is never used
init {
objectOperate("Open", "door_cooks_guild_closed") { (target) ->
if (levels.get(Skill.Cooking) < 32) {
npc<Quiz>("head_chef", "You need a cooking level of 32 to come in here.")
return@objectOperate
}
if (equipped(EquipSlot.Hat).id != "chefs_hat" && equipped(EquipSlot.Hat).id != "cooking_hood" && equipped(EquipSlot.Cape).id != "cooking_cape" && equipped(EquipSlot.Cape).id != "cooking_cape_t") {
npc<Neutral>("head_chef", "You can't come in here unless you're wearing a chef's hat, or something like that.")
return@objectOperate
}
// https://youtu.be/uPZANIKxM7c?si=nLgUxCiqTr48rKCk&t=98
// npc<Happy>("My word! A master explorer of Varrock! Come in, come in! You are more than welcome in here, my friend!")
enterDoor(target)
}

objectOperate("Open", "door_cooks_guild_achievement_closed") { (target) ->
if (levels.get(Skill.Cooking) < 99) {
statement("You must have completed the Varrock Achievement Diary Hard tasks or master the Cooking skill to gain entry.")
return@objectOperate
}
enterDoor(target)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package content.area.misthalin.varrock.cooks_guild

import content.entity.player.dialogue.Happy
import content.entity.player.dialogue.Neutral
import content.entity.player.dialogue.Quiz
import content.entity.player.dialogue.Sad
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.entity.character.player.skill.Skill
import world.gregs.voidps.engine.entity.character.player.skill.level.Level
import world.gregs.voidps.engine.inv.inventory
import world.gregs.voidps.engine.inv.transact.TransactionError
import world.gregs.voidps.engine.inv.transact.operation.AddItem.add
import world.gregs.voidps.engine.inv.transact.operation.RemoveItem.remove

class HeadChef : Script {

Check warning on line 18 in game/src/main/kotlin/content/area/misthalin/varrock/cooks_guild/HeadChef.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Class "HeadChef" is never used
init {
npcOperate("Talk-to", "head_chef") {
if (levels.get(Skill.Cooking) == 99) {
// https://youtu.be/6LuyWmDoJtg?si=_jAvyeri-gTmBEFI&t=66
npc<Happy>("Hello, welcome to the Cooking Guild. It's always great to have such an accomplished chef visit us. Say, would you be interested in a Skillcape of Cooking? They're only available to master chefs.")
choice {
option("No thanks.")
option("Yes please.") {
player<Quiz>("Can I buy a Skillcape of Cooking from you?")
npc<Neutral>("Most certainly, just as soon as you give me 99000 gold coins.")
choice {
option("That's much too expensive.")
option<Happy>("Sure") {
inventory.transaction {
val trimmed = Skill.entries.any { it != Skill.Cooking && levels.getMax(it) >= Level.MAX_LEVEL }
remove("coins", 99000)
add("cooking_cape${if (trimmed) "_t" else ""}")
add("cooking_hood")
}
when (inventory.transaction.error) {
is TransactionError.Deficient -> player<Sad>("I'm afraid you don't have enough coins on me at the moment.") // TODO proper message
is TransactionError.Full -> npc<Sad>("I'm afraid you don't have enough inventory spaces to take the cape and hood.") // TODO proper message
TransactionError.None -> npc<Happy>("Now you can use the title Master Chef.")
else -> {}
}
}
}
}
}
} else {
npc<Happy>("Hello, welcome to the Cooking Guild. Only accomplished chefs and cooks are allowed in here. Feel free to use any of our facilities.")
choice {
option("Nice cape you're wearing!") {
player<Neutral>("Nice cape, you're wearing!")
npc<Happy>("Thank you! It's my most prized possession, it's a Skillcape of Cooking; it shows that I've achieved level 99 Cooking and am one of the best chefs in the land!")
npc<Neutral>("If you ever achieve level 99 cooking you'll get to wear one too and doing so means you'll never burn any food!")
}
option<Neutral>("Thanks, bye.")
}
}
}
}
}
Loading
Loading