Completed very large refactor of Plague City quest and related functionality

This commit is contained in:
GregF 2025-02-16 10:19:20 +00:00 committed by Ryan
parent be76ca143b
commit 4f97dbef8c
66 changed files with 3055 additions and 1696 deletions

View file

@ -11426,47 +11426,11 @@
"weight": "100.0",
"id": "526",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "100.0",
"id": "1506",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "100.0",
"id": "6065",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "100.0",
"id": "6067",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "100.0",
"id": "6069",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "100.0",
"id": "6068",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "100.0",
"id": "6070",
"maxAmount": "1"
}
],
"charm": [],
"ids": "347,348,357,369,370,371,372,717,718,719,2349,2350,2351,2373,2374,2784,3216",
"description": "",
"ids": "370,357,348,369,347,371",
"description": "all combat mourners",
"main": []
},
{
@ -18161,7 +18125,7 @@
"maxAmount": "1"
}
],
"ids": "1183,1184,1201,2359,2360,2361,2362,7438,7439,7440,7441",
"ids": "1183,1184,1201,2359,2360,2361,2362,2373,7438,7439,7440,7441",
"description": "",
"main": [
{

View file

@ -95,6 +95,30 @@
"walkable": "false",
"tabIndex": "-1"
},
{
"id": "68",
"interfaceType": "4",
"walkable": "false",
"tabIndex": "-1"
},
{
"id": "69",
"interfaceType": "4",
"walkable": "false",
"tabIndex": "-1"
},
{
"id": "70",
"interfaceType": "4",
"walkable": "false",
"tabIndex": "-1"
},
{
"id": "71",
"interfaceType": "4",
"walkable": "false",
"tabIndex": "-1"
},
{
"id": "74",
"interfaceType": "4",
@ -365,6 +389,30 @@
"walkable": "false",
"tabIndex": "-1"
},
{
"id": "245",
"interfaceType": "4",
"walkable": "false",
"tabIndex": "-1"
},
{
"id": "246",
"interfaceType": "4",
"walkable": "false",
"tabIndex": "-1"
},
{
"id": "247",
"interfaceType": "4",
"walkable": "false",
"tabIndex": "-1"
},
{
"id": "248",
"interfaceType": "4",
"walkable": "false",
"tabIndex": "-1"
},
{
"id": "256",
"interfaceType": "8",

View file

@ -16309,6 +16309,7 @@
"examine": "Maybe I should read this...",
"durability": null,
"name": "A magic scroll",
"tradeable": "false",
"archery_ticket_price": "0",
"id": "1505"
},
@ -16324,7 +16325,7 @@
"equipment_slot": "0"
},
{
"examine": "Quite a small key (Plague City).",
"examine": "Quite a small key.",
"durability": null,
"name": "A small key",
"archery_ticket_price": "0",
@ -55738,7 +55739,7 @@
"equipment_slot": "4"
},
{
"examine": "Damaged: These are in need of a good tailor.Repaired: A pair of mourner trousers.",
"examine": "These are in need of a good tailor.",
"durability": null,
"name": "Mourner trousers",
"weight": "2.25",
@ -55746,7 +55747,7 @@
"id": "6066"
},
{
"examine": "Damaged: These are in need of a good tailor.Repaired: A pair of mourner trousers.",
"examine": "A pair of mourner trousers.",
"durability": null,
"name": "Mourner trousers",
"weight": "2.25",

View file

@ -4784,131 +4784,130 @@
"range_level": "1",
"attack_level": "1"
},
{
"examine": "A mourner, or plague healer.",
"melee_animation": "422",
"range_animation": "0",
"defence_animation": "0",
"weakness": "9",
"magic_animation": "0",
"death_animation": "836",
"name": "Mourner",
"defence_level": "24",
"safespot": null,
"lifepoints": "34",
"strength_level": "24",
"id": "347",
"range_level": "1",
"attack_level": "24"
},
{
"examine": "A mourner, or plague healer.",
"melee_animation": "422",
"range_animation": "0",
"defence_animation": "0",
"weakness": "9",
"magic_animation": "0",
"death_animation": "836",
"name": "Mourner",
"defence_level": "24",
"safespot": null,
"lifepoints": "34",
"strength_level": "24",
"id": "348",
"range_level": "1",
"attack_level": "24"
},
{
"examine": "One of Gielinor's many citizens.",
"melee_animation": "422",
"range_animation": "0",
"range_animation": "",
"combat_audio": "511,513,512",
"defence_animation": "0",
"weakness": "9",
"magic_animation": "0",
"attack_speed": "4",
"defence_animation": "404",
"weakness": "",
"magic_animation": "",
"death_animation": "836",
"name": "Man",
"defence_level": "2",
"defence_level": "1",
"safespot": null,
"lifepoints": "7",
"strength_level": "2",
"lifepoints": "13",
"strength_level": "1",
"id": "351",
"clue_level": "0",
"clue_level": "",
"bonuses": "0,0,0,0,0,1,1,1,0,0,0,0,0,0,0",
"range_level": "1",
"attack_level": "2"
},
{
"examine": "One of Gielinor's many citizens.",
"melee_animation": "422",
"range_animation": "0",
"range_animation": "",
"combat_audio": "511,506,505",
"defence_animation": "0",
"weakness": "9",
"magic_animation": "0",
"attack_speed": "4",
"respawn_delay": "50",
"defence_animation": "404",
"weakness": "",
"magic_animation": "",
"death_animation": "836",
"name": "Woman",
"defence_level": "2",
"defence_level": "1",
"safespot": null,
"lifepoints": "7",
"strength_level": "2",
"lifepoints": "10",
"strength_level": "1",
"id": "352",
"clue_level": "0",
"clue_level": "",
"bonuses": "0,0,0,0,0,1,1,1,0,0,0,0,0,0,0",
"range_level": "1",
"attack_level": "2"
},
{
"examine": "One of Gielinor's many citizens.",
"melee_animation": "422",
"range_animation": "0",
"range_animation": "",
"combat_audio": "511,506,505",
"defence_animation": "0",
"weakness": "9",
"magic_animation": "0",
"attack_speed": "4",
"respawn_delay": "50",
"defence_animation": "404",
"weakness": "",
"magic_animation": "",
"death_animation": "836",
"name": "Woman",
"defence_level": "2",
"defence_level": "1",
"safespot": null,
"lifepoints": "7",
"strength_level": "2",
"lifepoints": "13",
"strength_level": "1",
"id": "353",
"clue_level": "0",
"clue_level": "",
"bonuses": "0,0,0,0,0,1,1,1,0,0,0,0,0,0,0",
"range_level": "1",
"attack_level": "2"
},
{
"examine": "One of Gielinor's many citizens.",
"melee_animation": "422",
"range_animation": "0",
"range_animation": "",
"combat_audio": "511,506,505",
"defence_animation": "0",
"weakness": "9",
"magic_animation": "0",
"attack_speed": "4",
"respawn_delay": "50",
"defence_animation": "404",
"weakness": "",
"magic_animation": "",
"death_animation": "836",
"name": "Woman",
"defence_level": "2",
"defence_level": "1",
"safespot": null,
"lifepoints": "7",
"strength_level": "2",
"lifepoints": "13",
"strength_level": "1",
"id": "354",
"clue_level": "0",
"clue_level": "",
"bonuses": "0,0,0,0,0,1,1,1,0,0,0,0,0,0,0",
"range_level": "1",
"attack_level": "2"
},
{
"examine": "A child of West Ardougne.",
"melee_animation": "0",
"range_animation": "0",
"defence_animation": "0",
"magic_animation": "0",
"death_animation": "0",
"melee_animation": "",
"range_animation": "",
"magic_level": "",
"defence_animation": "",
"poison_amount": "",
"magic_animation": "",
"death_animation": "",
"name": "Child",
"defence_level": "1",
"defence_level": "",
"safespot": null,
"lifepoints": "10",
"strength_level": "1",
"movement_radius": "",
"lifepoints": "",
"strength_level": "",
"id": "355",
"range_level": "1",
"attack_level": "1"
"range_level": "",
"attack_level": ""
},
{
"examine": "A child of West Ardougne.",
"melee_animation": "",
"range_animation": "",
"magic_level": "",
"defence_animation": "",
"poison_amount": "",
"magic_animation": "",
"death_animation": "",
"name": "Child",
"defence_level": "",
"safespot": null,
"movement_radius": "",
"lifepoints": "",
"strength_level": "",
"id": "356",
"range_level": "",
"attack_level": ""
},
{
"examine": "A holy man.",
@ -4951,22 +4950,24 @@
{
"examine": "One of Gielinor's many citizens.",
"melee_animation": "422",
"range_animation": "422",
"range_animation": "",
"combat_audio": "511,506,505",
"attack_speed": "4",
"respawn_delay": "50",
"defence_animation": "404",
"weakness": "9",
"magic_animation": "422",
"weakness": "",
"magic_animation": "",
"death_animation": "836",
"name": "Woman",
"defence_level": "3",
"defence_level": "1",
"safespot": null,
"lifepoints": "7",
"lifepoints": "13",
"strength_level": "1",
"id": "360",
"clue_level": "0",
"clue_level": "",
"bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
"range_level": "1",
"attack_level": "3"
"attack_level": "2"
},
{
"examine": "One of Gielinor's many citizens.",
@ -4974,56 +4975,62 @@
"range_animation": "422",
"combat_audio": "511,506,505",
"attack_speed": "4",
"respawn_delay": "50",
"defence_animation": "404",
"weakness": "9",
"magic_animation": "422",
"weakness": "",
"magic_animation": "",
"death_animation": "836",
"name": "Woman",
"defence_level": "3",
"defence_level": "10",
"safespot": null,
"lifepoints": "7",
"strength_level": "1",
"lifepoints": "13",
"strength_level": "10",
"id": "361",
"bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
"range_level": "1",
"attack_level": "3"
"attack_level": "10"
},
{
"examine": "One of Gielinor's many citizens.",
"melee_animation": "422",
"range_animation": "422",
"range_animation": "",
"combat_audio": "511,506,505",
"attack_speed": "4",
"respawn_delay": "50",
"defence_animation": "404",
"weakness": "9",
"magic_animation": "422",
"weakness": "",
"magic_animation": "",
"death_animation": "836",
"name": "Woman",
"defence_level": "3",
"defence_level": "2",
"safespot": null,
"lifepoints": "7",
"lifepoints": "10",
"strength_level": "1",
"id": "362",
"bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
"range_level": "1",
"attack_level": "3"
"attack_level": "1"
},
{
"examine": "One of Gielinor's many citizens.",
"melee_animation": "422",
"range_animation": "422",
"range_animation": "",
"combat_audio": "511,506,505",
"attack_speed": "4",
"respawn_delay": "50",
"defence_animation": "404",
"weakness": "9",
"magic_animation": "422",
"weakness": "",
"magic_animation": "",
"death_animation": "836",
"name": "Woman",
"defence_level": "3",
"defence_level": "10",
"safespot": null,
"lifepoints": "7",
"strength_level": "1",
"lifepoints": "23",
"strength_level": "10",
"id": "363",
"bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
"range_level": "1",
"attack_level": "3"
"attack_level": "10"
},
{
"examine": "King Lathas of East Ardougne.",
@ -5087,23 +5094,6 @@
"range_level": "1",
"attack_level": "1"
},
{
"examine": "A mourner, or plague healer.",
"melee_animation": "422",
"range_animation": "0",
"defence_animation": "0",
"weakness": "9",
"magic_animation": "0",
"death_animation": "836",
"name": "Mourner",
"defence_level": "24",
"safespot": null,
"lifepoints": "34",
"strength_level": "24",
"id": "369",
"range_level": "1",
"attack_level": "24"
},
{
"examine": "She's quite a looker!",
"melee_animation": "0",
@ -8071,32 +8061,43 @@
"attack_level": "1"
},
{
"slayer_exp": "0",
"slayer_exp": "",
"examine": "A local civilian.",
"name": "Edmond",
"defence_level": "1",
"defence_level": "",
"safespot": null,
"lifepoints": "10",
"strength_level": "1",
"lifepoints": "",
"combat_audio": "",
"strength_level": "",
"id": "714",
"range_level": "1",
"attack_level": "1"
"range_level": "",
"attack_level": ""
},
{
"examine": "In charge of people with silly outfits.",
"melee_animation": "0",
"range_animation": "0",
"defence_animation": "0",
"magic_animation": "0",
"death_animation": "0",
"name": "Head mourner",
"defence_level": "1",
"slayer_exp": "",
"examine": "A local civilian.",
"name": "Edmond",
"defence_level": "",
"safespot": null,
"lifepoints": "10",
"strength_level": "1",
"id": "716",
"range_level": "1",
"attack_level": "1"
"lifepoints": "",
"combat_audio": "",
"strength_level": "",
"id": "3213",
"range_level": "",
"attack_level": ""
},
{
"slayer_exp": "",
"examine": "A local civilian.",
"name": "Edmond",
"defence_level": "",
"safespot": null,
"lifepoints": "",
"combat_audio": "",
"strength_level": "",
"id": "3214",
"range_level": "",
"attack_level": ""
},
{
"examine": "A member of the Ardougne Royal Army.",
@ -8142,39 +8143,42 @@
},
{
"examine": "One of Gielinor's many citizens.",
"melee_animation": "0",
"range_animation": "0",
"combat_audio": "511,513,512",
"melee_animation": "",
"range_animation": "",
"combat_audio": "",
"protect_style": "",
"respawn_delay": "",
"defence_animation": "0",
"magic_animation": "0",
"slayer_exp": "",
"magic_animation": "",
"death_animation": "0",
"name": "Man",
"defence_level": "1",
"safespot": null,
"lifepoints": "10",
"strength_level": "1",
"safespot": "",
"lifepoints": "",
"strength_level": "",
"id": "728",
"clue_level": "0",
"range_level": "1",
"attack_level": "1"
"clue_level": "",
"range_level": "",
"attack_level": ""
},
{
"examine": "One of Gielinor's many citizens.",
"melee_animation": "0",
"range_animation": "0",
"combat_audio": "511,513,512",
"defence_animation": "0",
"magic_animation": "0",
"death_animation": "0",
"melee_animation": "",
"range_animation": "",
"combat_audio": "",
"defence_animation": "",
"magic_animation": "",
"death_animation": "",
"name": "Man",
"defence_level": "1",
"defence_level": "",
"safespot": null,
"lifepoints": "10",
"strength_level": "1",
"lifepoints": "",
"strength_level": "",
"id": "729",
"clue_level": "0",
"range_level": "1",
"attack_level": "1"
"clue_level": "",
"range_level": "",
"attack_level": ""
},
{
"examine": "One of Gielinor's many citizens.",
@ -8498,51 +8502,51 @@
},
{
"examine": "A citizen of Ardougne.",
"melee_animation": "0",
"range_animation": "0",
"defence_animation": "0",
"magic_animation": "0",
"death_animation": "0",
"melee_animation": "",
"range_animation": "",
"defence_animation": "",
"magic_animation": "",
"death_animation": "",
"name": "Civilian",
"defence_level": "1",
"defence_level": "",
"safespot": null,
"lifepoints": "10",
"strength_level": "1",
"lifepoints": "",
"strength_level": "",
"id": "785",
"range_level": "1",
"attack_level": "1"
"range_level": "",
"attack_level": ""
},
{
"examine": "A citizen of Ardougne.",
"melee_animation": "0",
"range_animation": "0",
"defence_animation": "0",
"magic_animation": "0",
"death_animation": "0",
"melee_animation": "",
"range_animation": "",
"defence_animation": "",
"magic_animation": "",
"death_animation": "",
"name": "Civilian",
"defence_level": "1",
"defence_level": "",
"safespot": null,
"lifepoints": "10",
"strength_level": "1",
"lifepoints": "",
"strength_level": "",
"id": "786",
"range_level": "1",
"attack_level": "1"
"range_level": "",
"attack_level": ""
},
{
"examine": "A citizen of Ardougne.",
"melee_animation": "0",
"range_animation": "0",
"defence_animation": "0",
"magic_animation": "0",
"death_animation": "0",
"melee_animation": "",
"range_animation": "",
"defence_animation": "",
"magic_animation": "",
"death_animation": "",
"name": "Civilian",
"defence_level": "1",
"defence_level": "",
"safespot": null,
"lifepoints": "10",
"strength_level": "1",
"lifepoints": "",
"strength_level": "",
"id": "787",
"range_level": "1",
"attack_level": "1"
"range_level": "",
"attack_level": ""
},
{
"examine": "A gnome who's supposed to be cleaning up a mess.",
@ -24275,36 +24279,37 @@
},
{
"examine": "A Mourner showing his true identity.",
"melee_animation": "0",
"range_animation": "0",
"defence_animation": "0",
"magic_animation": "0",
"death_animation": "0",
"melee_animation": "",
"range_animation": "",
"defence_animation": "",
"magic_animation": "",
"death_animation": "",
"name": "Head mourner",
"defence_level": "1",
"defence_level": "",
"safespot": null,
"lifepoints": "10",
"strength_level": "1",
"lifepoints": "",
"strength_level": "",
"id": "2372",
"range_level": "1",
"attack_level": "1"
"range_level": "",
"attack_level": ""
},
{
"examine": "A mourner, or plague healer.",
"melee_animation": "428",
"range_animation": "0",
"defence_animation": "0",
"weakness": "9",
"magic_animation": "0",
"range_animation": "",
"attack_speed": "4",
"defence_animation": "",
"weakness": "",
"magic_animation": "",
"death_animation": "836",
"name": "Mourner",
"defence_level": "61",
"defence_level": "80",
"safespot": null,
"lifepoints": "87",
"strength_level": "61",
"id": "2373",
"aggressive": "true",
"range_level": "1",
"range_level": "",
"attack_level": "61"
},
{
@ -27188,51 +27193,51 @@
},
{
"examine": "Digging.",
"melee_animation": "0",
"range_animation": "0",
"defence_animation": "0",
"magic_animation": "0",
"death_animation": "0",
"melee_animation": "",
"range_animation": "",
"defence_animation": "",
"magic_animation": "",
"death_animation": "",
"name": "Slave",
"defence_level": "1",
"defence_level": "",
"safespot": null,
"lifepoints": "10",
"strength_level": "1",
"lifepoints": "",
"strength_level": "",
"id": "2785",
"range_level": "1",
"attack_level": "1"
"range_level": "",
"attack_level": ""
},
{
"examine": "Digging.",
"melee_animation": "0",
"range_animation": "0",
"defence_animation": "0",
"magic_animation": "0",
"death_animation": "0",
"melee_animation": "",
"range_animation": "",
"defence_animation": "",
"magic_animation": "",
"death_animation": "",
"name": "Slave",
"defence_level": "1",
"defence_level": "",
"safespot": null,
"lifepoints": "10",
"strength_level": "1",
"lifepoints": "",
"strength_level": "",
"id": "2786",
"range_level": "1",
"attack_level": "1"
"range_level": "",
"attack_level": ""
},
{
"examine": "Confused.",
"melee_animation": "0",
"range_animation": "0",
"defence_animation": "0",
"magic_animation": "0",
"death_animation": "0",
"melee_animation": "",
"range_animation": "",
"defence_animation": "",
"magic_animation": "",
"death_animation": "",
"name": "Slave",
"defence_level": "1",
"defence_level": "",
"safespot": null,
"lifepoints": "10",
"strength_level": "1",
"lifepoints": "",
"strength_level": "",
"id": "2787",
"range_level": "1",
"attack_level": "1"
"range_level": "",
"attack_level": ""
},
{
"examine": "Drill Sergeant from heck!",
@ -30714,22 +30719,6 @@
"range_level": "1",
"attack_level": "1"
},
{
"examine": "A mourner, or plague healer.",
"melee_animation": "0",
"range_animation": "0",
"defence_animation": "0",
"magic_animation": "0",
"death_animation": "0",
"name": "Mourner",
"defence_level": "1",
"safespot": null,
"lifepoints": "10",
"strength_level": "1",
"id": "3216",
"range_level": "1",
"attack_level": "1"
},
{
"examine": "Loves mining.",
"melee_animation": "99",
@ -87739,5 +87728,143 @@
"examine": "A nature impling. Right on, maaan.",
"name": "Nature Impling",
"id": "1034"
},
{
"examine": "A mourner, or plague healer.",
"death_animation": "836",
"name": "Mourner (boss)",
"defence_level": "10",
"lifepoints": "19",
"melee_animation": "428",
"attack_speed": "4",
"strength_level": "10",
"id": "370",
"bonuses": "0,0,0,0,0,3,2,4,0,0,0,0,0,0,0",
"attack_level": "10"
},
{
"examine": "A mourner, or plague healer.",
"name": "Mourner",
"id": "717"
},
{
"examine": "A mourner, or plague healer.",
"name": "Mourner",
"id": "718"
},
{
"examine": "A mourner, or plague healer.",
"name": "Mourner",
"id": "719"
},
{
"examine": "A mourner, or plague healer.",
"name": "Mourner",
"id": "3216"
},
{
"examine": "A mourner, or plague healer.",
"death_animation": "836",
"name": "Mourner",
"defence_level": "14",
"melee_animation": "428",
"lifepoints": "24",
"attack_speed": "4",
"strength_level": "14",
"id": "357",
"bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
"attack_level": "14"
},
{
"examine": "A mourner, or plague healer.",
"death_animation": "836",
"name": "Mourner",
"defence_level": "19",
"melee_animation": "422",
"lifepoints": "30",
"attack_speed": "4",
"strength_level": "19",
"id": "348",
"bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
"attack_level": "19"
},
{
"examine": "A mourner, or plague healer.",
"death_animation": "836",
"name": "Mourner",
"defence_level": "19",
"melee_animation": "422",
"lifepoints": "30",
"attack_speed": "4",
"strength_level": "19",
"id": "369",
"bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
"attack_level": "19"
},
{
"examine": "A mourner, or plague healer.",
"death_animation": "836",
"name": "Mourner",
"defence_level": "8",
"lifepoints": "18",
"melee_animation": "428",
"strength_level": "8",
"attack_speed": "4",
"id": "347",
"bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
"attack_level": "8"
},
{
"examine": "A Mourner, or plague healer.",
"name": "Mourner",
"id": "2374"
},
{
"examine": "A mourner, or plague healer.",
"name": "Mourner",
"id": "372"
},
{
"examine": "A mourner, or plague healer.",
"death_animation": "836",
"name": "Mourner",
"defence_level": "8",
"lifepoints": "20",
"melee_animation": "422",
"attack_speed": "4",
"strength_level": "8",
"id": "371",
"bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
"attack_level": "8"
},
{
"examine": "In charge of people with silly outfits.",
"name": "Head Mourner",
"id": "716"
},
{
"examine": "A mourner, or plague healer.",
"name": "Mourner",
"id": "2784"
},
{
"examine": "She looks concerned.",
"name": "Elena",
"id": "3215"
},
{
"examine": "She looks concerned.",
"name": "Elena",
"id": "715"
},
{
"examine": "She doesn't look too happy.",
"name": "Elena",
"id": "3209"
},
{
"name": "Elena",
"id": "335",
"examine": "She doesn't look too happy."
}
]

View file

