@Override
 public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) {
   final QuestState qs = getRandomPartyMemberState(killer, -1, 3, npc);
   if (qs != null) {
     final ItemChanceHolder info = MOBS_DROP_CHANCES.get(npc.getId());
     switch (info.getId()) {
       case RIB_BONE_OF_A_BLACK_MAGUS:
         {
           if (qs.isCond(1)
               && giveItemRandomly(
                   qs.getPlayer(),
                   npc,
                   RIB_BONE_OF_A_BLACK_MAGUS,
                   1,
                   RIB_BONE_REQUIRED_COUNT,
                   info.getChance(),
                   true)) {
             qs.setCond(2);
           }
           break;
         }
       case ZOMBIES_LIVER:
         {
           giveItemRandomly(qs.getPlayer(), npc, ZOMBIES_LIVER, 1, 0, info.getChance(), true);
           break;
         }
     }
   }
   return super.onKill(npc, killer, isSummon);
 }
示例#2
0
  @Override
  public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) {
    final QuestState qs = getRandomPartyMemberState(killer, -1, 3, npc);
    if (qs == null) {
      return super.onKill(npc, killer, isSummon);
    }

    switch (npc.getId()) {
      case MARSH_ZOMBIE:
        {
          if (hasQuestItems(killer, PRESERVE_OIL)
              && (getRandom(10) < 5)
              && Util.checkIfInRange(1500, npc, killer, true)) {
            giveItems(killer, ZOMBIE_HEAD, 1);
            takeItems(killer, PRESERVE_OIL, -1);
            qs.setCond(7, true);
          }
          break;
        }
      case DOOM_SOLDIER:
      case SKELETON_HUNTER:
      case SKELETON_HUNTER_ARCHER:
        {
          if (hasQuestItems(killer, CECKTINONS_VOUCHER2)
              && giveItemRandomly(qs.getPlayer(), npc, BONE_FRAGMENT, 1, 10, 1.0, true)) {
            qs.setCond(4, true);
          }
          break;
        }
    }
    return super.onKill(npc, killer, isSummon);
  }
 @Override
 public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon) {
   final QuestState st = getRandomPartyMemberState(player, 2, 3, npc);
   if ((st != null)
       && giveItemRandomly(
           st.getPlayer(), npc, ANTELOPE_SKIN, 1, 1, MOBS_SKIN.get(npc.getId()), true)) {
     st.setCond(3);
   }
   return super.onKill(npc, player, isSummon);
 }
  @Override
  public String onKill(L2Npc anays, L2PcInstance killer, boolean isSummon) {
    final QuestState qs = getRandomPartyMemberState(killer, -1, 3, anays);
    if (qs != null) {
      if (qs.getPlayer().isInParty()) {
        // if player is in party, reward all members
        final L2Party party = qs.getPlayer().getParty();
        final int rnd = getRandom(party.getMemberCount());
        int idx = 0;

        for (L2PcInstance member : party.getMembers()) {
          // only one lucky player will get the good item, the rest will get the bad one
          rewardPlayer(getQuestState(member, false), (idx == rnd));
          idx++;
        }
      } else {
        // if no party, the winner gets it all
        rewardPlayer(qs, true);
      }
    }
    return super.onKill(anays, killer, isSummon);
  }
 @Override
 public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) {
   final QuestState qs = getRandomPartyMemberState(killer, 7, 3, npc);
   if (qs != null) {
     if (giveItemRandomly(
         qs.getPlayer(),
         npc,
         SPIRIT_OF_DARKNESS,
         1,
         200,
         MONSTER_CHANCES.get(npc.getId()),
         true)) {
       qs.setCond(8, true);
     }
   }
   return super.onKill(npc, killer, isSummon);
 }
 private static final void rewardPlayer(QuestState qs, boolean isLucky) {
   if ((qs != null) && qs.isCond(1)) {
     giveItems(qs.getPlayer(), (isLucky ? MARK_OF_SPLENDOR : MARK_OF_DARKNESS), 1);
     qs.setCond(isLucky ? 3 : 2, true);
   }
 }