本文整理汇总了Java中client.inventory.MapleMount类的典型用法代码示例。如果您正苦于以下问题:Java MapleMount类的具体用法?Java MapleMount怎么用?Java MapleMount使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MapleMount类属于client.inventory包,在下文中一共展示了MapleMount类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: UseMountFood
import client.inventory.MapleMount; //导入依赖的package包/类
public static final void UseMountFood(final LittleEndianAccessor slea, final MapleClient c, final MapleCharacter chr) {
slea.skip(4); // update tick
final byte slot = (byte) slea.readShort();
final int itemid = slea.readInt(); //2260000 usually
final Item toUse = chr.getInventory(MapleInventoryType.USE).getItem(slot);
final MapleMount mount = chr.getMount();
if (itemid / 10000 == 226 && toUse != null && toUse.getQuantity() > 0 && toUse.getItemId() == itemid && mount != null && !c.getPlayer().hasBlockedInventory()) {
final int fatigue = mount.getFatigue();
boolean levelup = false;
mount.setFatigue((byte) -30);
if (fatigue > 0) {
mount.increaseExp();
final int level = mount.getLevel();
if (level < 30 && mount.getExp() >= GameConstants.getMountExpNeededForLevel(level + 1)) {
mount.setLevel((byte) (level + 1));
levelup = true;
}
}
chr.getMap().broadcastMessage(CWvsContext.updateMount(chr, levelup));
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.USE, slot, (short) 1, false);
}
c.getSession().write(CWvsContext.enableActions());
}
示例2: UseMountFood
import client.inventory.MapleMount; //导入依赖的package包/类
public static void UseMountFood(SeekableLittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
byte slot = (byte) slea.readShort();
int itemid = slea.readInt();
Item toUse = chr.getInventory(MapleInventoryType.USE).getItem((short) slot);
MapleMount mount = chr.getMount();
if ((itemid / 10000 == 226) && (toUse != null) && (toUse.getQuantity() > 0) && (toUse.getItemId() == itemid) && (mount != null) && (!c.getPlayer().hasBlockedInventory())) {
int fatigue = mount.getFatigue();
boolean levelup = false;
mount.setFatigue((byte) -30);
if (fatigue > 0) {
mount.increaseExp();
int level = mount.getLevel();
if ((level < 30) && (mount.getExp() >= GameConstants.getMountExpNeededForLevel(level + 1))) {
mount.setLevel((byte) (level + 1));
levelup = true;
}
}
chr.getMap().broadcastMessage(MaplePacketCreator.updateMount(chr, levelup));
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.USE, (short) slot, (byte) 1, false);
}
c.getSession().write(MaplePacketCreator.enableActions());
}
示例3: UseMountFood
import client.inventory.MapleMount; //导入依赖的package包/类
public static final void UseMountFood(final LittleEndianAccessor slea, final MapleClient c, final MapleCharacter chr) {
c.getPlayer().updateTick(slea.readInt());
final byte slot = (byte) slea.readShort();
final int itemid = slea.readInt(); //2260000 usually
final Item toUse = chr.getInventory(MapleInventoryType.USE).getItem(slot);
final MapleMount mount = chr.getMount();
if (itemid / 10000 == 226 && toUse != null && toUse.getQuantity() > 0 && toUse.getItemId() == itemid && mount != null && !c.getPlayer().hasBlockedInventory()) {
final int fatigue = mount.getFatigue();
boolean levelup = false;
mount.setFatigue((byte) -30);
if (fatigue > 0) {
mount.increaseExp();
final int level = mount.getLevel();
if (level < 30 && mount.getExp() >= GameConstants.getMountExpNeededForLevel(level + 1)) {
mount.setLevel((byte) (level + 1));
levelup = true;
}
}
chr.getMap().broadcastMessage(CWvsContext.updateMount(chr, levelup));
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.USE, slot, (short) 1, false);
}
c.getSession().write(CWvsContext.enableActions());
}
示例4: getMount
import client.inventory.MapleMount; //导入依赖的package包/类
public MapleMount getMount() {
return mount;
}
示例5: getMount
import client.inventory.MapleMount; //导入依赖的package包/类
public MapleMount getMount() {
return this.mount;
}