@ -213,7 +213,7 @@
},
{
"npc_id": "64",
"loc_data": "{2684,9798,0,1,2}-{2959,3917,0,1,0}-{2960,3925,0,1,0}-{2961,3920,0,1,0}-{2962,3915,0,1,0}-{2962,3933,0,1,0}-{2963,3923,0,1,0}-{2963,3929,0,1,0}-{2965,3927,0,1,0}-{2965,3931,0,1,0}-{2691,9814,0,1,5}-{2694,9819,0,1,6}-{2696,9831,0,1,3}-{2702,9837,0,1,6}-{2709,9844,0,1,3}-{2720,9847,0,1,4}-{2724,9843,0,1,6}-{2733,9846,0,1,4}-{2740,9841,0,1,3}-{2745,9836,0,1,4}-{2745,9828,0,1,5}-{2747,9826,0,1,1}-{2819,9950,0,1,0}-{2824,9934,0,1,0}-{2827,9925,0,1,0}-{2828,9956,0,1,0}-{2857,9969,0,1,0}-{2872,9972,0,1,0}-{2869,9912,0,1,0}-{2885,9962,0,1,0}-{2887,9936,0,1,0}-"
"loc_data": "{2869,9912,0,1,0}-{2819,9950,0,1,0}-{2824,9934,0,1,0}-{2827,9925,0,1,0}-{2828,9956,0,1,0}-{2857,9969,0,1,0}-{2872,9972,0,1,0}-{2684,9798,0,1,2}-{2885,9962,0,1,0}-{2887,9936,0,1,0}-{2959,3917,0,1,0}-{2960,3925,0,1,0}-{2961,3920,0,1,0}-{2962,3915,0,1,0}-{2962,3933,0,1,0}-{2963,3923,0,1,0}-{2963,3929,0,1,0}-{2965,3927,0,1,0}-{2965,3931,0,1,0}-{2691,9814,0,1,5}-{2694,9819,0,1,6}-{2696,9831,0,1,3}-{2702,9837,0,1,6}-{2709,9844,0,1,3}-{2720,9847,0,1,4}-{2724,9843,0,1,6}-{2733,9846,0,1,4}-{2740,9841,0,1,3}-{2745,9836,0,1,4}-{2745,9828,0,1,5}-{2747,9826,0,1,1}-"
},
{
"npc_id": "66",
@ -369,7 +369,7 @@
},
{
"npc_id": "111",
"loc_data": "{2811,3506,0,1,0}-{2883,9932,0,1,0}-{2883,9965,0,1,0}-{2920,3800,0,1,3}-{2952,3902,0,1,6}-{2953,3889,0,1,6}-{2947,3921,0,1,6}-{3043,9581,0,1,1}-{3055,9577,0,1,6}-{3061,9576,0,1,4}-{3055,9571,0,1,7}-{3052,9566,0,1,6}-"
"loc_data": "{2920,3800,0,1,3}-{2883,9932,0,1,0}-{2883,9965,0,1,0}-{2952,3902,0,1,6}-{2953,3889,0,1,6}-{2947,3921,0,1,6}-{2811,3506,0,1,0}-{3043,9581,0,1,1}-{3055,9577,0,1,6}-{3061,9576,0,1,4}-{3055,9571,0,1,7}-{3052,9566,0,1,6}-"
},
{
"npc_id": "112",
@ -417,7 +417,7 @@
},
{
"npc_id": "125",
"loc_data": "{2845,3517,0,1,4}-{2848,3515,0,1,4}-{2958,3867,0,1,3}-{2956,3857,0,1,6}-{2952,3862,0,1,3}-{2949,3858,0,1,4}-{2955,3875,0,1,7}-{2954,3874,0,1,5}-{2962,3876,0,1,1}-{2961,3877,0,1,3}-{2947,3878,0,1,6}-{2959,3884,0,1,4}-{2956,3885,0,1,3}-{2956,3886,0,1,3}-{2948,3886,0,1,1}-{2947,3934,0,1,0}-{2948,3917,0,1,0}-{2949,3926,0,1,0}-{2952,3913,0,1,0}-{2952,3936,0,1,0}-{2954,3921,0,1,0}-{2956,3930,0,1,0}-{2964,3944,0,1,0}-{2970,3947,0,1,0}-{2971,3938,0,1,0}-{2977,3953,0,1,0}-{2978,3942,0,1,0}-{2984,3933,0,1,0}-{3227,5443,0,1,5}-{3220,5448,0,1,5}-{3208,5443,0,1,6}-{3207,5448,0,1,4}-{3050,9570,0,1,3}-{3043,9579,0,1,2}-{3056,9585,0,1,0}-{3058,9575,0,1,1}-{3052,9582,0,1,0}-{3049,9577,0,1,4}-{3042,9586,0,1,6}-{3052,9588,0,1,1}-{3049,9590,0,1,5}-{3060,9578,0,1,3}-{3054,9566,0,1,7}-{2834,9940,0,1,0}-{2836,9953,0,1,0}-{2844,9944,0,1,0}-{2822,9901,0,1,0}-{2836,9905,0,1,0}-{2838,9917,0,1,0}-{2847,9919,0,1,0}-{2848,9912,0,1,0}-"
"loc_data": "{2845,3517,0,1,4}-{2848,3515,0,1,4}-{2822,9901,0,1,0}-{2836,9905,0,1,0}-{2838,9917,0,1,0}-{2847,9919,0,1,0}-{2848,9912,0,1,0}-{2834,9940,0,1,0}-{2836,9953,0,1,0}-{2844,9944,0,1,0}-{2958,3867,0,1,3}-{2956,3857,0,1,6}-{2952,3862,0,1,3}-{2949,3858,0,1,4}-{2955,3875,0,1,7}-{2954,3874,0,1,5}-{2962,3876,0,1,1}-{2961,3877,0,1,3}-{2947,3878,0,1,6}-{2959,3884,0,1,4}-{2956,3885,0,1,3}-{2956,3886,0,1,3}-{2948,3886,0,1,1}-{2947,3934,0,1,0}-{2948,3917,0,1,0}-{2949,3926,0,1,0}-{2952,3913,0,1,0}-{2952,3936,0,1,0}-{2954,3921,0,1,0}-{2956,3930,0,1,0}-{2964,3944,0,1,0}-{2970,3947,0,1,0}-{2971,3938,0,1,0}-{2977,3953,0,1,0}-{2978,3942,0,1,0}-{2984,3933,0,1,0}-{3227,5443,0,1,5}-{3220,5448,0,1,5}-{3208,5443,0,1,6}-{3207,5448,0,1,4}-{3050,9570,0,1,3}-{3043,9579,0,1,2}-{3056,9585,0,1,0}-{3058,9575,0,1,1}-{3052,9582,0,1,0}-{3049,9577,0,1,4}-{3042,9586,0,1,6}-{3052,9588,0,1,1}-{3049,9590,0,1,5}-{3060,9578,0,1,3}-{3054,9566,0,1,7}-"
},
{
"npc_id": "126",
@ -991,6 +991,10 @@
"npc_id": "334",
"loc_data": "{2612,3411,0,0,0}-{2165,3268,0,0,4}-{2162,3274,0,0,4}-{2627,3415,0,0,0}-{2639,3698,0,0,4}-{2642,3698,0,0,4}-{2699,2702,0,0,4}-{2694,2706,0,0,4}-{2700,2702,0,0,4}-{2707,2698,0,0,4}-{2700,2702,0,0,0}-{2700,2702,0,0,0}-{2700,2702,0,0,0}-{2707,2698,0,0,0}-{2707,2698,0,0,0}-{2707,2698,0,0,0}-"
},
{
"npc_id": "335",
"loc_data": "{2592,3336,0,1,0}-"
},
{
"npc_id": "336",
"loc_data": "{2928,3218,0,1,4}-"
@ -1025,11 +1029,11 @@
},
{
"npc_id": "347",
"loc_data": "{2523,3292,0,1,0}-{2536,3294,0,1,0}-{2538,3321,0,1,0}-"
"loc_data": "{2524,3292,0,1,3}-{2536,3294,0,1,3}-{2538,3321,0,1,3}-"
},
{
"npc_id": "348",
"loc_data": "{2501,3315,0,1,0}-{2513,3325,0,1,0}-{2526,3279,0,1,0}-{2528,3297,0,1,0}-{2535,3288,0,1,0}-{2548,3287,0,1,0}-"
"loc_data": "{2501,3315,0,1,3}-{2513,3325,0,1,3}-{2526,3279,0,1,3}-{2528,3297,0,1,3}-{2535,3288,0,1,3}-{2548,3287,0,1,3}-"
},
{
"npc_id": "349",
@ -1041,31 +1045,31 @@
},
{
"npc_id": "351",
"loc_data": "{2507,3325,0,1,4}-"
"loc_data": "{2465,3307,0,1,0}-{2482,3293,0,1,0}-{2509,3325,0,1,0}-"
},
{
"npc_id": "352",
"loc_data": "{2511,3322,0,1,2}-{2540,3279,0,1,6}-"
"loc_data": "{2453,3307,0,1,0}-{2480,3300,0,1,0}-{2511,3322,0,1,0}-{2540,3279,0,1,0}-"
},
{
"npc_id": "353",
"loc_data": "{2504,3326,0,1,1}-{2509,3314,0,1,3}-{2545,3278,0,1,3}-"
"loc_data": "{2473,3288,0,1,0}-{2504,3326,0,1,0}-{2509,3314,0,1,0}-{2546,3277,0,1,0}-"
},
{
"npc_id": "354",
"loc_data": "{2510,3318,0,1,6}-{2524,3271,0,1,3}-"
"loc_data": "{2470,3290,0,1,0}-{2472,3296,0,1,0}-{2483,3318,0,1,0}-{2483,3323,0,1,0}-{2490,3293,0,1,0}-{2510,3318,0,1,0}-{2524,3271,0,1,0}-"
},
{
"npc_id": "355",
"loc_data": "{2504,3318,0,1,0}-"
"loc_data": "{2464,3302,0,1,0}-{2466,3300,0,1,0}-{2466,3307,0,1,0}-{2467,3306,0,1,0}-{2468,3315,0,1,0}-{2469,3319,0,1,0}-{2471,3323,0,1,0}-{2473,3305,0,1,0}-{2474,3296,0,1,0}-{2476,3307,0,1,0}-{2478,3323,0,1,0}-{2480,3296,0,1,0}-{2481,3313,0,1,0}-{2485,3312,0,1,0}-{2504,3318,0,1,0}-{2547,3277,0,1,0}-"
},
{
"npc_id": "356",
"loc_data": "{2523,3307,0,1,0}-"
"loc_data": "{2462,3306,0,1,0}-{2465,3305,0,1,0}-{2469,3295,0,1,0}-{2477,3320,0,1,0}-{2482,3311,0,1,0}-{2518,3275,0,1,0}-{2523,3307,0,1,0}-"
},
{
"npc_id": "357",
"loc_data": "{2518,3309,0,1,0}-{2526,3303,0,1,0}-{2543,3309,0,1,0}-{2550,3319,0,1,0}-{2552,3319,0,1,0}-"
"loc_data": "{2518,3309,0,1,3}-{2526,3303,0,1,3}-{2543,3309,0,1,3}-{2552,3320,0,1,3}-"
},
{
"npc_id": "358",
@ -1073,19 +1077,19 @@
},
{
"npc_id": "360",
"loc_data": "{2550,3272,0,1,4}-"
"loc_data": "{2472,3307,0,1,0}-{2492,3314,0,1,0}-{2553,3275,0,1,0}-"
},
{
"npc_id": "361",
"loc_data": "{2519,3277,0,1,6}-"
"loc_data": "{2463,3317,0,1,0}-{2482,3296,0,1,0}-{2485,3315,0,1,0}-{2519,3277,0,1,0}-"
},
{
"npc_id": "362",
"loc_data": "{2537,3324,0,1,6}-"
"loc_data": "{2482,3286,0,1,0}-{2489,3295,0,1,0}-{2537,3324,0,1,0}-"
},
{
"npc_id": "363",
"loc_data": "{2513,3315,0,1,4}-"
"loc_data": "{2468,3290,0,1,0}-{2475,3325,0,1,0}-{2479,3312,0,1,0}-{2513,3315,0,1,0}-"
},
{
"npc_id": "364",
@ -1105,19 +1109,19 @@
},
{
"npc_id": "369",
"loc_data": "{2542,3326,0,1,0}-{2545,3324,0,1,0}-{2545,3327,0,1,0}-{2552,3326,0,1,0}-{2553,3322,0,1,0}-{2553,3324,0,1,0}-"
"loc_data": "{2548,3324,0,1,3}-{2550,3326,0,1,3}-{2553,3325,0,1,3}-"
},
{
"npc_id": "370",
"loc_data": "{2551,3324,1,1,0}-{2551,3327,1,1,0}-"
"loc_data": "{2549,3325,1,1,0}-{2550,3327,1,1,0}-"
},
{
"npc_id": "371",
"loc_data": "{2547,3326,0,1,0}-{2549,3322,0,1,0}-{2550,3326,0,1,0}-{2552,3323,0,1,0}-"
"loc_data": "{2545,3326,0,1,3}-{2551,3322,0,1,3}-{2555,3324,0,1,3}-"
},
{
"npc_id": "372",
"loc_data": "{2561,3303,0,1,6}-{2561,3305,0,1,4}-{2559,3303,0,1,6}-{2559,3305,0,1,1}-"
"loc_data": "{2561,3305,0,1,2}-{2561,3303,0,1,7}-{2559,3304,0,1,3}-"
},
{
"npc_id": "373",
@ -2104,20 +2108,24 @@
"loc_data": "{2526,3319,0,0,6}-"
},
{
"npc_id": "714",
"loc_data": "{2569,3333,0,1,0}-{2517,9755,0,1,0}-"
"npc_id": "715",
"loc_data": "{2541,9672,0,1,0}-"
},
{
"npc_id": "716",
"loc_data": "{2540,3286,0,0,1}-"
"loc_data": "{2542,3286,0,1,3}-"
},
{
"npc_id": "717",
"loc_data": "{2513,3294,0,1,0}-{2518,3320,0,1,0}-{2539,3273,0,0,1}-{2535,3296,0,1,0}-"
"loc_data": "{2513,3294,0,1,0}-{2518,3320,0,1,0}-{2530,3274,0,1,0}-{2535,3296,0,1,0}-"
},
{
"npc_id": "718",
"loc_data": "{2582,3329,0,1,2}-"
},
{
"npc_id": "719",
"loc_data": "{2560,3288,0,0,0}-{2026,4619,0,1,6}-{2026,4615,0,0,6}-{2020,4614,0,1,1}-{2021,4614,0,1,6}-{2008,4612,0,1,3}-{2002,4613,0,1,4}-"
"loc_data": "{2560,3288,0,1,2}-"
},
{
"npc_id": "720",
@ -2145,11 +2153,11 @@
},
{
"npc_id": "728",
"loc_data": "{2540,3308,0,1,6}-"
"loc_data": "{2540,3308,0,1,0}-"
},
{
"npc_id": "729",
"loc_data": "{2536,3308,0,1,4}-"
"loc_data": "{2536,3308,0,1,0}-"
},
{
"npc_id": "731",
@ -2273,15 +2281,15 @@
},
{
"npc_id": "785",
"loc_data": "{2470,3312,0,1,0}-{2479,3315,0,1,0}-"
"loc_data": "{2468,3304,0,1,0}-{2476,3317,0,1,0}-{2478,3291,0,1,0}-{2492,3312,0,1,0}-"
},
{
"npc_id": "786",
"loc_data": "{2482,3313,0,1,0}-{2477,3311,0,1,0}-"
"loc_data": "{2469,3309,0,1,0}-{2475,3298,0,1,0}-{2487,3308,0,1,0}-{2490,3289,0,1,0}-"
},
{
"npc_id": "787",
"loc_data": "{2486,3315,0,1,0}-{2479,3313,0,1,0}-"
"loc_data": "{2476,3313,0,1,0}-{2481,3289,0,1,0}-{2490,3313,0,1,0}-{2491,3300,0,1,0}-"
},
{
"npc_id": "788",
@ -2707,6 +2715,10 @@
"npc_id": "970",
"loc_data": "{3081,3247,0,0,1}-"
},
{
"npc_id": "971",
"loc_data": "{2464,3287,0,1,0}-"
},
{
"npc_id": "1005",
"loc_data": "{3057,3905,0,1,3}-"
@ -5609,11 +5621,15 @@
},
{
"npc_id": "2372",
"loc_data": "{2044,4632,0,1,3}-"
"loc_data": "{2044,4628,0,1,0}-"
},
{
"npc_id": "2373",
"loc_data": "{2037,4636,0,1,0}-{2038,4644,0,1,0}-{2041,4638,0,1,0}-{2044,4642,0,1,0}-"
},
{
"npc_id": "2374",
"loc_data": "{2041,4632,0,1,3}-{2037,4630,0,1,3}-{2041,4644,0,1,4}-"
"loc_data": "{2036,4633,0,0,6}-"
},
{
"npc_id": "2381",
@ -6209,7 +6225,23 @@
},
{
"npc_id": "2783",
"loc_data": "{1995,4660,0,1,7}-{1989,4660,0,1,0}-{1989,4664,0,1,7}-{1995,4660,0,1,2}-{1997,4664,0,1,3}-{1989,4658,0,1,0}-{2001,4646,0,1,4}-{2000,4645,0,1,3}-{1997,4644,0,1,1}-{2006,4639,0,1,6}-{1999,4636,0,1,3}-"
"loc_data": "{1995,4660,0,1,7}-{1989,4660,0,1,0}-{1989,4664,0,1,7}-{1997,4664,0,1,3}-{1989,4658,0,1,0}-{2001,4646,0,1,4}-{2000,4645,0,1,3}-{1997,4644,0,1,1}-{1999,4636,0,1,3}-{2022,4665,0,1,0}-{2024,4662,0,1,0}-{2020,4660,0,1,0}-{2023,4656,0,1,0}-{2029,4660,0,1,0}-{2031,4665,0,1,0}-{2034,4661,0,1,0}-{2032,4658,0,1,0}-{1991,4653,0,1,0}-{1995,4651,0,1,0}-"
},
{
"npc_id": "2784",
"loc_data": "{2022,4616,0,1,5}-{2024,4620,0,1,5}-"
},
{
"npc_id": "2785",
"loc_data": "{2000,4613,0,0,0}-{2000,4611,0,0,5}-"
},
{
"npc_id": "2786",
"loc_data": "{2008,4613,0,1,0}-"
},
{
"npc_id": "2787",
"loc_data": "{2023,4612,0,1,0}-"
},
{
"npc_id": "2790",
@ -6692,12 +6724,16 @@
"loc_data": "{3139,3448,0,1,3}-"
},
{
"npc_id": "3215",
"loc_data": "{2541,9672,0,1,3}-"
"npc_id": "3213",
"loc_data": "{2568,3334,0,1,0}-"
},
{
"npc_id": "3214",
"loc_data": "{2517,9755,0,1,0}-"
},
{
"npc_id": "3216",
"loc_data": "{2581,3332,0,1,3}-{2534,3273,0,0,1}-"
"loc_data": "{2534,3273,0,0,1}-{2539,3273,0,0,1}-"
},
{
"npc_id": "3217",
@ -8141,7 +8177,7 @@
},
{
"npc_id": "4686",
"loc_data": "{2804,3507,0,1,0}-{2880,9927,0,1,0}-{2887,9955,0,1,0}-{2891,9941,0,1,0}-{2824,3510,0,1,5}-{2954,3894,0,1,4}-{2950,3932,0,1,0}-{2955,3945,0,1,0}-{3213,5548,0,1,4}-"
"loc_data": "{2824,3510,0,1,5}-{2880,9927,0,1,0}-{2887,9955,0,1,0}-{2891,9941,0,1,0}-{2954,3894,0,1,4}-{2950,3932,0,1,0}-{2955,3945,0,1,0}-{3213,5548,0,1,4}-{2804,3507,0,1,0}-"
},
{
"npc_id": "4687",
@ -10663,14 +10699,6 @@
"npc_id": "6283",
"loc_data": "{2877,5326,2,1,2}-{2857,5328,2,1,3}-{2861,5315,2,1,7}-"
},
{
"npc_id": "6339",
"loc_data": "{2547,3277,0,0,0}-"
},
{
"npc_id": "6345",
"loc_data": "{2518,3275,0,1,0}-"
},
{
"npc_id": "6346",
"loc_data": "{2799,3186,0,1,7}-{2797,3169,0,0,0}-{2793,3161,0,1,3}-"

View file

@ -22,7 +22,7 @@ public class ManDialoguePlugin extends DialoguePlugin {
/**
* The NPC ids that use this dialogue plugin.
*/
private static final int[] NPC_IDS = {1, 2, 3, 4, 5, 6, 16, 24, 25, 170, 351, 352, 353, 354, 359, 360, 361, 362, 363, 726, 727, 728, 729, 730, 1086, 2675, 2776, 3224, 3225, 3227, 5923, 5924,};
private static final int[] NPC_IDS = {1, 2, 3, 4, 5, 6, 16, 24, 25, 170, 1086, 2675, 2776, 3224, 3225, 3227, 5923, 5924,};
public ManDialoguePlugin() {
}

View file

@ -1,22 +1,19 @@
package content.global.handlers.item
import core.api.inInventory
import core.api.removeItem
import core.api.teleport
import content.region.kandarin.ardougne.quest.plaguecity.PlagueCityListeners.Companion.ARDOUGNE_TELE_ATTRIBUTE
import core.api.*
import core.game.interaction.IntType
import core.game.interaction.InteractionListener
import core.game.node.entity.player.Player
import core.game.node.entity.player.link.TeleportManager
import core.game.node.item.Item
import core.game.world.map.Location
import core.api.hasRequirement;
import content.data.Quests
class TeleTabsListener : InteractionListener {
enum class TeleTabs(val item: Int, val location: Location, val exp: Double, val requirementCheck: (Player) -> Boolean = { true }) {
ADDOUGNE_TELEPORT(8011, Location.create(2662, 3307, 0), 61.0, {
player -> hasRequirement(player, Quests.PLAGUE_CITY);
player -> getAttribute(player, ARDOUGNE_TELE_ATTRIBUTE, false)
}),
AIR_ALTAR_TELEPORT(13599, Location.create(2978, 3296, 0), 0.0),
ASTRAL_ALTAR_TELEPORT(13611, Location.create(2156, 3862, 0), 0.0),
@ -52,9 +49,17 @@ class TeleTabsListener : InteractionListener {
val tabEnum = TeleTabs.forId(tab)
if (tabEnum != null && inInventory(player,tab)) {
val tabloc = tabEnum.location
if (inInventory(player, tab) && tabEnum.requirementCheck(player)) {
if (teleport(player, tabloc, TeleportManager.TeleportType.TELETABS)) {
removeItem(player, Item(node.id, 1))
if (inInventory(player, tab)) {
if (tabEnum.requirementCheck(player)){
if (teleport(player, tabloc, TeleportManager.TeleportType.TELETABS)) {
removeItem(player, Item(node.id, 1))
}
}
else {
when (tabEnum){
TeleTabs.ADDOUGNE_TELEPORT -> sendMessage(player, "You need to complete Plague City to use this tablet.")
else -> sendMessage(player, "You do not have the requirements to use this tablet.")
}
}
}
}

View file

@ -1,56 +0,0 @@
package content.global.handlers.item.withnpc
import core.api.Container
import core.api.*
import org.rs09.consts.Items
import org.rs09.consts.NPCs
import core.game.interaction.InteractionListener
import core.game.interaction.IntType
class CatOnArdougneCivilian: InteractionListener {
private val civilians = intArrayOf(
NPCs.CIVILIAN_785,
NPCs.CIVILIAN_786,
NPCs.CIVILIAN_787
)
private val cats = intArrayOf(
Items.PET_CAT_1561,
Items.PET_CAT_1562,
Items.PET_CAT_1563,
Items.PET_CAT_1564,
Items.PET_CAT_1565,
Items.PET_CAT_1566,
Items.OVERGROWN_CAT_1567,
Items.OVERGROWN_CAT_1568,
Items.OVERGROWN_CAT_1569,
Items.OVERGROWN_CAT_1570,
Items.OVERGROWN_CAT_1571,
Items.OVERGROWN_CAT_1572,
Items.LAZY_CAT_6551,
Items.LAZY_CAT_6552,
Items.LAZY_CAT_6553,
Items.LAZY_CAT_6554,
Items.WILY_CAT_6555,
Items.WILY_CAT_6556,
Items.WILY_CAT_6557,
Items.WILY_CAT_6558,
Items.WILY_CAT_6559,
Items.WILY_CAT_6560,
Items.HELL_CAT_7582,
Items.OVERGROWN_HELLCAT_7581,
Items.LAZY_HELL_CAT_7584,
Items.WILY_HELLCAT_7585,
)
override fun defineListeners() {
onUseWith(IntType.NPC,cats,*civilians){ player, used, _ ->
sendItemDialogue(player,Items.DEATH_RUNE_560,"You hand over the cat.<br>You are given 100 Death Runes.")
player.familiarManager.removeDetails(used.id)
removeItem(player,used,Container.INVENTORY)
addItem(player,Items.DEATH_RUNE_560,100)
return@onUseWith true
}
}
}

View file

@ -17,6 +17,8 @@ import core.plugin.Initializable;
import core.plugin.Plugin;
import core.plugin.ClassScanner;
import static content.region.kandarin.ardougne.quest.plaguecity.PlagueCityListeners.ARDOUGNE_TELE_ATTRIBUTE;
/**
* PortalChamberPlugin
* @author Clayton Williams
@ -87,6 +89,12 @@ public class PortalChamberPlugin extends OptionHandler {
}
for (Locations l : Locations.values()) {
if (l.name().contains(identifier)) {
if (l == Locations.ARDOUGNE){
if (player.getAttribute(ARDOUGNE_TELE_ATTRIBUTE, false)){
player.sendMessage("You do not have the requirements to direct the portal there");
return;
}
}
Item[] runes = l.runes;
if (!player.getInventory().containsItems(runes)) {
player.sendMessage("You do not have the required runes to build this portal");
@ -130,6 +138,12 @@ public class PortalChamberPlugin extends OptionHandler {
case "enter":
String objectName = object.getName();
for (Locations l : Locations.values()) {
if (l == Locations.ARDOUGNE){
if (player.getAttribute(ARDOUGNE_TELE_ATTRIBUTE, false)){
player.sendMessage("You do not have the requirements to enter this portal.");
return false;
}
}
if (objectName.toLowerCase().contains(l.name().toLowerCase())) {
player.teleport(l.location);
if (player.getHouseManager().isInHouse(player) && node.getId() == 13635) {

View file

@ -10,6 +10,7 @@ import core.game.node.entity.player.Player
import core.game.node.entity.player.link.diary.DiaryType
import core.game.node.entity.skill.Skills
import content.global.skill.construction.Decoration
import content.region.kandarin.ardougne.quest.plaguecity.PlagueCityListeners.Companion.ARDOUGNE_TELE_ATTRIBUTE
import core.game.node.entity.combat.spell.MagicStaff
import core.game.node.item.Item
import core.game.system.task.Pulse
@ -84,6 +85,11 @@ class LecternPlugin : OptionHandler() {
player.sendMessages("You need the Bones to Peaches ability purchased from MTA before making these.", "This requirement doesn't apply to actually using the tabs.")
return false
}
if(this == ARDOUGNE && !getAttribute(player, ARDOUGNE_TELE_ATTRIBUTE, false)){
sendMessage(player, "You need to unlock Ardougne teleport before you can make a tablet.")
return false
}
var found = false
for (d in requiredDecorations) if (d.objectId == objectId) found = true
if (!found) {

View file

@ -0,0 +1,44 @@
package content.global.skill.cooking.recipe
import core.api.*
import core.game.interaction.IntType
import core.game.interaction.InteractionListener
import core.game.node.entity.skill.Skills
import org.rs09.consts.Items
class HangoverRecipe : InteractionListener {
companion object{
private const val SNAPE_GRASS = Items.SNAPE_GRASS_231
private const val HANGOVER_CURE = Items.HANGOVER_CURE_1504
private const val BUCKET_OF_MILK = Items.BUCKET_OF_MILK_1927
private const val CHOCOLATE_DUST = Items.CHOCOLATE_DUST_1975
private const val CHOCOLATE_MILK = Items.CHOCOLATEY_MILK_1977
}
override fun defineListeners() {
onUseWith(IntType.ITEM, CHOCOLATE_DUST, BUCKET_OF_MILK) { player, _, _ ->
if(hasLevelDyn(player, Skills.COOKING, 4)){
if(removeItem(player, CHOCOLATE_DUST) and removeItem(player, BUCKET_OF_MILK)){
addItem(player, CHOCOLATE_MILK)
sendItemDialogue(player, CHOCOLATE_MILK, "You mix the chocolate into the bucket.")
}
}
else {
sendDialogue(player, "You need a Cooking level of at least 4 to make chocolate milk.")
}
return@onUseWith true
}
onUseWith(IntType.ITEM, SNAPE_GRASS, CHOCOLATE_MILK) { player, _, _ ->
if (removeItem(player, SNAPE_GRASS) && removeItem(player, CHOCOLATE_MILK))
{
sendItemDialogue(player, HANGOVER_CURE, "You mix the snape grass into the bucket.")
addItem(player, HANGOVER_CURE)
return@onUseWith true
}
return@onUseWith false
}
}
}

View file

@ -1,5 +1,6 @@
package content.global.skill.magic.modern
import content.data.Quests
import content.global.skill.magic.SpellListener
import content.global.skill.magic.SpellUtils.hasRune
import content.global.skill.magic.TeleportMethod
@ -22,6 +23,7 @@ import core.game.node.entity.player.Player
import core.game.node.entity.player.link.TeleportManager
import core.game.node.entity.player.link.diary.DiaryType
import core.game.node.entity.skill.Skills
import content.region.kandarin.ardougne.quest.plaguecity.PlagueCityListeners
import core.game.node.item.Item
import core.game.world.map.Location
import core.game.world.update.flag.context.Animation
@ -29,7 +31,6 @@ import core.game.world.update.flag.context.Graphics
import org.rs09.consts.Items
import org.rs09.consts.Scenery
import org.rs09.consts.Sounds
import content.data.Quests
class ModernListeners : SpellListener("modern"){
override fun defineListeners() {
@ -66,10 +67,15 @@ class ModernListeners : SpellListener("modern"){
}
onCast(Modern.ARDOUGNE_TELEPORT, NONE){ player, _ ->
if (!hasRequirement(player, Quests.PLAGUE_CITY))
return@onCast
requires(player,51, arrayOf(Item(Items.WATER_RUNE_555,2),Item(Items.LAW_RUNE_563,2)))
sendTeleport(player,61.0, Location.create(2662, 3307, 0))
if (getAttribute(player, PlagueCityListeners.ARDOUGNE_TELE_ATTRIBUTE, false)){
requires(player,51, arrayOf(Item(Items.WATER_RUNE_555,2),Item(Items.LAW_RUNE_563,2)))
sendTeleport(player,61.0, Location.create(2662, 3307, 0))
}
else {
// source https://runescape.salmoneus.net/forums/topic/289818-ardougne-teleport-help/
sendDialogue(player, "You haven\'t learnt how to cast this spell yet")
}
return@onCast
}
onCast(Modern.WATCHTOWER_TELEPORT, NONE){ player, _ ->

View file

@ -28,7 +28,6 @@ public class SlayerPlugin extends OptionHandler {
@Override
public Plugin<Object> newInstance(Object arg) throws Throwable {
SceneryDefinition.forId(8783).getHandlers().put("option:open", this);
SceneryDefinition.forId(8785).getHandlers().put("option:climb-up", this);
SceneryDefinition.forId(23158).getHandlers().put("option:exit", this);
SceneryDefinition.forId(23157).getHandlers().put("option:exit", this);
@ -53,9 +52,6 @@ public class SlayerPlugin extends OptionHandler {
@Override
public boolean handle(Player player, Node node, String option) {
switch (node.getId()) {
case 8783:
player.teleport(new Location(2044, 4649, 0));
break;
case 8785:
player.teleport(new Location(2543, 3327, 0));
break;

View file

@ -65,7 +65,6 @@ abstract class CastleWarsArea : MapArea, LogoutListener, InteractionListener {
defineAreaBorders().forEach { border ->
if (border.insideBorder(player)) {
sendMessage(player, "You can't remove your team's colours")
// TODO: Equipping a cape or helmet causes issues
return@onUnequip false
}
}

View file

@ -92,7 +92,7 @@ public class ShantayPassPlugin extends OptionHandler {
case "quick-pass":
if (player.getLocation().getY() > 3116) {
if (!inInventory(player, Items.SHANTAY_PASS_1854, 1)) {
sendNPCDialogue(player, 838, "You need a Shantay pass to get through this gate. See Shantay, he will sell you one for a very reasonable price.", FacialExpression.NEUTRAL);
sendNPCDialogue(player, 838, "You need a Shantay pass to get through this gate. See Shantay, he will sell you one for a very reasonable price.", FacialExpression.NEUTRAL, false);
return true;
}
if (!removeItem(player, Items.SHANTAY_PASS_1854, Container.INVENTORY)) return true;

View file

@ -1,44 +0,0 @@
package content.region.kandarin.ardougne.plaguecity.dialogue
import core.api.inEquipment
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
@Initializable
class CivilianDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if(inEquipment(player, Items.GAS_MASK_1506)) {
playerl(FacialExpression.FRIENDLY, "Hello there.").also { stage = 4 }
} else {
playerl(FacialExpression.FRIENDLY, "Hello there.").also { stage = 0 }
}
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
0 -> npcl(FacialExpression.FRIENDLY, "I'm a bit busy to talk right now, sorry.").also { stage++ }
1 -> playerl(FacialExpression.FRIENDLY, "Why? What are you doing?").also { stage++ }
2 -> npcl(FacialExpression.FRIENDLY, "Trying to kill these mice! What I really need is a cat!").also { stage++ }
3 -> playerl(FacialExpression.FRIENDLY, "No, you're right, you don't see many around.").also { stage = END_DIALOGUE }
4 -> npcl(FacialExpression.FRIENDLY, "If you Mourners really wanna help, why don't you do something about these mice?!").also { stage = END_DIALOGUE }
}
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return CivilianDialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.CIVILIAN_785, NPCs.CIVILIAN_786, NPCs.CIVILIAN_787)
}
}

View file

@ -1,54 +0,0 @@
package content.region.kandarin.ardougne.plaguecity.dialogue
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.NPCs
import content.data.Quests
@Initializable
class KilronDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if (player.questRepository.getQuest(Quests.PLAGUE_CITY).isCompleted(player)){
npcl(FacialExpression.FRIENDLY, "Looks like you won't be needing the rope ladder any more, adventurer. I heard it was you who started the revolution and freed West Ardougne!").also { stage = END_DIALOGUE }
} else {
playerl(FacialExpression.FRIENDLY, "Hello there.")
}
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
0 -> npcl(FacialExpression.FRIENDLY, "Hello.").also { stage++ }
1 -> playerl(FacialExpression.FRIENDLY, "How are you?").also { stage++ }
2 -> npcl(FacialExpression.FRIENDLY, "Busy.").also { stage = END_DIALOGUE }
}
return true
}
/* After Biohazard and before Plague's End
0 -> playerl(FacialExpression.FRIENDLY, "Hello Kilron.").also { stage++ }
1 -> npcl(FacialExpression.FRIENDLY, "Hello traveller. Do you need to go back over?").also { stage++ }
2 -> options("Not yet Kilron", "Yes I do").also { stage++ }
3 -> when(buttonID) {
1 -> playerl(FacialExpression.FRIENDLY, "Not yet Kilron.").also { stage = 4 }
2 -> playerl(FacialExpression.FRIENDLY, "Yes I do.").also { stage = 5 }
}
4 -> npcl(FacialExpression.FRIENDLY, "Okay, just give me the word.").also { stage = END_DIALOGUE }
5 -> npcl(FacialExpression.FRIENDLY, "Okay, quickly now!").also { stage = END_DIALOGUE }
*/
override fun newInstance(player: Player?): DialoguePlugin {
return KilronDialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.KILRON_349)
}
}

View file

@ -1,24 +0,0 @@
package content.region.kandarin.ardougne.plaguecity.dialogue
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.plugin.Initializable
import core.tools.END_DIALOGUE
@Initializable
class ManDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
when (stage) {
0 -> npcl(FacialExpression.HALF_GUILTY, "We don't have good days here anymore. Curse King Tyras.").also { stage++ }
1 -> options("Oh okay, bad day then.", "Why, what has he done?", "I'm looking for a woman called Elena.").also { stage++ }
2 -> when (buttonID) {
1 -> playerl(FacialExpression.FRIENDLY, "Oh okay, bad day then.").also { stage = END_DIALOGUE }
2 -> playerl(FacialExpression.FRIENDLY, "Why, what has he done?").also { stage = 3 }
3 -> playerl(FacialExpression.FRIENDLY, "I'm looking for a woman called Elena.").also { stage = 4 }
}
3 -> npcl(FacialExpression.FRIENDLY, "His army curses our city with this plague then wanders off again, leaving us to clear up the pieces.").also { stage = END_DIALOGUE }
4 -> npcl(FacialExpression.THINKING, "Not heard of her.").also { stage = END_DIALOGUE }
}
}
}

View file

@ -1,41 +0,0 @@
package content.region.kandarin.ardougne.plaguecity.dialogue
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.NPCs
@Initializable
class MournersDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
playerl(FacialExpression.FRIENDLY, "Hi.").also { stage = 0 }
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
0 -> npcl(FacialExpression.SAD, "What are you up to?").also { stage++ }
1 -> playerl(FacialExpression.NEUTRAL,"Just sight-seeing.").also { stage++ }
2 -> npcl(FacialExpression.FRIENDLY, "This is no place for sight-seeing. Don't you know there's been a plague outbreak?").also { stage++ }
3 -> playerl(FacialExpression.FRIENDLY, "Yes, I had heard.").also { stage++ }
4 -> npcl(FacialExpression.FRIENDLY, "Then I suggest you leave as soon as you can.").also { stage++ }
5 -> playerl(FacialExpression.FRIENDLY, "Thanks for the advice.").also { stage = END_DIALOGUE }
}
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return MournersDialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(
NPCs.MOURNER_347, NPCs.MOURNER_348, NPCs.MOURNER_357, NPCs.MOURNER_369, NPCs.MOURNER_371, NPCs.MOURNER_370)
}
}

View file

