Jump to content
  • 0

NPC Protection


Question

Posted

Prospa8isa na vro post giafto to 8ema kai den vrika mipos esis borite na me help 8elw script code gia npc opos buffer/gatekeper ph otan einai flag o char i exi karma 8elw na tou vgali ena mnm oti den bori den 8elw na ta valo apo configs to 3erw to 8elw mono se 2 npc... ty :)

 

x4kt9y.jpg

6 answers to this question

Recommended Posts

  • 0
Posted

oriste file mou ena java code

 

allow soe if flagged config

 

Index: /trunk/-Gameserver/java/net/gp/gameserver/handler/itemhandlers/ScrollOfEscape.java
===================================================================
--- /trunk/-Gameserver/java/net/gp/gameserver/handler/itemhandlers/ScrollOfEscape.java (revision 52)
+++ /trunk/-Gameserver/java/net/gp/gameserver/handler/itemhandlers/ScrollOfEscape.java (revision 58)
@@ -84,4 +84,11 @@
             return;
         }
+		
+        if (Config.ALLOW_SOE_IN_PVP && activeChar.getPvpFlag() != 0)
+        {  
+                activeChar.sendMessage("You can't use SOE if you're flagged!");  
+                return;  
+        }  
+

         // Check to see if the player is in a festival.
Index: /trunk/-Gameserver/java/net/gp/Config.java
===================================================================
--- /trunk/-Gameserver/java/net/gp/Config.java (revision 57)
+++ /trunk/Gameserver/java/net/gp/Config.java (revision 58)
@@ -874,4 +874,5 @@
     public static int L2JMOD_WEDDING_DIVORCE_COSTS;
	public static boolean ALLOW_GK_IN_PVP; 
+	public static boolean ALLOW_SOE_IN_PVP;

     
@@ -1924,4 +1925,5 @@
                 L2JMOD_WEDDING_DIVORCE_COSTS            = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
				ALLOW_GK_IN_PVP                         = Boolean.parseBoolean(L2JModSettings.getProperty("AllowGkInPvP", "True"));
+				ALLOW_SOE_IN_PVP                        = Boolean.parseBoolean(L2JModSettings.getProperty("AllowSoEInPvP", "True"));


Index: /trunk/-Gameserver/config/l2jmods.properties
===================================================================
--- /trunk/-Gameserver/config/l2jmods.properties (revision 57)
+++ /trunk/-Gameserver/config/l2jmods.properties (revision 58)
@@ -137,2 +137,6 @@
# Default : True
AllowGkInPvP = True
+
+# If is set to False , players can't use SOE when they are flagged!
+# Default : True
+AllowSoEInPvP = True

 

 

oriste kai ena allo

 

Allow/Restrict Gk If Flagged config

 

Index: /trunk/-Gameserver/java/net/gp/gameserver/model/actor/instance/L2NpcInstance.java
===================================================================
--- /trunk/-Gameserver/java/net/gp/gameserver/model/actor/instance/L2NpcInstance.java (revision 52)
+++ /trunk/-Gameserver/java/net/gp/gameserver/model/actor/instance/L2NpcInstance.java (revision 57)
@@ -86,4 +86,6 @@
import net.gp.gameserver.templates.L2NpcTemplate;
import net.gp.gameserver.templates.L2Weapon;
+import net.gp.gameserver.model.actor.instance.L2PcInstance; 
+import net.gp.gameserver.model.actor.instance.L2PlayableInstance;
import net.gp.util.Rnd;
/**
@@ -1735,4 +1737,20 @@
      * 
      */
+	 
+	 
+	     
+    public void restrict(L2PlayableInstance playable, int val)
+    {
+        if (!(playable instanceof L2PcInstance)) return;
+        L2PcInstance activeChar = (L2PcInstance)playable;
+        if (Config.ALLOW_GK_IN_PVP && activeChar.getPvpFlag() != 0 && this instanceof L2TeleporterInstance)
+        {
+                activeChar.sendMessage("You can't use GK if you're flagged!");
+                return;
+        }
+   }
+    
+
+	 
     public void showChatWindow(L2PcInstance player, int val)
     {
Index: /trunk/-Gameserver/java/net/gp/gameserver/handler/admincommandhandlers/AdminAdmin.java
===================================================================
--- /trunk/-Gameserver/java/net/gp/gameserver/handler/admincommandhandlers/AdminAdmin.java (revision 52)
+++ /trunk/-Gameserver/java/net/gp/gameserver/handler/admincommandhandlers/AdminAdmin.java (revision 57)
@@ -226,8 +226,14 @@
				}

