瀏覽代碼

TvT Event buffs for participants

_DS_ 16 年之前
父節點
當前提交
b826ec86d4

+ 11 - 0
L2_GameServer/java/config/l2jmods.properties

@@ -183,6 +183,17 @@ TvTRewardTeamTie = False
 # Default: 0
 TvTEventEffectsRemoval = 0
 
+# Fighter-class participants will be buffed with those buffs each respawn
+# Format: skill1Id,skill1Level;skill2Id,skill2Level...
+# Example: 1504,1;1501,1;1502,1;1499,1
+TvTEventFighterBuffs =
+
+# Mage-class participants will be buffed with those buffs each respawn
+# Format: skill1Id,skill1Level;skill2Id,skill2Level...
+# Example: 1504,1;1500,1;1501,1;1085,3
+TvTEventMageBuffs =
+
+
 # ---------------------------------------------------------------------------
 # L2J Banking System
 # ---------------------------------------------------------------------------

+ 50 - 0
L2_GameServer/java/net/sf/l2j/Config.java

@@ -560,6 +560,8 @@ public final class Config
 	public static byte TVT_EVENT_MIN_LVL;
 	public static byte TVT_EVENT_MAX_LVL;
 	public static int TVT_EVENT_EFFECTS_REMOVAL;
+	public static Map<Integer, Integer> TVT_EVENT_FIGHTER_BUFFS;
+	public static Map<Integer, Integer> TVT_EVENT_MAGE_BUFFS;
 	public static boolean L2JMOD_ALLOW_WEDDING;
 	public static int L2JMOD_WEDDING_PRICE;
 	public static boolean L2JMOD_WEDDING_PUNISH_INFIDELITY;
@@ -1861,6 +1863,54 @@ public final class Config
 												_log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToClose \"", door, "\""));
 										}
 									}
+
+									propertySplit = L2JModSettings.getProperty("TvTEventFighterBuffs", "").split(";");
+									if (!propertySplit[0].equals(""))
+									{
+										TVT_EVENT_FIGHTER_BUFFS = new FastMap<Integer, Integer>();
+										for (String skill : propertySplit)
+										{
+											String[] skillSplit = skill.split(",");
+											if (skillSplit.length != 2)
+												_log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventFighterBuffs \"", skill, "\""));
+											else
+											{
+												try
+												{
+													TVT_EVENT_FIGHTER_BUFFS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
+												}
+												catch (NumberFormatException nfe)
+												{
+													if (!skill.isEmpty())
+														_log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventFighterBuffs \"", skill, "\""));
+												}
+											}
+										}
+									}
+
+									propertySplit = L2JModSettings.getProperty("TvTEventMageBuffs", "").split(";");
+									if (!propertySplit[0].equals(""))
+									{
+										TVT_EVENT_MAGE_BUFFS = new FastMap<Integer, Integer>();
+										for (String skill : propertySplit)
+										{
+											String[] skillSplit = skill.split(",");
+											if (skillSplit.length != 2)
+												_log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventMageBuffs \"", skill, "\""));
+											else
+											{
+												try
+												{
+													TVT_EVENT_MAGE_BUFFS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
+												}
+												catch (NumberFormatException nfe)
+												{
+													if (!skill.isEmpty())
+														_log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventMageBuffs \"", skill, "\""));
+												}
+											}
+										}
+									}
 								}
 							}
 						}

+ 33 - 3
L2_GameServer/java/net/sf/l2j/gameserver/model/entity/TvTEventTeleporter.java

@@ -16,6 +16,8 @@ package net.sf.l2j.gameserver.model.entity;
 
 import net.sf.l2j.Config;
 import net.sf.l2j.gameserver.ThreadPoolManager;
+import net.sf.l2j.gameserver.datatables.SkillTable;
+import net.sf.l2j.gameserver.model.L2Skill;
 import net.sf.l2j.gameserver.model.actor.L2Summon;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.util.Rnd;
@@ -73,9 +75,7 @@ public class TvTEventTeleporter implements Runnable
 			_playerInstance.stopAllEffectsExceptThoseThatLastThroughDeath();
 
 		_playerInstance.doRevive();
-		_playerInstance.setCurrentCp(_playerInstance.getMaxCp());
-		_playerInstance.setCurrentHp(_playerInstance.getMaxHp());
-		_playerInstance.setCurrentMp(_playerInstance.getMaxMp());
+
 		_playerInstance.setInstanceId(0);
 		_playerInstance.teleToLocation( _coordinates[ 0 ] + Rnd.get(101)-50, _coordinates[ 1 ] + Rnd.get(101)-50, _coordinates[ 2 ], false );
 		
@@ -84,6 +84,36 @@ public class TvTEventTeleporter implements Runnable
 		else
 			_playerInstance.setTeam(0);
 		
+		L2Skill skill;
+		if (_playerInstance.isMageClass())
+		{
+			if (Config.TVT_EVENT_MAGE_BUFFS != null && !Config.TVT_EVENT_MAGE_BUFFS.isEmpty())
+			{
+				for (int i : Config.TVT_EVENT_MAGE_BUFFS.keySet())
+				{
+					skill = SkillTable.getInstance().getInfo(i, Config.TVT_EVENT_MAGE_BUFFS.get(i));
+					if (skill != null)
+						skill.getEffects(_playerInstance, _playerInstance);
+				}
+			}
+		}
+		else
+		{
+			if (Config.TVT_EVENT_FIGHTER_BUFFS != null && !Config.TVT_EVENT_FIGHTER_BUFFS.isEmpty())
+			{
+				for (int i : Config.TVT_EVENT_FIGHTER_BUFFS.keySet())
+				{
+					skill = SkillTable.getInstance().getInfo(i, Config.TVT_EVENT_FIGHTER_BUFFS.get(i));
+					if (skill != null)
+						skill.getEffects(_playerInstance, _playerInstance);
+				}
+			}
+		}
+
+		_playerInstance.setCurrentCp(_playerInstance.getMaxCp());
+		_playerInstance.setCurrentHp(_playerInstance.getMaxHp());
+		_playerInstance.setCurrentMp(_playerInstance.getMaxMp());
+
 		_playerInstance.broadcastStatusUpdate();
 		_playerInstance.broadcastUserInfo();
 	}