Advertisement
Kimeraweb

L2J NoBots

Jan 18th, 2014
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.75 KB | None | 0 0
  1.  
  2. ===================================================================
  3. --- java/com/l2jserver/gameserver/model/L2Object.java   (revision 6327)
  4. +++ java/com/l2jserver/gameserver/model/L2Object.java   (working copy)
  5. @@ -174,7 +174,8 @@
  6.         L2NpcBufferInstance(L2Npc),
  7.         L2TvTEventNpcInstance(L2Npc),
  8.         L2WeddingManagerInstance(L2Npc),
  9. -       L2EventMobInstance(L2Npc);
  10. +       L2EventMobInstance(L2Npc),
  11. +       L2NpcNoBotsInstance(L2MonsterInstance);
  12.        
  13.         private final InstanceType _parent;
  14.         private final long _typeL;
  15. Index: java/com/l2jserver/gameserver/model/actor/instance/L2NpcNoBotsInstance.java
  16. ===================================================================
  17. --- java/com/l2jserver/gameserver/model/actor/instance/L2NpcNoBotsInstance.java (revision 0)
  18. +++ java/com/l2jserver/gameserver/model/actor/instance/L2NpcNoBotsInstance.java (revision 0)
  19. @@ -0,0 +1,84 @@
  20. +/*
  21. + * Copyright (C) 2004-2014 L2J Server
  22. + *
  23. + * This file is part of L2J Server.
  24. + *
  25. + * L2J Server is free software: you can redistribute it and/or modify
  26. + * it under the terms of the GNU General Public License as published by
  27. + * the Free Software Foundation, either version 3 of the License, or
  28. + * (at your option) any later version.
  29. + *
  30. + * L2J Server is distributed in the hope that it will be useful,
  31. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  32. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  33. + * General Public License for more details.
  34. + *
  35. + * You should have received a copy of the GNU General Public License
  36. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  37. + */
  38. +package com.l2jserver.gameserver.model.actor.instance;
  39. +
  40. +import com.l2jserver.gameserver.model.actor.L2Character;
  41. +import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
  42. +
  43. +/**
  44. + * @author Kimera
  45. + * @web kimeraweb.es
  46. + * @Descripcion Este mob está pensado para ser spawneado en las zonas de farmeo. Los bots matan indiscriminadamente todos los mobs que tienen delante, pero este mob es un señuelo. Si se mata, te envia a la carcel. <br>
  47. + * <br>
  48. + *              Es mas comodo evitar un mob que obligar a un jugador a estar tecleando CAPCTHAS constantemente. <br>
  49. + * <br>
  50. + *              Eres libre de editar el codigo a tu gusto, pero no omitas su autoria! Gracias! <br>
  51. + * <br>
  52. + * @Creado Para los foros de adminsproL2
  53. + */
  54. +public class L2NpcNoBotsInstance extends L2MonsterInstance
  55. +{
  56. +  
  57. +   /**
  58. +    * @param objectId
  59. +    * @param template
  60. +    */
  61. +   public L2NpcNoBotsInstance(int objectId, L2NpcTemplate template)
  62. +   {
  63. +       super(objectId, template);
  64. +       setInstanceType(InstanceType.L2NpcNoBotsInstance);
  65. +       setAutoAttackable(true);
  66. +   }
  67. +  
  68. +   @Override
  69. +   public boolean doDie(L2Character killer)
  70. +   {
  71. +       // Si no es un jugador, finalizamos aqui.
  72. +       if (!(killer instanceof L2PcInstance))
  73. +       {
  74. +           return false;
  75. +       }
  76. +      
  77. +       // Si no hay asesino
  78. +       if (!super.doDie(killer))
  79. +       {
  80. +           return false;
  81. +       }
  82. +      
  83. +       // Quitar el cadaver del suelo
  84. +       if (_maintenanceTask != null)
  85. +       {
  86. +           _maintenanceTask.cancel(false);
  87. +           _maintenanceTask = null;
  88. +       }
  89. +      
  90. +       killer.sendMessage("Vas a la carcel por un minuto. Has matado a un monster antibot!!");
  91. +       ((L2PcInstance) killer).setPunishLevel(L2PcInstance.PunishLevel.JAIL, 1);
  92. +      
  93. +       // Otros posibles castigos (los puedes activar todos):
  94. +       // ((L2PcInstance)killer).setPunishLevel(L2PcInstance.PunishLevel.CHAR, 1); // Baneo del PJ
  95. +       // ((L2PcInstance)killer).setPunishLevel(L2PcInstance.PunishLevel.ACC,1); // Baneo de la cuenta
  96. +       // ((L2PcInstance)killer).setKarma(1000); // 1000 de karma (El PJ ya es un evento xD)
  97. +       // ((L2PcInstance)killer).doDie(this); // Este mob mata al PJ
  98. +       // ((L2PcInstance)killer).logout(); // Kickea al PJ
  99. +      
  100. +       return true;
  101. +   }
  102. +  
  103. +}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement