Secret Experience

Secret Experience (https://secretexperience.net/index.php)
-   [Lineage] Java Mods (https://secretexperience.net/forumdisplay.php?f=636)
-   -   [L2JServer] Brilho de Hero nos PvPs. (https://secretexperience.net/showthread.php?t=10326)

KaL 02-07-2009 11:06 PM

Brilho de Hero nos PvPs.
 
Este Mod dá o brilho hero quando pegar 100 PvPs e ter 4 Kills consecutivos.

Para alterar a quantidade de PvPs necessária, altere o destaque em vermelho.
Para alterar a quantidade de PvPs consecutivos necessários, altere o destaque azul.
Código:

Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java  (revision 1901)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java  (working copy)
@@ -488,6 +488,11 @@
 
    private boolean _noble = false;
    private boolean _hero = false;

+  /** Special hero aura values */
+  private int heroConsecutiveKillCount = 0;
+  private boolean isPermaHero = false;
+  private boolean isPVPHero = false;
 
    /** The L2FolkInstance corresponding to the last Folk wich one the player talked. */
    private L2FolkInstance _lastFolkNpc = null;
@@ -1971,6 +1976,13 @@
    public void setPvpKills(int pvpKills)
    {
      _pvpKills = pvpKills;
+     
+      // Set hero aura if pvp kills > 100
+      if (pvpKills > 100)
+      {
+        isPermaHero = true;
+        setHeroAura(true);
+      }
    }
 
    /**
@@ -4678,6 +4690,14 @@
 
      stopRentPet();
      stopWaterTask();
+     
+      // Remove kill count for special hero aura if total pvp < 100
+      heroConsecutiveKillCount = 0;
+      if (!isPermaHero)
+      {
+        setHeroAura(false);
+        sendPacket(new UserInfo(this));
+      }
      return true;
    }
 
@@ -4897,6 +4917,13 @@
    {
        // Add karma to attacker and increase its PK counter
        setPvpKills(getPvpKills() + 1);
+     
+        // Increase the kill count for a special hero aura
+        heroConsecutiveKillCount++;
+     
+        // If heroConsecutiveKillCount > 4 (5+ kills) give hero aura
+        if(heroConsecutiveKillCount > 4)
+          setHeroAura(true);
 
        // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
        sendPacket(new UserInfo(this));
@@ -8715,6 +8742,22 @@
    {
      return _blockList;
    }

+  public void reloadPVPHeroAura()
+  {
+      sendPacket(new UserInfo(this));
+  }

+  public void setHeroAura (boolean heroAura)
+  {
+      isPVPHero = heroAura;
+      return;
+  }

+  public boolean getIsPVPHero()
+  {
+      return isPVPHero;
+  }
 
    public void setHero(boolean hero)
    {
Index: java/net/sf/l2j/gameserver/serverpackets/UserInfo.java
===================================================================
--- java/net/sf/l2j/gameserver/serverpackets/UserInfo.java  (revision 1901)
+++ java/net/sf/l2j/gameserver/serverpackets/UserInfo.java  (working copy)
@@ -337,7 +337,7 @@
 
        writeD(_activeChar.getClanCrestLargeId());
        writeC(_activeChar.isNoble() ? 1 : 0); //0x01: symbol on char menu ctrl+I
-        writeC((_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA)) ? 1 : 0); //0x01: Hero Aura
+        writeC((_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA) || _activeChar.getIsPVPHero()) ? 1 : 0); //0x01: Hero Aura
 
        writeC(_activeChar.isFishing() ? 1 : 0); //Fishing Mode
        writeD(_activeChar.getFishx()); //fishing x

Obs.: Ao ter 4 Kills sem morrer, o char ganha o brilho Hero...se morrer, ele perde o mesmo e a contagem consecutiva é zerada.

Creditos : L2jServer Fórum ( ??? )

_Dudu_1533 10-07-2009 03:10 PM

E isso é salvo onde?
Qual arquivo?

Até mais ^^

paytaly 10-07-2009 04:36 PM

@_Dudu_1533, aquilo é uma Diff! :D
Os arquivos que devem ser modificados, ficam na frente do Index:

Regencio 10-07-2009 06:24 PM

Index?.. Como assim?

Loki 10-07-2009 07:48 PM

paytaly se poderia explicar mano como que add isso ae no java sei que e com algo de aplly path vc pode dar uja luz nisso ae agradeço

soul12 11-07-2009 09:26 AM

Alguem ai pode dizer o local exato pra inserir esses codigos ai?
Obrigado!

paytaly 11-07-2009 06:31 PM

Por acaso Regencio e soul12, prestaram atenção na minha resposta e no Código?
Citação:

Postado Originalmente por paytaly
Os arquivos que devem ser modificados, ficam na frente do Index:

Código:

Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java  (revision 1901)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java  (working copy)
@@ -488,6 +488,11 @@
 
    private boolean _noble = false;
    private boolean _hero = false;

+  /** Special hero aura values */
+  private int heroConsecutiveKillCount = 0;
+  private boolean isPermaHero = false;
+  private boolean isPVPHero = false;
 
    /** The L2FolkInstance corresponding to the last Folk wich one the player talked. */
    private L2FolkInstance _lastFolkNpc = null;
@@ -1971,6 +1976,13 @@
    public void setPvpKills(int pvpKills)
    {
      _pvpKills = pvpKills;
+     
+      // Set hero aura if pvp kills > 100
+      if (pvpKills > 100)
+      {
+        isPermaHero = true;
+        setHeroAura(true);
+      }
    }
 
    /**
@@ -4678,6 +4690,14 @@
 
      stopRentPet();
      stopWaterTask();
+     
+      // Remove kill count for special hero aura if total pvp < 100
+      heroConsecutiveKillCount = 0;
+      if (!isPermaHero)
+      {
+        setHeroAura(false);
+        sendPacket(new UserInfo(this));
+      }
      return true;
    }
 
@@ -4897,6 +4917,13 @@
    {
        // Add karma to attacker and increase its PK counter
        setPvpKills(getPvpKills() + 1);
+     
+        // Increase the kill count for a special hero aura
+        heroConsecutiveKillCount++;
+     
+        // If heroConsecutiveKillCount > 4 (5+ kills) give hero aura
+        if(heroConsecutiveKillCount > 4)
+          setHeroAura(true);
 
        // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
        sendPacket(new UserInfo(this));
@@ -8715,6 +8742,22 @@
    {
      return _blockList;
    }

+  public void reloadPVPHeroAura()
+  {
+      sendPacket(new UserInfo(this));
+  }

+  public void setHeroAura (boolean heroAura)
+  {
+      isPVPHero = heroAura;
+      return;
+  }

+  public boolean getIsPVPHero()
+  {
+      return isPVPHero;
+  }
 
    public void setHero(boolean hero)
    {
Index: java/net/sf/l2j/gameserver/serverpackets/UserInfo.java
===================================================================
--- java/net/sf/l2j/gameserver/serverpackets/UserInfo.java  (revision 1901)
+++ java/net/sf/l2j/gameserver/serverpackets/UserInfo.java  (working copy)
@@ -337,7 +337,7 @@
 
        writeD(_activeChar.getClanCrestLargeId());
        writeC(_activeChar.isNoble() ? 1 : 0); //0x01: symbol on char menu ctrl+I
-        writeC((_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA)) ? 1 : 0); //0x01: Hero Aura
+        writeC((_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA) || _activeChar.getIsPVPHero()) ? 1 : 0); //0x01: Hero Aura
 
        writeC(_activeChar.isFishing() ? 1 : 0); //Fishing Mode
        writeD(_activeChar.getFishx()); //fishing x

@Loki, dê uma olhada no Vídeo abaixo, ele é em inglês, porém você consegue
fazer apenas olhando onde foi clicado além de que Aplicar esses Patchs é fácil.
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]

soul12 11-07-2009 10:10 PM

Vlws... brigadão ajudo muito

Loki 12-07-2009 01:50 AM

Paytali cara vlw mesmo resolveu meus problemas cara obrigadooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooo

Regencio 12-07-2009 01:19 PM

E eu para ter o PvP Kills (Hero) preciso copiar e colar aqui : java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java

Certo?


Horários baseados na GMT -3. Agora são 10:48 PM.

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