Guest User

Untitled

a guest
Dec 4th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.83 KB | None | 0 0
  1. package custom.SuperMonster;
  2.  
  3. import net.sf.l2j.gameserver.model.actor.L2Npc;
  4. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  5. import net.sf.l2j.gameserver.model.quest.Quest;
  6. import net.sf.l2j.gameserver.util.Broadcast;
  7.  
  8. public class SuperMonster extends Quest
  9. {
  10.     // Monsters's ID.
  11.     private static final int MONSTERS[] =
  12.     {
  13.         12564
  14.     };
  15.    
  16.     private static final boolean REWARD_PARTY = false;
  17.     private final static boolean REWARD_NOBLE = true;
  18.    
  19.     private final static boolean REWARD_ITEMS = true;
  20.     private final static int REWARD_ITEM_ID = 5575;
  21.     private final static int REWARD_ITEM_COUNT = 100000;
  22.    
  23.     public SuperMonster()
  24.     {
  25.         super(-1, "SuperMonster", "custom");
  26.        
  27.         for (int mobs : MONSTERS)
  28.             addKillId(mobs);
  29.     }
  30.    
  31.     @Override
  32.     public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
  33.     {
  34.         Broadcast.announceToOnlinePlayers("The Villain was successfully killed by " + player.getName() + ".");
  35.        
  36.         if (REWARD_PARTY)
  37.         {
  38.             if (player.getParty() != null)
  39.             {
  40.                 for (L2PcInstance members : player.getParty().getPartyMembers())
  41.                 {  
  42.                     if (REWARD_ITEMS)
  43.                         members.addItem("Reward", REWARD_ITEM_ID, REWARD_ITEM_COUNT, members, true);
  44.                     if (REWARD_NOBLE)
  45.                     {
  46.                         if (!members.isNoble())
  47.                             members.setNoble(true, true);
  48.                         else
  49.                             members.sendMessage("You already Noblesse.");
  50.                     }
  51.                    
  52.                     members.sendMessage("Congratulations! You have killed the Villain.");
  53.                 }
  54.             }
  55.         }
  56.         else
  57.         {
  58.             player.sendMessage("Congratulations! You have killed the Villain.");
  59.            
  60.             if (REWARD_ITEMS)
  61.                 player.addItem("Add", REWARD_ITEM_ID, REWARD_ITEM_COUNT, player, true);
  62.             if (REWARD_NOBLE)
  63.             {
  64.                 if (!player.isNoble())
  65.                     player.setNoble(true, true);
  66.             }
  67.         }
  68.         return null;
  69.     }
  70.    
  71.     public static void main(String args[])
  72.     {
  73.         new SuperMonster();
  74.     }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment