Jump to content

[Share]TvT Event buffs for participants


Guma!

Recommended Posts

Index: /TrunK/L2JBrasil_CORE/java/com/it/br/Config.java
===================================================================
--- /TrunK/L2JBrasil_CORE/java/com/it/br/Config.java (revision 849)
+++ /TrunK/L2JBrasil_CORE/java/com/it/br/Config.java (revision 850)
@@ -27,9 +27,12 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
import java.util.logging.Logger;
import javolution.util.FastList;
+import javolution.util.FastMap;

import com.it.br.gameserver.model.actor.instance.L2PcInstance;
+import com.it.br.gameserver.util.StringUtil;

/**
@@ -721,5 +724,7 @@
    public static byte    TVT_EVENT_MIN_LVL;
    public static byte    TVT_EVENT_MAX_LVL;
-
+    public static Map<Integer, Integer> TVT_EVENT_FIGHTER_BUFFS; 
+    public static Map<Integer, Integer> TVT_EVENT_MAGE_BUFFS; 
+    
    public static boolean OFFLINE_TRADE_ENABLE; 
    public static boolean OFFLINE_CRAFT_ENABLE; 
@@ -1974,5 +1979,52 @@
                                	}
                                }
-
+                                
+                               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, "\"")); 
+                                         } 
+                                      } 
+                                   } 
+                                } 
                                TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED	= Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventTargetTeamMembersAllowed", "true"));
                        		TVT_EVENT_POTIONS_ALLOWED				= Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventPotionsAllowed", "false"));
Index: /TrunK/L2JBrasil_CORE/java/com/it/br/gameserver/model/entity/TvTEventTeleporter.java
===================================================================
--- /TrunK/L2JBrasil_CORE/java/com/it/br/gameserver/model/entity/TvTEventTeleporter.java (revision 642)
+++ /TrunK/L2JBrasil_CORE/java/com/it/br/gameserver/model/entity/TvTEventTeleporter.java (revision 850)
@@ -21,5 +21,7 @@
import com.it.br.Config;
import com.it.br.gameserver.ThreadPoolManager;
+import com.it.br.gameserver.datatables.SkillTable;
import com.it.br.gameserver.model.L2Effect;
+import com.it.br.gameserver.model.L2Skill;
import com.it.br.gameserver.model.L2Summon;
import com.it.br.gameserver.model.actor.instance.L2PcInstance;
@@ -84,7 +86,5 @@

		_playerInstance.doRevive();
-		_playerInstance.setCurrentCp(_playerInstance.getMaxCp());
-		_playerInstance.setCurrentHp(_playerInstance.getMaxHp());
-		_playerInstance.setCurrentMp(_playerInstance.getMaxMp());
+
		_playerInstance.teleToLocation(_coordinates[0], _coordinates[1], _coordinates[2], false);

@@ -93,4 +93,33 @@
		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();
Index: /TrunK/L2JBrasil_CORE/config/l2jmods.properties
===================================================================
--- /TrunK/L2JBrasil_CORE/config/l2jmods.properties (revision 817)
+++ /TrunK/L2JBrasil_CORE/config/l2jmods.properties (revision 850)
@@ -112,4 +112,13 @@
TvTDoorsToOpen = 
TvTDoorsToClose =
+# 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 =

# --------------------------------------------------------------------------- 

 

Source: http://trac6.assembla.com/L2j-Brasil/changeset/850

 

Creditos: _DS_

Link to comment
Share on other sites

  • 1 year later...
Guest
This topic is now closed to further replies.


×
×
  • Create New...