@ -1,61 +0,0 @@
package content.region.kandarin.ardougne.plaguecity.dialogue
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import core.tools.RandomFunction
@Initializable
class WomanDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
when (RandomFunction.random(1,4)) {
1 -> when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello, how's it going?").also { stage++ }
1 -> npcl(FacialExpression.FRIENDLY, "Bah, those mourners... they're meant to be helping us, but I think they're doing more harm here than good. They won't even let me send a letter out to my family.").also { stage++ }
2 -> options("Have you seen a lady called Elena around here?", "You should stand up to them more.").also { stage++ }
3 -> when (buttonID) {
1 -> playerl(FacialExpression.FRIENDLY, "Have you seen a lady called Elena around here?").also { stage = 4 }
2 -> playerl(FacialExpression.FRIENDLY, "You should stand up to them more.").also { stage = 6 }
}
4 -> npcl(FacialExpression.FRIENDLY, "Yes, I've seen her. Very helpful person.").also { stage++ }
5 -> npcl(FacialExpression.FRIENDLY, "Not for the last few days though... I thought maybe she'd gone home.").also { stage = END_DIALOGUE }
6 -> npcl(FacialExpression.FRIENDLY, "Oh I'm not one to cause a fuss.").also { stage = END_DIALOGUE }
}
2 -> when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello, how's it going?").also { stage++ }
1 -> npcl(FacialExpression.FRIENDLY, "Life is tough.").also { stage++ }
2 -> options("Yes, living in a plague city must be hard.", "I'm sorry to hear that.", "I'm looking for a lady called Elena.").also { stage++ }
3 -> when (buttonID) {
1 -> playerl(FacialExpression.FRIENDLY, "Yes, living in a plague city must be hard.").also { stage = 4 }
2 -> playerl(FacialExpression.FRIENDLY, "I'm sorry to hear that.").also { stage = 6 }
3 -> playerl(FacialExpression.FRIENDLY, "I'm looking for a lady called Elena.").also { stage = 7 }
}
4 -> npcl(FacialExpression.FRIENDLY, "Plague? Pah, that's no excuse for the treatment we've received. It's obvious pretty quickly if someone has the plague.").also { stage++ }
5 -> npcl(FacialExpression.FRIENDLY, "I'm thinking about making a break for it. I'm perfectly healthy, not gonna infect anyone.").also { stage = END_DIALOGUE }
6 -> npcl(FacialExpression.FRIENDLY, "Well, ain't much either you or me can do about it.").also { stage = END_DIALOGUE }
7 -> npcl(FacialExpression.FRIENDLY, "I've not heard of her. Old Jethick knows a lot of people, maybe he'll know where you can find her.").also { stage = END_DIALOGUE }
}
3 -> when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello, how's it going?").also { stage++ }
1 -> npcl(FacialExpression.FRIENDLY, "We don't have good days here anymore. Curse King Tyras.").also { stage++ }
2 -> options("Oh okay, bad day then.", "Why, what has he done?", "I'm looking for a woman called Elena.").also { stage++ }
3 -> when (buttonID) {
1 -> playerl(FacialExpression.FRIENDLY, "Oh okay, bad day then.").also { stage = END_DIALOGUE }
2 -> playerl(FacialExpression.FRIENDLY, "Why, what has he done?").also { stage = 4 }
3 -> playerl(FacialExpression.FRIENDLY, "I'm looking for a lady called Elena.").also { stage = 5 }
}
4 -> npcl(FacialExpression.FRIENDLY, "His army curses our city with this plague then wanders off again, leaving us to clear up the pieces.").also { stage = END_DIALOGUE }
5 -> npcl(FacialExpression.FRIENDLY, "Not heard of her.").also { stage = END_DIALOGUE }
}
4 -> when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello, how's it going?").also { stage++ }
1 -> npcl(FacialExpression.HALF_ASKING, "An outsider! Can you get me out of this hell hole?").also { stage++ }
2 -> playerl(FacialExpression.HALF_GUILTY, "Sorry, that's not what I'm here to do.").also { stage = END_DIALOGUE }
}
}
}
}

View file

@ -1,117 +0,0 @@
package content.region.kandarin.ardougne.plaguecity.quest.elena
import core.api.*
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
import content.data.Quests
@Initializable
class BravekDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if (player.questRepository.getStage(Quests.PLAGUE_CITY) == 0) {
npcl(FacialExpression.ANGRY, "Go away, I'm busy! I'm... Um... In a meeting!").also { stage = END_DIALOGUE }
} else if (player.questRepository.getStage(Quests.PLAGUE_CITY) == 13) {
npcl(FacialExpression.NEUTRAL, "My head hurts! I'll speak to you another day...").also { stage = 1 }
} else if (player.questRepository.getStage(Quests.PLAGUE_CITY) == 14) {
npcl(FacialExpression.NEUTRAL, "Uurgh! My head still hurts too much to think straight. Oh for one of Trudi's hangover cures!").also { stage = 1 }
} else if (player.questRepository.getStage(Quests.PLAGUE_CITY) >= 16) {
npcl(FacialExpression.NEUTRAL, "Thanks again for the hangover cure.").also { stage = 1 }
} else {
npcl(FacialExpression.ANGRY, "Go away, I'm busy! I'm... Um... In a meeting!").also { stage = END_DIALOGUE }
}
return true
}
override fun handle(componentID: Int, buttonID: Int): Boolean {
when (getQuestStage(player!!, Quests.PLAGUE_CITY)) {
13 -> when (stage) {
1 -> playerl(FacialExpression.FRIENDLY, "This is really important though!").also { stage = 2 }
2 -> npcl(FacialExpression.FRIENDLY, "I can't possibly speak to you with my head spinning like this... I went a bit heavy on the drink last night.").also { stage++ }
3 -> npcl(FacialExpression.FRIENDLY, "Curse my herbalist, she made the best hangover cures. Darn inconvenient of her catching the plague.").also { stage++ }
4 -> options("You shouldn't drink so much then!", "Do you know what's in the cure?", "Okay, goodbye.").also { stage++ }
5 -> when (buttonID) {
1 -> playerl(FacialExpression.FRIENDLY, "You shouldn't drink so much then!").also { stage = 7 }
2 -> playerl(FacialExpression.FRIENDLY, "Do you know what's in the cure?").also { stage = 20 }
3 -> playerl(FacialExpression.FRIENDLY, "Okay, goodbye.").also { stage = END_DIALOGUE }
}
7 -> npcl(FacialExpression.FRIENDLY, "Well positions of responsibility are hard, I need something to take my mind off things... Especially with the problems this place has..").also { stage++ }
8 -> playerl(FacialExpression.FRIENDLY, "I don't think drink is the solution.").also { stage++ }
9 -> npcl(FacialExpression.FRIENDLY, "Uurgh! My head still hurts too much to think straight. Oh for one of Trudi's hangover cures!").also { stage++ }
10 -> npcl(FacialExpression.FRIENDLY, "I'll see what I can do I suppose. Mr. Bravek, there's someone here who really needs to speak to you.").also { stage++ }
11 -> sendNPCDialogue(player!!, NPCs.BRAVEK_711, "I suppose they can come in then. If they keep it short.").also { stage = END_DIALOGUE }
20 -> npcl(FacialExpression.FRIENDLY, "Hmmm let me think... Ouch! Thinking isn't clever. Ah here, she did scribble it down for me.").also { stage++ }
21 -> if (freeSlots(player!!) == 0) {
end()
sendItemDialogue(player!!, Items.A_SCRUFFY_NOTE_1508, "Bravek waves a tatty piece of paper at you, but you don't have room to take it.").also { stage = END_DIALOGUE }
} else {
end()
sendItemDialogue(player!!, Items.A_SCRUFFY_NOTE_1508, "Bravek hands you a tatty piece of paper.").also { stage++ }
addItem(player!!, Items.A_SCRUFFY_NOTE_1508)
setQuestStage(player!!, Quests.PLAGUE_CITY, 14)
}
}
14 -> when (stage) {
1 -> if(removeItem(player!!, Items.HANGOVER_CURE_1504)) {
playerl(FacialExpression.FRIENDLY, "Try this.").also { stage++ }
} else {
end()
stage = END_DIALOGUE
}
2 -> {
animate(npc, 1330) // Drink hangover cure.
findLocalNPC(player!!, NPCs.BRAVEK_711)!!.sendChat("Grruurgh!")
sendItemDialogue(player!!, Items.HANGOVER_CURE_1504, "You give Bravek the hangover cure.").also { stage++ }
}
3 -> sendDialogue(player!!, "Bravek gulps down the foul-looking liquid.").also { stage++ }
4 -> npcl(FacialExpression.NEUTRAL, "Ooh that's much better! Thanks, that's the clearest my head has felt in a month. Ah now, what was it you wanted me to do for you?").also { stage++ }
5 -> playerl(FacialExpression.FRIENDLY, "I need to rescue a kidnap victim named Elena. She's being held in a plague house, I need permission to enter.").also { stage++ }
6 -> options("Ok, I'll go speak to them.", "Is that all anyone says around here?", "They won't listen to me!").also { stage++ }
7 -> when (buttonID) {
1 -> playerl(FacialExpression.FRIENDLY, "Ok, I'll go speak to them.").also { stage = 6 }
2 -> playerl(FacialExpression.FRIENDLY, "Is that all anyone says around here?").also { stage = 11 }
3 -> playerl(FacialExpression.FRIENDLY, "They won't listen to me! They say I'm not properly equipped to go in the house, though I do have a very effective gasmask.").also { stage++ }
}
8 -> npcl(FacialExpression.FRIENDLY, "Hmmm, well I guess they're not taking the issue of a kidnapping seriously enough. They do go a bit far sometimes.").also { stage++ }
9 -> npcl(FacialExpression.FRIENDLY, "I've heard of Elena, she has helped us a lot... Ok, I'll give you this warrant to enter the house.").also { stage = 17 }
11 -> npcl(FacialExpression.FRIENDLY, "Well, they know best about plague issues.").also { stage++ }
12 -> playerl(FacialExpression.FRIENDLY, "Don't you want to take an interest in it at all?").also { stage++ }
13 -> npcl(FacialExpression.FRIENDLY, "Nope, I don't wish to take a deep interest in plagues. That stuff is too scary for me!").also { stage++ }
14 -> playerl(FacialExpression.FRIENDLY, "I can see why people say you're a weak leader.").also { stage++ }
15 -> npcl(FacialExpression.FRIENDLY, "Bah, people always criticise their leaders but delegating is the only way to lead. I delegate all plague issues to the mourners.").also { stage++ }
16 -> playerl(FacialExpression.FRIENDLY, "This whole city is a plague issue!").also { stage = 6 }
17 -> if (freeSlots(player!!) == 0) {
end()
sendItemDialogue(player!!, Items.WARRANT_1503, "Bravek waves a warrant at you, but you don't have room to take it.").also { stage = END_DIALOGUE }
} else {
end()
sendItemDialogue(player!!, Items.WARRANT_1503, "Bravek hands you a warrant.").also { stage = END_DIALOGUE }
addItem(player!!, Items.WARRANT_1503)
setQuestStage(player!!, Quests.PLAGUE_CITY, 16)
}
}
16 -> when (stage) {
1 -> playerl(FacialExpression.NEUTRAL, "Not a problem, happy to help out.").also { stage++ }
2 -> npcl(FacialExpression.FRIENDLY, "I'm just having a little drop of whisky, then I'll feel really good.").also { stage = END_DIALOGUE }
}
in 17..100 -> when (stage) {
1 -> playerl(FacialExpression.FRIENDLY, "Not a problem, happy to help out.").also { stage++ }
2 -> npcl(FacialExpression.FRIENDLY, "I'm just having a little drop of whisky, then I'll feel really good.").also { stage = END_DIALOGUE }
}
}
return true
}
override fun getIds(): IntArray = intArrayOf(NPCs.BRAVEK_711)
}

View file

@ -1,95 +0,0 @@
package content.region.kandarin.ardougne.plaguecity.quest.elena
import core.api.getQuestStage
import core.api.sendNPCDialogue
import core.api.setQuestStage
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.NPCs
import content.data.Quests
@Initializable
class ClerkDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
npcl(FacialExpression.NEUTRAL, "Hello, welcome to the Civic Office of West Ardougne. How can I help you?").also { stage = 0 }
return true
}
override fun handle(componentID: Int, buttonID: Int): Boolean {
when (getQuestStage(player!!, Quests.PLAGUE_CITY)) {
11 -> when (stage) {
0 -> options("Who is through that door?", "I'm just looking thanks.").also { stage++ }
1 -> when (buttonID) {
1 -> playerl(FacialExpression.FRIENDLY, "Who is through that door?").also { stage = 2 }
2 -> playerl(FacialExpression.FRIENDLY, "I'm just looking thanks.").also { stage = END_DIALOGUE }
}
2 -> npcl(FacialExpression.FRIENDLY, "The city warder Bravek is in there.").also { stage++ }
3 -> playerl(FacialExpression.FRIENDLY,"Can I go in?").also { stage++ }
4 -> npcl(FacialExpression.FRIENDLY, "He has asked not to be disturbed.").also { stage = END_DIALOGUE }
}
12 -> when (stage) {
0 -> options("I need permission to enter a plague house.", "Who is through that door?", "I'm just looking thanks.").also { stage++ }
1 -> when (buttonID) {
1 -> playerl(FacialExpression.FRIENDLY, "I need permission to enter a plague house.").also { stage = 2 }
2 -> playerl(FacialExpression.FRIENDLY, "Who is through that door?").also { stage = 12 }
3 -> playerl(FacialExpression.FRIENDLY, "I'm just looking thanks.").also { stage = END_DIALOGUE }
}
2 -> npcl(FacialExpression.FRIENDLY, "Rather you than me! The mourners usually deal with that stuff, you should speak to them. Their headquarters are right near the city gate.").also { stage++ }
3 -> options("I'll try asking them then.", "Surely you don't let them run everything for you?").also { stage++ }
4 -> when (buttonID) {
1 -> playerl(FacialExpression.HALF_GUILTY, "I'll try asking them then.").also { stage = END_DIALOGUE }
2 -> playerl(FacialExpression.HALF_GUILTY, "Surely you don't let them run everything for you?").also { stage = 5 }
}
5 -> npcl(FacialExpression.FRIENDLY, "Well, they do know what they're doing here. If they did start doing something badly Bravek, the city warder, would have the power to override them. I can't see that happening though.").also { stage++ }
6 -> options("I'll try asking them then.", "Can I speak to Bravek anyway?", "This is urgent though! Someone's been kidnapped!").also { stage++ }
7 -> when (buttonID) {
1 -> playerl(FacialExpression.HALF_GUILTY, "I'll try asking them then.").also { stage = END_DIALOGUE }
2 -> playerl(FacialExpression.HALF_GUILTY, "Can I speak to Bravek anyway?").also { stage = 8 }
3 -> playerl(FacialExpression.HALF_GUILTY, "This is urgent though! Someone's been kidnapped!").also { stage = 11 }
}
8 -> npcl(FacialExpression.FRIENDLY, "He has asked not to be disturbed.").also { stage++ }
9 -> options("This is urgent though! Someone's been kidnapped!", "Okay, I'll leave him alone.", "Do you know when he will be available?").also { stage++ }
10 -> when (buttonID) {
1 -> playerl(FacialExpression.HALF_GUILTY, "This is urgent though! Someone's been kidnapped!").also { stage = 11 }
2 -> playerl(FacialExpression.HALF_GUILTY, "Okay, I'll leave him alone.").also { stage = END_DIALOGUE }
3 -> playerl(FacialExpression.HALF_GUILTY, "Do you know when he will be available?").also { stage = 14 }
}
11 -> npcl(FacialExpression.HALF_GUILTY, "I'll see what I can do I suppose.").also { stage++ }
12 -> npcl(FacialExpression.HALF_GUILTY, "Mr Bravek, there's a man here who really needs to speak to you.").also { stage++ }
13 -> {
end()
setQuestStage(player!!, Quests.PLAGUE_CITY, 13)
sendNPCDialogue(player!!, NPCs.BRAVEK_711, "I suppose they can come in then. If they keep it short.").also { stage++ }
}
14 -> npcl(FacialExpression.HALF_GUILTY, "Oh I don't know, an hour or so maybe.").also { stage = END_DIALOGUE }
}
in 13..15 -> when (stage) {
0 -> npcl(FacialExpression.FRIENDLY, "Bravek will see you now but keep it short!").also { stage++ }
1 -> playerl(FacialExpression.FRIENDLY, "Thanks, I won't take much of his time.").also { stage = END_DIALOGUE }
}
in 16..100 -> when (stage) {
0 -> options("Who is through that door?", "I'm just looking thanks.").also { stage++ }
1 -> when (buttonID) {
1 -> playerl(FacialExpression.FRIENDLY, "Who is through that door?").also { stage = 2 }
2 -> playerl(FacialExpression.FRIENDLY, "I'm just looking thanks.").also { stage = END_DIALOGUE }
}
2 -> npcl(FacialExpression.FRIENDLY, "The city warder Bravek is in there.").also { stage++ }
3 -> playerl(FacialExpression.FRIENDLY,"Can I go in?").also { stage++ }
4 -> npcl(FacialExpression.FRIENDLY, "I suppose so.").also { stage = END_DIALOGUE }
}
}
return true
}
override fun getIds(): IntArray = intArrayOf(NPCs.CLERK_713)
}

View file

@ -1,168 +0,0 @@
package content.region.kandarin.ardougne.plaguecity.quest.elena
import core.api.*
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
import content.data.Quests
@Initializable
class EdmondDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if(inEquipmentOrInventory(player, Items.GAS_MASK_1506) && (player.questRepository.getStage(Quests.PLAGUE_CITY) == 2)) {
playerl(FacialExpression.FRIENDLY, "Hi Edmond, I've got the gas mask now.").also { stage++ }
} else if(player.questRepository.getStage(Quests.PLAGUE_CITY) > 2) {
playerl(FacialExpression.FRIENDLY, "Hello Edmond.").also { stage++ }
} else {
playerl(FacialExpression.FRIENDLY, "Hello old man.").also { stage++ }
}
return true
}
override fun handle(componentID: Int, buttonID: Int): Boolean {
when (getQuestStage(player!!, Quests.PLAGUE_CITY)) {
0 -> when (stage) {
1 -> npcl(FacialExpression.NEUTRAL, "Sorry, I can't stop to talk...").also { stage++ }
2 -> playerl(FacialExpression.FRIENDLY, "Why, what's wrong?").also { stage++ }
3 -> npcl(FacialExpression.FRIENDLY, "I've got to find my daughter. I pray that she is still alive...").also { stage++ }
4 -> options("What's happened to her?", "Well, good luck finding her.").also { stage++ }
5 -> when (buttonID) {
1 -> playerl(FacialExpression.FRIENDLY, "What's happened to her?").also { stage = 6 }
2 -> playerl(FacialExpression.FRIENDLY, "Well, good luck finding her.").also { stage = END_DIALOGUE }
}
6 -> npcl(FacialExpression.NEUTRAL, "Elena's a missionary and a healer. Three weeks ago she managed to cross the Ardougne wall...").also { stage++ }
7 -> npcl(FacialExpression.NEUTRAL, "No-one's allowed to cross the wall in case they spread the plague. But after hearing the screams of suffering she felt she had to help.").also { stage++ }
8 -> npcl(FacialExpression.NEUTRAL, "She said she'd be gone for a few days but we've heard nothing since.").also { stage++ }
9 -> options("Tell me more about the plague.", "Can I help find her?", "I'm sorry, I have to go.").also { stage++ }
10 -> when (buttonID) {
1 -> playerl(FacialExpression.FRIENDLY, "Tell me more about the plague.").also { stage = 12 }
2 -> playerl(FacialExpression.FRIENDLY, "Can I help find her?").also { stage = 13 }
3 -> playerl(FacialExpression.FRIENDLY, "I'm sorry, I have to go.").also { stage = END_DIALOGUE }
}
12 -> npcl(FacialExpression.FRIENDLY, "The mourners can tell you more than me. They're the only ones allowed to cross the border. I do know the plague is a horrible way to go... That's why Elena felt she had to go help.").also { stage = 9 }
13 -> npcl(FacialExpression.FRIENDLY, "Really, would you? I've been working on a plan to get into West Ardougne, but I'm too old and tired to carry it through.").also { stage++ }
14 -> npcl(FacialExpression.FRIENDLY, "If you're going into West Ardougne you'll need protection from the plague. My wife made a special gas mask for Elena with dwellberries rubbed into it.").also { stage++ }
15 -> npcl(FacialExpression.FRIENDLY, "Dwellberries help repel the virus! We need some more though...").also { stage++ }
16 -> playerl(FacialExpression.ASKING, "Where can I find these dwellberries?").also { stage++ }
17 -> npcl(FacialExpression.FRIENDLY, "The only place I know of is McGrubor's Wood just north of the Rangers' Guild.").also { stage++ }
18 -> playerl(FacialExpression.FRIENDLY, "Ok, I'll go and get some.").also { stage++ }
19 -> npcl(FacialExpression.NEUTRAL, "The foresters keep a close eye on it, but there is a back way in.").also { stage++ }
20 -> {
end()
setQuestStage(player!!, Quests.PLAGUE_CITY, 1)
}
}
1 -> when (stage) {
1 -> npcl(FacialExpression.NEUTRAL, "Have you got the dwellberries yet?").also { stage++ }
2 -> if (!inInventory(player, Items.DWELLBERRIES_2126)) {
playerl(FacialExpression.FRIENDLY, "Sorry, I'm afraid not.").also { stage = 3 }
} else {
playerl(FacialExpression.FRIENDLY, "Yes I've got some here.").also { stage = 6 }
}
3 -> npcl(FacialExpression.NEUTRAL, "You'll probably find them in McGrubor's Wood it's just west of Seers village.").also { stage++ }
4 -> playerl(FacialExpression.NEUTRAL, "Ok, I'll go and get some.").also { stage++ }
5 -> npcl(FacialExpression.NEUTRAL, "The foresters keep a close eye on it, but there is a back way in.").also { stage = END_DIALOGUE }
6 -> npcl(FacialExpression.NEUTRAL, "Take them to my wife Alrena, she's inside.").also { stage = END_DIALOGUE }
}
2 -> when (stage) {
1 -> npcl(FacialExpression.NEUTRAL, "Good stuff, now for the digging. Beneath us are the Ardougne sewers, there you'll find the access to West Ardougne.").also { stage++ }
2 -> npcl(FacialExpression.NEUTRAL, "The problem is the soil is rock hard. You'll need to pour on several buckets of water to soften it up. I'll keep an eye out for the mourners.").also { stage++ }
3 -> {
end()
setQuestStage(player!!, Quests.PLAGUE_CITY, 3)
}
}
3 -> when (stage) {
1 -> if (player!!.getAttribute("/save:elena:dig", false) == true) {
playerl(FacialExpression.NEUTRAL, "I've soaked the soil with water.").also { stage = 3 }
} else {
npcl(FacialExpression.FRIENDLY, "How's it going?").also { stage = 2 }
}
2 -> if (player.getAttribute(PlagueCityListeners.BUCKET_USES_ATTRIBUTE, 0) == 1) {
playerl(FacialExpression.NEUTRAL, "I still need to pour three more buckets of water on the soil.").also { stage = END_DIALOGUE }
} else if (player.getAttribute(PlagueCityListeners.BUCKET_USES_ATTRIBUTE, 0) == 2){
playerl(FacialExpression.NEUTRAL, "I still need to pour two more buckets of water on the soil.").also { stage = END_DIALOGUE }
} else if (player.getAttribute(PlagueCityListeners.BUCKET_USES_ATTRIBUTE, 0) == 3) {
playerl(FacialExpression.NEUTRAL, "I still need to pour one more bucket of water on the soil.").also { stage = END_DIALOGUE }
}
3 -> npcl(FacialExpression.FRIENDLY, "That's great, it should be soft enough to dig through now.").also { stage = END_DIALOGUE }
}
4 -> when (stage) {
1 -> npcl(FacialExpression.FRIENDLY, "I think it's the pipe to the south that comes up in West Ardougne.").also { stage++ }
2 -> playerl(FacialExpression.NEUTRAL, "Alright I'll check it out.").also { stage++ }
3 -> npcl(FacialExpression.NEUTRAL, "Once you're in the city look for a man called Jethick, he's an old friend and should help you. Send him my regards, I haven't seen him since before Elena was born.").also { stage++ }
4 -> playerl(FacialExpression.NEUTRAL, "Alright, thanks I will.").also { stage = END_DIALOGUE }
}
5 -> when (stage) {
1 -> playerl(FacialExpression.NEUTRAL, "Edmond, I can't get through to West Ardougne! There's an iron grill blocking my way, I can't pull it off alone.").also { stage++ }
2 -> npcl(FacialExpression.NEUTRAL, "If you get some rope you could tie to the grill, then we could both pull it at the same time.").also { stage = END_DIALOGUE }
}
6 -> when (stage) {
1 -> playerl(FacialExpression.NEUTRAL, "I've tied a rope to the grill over there, will you help me pull it off?").also { stage++ }
2 -> npcl(FacialExpression.NEUTRAL, "Alright, let's get to it...").also { stage++ }
3 -> {
end()
UndergroundCutscene(player!!).start()
}
}
7 -> when (stage) {
1 -> npcl(FacialExpression.NEUTRAL, "Have you found Elena yet?").also { stage++ }
2 -> playerl(FacialExpression.NEUTRAL, "Not yet, it's a big city over there.").also { stage++ }
3 -> npcl(FacialExpression.FRIENDLY, "Don't forget to look for my friend Jethick. He may be able to help.").also { stage = END_DIALOGUE }
}
8 -> when (stage) {
1 -> npcl(FacialExpression.NEUTRAL, "Have you found Elena yet?").also { stage++ }
2 -> playerl(FacialExpression.NEUTRAL, "Not yet, it's a big city over there. Do you have a picture of Elena?").also { stage++ }
3 -> npcl(FacialExpression.FRIENDLY, "There should be a picture of Elena in the house. Please find her quickly, I hope it's not too late.").also { stage = END_DIALOGUE }
}
99 -> when (stage) {
1 -> npcl(FacialExpression.NEUTRAL, "Thank you, thank you! Elena beat you back by minutes.").also { stage++ }
2 -> npcl(FacialExpression.NEUTRAL, "Now I said I'd give you a reward. What can I give you as a reward I wonder?").also { stage++ }
3 -> npcl(FacialExpression.NEUTRAL, "Here take this magic scroll, I have little use for it but it may help you.").also { stage++ }
4 -> {
end()
player!!.questRepository.getQuest(Quests.PLAGUE_CITY).finish(player)
}
}
100 -> when (stage) {
1 -> if (!inInventory(player!!, Items.ARDOUGNE_TELEPORT_8011)) {
npcl(FacialExpression.FRIENDLY, "Ah hello again, and thank you again for rescuing my daughter.").also { stage = 2 }
} else {
npcl(FacialExpression.FRIENDLY, "Ah hello again, and thank you again for rescuing my daughter.").also { stage = 5 }
}
2 -> options("Do you have any more of those scrolls?", "No problem.").also { stage++ }
3 -> when (buttonID) {
1 -> playerl(FacialExpression.NEUTRAL, "Do you have any more of those scrolls?").also { stage = 4 }
2 -> playerl(FacialExpression.NEUTRAL, "No problem.").also { stage = END_DIALOGUE }
}
4 -> npcl(FacialExpression.FRIENDLY, "Here take this magic scroll, I have little use for it but it may help you.").also { stage = 6 }
5 -> playerl(FacialExpression.NEUTRAL, "No problem.").also { stage = END_DIALOGUE }
6 -> {
end()
addItemOrDrop(player!!, Items.A_MAGIC_SCROLL_1505)
}
}
}
return true
}
override fun getIds(): IntArray = intArrayOf(NPCs.EDMOND_714)
}

View file

@ -1,87 +0,0 @@
package content.region.kandarin.ardougne.plaguecity.quest.elena
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.game.global.action.DoorActionHandler
import core.game.node.entity.npc.NPC
import core.game.world.map.RegionManager.getObject
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.NPCs
import content.data.Quests
@Initializable
class MournerDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
npc = NPC(NPCs.MOURNER_3216)
when (getQuestStage(player!!, Quests.PLAGUE_CITY)) {
in 0..6 -> when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello.").also { stage++ }
1 -> npcl(FacialExpression.NEUTRAL, "What are you up to with old man Edmond?").also { stage++ }
2 -> playerl(FacialExpression.FRIENDLY, "Nothing, we've just been chatting.").also { stage++ }
3 -> npcl(FacialExpression.NEUTRAL, "What about his daughter?").also { stage++ }
4 -> playerl(FacialExpression.FRIENDLY, "you know about that then?").also { stage++ }
5 -> npcl(FacialExpression.NEUTRAL, "We know about everything that goes on in Ardougne. We have to if we are to contain the plague.").also { stage++ }
6 -> playerl(FacialExpression.FRIENDLY, "Have you see his daughter recently?").also { stage++ }
7 -> npcl(FacialExpression.NEUTRAL, "I imagine she's caught the plague. Either way she won't be allowed out of West Ardougne, the risk is too great.").also { stage == END_DIALOGUE }
}
7 -> when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello there.").also { stage++ }
1 -> npcl(FacialExpression.NEUTRAL, "Been digging have we?").also { stage++ }
2 -> playerl(FacialExpression.FRIENDLY, "What do you mean?").also { stage++ }
3 -> npcl(FacialExpression.NEUTRAL, "Your hands are covered in mud.Player: Oh that...").also { stage++ }
4 -> npcl(FacialExpression.NEUTRAL, "Funny, you don't look like the gardening type.").also { stage++ }
5 -> playerl(FacialExpression.FRIENDLY, "Oh no, I love gardening! It's my favorite pastime.").also { stage = END_DIALOGUE }
}
8 -> when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello there.").also { stage++ }
1 -> npcl(FacialExpression.NEUTRAL, "Do you have a problem traveller?").also { stage++ }
2 -> playerl(FacialExpression.NEUTRAL, "No, I just wondered why you're wearing that outfit... Is it fancy dress?").also { stage++ }
3 -> npcl(FacialExpression.NEUTRAL, "No! It's for protection.").also { stage++ }
4 -> playerl(FacialExpression.NEUTRAL, "Protection from what?").also { stage++ }
5 -> npcl(FacialExpression.FRIENDLY, "The plague of course...").also { stage = END_DIALOGUE }
}
in 9..15 -> when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello there.").also { stage++ }
1 -> npcl(FacialExpression.NEUTRAL, "Can I help you?").also { stage++ }
2 -> playerl(FacialExpression.NEUTRAL, "What are you doing?").also { stage++ }
3 -> npcl(FacialExpression.NEUTRAL, "I'm guarding the border to West Ardougne. No-one except we mourners can pass through.").also { stage++ }
4 -> playerl(FacialExpression.NEUTRAL, "Why?").also { stage++ }
5 -> npcl(FacialExpression.FRIENDLY, "The plague of course. We can't risk cross contamination.").also { stage++ }
6 -> playerl(FacialExpression.FRIENDLY, "Ok then, see you around.").also { stage++ }
7 -> npcl(FacialExpression.FRIENDLY, "Maybe...").also { stage = END_DIALOGUE }
}
16 -> when (stage) {
0 -> if (inBorders(player!!, 2532, 3272, 2534, 3273)) {
player!!.dialogueInterpreter.sendDialogue("The door won't open.", "You notice a black cross on the door.").also { stage = END_DIALOGUE }
} else {
playerl(FacialExpression.FRIENDLY, "Hello there.").also { stage++ }
}
1 -> playerl(FacialExpression.FRIENDLY, "I have a warrant from Bravek to enter here.").also { stage++ }
2 -> npcl(FacialExpression.NEUTRAL, "This is highly irregular. Please wait...").also { stage++ }
3 -> {
runTask(player!!, 0) {
findLocalNPC(player!!, NPCs.MOURNER_717)!!.sendChat("Hay... I got someone here with a warrant from Bravek, what should we do?")
findLocalNPC(player!!, NPCs.MOURNER_3216)!!.sendChat("Well you can't let them in...", 1)
}.also {
end()
setQuestStage(player!!, Quests.PLAGUE_CITY, 17)
DoorActionHandler.handleAutowalkDoor(player, getObject(location(2540, 3273, 0))!!.asScenery())
sendDialogue(player!!, "You wait until the mourner's back is turned and sneak into the building.")
}
}
}
in 17..100 -> when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello there.").also { stage++ }
1 -> npcl(FacialExpression.FRIENDLY, "I'd stand away from there. That black cross means that house has been touched by the plague.").also { stage = END_DIALOGUE }
}
}
}
}

