Battalion zone - incomplete.

Contributed by Ionut.
This commit is contained in:
mobius
2015-01-15 13:21:00 +00:00
parent 7b2eeaf75d
commit 3ae2479692
12 changed files with 596 additions and 1 deletions

View File

@ -25,6 +25,7 @@ import java.util.logging.Logger;
import com.l2jserver.Config;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.entity.L2Event;
import com.l2jserver.gameserver.model.zone.ZoneId;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
import com.l2jserver.gameserver.taskmanager.AttackStanceTaskManager;
@ -70,6 +71,13 @@ public final class Logout extends L2GameClientPacket
return;
}
if (player.isInsideZone(ZoneId.BATTALION) && !Config.BTZ_LOGOUT_ZONE)
{
player.sendMessage("You cannot logout while inside a Battalion zone.");
player.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
// Don't allow leaving if player is fighting
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player))
{

View File

@ -26,6 +26,7 @@ import com.l2jserver.Config;
import com.l2jserver.gameserver.enums.PrivateStoreType;
import com.l2jserver.gameserver.instancemanager.AntiFeedManager;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.zone.ZoneId;
import com.l2jserver.gameserver.network.L2GameClient;
import com.l2jserver.gameserver.network.L2GameClient.GameClientState;
import com.l2jserver.gameserver.network.SystemMessageId;
@ -90,6 +91,13 @@ public final class RequestRestart extends L2GameClientPacket
return;
}
if (player.isInsideZone(ZoneId.BATTALION) && !Config.BTZ_RESTART_ZONE)
{
player.sendMessage("You cannot restart while inside a Battalion zone.");
sendPacket(RestartResponse.valueOf(false));
return;
}
if (player.isBlockedFromExit())
{
sendPacket(RestartResponse.valueOf(false));

View File

@ -42,6 +42,8 @@ import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.model.items.type.ArmorType;
import com.l2jserver.gameserver.model.items.type.WeaponType;
import com.l2jserver.gameserver.model.skills.Skill;
import com.l2jserver.gameserver.model.zone.ZoneId;
import com.l2jserver.gameserver.model.zone.type.L2BattalionZone;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
import com.l2jserver.gameserver.network.serverpackets.ExUseSharedGroupItem;
@ -127,6 +129,12 @@ public final class UseItem extends L2GameClientPacket
return;
}
if (activeChar.isInsideZone(ZoneId.BATTALION) && !L2BattalionZone.checkItem(item))
{
getClient().getActiveChar().sendMessage("You cannot use " + item.getName() + " inside this zone.");
return;
}
if (item.getItem().getType2() == L2Item.TYPE2_QUEST)
{
activeChar.sendPacket(SystemMessageId.YOU_CANNOT_USE_QUEST_ITEMS);

View File

@ -22,6 +22,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.l2jserver.Config;
import com.l2jserver.gameserver.instancemanager.CHSiegeManager;
import com.l2jserver.gameserver.instancemanager.CastleManager;
import com.l2jserver.gameserver.instancemanager.FortManager;
@ -31,6 +32,7 @@ import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.entity.Castle;
import com.l2jserver.gameserver.model.entity.Fort;
import com.l2jserver.gameserver.model.entity.clanhall.SiegableHall;
import com.l2jserver.gameserver.model.zone.ZoneId;
/**
* @author UnAfraid, Nos
@ -81,6 +83,16 @@ public class Die extends L2GameServerPacket
_toFortress = ((clan != null) && (clan.getFortId() > 0)) || isInFortDefense;
}
if (activeChar.isInsideZone(ZoneId.BATTALION) && !Config.BTZ_REVIVE)
{
_toVillage = false;
_toClanHall = false;
_toCastle = false;
_toOutpost = false;
_useFeather = false;
_toFortress = false;
}
_isSweepable = activeChar.isAttackable() && activeChar.isSweepActive();
}

View File

@ -74,6 +74,30 @@ public class ExShowScreenMessage extends L2GameServerPacket
_npcString = -1;
}
/**
* Display a String on the screen for a given time.
* @param text the text to display
* @param time the display time
* @param position the position on the screen
* @param showEffect upper effect (false - disabled, true - enabled) - _position must be 2 (center) otherwise no effect
*/
public ExShowScreenMessage(String text, int time, boolean showEffect, int position)
{
_type = 2;
_sysMessageId = -1;
_unk1 = 0;
_unk2 = 0;
_unk3 = 0;
_fade = false;
_position = TOP_CENTER;
_text = text;
_time = time;
_size = 0;
_effect = showEffect;
_npcString = -1;
}
/**
* Display a NPC String on the screen for a given position and time.
* @param npcString the NPC String Id