Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P aCis_gameserver
- Index: java/net/sf/l2j/gameserver/handler/SkillHandler.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/SkillHandler.java (revision 22)
- +++ java/net/sf/l2j/gameserver/handler/SkillHandler.java (working copy)
- @@ -24,6 +24,7 @@
- import net.sf.l2j.gameserver.handler.skillhandlers.CpDamPercent;
- import net.sf.l2j.gameserver.handler.skillhandlers.Craft;
- import net.sf.l2j.gameserver.handler.skillhandlers.Disablers;
- +import net.sf.l2j.gameserver.handler.skillhandlers.Disarm;
- import net.sf.l2j.gameserver.handler.skillhandlers.DrainSoul;
- import net.sf.l2j.gameserver.handler.skillhandlers.Dummy;
- import net.sf.l2j.gameserver.handler.skillhandlers.Extractable;
- @@ -92,6 +93,7 @@
- registerSkillHandler(new Sweep());
- registerSkillHandler(new TakeCastle());
- registerSkillHandler(new Unlock());
- + registerSkillHandler(new Disarm());
- }
- public void registerSkillHandler(ISkillHandler handler)
- Index: java/net/sf/l2j/gameserver/model/CharEffectList.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/CharEffectList.java (revision 22)
- +++ java/net/sf/l2j/gameserver/model/CharEffectList.java (working copy)
- @@ -580,7 +580,14 @@
- effectList = _buffs;
- }
- -
- + if (effect.getSkill().getId() >= 3080 && effect.getSkill().getId() <= 3259)
- + {
- + _owner.removeStatsByOwner(effect);
- + effectList.remove(effect);
- + effect.getShowIcon();
- +
- + return;
- + }
- if ("none".equals(effect.getStackType()))
- {
- // Remove Func added by this effect from the L2Character Calculator
- @@ -692,8 +699,7 @@
- }
- // Remove first buff when buff list is full
- - if (!doesStack(newSkill) && !newSkill.is7Signs())
- - {
- + if (!doesStack(newSkill) && !newSkill.is7Signs() && !(newSkill.getId() >= 3080 && newSkill.getId() <= 3259 && newSkill.getSkillType() == L2SkillType.BUFF)){
- int effectsToRemove = getBuffCount() - _owner.getMaxBuffCount();
- if (effectsToRemove >= 0)
- {
- @@ -743,7 +749,14 @@
- _buffs.add(pos, newEffect);
- }
- }
- -
- + if (newEffect.getSkill().getId() >= 3080 && newEffect.getSkill().getId() <= 3259)
- + {
- + if (newEffect.setInUse(true))
- + _owner.addStatFuncs(newEffect.getStatFuncs());
- +
- + return;
- + }
- +
- // Check if a stack group is defined for this effect
- if ("none".equals(newEffect.getStackType()))
- {
- Index: java/net/sf/l2j/gameserver/model/entity/SoloEvent.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/entity/SoloEvent.java (revision 0)
- +++ java/net/sf/l2j/gameserver/model/entity/SoloEvent.java (revision 0)
- @@ -0,0 +1,201 @@
- +/*
- + * This program is free software: you can redistribute it and/or modify it under
- + * the terms of the GNU General Public License as published by the Free Software
- + * Foundation, either version 3 of the License, or (at your option) any later
- + * version.
- + *
- + * This program is distributed in the hope that it will be useful, but WITHOUT
- + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- + * details.
- + *
- + * You should have received a copy of the GNU General Public License along with
- + * this program. If not, see <http://www.gnu.org/licenses/>.
- + */
- +package net.sf.l2j.gameserver.model.entity;
- +
- +import java.util.Vector;
- +
- +import net.sf.l2j.gameserver.ThreadPoolManager;
- +import net.sf.l2j.gameserver.datatables.NpcTable;
- +import net.sf.l2j.gameserver.datatables.SpawnTable;
- +import net.sf.l2j.gameserver.datatables.MapRegionTable.TeleportWhereType;
- +import net.sf.l2j.gameserver.model.L2Spawn;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +import net.sf.l2j.gameserver.skills.AbnormalEffect;
- +import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate;
- +/**
- + * @author Anarchy
- + *
- + */
- +public class SoloEvent
- +{
- + public static boolean full = false,
- + start = false;
- + public static int highLs = 0,
- + topLs = 0;
- + private static String playerName = null;
- + public static L2PcInstance player = null;
- + public static long enterTime = 0;
- + private static Vector<L2Spawn> _monsters = new Vector<L2Spawn>();
- + public static Vector<String> _savedPlayers = new Vector<String>();
- +
- + public static void getInstance()
- + {
- + ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()
- + {
- + @Override
- + public void run()
- + {
- + if (start)
- + {
- + start = false;
- + startEvent();
- + return;
- + }
- + }
- + }, 5000, 5000);
- + }
- +
- + private static void startEvent()
- + {
- + enterTime = System.currentTimeMillis();
- + playerName = player.getName();
- + player.teleToLocation(184133, 114298, -8221,1);
- + player.startAbnormalEffect(AbnormalEffect.ROOT);
- + player.setIsParalyzed(true);
- + player.sendMessage("10 seconds till the monsters get spawned.");
- + wait(10);
- + player.stopAbnormalEffect(AbnormalEffect.ROOT);
- + player.setIsParalyzed(false);
- + spawnMonsters();
- + player.sendMessage("The monsters were spawned. You have 2 minutes and 50 seconds to kill as many as possible.");
- + wait(50);
- + if (!checkPlayer())
- + {
- + return;
- + }
- + wait(30);
- + if (!checkPlayer())
- + {
- + return;
- + }
- + wait(30);
- + if (!checkPlayer())
- + {
- + return;
- + }
- + wait(30);
- + if (!checkPlayer())
- + {
- + return;
- + }
- + wait(30);
- + if (!checkPlayer())
- + {
- + return;
- + }
- + player.sendMessage("The event is over. You were rewarded and teleported back to Giran.");
- + reward();
- + }
- +
- + private static boolean checkPlayer()
- + {
- + if (player == null || !player.isOnline())
- + {
- + _savedPlayers.add(playerName);
- + playerName = null;
- + highLs = 0;
- + topLs = 0;
- + full = false;
- + enterTime = 0;
- + for (L2Spawn s : _monsters)
- + {
- + s.getLastSpawn().deleteMe();
- + s.stopRespawn();
- + SpawnTable.getInstance().deleteSpawn(s, false);
- + }
- + _monsters.clear();
- + return false;
- + }
- +
- + return true;
- + }
- +
- + private static void reward()
- + {
- + player.addItem("Solo Event.", 8762, topLs, player, true);
- + player.addItem("Solo Event.", 8752, highLs, player, true);
- + player.teleToLocation(TeleportWhereType.Town);
- + player = null;
- + playerName = null;
- + highLs = 0;
- + topLs = 0;
- + full = false;
- + enterTime = 0;
- + for (L2Spawn s : _monsters)
- + {
- + s.getLastSpawn().deleteMe();
- + s.stopRespawn();
- + SpawnTable.getInstance().deleteSpawn(s, false);
- + }
- + _monsters.clear();
- + }
- +
- + private static void spawnMonsters()
- + {
- + spawnAMonster(184868, 114281, -8219);
- + spawnAMonster(185044, 114442, -8219);
- + spawnAMonster(184880, 114720, -8219);
- + spawnAMonster(185206, 115010, -8219);
- + spawnAMonster(185474, 114886, -8219);
- + spawnAMonster(185789, 115153, -8219);
- + spawnAMonster(186002, 115058, -8219);
- + spawnAMonster(186077, 114780, -8219);
- + spawnAMonster(186018, 114594, -8219);
- + spawnAMonster(186503, 114608, -8219);
- + spawnAMonster(186717, 115616, -8219);
- + spawnAMonster(186285, 115503, -8219);
- + spawnAMonster(185990, 115797, -8219);
- + spawnAMonster(185698, 115763, -8219);
- + spawnAMonster(185571, 115514, -8219);
- + spawnAMonster(185269, 115602, -8219);
- + spawnAMonster(184880, 115599, -8219);
- + spawnAMonster(185027, 115063, -8219);
- + spawnAMonster(185220, 114434, -8219);
- + spawnAMonster(185616, 113609, -8219);
- + }
- +
- + private static void spawnAMonster(int x, int y, int z)
- + {
- + L2Spawn _monster = null;
- + L2NpcTemplate monster = NpcTable.getInstance().getTemplate(65527);
- +
- + try
- + {
- + _monster = new L2Spawn(monster);
- + _monster.setLocx(x);
- + _monster.setLocy(y);
- + _monster.setLocz(z);
- + _monster.setHeading(1);
- + _monster.setRespawnDelay(15);
- + _monster.init();
- + _monster.getLastSpawn().decayMe();
- + _monster.getLastSpawn().spawnMe(_monster.getLastSpawn().getX(), _monster.getLastSpawn().getY(), _monster.getLastSpawn().getZ());
- + SpawnTable.getInstance().addNewSpawn(_monster, false);
- + _monsters.add(_monster);
- + }
- + catch (Exception e)
- + { }
- + }
- +
- + private static void wait(int seconds)
- + {
- + try
- + {
- + Thread.sleep(seconds*1000);
- + }
- + catch (Exception e)
- + { }
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/model/L2Clan.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/L2Clan.java (revision 22)
- +++ java/net/sf/l2j/gameserver/model/L2Clan.java (working copy)
- @@ -465,6 +465,7 @@
- case 1002:
- case 2001:
- case 2002:
- +
- return 10;
- }
- return 0;
- @@ -1498,7 +1499,7 @@
- * <b>This method DOESN'T update the database.</b>
- * @param value : The total amount to set to _reputationScore.
- */
- - private void setReputationScore(int value)
- + public void setReputationScore(int value)
- {
- // That check is used to see if it needs a refresh.
- final boolean needRefresh = (_reputationScore > 0 && value <= 0) || (value > 0 && _reputationScore <= 0);
- @@ -2028,6 +2029,47 @@
- increaseClanLevel = true;
- }
- break;
- + case 8:
- + // Upgrade to 9
- + if(getReputationScore() >= 40000 && player.getInventory().getItemByItemId(1419) != null && getMembersCount() >= 140)
- + {
- + // itemId 1419 == Blood Mark
- + if (player.destroyItemByItemId("ClanLvl", 1419, 50, player.getTarget(), false))
- + {
- + setReputationScore(getReputationScore() - 40000, true);
- + SystemMessage cr = new SystemMessage(SystemMessageId.S1_DEDUCTED_FROM_CLAN_REP);
- + cr.addNumber(40000);
- + player.sendPacket(cr);
- + cr = null;
- + SystemMessage sm = new SystemMessage(SystemMessageId.DISSAPEARED_ITEM);
- + sm.addItemName(1419);
- + sm.addNumber(50);
- + player.sendPacket(sm);
- + increaseClanLevel = true;
- + }
- + }
- + break;
- + case 9:
- + // Upgrade to 10
- + if(getReputationScore() >= 40000 && player.getInventory().getItemByItemId(3874) != null && getMembersCount() >= 140)
- + {
- + // itemId 3874 == Alliance Manifesto
- + if (player.destroyItemByItemId("ClanLvl", 3874, 5, player.getTarget(), false))
- + {
- + setReputationScore(getReputationScore() - 40000);
- + SystemMessage cr = new SystemMessage(SystemMessageId.S1_DEDUCTED_FROM_CLAN_REP);
- + cr.addNumber(40000);
- + player.sendPacket(cr);
- + cr = null;
- + SystemMessage sm = new SystemMessage(SystemMessageId.ITEM_CANNOT_EXCHANGE);
- + sm.addItemName(3874);
- + sm.addNumber(5);
- + player.sendPacket(sm);
- + increaseClanLevel = true;
- + }
- +
- + }
- + break;
- default:
- return false;
- }
- Index: java/net/sf/l2j/gameserver/handler/skillhandlers/Disablers.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/skillhandlers/Disablers.java (revision 22)
- +++ java/net/sf/l2j/gameserver/handler/skillhandlers/Disablers.java (working copy)
- @@ -16,9 +16,13 @@
- import java.util.logging.Logger;
- +import javolution.util.FastList;
- +
- +import net.sf.l2j.gameserver.ThreadPoolManager;
- import net.sf.l2j.gameserver.ai.CtrlEvent;
- import net.sf.l2j.gameserver.ai.CtrlIntention;
- import net.sf.l2j.gameserver.ai.L2AttackableAI;
- +import net.sf.l2j.gameserver.datatables.SkillTable;
- import net.sf.l2j.gameserver.handler.ISkillHandler;
- import net.sf.l2j.gameserver.model.L2Effect;
- import net.sf.l2j.gameserver.model.L2Object;
- @@ -35,6 +39,7 @@
- import net.sf.l2j.gameserver.skills.Formulas;
- import net.sf.l2j.gameserver.skills.Stats;
- import net.sf.l2j.gameserver.templates.skills.L2SkillType;
- +import net.sf.l2j.util.Rnd;
- /**
- * This Handles Disabler skills
- @@ -62,7 +67,27 @@
- };
- protected static final Logger _log = Logger.getLogger(Disablers.class.getName());
- -
- + public class Canc implements Runnable{
- + L2PcInstance j;
- + FastList<L2Effect> l;
- +
- + public Canc(L2PcInstance p,FastList<L2Effect> f){
- + j = p;
- + l = f;
- + }
- +
- + public void run(){
- + if(l.isEmpty())
- + return;
- + for(L2Effect b : l)
- + {
- + L2Skill k = SkillTable.getInstance().getInfo(b.getSkill().getId(), b.getLevel());
- + if(k != null)
- + k.getEffects(j, j);
- + }
- + l.clear();
- + }
- + }
- @Override
- public void useSkill(L2Character activeChar, L2Skill skill, L2Object[] targets)
- {
- @@ -335,7 +360,30 @@
- break;
- }
- }
- -
- + L2PcInstance p = null;
- + if(activeChar instanceof L2PcInstance)
- + p = (L2PcInstance) activeChar;
- +
- + if(p != null){
- + L2Effect[] l = p.getAllEffects();
- + int r = Rnd.get(6);
- + if(l.length < r){}
- + int i = 0;
- + for(L2Effect h : l){
- + int id = h.getSkill().getId();
- + if(id == 4082 || id == 4515 || id == 110 || id == 111 || id == 1323 || id == 1325)
- + continue;
- + if(i == r)
- + break;
- +
- + i++;
- + p.addRemovedBuff(h);
- + h.exit();
- + }
- + ThreadPoolManager.getInstance().scheduleGeneral(new Canc(p,p.getRemovedBuffs()), 6000);
- + }
- + // Cannot cancel skills 4082, 4215, 4515, 110, 111, 1323, 1325
- +
- if (skill.hasSelfEffects())
- {
- final L2Effect effect = activeChar.getFirstEffect(skill.getId());
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java (revision 0)
- @@ -0,0 +1,83 @@
- +package net.sf.l2j.gameserver.skills.effects;
- +
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.network.SystemMessageId;
- +import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
- +import net.sf.l2j.gameserver.skills.Env;
- +import net.sf.l2j.gameserver.templates.skills.L2EffectType;
- +import net.sf.l2j.gameserver.templates.skills.L2SkillType;
- +
- +
- +/**
- + * @author Lineal
- + */
- +public final class EffectDeflectBuff extends L2Effect
- +{
- + /**
- + * @param env
- + * @param template
- + */
- + public EffectDeflectBuff(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + /*
- + * (non-Javadoc)
- + *
- + * @see com.l2jfrozen.gameserver.model.L2Effect#getEffectType()
- + */
- + @Override
- + public L2EffectType getEffectType()
- + {
- + return L2EffectType.PREVENT_BUFF;
- + }
- +
- + /*
- + * (non-Javadoc)
- + *
- + * @see com.l2jfrozen.gameserver.model.L2Effect#onActionTime()
- + */
- + @Override
- + public boolean onActionTime()
- + {
- + // Only cont skills shouldn't end
- + if(getSkill().getSkillType() != L2SkillType.CONT)
- + return false;
- +
- + double manaDam = calc();
- +
- + if(manaDam > getEffected().getCurrentMp())
- + {
- + SystemMessage sm = new SystemMessage(SystemMessageId.SKILL_REMOVED_DUE_LACK_MP);
- + getEffected().sendPacket(sm);
- + return false;
- + }
- +
- + getEffected().reduceCurrentMp(manaDam);
- + return true;
- + }
- +
- + /*
- + * (non-Javadoc)
- + *
- + * @see com.l2jfrozen.gameserver.model.L2Effect#onStart()
- + */
- + @Override
- + public boolean onStart()
- + {
- + getEffected().setIsBuffProtected(true);
- + return true;
- + }
- +
- + /*
- + * (non-Javadoc)
- + *
- + * @see com.l2jfrozen.gameserver.model.L2Effect#onExit()
- + */
- + @Override
- + public void onExit()
- + {
- + getEffected().setIsBuffProtected(false);
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/model/actor/L2Character.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/L2Character.java (revision 22)
- +++ java/net/sf/l2j/gameserver/model/actor/L2Character.java (working copy)
- @@ -136,6 +136,17 @@
- */
- public abstract class L2Character extends L2Object
- {
- + private boolean _isBuffProtected = false; //Protect From Debuffs
- + public final void setIsBuffProtected(boolean value)
- + {
- + _isBuffProtected = value;
- + }
- +
- + public boolean isBuffProtected()
- + {
- + return _isBuffProtected;
- + }
- +
- public static final Logger _log = Logger.getLogger(L2Character.class.getName());
- private Set<L2Character> _attackByList;
- Index: java/net/sf/l2j/gameserver/handler/itemhandlers/SoloEventTeleportationCube.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/itemhandlers/SoloEventTeleportationCube.java (revision 0)
- +++ java/net/sf/l2j/gameserver/handler/itemhandlers/SoloEventTeleportationCube.java (revision 0)
- @@ -0,0 +1,83 @@
- +/*
- + * This program is free software: you can redistribute it and/or modify it under
- + * the terms of the GNU General Public License as published by the Free Software
- + * Foundation, either version 3 of the License, or (at your option) any later
- + * version.
- + *
- + * This program is distributed in the hope that it will be useful, but WITHOUT
- + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- + * details.
- + *
- + * You should have received a copy of the GNU General Public License along with
- + * this program. If not, see <http://www.gnu.org/licenses/>.
- + */
- +package net.sf.l2j.gameserver.handler.itemhandlers;
- +
- +import javolution.text.TextBuilder;
- +
- +import net.sf.l2j.gameserver.handler.IItemHandler;
- +import net.sf.l2j.gameserver.model.L2ItemInstance;
- +import net.sf.l2j.gameserver.model.actor.L2Playable;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +import net.sf.l2j.gameserver.model.entity.SoloEvent;
- +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
- +/**
- + * @author Anarchy
- + *
- + */
- +public class SoloEventTeleportationCube implements IItemHandler
- +{
- + public void useItem(L2Playable playable, L2ItemInstance item, boolean forceUse)
- + {
- + if (!(playable instanceof L2PcInstance))
- + {
- + return;
- + }
- +
- + L2PcInstance player = (L2PcInstance)playable;
- +
- + if (player.isInOlympiadMode())
- + {
- + player.sendMessage("You may not enter Solo Event while being in olympiad mode.");
- + return;
- + }
- + if (player.getPvpFlag() > 0 || player.getKarma() > 0)
- + {
- + player.sendMessage("You may not enter Solo Event while fighting.");
- + return;
- + }
- + if (player.getActiveTradeList() != null)
- + {
- + player.sendMessage("You may not enter Solo Event while trading.");
- + return;
- + }
- + if (player.getActiveWarehouse() != null)
- + {
- + player.sendMessage("You may not enter Solo Event while using the warehouse.");
- + return;
- + }
- + if (SoloEvent.player == player)
- + {
- + player.sendMessage("You can't use this while being in a Solo Event.");
- + return;
- + }
- +
- + NpcHtmlMessage htm = new NpcHtmlMessage(0);
- + TextBuilder tb = new TextBuilder("<html><body>");
- + tb.append("<center>Solo Event room is "+(SoloEvent.full ? "full." : "empty."));
- + if (SoloEvent.full)
- + {
- + tb.append("<br1>Player inside: "+SoloEvent.player.getName());
- + tb.append("<br1>Time left: "+(180-((System.currentTimeMillis()-SoloEvent.enterTime)/1000) < 60 ? 180-((System.currentTimeMillis()-SoloEvent.enterTime)/1000)+" seconds." : 3-((System.currentTimeMillis()-SoloEvent.enterTime)/1000/60)+" minutes."));
- + }
- + else
- + {
- + tb.append("<br><a action=\"bypass -h bp_enterSoloEvent\">Enter Solo Event.</a>");
- + }
- + tb.append("</center></body></html>");
- + htm.setHtml(tb.toString());
- +
- + player.sendPacket(htm);
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java (revision 25)
- +++ java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java (working copy)
- @@ -18,6 +18,7 @@
- import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Online;
- import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Siege;
- import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Vote;
- +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.VoteRewardMe;
- import gnu.trove.map.hash.TIntObjectHashMap;
- @@ -43,6 +44,11 @@
- registerHandler(new EventJoin());
- registerHandler(new Vote());
- registerHandler(new Siege());
- + if(Config.VOTE_BUFF_ENABLED)
- + {
- + registerHandler( new VoteRewardMe());
- + }
- +
- }
- public void registerHandler(IVoicedCommandHandler handler)
- Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (revision 22)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (working copy)
- @@ -17,11 +17,13 @@
- import java.text.SimpleDateFormat;
- import java.util.Calendar;
- import java.util.Date;
- +import java.util.Vector;
- import net.sf.l2j.Config;
- import net.sf.l2j.gameserver.Announcements;
- import net.sf.l2j.gameserver.GameTimeController;
- import net.sf.l2j.gameserver.SevenSigns;
- +import net.sf.l2j.gameserver.cache.HtmCache;
- import net.sf.l2j.gameserver.datatables.AdminCommandAccessRights;
- import net.sf.l2j.gameserver.datatables.GmListTable;
- import net.sf.l2j.gameserver.datatables.MapRegionTable;
- @@ -64,7 +66,7 @@
- {
- long _daysleft;
- SimpleDateFormat df = new SimpleDateFormat("dd MM yyyy");
- -
- + public static Vector<L2PcInstance> _onlineplayers = new Vector<L2PcInstance>();
- @Override
- protected void readImpl()
- {
- @@ -75,13 +77,36 @@
- protected void runImpl()
- {
- final L2PcInstance activeChar = getClient().getActiveChar();
- + _onlineplayers.add(activeChar);
- if (activeChar == null)
- {
- _log.warning("EnterWorld failed! activeChar is null...");
- getClient().closeNow();
- return;
- }
- -
- +
- + if (Config.ALLOW_TITLE_PANEL)
- + {
- + StringBuilder debian = new StringBuilder();
- + NpcHtmlMessage d = new NpcHtmlMessage(1);
- +
- + debian.append("<html><head></head>" +
- + "<body>" +
- + "<center>" +
- + "This panel, allows you to change your title.<br>" +
- + "<br>" +
- + "Option 1:<br>" +
- + "<button value=\"Normal Title\" action=\"bypass -h title1\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">" +
- + "<br>" +
- + "Option 2:<br>" +
- + "<button value=\"PvP/PK Title\" action=\"bypass -h title2\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">" +
- + "<br>" +
- + "</center></body></html>");
- +
- + d.setHtml(debian.toString());
- + activeChar.sendPacket(d);
- + }
- +
- if (L2World.getInstance().findObject(activeChar.getObjectId()) != null)
- {
- if (Config.DEBUG)
- @@ -246,7 +271,18 @@
- if (!activeChar.isGM() && (!activeChar.isInSiege() || activeChar.getSiegeState() < 2) && activeChar.isInsideZone(ZoneId.SIEGE))
- activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);
- }
- -
- + public void warnAllPlayers()
- + {
- + for (L2PcInstance player : _onlineplayers)
- + {
- + String file = "data/html/chaos/warning.htm";
- + String html = HtmCache.getInstance().getHtm(file);
- + NpcHtmlMessage warning = new NpcHtmlMessage(1);
- + warning.setHtml(html);
- +
- + player.sendPacket(warning);
- + }
- + }
- private void onEnterAio(L2PcInstance activeChar)
- {
- long now = Calendar.getInstance().getTimeInMillis();
- Index: java/net/sf/l2j/gameserver/network/serverpackets/SystemMessage.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/serverpackets/SystemMessage.java (revision 22)
- +++ java/net/sf/l2j/gameserver/network/serverpackets/SystemMessage.java (working copy)
- @@ -110,7 +110,7 @@
- private SMParam[] _params;
- private int _paramIndex;
- - private SystemMessage(final SystemMessageId smId)
- + public SystemMessage(final SystemMessageId smId)
- {
- final int paramCount = smId.getParamCount();
- _smId = smId;
- Index: java/net/sf/l2j/gameserver/model/L2Effect.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/L2Effect.java (revision 22)
- +++ java/net/sf/l2j/gameserver/model/L2Effect.java (working copy)
- @@ -389,7 +389,30 @@
- smsg.addSkillName(_skill);
- getEffected().sendPacket(smsg);
- }
- -
- + if (getEffected() instanceof L2PcInstance)
- + {
- + L2Effect firstAug = null;
- + int activeAugs = 0;
- +
- + for (L2Effect e : getEffected().getAllEffects())
- + {
- + if (e.getSkill().getId() >= 3080 && e.getSkill().getId() <= 3259 && e.getSkillType() == L2SkillType.BUFF)
- + {
- + if (firstAug == null)
- + {
- + firstAug = e;
- + }
- +
- + activeAugs++;
- + }
- + }
- +
- + if (activeAugs >= 3) // at 2 make an int config.
- + {
- + if (firstAug != null)
- + firstAug.exit();
- + }
- + }
- if (_period != 0)
- {
- startEffectTask();
- Index: java/net/sf/l2j/gameserver/handler/itemhandlers/ScrollOfClanRepPoints.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/itemhandlers/ScrollOfClanRepPoints.java (revision 0)
- +++ java/net/sf/l2j/gameserver/handler/itemhandlers/ScrollOfClanRepPoints.java (revision 0)
- @@ -0,0 +1,60 @@
- +/*
- + * This program is free software; you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation; either version 2, or (at your option)
- + * any later version.
- + *
- + * This program is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + * GNU General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with this program; if not, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +package net.sf.l2j.gameserver.handler.itemhandlers;
- +
- +import net.sf.l2j.gameserver.handler.IItemHandler;
- +import net.sf.l2j.gameserver.model.L2ItemInstance;
- +import net.sf.l2j.gameserver.model.actor.L2Playable;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +
- +
- +/**
- + * @author Stefoulis15
- + **/
- +public class ScrollOfClanRepPoints implements IItemHandler
- +{
- + private static final int ITEM_IDS[] = { 9190 };
- +
- +
- + /* (non-Javadoc)
- + * @see net.sf.l2j.gameserver.handler.IItemHandler#useItem(net.sf.l2j.gameserver.model.actor.L2Playable, net.sf.l2j.gameserver.model.L2ItemInstance, boolean)
- + */
- + @Override
- + public void useItem(L2Playable playable, L2ItemInstance item, boolean forceUse)
- + {L2PcInstance activeChar = (L2PcInstance) playable;
- + if (activeChar.getClan() == null)
- + {
- + activeChar.sendMessage("You do not have any clan!");
- + return;
- + }
- +
- + else if (!activeChar.isClanLeader())
- + {
- + activeChar.sendMessage("You are not clan leader!");
- + return;
- + }
- + activeChar.getClan().setReputationScore(1000);
- + activeChar.sendMessage("Your clan's reputation score is now " + activeChar.getClan().getReputationScore() + "");
- + activeChar.broadcastUserInfo();
- + playable.destroyItem("Consume", item.getObjectId(), 1, null, true);
- +}
- +
- +
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminPledge.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminPledge.java (revision 22)
- +++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminPledge.java (working copy)
- @@ -114,8 +114,8 @@
- {
- final int level = Integer.parseInt(st.nextToken());
- - if (level >= 0 && level < 9)
- - {
- + if (level>=0 && level <11)
- + {
- player.getClan().changeLevel(level);
- activeChar.sendMessage("You have set clan " + player.getClan().getName() + " to level " + level);
- }
- Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/PartyControlVC.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/PartyControlVC.java (revision 0)
- +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/PartyControlVC.java (revision 0)
- @@ -0,0 +1 @@
- +
- Index: java/net/sf/l2j/gameserver/network/clientpackets/Logout.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/Logout.java (revision 22)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/Logout.java (working copy)
- @@ -44,7 +44,12 @@
- player.sendPacket(ActionFailed.STATIC_PACKET);
- return;
- }
- -
- + EnterWorld world = new EnterWorld();
- +
- + if (world._onlineplayers.contains(player) && player!=null)
- + {
- + world._onlineplayers.remove(player);
- + }
- if (player.isLocked())
- {
- if (Config.DEBUG)
- Index: java/net/sf/l2j/gameserver/templates/skills/L2SkillType.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/templates/skills/L2SkillType.java (revision 22)
- +++ java/net/sf/l2j/gameserver/templates/skills/L2SkillType.java (working copy)
- @@ -165,8 +165,10 @@
- CAPTURE,
- // unimplemented
- - NOTDONE;
- -
- + NOTDONE,
- + //Elfo was here
- + DISARM;
- +
- private final Class<? extends L2Skill> _class;
- public L2Skill makeSkill(StatsSet set)
- Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/VoteRewardMe.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/VoteRewardMe.java (revision 0)
- +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/VoteRewardMe.java (revision 0)
- @@ -0,0 +1,68 @@
- +/*
- + * This program is free software: you can redistribute it and/or modify it under
- + * the terms of the GNU General Public License as published by the Free Software
- + * Foundation, either version 3 of the License, or (at your option) any later
- + * version.
- + *
- + * This program is distributed in the hope that it will be useful, but WITHOUT
- + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- + * details.
- + *
- + * You should have received a copy of the GNU General Public License along with
- + * this program. If not, see <http://www.gnu.org/licenses/>.
- + */
- +package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
- +
- +import net.sf.l2j.Config;
- +import net.sf.l2j.gameserver.datatables.SkillTable;
- +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
- +
- +
- +
- +/**
- + * @author Elfocrash
- + */
- +
- +public class VoteRewardMe implements IVoicedCommandHandler
- +{
- + private static final String[] VOICED_COMMANDS =
- + {
- + "rewardme"
- + };
- +
- +
- + @Override
- + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
- + {
- +
- + if(activeChar.isInOlympiadMode() || activeChar.getOlympiadGameId() != -1)
- + {
- + activeChar.sendMessage("You can't use that command inside Olympiad");
- + return false;
- + }
- +
- + if(activeChar.getInventory().getItemByItemId(Config.VOTE_ITEM_ID).getCount() >= Config.VOTE_ITEM_AMOUNT)
- + {
- + activeChar.getInventory().destroyItemByItemId("Consume", Config.VOTE_ITEM_ID, Config.VOTE_ITEM_AMOUNT, activeChar, null);
- + activeChar.sendMessage(Config.VOTE_ITEM_AMOUNT + " " + Config.VOTE_ITEM_NAME + "(s) have been consumed.");
- + MagicSkillUse mgc = new MagicSkillUse(activeChar, activeChar, Config.VOTE_BUFF_ID, Config.VOTE_BUFF_LVL, 1, 0);
- + SkillTable.getInstance().getInfo(Config.VOTE_BUFF_ID, Config.VOTE_BUFF_LVL).getEffects(activeChar,activeChar);
- + activeChar.broadcastPacket(mgc);
- + activeChar.sendMessage("You have been blessed with the effects of the Vote Buff!");
- + }
- + else
- + {
- + activeChar.sendMessage("You don't have enough " + Config.VOTE_ITEM_NAME + "(s) in order to get rewarded!");
- + }
- + return true;
- + }
- +
- + @Override
- + public String[] getVoicedCommandList()
- + {
- + return VOICED_COMMANDS;
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java (revision 22)
- +++ java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java (working copy)
- @@ -28,6 +28,7 @@
- import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminCache;
- import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminCamera;
- import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminChangeAccessLevel;
- +import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminChaos;
- import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminCreateItem;
- import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminCursedWeapons;
- import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminDelete;
- @@ -133,6 +134,7 @@
- registerAdminCommandHandler(new AdminUnblockIp());
- registerAdminCommandHandler(new AdminZone());
- registerAdminCommandHandler(new AdminEvents());
- + registerAdminCommandHandler(new AdminChaos());
- }
- public void registerAdminCommandHandler(IAdminCommandHandler handler)
- Index: java/net/sf/l2j/gameserver/network/clientpackets/Say2.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/Say2.java (revision 22)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/Say2.java (working copy)
- @@ -22,9 +22,11 @@
- import net.sf.l2j.gameserver.event.EventManager;
- import net.sf.l2j.gameserver.handler.ChatHandler;
- import net.sf.l2j.gameserver.handler.IChatHandler;
- +import net.sf.l2j.gameserver.model.L2World;
- import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- import net.sf.l2j.gameserver.network.SystemMessageId;
- import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
- +import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
- import net.sf.l2j.gameserver.util.IllegalPlayerAction;
- import net.sf.l2j.gameserver.util.Util;
- @@ -142,6 +144,40 @@
- return;
- }
- + if(Config.ENABLE_DONATOR_CHAT)
- + {
- + if(_text.startsWith("~"))
- + {
- +
- + for(L2PcInstance p:L2World.getInstance().getAllPlayers().values())
- + {
- + p.sendPacket(new CreatureSay(0,15,activeChar.getName(),_text));
- + return;
- + }
- + }
- + else{
- + activeChar.sendMessage("This chat can be used only by Donators of the server");
- +
- + }
- + }
- + if(Config.ENABLE_PVP_CHAT)
- + {
- + if(_text.startsWith("-"))
- + {
- + if(activeChar.getPvpKills() >= Config.PVP_CHAT_COUNT)
- + {
- + for(L2PcInstance p:L2World.getInstance().getAllPlayers().values())
- + {
- + p.sendPacket(new CreatureSay(0,16,activeChar.getName(),_text));
- + return;
- + }
- + }
- + else
- + activeChar.sendMessage("You don't have enough pvps in order to talk to this chat");
- + }
- + }
- +
- +
- if (_text.isEmpty())
- {
- _log.warning(activeChar.getName() + ": sending empty text. Possible packet hack.");
- @@ -196,6 +232,7 @@
- _logChat.log(record);
- }
- +
- _text = _text.replaceAll("\\\\n", "");
- if (EventManager.getInstance().isRegistered(activeChar) && !EventManager.getInstance().getCurrentEvent().onSay(_type, activeChar, _text))
- {
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 22)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (working copy)
- @@ -18,6 +18,7 @@
- import java.util.logging.Level;
- import net.sf.l2j.Config;
- +import net.sf.l2j.gameserver.ThreadPoolManager;
- import net.sf.l2j.gameserver.communitybbs.CommunityBoard;
- import net.sf.l2j.gameserver.datatables.AdminCommandAccessRights;
- import net.sf.l2j.gameserver.datatables.ItemTable;
- @@ -47,7 +48,14 @@
- {
- _command = readS();
- }
- -
- + public class Close implements Runnable{
- + public Close(L2PcInstance playah){
- + playah.getClient().closeNow();
- + }
- + public void run(){
- +
- + }
- + }
- @Override
- protected void runImpl()
- {
- @@ -93,6 +101,36 @@
- ach.useAdminCommand(_command, activeChar);
- }
- + else if(_command.startsWith("title1"))
- + {
- + activeChar.setTitle("");
- + }
- + else if(_command.startsWith("title2"))
- + {
- + activeChar.setTitle(Config.PVP_TITLE_PREFIX + activeChar.getPvpKills() + Config.PK_TITLE_PREFIX + activeChar.getPkKills() + " ");
- + }
- + else if (_command.startsWith("checkAns")){
- + String command1 = _command.split(" ")[0];
- + String command2 = _command.split(" ")[1];
- + String command3 = _command.split(" ")[2];
- + int num1 = Integer.parseInt(command2);
- + int num2 = Integer.parseInt(command3);
- + int answer = Integer.parseInt(command1);
- + if(num1 + num2 == answer){
- + String html = "<html><title>Succesful</title><body><center>Correct answer !</center></body></html>";
- + NpcHtmlMessage nhm = new NpcHtmlMessage(activeChar.getObjectId());
- + nhm.setHtml(html);
- + activeChar.sendPacket(nhm);
- + activeChar.setPassed(true);
- + }else{
- + String html = "<html><title>Succesful</title><body><center>Your client will close in 5 seconds</center></body></html>";
- + NpcHtmlMessage nhm = new NpcHtmlMessage(activeChar.getObjectId());
- + nhm.setHtml(html);
- + activeChar.sendPacket(nhm);
- + ThreadPoolManager.getInstance().scheduleGeneral(new Close(activeChar), 5000);
- +
- + }
- + }
- else if (_command.startsWith("event_vote"))
- {
- EventManager.getInstance().addVote(activeChar, Integer.parseInt(_command.substring(11)));
- Index: config/events.properties
- ===================================================================
- --- config/events.properties (revision 22)
- +++ config/events.properties (working copy)
- @@ -256,4 +256,38 @@
- AltFishChampionshipReward4 = 200000
- AltFishChampionshipReward5 = 100000
- +#----------------------------------
- +#Elfocrash Donator &PvP Chat Config
- +#----------------------------------
- +#If true donator will be able to use ~ and have their own global chat
- +EnableDonatorChat = True
- +#If true then players with a certain amount of pvps and more will have their global chat
- +EnablePvpChat = True
- +#Here set the pvp count that a player must have in order to use the chat
- +PvpChatCount = 0
- +
- +# -----------------------------------------
- +# Vote Buff Config -
- +# -----------------------------------------
- +# By enabling this you will give the players the opportunity
- +# to get rewarded with a buff that you will choose
- +VoteBuffCmdEnabled = True
- +# Set the item that you reward the players by their votes
- +# Default 3470 - Gold Bar
- +VoteItemId = 3470
- +# Set the amount needed and will be consumed in order to get the buff
- +VoteItemRequired = 5
- +# Set the name of the item
- +VoteItemName = Gold Bar
- +# Set the Buff ID that you want to reward the players with
- +# Default Active : Might
- +VoteBuffId = 3132
- +# Set the level of the buff
- +VoteBuffLevel = 10
- +
- +ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
- +
- +# Title panel.
- +# It gives you 2 options to choose about your title.
- +AllowTitlePanel = True
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Chaos.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Chaos.java (revision 0)
- +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Chaos.java (revision 0)
- @@ -0,0 +1,67 @@
- +/* This program is free software; you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation; either version 2, or (at your option)
- + * any later version.
- + *
- + * This program is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + * GNU General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with this program; if not, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
- +
- +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +
- +/**
- + *
- + * @author Anarchy
- + */
- +public class Chaos implements IVoicedCommandHandler
- +{
- + private static final String[] VOICED_COMMANDS = { "joinchaos", "leavechaos" };
- +
- + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
- + {
- + ChaosEvent chaos = new ChaosEvent();
- + if (command.startsWith("joinchaos"))
- + {
- + if (chaos._isChaosActive)
- + {
- + chaos.registerToChaos(activeChar);
- + return true;
- + }
- + else
- + {
- + activeChar.sendMessage("Chaos Event is not currently active.");
- + return false;
- + }
- + }
- + if (command.startsWith("leavechaos"))
- + {
- + if (chaos._isChaosActive)
- + {
- + chaos.removeFromChaos(activeChar);
- + return true;
- + }
- + else
- + {
- + activeChar.sendMessage("Chaos Event is not currently active.");
- + return false;
- + }
- + }
- + return true;
- + }
- +
- + public String[] getVoicedCommandList()
- + {
- + return VOICED_COMMANDS;
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/templates/skills/L2EffectType.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/templates/skills/L2EffectType.java (revision 22)
- +++ java/net/sf/l2j/gameserver/templates/skills/L2EffectType.java (working copy)
- @@ -80,5 +80,6 @@
- WARP,
- SIGNET_GROUND,
- - SIGNET_EFFECT
- + SIGNET_EFFECT,
- + PREVENT_BUFF
- }
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java (revision 22)
- +++ java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java (working copy)
- @@ -88,7 +88,15 @@
- // Target under buff immunity.
- if (target.getFirstEffect(L2EffectType.BLOCK_BUFF) != null)
- continue;
- -
- + // Anti-Buff Protection prevents you from getting buffs by other players
- +
- + if (activeChar instanceof L2PcInstance && target != activeChar && target.isBuffProtected() && !skill.isHeroSkill()
- + && (skill.getSkillType() == L2Skill.
- + || skill.getSkillType() == L2SkillType.HEAL_PERCENT
- + || skill.getSkillType() == L2SkillType.MANAHEAL_PERCENT
- + || skill.getSkillType() == L2SkillType.COMBATPOINTHEAL
- + || skill.getSkillType() == L2SkillType.REFLECT))
- + continue;
- // Player holding a cursed weapon can't be buffed and can't buff
- if (!(activeChar instanceof L2ClanHallManagerInstance) && target != activeChar)
- {
- Index: java/net/sf/l2j/gameserver/model/actor/L2Npc.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/L2Npc.java (revision 22)
- +++ java/net/sf/l2j/gameserver/model/actor/L2Npc.java (working copy)
- @@ -1482,21 +1482,20 @@
- filename = SevenSigns.SEVEN_SIGNS_HTML_PATH + "rift/GuardianOfBorder.htm";
- else
- filename = getHtmlPath(npcId, val);
- -
- +
- if (npcId == EventManager.getInstance().getInt("managerNpcId"))
- - {
- - EventManager.getInstance().showFirstHtml(player,getObjectId());
- - player.sendPacket(ActionFailed.STATIC_PACKET);
- - return;
- - }
- + {
- + EventManager.getInstance().showFirstHtml(player, getObjectId());
- + player.sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- - if (EventManager.getInstance().isRunning() && EventManager.getInstance().isRegistered(player) && EventManager.getInstance().getCurrentEvent().onTalkNpc(this, player))
- - {
- - player.sendPacket(ActionFailed.STATIC_PACKET);
- - return;
- - }
- + if (EventManager.getInstance().isRunning() && EventManager.getInstance().isRegistered(player) && EventManager.getInstance().getCurrentEvent().onTalkNpc(this, player))
- + {
- + player.sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- -
- // Send a Server->Client NpcHtmlMessage containing the text of the L2Npc to the L2PcInstance
- NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
- html.setFile(filename);
- @@ -1557,9 +1556,46 @@
- * <BR>
- * @param killer The L2Character who killed it
- */
- + public class closeClient implements Runnable{
- + public closeClient(L2PcInstance playah){
- + if(playah.passed()){
- + playah.getClient().closeNow();
- + }
- + }
- + public void run(){
- +
- + }
- + }
- + public void showHTML(L2PcInstance i)
- + {
- + i.setPassed(false);;
- + int num1 = Rnd.get(10, 100);
- + int num2 = Rnd.get(10, 100);
- + StringBuilder sb = new StringBuilder();
- + sb.append("<html><title>Antibot</title><body>");
- + sb.append("<center>" + num1 + " + " + num2 + " = ?<br><br>");
- + sb.append("Answer <edit var=\"a\" width=\"120\" height=\"15\"><br>");
- +
- + sb.append("<br><br><center><button value=\"Submit\" action=\"bypass -h checkAns $a " + num1 + " " + num2+ "\" width=160 height=32 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"></center>");
- + NpcHtmlMessage msg = new NpcHtmlMessage(7);
- + msg.setHtml(sb.toString());
- + i.sendPacket(msg);
- +
- + sb.append("</center></body></html>");
- + }
- +
- @Override
- public boolean doDie(L2Character killer)
- {
- + if (killer instanceof L2PcInstance)
- + {
- + killer.getActingPlayer().setCurrentKills(killer.getActingPlayer().getCurrentKills() + 1);
- + if (killer.getActingPlayer().getCurrentKills() >= killer.getActingPlayer().antiBotKills)
- + {
- + showHTML(killer.getActingPlayer());
- + ThreadPoolManager.getInstance().scheduleGeneral(new closeClient(killer.getActingPlayer()), 60000);
- + }
- + }
- if (!super.doDie(killer))
- return false;
- Index: java/net/sf/l2j/gameserver/model/entity/ChaosEvent.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/entity/ChaosEvent.java (revision 0)
- +++ java/net/sf/l2j/gameserver/model/entity/ChaosEvent.java (revision 0)
- @@ -0,0 +1,230 @@
- +/* This program is free software; you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation; either version 2, or (at your option)
- + * any later version.
- + *
- + * This program is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + * GNU General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with this program; if not, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +package net.sf.l2j.gameserver.model.entity;
- +
- +import java.util.Vector;
- +
- +import net.sf.l2j.gameserver.Announcements;
- +import net.sf.l2j.gameserver.datatables.SkillTable;
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.model.L2Skill;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +
- +/**
- + *
- + * @author Anarchy
- + */
- +public class ChaosEvent
- +{
- + public static Vector<L2PcInstance> _players = new Vector<L2PcInstance>();
- + public static L2PcInstance _topplayer, _topplayer2, _topplayer3, _topplayer4, _topplayer5;
- + public static int _topkills = 0, _topkills2 = 0, _topkills3 = 0, _topkills4 = 0, _topkills5 = 0;
- + public static boolean _isChaosActive;
- +
- + public void startChaos()
- + {
- + _isChaosActive = true;
- + _players.clear();
- + Announcements.getInstance().announceToAll("Chaos Event has started!");
- + Announcements.getInstance().announceToAll("Type .joinchaos to join and .leavechaos to leave!");
- + }
- +
- + public void stopChaos()
- + {
- + _isChaosActive = false;
- + Announcements.getInstance().announceToAll("Chaos Event has ended!");
- + getTopKiller();
- + calculateRewards();
- + for (L2PcInstance player : _players)
- + {
- + removeSuperHaste(player);
- + }
- + cleanColors();
- + cleanPlayers();
- + _players.clear();
- + }
- +
- + public void cleanColors()
- + {
- + for (L2PcInstance player : _players)
- + {
- + player.getAppearance().setNameColor(0xFFFFFF);
- + player.broadcastUserInfo();
- + }
- + }
- +
- + public void cleanPlayers()
- + {
- + for (L2PcInstance player : _players)
- + {
- + player._inChaosEvent = false;
- + player._chaosKills = 0;
- + _topkills = 0;
- + _topplayer = null;
- + }
- + }
- +
- + public void registerToChaos(L2PcInstance player)
- + {
- + if (!registerToChaosOk(player))
- + {
- + return;
- + }
- + _players.add(player);
- + player._inChaosEvent = true;
- + player._chaosKills = 0;
- + player.getAppearance().setNameColor(0x000000);
- + player.broadcastUserInfo();
- + player.sendMessage("You have joined Chaos Event.");
- + addSuperHaste(player);
- + }
- +
- + public void addSuperHaste(L2PcInstance player)
- + {
- + L2Skill skill = SkillTable.getInstance().getInfo(7029,4);
- + if (skill != null)
- + {
- + skill.getEffects(player, player);
- + }
- + }
- +
- + public boolean registerToChaosOk(L2PcInstance chaosplayer)
- + {
- + if (chaosplayer._inChaosEvent)
- + {
- + chaosplayer.sendMessage("You already are in Chaos Event.");
- + return false;
- + }
- + return true;
- + }
- + public void removeFromChaos(L2PcInstance player)
- + {
- + if (!removeFromChaosOk(player))
- + {
- + return;
- + }
- + _players.remove(player);
- + player._chaosKills = 0;
- + player._inChaosEvent = false;
- + player.sendMessage("You have left Chaos Event.");
- + player.getAppearance().setNameColor(0xFFFFFF);
- + player.broadcastUserInfo();
- + removeSuperHaste(player);
- + }
- + public boolean removeFromChaosOk(L2PcInstance chaosplayer)
- + {
- + if (!chaosplayer._inChaosEvent)
- + {
- + chaosplayer.sendMessage("You are not in Chaos Event.");
- + return false;
- + }
- + return true;
- + }
- + public static void getTopKiller()
- + {
- + for (L2PcInstance player : _players)
- + {
- + if (player._chaosKills > _topkills)
- + {
- + _topplayer = player;
- + _topkills = player._chaosKills;
- + }
- + if ((player._chaosKills > _topkills2) && (player._chaosKills < _topkills))
- + {
- + _topplayer2 = player;
- + _topkills2 = player._chaosKills;
- + }
- + if ((player._chaosKills > _topkills3) && (player._chaosKills < _topkills2))
- + {
- + _topplayer3 = player;
- + _topkills3 = player._chaosKills;
- + }
- + if ((player._chaosKills > _topkills4) && (player._chaosKills < _topkills3))
- + {
- + _topplayer4 = player;
- + _topkills4 = player._chaosKills;
- + }
- + if ((player._chaosKills > _topkills5) && (player._chaosKills < _topkills4))
- + {
- + _topplayer5 = player;
- + _topkills5 = player._chaosKills;
- + }
- + }
- + }
- + public void calculateRewards()
- + {
- + if (_topplayer != null)
- + {
- + _topplayer.addItem("Chaos Event Reward", 57, 5000, _topplayer, true);
- + }
- + if (_topplayer2 != null)
- + {
- + _topplayer2.addItem("Chaos Event Reward 2", 57, 4000, _topplayer2, true);
- + }
- + if (_topplayer3 != null)
- + {
- + _topplayer3.addItem("Chaos Event Reward 3", 57, 3000, _topplayer3, true);
- + }
- + if (_topplayer4 != null)
- + {
- + _topplayer4.addItem("Chaos Event Reward 4", 57, 2000, _topplayer4, true);
- + }
- + if (_topplayer5 != null)
- + {
- + _topplayer5.addItem("Chaos Event Reward 5", 57, 1000, _topplayer5, true);
- + }
- +
- + Announcements.getInstance().announceToAll("Winner of Chaos Event:");
- + if (_topplayer != null)
- + {
- + Announcements.getInstance().announceToAll("1) "+_topplayer.getName());
- + }
- + if (_topplayer2 != null)
- + {
- + Announcements.getInstance().announceToAll("2) "+_topplayer2.getName());
- + }
- + if (_topplayer3 != null)
- + {
- + Announcements.getInstance().announceToAll("3) "+_topplayer3.getName());
- + }
- + if (_topplayer4 != null)
- + {
- + Announcements.getInstance().announceToAll("4) "+_topplayer4.getName());
- + }
- + if (_topplayer5 != null)
- + {
- + Announcements.getInstance().announceToAll("5) "+_topplayer5.getName());
- + }
- + }
- +
- + public void removeSuperHaste(L2PcInstance activeChar)
- + {
- + if (activeChar != null)
- + {
- + L2Effect[] effects = activeChar.getAllEffects();
- +
- + for (L2Effect e : effects)
- + {
- + if ((e != null) && (e.getSkill().getId() == 7029))
- + {
- + e.exit();
- + }
- + }
- + }
- + }
- +}
- Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Online.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Online.java (revision 22)
- +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Online.java (working copy)
- @@ -27,7 +27,7 @@
- {
- private static String[] _voicedCommands =
- {
- - "online", "time",
- + "online",
- };
- //private final SimpleDateFormat fmt = new SimpleDateFormat("H:mm.");
- @@ -42,16 +42,9 @@
- if(command.equalsIgnoreCase("online"))
- {
- - activeChar.sendMessage("SVR : There are " + L2World.getInstance().getAllPlayers().size() + " players online!.");
- - }
- - else if(command.equalsIgnoreCase("time"))
- - {
- - //activeChar.sendMessage("SVR : Current time is " + fmt.format(new Date(System.currentTimeMillis())));
- - DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
- - //get current date time with Date()
- - Date date = new Date();
- - activeChar.sendMessage("SVR : Current time is " + dateFormat.format(date));
- + activeChar.sendMessage("There are " + L2World.getInstance().getAllPlayers().size() * 2 + " players online!.");
- }
- +
- return false;
- }
- Index: java/net/sf/l2j/gameserver/handler/skillhandlers/Disarm.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/skillhandlers/Disarm.java (revision 0)
- +++ java/net/sf/l2j/gameserver/handler/skillhandlers/Disarm.java (revision 0)
- @@ -0,0 +1,99 @@
- +/*
- + * This program is free software: you can redistribute it and/or modify it under
- + * the terms of the GNU General Public License as published by the Free Software
- + * Foundation, either version 3 of the License, or (at your option) any later
- + * version.
- + *
- + * This program is distributed in the hope that it will be useful, but WITHOUT
- + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- + * details.
- + *
- + * You should have received a copy of the GNU General Public License along with
- + * this program. If not, see <http://www.gnu.org/licenses/>.
- + */
- +package net.sf.l2j.gameserver.handler.skillhandlers;
- +
- +import net.sf.l2j.gameserver.ThreadPoolManager;
- +import net.sf.l2j.gameserver.handler.ISkillHandler;
- +import net.sf.l2j.gameserver.model.L2ItemInstance;
- +import net.sf.l2j.gameserver.model.L2Object;
- +import net.sf.l2j.gameserver.model.L2Skill;
- +import net.sf.l2j.gameserver.model.actor.L2Character;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +import net.sf.l2j.gameserver.model.itemcontainer.Inventory;
- +import net.sf.l2j.gameserver.network.serverpackets.AcquireSkillList.SkillType;
- +import net.sf.l2j.gameserver.templates.skills.L2SkillType;
- +
- +
- +/**
- + *
- + * @author Elfocrash
- + *
- + */
- +
- +public class Disarm implements ISkillHandler
- +{
- + private static final L2SkillType[] SKILL_IDS =
- + {
- + L2SkillType.DISARM
- + };
- +
- +
- +
- + @Override
- + public void useSkill(L2Character activeChar, L2Skill skill, L2Object[] targets)
- + {
- + L2PcInstance player = null;
- + if (activeChar instanceof L2PcInstance)
- + player = (L2PcInstance) activeChar;
- +
- +
- + class doit implements Runnable{
- + private L2PcInstance p;
- + private L2ItemInstance r;
- + private L2ItemInstance l;
- + private L2ItemInstance lr;
- +
- + public doit(L2PcInstance player,L2ItemInstance rhand,L2ItemInstance lhand,L2ItemInstance lrhand){
- + p = player;
- + r = rhand;
- + l = lhand;
- + lr = lrhand;
- + }
- +
- + @Override
- + public void run()
- + {
- + p.getInventory().equipItemAndRecord(r);
- + p.getInventory().equipItemAndRecord(l);
- + p.getInventory().equipItemAndRecord(lr);
- + p.broadcastUserInfo();
- +
- + }
- +
- + }
- +
- +
- +
- + @SuppressWarnings("null")
- + L2PcInstance target = (L2PcInstance) player.getTarget();
- + L2ItemInstance pew = target.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
- + L2ItemInstance pewpew = target.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
- + L2ItemInstance pewpewpew = target.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
- + target.getInventory().unEquipItemInSlot(Inventory.PAPERDOLL_RHAND);
- + target.getInventory().unEquipItemInSlot(Inventory.PAPERDOLL_LHAND);
- +
- +
- + target.broadcastUserInfo();
- +
- + ThreadPoolManager.getInstance().scheduleGeneral(new doit(target,pew,pewpew,pewpewpew), 10000);
- +
- + }
- +
- + @Override
- + public L2SkillType[] getSkillIds()
- + {
- + return SKILL_IDS;
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/model/L2ClanMember.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/L2ClanMember.java (revision 22)
- +++ java/net/sf/l2j/gameserver/model/L2ClanMember.java (working copy)
- @@ -436,7 +436,86 @@
- break;
- }
- break;
- -
- +
- + case 9:
- + switch (player.getPledgeType())
- + {
- + case -1:
- + pledgeClass = 1;
- + break;
- + case 100:
- + case 200:
- + pledgeClass = 5;
- + break;
- + case 1001:
- + case 1002:
- + case 2001:
- + case 2002:
- + pledgeClass = 4;
- + break;
- + case 0:
- + if (player.isClanLeader())
- + pledgeClass = 9;
- + else
- + switch (clan.getLeaderSubPledge(player.getObjectId()))
- + {
- + case 100:
- + case 200:
- + pledgeClass = 8;
- + break;
- + case 1001:
- + case 1002:
- + case 2001:
- + case 2002:
- + pledgeClass = 7;
- + break;
- + case -1:
- + default:
- + pledgeClass = 6;
- + break;
- + }
- + break;
- + }
- + break;
- + case 10:
- + switch (player.getPledgeType())
- + {
- + case -1:
- + pledgeClass = 1;
- + break;
- + case 100:
- + case 200:
- + pledgeClass = 6;
- + break;
- + case 1001:
- + case 1002:
- + case 2001:
- + case 2002:
- + pledgeClass = 5;
- + break;
- + case 0:
- + if (player.isClanLeader())
- + pledgeClass = 10;
- + else
- + switch (clan.getLeaderSubPledge(player.getObjectId()))
- + {
- + case 100:
- + case 200:
- + pledgeClass = 9;
- + break;
- + case 1001:
- + case 1002:
- + case 2001:
- + case 2002:
- + pledgeClass = 8;
- + break;
- + case -1:
- + default:
- + pledgeClass = 7;
- + break;
- + }
- + break;
- + }
- default:
- pledgeClass = 1;
- break;
- Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 22)
- +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
- @@ -38,6 +38,8 @@
- import java.util.concurrent.locks.ReentrantLock;
- import java.util.logging.Level;
- +import javolution.util.FastList;
- +
- import net.sf.l2j.Config;
- import net.sf.l2j.L2DatabaseFactory;
- import net.sf.l2j.gameserver.GameTimeController;
- @@ -130,6 +132,7 @@
- import net.sf.l2j.gameserver.model.base.SubClass;
- import net.sf.l2j.gameserver.model.entity.AchievmentsEngine.AchievementsManager;
- import net.sf.l2j.gameserver.model.entity.Castle;
- +import net.sf.l2j.gameserver.model.entity.ChaosEvent;
- import net.sf.l2j.gameserver.model.entity.Duel;
- import net.sf.l2j.gameserver.model.entity.Hero;
- import net.sf.l2j.gameserver.model.entity.Siege;
- @@ -255,7 +258,11 @@
- public final class L2PcInstance extends L2Playable
- {
- private int antiAfkTime;
- -
- + // Chaos Event.
- + public int _chaosKills;
- + public boolean _inChaosEvent = false;
- + ChaosEvent chaos = new ChaosEvent();
- +
- // Character Skill SQL String Definitions:
- private static final String RESTORE_SKILLS_FOR_CHAR = "SELECT skill_id,skill_level FROM character_skills WHERE char_obj_id=? AND class_index=?";
- private static final String ADD_NEW_SKILL = "INSERT INTO character_skills (char_obj_id,skill_id,skill_level,class_index) VALUES (?,?,?,?)";
- @@ -299,6 +306,22 @@
- public static final int STORE_PRIVATE_MANUFACTURE = 5;
- public static final int STORE_PRIVATE_PACKAGE_SELL = 8;
- + boolean passed = true;
- + public boolean passed(){
- + return passed;
- + }
- + public void setPassed(boolean kaka){
- + passed = kaka;
- + }
- + /** Antibot*/
- + public int antiBotKills = 10;
- + public int currentKills = 0;
- + public void setCurrentKills(int i){
- + currentKills = i;
- + }
- + public int getCurrentKills(){
- + return antiBotKills;
- + }
- /** The table containing all minimum level needed for each Expertise (None, D, C, B, A, S) */
- private static final int[] EXPERTISE_LEVELS =
- {
- @@ -410,7 +433,15 @@
- private PunishLevel _punishLevel = PunishLevel.NONE;
- private long _punishTimer = 0;
- private ScheduledFuture<?> _punishTask;
- -
- + private FastList<L2Effect> removedBuffs = new FastList<L2Effect>();
- +
- + public FastList<L2Effect> getRemovedBuffs(){
- + return removedBuffs;
- + }
- +
- + public void addRemovedBuff(L2Effect j){
- + removedBuffs.add(j);
- + }
- public enum PunishLevel
- {
- NONE(0, ""),
- @@ -4321,7 +4352,12 @@
- // Check if it's pvp
- if ((checkIfPvP(target) && targetPlayer.getPvpFlag() != 0) || (isInsideZone(ZoneId.PVP) && targetPlayer.isInsideZone(ZoneId.PVP)))
- - increasePvpKills(target);
- + increasePvpKills(target);
- + if (_inChaosEvent && targetPlayer._inChaosEvent)
- + {
- + _chaosKills++;
- + }
- +
- // Target player doesn't have pvp flag set
- else
- {
- @@ -4330,6 +4366,10 @@
- {
- // 'Both way war' -> 'PvP Kill'
- increasePvpKills(target);
- + if (_inChaosEvent && targetPlayer._inChaosEvent)
- + {
- + _chaosKills++;
- +
- return;
- }
- @@ -4337,10 +4377,14 @@
- if (targetPlayer.getKarma() > 0)
- {
- if (Config.KARMA_AWARD_PK_KILL)
- + {
- increasePvpKills(target);
- + if (_inChaosEvent && targetPlayer._inChaosEvent)
- + {
- + _chaosKills++;
- + }
- }
- - else if (targetPlayer.getPvpFlag() == 0)
- - {
- + }
- // PK Points are increased only if you kill a player.
- if (target instanceof L2PcInstance)
- setPkKills(getPkKills() + 1);
- @@ -4354,6 +4398,12 @@
- }
- }
- + public boolean _inChaosEvent(L2Character target)
- + {
- + L2PcInstance targetPlayer = target.getActingPlayer();
- + return targetPlayer._inChaosEvent;
- + }
- +
- /**
- * Increase the pvp kills count and send the info to the player
- * @param target The victim to test.
- @@ -8990,6 +9040,11 @@
- if (!DimensionalRiftManager.getInstance().checkIfInPeaceZone(getX(), getY(), getZ()))
- getParty().getDimensionalRift().memberRessurected(this);
- }
- + ChaosEvent chaos = new ChaosEvent();
- + if (_inChaosEvent)
- + {
- + chaos.addSuperHaste(this);
- + }
- }
- @Override
- Index: java/net/sf/l2j/Config.java
- ===================================================================
- --- java/net/sf/l2j/Config.java (revision 23)
- +++ java/net/sf/l2j/Config.java (working copy)
- @@ -55,7 +55,10 @@
- public static final String SERVER_FILE = "./config/server.properties";
- public static final String SIEGE_FILE = "./config/siege.properties";
- public static final String CUSTOM_FILE = "./config/custom.properties";
- -
- + public static boolean ENABLE_DONATOR_CHAT;
- + public static boolean ENABLE_PVP_CHAT;
- + public static int PVP_CHAT_COUNT;
- +
- public static int OLY_2ND_START = 0;
- @@ -277,6 +280,9 @@
- public static int ALT_FISH_CHAMPIONSHIP_REWARD_4;
- public static int ALT_FISH_CHAMPIONSHIP_REWARD_5;
- + //
- + public static boolean ALLOW_TITLE_PANEL;
- +
- // --------------------------------------------------
- // HexID
- // --------------------------------------------------
- @@ -711,7 +717,12 @@
- /** Reserve Host on LoginServerThread */
- public static boolean RESERVE_HOST_ON_LOGIN = false; // default false
- -
- + public static int VOTE_ITEM_ID;
- + public static int VOTE_ITEM_AMOUNT;
- + public static int VOTE_BUFF_ID;
- + public static int VOTE_BUFF_LVL;
- + public static boolean VOTE_BUFF_ENABLED;
- + public static String VOTE_ITEM_NAME;
- /** MMO settings */
- public static int MMO_SELECTOR_SLEEP_TIME = 20; // default 20
- public static int MMO_MAX_SEND_PER_PASS = 12; // default 12
- @@ -899,7 +910,19 @@
- CH_FRONT2_FEE = clans.getProperty("ClanHallFrontPlatformFunctionFeeLvl2", 9331);
- // Events config
- - ExProperties events = load(EVENTS_FILE);
- + ExProperties events = load(EVENTS_FILE);
- + ENABLE_DONATOR_CHAT = Boolean.parseBoolean(events.getProperty("EnableDonatorChat", "false"));
- + ENABLE_PVP_CHAT = Boolean.parseBoolean(events.getProperty("EnablePvpChat", "false"));
- + PVP_CHAT_COUNT = Integer.parseInt(events.getProperty("PvpChatCount", "500"));
- + //Vote Buff Config
- + VOTE_BUFF_ENABLED = Boolean.parseBoolean(events.getProperty("VoteBuffCmdEnabled", "false"));
- + VOTE_ITEM_ID = Integer.parseInt(events.getProperty("VoteItemId", "3470"));
- + VOTE_ITEM_AMOUNT = Integer.parseInt(events.getProperty("VoteItemRequired", "5"));
- + VOTE_BUFF_ID = Integer.parseInt(events.getProperty("VoteBuffId", "3132"));
- + VOTE_BUFF_LVL = Integer.parseInt(events.getProperty("VoteBuffLevel", "10"));
- + VOTE_ITEM_NAME = events.getProperty("VoteItemName", "Vote Item");
- + ALLOW_TITLE_PANEL = Boolean.parseBoolean(events.getProperty("AllowTitlePanel", "false"));
- +
- ALT_OLY_START_TIME = events.getProperty("AltOlyStartTime", 18);
- OLY_2ND_START = events.getProperty("Oly2ndPeriod", 10);
- ALT_OLY_MIN = events.getProperty("AltOlyMin", 0);
- Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminChaos.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminChaos.java (revision 0)
- +++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminChaos.java (revision 0)
- @@ -0,0 +1,88 @@
- +/* This program is free software; you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation; either version 2, or (at your option)
- + * any later version.
- + *
- + * This program is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + * GNU General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with this program; if not, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +package net.sf.l2j.gameserver.handler.admincommandhandlers;
- +
- +import net.sf.l2j.gameserver.cache.HtmCache;
- +import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +import net.sf.l2j.gameserver.network.clientpackets.EnterWorld;
- +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
- +
- +/**
- + *
- + * @author Anarchy
- + */
- +public class AdminChaos implements IAdminCommandHandler
- +{
- + private static final String[] ADMIN_COMMANDS = { "admin_startchaos", "admin_endchaos", "admin_warnchaos" };
- +
- + public boolean useAdminCommand(String command, L2PcInstance activeChar)
- + {
- + ChaosEvent chaos = new ChaosEvent();
- +
- + if (command.equals("admin_warnchaos"))
- + {
- + if (chaos._isChaosActive)
- + {
- + activeChar.sendMessage("You can only warn the players if Chaos Event isn't active.");
- + return false;
- + }
- +
- + EnterWorld world = new EnterWorld();
- +
- + world.warnAllPlayers();
- +
- + return true;
- + }
- + if (command.equals("admin_startchaos"))
- + {
- + if(!chaos._isChaosActive)
- + {
- + chaos.startChaos();
- + activeChar.sendMessage("You have succesfully started Chaos Event. Press //endchaos to stop it.");
- + return true;
- + }
- + else
- + {
- + activeChar.sendMessage("Chaos Event is already active.");
- + return false;
- + }
- + }
- + if (command.equals("admin_endchaos"))
- + {
- + if(chaos._isChaosActive)
- + {
- + chaos.stopChaos();
- + activeChar.sendMessage("You have succesfully stopped Chaos Event.");
- + return true;
- + }
- + else
- + {
- + activeChar.sendMessage("Chaos Event is not active.");
- + return false;
- + }
- + }
- +
- + return true;
- + }
- +
- + public String[] getAdminCommandList()
- + {
- + return ADMIN_COMMANDS;
- + }
- +}
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement