Jump to content

Recommended Posts

Posted

(Gr) Geia sas eftiaxa ena code (to prwto mou) to opoio einai basismeno sto pvp chat tou Rizlaa.

(Eng) Hello I created my first code which is based on Rizlaa's pvp chat code.

My Code ( It is based on l2jfree source):

 

### Eclipse Workspace Patch 1.0
#P Chr.6GMS
Index: java/config/l2jmods.properties
===================================================================
--- java/config/l2jmods.properties    (revision 5263)
+++ java/config/l2jmods.properties    (working copy)
@@ -91,6 +91,11 @@

#Cost of Divorce, % of Adena
WeddingDivorceCosts=20
+
+#Custom Chat via PKs
+AllowPkChat = False
+#Pvps to talk there
+PksToChat = 500
+
 #---------------------------------------------------------------
 # Team vs. Team Event Engine (by FBIagent)              -
 #---------------------------------------------------------------

Index: java/net/sf/l2j/gameserver/clientpackets/Say2.java
===================================================================
--- java/net/sf/l2j/gameserver/clientpackets/Say2.java    (revision 5263)
+++ java/net/sf/l2j/gameserver/clientpackets/Say2.java    (working copy)
@@ -233,6 +233,14 @@

 

  }
                break;
            case ALL:
+    if(Config.ALLOW_PK_CHAT){
+     if(activeChar.getPvpKills() >= Config.PKS_TO_CHAT)
 + if(_text.startsWith("*")){
 +         String customChat = _text.substring(1);
  +       for(L2PcInstance players : L2World.getInstance().getAllPlayers())
 +      players.sendPacket(new CreatureSay(activeChar.getObjectId(),15,activeChar.getName(),customChat));

+                                                                   }
+                                                            }

    }
                if (_text.startsWith("."))
                {
                    StringTokenizer st = new StringTokenizer(_text);
                

Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java    (revision 5263)
+++ java/net/sf/l2j/Config.java    (working copy)
@@ -881,7 +881,12 @@

 

public static boolean L2JMOD_WEDDING_SAMESEX;
    public static boolean L2JMOD_WEDDING_FORMALWEAR;
    public static int L2JMOD_WEDDING_DIVORCE_COSTS;

+   
+    //pk chat
+    public static boolean ALLOW_PK_CHAT;
+    public static int PKS_TO_CHAT;
+

// Packet information
    /** Count the a-beep-t of packets per minute ? */
    public static boolean  COUNT_PACKETS          = false;

 

@@ -1859,6 +1864,10 @@
     L2JMOD_WEDDING_FORMALWEAR              = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
     L2JMOD_WEDDING_DIVORCE_COSTS            = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));

+         
+                   ALLOW_PK_CHAT=Boolean.valueOf(L2JModSettings.getProperty("AllowPkChat","False"));
+                                PKS_TO_CHAT=Integer.parseInt(L2JModSettings.getProperty("PksToChat","500"));

+               
               
if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
                {
                    TVT_EVENT_ENABLED = false;

 

Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..