use of xyz.derkades.ublisk.quest.QuestParticipant in project Ublisk by Derkades.
the class Arzhur method waterProblem.
private void waterProblem(UPlayer player) {
QuestParticipant qp = player.getQuestParticipant(Quest.WATER_PROBLEM, this);
if (qp.getProgress(QuestProgress.CHECKED_DAM)) {
// If the player has checked the dam
qp.sendMessage("Oh no, we must fix the dam before it completely breaks. You should collect some wood from the saw and bring it to Alvin.");
qp.saveProgress(QuestProgress.DAM_REPORTED_BACK);
} else {
// If neither of the above are true
qp.sendMessage("People from the village have been complaining about an excessive amount of water, can you go and check the Glaenor Dam?");
if (!qp.getProgress(QuestProgress.DAM_FIRST_TALK))
qp.saveProgress(QuestProgress.DAM_FIRST_TALK);
}
}
use of xyz.derkades.ublisk.quest.QuestParticipant in project Ublisk by Derkades.
the class Roy method talk.
@Override
public void talk(UPlayer player) {
QuestParticipant qp = player.getQuestParticipant(Quest.UNKNOWN, this);
qp.sendMessage("Hoi " + player.getName() + ", ik ben Roy");
Town town = player.getLastTown();
String townNaam = town.getName();
qp.sendMessage("Je bent in: " + townNaam);
}
use of xyz.derkades.ublisk.quest.QuestParticipant in project Ublisk by Derkades.
the class TestNPC method talk.
@Override
public void talk(UPlayer player) {
final QuestParticipant qp = player.getQuestParticipant(Quest.UNKNOWN, this);
/*ClickAction action = new ClickAction(){
@Override
public void click(ClickedOption option) {
qp.sendMessage("TEST!");
}
};*/
// Option option1 = new Option(10, Material.STONE, "Some random option", "Some lore!", "Line 2");
// Option option2 = new Option(11, Material.WOOD, "Option without lore");
// qp.openMenu(new NPCMenu("Test Menu", action, option1, option2));
new NPCMenu("Test Menu", 3 * 9, qp) {
@Override
public void open() {
items.put(10, new ItemBuilder(Material.STONE).name("Some random option").lore("Some lore!", "Lines 2").create());
items.put(11, new ItemBuilder(Material.WOOD).name("Option without lore").create());
super.open();
}
@Override
public boolean onOptionClick(OptionClickEvent event) {
qp.sendMessage("TEST!");
return false;
}
}.open();
}
use of xyz.derkades.ublisk.quest.QuestParticipant in project Ublisk by Derkades.
the class Zoltar method talk.
@Override
public void talk(UPlayer player) {
QuestParticipant qp = player.getQuestParticipant(Quest.HAY_TRANSPORT, this);
UInventory inv = qp.getInventory();
if (qp.getProgress(QuestProgress.HAY_TRANSPORT_STARTED) && inv.contains(Material.HAY_BLOCK, 10)) {
inv.remove(Material.HAY_BLOCK, 10);
qp.sendMessage("There you are! That took you a while, didn't it? Anyway, thanks for helping.");
// Send a message
qp.sendCompletedMessage();
// Give reward experience
qp.giveRewardExp();
// Set the quest as completed for this player
qp.setQuestCompleted(true);
qp.sendMessage("Hold on! If you ever need to sell something, come to me I am always here to buy your goodies.");
} else {
qp.sendMessage("Hello, I'm the junk merchant.");
}
}
use of xyz.derkades.ublisk.quest.QuestParticipant in project Ublisk by Derkades.
the class Merek method talk.
@Override
public void talk(UPlayer player) {
QuestParticipant qp = player.getQuestParticipant(Quest.INTRODUCTION, this);
UInventory inv = qp.getInventory();
if (inv.containsItems(new Item(Material.LOG, 10), new Item(Material.STRING, 16), new MoneyItem(MoneyItem.Type.DUST).setAmount(10))) {
qp.sendMessage("Great! Now go to Ulric to craft a weapon.");
} else if (inv.containsItems(new Item(Material.STRING, 16), new MoneyItem(MoneyItem.Type.DUST).setAmount(10))) {
qp.sendMessage("Finally get 10 wood logs at the saw");
} else if (inv.containsItems(new Item(Material.WOOL, 4), new MoneyItem(MoneyItem.Type.DUST).setAmount(10))) {
qp.sendMessage("Great job, now please break down your wool into 16 string by using the windmill.");
} else if (inv.contains(Material.GOLD_NUGGET, 10)) {
qp.sendMessage("Now bring me 4 wool by killing sheep.");
} else {
qp.sendMessage("What are you doing out here? You don't even have a weapon yet! I'll tell you what you'll need to make a weapon. First, get 10 gold dust by killing animals.");
}
}
Aggregations