+				else if(type.startsWith("configs")) 
+ 		                                { 
+ 		                                        Config.loadAll(); 
+ 		                                        activeChar.sendMessage("Configs has benn reloaded"); 
+ 		                                } 
+				
			}
			catch(Exception e)
			{
-				activeChar.sendMessage("Usage:  //reload <multisell|skill|npc|htm|item|instancemanager>");
+				activeChar.sendMessage("Usage:  //reload <multisell|skill|npc|htm|item|instancemanager|configs>");
			}
		}
Index: /trunk/-Gameserver/java/net/gp/Config.java
===================================================================
--- /trunk/-Gameserver/java/net/gp/Config.java (revision 56)
+++ /trunk/-Gameserver/java/net/gp/Config.java (revision 57)
@@ -873,4 +873,5 @@
     public static boolean L2JMOD_WEDDING_FORMALWEAR;
     public static int L2JMOD_WEDDING_DIVORCE_COSTS;
+	public static boolean ALLOW_GK_IN_PVP; 

     
@@ -1922,4 +1923,5 @@
                 L2JMOD_WEDDING_FORMALWEAR               = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
                 L2JMOD_WEDDING_DIVORCE_COSTS            = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
+				ALLOW_GK_IN_PVP                         = Boolean.parseBoolean(L2JModSettings.getProperty("AllowGkInPvP", "True"));


@@ -2563,4 +2565,9 @@
         Config.saveHexid(serverId, string, HEXID_FILE);
     }
+    
+    public static void loadAll() 
+ 		    { 
+ 		        load(); 
+ 		    } 

     /**
Index: /trunk/-Gameserver/config/l2jmods.properties
=================================================================
--- /trunk/Gameserver/config/l2jmods.properties (revision 52)
+++ /trunk/Gameserver/config/l2jmods.properties (revision 57)
@@ -133,2 +133,6 @@
# no ";" at the start or end
TvTEventDoorsCloseOpenOnStartEnd =
+
+# If is set to False , players can't use GK when they are flagged!
+# Default : True
+AllowGkInPvP = True

  • 0
Posted

oriste file mou ena java code

 

allow soe if flagged config

 

Index: /trunk/-Gameserver/java/net/gp/gameserver/handler/itemhandlers/ScrollOfEscape.java
===================================================================
--- /trunk/-Gameserver/java/net/gp/gameserver/handler/itemhandlers/ScrollOfEscape.java (revision 52)
+++ /trunk/-Gameserver/java/net/gp/gameserver/handler/itemhandlers/ScrollOfEscape.java (revision 58)
@@ -84,4 +84,11 @@
             return;
         }
+		
+        if (Config.ALLOW_SOE_IN_PVP && activeChar.getPvpFlag() != 0)
+        {  
+                activeChar.sendMessage("You can't use SOE if you're flagged!");  
+                return;  
+        }  
+

         // Check to see if the player is in a festival.
Index: /trunk/-Gameserver/java/net/gp/Config.java
===================================================================
--- /trunk/-Gameserver/java/net/gp/Config.java (revision 57)
+++ /trunk/Gameserver/java/net/gp/Config.java (revision 58)
@@ -874,4 +874,5 @@
     public static int L2JMOD_WEDDING_DIVORCE_COSTS;
	public static boolean ALLOW_GK_IN_PVP; 
+	public static boolean ALLOW_SOE_IN_PVP;

     
@@ -1924,4 +1925,5 @@
                 L2JMOD_WEDDING_DIVORCE_COSTS            = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
				ALLOW_GK_IN_PVP                         = Boolean.parseBoolean(L2JModSettings.getProperty("AllowGkInPvP", "True"));
+				ALLOW_SOE_IN_PVP                        = Boolean.parseBoolean(L2JModSettings.getProperty("AllowSoEInPvP", "True"));


Index: /trunk/-Gameserver/config/l2jmods.properties
===================================================================
--- /trunk/-Gameserver/config/l2jmods.properties (revision 57)
+++ /trunk/-Gameserver/config/l2jmods.properties (revision 58)
@@ -137,2 +137,6 @@
# Default : True
AllowGkInPvP = True
+
+# If is set to False , players can't use SOE when they are flagged!
+# Default : True
+AllowSoEInPvP = True

 

 

oriste kai ena allo

 

Allow/Restrict Gk If Flagged config

 

Index: /trunk/-Gameserver/java/net/gp/gameserver/model/actor/instance/L2NpcInstance.java
===================================================================
--- /trunk/-Gameserver/java/net/gp/gameserver/model/actor/instance/L2NpcInstance.java (revision 52)
+++ /trunk/-Gameserver/java/net/gp/gameserver/model/actor/instance/L2NpcInstance.java (revision 57)
@@ -86,4 +86,6 @@
import net.gp.gameserver.templates.L2NpcTemplate;
import net.gp.gameserver.templates.L2Weapon;
+import net.gp.gameserver.model.actor.instance.L2PcInstance; 
+import net.gp.gameserver.model.actor.instance.L2PlayableInstance;
import net.gp.util.Rnd;
/**
@@ -1735,4 +1737,20 @@
      * 
      */
