Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: java/config/l2jmods.properties
- ===================================================================
- --- java/config/l2jmods.properties (revision 4430)
- +++ java/config/l2jmods.properties (working copy)
- @@ -132,3 +132,16 @@
- # ex.: 1;2;3;4;5;6
- # no ";" at the start or end
- TvTEventDoorsCloseOpenOnStartEnd =
- +
- +#---------------------------------------------------------------
- +# Skill Customizations -
- +#---------------------------------------------------------------
- +# Enable to modify skill duration data
- +EnableModifySkillDuration = false
- +# Skill duration list
- +# Format : skillid,newtime;skillid,newtime....
- +# Example : this enable 1h(3600) duration for songs
- +# SkillDurationList = 264,3600;265,3600;266,3600;267,3600;268,3600;\
- +# 269,3600;270,3600;304,3600;305,1200;306,3600;308,3600;349,3600;\
- +# 363,3600;364,3600
- +SkillDurationList =
- \ No newline at end of file
- Index: java/net/sf/l2j/Config.java
- ===================================================================
- --- java/net/sf/l2j/Config.java (revision 4430)
- +++ java/net/sf/l2j/Config.java (working copy)
- @@ -25,10 +25,12 @@
- import java.io.OutputStream;
- import java.math.BigInteger;
- 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 net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- /**
- @@ -882,7 +884,12 @@
- public static boolean L2JMOD_WEDDING_FORMALWEAR;
- public static int L2JMOD_WEDDING_DIVORCE_COSTS;
- - // Packet information
- + /** Enable skill duration mod */
- + public static boolean ENABLE_MODIFY_SKILL_DURATION;
- + public static Map<Integer, Integer> SKILL_DURATION_LIST;
- + public static int MODIFIED_SKILL_COUNT;
- +
- + // Packet information
- /** Count the amount of packets per minute ? */
- public static boolean COUNT_PACKETS = false;
- /** Dump packet count ? */
- @@ -1858,7 +1865,37 @@
- L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingAllowSameSex", "False"));
- L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
- L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
- -
- + ENABLE_MODIFY_SKILL_DURATION = Boolean.valueOf(L2JModSettings.getProperty("EnableModifySkillDuration", "false"));
- +
- + if (ENABLE_MODIFY_SKILL_DURATION)
- + {
- + SKILL_DURATION_LIST = new FastMap<Integer, Integer>();
- + String[] propertySplit;
- + propertySplit = L2JModSettings.getProperty("SkillDurationList", "").split(";");
- + for (String skill : propertySplit)
- + {
- + String[] skillSplit = skill.split(",");
- + if (skillSplit.length != 2)
- + {
- + System.out.println("[skillDurationList]: invalid config property -> SkillDurationList \"" + skill + "\"");
- + }
- + else
- + {
- + try
- + {
- + SKILL_DURATION_LIST.put(Integer.valueOf(skillSplit[0]), Integer.valueOf(skillSplit[1]));
- + }
- + catch (NumberFormatException nfe)
- + {
- + if (!skill.equals(""))
- + {
- + System.out.println("[skillDurationList]: invalid config property -> SkillList \"" + skillSplit[0] + "\"" + skillSplit[1]);
- + }
- + }
- + }
- + }
- + }
- +
- if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
- {
- TVT_EVENT_ENABLED = false;
- Index: java/net/sf/l2j/gameserver/skills/DocumentBase.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/DocumentBase.java (revision 4430)
- +++ java/net/sf/l2j/gameserver/skills/DocumentBase.java (working copy)
- @@ -30,6 +30,7 @@
- import javolution.text.TextBuilder;
- import javolution.util.FastList;
- import javolution.util.FastMap;
- +import net.sf.l2j.Config;
- import net.sf.l2j.gameserver.datatables.SkillTable;
- import net.sf.l2j.gameserver.model.L2Character;
- import net.sf.l2j.gameserver.model.L2Skill;
- @@ -206,6 +207,29 @@
- if (attrs.getNamedItem("time") != null)
- {
- time = Integer.decode(getValue(attrs.getNamedItem("time").getNodeValue(),template));
- + if (Config.ENABLE_MODIFY_SKILL_DURATION)
- + {
- + if (Config.SKILL_DURATION_LIST.containsKey(((L2Skill) template).getId()))
- + {
- + if (((L2Skill) template).getLevel() < 100)
- + {
- + time = Config.SKILL_DURATION_LIST.get(((L2Skill) template).getId());
- + }
- + else if ((((L2Skill) template).getLevel() >= 100) && (((L2Skill) template).getLevel() < 140))
- + {
- + time += Config.SKILL_DURATION_LIST.get(((L2Skill) template).getId());
- + }
- + else if (((L2Skill) template).getLevel() > 140)
- + {
- + time = Config.SKILL_DURATION_LIST.get(((L2Skill) template).getId());
- + }
- + if (Config.DEBUG)
- + {
- + _log.info("*** Skill " + ((L2Skill) template).getName() + " (" + ((L2Skill) template).getLevel() + ") changed duration to " + time + " seconds.");
- + }
- + Config.MODIFIED_SKILL_COUNT += 1;
- + }
- + }
- }
- else time = ((L2Skill) template).getBuffDuration() / 1000 / count;
- boolean self = false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement