Adapting Appearance Stone system from L2jServer.

This commit is contained in:
mobius
2015-02-25 17:57:47 +00:00
parent a3c6227823
commit 7068b969e5
41 changed files with 2830 additions and 717 deletions

View File

@ -0,0 +1,52 @@
/*
* 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.appearance;
import com.l2jserver.gameserver.model.items.appearance.AppearanceStone;
import com.l2jserver.gameserver.model.items.appearance.AppearanceTargetType;
import com.l2jserver.gameserver.model.items.appearance.AppearanceType;
import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
/**
* @author UnAfraid
*/
public class ExChooseShapeShiftingItem extends L2GameServerPacket
{
private final AppearanceType _type;
private final AppearanceTargetType _targetType;
private final int _itemId;
public ExChooseShapeShiftingItem(AppearanceStone stone)
{
_type = stone.getType();
_targetType = stone.getTargetTypes().size() > 1 ? AppearanceTargetType.ALL : stone.getTargetTypes().get(0);
_itemId = stone.getId();
}
@Override
protected void writeImpl()
{
writeC(0xFE);
writeH(0x129);
writeD(_targetType != null ? _targetType.ordinal() : 0);
writeD(_type != null ? _type.ordinal() : 0);
writeD(_itemId);
}
}

View File

@ -16,20 +16,23 @@
* 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.itemappearance;
package com.l2jserver.gameserver.network.serverpackets.appearance;
import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
/**
* @author Erlandys
* @author UnAfraid
*/
public class ExPut_Shape_Shifting_Target_Item_Result extends L2GameServerPacket
public class ExPutShapeShiftingExtractionItemResult extends L2GameServerPacket
{
private final int _success;
public static ExPutShapeShiftingExtractionItemResult FAILED = new ExPutShapeShiftingExtractionItemResult(0x00);
public static ExPutShapeShiftingExtractionItemResult SUCCESS = new ExPutShapeShiftingExtractionItemResult(0x01);
public ExPut_Shape_Shifting_Target_Item_Result(int success)
private final int _result;
public ExPutShapeShiftingExtractionItemResult(int result)
{
_success = success;
_result = result;
}
@Override
@ -37,6 +40,6 @@ public class ExPut_Shape_Shifting_Target_Item_Result extends L2GameServerPacket
{
writeC(0xFE);
writeH(0x12B);
writeD(_success);
writeD(_result);
}
}
}

View File

@ -16,26 +16,26 @@
* 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.itemappearance;
package com.l2jserver.gameserver.network.serverpackets.appearance;
import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
/**
* @author Erlandys
* @author UnAfraid
*/
public class ExPut_Shape_Shifting_Extraction_Item_Result extends L2GameServerPacket
public class ExPutShapeShiftingTargetItemResult extends L2GameServerPacket
{
private final int _type;
private long _price = 0;
public static int RESULT_FAILED = 0x00;
public static int RESULT_SUCCESS = 0x01;
public ExPut_Shape_Shifting_Extraction_Item_Result(int type)
{
_type = type;
}
public static ExPutShapeShiftingTargetItemResult FAILED = new ExPutShapeShiftingTargetItemResult(RESULT_FAILED, 0L);
public ExPut_Shape_Shifting_Extraction_Item_Result(int type, long price)
private final int _resultId;
private final long _price;
public ExPutShapeShiftingTargetItemResult(int resultId, long price)
{
_type = type;
_resultId = resultId;
_price = price;
}
@ -44,7 +44,7 @@ public class ExPut_Shape_Shifting_Extraction_Item_Result extends L2GameServerPac
{
writeC(0xFE);
writeH(0x12A);
writeD(_type);
writeD(_resultId);
writeQ(_price);
}
}
}

View File

@ -16,34 +16,38 @@
* 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.itemappearance;
package com.l2jserver.gameserver.network.serverpackets.appearance;
import com.l2jserver.gameserver.model.entity.AppearanceStone;
import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
/**
* @author Erlandys
* @author UnAfraid
*/
public class ExChoose_Shape_Shifting_Item extends L2GameServerPacket
public class ExShapeShiftingResult extends L2GameServerPacket
{
private final int _itemId;
private final int _type;
private final int _itemType;
public static int RESULT_FAILED = 0x00;
public static int RESULT_SUCCESS = 0x01;
public ExChoose_Shape_Shifting_Item(AppearanceStone stone)
public static ExShapeShiftingResult FAILED = new ExShapeShiftingResult(RESULT_FAILED, 0, 0);
private final int _result;
private final int _targetItemId;
private final int _extractItemId;
public ExShapeShiftingResult(int result, int targetItemId, int extractItemId)
{
_itemId = stone.getItemId();
_type = stone.getType().ordinal();
_itemType = stone.getItemType().ordinal();
_result = result;
_targetItemId = targetItemId;
_extractItemId = extractItemId;
}
@Override
protected void writeImpl()
{
writeC(0xFE);
writeH(0x129);
writeD(_type);
writeD(_itemType);
writeD(_itemId);
writeH(0x12C);
writeD(_result);
writeD(_targetItemId);
writeD(_extractItemId);
}
}

View File

@ -1,61 +0,0 @@
/*
* 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.itemappearance;
import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
/**
* @author Erlandys
*/
public class ExShape_Shifting_Result extends L2GameServerPacket
{
private final int _success;
private int _itemId = 0, _targetItemId = 0, _time = -1;
public ExShape_Shifting_Result(int success)
{
_success = success;
}
public ExShape_Shifting_Result(int success, int itemId, int targetItemId)
{
_success = success;
_itemId = itemId;
_targetItemId = targetItemId;
}
public ExShape_Shifting_Result(int success, int itemId, int targetItemId, int time)
{
_success = success;
_itemId = itemId;
_targetItemId = targetItemId;
_time = time;
}
@Override
protected void writeImpl()
{
writeC(0xFE);
writeH(0x12C);
writeD(_success); // Success - 1, Fail - 0
writeD(_itemId); // targetItemId
writeD(_targetItemId); // extractItemId
writeD(_time); // time
}
}