Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2015
437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.40 KB | None | 0 0
  1. package l2next.scripts.events;
  2.  
  3. import l2next.gameserver.datatables.xml.NpcTable;
  4. import l2next.gameserver.model.actor.L2Npc;
  5. import l2next.gameserver.model.actor.instance.L2PcInstance;
  6. import l2next.gameserver.model.actor.templates.L2NpcTemplate;
  7. import l2next.gameserver.model.items.base.proptypes.ProcessType;
  8. import l2next.gameserver.model.world.quest.Quest;
  9. import l2next.gameserver.util.Rnd;
  10.  
  11. /**
  12.  * User: Samurai
  13.  */
  14. public class DropToAll extends Quest
  15. {
  16.     public DropToAll()
  17.     {
  18.         super();
  19.         for(L2NpcTemplate npcTemplate : NpcTable.getInstance().getAllMonstersOfLevel(90, 91, 92, 93, 94, 95, 96, 97, 98, 99))
  20.         {
  21.             addEventId(npcTemplate.getNpcId(), QuestEventType.ON_KILL);
  22.         }
  23.     }
  24.  
  25.     public static void main(String[] args)
  26.     {
  27.         new DropToAll();
  28.     }
  29.  
  30.     @Override
  31.     public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
  32.     {
  33.         if(npc.getLevel() >= 85 && npc.getLevel() < 90)
  34.         {
  35.             if(Rnd.getChance(45))
  36.             {
  37.                 killer.addItem(ProcessType.DROP, 4356, Rnd.get(2, 10), killer, true);
  38.             }
  39.         }
  40.         else if(npc.getLevel() >= 90 && npc.getLevel() < 95)
  41.         {
  42.             if(Rnd.getChance(45))
  43.             {
  44.                 killer.addItem(ProcessType.DROP, 4356, Rnd.get(10, 30), killer, true);
  45.             }
  46.         }
  47.         else if(npc.getLevel() >= 95 && npc.getLevel() < 100)
  48.         {
  49.             if(Rnd.getChance(30))
  50.             {
  51.                 killer.addItem(ProcessType.DROP, 4356, Rnd.get(30, 50), killer, true);
  52.             }
  53.         }
  54.         return null;
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement