Handy's Block Checker Event adjustments and removals.
This commit is contained in:
@@ -658,7 +658,7 @@ public class TvT extends Event
|
||||
player.sendMessage("Your level is too high to participate.");
|
||||
return false;
|
||||
}
|
||||
if (player.isRegisteredOnEvent() || (player.getBlockCheckerArena() > -1))
|
||||
if (player.isRegisteredOnEvent())
|
||||
{
|
||||
player.sendMessage("You are already registered on an event.");
|
||||
return false;
|
||||
|
@@ -152,7 +152,6 @@ public class EffectMasterHandler
|
||||
EffectHandler.getInstance().registerHandler("Feed", Feed::new);
|
||||
EffectHandler.getInstance().registerHandler("FishingExpSpBonus", FishingExpSpBonus::new);
|
||||
EffectHandler.getInstance().registerHandler("Flag", Flag::new);
|
||||
EffectHandler.getInstance().registerHandler("FlipBlock", FlipBlock::new);
|
||||
EffectHandler.getInstance().registerHandler("FocusEnergy", FocusEnergy::new);
|
||||
EffectHandler.getInstance().registerHandler("FocusMomentum", FocusMomentum::new);
|
||||
EffectHandler.getInstance().registerHandler("FocusMaxMomentum", FocusMaxMomentum::new);
|
||||
|
@@ -195,7 +195,6 @@ import handlers.itemhandlers.CharmOfCourage;
|
||||
import handlers.itemhandlers.Elixir;
|
||||
import handlers.itemhandlers.EnchantAttribute;
|
||||
import handlers.itemhandlers.EnchantScrolls;
|
||||
import handlers.itemhandlers.EventItem;
|
||||
import handlers.itemhandlers.ExtractableItems;
|
||||
import handlers.itemhandlers.FatedSupportBox;
|
||||
import handlers.itemhandlers.FishShots;
|
||||
@@ -519,7 +518,6 @@ public class MasterHandler
|
||||
Elixir.class,
|
||||
EnchantAttribute.class,
|
||||
EnchantScrolls.class,
|
||||
EventItem.class,
|
||||
ExtractableItems.class,
|
||||
FatedSupportBox.class,
|
||||
FishShots.class,
|
||||
|
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.instancemanager.HandysBlockCheckerManager;
|
||||
import org.l2jmobius.gameserver.model.ArenaParticipantsHolder;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.Block;
|
||||
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
|
||||
/**
|
||||
* Flip Block effect implementation.
|
||||
* @author Mobius
|
||||
*/
|
||||
public class FlipBlock extends AbstractEffect
|
||||
{
|
||||
public FlipBlock(StatSet params)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInstant()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void instant(Creature effector, Creature effected, Skill skill, Item item)
|
||||
{
|
||||
final Block block = effected instanceof Block ? (Block) effected : null;
|
||||
final Player player = effector.isPlayer() ? (Player) effector : null;
|
||||
if ((block == null) || (player == null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int arena = player.getBlockCheckerArena();
|
||||
if (arena != -1)
|
||||
{
|
||||
final ArenaParticipantsHolder holder = HandysBlockCheckerManager.getInstance().getHolder(arena);
|
||||
if (holder == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int team = holder.getPlayerTeam(player);
|
||||
final int color = block.getColorEffect();
|
||||
if ((team == 0) && (color == 0x00))
|
||||
{
|
||||
block.changeColor(player, holder, team);
|
||||
}
|
||||
else if ((team == 1) && (color == 0x53))
|
||||
{
|
||||
block.changeColor(player, holder, team);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,107 +0,0 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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.itemhandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.ItemSkillType;
|
||||
import org.l2jmobius.gameserver.handler.IItemHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.HandysBlockCheckerManager;
|
||||
import org.l2jmobius.gameserver.model.ArenaParticipantsHolder;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Playable;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.Block;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
public class EventItem implements IItemHandler
|
||||
{
|
||||
@Override
|
||||
public boolean useItem(Playable playable, Item item, boolean forceUse)
|
||||
{
|
||||
if (!playable.isPlayer())
|
||||
{
|
||||
playable.sendPacket(SystemMessageId.YOUR_PET_CANNOT_CARRY_THIS_ITEM);
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean used = false;
|
||||
|
||||
final Player player = playable.getActingPlayer();
|
||||
final int itemId = item.getId();
|
||||
switch (itemId)
|
||||
{
|
||||
case 13787: // Handy's Block Checker Bond
|
||||
{
|
||||
used = useBlockCheckerItem(player, item);
|
||||
break;
|
||||
}
|
||||
case 13788: // Handy's Block Checker Land Mine
|
||||
{
|
||||
used = useBlockCheckerItem(player, item);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
LOGGER.warning("EventItemHandler: Item with id: " + itemId + " is not handled");
|
||||
}
|
||||
}
|
||||
return used;
|
||||
}
|
||||
|
||||
private final boolean useBlockCheckerItem(Player castor, Item item)
|
||||
{
|
||||
final int blockCheckerArena = castor.getBlockCheckerArena();
|
||||
if (blockCheckerArena == -1)
|
||||
{
|
||||
final SystemMessage msg = new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS);
|
||||
msg.addItemName(item);
|
||||
castor.sendPacket(msg);
|
||||
return false;
|
||||
}
|
||||
|
||||
final Skill sk = item.getEtcItem().getSkills(ItemSkillType.NORMAL).get(0).getSkill();
|
||||
if (sk == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!castor.destroyItem("Consume", item, 1, castor, true))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final Block block = (Block) castor.getTarget();
|
||||
final ArenaParticipantsHolder holder = HandysBlockCheckerManager.getInstance().getHolder(blockCheckerArena);
|
||||
if (holder != null)
|
||||
{
|
||||
final int team = holder.getPlayerTeam(castor);
|
||||
World.getInstance().forEachVisibleObjectInRange(block, Player.class, sk.getEffectRange(), pc ->
|
||||
{
|
||||
final int enemyTeam = holder.getPlayerTeam(pc);
|
||||
if ((enemyTeam != -1) && (enemyTeam != team))
|
||||
{
|
||||
sk.applyEffects(castor, pc);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
LOGGER.warning("Char: " + castor.getName() + "[" + castor.getObjectId() + "] has unknown block checker arena");
|
||||
return false;
|
||||
}
|
||||
}
|
@@ -39,7 +39,7 @@ public class SummonItems extends ItemSkillsTemplate
|
||||
}
|
||||
|
||||
final Player player = playable.getActingPlayer();
|
||||
if (!player.getClient().getFloodProtectors().canUsePetSummonItem() || (player.getBlockCheckerArena() != -1) || player.inObserverMode() || player.isAllSkillsDisabled() || player.isCastingNow())
|
||||
if (!player.getClient().getFloodProtectors().canUsePetSummonItem() || player.inObserverMode() || player.isAllSkillsDisabled() || player.isCastingNow())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user