mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-28 05:45:10 -06:00
Compare commits
90 commits
Apr-19-202
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91bb6be123 | ||
|
|
2419bdb65e | ||
|
|
a6699243db | ||
|
|
a643299b0c | ||
|
|
e611b1780b | ||
|
|
d5527c268f | ||
|
|
5a37f2f8da | ||
|
|
592138d904 | ||
|
|
37b30d7561 | ||
|
|
efc324883b | ||
|
|
be744e73b3 | ||
|
|
ba372ef31f | ||
|
|
6cccaa79de | ||
|
|
9a4566cb0e | ||
|
|
5822b8df99 | ||
|
|
afeffc1b98 | ||
|
|
76523c0130 | ||
|
|
5d82897215 | ||
|
|
9a872f763d | ||
|
|
fd0976e5d5 | ||
|
|
392b13697b | ||
|
|
1d383f0ff3 | ||
|
|
09d9d1ec55 | ||
|
|
97f78b9058 | ||
|
|
5e6c5bdee1 | ||
|
|
e84798c82c | ||
|
|
166ecbacbf | ||
|
|
db960154e6 | ||
|
|
0d1dda90d8 | ||
|
|
559bdb5a68 | ||
|
|
7b55acaddc | ||
|
|
18d5fb62cd | ||
|
|
0fdbf323d6 | ||
|
|
5670ac5e9d | ||
|
|
fd8f672728 | ||
|
|
16187ad211 | ||
|
|
200dfc64f9 | ||
|
|
0443230b85 | ||
|
|
aa8c26f50c | ||
|
|
a5d98df06d | ||
|
|
eb5af4a5a8 | ||
|
|
9bfeea1d18 | ||
|
|
08e2e0b45e | ||
|
|
fecb243650 | ||
|
|
6546016d1a | ||
|
|
fcec1a765b | ||
|
|
34e386dbbf | ||
|
|
2c8885fa60 | ||
|
|
af9aaad94c | ||
|
|
39b6add4e9 | ||
|
|
a3fbce0e6f | ||
|
|
1727cde92f | ||
|
|
66a3410844 | ||
|
|
50e95c1101 | ||
|
|
353266d748 | ||
|
|
6508383fe8 | ||
|
|
dcaf28755d | ||
|
|
73840f7c28 | ||
|
|
c84539003f | ||
|
|
acc02e00d3 | ||
|
|
dc12d2d6ab | ||
|
|
dfcff908fe | ||
|
|
aae03d85fd | ||
|
|
13c4358d77 | ||
|
|
80c8b219ea | ||
|
|
acd0a9e22f | ||
|
|
da41694dd4 | ||
|
|
fc031be6ff | ||
|
|
bc6fd94f46 | ||
|
|
130cc79a17 | ||
|
|
cf6cc08b26 | ||
|
|
f98495d1ae | ||
|
|
50eb7582dd | ||
|
|
501b75aa22 | ||
|
|
0b41c5a146 | ||
|
|
8d7f78ac5b | ||
|
|
5633fbf115 | ||
|
|
7583f6bff2 | ||
|
|
39ac26f5d9 | ||
|
|
bd5ce18fc1 | ||
|
|
4795f25c09 | ||
|
|
4853262c25 | ||
|
|
e66be1b9d1 | ||
|
|
dec9c04fdd | ||
|
|
0c4cfcb1eb | ||
|
|
dd1cfbba51 | ||
|
|
626a3d0f80 | ||
|
|
40a495fcdc | ||
|
|
5d37bb20b0 | ||
|
|
15197bae85 |
250 changed files with 205420 additions and 213664 deletions
49
README.md
49
README.md
|
|
@ -29,6 +29,7 @@
|
||||||
* [Prerequisites](#prerequisites)
|
* [Prerequisites](#prerequisites)
|
||||||
* [Project Setup](#project-setup)
|
* [Project Setup](#project-setup)
|
||||||
* [Running the project](#running-the-project)
|
* [Running the project](#running-the-project)
|
||||||
|
* [Browser WebSocket Transport](#browser-websocket-transport)
|
||||||
* [License](#license)
|
* [License](#license)
|
||||||
* [Contact](#contact)
|
* [Contact](#contact)
|
||||||
|
|
||||||
|
|
@ -80,6 +81,20 @@ There are many ways everyone can contribute! From the most seasoned programmers
|
||||||
|
|
||||||
* **Code Contributors**: As a remake, we have massive amounts of content that need to be implemented or corrected. If you know how to program or are willing to learn, this is where you could be extremely helpful! We need everything from quests, to dialogue, to mini-games, to skills that still need to be corrected or implemented. This is perhaps one of the most valuable ways someone could help out the project! If you are interested in developing content, reach out in the development channel of the Discord.
|
* **Code Contributors**: As a remake, we have massive amounts of content that need to be implemented or corrected. If you know how to program or are willing to learn, this is where you could be extremely helpful! We need everything from quests, to dialogue, to mini-games, to skills that still need to be corrected or implemented. This is perhaps one of the most valuable ways someone could help out the project! If you are interested in developing content, reach out in the development channel of the Discord.
|
||||||
|
|
||||||
|
|
||||||
|
### Policy on Use of AI Tools
|
||||||
|
|
||||||
|
You, the contributor, agree to submit quality code to the best of your ability which you have tested yourself and confirmed that it works as intended, and if it doesn’t work, you agree to take constructive feedback and fix it.
|
||||||
|
|
||||||
|
You should be able to explain or defend how any part of your code works, without the use of AI or any other assistive tools.
|
||||||
|
|
||||||
|
2009scape reserves the right to reject your MR on grounds of poor quality, poor functionality, poor code style, poor attitudes or unethical over-reliance on assistive tools.
|
||||||
|
|
||||||
|
2009scape reserves the right to bar an individual from contributing due to patterns of aforementioned behavior, and close or delete all future MRs or issues or suggestions from said person without given explanation.
|
||||||
|
|
||||||
|
AI may not be used to generate your MR description, your issue description, or any responses to any discourse present on the Gitlab at any time or in any fashion. If you use AI in any of these places, it will be assumed that your entire contribution is AI and that you have no clue how it functions, and the remainder of the policy outlined above will be applied to you immediately.
|
||||||
|
|
||||||
|
|
||||||
## Content Developers: Setting Up the Project.
|
## Content Developers: Setting Up the Project.
|
||||||
### GitLab Setup
|
### GitLab Setup
|
||||||
**Note: This allows you to commit changes to the main repo (with approval)! Also, always stay up to date with the most recent updates by pulling into your copy when 2009Scape updates!**
|
**Note: This allows you to commit changes to the main repo (with approval)! Also, always stay up to date with the most recent updates by pulling into your copy when 2009Scape updates!**
|
||||||
|
|
@ -125,6 +140,40 @@ Start the game server with the included run script. Use `./run -h` for more info
|
||||||
|
|
||||||
Start the game server with `run-server.bat`
|
Start the game server with `run-server.bat`
|
||||||
|
|
||||||
|
#### Browser WebSocket Transport
|
||||||
|
|
||||||
|
Enable the listener in `Server/worldprops/default.conf`:
|
||||||
|
|
||||||
|
```properties
|
||||||
|
websocket_enabled = true
|
||||||
|
websocket_port = 0
|
||||||
|
```
|
||||||
|
|
||||||
|
When `websocket_port = 0`, the listener uses `53594 + world_id`. For world `1`, that is `53595`.
|
||||||
|
|
||||||
|
Both plain WebSocket (`ws://`) and secure WebSocket (`wss://`) are supported. Use `ws://` for local HTTP testing. PWA requires HTTPS/WSS.
|
||||||
|
|
||||||
|
Enable WSS with a Java keystore:
|
||||||
|
|
||||||
|
```properties
|
||||||
|
websocket_tls_enabled = true
|
||||||
|
websocket_tls_keystore_path = "certs/dev-wss.p12"
|
||||||
|
websocket_tls_keystore_password = "<keystore-password>"
|
||||||
|
```
|
||||||
|
|
||||||
|
The keystore password is optional. Leave `websocket_tls_keystore_password` blank when using a PKCS12 file exported with an empty password:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
openssl pkcs12 -export \
|
||||||
|
-in fullchain.pem \
|
||||||
|
-inkey privkey.pem \
|
||||||
|
-out certs/dev-wss.p12 \
|
||||||
|
-name websocket \
|
||||||
|
-passout pass:
|
||||||
|
```
|
||||||
|
|
||||||
|
For local WSS development, create a certificate for your hostname or LAN IP that the browser will use, then point the server at a PKCS12 keystore. For production, use a normal certificate from certbot. Plain WS does not require a certificate.
|
||||||
|
|
||||||
#### Docker
|
#### Docker
|
||||||
|
|
||||||
Make sure [Docker Engine](https://docs.docker.com/engine/install/) & [Docker Compose](https://docs.docker.com/compose/install/) plugin are installed first:
|
Make sure [Docker Engine](https://docs.docker.com/engine/install/) & [Docker Compose](https://docs.docker.com/compose/install/) plugin are installed first:
|
||||||
|
|
|
||||||
|
|
@ -8353,6 +8353,20 @@
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": []
|
"main": []
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"default": [
|
||||||
|
{
|
||||||
|
"minAmount": "1",
|
||||||
|
"weight": "100.0",
|
||||||
|
"id": "526",
|
||||||
|
"maxAmount": "1"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"charm": [],
|
||||||
|
"ids": "1329",
|
||||||
|
"description": "",
|
||||||
|
"main": []
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"default": [
|
"default": [
|
||||||
{
|
{
|
||||||
|
|
@ -18342,7 +18356,7 @@
|
||||||
{
|
{
|
||||||
"minAmount": "1",
|
"minAmount": "1",
|
||||||
"weight": "5.0",
|
"weight": "5.0",
|
||||||
"id": "5733",
|
"id": "12070",
|
||||||
"maxAmount": "1"
|
"maxAmount": "1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -19684,7 +19698,14 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"default": [],
|
"default": [
|
||||||
|
{
|
||||||
|
"minAmount": "1",
|
||||||
|
"weight": "100.0",
|
||||||
|
"id": "526",
|
||||||
|
"maxAmount": "1"
|
||||||
|
}
|
||||||
|
],
|
||||||
"charm": [],
|
"charm": [],
|
||||||
"ids": "1307",
|
"ids": "1307",
|
||||||
"description": "",
|
"description": "",
|
||||||
|
|
@ -29810,10 +29831,10 @@
|
||||||
"maxAmount": "1"
|
"maxAmount": "1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"minAmount": "1",
|
"minAmount": "2",
|
||||||
"weight": "100.0",
|
"weight": "100.0",
|
||||||
"id": "12161",
|
"id": "12161",
|
||||||
"maxAmount": "1"
|
"maxAmount": "2"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"minAmount": "1",
|
"minAmount": "1",
|
||||||
|
|
@ -41175,7 +41196,7 @@
|
||||||
{
|
{
|
||||||
"minAmount": "1",
|
"minAmount": "1",
|
||||||
"weight": "5.0",
|
"weight": "5.0",
|
||||||
"id": "1",
|
"id": "12070",
|
||||||
"maxAmount": "1"
|
"maxAmount": "1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"item_id": "444",
|
"item_id": "444",
|
||||||
"loc_data": "{1,3231,3739,0,250}-{1,3236,3741,0,250}-{1,3195,9821,0,150}-"
|
"loc_data": "{1,3231,3739,0,250}-{1,3236,3741,0,250}-{1,3195,9821,0,150}-{1,2732,3224,0,250}-"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"item_id": "480",
|
"item_id": "480",
|
||||||
|
|
@ -415,6 +415,10 @@
|
||||||
"item_id": "1755",
|
"item_id": "1755",
|
||||||
"loc_data": "{1,2935,3286,0,90}-"
|
"loc_data": "{1,2935,3286,0,90}-"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"item_id": "1773",
|
||||||
|
"loc_data": "{1,2563,3261,0,100}-"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"item_id": "1785",
|
"item_id": "1785",
|
||||||
"loc_data": "{1,2822,3355,0,150}-"
|
"loc_data": "{1,2822,3355,0,150}-"
|
||||||
|
|
|
||||||
|
|
@ -539,6 +539,12 @@
|
||||||
"walkable": "true",
|
"walkable": "true",
|
||||||
"tabIndex": "-1"
|
"tabIndex": "-1"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "375",
|
||||||
|
"interfaceType": "3",
|
||||||
|
"walkable": "false",
|
||||||
|
"tabIndex": "-1"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "377",
|
"id": "377",
|
||||||
"interfaceType": "8",
|
"interfaceType": "8",
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1546,5 +1546,41 @@
|
||||||
"animation": "426",
|
"animation": "426",
|
||||||
"drop_ammo": "true",
|
"drop_ammo": "true",
|
||||||
"ammunition": "14202,14203,14204,14205,14206"
|
"ammunition": "14202,14203,14204,14205,14206"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"itemId": "10149",
|
||||||
|
"name": "Swamp lizard",
|
||||||
|
"ammo_slot": "13",
|
||||||
|
"weapon_type": "0",
|
||||||
|
"animation": "5247",
|
||||||
|
"drop_ammo": "false",
|
||||||
|
"ammunition": "10142"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"itemId": "10146",
|
||||||
|
"name": "Orange salamander",
|
||||||
|
"ammo_slot": "13",
|
||||||
|
"weapon_type": "0",
|
||||||
|
"animation": "5247",
|
||||||
|
"drop_ammo": "false",
|
||||||
|
"ammunition": "10143"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"itemId": "10147",
|
||||||
|
"name": "Red salamander",
|
||||||
|
"ammo_slot": "13",
|
||||||
|
"weapon_type": "0",
|
||||||
|
"animation": "5247",
|
||||||
|
"drop_ammo": "false",
|
||||||
|
"ammunition": "10144"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"itemId": "10148",
|
||||||
|
"name": "Black salamander",
|
||||||
|
"ammo_slot": "13",
|
||||||
|
"weapon_type": "0",
|
||||||
|
"animation": "5247",
|
||||||
|
"drop_ammo": "false",
|
||||||
|
"ammunition": "10145"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<properties>
|
<properties>
|
||||||
<project.mainClassName>core.Server</project.mainClassName>
|
<project.mainClassName>core.Server</project.mainClassName>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
|
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
|
||||||
<kotlin.version>1.8.20</kotlin.version>
|
<kotlin.version>1.8.20</kotlin.version>
|
||||||
<kotlin.compiler.jvmTarget>11</kotlin.compiler.jvmTarget>
|
<kotlin.compiler.jvmTarget>11</kotlin.compiler.jvmTarget>
|
||||||
|
|
@ -90,6 +91,11 @@
|
||||||
<version>2.9.0</version>
|
<version>2.9.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.java-websocket</groupId>
|
||||||
|
<artifactId>Java-WebSocket</artifactId>
|
||||||
|
<version>1.5.7</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
||||||
|
|
@ -1,172 +0,0 @@
|
||||||
package content.data;
|
|
||||||
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The BossKillcounter keeps track of the amount of bosses the player has slain.
|
|
||||||
* addtoKillcount(player, npcId) should be added in the finalizeDeath() method of the combat handler for the boss.
|
|
||||||
* @author Splinter
|
|
||||||
*/
|
|
||||||
public enum BossKillCounter {
|
|
||||||
|
|
||||||
|
|
||||||
/* ORDINAL BOUND */
|
|
||||||
KING_BLACK_DRAGON(new int[] { 50 }, "King Black Dragon", 14649),
|
|
||||||
BORK(new int[] { 7133, 7134 }, "Bork", -1),
|
|
||||||
DAGANNOTH_SUPREME(new int[] { 2881 }, "Dagannoth Supreme", 14639),
|
|
||||||
DAGANNOTH_PRIME(new int[] { 2882 }, "Dagannoth Prime", 14640),
|
|
||||||
DAGANNOTH_REX(new int[] { 2883 }, "Dagannoth Rex", 14641),
|
|
||||||
CHAOS_ELEMENTAL(new int[] { 3200 }, "Chaos Elemental", 14638),
|
|
||||||
GIANT_MOLE(new int[] { 3340 }, "Giant Mole", 14642),
|
|
||||||
SARADOMIN(new int[] { 6247 }, "Commander Zilyana", 14647),
|
|
||||||
ZAMORAK(new int[] { 6203 }, "K'ril Tsutsaroth", 14648),
|
|
||||||
BANDOS(new int[] { 6260 }, "General Graardor", 14646),
|
|
||||||
ARMADYL(new int[] { 6222 }, "Kree'arra", 14645),
|
|
||||||
JAD(new int[] { 2745 }, "Tz-Tok Jad", 14828),
|
|
||||||
KALPHITE_QUEEN(new int[] { 1160 }, "Kalphite Queen", 14650),
|
|
||||||
CORPOREAL_BEAST(new int[] { 8133 }, "Corporeal Beast", 14653),
|
|
||||||
TORMENTED_DEMONS(new int[] {
|
|
||||||
8349, 8350, 8351, 8352, 8353, 8354,
|
|
||||||
8355, 8356, 8357, 8358, 8359, 8360,
|
|
||||||
8361, 8362, 8363, 8364, 8365, 8366,
|
|
||||||
}, "Tormented demon", -1),
|
|
||||||
|
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The npcs that can increase the killcounter
|
|
||||||
*/
|
|
||||||
private final int[] npc;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The name of the NPC, to be displayed as a sendMessage
|
|
||||||
*/
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The item ID of the pet relating to the boss.
|
|
||||||
*/
|
|
||||||
private final int petId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code BossKillCounter} {@code Object}.
|
|
||||||
* @param npc the npc.
|
|
||||||
* @param name the npc's string name
|
|
||||||
*/
|
|
||||||
BossKillCounter(final int[] npc, final String name, final int petId) {
|
|
||||||
this.npc = npc;
|
|
||||||
this.name = name;
|
|
||||||
this.petId = petId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the npc.
|
|
||||||
* @return The npc.
|
|
||||||
*/
|
|
||||||
public int[] getNpc() {
|
|
||||||
return npc;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the NPC's name
|
|
||||||
* @return their name
|
|
||||||
*/
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the petId
|
|
||||||
* @return The petId
|
|
||||||
*/
|
|
||||||
public int getPetId() {
|
|
||||||
return petId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the type for the npc.
|
|
||||||
* @param npc the npc.
|
|
||||||
* @return the BossKillcounter
|
|
||||||
*/
|
|
||||||
public static BossKillCounter forNPC(final int npc) {
|
|
||||||
for (BossKillCounter kc : BossKillCounter.values()) {
|
|
||||||
for (int i : kc.getNpc()) {
|
|
||||||
if (npc == i) {
|
|
||||||
return kc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds to the player's killcount for that particular boss.
|
|
||||||
* @param killer The player who killed the npc
|
|
||||||
* @param npcid the ID of the npc that just died
|
|
||||||
*/
|
|
||||||
public static void addtoKillcount(Player killer, int npcid) {
|
|
||||||
if (killer == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
BossKillCounter boss = BossKillCounter.forNPC(npcid);
|
|
||||||
if (boss == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
killer.getSavedData().getGlobalData().getBossCounters()[boss.ordinal()]++;
|
|
||||||
killer.getPacketDispatch().sendMessage("Your " + boss.getName() + " killcount is now: <col=ff0000>" + killer.getSavedData().getGlobalData().getBossCounters()[boss.ordinal()] + "</col>.");
|
|
||||||
// addBossPet(killer, npcid, boss);
|
|
||||||
}
|
|
||||||
|
|
||||||
// /**
|
|
||||||
// * Gives the player the pet if they killed a certain boss.
|
|
||||||
// * The chance by default is 1/5000. This rate lowers to 1/2200 if the <GlobalEvents> for Boss Pets is active.
|
|
||||||
// * Note: Not all bosses have pet versions of themselves.
|
|
||||||
// */
|
|
||||||
// private static void addBossPet(Player killer, int npcid, BossKillCounter boss){
|
|
||||||
// if(boss.getPetId() == -1){ //The boss does not have a pet version.
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// int number = 5000;
|
|
||||||
// if (npcid == 2745) {
|
|
||||||
// number = 200;
|
|
||||||
// if (killer.getSlayer().getTask() == Tasks.JAD) {
|
|
||||||
// number = 100;
|
|
||||||
// }
|
|
||||||
// } else if (npcid == 3200) {
|
|
||||||
// number = 300;
|
|
||||||
// }
|
|
||||||
// int rand = number;
|
|
||||||
// if(rand == 10){
|
|
||||||
// for (int i = 0; i < killer.getFamiliarManager().getInsuredPets().size(); i++) {
|
|
||||||
// if (killer.getFamiliarManager().getInsuredPets().get(i).getBabyItemId() == boss.getPetId()) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if(killer.getFamiliarManager().hasFamiliar() && killer.getInventory().freeSlots() < 1){
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if(!killer.getFamiliarManager().hasFamiliar()){
|
|
||||||
// killer.getFamiliarManager().summon(new Item(boss.getPetId()), true);
|
|
||||||
// killer.sendNotificationMessage("You have a funny feeling like you're being followed.");
|
|
||||||
// } else if (killer.getInventory().freeSlots() > 0){
|
|
||||||
// killer.getInventory().add(new Item(boss.getPetId(), 1));
|
|
||||||
// killer.sendNotificationMessage("You feel something weird sneaking into your backpack.");
|
|
||||||
// }
|
|
||||||
// Repository.sendNews(killer.getUsername()+" now commands a miniature "+(boss.equals(CORPOREAL_BEAST) ? "Dark core" : boss.getName())+"!");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Increments the player's Barrows chest counter.
|
|
||||||
* @param player the player
|
|
||||||
*/
|
|
||||||
public static void addtoBarrowsCount(Player player) {
|
|
||||||
if (player == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
player.getSavedData().getGlobalData().setBarrowsLoots(player.getSavedData().getGlobalData().getBarrowsLoots() + 1);
|
|
||||||
player.getPacketDispatch().sendMessage("Your Barrows chest count is: <col=ff0000>" + player.getSavedData().getGlobalData().getBarrowsLoots() + "</col>.");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
72
Server/src/main/content/data/BossKillCounter.kt
Normal file
72
Server/src/main/content/data/BossKillCounter.kt
Normal file
|
|
@ -0,0 +1,72 @@
|
||||||
|
package content.data
|
||||||
|
|
||||||
|
import core.api.sendMessage
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
import org.rs09.consts.NPCs
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enumerates the bosses that have their kill counts tracked in a player's statistics (::stats).
|
||||||
|
* addToBossKillCount(player, npcId) should be added in the finalizeDeath() method of the combat handler for the boss.
|
||||||
|
* ORDINAL BOUND
|
||||||
|
* @author Bishop
|
||||||
|
*/
|
||||||
|
|
||||||
|
enum class BossKillCounter(val bossId: IntArray, val bossName: String) {
|
||||||
|
|
||||||
|
KING_BLACK_DRAGON(intArrayOf(NPCs.KING_BLACK_DRAGON_50), "King Black Dragon"),
|
||||||
|
BORK(intArrayOf(NPCs.BORK_7133, NPCs.BORK_7134), "Bork"),
|
||||||
|
DAGANNOTH_SUPREME(intArrayOf(NPCs.DAGANNOTH_SUPREME_2881), "Dagannoth Supreme"),
|
||||||
|
DAGANNOTH_PRIME(intArrayOf(NPCs.DAGANNOTH_PRIME_2882), "Dagannoth Prime"),
|
||||||
|
DAGANNOTH_REX(intArrayOf(NPCs.DAGANNOTH_REX_2883), "Dagannoth Rex"),
|
||||||
|
CHAOS_ELEMENTAL(intArrayOf(NPCs.CHAOS_ELEMENTAL_3200), "Chaos Elemental"),
|
||||||
|
GIANT_MOLE(intArrayOf(NPCs.GIANT_MOLE_3340), "Giant Mole"),
|
||||||
|
SARADOMIN(intArrayOf(NPCs.COMMANDER_ZILYANA_6247), "Commander Zilyana"),
|
||||||
|
ZAMORAK(intArrayOf(NPCs.KRIL_TSUTSAROTH_6203), "K'ril Tsutsaroth"),
|
||||||
|
BANDOS(intArrayOf(NPCs.GENERAL_GRAARDOR_6260), "General Graardor"),
|
||||||
|
ARMADYL(intArrayOf(NPCs.KREEARRA_6222), "Kree'arra"),
|
||||||
|
JAD(intArrayOf(NPCs.TZTOK_JAD_2745), "Tz-Tok Jad"),
|
||||||
|
KALPHITE_QUEEN(intArrayOf(NPCs.KALPHITE_QUEEN_1160), "Kalphite Queen"),
|
||||||
|
CORPOREAL_BEAST(intArrayOf(NPCs.CORPOREAL_BEAST_8133), "Corporeal Beast"),
|
||||||
|
TORMENTED_DEMONS(
|
||||||
|
intArrayOf(
|
||||||
|
NPCs.TORMENTED_DEMON_8349, NPCs.TORMENTED_DEMON_8350, NPCs.TORMENTED_DEMON_8351,
|
||||||
|
NPCs.TORMENTED_DEMON_8352, NPCs.TORMENTED_DEMON_8353, NPCs.TORMENTED_DEMON_8354,
|
||||||
|
NPCs.TORMENTED_DEMON_8355, NPCs.TORMENTED_DEMON_8356, NPCs.TORMENTED_DEMON_8357,
|
||||||
|
NPCs.TORMENTED_DEMON_8358, NPCs.TORMENTED_DEMON_8359, NPCs.TORMENTED_DEMON_8360,
|
||||||
|
NPCs.TORMENTED_DEMON_8361, NPCs.TORMENTED_DEMON_8362, NPCs.TORMENTED_DEMON_8363,
|
||||||
|
NPCs.TORMENTED_DEMON_8364, NPCs.TORMENTED_DEMON_8365, NPCs.TORMENTED_DEMON_8366),
|
||||||
|
"Tormented demon"
|
||||||
|
),
|
||||||
|
PENANCE_QUEEN(intArrayOf(NPCs.PENANCE_QUEEN_5247), "Penance Queen");
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private fun forBossId(npc: Int): BossKillCounter? {
|
||||||
|
for (kc in values()) {
|
||||||
|
for (i in kc.bossId) {
|
||||||
|
if (npc == i) {
|
||||||
|
return kc
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
fun addToBossKillCount(killer: Player?, bossId: Int) {
|
||||||
|
if (killer == null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
val boss: BossKillCounter = forBossId(bossId) ?: return
|
||||||
|
killer.getSavedData().globalData.bossCounters[boss.ordinal]++
|
||||||
|
sendMessage(killer, "Your ${boss.bossName} killcount is now: <col=ff0000>${killer.getSavedData().globalData.bossCounters[boss.ordinal]}</col>.")
|
||||||
|
}
|
||||||
|
|
||||||
|
fun addToBarrowsChestCount(player: Player?) {
|
||||||
|
if (player == null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
player.getSavedData().globalData.barrowsLoots++
|
||||||
|
sendMessage(player, "Your Barrows chest count is: <col=ff0000>${player.getSavedData().globalData.barrowsLoots}</col>.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -9,15 +9,14 @@ import core.game.event.TeleportEvent
|
||||||
import core.game.interaction.QueueStrength
|
import core.game.interaction.QueueStrength
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
import core.game.node.entity.player.link.TeleportManager
|
import core.game.node.entity.player.link.TeleportManager
|
||||||
|
import core.game.node.entity.player.link.diary.DiaryType
|
||||||
import core.game.node.item.Item
|
import core.game.node.item.Item
|
||||||
import core.game.system.task.Pulse
|
|
||||||
import core.game.world.GameWorld
|
import core.game.world.GameWorld
|
||||||
import core.game.world.map.Location
|
import core.game.world.map.Location
|
||||||
import core.game.world.update.flag.context.Animation
|
import core.game.world.update.flag.context.Animation
|
||||||
import core.game.world.update.flag.context.Graphics
|
import core.game.world.update.flag.context.Graphics
|
||||||
import org.rs09.consts.Items
|
|
||||||
import core.game.world.GameWorld.Pulser
|
|
||||||
import core.tools.Log
|
import core.tools.Log
|
||||||
|
import org.rs09.consts.Items
|
||||||
import org.rs09.consts.Sounds
|
import org.rs09.consts.Sounds
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
|
@ -194,7 +193,7 @@ enum class EnchantedJewellery(
|
||||||
),
|
),
|
||||||
RING_OF_LIFE(arrayOf<String>(),
|
RING_OF_LIFE(arrayOf<String>(),
|
||||||
arrayOf(
|
arrayOf(
|
||||||
Location.create(ServerConstants.HOME_LOCATION)
|
Location.create(ServerConstants.HOME_LOCATION!!)
|
||||||
),
|
),
|
||||||
true,
|
true,
|
||||||
Items.RING_OF_LIFE_2570
|
Items.RING_OF_LIFE_2570
|
||||||
|
|
@ -247,7 +246,13 @@ enum class EnchantedJewellery(
|
||||||
when (stage) {
|
when (stage) {
|
||||||
0 -> {
|
0 -> {
|
||||||
lock(player, 4)
|
lock(player, 4)
|
||||||
visualize(player, ANIMATION, GRAPHICS)
|
// This is an intentional teleport animation & graphics difference as these two jewellery
|
||||||
|
// animations are authentic to 2009 while others are currently unknown.
|
||||||
|
if (this == RING_OF_DUELING || this == GAMES_NECKLACE) {
|
||||||
|
visualize(player, JEWELLERY_ANIMATION, JEWELLERY_GRAPHICS)
|
||||||
|
} else {
|
||||||
|
visualize(player, ANIMATION, GRAPHICS)
|
||||||
|
}
|
||||||
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||||
player.impactHandler.disabledTicks = 4
|
player.impactHandler.disabledTicks = 4
|
||||||
closeInterface(player)
|
closeInterface(player)
|
||||||
|
|
@ -256,8 +261,16 @@ enum class EnchantedJewellery(
|
||||||
1 -> {
|
1 -> {
|
||||||
teleport(player, location)
|
teleport(player, location)
|
||||||
resetAnimator(player)
|
resetAnimator(player)
|
||||||
|
if (this == RING_OF_DUELING || this == GAMES_NECKLACE) {
|
||||||
|
player.graphics(JEWELLERY_GRAPHICS)
|
||||||
|
}
|
||||||
unlock(player)
|
unlock(player)
|
||||||
player.dispatch(TeleportEvent(TeleportManager.TeleportType.NORMAL, TeleportMethod.JEWELRY, item, location))
|
player.dispatch(TeleportEvent(TeleportManager.TeleportType.NORMAL, TeleportMethod.JEWELRY, item, location))
|
||||||
|
|
||||||
|
if (DIGSITE_PENDANT.ids.contains(item.id)) {
|
||||||
|
player.achievementDiaryManager.finishTask(player, DiaryType.VARROCK, 1, 10)
|
||||||
|
}
|
||||||
|
|
||||||
if (!replace) {
|
if (!replace) {
|
||||||
return@queueScript stopExecuting(player)
|
return@queueScript stopExecuting(player)
|
||||||
}
|
}
|
||||||
|
|
@ -366,6 +379,8 @@ enum class EnchantedJewellery(
|
||||||
companion object {
|
companion object {
|
||||||
private val ANIMATION = Animation(714)
|
private val ANIMATION = Animation(714)
|
||||||
private val GRAPHICS = Graphics(308, 100, 50)
|
private val GRAPHICS = Graphics(308, 100, 50)
|
||||||
|
private val JEWELLERY_ANIMATION = Animation(9603)
|
||||||
|
private val JEWELLERY_GRAPHICS = Graphics(1684)
|
||||||
val idMap = HashMap<Int, EnchantedJewellery>()
|
val idMap = HashMap<Int, EnchantedJewellery>()
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,8 @@ public enum Consumables {
|
||||||
EGG_AND_TOMATO(new Food(new int[] {7064, 1923}, new HealingEffect(8))),
|
EGG_AND_TOMATO(new Food(new int[] {7064, 1923}, new HealingEffect(8))),
|
||||||
SWEET_CORN(new Food(new int[] {5988}, new MultiEffect(new HealingEffect(1), new PercentageHealthEffect(10)))),
|
SWEET_CORN(new Food(new int[] {5988}, new MultiEffect(new HealingEffect(1), new PercentageHealthEffect(10)))),
|
||||||
SWEETCORN_BOWL(new Food(new int[] {7088, 1923}, new MultiEffect(new HealingEffect(1), new PercentageHealthEffect(10)))),
|
SWEETCORN_BOWL(new Food(new int[] {7088, 1923}, new MultiEffect(new HealingEffect(1), new PercentageHealthEffect(10)))),
|
||||||
|
CHOPPED_TUNA(new Food(new int[] {7086, 1923}, new HealingEffect(10))),
|
||||||
|
CHOPPED_ONION(new Food(new int[] {1871, 1923}, new HealingEffect(1))),
|
||||||
POTATO_WITH_BUTTER(new Food(new int[] {6703}, new HealingEffect(7))),
|
POTATO_WITH_BUTTER(new Food(new int[] {6703}, new HealingEffect(7))),
|
||||||
CHILLI_POTATO(new Food(new int[] {7054}, new HealingEffect(14))),
|
CHILLI_POTATO(new Food(new int[] {7054}, new HealingEffect(14))),
|
||||||
FRIED_ONIONS(new Food(new int[] {7084, 1923}, new HealingEffect(5))),
|
FRIED_ONIONS(new Food(new int[] {7084, 1923}, new HealingEffect(5))),
|
||||||
|
|
@ -317,6 +319,7 @@ public enum Consumables {
|
||||||
TCHIKI_MONKEY_PASTE(new Food(new int[] {7575}, new HealingEffect(5), "You eat the Tchiki monkey nut paste. It sticks to the roof of your mouth.")),
|
TCHIKI_MONKEY_PASTE(new Food(new int[] {7575}, new HealingEffect(5), "You eat the Tchiki monkey nut paste. It sticks to the roof of your mouth.")),
|
||||||
OOMLIE_WRAP(new Food(new int[] {Items.COOKED_OOMLIE_WRAP_2343}, new MultiEffect(new HealingEffect(14), new AchievementEffect(DiaryType.KARAMJA, 2, 2)))),
|
OOMLIE_WRAP(new Food(new int[] {Items.COOKED_OOMLIE_WRAP_2343}, new MultiEffect(new HealingEffect(14), new AchievementEffect(DiaryType.KARAMJA, 2, 2)))),
|
||||||
ROE(new Food(new int[]{11324}, new HealingEffect(3))),
|
ROE(new Food(new int[]{11324}, new HealingEffect(3))),
|
||||||
|
CAVIAR(new Food(new int[]{11326}, new HealingEffect(5))),
|
||||||
EQUA_LEAVES(new Food(new int[]{2128}, new HealingEffect(1))),
|
EQUA_LEAVES(new Food(new int[]{2128}, new HealingEffect(1))),
|
||||||
CHOC_ICE(new Food(new int[]{6794}, new HealingEffect(7))),
|
CHOC_ICE(new Food(new int[]{6794}, new HealingEffect(7))),
|
||||||
EDIBLE_SEAWEED(new Food(new int[] {403}, new HealingEffect(4))),
|
EDIBLE_SEAWEED(new Food(new int[] {403}, new HealingEffect(4))),
|
||||||
|
|
@ -343,14 +346,14 @@ public enum Consumables {
|
||||||
AGILITY(new Potion(new int[] {3032, 3034, 3036, 3038}, new SkillEffect(Skills.AGILITY, 3, 0))),
|
AGILITY(new Potion(new int[] {3032, 3034, 3036, 3038}, new SkillEffect(Skills.AGILITY, 3, 0))),
|
||||||
HUNTER(new Potion(new int[] {9998, 10000, 10002, 10004}, new SkillEffect(Skills.HUNTER, 3, 0))),
|
HUNTER(new Potion(new int[] {9998, 10000, 10002, 10004}, new SkillEffect(Skills.HUNTER, 3, 0))),
|
||||||
RESTORE(new Potion(new int[] {2430, 127, 129, 131}, new RestoreEffect(10, 0.3))),
|
RESTORE(new Potion(new int[] {2430, 127, 129, 131}, new RestoreEffect(10, 0.3))),
|
||||||
SARA_BREW(new Potion(new int[] {6685, 6687, 6689, 6691}, new MultiEffect(new PercentHeal(0, .15), new SkillEffect(Skills.ATTACK, 0, -0.10), new SkillEffect(Skills.STRENGTH, 0, -0.10), new SkillEffect(Skills.MAGIC, 0, -0.10), new SkillEffect(Skills.RANGE, 0, -0.10), new SkillEffect(Skills.DEFENCE, 0, 0.25)))),
|
SARA_BREW(new Potion(new int[] {6685, 6687, 6689, 6691}, new MultiEffect(new PercentHeal(2, .15), new SkillEffect(Skills.ATTACK, 0, -0.10), new SkillEffect(Skills.STRENGTH, 0, -0.10), new SkillEffect(Skills.MAGIC, 0, -0.10), new SkillEffect(Skills.RANGE, 0, -0.10), new SkillEffect(Skills.DEFENCE, 2, 0.2)))),
|
||||||
SUMMONING(new Potion(new int[] {12140, 12142, 12144, 12146}, new MultiEffect(new RestoreSummoningSpecial(), new SummoningEffect(7, 0.25)))),
|
SUMMONING(new Potion(new int[] {12140, 12142, 12144, 12146}, new MultiEffect(new RestoreSummoningSpecial(), new SummoningEffect(7, 0.25)))),
|
||||||
COMBAT(new Potion(new int[] {9739, 9741, 9743, 9745}, new MultiEffect(new SkillEffect(Skills.STRENGTH, 3, .1), new SkillEffect(Skills.ATTACK, 3, .1)))),
|
COMBAT(new Potion(new int[] {9739, 9741, 9743, 9745}, new MultiEffect(new SkillEffect(Skills.STRENGTH, 3, .1), new SkillEffect(Skills.ATTACK, 3, .1)))),
|
||||||
ENERGY(new Potion(new int[] {3008, 3010, 3012, 3014}, new EnergyEffect(10))),
|
ENERGY(new Potion(new int[] {3008, 3010, 3012, 3014}, new EnergyEffect(10))),
|
||||||
FISHING(new Potion(new int[] {2438, 151, 153, 155}, new SkillEffect(Skills.FISHING, 3, 0))),
|
FISHING(new Potion(new int[] {2438, 151, 153, 155}, new SkillEffect(Skills.FISHING, 3, 0))),
|
||||||
PRAYER(new Potion(new int[] {2434, 139, 141, 143}, new PrayerEffect(7, 0.25))),
|
PRAYER(new Potion(new int[] {2434, 139, 141, 143}, new PrayerEffect(7, 0.25))),
|
||||||
SUPER_RESTO(new Potion(new int[] {3024, 3026, 3028, 3030}, new RestoreEffect(8, 0.25, true))),
|
SUPER_RESTO(new Potion(new int[] {3024, 3026, 3028, 3030}, new RestoreEffect(8, 0.25, true))),
|
||||||
ZAMMY_BREW(new Potion(new int[] {2450, 189, 191, 193}, new MultiEffect(new DamageEffect(10, true), new SkillEffect(Skills.ATTACK, 0, 0.25), new SkillEffect(Skills.STRENGTH, 0, 0.15), new SkillEffect(Skills.DEFENCE, 0, -0.1)))),
|
ZAMMY_BREW(new Potion(new int[] {2450, 189, 191, 193}, new MultiEffect(new DamageEffect(10, true, 2), new SkillEffect(Skills.ATTACK, 2, 0.20), new SkillEffect(Skills.STRENGTH, 2, 0.12), new SkillEffect(Skills.DEFENCE, -2, -0.10), new PrayerEffect(0.0, 0.10, true)))),
|
||||||
ANTIFIRE(new Potion(new int[] {2452, 2454, 2456, 2458}, new AddTimerEffect("dragonfire:immunity", 600, true))),
|
ANTIFIRE(new Potion(new int[] {2452, 2454, 2456, 2458}, new AddTimerEffect("dragonfire:immunity", 600, true))),
|
||||||
GUTH_REST(new Potion(new int[] {4417, 4419, 4421, 4423}, new MultiEffect(new RemoveTimerEffect("poison"), new EnergyEffect(5), new HealingEffect(5)))),
|
GUTH_REST(new Potion(new int[] {4417, 4419, 4421, 4423}, new MultiEffect(new RemoveTimerEffect("poison"), new EnergyEffect(5), new HealingEffect(5)))),
|
||||||
MAGIC_ESS(new Potion(new int[] {9021, 9022, 9023, 9024}, new SkillEffect(Skills.MAGIC,3,0))),
|
MAGIC_ESS(new Potion(new int[] {9021, 9022, 9023, 9024}, new SkillEffect(Skills.MAGIC,3,0))),
|
||||||
|
|
@ -360,7 +363,7 @@ public enum Consumables {
|
||||||
|
|
||||||
/** Barbarian Mixes */
|
/** Barbarian Mixes */
|
||||||
PRAYERMIX(new BarbarianMix(new int[] {11465, 11467}, new MultiEffect(new PrayerEffect(7, 0.25), new HealingEffect(6)))),
|
PRAYERMIX(new BarbarianMix(new int[] {11465, 11467}, new MultiEffect(new PrayerEffect(7, 0.25), new HealingEffect(6)))),
|
||||||
ZAMMY_MIX(new BarbarianMix(new int[] {11521, 11523}, new MultiEffect(new DamageEffect(10, true), new SkillEffect(Skills.ATTACK, 0, 0.15), new SkillEffect(Skills.STRENGTH, 0, 0.25), new SkillEffect(Skills.DEFENCE, 0, -0.1)))),
|
ZAMMY_MIX(new BarbarianMix(new int[]{11521, 11523}, new MultiEffect(new ZamorakMixEffect(), new SkillEffect(Skills.ATTACK, 2, 0.20), new SkillEffect(Skills.STRENGTH, 2, 0.12), new SkillEffect(Skills.DEFENCE, -2, -0.10)))),
|
||||||
ATT_MIX(new BarbarianMix(new int[] {11429, 11431}, new MultiEffect(new SkillEffect(Skills.ATTACK, 3, 0.1), new HealingEffect(3)))),
|
ATT_MIX(new BarbarianMix(new int[] {11429, 11431}, new MultiEffect(new SkillEffect(Skills.ATTACK, 3, 0.1), new HealingEffect(3)))),
|
||||||
ANTIP_MIX(new BarbarianMix(new int[] {11433, 11435}, new MultiEffect(new AddTimerEffect("poison:immunity", secondsToTicks(90)), new HealingEffect(3)))),
|
ANTIP_MIX(new BarbarianMix(new int[] {11433, 11435}, new MultiEffect(new AddTimerEffect("poison:immunity", secondsToTicks(90)), new HealingEffect(3)))),
|
||||||
RELIC_MIX(new BarbarianMix(new int[] {11437, 11439}, new MultiEffect(new CureDiseaseEffect(), new HealingEffect(3)))),
|
RELIC_MIX(new BarbarianMix(new int[] {11437, 11439}, new MultiEffect(new CureDiseaseEffect(), new HealingEffect(3)))),
|
||||||
|
|
|
||||||
|
|
@ -7,15 +7,21 @@ import core.game.node.entity.player.Player;
|
||||||
public class DamageEffect extends ConsumableEffect {
|
public class DamageEffect extends ConsumableEffect {
|
||||||
final double amt;
|
final double amt;
|
||||||
final boolean isPercent;
|
final boolean isPercent;
|
||||||
|
final int baseAmount;
|
||||||
|
|
||||||
public DamageEffect(double amt,boolean isPercent){
|
public DamageEffect(double amt, boolean isPercent) {
|
||||||
|
this(amt, isPercent, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DamageEffect(double amt, boolean isPercent, int baseAmount) {
|
||||||
this.amt = amt;
|
this.amt = amt;
|
||||||
this.isPercent = isPercent;
|
this.isPercent = isPercent;
|
||||||
|
this.baseAmount = baseAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void activate(Player p) {
|
public void activate(Player p) {
|
||||||
p.getImpactHandler().manualHit(p,-getHealthEffectValue(p), ImpactHandler.HitsplatType.NORMAL);
|
p.getImpactHandler().manualHit(p, -getHealthEffectValue(p), ImpactHandler.HitsplatType.NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -23,8 +29,8 @@ public class DamageEffect extends ConsumableEffect {
|
||||||
double amount = amt;
|
double amount = amt;
|
||||||
if (isPercent) {
|
if (isPercent) {
|
||||||
amount /= 100;
|
amount /= 100;
|
||||||
return (int) -(amount * player.getSkills().getLifepoints());
|
return (int) -(amount * player.getSkills().getLifepoints() + baseAmount);
|
||||||
}
|
}
|
||||||
return (int) -amt;
|
return (int) -(amt + baseAmount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,16 +5,18 @@ import core.game.consumable.ConsumableEffect
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
import core.game.node.entity.skill.Skills
|
import core.game.node.entity.skill.Skills
|
||||||
import org.rs09.consts.Items
|
import org.rs09.consts.Items
|
||||||
|
import kotlin.math.ceil
|
||||||
import kotlin.math.floor
|
import kotlin.math.floor
|
||||||
|
|
||||||
class PrayerEffect(var base: Double, var bonus: Double) : ConsumableEffect() {
|
class PrayerEffect @JvmOverloads constructor(var base: Double, var bonus: Double, private val roundUp: Boolean = false) : ConsumableEffect() {
|
||||||
override fun activate(player: Player?) {
|
override fun activate(player: Player?) {
|
||||||
if(player == null) return
|
if(player == null) return
|
||||||
val level = getStatLevel(player, Skills.PRAYER)
|
val level = getStatLevel(player, Skills.PRAYER)
|
||||||
var b = bonus
|
var b = bonus
|
||||||
if(inInventory(player, Items.HOLY_WRENCH_6714))
|
if(inInventory(player, Items.HOLY_WRENCH_6714))
|
||||||
b += 0.02 // Leaving this in for futureproofing. Current update is for properly rounding down.
|
b += 0.02 // Leaving this in for futureproofing. Current update is for properly rounding down.
|
||||||
val amount = floor(base + (level * b))
|
val rawAmount = base + (level * b)
|
||||||
|
val amount = if (roundUp) ceil(rawAmount) else floor(rawAmount)
|
||||||
modPrayerPoints(player, amount)
|
modPrayerPoints(player, amount)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package content.data.consumables.effects;
|
||||||
|
|
||||||
|
import core.game.consumable.ConsumableEffect;
|
||||||
|
import core.game.node.entity.combat.ImpactHandler;
|
||||||
|
import core.game.node.entity.player.Player;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Zamorak mix shows the regular Zamorak brew hitsplat (10% of pre-drink lifepoints + 2, rounded down)
|
||||||
|
* but also heals 6 lifepoints. The heal must be applied before the hit so the net change can never kill
|
||||||
|
* the player, while the hitsplat still reflects the pre-heal lifepoints.
|
||||||
|
*/
|
||||||
|
public class ZamorakMixEffect extends ConsumableEffect {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void activate(Player p) {
|
||||||
|
int damage = (int) (p.getSkills().getLifepoints() * 0.10 + 2);
|
||||||
|
p.getSkills().heal(6);
|
||||||
|
p.getImpactHandler().manualHit(p, damage, ImpactHandler.HitsplatType.NORMAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getHealthEffectValue(Player player) {
|
||||||
|
return 6 - (int) (player.getSkills().getLifepoints() * 0.10 + 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
package content.global.activity.cchallange.npc
|
package content.global.activity.cchallange.npc
|
||||||
|
|
||||||
import core.api.*
|
import core.api.*
|
||||||
import core.game.container.impl.EquipmentContainer
|
|
||||||
import core.game.global.action.EquipHandler
|
|
||||||
import core.game.node.entity.Entity
|
import core.game.node.entity.Entity
|
||||||
import core.game.node.entity.combat.BattleState
|
import core.game.node.entity.combat.BattleState
|
||||||
import core.game.node.entity.npc.AbstractNPC
|
import core.game.node.entity.npc.AbstractNPC
|
||||||
|
|
@ -62,12 +60,11 @@ class LesserDemonChampionNPC(id: Int = 0, location: Location? = null) : Abstract
|
||||||
super.checkImpact(state)
|
super.checkImpact(state)
|
||||||
val player = state.attacker
|
val player = state.attacker
|
||||||
if (player is Player) {
|
if (player is Player) {
|
||||||
if (!player.equipment[3].hasItemPlugin()) {
|
if (player.equipment.isEmpty) {
|
||||||
state.neutralizeHits()
|
state.neutralizeHits()
|
||||||
state.estimatedHit = state.maximumHit
|
state.estimatedHit = state.maximumHit
|
||||||
} else {
|
} else {
|
||||||
EquipHandler.unequip(player, EquipmentContainer.SLOT_WEAPON, id)
|
sendMessage(player, "You cannot wear any equipment in this challenge.")
|
||||||
sendMessage(player, "You cannot use weapons in this challenge.")
|
|
||||||
if (state.estimatedHit > -1) {
|
if (state.estimatedHit > -1) {
|
||||||
state.estimatedHit = 0
|
state.estimatedHit = 0
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -63,8 +63,8 @@ class ZombieChampionNPC(id: Int = 0, location: Location? = null) : AbstractNPC(i
|
||||||
val player = state.attacker
|
val player = state.attacker
|
||||||
if (player is Player) {
|
if (player is Player) {
|
||||||
if (state.style == CombatStyle.MELEE || state.style == CombatStyle.RANGE) {
|
if (state.style == CombatStyle.MELEE || state.style == CombatStyle.RANGE) {
|
||||||
state.estimatedHit = state.maximumHit
|
|
||||||
state.neutralizeHits()
|
state.neutralizeHits()
|
||||||
|
state.estimatedHit = state.maximumHit
|
||||||
}
|
}
|
||||||
if (state.style == CombatStyle.MAGIC) {
|
if (state.style == CombatStyle.MAGIC) {
|
||||||
sendMessage(player, "You cannot use spells in this challenge.")
|
sendMessage(player, "You cannot use spells in this challenge.")
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ class PenguinManager{
|
||||||
return tagMapping[Penguin.forLocation(location)?.ordinal]?.contains(player.username.toLowerCase()) ?: false
|
return tagMapping[Penguin.forLocation(location)?.ordinal]?.contains(player.username.toLowerCase()) ?: false
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateStoreFile(){
|
fun updateStoreFile(){
|
||||||
val jsonTags = JSONArray()
|
val jsonTags = JSONArray()
|
||||||
tagMapping.filter { it.value.isNotEmpty() }.forEach { (ordinal,taggers) ->
|
tagMapping.filter { it.value.isNotEmpty() }.forEach { (ordinal,taggers) ->
|
||||||
log(this::class.java, Log.FINE, "$ordinal - ${taggers.first()}")
|
log(this::class.java, Log.FINE, "$ordinal - ${taggers.first()}")
|
||||||
|
|
|
||||||
|
|
@ -44,18 +44,65 @@ enum class Penguin(val id: Int, val hint: String, val location: Location){
|
||||||
BUSH_8(NPCs.BUSH_8105,"located in the kingdom of Asgarnia.",Location.create(2951, 3511, 0)),
|
BUSH_8(NPCs.BUSH_8105,"located in the kingdom of Asgarnia.",Location.create(2951, 3511, 0)),
|
||||||
BUSH_9(NPCs.BUSH_8105,"located in the northern desert.",Location.create(3350, 3311, 0)),
|
BUSH_9(NPCs.BUSH_8105,"located in the northern desert.",Location.create(3350, 3311, 0)),
|
||||||
BUSH_10(NPCs.BUSH_8105,"located somewhere in the kingdom of Kandarin.",Location.create(2633, 3501, 0)),
|
BUSH_10(NPCs.BUSH_8105,"located somewhere in the kingdom of Kandarin.",Location.create(2633, 3501, 0)),
|
||||||
BUSH_11(NPCs.BUSH_8105,"located south of Ardougne.",Location.create(2440, 3206, 0)),
|
BUSH_11(NPCs.BUSH_8105,"located where wizards study.",Location.create(3112, 3149, 0)),
|
||||||
BUSH_12(NPCs.BUSH_8105,"located where wizards study.",Location.create(3112, 3149, 0)),
|
|
||||||
ROCK_1(NPCs.ROCK_8109,"located where the Imperial Guard train.",Location.create(2852, 3578, 0)),
|
ROCK_1(NPCs.ROCK_8109,"located where the Imperial Guard train.",Location.create(2852, 3578, 0)),
|
||||||
ROCK_2(NPCs.ROCK_8109,"located in the kingdom of Misthalin.",Location.create(3356, 3416, 0)),
|
ROCK_2(NPCs.ROCK_8109,"located in the kingdom of Misthalin.",Location.create(3356, 3416, 0)),
|
||||||
ROCK_3(NPCs.ROCK_8109,"located near some ogres.",Location.create(2631, 2980, 0)),
|
ROCK_3(NPCs.ROCK_8109,"located near some ogres.",Location.create(2631, 2980, 0)), //potentially incorrect location
|
||||||
ROCK_4(NPCs.ROCK_8109,"located in the Kingdom of Asgarnia.",Location.create(3013, 3501, 0)),
|
ROCK_4(NPCs.ROCK_8109,"located in the Kingdom of Asgarnia.",Location.create(3013, 3501, 0)),
|
||||||
ROCK_5(NPCs.ROCK_8109,"located between Fremennik and barbarians.",Location.create(2532, 3630, 0)),
|
ROCK_5(NPCs.ROCK_8109,"located between Fremennik and barbarians.",Location.create(2532, 3630, 0)),
|
||||||
CRATE_1(NPCs.CRATE_8108,"located in the kingdom of Misthalin.",Location.create(3112, 3332, 0)),
|
CRATE_1(NPCs.CRATE_8108,"located in the kingdom of Misthalin.",Location.create(3112, 3332, 0)),
|
||||||
CRATE_2(NPCs.CRATE_8108,"located in the Kingdom of Misthalin.",Location.create(3305, 3508, 0)),
|
CRATE_2(NPCs.CRATE_8108,"located in the Kingdom of Misthalin.",Location.create(3305, 3508, 0)),
|
||||||
BARREL_1(NPCs.CRATE_8108,"located where no weapons may go.",Location.create(2806, 3383, 0)),
|
CRATE_3(NPCs.CRATE_8108,"located south of Ardougne.",Location.create(2440, 3206, 0)),
|
||||||
|
BARREL_1(NPCs.BARREL_8104,"located where no weapons may go.",Location.create(2806, 3383, 0)),
|
||||||
TOADSTOOL_1(NPCs.TOADSTOOL_8110,"located in the kingdom of Misthalin.",Location.create(3156, 3178, 0)),
|
TOADSTOOL_1(NPCs.TOADSTOOL_8110,"located in the kingdom of Misthalin.",Location.create(3156, 3178, 0)),
|
||||||
TOADSTOOL_2(NPCs.TOADSTOOL_8110,"located in the fairy realm.",Location.create(2409, 4462, 0));
|
TOADSTOOL_2(NPCs.TOADSTOOL_8110,"located in the fairy realm.",Location.create(2409, 4462, 0)), //potentially a spawn from 2010
|
||||||
|
|
||||||
|
BUSH_12(NPCs.BUSH_8105,"located on an island.",Location.create(2534, 3871, 0)),
|
||||||
|
BARREL_2(NPCs.BARREL_8104,"located near the ghost town.",Location.create(3654, 3491, 0)),
|
||||||
|
BUSH_13(NPCs.BUSH_8105,"located where bloodsuckers rule.",Location.create(3600, 3487, 0)),
|
||||||
|
BUSH_14(NPCs.BUSH_8105,"located on islands where brothers quarrel.",Location.create(2355, 3848, 0)),
|
||||||
|
ROCK_6(NPCs.ROCK_8109,"located on a large crescent island.",Location.create(2118, 3943, 0)),
|
||||||
|
ROCK_7(NPCs.ROCK_8109,"located on islands where brothers quarrel.",Location.create(2357, 3797, 0)),
|
||||||
|
ROCK_8(NPCs.ROCK_8109,"located in the Wilderness.",Location.create(3169, 3650, 0)),
|
||||||
|
BARREL_3(NPCs.BARREL_8104,"located where pirates feel mostly harmless.",Location.create(3738, 3001, 0)),
|
||||||
|
CACTUS_3(NPCs.CACTUS_8107,"located in the southern desert.",Location.create(3276, 2797, 0)),
|
||||||
|
TOADSTOOL_3(NPCs.TOADSTOOL_8110,"located near the pointy-eared ones.",Location.create(2314, 3174, 0)),
|
||||||
|
BUSH_15(NPCs.BUSH_8105,"located deep in the jungle.",Location.create(2938, 2978, 0)),
|
||||||
|
TOADSTOOL_4(NPCs.TOADSTOOL_8110,"located near the pointy-eared ones.",Location.create(2219, 3227, 0)),
|
||||||
|
BARREL_4(NPCs.BARREL_8104,"located south of Ardougne.",Location.create(2662, 3152, 0)),
|
||||||
|
//BARREL_5(NPCs.BARREL_8104,"located where monkeys rule.",Location.create(2751, 2700, 0)),
|
||||||
|
//currently not well accessible, will need to add when Ape Atoll is sorted.
|
||||||
|
//BUSH_16(NPCs.BUSH_8105,"located on islands where brothers quarrel.",Location.create(2353, 3834, 0)),
|
||||||
|
//currently not well accessible, will need to add when Neitiznot bridges are fixed.
|
||||||
|
ROCK_9(NPCs.ROCK_8109,"located near a mountain of wolves.",Location.create(2852, 3504, 0)),
|
||||||
|
ROCK_10(NPCs.ROCK_8109,"located on islands where brothers quarrel.",Location.create(2413, 3846, 0)),
|
||||||
|
|
||||||
|
BUSH_17(NPCs.BUSH_8105,"located near some ogres.",Location.create(2578, 2909, 0)),
|
||||||
|
CRATE_4(NPCs.CRATE_8108,"located where banana smugglers dwell.",Location.create(2869, 3157, 0)),
|
||||||
|
//CRATE_5(NPCs.CRATE_8108,"located near the island of Dragontooth.",Location.create(3824, 3562, 0)),
|
||||||
|
//current not accessible, will need to add when Dragontooth island is sorted.
|
||||||
|
ROCK_11(NPCs.ROCK_8109,"located where bloodsuckers rule.",Location.create(3550, 3439, 0)),
|
||||||
|
TOADSTOOL_5(NPCs.TOADSTOOL_8110,"located near the pointy-eared ones.",Location.create(2181, 3172, 0)),
|
||||||
|
BUSH_18(NPCs.BUSH_8105,"located where bloodsuckers rule.",Location.create(3472, 3392, 0)),
|
||||||
|
BUSH_19(NPCs.BUSH_8105,"located near Port Sarim.",Location.create(2989, 3121, 0)),
|
||||||
|
CRATE_6(NPCs.CRATE_8108,"located where fishers colonise.",Location.create(2322, 3658, 0)),
|
||||||
|
ROCK_12(NPCs.ROCK_8109,"located between Fremennik and barbarians.",Location.create(2675, 3717, 0)),
|
||||||
|
ROCK_13(NPCs.ROCK_8109,"located near the pointy-eared ones.",Location.create(2296, 3270, 0)),
|
||||||
|
CRATE_7(NPCs.CRATE_8108,"located where bloodsuckers rule.",Location.create(3637, 3486, 0)),
|
||||||
|
TOADSTOOL_6(NPCs.TOADSTOOL_8110,"located where bloodsuckers rule.",Location.create(3416, 3437, 0)),
|
||||||
|
BUSH_20(NPCs.BUSH_8105,"located where monkeys rule.",Location.create(2802, 2806, 0)),
|
||||||
|
|
||||||
|
ROCK_14(NPCs.ROCK_8109,"located near some ogres.",Location.create(2438, 3050, 0)),
|
||||||
|
CACTUS_4(NPCs.CACTUS_8107,"located in the southern desert.",Location.create(3252, 2963, 0)),
|
||||||
|
ROCK_15(NPCs.ROCK_8109,"located near some ogres.",Location.create(2340, 3064, 0)),
|
||||||
|
ROCK_16(NPCs.ROCK_8109,"located in the Wilderness.",Location.create(3108, 3837, 0)),
|
||||||
|
CACTUS_5(NPCs.CACTUS_8107,"located in the southern desert.",Location.create(3433, 3000, 0)),
|
||||||
|
CACTUS_6(NPCs.CACTUS_8107,"located in the southern desert.",Location.create(3274, 2813, 0)),
|
||||||
|
ROCK_17(NPCs.ROCK_8109,"located in the Wilderness.",Location.create(3019, 3866, 0)),
|
||||||
|
ROCK_18(NPCs.ROCK_8109,"located in the Wilderness.",Location.create(2991, 3824, 0)),
|
||||||
|
BUSH_21(NPCs.BUSH_8105,"located north of Ardougne.",Location.create(2398, 3361, 0)),
|
||||||
|
ROCK_19(NPCs.ROCK_8109,"located near the coast.",Location.create(2733, 3283, 0)),
|
||||||
|
ROCK_20(NPCs.ROCK_8109,"located in the Wilderness.",Location.create(3236, 3927, 0));
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val locationMap = values().map { it.location.toString() to it }.toMap()
|
private val locationMap = values().map { it.location.toString() to it }.toMap()
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
package content.global.ame
|
package content.global.ame
|
||||||
|
|
||||||
import content.global.ame.events.surpriseexam.MysteriousOldManNPC
|
import content.global.ame.events.surpriseexam.MysteriousOldManNPC
|
||||||
|
import core.api.getAttribute
|
||||||
import core.api.playGlobalAudio
|
import core.api.playGlobalAudio
|
||||||
import core.api.poofClear
|
import core.api.poofClear
|
||||||
|
import core.api.removeAttribute
|
||||||
import core.api.sendMessage
|
import core.api.sendMessage
|
||||||
import core.api.setAttribute
|
import core.api.setAttribute
|
||||||
import core.api.utils.WeightBasedTable
|
import core.api.utils.WeightBasedTable
|
||||||
|
|
@ -25,8 +27,6 @@ import core.tools.secondsToTicks
|
||||||
import core.tools.ticksToCycles
|
import core.tools.ticksToCycles
|
||||||
import org.rs09.consts.NPCs
|
import org.rs09.consts.NPCs
|
||||||
import org.rs09.consts.Sounds
|
import org.rs09.consts.Sounds
|
||||||
import kotlin.math.ceil
|
|
||||||
import kotlin.math.min
|
|
||||||
import kotlin.random.Random
|
import kotlin.random.Random
|
||||||
import kotlin.reflect.full.createInstance
|
import kotlin.reflect.full.createInstance
|
||||||
|
|
||||||
|
|
@ -37,8 +37,8 @@ abstract class RandomEventNPC(id: Int) : NPC(id) {
|
||||||
val SMOKE_GRAPHICS = Graphics(86)
|
val SMOKE_GRAPHICS = Graphics(86)
|
||||||
var initialized = false
|
var initialized = false
|
||||||
var finalized = false
|
var finalized = false
|
||||||
var timerPaused = false
|
|
||||||
var ticksLeft = secondsToTicks(180)
|
var ticksLeft = secondsToTicks(180)
|
||||||
|
private val combatBracket = intArrayOf(10, 20, 40, 60, 90)
|
||||||
|
|
||||||
open fun create(player: Player, loot: WeightBasedTable? = null, type: String = ""): RandomEventNPC {
|
open fun create(player: Player, loot: WeightBasedTable? = null, type: String = ""): RandomEventNPC {
|
||||||
val event = this::class.createInstance()
|
val event = this::class.createInstance()
|
||||||
|
|
@ -56,6 +56,7 @@ abstract class RandomEventNPC(id: Int) : NPC(id) {
|
||||||
poofClear(this)
|
poofClear(this)
|
||||||
playGlobalAudio(this.location, Sounds.SMOKEPUFF_1930, ticksToCycles(1))
|
playGlobalAudio(this.location, Sounds.SMOKEPUFF_1930, ticksToCycles(1))
|
||||||
}
|
}
|
||||||
|
removeAttribute(player, "random:pause")
|
||||||
finalized = true
|
finalized = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -92,7 +93,6 @@ abstract class RandomEventNPC(id: Int) : NPC(id) {
|
||||||
override fun init() {
|
override fun init() {
|
||||||
initialized = true
|
initialized = true
|
||||||
finalized = false
|
finalized = false
|
||||||
timerPaused = false
|
|
||||||
spawnLocation ?: terminate()
|
spawnLocation ?: terminate()
|
||||||
location = spawnLocation
|
location = spawnLocation
|
||||||
player.setAttribute("re-npc", this)
|
player.setAttribute("re-npc", this)
|
||||||
|
|
@ -144,12 +144,13 @@ abstract class RandomEventNPC(id: Int) : NPC(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun idForCombatLevel(ids: List<Int>, player: Player): Int {
|
fun idForCombatLevel(ids: List<Int>, player: Player): Int {
|
||||||
val index = min(ids.size, ceil(player.properties.currentCombatLevel / 20.0).toInt()) - 1
|
val index = combatBracket.indexOfFirst { player.properties.currentCombatLevel <= it }.takeIf { it != -1 }?: ids.lastIndex
|
||||||
return ids[index]
|
return ids[index]
|
||||||
}
|
}
|
||||||
|
|
||||||
fun sayLine(npc: NPC, phrases: Array<String>, hasOpeningPhrase: Boolean, hasOverTimePhrase: Boolean) {
|
fun sayLine(npc: NPC, phrases: Array<String>, hasOpeningPhrase: Boolean, hasOverTimePhrase: Boolean) {
|
||||||
if (!timerPaused && (ticksLeft % 20 == 0 || ticksLeft <= 2)) { //unless the Certer interface is up, speak every 20 ticks, or in the 2nd-to-last tick before attack/note-&-teleport
|
val inInteraction = getAttribute(player, "random:pause", false) //used by Certer
|
||||||
|
if ((ticksLeft % 20 == 0 || ticksLeft <= 2) && !inInteraction) { //speak every 20 ticks, or in the 2nd-to-last tick before attack/note-&-teleport
|
||||||
var playDwarfWhistle = true
|
var playDwarfWhistle = true
|
||||||
if (ticksLeft == secondsToTicks(180) && hasOpeningPhrase) {
|
if (ticksLeft == secondsToTicks(180) && hasOpeningPhrase) {
|
||||||
sendChat(phrases[0])
|
sendChat(phrases[0])
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import org.rs09.consts.NPCs
|
||||||
import content.global.ame.RandomEventNPC
|
import content.global.ame.RandomEventNPC
|
||||||
import core.api.animate
|
import core.api.animate
|
||||||
import core.api.lock
|
import core.api.lock
|
||||||
|
import core.api.setAttribute
|
||||||
import core.api.utils.WeightBasedTable
|
import core.api.utils.WeightBasedTable
|
||||||
|
|
||||||
class CerterNPC(override var loot: WeightBasedTable? = null) : RandomEventNPC(NPCs.GILES_2538) {
|
class CerterNPC(override var loot: WeightBasedTable? = null) : RandomEventNPC(NPCs.GILES_2538) {
|
||||||
|
|
@ -33,8 +34,7 @@ class CerterNPC(override var loot: WeightBasedTable? = null) : RandomEventNPC(NP
|
||||||
"It's really rude to ignore someone, ${player.username}!",
|
"It's really rude to ignore someone, ${player.username}!",
|
||||||
"No-one ignores me!"
|
"No-one ignores me!"
|
||||||
)
|
)
|
||||||
player.setAttribute("random:pause", false)
|
setAttribute(player, "certer:reward", false)
|
||||||
player.setAttribute("certer:reward", false)
|
|
||||||
animate(this, Emotes.BOW.animation, true)
|
animate(this, Emotes.BOW.animation, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -42,4 +42,4 @@ class CerterNPC(override var loot: WeightBasedTable? = null) : RandomEventNPC(NP
|
||||||
noteAndTeleport()
|
noteAndTeleport()
|
||||||
terminate()
|
terminate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,20 @@ class MazeInterface : InteractionListener, EventHook<TickEvent>, MapArea {
|
||||||
WeightedItem(Items.DEFENCE_POTION2_135,1,1,1.0),
|
WeightedItem(Items.DEFENCE_POTION2_135,1,1,1.0),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
private val ONE_WAY_WALL = mapOf(
|
||||||
|
Location.create(2904, 4573, 0) to setOf( // Diagonal entries
|
||||||
|
Location.create(2904, 4573, 0),
|
||||||
|
Location.create(2904, 4572, 0),
|
||||||
|
Location.create(2904, 4574, 0),
|
||||||
|
),
|
||||||
|
Location.create(2906, 4586, 0) to setOf( // Diagonal entries
|
||||||
|
Location.create(2906, 4586, 0),
|
||||||
|
Location.create(2907, 4586, 0),
|
||||||
|
),
|
||||||
|
Location.create(2902, 4575, 0) to setOf(Location.create(2903, 4575, 0)),
|
||||||
|
Location.create(2924, 4583, 0) to setOf(Location.create(2923, 4583, 0)),
|
||||||
|
)
|
||||||
|
|
||||||
fun initMaze(player: Player) {
|
fun initMaze(player: Player) {
|
||||||
setAttribute(player, MAZE_ATTRIBUTE_TICKS_LEFT, 300)
|
setAttribute(player, MAZE_ATTRIBUTE_TICKS_LEFT, 300)
|
||||||
setVarp(player, MAZE_TIMER_VARP, (getAttribute<Int>(player, MAZE_ATTRIBUTE_TICKS_LEFT, 0) / 3),false)
|
setVarp(player, MAZE_TIMER_VARP, (getAttribute<Int>(player, MAZE_ATTRIBUTE_TICKS_LEFT, 0) / 3),false)
|
||||||
|
|
@ -190,10 +204,25 @@ class MazeInterface : InteractionListener, EventHook<TickEvent>, MapArea {
|
||||||
return@on true
|
return@on true
|
||||||
}
|
}
|
||||||
|
|
||||||
on(Scenery.WALL_3628, IntType.SCENERY, "open") { player, node ->
|
on(
|
||||||
// Door opening workaround
|
intArrayOf(
|
||||||
// Ignore 3629(WALL_3629) and 3630(WALL_3630) in handleAutowalkDoor ignoreSecondDoor
|
Scenery.WALL_3628,
|
||||||
DoorActionHandler.handleAutowalkDoor(player, node as core.game.node.scenery.Scenery)
|
Scenery.WALL_3629,
|
||||||
|
Scenery.WALL_3630,
|
||||||
|
Scenery.WALL_3631,
|
||||||
|
Scenery.WALL_3632,
|
||||||
|
),
|
||||||
|
IntType.SCENERY,
|
||||||
|
"open"
|
||||||
|
) { player, node ->
|
||||||
|
val scenery = node as core.game.node.scenery.Scenery
|
||||||
|
|
||||||
|
if (ONE_WAY_WALL[scenery.location]?.contains(player.location) == true) {
|
||||||
|
sendDialogue(player, "I don't think that's the right way.")
|
||||||
|
} else {
|
||||||
|
DoorActionHandler.handleAutowalkDoor(player, scenery)
|
||||||
|
}
|
||||||
|
|
||||||
return@on true
|
return@on true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ class QuizMasterNPC(var type: String = "", override var loot: WeightBasedTable?
|
||||||
super.init()
|
super.init()
|
||||||
sendChat("Hey ${player.username}! It's your lucky day!")
|
sendChat("Hey ${player.username}! It's your lucky day!")
|
||||||
face(player)
|
face(player)
|
||||||
kidnapPlayer(this, player, Location(1952, 4764, 0)) { player, _ ->
|
kidnapPlayer(this, player, Location(1952, 4764, 1)) { player, _ ->
|
||||||
setAttribute(player, QuizMasterDialogueFile.QUIZMASTER_ATTRIBUTE_QUESTIONS_CORRECT, 0)
|
setAttribute(player, QuizMasterDialogueFile.QUIZMASTER_ATTRIBUTE_QUESTIONS_CORRECT, 0)
|
||||||
sendMessage(player, "Answer four questions correctly in a row to be teleported back where you came from.")
|
sendMessage(player, "Answer four questions correctly in a row to be teleported back where you came from.")
|
||||||
sendMessage(player, "You will need to relog in if you lose the quiz dialog.") // Inauthentic, but there to notify the player in case.
|
sendMessage(player, "You will need to relog in if you lose the quiz dialog.") // Inauthentic, but there to notify the player in case.
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import core.game.bots.SkillingBotAssembler
|
||||||
import core.game.bots.Script
|
import core.game.bots.Script
|
||||||
import core.game.interaction.IntType
|
import core.game.interaction.IntType
|
||||||
import core.game.interaction.InteractionListeners
|
import core.game.interaction.InteractionListeners
|
||||||
|
import core.game.node.entity.skill.Skills
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class ManThiever : Script() {
|
class ManThiever : Script() {
|
||||||
|
|
@ -22,6 +23,6 @@ class ManThiever : Script() {
|
||||||
}
|
}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
equipment.addAll(Arrays.asList(Item(1103), Item(1139), Item(1265)))
|
skills[Skills.THIEVING] = 20
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2,6 +2,7 @@ package content.global.dialogue;
|
||||||
|
|
||||||
import content.global.handlers.item.book.GeneralRuleBook;
|
import content.global.handlers.item.book.GeneralRuleBook;
|
||||||
import core.game.dialogue.DialoguePlugin;
|
import core.game.dialogue.DialoguePlugin;
|
||||||
|
import core.game.diary.DiaryLevel;
|
||||||
import core.game.node.entity.npc.NPC;
|
import core.game.node.entity.npc.NPC;
|
||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.node.entity.player.link.diary.DiaryType;
|
import core.game.node.entity.player.link.diary.DiaryType;
|
||||||
|
|
@ -10,6 +11,10 @@ import core.game.world.GameWorld;
|
||||||
import core.game.world.update.flag.context.Animation;
|
import core.game.world.update.flag.context.Animation;
|
||||||
import core.plugin.Initializable;
|
import core.plugin.Initializable;
|
||||||
import core.tools.RandomFunction;
|
import core.tools.RandomFunction;
|
||||||
|
import org.rs09.consts.NPCs;
|
||||||
|
|
||||||
|
import static content.region.misthalin.lumbridge.diary.LumbridgeAchivementDiary.Companion.BeginnerTasks.DRAYNOR_TALK_TO_TOWNCRIER_ABOUT_RULES;
|
||||||
|
import static core.api.ContentAPIKt.finishTask;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the town crier dialogue plugin.
|
* Represents the town crier dialogue plugin.
|
||||||
|
|
@ -127,9 +132,8 @@ public final class TownCrierDialogue extends DialoguePlugin {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// Find out about the Rules of Conduct from the Draynor<br><br>Town Crier
|
if (npc.getId() == NPCs.TOWN_CRIER_6136) {
|
||||||
if (npc.getId() == 6136) {
|
finishTask(player, DiaryType.LUMBRIDGE, DiaryLevel.BEGINNER, DRAYNOR_TALK_TO_TOWNCRIER_ABOUT_RULES);
|
||||||
player.getAchievementDiaryManager().finishTask(player, DiaryType.LUMBRIDGE, 0, 10);
|
|
||||||
}
|
}
|
||||||
stage = 71;
|
stage = 71;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import core.game.component.ComponentDefinition
|
||||||
import core.game.component.ComponentPlugin
|
import core.game.component.ComponentPlugin
|
||||||
import core.game.container.access.InterfaceContainer
|
import core.game.container.access.InterfaceContainer
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
|
import core.game.node.entity.player.link.diary.DiaryType
|
||||||
import core.game.node.item.Item
|
import core.game.node.item.Item
|
||||||
import core.plugin.Initializable
|
import core.plugin.Initializable
|
||||||
import core.plugin.Plugin
|
import core.plugin.Plugin
|
||||||
|
|
@ -165,6 +166,10 @@ class FurClothingInterface : ComponentPlugin(){
|
||||||
if (removeItem(player, requiredFur, Container.INVENTORY) &&
|
if (removeItem(player, requiredFur, Container.INVENTORY) &&
|
||||||
removeItem(player, coins, Container.INVENTORY)) {
|
removeItem(player, coins, Container.INVENTORY)) {
|
||||||
addItem(player, clothing.product.id, amount)
|
addItem(player, clothing.product.id, amount)
|
||||||
|
|
||||||
|
if (clothing == FUR_CLOTHING.DASH_CAPE) {
|
||||||
|
player.achievementDiaryManager.finishTask(player, DiaryType.VARROCK, 2, 2)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
package content.global.handlers.iface;
|
|
||||||
|
|
||||||
import static core.api.ContentAPIKt.*;
|
|
||||||
import core.game.component.Component;
|
|
||||||
import core.game.component.ComponentDefinition;
|
|
||||||
import core.game.component.ComponentPlugin;
|
|
||||||
import content.global.travel.glider.GliderPulse;
|
|
||||||
import content.global.travel.glider.Gliders;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.plugin.Initializable;
|
|
||||||
import core.plugin.Plugin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the glider interface component.
|
|
||||||
* @author Emperor
|
|
||||||
* @author 'Vexia
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public final class GliderInterface extends ComponentPlugin {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
ComponentDefinition.put(138, this);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(final Player player, Component component, int opcode, int button, int slot, int itemId) {
|
|
||||||
final Gliders glider = Gliders.forId(button);
|
|
||||||
if (glider == null) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
submitWorldPulse(new GliderPulse(1, player, glider));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
package content.global.handlers.iface
|
||||||
|
|
||||||
|
import core.api.submitWorldPulse
|
||||||
|
import content.global.travel.glider.GliderPulse
|
||||||
|
import content.global.travel.glider.Gliders
|
||||||
|
import core.game.interaction.InterfaceListener
|
||||||
|
import org.rs09.consts.Components
|
||||||
|
|
||||||
|
class GliderInterface : InterfaceListener {
|
||||||
|
override fun defineInterfaceListeners() {
|
||||||
|
on(Components.GLIDERMAP_138) { player, _, _, button, _, _ ->
|
||||||
|
val glider = Gliders.forId(button) ?: return@on true
|
||||||
|
submitWorldPulse(GliderPulse(1, player, glider))
|
||||||
|
return@on true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,90 +0,0 @@
|
||||||
package content.global.handlers.iface;
|
|
||||||
|
|
||||||
import static core.api.ContentAPIKt.*;
|
|
||||||
import core.game.component.Component;
|
|
||||||
import core.game.component.ComponentDefinition;
|
|
||||||
import core.game.component.ComponentPlugin;
|
|
||||||
import content.global.skill.crafting.TanningProduct;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
import core.plugin.Initializable;
|
|
||||||
import core.plugin.Plugin;
|
|
||||||
import kotlin.Unit;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vexia
|
|
||||||
* @version 1.2
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public class TanningInterface extends ComponentPlugin {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method used to create a new instance.
|
|
||||||
* @param arg
|
|
||||||
* @return
|
|
||||||
* @throws Throwable
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
ComponentDefinition.put(324, this);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(Player player, Component component, int opcode, int button, int slot, int itemId) {
|
|
||||||
TanningProduct def = null;
|
|
||||||
switch (button) {
|
|
||||||
case 1:
|
|
||||||
def = TanningProduct.SOFT_LEATHER;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
def = TanningProduct.HARD_LEATHER;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
def = TanningProduct.SNAKESKIN;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
def = TanningProduct.SNAKESKIN2;
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
def = TanningProduct.GREEN_DHIDE;
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
def = TanningProduct.BLUEDHIDE;
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
def = TanningProduct.REDDHIDE;
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
def = TanningProduct.BLACKDHIDE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (def == null) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
int amount = 0;
|
|
||||||
final TanningProduct deff = def;
|
|
||||||
switch (opcode){
|
|
||||||
case 155:
|
|
||||||
amount = 1;
|
|
||||||
break;
|
|
||||||
case 196:
|
|
||||||
amount = 5;
|
|
||||||
break;
|
|
||||||
case 124:
|
|
||||||
amount = 10;
|
|
||||||
case 199:
|
|
||||||
sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
|
||||||
TanningProduct.tan(player, (int) value, deff);
|
|
||||||
return Unit.INSTANCE;
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case 234:
|
|
||||||
amount = player.getInventory().getAmount(new Item(def.getItem(), 1));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
TanningProduct.tan(player, amount, def);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package content.global.handlers.iface
|
||||||
|
|
||||||
|
import content.global.skill.crafting.TanningProduct
|
||||||
|
import core.api.amountInInventory
|
||||||
|
import core.api.sendInputDialogue
|
||||||
|
import core.game.interaction.InterfaceListener
|
||||||
|
|
||||||
|
class TanningInterface : InterfaceListener {
|
||||||
|
override fun defineInterfaceListeners() {
|
||||||
|
on(324) { player, _, opcode, buttonID, _, _ ->
|
||||||
|
val product = TanningProduct.forId(buttonID)
|
||||||
|
|
||||||
|
when (opcode) {
|
||||||
|
155 -> TanningProduct.tan(player, 1, product)
|
||||||
|
196 -> TanningProduct.tan(player, 5, product)
|
||||||
|
124 -> TanningProduct.tan(player, 10, product)
|
||||||
|
199 -> sendInputDialogue(player, true, "Enter the amount:") { value ->
|
||||||
|
TanningProduct.tan(player, value as Int, product)
|
||||||
|
}
|
||||||
|
234 -> TanningProduct.tan(player, amountInInventory(player, product.item), product)
|
||||||
|
}
|
||||||
|
return@on true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -127,7 +127,7 @@ private const val F_FLARES = 72
|
||||||
private const val F_PLAIN_TROUSERS = 70
|
private const val F_PLAIN_TROUSERS = 70
|
||||||
private const val F_SHORTS = 77
|
private const val F_SHORTS = 77
|
||||||
|
|
||||||
private val femaleLegIDs = intArrayOf(F_FINE_SKIRT, F_FRILLED_SKIRT, F_LAYERED_SKIRT, F_LONG_NARROW_SKIRT, F_RAGGED_SKIRT, F_TATTERED_SKIRT, F_SHORT_SKIRT, F_SASHED_SKIRT, F_FITTED_SKIRT, F_TORN_TROUSERS, F_LONG_SKIRT, F_TURN_UPS, F_FLARES, F_FLARES, F_PLAIN_TROUSERS, F_SHORTS)
|
private val femaleLegIDs = intArrayOf(F_FINE_SKIRT, F_FRILLED_SKIRT, F_LAYERED_SKIRT, F_LONG_NARROW_SKIRT, F_RAGGED_SKIRT, F_TATTERED_SKIRT, F_SHORT_SKIRT, F_SASHED_SKIRT, F_FITTED_SKIRT, F_TORN_TROUSERS, F_LONG_SKIRT, F_TURN_UPS, F_FLARES, F_PLAIN_TROUSERS, F_SHORTS)
|
||||||
|
|
||||||
private val COINS = Item(995,1000)
|
private val COINS = Item(995,1000)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
package content.global.handlers.iface;
|
|
||||||
|
|
||||||
import core.game.component.Component;
|
|
||||||
import core.game.component.ComponentDefinition;
|
|
||||||
import core.game.component.ComponentPlugin;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.plugin.Initializable;
|
|
||||||
import core.plugin.Plugin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handles the world map interface.
|
|
||||||
* @author Emperor
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public final class WorldMapInterface extends ComponentPlugin {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
ComponentDefinition.forId(755).setPlugin(this);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Thanks snicker!
|
|
||||||
@Override
|
|
||||||
public boolean handle(Player player, Component component, int opcode, int button, int slot, int itemId) {
|
|
||||||
switch (button) {
|
|
||||||
case 3:
|
|
||||||
player.getInterfaceManager().openWindowsPane(new Component(player.getInterfaceManager().isResizable() ? 746 : 548), 2);
|
|
||||||
player.getPacketDispatch().sendRunScript(1187, "ii", 0, 0);
|
|
||||||
player.updateSceneGraph(true);
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
//log(this.getClass(), Log.ERR, "World map: buttonid: " + button + ", opcode: " + opcode + ", slot: " + slot);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
package content.global.handlers.iface
|
||||||
|
|
||||||
|
import core.game.component.Component
|
||||||
|
import core.game.interaction.InterfaceListener
|
||||||
|
import org.rs09.consts.Components
|
||||||
|
|
||||||
|
class WorldMapInterface : InterfaceListener {
|
||||||
|
override fun defineInterfaceListeners() {
|
||||||
|
on(Components.WORLDMAP_755) { player, _, _, button, _, _ ->
|
||||||
|
if (button == 3) {
|
||||||
|
val paneId = if (player.interfaceManager.isResizable) {
|
||||||
|
Components.TOPLEVEL_FULLSCREEN_746
|
||||||
|
} else {
|
||||||
|
Components.TOPLEVEL_548
|
||||||
|
}
|
||||||
|
player.interfaceManager.openWindowsPane(Component(paneId), 2)
|
||||||
|
player.packetDispatch.sendRunScript(1187, "ii", 0, 0)
|
||||||
|
player.updateSceneGraph(true)
|
||||||
|
}
|
||||||
|
return@on true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,7 +2,6 @@ package content.global.handlers.item
|
||||||
|
|
||||||
import content.global.skill.slayer.SlayerUtils
|
import content.global.skill.slayer.SlayerUtils
|
||||||
import core.api.*
|
import core.api.*
|
||||||
import content.global.skill.slayer.Tasks
|
|
||||||
import org.rs09.consts.Items
|
import org.rs09.consts.Items
|
||||||
import core.game.dialogue.DialogueFile
|
import core.game.dialogue.DialogueFile
|
||||||
import core.game.dialogue.IfTopic
|
import core.game.dialogue.IfTopic
|
||||||
|
|
@ -39,12 +38,7 @@ class EnchantedGemDialogue() : DialogueFile() {
|
||||||
if(!hasSlayerTask(player!!)) {
|
if(!hasSlayerTask(player!!)) {
|
||||||
npcl(core.game.dialogue.FacialExpression.HALF_THINKING, "You need something new to hunt. Come and see me when you can and I'll give you a new task.").also { stage = 1 }
|
npcl(core.game.dialogue.FacialExpression.HALF_THINKING, "You need something new to hunt. Come and see me when you can and I'll give you a new task.").also { stage = 1 }
|
||||||
} else {
|
} else {
|
||||||
if(getSlayerTask(player!!) == Tasks.JAD) {
|
npcl(core.game.dialogue.FacialExpression.FRIENDLY, "You're currently assigned to kill ${SlayerUtils.pluralise(getSlayerTaskName(player!!))}; only ${getSlayerTaskKillsRemaining(player!!)} more to go.")
|
||||||
npcl(core.game.dialogue.FacialExpression.FRIENDLY, "You're currently assigned to kill TzTok-Jad!")
|
|
||||||
} else {
|
|
||||||
npcl(core.game.dialogue.FacialExpression.FRIENDLY, "You're currently assigned to kill ${SlayerUtils.pluralise(
|
|
||||||
getSlayerTaskName(player!!))}; only ${getSlayerTaskKillsRemaining(player!!)} more to go.")
|
|
||||||
}
|
|
||||||
setVarp(player!!, 2502, getSlayerTaskFlags(player!!) shr 4)
|
setVarp(player!!, 2502, getSlayerTaskFlags(player!!) shr 4)
|
||||||
stage = 1
|
stage = 1
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
package content.global.handlers.item
|
||||||
|
|
||||||
|
import core.api.*
|
||||||
|
import core.game.interaction.InteractionListener
|
||||||
|
import core.game.interaction.InterfaceListener
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
import org.rs09.consts.NPCs
|
||||||
|
import org.rs09.consts.Sounds
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles morphing with the Ring of Stone and Easter Ring.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class MorphItemListener : InteractionListener, InterfaceListener {
|
||||||
|
|
||||||
|
// the morphing items
|
||||||
|
private val morphItems = intArrayOf(Items.RING_OF_STONE_6583, Items.EASTER_RING_7927)
|
||||||
|
|
||||||
|
// the NPCs to morph into
|
||||||
|
private val easterEggs = intArrayOf(
|
||||||
|
NPCs.EGG_3689,
|
||||||
|
NPCs.EGG_3690,
|
||||||
|
NPCs.EGG_3691,
|
||||||
|
NPCs.EGG_3692,
|
||||||
|
NPCs.EGG_3693,
|
||||||
|
NPCs.EGG_3694
|
||||||
|
)
|
||||||
|
private val stone = intArrayOf(NPCs.ROCKS_2626)
|
||||||
|
|
||||||
|
// the "unmorph" interface
|
||||||
|
private val morphIface = 375
|
||||||
|
|
||||||
|
// equipping the morph items
|
||||||
|
override fun defineListeners() {
|
||||||
|
onEquip(morphItems) { player, item ->
|
||||||
|
morph(player, item.id)
|
||||||
|
return@onEquip false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// the interface that appears when you morph
|
||||||
|
override fun defineInterfaceListeners() {
|
||||||
|
|
||||||
|
// hitting the 'unmorph' button
|
||||||
|
on(morphIface){ player, _, _, buttonID, _, _ ->
|
||||||
|
when(buttonID) {
|
||||||
|
3 -> closeAllInterfaces(player)
|
||||||
|
}
|
||||||
|
return@on true
|
||||||
|
}
|
||||||
|
|
||||||
|
// after the interface closes
|
||||||
|
onClose(morphIface) { player, _ ->
|
||||||
|
unmorph(player)
|
||||||
|
return@onClose true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// morphs the player
|
||||||
|
private fun morph(player: Player, item: Int) {
|
||||||
|
val morphId = when (item) {
|
||||||
|
Items.RING_OF_STONE_6583 -> stone.random()
|
||||||
|
else -> easterEggs.random()
|
||||||
|
}
|
||||||
|
playAudio(player, Sounds.EASTER06_HUMAN_INTO_EGG_1520)
|
||||||
|
stopWalk(player)
|
||||||
|
closeAllInterfaces(player)
|
||||||
|
player.appearance.transformNPC(morphId)
|
||||||
|
openInterface(player, morphIface)
|
||||||
|
}
|
||||||
|
|
||||||
|
// unmorphs the player
|
||||||
|
private fun unmorph(player: Player) {
|
||||||
|
player.appearance.transformNPC(-1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,113 +0,0 @@
|
||||||
package content.global.handlers.item;
|
|
||||||
|
|
||||||
import core.cache.def.impl.ItemDefinition;
|
|
||||||
import core.game.component.CloseEvent;
|
|
||||||
import core.game.component.Component;
|
|
||||||
import core.game.component.ComponentDefinition;
|
|
||||||
import core.game.component.ComponentPlugin;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
import core.game.world.GameWorld;
|
|
||||||
import core.plugin.Initializable;
|
|
||||||
import core.plugin.Plugin;
|
|
||||||
import core.plugin.ClassScanner;
|
|
||||||
import core.tools.RandomFunction;
|
|
||||||
import org.rs09.consts.Sounds;
|
|
||||||
|
|
||||||
import static core.api.ContentAPIKt.playAudio;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handles a morph item.
|
|
||||||
* @author Vexia
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public class MorphItemPlugin implements Plugin<Object> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The easter egg ids.
|
|
||||||
*/
|
|
||||||
protected static final int[] EASTER_EGG_IDS = new int[] { 3689, 3690, 3691, 3692, 3693, 3694 };
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The morph component.
|
|
||||||
*/
|
|
||||||
private static final Component COMPONENT = new Component(375).setCloseEvent(new CloseEvent() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean close(Player player, Component c) {
|
|
||||||
unmorph(player);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
ItemDefinition.forId(7927).getHandlers().put("equipment", this);
|
|
||||||
ItemDefinition.forId(6583).getHandlers().put("equipment", this);
|
|
||||||
ClassScanner.definePlugin(new MorphInterfacePlugin());
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object fireEvent(String identifier, Object... args) {
|
|
||||||
final Player player = (Player) args[0];
|
|
||||||
final Item item = (Item) args[1];
|
|
||||||
switch (identifier) {
|
|
||||||
case "equip":
|
|
||||||
morph(player, item);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Morphs the player.
|
|
||||||
* @param player the player.
|
|
||||||
* @param item the item.
|
|
||||||
*/
|
|
||||||
private void morph(Player player, Item item) {
|
|
||||||
int morphId = item.getId() == 6583 ? 2626 : EASTER_EGG_IDS[RandomFunction.random(EASTER_EGG_IDS.length)];
|
|
||||||
playAudio(player, 1520);
|
|
||||||
player.getInterfaceManager().close();
|
|
||||||
player.getAppearance().transformNPC(morphId);
|
|
||||||
player.getInterfaceManager().removeTabs(0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14);
|
|
||||||
player.getLocks().lockMovement(GameWorld.getTicks() + 900000000);
|
|
||||||
player.getLocks().lockInteractions(GameWorld.getTicks() + 90000000);
|
|
||||||
player.getLocks().lockTeleport(GameWorld.getTicks() + 900000000);
|
|
||||||
player.getInterfaceManager().openSingleTab(COMPONENT);
|
|
||||||
player.getAppearance().sync();
|
|
||||||
player.getWalkingQueue().reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unmorphs the player.
|
|
||||||
* @param player the player.
|
|
||||||
*/
|
|
||||||
private static void unmorph(Player player) {
|
|
||||||
player.getAppearance().transformNPC(-1);
|
|
||||||
player.unlock();
|
|
||||||
player.getInterfaceManager().restoreTabs();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handles the morph interface plugin.
|
|
||||||
* @author Vexia
|
|
||||||
*/
|
|
||||||
public class MorphInterfacePlugin extends ComponentPlugin {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
ComponentDefinition.forId(375).setPlugin(this);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(Player player, Component component, int opcode, int button, int slot, int itemId) {
|
|
||||||
player.getInterfaceManager().closeSingleTab();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -129,9 +129,9 @@ class SheepBehavior : NPCBehavior(*sheepIds), InteractionListener {
|
||||||
val sheepDirection = Direction.getDirection(sheepLocation, playerLocation) // Get direction sheep is facing, from the player's location
|
val sheepDirection = Direction.getDirection(sheepLocation, playerLocation) // Get direction sheep is facing, from the player's location
|
||||||
val sheepOppositeDirection = sheepDirection.getOpposite() // Switch to opposite direction
|
val sheepOppositeDirection = sheepDirection.getOpposite() // Switch to opposite direction
|
||||||
|
|
||||||
val xWalkLocation = sheepLocation.getX() + (sheepOppositeDirection.getStepX() * 3) // Gets x location, if set, 3 steps away from player
|
val xWalkLocation = sheepLocation.x + (sheepOppositeDirection.getStepX() * 3) // Gets x location, if set, 3 steps away from player
|
||||||
val yWalkLocation = sheepLocation.getY() + (sheepOppositeDirection.getStepY() * 3) // Gets y location, if set, 3 steps away from player
|
val yWalkLocation = sheepLocation.y + (sheepOppositeDirection.getStepY() * 3) // Gets y location, if set, 3 steps away from player
|
||||||
val sheepWalkToLocation = Location(xWalkLocation, yWalkLocation, sheepLocation.getZ()); // New location for pathfinding
|
val sheepWalkToLocation = Location(xWalkLocation, yWalkLocation, sheepLocation.z); // New location for pathfinding
|
||||||
|
|
||||||
sendMessage(player, messagePlayer)
|
sendMessage(player, messagePlayer)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,13 @@ public final class AgilityHandler {
|
||||||
* @return The force movement instance, if force movement is used.
|
* @return The force movement instance, if force movement is used.
|
||||||
*/
|
*/
|
||||||
public static ForceMovement forceWalk(final Player player, final int courseIndex, Location start, Location end, Animation animation, int speed, final double experience, final String message) {
|
public static ForceMovement forceWalk(final Player player, final int courseIndex, Location start, Location end, Animation animation, int speed, final double experience, final String message) {
|
||||||
|
return forceWalk(player, courseIndex, start, end, animation, speed, experience, message, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Walks across an obstacle while using an explicit force-movement facing direction.
|
||||||
|
*/
|
||||||
|
public static ForceMovement forceWalk(final Player player, final int courseIndex, Location start, Location end, Animation animation, int speed, final double experience, final String message, Direction direction) {
|
||||||
player.logoutListeners.put("forcewalk", p -> {
|
player.logoutListeners.put("forcewalk", p -> {
|
||||||
p.setLocation(player.getLocation().transform(0,0,0));
|
p.setLocation(player.getLocation().transform(0,0,0));
|
||||||
return Unit.INSTANCE;
|
return Unit.INSTANCE;
|
||||||
|
|
@ -158,6 +165,9 @@ public final class AgilityHandler {
|
||||||
player.logoutListeners.remove("forcewalk");
|
player.logoutListeners.remove("forcewalk");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
if (direction != null) {
|
||||||
|
movement.setDirection(direction);
|
||||||
|
}
|
||||||
movement.start();
|
movement.start();
|
||||||
GameWorld.getPulser().submit(movement);
|
GameWorld.getPulser().submit(movement);
|
||||||
return movement;
|
return movement;
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package content.global.skill.agility
|
||||||
|
|
||||||
import core.api.*
|
import core.api.*
|
||||||
import core.cache.def.impl.SceneryDefinition
|
import core.cache.def.impl.SceneryDefinition
|
||||||
|
import core.game.interaction.QueueStrength
|
||||||
import core.game.node.Node
|
import core.game.node.Node
|
||||||
import core.game.node.scenery.Scenery
|
import core.game.node.scenery.Scenery
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
|
|
@ -168,25 +169,27 @@ class WildernessCourse
|
||||||
private fun handleSteppingStones(player: Player, `object`: Scenery) {
|
private fun handleSteppingStones(player: Player, `object`: Scenery) {
|
||||||
lock(player, 50)
|
lock(player, 50)
|
||||||
val fail = AgilityHandler.hasFailed(player, 1, 0.3)
|
val fail = AgilityHandler.hasFailed(player, 1, 0.3)
|
||||||
val origLoc = player.location
|
queueScript(player, 0, QueueStrength.SOFT) { stage ->
|
||||||
registerLogoutListener(player, "steppingstone"){p ->
|
val courseIndex = if (stage == 5) 2 else -1
|
||||||
player.location = origLoc
|
val start = player.location
|
||||||
}
|
val end = player.location.transform(-1, 0, 0)
|
||||||
submitWorldPulse(object : Pulse(2, player){
|
val anim = Animation(741)
|
||||||
var counter = 0
|
val xp = if (stage == 5) 20.0 else 0.0
|
||||||
override fun pulse(): Boolean {
|
val message = if (stage == 0) "You carefully start crossing the stepping stones..." else null
|
||||||
if (counter == 3 && fail) {
|
AgilityHandler.forceWalk(player, courseIndex, start, end, anim, 10, xp, message)
|
||||||
AgilityHandler.fail(player, -1, Location.create(3001, 3963, 0), Animation.create(771), (player.skills.lifepoints * 0.26).toInt(), "...You lose your footing and fall into the lava.")
|
if (stage == 2 && fail) {
|
||||||
return true
|
val dest = Location(3001, 3963, 0)
|
||||||
}
|
val failanim = Animation(771)
|
||||||
AgilityHandler.forceWalk(player, if (counter == 5) 2 else -1, player.location, player.location.transform(-1, 0, 0), Animation.create(741), 10, if (counter == 5) 20.0 else 0.0, if (counter != 0) null else "You carefully start crossing the stepping stones...")
|
val hit = (player.skills.lifepoints * 0.26).toInt()
|
||||||
if(++counter == 6){
|
AgilityHandler.fail(player, -1, dest, failanim, hit, "... You lose your footing and fall into the lava.")
|
||||||
unlock(player)
|
return@queueScript stopExecuting(player)
|
||||||
clearLogoutListener(player, "steppingstone")
|
|
||||||
}
|
|
||||||
return counter == 6
|
|
||||||
}
|
}
|
||||||
})
|
if (stage == 5) {
|
||||||
|
unlock(player)
|
||||||
|
return@queueScript stopExecuting(player)
|
||||||
|
}
|
||||||
|
return@queueScript delayScript(player, 2)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@ import core.game.node.entity.Entity;
|
||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.system.task.MovementHook;
|
import core.game.system.task.MovementHook;
|
||||||
import core.game.system.task.Pulse;
|
import core.game.system.task.Pulse;
|
||||||
|
import core.net.packet.PacketRepository;
|
||||||
|
import core.net.packet.context.PlayerContext;
|
||||||
|
import core.net.packet.out.ClearMinimapFlag;
|
||||||
import kotlin.Unit;
|
import kotlin.Unit;
|
||||||
import core.game.world.GameWorld;
|
import core.game.world.GameWorld;
|
||||||
import core.game.world.map.Direction;
|
import core.game.world.map.Direction;
|
||||||
|
|
@ -24,6 +27,10 @@ public final class BladeTrap implements MovementHook {
|
||||||
final Direction dir = e.getDirection();
|
final Direction dir = e.getDirection();
|
||||||
final Player player = (Player) e;
|
final Player player = (Player) e;
|
||||||
final Location start = l.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
final Location start = l.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
||||||
|
player.getPulseManager().clear();
|
||||||
|
player.getWalkingQueue().reset();
|
||||||
|
PacketRepository.send(ClearMinimapFlag.class, new PlayerContext(player));
|
||||||
|
|
||||||
e.lock(5);
|
e.lock(5);
|
||||||
if(e.isPlayer())
|
if(e.isPlayer())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,8 @@ public final class BrimhavenCourse extends OptionHandler {
|
||||||
final Direction dir = direction;
|
final Direction dir = direction;
|
||||||
final Direction faceDirection = Direction.get(object.getDirection().toInteger() - 1 & 3);
|
final Direction faceDirection = Direction.get(object.getDirection().toInteger() - 1 & 3);
|
||||||
final Location start = player.getLocation();
|
final Location start = player.getLocation();
|
||||||
|
player.setDirection(faceDirection);
|
||||||
|
player.faceLocation(start.transform(faceDirection));
|
||||||
player.getAppearance().setAnimations(Animation.create(1118 + m));
|
player.getAppearance().setAnimations(Animation.create(1118 + m));
|
||||||
player.getAppearance().sync();
|
player.getAppearance().sync();
|
||||||
AgilityHandler.climb(player, -1, new Animation(1117 + m), start.transform(dir), 0.0, null);
|
AgilityHandler.climb(player, -1, new Animation(1117 + m), start.transform(dir), 0.0, null);
|
||||||
|
|
@ -143,12 +145,12 @@ public final class BrimhavenCourse extends OptionHandler {
|
||||||
} else if (count == 6) {
|
} else if (count == 6) {
|
||||||
player.getAppearance().setAnimations();
|
player.getAppearance().setAnimations();
|
||||||
player.getAppearance().sync();
|
player.getAppearance().sync();
|
||||||
AgilityHandler.forceWalk(player, -1, last, last.transform(dir), Animation.create(1120 + m), 5, getExp(player, 22.0), null).setDirection(faceDirection);
|
AgilityHandler.forceWalk(player, -1, last, last.transform(dir), Animation.create(1120 + m), 5, getExp(player, 22.0), null, faceDirection);
|
||||||
player.logoutListeners.remove("brimcourse");
|
player.logoutListeners.remove("brimcourse");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
player.logoutListeners.remove("brimcourse");
|
player.logoutListeners.remove("brimcourse");
|
||||||
AgilityHandler.forceWalk(player, -1, last, last = last.transform(dir), Animation.create(1118 + m), 5, 0.0, null).setDirection(faceDirection);
|
AgilityHandler.forceWalk(player, -1, last, last = last.transform(dir), Animation.create(1118 + m), 5, 0.0, null, faceDirection);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -272,7 +274,7 @@ public final class BrimhavenCourse extends OptionHandler {
|
||||||
public boolean pulse() {
|
public boolean pulse() {
|
||||||
if (!finish) {
|
if (!finish) {
|
||||||
setDelay(2);
|
setDelay(2);
|
||||||
AgilityHandler.fail(player, 1, player.getLocation().transform(0, 0, -3), Animation.create(189), getHitAmount(player), "You stepped on a broken piece of plank!");
|
AgilityHandler.fail(player, 1, player.getLocation().transform(0, 0, -3), Animation.create(768), getHitAmount(player), "You stepped on a broken piece of plank!");
|
||||||
finish = true;
|
finish = true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -282,7 +284,7 @@ public final class BrimhavenCourse extends OptionHandler {
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AgilityHandler.walk(player, -1, start, end, ForceMovement.WALK_ANIMATION, getExp(player, 6.0), null);
|
AgilityHandler.walk(player, -1, start, end, Animation.create(1426), getExp(player, 6.0), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -389,6 +391,7 @@ public final class BrimhavenCourse extends OptionHandler {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3551:
|
case 3551:
|
||||||
|
case 3583:
|
||||||
return n.getLocation();
|
return n.getLocation();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ import core.game.node.entity.impl.Projectile;
|
||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.system.task.MovementHook;
|
import core.game.system.task.MovementHook;
|
||||||
import core.game.system.task.Pulse;
|
import core.game.system.task.Pulse;
|
||||||
|
import core.net.packet.context.PlayerContext;
|
||||||
|
import core.net.packet.out.ClearMinimapFlag;
|
||||||
import kotlin.Unit;
|
import kotlin.Unit;
|
||||||
import core.game.world.GameWorld;
|
import core.game.world.GameWorld;
|
||||||
import core.game.world.map.Direction;
|
import core.game.world.map.Direction;
|
||||||
|
|
@ -29,6 +31,9 @@ public final class DartTrap implements MovementHook {
|
||||||
final Direction dir = e.getDirection();
|
final Direction dir = e.getDirection();
|
||||||
final Player player = (Player) e;
|
final Player player = (Player) e;
|
||||||
final Location start = l.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
final Location start = l.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
||||||
|
player.getPulseManager().clear();
|
||||||
|
player.getWalkingQueue().reset();
|
||||||
|
PacketRepository.send(ClearMinimapFlag.class, new PlayerContext(player));
|
||||||
e.lock(6);
|
e.lock(6);
|
||||||
if(e.isPlayer())
|
if(e.isPlayer())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@ import core.game.node.entity.Entity;
|
||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.system.task.MovementHook;
|
import core.game.system.task.MovementHook;
|
||||||
import core.game.system.task.Pulse;
|
import core.game.system.task.Pulse;
|
||||||
|
import core.net.packet.PacketRepository;
|
||||||
|
import core.net.packet.context.PlayerContext;
|
||||||
|
import core.net.packet.out.ClearMinimapFlag;
|
||||||
import kotlin.Unit;
|
import kotlin.Unit;
|
||||||
import core.game.world.GameWorld;
|
import core.game.world.GameWorld;
|
||||||
import core.game.world.map.Direction;
|
import core.game.world.map.Direction;
|
||||||
|
|
@ -24,6 +27,9 @@ public final class FloorSpikes implements MovementHook {
|
||||||
final Direction dir = e.getDirection();
|
final Direction dir = e.getDirection();
|
||||||
final Player player = (Player) e;
|
final Player player = (Player) e;
|
||||||
final Location start = l.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
final Location start = l.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
||||||
|
player.getPulseManager().clear();
|
||||||
|
player.getWalkingQueue().reset();
|
||||||
|
PacketRepository.send(ClearMinimapFlag.class, new PlayerContext(player));
|
||||||
e.lock(5);
|
e.lock(5);
|
||||||
if(e.isPlayer())
|
if(e.isPlayer())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@ import core.game.node.entity.Entity;
|
||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.system.task.MovementHook;
|
import core.game.system.task.MovementHook;
|
||||||
import core.game.system.task.Pulse;
|
import core.game.system.task.Pulse;
|
||||||
|
import core.net.packet.PacketRepository;
|
||||||
|
import core.net.packet.context.PlayerContext;
|
||||||
|
import core.net.packet.out.ClearMinimapFlag;
|
||||||
import kotlin.Unit;
|
import kotlin.Unit;
|
||||||
import core.game.world.GameWorld;
|
import core.game.world.GameWorld;
|
||||||
import core.game.world.map.Direction;
|
import core.game.world.map.Direction;
|
||||||
|
|
@ -24,6 +27,10 @@ public final class PressurePad implements MovementHook {
|
||||||
final Direction dir = e.getDirection();
|
final Direction dir = e.getDirection();
|
||||||
final Player player = (Player) e;
|
final Player player = (Player) e;
|
||||||
final Location start = dest.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
final Location start = dest.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
||||||
|
player.getPulseManager().clear();
|
||||||
|
player.getWalkingQueue().reset();
|
||||||
|
PacketRepository.send(ClearMinimapFlag.class, new PlayerContext(player));
|
||||||
|
|
||||||
e.lock(5);
|
e.lock(5);
|
||||||
if(e.isPlayer())
|
if(e.isPlayer())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@ import core.game.node.entity.Entity;
|
||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.system.task.MovementHook;
|
import core.game.system.task.MovementHook;
|
||||||
import core.game.system.task.Pulse;
|
import core.game.system.task.Pulse;
|
||||||
|
import core.net.packet.PacketRepository;
|
||||||
|
import core.net.packet.context.PlayerContext;
|
||||||
|
import core.net.packet.out.ClearMinimapFlag;
|
||||||
import kotlin.Unit;
|
import kotlin.Unit;
|
||||||
import core.game.world.GameWorld;
|
import core.game.world.GameWorld;
|
||||||
import core.game.world.map.Direction;
|
import core.game.world.map.Direction;
|
||||||
|
|
@ -24,6 +27,9 @@ public final class SpinningBlades implements MovementHook {
|
||||||
final Direction dir = e.getDirection();
|
final Direction dir = e.getDirection();
|
||||||
final Player player = (Player) e;
|
final Player player = (Player) e;
|
||||||
final Location start = l.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
final Location start = l.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
||||||
|
player.getPulseManager().clear();
|
||||||
|
player.getWalkingQueue().reset();
|
||||||
|
PacketRepository.send(ClearMinimapFlag.class, new PlayerContext(player));
|
||||||
e.lock(5);
|
e.lock(5);
|
||||||
if(e.isPlayer())
|
if(e.isPlayer())
|
||||||
{
|
{
|
||||||
|
|
@ -70,4 +76,4 @@ public final class SpinningBlades implements MovementHook {
|
||||||
}
|
}
|
||||||
player.getPacketDispatch().sendSceneryAnimation(RegionManager.getObject(l), Animation.create(1107));
|
player.getPacketDispatch().sendSceneryAnimation(RegionManager.getObject(l), Animation.create(1107));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,12 +96,12 @@ public final class HouseZone extends MapZone {
|
||||||
Player p = (Player) e;
|
Player p = (Player) e;
|
||||||
|
|
||||||
// if the player is moving between the dungeon and main house, don't trigger the leave sequence
|
// if the player is moving between the dungeon and main house, don't trigger the leave sequence
|
||||||
if (!logout) {
|
if (house.getDungeonRegion() != null && !logout) {
|
||||||
// current loc
|
// current loc
|
||||||
Location dest = p.getProperties().getTeleportLocation();
|
Location dest = p.getProperties().getTeleportLocation();
|
||||||
int currentRegionId = p.getLocation().getRegionId();
|
int currentRegionId = p.getLocation().getRegionId();
|
||||||
int houseId = house.getHouseRegion().getId();
|
int houseId = house.getHouseRegion().getId();
|
||||||
int dungeonId = (house.getDungeonRegion() != null) ? house.getDungeonRegion().getId() : -1;
|
int dungeonId = house.getDungeonRegion().getId();
|
||||||
|
|
||||||
// check if still in house
|
// check if still in house
|
||||||
boolean currentlyInHouse = (currentRegionId == houseId || currentRegionId == dungeonId);
|
boolean currentlyInHouse = (currentRegionId == houseId || currentRegionId == dungeonId);
|
||||||
|
|
@ -122,7 +122,7 @@ public final class HouseZone extends MapZone {
|
||||||
house.expelGuests(p);
|
house.expelGuests(p);
|
||||||
int toRemove = previousRegion;
|
int toRemove = previousRegion;
|
||||||
int dungRemove = previousDungeon;
|
int dungRemove = previousDungeon;
|
||||||
submitWorldPulse(new Pulse(2) {
|
submitWorldPulse(new Pulse(1) {
|
||||||
public boolean pulse() {
|
public boolean pulse() {
|
||||||
Region r = RegionManager.forId(toRemove);
|
Region r = RegionManager.forId(toRemove);
|
||||||
Region dr = dungRemove != -1 ? RegionManager.forId(dungRemove) : null;
|
Region dr = dungRemove != -1 ? RegionManager.forId(dungRemove) : null;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
package content.global.skill.construction.decoration.skillhall
|
||||||
|
|
||||||
|
import content.global.skill.construction.HouseManager
|
||||||
|
import core.api.openDialogue
|
||||||
|
import core.game.dialogue.DialogueFile
|
||||||
|
import core.game.dialogue.FacialExpression
|
||||||
|
import core.game.interaction.IntType
|
||||||
|
import core.game.interaction.InteractionListener
|
||||||
|
import core.game.world.repository.Repository
|
||||||
|
import core.tools.END_DIALOGUE
|
||||||
|
import org.rs09.consts.NPCs
|
||||||
|
import org.rs09.consts.Scenery as Sceneries
|
||||||
|
|
||||||
|
class MountedCockatriceHead : InteractionListener {
|
||||||
|
override fun defineListeners() {
|
||||||
|
on(Sceneries.COCKATRICE_HEAD_13482, IntType.SCENERY, "talk-to") { player, _ ->
|
||||||
|
val house = player.getAttribute<HouseManager>("poh_entry", player.houseManager)
|
||||||
|
if (house == player.houseManager) {
|
||||||
|
openDialogue(player, MountedCockatriceHeadOwnerDialogue())
|
||||||
|
} else {
|
||||||
|
val ownerName = Repository.players.first { it.houseManager == house }.username.capitalize()
|
||||||
|
openDialogue(player, MountedCockatriceHeadGuestDialogue(ownerName))
|
||||||
|
}
|
||||||
|
return@on true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class MountedCockatriceHeadOwnerDialogue : DialogueFile() {
|
||||||
|
override fun handle(componentID: Int, buttonID: Int) {
|
||||||
|
when (stage) {
|
||||||
|
0 -> npcl(NPCs.COCKATRICE_4227, FacialExpression.CHILD_NORMAL, "You deaded me!").also { stage++ }
|
||||||
|
1 -> playerl(FacialExpression.NEUTRAL, "Well, yes.").also { stage++ }
|
||||||
|
2 -> npcl(NPCs.COCKATRICE_4227, FacialExpression.CHILD_NORMAL, "What did you do that for?").also { stage++ }
|
||||||
|
3 -> options("A Slayer Master told me to.", "So I could mount your head on my wall.", "I just wanted to.").also { stage++ }
|
||||||
|
4 -> when (buttonID) {
|
||||||
|
1 -> playerl(FacialExpression.NEUTRAL, "A Slayer Master told me to.").also { stage = 10 }
|
||||||
|
2 -> playerl(FacialExpression.NEUTRAL, "So I could mount your head on my wall.").also { stage = 20 }
|
||||||
|
3 -> playerl(FacialExpression.NEUTRAL, "I just wanted to.").also { stage = 30 }
|
||||||
|
}
|
||||||
|
10 -> npcl(NPCs.COCKATRICE_4227, FacialExpression.CHILD_SAD, "Why do the Slayer Masters all pick on poor cockatrice?").also { stage++ }
|
||||||
|
11 -> playerl(FacialExpression.NEUTRAL, "They pick on lots of other creatures too.").also { stage++ }
|
||||||
|
12 -> npcl(NPCs.COCKATRICE_4227, FacialExpression.CHILD_SAD, "Then mount one of them on your wall and let poor cockatrice rest in peace!").also { stage = END_DIALOGUE }
|
||||||
|
20 -> npcl(NPCs.COCKATRICE_4227, FacialExpression.CHILD_SAD, "Another cockatrice falls victim to the dreaded mirror shield!").also { stage++ }
|
||||||
|
21 -> playerl(FacialExpression.NEUTRAL, "Don't take it personally. You look good on my wall.").also { stage++ }
|
||||||
|
22 -> npcl(NPCs.COCKATRICE_4227, FacialExpression.CHILD_SAD, "I don't care! I think I looked better with a body!").also { stage = END_DIALOGUE }
|
||||||
|
30 -> npcl(NPCs.COCKATRICE_4227, FacialExpression.CHILD_ANGRY, "You dirty rotten swine, you!").also { stage++ }
|
||||||
|
31 -> playerl(FacialExpression.AMAZED, "Steady on.").also { stage++ }
|
||||||
|
32 -> npcl(NPCs.COCKATRICE_4227, FacialExpression.CHILD_ANGRY, "I will kill you with my paralyzing-type magic eyes look!").also { stage++ }
|
||||||
|
33 -> npcl(NPCs.COCKATRICE_4227, FacialExpression.CHILD_ANGRY, "Dots appear in air between eyes and victim. Dot! Dot! Dotty!").also { stage++ }
|
||||||
|
34 -> playerl(FacialExpression.NEUTRAL, "Er, nothing's happening...").also { stage++ }
|
||||||
|
35 -> npcl(NPCs.COCKATRICE_4227, FacialExpression.CHILD_ANGRY, "Concentrates mental power. Eyes narrow beak clenches veins on head stand out.").also { stage++ }
|
||||||
|
36 -> npcl(NPCs.COCKATRICE_4227, FacialExpression.CHILD_ANGRY, "Strain!").also { stage++ }
|
||||||
|
37 -> playerl(FacialExpression.ASKING, "You're dead, cockatrice. Your eyes are glass beads. It won't work.").also { stage++ }
|
||||||
|
38 -> npcl(NPCs.COCKATRICE_4227, FacialExpression.CHILD_ANGRY, "STRA-A-AIN!").also { stage++ }
|
||||||
|
39 -> playerl(FacialExpression.ASKING, "I think I'll leave you to it.").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class MountedCockatriceHeadGuestDialogue(private val ownerName: String) : DialogueFile() {
|
||||||
|
override fun handle(componentID: Int, buttonID: Int) {
|
||||||
|
when (stage) {
|
||||||
|
0 -> playerl(FacialExpression.HAPPY, "Hey, a cockatrice!").also { stage++ }
|
||||||
|
1 -> npcl(NPCs.COCKATRICE_4227, FacialExpression.CHILD_SAD, "$ownerName deaded me! That wasn't very nice!").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
39
Server/src/main/content/global/skill/cooking/CakeListener.kt
Normal file
39
Server/src/main/content/global/skill/cooking/CakeListener.kt
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
package content.global.skill.cooking
|
||||||
|
|
||||||
|
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 CakeListener : InteractionListener {
|
||||||
|
private val cakeArr = intArrayOf(
|
||||||
|
Items.EGG_1944,
|
||||||
|
Items.BUCKET_OF_MILK_1927,
|
||||||
|
Items.POT_OF_FLOUR_1933
|
||||||
|
)
|
||||||
|
|
||||||
|
override fun defineListeners() {
|
||||||
|
onUseWith(IntType.ITEM, cakeArr, Items.CAKE_TIN_1887) { player, _, _ ->
|
||||||
|
if (getDynLevel(player, Skills.COOKING) < 40) {
|
||||||
|
sendMessage(player, "You need a Cooking level of at least 40 in order to do this.")
|
||||||
|
return@onUseWith true
|
||||||
|
}
|
||||||
|
|
||||||
|
if(inInventory(player, Items.EGG_1944) && inInventory(player, Items.BUCKET_OF_MILK_1927) && inInventory(player, Items.POT_OF_FLOUR_1933) && inInventory(player, Items.CAKE_TIN_1887)) {
|
||||||
|
if(removeItem(player, Items.EGG_1944) && removeItem(player, Items.BUCKET_OF_MILK_1927) && removeItem(player, Items.POT_OF_FLOUR_1933) && removeItem(player, Items.CAKE_TIN_1887)){
|
||||||
|
addItem(player, Items.EMPTY_POT_1931)
|
||||||
|
addItem(player, Items.UNCOOKED_CAKE_1889)
|
||||||
|
addItem(player, Items.BUCKET_1925)
|
||||||
|
sendMessage(player, "You mix the milk, flour and egg together to make a raw cake mix.")
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
// Not sure about the authentic message
|
||||||
|
sendMessage(player, "You don't have enough ingredients to make that.")
|
||||||
|
}
|
||||||
|
return@onUseWith true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,69 +0,0 @@
|
||||||
package content.global.skill.cooking;
|
|
||||||
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.interaction.UseWithHandler;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
import core.plugin.Initializable;
|
|
||||||
import core.plugin.Plugin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the plugin used to make a cake.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public final class CakeMakingPlugin extends UseWithHandler {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the bucket of milk item.
|
|
||||||
*/
|
|
||||||
private static final Item BUCKET_OF_MILK = new Item(1927);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the egg item.
|
|
||||||
*/
|
|
||||||
private static final Item EGG = new Item(1944);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the cake tin item.
|
|
||||||
*/
|
|
||||||
private static final Item CAKE_TIN = new Item(1887);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the pot of flour item.
|
|
||||||
*/
|
|
||||||
private static final Item POT_OF_FLOUR = new Item(1933);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the uncooked cake item.
|
|
||||||
*/
|
|
||||||
private static final Item UNCOOKED_CAKE = new Item(1889);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code CakeMakingPlugin} {@code Object}.
|
|
||||||
*/
|
|
||||||
public CakeMakingPlugin() {
|
|
||||||
super(1933);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
addHandler(1887, ITEM_TYPE, this);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(NodeUsageEvent event) {
|
|
||||||
if (event.getUsedItem().getId() == 1887 && ((Item) event.getUsedWith()).getId() == 1933 || event.getUsedWith().getName().equalsIgnoreCase("cake tin") && ((Item) event.getUsedItem()).getName().equalsIgnoreCase("pot of flour")) {
|
|
||||||
if (event.getPlayer().getInventory().contains(1933, 1) && event.getPlayer().getInventory().contains(1927, 1) && event.getPlayer().getInventory().contains(1944, 1)) {
|
|
||||||
if (event.getPlayer().getInventory().remove(BUCKET_OF_MILK, EGG, CAKE_TIN, POT_OF_FLOUR)) {
|
|
||||||
event.getPlayer().getInventory().add(UNCOOKED_CAKE);
|
|
||||||
event.getPlayer().getPacketDispatch().sendMessage("You mix the milk, flour and egg together to make a raw cake mix.");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
package content.global.skill.cooking
|
||||||
|
|
||||||
|
import core.api.addItem
|
||||||
|
import core.api.removeItem
|
||||||
|
import core.api.sendMessage
|
||||||
|
import core.game.interaction.IntType
|
||||||
|
import core.game.interaction.InteractionListener
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
|
||||||
|
class CoconutListener : InteractionListener {
|
||||||
|
|
||||||
|
override fun defineListeners() {
|
||||||
|
onUseWith(IntType.ITEM, Items.COCONUT_5974, Items.HAMMER_2347) { player, used, _ ->
|
||||||
|
if(removeItem(player, used.id)) {
|
||||||
|
addItem(player, Items.COCONUT_5976)
|
||||||
|
sendMessage(player, "You crush the coconut with a hammer.")
|
||||||
|
return@onUseWith true
|
||||||
|
}
|
||||||
|
return@onUseWith false
|
||||||
|
}
|
||||||
|
onUseWith(IntType.ITEM, Items.COCONUT_5976, Items.VIAL_229) { player, used, with ->
|
||||||
|
if(removeItem(player, used.id) && removeItem(player, with.id)) {
|
||||||
|
addItem(player, Items.COCONUT_SHELL_5978)
|
||||||
|
addItem(player, Items.COCONUT_MILK_5935)
|
||||||
|
sendMessage(player, "You overturn the coconut into a vial.")
|
||||||
|
return@onUseWith true
|
||||||
|
}
|
||||||
|
return@onUseWith false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,56 +0,0 @@
|
||||||
package content.global.skill.cooking;
|
|
||||||
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.interaction.UseWithHandler;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
import core.plugin.Initializable;
|
|
||||||
import core.plugin.Plugin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the plugin used to make a coconut.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public final class CoconutMakePlugin extends UseWithHandler {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the items related to coconut making plugin.
|
|
||||||
*/
|
|
||||||
private static final Item[] ITEMS = new Item[] { new Item(5974, 1), new Item(5976, 1), new Item(229), new Item(5935, 1), new Item(5978) };
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code CoconutMakePlugin} {@code Object}.
|
|
||||||
*/
|
|
||||||
public CoconutMakePlugin() {
|
|
||||||
super(5974, 5976);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
addHandler(2347, ITEM_TYPE, this);
|
|
||||||
addHandler(229, ITEM_TYPE, this);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(NodeUsageEvent event) {
|
|
||||||
final Player player = event.getPlayer();
|
|
||||||
final Item usedWith = (Item) event.getUsedWith();
|
|
||||||
if (usedWith.getId() == 5974 && event.getUsedItem().getId() == 2347 || usedWith.getId() == 2347 && event.getUsedItem().getId() == 5974) {
|
|
||||||
player.getInventory().remove(ITEMS[0]);
|
|
||||||
player.getInventory().add(ITEMS[1]);
|
|
||||||
player.getPacketDispatch().sendMessage("You crush the coconut with a hammer.");
|
|
||||||
}
|
|
||||||
if (usedWith.getId() == 5976 && event.getUsedItem().getId() == 229 || usedWith.getId() == 229 && event.getUsedItem().getId() == 5976) {
|
|
||||||
player.getInventory().remove(ITEMS[1]);
|
|
||||||
player.getInventory().remove(ITEMS[2]);
|
|
||||||
player.getInventory().add(ITEMS[3]);
|
|
||||||
player.getInventory().add(ITEMS[4]);
|
|
||||||
player.getPacketDispatch().sendMessage("You overturn the coconut into a vial.");
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,134 +0,0 @@
|
||||||
package content.global.skill.cooking;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.Recipe;
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.interaction.UseWithHandler;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
import core.game.system.task.Pulse;
|
|
||||||
import core.plugin.Initializable;
|
|
||||||
import core.plugin.Plugin;
|
|
||||||
import core.game.dialogue.SkillDialogueHandler.SkillDialogue;
|
|
||||||
import core.game.dialogue.SkillDialogueHandler;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a cooking recipe plugin. This is used to handle the multiple
|
|
||||||
* recipes used in cooking these recipes can range from making a pizza or making
|
|
||||||
* a pie.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @version 1.9
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public final class CookingRecipePlugin extends UseWithHandler {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code CookingRecipePlugin} {@code Object}.
|
|
||||||
*/
|
|
||||||
public CookingRecipePlugin() {
|
|
||||||
super(getAllowedNodes());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
for (Recipe recipe : Recipe.RECIPES) {
|
|
||||||
for (Item ingredient : recipe.getIngredients()) {
|
|
||||||
addHandler(ingredient.getId(), ITEM_TYPE, this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(NodeUsageEvent event) {
|
|
||||||
Recipe recipe = null;
|
|
||||||
Item part = null;
|
|
||||||
// TODO: Transitioning to a Listener would save an O(n) pass through the recipes list on every use-with
|
|
||||||
recipeloop:
|
|
||||||
for (Recipe temp : Recipe.RECIPES) {
|
|
||||||
if (temp.isSingular()) {
|
|
||||||
if (temp.getBase().getId() == event.getUsedItem().getId() || temp.getBase().getId() == event.getBaseItem().getId()) {
|
|
||||||
for (Item ingredient : temp.getIngredients()) {
|
|
||||||
if (ingredient.getId() == event.getBaseItem().getId() || ingredient.getId() == event.getUsedItem().getId()) {
|
|
||||||
recipe = temp;
|
|
||||||
break recipeloop;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (int k = 0; k < temp.getParts().length; k++) {
|
|
||||||
for (int i = 0; i < temp.getIngredients().length; i++) {
|
|
||||||
Item tempPart = temp.getParts()[k];
|
|
||||||
Item ingredient = temp.getIngredients()[i];
|
|
||||||
if (tempPart.getId() == event.getUsedItem().getId() && ingredient.getId() == event.getBaseItem().getId() || tempPart.getId() == event.getBaseItem().getId() && ingredient.getId() == event.getUsedItem().getId()) {
|
|
||||||
if (k == i) {// represents that this ingredient can
|
|
||||||
// mix with the other.
|
|
||||||
recipe = temp;
|
|
||||||
part = tempPart;
|
|
||||||
break recipeloop;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (recipe != null) {
|
|
||||||
final Player player = event.getPlayer();
|
|
||||||
final Recipe recipe_ = recipe;
|
|
||||||
final Item part_ = part;
|
|
||||||
SkillDialogueHandler handler = new SkillDialogueHandler(player, SkillDialogue.ONE_OPTION, recipe.getProduct()) {
|
|
||||||
@Override
|
|
||||||
public void create(final int amount, int index) {
|
|
||||||
player.getPulseManager().run(new Pulse(2) {
|
|
||||||
int count = 0;
|
|
||||||
@Override
|
|
||||||
public boolean pulse() {
|
|
||||||
recipe_.mix(player, event);
|
|
||||||
return ++count >= amount;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getAll(int index) {
|
|
||||||
return player.getInventory().getAmount(part_ != null ? part_ : recipe_.getBase());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
if (player.getInventory().getAmount(recipe.getBase()) == 1) {
|
|
||||||
recipe_.mix(player, event);
|
|
||||||
} else {
|
|
||||||
handler.open();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method used to get the allowed nodes for this plugin.
|
|
||||||
* @return the allowed nodes.
|
|
||||||
*/
|
|
||||||
private final static int[] getAllowedNodes() {
|
|
||||||
List<Integer> bases = new ArrayList<>(10);
|
|
||||||
for (Recipe recipe : Recipe.RECIPES) {
|
|
||||||
for (Item base : recipe.getParts()) {
|
|
||||||
if (bases.contains(base.getId())) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
bases.add(base.getId());
|
|
||||||
}
|
|
||||||
if (bases.contains(recipe.getBase().getId())) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
bases.add(recipe.getBase().getId());
|
|
||||||
}
|
|
||||||
int[] baseArray = new int[bases.size()];
|
|
||||||
for (int i = 0; i < bases.size(); i++) {
|
|
||||||
baseArray[i] = bases.get(i);
|
|
||||||
}
|
|
||||||
return baseArray;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -43,7 +43,6 @@ public class IntentionalBurnPulse extends StandardCookingPulse {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean cook(Player player, Scenery object, boolean burned, int initial, int product) {
|
public boolean cook(Player player, Scenery object, boolean burned, int initial, int product) {
|
||||||
super.animate();
|
|
||||||
Item initialItem = new Item(initial);
|
Item initialItem = new Item(initial);
|
||||||
Item productItem = new Item(product);
|
Item productItem = new Item(product);
|
||||||
|
|
||||||
|
|
@ -51,6 +50,7 @@ public class IntentionalBurnPulse extends StandardCookingPulse {
|
||||||
player.getInventory().add(productItem);
|
player.getInventory().add(productItem);
|
||||||
player.getPacketDispatch().sendMessage(getMessage(initialItem, productItem, burned));
|
player.getPacketDispatch().sendMessage(getMessage(initialItem, productItem, burned));
|
||||||
playAudio(player, Sounds.FRY_2577);
|
playAudio(player, Sounds.FRY_2577);
|
||||||
|
super.animate();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -1,56 +0,0 @@
|
||||||
package content.global.skill.cooking;
|
|
||||||
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.interaction.UseWithHandler;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
import core.plugin.Initializable;
|
|
||||||
import core.plugin.Plugin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the pie shell making plugin.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public final class PieShellPlugin extends UseWithHandler {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the pie sell item.
|
|
||||||
*/
|
|
||||||
private static final Item PIE_SHELL = new Item(2315, 1);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the pie dish item.
|
|
||||||
*/
|
|
||||||
private static final Item PIE_DISH = new Item(2313, 1);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the pastry dough item.
|
|
||||||
*/
|
|
||||||
private static final Item PASTRY_DOUGH = new Item(1953, 1);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code PieMakingPlugin} {@code Object}.
|
|
||||||
*/
|
|
||||||
public PieShellPlugin() {
|
|
||||||
super(1953);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
addHandler(2313, ITEM_TYPE, this);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(NodeUsageEvent event) {
|
|
||||||
final Player player = event.getPlayer();
|
|
||||||
if (player.getInventory().remove(PASTRY_DOUGH, PIE_DISH)) {
|
|
||||||
player.getInventory().add(PIE_SHELL);
|
|
||||||
player.getPacketDispatch().sendMessage("You put the pastry dough into the pie dish to make a pie shell.");
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
package content.global.skill.cooking
|
||||||
|
|
||||||
|
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 SkeweredFoodListener : InteractionListener {
|
||||||
|
val skewerMap = hashMapOf(
|
||||||
|
Items.RAW_CHOMPY_2876 to Items.SKEWERED_CHOMPY_7230,
|
||||||
|
Items.RAW_RABBIT_3226 to Items.SKEWERED_RABBIT_7224,
|
||||||
|
Items.RAW_BIRD_MEAT_9978 to Items.SKEWERED_BIRD_MEAT_9984,
|
||||||
|
Items.RAW_BEAST_MEAT_9986 to Items.SKEWERED_BEAST_9992
|
||||||
|
)
|
||||||
|
|
||||||
|
override fun defineListeners() {
|
||||||
|
onUseWith(IntType.ITEM, skewerMap.keys.toIntArray(), Items.IRON_SPIT_7225) { player, used, with ->
|
||||||
|
val level = when (used.id) {
|
||||||
|
Items.RAW_BIRD_MEAT_9978 -> 11
|
||||||
|
Items.RAW_RABBIT_3226 -> 16
|
||||||
|
Items.RAW_BEAST_MEAT_9986 -> 21
|
||||||
|
Items.RAW_CHOMPY_2876 -> 30
|
||||||
|
else -> 0
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getDynLevel(player, Skills.COOKING) < level) {
|
||||||
|
sendMessage(player, "You need a Cooking level of at least $level in order to do this.")
|
||||||
|
return@onUseWith true
|
||||||
|
}
|
||||||
|
if (removeItem(player, used.id) && removeItem(player, with.id)) {
|
||||||
|
skewerMap[used.id]?.let { addItem(player, it) }
|
||||||
|
return@onUseWith true
|
||||||
|
}
|
||||||
|
return@onUseWith false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,115 +0,0 @@
|
||||||
package content.global.skill.cooking;
|
|
||||||
|
|
||||||
import core.game.node.entity.skill.Skills;
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.interaction.UseWithHandler;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
import core.plugin.Initializable;
|
|
||||||
import core.plugin.Plugin;
|
|
||||||
import org.rs09.consts.Items;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the plugin used to make skwered items.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 22/12/2013
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public class SkeweredFoodPlugin extends UseWithHandler {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the level required.
|
|
||||||
*/
|
|
||||||
private final int LEVEL = 20;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code SkeweredFoodPlugin} {@code Object}.
|
|
||||||
*/
|
|
||||||
public SkeweredFoodPlugin() {
|
|
||||||
super(7225);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
for (SkeweredSet set : SkeweredSet.values()) {
|
|
||||||
addHandler(set.getRaw().getId(), ITEM_TYPE, this);
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(NodeUsageEvent event) {
|
|
||||||
final Player player = event.getPlayer();
|
|
||||||
if (player.getSkills().getLevel(Skills.FIREMAKING) < LEVEL) {
|
|
||||||
player.getPacketDispatch().sendMessage("You meed a Firemaking level of at least " + LEVEL + " in order to do this.");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
final SkeweredSet set = SkeweredSet.forItem(event.getBaseItem().getId() == 7225 ? event.getUsedItem() : event.getBaseItem());
|
|
||||||
if (player.getInventory().remove(event.getBaseItem()) && player.getInventory().remove(event.getUsedItem())) {
|
|
||||||
player.getInventory().add(set.getProduct());
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a set of skwered items.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 22/12/2013
|
|
||||||
*/
|
|
||||||
public enum SkeweredSet {
|
|
||||||
CHOMPY(new Item(Items.RAW_CHOMPY_2876), new Item(Items.SKEWERED_CHOMPY_7230)),
|
|
||||||
RABBIT(new Item(Items.RAW_RABBIT_3226), new Item(Items.SKEWERED_RABBIT_7224)),
|
|
||||||
BIRD(new Item(Items.RAW_BIRD_MEAT_9978), new Item(Items.SKEWERED_BIRD_MEAT_9984)),
|
|
||||||
BEAST(new Item(Items.RAW_BEAST_MEAT_9986), new Item(Items.SKEWERED_BEAST_9992));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the raw item.
|
|
||||||
*/
|
|
||||||
private final Item raw;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the product item.
|
|
||||||
*/
|
|
||||||
private final Item product;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code SkeweredFoodPlugin} {@code Object}.
|
|
||||||
* @param raw the raw item.
|
|
||||||
* @param product the product.
|
|
||||||
*/
|
|
||||||
private SkeweredSet(Item raw, Item product) {
|
|
||||||
this.raw = raw;
|
|
||||||
this.product = product;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the raw.
|
|
||||||
* @return The raw.
|
|
||||||
*/
|
|
||||||
public Item getRaw() {
|
|
||||||
return raw;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the product.
|
|
||||||
* @return The product.
|
|
||||||
*/
|
|
||||||
public Item getProduct() {
|
|
||||||
return product;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the skwered set.
|
|
||||||
* @param item the item.
|
|
||||||
* @return the set.
|
|
||||||
*/
|
|
||||||
public static SkeweredSet forItem(final Item item) {
|
|
||||||
for (SkeweredSet set : values()) {
|
|
||||||
if (set.getRaw().getId() == item.getId()) {
|
|
||||||
return set;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -149,7 +149,6 @@ public class StandardCookingPulse extends Pulse {
|
||||||
public boolean cook(final Player player, final Scenery object, final boolean burned, final int initial, final int product) {
|
public boolean cook(final Player player, final Scenery object, final boolean burned, final int initial, final int product) {
|
||||||
Item initialItem = new Item(initial);
|
Item initialItem = new Item(initial);
|
||||||
Item productItem = new Item(product);
|
Item productItem = new Item(product);
|
||||||
animate();
|
|
||||||
|
|
||||||
//handle special cooking results (spits, cake, etc) that don't justify separate plugin
|
//handle special cooking results (spits, cake, etc) that don't justify separate plugin
|
||||||
switch (initial) {
|
switch (initial) {
|
||||||
|
|
@ -188,6 +187,7 @@ public class StandardCookingPulse extends Pulse {
|
||||||
}
|
}
|
||||||
player.getPacketDispatch().sendMessage(getMessage(initialItem, productItem, burned));
|
player.getPacketDispatch().sendMessage(getMessage(initialItem, productItem, burned));
|
||||||
playAudio(player, Sounds.FRY_2577);
|
playAudio(player, Sounds.FRY_2577);
|
||||||
|
animate();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package content.global.skill.cooking
|
||||||
|
|
||||||
|
import core.api.*
|
||||||
|
import core.game.interaction.IntType
|
||||||
|
import core.game.interaction.InteractionListener
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
|
||||||
|
class WatermelonSliceListener : InteractionListener {
|
||||||
|
|
||||||
|
override fun defineListeners() {
|
||||||
|
onUseWith(IntType.ITEM, Items.WATERMELON_5982, Items.KNIFE_946) { player, used, _ ->
|
||||||
|
if(removeItem(player, used.asItem())) {
|
||||||
|
addItemOrDrop(player, Items.WATERMELON_SLICE_5984, 3)
|
||||||
|
sendMessage(player, "You slice the watermelon into three slices.")
|
||||||
|
return@onUseWith true
|
||||||
|
}
|
||||||
|
return@onUseWith false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,59 +0,0 @@
|
||||||
package content.global.skill.cooking;
|
|
||||||
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.interaction.UseWithHandler;
|
|
||||||
import core.game.node.item.GroundItemManager;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
import core.plugin.Initializable;
|
|
||||||
import core.plugin.Plugin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the plugin used to slice a watermelon.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public final class WatermelonSlicePlugin extends UseWithHandler {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the knife item.
|
|
||||||
*/
|
|
||||||
private static final Item KNIFE = new Item(946);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the watermelon item.
|
|
||||||
*/
|
|
||||||
private static final Item WATERMELON = new Item(5982);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the watermelon slice item.
|
|
||||||
*/
|
|
||||||
private static final Item WATERMELON_SLICE = new Item(5984);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code WatermelonSlicePlugin.java} {@code Object}.
|
|
||||||
*/
|
|
||||||
public WatermelonSlicePlugin() {
|
|
||||||
super(KNIFE.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
addHandler(5982, ITEM_TYPE, this);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(NodeUsageEvent event) {
|
|
||||||
if (event.getPlayer().getInventory().remove(WATERMELON)) {
|
|
||||||
for (int i = 0; i < 3; i++) {
|
|
||||||
if (!event.getPlayer().getInventory().add(WATERMELON_SLICE)) {
|
|
||||||
GroundItemManager.create(WATERMELON_SLICE, event.getPlayer());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
event.getPlayer().getPacketDispatch().sendMessage("You slice the watermelon into three slices.");
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
package content.global.skill.cooking
|
||||||
|
|
||||||
|
import content.global.skill.cooking.fermenting.WineFermentingPulse
|
||||||
|
import core.api.addItem
|
||||||
|
import core.api.getDynLevel
|
||||||
|
import core.api.removeItem
|
||||||
|
import core.api.sendMessage
|
||||||
|
import core.game.interaction.IntType
|
||||||
|
import core.game.interaction.InteractionListener
|
||||||
|
import core.game.node.entity.skill.Skills
|
||||||
|
import core.game.world.GameWorld.Pulser
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
|
||||||
|
class WineFermentListener : InteractionListener {
|
||||||
|
|
||||||
|
override fun defineListeners() {
|
||||||
|
onUseWith(IntType.ITEM, Items.GRAPES_1987, Items.JUG_OF_WATER_1937) { player, used, with ->
|
||||||
|
if (getDynLevel(player, Skills.COOKING) < 35) {
|
||||||
|
sendMessage(player, "You need a cooking level of 35 to do this.")
|
||||||
|
return@onUseWith true
|
||||||
|
}
|
||||||
|
if (removeItem(player, used.id) && removeItem(player, with.id)) {
|
||||||
|
addItem(player, Items.UNFERMENTED_WINE_1995)
|
||||||
|
Pulser.submit(WineFermentingPulse(1, player))
|
||||||
|
return@onUseWith true
|
||||||
|
}
|
||||||
|
return@onUseWith false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
package content.global.skill.cooking;
|
|
||||||
|
|
||||||
import core.plugin.Initializable;
|
|
||||||
import core.game.node.entity.skill.Skills;
|
|
||||||
import content.global.skill.cooking.fermenting.WineFermentingPulse;
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.interaction.UseWithHandler;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
import core.game.world.GameWorld;
|
|
||||||
import core.plugin.Plugin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the plugin used to ferment wine.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public final class WineFermentPlugin extends UseWithHandler {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the grapes item.
|
|
||||||
*/
|
|
||||||
private static final Item GRAPES = new Item(1987, 1);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the jug of water item.
|
|
||||||
*/
|
|
||||||
private static final Item JUG_OF_WATER = new Item(1937, 1);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the unfermented wine item.
|
|
||||||
*/
|
|
||||||
private static final Item UNFERMENTED_WINE = new Item(1995, 1);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code WineFermentPlugin} {@code Object}.
|
|
||||||
*/
|
|
||||||
public WineFermentPlugin() {
|
|
||||||
super(1937);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
addHandler(1987, ITEM_TYPE, this);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(NodeUsageEvent event) {
|
|
||||||
final Player player = event.getPlayer();
|
|
||||||
if (player.getSkills().getLevel(Skills.COOKING) < 35) {
|
|
||||||
player.getPacketDispatch().sendMessage("You need a cooking level of 35 to do this.");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (player.getInventory().remove(GRAPES, JUG_OF_WATER)) {
|
|
||||||
player.getInventory().add(UNFERMENTED_WINE);
|
|
||||||
GameWorld.getPulser().submit(new WineFermentingPulse(1, player));
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
package content.global.skill.cooking.recipe
|
||||||
|
|
||||||
|
import core.game.interaction.IntType
|
||||||
|
import core.game.interaction.InteractionListener
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
|
||||||
|
class ChocolateCakeListener : InteractionListener {
|
||||||
|
|
||||||
|
val chocolate = intArrayOf(Items.CHOCOLATE_BAR_1973, Items.CHOCOLATE_DUST_1975)
|
||||||
|
|
||||||
|
override fun defineListeners() {
|
||||||
|
onUseWith(IntType.ITEM, Items.CAKE_1891, *chocolate) { player, used, with ->
|
||||||
|
val product = Items.CHOCOLATE_CAKE_1897
|
||||||
|
val level = 50
|
||||||
|
val experience = 30.0
|
||||||
|
val message = ""
|
||||||
|
val failMessage = "You need a Cooking level of $level in order to do that."
|
||||||
|
|
||||||
|
return@onUseWith standardMix(
|
||||||
|
player,
|
||||||
|
used.asItem(),
|
||||||
|
with.asItem(),
|
||||||
|
product,
|
||||||
|
level,
|
||||||
|
experience,
|
||||||
|
message,
|
||||||
|
failMessage
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package content.global.skill.cooking.recipe
|
||||||
|
|
||||||
|
import core.game.interaction.IntType
|
||||||
|
import core.game.interaction.InteractionListener
|
||||||
|
import core.game.node.item.Item
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
|
||||||
|
class CurryListener : InteractionListener {
|
||||||
|
|
||||||
|
val added = intArrayOf(Items.CURRY_LEAF_5970, Items.SPICE_2007)
|
||||||
|
|
||||||
|
override fun defineListeners() {
|
||||||
|
onUseWith(IntType.ITEM, Items.UNCOOKED_STEW_2001, *added) { player, used, with ->
|
||||||
|
val product = Items.UNCOOKED_CURRY_2009
|
||||||
|
val amountAdded = when (with.id) {
|
||||||
|
Items.CURRY_LEAF_5970 -> 3
|
||||||
|
Items.SPICE_2007 -> 1
|
||||||
|
else -> 0
|
||||||
|
}
|
||||||
|
val level = 60
|
||||||
|
val experience = 0.0
|
||||||
|
val message = "You mix the spice with the stew."
|
||||||
|
val failMessage = "You need a Cooking level of at least $level in order to do this."
|
||||||
|
|
||||||
|
return@onUseWith standardMix(
|
||||||
|
player,
|
||||||
|
used.asItem(),
|
||||||
|
Item(with.id, amountAdded),
|
||||||
|
product,
|
||||||
|
level,
|
||||||
|
experience,
|
||||||
|
message,
|
||||||
|
failMessage
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
package content.global.skill.cooking.recipe
|
||||||
|
|
||||||
|
import core.api.*
|
||||||
|
import core.game.dialogue.SkillDialogueHandler
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
import core.game.node.entity.skill.Skills
|
||||||
|
import core.game.node.item.Item
|
||||||
|
import kotlin.math.min
|
||||||
|
|
||||||
|
fun standardMix(player: Player, used: Item, with: Item, product: Int, level: Int, experience: Double, message: String, failMessage: String): Boolean {
|
||||||
|
// Avoids sending dialogue if not enough ingredients to create (relevant only for curry leaves)
|
||||||
|
if (amountInInventory(player, used.id) < used.amount || amountInInventory(player, with.id) < with.amount) {
|
||||||
|
// Not sure about the authentic message
|
||||||
|
sendMessage(player, "You don't have enough ingredients to make that.")
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// Avoids sending dialogue if only one can be created
|
||||||
|
if (amountInInventory(player, used.id) == used.amount || amountInInventory(player, with.id) == with.amount) {
|
||||||
|
if (getDynLevel(player, Skills.COOKING) < level) {
|
||||||
|
sendDialogue(player, failMessage)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (removeItem(player, used) && removeItem(player, with)) {
|
||||||
|
sendMessage(player, message)
|
||||||
|
rewardXP(player, Skills.COOKING, experience)
|
||||||
|
addItem(player, product)
|
||||||
|
containerIngredient(player, used.id)
|
||||||
|
containerIngredient(player, with.id)
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
mixHandler(
|
||||||
|
player,
|
||||||
|
used,
|
||||||
|
with,
|
||||||
|
product,
|
||||||
|
level,
|
||||||
|
experience,
|
||||||
|
message,
|
||||||
|
failMessage
|
||||||
|
).open()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun mixHandler(player: Player, used: Item, with: Item, product: Int, level: Int, experience: Double, message: String, failMessage: String): SkillDialogueHandler {
|
||||||
|
val handler: SkillDialogueHandler =
|
||||||
|
object : SkillDialogueHandler(player, SkillDialogue.ONE_OPTION, product.asItem()) {
|
||||||
|
override fun create(amount: Int, index: Int) {
|
||||||
|
if (!playerMeetsInitialRequirements()) return
|
||||||
|
MixScript(player, used, with, product, amount, level, experience, message, failMessage).invoke()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun playerMeetsInitialRequirements(): Boolean {
|
||||||
|
if (getDynLevel(player, Skills.COOKING) < level) {
|
||||||
|
sendDialogue(player, failMessage)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getAll(index: Int): Int {
|
||||||
|
return min(
|
||||||
|
amountInInventory(player, used.id)/used.amount,
|
||||||
|
amountInInventory(player, with.id)/with.amount
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return handler
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
package content.global.skill.cooking.recipe
|
||||||
|
|
||||||
|
import core.api.*
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
import core.game.node.entity.skill.Skills
|
||||||
|
import core.game.node.item.Item
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
|
||||||
|
class MixScript(
|
||||||
|
private val player: Player,
|
||||||
|
private val used: Item,
|
||||||
|
private val with: Item,
|
||||||
|
private val product: Int,
|
||||||
|
private val sets: Int,
|
||||||
|
private val level: Int,
|
||||||
|
private val experience: Double,
|
||||||
|
private val message: String,
|
||||||
|
private val failMessage: String
|
||||||
|
) {
|
||||||
|
|
||||||
|
private val delay = 2
|
||||||
|
|
||||||
|
fun invoke() {
|
||||||
|
queueScript(player, delay) { stage -> Int
|
||||||
|
if (getDynLevel(player, Skills.COOKING) < level) {
|
||||||
|
sendDialogue(player, failMessage)
|
||||||
|
return@queueScript stopExecuting(player)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inInventory(player, used.id, used.amount) && inInventory(player, with.id, with.amount)) {
|
||||||
|
if(removeItem(player, used) && removeItem(player, with)) {
|
||||||
|
sendMessage(player, message)
|
||||||
|
rewardXP(player, Skills.COOKING, experience)
|
||||||
|
addItem(player, product)
|
||||||
|
containerIngredient(player, used.id)
|
||||||
|
containerIngredient(player, with.id)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return@queueScript stopExecuting(player)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stage >= sets - 1) {
|
||||||
|
return@queueScript stopExecuting(player)
|
||||||
|
}
|
||||||
|
|
||||||
|
return@queueScript delayScript(player, delay)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun containerIngredient(player: Player, ingredient: Int): Boolean{
|
||||||
|
return when (ingredient) {
|
||||||
|
Items.BUCKET_OF_WATER_1929, Items.COMPOST_6032 -> addItem(player, Items.BUCKET_1925)
|
||||||
|
Items.FRIED_MUSHROOMS_7082 -> addItem(player, Items.BOWL_1923)
|
||||||
|
else -> false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,57 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe;
|
|
||||||
|
|
||||||
import org.rs09.consts.Items;
|
|
||||||
import core.game.node.entity.skill.Skills;
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author afaroutdude
|
|
||||||
*/
|
|
||||||
public class OomlieWrap extends Recipe {
|
|
||||||
|
|
||||||
private static final Item OOMLIE_WRAP = new Item(Items.WRAPPED_OOMLIE_2341);
|
|
||||||
private static final Item RAW_OOMLIE = new Item(Items.RAW_OOMLIE_2337);
|
|
||||||
private static final Item PALM_LEAF = new Item(Items.PALM_LEAF_2339);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mix(final Player player, final NodeUsageEvent event) {
|
|
||||||
if (player.getSkills().getLevel(Skills.COOKING) < 50) {
|
|
||||||
player.getDialogueInterpreter().sendDialogue("You need a Cooking level of 50 in order to do that.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
super.mix(player, event);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getBase() {
|
|
||||||
return RAW_OOMLIE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return OOMLIE_WRAP;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { PALM_LEAF };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getParts() {
|
|
||||||
return new Item[] {};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getMixMessage(NodeUsageEvent event) {
|
|
||||||
return "You wrap the raw oomlie in the palm leaf.";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSingular() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package content.global.skill.cooking.recipe
|
||||||
|
|
||||||
|
import core.game.interaction.IntType
|
||||||
|
import core.game.interaction.InteractionListener
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
|
||||||
|
class OomlieWrapListener : InteractionListener {
|
||||||
|
|
||||||
|
override fun defineListeners() {
|
||||||
|
onUseWith(IntType.ITEM, Items.RAW_OOMLIE_2337, Items.PALM_LEAF_2339) { player, used, with ->
|
||||||
|
val product = Items.WRAPPED_OOMLIE_2341
|
||||||
|
val level = 50
|
||||||
|
val experience = 0.0
|
||||||
|
val message = "You wrap the raw oomlie in the palm leaf."
|
||||||
|
val failMessage = "You need a Cooking level of at least $level in order to do that."
|
||||||
|
|
||||||
|
return@onUseWith standardMix(
|
||||||
|
player,
|
||||||
|
used.asItem(),
|
||||||
|
with.asItem(),
|
||||||
|
product,
|
||||||
|
level,
|
||||||
|
experience,
|
||||||
|
message,
|
||||||
|
failMessage
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
package content.global.skill.cooking.recipe
|
||||||
|
|
||||||
|
import core.game.interaction.IntType
|
||||||
|
import core.game.interaction.InteractionListener
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
|
||||||
|
class PieListener : InteractionListener {
|
||||||
|
|
||||||
|
val base = PieProduct.values().map { it.base }.toIntArray()
|
||||||
|
val added = PieProduct.values().map { it.added }.toIntArray()
|
||||||
|
|
||||||
|
override fun defineListeners() {
|
||||||
|
onUseWith(IntType.ITEM, base, *added) { player, used, with ->
|
||||||
|
val pie = PieProduct.productMap[used.id] ?: return@onUseWith true
|
||||||
|
|
||||||
|
if (pie.added != with.id) {
|
||||||
|
return@onUseWith false
|
||||||
|
}
|
||||||
|
|
||||||
|
val product = pie.product
|
||||||
|
val level = pie.minimumLevel
|
||||||
|
val experience = 0.0
|
||||||
|
val message = "You fill the pie with ${pie.ingredientMessage}."
|
||||||
|
val failMessage = "You need a Cooking level of ${pie.minimumLevel} to make this."
|
||||||
|
|
||||||
|
return@onUseWith standardMix(
|
||||||
|
player,
|
||||||
|
used.asItem(),
|
||||||
|
with.asItem(),
|
||||||
|
product,
|
||||||
|
level,
|
||||||
|
experience,
|
||||||
|
message,
|
||||||
|
failMessage
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum class PieProduct(
|
||||||
|
val base: Int,
|
||||||
|
val added: Int,
|
||||||
|
val product: Int,
|
||||||
|
val minimumLevel: Int,
|
||||||
|
val ingredientMessage: String,
|
||||||
|
) {
|
||||||
|
REDBERRY_PIE(Items.REDBERRIES_1951, Items.PIE_SHELL_2315, Items.UNCOOKED_BERRY_PIE_2321, 10, "redberries"),
|
||||||
|
MEAT_PIE(Items.COOKED_MEAT_2142, Items.PIE_SHELL_2315, Items.UNCOOKED_MEAT_PIE_2319, 20, "meat"),
|
||||||
|
MUD_PIE_1(Items.COMPOST_6032, Items.PIE_SHELL_2315, Items.PART_MUD_PIE_7164, 29, "compost"),
|
||||||
|
MUD_PIE_2(Items.PART_MUD_PIE_7164, Items.BUCKET_OF_WATER_1929, Items.PART_MUD_PIE_7166, 29, "water"),
|
||||||
|
MUD_PIE_3(Items.PART_MUD_PIE_7166, Items.CLAY_434, Items.RAW_MUD_PIE_7168, 29, "clay"),
|
||||||
|
APPLE_PIE(Items.COOKING_APPLE_1955, Items.PIE_SHELL_2315, Items.UNCOOKED_APPLE_PIE_2317, 30, "cooking apple"),
|
||||||
|
GARDEN_PIE_1(Items.TOMATO_1982, Items.PIE_SHELL_2315, Items.PART_GARDEN_PIE_7172, 34, "tomato"),
|
||||||
|
GARDEN_PIE_2(Items.PART_GARDEN_PIE_7172, Items.ONION_1957, Items.PART_GARDEN_PIE_7174, 34, "onion"),
|
||||||
|
GARDEN_PIE_3(Items.PART_GARDEN_PIE_7174, Items.CABBAGE_1965, Items.RAW_GARDEN_PIE_7176, 34, "cabbage"),
|
||||||
|
FISH_PIE_1(Items.TROUT_333, Items.PIE_SHELL_2315, Items.PART_FISH_PIE_7182, 47, "trout"),
|
||||||
|
FISH_PIE_2(Items.PART_FISH_PIE_7182, Items.COD_339, Items.PART_FISH_PIE_7184, 47, "cod"),
|
||||||
|
FISH_PIE_3(Items.PART_FISH_PIE_7184, Items.POTATO_1942, Items.RAW_FISH_PIE_7186, 47, "potato"),
|
||||||
|
ADMIRAL_PIE_1(Items.SALMON_329, Items.PIE_SHELL_2315, Items.PART_ADMIRAL_PIE_7192, 70, "salmon"),
|
||||||
|
ADMIRAL_PIE_2(Items.PART_ADMIRAL_PIE_7192, Items.TUNA_361, Items.PART_ADMIRAL_PIE_7194, 70, "tuna"),
|
||||||
|
ADMIRAL_PIE_3(Items.PART_ADMIRAL_PIE_7194, Items.POTATO_1942, Items.RAW_ADMIRAL_PIE_7196, 70, "potato"),
|
||||||
|
WILD_PIE_1(Items.RAW_BEAR_MEAT_2136, Items.PIE_SHELL_2315, Items.PART_WILD_PIE_7202, 85, "raw bear meat"),
|
||||||
|
WILD_PIE_2(Items.PART_WILD_PIE_7202, Items.RAW_CHOMPY_2876, Items.PART_WILD_PIE_7204, 85, "raw chompy"),
|
||||||
|
WILD_PIE_3(Items.PART_WILD_PIE_7204, Items.RAW_RABBIT_3226, Items.RAW_WILD_PIE_7206, 85, "raw rabbit"),
|
||||||
|
SUMMER_PIE_1(Items.STRAWBERRY_5504, Items.PIE_SHELL_2315, Items.PART_SUMMER_PIE_7212, 95, "strawberry"),
|
||||||
|
SUMMER_PIE_2(Items.PART_SUMMER_PIE_7212, Items.WATERMELON_5982, Items.PART_SUMMER_PIE_7214, 95, "watermelon"),
|
||||||
|
SUMMER_PIE_3(Items.PART_SUMMER_PIE_7214, Items.COOKING_APPLE_1955, Items.RAW_SUMMER_PIE_7216, 95, "apple"),
|
||||||
|
;
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
val productMap = HashMap<Int, PieProduct>()
|
||||||
|
|
||||||
|
init {
|
||||||
|
for (pie in PieProduct.values()) {
|
||||||
|
productMap[pie.base] = pie
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package content.global.skill.cooking.recipe
|
||||||
|
|
||||||
|
import core.game.interaction.IntType
|
||||||
|
import core.game.interaction.InteractionListener
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
|
||||||
|
class PieShellListener : InteractionListener {
|
||||||
|
|
||||||
|
override fun defineListeners() {
|
||||||
|
onUseWith(IntType.ITEM, Items.PIE_DISH_2313, Items.PASTRY_DOUGH_1953) { player, used, with ->
|
||||||
|
val product = Items.PIE_SHELL_2315
|
||||||
|
val level = 1
|
||||||
|
val experience = 0.0
|
||||||
|
val message = "You put the pastry dough into the pie dish to make a pie shell."
|
||||||
|
val failMessage = ""
|
||||||
|
|
||||||
|
return@onUseWith standardMix(
|
||||||
|
player,
|
||||||
|
used.asItem(),
|
||||||
|
with.asItem(),
|
||||||
|
product,
|
||||||
|
level,
|
||||||
|
experience,
|
||||||
|
message,
|
||||||
|
failMessage
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,66 @@
|
||||||
|
package content.global.skill.cooking.recipe
|
||||||
|
|
||||||
|
import core.game.interaction.IntType
|
||||||
|
import core.game.interaction.InteractionListener
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
|
||||||
|
class PizzaListener : InteractionListener {
|
||||||
|
|
||||||
|
val base = PizzaProduct.values().map { it.base }.toIntArray()
|
||||||
|
val added = PizzaProduct.values().map { it.added }.toIntArray()
|
||||||
|
|
||||||
|
override fun defineListeners() {
|
||||||
|
onUseWith(IntType.ITEM, base, *added) { player, used, with ->
|
||||||
|
val pizza = PizzaProduct.productMap[used.id] ?: return@onUseWith true
|
||||||
|
|
||||||
|
if (pizza.added != with.id) {
|
||||||
|
return@onUseWith false
|
||||||
|
}
|
||||||
|
|
||||||
|
val product = pizza.product
|
||||||
|
val level = pizza.minimumLevel
|
||||||
|
val experience = pizza.experience
|
||||||
|
val message = "You add the ${pizza.message} to the pizza."
|
||||||
|
val failMessage = "You need a Cooking level of at least ${pizza.minimumLevel} in order to do this."
|
||||||
|
|
||||||
|
return@onUseWith standardMix(
|
||||||
|
player,
|
||||||
|
used.asItem(),
|
||||||
|
with.asItem(),
|
||||||
|
product,
|
||||||
|
level,
|
||||||
|
experience,
|
||||||
|
message,
|
||||||
|
failMessage
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum class PizzaProduct(
|
||||||
|
val base: Int,
|
||||||
|
val added: Int,
|
||||||
|
val product: Int,
|
||||||
|
val minimumLevel: Int,
|
||||||
|
val experience: Double,
|
||||||
|
val message: String,
|
||||||
|
) {
|
||||||
|
PIZZA_1(Items.TOMATO_1982, Items.PIZZA_BASE_2283, Items.INCOMPLETE_PIZZA_2285, 35, 0.0,"tomato"),
|
||||||
|
PIZZA_2(Items.CHEESE_1985, Items.INCOMPLETE_PIZZA_2285, Items.UNCOOKED_PIZZA_2287, 35, 0.0, "cheese"),
|
||||||
|
MEAT_PIZZA_1(Items.COOKED_MEAT_2142, Items.PLAIN_PIZZA_2289, Items.MEAT_PIZZA_2293, 45, 26.0, "meat"),
|
||||||
|
MEAT_PIZZA_2(Items.COOKED_CHICKEN_2140, Items.PLAIN_PIZZA_2289, Items.MEAT_PIZZA_2293, 45, 26.0, "cooked chicken"),
|
||||||
|
ANCHOVY_PIZZA(Items.ANCHOVIES_319, Items.PLAIN_PIZZA_2289, Items.ANCHOVY_PIZZA_2297, 55, 39.0, "anchovies"),
|
||||||
|
PINEAPPLE_PIZZA_1(Items.PINEAPPLE_CHUNKS_2116, Items.PLAIN_PIZZA_2289, Items.PINEAPPLE_PIZZA_2301, 65, 52.0, "pineapple"),
|
||||||
|
PINEAPPLE_PIZZA_2(Items.PINEAPPLE_RING_2118, Items.PLAIN_PIZZA_2289, Items.PINEAPPLE_PIZZA_2301, 65, 52.0, "pineapple"),
|
||||||
|
;
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
val productMap = HashMap<Int, PizzaProduct>()
|
||||||
|
|
||||||
|
init {
|
||||||
|
for (pizza in PizzaProduct.values()) {
|
||||||
|
productMap[pizza.base] = pizza
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
package content.global.skill.cooking.recipe
|
||||||
|
|
||||||
|
import core.game.interaction.IntType
|
||||||
|
import core.game.interaction.InteractionListener
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
|
||||||
|
class PotatoListener : InteractionListener {
|
||||||
|
|
||||||
|
val added = PotatoProduct.values().map { it.added }.toIntArray()
|
||||||
|
|
||||||
|
override fun defineListeners() {
|
||||||
|
onUseWith(IntType.ITEM, Items.BAKED_POTATO_6701, Items.PAT_OF_BUTTER_6697) { player, used, with ->
|
||||||
|
val product = Items.POTATO_WITH_BUTTER_6703
|
||||||
|
val level = 39
|
||||||
|
val experience = 40.5
|
||||||
|
val message = "You add a pat of butter to the potato."
|
||||||
|
val failMessage = "You need a Cooking level of at least $level in order to do this."
|
||||||
|
|
||||||
|
return@onUseWith standardMix(
|
||||||
|
player,
|
||||||
|
used.asItem(),
|
||||||
|
with.asItem(),
|
||||||
|
product,
|
||||||
|
level,
|
||||||
|
experience,
|
||||||
|
message,
|
||||||
|
failMessage
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
onUseWith(IntType.ITEM, added, Items.POTATO_WITH_BUTTER_6703) { player, used, with ->
|
||||||
|
val topping = PotatoProduct.productMap[used.id] ?: return@onUseWith true
|
||||||
|
|
||||||
|
val product = topping.product
|
||||||
|
val level = topping.minimumLevel
|
||||||
|
val experience = topping.experience
|
||||||
|
val message = ""
|
||||||
|
val failMessage = "You need a Cooking level of at least $level in order to do this."
|
||||||
|
|
||||||
|
return@onUseWith standardMix(
|
||||||
|
player,
|
||||||
|
used.asItem(),
|
||||||
|
with.asItem(),
|
||||||
|
product,
|
||||||
|
level,
|
||||||
|
experience,
|
||||||
|
message,
|
||||||
|
failMessage
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum class PotatoProduct(
|
||||||
|
val added: Int,
|
||||||
|
val product: Int,
|
||||||
|
val minimumLevel: Int,
|
||||||
|
val experience: Double,
|
||||||
|
val message: String
|
||||||
|
) {
|
||||||
|
CHEESE_POTATO(Items.CHEESE_1985, Items.POTATO_WITH_CHEESE_6705, 47, 10.0, ""),
|
||||||
|
CHILLI_POTATO(Items.CHILLI_CON_CARNE_7062, Items.CHILLI_POTATO_7054, 41, 15.0, ""),
|
||||||
|
EGG_POTATO(Items.EGG_AND_TOMATO_7064, Items.EGG_POTATO_7056, 51, 50.0, ""),
|
||||||
|
TUNA_POTATO(Items.TUNA_AND_CORN_7068, Items.TUNA_POTATO_7060, 68, 10.0, ""),
|
||||||
|
MUSHROOM_POTATO(Items.MUSHROOM_AND_ONION_7066, Items.MUSHROOM_POTATO_7058, 64, 55.0, ""),
|
||||||
|
;
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
val productMap = HashMap<Int, PotatoProduct>()
|
||||||
|
|
||||||
|
init {
|
||||||
|
for (topping in PotatoProduct.values()) {
|
||||||
|
productMap[topping.added] = topping
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,134 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.pie.impl.*;
|
|
||||||
import content.global.skill.cooking.recipe.pizza.impl.AnchovyPizza;
|
|
||||||
import content.global.skill.cooking.recipe.pizza.impl.MeatPizza;
|
|
||||||
import content.global.skill.cooking.recipe.pizza.impl.PineapplePizza;
|
|
||||||
import content.global.skill.cooking.recipe.pizza.impl.PlainPizza;
|
|
||||||
import content.global.skill.cooking.recipe.potato.impl.*;
|
|
||||||
import content.global.skill.cooking.recipe.stew.CurryRecipe;
|
|
||||||
import content.global.skill.cooking.recipe.stew.StewRecipe;
|
|
||||||
import content.global.skill.cooking.recipe.topping.impl.*;
|
|
||||||
import content.global.skill.cooking.recipe.cake.ChocolateCake;
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a cooking recipe, this is dynamic that can range from a pie to a
|
|
||||||
* pizza.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 21/12/2013
|
|
||||||
*/
|
|
||||||
public abstract class Recipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the array of active recipes in 2009Scape.
|
|
||||||
*/
|
|
||||||
// TODO:
|
|
||||||
// - Making this an enum would drastically save on file/line count, since the recipes seem to mostly be plain-old-data classes
|
|
||||||
// - Making pie shells a recipe would make make-x for them just work
|
|
||||||
// - Making pineapple cutting a recipe would probably fix their make-x making all with any option
|
|
||||||
public static final Recipe[] RECIPES = new Recipe[] {
|
|
||||||
new RedberryPie(), new MeatPie(), new ApplePie(), new MudPie(), new GardenPie(), new FishPie(), new AdmiralPie(), new WildPie(), new SummerPie(),
|
|
||||||
new StewRecipe(), new CurryRecipe(),
|
|
||||||
new PlainPizza(), new MeatPizza(), new AnchovyPizza(), new PineapplePizza(),
|
|
||||||
new ChocolateCake(),
|
|
||||||
new ButterPotato(), new ChilliPotato(), new CheesePotato(), new EggPotato(), new MushroomPotato(), new TunaPotato(),
|
|
||||||
new SpicySauce(), new ChilliConCarne(), new UncookedEgg(), new EggAndTomato(), new MushroomAndOnion(), new ChoppedOnion(), new SlicedMushroom(), new ChoppedTuna(), new TunaAndCorn(), new OomlieWrap()
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method used to get the base item.
|
|
||||||
* @return the item.
|
|
||||||
*/
|
|
||||||
public abstract Item getBase();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method used to get the product item.
|
|
||||||
* @return the product item.
|
|
||||||
*/
|
|
||||||
public abstract Item getProduct();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method used to get the ingredients in this recipe.
|
|
||||||
* @return the ingredients.
|
|
||||||
*/
|
|
||||||
public abstract Item[] getIngredients();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method used to get the part items made from ingredients.
|
|
||||||
* @return the part items.
|
|
||||||
*/
|
|
||||||
public abstract Item[] getParts();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method used to get the mixing message.
|
|
||||||
* @param event the node usage event.
|
|
||||||
* @return the message used to mix.
|
|
||||||
*/
|
|
||||||
public abstract String getMixMessage(final NodeUsageEvent event);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method used to check if this is a singular one step recipe.
|
|
||||||
* @return <code>True</code> if so.
|
|
||||||
*/
|
|
||||||
public abstract boolean isSingular();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method used to mix this recipes ingredients.
|
|
||||||
* @param player the player.
|
|
||||||
* @param event the event.
|
|
||||||
*/
|
|
||||||
public void mix(final Player player, final NodeUsageEvent event) {
|
|
||||||
if (getIngredients().length == 1) {
|
|
||||||
singleMix(player, event);
|
|
||||||
} else {
|
|
||||||
multipleMix(player, event);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method used to handle a single mixing.
|
|
||||||
* @param player the player.
|
|
||||||
* @param event the event.
|
|
||||||
*/
|
|
||||||
public void singleMix(final Player player, final NodeUsageEvent event) {
|
|
||||||
if (player.getInventory().remove(event.getBaseItem()) && player.getInventory().remove(event.getUsedItem())) {
|
|
||||||
player.getInventory().add(getProduct());
|
|
||||||
String message = getMixMessage(event);
|
|
||||||
if (message != null) {
|
|
||||||
player.getPacketDispatch().sendMessage(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method used to handle mixing multiple item recipes.
|
|
||||||
* @param player the player.
|
|
||||||
* @param event the event.
|
|
||||||
*/
|
|
||||||
public void multipleMix(final Player player, final NodeUsageEvent event) {
|
|
||||||
Item item = null;
|
|
||||||
int index = -1;
|
|
||||||
for (int counter = 0; counter < getIngredients().length; counter++) {
|
|
||||||
item = getIngredients()[counter];
|
|
||||||
if (item.getId() == event.getUsedItem().getId() || item.getId() == event.getBaseItem().getId()) {
|
|
||||||
index = counter;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (index != -1) {
|
|
||||||
if (!player.getInventory().containItems(event.getBaseItem().getId(), event.getUsedItem().getId())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (player.getInventory().remove(event.getBaseItem()) && player.getInventory().remove(event.getUsedItem())) {
|
|
||||||
player.getInventory().add(getParts()[index + 1]);
|
|
||||||
String message = getMixMessage(event);
|
|
||||||
if (message != null) {
|
|
||||||
player.getPacketDispatch().sendMessage(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package content.global.skill.cooking.recipe
|
||||||
|
|
||||||
|
import core.game.interaction.IntType
|
||||||
|
import core.game.interaction.InteractionListener
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
|
||||||
|
class StewListener : InteractionListener {
|
||||||
|
|
||||||
|
val base = StewProduct.values().map { it.base }.toIntArray()
|
||||||
|
val added = StewProduct.values().map { it.added }.toIntArray()
|
||||||
|
|
||||||
|
override fun defineListeners() {
|
||||||
|
onUseWith(IntType.ITEM, base, *added) { player, used, with ->
|
||||||
|
val stew = StewProduct.productMap[used.id] ?: return@onUseWith true
|
||||||
|
|
||||||
|
if (stew.added != with.id) {
|
||||||
|
return@onUseWith false
|
||||||
|
}
|
||||||
|
|
||||||
|
val product = stew.product
|
||||||
|
val level = stew.minimumLevel
|
||||||
|
val experience = 0.0
|
||||||
|
val message = "You cut up the ${stew.message} and put it into the stew."
|
||||||
|
val failMessage = "You need a Cooking level of at least ${stew.minimumLevel} in order to do this."
|
||||||
|
|
||||||
|
return@onUseWith standardMix(
|
||||||
|
player,
|
||||||
|
used.asItem(),
|
||||||
|
with.asItem(),
|
||||||
|
product,
|
||||||
|
level,
|
||||||
|
experience,
|
||||||
|
message,
|
||||||
|
failMessage
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum class StewProduct(
|
||||||
|
val base: Int,
|
||||||
|
val added: Int,
|
||||||
|
val product: Int,
|
||||||
|
val minimumLevel: Int,
|
||||||
|
val message: String,
|
||||||
|
) {
|
||||||
|
STEW_1(Items.POTATO_1942, Items.BOWL_OF_WATER_1921, Items.INCOMPLETE_STEW_1997, 25, "potato"),
|
||||||
|
STEW_2(Items.INCOMPLETE_STEW_1997, Items.COOKED_MEAT_2142, Items.UNCOOKED_STEW_2001, 25, "meat"),
|
||||||
|
STEW_3(Items.COOKED_MEAT_2142, Items.BOWL_OF_WATER_1921, Items.INCOMPLETE_STEW_1999, 25, "meat"),
|
||||||
|
STEW_4(Items.INCOMPLETE_STEW_1999, Items.POTATO_1942, Items.UNCOOKED_STEW_2001, 25, "potato"),
|
||||||
|
;
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
val productMap = HashMap<Int, StewProduct>()
|
||||||
|
|
||||||
|
init {
|
||||||
|
for (stew in StewProduct.values()) {
|
||||||
|
productMap[stew.base] = stew
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,84 @@
|
||||||
|
package content.global.skill.cooking.recipe
|
||||||
|
|
||||||
|
import core.api.inInventory
|
||||||
|
import core.api.sendDialogue
|
||||||
|
import core.game.interaction.IntType
|
||||||
|
import core.game.interaction.InteractionListener
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
|
||||||
|
class ToppingListener : InteractionListener {
|
||||||
|
|
||||||
|
val base = ToppingProduct.values().map { it.base }.toIntArray()
|
||||||
|
val added = ToppingProduct.values().map { it.added }.toIntArray()
|
||||||
|
|
||||||
|
override fun defineListeners() {
|
||||||
|
onUseWith(IntType.ITEM, base, *added) { player, used, with ->
|
||||||
|
val topping = ToppingProduct.productMap[used.id] ?: return@onUseWith true
|
||||||
|
val verb = if (with.id == Items.COOKED_MEAT_2142) "cut" else "slice"
|
||||||
|
|
||||||
|
if (topping.added != with.id) {
|
||||||
|
return@onUseWith false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (topping.cut_name != "" && !inInventory(player, Items.KNIFE_946)) {
|
||||||
|
sendDialogue(player, "You need a knife in order to $verb up the ${topping.cut_name}.")
|
||||||
|
return@onUseWith true
|
||||||
|
}
|
||||||
|
|
||||||
|
val product = topping.product
|
||||||
|
val level = topping.minimumLevel
|
||||||
|
val experience = topping.experience
|
||||||
|
val message = topping.message
|
||||||
|
val failMessage = "You need a Cooking level of at least ${topping.minimumLevel} in order to do this."
|
||||||
|
|
||||||
|
return@onUseWith standardMix(
|
||||||
|
player,
|
||||||
|
used.asItem(),
|
||||||
|
with.asItem(),
|
||||||
|
product,
|
||||||
|
level,
|
||||||
|
experience,
|
||||||
|
message,
|
||||||
|
failMessage
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum class ToppingProduct(
|
||||||
|
val base: Int,
|
||||||
|
val added: Int,
|
||||||
|
val product: Int,
|
||||||
|
val minimumLevel: Int,
|
||||||
|
val experience: Double,
|
||||||
|
val message: String,
|
||||||
|
val cut_name: String
|
||||||
|
) {
|
||||||
|
//Tuna and Corn: https://www.youtube.com/watch?v=wAavERc9p2c
|
||||||
|
//Uncooked Egg: https://www.youtube.com/watch?v=LiLq6PhCc2M
|
||||||
|
//Bowl of sweetcorn (OSRS source is only I could find) https://www.youtube.com/watch?v=pz8epXjkKYE
|
||||||
|
|
||||||
|
UNCOOKED_EGG(Items.EGG_1944, Items.BOWL_1923, Items.UNCOOKED_EGG_7076, 1, 0.0, "You carefully break the egg into the bowl.", ""),
|
||||||
|
BOWL_OF_SWEETCORN(Items.COOKED_SWEETCORN_5988, Items.BOWL_1923, Items.SWEETCORN_7088, 1, 0.0, "You put the cooked sweetcorn into the bowl.", ""),
|
||||||
|
SLICED_MUSHROOM(Items.MUSHROOM_6004, Items.BOWL_1923, Items.SLICED_MUSHROOMS_7080, 1, 0.0, "You chop the mushrooms into the bowl.", "mushrooms"),
|
||||||
|
CHOPPED_TUNA(Items.TUNA_361, Items.BOWL_1923, Items.CHOPPED_TUNA_7086, 1, 0.0, "You chop the tuna into the bowl.", "tuna"),
|
||||||
|
CHOPPED_ONION(Items.ONION_1957, Items.BOWL_1923, Items.CHOPPED_ONION_1871, 1, 0.0, "You chop the onion into the bowl.", "onion"),
|
||||||
|
CHOPPED_GARLIC(Items.GARLIC_1550, Items.BOWL_1923, Items.CHOPPED_GARLIC_7074, 1, 0.0, "You chop the garlic into the bowl.", "garlic"),
|
||||||
|
SPICY_SAUCE(Items.CHOPPED_GARLIC_7074, Items.GNOME_SPICE_2169, Items.SPICY_SAUCE_7072, 9, 25.0, "You mix the ingredients to make the topping.", ""), //inauthentic, used generic mixing message
|
||||||
|
CHILLI_CON_CARNE(Items.SPICY_SAUCE_7072, Items.COOKED_MEAT_2142, Items.CHILLI_CON_CARNE_7062, 9, 0.0, "You mix the ingredients to make the topping.", "meat"), //inauthentic, used generic mixing message
|
||||||
|
EGG_AND_TOMATO(Items.TOMATO_1982, Items.SCRAMBLED_EGG_7078, Items.EGG_AND_TOMATO_7064, 23, 50.0, "You mix the ingredients to make the topping.", ""),
|
||||||
|
MUSHROOM_AND_ONION(Items.FRIED_MUSHROOMS_7082, Items.FRIED_ONIONS_7084, Items.MUSHROOM_AND_ONION_7066, 57, 120.0, "You mix the ingredients to make the topping.", ""),
|
||||||
|
TUNA_AND_CORN_1(Items.CHOPPED_TUNA_7086, Items.COOKED_SWEETCORN_5988, Items.TUNA_AND_CORN_7068, 67, 204.0, "You mix the ingredients to make the topping.", ""),
|
||||||
|
TUNA_AND_CORN_2(Items.SWEETCORN_7088, Items.TUNA_361, Items.TUNA_AND_CORN_7068, 67, 204.0, "You mix the ingredients to make the topping.", "tuna"),
|
||||||
|
;
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
val productMap = HashMap<Int, ToppingProduct>()
|
||||||
|
|
||||||
|
init {
|
||||||
|
for (topping in ToppingProduct.values()) {
|
||||||
|
productMap[topping.base] = topping
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.cake;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.Recipe;
|
|
||||||
import core.game.node.entity.skill.Skills;
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the chocolate cake recipe. This recipe consists of adding a
|
|
||||||
* chocolate bar to a cake.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 22/12/2013
|
|
||||||
*/
|
|
||||||
public class ChocolateCake extends Recipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the cake item.
|
|
||||||
*/
|
|
||||||
private static final Item CAKE = new Item(1891);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the chocolate cake item.
|
|
||||||
*/
|
|
||||||
private static final Item CHOCOLATE_CAKE = new Item(1897);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the chocolate bar item.
|
|
||||||
*/
|
|
||||||
private static final Item CHOCOLATE_BAR = new Item(1973);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mix(final Player player, final NodeUsageEvent event) {
|
|
||||||
if (player.getSkills().getLevel(Skills.COOKING) < 50) {
|
|
||||||
player.getDialogueInterpreter().sendDialogue("You need a Cooking level of 50 in order to do that.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
super.mix(player, event);
|
|
||||||
player.getSkills().addExperience(Skills.COOKING, 30, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getBase() {
|
|
||||||
return CAKE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return CHOCOLATE_CAKE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { CHOCOLATE_BAR };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getParts() {
|
|
||||||
return new Item[] {};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getMixMessage(NodeUsageEvent event) {
|
|
||||||
return "You add chocolate to the cake.";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSingular() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.pie;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.Recipe;
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the generic recipe for a pie.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 21/12/2013
|
|
||||||
*/
|
|
||||||
public abstract class PieRecipe extends Recipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the pie shell item.
|
|
||||||
*/
|
|
||||||
protected static final Item PIE_SHELL = new Item(2315);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getParts() {
|
|
||||||
return new Item[] {};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getBase() {
|
|
||||||
return PIE_SHELL;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getMixMessage(final NodeUsageEvent event) {
|
|
||||||
return "You fill the pie with " + (event.getBaseItem().getId() == 2315 ? event.getUsedItem().getName().toLowerCase() : event.getBaseItem().getName().toLowerCase()) + ".";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSingular() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.pie.impl;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.pie.PieRecipe;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the admiral pie recipe. This recipe conists of pixing a salmon,
|
|
||||||
* tuna and potato together.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 21/12/2013
|
|
||||||
*/
|
|
||||||
public class AdmiralPie extends PieRecipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the uncooked redberry pie.
|
|
||||||
*/
|
|
||||||
private static final Item UNCOOKED_PIE = new Item(7196);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the salmon ingredient item.
|
|
||||||
*/
|
|
||||||
private static final Item SALMON = new Item(329);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the tuna ingredient item.
|
|
||||||
*/
|
|
||||||
private static final Item TUNA = new Item(361);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the potato item.
|
|
||||||
*/
|
|
||||||
private static final Item POTATO = new Item(1942);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the part one pie item.
|
|
||||||
*/
|
|
||||||
private static final Item PART_ONE = new Item(7192);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the part two pie item.
|
|
||||||
*/
|
|
||||||
private static final Item PART_TWO = new Item(7194);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return UNCOOKED_PIE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { SALMON, TUNA, POTATO };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getParts() {
|
|
||||||
return new Item[] { PIE_SHELL, PART_ONE, PART_TWO, UNCOOKED_PIE };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSingular() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.pie.impl;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.pie.PieRecipe;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the apple pie recipe. This recipe consists of cooking apples and a
|
|
||||||
* pie shell.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 21/12/2013
|
|
||||||
*/
|
|
||||||
public class ApplePie extends PieRecipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the uncooked redberry pie.
|
|
||||||
*/
|
|
||||||
private static final Item UNCOOKED_PIE = new Item(2317);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the cooking apple item.
|
|
||||||
*/
|
|
||||||
private static final Item COOKING_APPLE = new Item(1955);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return UNCOOKED_PIE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { COOKING_APPLE };
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.pie.impl;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.pie.PieRecipe;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the garden pie recipe. This pie consists of mixing, tomato, onion,
|
|
||||||
* and cabbage together.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 21/12/2013
|
|
||||||
*/
|
|
||||||
public class FishPie extends PieRecipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the uncooked redberry pie.
|
|
||||||
*/
|
|
||||||
private static final Item UNCOOKED_PIE = new Item(7186);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the trout item ingredient.
|
|
||||||
*/
|
|
||||||
private static final Item TROUT = new Item(333);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the cod item ingredient.
|
|
||||||
*/
|
|
||||||
private static final Item COD = new Item(339);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the potato item.
|
|
||||||
*/
|
|
||||||
private static final Item POTATO = new Item(1942);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the part one pie item.
|
|
||||||
*/
|
|
||||||
private static final Item PART_ONE = new Item(7182);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the part two pie item.
|
|
||||||
*/
|
|
||||||
private static final Item PART_TWO = new Item(7184);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return UNCOOKED_PIE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { TROUT, COD, POTATO };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getParts() {
|
|
||||||
return new Item[] { PIE_SHELL, PART_ONE, PART_TWO, UNCOOKED_PIE };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSingular() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.pie.impl;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.pie.PieRecipe;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the garden pie recipe. This pie consists of mixing, tomato, onion,
|
|
||||||
* and cabbage together.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 21/12/2013
|
|
||||||
*/
|
|
||||||
public class GardenPie extends PieRecipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the uncooked redberry pie.
|
|
||||||
*/
|
|
||||||
private static final Item UNCOOKED_PIE = new Item(7176);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the tomato ingredient item.
|
|
||||||
*/
|
|
||||||
private static final Item TOMATO = new Item(1982);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the onion ingredient item.
|
|
||||||
*/
|
|
||||||
private static final Item ONION = new Item(1957);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the cabbage ingredient item.
|
|
||||||
*/
|
|
||||||
private static final Item CABBAGE = new Item(1965);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the part one pie item.
|
|
||||||
*/
|
|
||||||
private static final Item PART_ONE = new Item(7172);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the part two pie item.
|
|
||||||
*/
|
|
||||||
private static final Item PART_TWO = new Item(7174);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return UNCOOKED_PIE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { TOMATO, ONION, CABBAGE };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getParts() {
|
|
||||||
return new Item[] { PIE_SHELL, PART_ONE, PART_TWO, UNCOOKED_PIE };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSingular() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.pie.impl;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.pie.PieRecipe;
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the meat pie recipe.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 21/12/2013
|
|
||||||
*/
|
|
||||||
public class MeatPie extends PieRecipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the uncooked redberry pie.
|
|
||||||
*/
|
|
||||||
private static final Item UNCOOKED_PIE = new Item(2319);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the cooked meat item.
|
|
||||||
*/
|
|
||||||
private static final Item COOKED_MEAT = new Item(2142);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the cooked chicken item.
|
|
||||||
*/
|
|
||||||
private static final Item COOKED_CHICKEN = new Item(2140);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the cooked rabbit.
|
|
||||||
*/
|
|
||||||
private static final Item COOKED_RABBIT = new Item(3228);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mix(final Player player, final NodeUsageEvent event) {
|
|
||||||
if (player.getInventory().remove(event.getUsedItem()) && player.getInventory().remove(event.getBaseItem())) {
|
|
||||||
player.getInventory().add(getProduct());
|
|
||||||
player.getPacketDispatch().sendMessage(getMixMessage(event));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return UNCOOKED_PIE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { COOKED_MEAT, COOKED_CHICKEN, COOKED_RABBIT };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getMixMessage(final NodeUsageEvent event) {
|
|
||||||
return "You fill the pie with meat.";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.pie.impl;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.pie.PieRecipe;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the mud pie recipe. A mud pie consists of mixing compost, water
|
|
||||||
* and clay together.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 21/12/2013
|
|
||||||
*/
|
|
||||||
public class MudPie extends PieRecipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the uncooked redberry pie.
|
|
||||||
*/
|
|
||||||
private static final Item UNCOOKED_PIE = new Item(7168);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the compost item.
|
|
||||||
*/
|
|
||||||
private static final Item COMPOST = new Item(6032);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the bucket of water item.
|
|
||||||
*/
|
|
||||||
private static final Item BUCKET_OF_WATER = new Item(1929);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the clay item.
|
|
||||||
*/
|
|
||||||
private static final Item CLAY = new Item(434);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the part one pie item.
|
|
||||||
*/
|
|
||||||
private static final Item PART_ONE = new Item(7164);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the part two pie item.
|
|
||||||
*/
|
|
||||||
private static final Item PART_TWO = new Item(7166);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return UNCOOKED_PIE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { COMPOST, BUCKET_OF_WATER, CLAY };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getParts() {
|
|
||||||
return new Item[] { PIE_SHELL, PART_ONE, PART_TWO, UNCOOKED_PIE };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSingular() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.pie.impl;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.pie.PieRecipe;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a redberry pie recipe.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 21/12/2013
|
|
||||||
*/
|
|
||||||
public class RedberryPie extends PieRecipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the uncooked redberry pie.
|
|
||||||
*/
|
|
||||||
private static final Item UNCOOKED_PIE = new Item(2321);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the redberries pie.
|
|
||||||
*/
|
|
||||||
private static final Item REDBERRIES = new Item(1951);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return UNCOOKED_PIE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { REDBERRIES };
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.pie.impl;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.pie.PieRecipe;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the summer pie recipe. This recipe consists of mixing stawberry,
|
|
||||||
* watermelon, and an apple.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 21/12/2013
|
|
||||||
*/
|
|
||||||
public class SummerPie extends PieRecipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the uncooked redberry pie.
|
|
||||||
*/
|
|
||||||
private static final Item UNCOOKED_PIE = new Item(7216);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the strawberry item.
|
|
||||||
*/
|
|
||||||
private static final Item STRAWBERRY = new Item(5504);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the watermelon item.
|
|
||||||
*/
|
|
||||||
private static final Item WATERMELON = new Item(5982);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the cooking apple item.
|
|
||||||
*/
|
|
||||||
private static final Item COOKING_APPLE = new Item(1955);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the part one pie item.
|
|
||||||
*/
|
|
||||||
private static final Item PART_ONE = new Item(7212);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the part two pie item.
|
|
||||||
*/
|
|
||||||
private static final Item PART_TWO = new Item(7214);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return UNCOOKED_PIE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { STRAWBERRY, WATERMELON, COOKING_APPLE };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getParts() {
|
|
||||||
return new Item[] { PIE_SHELL, PART_ONE, PART_TWO, UNCOOKED_PIE };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSingular() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.pie.impl;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.pie.PieRecipe;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the wild pie recipe. This recipe consists of mixing raw beat meat,
|
|
||||||
* raw chomp, and raw rabbit into a pie shell.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 21/12/2013
|
|
||||||
*/
|
|
||||||
public class WildPie extends PieRecipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the uncooked redberry pie.
|
|
||||||
*/
|
|
||||||
private static final Item UNCOOKED_PIE = new Item(7206);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the raw bear meat item.
|
|
||||||
*/
|
|
||||||
private static final Item BEAR_MEAT = new Item(2136);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the raw chompy meat item.
|
|
||||||
*/
|
|
||||||
private static final Item CHOMPY_MEAT = new Item(2876);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the raw rabbit meat item.
|
|
||||||
*/
|
|
||||||
private static final Item RABBIT_MEAT = new Item(3226);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the part one pie item.
|
|
||||||
*/
|
|
||||||
private static final Item PART_ONE = new Item(7202);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the part two pie item.
|
|
||||||
*/
|
|
||||||
private static final Item PART_TWO = new Item(7204);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return UNCOOKED_PIE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { BEAR_MEAT, CHOMPY_MEAT, RABBIT_MEAT };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getParts() {
|
|
||||||
return new Item[] { PIE_SHELL, PART_ONE, PART_TWO, UNCOOKED_PIE };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSingular() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.pizza;
|
|
||||||
|
|
||||||
import core.game.node.entity.skill.Skills;
|
|
||||||
import content.global.skill.cooking.recipe.Recipe;
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the generic recipe for a pizza.
|
|
||||||
* @author ceikry
|
|
||||||
*/
|
|
||||||
public abstract class PizzaRecipe extends Recipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the plain pizza.
|
|
||||||
*/
|
|
||||||
protected static final Item PLAIN_PIZZA = new Item(2289);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method used to get the experience gained from adding the final
|
|
||||||
* ingredient.
|
|
||||||
* @return the experience.
|
|
||||||
*/
|
|
||||||
public abstract double getExperience();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method used to get the level required.
|
|
||||||
* @return the level required.
|
|
||||||
*/
|
|
||||||
public abstract int getLevel();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mix(final Player player, final NodeUsageEvent event) {
|
|
||||||
if (player.getSkills().getLevel(Skills.COOKING) < getLevel()) {
|
|
||||||
player.getDialogueInterpreter().sendDialogue("You need a Cooking level of at least " + getLevel() + " in order to do this.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
super.singleMix(player, event);
|
|
||||||
player.getSkills().addExperience(Skills.COOKING, getExperience(), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getParts() {
|
|
||||||
return new Item[] {};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getBase() {
|
|
||||||
return PLAIN_PIZZA;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getMixMessage(final NodeUsageEvent event) {
|
|
||||||
return "You add " + event.getBaseItem().getName().toLowerCase() + " to the pizza.";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSingular() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.pizza.impl;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.pizza.PizzaRecipe;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the anchovy pizza. This recipe consists of adding anchovies to a
|
|
||||||
* plain pizza.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 22/12/2013
|
|
||||||
*/
|
|
||||||
public class AnchovyPizza extends PizzaRecipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the anchovy pizza item.
|
|
||||||
*/
|
|
||||||
private static final Item ANCHOVY_PIZZA = new Item(2297);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the anchovies item.
|
|
||||||
*/
|
|
||||||
private static final Item ANCHOVIES = new Item(319);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getExperience() {
|
|
||||||
return 39;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return ANCHOVY_PIZZA;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { ANCHOVIES };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getLevel() {
|
|
||||||
return 55;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.pizza.impl;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.pizza.PizzaRecipe;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the meat pizza recipe. This recipe consists of adding cooked meat
|
|
||||||
* to a plain pizza.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 22/12/2013
|
|
||||||
*/
|
|
||||||
public class MeatPizza extends PizzaRecipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the meat pizza item.
|
|
||||||
*/
|
|
||||||
private static final Item MEAT_PIZZA = new Item(2293);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the cooked meat item.
|
|
||||||
*/
|
|
||||||
private static final Item COOKED_MEAT = new Item(2142);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the cooked chicken item.
|
|
||||||
*/
|
|
||||||
private static final Item COOKED_CHICKEN = new Item(2140);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getExperience() {
|
|
||||||
return 26;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getLevel() {
|
|
||||||
return 45;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return MEAT_PIZZA;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { COOKED_MEAT, COOKED_CHICKEN };
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.pizza.impl;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.pizza.PizzaRecipe;
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the pineapple pizza recipe. This recipe consists of mixing either
|
|
||||||
* pineapple chunks or pineapple rings.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 22/12/2013
|
|
||||||
*/
|
|
||||||
public class PineapplePizza extends PizzaRecipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the pineapple pizza item.
|
|
||||||
*/
|
|
||||||
private static final Item PINEAPPLE_PIZZA = new Item(2301);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the pineapple ring item.
|
|
||||||
*/
|
|
||||||
private static final Item PINEAPPLE_RING = new Item(2118);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the pineapple chunk item.
|
|
||||||
*/
|
|
||||||
private static final Item PINEAPPLE_CHUNKS = new Item(2116);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getExperience() {
|
|
||||||
return 52;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getLevel() {
|
|
||||||
return 65;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return PINEAPPLE_PIZZA;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { PINEAPPLE_CHUNKS, PINEAPPLE_RING };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getMixMessage(NodeUsageEvent event) {
|
|
||||||
return "You add the " + event.getBaseItem().getName().toLowerCase() + " to the pizza.";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.pizza.impl;
|
|
||||||
|
|
||||||
import core.game.node.entity.skill.Skills;
|
|
||||||
import content.global.skill.cooking.recipe.Recipe;
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the plain pizza recipe. This recipe consists of mixing tomato, and
|
|
||||||
* cheese to a pizza base.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 22/12/2013
|
|
||||||
*/
|
|
||||||
public class PlainPizza extends Recipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the pizza base.
|
|
||||||
*/
|
|
||||||
private static final Item PIZZA_BASE = new Item(2283);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the uncooked pizza.
|
|
||||||
*/
|
|
||||||
private static final Item UNCOOKED_PIZZA = new Item(2287);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the incomplete pizza.
|
|
||||||
*/
|
|
||||||
private static final Item INCOMPLETE_PIZZA = new Item(2285);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the tomato ingredient item.
|
|
||||||
*/
|
|
||||||
private static final Item TOMATO = new Item(1982);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the cheese item.
|
|
||||||
*/
|
|
||||||
private static final Item CHEESE = new Item(1985);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mix(final Player player, final NodeUsageEvent event) {
|
|
||||||
if (player.getSkills().getLevel(Skills.COOKING) < 35) {
|
|
||||||
player.getDialogueInterpreter().sendDialogue("You need a Cooking level of at least " + 35 + " in order to do this.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
super.mix(player, event);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getBase() {
|
|
||||||
return PIZZA_BASE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return UNCOOKED_PIZZA;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { TOMATO, CHEESE };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getParts() {
|
|
||||||
return new Item[] { PIZZA_BASE, INCOMPLETE_PIZZA, UNCOOKED_PIZZA };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getMixMessage(NodeUsageEvent event) {
|
|
||||||
return "You add the " + event.getBaseItem().getName().toLowerCase() + " to the pizza.";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSingular() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,76 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.potato;
|
|
||||||
|
|
||||||
import core.game.node.entity.skill.Skills;
|
|
||||||
import content.global.skill.cooking.recipe.Recipe;
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a generic potato topping recipe.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 22/12/2013
|
|
||||||
*/
|
|
||||||
public abstract class PotatoRecipe extends Recipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the potato with butter.
|
|
||||||
*/
|
|
||||||
private static final Item POTATO_WITH_BUTTER = new Item(6703);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the bowl item.
|
|
||||||
*/
|
|
||||||
protected static final Item BOWL = new Item(1923);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mix(final Player player, final NodeUsageEvent event) {
|
|
||||||
if (player.getSkills().getLevel(Skills.COOKING) < getLevel()) {
|
|
||||||
player.getDialogueInterpreter().sendDialogue("You need a Cooking level of at least " + getLevel() + " in order to do this.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
super.singleMix(player, event);
|
|
||||||
if (isTopping()) {
|
|
||||||
player.getInventory().add(BOWL);
|
|
||||||
}
|
|
||||||
player.getSkills().addExperience(Skills.COOKING, getExperience(), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getBase() {
|
|
||||||
return POTATO_WITH_BUTTER;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getParts() {
|
|
||||||
return new Item[] {};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getMixMessage(NodeUsageEvent event) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSingular() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method used to check if it is a topping recipe.
|
|
||||||
* @return <code>True</code> if it is a topping.
|
|
||||||
*/
|
|
||||||
public abstract boolean isTopping();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method used to get the level required.
|
|
||||||
* @return the level.
|
|
||||||
*/
|
|
||||||
public abstract int getLevel();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method used to get the experience gained.
|
|
||||||
* @return the experience.
|
|
||||||
*/
|
|
||||||
public abstract double getExperience();
|
|
||||||
}
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.potato.impl;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.Recipe;
|
|
||||||
import core.game.node.entity.skill.Skills;
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the butter potato recipe. This recipe consists of adding a pat of
|
|
||||||
* butter to a potato.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 22/12/2013
|
|
||||||
*/
|
|
||||||
public class ButterPotato extends Recipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the baked potato.
|
|
||||||
*/
|
|
||||||
private static final Item BAKED_POTATO = new Item(6701);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the potato with butter.
|
|
||||||
*/
|
|
||||||
private static final Item POTATO_WITH_BUTTER = new Item(6703);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the pat of butter.
|
|
||||||
*/
|
|
||||||
private static final Item PAT_OF_BUTTER = new Item(6697);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mix(final Player player, final NodeUsageEvent event) {
|
|
||||||
if (player.getSkills().getLevel(Skills.COOKING) < 39) {
|
|
||||||
player.getDialogueInterpreter().sendDialogue("You need a Cooking level of at least " + 39 + " in order to do this.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
super.singleMix(player, event);
|
|
||||||
player.getSkills().addExperience(Skills.COOKING, 40.5, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getBase() {
|
|
||||||
return BAKED_POTATO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return POTATO_WITH_BUTTER;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { PAT_OF_BUTTER };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getParts() {
|
|
||||||
return new Item[] {};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getMixMessage(NodeUsageEvent event) {
|
|
||||||
return "You add a pat of butter to the potato.";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSingular() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.potato.impl;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.potato.PotatoRecipe;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the cheese potato. This recipe consists of mixing cheese witha
|
|
||||||
* baked potato.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 22/12/2013
|
|
||||||
*/
|
|
||||||
public class CheesePotato extends PotatoRecipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the cheese potato.
|
|
||||||
*/
|
|
||||||
private static final Item CHEESE_POTATO = new Item(6705);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the cheese item.
|
|
||||||
*/
|
|
||||||
private static final Item CHEESE = new Item(1985);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return CHEESE_POTATO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { CHEESE };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isTopping() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getLevel() {
|
|
||||||
return 47;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getExperience() {
|
|
||||||
return 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.potato.impl;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.potato.PotatoRecipe;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the chilli potato recipe. This recipe consists of adding chilli
|
|
||||||
* con carne to a baked butter potato.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 22/12/2013
|
|
||||||
*/
|
|
||||||
public class ChilliPotato extends PotatoRecipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the chilli potato item.
|
|
||||||
*/
|
|
||||||
private static final Item CHILLI_POTATO = new Item(7054);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the chilli con carne item/
|
|
||||||
*/
|
|
||||||
private static final Item CHILLI_CON_CARNE = new Item(7062);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return CHILLI_POTATO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { CHILLI_CON_CARNE };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isTopping() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getLevel() {
|
|
||||||
return 41;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getExperience() {
|
|
||||||
return 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.potato.impl;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.potato.PotatoRecipe;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the egg potato recipe. This recipe consists of mixing a egg and a
|
|
||||||
* tomato.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 22/12/2013
|
|
||||||
*/
|
|
||||||
public class EggPotato extends PotatoRecipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the egg potato.
|
|
||||||
*/
|
|
||||||
private static final Item EGG_POTATO = new Item(7056);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the topping item.
|
|
||||||
*/
|
|
||||||
private static final Item TOPPING = new Item(7064);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return EGG_POTATO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { TOPPING };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isTopping() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getLevel() {
|
|
||||||
return 51;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getExperience() {
|
|
||||||
return 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.potato.impl;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.potato.PotatoRecipe;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the mushrrom potato. This recipe consists of mixing a baked potato
|
|
||||||
* with mushroom and onion toppings.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 22/12/2013
|
|
||||||
*/
|
|
||||||
public class MushroomPotato extends PotatoRecipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the egg potato.
|
|
||||||
*/
|
|
||||||
private static final Item MUSHROOM_POTATO = new Item(7058);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the topping item.
|
|
||||||
*/
|
|
||||||
private static final Item TOPPING = new Item(7066);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return MUSHROOM_POTATO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { TOPPING };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isTopping() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getLevel() {
|
|
||||||
return 64;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getExperience() {
|
|
||||||
return 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.potato.impl;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.potato.PotatoRecipe;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the tuna potato recipe. This recipe consists of mixing tuna and
|
|
||||||
* corn toppings.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 22/12/2013
|
|
||||||
*/
|
|
||||||
public class TunaPotato extends PotatoRecipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the tuna potato.
|
|
||||||
*/
|
|
||||||
private static final Item TUNA_POTATO = new Item(7060);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the topping item.
|
|
||||||
*/
|
|
||||||
private static final Item TOPPING = new Item(7068);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return TUNA_POTATO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { TOPPING };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isTopping() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getLevel() {
|
|
||||||
return 68;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getExperience() {
|
|
||||||
return 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.stew;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.Recipe;
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the curry recipe. This recipe consists of mixing 3 curry leaves or
|
|
||||||
* a spice into a stew.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 22/12/2013
|
|
||||||
*/
|
|
||||||
public class CurryRecipe extends Recipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the uncooked curry item.
|
|
||||||
*/
|
|
||||||
private static final Item UNCOOKED_CURRY = new Item(2009);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the uncooked stew item.
|
|
||||||
*/
|
|
||||||
private static final Item UNCOOKED_STEW = new Item(2001);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the spice item.
|
|
||||||
*/
|
|
||||||
private static final Item SPICE = new Item(2007);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the curry leaf.
|
|
||||||
*/
|
|
||||||
private static final Item CURRY_LEAF = new Item(5970);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mix(Player player, NodeUsageEvent event) {
|
|
||||||
if (event.getBaseItem().getId() == CURRY_LEAF.getId() || event.getUsedItem().getId() == CURRY_LEAF.getId()) {
|
|
||||||
Item stew = event.getBaseItem().getId() == UNCOOKED_STEW.getId() ? event.getBaseItem() : event.getUsedItem();
|
|
||||||
if (stew.getCharge() == 1000) {
|
|
||||||
stew.setCharge(1);
|
|
||||||
}
|
|
||||||
int charge = stew.getCharge();
|
|
||||||
if (charge < 3) {
|
|
||||||
player.getInventory().remove(CURRY_LEAF);
|
|
||||||
stew.setCharge(charge + 1);
|
|
||||||
} else {
|
|
||||||
if (player.getInventory().remove(stew) && player.getInventory().remove(CURRY_LEAF)) {
|
|
||||||
player.getInventory().add(UNCOOKED_CURRY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (player.getInventory().remove(event.getBaseItem()) && player.getInventory().remove(event.getUsedItem())) {
|
|
||||||
player.getInventory().add(getProduct());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getBase() {
|
|
||||||
return UNCOOKED_STEW;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return UNCOOKED_CURRY;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { SPICE, CURRY_LEAF };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getParts() {
|
|
||||||
return new Item[] { UNCOOKED_STEW };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getMixMessage(NodeUsageEvent event) {
|
|
||||||
return "You mix the spice with the stew.";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSingular() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,92 +0,0 @@
|
||||||
package content.global.skill.cooking.recipe.stew;
|
|
||||||
|
|
||||||
import content.global.skill.cooking.recipe.Recipe;
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the stew recipe. This recipe consists of mixing meat and a raw
|
|
||||||
* potato in a bowl of water.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @date 22/12/2013
|
|
||||||
*/
|
|
||||||
public class StewRecipe extends Recipe {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the uncooked stew item.
|
|
||||||
*/
|
|
||||||
private static final Item UNCOOKED_STEW = new Item(2001);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the bowl of water item.
|
|
||||||
*/
|
|
||||||
private static final Item BOWL_OF_WATER = new Item(1921);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the meat item.
|
|
||||||
*/
|
|
||||||
private static final Item MEAT = new Item(2142);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the potato item.
|
|
||||||
*/
|
|
||||||
private static final Item POTATO = new Item(1942);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the incomplete stew.
|
|
||||||
*/
|
|
||||||
private static final Item INCOMPLETE_STEW = new Item(1997);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the second incomplete stew.
|
|
||||||
*/
|
|
||||||
private static final Item INCOMPLETE_STEW2 = new Item(1999);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mix(Player player, NodeUsageEvent event) {
|
|
||||||
Item first = event.getUsedItem();
|
|
||||||
Item second = event.getBaseItem();
|
|
||||||
if(first != null && second != null) {
|
|
||||||
if (player.getInventory().remove(first) && player.getInventory().remove(second)) {
|
|
||||||
if (first.getId() == BOWL_OF_WATER.getId() || second.getId() == BOWL_OF_WATER.getId()) {
|
|
||||||
player.getInventory().add(first.getId() == POTATO.getId() ? INCOMPLETE_STEW : first.getId() == MEAT.getId() ? INCOMPLETE_STEW2 : second.getId() == POTATO.getId() ? INCOMPLETE_STEW : second.getId() == MEAT.getId() ? INCOMPLETE_STEW2 : null);
|
|
||||||
} else {
|
|
||||||
player.getInventory().add(UNCOOKED_STEW);
|
|
||||||
}
|
|
||||||
player.getPacketDispatch().sendMessage(getMixMessage(event));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getBase() {
|
|
||||||
return BOWL_OF_WATER;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getProduct() {
|
|
||||||
return UNCOOKED_STEW;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getIngredients() {
|
|
||||||
return new Item[] { MEAT, POTATO, MEAT, POTATO };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item[] getParts() {
|
|
||||||
return new Item[] { BOWL_OF_WATER, BOWL_OF_WATER, INCOMPLETE_STEW, INCOMPLETE_STEW2 };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getMixMessage(NodeUsageEvent event) {
|
|
||||||
return "You cut up the " + (event.getUsedItem().getName().toLowerCase().contains("incomplete") ? event.getBaseItem().getName().toLowerCase() : event.getUsedItem().getName().toLowerCase().replace("cooked", "").trim()) + " and put it into the stew.";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSingular() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue