Secret Experience

Secret Experience (https://secretexperience.net/)
-   [Lineage] Java Mods (https://secretexperience.net/lineage-java-mods/)
-   -   [L2JServer] Criando Skill Ant-Buffer[JAVA] (https://secretexperience.net/lineage-java-mods/33132-criando-skill-ant-buffer-java.html)

allanalcantara 30-10-2011 03:11 AM

Criando Skill Ant-Buffer[JAVA]
 
se faltar alguma coisa digam-me aqui...
é um mod que ele faz um comando ant buffer dentro do java.
Criar um Comando de voz Handler [Nome: InvullBuffs]

Código:

package net.sf.l2j.gameserver.handler.voicedcommandhandlers;

import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

public class InvullBuffs implements IVoicedCommandHandler
{
private static String[] _voicedCommands = { "buff_block", "buff_unblock" };

public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
{
if (command.equalsIgnoreCase("buff_block"))
{
activeChar.setInvullBuffs(true);
activeChar.sendMessage("You cant take any effect now.");
}
else if (command.equalsIgnoreCase("buff_unblock"))
{
activeChar.setInvullBuffs(false);
activeChar.sendMessage("Your status restored, you can take normaly effects.");
}
    return true;
}

public String[] getVoicedCommandList()
{
    return _voicedCommands;
}
}




Registre seu novo Handler

Código:


@@ -47,6 +47,7 @@
{
_datatable = new FastMap<String, IVoicedCommandHandler>();
        registerVoicedCommandHandler(new stats());
+      registerVoicedCommandHandler(new InvullBuffs());
  if (Config.L2JMOD_ALLOW_WEDDING)
        registerVoicedCommandHandler(new Wedding());
if (Config.BANKING_SYSTEM_ENABLED)

Criar Método "InvullBuffs" em L2PcInstance

Código:

@@ -2153,6 +2160,15 @@
{
return _pvpKills;
}
+        public void setInvullBuffs(boolean InvullBuffs)
+        {
+              _InvullBuffs = InvullBuffs;
+        }
+
+        public boolean isInvullBuffs()
+        {
+              return _InvullBuffs;
+        }



Como última etapa em "net/sf/l2j/gamserver/model/L2Skill.Java"

Código:

@@ -2934,6 +2962,9 @@
if (effected.isInvul())
return _emptyEffectSet;

+      if ((effector instanceof L2PcInstance && (!isOffensive() || !isDebuff())) && (((L2PcInstance)effected).isInvullBuffs()))
+    return _emptyEffectSet;
+

if ((isOffensive() || isDebuff()) && effector instanceof L2PcInstance && ((L2PcInstance)effector).isGM())
{
if (!((L2PcInstance)effector).getAccessLevel().canGiveDamage())



Horários baseados na GMT -3. Agora são 09:40 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.