View file

@ -1,457 +0,0 @@
package content.region.kandarin.ardougne.plaguecity.quest.elena
import content.region.kandarin.ardougne.plaguecity.dialogue.ManDialogue
import content.region.kandarin.ardougne.plaguecity.dialogue.WomanDialogue
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.game.global.action.DoorActionHandler
import core.game.interaction.IntType
import core.game.interaction.InteractionListener
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.game.system.task.Pulse
import core.game.world.map.Direction
import core.game.world.map.Location
import core.tools.END_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
import org.rs09.consts.Scenery
import content.data.Quests
class PlagueCityListeners : InteractionListener {
companion object {
const val BUCKET_USES_ATTRIBUTE = "/save:elena:bucket"
const val BRAVEK = NPCs.BRAVEK_711
const val HEAD_MOURNER = NPCs.HEAD_MOURNER_716
const val BILLI = 723
val MANS = intArrayOf(NPCs.MAN_728,NPCs.MAN_729, NPCs.MAN_351)
val WOMANS = intArrayOf(NPCs.WOMAN_352, NPCs.WOMAN_353, NPCs.WOMAN_354, NPCs.WOMAN_360, NPCs.WOMAN_362, NPCs.WOMAN_363)
const val MUD_PILE = Scenery.MUD_PILE_2533
const val GRILL = Scenery.GRILL_11423
const val MUD_PATCH = Scenery.MUD_PATCH_11418
const val PIPE = Scenery.PIPE_2542
const val WARDROBE = Scenery.WARDROBE_2525
const val LEFT_DOOR = Scenery.ARDOUGNE_WALL_DOOR_9738
const val RIGHT_DOOR = Scenery.ARDOUGNE_WALL_DOOR_9330
const val PLAGUE_TED_DOORS = Scenery.DOOR_2537
const val HEAD_DOORS = Scenery.DOOR_35991
const val BARREL = Scenery.BARREL_2530
const val SPOOKY_STAIRS_DOWN = Scenery.SPOOKY_STAIRS_2522
const val SPOOKY_STAIRS_UP = Scenery.SPOOKY_STAIRS_2523
const val PRISON_DOORS = Scenery.DOOR_2526
const val BRAVEK_DOORS = Scenery.DOOR_2528
const val MANHOLE_CLOSED = Scenery.MANHOLE_2543
const val MANHOLE_OPEN = Scenery.MANHOLE_2544
const val MANHOLE_COVER = Scenery.MANHOLE_COVER_2545
private const val SNAPE_GRASS = Items.SNAPE_GRASS_231
private const val SPADE = Items.SPADE_952
private const val ROPE = Items.ROPE_954
private const val HANGOVER_CURE = Items.HANGOVER_CURE_1504
private const val MAGIC_SCROLL = Items.A_MAGIC_SCROLL_1505
private const val GAS_MASK = Items.GAS_MASK_1506
private const val SMALL_KEY = Items.A_SMALL_KEY_1507
private const val SCRUFFY_NOTE = Items.A_SCRUFFY_NOTE_1508
private const val BOOK = Items.BOOK_1509
private const val EMPTY_BUCKET = Items.BUCKET_1925
private const val BUCKET_OF_MILK = Items.BUCKET_OF_MILK_1927
private const val BUCKET_OF_WATER = Items.BUCKET_OF_WATER_1929
private const val CHOCOLATE_DUST = Items.CHOCOLATE_DUST_1975
private const val CHOCOLATE_MILK = Items.CHOCOLATEY_MILK_1977
private const val TRYING_TO_OPEN_GRILL = 3192
private const val POUR_THE_WATER = 2283
private const val CLIMB_LADDER = 828
private const val GO_INTO_PIPE = 10580
private const val TIE_THE_ROPE = 3191
private const val DIG_WITH_SPADE = 830
}
override fun defineListeners() {
on(BILLI, IntType.NPC, "talk-to") { player, _ ->
sendMessage(player, "Billy isn't interested in talking.")
return@on true
}
on(HEAD_MOURNER, IntType.NPC, "talk-to") { player, _ ->
openDialogue(player, HeadMournerDialogue())
return@on true
}
on(MANS, IntType.NPC, "talk-to") { player, _ ->
if(inBorders(player, 2496, 3280,2557, 3336)) {
openDialogue(player, ManDialogue())
}
return@on true
}
on(WOMANS, IntType.NPC, "talk-to") { player, _ ->
if(inBorders(player, 2496, 3280,2557, 3336)) {
openDialogue(player, WomanDialogue())
}
return@on true
}
on(LEFT_DOOR, IntType.SCENERY, "open") { player, node ->
if (player.questRepository.getQuest(Quests.PLAGUE_CITY).isCompleted(player)) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
} else if(inBorders(player, 2556, 3298, 2557, 3301)){
lock(player,2)
sendMessage(player, "You pull on the large wooden doors...")
runTask(player,2){
sendMessage(player, "...But they will not open.")
}
} else {
face(player, Location.create(2559, 3302, 0))
sendNPCDialogue(player, NPCs.MOURNER_2349, "Oi! What are you doing? Get away from there!")
}
return@on true
}
on(RIGHT_DOOR, IntType.SCENERY, "open") { player, node ->
if (player.questRepository.getQuest(Quests.PLAGUE_CITY).isCompleted(player)) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
} else if(inBorders(player, 2556, 3298, 2557, 3301)){
lock(player,2)
sendMessage(player, "You pull on the large wooden doors...")
runTask(player,2){
sendMessage(player, "...But they will not open.")
}
} else {
face(player, Location.create(2559, 3302, 0))
sendNPCDialogue(player, NPCs.MOURNER_2349, "Oi! What are you doing? Get away from there!")
}
return@on true
}
on(MANHOLE_CLOSED, IntType.SCENERY, "open") { player, node ->
replaceScenery(node.asScenery(), MANHOLE_OPEN, -1)
addScenery(MANHOLE_COVER, Location(2529, 3302, 0),0,10)
sendMessage(player, "You pull back the manhole cover.")
return@on true
}
on(MANHOLE_COVER, IntType.SCENERY, "close") { player, node ->
removeScenery(node.asScenery())
getScenery(location(2529, 3303, 0))?.let { replaceScenery(it, MANHOLE_CLOSED, -1) }
sendMessage(player, "You close the manhole cover.")
return@on true
}
on(MANHOLE_OPEN, IntType.SCENERY, "climb-down") { player, _ ->
teleport(player, Location(2514, 9739, 0))
sendMessage(player, "You climb down through the manhole.")
return@on true
}
on(BRAVEK_DOORS, IntType.SCENERY, "open") { player, node ->
if (player.questRepository.getStage(Quests.PLAGUE_CITY) >= 13) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
} else {
sendNPCDialogue(player,BRAVEK,"Go away, I'm busy! I'm... Umm... In a meeting!")
}
return@on true
}
on(MUD_PILE, IntType.SCENERY, "climb") { player, _ ->
animate(player, CLIMB_LADDER)
runTask(player, 2){
teleport(player, Location(2566, 3332))
sendDialogue(player, "You climb up the mud pile.")
}
return@on true
}
on(MAGIC_SCROLL, IntType.ITEM, "read") { player, _ ->
sendItemDialogue(player, MAGIC_SCROLL, "You memorise what is written on the scroll.")
removeItem(player, MAGIC_SCROLL)
sendDialogue(player, "You can now cast the Ardougne Teleport spell provided you have the required runes and magic level.")
return@on true
}
on(SCRUFFY_NOTE, IntType.ITEM, "read") { player, _ ->
sendMessage(player, "You guess it really says something slightly different.")
openInterface(player, 222).also { scruffyNote(player) }
return@on true
}
on(HEAD_DOORS, IntType.SCENERY, "open") { player, node ->
if (player.questRepository.getStage(Quests.PLAGUE_CITY) == 11) {
openDialogue(player, HeadMournerDialogue())
} else if (player.questRepository.getStage(Quests.PLAGUE_CITY) == 16) {
openDialogue(player, MournerDialogue())
} else if (player.questRepository.getStage(Quests.PLAGUE_CITY) > 16) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
} else {
openDialogue(player, MournerDialogue())
}
return@on true
}
on(WARDROBE, IntType.SCENERY, "search") { player, _ ->
if (freeSlots(player) == 0 && !inEquipmentOrInventory(player, GAS_MASK)) {
sendItemDialogue(player, GAS_MASK, "You find a protective mask but you don't have enough room to take it.")
} else if (inEquipmentOrInventory(player, GAS_MASK)) {
sendMessage(player, "You search the wardrobe but you find nothing.")
} else if (player.questRepository.getStage(Quests.PLAGUE_CITY) >= 2) {
sendItemDialogue(player, GAS_MASK, "You find a protective mask.")
addItem(player, GAS_MASK)
}
return@on true
}
onUseWith(IntType.SCENERY, BUCKET_OF_WATER, MUD_PATCH) { player, _, _ ->
if (player.getAttribute(BUCKET_USES_ATTRIBUTE, 0) in 0..2 && removeItem(player, BUCKET_OF_WATER)) {
animate(player, POUR_THE_WATER)
player.dialogueInterpreter.sendDialogue(
"You pour water onto the soil.",
"The soil softens slightly."
)
player.incrementAttribute(BUCKET_USES_ATTRIBUTE, 1)
addItem(player, EMPTY_BUCKET)
return@onUseWith true
} else if (player.getAttribute(BUCKET_USES_ATTRIBUTE, 0) == 3 && removeItem(player, BUCKET_OF_WATER)) {
animate(player, POUR_THE_WATER)
player.dialogueInterpreter.sendDialogue(
"You pour water onto the soil.",
"The soil is now soft enough to dig into."
)
player.setAttribute("/save:elena:dig", true)
addItem(player, EMPTY_BUCKET)
} else {
sendMessage(player, "Nothing interesting happens.")
}
return@onUseWith true
}
onUseWith(IntType.SCENERY, SPADE, MUD_PATCH) { player, _, _ ->
if (player.getAttribute("/save:elena:dig", false) == true) {
player.pulseManager.run(object : Pulse() {
var counter = 0
override fun pulse(): Boolean {
when (counter++) {
0 -> sendItemDialogue(player, SPADE,"You dig deep into the soft soil... Suddenly it crumbles away!")
1 -> animate(player, DIG_WITH_SPADE)
3 -> {
teleport(player, Location(2518, 9759))
setQuestStage(player, Quests.PLAGUE_CITY, 4)
player.dialogueInterpreter.sendDialogue(
"You fall through...",
"...you land in the sewer.",
"Edmond follows you down the hole."
)
return true
}
}
return false
}
})
} else {
sendMessage(player, "Nothing interesting happens.")
}
return@onUseWith true
}
on(GRILL, IntType.SCENERY, "open") { player, _ ->
if (player.questRepository.getStage(Quests.PLAGUE_CITY) == 4) {
sendDialogue(player, "The grill is too secure. You can't pull it off alone.")
animate(player, TRYING_TO_OPEN_GRILL)
setQuestStage(player, Quests.PLAGUE_CITY, 5)
} else {
sendDialogue(player, "There is a grill blocking your way")
}
return@on true
}
on(PIPE, IntType.SCENERY, "climb-up") { player, _ ->
if (player.questRepository.getStage(Quests.PLAGUE_CITY) >= 7 && inEquipment(player, GAS_MASK)) {
animate(player, GO_INTO_PIPE,true)
forceMove(player, Location(2514, 9739, 0), Location(2514, 9734, 0), 0, 4,Direction.SOUTH)
runTask(player, 3) {
teleport(player, Location(2529, 3304, 0))
sendDialogue(player, "You climb up through the sewer pipe.")
}
} else if (player.questRepository.getStage(Quests.PLAGUE_CITY) >= 7 && !inEquipment(player, GAS_MASK)) {
sendNPCDialogue(player, NPCs.EDMOND_714, "I can't let you enter the city without your gasmask on.")
} else {
sendDialogue(player, "There is a grill blocking your way")
}
return@on true
}
onUseWith(IntType.SCENERY, ROPE, PIPE) { player, _, _ ->
sendPlayerDialogue(player, "Maybe I should try opening it first.")
return@onUseWith true
}
onUseWith(IntType.SCENERY, ROPE, GRILL) { player, _, _ ->
if(removeItem(player, ROPE)) {
player.pulseManager.run(object : Pulse() {
var counter = 0
override fun pulse(): Boolean {
when (counter++) {
0 -> forceWalk(player, Location.create(2514, 9740, 0), "SMART")
2 -> face(player, Location.create(2514, 9739, 0), -1)
3 -> {
animate(player, TIE_THE_ROPE)
setVarbit(player, 1787, 5, true) // Tied rope to the grill.
}
4 -> {
setQuestStage(player, Quests.PLAGUE_CITY, 6)
sendItemDialogue(player, ROPE, "You tie the end of the rope to the sewer pipe's grill.")
}
}
return false
}
})
} else {
sendMessage(player, "Nothing interesting happens.")
}
return@onUseWith true
}
class TedRehnisonDoors : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
npc = NPC(NPCs.TED_REHNISON_721)
when (stage) {
0 -> if(removeItem(player!!, BOOK)){
playerl(FacialExpression.NEUTRAL, "I'm a friend of Jethick's, I have come to return a book he borrowed.").also { stage++ }
} else {
npcl(FacialExpression.FRIENDLY, "Go away. We don't want any.").also { stage = END_DIALOGUE }
}
1 -> npcl(FacialExpression.FRIENDLY, "Oh... why didn't you say, come in then.").also { stage++ }
2 -> sendItemDialogue(player!!, BOOK, "You hand the book to Ted as you enter.").also { stage++ }
3 -> npcl(FacialExpression.NEUTRAL, "Thanks, I've been missing that.").also { stage++ }
4 -> {
end()
DoorActionHandler.handleAutowalkDoor(player, getScenery(2531, 3328, 0))
setQuestStage(player!!, Quests.PLAGUE_CITY, 9)
}
}
}
}
on(PLAGUE_TED_DOORS, IntType.SCENERY, "open") { player, node ->
if (player.questRepository.getStage(Quests.PLAGUE_CITY) >= 9) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
} else {
openDialogue(player, TedRehnisonDoors())
}
return@on true
}
on(BARREL, IntType.SCENERY, "search") { player, _ ->
if (inInventory(player, SMALL_KEY)) {
sendMessage(player, "You don't find anything interesting.")
return@on true
} else {
sendItemDialogue(player, SMALL_KEY, "You find a small key in the barrel.")
addItem(player, SMALL_KEY)
}
}
onUseWith(IntType.ITEM, CHOCOLATE_DUST, BUCKET_OF_MILK) { player, _, _ ->
if (player.questRepository.hasStarted(Quests.PLAGUE_CITY) && removeItem(player, CHOCOLATE_DUST) && removeItem(player, BUCKET_OF_MILK)) {
sendItemDialogue(player, CHOCOLATE_MILK, "You mix the chocolate into the bucket.")
addItem(player, CHOCOLATE_MILK)
} else {
sendMessage(player, "Nothing interesting happens.")
}
return@onUseWith true
}
onUseWith(IntType.ITEM, SNAPE_GRASS, CHOCOLATE_MILK) { player, _, _ ->
if (player.questRepository.hasStarted(Quests.PLAGUE_CITY) && removeItem(player, SNAPE_GRASS) && removeItem(player, CHOCOLATE_MILK)) {
sendItemDialogue(player, HANGOVER_CURE, "You mix the snape grass into the bucket.")
addItem(player, HANGOVER_CURE)
} else {
sendMessage(player, "Nothing interesting happens.")
}
return@onUseWith true
}
on(SPOOKY_STAIRS_DOWN, IntType.SCENERY, "walk-down") { player, _ ->
sendMessage(player, "You walk down the stairs...")
teleport(player, Location.create(2537, 9671))
return@on true
}
on(SPOOKY_STAIRS_UP, IntType.SCENERY, "walk-up") { player, _ ->
teleport(player, Location.create(2536, 3271, 0))
sendMessage(player, "You walk up the stairs...")
return@on true
}
class ElenaDoorDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
npc = NPC(NPCs.ELENA_3215)
when (stage) {
0 -> sendDialogue(player!!, "The door is locked.").also { stage++ }
1 -> npcl(FacialExpression.CRYING, "Hey get me out of here please!").also { stage++ }
2 -> playerl(FacialExpression.FRIENDLY, "I would do but I don't have a key.").also { stage++ }
3 -> npcl(FacialExpression.SAD, "I think there may be one around somewhere. I'm sure I heard them stashing it somewhere.").also { stage++ }
4 -> options("Have you caught the plague?", "Okay, I'll look for it.").also { stage++ }
5 -> when (buttonID) {
1 -> playerl(FacialExpression.FRIENDLY, "Have you caught the plague?").also { stage = 6 }
2 -> playerl(FacialExpression.FRIENDLY, "Okay, I'll look for it.").also { stage = END_DIALOGUE }
}
6 -> npcl(FacialExpression.HALF_WORRIED, "No, I have none of the symptoms.").also { stage++ }
7 -> playerl(FacialExpression.THINKING, "Strange, I was told this house was plague infected.").also { stage++ }
8 -> playerl(FacialExpression.THINKING, "I suppose that was a cover up by the kidnappers.").also { stage = 4 }
}
}
}
onUseWith(IntType.SCENERY, SMALL_KEY, PRISON_DOORS) { player, _, _ ->
if (player.questRepository.getStage(Quests.PLAGUE_CITY) >= 16) {
DoorActionHandler.handleAutowalkDoor(player, core.game.world.map.RegionManager.getObject(Location(2539, 9672, 0))!!.asScenery())
sendDialogue(player, "You unlock the door.")
} else {
sendMessage(player, "Nothing interesting happens.")
}
return@onUseWith true
}
on(PRISON_DOORS, IntType.SCENERY, "open") { player, node ->
if (player.questRepository.getStage(Quests.PLAGUE_CITY) >= 99) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
} else {
openDialogue(player, ElenaDoorDialogue())
}
return@on true
}
}
private fun scruffyNote(player: Player) {
val scruffynotes =
arrayOf(
"Got a bncket of nnilk",
"Tlen grind sorne lhoculate",
"vnith a pestal and rnortar",
"ald the grourd dlocolate to tho milt",
"finales add 5cme snape gras5",
)
setInterfaceText(player, scruffynotes.joinToString("<br>"), 222, 5)
}
override fun defineDestinationOverrides() {
setDest(IntType.SCENERY, intArrayOf(GRILL), "open") { _, _ ->
return@setDest Location.create(2514, 9739, 0)
}
setDest(IntType.SCENERY, intArrayOf(PIPE), "climb-up") { _, _ ->
return@setDest Location.create(2514, 9739, 0)
}
setDest(IntType.SCENERY, intArrayOf(MANHOLE_OPEN), "climb-down") { _, _ ->
return@setDest Location.create(2529, 3304, 0)
}
}
}

View file

@ -0,0 +1,51 @@
package content.region.kandarin.ardougne.quest.biohazard.dialogue
import content.data.Quests
import core.api.getQuestStage
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.dialogue.Topic
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.NPCs
@Initializable
class KilronDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
playerl(FacialExpression.FRIENDLY, "Hello there.")
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
if (getQuestStage(player, Quests.BIOHAZARD) > 0){
when(stage){
0 -> playerl(FacialExpression.FRIENDLY, "Hello Kilron.").also { stage++ }
1 -> npcl(FacialExpression.FRIENDLY, "Hello traveller. Do you need to go back over?").also { stage++ }
2 -> showTopics(
Topic("Not yet Kilron.", 4),
Topic("Yes I do.", 5)
)
4 -> npcl(FacialExpression.FRIENDLY, "Okay, just give me the word.").also { stage = END_DIALOGUE }
5 -> npcl(FacialExpression.FRIENDLY, "Okay, quickly now!").also { stage = END_DIALOGUE }
}
}
else {
when (stage) {
0 -> npcl(FacialExpression.FRIENDLY, "Hello.").also { stage++ }
1 -> playerl(FacialExpression.FRIENDLY, "How are you?").also { stage++ }
2 -> npcl(FacialExpression.FRIENDLY, "Busy.").also { stage = END_DIALOGUE }
}
}
return true
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.KILRON_349)
}
}

View file

@ -0,0 +1,149 @@
package content.region.kandarin.ardougne.quest.biohazard.dialogue
import core.api.*
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.dialogue.Topic
import core.game.interaction.QueueStrength
import core.game.node.entity.Entity
import core.game.node.entity.npc.AbstractNPC
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.game.world.map.Location
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import core.tools.START_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
/**
* For some reason the level 13 mourner upstairs is called the boss
* And despite the fact that other NPCs say there's one sick person upstairs they're 2 up there.
*
* We should be using key 423 but that got incorrectly used for Lost Tribe
*/
@Initializable
class MournerBossDialogue(player: Player? = null) : DialoguePlugin(player) {
companion object{
const val HOLD_BREATH = 10
const val PRAY = 20
const val FATAL = 30
const val HAVE_KEY = 40
}
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if (inEquipment(player!!, Items.DOCTORS_GOWN_430)){
playerl(FacialExpression.FRIENDLY, "Hello there.").also { stage = if (hasAnItem(player!!, Items.KEY_5010).exists()) HAVE_KEY else START_DIALOGUE + 1 }
return true
}
else {
sendDialogue("The mourner doesn't feel like talking.").also { stage = END_DIALOGUE }
return false
}
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when(stage){
START_DIALOGUE + 1 -> npcl(FacialExpression.ASKING, "A doctor? At last! I don't know what I've eaten but I feel like I'm on death's door.").also { stage++ }
START_DIALOGUE + 2 -> playerl(FacialExpression.NEUTRAL, "Hmm... interesting, sounds like food poisoning.").also { stage++ }
// Jagex didn't include a question mark here
START_DIALOGUE + 3 -> npcl(FacialExpression.ASKING, "Yes, I'd figured that out already. What can you give me to help.").also { stage++ }
START_DIALOGUE + 4 -> showTopics(
Topic("Just hold your breath and count to ten.", HOLD_BREATH),
Topic("The best I can do is pray for you.", PRAY),
Topic("There's nothing I can do, it's fatal.", FATAL)
)
HOLD_BREATH -> npcl(FacialExpression.SUSPICIOUS, "What? How will that help? What kind of doctor are you?").also { stage++ }
HOLD_BREATH + 1 -> player(FacialExpression.HALF_GUILTY, "Erm... I'm new, I just started.").also { stage++ }
HOLD_BREATH + 2 -> npcl(FacialExpression.ANGRY, "You're no doctor!").also {
stage = END_DIALOGUE
fight(player)
}
PRAY -> npcl(FacialExpression.ANGRY, "Pray for me? You're no doctor... You're an imposter!").also {
stage = END_DIALOGUE
fight(player)
}
FATAL -> npcl(FacialExpression.PANICKED, "No, I'm too young to die! I've never even had a girlfriend.").also { stage++ }
FATAL + 1 -> playerl(FacialExpression.SAD, "That's life for you.").also { stage++ }
FATAL + 2 -> npcl(FacialExpression.ASKING, "Wait a minute, where's your equipment?").also { stage++ }
FATAL + 3 -> playerl(FacialExpression.HALF_GUILTY, "It's erm... at home.").also { stage++ }
FATAL + 4 -> npcl(FacialExpression.ANGRY, "You're no doctor!").also {
stage = END_DIALOGUE
fight(player)
}
HAVE_KEY -> npcl(FacialExpression.NEUTRAL, "Sorry, I'd like to be left in peace.").also { stage = END_DIALOGUE }
}
return true
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.MOURNER_370)
}
private fun fight(player: Player){
queueScript(player) { stage: Int ->
if (stage == 1){
npc.attack(player)
return@queueScript stopExecuting(player)
}
return@queueScript delayScript(player, 1)
}
}
}
/**
* Handles the key drop from the mourner boss
*/
@Initializable
class MournerBossNPC : AbstractNPC {
var target: Player? = null
private val supportRange: Int = 5
//Constructor spaghetti because Arios I guess
constructor() : super(NPCs.MOURNER_370, null, true) {}
private constructor(id: Int, location: Location) : super(id, location) {}
override fun construct(id: Int, location: Location, vararg objects: Any): AbstractNPC {
return MournerBossNPC(id, location)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.MOURNER_370)
}
override fun finalizeDeath(killer: Entity?) {
val p = killer as Player
if (!hasAnItem(p, Items.KEY_5010).exists()){
queueScript(p, 1, QueueStrength.NORMAL){ stage: Int ->
when(stage){
0 -> {
sendMessage(p, "You search the mourner...")
}
2 ->{
sendMessage(p, "and find a key.")
// If the player doesn't have space bad luck
// They can kill another mourner boss
// todo change this key and fix lost tribe key at the same time
// It should be 423 here and 5010 over there
// addItemOrDrop(p, Items.KEY_5010)
return@queueScript stopExecuting(p)
}
}
return@queueScript delayScript(p, 1)
}
}
super.finalizeDeath(killer)
}
}

View file

