Secret Experience

Secret Experience (https://secretexperience.net/)
-   [L2J] Dúvidas Solucionadas (https://secretexperience.net/l2j-duvidas-solucionadas/)
-   -   Annuncios PVP PK (https://secretexperience.net/l2j-duvidas-solucionadas/22980-annuncios-pvp-pk.html)

Mazokista 06-07-2010 12:46 PM

Annuncios PVP PK
 
Queria Tirar Uma Duvida Onde Estao Todos Os
[B]Codigos Abaixo Se eu Alterar Pro ToPlayers
Troca em Todos Qui Estao em Baixo Annunciara no Chat Superior ?

[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]


Citação:

Announcements.getInstance().announceToAll(sm);
Troco Pelo
Citação:

Announcements.getInstance().announceToPlayers(sm);
Código:

            increasePvpKills();
            if ( target instanceof L2PcInstance && Config.ANNOUNCE_PVP_KILL ) // Announces a PvP kill
              Announcements.getInstance().announceToAll("Player "+this.getName()+" hunted Player "+target.getName());
            return;
                }
                else                                                                        // Target player doesn't have pvp flag set
                {
            // check about wars
            if (targetPlayer.getClan() != null && getClan() != null)
            {
                if (getClan().isAtWarWith(targetPlayer.getClanId()))
                {
                    if (targetPlayer.getClan().isAtWarWith(getClanId()))
                    {
                        // 'Both way war' -> 'PvP Kill'
                        increasePvpKills();
                        if ( target instanceof L2PcInstance && Config.ANNOUNCE_PVP_KILL ) // Announces a PvP kill
                          Announcements.getInstance().announceToPlayers("Player "+this.getName()+" hunted Player "+target.getName());
                        else if ( target instanceof L2PcInstance && Config.ANNOUNCE_ALL_KILL ) // Announces a kill
                          Announcements.getInstance().announceToPlayers("Player "+this.getName()+" killed Player "+target.getName());
                        return;
                    }
                }
            }

            // 'No war' or 'One way war' -> 'Normal PK'
                        if (targetPlayer.getKarma() > 0)                                        // Target player has karma
                        {
                                if ( Config.KARMA_AWARD_PK_KILL )
                                {
                    increasePvpKills();
                    if ( target instanceof L2PcInstance && Config.ANNOUNCE_PVP_KILL ) // Announces a PvP kill
                      Announcements.getInstance().announceToAll("Player "+this.getName()+" hunted Player "+target.getName());
                                }
                        }
                        else if (targetPlayer.getPvpFlag() == 0)                                                                    // Target player doesn't have karma
                        {
                increasePkKillsAndKarma(targetPlayer.getLevel());
                if ( target instanceof L2PcInstance && Config.ANNOUNCE_PK_KILL ) // Announces a Pk kill
                  Announcements.getInstance().announceToAll("Player "+this.getName()+" has assassinated Player "+target.getName());
                        }
                }
      if ( target instanceof L2PcInstance && Config.ANNOUNCE_ALL_KILL ) // Announces a kill
        Announcements.getInstance().announceToAll("Player "+this.getName()+" killed Player "+target.getName());
        }


paytaly 06-07-2010 01:15 PM

Teoricamente sim, porém é necessário ter suporte para o método announceToPlayers.
Isso já foi discutido em outros tópicos. Procure um pouco que encontrará a solução neles.

Mazokista 06-07-2010 01:41 PM

Nao Consegui Achar Vc Pode Min informa o Suporte Para o Metodo

B1Z4R0 06-07-2010 02:40 PM

[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]

Mazokista 06-07-2010 03:43 PM

Esto Com Dificuldade Nao Consegui Adaptar Para *********

B1Z4R0 06-07-2010 04:22 PM

acabei de colocar no L2JMACK rev 69! muito simples, ai a diff se quiser ver

Código:

Index: /trunk/L2J-Mack_IL/L2J-Mack_GameServer/java/com/l2dot/gameserver/Announcements.java
===================================================================
--- /trunk/L2J-Mack_IL/L2J-Mack_GameServer/java/com/l2dot/gameserver/Announcements.java (revision 5)
+++ /trunk/L2J-Mack_IL/L2J-Mack_GameServer/java/com/l2dot/gameserver/Announcements.java (revision 69)
@@ -240,3 +240,11 @@
                }
        }
