/
DemoQuest.java
89 lines (74 loc) · 2.38 KB
/
DemoQuest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package com.rs.content.quests.impl;
import com.rs.constants.ItemNames;
import com.rs.content.quests.Quest;
import com.rs.content.quests.QuestAttribute;
import com.rs.game.item.Item;
import com.rs.game.map.GameObject;
import com.rs.game.npc.NPC;
import com.rs.game.player.Player;
import skills.Skills;
public class DemoQuest extends Quest {
@Override
public String getName() {
return "Test Quest";
}
@Override
public String[] getReward() {
return new String[] {"Nothing, it's over!"};
}
@Override
public int getComponentId() {
return 0;
}
@Override
public String[] getInformation(Player player) {
if (!startedQuest(player))
return new String[]{"You have not yet started this quest!", "This is just a demo class & quest text", "This is just a demo class & quest text", "This is just a demo class & quest text", "This is just a demo class & quest text", "This is just a demo class & quest text", "This is just a demo class & quest text", "This is just a demo class & quest text"};
switch (getQuestStage(player)) {
case 1:
return new String[]{"I should talk to the Lumbridge Cook firstly."};
case 2:
return new String[]{"I have completed the quest: " + getName()};
default:
return new String[]{};
}
}
@Override
public void addRequirements(Player player) {
addQuestRequirement(new QuestAttribute("I must have at least 50 Cooking", player.getSkills().getLevel(Skills.COOKING) >= 50, false));
addQuestRequirement(new QuestAttribute("I must be willing to take damage when passing by monsters", true, true));
}
@Override
public int rewardItemForDisplay() {
return ItemNames.CAKE_1891;
}
@Override
public int questPointReward() {
return 1;
}
@Override
public boolean handleDroppedItem(Player player, Item item) {
return false;
}
/* NOTE:
* If you want you can use this method of interactions for npcs/object
* or utilize the plugin classes. These are optonal boolean methods. Yo dont need
* them if you use the Plugin system.
*/
@Override
public boolean handleNPC(Player player, NPC npc, int option) {
if (npc.getId() == 0) {
npc.doAction(option, "Talk-to", () -> {
});
}
return false;
}
@Override
public boolean handleObject(Player player, GameObject object) {
return false;
}
@Override
public int stageCount() {
return 2;
}
}