+	 
+	 
+	     
+    public void restrict(L2PlayableInstance playable, int val)
+    {
+        if (!(playable instanceof L2PcInstance)) return;
+        L2PcInstance activeChar = (L2PcInstance)playable;
+        if (Config.ALLOW_GK_IN_PVP && activeChar.getPvpFlag() != 0 && this instanceof L2TeleporterInstance)
+        {
+                activeChar.sendMessage("You can't use GK if you're flagged!");
+                return;
+        }
+   }
+    
+
+	 
     public void showChatWindow(L2PcInstance player, int val)
     {
Index: /trunk/-Gameserver/java/net/gp/gameserver/handler/admincommandhandlers/AdminAdmin.java
===================================================================
--- /trunk/-Gameserver/java/net/gp/gameserver/handler/admincommandhandlers/AdminAdmin.java (revision 52)
+++ /trunk/-Gameserver/java/net/gp/gameserver/handler/admincommandhandlers/AdminAdmin.java (revision 57)
@@ -226,8 +226,14 @@
				}

+				else if(type.startsWith("configs")) 
+ 		                                { 
+ 		                                        Config.loadAll(); 
+ 		                                        activeChar.sendMessage("Configs has benn reloaded"); 
+ 		                                } 
+				
			}
			catch(Exception e)
			{
-				activeChar.sendMessage("Usage:  //reload <multisell|skill|npc|htm|item|instancemanager>");
+				activeChar.sendMessage("Usage:  //reload <multisell|skill|npc|htm|item|instancemanager|configs>");
			}
		}
Index: /trunk/-Gameserver/java/net/gp/Config.java
===================================================================
--- /trunk/-Gameserver/java/net/gp/Config.java (revision 56)
+++ /trunk/-Gameserver/java/net/gp/Config.java (revision 57)
@@ -873,4 +873,5 @@
     public static boolean L2JMOD_WEDDING_FORMALWEAR;
     public static int L2JMOD_WEDDING_DIVORCE_COSTS;
+	public static boolean ALLOW_GK_IN_PVP; 

     
@@ -1922,4 +1923,5 @@
                 L2JMOD_WEDDING_FORMALWEAR               = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
                 L2JMOD_WEDDING_DIVORCE_COSTS            = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
+				ALLOW_GK_IN_PVP                         = Boolean.parseBoolean(L2JModSettings.getProperty("AllowGkInPvP", "True"));


@@ -2563,4 +2565,9 @@
         Config.saveHexid(serverId, string, HEXID_FILE);
     }
+    
+    public static void loadAll() 
+ 		    { 
+ 		        load(); 
+ 		    } 

     /**
Index: /trunk/-Gameserver/config/l2jmods.properties
=================================================================
--- /trunk/Gameserver/config/l2jmods.properties (revision 52)
+++ /trunk/Gameserver/config/l2jmods.properties (revision 57)
@@ -133,2 +133,6 @@
# no ";" at the start or end
TvTEventDoorsCloseOpenOnStartEnd =
+
+# If is set to False , players can't use GK when they are flagged!
+# Default : True
+AllowGkInPvP = True

 

den 8elw code des ti 8elw afto quest script :) to sigekrimeno pou 8elw to exi sto http://www.l2sexi.es/  ama katalaves :)

  • 0
Posted

den 8elw code des ti 8elw afto quest script :) to sigekrimeno pou 8elw to exi sto http://www.l2sexi.es/  ama katalaves :)

Δεν νομίζω να υπάρχει κάποιο τέτοιο Share στο Forum. Καλύτερα βάλε τον κώδικα.

  • 0
Posted

Δεν νομίζω να υπάρχει κάποιο τέτοιο Share στο Forum. Καλύτερα βάλε τον κώδικα.

 

to code to exi se ola ta Aio NPC tou Allen ala den boro na to 3exoriso ama alazo apo to script m to dixni error :)

Guest
This topic is now closed to further replies.
×
×
  • Create New...