+       
+        public void announceToPlayers(String message)
+        {
+                // Get all players
+                for (L2PcInstance player : L2World.getInstance().getAllPlayers()) {
+                        player.sendMessage(message);
+                }
+                }
 }
Index: /trunk/L2J-Mack_IL/L2J-Mack_GameServer/java/com/l2dot/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- /trunk/L2J-Mack_IL/L2J-Mack_GameServer/java/com/l2dot/gameserver/model/actor/instance/L2PcInstance.java (revision 68)
+++ /trunk/L2J-Mack_IL/L2J-Mack_GameServer/java/com/l2dot/gameserver/model/actor/instance/L2PcInstance.java (revision 69)
@@ -4812,5 +4812,5 @@
            increasePvpKills();
                        if ( target instanceof L2PcInstance && Config.ANNOUNCE_PVP_KILL ) // Announces a PvP kill
-                                      Announcements.getInstance().announceToAll("Player "+this.getName()+" hunted Player "+target.getName());
+                                      Announcements.getInstance().announceToPlayers("Player "+this.getName()+" hunted Player "+target.getName());
                                return;
                }
@@ -4827,7 +4827,7 @@
                        increasePvpKills();
                                                if ( target instanceof L2PcInstance && Config.ANNOUNCE_PVP_KILL ) // Announces a PvP kill
-                                                                Announcements.getInstance().announceToAll("Player "+this.getName()+" hunted Player "+target.getName());
+                                                                Announcements.getInstance().announceToPlayers("Player "+this.getName()+" hunted Player "+target.getName());
                                                        else if ( target instanceof L2PcInstance && Config.ANNOUNCE_ALL_KILL ) // Announces a kill
-                                                                Announcements.getInstance().announceToAll("Player "+this.getName()+" killed Player "+target.getName());
+                                                                Announcements.getInstance().announceToPlayers("Player "+this.getName()+" killed Player "+target.getName());
                        return;
                    }
@@ -4842,5 +4842,5 @@
                    increasePvpKills();
                                        if ( target instanceof L2PcInstance && Config.ANNOUNCE_PVP_KILL ) // Announces a PvP kill
-                                                        Announcements.getInstance().announceToAll("Player "+this.getName()+" hunted Player "+target.getName());
+                                                        Announcements.getInstance().announceToPlayers("Player "+this.getName()+" hunted Player "+target.getName());
                                }
                        }
@@ -4849,9 +4849,9 @@
                increasePkKillsAndKarma(targetPlayer.getLevel());
                                if ( target instanceof L2PcInstance && Config.ANNOUNCE_PK_KILL ) // Announces a Pk kill
-                                                Announcements.getInstance().announceToAll("Player "+this.getName()+" has assassinated Player "+target.getName());
+                                                Announcements.getInstance().announceToPlayers("Player "+this.getName()+" has assassinated Player "+target.getName());
                        }
                }
                                if ( target instanceof L2PcInstance && Config.ANNOUNCE_ALL_KILL ) // Announces a kill
-                                                Announcements.getInstance().announceToAll("Player "+this.getName()+" killed Player "+target.getName());
+                                                Announcements.getInstance().announceToPlayers("Player "+this.getName()+" killed Player "+target.getName());
                                  }
    /**


Mazokista 06-07-2010 04:54 PM

Muito Obrigado Manow Qui Deus de Abençoe

ASuhuhsahusa Foi Falta de Atencao Esqueci dessa Linha
Mais Brigadao Mesmo



Citação:

Index: /trunk/L2J-Mack_IL/L2J-Mack_GameServer/java/com/l2dot/gameserver/Announcements.java
================================================== =================
--- /trunk/L2J-Mack_IL/L2J-Mack_GameServer/java/com/l2dot/gameserver/Announcements.java (revision 5)
+++ /trunk/L2J-Mack_IL/L2J-Mack_GameServer/java/com/l2dot/gameserver/Announcements.java (revision 69)
@@ -240,3 +240,11 @@
}
}
+
+ public void announceToPlayers(String message)
+ {
+ // Get all players
+ for (L2PcInstance player : L2World.getInstance().getAllPlayers()) {
+ player.sendMessage(message);
+ }
+ }
}


Horários baseados na GMT -3. Agora são 04:54 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0