@ -1,5 +1,6 @@
package content.region.kandarin.ardougne.plaguecity.quest.elena
package content.region.kandarin.ardougne.quest.plaguecity
import content.data.Quests
import core.api.addItemOrDrop
import core.api.removeAttributes
import core.api.rewardXP
@ -8,7 +9,6 @@ import core.game.node.entity.player.link.quest.Quest
import core.game.node.entity.skill.Skills
import core.plugin.Initializable
import org.rs09.consts.Items
import content.data.Quests
@Initializable
class PlagueCity : Quest(Quests.PLAGUE_CITY, 98, 97, 1, 165, 0, 1, 29) {
@ -35,7 +35,7 @@ class PlagueCity : Quest(Quests.PLAGUE_CITY, 98, 97, 1, 165, 0, 1, 29) {
if (stage >= 2) {
line++
line(player, "Alrena has given me a Gasmask to protect me", line++, stage >= 3)
line(player, "Alrena has given me a gas mask to protect me", line++, stage >= 3)
line(player, "from the plague while in West Ardougne.", line++, stage >= 3)
line++
}

View file

@ -0,0 +1,430 @@
package content.region.kandarin.ardougne.quest.plaguecity
import content.data.Quests
import content.region.kandarin.ardougne.quest.plaguecity.dialogue.mourners.MournerKidnapDialogueFile
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.game.global.action.DoorActionHandler
import core.game.interaction.IntType
import core.game.interaction.InteractionListener
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.game.world.map.Direction
import core.game.world.map.Location
import core.game.world.update.flag.context.Graphics
import core.tools.END_DIALOGUE
import org.rs09.consts.*
import core.game.node.scenery.Scenery as SceneryNode
class PlagueCityListeners : InteractionListener {
companion object {
const val BUCKET_USES_ATTRIBUTE = "/save:elena:bucket"
const val ARDOUGNE_TELE_ATTRIBUTE = "/save:Ardougne:teleport"
private const val TRYING_TO_OPEN_GRILL = 3192
private const val POUR_THE_WATER = 2283
private const val CLIMB_LADDER = 828
private const val GO_INTO_PIPE = 10580
private const val TIE_THE_ROPE = 3191
private const val DIG_WITH_SPADE = 830
}
override fun defineListeners() {
on(NPCs.BILLY_REHNISON_723, IntType.NPC, "talk-to") { player, _ ->
sendMessage(player, "Billy isn't interested in talking.")
return@on true
}
on(Scenery.MANHOLE_2543, IntType.SCENERY, "open") { player, node ->
replaceScenery(node.asScenery(), Scenery.MANHOLE_2544, -1)
addScenery(Scenery.MANHOLE_COVER_2545, Location(node.location.x, node.location.y-1, 0),0,10)
sendMessage(player, "You pull back the manhole cover.")
return@on true
}
on(Scenery.MANHOLE_COVER_2545, IntType.SCENERY, "close") { player, node ->
removeScenery(node.asScenery())
getScenery(location(node.location.x, node.location.y+1, 0))?.let { replaceScenery(it, Scenery.MANHOLE_2543, -1) }
sendMessage(player, "You close the manhole cover.")
return@on true
}
on(Scenery.MANHOLE_2544, IntType.SCENERY, "climb-down") { player, _ ->
teleport(player, Location(2514, 9739, 0))
face(player, Location.create(2514, 9740))
sendMessage(player, "You climb down through the manhole.")
return@on true
}
on(Scenery.DOOR_2528, IntType.SCENERY, "open") { player, node ->
if (getQuestStage(player, Quests.PLAGUE_CITY) >= 13) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
} else {
sendNPCDialogue(player, NPCs.BRAVEK_711,"Go away, I'm busy! I'm... Umm... In a meeting!")
// This typo is authentic
sendMessage(player, "The door won't open")
}
return@on true
}
on(Scenery.MUD_PILE_2533, IntType.SCENERY, "climb") { player, _ ->
animate(player, CLIMB_LADDER)
queueScript(player, 2){
teleport(player, Location(2566, 3332))
sendDialogue(player, "You climb up the mud pile.")
return@queueScript true
}
return@on true
}
on(Scenery.DUG_HOLE_11417, IntType.SCENERY, "Climb-down") { player, _ ->
teleport(player, Location(2518, 9759))
sendDialogue(player, "You climb down the tunnel into the sewer.")
return@on true
}
on(Items.A_MAGIC_SCROLL_1505, IntType.ITEM, "read") { player, item ->
if (removeItem(player, item)){
if (getAttribute(player, ARDOUGNE_TELE_ATTRIBUTE, false)){
sendGraphics(Graphics(157,96), player.location)
impact(player, 0)
sendMessage(player, "The scroll explodes.")
addItem(player, Items.ASHES_592)
}
else{
sendItemDialogue(player, Items.A_MAGIC_SCROLL_1505, "You memorise what is written on the scroll.")
sendDialogue(player, "You can now cast the Ardougne Teleport spell provided you have the required runes and magic level.")
setAttribute(player, ARDOUGNE_TELE_ATTRIBUTE, true)
}
return@on true
}
return@on false
}
on(Items.A_SCRUFFY_NOTE_1508, IntType.ITEM, "read") { player, _ ->
sendMessage(player, "You guess it really says something slightly different.")
openInterface(player, 222).also { scruffyNote(player) }
return@on true
}
class KidnapDoorDialogue : DialogueFile(){
override fun handle(componentID: Int, buttonID: Int) {
when(stage) {
0 -> {
// Face the door
face(player!!, Location.create(player!!.location.x, 3270, 0))
sendDialogue(player!!, "The door won't open. You notice a black cross on the door.").also { stage++ }
}
1 -> openDialogue(player!!, MournerKidnapDialogueFile(), NPC(NPCs.MOURNER_3216))
}
}
}
on(Scenery.DOOR_35991, IntType.SCENERY, "open") { player, node ->
if (getQuestStage(player, Quests.PLAGUE_CITY) > 16) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
}
else {
// Make sure we are standing in front of the door
forceWalk(player, Location.create(node.location.x, node.location.y), "smart")
openDialogue(player, KidnapDoorDialogue())
}
return@on true
}
on(Scenery.WARDROBE_2525, IntType.SCENERY, "search") { player, _ ->
if(getQuestStage(player, Quests.PLAGUE_CITY) >= 2){
if (!hasAnItem(player, Items.GAS_MASK_1506).exists()){
if(freeSlots(player) == 0) {
sendItemDialogue(player, Items.GAS_MASK_1506, "You find a protective mask but you don't have enough room to take it.")
return@on true
}
else {
sendItemDialogue(player, Items.GAS_MASK_1506, "You find a protective mask.")
addItem(player, Items.GAS_MASK_1506)
return@on true
}
}
}
// The player should not be given a mask for whatever reason
sendMessage(player, "You search the wardrobe but you find nothing.")
return@on false
}
onUseWith(IntType.SCENERY, Items.BUCKET_OF_WATER_1929, Scenery.MUD_PATCH_11418) { player, _, _ ->
if (getAttribute(player, BUCKET_USES_ATTRIBUTE, 0) in 0..2 && removeItem(player, Items.BUCKET_OF_WATER_1929)) {
animate(player, POUR_THE_WATER)
sendDialogueLines(player, "You pour water onto the soil.", "The soil softens slightly."
)
player.incrementAttribute(BUCKET_USES_ATTRIBUTE, 1)
addItem(player, Items.BUCKET_1925)
return@onUseWith true
} else if (getAttribute(player, BUCKET_USES_ATTRIBUTE, 0) == 3 && removeItem(player, Items.BUCKET_OF_WATER_1929)) {
animate(player, POUR_THE_WATER)
player.incrementAttribute(BUCKET_USES_ATTRIBUTE, 1)
sendDialogueLines(player,
"You pour water onto the soil.",
"The soil is now soft enough to dig into."
)
setAttribute(player, "/save:elena:dig", true)
addItem(player, Items.BUCKET_1925)
} else {
sendDialogue(player, "You don't need to pour on any more water the soil is soft enough already.")
}
return@onUseWith true
}
onDig(Location.create(2566, 3332, 0)){ player: Player ->
dig(player)
}
onUseWith(IntType.SCENERY, Items.SPADE_952, Scenery.MUD_PATCH_11418) { player, _, _ ->
dig(player)
return@onUseWith true
}
on(Scenery.GRILL_11423, IntType.SCENERY, "open") { player, _ ->
if (getQuestStage(player, Quests.PLAGUE_CITY) == 4) {
sendDialogue(player, "The grill is too secure. You can't pull it off alone.")
animate(player, TRYING_TO_OPEN_GRILL)
setQuestStage(player, Quests.PLAGUE_CITY, 5)
} else {
sendDialogue(player, "There is a grill blocking your way")
}
return@on true
}
on(Scenery.PIPE_2542, IntType.SCENERY, "climb-up") { player, _ ->
if (getQuestStage(player, Quests.PLAGUE_CITY) >= 7) {
if (inEquipment(player, Items.GAS_MASK_1506)){
animate(player, GO_INTO_PIPE,true)
queueScript(player, 3) {
teleport(player, Location(2529, 3304, 0))
sendDialogue(player, "You climb up through the sewer pipe.")
return@queueScript stopExecuting(player)
}
forceMove(player, Location(2514, 9739, 0), Location(2514, 9734, 0), 0, 5,Direction.SOUTH)
}
else {
sendNPCDialogue(player, NPCs.EDMOND_714, "I can't let you enter the city without your gas mask on.")
}
}
else {
sendDialogue(player, "There is a grill blocking your way")
}
return@on true
}
onUseWith(IntType.SCENERY, Items.ROPE_954, Scenery.PIPE_2542) { player, _, _ ->
sendPlayerDialogue(player, "Maybe I should try opening it first.")
return@onUseWith true
}
onUseWith(IntType.SCENERY, Items.ROPE_954, Scenery.GRILL_11423) { player, _, _ ->
if(removeItem(player, Items.ROPE_954)) {
queueScript(player, 1) { stage: Int ->
when (stage) {
0 -> forceWalk(player, Location.create(2514, 9740, 0), "SMART")
2 -> face(player, Location.create(2514, 9739, 0), -1)
3 -> {
animate(player, TIE_THE_ROPE)
setVarbit(player, 1787, 5, true) // Tied rope to the grill.
}
4 -> {
setQuestStage(player, Quests.PLAGUE_CITY, 6)
sendItemDialogue(
player,
Items.ROPE_954,
"You tie the end of the rope to the sewer pipe's grill."
)
return@queueScript stopExecuting(player)
}
}
return@queueScript delayScript(player, 1)
}
return@onUseWith true
} else {
sendMessage(player, "Nothing interesting happens.")
}
return@onUseWith true
}
class TedRehnisonDoors : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
npc = NPC(NPCs.TED_REHNISON_721)
when (stage) {
0 -> {
npcl(FacialExpression.FRIENDLY, "Go away. We don't want any.").also {
if(hasAnItem(player!!, Items.BOOK_1509).exists()){
stage++
} else {
stage = END_DIALOGUE }
}
}
1 -> playerl(FacialExpression.NEUTRAL, "I'm a friend of Jethick's, I have come to return a book he borrowed.").also { stage++ }
// todo change this back after sendItemDialogue is fixed for having a single line before See #1885
2 -> npc(FacialExpression.FRIENDLY, "", "Oh... why didn't you say, come in then.", "").also { stage++ }
3 -> sendItemDialogue(player!!, Items.BOOK_1509, "You hand the book to Ted as you enter.").also {
DoorActionHandler.handleAutowalkDoor(player, getScenery(2531, 3328, 0))
setQuestStage(player!!, Quests.PLAGUE_CITY, 9)
removeItem(player!!, Items.BOOK_1509)
stage++
}
4 -> npcl(FacialExpression.NEUTRAL, "Thanks, I've been missing that.").also { stage = END_DIALOGUE }
}
}
}
on(Scenery.DOOR_2537, IntType.SCENERY, "open") { player, node ->
if (getQuestStage(player, Quests.PLAGUE_CITY) >= 9) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
} else {
openDialogue(player, TedRehnisonDoors())
}
return@on true
}
on(Scenery.BARREL_2530, IntType.SCENERY, "search") { player, _ ->
if (inInventory(player, Items.A_SMALL_KEY_1507)) {
sendMessage(player, "You don't find anything interesting.")
return@on true
} else {
sendItemDialogue(player, Items.A_SMALL_KEY_1507, "You find a small key in the barrel.")
addItem(player, Items.A_SMALL_KEY_1507)
}
}
on(Scenery.SPOOKY_STAIRS_2522, IntType.SCENERY, "walk-down") { player, _ ->
sendMessage(player, "You walk down the stairs...")
teleport(player, Location.create(2537, 9671))
return@on true
}
on(Scenery.SPOOKY_STAIRS_2523, IntType.SCENERY, "walk-up") { player, _ ->
teleport(player, Location.create(2536, 3271, 0))
sendMessage(player, "You walk up the stairs...")
return@on true
}
class ElenaDoorDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
npc = NPC(NPCs.ELENA_3215)
when (stage) {
0 -> sendDialogue(player!!, "The door is locked.").also { stage++ }
1 -> npcl(FacialExpression.CRYING, "Hey get me out of here please!").also { stage++ }
2 -> playerl(FacialExpression.FRIENDLY, "I would do but I don't have a key.").also { stage++ }
3 -> npcl(FacialExpression.SAD, "I think there may be one around somewhere. I'm sure I heard them stashing it somewhere.").also { stage++ }
4 -> options("Have you caught the plague?", "Okay, I'll look for it.").also { stage++ }
5 -> when (buttonID) {
1 -> playerl(FacialExpression.WORRIED, "Have you caught the plague?").also { stage = 6 }
2 -> playerl(FacialExpression.NEUTRAL, "Okay, I'll look for it.").also { stage = END_DIALOGUE }
}
6 -> npcl(FacialExpression.HALF_WORRIED, "No, I have none of the symptoms.").also { stage++ }
7 -> playerl(FacialExpression.THINKING, "Strange, I was told this house was plague infected.").also { stage++ }
8 -> npcl(FacialExpression.THINKING, "I suppose that was a cover up by the kidnappers.").also { stage = END_DIALOGUE }
}
}
}
onUseWith(IntType.SCENERY, Items.A_SMALL_KEY_1507, Scenery.DOOR_2526) { player, _, node ->
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
sendDialogue(player, "You unlock the door.")
return@onUseWith true
}
on(Scenery.DOOR_2526, IntType.SCENERY, "open") { player, node ->
if (getQuestStage(player, Quests.PLAGUE_CITY) >= 99 || hasAnItem(player, Items.A_SMALL_KEY_1507).exists()) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
} else {
openDialogue(player, ElenaDoorDialogue())
}
return@on true
}
onUseWith(IntType.NPC, Items.HANGOVER_CURE_1504, NPCs.BRAVEK_711) { player, _, _ ->
openDialogue(player, NPCs.BRAVEK_711)
return@onUseWith true
}
on(Scenery.DOOR_2054, IntType.SCENERY, "open"){ player, node ->
if (isQuestComplete(player, Quests.PLAGUE_CITY)){
DoorActionHandler.handleDoor(player, node as SceneryNode)
}
else{
sendMessage(player, "This door is locked")
}
return@on true
}
}
private fun dig(p : Player) {
if (getAttribute(p, "/save:elena:dig", false)) {
// Only remove the counter now that you have dug a hole
removeAttribute(p, BUCKET_USES_ATTRIBUTE)
queueScript(p, 1) { stage: Int ->
when (stage) {
0 -> sendItemDialogue(
p, Items.SPADE_952,
"You dig deep into the soft soil... Suddenly it crumbles away!"
)
1 -> animate(p, DIG_WITH_SPADE)
3 -> {
teleport(p, Location(2518, 9759))
setQuestStage(p, Quests.PLAGUE_CITY, 4)
setVarbit(p, Vars.VARBIT_QUEST_PLAGUE_CITY_EDMOND_TUNNELS, 1)
setVarbit(p, Vars.VARBIT_QUEST_PLAGUE_CITY_MUD_PILE, 1)
sendDialogueLines(
p,
"You fall through...",
"...you land in the sewer.",
"Edmond follows you down the hole."
)
// We've dug the hole so don't keep track
removeAttribute(p, "/save:elena:dig")
return@queueScript stopExecuting(p)
}
}
return@queueScript delayScript(p, 1)
}
} else {
sendMessage(p, "Nothing interesting happens.")
}
}
private fun scruffyNote(player: Player) {
val scruffynotes =
arrayOf(
"Got a bncket of nnilk",
"Tlen grind sorne lhoculate",
"vnith a pestal and rnortar",
"ald the grourd dlocolate to tho milt",
"finales add 5cme snape gras5",
)
setInterfaceText(player, scruffynotes.joinToString("<br>"), 222, 5)
}
override fun defineDestinationOverrides() {
setDest(IntType.SCENERY, intArrayOf(Scenery.GRILL_11423), "open") { _, _ ->
return@setDest Location.create(2514, 9739, 0)
}
setDest(IntType.SCENERY, intArrayOf(Scenery.PIPE_2542), "climb-up") { _, _ ->
return@setDest Location.create(2514, 9739, 0)
}
setDest(IntType.SCENERY, intArrayOf(Scenery.MANHOLE_2544), "climb-down") { _, node ->
return@setDest Location.create(node.location.x, node.location.y+1, 0)
}
}
}

View file

