Noticias:

Debes de estar registrado para poder ver el contenido indicado. Registrate o Conectate

Menú Principal

Custom Buff Olympiadas

Iniciado por Swarlog, Ago 19, 2022, 12:27 AM

Tema anterior - Siguiente tema

Swarlog

### Eclipse Workspace Patch 1.0
#P L2jSanne_GameServer
Index: head-src/com/l2jsanne/Config.java
===================================================================
--- head-src/com/l2jsanne/Config.java (revision 43)
+++ head-src/com/l2jsanne/Config.java (working copy)
@@ -2913,6 +2913,8 @@
public static boolean OLY_PARTICIPATION_BY_PVP;
public static boolean OLY_PARTICIPATION_BY_PK;
public static int OLY_PARTICIPATION_COUNT;
+ public static List<int[]> CUSTOM_BUFFS_M = new ArrayList<int[]>();
+ public static List<int[]> CUSTOM_BUFFS_F = new ArrayList<int[]>();
//============================================================

public static void loadOlympConfig()
@@ -2972,6 +2974,53 @@
OLY_PARTICIPATION_BY_PK = OLYMPSetting.getProperty("OlympiadParticipationRelated", "All").equalsIgnoreCase("pk") || OLYMPSetting.getProperty("OlympiadParticipationRelated", "All").equalsIgnoreCase("all");
OLY_PARTICIPATION_COUNT = Integer.parseInt(OLYMPSetting.getProperty("OlympiadPartipationCount", "100"));

+ /* OLYMPIAD BUFF CONFIG */
+ String[] propertySplit = OLYMPSetting.getProperty("OlympiadBuffsMage", "1204,2").split(";");
+ CUSTOM_BUFFS_M.clear();
+ for (String buff : propertySplit)
+ {
+ String[] buffSplit = buff.split(",");
+ if (buffSplit.length != 2)
+ _log.warning("OlympiadBuffsMage[Config.load()]: invalid config property -> OlympiadBuffsMage \"" + buff + "\"");
+ else
+ {
+ try
+ {
+ CUSTOM_BUFFS_M.add(new int[]{Integer.parseInt(buffSplit[0]), Integer.parseInt(buffSplit[1])});
+ }
+ catch (NumberFormatException nfe)
+ {
+ if(Config.ENABLE_ALL_EXCEPTIONS)
+ nfe.printStackTrace();
+ if (!buff.isEmpty())
+ _log.warning("OlympiadBuffsMage[Config.load()]: invalid config property -> OlympiadBuffsMage \"" + buff + "\"");
+ }
+ }
+ }
+
+ propertySplit = OLYMPSetting.getProperty("OlympiadBuffsFighter", "1204,2").split(";");
+ CUSTOM_BUFFS_F.clear();
+ for (String buff : propertySplit)
+ {
+ String[] buffSplit = buff.split(",");
+ if (buffSplit.length != 2)
+ _log.warning("OlympiadBuffsFighter[Config.load()]: invalid config property -> OlympiadBuffsFighter \"" + buff + "\"");
+ else
+ {
+ try
+ {
+ CUSTOM_BUFFS_F.add(new int[]{Integer.parseInt(buffSplit[0]), Integer.parseInt(buffSplit[1])});
+ }
+ catch (NumberFormatException nfe)
+ {
+ if(Config.ENABLE_ALL_EXCEPTIONS)
+ nfe.printStackTrace();
+
+ if (!buff.isEmpty())
+ _log.warning("OlympiadBuffsFighter[Config.load()]: invalid config property -> OlympiadBuffsFighter \"" + buff + "\"");
+ }
+ }
+ }

}
catch(Exception e)
Index: config/head/olympiad.properties
===================================================================
--- config/head/olympiad.properties (revision 43)
+++ config/head/olympiad.properties (working copy)
@@ -109,3 +109,14 @@
# Sets the amount required to participate in the Olympics game.
# Note: Only Works if OlympiadParticipationRelated equals All, Pvp or PK!
OlympiadPartipationCount = 100
+
+# ----------------------------------------
+# Custom Olympiad buffs
+#------------------------------------------
+#Buffs for mage classes:
+#Retail: Wind Walk(lvl 2) and Acumen(lvl 1)
+OlympiadBuffsMage = 1204,2;1085,1;1363,1;
+
+#Buffs for fighter classes:
+#Retail: Wind Walk(lvl 2) and Haste(lvl 1)
+OlympiadBuffsFighter = 1204,2;1086,1;1363,1;
Index: head-src/com/l2jsanne/gameserver/model/entity/olympiad/OlympiadGame.java
===================================================================
--- head-src/com/l2jsanne/gameserver/model/entity/olympiad/OlympiadGame.java (revision 43)
+++ head-src/com/l2jsanne/gameserver/model/entity/olympiad/OlympiadGame.java (working copy)
@@ -49,6 +49,7 @@
*
* @author GodKratos
*/
+@SuppressWarnings("unused")
class OlympiadGame
{
protected static final Logger _log = Logger.getLogger(OlympiadGame.class.getName());
@@ -388,31 +389,28 @@
//Wind Walk Buff for Both
L2Skill skill;
SystemMessage sm;
- skill = SkillTable.getInstance().getInfo(1204, 2);
- skill.getEffects(player, player);
- player.broadcastPacket(new MagicSkillUser(player, player, skill.getId(), 2, skill.getHitTime(), 0));
- sm = new SystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
- sm.addSkillName(1204);
- player.sendPacket(sm);
- if (!player.isMageClass())
+ if(!player.isMageClass())
{
- //Haste Buff to Fighters
- skill = SkillTable.getInstance().getInfo(1086, 1);
- skill.getEffects(player, player);
- player.broadcastPacket(new MagicSkillUser(player, player, skill.getId(), 1, skill.getHitTime(), 0));
- sm = new SystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
- sm.addSkillName(1086);
- player.sendPacket(sm);
+ for (int[] buff : Config.CUSTOM_BUFFS_F) //Custom buffs for fighters
+ {
+ skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
+ skill.getEffects(player, player,false,false,false);
+ sm = new SystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
+ sm.addSkillName(buff[0]);
+ player.sendPacket(sm);
+ }
}
else
{
//Acumen Buff to Mages
- skill = SkillTable.getInstance().getInfo(1085, 1);
- skill.getEffects(player, player);
- player.broadcastPacket(new MagicSkillUser(player, player, skill.getId(), 1, skill.getHitTime(), 0));
- sm = new SystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
- sm.addSkillName(1085);
- player.sendPacket(sm);
+ for (int[] buff : Config.CUSTOM_BUFFS_M) //Custom buffs for mystics
+ {
+ skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
+ skill.getEffects(player, player,false,false,false);
+ sm = new SystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
+ sm.addSkillName(buff[0]);
+ player.sendPacket(sm);
+ }
}
}
catch (Exception e)

By: Lekinho