Search in sources :

Example 6 with UInventory

use of xyz.derkades.ublisk.utils.inventory.UInventory 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 7 with UInventory

use of xyz.derkades.ublisk.utils.inventory.UInventory 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 8 with UInventory

use of xyz.derkades.ublisk.utils.inventory.UInventory 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

UInventory (xyz.derkades.ublisk.utils.inventory.UInventory)8 QuestParticipant (xyz.derkades.ublisk.quest.QuestParticipant)5 UPlayer (xyz.derkades.ublisk.utils.UPlayer)2 Item (xyz.derkades.ublisk.utils.inventory.Item)2 Material (org.bukkit.Material)1 EventHandler (org.bukkit.event.EventHandler)1 Action (org.bukkit.event.block.Action)1 MainMenu (xyz.derkades.ublisk.iconmenus.MainMenu)1 MoneyItem (xyz.derkades.ublisk.money.MoneyItem)1 CustomItem (xyz.derkades.ublisk.utils.inventory.CustomItem)1