Codigo con el cual evitas recuperar Hp drenando del moob en estado de flag.Se puede editar para magos y warriors (skill/hit).Saludos espero que les sea útil.
### Eclipse Workspace Patch 1.0
#P Chr.6GMS
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 5263)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -238,6 +238,8 @@
public static final int STORE_PRIVATE_BUY = 3;
public static final int STORE_PRIVATE_MANUFACTURE = 5;
public static final int STORE_PRIVATE_PACKAGE_SELL = 8;
+
+ private int[] drainIds = {0,25,2};
/** The table containing all minimum level needed for each Expertise (None, D, C, B, A, S)*/
private static final int[] EXPERTISE_LEVELS =
@@ -284,6 +286,21 @@
public void doCast(L2Skill skill)
{
super.doCast(skill);
+
+ //--Cannot use drain skills in mobs--
+ L2Object target = getTarget();
+ L2MonsterInstance m = null;
+ if(target instanceof L2MonsterInstance)
+ m = (L2MonsterInstance) target;
+ if(m != null && getPvpFlag() > 0){
+ for(int i=0; i < drainIds.length; i ++)
+ {
+ if(skill.getId() == drainIds[i]){
+ sendMessage("You can't drain hp from mobs");
+ return;
+ }
+ }
+ }
// cancel the recent fake-death protection instantly if the player attacks or casts spells
getPlayer().setRecentFakeDeath(false);
By Zeus