mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-07 07:52:57 +00:00
@@ -22,6 +22,7 @@ import com.l2jserver.game.net.Lineage2Connection;
|
||||
import com.l2jserver.game.net.packet.AbstractServerPacket;
|
||||
import com.l2jserver.model.world.Item;
|
||||
import com.l2jserver.model.world.character.CharacterInventory;
|
||||
import com.l2jserver.model.world.character.CharacterInventory.InventoryLocation;
|
||||
|
||||
/**
|
||||
* This packet send the inventory to the client
|
||||
@@ -53,13 +54,21 @@ public class InventoryPacket extends AbstractServerPacket {
|
||||
buffer.writeByte((showWindow ? 0x01 : 0x00));
|
||||
buffer.writeInt(inventory.getItemCount()); // item count
|
||||
for (Item item : inventory) {
|
||||
buffer.writeInt(item.getID().getID());
|
||||
buffer.writeInt(item.getTemplateID().getID());
|
||||
buffer.writeInt(0x00); // loc slot
|
||||
buffer.writeLong(0x00); // count
|
||||
buffer.writeInt(item.getID().getID()); // obj id
|
||||
buffer.writeInt(item.getTemplateID().getID()); // item id
|
||||
if (item.getLocation() == InventoryLocation.PAPERDOLL) {
|
||||
buffer.writeInt(item.getPaperdoll().id); // loc slot
|
||||
} else {
|
||||
buffer.writeInt(0x00); // loc slot
|
||||
}
|
||||
buffer.writeLong(item.getCount()); // count
|
||||
buffer.writeShort(0x00); // item type2
|
||||
buffer.writeShort(0x00); // item type3
|
||||
buffer.writeShort(0x00); // equiped?
|
||||
if (item.getLocation() == InventoryLocation.PAPERDOLL) {
|
||||
buffer.writeShort(0x01); // equiped?
|
||||
} else {
|
||||
buffer.writeShort(0x00); // equiped?
|
||||
}
|
||||
buffer.writeInt(0x00); // body part
|
||||
buffer.writeShort(0x00); // enchant level
|
||||
// race tickets
|
||||
|
||||
@@ -76,7 +76,7 @@ public class Item extends AbstractObject implements Playable, Spawnable,
|
||||
/**
|
||||
* Count of items
|
||||
*/
|
||||
private int count = 1;
|
||||
private long count = 1;
|
||||
|
||||
public Item(ItemTemplateID templateID) {
|
||||
this.templateID = templateID;
|
||||
@@ -112,7 +112,7 @@ public class Item extends AbstractObject implements Playable, Spawnable,
|
||||
/**
|
||||
* @return the count
|
||||
*/
|
||||
public int getCount() {
|
||||
public long getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ public class Item extends AbstractObject implements Playable, Spawnable,
|
||||
* @param count
|
||||
* the count to set
|
||||
*/
|
||||
public void setCount(int count) {
|
||||
public void setCount(long count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
|
||||
@@ -114,11 +114,21 @@ public class CharacterInventory implements Iterable<Item> {
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public enum InventoryPaperdoll {
|
||||
UNDERWEAR, HEAD, HAIR1, HAIR2, NECK, RIGHT_HAND, FEET, LEFT_HAND, RIGHT_EAR, LEFT_EAR, GLOVES,
|
||||
UNDERWEAR(0), HEAD(1), HAIR1(2), HAIR2(3), NECK(4), RIGHT_HAND(5), CHEST(
|
||||
6), LEFT_HAND(7), RIGHT_EAR(8), LEFT_EAR(9), GLOVES(10), LEGS(
|
||||
11), FEET(12), RIGHT_FINGER(13), LEFT_FINGER(14), LEFT_BRACELET(
|
||||
15), RIGHT_BRACELET(16), DECORATION_1(17), DECORATION_2(18), DECORATION_3(
|
||||
19), DECORATION_4(20), DECORATION_5(21), DECORATION_6(22), CLOAK(
|
||||
23), BELT(24);
|
||||
|
||||
LEGS, LEFT_FEET, RIGHT_FEET, RIGHT_FINGER, LEFT_FINGER, CHEST, LEFT_BRACELET, RIGHT_BRACELET,
|
||||
/**
|
||||
* The inventory paperdoll slot id
|
||||
*/
|
||||
public final int id;
|
||||
|
||||
DECORATION_1, DECORATION_2, DECORATION_3, DECORATION_4, DECORATION_5, DECORATION_6, CLOAK, BELT;
|
||||
InventoryPaperdoll(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,16 +14,21 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.calculator;
|
||||
package com.l2jserver.util.oldcalculator;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jserver.util.calculator.operation.AddOperation;
|
||||
import com.l2jserver.util.calculator.operation.CalculatorOperation;
|
||||
import com.l2jserver.util.calculator.operation.SetOperation;
|
||||
import com.l2jserver.util.calculator.operation.SubtractOperation;
|
||||
import com.l2jserver.util.factory.CollectionFactory;
|
||||
import com.l2jserver.util.oldcalculator.operation.AddOperation;
|
||||
import com.l2jserver.util.oldcalculator.operation.CalculatorOperation;
|
||||
import com.l2jserver.util.oldcalculator.operation.SetOperation;
|
||||
import com.l2jserver.util.oldcalculator.operation.SubtractOperation;
|
||||
|
||||
/**
|
||||
* The formula object does an sequence of steps into calculating something.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class Formula {
|
||||
private List<CalculatorOperation<Integer>> operations = CollectionFactory
|
||||
.newList(null);
|
||||
@@ -14,7 +14,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.calculator.operation;
|
||||
package com.l2jserver.util.oldcalculator.operation;
|
||||
|
||||
public class AddOperation implements CalculatorOperation<Integer> {
|
||||
private Integer value;
|
||||
@@ -14,7 +14,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.calculator.operation;
|
||||
package com.l2jserver.util.oldcalculator.operation;
|
||||
|
||||
public interface CalculatorOperation<T extends Number> {
|
||||
T calculate(T value);
|
||||
@@ -14,7 +14,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.calculator.operation;
|
||||
package com.l2jserver.util.oldcalculator.operation;
|
||||
|
||||
public class MultiplyOperation implements CalculatorOperation<Integer> {
|
||||
private Integer value;
|
||||
@@ -14,7 +14,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.calculator.operation;
|
||||
package com.l2jserver.util.oldcalculator.operation;
|
||||
|
||||
public class SetOperation implements CalculatorOperation<Integer> {
|
||||
private Integer value;
|
||||
@@ -14,7 +14,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.calculator.operation;
|
||||
package com.l2jserver.util.oldcalculator.operation;
|
||||
|
||||
public class SubtractOperation implements CalculatorOperation<Integer> {
|
||||
private Integer value;
|
||||
Reference in New Issue
Block a user