Added Sayune.

This commit is contained in:
mobius
2015-01-03 10:55:42 +00:00
parent 44ee984365
commit 7e473d3efd
16 changed files with 1301 additions and 3 deletions

View File

@@ -1302,7 +1302,7 @@ public final class L2GamePacketHandler implements IPacketHandler<L2GameClient>,
// @ msg = new RequestExEscapeScene();
break;
case 0x91:
// msg = new RequestFlyMove();
msg = new RequestFlyMove();
break;
case 0x92:
// msg = new RequestSurrenderPledgeWarEX(); (chS)
@@ -1392,7 +1392,7 @@ public final class L2GamePacketHandler implements IPacketHandler<L2GameClient>,
// msg = new RequestFirstPlayStart();
break;
case 0xAD:
// msg = new RequestFlyMoveStart();
msg = new RequestFlyMoveStart();
break;
case 0xAE:
case 0xAF:

View File

@@ -22,10 +22,13 @@ import java.nio.BufferUnderflowException;
import com.l2jserver.Config;
import com.l2jserver.gameserver.ai.CtrlIntention;
import com.l2jserver.gameserver.instancemanager.JumpManager;
import com.l2jserver.gameserver.instancemanager.JumpManager.JumpWay;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
import com.l2jserver.gameserver.network.serverpackets.ExFlyMove;
import com.l2jserver.gameserver.network.serverpackets.StopMove;
import com.l2jserver.gameserver.util.Util;
@@ -101,6 +104,26 @@ public class MoveBackwardToLocation extends L2GameClientPacket
if (activeChar.getTeleMode() > 0)
{
// Sayune
if ((activeChar.getTeleMode() == 3) || (activeChar.getTeleMode() == 4))
{
if (activeChar.getTeleMode() == 3)
{
activeChar.setTeleMode(0);
}
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
activeChar.stopMove(null, false);
activeChar.abortAttack();
activeChar.abortCast();
activeChar.setTarget(null);
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
JumpWay jw = JumpManager.getInstance().new JumpWay();
jw.add(JumpManager.getInstance().new JumpNode(_targetX, _targetY, _targetZ, -1));
activeChar.sendPacket(new ExFlyMove(activeChar.getObjectId(), -1, jw));
activeChar.setXYZ(_targetX, _targetY, _targetZ);
return;
}
if (activeChar.getTeleMode() == 1)
{
activeChar.setTeleMode(0);

View File

@@ -0,0 +1,57 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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 com.l2jserver.gameserver.network.clientpackets;
import com.l2jserver.gameserver.instancemanager.JumpManager;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
/**
* Format: (ch)d
* @author mrTJO
*/
public final class RequestFlyMove extends L2GameClientPacket
{
private static final String _C__D0_94_REQUESTFLYMOVE = "[C] D0:94 RequestFlyMove";
int _nextPoint;
@Override
protected void readImpl()
{
_nextPoint = readD();
}
@Override
protected void runImpl()
{
final L2PcInstance activeChar = getClient().getActiveChar();
if (activeChar == null)
{
return;
}
JumpManager.getInstance().NextJump(activeChar, _nextPoint);
}
@Override
public String getType()
{
return _C__D0_94_REQUESTFLYMOVE;
}
}

View File

@@ -0,0 +1,80 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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 com.l2jserver.gameserver.network.clientpackets;
import com.l2jserver.gameserver.instancemanager.JumpManager;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
public final class RequestFlyMoveStart extends L2GameClientPacket
{
private static final String _C__D0_AD_REQUESTFLYMOVESTART = "[C] D0:AD RequestFlyMoveStart";
@Override
protected void readImpl()
{
}
@Override
protected void runImpl()
{
final L2PcInstance activeChar = getClient().getActiveChar();
if (activeChar == null)
{
return;
}
if (activeChar.isFlying() || activeChar.isMounted() || activeChar.isFlyingMounted() || activeChar.isInBoat() || activeChar.isInAirShip())
{
return;
}
if (activeChar.isTransformed() || activeChar.isCursedWeaponEquipped() || activeChar.isFishing())
{
return;
}
if (activeChar.isCastingNow() || activeChar.isCastingSimultaneouslyNow() || activeChar.isAttackingNow() || activeChar.isInCombat() || activeChar.isInDuel())
{
return;
}
if (activeChar.isStunned() || activeChar.isParalyzed() || activeChar.isSleeping() || activeChar.isAfraid() || activeChar.isAlikeDead() || activeChar.isFakeDeath())
{
return;
}
if (activeChar.isDead() || activeChar.isOutOfControl() || activeChar.isMovementDisabled())
{
return;
}
if (activeChar.isSitting() || activeChar.isMoving() || activeChar.isTeleporting())
{
return;
}
if (activeChar.isInStoreMode() || activeChar.isInCraftMode() || activeChar.isInOlympiadMode())
{
return;
}
activeChar.disableAllSkills(); // lock player skills
JumpManager.getInstance().StartJump(activeChar);
}
@Override
public String getType()
{
return _C__D0_AD_REQUESTFLYMOVESTART;
}
}

View File

@@ -0,0 +1,75 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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 com.l2jserver.gameserver.network.serverpackets;
import com.l2jserver.gameserver.instancemanager.JumpManager.JumpNode;
import com.l2jserver.gameserver.instancemanager.JumpManager.JumpWay;
/**
* Created by IntelliJ IDEA. User: Keiichi Date: 27.05.2011 Time: 12:06:19 To change this template use File | Settings | File Templates.
*/
public class ExFlyMove extends L2GameServerPacket
{
final int _objId;
final int _trackId;
final JumpWay _jw;
public ExFlyMove(int objid, int trackId, JumpWay jw)
{
_objId = objid;
_trackId = trackId;
_jw = jw;
}
@Override
protected void writeImpl()
{
if (_jw == null)
{
return;
}
writeC(0xfe);
writeH(0xe8);
writeD(_objId);
if (_jw.size() == 1)
{
writeD(2);
}
else
{
writeD(0);
}
writeD(0);
writeD(_trackId);
writeD(_jw.size());
for (JumpNode n : _jw)
{
writeD(n.getNext());
writeD(0);
writeD(n.getX());
writeD(n.getY());
writeD(n.getZ());
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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 com.l2jserver.gameserver.network.serverpackets;
/**
* @author mrTJO
*/
public final class ExNotifyFlyMoveStart extends L2GameServerPacket
{
public ExNotifyFlyMoveStart()
{
}
@Override
protected void writeImpl()
{
writeC(0xFE);
writeH(0x110);
}
}