diff --git a/src/main/java/noppes/npcs/ServerEventsHandler.java b/src/main/java/noppes/npcs/ServerEventsHandler.java index b907632b8..54dc12f12 100644 --- a/src/main/java/noppes/npcs/ServerEventsHandler.java +++ b/src/main/java/noppes/npcs/ServerEventsHandler.java @@ -341,19 +341,18 @@ public class ServerEventsHandler { if (data.quest.type != EnumQuestType.Kill && data.quest.type != EnumQuestType.AreaKill) continue; -// Disable Area Kill for Party -// if (data.quest.type == EnumQuestType.AreaKill && all) { -// List list = player.worldObj.getEntitiesWithinAABB(EntityPlayer.class, entity.boundingBox.expand(10, 10, 10)); -// for (EntityPlayer pl : list) { -// if (pl != player) { -// if(party == null){ -// doQuest(pl, entity, false); -// } else if(!party.hasPlayer(pl.getUniqueID())){ -// doQuest(pl, entity, false); -// } -// } -// } -// } + if (data.quest.type == EnumQuestType.AreaKill && all) { + List list = player.worldObj.getEntitiesWithinAABB(EntityPlayer.class, entity.boundingBox.expand(10, 10, 10)); + for (EntityPlayer pl : list) { + if (pl != player) { + if(party == null){ + doQuest(pl, entity, false); + } else if(!party.hasPlayer(pl.getUniqueID())){ + doQuest(pl, entity, false); + } + } + } + } String name = entityName; QuestKill quest = (QuestKill) data.quest.questInterface; diff --git a/src/main/java/noppes/npcs/constants/EnumPartyObjectives.java b/src/main/java/noppes/npcs/constants/EnumPartyObjectives.java index 3367800cf..a8ec9c8a7 100644 --- a/src/main/java/noppes/npcs/constants/EnumPartyObjectives.java +++ b/src/main/java/noppes/npcs/constants/EnumPartyObjectives.java @@ -7,7 +7,7 @@ public enum EnumPartyObjectives { All("party.all"), Leader("party.leader"); - String name; + final String name; EnumPartyObjectives(String name){ this.name = name; diff --git a/src/main/java/noppes/npcs/quests/QuestInterface.java b/src/main/java/noppes/npcs/quests/QuestInterface.java index b3848967e..1fa44ce11 100644 --- a/src/main/java/noppes/npcs/quests/QuestInterface.java +++ b/src/main/java/noppes/npcs/quests/QuestInterface.java @@ -27,6 +27,8 @@ public abstract class QuestInterface implements IQuestInterface { public abstract Vector getQuestLogStatus(EntityPlayer player); public abstract IQuestObjective[] getObjectives(EntityPlayer var1); + + // Party Related public abstract IQuestObjective[] getPartyObjectives(Party party); public abstract Vector getPartyQuestLogStatus(Party party); diff --git a/src/main/java/noppes/npcs/quests/QuestKill.java b/src/main/java/noppes/npcs/quests/QuestKill.java index 665d28053..c3b50eb0b 100644 --- a/src/main/java/noppes/npcs/quests/QuestKill.java +++ b/src/main/java/noppes/npcs/quests/QuestKill.java @@ -24,7 +24,6 @@ public class QuestKill extends QuestInterface implements IQuestKill { @Override public void writeEntityToNBT(NBTTagCompound compound) { compound.setTag("QuestKills", NBTTags.nbtStringIntegerMap(targets)); - //compound.setTag("QuestDialogs", NBTTags.nbtStringIntegerMap(targets)); compound.setInteger("TargetType",targetType); compound.setString("CustomTargetType",customTargetType); } @@ -38,9 +37,7 @@ public class QuestKill extends QuestInterface implements IQuestKill { } else { targets = NBTTags.getStringIntegerMap(compound.getTagList("QuestKills", 10)); } - - //targets = NBTTags.getStringIntegerMap(compound.getTagList("QuestDialogs", 10)); - targetType = compound.getInteger("TargetType"); + targetType = compound.getInteger("TargetType"); customTargetType = compound.getString("CustomTargetType"); } diff --git a/src/main/java/noppes/npcs/quests/QuestLocation.java b/src/main/java/noppes/npcs/quests/QuestLocation.java index 76939541f..beadecb4d 100644 --- a/src/main/java/noppes/npcs/quests/QuestLocation.java +++ b/src/main/java/noppes/npcs/quests/QuestLocation.java @@ -70,6 +70,24 @@ public class QuestLocation extends QuestInterface implements IQuestLocation { return vec; } + @Override + public IQuestObjective[] getObjectives(EntityPlayer player) { + List list = new ArrayList(); + if (!this.location.isEmpty()) { + list.add(new noppes.npcs.quests.QuestLocation.QuestLocationObjective(this, player, this.location, "LocationFound")); + } + + if (!this.location2.isEmpty()) { + list.add(new noppes.npcs.quests.QuestLocation.QuestLocationObjective(this, player, this.location2, "Location2Found")); + } + + if (!this.location3.isEmpty()) { + list.add(new noppes.npcs.quests.QuestLocation.QuestLocationObjective(this, player, this.location3, "Location3Found")); + } + + return (IQuestObjective[])list.toArray(new IQuestObjective[list.size()]); + } + public boolean getFound(QuestData data, int i) { if(i == 1) return data.extraData.getBoolean("LocationFound"); @@ -190,23 +208,7 @@ public class QuestLocation extends QuestInterface implements IQuestLocation { return newFind; } - public IQuestObjective[] getObjectives(EntityPlayer player) { - List list = new ArrayList(); - if (!this.location.isEmpty()) { - list.add(new noppes.npcs.quests.QuestLocation.QuestLocationObjective(this, player, this.location, "LocationFound")); - } - - if (!this.location2.isEmpty()) { - list.add(new noppes.npcs.quests.QuestLocation.QuestLocationObjective(this, player, this.location2, "Location2Found")); - } - - if (!this.location3.isEmpty()) { - list.add(new noppes.npcs.quests.QuestLocation.QuestLocationObjective(this, player, this.location3, "Location3Found")); - } - - return (IQuestObjective[])list.toArray(new IQuestObjective[list.size()]); - } - + @Override public IQuestObjective[] getPartyObjectives(Party party) { List list = new ArrayList(); if (!this.location.isEmpty()) {