Search in sources :

Example 6 with QuestParticipant

use of xyz.derkades.ublisk.quest.QuestParticipant in project Ublisk by Derkades.

the class Rasmus method hayTransportation.

private void hayTransportation(UPlayer player) {
    QuestParticipant qp = player.getQuestParticipant(Quest.HAY_TRANSPORT, this);
    qp.sendMessage("I see you have fixed the water issue, well done! Can you maybe help me too? There is a big pile of hay that needs to be transported to a cart just outside of Glaenor. You should give it to Zoltar, he\'ll pay you for the job.");
    if (!qp.getProgress(QuestProgress.HAY_TRANSPORT_STARTED))
        qp.saveProgress(QuestProgress.HAY_TRANSPORT_STARTED);
// TODO Item for breaking hay
}
Also used : QuestParticipant(xyz.derkades.ublisk.quest.QuestParticipant)

Example 7 with QuestParticipant

use of xyz.derkades.ublisk.quest.QuestParticipant in project Ublisk by Derkades.

the class Rasmus method chickenHunt.

private void chickenHunt(UPlayer player) {
    QuestParticipant qp = player.getQuestParticipant(Quest.CHICKEN_HUNT, this);
    UInventory inv = qp.getInventory();
    if (!qp.hasRequiredLevel()) {
        qp.sendMessage(Message.QUEST_LOW_LEVEL);
        return;
    }
    if (qp.getQuestCompleted()) {
    // TODO Message if player has completed quest
    } else if (qp.getProgress(QuestProgress.CHICKEN_HUNT_TALK_TO_ARZHUR) && inv.contains(Material.FEATHER, 15)) {
        qp.sendMessage("Thanks for helping! Here is some money for your hard work. By the way, you can keep the {something}");
        qp.giveRewardExp();
        qp.sendCompletedMessage();
        qp.setQuestCompleted(true);
    } else if (qp.getProgress(QuestProgress.CHICKEN_HUNT_TALK_TO_ARZHUR)) {
    // TODO Message for chicken hunt quest
    } else {
        qp.sendMessage("Hi again. Have you noticed all these monsters eating our crops! Can you kill these monsters for me? Go to Arzhur, he probably has a tool for you that will help you!");
        qp.saveProgress(QuestProgress.CHICKENHUNT_TALK_TO_RASMUS);
    }
}
Also used : QuestParticipant(xyz.derkades.ublisk.quest.QuestParticipant) UInventory(xyz.derkades.ublisk.utils.inventory.UInventory)

Example 8 with QuestParticipant

use of xyz.derkades.ublisk.quest.QuestParticipant in project Ublisk by Derkades.

the class Alvin method talk.

@Override
public void talk(UPlayer player) {
    QuestParticipant qp = player.getQuestParticipant(Quest.WATER_PROBLEM, this);
    UInventory inv = qp.getInventory();
    if (qp.getQuestCompleted()) {
        qp.sendMessage("I'm looking for the biggest rose in the world!");
        return;
    }
    if (qp.getProgress(QuestProgress.DAM_REPORTED_BACK) && inv.contains(Material.LOG, 5)) {
        // If the player has 5 wood logs (last step)
        qp.sendMessage("This will do the trick!");
        // Remove the 5 wood logs
        inv.remove(Material.LOG, 5);
        // Send a message
        qp.sendCompletedMessage();
        // Give reward experience
        qp.giveRewardExp();
        // Set the quest as completed for this player
        qp.setQuestCompleted(true);
        return;
    }
    if (qp.getProgress(QuestProgress.CHECKED_DAM)) {
        qp.sendMessage("You should go to back to Gleanor and tell them this dam is broken right now!");
        return;
    }
    if (!qp.getProgress(QuestProgress.DAM_FIRST_TALK)) {
        qp.sendMessage("I'm looking for the biggest rose in the world!");
        return;
    }
    qp.sendMessage("HELP! I don't know what to do! Everything will be underwater! Please save us! ");
    qp.saveProgress(QuestProgress.CHECKED_DAM);
}
Also used : QuestParticipant(xyz.derkades.ublisk.quest.QuestParticipant) UInventory(xyz.derkades.ublisk.utils.inventory.UInventory)

Example 9 with QuestParticipant

use of xyz.derkades.ublisk.quest.QuestParticipant in project Ublisk by Derkades.

the class Arzhur method chickenHunt.

private void chickenHunt(UPlayer player) {
    QuestParticipant qp = player.getQuestParticipant(Quest.CHICKEN_HUNT, this);
    if (qp.getProgress(QuestProgress.CHICKENHUNT_TALK_TO_RASMUS)) {
        qp.sendMessage("You were sent by Rasmus, weren't you? That old man always bothers himself of the so called monsters in his farm. Just between you and me, he has gotten a little crazy over the last few years and now thinks that the chickens in his farm are monsters! Here take this. It will help you to scare those chickens away.");
        qp.saveProgress(QuestProgress.CHICKEN_HUNT_TALK_TO_ARZHUR);
    } else {
        qp.sendMessage("Thank you for fixing up the dam!");
    }
}
Also used : QuestParticipant(xyz.derkades.ublisk.quest.QuestParticipant)

Example 10 with QuestParticipant

use of xyz.derkades.ublisk.quest.QuestParticipant in project Ublisk by Derkades.

the class Arzhur method searchMeat.

private void searchMeat(UPlayer player) {
    QuestParticipant qp = player.getQuestParticipant(Quest.SEARCH_MEAT, this);
    UInventory inv = qp.getInventory();
    if (inv.contains(Material.GRILLED_PORK, 10)) {
        qp.sendMessage("Thank you very much for helping us. We will be alright for a while! Here is something that will help you survive in the fields.");
        inv.remove(Material.GRILLED_PORK, 10);
        qp.setLifeCrystals(qp.getLifeCrystals() + 5);
        qp.setQuestCompleted(true);
        qp.sendCompletedMessage();
        qp.giveRewardExp();
    } else {
        qp.sendMessage("We are having a shortage of food here in town. Meat in particular. can you maybe go and get some Zombie Flesh by slaying some Zombies at the Ruins. Go to Dianh, she can purify the meat so we can eat it.");
        qp.saveProgress(QuestProgress.SEARCH_FOR_MEAT_TALK_TO_ARZHUR);
    }
}
Also used : QuestParticipant(xyz.derkades.ublisk.quest.QuestParticipant) UInventory(xyz.derkades.ublisk.utils.inventory.UInventory)

Aggregations

QuestParticipant (xyz.derkades.ublisk.quest.QuestParticipant)11 UInventory (xyz.derkades.ublisk.utils.inventory.UInventory)5 ItemBuilder (xyz.derkades.derkutils.bukkit.ItemBuilder)1 Town (xyz.derkades.ublisk.Town)1 MoneyItem (xyz.derkades.ublisk.money.MoneyItem)1 NPCMenu (xyz.derkades.ublisk.quest.npcmenu.NPCMenu)1 Item (xyz.derkades.ublisk.utils.inventory.Item)1