Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2J_DataPack
- Index: dist/game/data/scripts/handlers/MasterHandler.java
- ===================================================================
- --- dist/game/data/scripts/handlers/MasterHandler.java (revision 9467)
- +++ dist/game/data/scripts/handlers/MasterHandler.java (working copy);
- @@ -290,6 +291,7 @@
- import handlers.voicedcommandhandlers.Debug;
- import handlers.voicedcommandhandlers.Hellbound;
- import handlers.voicedcommandhandlers.Lang;
- +import handlers.voicedcommandhandlers.PkHunterVoiced;
- import handlers.voicedcommandhandlers.StatsVCmd;
- import handlers.voicedcommandhandlers.TvTVoicedInfo;
- import handlers.voicedcommandhandlers.Wedding;
- @@ -603,6 +606,7 @@
- (Config.L2JMOD_DEBUG_VOICE_COMMAND ? Debug.class : null),
- (Config.L2JMOD_ALLOW_CHANGE_PASSWORD ? ChangePassword.class : null),
- (Config.L2JMOD_HELLBOUND_STATUS ? Hellbound.class : null),
- + (Config.ENABLE_PKHUNTEREVENT ? PkHunterVoiced.class : null),
- },
- {
- // Target Handlers
- Index: dist/game/data/scripts/handlers/itemhandlers/ItemSkills.java
- ===================================================================
- --- dist/game/data/scripts/handlers/itemhandlers/ItemSkills.java (revision 9467)
- +++ dist/game/data/scripts/handlers/itemhandlers/ItemSkills.java (working copy)
- @@ -14,8 +14,10 @@
- */
- package handlers.itemhandlers;
- +import com.l2jserver.gameserver.model.actor.L2Character;
- import com.l2jserver.gameserver.model.actor.L2Playable;
- import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
- import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
- import com.l2jserver.gameserver.network.SystemMessageId;
- @@ -33,6 +35,16 @@
- activeChar.sendPacket(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT);
- return false;
- }
- + else if((activeChar != null) && PkHunterEvent.isPk(activeChar))
- + {
- + activeChar.sendMessage("You cannot use this item while in this zone.");
- + return false;
- + }
- + else if(activeChar != null && activeChar.isInsideZone(L2Character.MASS_ZONE) && item.getItemId() != 728 && item.getItemId() != 5592 && item.getItemId() != 20353)
- + {
- + activeChar.sendMessage("You cannot use this item while in this zone.");
- + return false;
- + }
- return super.useItem(playable, item, forceUse);
- }
- }
- Index: dist/game/data/scripts/handlers/skillhandlers/SummonFriend.java
- ===================================================================
- --- dist/game/data/scripts/handlers/skillhandlers/SummonFriend.java (revision 9467)
- +++ dist/game/data/scripts/handlers/skillhandlers/SummonFriend.java (working copy)
- @@ -21,6 +21,7 @@
- import com.l2jserver.gameserver.model.L2Party;
- import com.l2jserver.gameserver.model.actor.L2Character;
- import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
- import com.l2jserver.gameserver.model.skills.L2Skill;
- import com.l2jserver.gameserver.model.skills.L2SkillType;
- import com.l2jserver.gameserver.network.SystemMessageId;
- @@ -98,6 +99,11 @@
- if (skill.getId() == 1403) //Summon Friend
- {
- + if (PkHunterEvent.isPk(activePlayer) || PkHunterEvent.isPk(targetPlayer))
- + {
- + activeChar.sendMessage("Players can't be summoned while in event.");
- + return;
- + }
- // Send message
- final ConfirmDlg confirm = new ConfirmDlg(SystemMessageId.C1_WISHES_TO_SUMMON_YOU_FROM_S2_DO_YOU_ACCEPT.getId());
- confirm.addCharName(activeChar);
- Index: dist/game/data/scripts/handlers/usercommandhandlers/Escape.java
- ===================================================================
- --- dist/game/data/scripts/handlers/usercommandhandlers/Escape.java (revision 9467)
- +++ dist/game/data/scripts/handlers/usercommandhandlers/Escape.java (working copy)
- @@ -25,6 +25,7 @@
- import com.l2jserver.gameserver.instancemanager.GrandBossManager;
- import com.l2jserver.gameserver.instancemanager.MapRegionManager;
- import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
- import com.l2jserver.gameserver.model.entity.TvTEvent;
- import com.l2jserver.gameserver.model.skills.L2Skill;
- import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
- @@ -75,6 +76,12 @@
- return false;
- }
- + if (PkHunterEvent.isPk(activeChar))
- + {
- + activeChar.sendMessage("You can't escape while in event.");
- + return false;
- + }
- +
- if (activeChar.isCastingNow() || activeChar.isMovementDisabled() || activeChar.isMuted()
- || activeChar.isAlikeDead() || activeChar.isInOlympiadMode() || activeChar.inObserverMode() || activeChar.isCombatFlagEquipped())
- return false;
- Index: dist/game/data/scripts/handlers/itemhandlers/SummonItems.java
- ===================================================================
- --- dist/game/data/scripts/handlers/itemhandlers/SummonItems.java (revision 9467)
- +++ dist/game/data/scripts/handlers/itemhandlers/SummonItems.java (working copy)
- @@ -37,6 +37,7 @@
- import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
- import com.l2jserver.gameserver.model.actor.instance.L2XmassTreeInstance;
- import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
- +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
- import com.l2jserver.gameserver.model.entity.TvTEvent;
- import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
- import com.l2jserver.gameserver.network.SystemMessageId;
- @@ -85,6 +86,11 @@
- activeChar.sendPacket(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT);
- return false;
- }
- + if (PkHunterEvent.isPk(activeChar))
- + {
- + activeChar.sendMessage("You can't use this item while in event.");
- + return false;
- + }
- if (activeChar.isAllSkillsDisabled() || activeChar.isCastingNow())
- return false;
- Index: dist/game/data/scripts/handlers/voicedcommandhandlers/PkHunterVoiced.java
- ===================================================================
- --- dist/game/data/scripts/handlers/voicedcommandhandlers/PkHunterVoiced.java (revision 0)
- +++ dist/game/data/scripts/handlers/voicedcommandhandlers/PkHunterVoiced.java (revision 0)
- @@ -0,0 +1,80 @@
- +/*
- + * 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 handlers.voicedcommandhandlers;
- +
- +
- +import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
- +import com.l2jserver.gameserver.model.StatsSet;
- +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
- +import com.l2jserver.gameserver.model.skills.l2skills.L2SkillTeleport;
- +
- +/**
- + *
- + * @author Wyatt
- + */
- +
- +public class PkHunterVoiced implements IVoicedCommandHandler
- +{
- + private static final String[] VOICED_COMMANDS = { "gopk", "pkinfo"};
- +
- + @Override
- + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
- + {
- + if (command.toLowerCase().equals("gopk"))
- + {
- + if (activeChar.isFestivalParticipant() || activeChar.isInJail() || activeChar.isInDuel()
- + || activeChar.isInOlympiadMode() || activeChar.inObserverMode() || PkHunterEvent.isPk(activeChar)
- + )
- + {
- + activeChar.sendMessage("You can't use this command while participating in the Festival!");
- + return false;
- + }
- +
- + if (PkHunterEvent.isActive())
- + {
- + StatsSet set = new StatsSet();
- + set.set("skill_id", "2525");
- + set.set("level", "1");
- + set.set("target", "TARGET_SELF");
- + set.set("name", "Scroll to move to PkHunter Event area");
- + set.set("isMagic", "2");
- + set.set("itemConsumeCount", "0");
- + set.set("hitTime", "10000");
- + set.set("operateType", "A1");
- + set.set("skillType", "TELEPORT");
- + set.set("teleCoords", PkHunterEvent.getPkLocation()[0]+","+PkHunterEvent.getPkLocation()[1]+","+PkHunterEvent.getPkLocation()[2]);
- + activeChar.useMagic(new L2SkillTeleport(set), false, true);
- + activeChar.sendMessage("Moving to PkHunter Event area...");
- + }
- + else
- + {
- + activeChar.sendMessage("PkHunter Event is not currently active.");
- + return false;
- + }
- + }
- + else if (command.toLowerCase().equals("pkinfo"))
- + {
- + PkHunterEvent.sendLocationMessage(activeChar);
- + }
- + return true;
- + }
- +
- + @Override
- + public String[] getVoicedCommandList()
- + {
- + return VOICED_COMMANDS;
- + }
- +}
- \ No newline at end of file
- Index: dist/game/data/scripts/handlers/itemhandlers/ItemSkills.java
- ===================================================================
- --- dist/game/data/scripts/handlers/itemhandlers/ItemSkills.java (revision 9467)
- +++ dist/game/data/scripts/handlers/itemhandlers/ItemSkills.java (working copy)
- @@ -14,6 +14,7 @@
- */
- package handlers.itemhandlers;
- +import com.l2jserver.gameserver.model.actor.L2Character;
- import com.l2jserver.gameserver.model.actor.L2Playable;
- import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
- @@ -33,6 +34,11 @@
- activeChar.sendPacket(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT);
- return false;
- }
- + else if(activeChar != null && activeChar.isInsideZone(L2Character.MASS_ZONE) && item.getItemId() != 728 && item.getItemId() != 5592 && item.getItemId() != 20353)
- + {
- + activeChar.sendMessage("You cannot use this item while in this zone.");
- + return false;
- + }
- return super.useItem(playable, item, forceUse);
- }
- }
- Index: dist/game/data/scripts/handlers/bypasshandlers/OlympiadObservation.java
- ===================================================================
- --- dist/game/data/scripts/handlers/bypasshandlers/OlympiadObservation.java (revision 9467)
- +++ dist/game/data/scripts/handlers/bypasshandlers/OlympiadObservation.java (working copy)
- @@ -20,6 +20,7 @@
- import com.l2jserver.gameserver.model.actor.L2Character;
- import com.l2jserver.gameserver.model.actor.instance.L2OlympiadManagerInstance;
- import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
- import com.l2jserver.gameserver.model.entity.TvTEvent;
- import com.l2jserver.gameserver.model.olympiad.Olympiad;
- import com.l2jserver.gameserver.model.olympiad.OlympiadGameManager;
- @@ -216,6 +217,11 @@
- activeChar.sendMessage("You can not observe games while registered for TvT");
- return false;
- }
- + if (PkHunterEvent.isPk(activeChar))
- + {
- + activeChar.sendMessage("You can't observe games while in event.");
- + return false;
- + }
- }
- final int arenaId = Integer.parseInt(command.substring(12).trim());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement