@@ -0,0 +1,3319 @@
+package com.elmakers.mine.bukkit.magicquests;%0A%0Aimport com.elmakers.mine.bukkit.api.entity.EntityData;%0Aimport com.elmakers.mine.bukkit.api.event.MagicMobDeathEvent;%0Aimport com.elmakers.mine.bukkit.api.magic.Mage;%0Aimport me.blackvein.quests.CustomObjective;%0Aimport me.blackvein.quests.Quest;%0Aimport me.blackvein.quests.Quester;%0Aimport me.blackvein.quests.Quests;%0Aimport org.bukkit.ChatColor;%0Aimport org.bukkit.entity.Player;%0Aimport org.bukkit.event.EventHandler;%0A%0Aimport java.util.Map;%0A%0Apublic class MagicMobKillObjective extends CustomObjective %7B%0A%0A    public MagicMobKillObjective() %7B%0A        this.setName(%22Kill Magic Mob%22);%0A        this.setAuthor(%22NathanWolf%22);%0A        this.setEnableCount(true);%0A        this.setShowCount(true);%0A        this.addData(%22Mob%22);%0A        this.setCountPrompt(%22Enter the number of times the player must kill this mob:%22);%0A        this.addDescription(%22Mob%22, %22The name or key of the Magic Mob the player must kill.%22);%0A        this.setDisplay(%22Kill %25Mob%25: %25count%25%22);%0A    %7D%0A%0A    @EventHandler%0A    public void onMagicMobKill(MagicMobDeathEvent event) %7B%0A        Player player = event.getPlayer();%0A        Mage mage = event.getMage();%0A        if (player == null %7C%7C mage == null) %7B%0A            return;%0A        %7D%0A        %0A        // This fails in a pretty bad way if the player is not on a quest currently%0A        // There isn't a super clean way to check for this state so we'll just catch%0A        // and ignore expections :%5C%0A        Quester quester = Quests.getInstance().getQuester(player.getUniqueId());%0A        if (quester == null) %7B%0A            return;%0A        %7D%0A%0A        boolean isDebug = mage.getDebugLevel() %3E 0;%0A%0A        EntityData entityData = event.getEntityData();%0A        %0A        if (isDebug) mage.sendDebugMessage(ChatColor.BLUE + %22Checking mob kill objective for %22 + ChatColor.GOLD + entityData.describe() +%0A                ChatColor.BLUE + %22 with %22 + ChatColor.YELLOW + quester.currentQuests.size() +%0A                ChatColor.BLUE + %22 active quests%22, 5);%0A%0A        for (Quest quest : quester.currentQuests.keySet()) %7B%0A            Map%3CString, Object%3E map = null;%0A            try %7B%0A                map = getDatamap(player, this, quest);%0A            %7D catch (Exception ex) %7B%0A                map = null;%0A            %7D%0A            if (map == null) %7B%0A                if (isDebug) mage.sendDebugMessage(ChatColor.DARK_RED + %22No active data for this objective for quest: %22 + ChatColor.GOLD + quest.getName(), 7);%0A                continue;%0A            %7D%0A%0A            String mobName = (String)map.get(%22Mob%22);%0A            if (mobName == null) %7B%0A                if (isDebug) mage.sendDebugMessage(ChatColor.DARK_RED + %22No active Mob data for this objective for quest: %22 + ChatColor.GOLD + quest.getName(), 7);%0A                continue;%0A            %7D%0A%0A            if (isDebug) mage.sendDebugMessage(ChatColor.BLUE + %22Checking : %22 + ChatColor.GOLD +%0A                    quest.getName() + ChatColor.BLUE + %22 looking for %22 + ChatColor.YELLOW + mobName, 7);%0A%0A            if (!mobName.equalsIgnoreCase(entityData.getName()) && !mobName.equalsIgnoreCase(entityData.getKey())) continue;%0A%0A            if (isDebug) mage.sendDebugMessage(ChatColor.GREEN + %22Incrementing objective for quest: %22 + ChatColor.GOLD + quest.getName(), 2);%0A            incrementObjective(player, this, 1, quest);%0A        %7D%0A    %7D%0A%7D%0A

Add MagicMobKillObjective