Unstable commit (unfinished)

This commit is contained in:
Blackvein 2012-10-11 07:26:13 -07:00
parent 35244379a5
commit d1c7a169e6
2 changed files with 33 additions and 26 deletions

View File

@ -73,16 +73,22 @@ public class PlayerListener implements Listener {
quester.currentStage = q.stages.getFirst();
quester.addEmpties();
quester.isTalking = false;
if(q.moneyReq > 0){
if (q.moneyReq > 0) {
Quests.economy.withdrawPlayer(quester.name, q.moneyReq);
}
player.sendMessage(ChatColor.GREEN + "Quest accepted: " + q.name);
player.sendMessage("");
player.sendMessage(ChatColor.GOLD + "---(Objectives)---");
for(String s : quester.getObjectives()){
player.sendMessage(s);
for(int i : q.itemIds){
if (q.removeItems.get(q.itemIds.indexOf(i)) == true)
Quests.removeItem(player.getInventory(), Material.getMaterial(i), q.itemAmounts.get(q.itemIds.indexOf(i)));
}
player.sendMessage(ChatColor.GREEN + "Quest accepted: " + q.name);
player.sendMessage("");
player.sendMessage(ChatColor.GOLD + "---(Objectives)---");
for (String s : quester.getObjectives()) {
player.sendMessage(s);
}
}else {
player.sendMessage(q.failRequirements);

View File

@ -578,8 +578,9 @@ public class Quests extends JavaPlugin {
}
for(int i : quest.itemIds){
if (quest.removeItems.get(quest.itemIds.indexOf(i)) == true)
if (quest.removeItems.get(quest.itemIds.indexOf(i)) == true){
removeItem(((Player) sender).getInventory(), Material.getMaterial(i), quest.itemAmounts.get(quest.itemIds.indexOf(i)));
}
}
sender.sendMessage(ChatColor.GREEN + "Quest accepted: " + quest.name);