Example #1
0
  @Override
  public final String onKill(L2Npc npc, L2PcInstance player, boolean isSummon) {
    final QuestState st = getQuestState(player, false);
    if (st == null) {
      return null;
    }

    for (int _gk[] : _gatekeepers) {
      if (npc.getId() == _gk[0]) {
        // Drop key
        npc.dropItem(player, _gk[1], 1);

        // Check if gatekeeper should open bridge, and open it
        if (_gk[2] > 0) {
          final InstanceWorld tmpworld =
              InstanceManager.getInstance().getWorld(player.getInstanceId());
          if (tmpworld instanceof NornilsWorld) {
            openDoor(_gk[2], tmpworld.getInstanceId());
          }
        }
      }
      if (npc.getId() == 18355) {
        spawn2(npc);
      }
    }
    return super.onKill(npc, player, isSummon);
  }
Example #2
0
 @Override
 public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) {
   final ItemChanceHolder holder = MONSTERS.get(npc.getId());
   if (getRandom(10000) <= holder.getChance()) {
     npc.dropItem(killer, holder);
   }
   return super.onKill(npc, killer, isSummon);
 }
Example #3
0
 private static final void dropHerb(L2Npc mob, L2PcInstance player, int[][] drop) {
   final int chance = getRandom(100);
   for (int[] element : drop) {
     if (chance < element[2]) {
       mob.dropItem(player, element[0], element[1]);
     }
   }
 }