Secret Experience

Secret Experience (https://secretexperience.net/)
-   [Lineage] Java Mods (https://secretexperience.net/lineage-java-mods/)
-   -   [L2JServer] OlyParticipants (https://secretexperience.net/lineage-java-mods/25321-olyparticipants.html)

Mazokista 14-09-2010 05:09 PM

OlyParticipants
 
1 Anexo(s)
Creditos : GUMA


Esse Mod Vc Consegui qui + de 2 Player Participem Das Olympiads :D

Código:

Index: TrunK/*********_CORE/java/config/altsettings.properties
=============================================================
--- TrunK/*********_CORE/java/config/altsettings.properties (revision 1449)
+++ TrunK/*********_CORE/java/config/altsettings.properties (revision 1453)

@@ -190,6 +190,13 @@
 # How many week 1 Olympiad cycle should last, default = 4
 AltOlyWeeks = 4
 
+# Required number of participants for Classed and Non-Classed matches, Default 3 & 5
+# Default: 3
+AltOlyClassedParticipants = 5
+
+# Default: 5
+AltOlyNonClassedParticipants = 9
+

 #-----------------------------------------------------------------
 # Manor Config
 #-----------------------------------------------------------------

Index: TrunK/*********_CORE/java/com/it/br/Config.java
=============================================================
--- TrunK/*********_CORE/java/com/it/br/Config.java (revision 1433)
+++ TrunK/*********_CORE/java/com/it/br/Config.java (revision 1453)

@@ -191,6 +191,8 @@
    public static long ALT_OLY_WPERIOD;
    public static long ALT_OLY_VPERIOD;
    public static int  ALT_OLY_WEEKS;
+    public static int ALT_OLY_CLASSED;
+    public static int ALT_OLY_NONCLASSED;

    public static boolean ALLOW_MANOR;
    public static int ALT_MANOR_REFRESH_TIME;
    public static int ALT_MANOR_REFRESH_MIN;
@@ -1673,6 +1675,8 @@
                    { 
                                ALT_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id)); 
                    }
+                ALT_OLY_CLASSED = Integer.parseInt(AltSettings.getProperty("AltOlyClassedParticipants", "5"));
+                ALT_OLY_NONCLASSED = Integer.parseInt(AltSettings.getProperty("AltOlyNonClassedParticipants", "9"));

                ALLOW_MANOR = Boolean.parseBoolean(AltSettings.getProperty("AllowManor", "False"));
                ALT_MANOR_REFRESH_TIME = Integer.parseInt(AltSettings.getProperty("AltManorRefreshTime","20"));
                ALT_MANOR_REFRESH_MIN  = Integer.parseInt(AltSettings.getProperty("AltManorRefreshMin","00"));

Index: TrunK/*********_CORE/java/com/it/br/gameserver/model/Olympiad/OlympiadManager.java
=============================================================
--- TrunK/*********_CORE/java/com/it/br/gameserver/model/Olympiad/OlympiadManager.java (revision 1427)
+++ TrunK/*********_CORE/java/com/it/br/gameserver/model/Olympiad/OlympiadManager.java (revision 1453)

@@ -23,6 +23,8 @@
 
 import javolution.util.FastList;
 import javolution.util.FastMap;
+
+import com.it.br.Config;

 import com.it.br.gameserver.model.Olympiad.Olympiad.COMP_TYPE;
 import com.it.br.gameserver.model.actor.instance.L2PcInstance;
 import com.it.br.util.Rnd;
@@ -64,7 +66,7 @@
 
        try{
            sortClassBasedOpponents();
-            _nonClassBasedParticipants = pickOpponents(Olympiad._nonClassBasedRegisters);
+            _nonClassBasedParticipants = pickOpponents(Olympiad._nonClassBasedRegisters, false);
        }catch(Exception e){e.printStackTrace();}
 
        int classIndex = 0;
@@ -217,10 +219,11 @@
 
        for (List<L2PcInstance> classed : Olympiad._classBasedRegisters.values())
        {
-            if (classed.size() == 0) continue;
+            if (classed.size() < Config.ALT_OLY_CLASSED)
+                                continue;

 
            try{
-              result = pickOpponents(classed);
[COLOR="DeepSkyBlue"]+              result = pickOpponents(classed, true);
            }catch(Exception e){e.printStackTrace();}
 
            if (result.size() == 0)
@@ -242,13 +245,15 @@
        return (_olympiadInstances == null)? null : _olympiadInstances;
    }
 
-    private Map<Integer, List<L2PcInstance>> pickOpponents(List<L2PcInstance> list) throws Exception
+    private Map<Integer, List<L2PcInstance>> pickOpponents(List<L2PcInstance> list, boolean classed) throws Exception
    {
        Map<Integer, List<L2PcInstance>> result =
            new FastMap<Integer, List<L2PcInstance>>();
 
        if (list.size() == 0)
            return result;
+        if (!classed && list.size() < Config.ALT_OLY_NONCLASSED)
+            return result;

 
        int loopCount = (list.size() / 2);



Horários baseados na GMT -3. Agora são 06:50 AM.

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