@ -1,12 +1,12 @@
package content.region.kandarin.ardougne.plaguecity.quest.elena
package content.region.kandarin.ardougne.quest.plaguecity
import content.data.Quests
import core.api.*
import core.game.activity.Cutscene
import core.game.dialogue.FacialExpression
import core.game.node.entity.player.Player
import core.game.world.map.Direction
import core.game.world.map.Location
import content.data.Quests
class UndergroundCutscene(player: Player) : Cutscene(player) {
@ -29,12 +29,22 @@ class UndergroundCutscene(player: Player) : Cutscene(player) {
}
1 -> {
teleport(player, 18, 13)
teleport(player, 18, 12)
setVarbit(player, 1787, 2, true) // Grill removal.
timedUpdate(1)
}
2 -> {
move(player, 18, 12)
face(player, base.transform(18, 11, 0))
// You have to remove the stubborn previous sceneries before adding your own.
removeScenery(getScenery(base.transform(18, 11, 0))!!)
removeScenery(getScenery(base.transform(18, 12, 0))!!)
removeScenery(getScenery(base.transform(18, 13, 0))!!)
// Add the rope sceneries to animate.
addScenery(11416, base.transform(18, 11, 0),2,10)
addScenery(11412, base.transform(18, 12, 0),2,10)
addScenery(11414, base.transform(18, 13, 0),2,10)
fadeFromBlack()
moveCamera(21, 16)
rotateCamera(18, 13)
@ -42,20 +52,22 @@ class UndergroundCutscene(player: Player) : Cutscene(player) {
}
3 -> {
visualize(getNPC(EDMOND)!!, ROPE_PULL, 2270)
visualize(player, ROPE_PULL, 2270)
animate(getNPC(EDMOND)!!, ROPE_PULL)
animate(player, ROPE_PULL)
animateScenery(player, getScenery(base.transform(18, 11, 0))!!, 3189)
animateScenery(player, getScenery(base.transform(18, 12, 0))!!, 3188)
animateScenery(player, getScenery(base.transform(18, 13, 0))!!, 3188)
sendChat(player, "1... 2... 3... Pull!")
timedUpdate(6)
}
4 -> {
setVarbit(player, 1787, 6, true) // Grill removal.
face(player, getNPC(EDMOND)!!.location)
timedUpdate(2)
}
5 -> {
dialogueUpdate(EDMOND, FacialExpression.FRIENDLY, "Once you're in the city look for a man called Jethick, he's an old friend and should help you. Send")
dialogueUpdate(EDMOND, FacialExpression.FRIENDLY, "Once you're in the city look for a man called Jethick, he's an old friend and should help you. Send", hide=true)
sendChat(getNPC(EDMOND)!!, "Once you're in the city")
timedUpdate(4)
}
@ -76,7 +88,7 @@ class UndergroundCutscene(player: Player) : Cutscene(player) {
}
9 -> {
dialogueUpdate(EDMOND, FacialExpression.FRIENDLY, "him my regards, I Haven't seen him since before Elena was born.")
dialogueUpdate(EDMOND, FacialExpression.FRIENDLY, "him my regards, I haven't seen him since before Elena was born.", hide=true)
sendChat(getNPC(EDMOND)!!, "him my regards, I haven't")
timedUpdate(4)
}
@ -93,15 +105,11 @@ class UndergroundCutscene(player: Player) : Cutscene(player) {
12 -> {
sendChat(player, "Alright, thanks I will.")
timedUpdate(3)
// todo change this to true once no continue button player model size is fixed
sendPlayerDialogue(player,"Alright, thanks I will.", hide = false)
timedUpdate(2)
}
13 -> {
sendPlayerDialogue(player,"Alright, thanks I will.")
timedUpdate(4)
}
14 -> {
end {
setQuestStage(player, Quests.PLAGUE_CITY, 7)
}
@ -111,6 +119,6 @@ class UndergroundCutscene(player: Player) : Cutscene(player) {
companion object {
private const val EDMOND = 714
private val ROPE_PULL = 3187
private const val ROPE_PULL = 3187
}
}

View file

@ -1,5 +1,7 @@
package content.region.kandarin.ardougne.plaguecity.quest.elena
package content.region.kandarin.ardougne.quest.plaguecity.dialogue
import content.data.Quests
import content.region.kandarin.ardougne.quest.plaguecity.PlagueCityListeners
import core.api.*
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
@ -9,7 +11,6 @@ import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
import content.data.Quests
@Initializable
class AlrenaDialogue(player: Player? = null) : DialoguePlugin(player) {
@ -17,7 +18,8 @@ class AlrenaDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if (player.questRepository.getStage(Quests.PLAGUE_CITY) == 1) {
playerl(FacialExpression.FRIENDLY, "Hello, Edmond has asked me to help find your daughter.").also { stage++ }
// playerl formats this weirdly
player(FacialExpression.FRIENDLY, "Hello, Edmond has asked me to help find your","daughter.").also { stage++ }
} else {
playerl(FacialExpression.FRIENDLY, "Hello Madam.").also { stage++ }
}
@ -44,15 +46,15 @@ class AlrenaDialogue(player: Player? = null) : DialoguePlugin(player) {
sendItemDialogue(player!!, Items.DWELLBERRIES_2126, "You give the dwellberries to Alrena.").also { stage++ }
removeItem(player!!, Items.DWELLBERRIES_2126)
}
4 -> sendDialogue(player!!, "Alrena crushes the berries into a smooth paste. She then smears the paste over a strange mask.").also { stage++ }
5 -> npcl(FacialExpression.FRIENDLY, "There we go, all done. While in West Ardougne you must wear this at all times, or you could catch the plague. I'll make a spare mask. I'll hide it in the wardrobe in case the mourners come in.").also { stage++ }
6 -> sendItemDialogue(player!!, Items.GAS_MASK_1506, "Alrena gives you the mask.").also { stage++ }
7 -> {
end()
addItem(player!!, Items.GAS_MASK_1506)
// sendDialogue formats this weirdly
4 -> sendDialogueLines(player!!, "Alrena crushes the berries into a smooth paste. She then smears the", "paste over a strange mask.").also { stage++ }
// npcl formats this weirdly
5 -> npc(FacialExpression.FRIENDLY, "There we go, all done. While in West Ardougne you", "must wear this at all times, or you could catch the","plague.").also { stage++ }
6 -> {
setQuestStage(player!!, Quests.PLAGUE_CITY, 2)
setAttribute(player!!, PlagueCityListeners.BUCKET_USES_ATTRIBUTE, 0)
sendNPCDialogue(player!!, NPCs.ALRENA_710, "I'll make a spare mask. I'll hide it in the wardrobe in case the mourners come in.")
addItem(player!!, Items.GAS_MASK_1506)
sendItemDialogue(player!!, Items.GAS_MASK_1506, "Alrena gives you the mask.").also { stage++ }
// Jump down to quest stage 2 from here
}
8 -> playerl(FacialExpression.NEUTRAL, "Ok, I'll go and get some.").also { stage = END_DIALOGUE }
}
@ -60,6 +62,9 @@ class AlrenaDialogue(player: Player? = null) : DialoguePlugin(player) {
2 -> when (stage) {
1 -> npcl(FacialExpression.FRIENDLY, "Hello darling, I think Edmond had a good idea of how to get into West Ardougne, you should hear his idea.").also { stage++ }
2 -> playerl(FacialExpression.FRIENDLY, "Alright I'll go and see him now.").also { stage = END_DIALOGUE }
// This gets entered from quest stage 1
7 -> npcl(FacialExpression.FRIENDLY, "I'll make a spare mask. I'll hide it in the wardrobe in case the mourners come in.").also { stage = END_DIALOGUE }
}
3 -> when (stage) {
@ -113,19 +118,26 @@ class AlrenaDialogue(player: Player? = null) : DialoguePlugin(player) {
5 -> npcl(FacialExpression.FRIENDLY, " Yes. There should be one in the house somewhere. Let me know if you need anything else.").also { stage = END_DIALOGUE }
}
in 15..98 -> when (stage) {
15 -> when (stage) {
1 -> npcl(FacialExpression.FRIENDLY, "Hello, any word on Elena?").also { stage++ }
2 -> playerl(FacialExpression.FRIENDLY, "Not yet I'm afraid, I need to find some Snape grass first, any idea where I'd find some?").also { stage++ }
3 -> npcl(FacialExpression.FRIENDLY, "It's not common round here, though I hear it's easy to find by the coast south west of Falador.").also { stage++ }
4 -> playerl(FacialExpression.FRIENDLY, "Thanks, I'll go take a look.").also { stage++ }
5 -> playerl(FacialExpression.FRIENDLY, "I also need to get some chocolate powder for a hangover cure for the city warder.").also { stage++ }
6 -> npcl(FacialExpression.FRIENDLY, "Well I don't have any chocolate, but this may help.").also { stage++ }
7 -> sendItemDialogue(player!!, Items.PESTLE_AND_MORTAR_233, "Alrena hands you a pestle and mortar.").also { stage++ }
8 -> playerl(FacialExpression.FRIENDLY, "Thanks.").also { stage++ }
9 -> {
end()
7 -> sendItemDialogue(player!!, Items.PESTLE_AND_MORTAR_233, "Alrena hands you a pestle and mortar.").also {
addItem(player!!, Items.PESTLE_AND_MORTAR_233)
stage++
}
8 -> playerl(FacialExpression.FRIENDLY, "Thanks.").also { stage = END_DIALOGUE }
}
in 16 .. 98 -> when(stage){
1 -> npcl(FacialExpression.WORRIED, "Hello, any word on Elena?").also { stage++ }
2 -> playerl(FacialExpression.NEUTRAL, "Not yet I'm afraid.").also { stage++ }
3 -> npcl(FacialExpression.WORRIED, "Is there anything else I can do to help?").also { stage++ }
4 -> playerl(FacialExpression.SAD, "Sorry but not right now.").also {stage = END_DIALOGUE }
}
99 -> when (stage) {

View file

@ -0,0 +1,156 @@
package content.region.kandarin.ardougne.quest.plaguecity.dialogue
import content.data.Quests
import core.api.*
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.dialogue.Topic
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.game.node.item.Item
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
@Initializable
class BravekDialogue(player: Player? = null) : DialoguePlugin(player) {
companion object{
const val SPEAK_ANOTHER_DAY = 10
const val WAITING_FOR_CURE = 20
const val CURED = 30
const val IMPORTANT = 50
const val DRINK_TOO_MUCH = 60
const val CURE = 70
const val WHAT_HELP = 80
const val ALL_PEOPLE_SAY = 90
const val NOT_LISTEN = 100
const val INTEREST = 110
const val WEAK_LEADER = 120
}
override fun open(vararg args: Any?): Boolean {
npc = if (args[0] is Int) NPC(args[0] as Int) else args[0] as NPC
when(getQuestStage(player, Quests.PLAGUE_CITY)){
in 0..13 -> npcl(FacialExpression.ANNOYED, "My head hurts! I'll speak to you another day...").also { stage = SPEAK_ANOTHER_DAY }
14 -> npcl(FacialExpression.ANNOYED, " Uurgh! My head still hurts too much to think straight. " +
"Oh for one of Trudi's hangover cures!").also { stage = if(hasAnItem(player, Items.HANGOVER_CURE_1504).exists()) WAITING_FOR_CURE else END_DIALOGUE }
15 -> npcl(FacialExpression.FRIENDLY, "Ah now, what was it you wanted me to do for you?").also { stage = WHAT_HELP }
else -> npcl(FacialExpression.FRIENDLY, "Thanks again for the hangover cure.").also { stage = if(hasAnItem(player, Items.WARRANT_1503).exists() || getQuestStage(player, Quests.PLAGUE_CITY) >= 99) CURED else WHAT_HELP }
}
return true
}
override fun handle(componentID: Int, buttonID: Int): Boolean {
when (stage){
SPEAK_ANOTHER_DAY -> showTopics(
Topic("This is really important though!", IMPORTANT),
Topic("Ok, goodbye.", END_DIALOGUE)
)
IMPORTANT -> npc(FacialExpression.ANNOYED,
"I can't possibly speak to you with my head spinning like",
"this... I went a bit heavy on the drink again last night.",
"Curse my herbalist, she made the best hang over cures.",
"Darn inconvenient of her catching the plague.").also { stage++ }
IMPORTANT + 1 -> showTopics(
Topic("Ok, goodbye.", END_DIALOGUE),
Topic(" You shouldn't drink so much then!", DRINK_TOO_MUCH),
Topic("Do you know what's in the cure?", CURE)
)
DRINK_TOO_MUCH -> npcl(FacialExpression.ANNOYED, "Well positions of responsibility are hard, " +
"I need something to take my mind off things... Especially with the problems this place has.").also { stage++ }
DRINK_TOO_MUCH + 1 -> showTopics(
Topic("Ok, goodbye.", END_DIALOGUE),
Topic("Do you know what's in the cure?", CURE),
Topic("I don't think drink is the solution.", DRINK_TOO_MUCH+2)
)
DRINK_TOO_MUCH + 2 -> npcl(FacialExpression.ANNOYED, "Uurgh! My head still hurts too much to think straight. Oh for one of Trudi's hangover cures!").also { stage = END_DIALOGUE }
CURE -> npc(FacialExpression.NEUTRAL,
"Hmmm let me think... Ouch! Thinking isn't clever. Ah",
"here, she did scribble it down for me.").also { stage++ }
CURE + 1 -> {
if(hasSpaceFor(player!!, Item(Items.A_SCRUFFY_NOTE_1508))) {
sendItemDialogue(
player!!,
Items.A_SCRUFFY_NOTE_1508,
"Bravek hands you a tatty piece of paper."
).also { stage++ }
}
else{
sendItemDialogue(player!!, Items.A_SCRUFFY_NOTE_1508, "Bravek waves a note in front of you but you do not have space for it").also { stage = END_DIALOGUE }
}
}
CURE + 2 ->{
addItem(player!!, Items.A_SCRUFFY_NOTE_1508)
setQuestStage(player!!, Quests.PLAGUE_CITY, 14)
end()
}
WAITING_FOR_CURE -> playerl(FacialExpression.NEUTRAL, "Try this.").also { stage++ }
WAITING_FOR_CURE + 1 -> {
animate(npc, 1330) // Drink hangover cure.
findLocalNPC(player!!, NPCs.BRAVEK_711)!!.sendChat("Grruurgh!")
sendItemDialogue(player!!, Items.HANGOVER_CURE_1504, "You give Bravek the hangover cure. Bravek gulps down the foul-looking liquid.").also { stage++ }
setQuestStage(player, Quests.PLAGUE_CITY, 15)
removeItem(player, Items.HANGOVER_CURE_1504)
}
WAITING_FOR_CURE + 2 -> npcl(FacialExpression.HAPPY, "Ooh that's much better! Thanks, that's the clearest my head has felt in a month." +
"Ah now, what was it you wanted me to do for you?"
).also { stage = WHAT_HELP }
WHAT_HELP -> playerl(FacialExpression.ASKING, "I need to rescue a kidnap victim called Elena. She's being held in a plague house, I need permission to enter.").also { stage++ }
WHAT_HELP + 1 -> npcl(FacialExpression.HALF_GUILTY, "Well the mourners deal with that sort of thing...").also { stage++ }
WHAT_HELP + 2 -> showTopics(
Topic("Ok, I'll go speak to them.", END_DIALOGUE),
Topic("Is that all anyone says around here?", ALL_PEOPLE_SAY),
Topic("They won't listen to me!", NOT_LISTEN, skipPlayer = true)
)
ALL_PEOPLE_SAY -> npcl(FacialExpression.HALF_GUILTY, "Well, they know best about plague issues.").also { stage++ }
ALL_PEOPLE_SAY + 1 -> showTopics(
Topic("Don't you want to take an interest in it at all?", INTEREST),
Topic("They won't listen to me!", NOT_LISTEN, skipPlayer = true)
)
INTEREST -> npcl(FacialExpression.HALF_GUILTY, "Nope, I don't wish to take a deep interest in plagues. That stuff is too scary for me!").also { stage++ }
INTEREST + 1 -> showTopics(
Topic("I see why people say you're a weak leader.", WEAK_LEADER),
Topic("Ok, I'll talk to the mourners.", END_DIALOGUE),
Topic("They won't listen to me!", NOT_LISTEN, skipPlayer = true)
)
WEAK_LEADER -> npcl(FacialExpression.ANNOYED, "Bah, people always criticise their leaders but delegating is the only way to lead. I delegate all plague issues to the mourners.").also { stage++ }
WEAK_LEADER + 1 -> playerl(FacialExpression.ANNOYED, "This whole city is a plague issue!").also { stage = END_DIALOGUE }
NOT_LISTEN -> playerl(FacialExpression.ANNOYED, "They won't listen to me! They say I'm not properly equipped to go in the house, though I do have a very effective gas mask.").also { stage++ }
// npcl does not work
NOT_LISTEN + 1 -> npc(FacialExpression.ANNOYED,
"Hmmm, well I guess they're not taking the issue of a",
"kidnapping seriously enough. They do go a bit far",
"sometimes. I've heard of Elena, she has helped us a lot...",
"Ok, I'll give you this warrant to enter the house."
).also { stage++ }
NOT_LISTEN + 2 -> {
if (freeSlots(player!!) == 0) {
sendItemDialogue(player!!, Items.WARRANT_1503, "Bravek waves a warrant at you, but you don't have room to take it.").also { stage = END_DIALOGUE }
} else {
sendItemDialogue(player!!, Items.WARRANT_1503, "Bravek hands you a warrant.").also { stage = END_DIALOGUE }
addItem(player!!, Items.WARRANT_1503)
setQuestStage(player!!, Quests.PLAGUE_CITY, 16)
}
}
CURED -> playerl(FacialExpression.FRIENDLY, "Not a problem, happy to help out.").also { stage++ }
CURED + 1 -> npcl(FacialExpression.FRIENDLY, " I'm just having a little drop of whisky, then I'll feel really good.").also { stage = END_DIALOGUE }
}
return true
}
override fun getIds(): IntArray = intArrayOf(NPCs.BRAVEK_711)
}

View file

@ -0,0 +1,98 @@
package content.region.kandarin.ardougne.quest.plaguecity.dialogue
import content.data.Quests
import core.api.getQuestStage
import core.api.setQuestStage
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.dialogue.IfTopic
import core.game.dialogue.Topic
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.NPCs
@Initializable
class ClerkDialogue(player: Player? = null) : DialoguePlugin(player) {
companion object{
const val TALK_AGAIN = 10
const val THROUGH_DOOR = 20
const val PERMISSION = 30
const val QUESTIONS = 40
const val URGENT = 60
const val RUN_EVERYTHING = 70
const val WHEN_AVAILABLE = 80
const val DISTURBED = 90
}
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if (getQuestStage(player, Quests.PLAGUE_CITY) < 13)
npcl(FacialExpression.NEUTRAL, "Hello, welcome to the Civic Office of West Ardougne. How can I help you?").also { stage = QUESTIONS }
else
npcl(FacialExpression.FRIENDLY, "Bravek will see you now but keep it short!").also { stage = TALK_AGAIN }
return true
}
override fun handle(componentID: Int, buttonID: Int): Boolean {
when(stage){
QUESTIONS -> showTopics(
IfTopic("I need permission to enter a plague house.", PERMISSION, getQuestStage(player, Quests.PLAGUE_CITY) > 11),
Topic("Who is through that door?", THROUGH_DOOR),
Topic("I'm just looking thanks.", END_DIALOGUE),
)
// npcl does not wordwrap right
PERMISSION -> npc(FacialExpression.NEUTRAL, "Rather you than me! The mourners normally deal with",
"that stuff, you should speak to them. Their headquarters","are right near the city gate.").also { stage++ }
PERMISSION + 1 -> showTopics(
Topic("I'll try asking them then.", END_DIALOGUE),
Topic("Surely you don't let them run everything for you?", RUN_EVERYTHING),
Topic("This is urgent though!", URGENT, skipPlayer = true)
)
RUN_EVERYTHING -> npcl(FacialExpression.NEUTRAL, " Well, they do know what they're doing here. " +
"If they did start doing something badly Bravek, the city warder, would have the power to override them. " +
"I can't see that happening though.").also { stage++ }
RUN_EVERYTHING + 1 -> showTopics(
Topic("I'll try asking them then.", END_DIALOGUE),
Topic("Can I speak to Bravek anyway?", DISTURBED)
)
URGENT -> playerl(FacialExpression.PANICKED, " This is urgent though! Someone's been kidnapped and is being held in a plague house!").also { stage++ }
URGENT+ 1 -> npcl(FacialExpression.NEUTRAL, "I'll see what I can do I suppose.").also { stage++ }
URGENT + 2 -> npcl(FacialExpression.NEUTRAL, " Mr Bravek, there's a ${if (player.isMale) "man" else "lady"} here who really needs to speak to you.").also {
stage++
npc = NPC(NPCs.BRAVEK_711)
}
URGENT + 3 -> npc(FacialExpression.ANNOYED, " I suppose they can come in then. If they keep it short.").also {
stage = END_DIALOGUE
setQuestStage(player, Quests.PLAGUE_CITY, 13)
}
THROUGH_DOOR -> npcl(FacialExpression.NEUTRAL, "The city warder Bravek is in there.").also { stage++ }
THROUGH_DOOR + 1 -> playerl(FacialExpression.ASKING, " Can I go in?").also { stage = DISTURBED }
DISTURBED -> npcl(FacialExpression.NEUTRAL, " He has asked not to be disturbed.").also { stage++ }
DISTURBED + 1 -> showTopics(
IfTopic("This is urgent though!", URGENT, getQuestStage(player, Quests.PLAGUE_CITY) > 11, skipPlayer = true),
Topic("Ok, I'll leave him alone.", END_DIALOGUE),
Topic("Do you know when he will be available?", WHEN_AVAILABLE)
)
WHEN_AVAILABLE -> npcl(FacialExpression.NEUTRAL, " Oh I don't know, an hour or so maybe.").also { stage = END_DIALOGUE }
TALK_AGAIN -> playerl(FacialExpression.FRIENDLY, "Thanks, I won't take much of his time.").also { stage = END_DIALOGUE }
}
return true
}
override fun getIds(): IntArray = intArrayOf(NPCs.CLERK_713)
}

View file

@ -0,0 +1,268 @@
package content.region.kandarin.ardougne.quest.plaguecity.dialogue
import content.data.Quests
import content.region.kandarin.ardougne.quest.plaguecity.PlagueCityListeners
import content.region.kandarin.ardougne.quest.plaguecity.UndergroundCutscene
import core.api.*
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.dialogue.Topic
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
@Initializable
class EdmondDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun open(vararg args: Any?): Boolean {
val questStage = getQuestStage(player, Quests.PLAGUE_CITY)
npc = args[0] as NPC
if(inEquipmentOrInventory(player, Items.GAS_MASK_1506) && (questStage == 2)) {
playerl(FacialExpression.FRIENDLY, "Hi Edmond, I've got the gas mask now.").also { stage++ }
}
else if (questStage == 4) {
// npcl not formatted quite right
npc(FacialExpression.FRIENDLY, "I think it's the pipe to the south that comes up in West", "Ardougne.").also { stage++ }
}
else if(questStage == 5){
playerl( FacialExpression.NEUTRAL,
"Edmond, I can't get through to West Ardougne! There's an iron grill blocking my way, I can't pull it off alone."
).also { stage++ }
}
else if(questStage == 6){
// playerl not formatted quite right
player(FacialExpression.NEUTRAL, "I've tied a rope to the grill over there, will you help me","pull it off?").also { stage++ }
}
else if(questStage > 2) {
playerl(FacialExpression.FRIENDLY, "Hello Edmond.").also { stage++ }
}
else {
playerl(FacialExpression.FRIENDLY, "Hello old man.").also { stage++ }
}
return true
}
override fun handle(componentID: Int, buttonID: Int): Boolean {
when (getQuestStage(player!!, Quests.PLAGUE_CITY)) {
0 -> when (stage) {
1 -> npcl(FacialExpression.NEUTRAL, "Sorry, I can't stop to talk...").also { stage++ }
2 -> playerl(FacialExpression.FRIENDLY, "Why, what's wrong?").also { stage++ }
3 -> npcl(
FacialExpression.FRIENDLY,
"I've got to find my daughter. I pray that she is still alive..."
).also { stage++ }
4 -> options("What's happened to her?", "Well, good luck finding her.").also { stage++ }
5 -> when (buttonID) {
1 -> playerl(FacialExpression.FRIENDLY, "What's happened to her?").also { stage = 6 }
2 -> playerl(FacialExpression.FRIENDLY, "Well, good luck finding her.").also {
stage = END_DIALOGUE
}
}
// npcl does not word wrap correctly
6 -> npc(
FacialExpression.NEUTRAL,
"Elena's a missionary and a healer. Three weeks ago she",
"managed to cross the Ardougne wall... No-one's allowed",
"to cross the wall in case they spread the plague. But",
"after hearing the screams of suffering she felt she had"
).also { stage++ }
7 -> npcl(
FacialExpression.NEUTRAL,
"to help. She said she'd be gone for a few days but we've heard nothing since."
).also { stage++ }
8 -> options(
"Tell me more about the plague.",
"Can I help find her?",
"I'm sorry, I have to go."
).also { stage++ }
9 -> when (buttonID) {
1 -> playerl(FacialExpression.FRIENDLY, "Tell me more about the plague.").also { stage = 10 }
2 -> playerl(FacialExpression.FRIENDLY, "Can I help find her?").also { stage = 11 }
3 -> playerl(FacialExpression.FRIENDLY, "I'm sorry, I have to go.").also { stage = END_DIALOGUE }
}
10 -> npcl(
FacialExpression.FRIENDLY,
"The mourners can tell you more than me. They're the only ones allowed to cross the border. I do know the plague is a horrible way to go... That's why Elena felt she had to go help."
).also { stage = 8 }
11 -> npcl(
FacialExpression.FRIENDLY,
"Really, would you? I've been working on a plan to get into West Ardougne, but I'm too old and tired to carry it through. If you're going into West Ardougne you'll need protection from the plague. My wife made a"
).also { stage++ }
12 -> npcl(
FacialExpression.FRIENDLY,
"special gas mask for Elena with dwellberries rubbed into it. Dwellberries help repel the virus! We need some more though..."
).also { stage++ }
13 -> playerl(FacialExpression.ASKING, "Where can I find these dwellberries?").also { stage++ }
14 -> npcl(
FacialExpression.FRIENDLY,
"The only place I know of is McGrubor's Wood just north of the Rangers' Guild."
).also { stage++ }
15 -> playerl(FacialExpression.FRIENDLY, "Ok, I'll go and get some.").also { stage++ }
16 -> npcl(
FacialExpression.NEUTRAL,
"The foresters keep a close eye on it, but there is a back way in."
).also { stage++ }
17 -> {
end()
setQuestStage(player!!, Quests.PLAGUE_CITY, 1)
}
}
1 -> when (stage) {
1 -> npcl(FacialExpression.NEUTRAL, "Have you got the dwellberries yet?").also { stage++ }
2 -> if (!inInventory(player, Items.DWELLBERRIES_2126)) {
playerl(FacialExpression.FRIENDLY, "Sorry, I'm afraid not.").also { stage = 3 }
} else {
playerl(FacialExpression.FRIENDLY, "Yes I've got some here.").also { stage = 6 }
}
3 -> npcl(
FacialExpression.NEUTRAL,
"You'll probably find them in McGrubor's Wood it's just west of Seers village."
).also { stage++ }
4 -> playerl(FacialExpression.NEUTRAL, "Ok, I'll go and get some.").also { stage++ }
5 -> npcl(
FacialExpression.NEUTRAL,
"The foresters keep a close eye on it, but there is a back way in."
).also { stage = END_DIALOGUE }
6 -> npcl(FacialExpression.NEUTRAL, "Take them to my wife Alrena, she's inside.").also {
stage = END_DIALOGUE
}
}
2 -> when (stage) {
// npcl formats this wrong
1 -> npc(
FacialExpression.NEUTRAL,
"Good stuff, now for the digging. Beneath us are the",
"Ardougne sewers, there you'll find",
"access to West Ardougne."
).also { stage++ }
2 -> npc(
FacialExpression.NEUTRAL, "The problem is the soil is rock hard. You'll need to pour",
"on several buckets of water to soften it up. I'll keep an",
"eye out for the mourners."
).also { stage++ }
3 -> {
end()
setQuestStage(player!!, Quests.PLAGUE_CITY, 3)
}
}
3 -> when (stage) {
1 -> if (player!!.getAttribute("/save:elena:dig", false) == true) {
playerl(FacialExpression.NEUTRAL, "I've soaked the soil with water.").also { stage = 3 }
} else {
npcl(FacialExpression.FRIENDLY, "How's it going?").also { stage = 2 }
}
2 -> if (player.getAttribute(PlagueCityListeners.BUCKET_USES_ATTRIBUTE, 0) == 1) {
playerl(
FacialExpression.NEUTRAL,
"I still need to pour three more buckets of water on the soil."
).also { stage = END_DIALOGUE }
} else if (player.getAttribute(PlagueCityListeners.BUCKET_USES_ATTRIBUTE, 0) == 2) {
playerl(
FacialExpression.NEUTRAL,
"I still need to pour two more buckets of water on the soil."
).also { stage = END_DIALOGUE }
} else if (player.getAttribute(PlagueCityListeners.BUCKET_USES_ATTRIBUTE, 0) == 3) {
playerl(
FacialExpression.NEUTRAL,
"I still need to pour one more bucket of water on the soil."
).also { stage = END_DIALOGUE }
}
3 -> npcl(
FacialExpression.FRIENDLY,
"That's great, it should be soft enough to dig through now."
).also { stage = END_DIALOGUE }
}
4 -> when (stage) {
1 -> playerl(FacialExpression.NEUTRAL, "Alright I'll check it out.").also { stage = END_DIALOGUE }
}
5 -> when (stage) {
1 -> npcl(
FacialExpression.NEUTRAL,
"If you get some rope you could tie to the grill, then we could both pull it at the same time."
).also { stage = END_DIALOGUE }
}
6 -> when(stage){
1 -> npcl(FacialExpression.NEUTRAL, "Alright, let's get to it...").also { stage++ }
2 -> end().also{ UndergroundCutscene(player!!).start() }
}
7-> when (stage) {
1 -> npcl(FacialExpression.NEUTRAL, "Have you found Elena yet?").also { stage++ }
2 -> playerl(FacialExpression.NEUTRAL, "Not yet, it's a big city over there.").also { stage++ }
3 -> npcl(FacialExpression.FRIENDLY, "Don't forget to look for my friend Jethick. He may be able to help.").also { stage = END_DIALOGUE }
}
8 -> when (stage) {
1 -> npcl(FacialExpression.NEUTRAL, "Have you found Elena yet?").also { stage++ }
2 -> playerl(FacialExpression.NEUTRAL, "Not yet, it's a big city over there. Do you have a picture of Elena?").also { stage++ }
3 -> npcl(FacialExpression.FRIENDLY, "There should be a picture of Elena in the house. Please find her quickly, I hope it's not too late.").also { stage = END_DIALOGUE }
}
// No source for this branch
in 9..98 -> when(stage) {
1 -> npcl(FacialExpression.NEUTRAL, "Have you found Elena yet?").also { stage++ }
2 -> playerl(FacialExpression.SAD, "Not yet.").also { stage++ }
3 -> npcl(FacialExpression.WORRIED, "Please find her quickly, I hope it's not too late.").also { stage = END_DIALOGUE }
}
99 -> when (stage) {
1 -> npcl(FacialExpression.NEUTRAL, "Thank you, thank you! Elena beat you back by minutes.").also { stage++ }
2 -> npcl(FacialExpression.NEUTRAL, "Now I said I'd give you a reward. What can I give you as a reward I wonder?").also { stage++ }
3 -> npcl(FacialExpression.NEUTRAL, "Here take this magic scroll, I have little use for it but it may help you.").also { stage++ }
4 -> {
end()
player!!.questRepository.getQuest(Quests.PLAGUE_CITY).finish(player)
}
}
100 -> when (stage) {
1 -> npcl(FacialExpression.FRIENDLY, "Ah hello again, and thank you again for rescuing my daughter.").also {
stage = if (
getAttribute(player, PlagueCityListeners.ARDOUGNE_TELE_ATTRIBUTE, false)
|| hasAnItem(player, Items.A_MAGIC_SCROLL_1505).exists()) 5 else 2
}
2 -> showTopics(
Topic("Do you have any more of those scrolls?", 3),
Topic("No problem.", END_DIALOGUE)
)
3 -> npcl(FacialExpression.FRIENDLY, "Here take this magic scroll, I have little use for it but it may help you.").also {
stage = END_DIALOGUE
addItemOrDrop(player!!, Items.A_MAGIC_SCROLL_1505)
}
5 -> playerl(FacialExpression.NEUTRAL, "No problem.").also { stage = END_DIALOGUE }
}
}
return true
}
override fun getIds(): IntArray = intArrayOf(NPCs.EDMOND_3213, NPCs.TUNNEL_EDMOND_3214)
}

View file

@ -1,5 +1,6 @@
package content.region.kandarin.ardougne.plaguecity.quest.elena
package content.region.kandarin.ardougne.quest.plaguecity.dialogue
import content.data.Quests
import core.api.*
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
@ -9,7 +10,6 @@ import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
import content.data.Quests
@Initializable
class JethickDialogue(player: Player? = null) : DialoguePlugin(player) {
@ -32,28 +32,37 @@ class JethickDialogue(player: Player? = null) : DialoguePlugin(player) {
}
in 7..9 -> when (stage) {
1 -> options("Hi, I'm looking for a woman from East Ardougne called Elena.", "So who's in charge here?").also { stage++ }
1 -> options("Hi, I'm looking for a woman from East Ardougne.", "So who's in charge here?").also { stage++ }
2 -> when (buttonID) {
// This line is authentically different than the question you click
1 -> playerl(FacialExpression.FRIENDLY, "Hi, I'm looking for a woman from East Ardougne called Elena.").also { stage = 3 }
2 -> playerl(FacialExpression.FRIENDLY, "So who's in charge here?").also { stage = END_DIALOGUE }
}
3 -> npcl(FacialExpression.FRIENDLY, "East Ardougnian women are easier to find in East Ardougne. Not many would come to West Ardougne to find one. Although the name is familiar, what does she look like?").also { stage++ }
4 -> playerl(FacialExpression.NEUTRAL, "Um... brown hair... in her twenties...").also { stage++ }
5 -> npcl(FacialExpression.NEUTRAL, "Hmm, that doesn't narrow it down a huge amount... I'll need to know more than that, or see a picture?").also { stage++ }
6 -> if (inInventory(player!!, Items.PICTURE_1510)) {
sendItemDialogue(player!!, Items.PICTURE_1510, "You show Jethick the picture.").also { stage++ }
// word wrap is wrong with npcl
3 -> npc(FacialExpression.FRIENDLY, "East Ardougnian women are easier to find in East",
"Ardougne. Not many would come to West Ardougne to",
"find one. Although the name is familiar, what does she",
"look like?").also { stage++ }
4 -> if (inInventory(player!!, Items.PICTURE_1510)) {
sendItemDialogue(player!!, Items.PICTURE_1510, "You show Jethick the picture.").also { stage = 7 }
} else {
end()
stage = END_DIALOGUE
playerl(FacialExpression.NEUTRAL, "Um... brown hair... in her twenties...").also { stage++ }
}
7 -> npcl(FacialExpression.FRIENDLY, "She came over here to help to aid plague victims. I think she is staying over with the Rehnison family. They live in the small timbered building at the far north side of town.").also { stage++ }
8 -> npcl(FacialExpression.FRIENDLY, "I've not seen her around here for a while, mind. I don't suppose you could run me a little errand while you're over there? I borrowed this book from them, could you return it?").also { stage++ }
9 -> options("Yes, I'll return it for you.", "No, I don't have time for that.").also { stage++ }
10 -> when (buttonID) {
1 -> playerl(FacialExpression.NEUTRAL, "Yes, I'll return it for you.").also { stage = 11 }
5 -> npcl(FacialExpression.NEUTRAL, "Hmm, that doesn't narrow it down a huge amount... I'll need to know more than that, or see a picture?").also { stage = END_DIALOGUE }
// npcl doesn't wrap right
7 -> npc(FacialExpression.FRIENDLY, "She came over here to help to aid plague victims. I",
"think she is staying over with the Rehnison family. They",
"live in the small timbered building at the far north side",
"of town. I've not seen her around here in a while,").also { stage++ }
8 -> npcl(FacialExpression.FRIENDLY, "mind. ").also { stage++ }
9 -> npcl(FacialExpression.FRIENDLY, "I don't suppose you could run me a little errand while you're over there? I borrowed this book from them, can you return it?").also { stage++ }
10 -> options("Yes, I'll return it for you.", "No, I don't have time for that.").also { stage++ }
11 -> when (buttonID) {
1 -> playerl(FacialExpression.NEUTRAL, "Yes, I'll return it for you.").also { stage = 12 }
2 -> playerl(FacialExpression.NEUTRAL, "No, I don't have time for that.").also { stage = END_DIALOGUE }
}
11 -> if(freeSlots(player) == 0) {
12 -> if(freeSlots(player) == 0) {
end()
sendItemDialogue(player!!, Items.BOOK_1509, "Jethick shows you the book, but you don't have room to take it.")
stage = END_DIALOGUE

View file

@ -1,6 +1,8 @@
package content.region.kandarin.ardougne.plaguecity.quest.elena
package content.region.kandarin.ardougne.quest.plaguecity.dialogue
import content.data.Quests
import core.api.setQuestStage
import core.api.setVarbit
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
@ -8,10 +10,10 @@ import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.NPCs
import content.data.Quests
import org.rs09.consts.Vars
@Initializable
class ElenaDialogue(player: Player? = null) : DialoguePlugin(player) {
class KidnappedElenaDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
@ -31,11 +33,13 @@ class ElenaDialogue(player: Player? = null) : DialoguePlugin(player) {
4 -> {
end()
setQuestStage(player!!, Quests.PLAGUE_CITY, 99)
setVarbit(player, Vars.VARBIT_QUEST_PLAGUE_CITY_RESCUE_ELENA, 1)
setVarbit(player, Vars.VARBIT_QUEST_PLAGUE_CITY_EDMOND_TUNNELS, 0)
stage = END_DIALOGUE
}
}
return true
}
override fun getIds(): IntArray = intArrayOf(NPCs.ELENA_3215)
override fun getIds(): IntArray = intArrayOf(NPCs.KIDNAPPED_ELENA_715)
}

View file

@ -1,5 +1,6 @@
package content.region.kandarin.ardougne.plaguecity.quest.elena
package content.region.kandarin.ardougne.quest.plaguecity.dialogue
import content.data.Quests
import core.api.getQuestStage
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
@ -8,7 +9,6 @@ import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.NPCs
import content.data.Quests
@Initializable
class MarthaRehnisonDialogue(player: Player? = null) : DialoguePlugin(player) {

View file

@ -1,5 +1,6 @@
package content.region.kandarin.ardougne.plaguecity.quest.elena
package content.region.kandarin.ardougne.quest.plaguecity.dialogue
import content.data.Quests
import core.api.getQuestStage
import core.api.setQuestStage
import core.game.dialogue.DialoguePlugin
@ -9,7 +10,6 @@ import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.NPCs
import content.data.Quests
@Initializable
class MilliRehnisonDialogue(player: Player? = null) : DialoguePlugin(player) {
@ -19,7 +19,7 @@ class MilliRehnisonDialogue(player: Player? = null) : DialoguePlugin(player) {
if (player.questRepository.getStage(Quests.PLAGUE_CITY) == 9) {
playerl(FacialExpression.FRIENDLY, "Hello. Your parents say you saw what happened to Elena...").also { stage++ }
} else {
npcl(FacialExpression.FRIENDLY, "Any luck finding Elena yet?").also { stage++ }
npcl(FacialExpression.CHILD_FRIENDLY, "Any luck finding Elena yet?").also { stage++ }
}
return true
}
@ -28,24 +28,26 @@ class MilliRehnisonDialogue(player: Player? = null) : DialoguePlugin(player) {
when (getQuestStage(player!!, Quests.PLAGUE_CITY)) {
9 -> when(stage) {
1 -> npcl(FacialExpression.NEUTRAL, "*sniff* Yes I was near the south east corner when I saw Elena walking by. I was about to run to greet her when some men jumped out. They shoved a sack over her head and dragged her into a building.").also { stage++ }
// Wordwrap doesn't match using npcl
1 -> npc(FacialExpression.CHILD_SAD, "*sniff* Yes I was near the south east corner when I",
"saw Elena walking by. I was about to run to greet her",
"when some men jumped out. They shoved a sack over",
"her head and dragged her into a building.").also { stage++ }
2 -> playerl(FacialExpression.FRIENDLY, "Which building?").also { stage++ }
3 -> npcl(FacialExpression.NEUTRAL, "It was the boarded up building with no windows in the south east corner of West Ardougne.").also { stage++ }
4 -> {
end()
setQuestStage(player!!, Quests.PLAGUE_CITY, 11)
3 -> npcl(FacialExpression.CHILD_NORMAL, "It was the boarded up building with no windows in the south east corner of West Ardougne.").also {
stage = END_DIALOGUE
setQuestStage(player!!, Quests.PLAGUE_CITY, 11)
}
}
in 10..98 -> when (stage) {
1 -> playerl(FacialExpression.FRIENDLY, "Not yet...").also { stage++ }
2 -> npcl(FacialExpression.FRIENDLY, "I wish you luck, she did a lot for us.").also { stage = END_DIALOGUE }
2 -> npcl(FacialExpression.CHILD_FRIENDLY, "I wish you luck, she did a lot for us.").also { stage = END_DIALOGUE }
}
in 99..100 -> when (stage) {
1 -> playerl(FacialExpression.FRIENDLY, "Yes, she is safe at home now.").also { stage++ }
2 -> npcl(FacialExpression.FRIENDLY, "That's good to hear, she helped us a lot.").also { stage = END_DIALOGUE }
2 -> npcl(FacialExpression.CHILD_FRIENDLY, "That's good to hear, she helped us a lot.").also { stage = END_DIALOGUE }
}
}
return true

View file

@ -1,5 +1,6 @@
package content.region.kandarin.ardougne.plaguecity.quest.elena
package content.region.kandarin.ardougne.quest.plaguecity.dialogue
import content.data.Quests
import core.api.getQuestStage
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
@ -8,7 +9,6 @@ import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.NPCs
import content.data.Quests
@Initializable
class TedRehnisonDialogue(player: Player? = null) : DialoguePlugin(player) {
@ -30,7 +30,7 @@ class TedRehnisonDialogue(player: Player? = null) : DialoguePlugin(player) {
9 -> when (stage) {
1 -> npcl(FacialExpression.FRIENDLY, "Yes she was staying here, but slightly over a week ago she was getting ready to go back. However she never managed to leave. My daughter Milli was playing near the west wall when she saw some shadowy figures jump").also { stage++ }
2 -> npcl(FacialExpression.FRIENDLY, "out and grab her. Milli is upstairs if you wish to speak to her.").also { stage = END_DIALOGUE }
2 -> npc(FacialExpression.FRIENDLY, "out and grab her. Milli is upstairs if you wish to speak", "to her.").also { stage = END_DIALOGUE }
}
in 10..98 -> when (stage) {

View file

@ -0,0 +1,61 @@
package content.region.kandarin.ardougne.quest.plaguecity.dialogue.mourners
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.dialogue.Topic
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.NPCs
/**
* This is the Mourner patrolling close to the wall in E Ardougne
*/
@Initializable
class MournerArdougneWallDialogue(player: Player? = null) : DialoguePlugin(player){
companion object{
const val START_DIALOGUE = 0
const val PLAGUE = 20
const val SYMPTOMS = 40
}
override fun open(vararg args: Any?): Boolean {
playerl(FacialExpression.NEUTRAL, "Hi.").also { stage = START_DIALOGUE }
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when(stage){
START_DIALOGUE -> npcl(FacialExpression.NEUTRAL, " What are you up to?").also { stage++ }
START_DIALOGUE + 1 -> playerl(FacialExpression.NEUTRAL, " Just sight-seeing.").also { stage++ }
START_DIALOGUE + 2 -> npcl(FacialExpression.NEUTRAL, "This is no place for sight-seeing. Don't you know there's been a plague outbreak?").also { stage++ }
START_DIALOGUE + 3 -> playerl(FacialExpression.NEUTRAL, " Yes, I had heard.").also { stage++ }
START_DIALOGUE + 4 -> npcl(FacialExpression.NEUTRAL, " Then I suggest you leave as soon as you can.").also { stage++ }
START_DIALOGUE + 5 -> showTopics(
Topic("What brought the plague to Ardougne?", PLAGUE),
Topic("What are the symptoms of the plague?", SYMPTOMS),
Topic("Thanks for the advice.", END_DIALOGUE),
)
PLAGUE -> npcl(FacialExpression.NEUTRAL, " It's all down to King Tyras of West Ardougne. " +
"'Rather than protecting his people he spends his time in the lands to the West. ").also { stage++ }
PLAGUE + 1 -> npcl(FacialExpression.NEUTRAL, "When he returned last he brought the plague with him then left before the problem became serious.").also { stage++ }
PLAGUE + 2 -> playerl(FacialExpression.ASKING, " Does he know how bad the situation is now?").also { stage++ }
PLAGUE + 3 -> npcl(FacialExpression.ANGRY, " If he did he wouldn't care. I believe he wants his people to suffer, he's an evil man.").also { stage++ }
PLAGUE + 4 -> playerl(FacialExpression.EXTREMELY_SHOCKED, " Isn't that treason?").also { stage++ }
PLAGUE + 5 -> npcl(FacialExpression.DISGUSTED_HEAD_SHAKE, " He's not my king.").also { stage = END_DIALOGUE }
SYMPTOMS -> npcl(FacialExpression.NEUTRAL, "The first signs are typical flu symptoms. These tend to be followed by severe nightmares, horrifying hallucinations which drive many to madness.").also { stage++ }
SYMPTOMS + 1 -> playerl(FacialExpression.DISGUSTED, "Sounds nasty.").also { stage++ }
SYMPTOMS + 2 -> npcl(FacialExpression.NEUTRAL, " It gets worse. Next the victim's blood changes into a thick black tar-like liquid, at this point they're past help.").also { stage++ }
SYMPTOMS + 3 -> npcl(FacialExpression.NEUTRAL, "Their skin is cold to the touch, the victim is now brain dead. Their body however lives on driven by the virus, roaming like a zombie, spreading itself further wherever possible.").also { stage++ }
SYMPTOMS + 4 -> playerl(FacialExpression.DISGUSTED_HEAD_SHAKE, " I think I've heard enough.").also { stage = END_DIALOGUE }
}
return true
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.MOURNER_719)
}
}

View file

@ -0,0 +1,115 @@
package content.region.kandarin.ardougne.quest.plaguecity.dialogue.mourners
import content.data.Quests
import core.api.getQuestStage
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.dialogue.Topic
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.NPCs
/**
* This is for the mourner wandering around Edmonds house
*/
@Initializable
class MournerEdmondHouseDialogue(player: Player? = null) : DialoguePlugin(player){
companion object {
const val BEFORE_PLAGUE_CITY = 10
const val BEFORE_GAS_MASK = 20
const val BEFORE_SOFTEN_GROUND = 30
const val SYMPTOMS1 = 40
const val FEEL_FINE = 50
const val PLAGUE_SOURCE1 = 60
const val BEFORE_DIG = 70
const val AFTER_DIG = 80
const val AFTER_ENTER_W_ARDOUGNE = 90
}
override fun open(vararg args: Any?): Boolean {
when (getQuestStage(player, Quests.PLAGUE_CITY)){
0 -> playerl(FacialExpression.NEUTRAL, "Hello there.").also { stage = BEFORE_PLAGUE_CITY }
1 -> playerl(FacialExpression.NEUTRAL, "Hello.").also { stage = BEFORE_GAS_MASK }
2 -> playerl(FacialExpression.NEUTRAL, "Hello.").also { stage = BEFORE_SOFTEN_GROUND }
3 -> playerl(FacialExpression.NEUTRAL, "Hello.").also { stage = BEFORE_DIG }
4 -> playerl(FacialExpression.NEUTRAL, "Hello there.").also { stage = AFTER_DIG }
else -> playerl(FacialExpression.NEUTRAL, "Hello.").also { stage = AFTER_ENTER_W_ARDOUGNE }
}
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when(stage){
BEFORE_PLAGUE_CITY -> npcl(FacialExpression.NEUTRAL, "Do you have a problem traveller?").also { stage++ }
BEFORE_PLAGUE_CITY + 1 -> playerl(FacialExpression.ASKING, "No, I just wondered why you're wearing that outfit... Is it fancy dress?").also { stage++ }
BEFORE_PLAGUE_CITY + 2 -> npcl(FacialExpression.NEUTRAL, "No! It's for protection.").also { stage++ }
BEFORE_PLAGUE_CITY + 3 -> playerl(FacialExpression.ASKING, "Protection from what?").also { stage++ }
BEFORE_PLAGUE_CITY + 4 -> npcl(FacialExpression.NEUTRAL, "The plague of course...").also { stage = END_DIALOGUE }
BEFORE_GAS_MASK -> npcl(FacialExpression.NEUTRAL, "What do you want?").also { stage++ }
BEFORE_GAS_MASK + 1 -> showTopics(
Topic("Who are you?", BEFORE_GAS_MASK + 3),
Topic("Nothing, just being polite.", BEFORE_GAS_MASK + 2)
)
BEFORE_GAS_MASK + 2 -> npcl(FacialExpression.NEUTRAL, "Hmmm, ok then. Be on your way.").also { stage = END_DIALOGUE }
BEFORE_GAS_MASK + 3 -> npcl(FacialExpression.NEUTRAL, "I'm a mourner. It's my job to help heal the plague victims of West Ardougne and to make sure the disease is contained.").also { stage++ }
BEFORE_GAS_MASK + 4 -> playerl(FacialExpression.THINKING, "Very noble of you.").also { stage++ }
BEFORE_GAS_MASK + 5 -> npcl(FacialExpression.NEUTRAL, "If you come down with any symptoms such as flu or nightmares let me know immediately.").also { stage = END_DIALOGUE }
BEFORE_SOFTEN_GROUND -> npcl(FacialExpression.NEUTRAL, "Are you ok?").also { stage++ }
BEFORE_SOFTEN_GROUND + 1 -> playerl(FacialExpression.NEUTRAL, "Yes, I'm fine thanks.").also { stage++ }
BEFORE_SOFTEN_GROUND + 2 -> npcl(FacialExpression.NEUTRAL, "Have you experienced any plague symptoms?").also { stage++ }
BEFORE_SOFTEN_GROUND + 3 -> showTopics(
Topic("What are the symptoms?", SYMPTOMS1),
Topic("No, I feel fine", FEEL_FINE),
Topic("No, but can you tell me where the plague came from?", PLAGUE_SOURCE1)
)
SYMPTOMS1 -> npcl(FacialExpression.NEUTRAL, "First you'll come down with heavy flu, this is usually followed by horrifying nightmares.").also { stage++ }
SYMPTOMS1 + 1 -> playerl(FacialExpression.HALF_WORRIED, "I used to have nightmares when I was younger.").also { stage++ }
SYMPTOMS1 + 2 -> npcl(FacialExpression.NEUTRAL, "Not like these I assure you. Soon after a thick black liquid will seep from your nose and eyes.").also { stage++ }
SYMPTOMS1 + 3 -> playerl(FacialExpression.HALF_WORRIED, "Yuck!").also { stage++ }
SYMPTOMS1 + 4 -> npcl(FacialExpression.HALF_WORRIED, "When it gets to that stage there's nothing we can do for you.").also { stage = END_DIALOGUE }
FEEL_FINE -> npcl(FacialExpression.NEUTRAL, "Well if you take a turn for the worse let me know straight away.").also { stage++ }
FEEL_FINE + 1 -> playerl(FacialExpression.HALF_WORRIED, "Can you cure it then?").also { stage++ }
FEEL_FINE + 2 -> npcl(FacialExpression.NEUTRAL, "No... But you will have to be treated.").also { stage++ }
FEEL_FINE + 3 -> playerl(FacialExpression.WORRIED, "Treated?").also { stage++ }
FEEL_FINE + 4 -> npcl(FacialExpression.NEUTRAL, "We have to take measures to contain the disease. " +
"That's why you must let us know immediately if you take a turn for the worse.").also { stage = END_DIALOGUE }
PLAGUE_SOURCE1 -> npcl(FacialExpression.NEUTRAL, "It all started when King Tyras of West Ardougne came back from one of his visits to the lands west of here.").also { stage++ }
PLAGUE_SOURCE1 + 1 -> npcl(FacialExpression.NEUTRAL, "Some of his men must have unknowingly caught it out there and brought it back with them").also { stage = END_DIALOGUE }
BEFORE_DIG -> npcl(FacialExpression.ASKING, "What are you up to with old man Edmond?").also { stage++ }
BEFORE_DIG + 1 -> playerl(FacialExpression.HALF_GUILTY, "Nothing, we've just been chatting.").also { stage++ }
BEFORE_DIG + 2 -> npcl(FacialExpression.ASKING, "What about his daughter?").also { stage++ }
BEFORE_DIG + 3 -> playerl(FacialExpression.HALF_GUILTY, "Oh, you know about that then?").also { stage++ }
BEFORE_DIG + 4 -> npcl(FacialExpression.NEUTRAL, "We know about everything that goes on in Ardougne. We have to if we are to contain the plague.").also { stage++ }
BEFORE_DIG + 5 -> playerl(FacialExpression.HALF_ASKING, "Have you see his daughter recently?").also { stage++ }
BEFORE_DIG + 6 -> npcl(FacialExpression.NEUTRAL, "I imagine she's caught the plague. Either way she won't be allowed out of West Ardougne, the risk is too great.").also { stage = END_DIALOGUE }
AFTER_DIG -> npcl(FacialExpression.ASKING, "Been digging have we?").also { stage++ }
AFTER_DIG + 1 -> playerl(FacialExpression.HALF_GUILTY, "What do you mean?").also { stage++ }
AFTER_DIG + 2 -> npcl(FacialExpression.NEUTRAL, "Your hands are covered in mud.").also { stage++ }
AFTER_DIG + 3 -> playerl(FacialExpression.HALF_GUILTY, "Oh that...").also { stage++ }
AFTER_DIG + 4 -> npcl(FacialExpression.THINKING, "Funny, you don't look like the gardening type.").also { stage++ }
AFTER_DIG + 5 -> playerl(FacialExpression.NEUTRAL, "Oh no, I love gardening! It's my favorite pastime.").also { stage = END_DIALOGUE }
AFTER_ENTER_W_ARDOUGNE -> npcl(FacialExpression.ASKING, " What are you up to?").also { stage++ }
AFTER_ENTER_W_ARDOUGNE + 1 -> playerl(FacialExpression.HALF_GUILTY, "Nothing.").also { stage++ }
AFTER_ENTER_W_ARDOUGNE + 2 -> npcl(FacialExpression.SUSPICIOUS, "I don't trust you.").also { stage++ }
AFTER_ENTER_W_ARDOUGNE + 3 -> playerl(FacialExpression.NEUTRAL, "You don't have to.").also { stage++ }
AFTER_ENTER_W_ARDOUGNE + 4 -> npcl(FacialExpression.SUSPICIOUS, "If I find you attempting to cross the wall I'll make sure you never return.").also { stage = END_DIALOGUE }
}
return true
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.MOURNER_718)
}
}

View file

@ -1,5 +1,6 @@
package content.region.kandarin.ardougne.plaguecity.quest.elena
package content.region.kandarin.ardougne.quest.plaguecity.dialogue.mourners
import content.data.Quests
import core.api.getQuestStage
import core.api.setQuestStage
import core.game.dialogue.DialogueFile
@ -8,12 +9,11 @@ import core.game.node.entity.npc.NPC
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.NPCs
import content.data.Quests
@Initializable
class HeadMournerDialogue : DialogueFile() {
class MournerGuardDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
npc = NPC(NPCs.HEAD_MOURNER_716)
npc = NPC(NPCs.MOURNER_717)
when (getQuestStage(player!!, Quests.PLAGUE_CITY)) {
in 8..10 -> when (stage) {
@ -38,8 +38,8 @@ class HeadMournerDialogue : DialogueFile() {
2 -> options("But I think a kidnap victim is in here.", "I fear not a mere plague.", "Thanks for the warning.").also { stage++ }
3 -> when (buttonID) {
1 -> playerl(FacialExpression.FRIENDLY, "But I think a kidnap victim is in here.").also { stage = 5 }
2 -> playerl(FacialExpression.FRIENDLY, "I fear not a mere plague.").also { stage = 4 }
3 -> playerl(FacialExpression.FRIENDLY, "Thanks for the warning.").also { stage = END_DIALOGUE }
2 -> playerl(FacialExpression.FRIENDLY, "I fear not a mere plague.").also { stage = 5 }
3 -> playerl(FacialExpression.FRIENDLY, "Thanks for the warning.").also { stage = 4 }
}
4 -> playerl(FacialExpression.FRIENDLY, "Thanks for the warning.").also { stage = END_DIALOGUE }

View file

@ -0,0 +1,184 @@
package content.region.kandarin.ardougne.quest.plaguecity.dialogue.mourners
import content.data.Quests
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.dialogue.Topic
import core.game.global.action.DoorActionHandler
import core.game.interaction.QueueStrength
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.game.world.map.Location
import core.game.world.map.RegionManager
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
/**
* These are the mourners guarding the kidnap building
*/
@Initializable
class MournerKidnapDialogue(player: Player? = null) :DialoguePlugin(player) {
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
openDialogue(player, MournerKidnapDialogueFile(), npc)
return true
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.MOURNER_3216)
}
}
/**
* Most of the work is in the dialogue file so the player can access this by trying to enter the room
*/
class MournerKidnapDialogueFile : DialogueFile(){
companion object {
const val KIDNAP = 10
const val FEAR = 30
const val CLEARANCE = 40
var closeMourner : NPC? = null
var farMourner : NPC? = null
val eDoor: Location = Location.create(2540, 3273, 0)
val wDoor: Location = Location.create(2533, 3273, 0)
var east = false
}
override fun handle(componentID: Int, buttonID: Int) {
// Figure out who we are. It needs to be this since we can enter this dialogue from a door
// Do this for the first time regardless of where we are
if (stage == 0) {
RegionManager.getLocalNpcs(player!!, 2).forEach {
if (it.id == NPCs.MOURNER_3216) {
closeMourner = it
resetFace(closeMourner!!)
face(closeMourner!!, player!!)
face(player!!, closeMourner!!)
}
}
east = player!!.location.x > 2537
}
if (hasAnItem(player!!, Items.WARRANT_1503).exists()){
when (stage){
0 -> npcl(
FacialExpression.NEUTRAL,
" I'd stand away from there. That black cross means that house has been touched by the plague."
).also { stage++ }
1 -> playerl(FacialExpression.FRIENDLY, " I have a warrant from Bravek to enter here.").also { stage++ }
2 -> npcl(FacialExpression.HALF_WORRIED, " This is highly irregular. Please wait...").also { stage++ }
3 -> {
// Look further for the other one
RegionManager.getLocalNpcs(player!!, 10).forEach {
if (it.id == NPCs.MOURNER_3216 && it != closeMourner){
farMourner = it
resetFace(farMourner!!)
}
}
// I don't know why the queue has to be on this mourner to get both talking
val mournerQueue = if (east) farMourner else closeMourner
queueScript(mournerQueue!!, 1, QueueStrength.WEAK) { animStage: Int ->
when(animStage){
0 -> {
end()
forceWalk(player!!, if (east) eDoor else wDoor, "smart")
face(closeMourner!!, farMourner!!)
// Legit typo
sendChat(closeMourner!!, "Hay... I got someone here with a warrant from Bravek, what should we do?")
// Immediately set the quest stage in case the player clicks again
if (getQuestStage(player!!, Quests.PLAGUE_CITY) < 17){
setQuestStage(player!!, Quests.PLAGUE_CITY, 17)
}
return@queueScript delayScript(mournerQueue, 1)
}
3 -> {
face(farMourner!!, closeMourner!! )
sendChat(farMourner!!, "Well you can't let them in...")
return@queueScript delayScript(mournerQueue, 1)
}
5 -> {
resetFace(player!!)
return@queueScript delayScript(mournerQueue, 1)
}
6 -> {
// only walk the player if they have not walked themselves through
if (player!!.location.y > 3272)
DoorActionHandler.handleAutowalkDoor(player, getScenery (if (east) eDoor else wDoor))
sendDialogue(player!!, "You wait until the mourner's back is turned and sneak into the building.").also { stage = END_DIALOGUE}
resetFace(closeMourner!!)
resetFace(farMourner!!)
return@queueScript delayScript(mournerQueue, 1)
}
10 -> {
// Face north again
face(closeMourner!!, Location.create(closeMourner!!.location.x, 3275, 0))
face(farMourner!!, Location.create(farMourner!!.location.x, 3275, 0))
return@queueScript stopExecuting(mournerQueue)
}
}
return@queueScript delayScript(mournerQueue, 1)
}
}
}
}
else {
when (stage) {
0 -> npcl(
FacialExpression.NEUTRAL,
" I'd stand away from there. That black cross means that house has been touched by the plague."
).also { stage = if (getQuestStage(player!!, Quests.PLAGUE_CITY) == 11) stage + 1 else END_DIALOGUE }
1 -> showTopics(
Topic("But I think a kidnap victim is in here.", KIDNAP),
Topic("I fear not a mere plague.", FEAR),
Topic("Thanks for the warning.", END_DIALOGUE),
)
KIDNAP -> npcl(
FacialExpression.NEUTRAL,
"Sounds unlikely, even kidnappers wouldn't go in there. Even if someone is in there, they're probably dead by now."
).also { stage++ }
KIDNAP + 1 -> showTopics(
Topic("Good point.", END_DIALOGUE),
Topic("I want to check anyway.", KIDNAP + 2)
)
KIDNAP + 2 -> npcl(FacialExpression.NEUTRAL, "You don't have clearance to go in there.").also {
stage = CLEARANCE
}
FEAR -> npcl(
FacialExpression.NEUTRAL,
" That's irrelevant. You don't have clearance to go in there."
).also { stage = CLEARANCE }
CLEARANCE -> playerl(FacialExpression.ASKING, " How do I get clearance?").also { stage++ }
CLEARANCE + 1 -> npcl(
FacialExpression.NEUTRAL,
" Well you'd need to apply to the head mourner, or I suppose Bravek the city warder."
).also { stage++ }
CLEARANCE + 2 -> npcl(FacialExpression.NEUTRAL, " I wouldn't get your hopes up though.").also {
stage = END_DIALOGUE
setQuestStage(player!!, Quests.PLAGUE_CITY, 12)
}
}
}
}
}

View file

@ -0,0 +1,57 @@
package content.region.kandarin.ardougne.westardougne
import core.api.EquipmentSlot
import core.api.allInEquipment
import core.api.getItemFromEquipment
import core.api.inEquipment
import core.game.node.entity.player.Player
import org.rs09.consts.Items
object MournerUtilities {
const val NO_GEAR = 0
const val JUST_MASK = 1
const val JUST_GEAR = 2
const val EXTRA_GEAR = 3
/**
* Check if the player is wearing just mourner gear
* @return 0 incomplete gear 1 mask only 2 complete gear only 3 complete gear with extras
*/
fun wearingMournerGear(player: Player): Int {
// Check that the play has all of these items
if (inEquipment(player, Items.GAS_MASK_1506)) {
// We have a mask
if (!allInEquipment(
player, Items.MOURNER_TOP_6065, Items.MOURNER_TROUSERS_6067,
Items.MOURNER_BOOTS_6069, Items.MOURNER_GLOVES_6068, Items.MOURNER_CLOAK_6070
)
) {
// We have only a mask
return JUST_MASK
}
else {
// Check if we have other gear
// These use up slots 0, 1, 4, 7, 9, 10. Check the others are empty
val mournerSlots = arrayOf(
EquipmentSlot.HEAD, EquipmentSlot.CAPE, EquipmentSlot.CHEST,
EquipmentSlot.LEGS, EquipmentSlot.HANDS, EquipmentSlot.FEET
)
for (slot in EquipmentSlot.values()) {
// Skip the slots that we know have the gear equipped
if (mournerSlots.contains(slot)) continue
if (getItemFromEquipment(player, slot) != null) {
return EXTRA_GEAR
}
}
return JUST_GEAR
}
}
else {
// We don't even have a mask
return NO_GEAR
}
}
}

View file

@ -1,4 +1,4 @@
package content.region.kandarin.ardougne.plaguecity.dialogue
package content.region.kandarin.ardougne.westardougne.dialogue
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression

View file

@ -1,5 +1,6 @@
package content.region.kandarin.ardougne.plaguecity.dialogue
package content.region.kandarin.ardougne.westardougne.dialogue
import content.region.kandarin.ardougne.westardougne.MournerUtilities
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
@ -18,9 +19,8 @@ class ChildDialogue(player: Player? = null) : DialoguePlugin(player) {
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
0 -> npcl(FacialExpression.FRIENDLY, "I'm not allowed to speak with strangers.").also { stage = END_DIALOGUE }
}
val noun = if (MournerUtilities.wearingMournerGear(player) > MournerUtilities.JUST_MASK) "mourners" else "strangers"
npcl(FacialExpression.CHILD_NORMAL, "I'm not allowed to speak with $noun.").also { stage = END_DIALOGUE }
return true
}
@ -29,7 +29,7 @@ class ChildDialogue(player: Player? = null) : DialoguePlugin(player) {
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.CHILD_6339, NPCs.CHILD_6345, NPCs.CHILD_356)
return intArrayOf(NPCs.CHILD_356, NPCs.CHILD_355)
}
}

View file

@ -0,0 +1,181 @@
package content.region.kandarin.ardougne.westardougne.dialogue
import content.region.kandarin.ardougne.westardougne.MournerUtilities
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.dialogue.Topic
import core.game.interaction.IntType
import core.game.interaction.InteractionListener
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
val cats = intArrayOf(
Items.PET_CAT_1561,
Items.PET_CAT_1562,
Items.PET_CAT_1563,
Items.PET_CAT_1564,
Items.PET_CAT_1565,
Items.PET_CAT_1566,
Items.OVERGROWN_CAT_1567,
Items.OVERGROWN_CAT_1568,
Items.OVERGROWN_CAT_1569,
Items.OVERGROWN_CAT_1570,
Items.OVERGROWN_CAT_1571,
Items.OVERGROWN_CAT_1572,
// todo implement these cats then uncomment this
// otherwise you get an exception which just steals your cat for no runes
// Items.LAZY_CAT_6549,
// Items.LAZY_CAT_6550,
// Items.LAZY_CAT_6551,
// Items.LAZY_CAT_6552,
// Items.LAZY_CAT_6553,
// Items.LAZY_CAT_6554,
// Items.WILY_CAT_6555,
// Items.WILY_CAT_6556,
// Items.WILY_CAT_6557,
// Items.WILY_CAT_6558,
// Items.WILY_CAT_6559,
// Items.WILY_CAT_6560,
)
@Initializable
class CivilianDialogue(player: Player? = null) : DialoguePlugin(player) {
companion object {
// Any of these
const val DIAG1 = 10
const val DIAG2 = 20
const val DIAG3 = 30
const val NO_CAT = 40
const val BUY_CATS = 50
const val REJECT_DEAL = 80
const val WITCH_CAT = 90
const val MOURNER = 100
}
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if (MournerUtilities.wearingMournerGear(player) > MournerUtilities.JUST_MASK){
playerl(FacialExpression.NEUTRAL, "Hello.").also { stage = MOURNER }
}
else {
when (npc.id) {
NPCs.CIVILIAN_785 -> playerl(FacialExpression.NEUTRAL, "Hello there.").also { stage = DIAG1 }
NPCs.CIVILIAN_786 -> playerl(FacialExpression.NEUTRAL, "Hi there.").also { stage = DIAG2 }
NPCs.CIVILIAN_787 -> player(FacialExpression.NEUTRAL, "Hello there.").also { stage = DIAG3 }
}
}
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
DIAG1 -> npcl(FacialExpression.HALF_GUILTY, "Oh hello, I'm sorry, I'm a bit worn out.").also { stage++ }
DIAG1 + 1 -> playerl(FacialExpression.NEUTRAL, "Busy day?").also { stage++ }
DIAG1 + 2 -> npcl(FacialExpression.HALF_GUILTY, "Oh, It's those mice! They're everywhere! " +
"What I really need is a cat. But they're hard to come by nowadays.").also {
stage = checkCat()
}
DIAG2 -> npcl(FacialExpression.NEUTRAL, "Good day to you traveller.").also { stage++ }
DIAG2 + 1 -> playerl(FacialExpression.NEUTRAL, "What are you up to?").also { stage++ }
DIAG2 + 2 -> npcl(FacialExpression.NEUTRAL, "Chasing mice as usual! It's all I seem to do nowadays.").also { stage++ }
DIAG2 + 3 -> playerl(FacialExpression.NEUTRAL, "You must waste a lot of time?").also { stage++ }
DIAG2 + 4 -> npcl(FacialExpression.HALF_WORRIED, "Yes, but what can you do? It's not like there's many cats around here!").also{ stage = checkCat()
}
DIAG3 -> npcl(FacialExpression.HALF_WORRIED, "I'm a bit busy to talk right now, sorry.").also { stage++ }
DIAG3 + 1 -> playerl(FacialExpression.NEUTRAL, "Why? What are you doing?").also { stage++ }
DIAG3 + 2 -> npcl(FacialExpression.HALF_WORRIED, "Trying to kill these mice! What I really need is a cat!").also { stage = checkCat() }
NO_CAT -> playerl(FacialExpression.HALF_WORRIED, "No, you're right, you don't see many around.").also { stage = END_DIALOGUE }
BUY_CATS -> showTopics(
Topic("I have a cat that I could sell.", BUY_CATS + 1),
Topic("Nope, they're not easy to get hold of.", END_DIALOGUE)
)
// intentional whitespace typo
BUY_CATS + 1 -> npcl(FacialExpression.ASKING, "You don't say, is that it ?").also { stage++ }
BUY_CATS + 2 -> playerl(FacialExpression.HAPPY, "Say hello to a real mouse killer!").also { stage++ }
BUY_CATS + 3 -> npcl(FacialExpression.HALF_ASKING, "Hmmm, not bad, not bad at all. Looks like it's a lively one.").also { stage++ }
BUY_CATS + 4 -> playerl(FacialExpression.HALF_GUILTY, "Erm...kind of...").also { stage++ }
BUY_CATS + 5 -> npcl(FacialExpression.FRIENDLY, "I don't have much in the way of money. I do have these!").also { stage++ }
BUY_CATS + 6 -> sendDialogue("The peasant shows you a sack of Death Runes.").also { stage++ }
BUY_CATS + 7 -> npcl(FacialExpression.ASKING, "The dwarves bring them from the mine for us. Tell you what, I'll give you 100 Death Runes for the cat.").also { stage++ }
BUY_CATS + 8 -> showTopics(
Topic("Nope, I'm not parting for that.", REJECT_DEAL),
Topic("Ok then, you've got a deal.", BUY_CATS+9)
)
BUY_CATS + 9 -> {
npcl(FacialExpression.HAPPY, "Great! Hand over the cat and I'll give you the runes.").also {
stage = END_DIALOGUE
for (cat in cats) {
if (removeItem(player, cat)){
player.familiarManager.removeDetails(cat)
addItem(player, Items.DEATH_RUNE_560, 100)
break
}
}
}
}
REJECT_DEAL -> npcl(FacialExpression.HALF_GUILTY, "Well, I'm not giving you anymore!").also { stage = END_DIALOGUE }
WITCH_CAT -> playerl(FacialExpression.HAPPY, "I have a cat...look!").also { stage++ }
WITCH_CAT + 1 -> npcl(FacialExpression.HALF_WORRIED, "Hmmm...doesn't look like it's seen daylight in years. That's not going to catch any mice!").also { stage = END_DIALOGUE }
MOURNER -> npcl(FacialExpression.ANGRY, "If you Mourners really wanna help, why don't you do something about these mice?!").also { stage = END_DIALOGUE }
}
return true
}
private fun checkCat(): Int {
return if (anyInInventory(player, *cats)) BUY_CATS
else if (inInventory(player, Items.WITCHS_CAT_1491)) WITCH_CAT
else NO_CAT
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.CIVILIAN_785, NPCs.CIVILIAN_786, NPCs.CIVILIAN_787)
}
}
class CatTrade : InteractionListener{
override fun defineListeners() {
class CatTradeDialogue : DialogueFile(){
override fun handle(componentID: Int, buttonID: Int) {
when (stage){
0 -> sendDialogue(player!!, "You hand over the cat. You are given 100 Death Runes.").also { stage++ }
1 -> npcl(FacialExpression.HAPPY, "Great, thanks for that!").also { stage++ }
2 -> playerl(FacialExpression.NEUTRAL, "That's ok, take care.").also { stage = END_DIALOGUE }
}
}
}
onUseWith(IntType.NPC, cats, NPCs.CIVILIAN_785, NPCs.CIVILIAN_786, NPCs.CIVILIAN_787){ player, used, with ->
if(removeItem(player, used)){
val dialogue = CatTradeDialogue()
// Remove the cat
player.familiarManager.removeDetails(used.id)
addItem(player, Items.DEATH_RUNE_560, 100)
openDialogue(player, dialogue, with as NPC)
}
return@onUseWith true
}
}
}

View file

@ -0,0 +1,115 @@
package content.region.kandarin.ardougne.westardougne.dialogue
import content.data.Quests
import content.region.kandarin.ardougne.quest.plaguecity.PlagueCity
import content.region.kandarin.ardougne.westardougne.MournerUtilities
import core.api.*
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.dialogue.IfTopic
import core.game.dialogue.Topic
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import core.tools.START_DIALOGUE
import org.rs09.consts.NPCs
import kotlin.properties.Delegates
@Initializable
class HeadMournerDialogue(player: Player? = null) : DialoguePlugin(player) {
companion object {
const val CLEARANCE = 40
const val WHATS_A_MOURNER = 10
const val NO_PLAGUE = 20
const val ELENA = 30
const val CRAZY = 50
const val KIDNAP = 60
const val MASK = 70
var mourningGear by Delegates.notNull<Int>()
}
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
mourningGear = MournerUtilities.wearingMournerGear(player)
if(mourningGear < MournerUtilities.JUST_GEAR){
npcl(FacialExpression.ANGRY, "How did you get into West Ardougne? " +
"Ah well you'll have to stay, can't risk you spreading the plague outside.").also { stage++ }
}
else{
npcl(FacialExpression.NEUTRAL, "Ahh... A new recruit.").also { stage++ }
}
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when(mourningGear){
MournerUtilities.NO_GEAR, MournerUtilities.JUST_MASK -> when(stage){
START_DIALOGUE + 1 -> showTopics(
IfTopic("I need clearance to enter a plague house.", CLEARANCE,
!isQuestComplete(player, Quests.PLAGUE_CITY) && (getQuestStage(player, Quests.PLAGUE_CITY) > 11)),
Topic("So what's a mourner?", WHATS_A_MOURNER),
Topic("I haven't got the plague though. ", NO_PLAGUE),
IfTopic("I'm looking for a woman named Elena.", ELENA, !isQuestComplete(player, Quests.PLAGUE_CITY))
)
CLEARANCE -> npcl(FacialExpression.DISGUSTED, "You must be nuts, absolutely not!").also { stage++ }
CLEARANCE + 1 -> showTopics(
Topic("There's a kidnap victim inside!", KIDNAP),
Topic("I've got a gas mask though...", MASK),
Topic("Yes, I'm utterly crazy.", CRAZY)
)
KIDNAP -> npcl(FacialExpression.FRIENDLY, "Well they're as good as dead then, no point in trying to save them.").also { stage = END_DIALOGUE }
MASK -> npcl(FacialExpression.FRIENDLY, "It's not regulation. Anyway you're not properly trained to deal with the plague.").also { stage++ }
MASK + 1 -> playerl(FacialExpression.FRIENDLY, "How do I get trained?").also { stage++ }
MASK + 2 -> npcl(FacialExpression.FRIENDLY, "It requires a strict 18 months of training.").also { stage++ }
MASK + 3 -> playerl(FacialExpression.FRIENDLY, "I don't have that sort of time.").also { stage = END_DIALOGUE }
CRAZY -> npcl(FacialExpression.FRIENDLY, "You're wasting my time, I have a lot of work to do!").also { stage = END_DIALOGUE }
WHATS_A_MOURNER -> npcl(FacialExpression.NEUTRAL,
"We're working for King Lathas of East Ardougne trying to contain the accursed plague sweeping West Ardougne." +
" We also do our best to ease these people's suffering.").also { stage++ }
WHATS_A_MOURNER + 1 -> npcl(FacialExpression.NEUTRAL, "We're nicknamed mourners because we spend a lot of" +
" time at plague victim funerals, no-one else is allowed to risk the funerals." +
" It's a demanding job, and we get little thanks from the people here.").also { stage = END_DIALOGUE }
NO_PLAGUE -> npcl(FacialExpression.ANNOYED, "Can't risk you being a carrier. That protective clothing you have isn't regulation issue. It won't meet safety standards.").also { stage = END_DIALOGUE }
ELENA -> npcl(
FacialExpression.NEUTRAL,
"Ah yes, I've heard of her. A healer I believe. She must be mad coming over here voluntarily."
).also { stage++ }
ELENA + 1 -> npcl(
FacialExpression.SAD,
"I hear rumours she has probably caught the plague now. Very tragic, a stupid waste of life."
).also { stage = END_DIALOGUE }
}
MournerUtilities.JUST_GEAR, MournerUtilities.EXTRA_GEAR -> when(stage){
START_DIALOGUE+1 ->playerl(FacialExpression.ASKING, " How do you know I'm new?").also { stage++ }
START_DIALOGUE+2 -> npcl(FacialExpression.NEUTRAL, "Because all the old members of the guard know to report to the real Head Mourner, not me.").also { if (mourningGear == MournerUtilities.EXTRA_GEAR) stage++ else stage+=2 }
START_DIALOGUE+3 -> npcl(FacialExpression.ANNOYED, "Also, none of the old timers use non-regulation gear.").also { stage++ }
START_DIALOGUE+4 -> playerl(FacialExpression.ASKING, " You're not the real overseer here?").also { stage++ }
START_DIALOGUE+5 -> npcl(FacialExpression.NEUTRAL, "No, I am just a front man, our true head is far too busy to deal with the requests of the citizens, so I conduct the day to day business here.").also { stage++ }
START_DIALOGUE+6 -> npcl(FacialExpression.NEUTRAL, "You should go and report in" + if(mourningGear == MournerUtilities.EXTRA_GEAR) ", I would lose the non-regulation gear as well if I were you." else "." ).also { stage++ }
START_DIALOGUE+7 -> playerl(FacialExpression.FRIENDLY, "Okay, thanks.").also { stage = END_DIALOGUE }
}
}
return true
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.HEAD_MOURNER_716)
}
}

View file

@ -0,0 +1,81 @@
package content.region.kandarin.ardougne.westardougne.dialogue
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.dialogue.Topic
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import core.tools.RandomFunction
import org.rs09.consts.NPCs
@Initializable
class ManWomanDialogue(player: Player? = null) : DialoguePlugin(player) {
companion object {
const val DIAG1 = 10
const val DIAG2 = 20
const val DIAG3 = 30
const val DIAG4 = 40
const val DIAG5 = 50
}
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
val path = RandomFunction.random(1, 6)
val msg = when(path){
1,5 -> "Good day."
2 -> "Hi there."
3, 4 -> "Hello, how's it going?"
else -> "Hello"
}
playerl(FacialExpression.FRIENDLY, msg).also { stage = path * 10 }
return true
}
override fun handle(componentID: Int, buttonID: Int): Boolean {
when (stage){
DIAG1 -> npcl(FacialExpression.HALF_ASKING, "An outsider! Can you get me out of this hell hole?").also { stage++ }
DIAG1 + 1 -> playerl(FacialExpression.SAD, "Sorry, that's not what I'm here to do.").also { stage = END_DIALOGUE }
DIAG2 -> npcl(FacialExpression.ANNOYED, "Go away. People from the outside shut us in like animals. I have nothing to say to you.").also { stage = END_DIALOGUE }
DIAG3 -> npcl(FacialExpression.SAD, "Life is tough.").also { stage++ }
DIAG3 + 1 -> showTopics(
Topic("Yes, living in a plague city must be hard.", DIAG3 + 2),
Topic("I'm sorry to hear that.", DIAG3 + 3),
Topic("I'm looking for a lady called Elena.", DIAG3 + 4)
)
DIAG3 + 2 -> npcl(FacialExpression.HALF_GUILTY, "Plague? Pah, that's no excuse for the treatment we've received. It's obvious pretty quickly if someone has the plague. I'm thinking about making a break for it. I'm perfectly healthy, not gonna infect anyone.").also { stage = END_DIALOGUE }
DIAG3 + 3 -> npcl(FacialExpression.SAD, "Well, aint much either you or me can do about it.").also { stage = END_DIALOGUE }
DIAG3 + 4 -> npcl(FacialExpression.NEUTRAL, "I've not heard of her. Old Jethick knows a lot of people, maybe he'll know where you can find her.").also { stage = END_DIALOGUE }
DIAG4 -> npcl(FacialExpression.ANNOYED, "Bah, those mourners... they're meant to be helping us, but I think they're doing more harm here than good. They won't even let me send a letter out to my family.").also{ stage++}
DIAG4 + 1 -> showTopics(
Topic("Have you seen a lady called Elena around here?", DIAG4 + 2),
Topic("You should stand up to them more.", DIAG4 + 3)
)
DIAG4 + 2 -> npcl(FacialExpression.SAD, "Yes, I've seen her. Very helpful person. Not for the last few days though... I thought maybe she'd gone home.").also { stage = END_DIALOGUE }
DIAG4 + 3 -> npcl(FacialExpression.HALF_GUILTY, " Oh I'm not one to cause a fuss.").also { stage = END_DIALOGUE }
DIAG5 -> npcl(FacialExpression.ANGRY, "We don't have good days here anymore. Curse King Tyras.").also { stage++ }
DIAG5 + 1 -> showTopics(
Topic("Oh ok, bad day then.", END_DIALOGUE),
Topic("Why, what has he done?", DIAG5 + 2),
Topic("I'm looking for a woman called Elena.", DIAG5 + 3)
)
DIAG5 + 2 -> npcl(FacialExpression.ANGRY, "His army curses our city with this plague then wanders off again, leaving us to clear up the pieces.").also { stage = END_DIALOGUE }
DIAG5 + 3 -> npcl(FacialExpression.NEUTRAL, "Not heard of her.").also { stage = END_DIALOGUE }
}
return true
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.MAN_728, NPCs.MAN_729, NPCs.MAN_351,
NPCs.WOMAN_352, NPCs.WOMAN_353, NPCs.WOMAN_354, NPCs.WOMAN_360, NPCs.WOMAN_361, NPCs.WOMAN_362, NPCs.WOMAN_363)
}
}

View file

@ -0,0 +1,114 @@
package content.region.kandarin.ardougne.westardougne.dialogue
import content.data.Quests
import content.region.kandarin.ardougne.quest.plaguecity.PlagueCity
import content.region.kandarin.ardougne.westardougne.MournerUtilities.EXTRA_GEAR
import content.region.kandarin.ardougne.westardougne.MournerUtilities.JUST_GEAR
import content.region.kandarin.ardougne.westardougne.MournerUtilities.JUST_MASK
import content.region.kandarin.ardougne.westardougne.MournerUtilities.NO_GEAR
import content.region.kandarin.ardougne.westardougne.MournerUtilities.wearingMournerGear
import core.api.getQuestStage
import core.game.dialogue.*
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.NPCs
@Initializable
class MournerDialogue(player: Player? = null) : DialoguePlugin(player) {
companion object{
const val WHATS_A_MOURNER = 10
const val NO_PLAGUE = 20
const val ELENA = 30
const val CONVO_1 = 40
const val CONVO_2 = 50
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when(wearingMournerGear(player)){
NO_GEAR, JUST_MASK -> {
if (npc.id == NPCs.MOURNER_717) {
when (stage) {
0 -> npcl(
FacialExpression.HALF_ASKING,
"Hmmm, how did you get over here? You're not one of this rabble. Ah well, you'll have to stay. Can't risk you going back now."
).also { stage++ }
1 -> showTopics(
Topic("So what's a mourner?", WHATS_A_MOURNER),
Topic("I haven't got the plague though... ", NO_PLAGUE),
IfTopic(
"I'm looking for a woman named Elena.",
ELENA,
getQuestStage(player, Quests.PLAGUE_CITY) in (6..98)
)
)
WHATS_A_MOURNER -> npcl(
FacialExpression.NEUTRAL,
"We're working for King Lathas of East Ardougne trying to contain the accursed plague sweeping West Ardougne." +
" We also do our best to ease these people's suffering."
).also { stage++ }
WHATS_A_MOURNER + 1 -> npcl(
FacialExpression.NEUTRAL, "We're nicknamed mourners because we spend a lot of" +
" time at plague victim funerals, no-one else is allowed to risk the funerals." +
" It's a demanding job, and we get little thanks from the people here."
).also { stage = END_DIALOGUE }
ELENA -> npcl(
FacialExpression.NEUTRAL,
"Ah yes, I've heard of her. A healer I believe. She must be mad coming over here voluntarily."
).also { stage++ }
ELENA + 1 -> npcl(
FacialExpression.SAD,
"I hear rumours she has probably caught the plague now. Very tragic, a stupid waste of life."
).also { stage = END_DIALOGUE }
NO_PLAGUE -> npcl(
FacialExpression.ANNOYED,
"Can't risk you being a carrier. That protective clothing you have isn't regulation issue. It won't meet safety standards."
).also { stage = END_DIALOGUE }
}
}
else{
npcl(FacialExpression.ANNOYED, "Stand back citizen, do not approach me.").also { stage = END_DIALOGUE }
}
}
JUST_GEAR -> {
when(stage){
0 -> playerl(FacialExpression.NEUTRAL, "Hello.").also {
stage = if((0..1).random() > 0) CONVO_1 else CONVO_2
}
CONVO_1 -> npcl(FacialExpression.NEUTRAL, "Good day. Are you in need of assistance?").also { stage++ }
CONVO_1 + 1 -> playerl(FacialExpression.NEUTRAL, " Yes, but I don't think you can help.").also { stage++ }
CONVO_1 + 2 -> npcl(FacialExpression.NEUTRAL, " You will be surprised at how much help the brute force of the Guard can be.").also { stage++ }
CONVO_1 + 3 -> playerl(FacialExpression.NEUTRAL, " Well I'll be sure to ask if I'm in need of some muscle.").also { stage = END_DIALOGUE }
CONVO_2 -> npcl(FacialExpression.ANNOYED, " Good day. Are you in need of assistance?").also { stage++ }
CONVO_2 + 1 -> playerl(FacialExpression.NEUTRAL, " No, I just wanted to talk to a friendly face.").also { stage++ }
CONVO_2 + 2 -> npcl(FacialExpression.ANGRY, " Do I look friendly to you? I really must work on my scowl more.").also { stage = END_DIALOGUE }
}
}
EXTRA_GEAR -> {
when(stage){
0 -> npcl(FacialExpression.ANNOYED, "You should know better than to wear non-regulation gear.").also { stage++ }
1 -> playerl(FacialExpression.HALF_GUILTY, "Sorry, I'm new around here.").also { stage++ }
2 -> npcl(FacialExpression.ANNOYED, "Well, you know the drill - lose the gear, I will let it pass this time.").also { stage = END_DIALOGUE }
}
}
}
return true
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.MOURNER_717, NPCs.MOURNER_348, NPCs.MOURNER_347, NPCs.MOURNER_371, NPCs.MOURNER_369)
}
}

View file

@ -1,4 +1,4 @@
package content.region.kandarin.ardougne.plaguecity.dialogue
package content.region.kandarin.ardougne.westardougne.dialogue
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
@ -20,7 +20,7 @@ class NurseSarahDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
0 -> npcl(FacialExpression.FRIENDLY, "Hello my dear, how are you feeling?").also { stage++ }
1 -> playerl(FacialExpression.FRIENDLY, "Hello my dear, how are you feeling?").also { stage++ }
1 -> playerl(FacialExpression.FRIENDLY, "I'm ok thanks.").also { stage++ }
2 -> npcl(FacialExpression.FRIENDLY, "Well in that case I'd better get back to work. Take care.").also { stage++ }
3 -> playerl(FacialExpression.FRIENDLY, "You too.").also { stage = END_DIALOGUE }
}

View file

@ -1,4 +1,4 @@
package content.region.kandarin.ardougne.plaguecity.dialogue
package content.region.kandarin.ardougne.westardougne.dialogue
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression

View file

@ -1,4 +1,4 @@
package content.region.kandarin.ardougne.plaguecity.dialogue
package content.region.kandarin.ardougne.westardougne.dialogue
import core.api.sendNPCDialogue
import core.game.dialogue.DialoguePlugin

View file

@ -0,0 +1,32 @@
package content.region.kandarin.ardougne.westardougne.handlers
import content.data.Quests
import core.api.*
import core.game.global.action.DoorActionHandler
import core.game.interaction.IntType
import core.game.interaction.InteractionListener
import core.game.world.map.Location
import org.rs09.consts.NPCs
import org.rs09.consts.Scenery
class MainGatesListener : InteractionListener {
override fun defineListeners() {
on(intArrayOf(Scenery.ARDOUGNE_WALL_DOOR_9738, Scenery.ARDOUGNE_WALL_DOOR_9330), IntType.SCENERY, "open") { player, node ->
if (isQuestComplete(player, Quests.BIOHAZARD)) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
} else if(inBorders(player, 2556, 3298, 2557, 3301)){
lock(player,2)
sendMessage(player, "You pull on the large wooden doors...")
queueScript(player,2){
sendMessage(player, "...but they will not open.")
return@queueScript stopExecuting(player)
}
} else {
face(player, Location.create(2559, 3302, 0))
sendNPCDialogue(player, NPCs.MOURNER_2349, "Oi! What are you doing? Get away from there!")
}
return@on true
}
}
}

View file

@ -0,0 +1,66 @@
package content.region.kandarin.ardougne.westardougne.handlers
import content.data.Quests
import content.region.kandarin.ardougne.quest.plaguecity.PlagueCity
// import core.api.hasAnItem
import core.api.isQuestComplete
import core.api.openDialogue
import core.api.teleport
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.game.global.action.DoorActionHandler
import core.game.interaction.IntType
import core.game.interaction.InteractionListener
import core.game.node.entity.npc.NPC
import core.game.world.map.Location
import core.tools.END_DIALOGUE
import core.tools.START_DIALOGUE
import org.rs09.consts.NPCs
// import org.rs09.consts.Items
import org.rs09.consts.Scenery
class MournerHQDoors : InteractionListener {
override fun defineListeners() {
class MournerHQDialogue : DialogueFile(){
override fun handle(componentID: Int, buttonID: Int) {
npc = NPC(NPCs.MOURNER_347)
// todo check only the mourner gear is equipped
when (stage){
START_DIALOGUE -> npcl(FacialExpression.ANNOYED, "Who are you? Go away!").also { stage = END_DIALOGUE }
// Wearing extra gear
/*
Mourner: You should know better than to wear non-regulation gear.
Player: Sorry, I'm new around here.
Mourner: Well, you know the drill - lose the gear, I will let it pass this time.
*/
}
}
}
// Front door
on(Scenery.DOOR_2036, IntType.SCENERY, "open"){ player, node->
//todo after Mourning's End I is implemented make this check for wearing mourner gear
if(isQuestComplete(player, Quests.PLAGUE_CITY)){
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
}
else{
openDialogue(player, MournerHQDialogue())
}
return@on true
}
on(Scenery.TRAPDOOR_8783, IntType.SCENERY, "open"){ player, _->
// https://youtu.be/P-ns2kyvIGs?si=_DfI-V8KCyNoRtss&t=560
//todo after Mourning's End II is implemented make this check for a New Key 6104
// if(hasAnItem(player, Items.NEW_KEY_6104).exists()){
teleport(player, Location.create(2044,4649, 0))
//}
//else{
// sendMessage(player, "The trapdoor appears locked")
//}
return@on true
}
}
}

View file

@ -0,0 +1,38 @@
package content.region.kandarin.ardougne.westardougne.handlers
import content.data.Quests
import content.region.kandarin.ardougne.quest.plaguecity.PlagueCity
import core.api.*
import core.game.interaction.IntType
import core.game.interaction.InteractionListener
import core.game.node.item.Item
import org.rs09.consts.Items
import org.rs09.consts.Scenery
class SarahsBox : InteractionListener {
override fun defineListeners() {
on(Scenery.BOX_2062, IntType.SCENERY, "open") { _, node ->
val box = node as core.game.node.scenery.Scenery
replaceScenery(box, Scenery.BOX_2063, -1)
return@on true
}
on(Scenery.BOX_2063, IntType.SCENERY, "search"){ player, _ ->
if(isQuestComplete(player, Quests.PLAGUE_CITY)){
if(hasSpaceFor(player, Item(Items.DOCTORS_GOWN_430)) && !hasAnItem(player, Items.DOCTORS_GOWN_430).exists()){
sendMessage(player, "You find a medical gown in the box.")
addItem(player, Items.DOCTORS_GOWN_430)
return@on true
}
}
sendMessage(player, "You search the box but find nothing")
return@on true
}
on(Scenery.BOX_2063, IntType.SCENERY, "close") { _, node ->
replaceScenery(node.asScenery(), Scenery.BOX_2062, -1)
return@on true
}
}
}

View file

@ -0,0 +1,42 @@
package content.region.kandarin.ardougne.westardougne.handlers
import content.data.Quests
import core.api.inBorders
import core.api.isQuestComplete
import core.api.openDialogue
import core.api.sendDialogue
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.game.interaction.InteractionListener
import core.tools.END_DIALOGUE
import org.rs09.consts.Items
class WearMaskListener : InteractionListener {
override fun defineListeners() {
onUnequip(Items.GAS_MASK_1506){ player, _ ->
if (isQuestComplete(player, Quests.BIOHAZARD)){
return@onUnequip true
}
else{
if(
inBorders(player, 2511, 3266, 2556, 3334) ||
inBorders(player, 2464, 3281, 2511, 3334) ||
inBorders(player, 2461, 3281,2463, 3322) ||
inBorders(player, 2435, 3307, 2463, 3322)
){
openDialogue(player, MaskChat())
return@onUnequip false
}
return@onUnequip true
}
}
}
}
class MaskChat : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
playerl(FacialExpression.WORRIED, "I should probably keep the gas mask on whilst I'm in West Ardougne.").also { stage = END_DIALOGUE }
}
}

View file

@ -93,17 +93,25 @@ class TreeGnomeVillageListeners : InteractionListener {
return@on true
}
on(closedChest, IntType.SCENERY, "open"){ player, node ->
SceneryBuilder.replace(node.asScenery(), Scenery(openedChest, node.location, node.asScenery().rotation),10)
replaceScenery(node.asScenery(), openedChest, -1)
val upperGuard: NPC = RegionManager.getNpc(player.location, NPCs.KHAZARD_COMMANDER_478, 6) ?: return@on true
upperGuard.sendChat("Oi. You! Get out of there.")
upperGuard.attack(player)
return@on true
}
on(openedChest, IntType.SCENERY, "search"){ player, _ ->
if(!inInventory(player,Items.ORB_OF_PROTECTION_587)){
sendDialogue(player,"You search the chest. Inside you find the gnomes' stolen orb of protection.")
addItemOrDrop(player,Items.ORB_OF_PROTECTION_587)
if (getQuestStage(player, Quests.TREE_GNOME_VILLAGE) >= 31) {
if (!hasAnItem(player, Items.ORB_OF_PROTECTION_587).exists()) {
sendDialogue(player, "You search the chest. Inside you find the gnomes' stolen orb of protection.")
addItemOrDrop(player, Items.ORB_OF_PROTECTION_587)
return@on true
}
}
sendMessage(player, "You search the chest but find nothing.")
return@on false
}
on(openedChest, IntType.SCENERY, "close"){ _, node ->
replaceScenery(node.asScenery(), closedChest, -1)
return@on true
}
on(strongholdDoor, IntType.SCENERY, "open"){ player, node ->
@ -119,9 +127,7 @@ class TreeGnomeVillageListeners : InteractionListener {
}
fun squeezeThrough(player: Player){
val squeezeAnim = Animation.create(3844)
var dest = if (player.location.y >= 3161)
val dest = if (player.location.y >= 3161)
player.location.transform(Direction.SOUTH, 1)
else
player.location.transform(Direction.NORTH, 1)

View file

@ -18,7 +18,7 @@ class ServerConstants {
var NOAUTH_DEFAULT_ADMIN: Boolean = true
@JvmField
var CURRENT_SAVEFILE_VERSION = 2
var CURRENT_SAVEFILE_VERSION = 3
@JvmField
var DAILY_ACCOUNT_LIMIT = 3

View file

@ -195,6 +195,18 @@ fun inEquipment(player: Player, id: Int, amount: Int = 1): Boolean {
return amountInEquipment(player, id) >= amount
}
/**
* Check if any item is in a player's inventory
* @param player the player
* @param ids the set of item ids to check
* @return true if the player has at least one of the items in their inventory, false if none are present
*/
fun anyInInventory(player: Player, vararg ids: Int): Boolean {
return ids.any{ id ->
inInventory(player, id)
}
}
/**
* Check if an item exists in a player's equipment or inventory
* @param player the player whose equipment to check
@ -1702,9 +1714,10 @@ fun closeAllInterfaces(player: Player) {
* @param player the player to send the dialogue to
* @param msg the message to send.
* @param expr the FacialExpression to use. An enum exists for these called FacialExpression. Defaults to FacialExpression.FRIENDLY
* @param hide should the continue button be hidden?
*/
fun sendPlayerDialogue(player: Player, msg: String, expr: core.game.dialogue.FacialExpression = core.game.dialogue.FacialExpression.FRIENDLY) {
player.dialogueInterpreter.sendDialogues(player, expr, *splitLines(msg))
fun sendPlayerDialogue(player: Player, msg: String, expr: core.game.dialogue.FacialExpression = core.game.dialogue.FacialExpression.FRIENDLY, hide: Boolean = false) {
player.dialogueInterpreter.sendDialogues(player, expr, hide, *splitLines(msg))
}
/**
@ -1723,9 +1736,11 @@ fun sendPlayerOnInterface(player: Player, iface: Int, child: Int) {
* @param npc the ID of the NPC to use for the chathead
* @param msg the message to send.
* @param expr the FacialExpression to use. An enum exists for these called FacialExpression. Defaults to FacialExpression.FRIENDLY
* @param hide should the continue button be hidden?
*/
fun sendNPCDialogue(player: Player, npc: Int, msg: String, expr: core.game.dialogue.FacialExpression = core.game.dialogue.FacialExpression.FRIENDLY) {
player.dialogueInterpreter.sendDialogues(npc, expr, *splitLines(msg))
fun sendNPCDialogue(player: Player, npc: Int, msg: String, expr: core.game.dialogue.FacialExpression = core.game.dialogue.FacialExpression.FRIENDLY,
hide: Boolean = false) {
player.dialogueInterpreter.sendDialogues(npc, expr, hide, *splitLines(msg))
}
/**

View file

@ -122,11 +122,12 @@ abstract class Cutscene(val player: Player) {
* @param expression the FacialExpression the NPC should use
* @param message the message to send
* @param onContinue (optional) a method that runs when the dialogue is "continued." Increments the cutscene stage by default.
* @param hide Should the continue button be hidden?
*/
fun dialogueUpdate(npcId: Int, expression: core.game.dialogue.FacialExpression, message: String, onContinue: () -> Unit = {incrementStage()})
fun dialogueUpdate(npcId: Int, expression: core.game.dialogue.FacialExpression, message: String, onContinue: () -> Unit = {incrementStage()}, hide: Boolean = false)
{
logCutscene("Sending NPC dialogue update.")
sendNPCDialogue(player, npcId, message, expression)
sendNPCDialogue(player, npcId, message, expression, hide)
player.dialogueInterpreter.addAction { _,_ -> onContinue.invoke() }
}

View file

@ -434,7 +434,7 @@ public final class DialogueInterpreter {
* @return The chatbox component.
*/
public Component sendDialogues(Entity entity, int expression, String... messages) {
return sendDialogues(entity instanceof Player ? -1 : ((NPC) entity).getShownNPC(player).getId(), expression, messages);
return sendDialogues(entity instanceof Player ? -1 : ((NPC) entity).getShownNPC(player).getId(), expression, false, messages);
}
/**
@ -442,12 +442,11 @@ public final class DialogueInterpreter {
* @param npcId The npc id.
* @param expression The entity's facial expression.
* @param messages The messages.
* @param hide the continue.
* @param hide should the continue button be hidden?
* @return The chatbox component.
*/
public Component sendDialogues(int npcId, FacialExpression expression, boolean hide, String... messages) {
sendDialogues(npcId, expression == null ? -1 : expression.getAnimationId(), messages);
return player.getInterfaceManager().getChatbox();
return sendDialogues(npcId, expression == null ? -1 : expression.getAnimationId(), hide, messages);
}
/**
@ -458,34 +457,18 @@ public final class DialogueInterpreter {
* @return The chatbox component.
*/
public Component sendDialogues(Entity entity, FacialExpression expression, boolean hide, String... messages) {
sendDialogues(entity, expression, messages);
player.getPacketDispatch().sendInterfaceConfig(player.getInterfaceManager().getChatbox().getId(), 3, hide);
return player.getInterfaceManager().getChatbox();
return sendDialogues(entity.getId(), expression == null ? -1 : expression.getAnimationId(), hide, messages);
}
/**
* Send dialogues based on the amount of specified messages.
* @param expression The entity's facial expression.
* @param messages The messages.
* @param hide the continue.
* @param hide should the continue button be hidden?
* @return The chatbox component.
*/
public Component sendDialogues(Entity entity, int expression, boolean hide, String... messages) {
sendDialogues(entity, expression, messages);
player.getPacketDispatch().sendInterfaceConfig(player.getInterfaceManager().getChatbox().getId(), 3, hide);
return player.getInterfaceManager().getChatbox();
}
/**
* Send dialogues based on the amount of specified messages.
* @param expression The entity's facial expression.
* @param messages The messages.
* @return The chatbox component.
*/
public Component sendDialogues(int npcId, int expression, boolean hide, String... messages) {
sendDialogues(npcId, expression, messages);
player.getPacketDispatch().sendInterfaceConfig(player.getInterfaceManager().getChatbox().getId(), 3, hide);
return player.getInterfaceManager().getChatbox();
return sendDialogues(entity.getId(), expression, hide, messages);
}
/**
@ -496,7 +479,7 @@ public final class DialogueInterpreter {
* @return The chatbox component.
*/
public Component sendDialogues(int npcId, FacialExpression expression, String... messages) {
return sendDialogues(npcId, expression == null ? -1 : expression.getAnimationId(), messages);
return sendDialogues(npcId, expression == null ? -1 : expression.getAnimationId(),false, messages);
}
static Pattern GENDERED_SUBSTITUTION = Pattern.compile("@g\\[([^,]*),([^\\]]*)\\]");
@ -512,7 +495,6 @@ public final class DialogueInterpreter {
m.appendTail(sb);
return sb.toString();
}
/**
* Send dialogues based on the amount of specified messages.
* @param npcId The npc id.
@ -521,18 +503,31 @@ public final class DialogueInterpreter {
* @return The chatbox component.
*/
public Component sendDialogues(int npcId, int expression, String... messages) {
return sendDialogues(npcId, expression, false, messages);
}
/**
* Send dialogues based on the amount of specified messages.
* @param npcId The npc id.
* @param expression The entity's facial expression.
* @param messages The messages.
* @param hide should the continue button be hidden?
* @return The chatbox component.
*/
public Component sendDialogues(int npcId, int expression, boolean hide, String... messages) {
if (messages.length < 1 || messages.length > 4) {
System.err.println("Invalid amount of messages: " + messages.length);
return null;
}
boolean npc = npcId > -1;
int interfaceId = (npc ? 240 : 63) + messages.length;
interfaceId += hide ? 4 : 0;
if (expression == -1) {
expression = FacialExpression.HALF_GUILTY.getAnimationId();
}
player.getPacketDispatch().sendAnimationInterface(expression, interfaceId, 2);
player.getPacketDispatch().sendItemOnInterface(-1, 1, interfaceId, 1);
if (npc) {
player.getPacketDispatch().sendItemOnInterface(-1, 1, interfaceId, 1);
player.getPacketDispatch().sendNpcOnInterface(npcId, interfaceId, 2);
player.getPacketDispatch().sendString(NPCDefinition.forId(npcId).getName(), interfaceId, 3);
} else {
@ -540,7 +535,7 @@ public final class DialogueInterpreter {
player.getPacketDispatch().sendString(player.getUsername(), interfaceId, 3);
}
for (int i = 0; i < messages.length; i++) {
player.getPacketDispatch().sendString(doSubstitutions(player, messages[i].toString()), interfaceId, (i + 4));
player.getPacketDispatch().sendString(doSubstitutions(player, messages[i]), interfaceId, (i + 4));
}
player.getInterfaceManager().openChatbox(interfaceId);
player.getPacketDispatch().sendInterfaceConfig(player.getInterfaceManager().getChatbox().getId(), 3, false);

View file

@ -33,11 +33,19 @@ class EquipHandler : InteractionListener {
fun handleEquip(player: Player, node: Node) {
val item = node.asItem()
val itemEquipmentSlot = item.definition.getConfiguration<Int>(ItemConfigParser.EQUIP_SLOT, -1)
if (item == null || player.inventory[item.slot] != item || item.name.toLowerCase().contains("goblin mail")) {
val currentEquippedItem = player.equipment[itemEquipmentSlot]
if (item == null || currentEquippedItem == item || item.name.toLowerCase().contains("goblin mail")) {
return
}
if(currentEquippedItem != null){
if(!InteractionListeners.run(currentEquippedItem.id, player, currentEquippedItem, false)){
return
}
}
val equipStateListener = item.definition.getConfiguration<Plugin<Any>>("equipment", null)
if (equipStateListener != null) {
val bool = equipStateListener.fireEvent("equip", player, item)
@ -45,7 +53,7 @@ class EquipHandler : InteractionListener {
return
}
}
if (!InteractionListeners.run(node.id, player, node, true)) {
if (!InteractionListeners.run(node.id, player, item, true)) {
return
}
@ -70,7 +78,6 @@ class EquipHandler : InteractionListener {
playAudio(player, item.definition.getConfiguration(ItemConfigParser.EQUIP_AUDIO, 2244))
if (player.properties.autocastSpell != null) {
val itemEquipmentSlot = item.definition.getConfiguration<Int>(ItemConfigParser.EQUIP_SLOT, -1)
if (itemEquipmentSlot == EquipmentContainer.SLOT_WEAPON) {
player.properties.autocastSpell = null

View file

@ -1,12 +1,15 @@
package core.game.node.entity.player.info.login
import content.data.Quests
import content.global.skill.summoning.pet.Pets
import content.region.kandarin.ardougne.quest.plaguecity.PlagueCity
import core.ServerConstants
import core.api.*
import core.game.node.entity.player.Player
import core.game.node.item.Item
import core.tools.Log
import org.rs09.consts.Items
import content.data.Quests
import org.rs09.consts.Vars
/**
* Runs one-time save-version-related hooks.
@ -16,6 +19,7 @@ import content.data.Quests
class SaveVersionHooks : LoginListener {
override fun login(player: Player) {
if (player.version < ServerConstants.CURRENT_SAVEFILE_VERSION) {
log(this::class.java, Log.FINE, "Upgrading ${player.name} from ${player.version} to ${ServerConstants.CURRENT_SAVEFILE_VERSION}")
if (player.version < 1) { // GL !1811
// Give out crafting hoods if the player bought any crafting capes when the hoods were not obtainable
@ -69,6 +73,15 @@ class SaveVersionHooks : LoginListener {
}
}
if (player.version < 3) {
// Damage control on Plague city. There are a few varbits that should have been set for spawning
when (getQuestStage(player, Quests.PLAGUE_CITY)){
in 6..98 -> setVarbit(player, Vars.VARBIT_QUEST_PLAGUE_CITY_EDMOND_TUNNELS, 1) // Edmond is in the tunnel
in 99..100 ->setVarbit(player, Vars.VARBIT_QUEST_PLAGUE_CITY_RESCUE_ELENA, 1) // Elena is free
}
}
// Finish up
player.version = ServerConstants.CURRENT_SAVEFILE_VERSION
}
}

View file

@ -202,7 +202,12 @@ public final class PacketDispatch {
* @param childId The child id.
*/
public void sendPlayerOnInterface(int interfaceId, int childId) {
PacketRepository.send(DisplayModel.class, new DisplayModelContext(player, interfaceId, childId));
// fixme right now for iface 68-71 the player is massive
// The zoom for the other windows is 2150
// for these 4 individuals it should be 796 but dmc.setZoom doesn't work
DisplayModelContext dmc = new DisplayModelContext(player, interfaceId, childId);
dmc.setZoom(796); // this appears to do nothing
PacketRepository.send(DisplayModel.class, dmc);
}
/**

View file

@ -73,6 +73,16 @@ class MiscCommandSet : CommandSet(Privilege.ADMIN){
AnmaCutscene(player).start()
}
define("setsaveversion", Privilege.ADMIN) { player, args ->
try{
player.version = args[1].toInt()
notify(player, "Setting save version to ${player.version}")
}
catch (nfe: NumberFormatException){
reject(player, "Save versions can only be an integer")
}
}
/**
* Prints player's current location
*/