Merged with released L2J-Unity files.
This commit is contained in:
@@ -1,63 +1,78 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.gameserver.datatables.SkillData;
|
||||
import com.l2jmobius.gameserver.model.skills.BuffInfo;
|
||||
|
||||
public class AbnormalStatusUpdate extends L2GameServerPacket
|
||||
{
|
||||
private final List<BuffInfo> _effects = new ArrayList<>();
|
||||
|
||||
public void addSkill(BuffInfo info)
|
||||
{
|
||||
if (!info.getSkill().isHealingPotionSkill())
|
||||
{
|
||||
_effects.add(info);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x85);
|
||||
writeH(_effects.size());
|
||||
for (BuffInfo info : _effects)
|
||||
{
|
||||
if ((info != null) && info.isInUse())
|
||||
{
|
||||
writeD(info.getSkill().getDisplayId());
|
||||
if (info.getSkill().getDisplayLevel() < 100)
|
||||
{
|
||||
writeH(info.getSkill().getDisplayLevel());
|
||||
writeH(0x00);
|
||||
}
|
||||
else
|
||||
{
|
||||
final int maxLevel = SkillData.getInstance().getMaxLevel(info.getSkill().getDisplayId());
|
||||
writeH(maxLevel);
|
||||
writeH(info.getSkill().getDisplayLevel());
|
||||
}
|
||||
writeD(0x00);
|
||||
writeH(info.getTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.skills.BuffInfo;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class AbnormalStatusUpdate implements IClientOutgoingPacket
|
||||
{
|
||||
private final List<BuffInfo> _effects = new ArrayList<>();
|
||||
private final List<Skill> _effects2 = new ArrayList<>();
|
||||
|
||||
public void addSkill(BuffInfo info)
|
||||
{
|
||||
if (!info.getSkill().isHealingPotionSkill())
|
||||
{
|
||||
_effects.add(info);
|
||||
}
|
||||
}
|
||||
|
||||
public void addSkill(Skill skill)
|
||||
{
|
||||
if (!skill.isHealingPotionSkill())
|
||||
{
|
||||
_effects2.add(skill);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.ABNORMAL_STATUS_UPDATE.writeId(packet);
|
||||
|
||||
packet.writeH(_effects.size() + _effects2.size());
|
||||
for (BuffInfo info : _effects)
|
||||
{
|
||||
if ((info != null) && info.isInUse())
|
||||
{
|
||||
packet.writeD(info.getSkill().getDisplayId());
|
||||
packet.writeH(info.getSkill().getDisplayLevel());
|
||||
packet.writeH(0x00); // Sub level
|
||||
packet.writeD(info.getSkill().getAbnormalType().getClientId());
|
||||
writeOptionalD(packet, info.getSkill().isAura() ? -1 : info.getTime());
|
||||
}
|
||||
}
|
||||
for (Skill skill : _effects2)
|
||||
{
|
||||
if (skill != null)
|
||||
{
|
||||
packet.writeD(skill.getDisplayId());
|
||||
packet.writeH(skill.getDisplayLevel());
|
||||
packet.writeH(0x00); // Sub level
|
||||
packet.writeD(skill.getAbnormalType().getClientId());
|
||||
packet.writeH(-1);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,159 +1,164 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.l2jmobius.gameserver.cache.HtmCache;
|
||||
import com.l2jmobius.gameserver.enums.HtmlActionScope;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* @author HorridoJoho
|
||||
*/
|
||||
public abstract class AbstractHtmlPacket extends L2GameServerPacket
|
||||
{
|
||||
public static final char VAR_PARAM_START_CHAR = '$';
|
||||
|
||||
private final int _npcObjId;
|
||||
private String _html = null;
|
||||
private boolean _disabledValidation = false;
|
||||
|
||||
protected AbstractHtmlPacket()
|
||||
{
|
||||
_npcObjId = 0;
|
||||
}
|
||||
|
||||
protected AbstractHtmlPacket(int npcObjId)
|
||||
{
|
||||
if (npcObjId < 0)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
_npcObjId = npcObjId;
|
||||
}
|
||||
|
||||
protected AbstractHtmlPacket(String html)
|
||||
{
|
||||
_npcObjId = 0;
|
||||
setHtml(html);
|
||||
}
|
||||
|
||||
protected AbstractHtmlPacket(int npcObjId, String html)
|
||||
{
|
||||
if (npcObjId < 0)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
_npcObjId = npcObjId;
|
||||
setHtml(html);
|
||||
}
|
||||
|
||||
public final void disableValidation()
|
||||
{
|
||||
_disabledValidation = true;
|
||||
}
|
||||
|
||||
public final void setHtml(String html)
|
||||
{
|
||||
if (html.length() > 17200)
|
||||
{
|
||||
_log.log(Level.WARNING, "Html is too long! this will crash the client!", new Throwable());
|
||||
_html = html.substring(0, 17200);
|
||||
}
|
||||
|
||||
if (!html.contains("<html") && !html.startsWith("..\\L2"))
|
||||
{
|
||||
html = "<html><body>" + html + "</body></html>";
|
||||
}
|
||||
|
||||
_html = html;
|
||||
}
|
||||
|
||||
public final boolean setFile(String prefix, String path)
|
||||
{
|
||||
final String content = HtmCache.getInstance().getHtm(prefix, path);
|
||||
if (content == null)
|
||||
{
|
||||
setHtml("<html><body>My Text is missing:<br>" + path + "</body></html>");
|
||||
_log.warning("missing html page " + path);
|
||||
return false;
|
||||
}
|
||||
|
||||
setHtml(content);
|
||||
return true;
|
||||
}
|
||||
|
||||
public final void replace(String pattern, String value)
|
||||
{
|
||||
_html = _html.replaceAll(pattern, value.replaceAll("\\$", "\\\\\\$"));
|
||||
}
|
||||
|
||||
public final void replace(String pattern, boolean val)
|
||||
{
|
||||
replace(pattern, String.valueOf(val));
|
||||
}
|
||||
|
||||
public final void replace(String pattern, int val)
|
||||
{
|
||||
replace(pattern, String.valueOf(val));
|
||||
}
|
||||
|
||||
public final void replace(String pattern, long val)
|
||||
{
|
||||
replace(pattern, String.valueOf(val));
|
||||
}
|
||||
|
||||
public final void replace(String pattern, double val)
|
||||
{
|
||||
replace(pattern, String.valueOf(val));
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void runImpl()
|
||||
{
|
||||
final L2PcInstance player = getClient().getActiveChar();
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.clearHtmlActions(getScope());
|
||||
|
||||
if (_disabledValidation)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Util.buildHtmlActionCache(player, getScope(), _npcObjId, _html);
|
||||
}
|
||||
|
||||
public final int getNpcObjId()
|
||||
{
|
||||
return _npcObjId;
|
||||
}
|
||||
|
||||
public final String getHtml()
|
||||
{
|
||||
return _html;
|
||||
}
|
||||
|
||||
public abstract HtmlActionScope getScope();
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.l2jmobius.gameserver.cache.HtmCache;
|
||||
import com.l2jmobius.gameserver.enums.HtmlActionScope;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* @author HorridoJoho
|
||||
*/
|
||||
public abstract class AbstractHtmlPacket implements IClientOutgoingPacket
|
||||
{
|
||||
public static final char VAR_PARAM_START_CHAR = '$';
|
||||
|
||||
private final int _npcObjId;
|
||||
private String _html = null;
|
||||
private boolean _disabledValidation = false;
|
||||
|
||||
protected AbstractHtmlPacket()
|
||||
{
|
||||
_npcObjId = 0;
|
||||
}
|
||||
|
||||
protected AbstractHtmlPacket(int npcObjId)
|
||||
{
|
||||
if (npcObjId < 0)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
_npcObjId = npcObjId;
|
||||
}
|
||||
|
||||
protected AbstractHtmlPacket(String html)
|
||||
{
|
||||
_npcObjId = 0;
|
||||
setHtml(html);
|
||||
}
|
||||
|
||||
protected AbstractHtmlPacket(int npcObjId, String html)
|
||||
{
|
||||
if (npcObjId < 0)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
_npcObjId = npcObjId;
|
||||
setHtml(html);
|
||||
}
|
||||
|
||||
public final void disableValidation()
|
||||
{
|
||||
_disabledValidation = true;
|
||||
}
|
||||
|
||||
public final void setHtml(String html)
|
||||
{
|
||||
if (html.length() > 17200)
|
||||
{
|
||||
_log.log(Level.WARNING, "Html is too long! this will crash the client!", new Throwable());
|
||||
_html = html.substring(0, 17200);
|
||||
}
|
||||
|
||||
if (!html.contains("<html") && !html.startsWith("..\\L2"))
|
||||
{
|
||||
html = "<html><body>" + html + "</body></html>";
|
||||
}
|
||||
|
||||
_html = html;
|
||||
}
|
||||
|
||||
public final boolean setFile(String prefix, String path)
|
||||
{
|
||||
final String content = HtmCache.getInstance().getHtm(prefix, path);
|
||||
if (content == null)
|
||||
{
|
||||
setHtml("<html><body>My Text is missing:<br>" + path + "</body></html>");
|
||||
_log.warning("missing html page " + path);
|
||||
return false;
|
||||
}
|
||||
|
||||
setHtml(content);
|
||||
return true;
|
||||
}
|
||||
|
||||
public final void replace(String pattern, String value)
|
||||
{
|
||||
_html = _html.replaceAll(pattern, value.replaceAll("\\$", "\\\\\\$"));
|
||||
}
|
||||
|
||||
public final void replace(String pattern, CharSequence value)
|
||||
{
|
||||
replace(pattern, String.valueOf(value));
|
||||
}
|
||||
|
||||
public final void replace(String pattern, boolean val)
|
||||
{
|
||||
replace(pattern, String.valueOf(val));
|
||||
}
|
||||
|
||||
public final void replace(String pattern, int val)
|
||||
{
|
||||
replace(pattern, String.valueOf(val));
|
||||
}
|
||||
|
||||
public final void replace(String pattern, long val)
|
||||
{
|
||||
replace(pattern, String.valueOf(val));
|
||||
}
|
||||
|
||||
public final void replace(String pattern, double val)
|
||||
{
|
||||
replace(pattern, String.valueOf(val));
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void runImpl(L2PcInstance player)
|
||||
{
|
||||
if (player != null)
|
||||
{
|
||||
player.clearHtmlActions(getScope());
|
||||
}
|
||||
|
||||
if (_disabledValidation)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
Util.buildHtmlActionCache(player, getScope(), _npcObjId, _html);
|
||||
}
|
||||
}
|
||||
|
||||
public final int getNpcObjId()
|
||||
{
|
||||
return _npcObjId;
|
||||
}
|
||||
|
||||
public final String getHtml()
|
||||
{
|
||||
return _html;
|
||||
}
|
||||
|
||||
public abstract HtmlActionScope getScope();
|
||||
}
|
||||
|
||||
@@ -1,93 +1,94 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentSkipListMap;
|
||||
|
||||
import com.l2jmobius.gameserver.model.ItemInfo;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public abstract class AbstractInventoryUpdate extends AbstractItemPacket
|
||||
{
|
||||
private final Map<Integer, ItemInfo> _items = new ConcurrentSkipListMap<>();
|
||||
|
||||
public AbstractInventoryUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
public AbstractInventoryUpdate(L2ItemInstance item)
|
||||
{
|
||||
addItem(item);
|
||||
}
|
||||
|
||||
public AbstractInventoryUpdate(List<ItemInfo> items)
|
||||
{
|
||||
for (ItemInfo item : items)
|
||||
{
|
||||
_items.put(item.getObjectId(), item);
|
||||
}
|
||||
}
|
||||
|
||||
public final void addItem(L2ItemInstance item)
|
||||
{
|
||||
_items.put(item.getObjectId(), new ItemInfo(item));
|
||||
}
|
||||
|
||||
public final void addNewItem(L2ItemInstance item)
|
||||
{
|
||||
_items.put(item.getObjectId(), new ItemInfo(item, 1));
|
||||
}
|
||||
|
||||
public final void addModifiedItem(L2ItemInstance item)
|
||||
{
|
||||
_items.put(item.getObjectId(), new ItemInfo(item, 2));
|
||||
}
|
||||
|
||||
public final void addRemovedItem(L2ItemInstance item)
|
||||
{
|
||||
_items.put(item.getObjectId(), new ItemInfo(item, 3));
|
||||
}
|
||||
|
||||
public final void addItems(List<L2ItemInstance> items)
|
||||
{
|
||||
for (L2ItemInstance item : items)
|
||||
{
|
||||
_items.put(item.getObjectId(), new ItemInfo(item));
|
||||
}
|
||||
}
|
||||
|
||||
public final Collection<ItemInfo> getItems()
|
||||
{
|
||||
return _items.values();
|
||||
}
|
||||
|
||||
protected final void writeItems()
|
||||
{
|
||||
writeH(_items.size());
|
||||
for (ItemInfo item : _items.values())
|
||||
{
|
||||
writeH(item.getChange()); // Update type : 01-add, 02-modify, 03-remove
|
||||
writeItem(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentSkipListMap;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.ItemInfo;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public abstract class AbstractInventoryUpdate extends AbstractItemPacket
|
||||
{
|
||||
private final Map<Integer, ItemInfo> _items = new ConcurrentSkipListMap<>();
|
||||
|
||||
public AbstractInventoryUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
public AbstractInventoryUpdate(L2ItemInstance item)
|
||||
{
|
||||
addItem(item);
|
||||
}
|
||||
|
||||
public AbstractInventoryUpdate(List<ItemInfo> items)
|
||||
{
|
||||
for (ItemInfo item : items)
|
||||
{
|
||||
_items.put(item.getObjectId(), item);
|
||||
}
|
||||
}
|
||||
|
||||
public final void addItem(L2ItemInstance item)
|
||||
{
|
||||
_items.put(item.getObjectId(), new ItemInfo(item));
|
||||
}
|
||||
|
||||
public final void addNewItem(L2ItemInstance item)
|
||||
{
|
||||
_items.put(item.getObjectId(), new ItemInfo(item, 1));
|
||||
}
|
||||
|
||||
public final void addModifiedItem(L2ItemInstance item)
|
||||
{
|
||||
_items.put(item.getObjectId(), new ItemInfo(item, 2));
|
||||
}
|
||||
|
||||
public final void addRemovedItem(L2ItemInstance item)
|
||||
{
|
||||
_items.put(item.getObjectId(), new ItemInfo(item, 3));
|
||||
}
|
||||
|
||||
public final void addItems(List<L2ItemInstance> items)
|
||||
{
|
||||
for (L2ItemInstance item : items)
|
||||
{
|
||||
_items.put(item.getObjectId(), new ItemInfo(item));
|
||||
}
|
||||
}
|
||||
|
||||
public final Collection<ItemInfo> getItems()
|
||||
{
|
||||
return _items.values();
|
||||
}
|
||||
|
||||
protected final void writeItems(PacketWriter packet)
|
||||
{
|
||||
packet.writeH(_items.size());
|
||||
for (ItemInfo item : _items.values())
|
||||
{
|
||||
packet.writeH(item.getChange()); // Update type : 01-add, 02-modify, 03-remove
|
||||
writeItem(packet, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,270 +1,246 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ItemListType;
|
||||
import com.l2jmobius.gameserver.model.ItemInfo;
|
||||
import com.l2jmobius.gameserver.model.TradeItem;
|
||||
import com.l2jmobius.gameserver.model.buylist.Product;
|
||||
import com.l2jmobius.gameserver.model.itemcontainer.PcInventory;
|
||||
import com.l2jmobius.gameserver.model.items.L2WarehouseItem;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.ensoul.SoulCrystalOption;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public abstract class AbstractItemPacket extends AbstractMaskPacket<ItemListType>
|
||||
{
|
||||
private static final byte[] MASKS =
|
||||
{
|
||||
0x00
|
||||
};
|
||||
|
||||
@Override
|
||||
protected byte[] getMasks()
|
||||
{
|
||||
return MASKS;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewMaskAdded(ItemListType component)
|
||||
{
|
||||
}
|
||||
|
||||
protected void writeItem(TradeItem item)
|
||||
{
|
||||
writeItem(new ItemInfo(item));
|
||||
}
|
||||
|
||||
protected void writeItem(L2WarehouseItem item)
|
||||
{
|
||||
writeItem(new ItemInfo(item));
|
||||
}
|
||||
|
||||
protected void writeItem(L2ItemInstance item)
|
||||
{
|
||||
writeItem(new ItemInfo(item));
|
||||
}
|
||||
|
||||
protected void writeItem(Product item)
|
||||
{
|
||||
writeItem(new ItemInfo(item));
|
||||
}
|
||||
|
||||
protected void writeTradeItem(TradeItem item)
|
||||
{
|
||||
writeH(item.getItem().getType1());
|
||||
writeD(item.getObjectId()); // ObjectId
|
||||
writeD(item.getItem().getDisplayId()); // ItemId
|
||||
writeQ(item.getCount()); // Quantity
|
||||
writeC(item.getItem().getType2()); // Item Type 2 : 00-weapon, 01-shield/armor, 02-ring/earring/necklace, 03-questitem, 04-adena, 05-item
|
||||
writeC(item.getCustomType1()); // Filler (always 0)
|
||||
writeQ(item.getItem().getBodyPart()); // Slot : 0006-lr.ear, 0008-neck, 0030-lr.finger, 0040-head, 0100-l.hand, 0200-gloves, 0400-chest, 0800-pants, 1000-feet, 4000-r.hand, 8000-r.hand
|
||||
writeC(item.getEnchant()); // Enchant level (pet level shown in control item)
|
||||
writeH(0x00); // Equipped : 00-No, 01-yes
|
||||
writeC(item.getCustomType2());
|
||||
writeD(0);
|
||||
final ItemInfo iteminfo = new ItemInfo(item);
|
||||
writeItemElementalAndEnchant(iteminfo);
|
||||
writeItemSoulCrystalOptions(iteminfo);
|
||||
}
|
||||
|
||||
protected void writeItem(ItemInfo item)
|
||||
{
|
||||
final int mask = calculateMask(item);
|
||||
// cddcQcchQccddc
|
||||
writeC(mask);
|
||||
writeD(item.getObjectId()); // ObjectId
|
||||
writeD(item.getItem().getDisplayId()); // ItemId
|
||||
writeC(item.getEquipped() == 0 ? item.getLocation() : 0xFF); // T1
|
||||
writeQ(item.getCount()); // Quantity
|
||||
writeC(item.getItem().getType2()); // Item Type 2 : 00-weapon, 01-shield/armor, 02-ring/earring/necklace, 03-questitem, 04-adena, 05-item
|
||||
writeC(item.getCustomType1()); // Filler (always 0)
|
||||
writeH(item.getEquipped()); // Equipped : 00-No, 01-yes
|
||||
writeQ(item.getItem().getBodyPart()); // Slot : 0006-lr.ear, 0008-neck, 0030-lr.finger, 0040-head, 0100-l.hand, 0200-gloves, 0400-chest, 0800-pants, 1000-feet, 4000-r.hand, 8000-r.hand
|
||||
writeC(item.getEnchant()); // Enchant level (pet level shown in control item)
|
||||
writeC(0);
|
||||
writeD(item.getMana());
|
||||
writeD(item.getTime());
|
||||
writeC(0x01); // GOD Item enabled = 1 disabled (red) = 0
|
||||
if (containsMask(mask, ItemListType.AUGMENT_BONUS))
|
||||
{
|
||||
writeD(item.get1stAugmentationId());
|
||||
writeD(item.get2ndAugmentationId());
|
||||
}
|
||||
if (containsMask(mask, ItemListType.ELEMENTAL_ATTRIBUTE))
|
||||
{
|
||||
writeItemElemental(item);
|
||||
}
|
||||
if (containsMask(mask, ItemListType.ENCHANT_EFFECT))
|
||||
{
|
||||
writeItemEnchantEffect(item);
|
||||
}
|
||||
if (containsMask(mask, ItemListType.VISUAL_ID))
|
||||
{
|
||||
writeD(item.getVisualId()); // Item remodel visual ID
|
||||
}
|
||||
if (containsMask(mask, ItemListType.SOUL_CRYSTAL))
|
||||
{
|
||||
writeItemSoulCrystalOptions(item);
|
||||
}
|
||||
}
|
||||
|
||||
protected static int calculateMask(ItemInfo item)
|
||||
{
|
||||
int mask = 0;
|
||||
if (item.getAugmentationBonus() > 0)
|
||||
{
|
||||
mask |= ItemListType.AUGMENT_BONUS.getMask();
|
||||
}
|
||||
|
||||
if (item.getAttackElementType() >= 0)
|
||||
{
|
||||
mask |= ItemListType.ELEMENTAL_ATTRIBUTE.getMask();
|
||||
}
|
||||
else
|
||||
{
|
||||
for (byte i = 0; i < 6; i++)
|
||||
{
|
||||
if (item.getElementDefAttr(i) >= 0)
|
||||
{
|
||||
mask |= ItemListType.ELEMENTAL_ATTRIBUTE.getMask();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (item.getEnchantOptions() != null)
|
||||
{
|
||||
for (int id : item.getEnchantOptions())
|
||||
{
|
||||
if (id > 0)
|
||||
{
|
||||
mask |= ItemListType.ENCHANT_EFFECT.getMask();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (item.getVisualId() > 0)
|
||||
{
|
||||
mask |= ItemListType.VISUAL_ID.getMask();
|
||||
}
|
||||
|
||||
if (item.getSpecialSoulCrystalOption() != null)
|
||||
{
|
||||
mask |= ItemListType.SOUL_CRYSTAL.getMask();
|
||||
}
|
||||
else
|
||||
{
|
||||
for (SoulCrystalOption sco : item.getCommonSoulCrystalOptions())
|
||||
{
|
||||
if (sco != null)
|
||||
{
|
||||
mask |= ItemListType.SOUL_CRYSTAL.getMask();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
||||
protected void writeItemElementalAndEnchant(ItemInfo item)
|
||||
{
|
||||
writeItemElemental(item);
|
||||
writeItemEnchantEffect(item);
|
||||
}
|
||||
|
||||
protected void writeItemElemental(ItemInfo item)
|
||||
{
|
||||
writeH(item.getAttackElementType());
|
||||
writeH(item.getAttackElementPower());
|
||||
for (byte i = 0; i < 6; i++)
|
||||
{
|
||||
writeH(item.getElementDefAttr(i));
|
||||
}
|
||||
}
|
||||
|
||||
protected void writeItemEnchantEffect(ItemInfo item)
|
||||
{
|
||||
// Enchant Effects
|
||||
for (int op : item.getEnchantOptions())
|
||||
{
|
||||
writeD(op);
|
||||
}
|
||||
}
|
||||
|
||||
protected void writeInventoryBlock(PcInventory inventory)
|
||||
{
|
||||
if (inventory.hasInventoryBlock())
|
||||
{
|
||||
writeH(inventory.getBlockItems().length);
|
||||
writeC(inventory.getBlockMode());
|
||||
for (int i : inventory.getBlockItems())
|
||||
{
|
||||
writeD(i);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
writeH(0x00);
|
||||
}
|
||||
}
|
||||
|
||||
protected void writeCommissionItem(ItemInfo item)
|
||||
{
|
||||
writeD(0); // Always 0
|
||||
writeD(item.getItem().getId());
|
||||
writeQ(item.getCount());
|
||||
writeH(item.getItem().getType2());
|
||||
writeQ(item.getItem().getBodyPart());
|
||||
writeH(item.getEnchant());
|
||||
writeH(item.getCustomType2());
|
||||
writeItemElementalAndEnchant(item);
|
||||
writeD(item.getVisualId());
|
||||
writeItemSoulCrystalOptions(item);
|
||||
}
|
||||
|
||||
protected void writeItemSoulCrystalOptions(ItemInfo item)
|
||||
{
|
||||
int count = 0;
|
||||
for (SoulCrystalOption sc : item.getCommonSoulCrystalOptions())
|
||||
{
|
||||
if (sc != null)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
writeC(count);
|
||||
for (SoulCrystalOption sco : item.getCommonSoulCrystalOptions())
|
||||
{
|
||||
if (sco != null)
|
||||
{
|
||||
writeD(sco.getEffect());
|
||||
}
|
||||
}
|
||||
|
||||
writeC(item.getSpecialSoulCrystalOption() != null);
|
||||
if (item.getSpecialSoulCrystalOption() != null)
|
||||
{
|
||||
writeD(item.getSpecialSoulCrystalOption().getEffect());
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.enums.ItemListType;
|
||||
import com.l2jmobius.gameserver.model.ItemInfo;
|
||||
import com.l2jmobius.gameserver.model.TradeItem;
|
||||
import com.l2jmobius.gameserver.model.buylist.Product;
|
||||
import com.l2jmobius.gameserver.model.ensoul.EnsoulOption;
|
||||
import com.l2jmobius.gameserver.model.itemcontainer.PcInventory;
|
||||
import com.l2jmobius.gameserver.model.items.L2WarehouseItem;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public abstract class AbstractItemPacket extends AbstractMaskPacket<ItemListType>
|
||||
{
|
||||
private static final byte[] MASKS =
|
||||
{
|
||||
0x00
|
||||
};
|
||||
|
||||
@Override
|
||||
protected byte[] getMasks()
|
||||
{
|
||||
return MASKS;
|
||||
}
|
||||
|
||||
protected void writeItem(PacketWriter packet, TradeItem item)
|
||||
{
|
||||
writeItem(packet, new ItemInfo(item));
|
||||
}
|
||||
|
||||
protected void writeItem(PacketWriter packet, L2WarehouseItem item)
|
||||
{
|
||||
writeItem(packet, new ItemInfo(item));
|
||||
}
|
||||
|
||||
protected void writeItem(PacketWriter packet, L2ItemInstance item)
|
||||
{
|
||||
writeItem(packet, new ItemInfo(item));
|
||||
}
|
||||
|
||||
protected void writeItem(PacketWriter packet, Product item)
|
||||
{
|
||||
writeItem(packet, new ItemInfo(item));
|
||||
}
|
||||
|
||||
protected void writeTradeItem(PacketWriter packet, TradeItem item)
|
||||
{
|
||||
packet.writeH(item.getItem().getType1());
|
||||
packet.writeD(item.getObjectId()); // ObjectId
|
||||
packet.writeD(item.getItem().getDisplayId()); // ItemId
|
||||
packet.writeQ(item.getCount()); // Quantity
|
||||
packet.writeC(item.getItem().getType2()); // Item Type 2 : 00-weapon, 01-shield/armor, 02-ring/earring/necklace, 03-questitem, 04-adena, 05-item
|
||||
packet.writeC(item.getCustomType1()); // Filler (always 0)
|
||||
packet.writeQ(item.getItem().getBodyPart()); // Slot : 0006-lr.ear, 0008-neck, 0030-lr.finger, 0040-head, 0100-l.hand, 0200-gloves, 0400-chest, 0800-pants, 1000-feet, 4000-r.hand, 8000-r.hand
|
||||
packet.writeC(item.getEnchant()); // Enchant level (pet level shown in control item)
|
||||
packet.writeC(0x00); // TODO : Find me
|
||||
packet.writeH(0x00); // Equipped : 00-No, 01-yes
|
||||
packet.writeH(item.getCustomType2());
|
||||
writeItemElementalAndEnchant(packet, new ItemInfo(item));
|
||||
}
|
||||
|
||||
protected void writeItem(PacketWriter packet, ItemInfo item)
|
||||
{
|
||||
final int mask = calculateMask(item);
|
||||
// cddcQcchQccddc
|
||||
packet.writeC(mask);
|
||||
packet.writeD(item.getObjectId()); // ObjectId
|
||||
packet.writeD(item.getItem().getDisplayId()); // ItemId
|
||||
packet.writeC(item.getItem().isQuestItem() || (item.getEquipped() == 1) ? 0xFF : item.getLocation()); // T1
|
||||
packet.writeQ(item.getCount()); // Quantity
|
||||
packet.writeC(item.getItem().getType2()); // Item Type 2 : 00-weapon, 01-shield/armor, 02-ring/earring/necklace, 03-questitem, 04-adena, 05-item
|
||||
packet.writeC(item.getCustomType1()); // Filler (always 0)
|
||||
packet.writeH(item.getEquipped()); // Equipped : 00-No, 01-yes
|
||||
packet.writeQ(item.getItem().getBodyPart()); // Slot : 0006-lr.ear, 0008-neck, 0030-lr.finger, 0040-head, 0100-l.hand, 0200-gloves, 0400-chest, 0800-pants, 1000-feet, 4000-r.hand, 8000-r.hand
|
||||
packet.writeC(item.getEnchant()); // Enchant level (pet level shown in control item)
|
||||
packet.writeC(0x01); // TODO : Find me
|
||||
packet.writeD(item.getMana());
|
||||
packet.writeD(item.getTime());
|
||||
packet.writeC(0x01); // GOD Item enabled = 1 disabled (red) = 0
|
||||
if (containsMask(mask, ItemListType.AUGMENT_BONUS))
|
||||
{
|
||||
packet.writeQ(item.getAugmentationBonus());
|
||||
}
|
||||
if (containsMask(mask, ItemListType.ELEMENTAL_ATTRIBUTE))
|
||||
{
|
||||
writeItemElemental(packet, item);
|
||||
}
|
||||
if (containsMask(mask, ItemListType.ENCHANT_EFFECT))
|
||||
{
|
||||
writeItemEnchantEffect(packet, item);
|
||||
}
|
||||
if (containsMask(mask, ItemListType.VISUAL_ID))
|
||||
{
|
||||
packet.writeD(item.getVisualId()); // Item remodel visual ID
|
||||
}
|
||||
if (containsMask(mask, ItemListType.SOUL_CRYSTAL))
|
||||
{
|
||||
packet.writeC(item.getSoulCrystalOptions().size()); // Size of regular soul crystal options.
|
||||
for (EnsoulOption option : item.getSoulCrystalOptions())
|
||||
{
|
||||
packet.writeD(option.getId()); // Regular Soul Crystal Ability ID.
|
||||
}
|
||||
|
||||
packet.writeC(item.getSoulCrystalSpecialOptions().size()); // Size of special soul crystal options.
|
||||
for (EnsoulOption option : item.getSoulCrystalSpecialOptions())
|
||||
{
|
||||
packet.writeD(option.getId()); // Special Soul Crystal Ability ID.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected static int calculateMask(ItemInfo item)
|
||||
{
|
||||
int mask = 0;
|
||||
if (item.getAugmentationBonus() > 0)
|
||||
{
|
||||
mask |= ItemListType.AUGMENT_BONUS.getMask();
|
||||
}
|
||||
|
||||
if (item.getAttackElementType() >= 0)
|
||||
{
|
||||
mask |= ItemListType.ELEMENTAL_ATTRIBUTE.getMask();
|
||||
}
|
||||
else
|
||||
{
|
||||
for (byte i = 0; i < 6; i++)
|
||||
{
|
||||
if (item.getElementDefAttr(i) > 0)
|
||||
{
|
||||
mask |= ItemListType.ELEMENTAL_ATTRIBUTE.getMask();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (item.getEnchantOptions() != null)
|
||||
{
|
||||
for (int id : item.getEnchantOptions())
|
||||
{
|
||||
if (id > 0)
|
||||
{
|
||||
mask |= ItemListType.ENCHANT_EFFECT.getMask();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (item.getVisualId() > 0)
|
||||
{
|
||||
mask |= ItemListType.VISUAL_ID.getMask();
|
||||
}
|
||||
|
||||
if (!item.getSoulCrystalOptions().isEmpty() || !item.getSoulCrystalSpecialOptions().isEmpty())
|
||||
{
|
||||
mask |= ItemListType.SOUL_CRYSTAL.getMask();
|
||||
}
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
||||
protected void writeItemElementalAndEnchant(PacketWriter packet, ItemInfo item)
|
||||
{
|
||||
writeItemElemental(packet, item);
|
||||
writeItemEnchantEffect(packet, item);
|
||||
}
|
||||
|
||||
protected void writeItemElemental(PacketWriter packet, ItemInfo item)
|
||||
{
|
||||
packet.writeH(item.getAttackElementType());
|
||||
packet.writeH(item.getAttackElementPower());
|
||||
for (byte i = 0; i < 6; i++)
|
||||
{
|
||||
packet.writeH(item.getElementDefAttr(i));
|
||||
}
|
||||
}
|
||||
|
||||
protected void writeItemEnchantEffect(PacketWriter packet, ItemInfo item)
|
||||
{
|
||||
// Enchant Effects
|
||||
for (int op : item.getEnchantOptions())
|
||||
{
|
||||
packet.writeD(op);
|
||||
}
|
||||
}
|
||||
|
||||
protected void writeInventoryBlock(PacketWriter packet, PcInventory inventory)
|
||||
{
|
||||
if (inventory.hasInventoryBlock())
|
||||
{
|
||||
packet.writeH(inventory.getBlockItems().size());
|
||||
packet.writeC(inventory.getBlockMode().getClientId());
|
||||
for (int id : inventory.getBlockItems())
|
||||
{
|
||||
packet.writeD(id);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
packet.writeH(0x00);
|
||||
}
|
||||
}
|
||||
|
||||
protected void writeCommissionItem(PacketWriter packet, ItemInfo item)
|
||||
{
|
||||
packet.writeD(0); // Always 0
|
||||
packet.writeD(item.getItem().getId());
|
||||
packet.writeQ(item.getCount());
|
||||
packet.writeH(item.getItem().getType2());
|
||||
packet.writeQ(item.getItem().getBodyPart());
|
||||
packet.writeC(item.getEnchant());
|
||||
packet.writeC(0x00); // TODO: Find me
|
||||
packet.writeH(item.getCustomType2());
|
||||
writeItemElementalAndEnchant(packet, item);
|
||||
packet.writeD(item.getVisualId());
|
||||
packet.writeC(item.getSoulCrystalOptions().size()); // Size of regular soul crystal options.
|
||||
for (EnsoulOption option : item.getSoulCrystalOptions())
|
||||
{
|
||||
packet.writeD(option.getId()); // Regular Soul Crystal Ability ID.
|
||||
}
|
||||
|
||||
packet.writeC(item.getSoulCrystalSpecialOptions().size()); // Size of special soul crystal options.
|
||||
for (EnsoulOption option : item.getSoulCrystalSpecialOptions())
|
||||
{
|
||||
packet.writeD(option.getId()); // Special Soul Crystal Ability ID.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,65 +1,83 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.interfaces.IUpdateTypeComponent;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
* @param <T>
|
||||
*/
|
||||
public abstract class AbstractMaskPacket<T extends IUpdateTypeComponent>extends L2GameServerPacket
|
||||
{
|
||||
protected static final byte[] DEFAULT_FLAG_ARRAY =
|
||||
{
|
||||
(byte) 0x80,
|
||||
0x40,
|
||||
0x20,
|
||||
0x10,
|
||||
0x08,
|
||||
0x04,
|
||||
0x02,
|
||||
0x01
|
||||
};
|
||||
|
||||
protected abstract byte[] getMasks();
|
||||
|
||||
protected abstract void onNewMaskAdded(T component);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addComponentType(T... updateComponents)
|
||||
{
|
||||
for (T component : updateComponents)
|
||||
{
|
||||
if (!containsMask(component))
|
||||
{
|
||||
getMasks()[component.getMask() >> 3] |= DEFAULT_FLAG_ARRAY[component.getMask() & 7];
|
||||
onNewMaskAdded(component);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean containsMask(T component)
|
||||
{
|
||||
return containsMask(component.getMask());
|
||||
}
|
||||
|
||||
public boolean containsMask(int mask)
|
||||
{
|
||||
return (getMasks()[mask >> 3] & DEFAULT_FLAG_ARRAY[mask & 7]) != 0;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.interfaces.IUpdateTypeComponent;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
* @param <T>
|
||||
*/
|
||||
public abstract class AbstractMaskPacket<T extends IUpdateTypeComponent> implements IClientOutgoingPacket
|
||||
{
|
||||
protected static final byte[] DEFAULT_FLAG_ARRAY =
|
||||
{
|
||||
(byte) 0x80,
|
||||
0x40,
|
||||
0x20,
|
||||
0x10,
|
||||
0x08,
|
||||
0x04,
|
||||
0x02,
|
||||
0x01
|
||||
};
|
||||
|
||||
protected abstract byte[] getMasks();
|
||||
|
||||
protected void onNewMaskAdded(T component)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
public final void addComponentType(T... updateComponents)
|
||||
{
|
||||
for (T component : updateComponents)
|
||||
{
|
||||
if (!containsMask(component))
|
||||
{
|
||||
addMask(component.getMask());
|
||||
onNewMaskAdded(component);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void addMask(int mask)
|
||||
{
|
||||
getMasks()[mask >> 3] |= DEFAULT_FLAG_ARRAY[mask & 7];
|
||||
}
|
||||
|
||||
public boolean containsMask(T component)
|
||||
{
|
||||
return containsMask(component.getMask());
|
||||
}
|
||||
|
||||
public boolean containsMask(int mask)
|
||||
{
|
||||
return (getMasks()[mask >> 3] & DEFAULT_FLAG_ARRAY[mask & 7]) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param masks
|
||||
* @param type
|
||||
* @return {@code true} if the mask contains the current update component type
|
||||
*/
|
||||
public boolean containsMask(int masks, T type)
|
||||
{
|
||||
return (masks & type.getMask()) == type.getMask();
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,141 +1,145 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2TrapInstance;
|
||||
|
||||
public abstract class AbstractNpcInfo extends L2GameServerPacket
|
||||
{
|
||||
protected int _x, _y, _z, _heading;
|
||||
protected int _idTemplate;
|
||||
protected boolean _isAttackable, _isSummoned;
|
||||
protected int _mAtkSpd, _pAtkSpd;
|
||||
protected final int _runSpd, _walkSpd;
|
||||
protected final int _swimRunSpd, _swimWalkSpd;
|
||||
protected final int _flyRunSpd, _flyWalkSpd;
|
||||
protected double _moveMultiplier;
|
||||
|
||||
protected int _rhand, _lhand, _chest, _enchantEffect;
|
||||
protected double _collisionHeight, _collisionRadius;
|
||||
protected String _name = "";
|
||||
protected String _title = "";
|
||||
|
||||
public AbstractNpcInfo(L2Character cha)
|
||||
{
|
||||
_isSummoned = cha.isShowSummonAnimation();
|
||||
_x = cha.getX();
|
||||
_y = cha.getY();
|
||||
_z = cha.getZ();
|
||||
_heading = cha.getHeading();
|
||||
_mAtkSpd = cha.getMAtkSpd();
|
||||
_pAtkSpd = (int) cha.getPAtkSpd();
|
||||
_moveMultiplier = cha.getMovementSpeedMultiplier();
|
||||
_runSpd = (int) Math.round(cha.getRunSpeed() / _moveMultiplier);
|
||||
_walkSpd = (int) Math.round(cha.getWalkSpeed() / _moveMultiplier);
|
||||
_swimRunSpd = (int) Math.round(cha.getSwimRunSpeed() / _moveMultiplier);
|
||||
_swimWalkSpd = (int) Math.round(cha.getSwimWalkSpeed() / _moveMultiplier);
|
||||
_flyRunSpd = cha.isFlying() ? _runSpd : 0;
|
||||
_flyWalkSpd = cha.isFlying() ? _walkSpd : 0;
|
||||
}
|
||||
|
||||
public static class TrapInfo extends AbstractNpcInfo
|
||||
{
|
||||
private final L2TrapInstance _trap;
|
||||
|
||||
public TrapInfo(L2TrapInstance cha, L2Character attacker)
|
||||
{
|
||||
super(cha);
|
||||
|
||||
_trap = cha;
|
||||
_idTemplate = cha.getTemplate().getDisplayId();
|
||||
_isAttackable = cha.isAutoAttackable(attacker);
|
||||
_rhand = 0;
|
||||
_lhand = 0;
|
||||
_collisionHeight = _trap.getTemplate().getfCollisionHeight();
|
||||
_collisionRadius = _trap.getTemplate().getfCollisionRadius();
|
||||
if (cha.getTemplate().isUsingServerSideName())
|
||||
{
|
||||
_name = cha.getName();
|
||||
}
|
||||
_title = cha.getOwner() != null ? cha.getOwner().getName() : "";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0x0c);
|
||||
writeD(_trap.getObjectId());
|
||||
writeD(_idTemplate + 1000000); // npctype id
|
||||
writeD(_isAttackable ? 1 : 0);
|
||||
writeD(_x);
|
||||
writeD(_y);
|
||||
writeD(_z);
|
||||
writeD(_heading);
|
||||
writeD(0x00);
|
||||
writeD(_mAtkSpd);
|
||||
writeD(_pAtkSpd);
|
||||
writeD(_runSpd);
|
||||
writeD(_walkSpd);
|
||||
writeD(_swimRunSpd);
|
||||
writeD(_swimWalkSpd);
|
||||
writeD(_flyRunSpd);
|
||||
writeD(_flyWalkSpd);
|
||||
writeD(_flyRunSpd);
|
||||
writeD(_flyWalkSpd);
|
||||
writeF(_moveMultiplier);
|
||||
writeF(_trap.getAttackSpeedMultiplier());
|
||||
writeF(_collisionRadius);
|
||||
writeF(_collisionHeight);
|
||||
writeD(_rhand); // right hand weapon
|
||||
writeD(_chest);
|
||||
writeD(_lhand); // left hand weapon
|
||||
writeC(1); // name above char 1=true ... ??
|
||||
writeC(1);
|
||||
writeC(_trap.isInCombat() ? 1 : 0);
|
||||
writeC(_trap.isAlikeDead() ? 1 : 0);
|
||||
writeC(_isSummoned ? 2 : 0); // invisible ?? 0=false 1=true 2=summoned (only works if model has a summon animation)
|
||||
writeD(-1); // High Five NPCString ID
|
||||
writeS(_name);
|
||||
writeD(-1); // High Five NPCString ID
|
||||
writeS(_title);
|
||||
writeD(0x00); // title color 0 = client default
|
||||
|
||||
writeD(_trap.getPvpFlag());
|
||||
writeD(_trap.getReputation());
|
||||
|
||||
writeD(0); // was AVE and was adding stealth
|
||||
writeD(0x00); // clan id
|
||||
writeD(0x00); // crest id
|
||||
writeD(0000); // C2
|
||||
writeD(0000); // C2
|
||||
writeC(0000); // C2
|
||||
|
||||
writeC(_trap.getTeam().getId());
|
||||
|
||||
writeF(_collisionRadius);
|
||||
writeF(_collisionHeight);
|
||||
writeD(0x00); // C4
|
||||
writeD(0x00); // C6
|
||||
writeD(0x00);
|
||||
writeD(0); // CT1.5 Pet form and skills
|
||||
writeC(0x01);
|
||||
writeC(0x01);
|
||||
writeD(0x00);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2TrapInstance;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public abstract class AbstractNpcInfo implements IClientOutgoingPacket
|
||||
{
|
||||
protected int _x, _y, _z, _heading;
|
||||
protected int _idTemplate;
|
||||
protected boolean _isAttackable, _isSummoned;
|
||||
protected int _mAtkSpd, _pAtkSpd;
|
||||
protected final int _runSpd, _walkSpd;
|
||||
protected final int _swimRunSpd, _swimWalkSpd;
|
||||
protected final int _flyRunSpd, _flyWalkSpd;
|
||||
protected double _moveMultiplier;
|
||||
|
||||
protected int _rhand, _lhand, _chest, _enchantEffect;
|
||||
protected double _collisionHeight, _collisionRadius;
|
||||
protected String _name = "";
|
||||
protected String _title = "";
|
||||
|
||||
public AbstractNpcInfo(L2Character cha)
|
||||
{
|
||||
_isSummoned = cha.isShowSummonAnimation();
|
||||
_x = cha.getX();
|
||||
_y = cha.getY();
|
||||
_z = cha.getZ();
|
||||
_heading = cha.getHeading();
|
||||
_mAtkSpd = cha.getMAtkSpd();
|
||||
_pAtkSpd = cha.getPAtkSpd();
|
||||
_moveMultiplier = cha.getMovementSpeedMultiplier();
|
||||
_runSpd = (int) Math.round(cha.getRunSpeed() / _moveMultiplier);
|
||||
_walkSpd = (int) Math.round(cha.getWalkSpeed() / _moveMultiplier);
|
||||
_swimRunSpd = (int) Math.round(cha.getSwimRunSpeed() / _moveMultiplier);
|
||||
_swimWalkSpd = (int) Math.round(cha.getSwimWalkSpeed() / _moveMultiplier);
|
||||
_flyRunSpd = cha.isFlying() ? _runSpd : 0;
|
||||
_flyWalkSpd = cha.isFlying() ? _walkSpd : 0;
|
||||
}
|
||||
|
||||
public static class TrapInfo extends AbstractNpcInfo
|
||||
{
|
||||
private final L2TrapInstance _trap;
|
||||
|
||||
public TrapInfo(L2TrapInstance cha, L2Character attacker)
|
||||
{
|
||||
super(cha);
|
||||
|
||||
_trap = cha;
|
||||
_idTemplate = cha.getTemplate().getDisplayId();
|
||||
_isAttackable = cha.isAutoAttackable(attacker);
|
||||
_rhand = 0;
|
||||
_lhand = 0;
|
||||
_collisionHeight = _trap.getTemplate().getfCollisionHeight();
|
||||
_collisionRadius = _trap.getTemplate().getfCollisionRadius();
|
||||
if (cha.getTemplate().isUsingServerSideName())
|
||||
{
|
||||
_name = cha.getName();
|
||||
}
|
||||
_title = cha.getOwner() != null ? cha.getOwner().getName() : "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.NPC_INFO.writeId(packet);
|
||||
|
||||
packet.writeD(_trap.getObjectId());
|
||||
packet.writeD(_idTemplate + 1000000); // npctype id
|
||||
packet.writeD(_isAttackable ? 1 : 0);
|
||||
packet.writeD(_x);
|
||||
packet.writeD(_y);
|
||||
packet.writeD(_z);
|
||||
packet.writeD(_heading);
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(_mAtkSpd);
|
||||
packet.writeD(_pAtkSpd);
|
||||
packet.writeD(_runSpd);
|
||||
packet.writeD(_walkSpd);
|
||||
packet.writeD(_swimRunSpd);
|
||||
packet.writeD(_swimWalkSpd);
|
||||
packet.writeD(_flyRunSpd);
|
||||
packet.writeD(_flyWalkSpd);
|
||||
packet.writeD(_flyRunSpd);
|
||||
packet.writeD(_flyWalkSpd);
|
||||
packet.writeF(_moveMultiplier);
|
||||
packet.writeF(_trap.getAttackSpeedMultiplier());
|
||||
packet.writeF(_collisionRadius);
|
||||
packet.writeF(_collisionHeight);
|
||||
packet.writeD(_rhand); // right hand weapon
|
||||
packet.writeD(_chest);
|
||||
packet.writeD(_lhand); // left hand weapon
|
||||
packet.writeC(1); // name above char 1=true ... ??
|
||||
packet.writeC(1);
|
||||
packet.writeC(_trap.isInCombat() ? 1 : 0);
|
||||
packet.writeC(_trap.isAlikeDead() ? 1 : 0);
|
||||
packet.writeC(_isSummoned ? 2 : 0); // invisible ?? 0=false 1=true 2=summoned (only works if model has a summon animation)
|
||||
packet.writeD(-1); // High Five NPCString ID
|
||||
packet.writeS(_name);
|
||||
packet.writeD(-1); // High Five NPCString ID
|
||||
packet.writeS(_title);
|
||||
packet.writeD(0x00); // title color 0 = client default
|
||||
|
||||
packet.writeD(_trap.getPvpFlag());
|
||||
packet.writeD(_trap.getReputation());
|
||||
|
||||
packet.writeD(0); // was AVE and was adding stealth
|
||||
packet.writeD(0x00); // clan id
|
||||
packet.writeD(0x00); // crest id
|
||||
packet.writeD(0000); // C2
|
||||
packet.writeD(0000); // C2
|
||||
packet.writeC(0000); // C2
|
||||
|
||||
packet.writeC(_trap.getTeam().getId());
|
||||
|
||||
packet.writeF(_collisionRadius);
|
||||
packet.writeF(_collisionHeight);
|
||||
packet.writeD(0x00); // C4
|
||||
packet.writeD(0x00); // C6
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(0); // CT1.5 Pet form and skills
|
||||
packet.writeC(0x01);
|
||||
packet.writeC(0x01);
|
||||
packet.writeD(0x00);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,34 +1,38 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author Kerberos
|
||||
*/
|
||||
public class AcquireSkillDone extends L2GameServerPacket
|
||||
{
|
||||
public AcquireSkillDone()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x94);
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author Kerberos
|
||||
*/
|
||||
public class AcquireSkillDone implements IClientOutgoingPacket
|
||||
{
|
||||
public AcquireSkillDone()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.ACQUIRE_SKILL_DONE.writeId(packet);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,128 +1,131 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.model.L2SkillLearn;
|
||||
import com.l2jmobius.gameserver.model.base.AcquireSkillType;
|
||||
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||
import com.l2jmobius.gameserver.model.skills.CommonSkill;
|
||||
|
||||
/**
|
||||
* Acquire Skill Info server packet implementation.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public class AcquireSkillInfo extends L2GameServerPacket
|
||||
{
|
||||
private final AcquireSkillType _type;
|
||||
private final int _id;
|
||||
private final int _level;
|
||||
private final int _spCost;
|
||||
private final List<Req> _reqs;
|
||||
|
||||
/**
|
||||
* Private class containing learning skill requisites.
|
||||
*/
|
||||
private static class Req
|
||||
{
|
||||
public int itemId;
|
||||
public long count;
|
||||
public int type;
|
||||
public int unk;
|
||||
|
||||
/**
|
||||
* @param pType TODO identify.
|
||||
* @param pItemId the item Id.
|
||||
* @param itemCount the item count.
|
||||
* @param pUnk TODO identify.
|
||||
*/
|
||||
public Req(int pType, int pItemId, long itemCount, int pUnk)
|
||||
{
|
||||
itemId = pItemId;
|
||||
type = pType;
|
||||
count = itemCount;
|
||||
unk = pUnk;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for the acquire skill info object.
|
||||
* @param skillType the skill learning type.
|
||||
* @param skillLearn the skill learn.
|
||||
*/
|
||||
public AcquireSkillInfo(AcquireSkillType skillType, L2SkillLearn skillLearn)
|
||||
{
|
||||
_id = skillLearn.getSkillId();
|
||||
_level = skillLearn.getSkillLevel();
|
||||
_spCost = skillLearn.getLevelUpSp();
|
||||
_type = skillType;
|
||||
_reqs = new ArrayList<>();
|
||||
if ((skillType != AcquireSkillType.PLEDGE) || Config.LIFE_CRYSTAL_NEEDED)
|
||||
{
|
||||
for (ItemHolder item : skillLearn.getRequiredItems())
|
||||
{
|
||||
if (!Config.DIVINE_SP_BOOK_NEEDED && (_id == CommonSkill.DIVINE_INSPIRATION.getId()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
_reqs.add(new Req(99, item.getId(), item.getCount(), 50));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Special constructor for Alternate Skill Learning system.<br>
|
||||
* Sets a custom amount of SP.
|
||||
* @param skillType the skill learning type.
|
||||
* @param skillLearn the skill learn.
|
||||
* @param sp the custom SP amount.
|
||||
*/
|
||||
public AcquireSkillInfo(AcquireSkillType skillType, L2SkillLearn skillLearn, int sp)
|
||||
{
|
||||
_id = skillLearn.getSkillId();
|
||||
_level = skillLearn.getSkillLevel();
|
||||
_spCost = sp;
|
||||
_type = skillType;
|
||||
_reqs = new ArrayList<>();
|
||||
for (ItemHolder item : skillLearn.getRequiredItems())
|
||||
{
|
||||
_reqs.add(new Req(99, item.getId(), item.getCount(), 50));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x91);
|
||||
writeD(_id);
|
||||
writeD(_level);
|
||||
writeQ(_spCost);
|
||||
writeD(_type.getId());
|
||||
writeD(_reqs.size());
|
||||
for (Req temp : _reqs)
|
||||
{
|
||||
writeD(temp.type);
|
||||
writeD(temp.itemId);
|
||||
writeQ(temp.count);
|
||||
writeD(temp.unk);
|
||||
}
|
||||
writeD(0);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.L2SkillLearn;
|
||||
import com.l2jmobius.gameserver.model.base.AcquireSkillType;
|
||||
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||
import com.l2jmobius.gameserver.model.skills.CommonSkill;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* Acquire Skill Info server packet implementation.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public class AcquireSkillInfo implements IClientOutgoingPacket
|
||||
{
|
||||
private final AcquireSkillType _type;
|
||||
private final int _id;
|
||||
private final int _level;
|
||||
private final int _spCost;
|
||||
private final List<Req> _reqs;
|
||||
|
||||
/**
|
||||
* Private class containing learning skill requisites.
|
||||
*/
|
||||
private static class Req
|
||||
{
|
||||
public int itemId;
|
||||
public long count;
|
||||
public int type;
|
||||
public int unk;
|
||||
|
||||
/**
|
||||
* @param pType TODO identify.
|
||||
* @param pItemId the item Id.
|
||||
* @param itemCount the item count.
|
||||
* @param pUnk TODO identify.
|
||||
*/
|
||||
public Req(int pType, int pItemId, long itemCount, int pUnk)
|
||||
{
|
||||
itemId = pItemId;
|
||||
type = pType;
|
||||
count = itemCount;
|
||||
unk = pUnk;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for the acquire skill info object.
|
||||
* @param skillType the skill learning type.
|
||||
* @param skillLearn the skill learn.
|
||||
*/
|
||||
public AcquireSkillInfo(AcquireSkillType skillType, L2SkillLearn skillLearn)
|
||||
{
|
||||
_id = skillLearn.getSkillId();
|
||||
_level = skillLearn.getSkillLevel();
|
||||
_spCost = skillLearn.getLevelUpSp();
|
||||
_type = skillType;
|
||||
_reqs = new ArrayList<>();
|
||||
if ((skillType != AcquireSkillType.PLEDGE) || Config.LIFE_CRYSTAL_NEEDED)
|
||||
{
|
||||
for (ItemHolder item : skillLearn.getRequiredItems())
|
||||
{
|
||||
if (!Config.DIVINE_SP_BOOK_NEEDED && (_id == CommonSkill.DIVINE_INSPIRATION.getId()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
_reqs.add(new Req(99, item.getId(), item.getCount(), 50));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Special constructor for Alternate Skill Learning system.<br>
|
||||
* Sets a custom amount of SP.
|
||||
* @param skillType the skill learning type.
|
||||
* @param skillLearn the skill learn.
|
||||
* @param sp the custom SP amount.
|
||||
*/
|
||||
public AcquireSkillInfo(AcquireSkillType skillType, L2SkillLearn skillLearn, int sp)
|
||||
{
|
||||
_id = skillLearn.getSkillId();
|
||||
_level = skillLearn.getSkillLevel();
|
||||
_spCost = sp;
|
||||
_type = skillType;
|
||||
_reqs = new ArrayList<>();
|
||||
for (ItemHolder item : skillLearn.getRequiredItems())
|
||||
{
|
||||
_reqs.add(new Req(99, item.getId(), item.getCount(), 50));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.ACQUIRE_SKILL_INFO.writeId(packet);
|
||||
|
||||
packet.writeD(_id);
|
||||
packet.writeD(_level);
|
||||
packet.writeQ(_spCost);
|
||||
packet.writeD(_type.getId());
|
||||
packet.writeD(_reqs.size());
|
||||
for (Req temp : _reqs)
|
||||
{
|
||||
packet.writeD(temp.type);
|
||||
packet.writeD(temp.itemId);
|
||||
packet.writeQ(temp.count);
|
||||
packet.writeD(temp.unk);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,82 +1,77 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
|
||||
import com.l2jmobius.gameserver.datatables.SkillData;
|
||||
import com.l2jmobius.gameserver.model.L2SkillLearn;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public class AcquireSkillList extends L2GameServerPacket
|
||||
{
|
||||
final L2PcInstance _activeChar;
|
||||
final List<L2SkillLearn> _learnable;
|
||||
|
||||
public AcquireSkillList(L2PcInstance activeChar)
|
||||
{
|
||||
_activeChar = activeChar;
|
||||
_learnable = SkillTreesData.getInstance().getAvailableSkillsList(activeChar, activeChar.getClassId(), false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0x90);
|
||||
writeH(_learnable.size());
|
||||
for (L2SkillLearn skill : _learnable)
|
||||
{
|
||||
writeD(skill.getSkillId());
|
||||
writeD(skill.getSkillLevel());
|
||||
writeQ(skill.getLevelUpSp());
|
||||
writeC(skill.getGetLevel());
|
||||
writeC(skill.getDualClassLevel());
|
||||
writeC(skill.getRequiredItems().size());
|
||||
for (ItemHolder item : skill.getRequiredItems())
|
||||
{
|
||||
writeD(item.getId());
|
||||
writeQ(item.getCount());
|
||||
}
|
||||
|
||||
final List<Skill> skillRem = skill.getRemoveSkills().stream().map(_activeChar::getKnownSkill).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
|
||||
writeC(skillRem.size());
|
||||
for (Skill skillRemove : skillRem)
|
||||
{
|
||||
writeD(skillRemove.getId());
|
||||
if (skillRemove.getLevel() < 100)
|
||||
{
|
||||
writeD(skillRemove.getLevel());
|
||||
}
|
||||
else
|
||||
{
|
||||
final int maxLevel = SkillData.getInstance().getMaxLevel(skillRemove.getId());
|
||||
writeH(maxLevel);
|
||||
writeH(skillRemove.getLevel());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
|
||||
import com.l2jmobius.gameserver.model.L2SkillLearn;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public class AcquireSkillList implements IClientOutgoingPacket
|
||||
{
|
||||
final L2PcInstance _activeChar;
|
||||
final List<L2SkillLearn> _learnable;
|
||||
|
||||
public AcquireSkillList(L2PcInstance activeChar)
|
||||
{
|
||||
_activeChar = activeChar;
|
||||
_learnable = SkillTreesData.getInstance().getAvailableSkills(activeChar, activeChar.getClassId(), false, false);
|
||||
_learnable.addAll(SkillTreesData.getInstance().getNextAvailableSkills(activeChar, activeChar.getClassId(), false, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.ACQUIRE_SKILL_LIST.writeId(packet);
|
||||
|
||||
packet.writeH(_learnable.size());
|
||||
for (L2SkillLearn skill : _learnable)
|
||||
{
|
||||
packet.writeD(skill.getSkillId());
|
||||
packet.writeD(skill.getSkillLevel());
|
||||
packet.writeQ(skill.getLevelUpSp());
|
||||
packet.writeC(skill.getGetLevel());
|
||||
packet.writeC(skill.getDualClassLevel());
|
||||
packet.writeC(skill.getRequiredItems().size());
|
||||
for (ItemHolder item : skill.getRequiredItems())
|
||||
{
|
||||
packet.writeD(item.getId());
|
||||
packet.writeQ(item.getCount());
|
||||
}
|
||||
|
||||
final List<Skill> skillRem = skill.getRemoveSkills().stream().map(_activeChar::getKnownSkill).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
|
||||
packet.writeC(skillRem.size());
|
||||
for (Skill skillRemove : skillRem)
|
||||
{
|
||||
packet.writeD(skillRemove.getId());
|
||||
packet.writeD(skillRemove.getLevel());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +1,64 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
public final class ActionFailed extends L2GameServerPacket
|
||||
{
|
||||
public static final ActionFailed STATIC_PACKET = new ActionFailed();
|
||||
|
||||
private ActionFailed()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0x1F);
|
||||
writeD(0x00); // TODO: Find me!
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.EnumMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.skills.SkillCastingType;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public final class ActionFailed implements IClientOutgoingPacket
|
||||
{
|
||||
public static final ActionFailed STATIC_PACKET = new ActionFailed();
|
||||
private static final Map<SkillCastingType, ActionFailed> STATIC_PACKET_BY_CASTING_TYPE = new EnumMap<>(SkillCastingType.class);
|
||||
|
||||
static
|
||||
{
|
||||
for (SkillCastingType castingType : SkillCastingType.values())
|
||||
{
|
||||
STATIC_PACKET_BY_CASTING_TYPE.put(castingType, new ActionFailed(castingType.getClientBarId()));
|
||||
}
|
||||
}
|
||||
|
||||
private final int _castingType;
|
||||
|
||||
private ActionFailed()
|
||||
{
|
||||
_castingType = 0;
|
||||
}
|
||||
|
||||
private ActionFailed(int castingType)
|
||||
{
|
||||
_castingType = castingType;
|
||||
}
|
||||
|
||||
public static ActionFailed get(SkillCastingType castingType)
|
||||
{
|
||||
return STATIC_PACKET_BY_CASTING_TYPE.getOrDefault(castingType, STATIC_PACKET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.ACTION_FAIL.writeId(packet);
|
||||
|
||||
packet.writeD(_castingType); // MagicSkillUse castingType
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,105 +1,110 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This class is made to create packets with any format
|
||||
* @author Maktakien
|
||||
*/
|
||||
public class AdminForgePacket extends L2GameServerPacket
|
||||
{
|
||||
private final List<Part> _parts = new ArrayList<>();
|
||||
|
||||
private static class Part
|
||||
{
|
||||
public byte b;
|
||||
public String str;
|
||||
|
||||
public Part(byte bb, String string)
|
||||
{
|
||||
b = bb;
|
||||
str = string;
|
||||
}
|
||||
}
|
||||
|
||||
public AdminForgePacket()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
for (Part p : _parts)
|
||||
{
|
||||
generate(p.b, p.str);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param b
|
||||
* @param string
|
||||
* @return
|
||||
*/
|
||||
public boolean generate(byte b, String string)
|
||||
{
|
||||
if ((b == 'C') || (b == 'c'))
|
||||
{
|
||||
writeC(Integer.decode(string));
|
||||
return true;
|
||||
}
|
||||
else if ((b == 'D') || (b == 'd'))
|
||||
{
|
||||
writeD(Integer.decode(string));
|
||||
return true;
|
||||
}
|
||||
else if ((b == 'H') || (b == 'h'))
|
||||
{
|
||||
writeH(Integer.decode(string));
|
||||
return true;
|
||||
}
|
||||
else if ((b == 'F') || (b == 'f'))
|
||||
{
|
||||
writeF(Double.parseDouble(string));
|
||||
return true;
|
||||
}
|
||||
else if ((b == 'S') || (b == 's'))
|
||||
{
|
||||
writeS(string);
|
||||
return true;
|
||||
}
|
||||
else if ((b == 'B') || (b == 'b') || (b == 'X') || (b == 'x'))
|
||||
{
|
||||
writeB(new BigInteger(string).toByteArray());
|
||||
return true;
|
||||
}
|
||||
else if ((b == 'Q') || (b == 'q'))
|
||||
{
|
||||
writeQ(Long.decode(string));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void addPart(byte b, String string)
|
||||
{
|
||||
_parts.add(new Part(b, string));
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
|
||||
/**
|
||||
* This class is made to create packets with any format
|
||||
* @author Maktakien
|
||||
*/
|
||||
public class AdminForgePacket implements IClientOutgoingPacket
|
||||
{
|
||||
private final List<Part> _parts = new ArrayList<>();
|
||||
|
||||
private static class Part
|
||||
{
|
||||
public byte b;
|
||||
public String str;
|
||||
|
||||
public Part(byte bb, String string)
|
||||
{
|
||||
b = bb;
|
||||
str = string;
|
||||
}
|
||||
}
|
||||
|
||||
public AdminForgePacket()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
for (Part p : _parts)
|
||||
{
|
||||
generate(packet, p.b, p.str);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param packet
|
||||
* @param type
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public boolean generate(PacketWriter packet, byte type, String value)
|
||||
{
|
||||
if ((type == 'C') || (type == 'c'))
|
||||
{
|
||||
packet.writeC(Integer.decode(value));
|
||||
return true;
|
||||
}
|
||||
else if ((type == 'D') || (type == 'd'))
|
||||
{
|
||||
packet.writeD(Integer.decode(value));
|
||||
return true;
|
||||
}
|
||||
else if ((type == 'H') || (type == 'h'))
|
||||
{
|
||||
packet.writeH(Integer.decode(value));
|
||||
return true;
|
||||
}
|
||||
else if ((type == 'F') || (type == 'f'))
|
||||
{
|
||||
packet.writeF(Double.parseDouble(value));
|
||||
return true;
|
||||
}
|
||||
else if ((type == 'S') || (type == 's'))
|
||||
{
|
||||
packet.writeS(value);
|
||||
return true;
|
||||
}
|
||||
else if ((type == 'B') || (type == 'b') || (type == 'X') || (type == 'x'))
|
||||
{
|
||||
packet.writeB(new BigInteger(value).toByteArray());
|
||||
return true;
|
||||
}
|
||||
else if ((type == 'Q') || (type == 'q'))
|
||||
{
|
||||
packet.writeQ(Long.decode(value));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void addPart(byte b, String string)
|
||||
{
|
||||
_parts.add(new Part(b, string));
|
||||
}
|
||||
}
|
||||
@@ -1,200 +1,58 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.entity.ClanHall;
|
||||
import com.l2jmobius.gameserver.model.entity.ClanHall.ClanHallFunction;
|
||||
import com.l2jmobius.gameserver.model.entity.clanhall.AuctionableHall;
|
||||
|
||||
/**
|
||||
* @author Steuf
|
||||
*/
|
||||
public class AgitDecoInfo extends L2GameServerPacket
|
||||
{
|
||||
private final AuctionableHall _clanHall;
|
||||
|
||||
public AgitDecoInfo(AuctionableHall ClanHall)
|
||||
{
|
||||
_clanHall = ClanHall;
|
||||
}
|
||||
|
||||
//@formatter:off
|
||||
/*
|
||||
* Packet send, must be confirmed
|
||||
writeC(0xf7);
|
||||
writeD(0); // clanhall id
|
||||
writeC(0); // FUNC_RESTORE_HP (Fireplace)
|
||||
writeC(0); // FUNC_RESTORE_MP (Carpet)
|
||||
writeC(0); // FUNC_RESTORE_MP (Statue)
|
||||
writeC(0); // FUNC_RESTORE_EXP (Chandelier)
|
||||
writeC(0); // FUNC_TELEPORT (Mirror)
|
||||
writeC(0); // Crytal
|
||||
writeC(0); // Curtain
|
||||
writeC(0); // FUNC_ITEM_CREATE (Magic Curtain)
|
||||
writeC(0); // FUNC_SUPPORT
|
||||
writeC(0); // FUNC_SUPPORT (Flag)
|
||||
writeC(0); // Front Platform
|
||||
writeC(0); // FUNC_ITEM_CREATE
|
||||
writeD(0);
|
||||
writeD(0);
|
||||
*/
|
||||
//@formatter:on
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0xfd);
|
||||
writeD(_clanHall.getId()); // clanhall id
|
||||
// FUNC_RESTORE_HP
|
||||
ClanHallFunction function = _clanHall.getFunction(ClanHall.FUNC_RESTORE_HP);
|
||||
if ((function == null) || (function.getLvl() == 0))
|
||||
{
|
||||
writeC(0);
|
||||
}
|
||||
else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 220)) || ((_clanHall.getGrade() == 1) && (function.getLvl() < 160)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 260)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 300)))
|
||||
{
|
||||
writeC(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
writeC(2);
|
||||
}
|
||||
// FUNC_RESTORE_MP
|
||||
function = _clanHall.getFunction(ClanHall.FUNC_RESTORE_MP);
|
||||
if ((function == null) || (function.getLvl() == 0))
|
||||
{
|
||||
writeC(0);
|
||||
writeC(0);
|
||||
}
|
||||
else if ((((_clanHall.getGrade() == 0) || (_clanHall.getGrade() == 1)) && (function.getLvl() < 25)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 30)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 40)))
|
||||
{
|
||||
writeC(1);
|
||||
writeC(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
writeC(2);
|
||||
writeC(2);
|
||||
}
|
||||
// FUNC_RESTORE_EXP
|
||||
function = _clanHall.getFunction(ClanHall.FUNC_RESTORE_EXP);
|
||||
if ((function == null) || (function.getLvl() == 0))
|
||||
{
|
||||
writeC(0);
|
||||
}
|
||||
else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 25)) || ((_clanHall.getGrade() == 1) && (function.getLvl() < 30)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 40)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 50)))
|
||||
{
|
||||
writeC(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
writeC(2);
|
||||
}
|
||||
// FUNC_TELEPORT
|
||||
function = _clanHall.getFunction(ClanHall.FUNC_TELEPORT);
|
||||
if ((function == null) || (function.getLvl() == 0))
|
||||
{
|
||||
writeC(0);
|
||||
}
|
||||
else if (function.getLvl() < 2)
|
||||
{
|
||||
writeC(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
writeC(2);
|
||||
}
|
||||
writeC(0);
|
||||
// CURTAINS
|
||||
function = _clanHall.getFunction(ClanHall.FUNC_DECO_CURTAINS);
|
||||
if ((function == null) || (function.getLvl() == 0))
|
||||
{
|
||||
writeC(0);
|
||||
}
|
||||
else if (function.getLvl() <= 1)
|
||||
{
|
||||
writeC(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
writeC(2);
|
||||
}
|
||||
// FUNC_ITEM_CREATE
|
||||
function = _clanHall.getFunction(ClanHall.FUNC_ITEM_CREATE);
|
||||
if ((function == null) || (function.getLvl() == 0))
|
||||
{
|
||||
writeC(0);
|
||||
}
|
||||
else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 2)) || (function.getLvl() < 3))
|
||||
{
|
||||
writeC(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
writeC(2);
|
||||
}
|
||||
// FUNC_SUPPORT
|
||||
function = _clanHall.getFunction(ClanHall.FUNC_SUPPORT);
|
||||
if ((function == null) || (function.getLvl() == 0))
|
||||
{
|
||||
writeC(0);
|
||||
writeC(0);
|
||||
}
|
||||
else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 2)) || ((_clanHall.getGrade() == 1) && (function.getLvl() < 4)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 5)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 8)))
|
||||
{
|
||||
writeC(1);
|
||||
writeC(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
writeC(2);
|
||||
writeC(2);
|
||||
}
|
||||
// Front Plateform
|
||||
function = _clanHall.getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM);
|
||||
if ((function == null) || (function.getLvl() == 0))
|
||||
{
|
||||
writeC(0);
|
||||
}
|
||||
else if (function.getLvl() <= 1)
|
||||
{
|
||||
writeC(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
writeC(2);
|
||||
}
|
||||
// FUNC_ITEM_CREATE
|
||||
function = _clanHall.getFunction(ClanHall.FUNC_ITEM_CREATE);
|
||||
if ((function == null) || (function.getLvl() == 0))
|
||||
{
|
||||
writeC(0);
|
||||
}
|
||||
else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 2)) || (function.getLvl() < 3))
|
||||
{
|
||||
writeC(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
writeC(2);
|
||||
}
|
||||
writeD(0); // TODO: Find me!
|
||||
writeD(0); // TODO: Find me!
|
||||
writeD(0); // TODO: Find me!
|
||||
writeD(0); // TODO: Find me!
|
||||
writeD(0); // TODO: Find me!
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.residences.AbstractResidence;
|
||||
import com.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author Steuf, UnAfraid
|
||||
*/
|
||||
public class AgitDecoInfo implements IClientOutgoingPacket
|
||||
{
|
||||
private final AbstractResidence _residense;
|
||||
|
||||
public AgitDecoInfo(AbstractResidence residense)
|
||||
{
|
||||
_residense = residense;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.AGIT_DECO_INFO.writeId(packet);
|
||||
packet.writeD(_residense.getResidenceId());
|
||||
for (ResidenceFunctionType type : ResidenceFunctionType.values())
|
||||
{
|
||||
if (type == ResidenceFunctionType.NONE)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
packet.writeC(_residense.hasFunction(type) ? 0x01 : 0x00);
|
||||
}
|
||||
|
||||
// Unknown
|
||||
packet.writeD(0); // TODO: Find me!
|
||||
packet.writeD(0); // TODO: Find me!
|
||||
packet.writeD(0); // TODO: Find me!
|
||||
packet.writeD(0); // TODO: Find me!
|
||||
packet.writeD(0); // TODO: Find me!
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,113 +1,116 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
|
||||
import com.l2jmobius.gameserver.model.ClanInfo;
|
||||
import com.l2jmobius.gameserver.model.L2Clan;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.RequestAllyInfo;
|
||||
|
||||
/**
|
||||
* Sent in response to {@link RequestAllyInfo}, if applicable.<BR>
|
||||
* @author afk5min
|
||||
*/
|
||||
public class AllianceInfo extends L2GameServerPacket
|
||||
{
|
||||
private final String _name;
|
||||
private final int _total;
|
||||
private final int _online;
|
||||
private final String _leaderC;
|
||||
private final String _leaderP;
|
||||
private final ClanInfo[] _allies;
|
||||
|
||||
public AllianceInfo(int allianceId)
|
||||
{
|
||||
final L2Clan leader = ClanTable.getInstance().getClan(allianceId);
|
||||
_name = leader.getAllyName();
|
||||
_leaderC = leader.getName();
|
||||
_leaderP = leader.getLeaderName();
|
||||
|
||||
final Collection<L2Clan> allies = ClanTable.getInstance().getClanAllies(allianceId);
|
||||
_allies = new ClanInfo[allies.size()];
|
||||
int idx = 0, total = 0, online = 0;
|
||||
for (L2Clan clan : allies)
|
||||
{
|
||||
final ClanInfo ci = new ClanInfo(clan);
|
||||
_allies[idx++] = ci;
|
||||
total += ci.getTotal();
|
||||
online += ci.getOnline();
|
||||
}
|
||||
|
||||
_total = total;
|
||||
_online = online;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xB5);
|
||||
|
||||
writeS(_name);
|
||||
writeD(_total);
|
||||
writeD(_online);
|
||||
writeS(_leaderC);
|
||||
writeS(_leaderP);
|
||||
|
||||
writeD(_allies.length);
|
||||
for (ClanInfo aci : _allies)
|
||||
{
|
||||
writeS(aci.getClan().getName());
|
||||
writeD(0x00);
|
||||
writeD(aci.getClan().getLevel());
|
||||
writeS(aci.getClan().getLeaderName());
|
||||
writeD(aci.getTotal());
|
||||
writeD(aci.getOnline());
|
||||
}
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
||||
public int getTotal()
|
||||
{
|
||||
return _total;
|
||||
}
|
||||
|
||||
public int getOnline()
|
||||
{
|
||||
return _online;
|
||||
}
|
||||
|
||||
public String getLeaderC()
|
||||
{
|
||||
return _leaderC;
|
||||
}
|
||||
|
||||
public String getLeaderP()
|
||||
{
|
||||
return _leaderP;
|
||||
}
|
||||
|
||||
public ClanInfo[] getAllies()
|
||||
{
|
||||
return _allies;
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
|
||||
import com.l2jmobius.gameserver.model.ClanInfo;
|
||||
import com.l2jmobius.gameserver.model.L2Clan;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.RequestAllyInfo;
|
||||
|
||||
/**
|
||||
* Sent in response to {@link RequestAllyInfo}, if applicable.<BR>
|
||||
* @author afk5min
|
||||
*/
|
||||
public class AllianceInfo implements IClientOutgoingPacket
|
||||
{
|
||||
private final String _name;
|
||||
private final int _total;
|
||||
private final int _online;
|
||||
private final String _leaderC;
|
||||
private final String _leaderP;
|
||||
private final ClanInfo[] _allies;
|
||||
|
||||
public AllianceInfo(int allianceId)
|
||||
{
|
||||
final L2Clan leader = ClanTable.getInstance().getClan(allianceId);
|
||||
_name = leader.getAllyName();
|
||||
_leaderC = leader.getName();
|
||||
_leaderP = leader.getLeaderName();
|
||||
|
||||
final Collection<L2Clan> allies = ClanTable.getInstance().getClanAllies(allianceId);
|
||||
_allies = new ClanInfo[allies.size()];
|
||||
int idx = 0, total = 0, online = 0;
|
||||
for (L2Clan clan : allies)
|
||||
{
|
||||
final ClanInfo ci = new ClanInfo(clan);
|
||||
_allies[idx++] = ci;
|
||||
total += ci.getTotal();
|
||||
online += ci.getOnline();
|
||||
}
|
||||
|
||||
_total = total;
|
||||
_online = online;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.ALLIANCE_INFO.writeId(packet);
|
||||
|
||||
packet.writeS(_name);
|
||||
packet.writeD(_total);
|
||||
packet.writeD(_online);
|
||||
packet.writeS(_leaderC);
|
||||
packet.writeS(_leaderP);
|
||||
|
||||
packet.writeD(_allies.length);
|
||||
for (ClanInfo aci : _allies)
|
||||
{
|
||||
packet.writeS(aci.getClan().getName());
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(aci.getClan().getLevel());
|
||||
packet.writeS(aci.getClan().getLeaderName());
|
||||
packet.writeD(aci.getTotal());
|
||||
packet.writeD(aci.getOnline());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
||||
public int getTotal()
|
||||
{
|
||||
return _total;
|
||||
}
|
||||
|
||||
public int getOnline()
|
||||
{
|
||||
return _online;
|
||||
}
|
||||
|
||||
public String getLeaderC()
|
||||
{
|
||||
return _leaderC;
|
||||
}
|
||||
|
||||
public String getLeaderP()
|
||||
{
|
||||
return _leaderP;
|
||||
}
|
||||
|
||||
public ClanInfo[] getAllies()
|
||||
{
|
||||
return _allies;
|
||||
}
|
||||
}
|
||||
@@ -1,49 +1,61 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.data.sql.impl.CrestTable;
|
||||
|
||||
public class AllyCrest extends L2GameServerPacket
|
||||
{
|
||||
private final int _crestId;
|
||||
private final byte[] _data;
|
||||
|
||||
public AllyCrest(int crestId)
|
||||
{
|
||||
_crestId = crestId;
|
||||
_data = CrestTable.getInstance().getCrest(crestId).getData();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0xAF);
|
||||
writeD(Config.SERVER_ID);
|
||||
writeD(_crestId);
|
||||
if (_data != null)
|
||||
{
|
||||
writeD(_data.length);
|
||||
writeB(_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
writeD(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.data.sql.impl.CrestTable;
|
||||
import com.l2jmobius.gameserver.model.L2Crest;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class AllyCrest implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _crestId;
|
||||
private final byte[] _data;
|
||||
|
||||
public AllyCrest(int crestId)
|
||||
{
|
||||
_crestId = crestId;
|
||||
final L2Crest crest = CrestTable.getInstance().getCrest(crestId);
|
||||
_data = crest != null ? crest.getData() : null;
|
||||
}
|
||||
|
||||
public AllyCrest(int crestId, byte[] data)
|
||||
{
|
||||
_crestId = crestId;
|
||||
_data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.ALLIANCE_CREST.writeId(packet);
|
||||
|
||||
packet.writeD(Config.SERVER_ID);
|
||||
packet.writeD(_crestId);
|
||||
if (_data != null)
|
||||
{
|
||||
packet.writeD(_data.length);
|
||||
packet.writeB(_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
packet.writeD(0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,46 +1,48 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
public class AskJoinAlly extends L2GameServerPacket
|
||||
{
|
||||
private final String _requestorName;
|
||||
private final int _requestorObjId;
|
||||
private final String _requestorAllyName;
|
||||
|
||||
/**
|
||||
* @param requestorObjId
|
||||
* @param requestorAllyName
|
||||
* @param requestorName
|
||||
*/
|
||||
public AskJoinAlly(int requestorObjId, String requestorAllyName, String requestorName)
|
||||
{
|
||||
_requestorName = requestorName;
|
||||
_requestorObjId = requestorObjId;
|
||||
_requestorAllyName = requestorAllyName;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0xbb);
|
||||
writeD(_requestorObjId);
|
||||
writeS(_requestorAllyName);
|
||||
writeS(null); // TODO: Find me!
|
||||
writeS(_requestorName);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class AskJoinAlly implements IClientOutgoingPacket
|
||||
{
|
||||
private final String _requestorName;
|
||||
private final int _requestorObjId;
|
||||
|
||||
/**
|
||||
* @param requestorObjId
|
||||
* @param requestorName
|
||||
*/
|
||||
public AskJoinAlly(int requestorObjId, String requestorName)
|
||||
{
|
||||
_requestorName = requestorName;
|
||||
_requestorObjId = requestorObjId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.ASK_JOIN_ALLIANCE.writeId(packet);
|
||||
|
||||
packet.writeD(_requestorObjId);
|
||||
packet.writeS(null); // Ally Name ?
|
||||
packet.writeS(null); // TODO: Find me!
|
||||
packet.writeS(_requestorName);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +1,47 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.PartyDistributionType;
|
||||
|
||||
public class AskJoinParty extends L2GameServerPacket
|
||||
{
|
||||
private final String _requestorName;
|
||||
private final PartyDistributionType _partyDistributionType;
|
||||
|
||||
/**
|
||||
* @param requestorName
|
||||
* @param partyDistributionType
|
||||
*/
|
||||
public AskJoinParty(String requestorName, PartyDistributionType partyDistributionType)
|
||||
{
|
||||
_requestorName = requestorName;
|
||||
_partyDistributionType = partyDistributionType;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x39);
|
||||
writeS(_requestorName);
|
||||
writeD(_partyDistributionType.getId());
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.enums.PartyDistributionType;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class AskJoinParty implements IClientOutgoingPacket
|
||||
{
|
||||
private final String _requestorName;
|
||||
private final PartyDistributionType _partyDistributionType;
|
||||
|
||||
/**
|
||||
* @param requestorName
|
||||
* @param partyDistributionType
|
||||
*/
|
||||
public AskJoinParty(String requestorName, PartyDistributionType partyDistributionType)
|
||||
{
|
||||
_requestorName = requestorName;
|
||||
_partyDistributionType = partyDistributionType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.ASK_JOIN_PARTY.writeId(packet);
|
||||
|
||||
packet.writeS(_requestorName);
|
||||
packet.writeD(_partyDistributionType.getId());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,52 +1,54 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
public final class AskJoinPledge extends L2GameServerPacket
|
||||
{
|
||||
private final int _requestorObjId;
|
||||
private final String _subPledgeName;
|
||||
private final int _pledgeType;
|
||||
private final String _pledgeName;
|
||||
private final String _askjoinName;
|
||||
|
||||
public AskJoinPledge(int requestorObjId, String subPledgeName, int pledgeType, String pledgeName, String askjoinName)
|
||||
{
|
||||
_requestorObjId = requestorObjId;
|
||||
_subPledgeName = subPledgeName;
|
||||
_pledgeType = pledgeType;
|
||||
_pledgeName = pledgeName;
|
||||
_askjoinName = askjoinName;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x2c);
|
||||
writeD(_requestorObjId);
|
||||
writeS(_askjoinName);
|
||||
writeS(_pledgeName);
|
||||
if (_pledgeType != 0)
|
||||
{
|
||||
writeD(_pledgeType);
|
||||
}
|
||||
if (_subPledgeName != null)
|
||||
{
|
||||
writeS(_pledgeType > 0 ? _subPledgeName : _pledgeName);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public final class AskJoinPledge implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _requestorObjId;
|
||||
private final String _subPledgeName;
|
||||
private final int _pledgeType;
|
||||
private final String _pledgeName;
|
||||
|
||||
public AskJoinPledge(int requestorObjId, String subPledgeName, int pledgeType, String pledgeName)
|
||||
{
|
||||
_requestorObjId = requestorObjId;
|
||||
_subPledgeName = subPledgeName;
|
||||
_pledgeType = pledgeType;
|
||||
_pledgeName = pledgeName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.ASK_JOIN_PLEDGE.writeId(packet);
|
||||
|
||||
packet.writeD(_requestorObjId);
|
||||
if (_subPledgeName != null)
|
||||
{
|
||||
packet.writeS(_pledgeType > 0 ? _subPledgeName : _pledgeName);
|
||||
}
|
||||
packet.writeS(_pledgeName);
|
||||
if (_pledgeType != 0)
|
||||
{
|
||||
packet.writeD(_pledgeType);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,115 +1,123 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.gameserver.model.Hit;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
|
||||
public class Attack extends L2GameServerPacket
|
||||
{
|
||||
private final int _attackerObjId;
|
||||
private final boolean _soulshot;
|
||||
private final int _ssGrade;
|
||||
private final Location _attackerLoc;
|
||||
private final Location _targetLoc;
|
||||
private final List<Hit> _hits = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* @param attacker
|
||||
* @param target
|
||||
* @param useShots
|
||||
* @param ssGrade
|
||||
*/
|
||||
public Attack(L2Character attacker, L2Character target, boolean useShots, int ssGrade)
|
||||
{
|
||||
_attackerObjId = attacker.getObjectId();
|
||||
_soulshot = useShots;
|
||||
_ssGrade = Math.min(ssGrade, 6);
|
||||
_attackerLoc = new Location(attacker);
|
||||
_targetLoc = new Location(target);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds hit to the attack (Attacks such as dual dagger/sword/fist has two hits)
|
||||
* @param target
|
||||
* @param damage
|
||||
* @param miss
|
||||
* @param crit
|
||||
* @param shld
|
||||
*/
|
||||
public void addHit(L2Character target, int damage, boolean miss, boolean crit, byte shld)
|
||||
{
|
||||
_hits.add(new Hit(target, damage, miss, crit, shld, _soulshot, _ssGrade));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code true} if current attack contains at least 1 hit.
|
||||
*/
|
||||
public boolean hasHits()
|
||||
{
|
||||
return !_hits.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code true} if attack has soul shot charged.
|
||||
*/
|
||||
public boolean hasSoulshot()
|
||||
{
|
||||
return _soulshot;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes current hit
|
||||
* @param hit
|
||||
*/
|
||||
private void writeHit(Hit hit)
|
||||
{
|
||||
writeD(hit.getTargetId());
|
||||
writeD(hit.getDamage());
|
||||
writeD(hit.getFlags());
|
||||
writeD(hit.getGrade()); // GOD
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
final Iterator<Hit> it = _hits.iterator();
|
||||
final Hit firstHit = it.next();
|
||||
writeC(0x33);
|
||||
|
||||
writeD(_attackerObjId);
|
||||
writeD(firstHit.getTargetId());
|
||||
writeD(0x00); // Ertheia Unknown
|
||||
writeD(firstHit.getDamage());
|
||||
writeD(firstHit.getFlags());
|
||||
writeD(firstHit.getGrade()); // GOD
|
||||
writeLoc(_attackerLoc);
|
||||
|
||||
writeH(_hits.size() - 1);
|
||||
while (it.hasNext())
|
||||
{
|
||||
writeHit(it.next());
|
||||
}
|
||||
|
||||
writeLoc(_targetLoc);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.Hit;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class Attack implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _attackerObjId;
|
||||
private final boolean _soulshot;
|
||||
private final int _ssGrade;
|
||||
private final Location _attackerLoc;
|
||||
private final Location _targetLoc;
|
||||
private final List<Hit> _hits = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* @param attacker
|
||||
* @param target
|
||||
* @param useShots
|
||||
* @param ssGrade
|
||||
*/
|
||||
public Attack(L2Character attacker, L2Character target, boolean useShots, int ssGrade)
|
||||
{
|
||||
_attackerObjId = attacker.getObjectId();
|
||||
_soulshot = useShots;
|
||||
_ssGrade = Math.min(ssGrade, 6);
|
||||
_attackerLoc = new Location(attacker);
|
||||
_targetLoc = new Location(target);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds hit to the attack (Attacks such as dual dagger/sword/fist has two hits)
|
||||
* @param target
|
||||
* @param damage
|
||||
* @param miss
|
||||
* @param crit
|
||||
* @param shld
|
||||
*/
|
||||
public void addHit(L2Character target, int damage, boolean miss, boolean crit, byte shld)
|
||||
{
|
||||
_hits.add(new Hit(target, damage, miss, crit, shld, _soulshot, _ssGrade));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code true} if current attack contains at least 1 hit.
|
||||
*/
|
||||
public boolean hasHits()
|
||||
{
|
||||
return !_hits.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code true} if attack has soul shot charged.
|
||||
*/
|
||||
public boolean hasSoulshot()
|
||||
{
|
||||
return _soulshot;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes current hit
|
||||
* @param packet
|
||||
* @param hit
|
||||
*/
|
||||
private void writeHit(PacketWriter packet, Hit hit)
|
||||
{
|
||||
packet.writeD(hit.getTargetId());
|
||||
packet.writeD(hit.getDamage());
|
||||
packet.writeD(hit.getFlags());
|
||||
packet.writeD(hit.getGrade()); // GOD
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
final Iterator<Hit> it = _hits.iterator();
|
||||
final Hit firstHit = it.next();
|
||||
OutgoingPackets.ATTACK.writeId(packet);
|
||||
|
||||
packet.writeD(_attackerObjId);
|
||||
packet.writeD(firstHit.getTargetId());
|
||||
packet.writeD(0x00); // Ertheia Unknown
|
||||
packet.writeD(firstHit.getDamage());
|
||||
packet.writeD(firstHit.getFlags());
|
||||
packet.writeD(firstHit.getGrade()); // GOD
|
||||
packet.writeD(_attackerLoc.getX());
|
||||
packet.writeD(_attackerLoc.getY());
|
||||
packet.writeD(_attackerLoc.getZ());
|
||||
|
||||
packet.writeH(_hits.size() - 1);
|
||||
while (it.hasNext())
|
||||
{
|
||||
writeHit(packet, it.next());
|
||||
}
|
||||
|
||||
packet.writeD(_targetLoc.getX());
|
||||
packet.writeD(_targetLoc.getY());
|
||||
packet.writeD(_targetLoc.getZ());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +1,42 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
public final class AutoAttackStart extends L2GameServerPacket
|
||||
{
|
||||
private final int _targetObjId;
|
||||
|
||||
/**
|
||||
* @param targetId
|
||||
*/
|
||||
public AutoAttackStart(int targetId)
|
||||
{
|
||||
_targetObjId = targetId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x25);
|
||||
writeD(_targetObjId);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public final class AutoAttackStart implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _targetObjId;
|
||||
|
||||
/**
|
||||
* @param targetId
|
||||
*/
|
||||
public AutoAttackStart(int targetId)
|
||||
{
|
||||
_targetObjId = targetId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.AUTO_ATTACK_START.writeId(packet);
|
||||
|
||||
packet.writeD(_targetObjId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +1,42 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
public class AutoAttackStop extends L2GameServerPacket
|
||||
{
|
||||
private final int _targetObjId;
|
||||
|
||||
/**
|
||||
* @param targetObjId
|
||||
*/
|
||||
public AutoAttackStop(int targetObjId)
|
||||
{
|
||||
_targetObjId = targetObjId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x26);
|
||||
writeD(_targetObjId);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class AutoAttackStop implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _targetObjId;
|
||||
|
||||
/**
|
||||
* @param targetObjId
|
||||
*/
|
||||
public AutoAttackStop(int targetObjId)
|
||||
{
|
||||
_targetObjId = targetObjId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.AUTO_ATTACK_STOP.writeId(packet);
|
||||
|
||||
packet.writeD(_targetObjId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.data.sql.impl.CharNameTable;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public class BlockListPacket implements IClientOutgoingPacket
|
||||
{
|
||||
private final List<Integer> _playersId;
|
||||
|
||||
public BlockListPacket(List<Integer> playersId)
|
||||
{
|
||||
_playersId = playersId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.BLOCK_LIST.writeId(packet);
|
||||
|
||||
packet.writeD(_playersId.size());
|
||||
for (int playerId : _playersId)
|
||||
{
|
||||
packet.writeS(CharNameTable.getInstance().getNameById(playerId));
|
||||
packet.writeS(""); // memo ?
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,68 +1,71 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.model.buylist.L2BuyList;
|
||||
import com.l2jmobius.gameserver.model.buylist.Product;
|
||||
|
||||
public final class BuyList extends AbstractItemPacket
|
||||
{
|
||||
private final int _listId;
|
||||
private final Collection<Product> _list;
|
||||
private final long _money;
|
||||
private double _taxRate = 0;
|
||||
|
||||
public BuyList(L2BuyList list, long currentMoney, double taxRate)
|
||||
{
|
||||
_listId = list.getListId();
|
||||
_list = list.getProducts();
|
||||
_money = currentMoney;
|
||||
_taxRate = taxRate;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0xB8);
|
||||
writeD(0x00);
|
||||
writeQ(_money); // current money
|
||||
writeD(_listId);
|
||||
writeD(0x00); // TODO: Find me
|
||||
writeH(_list.size());
|
||||
|
||||
for (Product product : _list)
|
||||
{
|
||||
if ((product.getCount() > 0) || !product.hasLimitedStock())
|
||||
{
|
||||
writeItem(product);
|
||||
|
||||
if ((product.getItemId() >= 3960) && (product.getItemId() <= 4026))
|
||||
{
|
||||
writeQ((long) (product.getPrice() * Config.RATE_SIEGE_GUARDS_PRICE * (1 + _taxRate)));
|
||||
}
|
||||
else
|
||||
{
|
||||
writeQ((long) (product.getPrice() * (1 + _taxRate)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.buylist.L2BuyList;
|
||||
import com.l2jmobius.gameserver.model.buylist.Product;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public final class BuyList extends AbstractItemPacket
|
||||
{
|
||||
private final int _listId;
|
||||
private final Collection<Product> _list;
|
||||
private final long _money;
|
||||
private double _taxRate = 0;
|
||||
|
||||
public BuyList(L2BuyList list, long currentMoney, double taxRate)
|
||||
{
|
||||
_listId = list.getListId();
|
||||
_list = list.getProducts();
|
||||
_money = currentMoney;
|
||||
_taxRate = taxRate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_BUY_SELL_LIST.writeId(packet);
|
||||
|
||||
packet.writeD(0x00); // Type BUY
|
||||
packet.writeQ(_money); // current money
|
||||
packet.writeD(_listId);
|
||||
packet.writeD(0x00); // TODO: inventory count
|
||||
packet.writeH(_list.size());
|
||||
|
||||
for (Product product : _list)
|
||||
{
|
||||
if ((product.getCount() > 0) || !product.hasLimitedStock())
|
||||
{
|
||||
writeItem(packet, product);
|
||||
|
||||
if ((product.getItemId() >= 3960) && (product.getItemId() <= 4026))
|
||||
{
|
||||
packet.writeQ((long) (product.getPrice() * Config.RATE_SIEGE_GUARDS_PRICE * (1 + _taxRate)));
|
||||
}
|
||||
else
|
||||
{
|
||||
packet.writeQ((long) (product.getPrice() * (1 + _taxRate)));
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,85 +1,87 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.gameserver.instancemanager.CastleManorManager;
|
||||
import com.l2jmobius.gameserver.model.SeedProduction;
|
||||
|
||||
/**
|
||||
* @author l3x
|
||||
*/
|
||||
public final class BuyListSeed extends L2GameServerPacket
|
||||
{
|
||||
private final int _manorId;
|
||||
private final long _money;
|
||||
private final List<SeedProduction> _list = new ArrayList<>();
|
||||
|
||||
public BuyListSeed(long currentMoney, int castleId)
|
||||
{
|
||||
_money = currentMoney;
|
||||
_manorId = castleId;
|
||||
|
||||
for (SeedProduction s : CastleManorManager.getInstance().getSeedProduction(castleId, false))
|
||||
{
|
||||
if ((s.getAmount() > 0) && (s.getPrice() > 0))
|
||||
{
|
||||
_list.add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0xe9);
|
||||
|
||||
writeQ(_money); // current money
|
||||
writeD(0x00); // TODO: Find me!
|
||||
writeD(_manorId); // manor id
|
||||
|
||||
if (!_list.isEmpty())
|
||||
{
|
||||
writeH(_list.size()); // list length
|
||||
for (SeedProduction s : _list)
|
||||
{
|
||||
writeC(0x00); // mask item 0 to print minimal item information
|
||||
writeD(s.getId()); // ObjectId
|
||||
writeD(s.getId()); // ItemId
|
||||
writeC(0xFF); // T1
|
||||
writeQ(s.getAmount()); // Quantity
|
||||
writeC(0x05); // Item Type 2 : 00-weapon, 01-shield/armor, 02-ring/earring/necklace, 03-questitem, 04-adena, 05-item
|
||||
writeC(0x00); // Filler (always 0)
|
||||
writeH(0x00); // Equipped : 00-No, 01-yes
|
||||
writeQ(0x00); // Slot : 0006-lr.ear, 0008-neck, 0030-lr.finger, 0040-head, 0100-l.hand, 0200-gloves, 0400-chest, 0800-pants, 1000-feet, 4000-r.hand, 8000-r.hand
|
||||
writeC(0x00); // Enchant level (pet level shown in control item)
|
||||
writeC(0x00);
|
||||
writeD(-1);
|
||||
writeD(-9999);
|
||||
writeC(0x01); // GOD Item enabled = 1 disabled (red) = 0
|
||||
writeQ(s.getPrice()); // price
|
||||
}
|
||||
_list.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
writeH(0x00);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.instancemanager.CastleManorManager;
|
||||
import com.l2jmobius.gameserver.model.SeedProduction;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author l3x
|
||||
*/
|
||||
public final class BuyListSeed implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _manorId;
|
||||
private final long _money;
|
||||
private final List<SeedProduction> _list = new ArrayList<>();
|
||||
|
||||
public BuyListSeed(long currentMoney, int castleId)
|
||||
{
|
||||
_money = currentMoney;
|
||||
_manorId = castleId;
|
||||
|
||||
for (SeedProduction s : CastleManorManager.getInstance().getSeedProduction(castleId, false))
|
||||
{
|
||||
if ((s.getAmount() > 0) && (s.getPrice() > 0))
|
||||
{
|
||||
_list.add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.BUY_LIST_SEED.writeId(packet);
|
||||
|
||||
packet.writeQ(_money); // current money
|
||||
packet.writeD(0x00); // TODO: Find me!
|
||||
packet.writeD(_manorId); // manor id
|
||||
|
||||
if (!_list.isEmpty())
|
||||
{
|
||||
packet.writeH(_list.size()); // list length
|
||||
for (SeedProduction s : _list)
|
||||
{
|
||||
packet.writeC(0x00); // mask item 0 to print minimal item information
|
||||
packet.writeD(s.getId()); // ObjectId
|
||||
packet.writeD(s.getId()); // ItemId
|
||||
packet.writeC(0xFF); // T1
|
||||
packet.writeQ(s.getAmount()); // Quantity
|
||||
packet.writeC(0x05); // Item Type 2 : 00-weapon, 01-shield/armor, 02-ring/earring/necklace, 03-questitem, 04-adena, 05-item
|
||||
packet.writeC(0x00); // Filler (always 0)
|
||||
packet.writeH(0x00); // Equipped : 00-No, 01-yes
|
||||
packet.writeQ(0x00); // Slot : 0006-lr.ear, 0008-neck, 0030-lr.finger, 0040-head, 0100-l.hand, 0200-gloves, 0400-chest, 0800-pants, 1000-feet, 4000-r.hand, 8000-r.hand
|
||||
packet.writeH(0x00); // Enchant level (pet level shown in control item)
|
||||
packet.writeD(-1);
|
||||
packet.writeD(-9999);
|
||||
packet.writeC(0x01); // GOD Item enabled = 1 disabled (red) = 0
|
||||
packet.writeQ(s.getPrice()); // price
|
||||
}
|
||||
_list.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
packet.writeH(0x00);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,40 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
public final class CSShowComBoard extends L2GameServerPacket
|
||||
{
|
||||
private final byte[] _html;
|
||||
|
||||
public CSShowComBoard(byte[] html)
|
||||
{
|
||||
_html = html;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0x7b);
|
||||
writeC(0x01); // c4 1 to show community 00 to hide
|
||||
writeB(_html);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public final class CSShowComBoard implements IClientOutgoingPacket
|
||||
{
|
||||
private final byte[] _html;
|
||||
|
||||
public CSShowComBoard(byte[] html)
|
||||
{
|
||||
_html = html;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.SHOW_BOARD.writeId(packet);
|
||||
|
||||
packet.writeC(0x01); // c4 1 to show community 00 to hide
|
||||
packet.writeB(_html);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,38 +1,43 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
public class CameraMode extends L2GameServerPacket
|
||||
{
|
||||
private final int _mode;
|
||||
|
||||
/**
|
||||
* Forces client camera mode change
|
||||
* @param mode 0 - third person cam 1 - first person cam
|
||||
*/
|
||||
public CameraMode(int mode)
|
||||
{
|
||||
_mode = mode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeImpl()
|
||||
{
|
||||
writeC(0xf7);
|
||||
writeD(_mode);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class CameraMode implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _mode;
|
||||
|
||||
/**
|
||||
* Forces client camera mode change
|
||||
* @param mode 0 - third person cam 1 - first person cam
|
||||
*/
|
||||
public CameraMode(int mode)
|
||||
{
|
||||
_mode = mode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.CAMERA_MODE.writeId(packet);
|
||||
|
||||
packet.writeD(_mode);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +1,47 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
public class ChairSit extends L2GameServerPacket
|
||||
{
|
||||
private final L2PcInstance _activeChar;
|
||||
private final int _staticObjectId;
|
||||
|
||||
/**
|
||||
* @param player
|
||||
* @param staticObjectId
|
||||
*/
|
||||
public ChairSit(L2PcInstance player, int staticObjectId)
|
||||
{
|
||||
_activeChar = player;
|
||||
_staticObjectId = staticObjectId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0xed);
|
||||
writeD(_activeChar.getObjectId());
|
||||
writeD(_staticObjectId);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class ChairSit implements IClientOutgoingPacket
|
||||
{
|
||||
private final L2PcInstance _activeChar;
|
||||
private final int _staticObjectId;
|
||||
|
||||
/**
|
||||
* @param player
|
||||
* @param staticObjectId
|
||||
*/
|
||||
public ChairSit(L2PcInstance player, int staticObjectId)
|
||||
{
|
||||
_activeChar = player;
|
||||
_staticObjectId = staticObjectId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.CHAIR_SIT.writeId(packet);
|
||||
|
||||
packet.writeD(_activeChar.getObjectId());
|
||||
packet.writeD(_staticObjectId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +1,47 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
|
||||
public class ChangeMoveType extends L2GameServerPacket
|
||||
{
|
||||
public static final int WALK = 0;
|
||||
public static final int RUN = 1;
|
||||
|
||||
private final int _charObjId;
|
||||
private final boolean _running;
|
||||
|
||||
public ChangeMoveType(L2Character character)
|
||||
{
|
||||
_charObjId = character.getObjectId();
|
||||
_running = character.isRunning();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x28);
|
||||
writeD(_charObjId);
|
||||
writeD(_running ? RUN : WALK);
|
||||
writeD(0); // c2
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class ChangeMoveType implements IClientOutgoingPacket
|
||||
{
|
||||
public static final int WALK = 0;
|
||||
public static final int RUN = 1;
|
||||
|
||||
private final int _charObjId;
|
||||
private final boolean _running;
|
||||
|
||||
public ChangeMoveType(L2Character character)
|
||||
{
|
||||
_charObjId = character.getObjectId();
|
||||
_running = character.isRunning();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.CHANGE_MOVE_TYPE.writeId(packet);
|
||||
|
||||
packet.writeD(_charObjId);
|
||||
packet.writeD(_running ? RUN : WALK);
|
||||
packet.writeD(0); // c2
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,52 +1,56 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
|
||||
public class ChangeWaitType extends L2GameServerPacket
|
||||
{
|
||||
private final int _charObjId;
|
||||
private final int _moveType;
|
||||
private final int _x, _y, _z;
|
||||
|
||||
public static final int WT_SITTING = 0;
|
||||
public static final int WT_STANDING = 1;
|
||||
public static final int WT_START_FAKEDEATH = 2;
|
||||
public static final int WT_STOP_FAKEDEATH = 3;
|
||||
|
||||
public ChangeWaitType(L2Character character, int newMoveType)
|
||||
{
|
||||
_charObjId = character.getObjectId();
|
||||
_moveType = newMoveType;
|
||||
|
||||
_x = character.getX();
|
||||
_y = character.getY();
|
||||
_z = character.getZ();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x29);
|
||||
writeD(_charObjId);
|
||||
writeD(_moveType);
|
||||
writeD(_x);
|
||||
writeD(_y);
|
||||
writeD(_z);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class ChangeWaitType implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _charObjId;
|
||||
private final int _moveType;
|
||||
private final int _x, _y, _z;
|
||||
|
||||
public static final int WT_SITTING = 0;
|
||||
public static final int WT_STANDING = 1;
|
||||
public static final int WT_START_FAKEDEATH = 2;
|
||||
public static final int WT_STOP_FAKEDEATH = 3;
|
||||
|
||||
public ChangeWaitType(L2Character character, int newMoveType)
|
||||
{
|
||||
_charObjId = character.getObjectId();
|
||||
_moveType = newMoveType;
|
||||
|
||||
_x = character.getX();
|
||||
_y = character.getY();
|
||||
_z = character.getZ();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.CHANGE_WAIT_TYPE.writeId(packet);
|
||||
|
||||
packet.writeD(_charObjId);
|
||||
packet.writeD(_moveType);
|
||||
packet.writeD(_x);
|
||||
packet.writeD(_y);
|
||||
packet.writeD(_z);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +1,49 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
public class CharCreateFail extends L2GameServerPacket
|
||||
{
|
||||
public static final int REASON_CREATION_FAILED = 0x00; // "Your character creation has failed."
|
||||
public static final int REASON_TOO_MANY_CHARACTERS = 0x01; // "You cannot create another character. Please delete the existing character and try again." Removes all settings that were selected (race, class, etc).
|
||||
public static final int REASON_NAME_ALREADY_EXISTS = 0x02; // "This name already exists."
|
||||
public static final int REASON_16_ENG_CHARS = 0x03; // "Your title cannot exceed 16 characters in length. Please try again."
|
||||
public static final int REASON_INCORRECT_NAME = 0x04; // "Incorrect name. Please try again."
|
||||
public static final int REASON_CREATE_NOT_ALLOWED = 0x05; // "Characters cannot be created from this server."
|
||||
public static final int REASON_CHOOSE_ANOTHER_SVR = 0x06; // "Unable to create character. You are unable to create a new character on the selected server. A restriction is in place which restricts users from creating characters on different servers where no previous character exists. Please
|
||||
// choose another server."
|
||||
|
||||
private final int _error;
|
||||
|
||||
public CharCreateFail(int errorCode)
|
||||
{
|
||||
_error = errorCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x10);
|
||||
writeD(_error);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class CharCreateFail implements IClientOutgoingPacket
|
||||
{
|
||||
// TODO: Enum
|
||||
public static final int REASON_CREATION_FAILED = 0x00; // "Your character creation has failed."
|
||||
public static final int REASON_TOO_MANY_CHARACTERS = 0x01; // "You cannot create another character. Please delete the existing character and try again." Removes all settings that were selected (race, class, etc).
|
||||
public static final int REASON_NAME_ALREADY_EXISTS = 0x02; // "This name already exists."
|
||||
public static final int REASON_16_ENG_CHARS = 0x03; // "Your title cannot exceed 16 characters in length. Please try again."
|
||||
public static final int REASON_INCORRECT_NAME = 0x04; // "Incorrect name. Please try again."
|
||||
public static final int REASON_CREATE_NOT_ALLOWED = 0x05; // "Characters cannot be created from this server."
|
||||
public static final int REASON_CHOOSE_ANOTHER_SVR = 0x06; // "Unable to create character. You are unable to create a new character on the selected server. A restriction is in place which restricts users from creating characters on different servers where no previous character exists. Please
|
||||
// choose another server."
|
||||
|
||||
private final int _error;
|
||||
|
||||
public CharCreateFail(int errorCode)
|
||||
{
|
||||
_error = errorCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.CHARACTER_CREATE_FAIL.writeId(packet);
|
||||
|
||||
packet.writeD(_error);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +1,38 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
public class CharCreateOk extends L2GameServerPacket
|
||||
{
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x0f);
|
||||
writeD(0x01);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class CharCreateOk implements IClientOutgoingPacket
|
||||
{
|
||||
public static final CharCreateOk STATIC_PACKET = new CharCreateOk();
|
||||
|
||||
private CharCreateOk()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.CHARACTER_CREATE_SUCCESS.writeId(packet);
|
||||
|
||||
packet.writeD(0x01);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,38 +1,40 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
public class CharDeleteFail extends L2GameServerPacket
|
||||
{
|
||||
public static final int REASON_DELETION_FAILED = 0x01;
|
||||
public static final int REASON_YOU_MAY_NOT_DELETE_CLAN_MEMBER = 0x02;
|
||||
public static final int REASON_CLAN_LEADERS_MAY_NOT_BE_DELETED = 0x03;
|
||||
|
||||
private final int _error;
|
||||
|
||||
public CharDeleteFail(int errorCode)
|
||||
{
|
||||
_error = errorCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x1e);
|
||||
writeD(_error);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.enums.CharacterDeleteFailType;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class CharDeleteFail implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _error;
|
||||
|
||||
public CharDeleteFail(CharacterDeleteFailType type)
|
||||
{
|
||||
_error = type.ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.CHARACTER_DELETE_FAIL.writeId(packet);
|
||||
|
||||
packet.writeD(_error);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,30 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
public class CharDeleteSuccess extends L2GameServerPacket
|
||||
{
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x1d);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class CharDeleteSuccess implements IClientOutgoingPacket
|
||||
{
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.CHARACTER_DELETE_SUCCESS.writeId(packet);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,246 +1,259 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
|
||||
import com.l2jmobius.gameserver.model.PcCondOverride;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Decoy;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||
import com.l2jmobius.gameserver.model.skills.AbnormalVisualEffect;
|
||||
import com.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
|
||||
public class CharInfo extends L2GameServerPacket
|
||||
{
|
||||
private final L2PcInstance _activeChar;
|
||||
private int _objId;
|
||||
private int _x;
|
||||
private int _y;
|
||||
private int _z;
|
||||
private int _heading;
|
||||
|
||||
private final int _runSpd;
|
||||
private final int _walkSpd;
|
||||
private final int _swimRunSpd;
|
||||
private final int _swimWalkSpd;
|
||||
private final int _flyRunSpd;
|
||||
private final int _flyWalkSpd;
|
||||
private final double _moveMultiplier;
|
||||
|
||||
private int _vehicleId = 0;
|
||||
|
||||
public CharInfo(L2PcInstance cha)
|
||||
{
|
||||
_activeChar = cha;
|
||||
_objId = cha.getObjectId();
|
||||
if ((_activeChar.getVehicle() != null) && (_activeChar.getInVehiclePosition() != null))
|
||||
{
|
||||
_x = _activeChar.getInVehiclePosition().getX();
|
||||
_y = _activeChar.getInVehiclePosition().getY();
|
||||
_z = _activeChar.getInVehiclePosition().getZ();
|
||||
_vehicleId = _activeChar.getVehicle().getObjectId();
|
||||
}
|
||||
else
|
||||
{
|
||||
_x = _activeChar.getX();
|
||||
_y = _activeChar.getY();
|
||||
_z = _activeChar.getZ();
|
||||
}
|
||||
|
||||
_moveMultiplier = cha.getMovementSpeedMultiplier();
|
||||
_runSpd = (int) Math.round(cha.getRunSpeed() / _moveMultiplier);
|
||||
_walkSpd = (int) Math.round(cha.getWalkSpeed() / _moveMultiplier);
|
||||
_swimRunSpd = (int) Math.round(cha.getSwimRunSpeed() / _moveMultiplier);
|
||||
_swimWalkSpd = (int) Math.round(cha.getSwimWalkSpeed() / _moveMultiplier);
|
||||
_flyRunSpd = cha.isFlying() ? _runSpd : 0;
|
||||
_flyWalkSpd = cha.isFlying() ? _walkSpd : 0;
|
||||
|
||||
setInvisible(cha.isInvisible());
|
||||
}
|
||||
|
||||
public CharInfo(L2Decoy decoy)
|
||||
{
|
||||
this(decoy.getActingPlayer()); // init
|
||||
_objId = decoy.getObjectId();
|
||||
_x = decoy.getX();
|
||||
_y = decoy.getY();
|
||||
_z = decoy.getZ();
|
||||
_heading = decoy.getHeading();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
boolean gmSeeInvis = false;
|
||||
|
||||
if (isInvisible())
|
||||
{
|
||||
final L2PcInstance activeChar = getClient().getActiveChar();
|
||||
if ((activeChar != null) && activeChar.canOverrideCond(PcCondOverride.SEE_ALL_PLAYERS))
|
||||
{
|
||||
gmSeeInvis = true;
|
||||
}
|
||||
}
|
||||
|
||||
writeC(0x31);
|
||||
writeD(_x); // Confirmed
|
||||
writeD(_y); // Confirmed
|
||||
writeD(_z); // Confirmed
|
||||
writeD(_vehicleId); // Confirmed
|
||||
writeD(_objId); // Confirmed
|
||||
writeS(_activeChar.getAppearance().getVisibleName()); // Confirmed
|
||||
writeH(_activeChar.getRace().ordinal()); // Confirmed
|
||||
writeC(_activeChar.getAppearance().getSex() ? 0x01 : 0x00); // Confirmed
|
||||
writeD(_activeChar.getBaseClassId()); // Confirmed
|
||||
|
||||
for (int slot : Inventory.PAPERDOLL_ORDER)
|
||||
{
|
||||
writeD(_activeChar.getInventory().getPaperdollItemDisplayId(slot)); // Confirmed
|
||||
}
|
||||
|
||||
for (int slot : Inventory.PAPERDOLL_ORDER_AUGMENT)
|
||||
{
|
||||
writeD(_activeChar.getInventory().getPaperdoll1stAugmentationId(slot));
|
||||
writeD(_activeChar.getInventory().getPaperdoll2ndAugmentationId(slot));
|
||||
}
|
||||
|
||||
writeC(_activeChar.getInventory().getArmorMinEnchant());
|
||||
|
||||
writeD(_activeChar.getInventory().getPaperdollItemVisualId(Inventory.PAPERDOLL_RHAND));
|
||||
writeD(_activeChar.getInventory().getPaperdollItemVisualId(Inventory.PAPERDOLL_LHAND));
|
||||
writeD(_activeChar.getInventory().getPaperdollItemVisualId(Inventory.PAPERDOLL_LRHAND));
|
||||
writeD(_activeChar.getInventory().getPaperdollItemVisualId(Inventory.PAPERDOLL_GLOVES));
|
||||
writeD(_activeChar.getInventory().getPaperdollItemVisualId(Inventory.PAPERDOLL_CHEST));
|
||||
writeD(_activeChar.getInventory().getPaperdollItemVisualId(Inventory.PAPERDOLL_LEGS));
|
||||
writeD(_activeChar.getInventory().getPaperdollItemVisualId(Inventory.PAPERDOLL_FEET));
|
||||
writeD(_activeChar.getInventory().getPaperdollItemVisualId(Inventory.PAPERDOLL_HAIR));
|
||||
writeD(_activeChar.getInventory().getPaperdollItemVisualId(Inventory.PAPERDOLL_DHAIR));
|
||||
|
||||
writeC(_activeChar.getPvpFlag());
|
||||
writeD(_activeChar.getReputation());
|
||||
|
||||
writeD(_activeChar.getMAtkSpd());
|
||||
writeD((int) _activeChar.getPAtkSpd());
|
||||
|
||||
writeH(_runSpd);
|
||||
writeH(_walkSpd);
|
||||
writeH(_swimRunSpd);
|
||||
writeH(_swimWalkSpd);
|
||||
writeH(_flyRunSpd);
|
||||
writeH(_flyWalkSpd);
|
||||
writeH(_flyRunSpd);
|
||||
writeH(_flyWalkSpd);
|
||||
writeF(_moveMultiplier);
|
||||
writeF(_activeChar.getAttackSpeedMultiplier());
|
||||
|
||||
writeF(_activeChar.getCollisionRadius());
|
||||
writeF(_activeChar.getCollisionHeight());
|
||||
|
||||
writeD(_activeChar.getVisualHair());
|
||||
writeD(_activeChar.getVisualHairColor());
|
||||
writeD(_activeChar.getVisualFace());
|
||||
|
||||
writeS(gmSeeInvis ? "[Invisible]" : _activeChar.getAppearance().getVisibleTitle());
|
||||
|
||||
if (!_activeChar.isCursedWeaponEquipped())
|
||||
{
|
||||
writeD(_activeChar.getClanId());
|
||||
writeD(_activeChar.getClanCrestId());
|
||||
writeD(_activeChar.getAllyId());
|
||||
writeD(_activeChar.getAllyCrestId());
|
||||
}
|
||||
else
|
||||
{
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
}
|
||||
|
||||
writeC(_activeChar.isSitting() ? 0x00 : 0x01); // Confirmed
|
||||
writeC(_activeChar.isRunning() ? 0x01 : 0x00); // Confirmed
|
||||
writeC(_activeChar.isInCombat() ? 0x01 : 0x00); // Confirmed
|
||||
|
||||
writeC(!_activeChar.isInOlympiadMode() && _activeChar.isAlikeDead() ? 0x01 : 0x00); // Confirmed
|
||||
|
||||
writeC(!gmSeeInvis && isInvisible() ? 0x01 : 0x00); // TODO: Find me!
|
||||
|
||||
writeC(_activeChar.getMountType().ordinal()); // 1-on Strider, 2-on Wyvern, 3-on Great Wolf, 0-no mount
|
||||
writeC(_activeChar.getPrivateStoreType().getId()); // Confirmed
|
||||
|
||||
writeH(_activeChar.getCubics().size()); // Confirmed
|
||||
_activeChar.getCubics().keySet().forEach(this::writeH);
|
||||
|
||||
writeC(_activeChar.isInPartyMatchRoom() ? 0x01 : 0x00); // Confirmed
|
||||
|
||||
writeC(_activeChar.isInsideZone(ZoneId.WATER) ? 1 : _activeChar.isFlyingMounted() ? 2 : 0);
|
||||
writeH(_activeChar.getRecomHave()); // Confirmed
|
||||
writeD(_activeChar.getMountNpcId() == 0 ? 0 : _activeChar.getMountNpcId() + 1000000);
|
||||
|
||||
writeD(_activeChar.getClassId().getId()); // Confirmed
|
||||
writeD(0x00); // TODO: Find me!
|
||||
writeC(_activeChar.isMounted() ? 0 : _activeChar.getInventory().getWeaponEnchant()); // Confirmed
|
||||
|
||||
writeC(_activeChar.getTeam().getId()); // Confirmed
|
||||
|
||||
writeD(_activeChar.getClanCrestLargeId());
|
||||
writeC(_activeChar.isNoble() ? 1 : 0); // Confirmed
|
||||
writeC(_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA) ? 1 : 0); // Confirmed
|
||||
|
||||
writeC(_activeChar.isFishing() ? 1 : 0); // Confirmed
|
||||
writeD(_activeChar.getFishx()); // Confirmed
|
||||
writeD(_activeChar.getFishy()); // Confirmed
|
||||
writeD(_activeChar.getFishz()); // Confirmed
|
||||
|
||||
writeD(_activeChar.getAppearance().getNameColor()); // Confirmed
|
||||
|
||||
writeD(_heading); // Confirmed
|
||||
|
||||
writeC(_activeChar.getPledgeClass());
|
||||
writeH(_activeChar.getPledgeType());
|
||||
|
||||
writeD(_activeChar.getAppearance().getTitleColor()); // Confirmed
|
||||
|
||||
writeC(_activeChar.isCursedWeaponEquipped() ? CursedWeaponsManager.getInstance().getLevel(_activeChar.getCursedWeaponEquippedId()) : 0); // TODO: Find me!
|
||||
|
||||
writeD(_activeChar.getClanId() > 0 ? _activeChar.getClan().getReputationScore() : 0);
|
||||
writeD(_activeChar.getTransformationDisplayId()); // Confirmed
|
||||
writeD(_activeChar.getAgathionId()); // Confirmed
|
||||
|
||||
writeC(0x01); // TODO: Find me!
|
||||
|
||||
writeD((int) Math.round(_activeChar.getCurrentCp())); // Confirmed
|
||||
writeD(_activeChar.getMaxHp()); // Confirmed
|
||||
writeD((int) Math.round(_activeChar.getCurrentHp())); // Confirmed
|
||||
writeD(_activeChar.getMaxMp()); // Confirmed
|
||||
writeD((int) Math.round(_activeChar.getCurrentMp())); // Confirmed
|
||||
|
||||
writeC(0x00); // TODO: Find me!
|
||||
final Set<AbnormalVisualEffect> abnormalVisualEffects = _activeChar.getCurrentAbnormalVisualEffects();
|
||||
writeD(abnormalVisualEffects.size()); // Confirmed
|
||||
for (AbnormalVisualEffect abnormalVisualEffect : abnormalVisualEffects)
|
||||
{
|
||||
writeH(abnormalVisualEffect.getClientId()); // Confirmed
|
||||
}
|
||||
writeC(0x00); // TODO: Find me!
|
||||
writeC(_activeChar.isHairAccessoryEnabled() ? 0x01 : 0x00); // Hair accessory
|
||||
writeC(_activeChar.getAbilityPointsUsed()); // Used Ability Points
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2DecoyInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
|
||||
import com.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosMember;
|
||||
import com.l2jmobius.gameserver.model.interfaces.ILocational;
|
||||
import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||
import com.l2jmobius.gameserver.model.skills.AbnormalVisualEffect;
|
||||
import com.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class CharInfo implements IClientOutgoingPacket
|
||||
{
|
||||
private final L2PcInstance _activeChar;
|
||||
private int _objId;
|
||||
private int _x, _y, _z, _heading;
|
||||
private final int _mAtkSpd, _pAtkSpd;
|
||||
|
||||
private final int _runSpd, _walkSpd;
|
||||
private final int _swimRunSpd;
|
||||
private final int _swimWalkSpd;
|
||||
private final int _flyRunSpd;
|
||||
private final int _flyWalkSpd;
|
||||
private final double _moveMultiplier;
|
||||
private final float _attackSpeedMultiplier;
|
||||
private int _enchantLevel = 0;
|
||||
private int _armorEnchant = 0;
|
||||
private int _vehicleId = 0;
|
||||
private final boolean _gmSeeInvis;
|
||||
|
||||
private static final int[] PAPERDOLL_ORDER = new int[]
|
||||
{
|
||||
Inventory.PAPERDOLL_UNDER,
|
||||
Inventory.PAPERDOLL_HEAD,
|
||||
Inventory.PAPERDOLL_RHAND,
|
||||
Inventory.PAPERDOLL_LHAND,
|
||||
Inventory.PAPERDOLL_GLOVES,
|
||||
Inventory.PAPERDOLL_CHEST,
|
||||
Inventory.PAPERDOLL_LEGS,
|
||||
Inventory.PAPERDOLL_FEET,
|
||||
Inventory.PAPERDOLL_CLOAK,
|
||||
Inventory.PAPERDOLL_RHAND,
|
||||
Inventory.PAPERDOLL_HAIR,
|
||||
Inventory.PAPERDOLL_HAIR2
|
||||
};
|
||||
|
||||
public CharInfo(L2PcInstance cha, boolean gmSeeInvis)
|
||||
{
|
||||
_activeChar = cha;
|
||||
_objId = cha.getObjectId();
|
||||
if ((_activeChar.getVehicle() != null) && (_activeChar.getInVehiclePosition() != null))
|
||||
{
|
||||
_x = _activeChar.getInVehiclePosition().getX();
|
||||
_y = _activeChar.getInVehiclePosition().getY();
|
||||
_z = _activeChar.getInVehiclePosition().getZ();
|
||||
_vehicleId = _activeChar.getVehicle().getObjectId();
|
||||
}
|
||||
else
|
||||
{
|
||||
_x = _activeChar.getX();
|
||||
_y = _activeChar.getY();
|
||||
_z = _activeChar.getZ();
|
||||
}
|
||||
_heading = _activeChar.getHeading();
|
||||
_mAtkSpd = _activeChar.getMAtkSpd();
|
||||
_pAtkSpd = _activeChar.getPAtkSpd();
|
||||
_attackSpeedMultiplier = _activeChar.getAttackSpeedMultiplier();
|
||||
_moveMultiplier = cha.getMovementSpeedMultiplier();
|
||||
_runSpd = (int) Math.round(cha.getRunSpeed() / _moveMultiplier);
|
||||
_walkSpd = (int) Math.round(cha.getWalkSpeed() / _moveMultiplier);
|
||||
_swimRunSpd = (int) Math.round(cha.getSwimRunSpeed() / _moveMultiplier);
|
||||
_swimWalkSpd = (int) Math.round(cha.getSwimWalkSpeed() / _moveMultiplier);
|
||||
_flyRunSpd = cha.isFlying() ? _runSpd : 0;
|
||||
_flyWalkSpd = cha.isFlying() ? _walkSpd : 0;
|
||||
_enchantLevel = cha.getInventory().getWeaponEnchant();
|
||||
_armorEnchant = cha.getInventory().getArmorMinEnchant();
|
||||
_gmSeeInvis = gmSeeInvis;
|
||||
}
|
||||
|
||||
public CharInfo(L2DecoyInstance decoy, boolean gmSeeInvis)
|
||||
{
|
||||
this(decoy.getActingPlayer(), gmSeeInvis); // init
|
||||
_objId = decoy.getObjectId();
|
||||
_x = decoy.getX();
|
||||
_y = decoy.getY();
|
||||
_z = decoy.getZ();
|
||||
_heading = decoy.getHeading();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.CHAR_INFO.writeId(packet);
|
||||
final CeremonyOfChaosEvent event = _activeChar.getEvent(CeremonyOfChaosEvent.class);
|
||||
final CeremonyOfChaosMember cocPlayer = event != null ? event.getMember(_activeChar.getObjectId()) : null;
|
||||
packet.writeD(_x); // Confirmed
|
||||
packet.writeD(_y); // Confirmed
|
||||
packet.writeD(_z); // Confirmed
|
||||
packet.writeD(_vehicleId); // Confirmed
|
||||
packet.writeD(_objId); // Confirmed
|
||||
packet.writeS(_activeChar.getAppearance().getVisibleName()); // Confirmed
|
||||
|
||||
packet.writeH(_activeChar.getRace().ordinal()); // Confirmed
|
||||
packet.writeC(_activeChar.getAppearance().getSex() ? 0x01 : 0x00); // Confirmed
|
||||
packet.writeD(_activeChar.getBaseClass()); // Confirmed
|
||||
|
||||
for (int slot : getPaperdollOrder())
|
||||
{
|
||||
packet.writeD(_activeChar.getInventory().getPaperdollItemDisplayId(slot)); // Confirmed
|
||||
}
|
||||
|
||||
for (int slot : getPaperdollOrderAugument())
|
||||
{
|
||||
packet.writeQ(_activeChar.getInventory().getPaperdollAugmentationId(slot)); // Confirmed
|
||||
}
|
||||
|
||||
packet.writeC(_armorEnchant);
|
||||
|
||||
for (int slot : getPaperdollOrderVisualId())
|
||||
{
|
||||
packet.writeD(_activeChar.getInventory().getPaperdollItemVisualId(slot));
|
||||
}
|
||||
|
||||
packet.writeC(_activeChar.getPvpFlag());
|
||||
packet.writeD(_activeChar.getReputation());
|
||||
|
||||
packet.writeD(_mAtkSpd);
|
||||
packet.writeD(_pAtkSpd);
|
||||
|
||||
packet.writeH(_runSpd);
|
||||
packet.writeH(_walkSpd);
|
||||
packet.writeH(_swimRunSpd);
|
||||
packet.writeH(_swimWalkSpd);
|
||||
packet.writeH(_flyRunSpd);
|
||||
packet.writeH(_flyWalkSpd);
|
||||
packet.writeH(_flyRunSpd);
|
||||
packet.writeH(_flyWalkSpd);
|
||||
packet.writeF(_moveMultiplier);
|
||||
packet.writeF(_attackSpeedMultiplier);
|
||||
|
||||
packet.writeF(_activeChar.getCollisionRadius());
|
||||
packet.writeF(_activeChar.getCollisionHeight());
|
||||
|
||||
packet.writeD(_activeChar.getVisualHair());
|
||||
packet.writeD(_activeChar.getVisualHairColor());
|
||||
packet.writeD(_activeChar.getVisualFace());
|
||||
|
||||
packet.writeS(_gmSeeInvis ? "Invisible" : _activeChar.getAppearance().getVisibleTitle());
|
||||
|
||||
packet.writeD(_activeChar.getAppearance().getVisibleClanId());
|
||||
packet.writeD(_activeChar.getAppearance().getVisibleClanCrestId());
|
||||
packet.writeD(_activeChar.getAppearance().getVisibleAllyId());
|
||||
packet.writeD(_activeChar.getAppearance().getVisibleAllyCrestId());
|
||||
|
||||
packet.writeC(_activeChar.isSitting() ? 0x00 : 0x01); // Confirmed
|
||||
packet.writeC(_activeChar.isRunning() ? 0x01 : 0x00); // Confirmed
|
||||
packet.writeC(_activeChar.isInCombat() ? 0x01 : 0x00); // Confirmed
|
||||
|
||||
packet.writeC(!_activeChar.isInOlympiadMode() && _activeChar.isAlikeDead() ? 0x01 : 0x00); // Confirmed
|
||||
|
||||
packet.writeC(_activeChar.isInvisible() ? 0x01 : 0x00);
|
||||
|
||||
packet.writeC(_activeChar.getMountType().ordinal()); // 1-on Strider, 2-on Wyvern, 3-on Great Wolf, 0-no mount
|
||||
packet.writeC(_activeChar.getPrivateStoreType().getId()); // Confirmed
|
||||
|
||||
packet.writeH(_activeChar.getCubics().size()); // Confirmed
|
||||
_activeChar.getCubics().keySet().forEach(packet::writeH);
|
||||
|
||||
packet.writeC(_activeChar.isInMatchingRoom() ? 0x01 : 0x00); // Confirmed
|
||||
|
||||
packet.writeC(_activeChar.isInsideZone(ZoneId.WATER) ? 1 : _activeChar.isFlyingMounted() ? 2 : 0);
|
||||
packet.writeH(_activeChar.getRecomHave()); // Confirmed
|
||||
packet.writeD(_activeChar.getMountNpcId() == 0 ? 0 : _activeChar.getMountNpcId() + 1000000);
|
||||
|
||||
packet.writeD(_activeChar.getClassId().getId()); // Confirmed
|
||||
packet.writeD(0x00); // TODO: Find me!
|
||||
packet.writeC(_activeChar.isMounted() ? 0 : _enchantLevel); // Confirmed
|
||||
|
||||
packet.writeC(_activeChar.getTeam().getId()); // Confirmed
|
||||
|
||||
packet.writeD(_activeChar.getClanCrestLargeId());
|
||||
packet.writeC(_activeChar.isNoble() ? 1 : 0); // Confirmed
|
||||
packet.writeC(_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA) ? 1 : 0); // Confirmed
|
||||
|
||||
packet.writeC(_activeChar.isFishing() ? 1 : 0); // Confirmed
|
||||
|
||||
final ILocational baitLocation = _activeChar.getFishing().getBaitLocation();
|
||||
packet.writeD(baitLocation.getX()); // Confirmed
|
||||
packet.writeD(baitLocation.getY()); // Confirmed
|
||||
packet.writeD(baitLocation.getZ()); // Confirmed
|
||||
|
||||
packet.writeD(_activeChar.getAppearance().getNameColor()); // Confirmed
|
||||
|
||||
packet.writeD(_heading); // Confirmed
|
||||
|
||||
packet.writeC(_activeChar.getPledgeClass());
|
||||
packet.writeH(_activeChar.getPledgeType());
|
||||
|
||||
packet.writeD(_activeChar.getAppearance().getTitleColor()); // Confirmed
|
||||
|
||||
packet.writeC(_activeChar.isCursedWeaponEquipped() ? CursedWeaponsManager.getInstance().getLevel(_activeChar.getCursedWeaponEquippedId()) : 0);
|
||||
|
||||
packet.writeD(_activeChar.getAppearance().getVisibleClanId() > 0 ? _activeChar.getClan().getReputationScore() : 0);
|
||||
packet.writeD(_activeChar.getTransformationDisplayId()); // Confirmed
|
||||
packet.writeD(_activeChar.getAgathionId()); // Confirmed
|
||||
|
||||
packet.writeC(0x00); // TODO: Find me!
|
||||
|
||||
packet.writeD((int) Math.round(_activeChar.getCurrentCp())); // Confirmed
|
||||
packet.writeD(_activeChar.getMaxHp()); // Confirmed
|
||||
packet.writeD((int) Math.round(_activeChar.getCurrentHp())); // Confirmed
|
||||
packet.writeD(_activeChar.getMaxMp()); // Confirmed
|
||||
packet.writeD((int) Math.round(_activeChar.getCurrentMp())); // Confirmed
|
||||
|
||||
packet.writeC(0x00); // TODO: Find me!
|
||||
final Set<AbnormalVisualEffect> abnormalVisualEffects = _activeChar.getCurrentAbnormalVisualEffects();
|
||||
packet.writeD(abnormalVisualEffects.size() + (_gmSeeInvis ? 1 : 0)); // Confirmed
|
||||
for (AbnormalVisualEffect abnormalVisualEffect : abnormalVisualEffects)
|
||||
{
|
||||
packet.writeH(abnormalVisualEffect.getClientId()); // Confirmed
|
||||
}
|
||||
if (_gmSeeInvis)
|
||||
{
|
||||
packet.writeH(AbnormalVisualEffect.STEALTH.getClientId());
|
||||
}
|
||||
packet.writeC(cocPlayer != null ? cocPlayer.getPosition() : 0);
|
||||
packet.writeC(_activeChar.isHairAccessoryEnabled() ? 0x01 : 0x00); // Hair accessory
|
||||
packet.writeC(_activeChar.getAbilityPointsUsed()); // Used Ability Points
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getPaperdollOrder()
|
||||
{
|
||||
return PAPERDOLL_ORDER;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,83 +1,86 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.GameTimeController;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
public class CharSelected extends L2GameServerPacket
|
||||
{
|
||||
private final L2PcInstance _activeChar;
|
||||
private final int _sessionId;
|
||||
|
||||
/**
|
||||
* @param cha
|
||||
* @param sessionId
|
||||
*/
|
||||
public CharSelected(L2PcInstance cha, int sessionId)
|
||||
{
|
||||
_activeChar = cha;
|
||||
_sessionId = sessionId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x0B);
|
||||
|
||||
writeS(_activeChar.getName());
|
||||
writeD(_activeChar.getObjectId());
|
||||
writeS(_activeChar.getTitle());
|
||||
writeD(_sessionId);
|
||||
writeD(_activeChar.getClanId());
|
||||
writeD(0x00); // ??
|
||||
writeD(_activeChar.getAppearance().getSex() ? 1 : 0);
|
||||
writeD(_activeChar.getRace().ordinal());
|
||||
writeD(_activeChar.getClassId().getId());
|
||||
writeD(0x01); // active ??
|
||||
writeD(_activeChar.getX());
|
||||
writeD(_activeChar.getY());
|
||||
writeD(_activeChar.getZ());
|
||||
writeF(_activeChar.getCurrentHp());
|
||||
writeF(_activeChar.getCurrentMp());
|
||||
writeQ(_activeChar.getSp());
|
||||
writeQ(_activeChar.getExp());
|
||||
writeD(_activeChar.getLevel());
|
||||
writeD(_activeChar.getReputation());
|
||||
writeD(_activeChar.getPkKills());
|
||||
writeD(GameTimeController.getInstance().getGameTime() % (24 * 60)); // "reset" on 24th hour
|
||||
writeD(0x00);
|
||||
writeD(_activeChar.getClassId().getId());
|
||||
|
||||
writeB(new byte[16]);
|
||||
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
|
||||
writeD(0x00);
|
||||
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
|
||||
writeB(new byte[28]);
|
||||
writeD(0x00);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.GameTimeController;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class CharSelected implements IClientOutgoingPacket
|
||||
{
|
||||
private final L2PcInstance _activeChar;
|
||||
private final int _sessionId;
|
||||
|
||||
/**
|
||||
* @param cha
|
||||
* @param sessionId
|
||||
*/
|
||||
public CharSelected(L2PcInstance cha, int sessionId)
|
||||
{
|
||||
_activeChar = cha;
|
||||
_sessionId = sessionId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.CHARACTER_SELECTED.writeId(packet);
|
||||
|
||||
packet.writeS(_activeChar.getName());
|
||||
packet.writeD(_activeChar.getObjectId());
|
||||
packet.writeS(_activeChar.getTitle());
|
||||
packet.writeD(_sessionId);
|
||||
packet.writeD(_activeChar.getClanId());
|
||||
packet.writeD(0x00); // ??
|
||||
packet.writeD(_activeChar.getAppearance().getSex() ? 1 : 0);
|
||||
packet.writeD(_activeChar.getRace().ordinal());
|
||||
packet.writeD(_activeChar.getClassId().getId());
|
||||
packet.writeD(0x01); // active ??
|
||||
packet.writeD(_activeChar.getX());
|
||||
packet.writeD(_activeChar.getY());
|
||||
packet.writeD(_activeChar.getZ());
|
||||
packet.writeF(_activeChar.getCurrentHp());
|
||||
packet.writeF(_activeChar.getCurrentMp());
|
||||
packet.writeQ(_activeChar.getSp());
|
||||
packet.writeQ(_activeChar.getExp());
|
||||
packet.writeD(_activeChar.getLevel());
|
||||
packet.writeD(_activeChar.getReputation());
|
||||
packet.writeD(_activeChar.getPkKills());
|
||||
packet.writeD(GameTimeController.getInstance().getGameTime() % (24 * 60)); // "reset" on 24th hour
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(_activeChar.getClassId().getId());
|
||||
|
||||
packet.writeB(new byte[16]);
|
||||
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(0x00);
|
||||
|
||||
packet.writeD(0x00);
|
||||
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(0x00);
|
||||
|
||||
packet.writeB(new byte[28]);
|
||||
packet.writeD(0x00);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,348 +1,398 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.commons.database.DatabaseFactory;
|
||||
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ExperienceData;
|
||||
import com.l2jmobius.gameserver.model.CharSelectInfoPackage;
|
||||
import com.l2jmobius.gameserver.model.L2Clan;
|
||||
import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||
|
||||
public class CharSelectionInfo extends L2GameServerPacket
|
||||
{
|
||||
private static Logger _log = Logger.getLogger(CharSelectionInfo.class.getName());
|
||||
private final String _loginName;
|
||||
private final int _sessionId;
|
||||
private final List<CharSelectInfoPackage> _characterPackages;
|
||||
|
||||
/**
|
||||
* Constructor for CharSelectionInfo.
|
||||
* @param loginName
|
||||
* @param sessionId
|
||||
*/
|
||||
public CharSelectionInfo(String loginName, int sessionId)
|
||||
{
|
||||
_sessionId = sessionId;
|
||||
_loginName = loginName;
|
||||
_characterPackages = loadCharacterSelectInfo(_loginName);
|
||||
}
|
||||
|
||||
public List<CharSelectInfoPackage> getCharInfo()
|
||||
{
|
||||
return _characterPackages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x09); // packet id
|
||||
final int size = _characterPackages.size();
|
||||
writeD(size); // How many char there is on this account
|
||||
|
||||
// Can prevent players from creating new characters (if 0); (if 1, the client will ask if chars may be created (0x13) Response: (0x0D) )
|
||||
writeD(Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT);
|
||||
writeC(size == Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT ? 0x01 : 0x00); // if 1 can't create new char
|
||||
writeC(0x01); // play mode, if 1 can create only 2 char in regular lobby
|
||||
writeC(0x02); // play mode, if 1 can create only 2 char in regular lobby
|
||||
writeD(0x00); // if 1, korean client
|
||||
|
||||
int charId = 0;
|
||||
if (!_characterPackages.isEmpty())
|
||||
{
|
||||
long lastAccess = -1L;
|
||||
charId = _characterPackages.get(0).getObjectId();
|
||||
|
||||
for (CharSelectInfoPackage info : _characterPackages)
|
||||
{
|
||||
if (info.isAvailable() && (lastAccess < info.getLastAccess()))
|
||||
{
|
||||
lastAccess = info.getLastAccess();
|
||||
charId = info.getObjectId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (CharSelectInfoPackage charInfoPackage : _characterPackages)
|
||||
{
|
||||
writeS(charInfoPackage.getName());
|
||||
writeD(charInfoPackage.getObjectId());
|
||||
writeS(_loginName);
|
||||
writeD(_sessionId);
|
||||
writeD(charInfoPackage.getClanId());
|
||||
writeD(0x00);
|
||||
writeD(charInfoPackage.getSex());
|
||||
writeD(charInfoPackage.getRace());
|
||||
writeD(charInfoPackage.getBaseClassId());
|
||||
writeD(Config.SERVER_ID);
|
||||
writeD(charInfoPackage.getX());
|
||||
writeD(charInfoPackage.getY());
|
||||
writeD(charInfoPackage.getZ());
|
||||
writeF(charInfoPackage.getCurrentHp());
|
||||
writeF(charInfoPackage.getCurrentMp());
|
||||
|
||||
writeQ(charInfoPackage.getSp());
|
||||
writeQ(charInfoPackage.getExp());
|
||||
writeF((float) (charInfoPackage.getExp() - ExperienceData.getInstance().getExpForLevel(charInfoPackage.getLevel())) / (ExperienceData.getInstance().getExpForLevel(charInfoPackage.getLevel() + 1) - ExperienceData.getInstance().getExpForLevel(charInfoPackage.getLevel()))); // High Five
|
||||
writeD(charInfoPackage.getLevel());
|
||||
|
||||
writeD(charInfoPackage.getReputation());
|
||||
writeD(charInfoPackage.getPkKills());
|
||||
writeD(charInfoPackage.getPvPKills());
|
||||
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
|
||||
writeD(0x00); // Ertheia
|
||||
writeD(0x00); // Ertheia
|
||||
|
||||
for (int slot : Inventory.PAPERDOLL_ORDER_ALL)
|
||||
{
|
||||
writeD(charInfoPackage.getPaperdollItemId(slot));
|
||||
}
|
||||
|
||||
writeD(charInfoPackage.getPaperdollItemVisualId(Inventory.PAPERDOLL_RHAND));
|
||||
writeD(charInfoPackage.getPaperdollItemVisualId(Inventory.PAPERDOLL_LHAND));
|
||||
writeD(charInfoPackage.getPaperdollItemVisualId(Inventory.PAPERDOLL_GLOVES));
|
||||
writeD(charInfoPackage.getPaperdollItemVisualId(Inventory.PAPERDOLL_CHEST));
|
||||
writeD(charInfoPackage.getPaperdollItemVisualId(Inventory.PAPERDOLL_LEGS));
|
||||
writeD(charInfoPackage.getPaperdollItemVisualId(Inventory.PAPERDOLL_FEET));
|
||||
writeD(charInfoPackage.getPaperdollItemVisualId(Inventory.PAPERDOLL_LRHAND));
|
||||
writeD(charInfoPackage.getPaperdollItemVisualId(Inventory.PAPERDOLL_HAIR));
|
||||
writeD(charInfoPackage.getPaperdollItemVisualId(Inventory.PAPERDOLL_DHAIR));
|
||||
|
||||
writeH(charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_CHEST));
|
||||
writeH(charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_LEGS));
|
||||
writeH(charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_HEAD));
|
||||
writeH(charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_GLOVES));
|
||||
writeH(charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_FEET));
|
||||
|
||||
writeD(charInfoPackage.getHairStyle());
|
||||
writeD(charInfoPackage.getHairColor());
|
||||
writeD(charInfoPackage.getFace());
|
||||
|
||||
writeF(charInfoPackage.getMaxHp());
|
||||
writeF(charInfoPackage.getMaxMp());
|
||||
|
||||
writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - System.currentTimeMillis()) / 1000) : 0);
|
||||
writeD(charInfoPackage.getClassId());
|
||||
writeD(charId == charInfoPackage.getObjectId() ? 0x01 : 0x00);
|
||||
writeC(charInfoPackage.getWeaponEnchantEffect());
|
||||
writeD(charInfoPackage.get1stAugmentationId());
|
||||
writeD(charInfoPackage.get2ndAugmentationId());
|
||||
writeD(charInfoPackage.getTransformationId());
|
||||
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
|
||||
writeF(0x00);
|
||||
writeF(0x00);
|
||||
writeD(charInfoPackage.getVitalityPoints());
|
||||
writeD(charInfoPackage.getVitalityPercent());
|
||||
writeD(charInfoPackage.getVitalityItemCount());
|
||||
writeD(charInfoPackage.isAvailable());
|
||||
writeC(0x00);
|
||||
writeC(charInfoPackage.isHero()); // hero glow
|
||||
writeC(charInfoPackage.isHairAccessoryEnabled() ? 0x01 : 0x00); // show hair accessory if enabled
|
||||
}
|
||||
}
|
||||
|
||||
private static List<CharSelectInfoPackage> loadCharacterSelectInfo(String loginName)
|
||||
{
|
||||
final List<CharSelectInfoPackage> characterList = new ArrayList<>();
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement statement = con.prepareStatement("SELECT * FROM characters WHERE account_name=? ORDER BY createDate"))
|
||||
{
|
||||
statement.setString(1, loginName);
|
||||
try (ResultSet charList = statement.executeQuery())
|
||||
{
|
||||
while (charList.next())// fills the package
|
||||
{
|
||||
final CharSelectInfoPackage charInfopackage = restoreChar(charList);
|
||||
if (charInfopackage != null)
|
||||
{
|
||||
characterList.add(charInfopackage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
|
||||
}
|
||||
return characterList;
|
||||
}
|
||||
|
||||
private static void loadCharacterSubclassInfo(CharSelectInfoPackage charInfopackage, int ObjectId, int activeClassId)
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement statement = con.prepareStatement("SELECT exp, sp, level, vitality_points FROM character_subclasses WHERE charId=? && class_id=? ORDER BY charId"))
|
||||
{
|
||||
statement.setInt(1, ObjectId);
|
||||
statement.setInt(2, activeClassId);
|
||||
try (ResultSet charList = statement.executeQuery())
|
||||
{
|
||||
if (charList.next())
|
||||
{
|
||||
charInfopackage.setExp(charList.getLong("exp"));
|
||||
charInfopackage.setSp(charList.getInt("sp"));
|
||||
charInfopackage.setLevel(charList.getInt("level"));
|
||||
charInfopackage.setVitalityPoints(charList.getInt("vitality_points"));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.log(Level.WARNING, "Could not restore char subclass info: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
private static CharSelectInfoPackage restoreChar(ResultSet chardata) throws Exception
|
||||
{
|
||||
final int objectId = chardata.getInt("charId");
|
||||
final String name = chardata.getString("char_name");
|
||||
|
||||
// See if the char must be deleted
|
||||
final long deletetime = chardata.getLong("deletetime");
|
||||
if ((deletetime > 0) && (System.currentTimeMillis() > deletetime))
|
||||
{
|
||||
final L2Clan clan = ClanTable.getInstance().getClan(chardata.getInt("clanid"));
|
||||
if (clan != null)
|
||||
{
|
||||
clan.removeClanMember(objectId, 0);
|
||||
}
|
||||
L2GameClient.deleteCharByObjId(objectId);
|
||||
return null;
|
||||
}
|
||||
|
||||
final CharSelectInfoPackage charInfopackage = new CharSelectInfoPackage(objectId, name);
|
||||
charInfopackage.setAccessLevel(chardata.getInt("accesslevel"));
|
||||
charInfopackage.setLevel(chardata.getInt("level"));
|
||||
charInfopackage.setMaxHp(chardata.getInt("maxhp"));
|
||||
charInfopackage.setCurrentHp(chardata.getDouble("curhp"));
|
||||
charInfopackage.setMaxMp(chardata.getInt("maxmp"));
|
||||
charInfopackage.setCurrentMp(chardata.getDouble("curmp"));
|
||||
charInfopackage.setReputation(chardata.getInt("reputation"));
|
||||
charInfopackage.setPkKills(chardata.getInt("pkkills"));
|
||||
charInfopackage.setPvPKills(chardata.getInt("pvpkills"));
|
||||
charInfopackage.setFace(chardata.getInt("face"));
|
||||
charInfopackage.setHairStyle(chardata.getInt("hairstyle"));
|
||||
charInfopackage.setHairColor(chardata.getInt("haircolor"));
|
||||
charInfopackage.setSex(chardata.getInt("sex"));
|
||||
|
||||
charInfopackage.setExp(chardata.getLong("exp"));
|
||||
charInfopackage.setSp(chardata.getLong("sp"));
|
||||
charInfopackage.setVitalityPoints(chardata.getInt("vitality_points"));
|
||||
charInfopackage.setClanId(chardata.getInt("clanid"));
|
||||
|
||||
charInfopackage.setRace(chardata.getInt("race"));
|
||||
|
||||
final int baseClassId = chardata.getInt("base_class");
|
||||
final int activeClassId = chardata.getInt("classid");
|
||||
|
||||
charInfopackage.setX(chardata.getInt("x"));
|
||||
charInfopackage.setY(chardata.getInt("y"));
|
||||
charInfopackage.setZ(chardata.getInt("z"));
|
||||
|
||||
final int faction = chardata.getInt("faction");
|
||||
if (faction == 1)
|
||||
{
|
||||
charInfopackage.setGood();
|
||||
}
|
||||
if (faction == 2)
|
||||
{
|
||||
charInfopackage.setEvil();
|
||||
}
|
||||
|
||||
if (Config.L2JMOD_MULTILANG_ENABLE)
|
||||
{
|
||||
String lang = chardata.getString("language");
|
||||
if (!Config.L2JMOD_MULTILANG_ALLOWED.contains(lang))
|
||||
{
|
||||
lang = Config.L2JMOD_MULTILANG_DEFAULT;
|
||||
}
|
||||
charInfopackage.setHtmlPrefix("lang/" + lang + "/");
|
||||
}
|
||||
|
||||
// if is in subclass, load subclass exp, sp, lvl info
|
||||
if (baseClassId != activeClassId)
|
||||
{
|
||||
loadCharacterSubclassInfo(charInfopackage, objectId, activeClassId);
|
||||
}
|
||||
|
||||
charInfopackage.setClassId(activeClassId);
|
||||
|
||||
// Get the augmentation id for equipped weapon
|
||||
int weaponObjId = charInfopackage.getPaperdollObjectId(Inventory.PAPERDOLL_RHAND);
|
||||
if (weaponObjId < 1)
|
||||
{
|
||||
weaponObjId = charInfopackage.getPaperdollObjectId(Inventory.PAPERDOLL_RHAND);
|
||||
}
|
||||
|
||||
if (weaponObjId > 0)
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement statement = con.prepareStatement("SELECT augAttributes FROM item_attributes WHERE itemId=?"))
|
||||
{
|
||||
statement.setInt(1, weaponObjId);
|
||||
try (ResultSet result = statement.executeQuery())
|
||||
{
|
||||
if (result.next())
|
||||
{
|
||||
final int augment = result.getInt("augAttributes");
|
||||
charInfopackage.setAugmentationId(augment == -1 ? 0 : augment);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.log(Level.WARNING, "Could not restore augmentation info: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the base class is set to zero and also doesn't match with the current active class, otherwise send the base class ID. This prevents chars created before base class was introduced from being displayed incorrectly.
|
||||
if ((baseClassId == 0) && (activeClassId > 0))
|
||||
{
|
||||
charInfopackage.setBaseClassId(activeClassId);
|
||||
}
|
||||
else
|
||||
{
|
||||
charInfopackage.setBaseClassId(baseClassId);
|
||||
}
|
||||
|
||||
charInfopackage.setDeleteTimer(deletetime);
|
||||
charInfopackage.setLastAccess(chardata.getLong("lastAccess"));
|
||||
return charInfopackage;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.commons.database.DatabaseFactory;
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ExperienceData;
|
||||
import com.l2jmobius.gameserver.model.CharSelectInfoPackage;
|
||||
import com.l2jmobius.gameserver.model.L2Clan;
|
||||
import com.l2jmobius.gameserver.model.entity.Hero;
|
||||
import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||
import com.l2jmobius.gameserver.network.client.L2GameClient;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class CharSelectionInfo implements IClientOutgoingPacket
|
||||
{
|
||||
private static Logger _log = Logger.getLogger(CharSelectionInfo.class.getName());
|
||||
private final String _loginName;
|
||||
private final int _sessionId;
|
||||
private int _activeId;
|
||||
private final CharSelectInfoPackage[] _characterPackages;
|
||||
|
||||
private static final int[] PAPERDOLL_ORDER_VISUAL_ID = new int[]
|
||||
{
|
||||
Inventory.PAPERDOLL_RHAND,
|
||||
Inventory.PAPERDOLL_LHAND,
|
||||
Inventory.PAPERDOLL_GLOVES,
|
||||
Inventory.PAPERDOLL_CHEST,
|
||||
Inventory.PAPERDOLL_LEGS,
|
||||
Inventory.PAPERDOLL_FEET,
|
||||
Inventory.PAPERDOLL_HAIR,
|
||||
Inventory.PAPERDOLL_HAIR2,
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructor for CharSelectionInfo.
|
||||
* @param loginName
|
||||
* @param sessionId
|
||||
*/
|
||||
public CharSelectionInfo(String loginName, int sessionId)
|
||||
{
|
||||
_sessionId = sessionId;
|
||||
_loginName = loginName;
|
||||
_characterPackages = loadCharacterSelectInfo(_loginName);
|
||||
_activeId = -1;
|
||||
}
|
||||
|
||||
public CharSelectionInfo(String loginName, int sessionId, int activeId)
|
||||
{
|
||||
_sessionId = sessionId;
|
||||
_loginName = loginName;
|
||||
_characterPackages = loadCharacterSelectInfo(_loginName);
|
||||
_activeId = activeId;
|
||||
}
|
||||
|
||||
public CharSelectInfoPackage[] getCharInfo()
|
||||
{
|
||||
return _characterPackages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.CHARACTER_SELECTION_INFO.writeId(packet);
|
||||
|
||||
final int size = _characterPackages.length;
|
||||
packet.writeD(size); // How many char there is on this account
|
||||
|
||||
// Can prevent players from creating new characters (if 0); (if 1, the client will ask if chars may be created (0x13) Response: (0x0D) )
|
||||
packet.writeD(Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT);
|
||||
packet.writeC(size == Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT ? 0x01 : 0x00); // if 1 can't create new char
|
||||
packet.writeC(0x01); // play mode, if 1 can create only 2 char in regular lobby
|
||||
packet.writeD(0x02); // if 1, korean client
|
||||
packet.writeC(0x00); // if 1 suggest premium account
|
||||
|
||||
long lastAccess = 0L;
|
||||
if (_activeId == -1)
|
||||
{
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
if (lastAccess < _characterPackages[i].getLastAccess())
|
||||
{
|
||||
lastAccess = _characterPackages[i].getLastAccess();
|
||||
_activeId = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
final CharSelectInfoPackage charInfoPackage = _characterPackages[i];
|
||||
|
||||
packet.writeS(charInfoPackage.getName()); // char name
|
||||
packet.writeD(charInfoPackage.getObjectId()); // char id
|
||||
packet.writeS(_loginName); // login
|
||||
packet.writeD(_sessionId); // session id
|
||||
packet.writeD(0x00); // ??
|
||||
packet.writeD(0x00); // ??
|
||||
|
||||
packet.writeD(charInfoPackage.getSex()); // sex
|
||||
packet.writeD(charInfoPackage.getRace()); // race
|
||||
|
||||
if (charInfoPackage.getClassId() == charInfoPackage.getBaseClassId())
|
||||
{
|
||||
packet.writeD(charInfoPackage.getClassId());
|
||||
}
|
||||
else
|
||||
{
|
||||
packet.writeD(charInfoPackage.getBaseClassId());
|
||||
}
|
||||
|
||||
packet.writeD(0x01); // server id ??
|
||||
|
||||
packet.writeD(charInfoPackage.getX());
|
||||
packet.writeD(charInfoPackage.getY());
|
||||
packet.writeD(charInfoPackage.getZ());
|
||||
packet.writeF(charInfoPackage.getCurrentHp());
|
||||
packet.writeF(charInfoPackage.getCurrentMp());
|
||||
|
||||
packet.writeQ(charInfoPackage.getSp());
|
||||
packet.writeQ(charInfoPackage.getExp());
|
||||
packet.writeF((float) (charInfoPackage.getExp() - ExperienceData.getInstance().getExpForLevel(charInfoPackage.getLevel())) / (ExperienceData.getInstance().getExpForLevel(charInfoPackage.getLevel() + 1) - ExperienceData.getInstance().getExpForLevel(charInfoPackage.getLevel()))); // High
|
||||
// Five
|
||||
packet.writeD(charInfoPackage.getLevel());
|
||||
|
||||
packet.writeD(charInfoPackage.getReputation());
|
||||
packet.writeD(charInfoPackage.getPkKills());
|
||||
packet.writeD(charInfoPackage.getPvPKills());
|
||||
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(0x00);
|
||||
|
||||
packet.writeD(0x00); // Ertheia
|
||||
packet.writeD(0x00); // Ertheia
|
||||
|
||||
for (int slot : getPaperdollOrder())
|
||||
{
|
||||
packet.writeD(charInfoPackage.getPaperdollItemId(slot));
|
||||
}
|
||||
|
||||
for (int slot : getPaperdollOrderVisualId())
|
||||
{
|
||||
packet.writeD(charInfoPackage.getPaperdollItemVisualId(slot));
|
||||
}
|
||||
|
||||
packet.writeD(0x00); // ??
|
||||
packet.writeD(0x00); // ??
|
||||
packet.writeD(0x00); // ??
|
||||
packet.writeC(0x00); // Armor Enchant
|
||||
packet.writeC(0x00); // Weapon Enchant
|
||||
|
||||
packet.writeD(charInfoPackage.getHairStyle());
|
||||
packet.writeD(charInfoPackage.getHairColor());
|
||||
packet.writeD(charInfoPackage.getFace());
|
||||
|
||||
packet.writeF(charInfoPackage.getMaxHp()); // hp max
|
||||
packet.writeF(charInfoPackage.getMaxMp()); // mp max
|
||||
|
||||
packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - System.currentTimeMillis()) / 1000) : 0);
|
||||
packet.writeD(charInfoPackage.getClassId());
|
||||
packet.writeD(i == _activeId ? 1 : 0);
|
||||
|
||||
packet.writeC(charInfoPackage.getEnchantEffect() > 127 ? 127 : charInfoPackage.getEnchantEffect());
|
||||
packet.writeQ(charInfoPackage.getAugmentationId());
|
||||
|
||||
// packet.writeD(charInfoPackage.getTransformId()); // Used to display Transformations
|
||||
packet.writeD(0x00); // Currently on retail when you are on character select you don't see your transformation.
|
||||
|
||||
// Freya by Vistall:
|
||||
packet.writeD(0x00); // npdid - 16024 Tame Tiny Baby Kookaburra A9E89C
|
||||
packet.writeD(0x00); // level
|
||||
packet.writeD(0x00); // ?
|
||||
packet.writeD(0x00); // food? - 1200
|
||||
packet.writeF(0x00); // max Hp
|
||||
packet.writeF(0x00); // cur Hp
|
||||
|
||||
packet.writeD(charInfoPackage.getVitalityPoints()); // H5 Vitality
|
||||
packet.writeD((int) Config.RATE_VITALITY_EXP_MULTIPLIER * 100); // Vitality Exp Bonus
|
||||
packet.writeD(charInfoPackage.getVitalityItemsUsed()); // Vitality items used, such as potion
|
||||
packet.writeD(charInfoPackage.getAccessLevel() == -100 ? 0x00 : 0x01); // Char is active or not
|
||||
packet.writeC(charInfoPackage.isNoble() ? 0x01 : 0x00);
|
||||
packet.writeC(Hero.getInstance().isHero(charInfoPackage.getObjectId()) ? 0x01 : 0x00); // hero glow
|
||||
packet.writeC(charInfoPackage.isHairAccessoryEnabled() ? 0x01 : 0x00); // show hair accessory if enabled
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static CharSelectInfoPackage[] loadCharacterSelectInfo(String loginName)
|
||||
{
|
||||
CharSelectInfoPackage charInfopackage;
|
||||
final List<CharSelectInfoPackage> characterList = new LinkedList<>();
|
||||
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement statement = con.prepareStatement("SELECT * FROM characters WHERE account_name=? ORDER BY createDate"))
|
||||
{
|
||||
statement.setString(1, loginName);
|
||||
try (ResultSet charList = statement.executeQuery())
|
||||
{
|
||||
while (charList.next())// fills the package
|
||||
{
|
||||
charInfopackage = restoreChar(charList);
|
||||
if (charInfopackage != null)
|
||||
{
|
||||
characterList.add(charInfopackage);
|
||||
}
|
||||
}
|
||||
}
|
||||
return characterList.toArray(new CharSelectInfoPackage[characterList.size()]);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
|
||||
}
|
||||
return new CharSelectInfoPackage[0];
|
||||
}
|
||||
|
||||
private static void loadCharacterSubclassInfo(CharSelectInfoPackage charInfopackage, int ObjectId, int activeClassId)
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement statement = con.prepareStatement("SELECT exp, sp, level, vitality_points FROM character_subclasses WHERE charId=? && class_id=? ORDER BY charId"))
|
||||
{
|
||||
statement.setInt(1, ObjectId);
|
||||
statement.setInt(2, activeClassId);
|
||||
try (ResultSet charList = statement.executeQuery())
|
||||
{
|
||||
if (charList.next())
|
||||
{
|
||||
charInfopackage.setExp(charList.getLong("exp"));
|
||||
charInfopackage.setSp(charList.getInt("sp"));
|
||||
charInfopackage.setLevel(charList.getInt("level"));
|
||||
charInfopackage.setVitalityPoints(charList.getInt("vitality_points"));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.log(Level.WARNING, "Could not restore char subclass info: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
private static CharSelectInfoPackage restoreChar(ResultSet chardata) throws Exception
|
||||
{
|
||||
final int objectId = chardata.getInt("charId");
|
||||
final String name = chardata.getString("char_name");
|
||||
|
||||
// See if the char must be deleted
|
||||
final long deletetime = chardata.getLong("deletetime");
|
||||
if (deletetime > 0)
|
||||
{
|
||||
if (System.currentTimeMillis() > deletetime)
|
||||
{
|
||||
final L2Clan clan = ClanTable.getInstance().getClan(chardata.getInt("clanid"));
|
||||
if (clan != null)
|
||||
{
|
||||
clan.removeClanMember(objectId, 0);
|
||||
}
|
||||
|
||||
L2GameClient.deleteCharByObjId(objectId);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
final CharSelectInfoPackage charInfopackage = new CharSelectInfoPackage(objectId, name);
|
||||
charInfopackage.setAccessLevel(chardata.getInt("accesslevel"));
|
||||
charInfopackage.setLevel(chardata.getInt("level"));
|
||||
charInfopackage.setMaxHp(chardata.getInt("maxhp"));
|
||||
charInfopackage.setCurrentHp(chardata.getDouble("curhp"));
|
||||
charInfopackage.setMaxMp(chardata.getInt("maxmp"));
|
||||
charInfopackage.setCurrentMp(chardata.getDouble("curmp"));
|
||||
charInfopackage.setReputation(chardata.getInt("reputation"));
|
||||
charInfopackage.setPkKills(chardata.getInt("pkkills"));
|
||||
charInfopackage.setPvPKills(chardata.getInt("pvpkills"));
|
||||
charInfopackage.setFace(chardata.getInt("face"));
|
||||
charInfopackage.setHairStyle(chardata.getInt("hairstyle"));
|
||||
charInfopackage.setHairColor(chardata.getInt("haircolor"));
|
||||
charInfopackage.setSex(chardata.getInt("sex"));
|
||||
|
||||
charInfopackage.setExp(chardata.getLong("exp"));
|
||||
charInfopackage.setSp(chardata.getLong("sp"));
|
||||
charInfopackage.setVitalityPoints(chardata.getInt("vitality_points"));
|
||||
charInfopackage.setClanId(chardata.getInt("clanid"));
|
||||
|
||||
charInfopackage.setRace(chardata.getInt("race"));
|
||||
|
||||
final int baseClassId = chardata.getInt("base_class");
|
||||
final int activeClassId = chardata.getInt("classid");
|
||||
|
||||
charInfopackage.setX(chardata.getInt("x"));
|
||||
charInfopackage.setY(chardata.getInt("y"));
|
||||
charInfopackage.setZ(chardata.getInt("z"));
|
||||
|
||||
final int faction = chardata.getInt("faction");
|
||||
if (faction == 1)
|
||||
{
|
||||
charInfopackage.setGood();
|
||||
}
|
||||
if (faction == 2)
|
||||
{
|
||||
charInfopackage.setEvil();
|
||||
}
|
||||
|
||||
if (Config.L2JMOD_MULTILANG_ENABLE)
|
||||
{
|
||||
String lang = chardata.getString("language");
|
||||
if (!Config.L2JMOD_MULTILANG_ALLOWED.contains(lang))
|
||||
{
|
||||
lang = Config.L2JMOD_MULTILANG_DEFAULT;
|
||||
}
|
||||
charInfopackage.setHtmlPrefix("data/lang/" + lang + "/");
|
||||
}
|
||||
|
||||
// if is in subclass, load subclass exp, sp, lvl info
|
||||
if (baseClassId != activeClassId)
|
||||
{
|
||||
loadCharacterSubclassInfo(charInfopackage, objectId, activeClassId);
|
||||
}
|
||||
|
||||
charInfopackage.setClassId(activeClassId);
|
||||
|
||||
// Get the augmentation id for equipped weapon
|
||||
int weaponObjId = charInfopackage.getPaperdollObjectId(Inventory.PAPERDOLL_RHAND);
|
||||
if (weaponObjId < 1)
|
||||
{
|
||||
weaponObjId = charInfopackage.getPaperdollObjectId(Inventory.PAPERDOLL_RHAND);
|
||||
}
|
||||
|
||||
if (weaponObjId > 0)
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement statement = con.prepareStatement("SELECT augAttributes FROM item_attributes WHERE itemId=?"))
|
||||
{
|
||||
statement.setInt(1, weaponObjId);
|
||||
try (ResultSet result = statement.executeQuery())
|
||||
{
|
||||
if (result.next())
|
||||
{
|
||||
final int augment = result.getInt("augAttributes");
|
||||
charInfopackage.setAugmentationId(augment == -1 ? 0 : augment);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.log(Level.WARNING, "Could not restore augmentation info: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the base class is set to zero and also doesn't match with the current active class, otherwise send the base class ID. This prevents chars created before base class was introduced from being displayed incorrectly.
|
||||
if ((baseClassId == 0) && (activeClassId > 0))
|
||||
{
|
||||
charInfopackage.setBaseClassId(activeClassId);
|
||||
}
|
||||
else
|
||||
{
|
||||
charInfopackage.setBaseClassId(baseClassId);
|
||||
}
|
||||
|
||||
charInfopackage.setDeleteTimer(deletetime);
|
||||
charInfopackage.setLastAccess(chardata.getLong("lastAccess"));
|
||||
charInfopackage.setNoble(chardata.getInt("nobless") == 1);
|
||||
return charInfopackage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getPaperdollOrderVisualId()
|
||||
{
|
||||
return PAPERDOLL_ORDER_VISUAL_ID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,34 +1,39 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
public final class ChooseInventoryItem extends L2GameServerPacket
|
||||
{
|
||||
private final int _itemId;
|
||||
|
||||
public ChooseInventoryItem(int itemId)
|
||||
{
|
||||
_itemId = itemId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x7c);
|
||||
writeD(_itemId);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public final class ChooseInventoryItem implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _itemId;
|
||||
|
||||
public ChooseInventoryItem(int itemId)
|
||||
{
|
||||
_itemId = itemId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.CHOOSE_INVENTORY_ITEM.writeId(packet);
|
||||
|
||||
packet.writeD(_itemId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +1,40 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.GameTimeController;
|
||||
|
||||
public class ClientSetTime extends L2GameServerPacket
|
||||
{
|
||||
public static final ClientSetTime STATIC_PACKET = new ClientSetTime();
|
||||
|
||||
private ClientSetTime()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0xf2);
|
||||
writeD(GameTimeController.getInstance().getGameTime()); // time in client minutes
|
||||
writeD(6); // constant to match the server time( this determines the speed of the client clock)
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.GameTimeController;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class ClientSetTime implements IClientOutgoingPacket
|
||||
{
|
||||
public static final ClientSetTime STATIC_PACKET = new ClientSetTime();
|
||||
|
||||
private ClientSetTime()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.CLIENT_SET_TIME.writeId(packet);
|
||||
|
||||
packet.writeD(GameTimeController.getInstance().getGameTime()); // time in client minutes
|
||||
packet.writeD(6); // constant to match the server time( this determines the speed of the client clock)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,79 +1,83 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
|
||||
/**
|
||||
* ConfirmDlg server packet implementation.
|
||||
* @author kombat, UnAfraid
|
||||
*/
|
||||
public class ConfirmDlg extends AbstractMessagePacket<ConfirmDlg>
|
||||
{
|
||||
private int _time;
|
||||
private int _requesterId;
|
||||
|
||||
public ConfirmDlg(SystemMessageId smId)
|
||||
{
|
||||
super(smId);
|
||||
}
|
||||
|
||||
public ConfirmDlg(int id)
|
||||
{
|
||||
this(SystemMessageId.getSystemMessageId(id));
|
||||
}
|
||||
|
||||
public ConfirmDlg(String text)
|
||||
{
|
||||
this(SystemMessageId.S13);
|
||||
addString(text);
|
||||
}
|
||||
|
||||
public ConfirmDlg addTime(int time)
|
||||
{
|
||||
_time = time;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ConfirmDlg addRequesterId(int id)
|
||||
{
|
||||
_requesterId = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeParamsSize(int size)
|
||||
{
|
||||
writeD(size);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeParamType(int type)
|
||||
{
|
||||
writeD(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0xF3);
|
||||
writeD(getId());
|
||||
writeMe();
|
||||
writeD(_time);
|
||||
writeD(_requesterId);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* ConfirmDlg server packet implementation.
|
||||
* @author kombat, UnAfraid
|
||||
*/
|
||||
public class ConfirmDlg extends AbstractMessagePacket<ConfirmDlg>
|
||||
{
|
||||
private int _time;
|
||||
private int _requesterId;
|
||||
|
||||
public ConfirmDlg(SystemMessageId smId)
|
||||
{
|
||||
super(smId);
|
||||
}
|
||||
|
||||
public ConfirmDlg(int id)
|
||||
{
|
||||
this(SystemMessageId.getSystemMessageId(id));
|
||||
}
|
||||
|
||||
public ConfirmDlg(String text)
|
||||
{
|
||||
this(SystemMessageId.S13);
|
||||
addString(text);
|
||||
}
|
||||
|
||||
public ConfirmDlg addTime(int time)
|
||||
{
|
||||
_time = time;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ConfirmDlg addRequesterId(int id)
|
||||
{
|
||||
_requesterId = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeParamsSize(PacketWriter packet, int size)
|
||||
{
|
||||
packet.writeD(size);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeParamType(PacketWriter packet, int type)
|
||||
{
|
||||
packet.writeD(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.CONFIRM_DLG.writeId(packet);
|
||||
|
||||
packet.writeD(getId());
|
||||
writeMe(packet);
|
||||
packet.writeD(_time);
|
||||
packet.writeD(_requesterId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,182 +1,185 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.instancemanager.MentorManager;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
|
||||
public final class CreatureSay extends L2GameServerPacket
|
||||
{
|
||||
private final int _objectId;
|
||||
private final ChatType _textType;
|
||||
private String _charName = null;
|
||||
private int _charId = 0;
|
||||
private String _text = null;
|
||||
private int _npcString = -1;
|
||||
private int _mask;
|
||||
private int _charLevel = -1;
|
||||
private List<String> _parameters;
|
||||
|
||||
/**
|
||||
* @param sender
|
||||
* @param receiver
|
||||
* @param name
|
||||
* @param messageType
|
||||
* @param text
|
||||
*/
|
||||
public CreatureSay(L2PcInstance sender, L2PcInstance receiver, String name, ChatType messageType, String text)
|
||||
{
|
||||
_objectId = sender.getObjectId();
|
||||
_charName = name;
|
||||
_charLevel = sender.getLevel();
|
||||
_textType = messageType;
|
||||
_text = text;
|
||||
if (receiver.getFriendList().containsKey(sender.getObjectId()))
|
||||
{
|
||||
_mask |= 0x01;
|
||||
}
|
||||
if ((receiver.getClanId() > 0) && (receiver.getClanId() == sender.getClanId()))
|
||||
{
|
||||
_mask |= 0x02;
|
||||
}
|
||||
if ((MentorManager.getInstance().getMentee(receiver.getObjectId(), sender.getObjectId()) != null) || (MentorManager.getInstance().getMentee(sender.getObjectId(), receiver.getObjectId()) != null))
|
||||
{
|
||||
_mask |= 0x04;
|
||||
}
|
||||
if ((receiver.getAllyId() > 0) && (receiver.getAllyId() == sender.getAllyId()))
|
||||
{
|
||||
_mask |= 0x08;
|
||||
}
|
||||
|
||||
// Does not shows level
|
||||
if (sender.isGM())
|
||||
{
|
||||
_mask |= 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param objectId
|
||||
* @param messageType
|
||||
* @param charName
|
||||
* @param text
|
||||
*/
|
||||
public CreatureSay(int objectId, ChatType messageType, String charName, String text)
|
||||
{
|
||||
_objectId = objectId;
|
||||
_textType = messageType;
|
||||
_charName = charName;
|
||||
_text = text;
|
||||
}
|
||||
|
||||
public CreatureSay(L2PcInstance player, ChatType messageType, String text)
|
||||
{
|
||||
_objectId = player.getObjectId();
|
||||
_textType = messageType;
|
||||
_charName = player.getAppearance().getVisibleName();
|
||||
_text = text;
|
||||
}
|
||||
|
||||
public CreatureSay(int objectId, ChatType messageType, int charId, NpcStringId npcString)
|
||||
{
|
||||
_objectId = objectId;
|
||||
_textType = messageType;
|
||||
_charId = charId;
|
||||
_npcString = npcString.getId();
|
||||
}
|
||||
|
||||
public CreatureSay(int objectId, ChatType messageType, String charName, NpcStringId npcString)
|
||||
{
|
||||
_objectId = objectId;
|
||||
_textType = messageType;
|
||||
_charName = charName;
|
||||
_npcString = npcString.getId();
|
||||
}
|
||||
|
||||
public CreatureSay(int objectId, ChatType messageType, int charId, SystemMessageId sysString)
|
||||
{
|
||||
_objectId = objectId;
|
||||
_textType = messageType;
|
||||
_charId = charId;
|
||||
_npcString = sysString.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* String parameter for argument S1,S2,.. in npcstring-e.dat
|
||||
* @param text
|
||||
*/
|
||||
public void addStringParameter(String text)
|
||||
{
|
||||
if (_parameters == null)
|
||||
{
|
||||
_parameters = new ArrayList<>();
|
||||
}
|
||||
_parameters.add(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x4A);
|
||||
writeD(_objectId);
|
||||
writeD(_textType.getClientId());
|
||||
if (_charName != null)
|
||||
{
|
||||
writeS(_charName);
|
||||
}
|
||||
else
|
||||
{
|
||||
writeD(_charId);
|
||||
}
|
||||
writeD(_npcString); // High Five NPCString ID
|
||||
if (_text != null)
|
||||
{
|
||||
writeS(_text);
|
||||
if ((_charLevel > 0) && (_textType == ChatType.WHISPER))
|
||||
{
|
||||
writeC(_mask);
|
||||
if ((_mask & 0x10) == 0)
|
||||
{
|
||||
writeC(_charLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (_parameters != null)
|
||||
{
|
||||
for (String s : _parameters)
|
||||
{
|
||||
writeS(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void runImpl()
|
||||
{
|
||||
final L2PcInstance _pci = getClient().getActiveChar();
|
||||
if (_pci != null)
|
||||
{
|
||||
_pci.broadcastSnoop(_textType, _charName, _text);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.instancemanager.MentorManager;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public final class CreatureSay implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _objectId;
|
||||
private final ChatType _textType;
|
||||
private String _charName = null;
|
||||
private int _charId = 0;
|
||||
private String _text = null;
|
||||
private int _npcString = -1;
|
||||
private int _mask;
|
||||
private int _charLevel = -1;
|
||||
private List<String> _parameters;
|
||||
|
||||
/**
|
||||
* @param sender
|
||||
* @param receiver
|
||||
* @param name
|
||||
* @param messageType
|
||||
* @param text
|
||||
*/
|
||||
public CreatureSay(L2PcInstance sender, L2PcInstance receiver, String name, ChatType messageType, String text)
|
||||
{
|
||||
_objectId = sender.getObjectId();
|
||||
_charName = name;
|
||||
_charLevel = sender.getLevel();
|
||||
_textType = messageType;
|
||||
_text = text;
|
||||
if (receiver.getFriendList().contains(sender.getObjectId()))
|
||||
{
|
||||
_mask |= 0x01;
|
||||
}
|
||||
if ((receiver.getClanId() > 0) && (receiver.getClanId() == sender.getClanId()))
|
||||
{
|
||||
_mask |= 0x02;
|
||||
}
|
||||
if ((MentorManager.getInstance().getMentee(receiver.getObjectId(), sender.getObjectId()) != null) || (MentorManager.getInstance().getMentee(sender.getObjectId(), receiver.getObjectId()) != null))
|
||||
{
|
||||
_mask |= 0x04;
|
||||
}
|
||||
if ((receiver.getAllyId() > 0) && (receiver.getAllyId() == sender.getAllyId()))
|
||||
{
|
||||
_mask |= 0x08;
|
||||
}
|
||||
|
||||
// Does not shows level
|
||||
if (sender.isGM())
|
||||
{
|
||||
_mask |= 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param objectId
|
||||
* @param messageType
|
||||
* @param charName
|
||||
* @param text
|
||||
*/
|
||||
public CreatureSay(int objectId, ChatType messageType, String charName, String text)
|
||||
{
|
||||
_objectId = objectId;
|
||||
_textType = messageType;
|
||||
_charName = charName;
|
||||
_text = text;
|
||||
}
|
||||
|
||||
public CreatureSay(L2PcInstance player, ChatType messageType, String text)
|
||||
{
|
||||
_objectId = player.getObjectId();
|
||||
_textType = messageType;
|
||||
_charName = player.getAppearance().getVisibleName();
|
||||
_text = text;
|
||||
}
|
||||
|
||||
public CreatureSay(int objectId, ChatType messageType, int charId, NpcStringId npcString)
|
||||
{
|
||||
_objectId = objectId;
|
||||
_textType = messageType;
|
||||
_charId = charId;
|
||||
_npcString = npcString.getId();
|
||||
}
|
||||
|
||||
public CreatureSay(int objectId, ChatType messageType, String charName, NpcStringId npcString)
|
||||
{
|
||||
_objectId = objectId;
|
||||
_textType = messageType;
|
||||
_charName = charName;
|
||||
_npcString = npcString.getId();
|
||||
}
|
||||
|
||||
public CreatureSay(int objectId, ChatType messageType, int charId, SystemMessageId sysString)
|
||||
{
|
||||
_objectId = objectId;
|
||||
_textType = messageType;
|
||||
_charId = charId;
|
||||
_npcString = sysString.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* String parameter for argument S1,S2,.. in npcstring-e.dat
|
||||
* @param text
|
||||
*/
|
||||
public void addStringParameter(String text)
|
||||
{
|
||||
if (_parameters == null)
|
||||
{
|
||||
_parameters = new ArrayList<>();
|
||||
}
|
||||
_parameters.add(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.SAY2.writeId(packet);
|
||||
|
||||
packet.writeD(_objectId);
|
||||
packet.writeD(_textType.getClientId());
|
||||
if (_charName != null)
|
||||
{
|
||||
packet.writeS(_charName);
|
||||
}
|
||||
else
|
||||
{
|
||||
packet.writeD(_charId);
|
||||
}
|
||||
packet.writeD(_npcString); // High Five NPCString ID
|
||||
if (_text != null)
|
||||
{
|
||||
packet.writeS(_text);
|
||||
if ((_charLevel > 0) && (_textType == ChatType.WHISPER))
|
||||
{
|
||||
packet.writeC(_mask);
|
||||
if ((_mask & 0x10) == 0)
|
||||
{
|
||||
packet.writeC(_charLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (_parameters != null)
|
||||
{
|
||||
for (String s : _parameters)
|
||||
{
|
||||
packet.writeS(s);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void runImpl(L2PcInstance player)
|
||||
{
|
||||
if (player != null)
|
||||
{
|
||||
player.broadcastSnoop(_textType, _charName, _text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,42 +1,46 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
|
||||
public final class DeleteObject extends L2GameServerPacket
|
||||
{
|
||||
private final int _objectId;
|
||||
|
||||
public DeleteObject(L2Object obj)
|
||||
{
|
||||
_objectId = obj.getObjectId();
|
||||
}
|
||||
|
||||
public DeleteObject(int objectId)
|
||||
{
|
||||
_objectId = objectId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x08);
|
||||
writeD(_objectId);
|
||||
writeC(0x00); // c2
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public final class DeleteObject implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _objectId;
|
||||
|
||||
public DeleteObject(L2Object obj)
|
||||
{
|
||||
_objectId = obj.getObjectId();
|
||||
}
|
||||
|
||||
public DeleteObject(int objectId)
|
||||
{
|
||||
_objectId = objectId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.DELETE_OBJECT.writeId(packet);
|
||||
|
||||
packet.writeD(_objectId);
|
||||
packet.writeC(0x00); // c2
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,57 +1,62 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
public class Dice extends L2GameServerPacket
|
||||
{
|
||||
private final int _charObjId;
|
||||
private final int _itemId;
|
||||
private final int _number;
|
||||
private final int _x;
|
||||
private final int _y;
|
||||
private final int _z;
|
||||
|
||||
/**
|
||||
* @param charObjId
|
||||
* @param itemId
|
||||
* @param number
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
*/
|
||||
public Dice(int charObjId, int itemId, int number, int x, int y, int z)
|
||||
{
|
||||
_charObjId = charObjId;
|
||||
_itemId = itemId;
|
||||
_number = number;
|
||||
_x = x;
|
||||
_y = y;
|
||||
_z = z;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0xda);
|
||||
writeD(_charObjId); // object id of player
|
||||
writeD(_itemId); // item id of dice (spade) 4625,4626,4627,4628
|
||||
writeD(_number); // number rolled
|
||||
writeD(_x); // x
|
||||
writeD(_y); // y
|
||||
writeD(_z); // z
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class Dice implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _charObjId;
|
||||
private final int _itemId;
|
||||
private final int _number;
|
||||
private final int _x;
|
||||
private final int _y;
|
||||
private final int _z;
|
||||
|
||||
/**
|
||||
* @param charObjId
|
||||
* @param itemId
|
||||
* @param number
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
*/
|
||||
public Dice(int charObjId, int itemId, int number, int x, int y, int z)
|
||||
{
|
||||
_charObjId = charObjId;
|
||||
_itemId = itemId;
|
||||
_number = number;
|
||||
_x = x;
|
||||
_y = y;
|
||||
_z = z;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.DICE.writeId(packet);
|
||||
|
||||
packet.writeD(_charObjId); // object id of player
|
||||
packet.writeD(_itemId); // item id of dice (spade) 4625,4626,4627,4628
|
||||
packet.writeD(_number); // number rolled
|
||||
packet.writeD(_x); // x
|
||||
packet.writeD(_y); // y
|
||||
packet.writeD(_z); // z
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,123 +1,138 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.gameserver.instancemanager.CHSiegeManager;
|
||||
import com.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
import com.l2jmobius.gameserver.instancemanager.FortManager;
|
||||
import com.l2jmobius.gameserver.model.L2Clan;
|
||||
import com.l2jmobius.gameserver.model.L2SiegeClan;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.entity.Castle;
|
||||
import com.l2jmobius.gameserver.model.entity.Fort;
|
||||
import com.l2jmobius.gameserver.model.entity.clanhall.SiegableHall;
|
||||
|
||||
/**
|
||||
* @author UnAfraid, Nos
|
||||
*/
|
||||
public class Die extends L2GameServerPacket
|
||||
{
|
||||
private final int _objectId;
|
||||
private boolean _toVillage;
|
||||
private boolean _toClanHall;
|
||||
private boolean _toCastle;
|
||||
private boolean _toOutpost;
|
||||
private final boolean _isSweepable;
|
||||
private boolean _useFeather;
|
||||
private boolean _toFortress;
|
||||
private List<Integer> _items = null;
|
||||
|
||||
public Die(L2Character activeChar)
|
||||
{
|
||||
_objectId = activeChar.getObjectId();
|
||||
if (activeChar.isPlayer())
|
||||
{
|
||||
final L2Clan clan = activeChar.getActingPlayer().getClan();
|
||||
boolean isInCastleDefense = false;
|
||||
boolean isInFortDefense = false;
|
||||
|
||||
L2SiegeClan siegeClan = null;
|
||||
final Castle castle = CastleManager.getInstance().getCastle(activeChar);
|
||||
final Fort fort = FortManager.getInstance().getFort(activeChar);
|
||||
final SiegableHall hall = CHSiegeManager.getInstance().getNearbyClanHall(activeChar);
|
||||
if ((castle != null) && castle.getSiege().isInProgress())
|
||||
{
|
||||
siegeClan = castle.getSiege().getAttackerClan(clan);
|
||||
isInCastleDefense = (siegeClan == null) && castle.getSiege().checkIsDefender(clan);
|
||||
}
|
||||
else if ((fort != null) && fort.getSiege().isInProgress())
|
||||
{
|
||||
siegeClan = fort.getSiege().getAttackerClan(clan);
|
||||
isInFortDefense = (siegeClan == null) && fort.getSiege().checkIsDefender(clan);
|
||||
}
|
||||
|
||||
_toVillage = activeChar.canRevive() && !activeChar.isPendingRevive();
|
||||
_toClanHall = (clan != null) && (clan.getHideoutId() > 0);
|
||||
_toCastle = ((clan != null) && (clan.getCastleId() > 0)) || isInCastleDefense;
|
||||
_toOutpost = ((siegeClan != null) && !isInCastleDefense && !isInFortDefense && !siegeClan.getFlag().isEmpty()) || ((hall != null) && hall.getSiege().checkIsAttacker(clan));
|
||||
_useFeather = activeChar.getAccessLevel().allowFixedRes();
|
||||
_toFortress = ((clan != null) && (clan.getFortId() > 0)) || isInFortDefense;
|
||||
}
|
||||
|
||||
_isSweepable = activeChar.isAttackable() && activeChar.isSweepActive();
|
||||
}
|
||||
|
||||
public void addItem(int itemId)
|
||||
{
|
||||
if (_items == null)
|
||||
{
|
||||
_items = new ArrayList<>(8);
|
||||
}
|
||||
|
||||
if (_items.size() < 8)
|
||||
{
|
||||
_items.add(itemId);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IndexOutOfBoundsException("Die packet doesn't support more then 8 items!");
|
||||
}
|
||||
}
|
||||
|
||||
public List<Integer> getItems()
|
||||
{
|
||||
return _items != null ? _items : Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x00);
|
||||
writeD(_objectId);
|
||||
writeD(_toVillage ? 0x01 : 0x00);
|
||||
writeD(_toClanHall ? 0x01 : 0x00);
|
||||
writeD(_toCastle ? 0x01 : 0x00);
|
||||
writeD(_toOutpost ? 0x01 : 0x00);
|
||||
writeD(_isSweepable ? 0x01 : 0x00);
|
||||
writeD(_useFeather ? 0x01 : 0x00);
|
||||
writeD(_toFortress ? 0x01 : 0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
writeC(0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
import com.l2jmobius.gameserver.instancemanager.FortManager;
|
||||
import com.l2jmobius.gameserver.model.L2Clan;
|
||||
import com.l2jmobius.gameserver.model.L2SiegeClan;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.entity.Castle;
|
||||
import com.l2jmobius.gameserver.model.entity.Fort;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author UnAfraid, Nos
|
||||
*/
|
||||
public class Die implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _objectId;
|
||||
private boolean _toVillage;
|
||||
private boolean _toClanHall;
|
||||
private boolean _toCastle;
|
||||
private boolean _toOutpost;
|
||||
private final boolean _isSweepable;
|
||||
private boolean _useFeather;
|
||||
private boolean _toFortress;
|
||||
private boolean _hideAnimation;
|
||||
private List<Integer> _items = null;
|
||||
private boolean _itemsEnabled;
|
||||
|
||||
public Die(L2Character activeChar)
|
||||
{
|
||||
_objectId = activeChar.getObjectId();
|
||||
if (activeChar.isPlayer())
|
||||
{
|
||||
final L2Clan clan = activeChar.getActingPlayer().getClan();
|
||||
boolean isInCastleDefense = false;
|
||||
boolean isInFortDefense = false;
|
||||
|
||||
L2SiegeClan siegeClan = null;
|
||||
final Castle castle = CastleManager.getInstance().getCastle(activeChar);
|
||||
final Fort fort = FortManager.getInstance().getFort(activeChar);
|
||||
if ((castle != null) && castle.getSiege().isInProgress())
|
||||
{
|
||||
siegeClan = castle.getSiege().getAttackerClan(clan);
|
||||
isInCastleDefense = (siegeClan == null) && castle.getSiege().checkIsDefender(clan);
|
||||
}
|
||||
else if ((fort != null) && fort.getSiege().isInProgress())
|
||||
{
|
||||
siegeClan = fort.getSiege().getAttackerClan(clan);
|
||||
isInFortDefense = (siegeClan == null) && fort.getSiege().checkIsDefender(clan);
|
||||
}
|
||||
|
||||
_toVillage = activeChar.canRevive() && !activeChar.isPendingRevive();
|
||||
_toClanHall = (clan != null) && (clan.getHideoutId() > 0);
|
||||
_toCastle = ((clan != null) && (clan.getCastleId() > 0)) || isInCastleDefense;
|
||||
_toOutpost = ((siegeClan != null) && !isInCastleDefense && !isInFortDefense && !siegeClan.getFlag().isEmpty());
|
||||
_useFeather = activeChar.getAccessLevel().allowFixedRes();
|
||||
_toFortress = ((clan != null) && (clan.getFortId() > 0)) || isInFortDefense;
|
||||
}
|
||||
|
||||
_isSweepable = activeChar.isAttackable() && activeChar.isSweepActive();
|
||||
}
|
||||
|
||||
public void setHideAnimation(boolean val)
|
||||
{
|
||||
_hideAnimation = val;
|
||||
}
|
||||
|
||||
public void addItem(int itemId)
|
||||
{
|
||||
if (_items == null)
|
||||
{
|
||||
_items = new ArrayList<>(8);
|
||||
}
|
||||
|
||||
if (_items.size() < 8)
|
||||
{
|
||||
_items.add(itemId);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IndexOutOfBoundsException("Die packet doesn't support more then 8 items!");
|
||||
}
|
||||
}
|
||||
|
||||
public List<Integer> getItems()
|
||||
{
|
||||
return _items != null ? _items : Collections.emptyList();
|
||||
}
|
||||
|
||||
public void setItemsEnabled(boolean val)
|
||||
{
|
||||
_itemsEnabled = val;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.DIE.writeId(packet);
|
||||
|
||||
packet.writeD(_objectId);
|
||||
packet.writeD(_toVillage ? 0x01 : 0x00);
|
||||
packet.writeD(_toClanHall ? 0x01 : 0x00);
|
||||
packet.writeD(_toCastle ? 0x01 : 0x00);
|
||||
packet.writeD(_toOutpost ? 0x01 : 0x00);
|
||||
packet.writeD(_isSweepable ? 0x01 : 0x00);
|
||||
packet.writeD(_useFeather ? 0x01 : 0x00);
|
||||
packet.writeD(_toFortress ? 0x01 : 0x00);
|
||||
packet.writeD(0x00); // Disables use Feather button for X seconds
|
||||
packet.writeD(0x00); // Adventure's Song
|
||||
packet.writeC(_hideAnimation ? 0x01 : 0x00);
|
||||
|
||||
packet.writeD(_itemsEnabled ? 0x01 : 0x00);
|
||||
packet.writeD(getItems().size());
|
||||
getItems().forEach(packet::writeD);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +1,41 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2DoorInstance;
|
||||
|
||||
public final class DoorInfo extends L2GameServerPacket
|
||||
{
|
||||
private final L2DoorInstance _door;
|
||||
|
||||
public DoorInfo(L2DoorInstance door)
|
||||
{
|
||||
_door = door;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x4c);
|
||||
writeD(_door.getObjectId());
|
||||
writeD(_door.getId());
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2DoorInstance;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public final class DoorInfo implements IClientOutgoingPacket
|
||||
{
|
||||
private final L2DoorInstance _door;
|
||||
|
||||
public DoorInfo(L2DoorInstance door)
|
||||
{
|
||||
_door = door;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.DOOR_INFO.writeId(packet);
|
||||
|
||||
packet.writeD(_door.getObjectId());
|
||||
packet.writeD(_door.getId());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,42 +1,46 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2DoorInstance;
|
||||
|
||||
public final class DoorStatusUpdate extends L2GameServerPacket
|
||||
{
|
||||
private final L2DoorInstance _door;
|
||||
|
||||
public DoorStatusUpdate(L2DoorInstance door)
|
||||
{
|
||||
_door = door;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x4d);
|
||||
writeD(_door.getObjectId());
|
||||
writeD(_door.getOpen() ? 0 : 1);
|
||||
writeD(_door.getDamage());
|
||||
writeD(_door.isEnemy() ? 1 : 0);
|
||||
writeD(_door.getId());
|
||||
writeD((int) _door.getCurrentHp());
|
||||
writeD(_door.getMaxHp());
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2DoorInstance;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public final class DoorStatusUpdate implements IClientOutgoingPacket
|
||||
{
|
||||
private final L2DoorInstance _door;
|
||||
|
||||
public DoorStatusUpdate(L2DoorInstance door)
|
||||
{
|
||||
_door = door;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.DOOR_STATUS_UPDATE.writeId(packet);
|
||||
|
||||
packet.writeD(_door.getObjectId());
|
||||
packet.writeD(_door.isOpen() ? 0 : 1);
|
||||
packet.writeD(_door.getDamage());
|
||||
packet.writeD(_door.isEnemy() ? 1 : 0);
|
||||
packet.writeD(_door.getId());
|
||||
packet.writeD((int) _door.getCurrentHp());
|
||||
packet.writeD(_door.getMaxHp());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,55 +1,59 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
|
||||
public class DropItem extends L2GameServerPacket
|
||||
{
|
||||
private final L2ItemInstance _item;
|
||||
private final int _charObjId;
|
||||
|
||||
/**
|
||||
* Constructor of the DropItem server packet
|
||||
* @param item : L2ItemInstance designating the item
|
||||
* @param playerObjId : int designating the player ID who dropped the item
|
||||
*/
|
||||
public DropItem(L2ItemInstance item, int playerObjId)
|
||||
{
|
||||
_item = item;
|
||||
_charObjId = playerObjId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x16);
|
||||
writeD(_charObjId);
|
||||
writeD(_item.getObjectId());
|
||||
writeD(_item.getDisplayId());
|
||||
|
||||
writeD(_item.getX());
|
||||
writeD(_item.getY());
|
||||
writeD(_item.getZ());
|
||||
// only show item count if it is a stackable item
|
||||
writeC(_item.isStackable() ? 0x01 : 0x00);
|
||||
writeQ(_item.getCount());
|
||||
|
||||
writeC(0x00);
|
||||
// writeD(0x01); if above C == true (1) then readD()
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class DropItem implements IClientOutgoingPacket
|
||||
{
|
||||
private final L2ItemInstance _item;
|
||||
private final int _charObjId;
|
||||
|
||||
/**
|
||||
* Constructor of the DropItem server packet
|
||||
* @param item : L2ItemInstance designating the item
|
||||
* @param playerObjId : int designating the player ID who dropped the item
|
||||
*/
|
||||
public DropItem(L2ItemInstance item, int playerObjId)
|
||||
{
|
||||
_item = item;
|
||||
_charObjId = playerObjId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.DROP_ITEM.writeId(packet);
|
||||
|
||||
packet.writeD(_charObjId);
|
||||
packet.writeD(_item.getObjectId());
|
||||
packet.writeD(_item.getDisplayId());
|
||||
|
||||
packet.writeD(_item.getX());
|
||||
packet.writeD(_item.getY());
|
||||
packet.writeD(_item.getZ());
|
||||
// only show item count if it is a stackable item
|
||||
packet.writeC(_item.isStackable() ? 0x01 : 0x00);
|
||||
packet.writeQ(_item.getCount());
|
||||
|
||||
packet.writeC(0x00);
|
||||
// packet.writeD(0x01); if above C == true (1) then packet.readD()
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,54 +1,74 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
public class Earthquake extends L2GameServerPacket
|
||||
{
|
||||
private final int _x;
|
||||
private final int _y;
|
||||
private final int _z;
|
||||
private final int _intensity;
|
||||
private final int _duration;
|
||||
|
||||
/**
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param intensity
|
||||
* @param duration
|
||||
*/
|
||||
public Earthquake(int x, int y, int z, int intensity, int duration)
|
||||
{
|
||||
_x = x;
|
||||
_y = y;
|
||||
_z = z;
|
||||
_intensity = intensity;
|
||||
_duration = duration;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0xD3);
|
||||
writeD(_x);
|
||||
writeD(_y);
|
||||
writeD(_z);
|
||||
writeD(_intensity);
|
||||
writeD(_duration);
|
||||
writeD(0x00); // Unknown
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.interfaces.ILocational;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class Earthquake implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _x;
|
||||
private final int _y;
|
||||
private final int _z;
|
||||
private final int _intensity;
|
||||
private final int _duration;
|
||||
|
||||
/**
|
||||
* @param location
|
||||
* @param intensity
|
||||
* @param duration
|
||||
*/
|
||||
public Earthquake(ILocational location, int intensity, int duration)
|
||||
{
|
||||
_x = location.getX();
|
||||
_y = location.getY();
|
||||
_z = location.getZ();
|
||||
_intensity = intensity;
|
||||
_duration = duration;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param intensity
|
||||
* @param duration
|
||||
*/
|
||||
public Earthquake(int x, int y, int z, int intensity, int duration)
|
||||
{
|
||||
_x = x;
|
||||
_y = y;
|
||||
_z = z;
|
||||
_intensity = intensity;
|
||||
_duration = duration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EARTHQUAKE.writeId(packet);
|
||||
|
||||
packet.writeD(_x);
|
||||
packet.writeD(_y);
|
||||
packet.writeD(_z);
|
||||
packet.writeD(_intensity);
|
||||
packet.writeD(_duration);
|
||||
packet.writeD(0x00); // Unknown
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,67 +1,71 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
|
||||
public class EnchantResult extends L2GameServerPacket
|
||||
{
|
||||
public static int SUCCESS = 0;
|
||||
public static int FAIL = 1;
|
||||
public static int ERROR = 2;
|
||||
public static int BLESSED_FAIL = 3;
|
||||
public static int NO_CRYSTAL = 4;
|
||||
public static int SAFE_FAIL = 5;
|
||||
private final int _result;
|
||||
private final int _crystal;
|
||||
private final int _count;
|
||||
private final int _enchantLevel;
|
||||
private final int[] _enchantOptions;
|
||||
|
||||
public EnchantResult(int result, int crystal, int count, int enchantLevel, int[] options)
|
||||
{
|
||||
_result = result;
|
||||
_crystal = crystal;
|
||||
_count = count;
|
||||
_enchantLevel = enchantLevel;
|
||||
_enchantOptions = options;
|
||||
}
|
||||
|
||||
public EnchantResult(int result, int crystal, int count)
|
||||
{
|
||||
this(result, crystal, count, 0, L2ItemInstance.DEFAULT_ENCHANT_OPTIONS);
|
||||
}
|
||||
|
||||
public EnchantResult(int result, L2ItemInstance item)
|
||||
{
|
||||
this(result, 0, 0, item.getEnchantLevel(), item.getEnchantOptions());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x87);
|
||||
writeD(_result);
|
||||
writeD(_crystal);
|
||||
writeQ(_count);
|
||||
writeD(_enchantLevel);
|
||||
for (int option : _enchantOptions)
|
||||
{
|
||||
writeD(option);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class EnchantResult implements IClientOutgoingPacket
|
||||
{
|
||||
public static int SUCCESS = 0;
|
||||
public static int FAIL = 1;
|
||||
public static int ERROR = 2;
|
||||
public static int BLESSED_FAIL = 3;
|
||||
public static int NO_CRYSTAL = 4;
|
||||
public static int SAFE_FAIL = 5;
|
||||
private final int _result;
|
||||
private final int _crystal;
|
||||
private final int _count;
|
||||
private final int _enchantLevel;
|
||||
private final int[] _enchantOptions;
|
||||
|
||||
public EnchantResult(int result, int crystal, int count, int enchantLevel, int[] options)
|
||||
{
|
||||
_result = result;
|
||||
_crystal = crystal;
|
||||
_count = count;
|
||||
_enchantLevel = enchantLevel;
|
||||
_enchantOptions = options;
|
||||
}
|
||||
|
||||
public EnchantResult(int result, int crystal, int count)
|
||||
{
|
||||
this(result, crystal, count, 0, L2ItemInstance.DEFAULT_ENCHANT_OPTIONS);
|
||||
}
|
||||
|
||||
public EnchantResult(int result, L2ItemInstance item)
|
||||
{
|
||||
this(result, 0, 0, item.getEnchantLevel(), item.getEnchantOptions());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.ENCHANT_RESULT.writeId(packet);
|
||||
|
||||
packet.writeD(_result);
|
||||
packet.writeD(_crystal);
|
||||
packet.writeQ(_count);
|
||||
packet.writeD(_enchantLevel);
|
||||
for (int option : _enchantOptions)
|
||||
{
|
||||
packet.writeH(option);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,50 +1,54 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
|
||||
/**
|
||||
* @author Luca Baldi
|
||||
*/
|
||||
public class EtcStatusUpdate extends L2GameServerPacket
|
||||
{
|
||||
private final L2PcInstance _activeChar;
|
||||
private int _mask;
|
||||
|
||||
public EtcStatusUpdate(L2PcInstance activeChar)
|
||||
{
|
||||
_activeChar = activeChar;
|
||||
_mask = _activeChar.getMessageRefusal() || _activeChar.isChatBanned() || _activeChar.isSilenceMode() ? 1 : 0;
|
||||
_mask |= _activeChar.isInsideZone(ZoneId.DANGER_AREA) ? 2 : 0;
|
||||
_mask |= _activeChar.hasCharmOfCourage() ? 4 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xF9); // several icons to a separate line (0 = disabled)
|
||||
writeC(_activeChar.getCharges()); // 1-7 increase force, lvl
|
||||
writeD(_activeChar.getWeightPenalty()); // 1-4 weight penalty, lvl (1=50%, 2=66.6%, 3=80%, 4=100%)
|
||||
writeC(_activeChar.getExpertiseWeaponPenalty()); // Weapon Grade Penalty [1-4]
|
||||
writeC(_activeChar.getExpertiseArmorPenalty()); // Armor Grade Penalty [1-4]
|
||||
writeC(0); // Death Penalty [1-15, 0 = disabled)], not used anymore in Ertheia
|
||||
writeC(_activeChar.getChargedSouls());
|
||||
writeC(_mask);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author Luca Baldi
|
||||
*/
|
||||
public class EtcStatusUpdate implements IClientOutgoingPacket
|
||||
{
|
||||
private final L2PcInstance _activeChar;
|
||||
private int _mask;
|
||||
|
||||
public EtcStatusUpdate(L2PcInstance activeChar)
|
||||
{
|
||||
_activeChar = activeChar;
|
||||
_mask = _activeChar.getMessageRefusal() || _activeChar.isChatBanned() || _activeChar.isSilenceMode() ? 1 : 0;
|
||||
_mask |= _activeChar.isInsideZone(ZoneId.DANGER_AREA) ? 2 : 0;
|
||||
_mask |= _activeChar.hasCharmOfCourage() ? 4 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.ETC_STATUS_UPDATE.writeId(packet);
|
||||
|
||||
packet.writeC(_activeChar.getCharges()); // 1-7 increase force, lvl
|
||||
packet.writeD(_activeChar.getWeightPenalty()); // 1-4 weight penalty, lvl (1=50%, 2=66.6%, 3=80%, 4=100%)
|
||||
packet.writeC(_activeChar.getExpertiseWeaponPenalty()); // Weapon Grade Penalty [1-4]
|
||||
packet.writeC(_activeChar.getExpertiseArmorPenalty()); // Armor Grade Penalty [1-4]
|
||||
packet.writeC(0); // Death Penalty [1-15, 0 = disabled)], not used anymore in Ertheia
|
||||
packet.writeC(_activeChar.getChargedSouls());
|
||||
packet.writeC(_mask);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,45 +1,50 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class Ex2ndPasswordAck extends L2GameServerPacket
|
||||
{
|
||||
private final int _status;
|
||||
private final int _response;
|
||||
|
||||
public static int SUCCESS = 0x00;
|
||||
public static int WRONG_PATTERN = 0x01;
|
||||
|
||||
public Ex2ndPasswordAck(int status, int response)
|
||||
{
|
||||
_status = status;
|
||||
_response = response;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x107);
|
||||
writeC(_status);
|
||||
writeD(_response == WRONG_PATTERN ? 0x01 : 0x00);
|
||||
writeD(0x00);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class Ex2ndPasswordAck implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _status;
|
||||
private final int _response;
|
||||
|
||||
// TODO: Enum
|
||||
public static int SUCCESS = 0x00;
|
||||
public static int WRONG_PATTERN = 0x01;
|
||||
|
||||
public Ex2ndPasswordAck(int status, int response)
|
||||
{
|
||||
_status = status;
|
||||
_response = response;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_2ND_PASSWORD_ACK.writeId(packet);
|
||||
|
||||
packet.writeC(_status);
|
||||
packet.writeD(_response == WRONG_PATTERN ? 0x01 : 0x00);
|
||||
packet.writeD(0x00);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,44 +1,48 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class Ex2ndPasswordCheck extends L2GameServerPacket
|
||||
{
|
||||
public static final int PASSWORD_NEW = 0x00;
|
||||
public static final int PASSWORD_PROMPT = 0x01;
|
||||
public static final int PASSWORD_OK = 0x02;
|
||||
|
||||
private final int _windowType;
|
||||
|
||||
public Ex2ndPasswordCheck(int windowType)
|
||||
{
|
||||
_windowType = windowType;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x105);
|
||||
|
||||
writeD(_windowType);
|
||||
writeD(0x00);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class Ex2ndPasswordCheck implements IClientOutgoingPacket
|
||||
{
|
||||
// TODO: Enum
|
||||
public static final int PASSWORD_NEW = 0x00;
|
||||
public static final int PASSWORD_PROMPT = 0x01;
|
||||
public static final int PASSWORD_OK = 0x02;
|
||||
|
||||
private final int _windowType;
|
||||
|
||||
public Ex2ndPasswordCheck(int windowType)
|
||||
{
|
||||
_windowType = windowType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_2ND_PASSWORD_CHECK.writeId(packet);
|
||||
|
||||
packet.writeD(_windowType);
|
||||
packet.writeD(0x00);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,45 +1,49 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class Ex2ndPasswordVerify extends L2GameServerPacket
|
||||
{
|
||||
public static final int PASSWORD_OK = 0x00;
|
||||
public static final int PASSWORD_WRONG = 0x01;
|
||||
public static final int PASSWORD_BAN = 0x02;
|
||||
|
||||
private final int _wrongTentatives, _mode;
|
||||
|
||||
public Ex2ndPasswordVerify(int mode, int wrongTentatives)
|
||||
{
|
||||
_mode = mode;
|
||||
_wrongTentatives = wrongTentatives;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
// writeH(0x109); GOD
|
||||
writeH(0x106);
|
||||
writeD(_mode);
|
||||
writeD(_wrongTentatives);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class Ex2ndPasswordVerify implements IClientOutgoingPacket
|
||||
{
|
||||
// TODO: Enum
|
||||
public static final int PASSWORD_OK = 0x00;
|
||||
public static final int PASSWORD_WRONG = 0x01;
|
||||
public static final int PASSWORD_BAN = 0x02;
|
||||
|
||||
private final int _wrongTentatives, _mode;
|
||||
|
||||
public Ex2ndPasswordVerify(int mode, int wrongTentatives)
|
||||
{
|
||||
_mode = mode;
|
||||
_wrongTentatives = wrongTentatives;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_2ND_PASSWORD_VERIFY.writeId(packet);
|
||||
|
||||
packet.writeD(_mode);
|
||||
packet.writeD(_wrongTentatives);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,105 +1,99 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.gameserver.datatables.SkillData;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.skills.BuffInfo;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
|
||||
public class ExAbnormalStatusUpdateFromTarget extends L2GameServerPacket
|
||||
{
|
||||
private final L2Character _character;
|
||||
private List<Effect> _effects = new ArrayList<>();
|
||||
|
||||
private static class Effect
|
||||
{
|
||||
protected int _skillId;
|
||||
protected int _level;
|
||||
protected int _maxlevel;
|
||||
protected int _duration;
|
||||
protected int _caster;
|
||||
|
||||
public Effect(BuffInfo info)
|
||||
{
|
||||
final Skill skill = info.getSkill();
|
||||
final L2Character caster = info.getEffector();
|
||||
int casterId = 0;
|
||||
if (caster != null)
|
||||
{
|
||||
casterId = caster.getObjectId();
|
||||
}
|
||||
|
||||
_skillId = skill.getDisplayId();
|
||||
_level = skill.getDisplayLevel();
|
||||
_maxlevel = SkillData.getInstance().getMaxLevel(_skillId);
|
||||
_duration = info.getTime();
|
||||
_caster = casterId;
|
||||
}
|
||||
}
|
||||
|
||||
public ExAbnormalStatusUpdateFromTarget(L2Character character)
|
||||
{
|
||||
_character = character;
|
||||
_effects = new ArrayList<>();
|
||||
|
||||
for (BuffInfo info : character.getEffectList().getEffects())
|
||||
{
|
||||
if ((info != null) && info.isInUse())
|
||||
{
|
||||
final Skill skill = info.getSkill();
|
||||
|
||||
// TODO: Check on retail if all effects should be displayed
|
||||
if (skill != null)
|
||||
{
|
||||
_effects.add(new Effect(info));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0xE6);
|
||||
|
||||
writeD(_character.getObjectId());
|
||||
writeH(_effects.size());
|
||||
|
||||
for (Effect info : _effects)
|
||||
{
|
||||
writeD(info._skillId);
|
||||
if (info._level < 100)
|
||||
{
|
||||
writeH(info._level);
|
||||
writeH(0x00);
|
||||
}
|
||||
else
|
||||
{
|
||||
writeH(info._maxlevel);
|
||||
writeH(info._level);
|
||||
}
|
||||
writeH(0x00); // Combo abnormal ?
|
||||
writeH(info._duration);
|
||||
writeD(info._caster);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.skills.BuffInfo;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class ExAbnormalStatusUpdateFromTarget implements IClientOutgoingPacket
|
||||
{
|
||||
private final L2Character _character;
|
||||
private List<Effect> _effects = new ArrayList<>();
|
||||
|
||||
private static class Effect
|
||||
{
|
||||
protected int _skillId;
|
||||
protected int _level;
|
||||
protected int _subLevel;
|
||||
protected int _abnormalType;
|
||||
protected int _duration;
|
||||
protected int _caster;
|
||||
|
||||
public Effect(BuffInfo info)
|
||||
{
|
||||
final Skill skill = info.getSkill();
|
||||
final L2Character caster = info.getEffector();
|
||||
int casterId = 0;
|
||||
if (caster != null)
|
||||
{
|
||||
casterId = caster.getObjectId();
|
||||
}
|
||||
|
||||
_skillId = skill.getDisplayId();
|
||||
_level = skill.getDisplayLevel();
|
||||
_abnormalType = skill.getAbnormalType().getClientId();
|
||||
_duration = skill.isAura() ? -1 : info.getTime();
|
||||
_caster = casterId;
|
||||
}
|
||||
}
|
||||
|
||||
public ExAbnormalStatusUpdateFromTarget(L2Character character)
|
||||
{
|
||||
_character = character;
|
||||
_effects = new ArrayList<>();
|
||||
|
||||
for (BuffInfo info : character.getEffectList().getEffects())
|
||||
{
|
||||
if ((info != null) && info.isInUse())
|
||||
{
|
||||
final Skill skill = info.getSkill();
|
||||
|
||||
// TODO: Check on retail if all effects should be displayed
|
||||
if (skill != null)
|
||||
{
|
||||
_effects.add(new Effect(info));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_ABNORMAL_STATUS_UPDATE_FROM_TARGET.writeId(packet);
|
||||
|
||||
packet.writeD(_character.getObjectId());
|
||||
packet.writeH(_effects.size());
|
||||
|
||||
for (Effect info : _effects)
|
||||
{
|
||||
packet.writeD(info._skillId);
|
||||
packet.writeH(info._level);
|
||||
packet.writeH(info._subLevel);
|
||||
packet.writeH(info._abnormalType);
|
||||
writeOptionalD(packet, info._duration);
|
||||
packet.writeD(info._caster);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,59 +1,62 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.gameserver.model.L2SkillLearn;
|
||||
import com.l2jmobius.gameserver.model.base.AcquireSkillType;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class ExAcquirableSkillListByClass extends L2GameServerPacket
|
||||
{
|
||||
final List<L2SkillLearn> _learnable;
|
||||
final AcquireSkillType _type;
|
||||
|
||||
public ExAcquirableSkillListByClass(List<L2SkillLearn> learnable, AcquireSkillType type)
|
||||
{
|
||||
_learnable = learnable;
|
||||
_type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0xFA);
|
||||
writeH(_type.getId());
|
||||
writeH(_learnable.size());
|
||||
for (L2SkillLearn skill : _learnable)
|
||||
{
|
||||
writeD(skill.getSkillId());
|
||||
writeH(skill.getSkillLevel());
|
||||
writeH(skill.getSkillLevel());
|
||||
writeC(skill.getGetLevel());
|
||||
writeQ(skill.getLevelUpSp());
|
||||
writeC(skill.getRequiredItems().size());
|
||||
if (_type == AcquireSkillType.SUBPLEDGE)
|
||||
{
|
||||
writeH(0x00);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.L2SkillLearn;
|
||||
import com.l2jmobius.gameserver.model.base.AcquireSkillType;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class ExAcquirableSkillListByClass implements IClientOutgoingPacket
|
||||
{
|
||||
final List<L2SkillLearn> _learnable;
|
||||
final AcquireSkillType _type;
|
||||
|
||||
public ExAcquirableSkillListByClass(List<L2SkillLearn> learnable, AcquireSkillType type)
|
||||
{
|
||||
_learnable = learnable;
|
||||
_type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_ACQUIRABLE_SKILL_LIST_BY_CLASS.writeId(packet);
|
||||
|
||||
packet.writeH(_type.getId());
|
||||
packet.writeH(_learnable.size());
|
||||
for (L2SkillLearn skill : _learnable)
|
||||
{
|
||||
packet.writeD(skill.getSkillId());
|
||||
packet.writeH(skill.getSkillLevel());
|
||||
packet.writeH(skill.getSkillLevel());
|
||||
packet.writeC(skill.getGetLevel());
|
||||
packet.writeQ(skill.getLevelUpSp());
|
||||
packet.writeC(skill.getRequiredItems().size());
|
||||
if (_type == AcquireSkillType.SUBPLEDGE)
|
||||
{
|
||||
packet.writeH(0x00);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,82 +1,86 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.l2jmobius.gameserver.model.L2SkillLearn;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class ExAcquireSkillInfo extends L2GameServerPacket
|
||||
{
|
||||
private final int _id;
|
||||
private final int _level;
|
||||
private final int _spCost;
|
||||
private final int _minLevel;
|
||||
private final List<ItemHolder> _itemReq;
|
||||
private final List<Skill> _skillRem;
|
||||
|
||||
/**
|
||||
* Special constructor for Alternate Skill Learning system.<br>
|
||||
* Sets a custom amount of SP.
|
||||
* @param player
|
||||
* @param skillLearn the skill learn.
|
||||
* @param sp the custom SP amount.
|
||||
*/
|
||||
public ExAcquireSkillInfo(L2PcInstance player, L2SkillLearn skillLearn, int sp)
|
||||
{
|
||||
_id = skillLearn.getSkillId();
|
||||
_level = skillLearn.getSkillLevel();
|
||||
_spCost = sp;
|
||||
_minLevel = skillLearn.getGetLevel();
|
||||
_itemReq = skillLearn.getRequiredItems();
|
||||
_skillRem = skillLearn.getRemoveSkills().stream().map(player::getKnownSkill).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0xFC);
|
||||
|
||||
writeD(_id);
|
||||
writeD(_level);
|
||||
writeQ(_spCost);
|
||||
writeH(_minLevel);
|
||||
writeH(0x00); // Dual Class Level Required
|
||||
writeD(_itemReq.size());
|
||||
for (ItemHolder holder : _itemReq)
|
||||
{
|
||||
writeD(holder.getId());
|
||||
writeQ(holder.getCount());
|
||||
}
|
||||
|
||||
writeD(_skillRem.size());
|
||||
for (Skill skill : _skillRem)
|
||||
{
|
||||
writeD(skill.getId());
|
||||
writeD(skill.getLevel());
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.L2SkillLearn;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class ExAcquireSkillInfo implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _id;
|
||||
private final int _level;
|
||||
private final int _dualClassLevel;
|
||||
private final int _spCost;
|
||||
private final int _minLevel;
|
||||
private final List<ItemHolder> _itemReq;
|
||||
private final List<Skill> _skillRem;
|
||||
|
||||
/**
|
||||
* Special constructor for Alternate Skill Learning system.<br>
|
||||
* Sets a custom amount of SP.
|
||||
* @param player
|
||||
* @param skillLearn the skill learn.
|
||||
* @param sp the custom SP amount.
|
||||
*/
|
||||
public ExAcquireSkillInfo(L2PcInstance player, L2SkillLearn skillLearn, int sp)
|
||||
{
|
||||
_id = skillLearn.getSkillId();
|
||||
_level = skillLearn.getSkillLevel();
|
||||
_dualClassLevel = skillLearn.getDualClassLevel();
|
||||
_spCost = sp;
|
||||
_minLevel = skillLearn.getGetLevel();
|
||||
_itemReq = skillLearn.getRequiredItems();
|
||||
_skillRem = skillLearn.getRemoveSkills().stream().map(player::getKnownSkill).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_ACQUIRE_SKILL_INFO.writeId(packet);
|
||||
|
||||
packet.writeD(_id);
|
||||
packet.writeD(_level);
|
||||
packet.writeQ(_spCost);
|
||||
packet.writeH(_minLevel);
|
||||
packet.writeH(_dualClassLevel);
|
||||
packet.writeD(_itemReq.size());
|
||||
for (ItemHolder holder : _itemReq)
|
||||
{
|
||||
packet.writeD(holder.getId());
|
||||
packet.writeQ(holder.getCount());
|
||||
}
|
||||
|
||||
packet.writeD(_skillRem.size());
|
||||
for (Skill skill : _skillRem)
|
||||
{
|
||||
packet.writeD(skill.getId());
|
||||
packet.writeD(skill.getLevel());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,42 +1,44 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public class ExAdenaInvenCount extends L2GameServerPacket
|
||||
{
|
||||
private final L2PcInstance _activeChar;
|
||||
|
||||
public ExAdenaInvenCount(L2PcInstance cha)
|
||||
{
|
||||
_activeChar = cha;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x13E);
|
||||
|
||||
writeQ(_activeChar.getAdena());
|
||||
writeH(_activeChar.getInventory().getSize());
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public class ExAdenaInvenCount implements IClientOutgoingPacket
|
||||
{
|
||||
private final L2PcInstance _activeChar;
|
||||
|
||||
public ExAdenaInvenCount(L2PcInstance cha)
|
||||
{
|
||||
_activeChar = cha;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_ADENA_INVEN_COUNT.writeId(packet);
|
||||
|
||||
packet.writeQ(_activeChar.getAdena());
|
||||
packet.writeH(_activeChar.getInventory().getSize());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,79 +1,81 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2AirShipInstance;
|
||||
|
||||
public class ExAirShipInfo extends L2GameServerPacket
|
||||
{
|
||||
// store some parameters, because they can be changed during broadcast
|
||||
private final L2AirShipInstance _ship;
|
||||
private final int _x, _y, _z, _heading, _moveSpeed, _rotationSpeed, _captain, _helm;
|
||||
|
||||
public ExAirShipInfo(L2AirShipInstance ship)
|
||||
{
|
||||
_ship = ship;
|
||||
_x = ship.getX();
|
||||
_y = ship.getY();
|
||||
_z = ship.getZ();
|
||||
_heading = ship.getHeading();
|
||||
_moveSpeed = (int) ship.getStat().getMoveSpeed();
|
||||
_rotationSpeed = (int) ship.getStat().getRotationSpeed();
|
||||
_captain = ship.getCaptainId();
|
||||
_helm = ship.getHelmObjectId();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x61);
|
||||
|
||||
writeD(_ship.getObjectId());
|
||||
writeD(_x);
|
||||
writeD(_y);
|
||||
writeD(_z);
|
||||
writeD(_heading);
|
||||
|
||||
writeD(_captain);
|
||||
writeD(_moveSpeed);
|
||||
writeD(_rotationSpeed);
|
||||
writeD(_helm);
|
||||
if (_helm != 0)
|
||||
{
|
||||
// TODO: unhardcode these!
|
||||
writeD(0x16e); // Controller X
|
||||
writeD(0x00); // Controller Y
|
||||
writeD(0x6b); // Controller Z
|
||||
writeD(0x15c); // Captain X
|
||||
writeD(0x00); // Captain Y
|
||||
writeD(0x69); // Captain Z
|
||||
}
|
||||
else
|
||||
{
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
}
|
||||
|
||||
writeD(_ship.getFuel());
|
||||
writeD(_ship.getMaxFuel());
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2AirShipInstance;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class ExAirShipInfo implements IClientOutgoingPacket
|
||||
{
|
||||
// store some parameters, because they can be changed during broadcast
|
||||
private final L2AirShipInstance _ship;
|
||||
private final int _x, _y, _z, _heading, _moveSpeed, _rotationSpeed, _captain, _helm;
|
||||
|
||||
public ExAirShipInfo(L2AirShipInstance ship)
|
||||
{
|
||||
_ship = ship;
|
||||
_x = ship.getX();
|
||||
_y = ship.getY();
|
||||
_z = ship.getZ();
|
||||
_heading = ship.getHeading();
|
||||
_moveSpeed = (int) ship.getStat().getMoveSpeed();
|
||||
_rotationSpeed = (int) ship.getStat().getRotationSpeed();
|
||||
_captain = ship.getCaptainId();
|
||||
_helm = ship.getHelmObjectId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_AIR_SHIP_INFO.writeId(packet);
|
||||
|
||||
packet.writeD(_ship.getObjectId());
|
||||
packet.writeD(_x);
|
||||
packet.writeD(_y);
|
||||
packet.writeD(_z);
|
||||
packet.writeD(_heading);
|
||||
|
||||
packet.writeD(_captain);
|
||||
packet.writeD(_moveSpeed);
|
||||
packet.writeD(_rotationSpeed);
|
||||
packet.writeD(_helm);
|
||||
if (_helm != 0)
|
||||
{
|
||||
// TODO: unhardcode these!
|
||||
packet.writeD(0x16e); // Controller X
|
||||
packet.writeD(0x00); // Controller Y
|
||||
packet.writeD(0x6b); // Controller Z
|
||||
packet.writeD(0x15c); // Captain X
|
||||
packet.writeD(0x00); // Captain Y
|
||||
packet.writeD(0x69); // Captain Z
|
||||
}
|
||||
else
|
||||
{
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(0x00);
|
||||
packet.writeD(0x00);
|
||||
}
|
||||
|
||||
packet.writeD(_ship.getFuel());
|
||||
packet.writeD(_ship.getMaxFuel());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,47 +1,49 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2AirShipInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
public class ExAirShipStopMove extends L2GameServerPacket
|
||||
{
|
||||
private final int _playerId, _airShipId, _x, _y, _z;
|
||||
|
||||
public ExAirShipStopMove(L2PcInstance player, L2AirShipInstance ship, int x, int y, int z)
|
||||
{
|
||||
_playerId = player.getObjectId();
|
||||
_airShipId = ship.getObjectId();
|
||||
_x = x;
|
||||
_y = y;
|
||||
_z = z;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xfe);
|
||||
writeH(0x66);
|
||||
|
||||
writeD(_airShipId);
|
||||
writeD(_playerId);
|
||||
writeD(_x);
|
||||
writeD(_y);
|
||||
writeD(_z);
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2AirShipInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class ExAirShipStopMove implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _playerId, _airShipId, _x, _y, _z;
|
||||
|
||||
public ExAirShipStopMove(L2PcInstance player, L2AirShipInstance ship, int x, int y, int z)
|
||||
{
|
||||
_playerId = player.getObjectId();
|
||||
_airShipId = ship.getObjectId();
|
||||
_x = x;
|
||||
_y = y;
|
||||
_z = z;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_MOVE_TO_LOCATION_AIR_SHIP.writeId(packet);
|
||||
|
||||
packet.writeD(_airShipId);
|
||||
packet.writeD(_playerId);
|
||||
packet.writeD(_x);
|
||||
packet.writeD(_y);
|
||||
packet.writeD(_z);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,63 +1,63 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.VehiclePathPoint;
|
||||
|
||||
public class ExAirShipTeleportList extends L2GameServerPacket
|
||||
{
|
||||
private final int _dockId;
|
||||
private final VehiclePathPoint[][] _teleports;
|
||||
private final int[] _fuelConsumption;
|
||||
|
||||
public ExAirShipTeleportList(int dockId, VehiclePathPoint[][] teleports, int[] fuelConsumption)
|
||||
{
|
||||
_dockId = dockId;
|
||||
_teleports = teleports;
|
||||
_fuelConsumption = fuelConsumption;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x9B);
|
||||
|
||||
writeD(_dockId);
|
||||
if (_teleports != null)
|
||||
{
|
||||
writeD(_teleports.length);
|
||||
|
||||
VehiclePathPoint[] path;
|
||||
VehiclePathPoint dst;
|
||||
for (int i = 0; i < _teleports.length; i++)
|
||||
{
|
||||
writeD(i - 1);
|
||||
writeD(_fuelConsumption[i]);
|
||||
path = _teleports[i];
|
||||
dst = path[path.length - 1];
|
||||
writeD(dst.getX());
|
||||
writeD(dst.getY());
|
||||
writeD(dst.getZ());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
writeD(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.VehiclePathPoint;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class ExAirShipTeleportList implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _dockId;
|
||||
private final VehiclePathPoint[][] _teleports;
|
||||
private final int[] _fuelConsumption;
|
||||
|
||||
public ExAirShipTeleportList(int dockId, VehiclePathPoint[][] teleports, int[] fuelConsumption)
|
||||
{
|
||||
_dockId = dockId;
|
||||
_teleports = teleports;
|
||||
_fuelConsumption = fuelConsumption;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_AIR_SHIP_TELEPORT_LIST.writeId(packet);
|
||||
|
||||
packet.writeD(_dockId);
|
||||
if (_teleports != null)
|
||||
{
|
||||
packet.writeD(_teleports.length);
|
||||
|
||||
for (int i = 0; i < _teleports.length; i++)
|
||||
{
|
||||
packet.writeD(i - 1);
|
||||
packet.writeD(_fuelConsumption[i]);
|
||||
final VehiclePathPoint[] path = _teleports[i];
|
||||
final VehiclePathPoint dst = path[path.length - 1];
|
||||
packet.writeD(dst.getX());
|
||||
packet.writeD(dst.getY());
|
||||
packet.writeD(dst.getZ());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
packet.writeD(0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,61 +1,59 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets.alchemy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.L2GameServerPacket;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class ExAlchemySkillList extends L2GameServerPacket
|
||||
{
|
||||
private static final int ALCHEMY_CUBE_SKILL = 17943;
|
||||
private final List<Skill> _skills = new ArrayList<>();
|
||||
|
||||
public ExAlchemySkillList(L2PcInstance player)
|
||||
{
|
||||
for (Skill skill : player.getAllSkills())
|
||||
{
|
||||
// Make sure its alchemy skill.
|
||||
if (SkillTreesData.getInstance().getAlchemySkill(skill.getId(), skill.getLevel()) != null)
|
||||
{
|
||||
_skills.add(skill);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x174);
|
||||
writeD(_skills.size());
|
||||
for (Skill skill : _skills)
|
||||
{
|
||||
writeD(skill.getId());
|
||||
writeD(skill.getLevel());
|
||||
writeQ(0x00); // Always 0 on Naia, SP i guess?
|
||||
writeC(skill.getId() == ALCHEMY_CUBE_SKILL ? 0x00 : 0x01);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.CommonSkill;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class ExAlchemySkillList implements IClientOutgoingPacket
|
||||
{
|
||||
private final List<Skill> _skills = new ArrayList<>();
|
||||
|
||||
public ExAlchemySkillList(L2PcInstance player)
|
||||
{
|
||||
_skills.addAll(player.getAllSkills().stream().filter(s -> SkillTreesData.getInstance().isAlchemySkill(s.getId(), s.getLevel())).collect(Collectors.toList()));
|
||||
_skills.add(SkillData.getInstance().getSkill(CommonSkill.ALCHEMY_CUBE.getId(), 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_ALCHEMY_SKILL_LIST.writeId(packet);
|
||||
|
||||
packet.writeD(_skills.size());
|
||||
for (Skill skill : _skills)
|
||||
{
|
||||
packet.writeD(skill.getId());
|
||||
packet.writeD(skill.getLevel());
|
||||
packet.writeQ(0x00); // Always 0 on Naia, SP i guess?
|
||||
packet.writeC(skill.getId() == CommonSkill.ALCHEMY_CUBE.getId() ? 0 : 1); // This is type in flash, visible or not
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class ExAlterSkillRequest implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _currentSkillId;
|
||||
private final int _nextSkillId;
|
||||
private final int _alterTime;
|
||||
|
||||
public ExAlterSkillRequest(int currentSkill, int nextSkill, int alterTime)
|
||||
{
|
||||
_currentSkillId = currentSkill;
|
||||
_nextSkillId = nextSkill;
|
||||
_alterTime = alterTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_ALTER_SKILL_REQUEST.writeId(packet);
|
||||
packet.writeD(_nextSkillId);
|
||||
packet.writeD(_currentSkillId);
|
||||
packet.writeD(_alterTime);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,41 +1,45 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author JIV
|
||||
*/
|
||||
public class ExAskCoupleAction extends L2GameServerPacket
|
||||
{
|
||||
private final int _charObjId;
|
||||
private final int _actionId;
|
||||
|
||||
public ExAskCoupleAction(int charObjId, int social)
|
||||
{
|
||||
_charObjId = charObjId;
|
||||
_actionId = social;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0xBC);
|
||||
writeD(_actionId);
|
||||
writeD(_charObjId);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author JIV
|
||||
*/
|
||||
public class ExAskCoupleAction implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _charObjId;
|
||||
private final int _actionId;
|
||||
|
||||
public ExAskCoupleAction(int charObjId, int social)
|
||||
{
|
||||
_charObjId = charObjId;
|
||||
_actionId = social;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_ASK_COUPLE_ACTION.writeId(packet);
|
||||
|
||||
packet.writeD(_actionId);
|
||||
packet.writeD(_charObjId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +1,47 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* Asks the player to join a CC
|
||||
* @author chris_00
|
||||
*/
|
||||
public class ExAskJoinMPCC extends L2GameServerPacket
|
||||
{
|
||||
private final String _requestorName;
|
||||
|
||||
/**
|
||||
* @param requestorName
|
||||
*/
|
||||
public ExAskJoinMPCC(String requestorName)
|
||||
{
|
||||
_requestorName = requestorName;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x1a);
|
||||
writeS(_requestorName); // name of CCLeader
|
||||
writeD(0x00); // TODO: Find me
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* Asks the player to join a CC
|
||||
* @author chris_00
|
||||
*/
|
||||
public class ExAskJoinMPCC implements IClientOutgoingPacket
|
||||
{
|
||||
private final String _requestorName;
|
||||
|
||||
/**
|
||||
* @param requestorName
|
||||
*/
|
||||
public ExAskJoinMPCC(String requestorName)
|
||||
{
|
||||
_requestorName = requestorName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_ASK_JOIN_MPCC.writeId(packet);
|
||||
|
||||
packet.writeS(_requestorName); // name of CCLeader
|
||||
packet.writeD(0x00); // TODO: Find me
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,44 +1,46 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.PartyMatchRoomList;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
* @author KenM
|
||||
*/
|
||||
public class ExAskJoinPartyRoom extends L2GameServerPacket
|
||||
{
|
||||
private final String _charName;
|
||||
private final String _roomName;
|
||||
|
||||
public ExAskJoinPartyRoom(L2PcInstance player)
|
||||
{
|
||||
_charName = player.getName();
|
||||
_roomName = PartyMatchRoomList.getInstance().getPlayerRoom(player).getTitle();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x35);
|
||||
writeS(_charName);
|
||||
writeS(_roomName);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author KenM
|
||||
*/
|
||||
public class ExAskJoinPartyRoom implements IClientOutgoingPacket
|
||||
{
|
||||
private final String _charName;
|
||||
private final String _roomName;
|
||||
|
||||
public ExAskJoinPartyRoom(L2PcInstance player)
|
||||
{
|
||||
_charName = player.getName();
|
||||
_roomName = player.getMatchingRoom().getTitle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_ASK_JOIN_PARTY_ROOM.writeId(packet);
|
||||
|
||||
packet.writeS(_charName);
|
||||
packet.writeS(_roomName);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +1,46 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.PartyDistributionType;
|
||||
|
||||
/**
|
||||
* @author JIV
|
||||
*/
|
||||
public class ExAskModifyPartyLooting extends L2GameServerPacket
|
||||
{
|
||||
private final String _requestor;
|
||||
private final PartyDistributionType _partyDistributionType;
|
||||
|
||||
public ExAskModifyPartyLooting(String name, PartyDistributionType partyDistributionType)
|
||||
{
|
||||
_requestor = name;
|
||||
_partyDistributionType = partyDistributionType;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0xC0);
|
||||
writeS(_requestor);
|
||||
writeD(_partyDistributionType.getId());
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.enums.PartyDistributionType;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author JIV
|
||||
*/
|
||||
public class ExAskModifyPartyLooting implements IClientOutgoingPacket
|
||||
{
|
||||
private final String _requestor;
|
||||
private final PartyDistributionType _partyDistributionType;
|
||||
|
||||
public ExAskModifyPartyLooting(String name, PartyDistributionType partyDistributionType)
|
||||
{
|
||||
_requestor = name;
|
||||
_partyDistributionType = partyDistributionType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_ASK_MODIFY_PARTY_LOOTING.writeId(packet);
|
||||
|
||||
packet.writeS(_requestor);
|
||||
packet.writeD(_partyDistributionType.getId());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,54 +1,58 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
public class ExAttributeEnchantResult extends L2GameServerPacket
|
||||
{
|
||||
private final int _result;
|
||||
private final int _isWeapon;
|
||||
private final int _type;
|
||||
private final int _before;
|
||||
private final int _after;
|
||||
private final int _successCount;
|
||||
private final int _failedCount;
|
||||
|
||||
public ExAttributeEnchantResult(int result, boolean isWeapon, int type, int before, int after, int successCount, int failedCount)
|
||||
{
|
||||
_result = result;
|
||||
_isWeapon = isWeapon ? 1 : 0;
|
||||
_type = type;
|
||||
_before = before;
|
||||
_after = after;
|
||||
_successCount = successCount;
|
||||
_failedCount = failedCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x62);
|
||||
|
||||
writeD(_result);
|
||||
writeC(_isWeapon);
|
||||
writeH(_type);
|
||||
writeH(_before);
|
||||
writeH(_after);
|
||||
writeH(_successCount);
|
||||
writeH(_failedCount);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.enums.AttributeType;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class ExAttributeEnchantResult implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _result;
|
||||
private final int _isWeapon;
|
||||
private final int _type;
|
||||
private final int _before;
|
||||
private final int _after;
|
||||
private final int _successCount;
|
||||
private final int _failedCount;
|
||||
|
||||
public ExAttributeEnchantResult(int result, boolean isWeapon, AttributeType type, int before, int after, int successCount, int failedCount)
|
||||
{
|
||||
_result = result;
|
||||
_isWeapon = isWeapon ? 1 : 0;
|
||||
_type = type.getClientId();
|
||||
_before = before;
|
||||
_after = after;
|
||||
_successCount = successCount;
|
||||
_failedCount = failedCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_ATTRIBUTE_ENCHANT_RESULT.writeId(packet);
|
||||
|
||||
packet.writeD(_result);
|
||||
packet.writeC(_isWeapon);
|
||||
packet.writeH(_type);
|
||||
packet.writeH(_before);
|
||||
packet.writeH(_after);
|
||||
packet.writeH(_successCount);
|
||||
packet.writeH(_failedCount);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,49 +1,50 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class ExAutoSoulShot extends L2GameServerPacket
|
||||
{
|
||||
private final int _itemId;
|
||||
private final int _enabled;
|
||||
private final int _type; // 0 SS, 1 SPS, 2 Beast SS, 3 Beast SPS
|
||||
|
||||
/**
|
||||
* @param itemId
|
||||
* @param enabled
|
||||
* @param type
|
||||
*/
|
||||
public ExAutoSoulShot(int itemId, int enabled, int type)
|
||||
{
|
||||
_itemId = itemId;
|
||||
_enabled = enabled;
|
||||
_type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x0C);
|
||||
writeD(_itemId);
|
||||
writeD(_enabled);
|
||||
writeD(_type);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
public class ExAutoSoulShot implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _itemId;
|
||||
private final boolean _enable;
|
||||
private final int _type;
|
||||
|
||||
/**
|
||||
* @param itemId
|
||||
* @param enable
|
||||
* @param type
|
||||
*/
|
||||
public ExAutoSoulShot(int itemId, boolean enable, int type)
|
||||
{
|
||||
_itemId = itemId;
|
||||
_enable = enable;
|
||||
_type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_AUTO_SOUL_SHOT.writeId(packet);
|
||||
|
||||
packet.writeD(_itemId);
|
||||
packet.writeD(_enable ? 0x01 : 0x00);
|
||||
packet.writeD(_type);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,42 +1,46 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author JIV
|
||||
*/
|
||||
public class ExBaseAttributeCancelResult extends L2GameServerPacket
|
||||
{
|
||||
private final int _objId;
|
||||
private final byte _attribute;
|
||||
|
||||
public ExBaseAttributeCancelResult(int objId, byte attribute)
|
||||
{
|
||||
_objId = objId;
|
||||
_attribute = attribute;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x76);
|
||||
writeD(0x01); // result
|
||||
writeD(_objId);
|
||||
writeD(_attribute);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author JIV
|
||||
*/
|
||||
public class ExBaseAttributeCancelResult implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _objId;
|
||||
private final byte _attribute;
|
||||
|
||||
public ExBaseAttributeCancelResult(int objId, byte attribute)
|
||||
{
|
||||
_objId = objId;
|
||||
_attribute = attribute;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_BASE_ATTRIBUTE_CANCEL_RESULT.writeId(packet);
|
||||
|
||||
packet.writeD(0x01); // result
|
||||
packet.writeD(_objId);
|
||||
packet.writeD(_attribute);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,166 +1,170 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author KenM
|
||||
*/
|
||||
public final class ExBasicActionList extends L2GameServerPacket
|
||||
{
|
||||
//@formatter:off
|
||||
public static final int[] ACTIONS_ON_TRANSFORM =
|
||||
{
|
||||
1, 3, 4, 5,
|
||||
6, 7, 8, 9,
|
||||
11, 15, 16, 17,
|
||||
18, 19, 21, 22,
|
||||
23, 32, 36, 39,
|
||||
40, 41, 42, 43,
|
||||
44, 45, 46, 47,
|
||||
48, 50, 52, 53,
|
||||
54, 55, 56, 57,
|
||||
63, 64, 65, 70, 86,
|
||||
1000, 1001, 1003, 1004,
|
||||
1005, 1006, 1007, 1008,
|
||||
1009, 1010, 1011, 1012,
|
||||
1013, 1014, 1015, 1016,
|
||||
1017, 1018, 1019, 1020,
|
||||
1021, 1022, 1023, 1024,
|
||||
1025, 1026, 1027, 1028,
|
||||
1029, 1030, 1031, 1032,
|
||||
1033, 1034, 1035, 1036,
|
||||
1037, 1038, 1039, 1040,
|
||||
1041, 1042, 1043, 1044,
|
||||
1045, 1046, 1047, 1048,
|
||||
1049, 1050, 1051, 1052,
|
||||
1053, 1054, 1055, 1056,
|
||||
1057, 1058, 1059, 1060,
|
||||
1061, 1062, 1063, 1064,
|
||||
1065, 1066, 1067, 1068,
|
||||
1069, 1070, 1071, 1072,
|
||||
1073, 1074, 1075, 1076,
|
||||
1077, 1078, 1079, 1080,
|
||||
1081, 1082, 1083, 1084,
|
||||
1089, 1090, 1091, 1092,
|
||||
1093, 1094, 1095, 1096,
|
||||
1097, 1098, 1099, 1100,
|
||||
1101, 1102, 1103, 1104,
|
||||
1106, 1107, 1108, 1109,
|
||||
1110, 1111, 1113, 1114,
|
||||
1115, 1116, 1117, 1118,
|
||||
1120, 1121, 1124, 1125,
|
||||
1126, 1127, 1128, 1129,
|
||||
1130, 1131, 1132, 1133,
|
||||
1134, 1135, 1136, 1137,
|
||||
1138, 1139, 1140, 1141,
|
||||
1142, 1143, 1144, 1145,
|
||||
1146, 1147, 1148, 1149,
|
||||
1150, 1151, 1152, 1153,
|
||||
1154, 1155
|
||||
};
|
||||
|
||||
public static final int[] DEFAULT_ACTION_LIST =
|
||||
{
|
||||
0, 1, 2, 3, 4,
|
||||
5, 6, 7, 8, 9,
|
||||
10, 11, 12, 13,
|
||||
14, 15, 16, 17,
|
||||
18, 19, 20, 21,
|
||||
22, 23, 24, 25,
|
||||
26, 27, 28, 29,
|
||||
30, 31, 32, 33,
|
||||
34, 35, 36, 37,
|
||||
38, 39, 40, 41,
|
||||
42, 43, 44, 45,
|
||||
46, 47, 48, 49,
|
||||
50, 51, 52, 53,
|
||||
54, 55, 56, 57,
|
||||
58, 59, 60, 61,
|
||||
62, 63, 64, 65,
|
||||
66, 67, 68, 69,
|
||||
70, 71, 72, 73,
|
||||
74, 76, 77, 78,
|
||||
79, 80, 81, 82,
|
||||
83, 84, 85, 86,
|
||||
87, 88, 89, 90,
|
||||
1000, 1001, 1002, 1003,
|
||||
1004, 1005, 1006, 1007,
|
||||
1008, 1009, 1010, 1011,
|
||||
1012, 1013, 1014, 1015,
|
||||
1016, 1017, 1018, 1019,
|
||||
1020, 1021, 1022, 1023,
|
||||
1024, 1025, 1026, 1027,
|
||||
1028, 1029, 1030, 1031,
|
||||
1032, 1033, 1034, 1035,
|
||||
1036, 1037, 1038, 1039,
|
||||
1040, 1041, 1042, 1043,
|
||||
1044, 1045, 1046, 1047,
|
||||
1048, 1049, 1050, 1051,
|
||||
1052, 1053, 1054, 1055,
|
||||
1056, 1057, 1058, 1059,
|
||||
1060, 1061, 1062, 1063,
|
||||
1064, 1065, 1066, 1067,
|
||||
1068, 1069, 1070, 1071,
|
||||
1072, 1073, 1074, 1075,
|
||||
1076, 1077, 1078, 1079,
|
||||
1080, 1081, 1082, 1083,
|
||||
1084, 1086, 1087, 1088,
|
||||
1089, 1090, 1091, 1092,
|
||||
1093, 1094, 1095, 1096,
|
||||
1097, 1098, 1099, 1100,
|
||||
1101, 1102, 1103, 1104,
|
||||
1106, 1107, 1108, 1109,
|
||||
1110, 1111, 1112, 1113,
|
||||
1114, 1115, 1116, 1117,
|
||||
1118, 1119, 1120, 1121,
|
||||
1122, 1123, 1124, 1125,
|
||||
1126, 1127, 1128, 1129,
|
||||
1130, 1131, 1132, 1133,
|
||||
1134, 1135, 1136, 1137,
|
||||
1138, 1139, 1140, 1141,
|
||||
1142, 1143, 1144, 1145,
|
||||
1146, 1147, 1148, 1149,
|
||||
1150, 1151, 1152, 1153,
|
||||
1154, 1155, 5000, 5001,
|
||||
5002, 5003, 5004, 5005,
|
||||
5006, 5007, 5008, 5009,
|
||||
5010, 5011, 5012, 5013,
|
||||
5014, 5015
|
||||
};
|
||||
//@formatter:on
|
||||
|
||||
public static final ExBasicActionList STATIC_PACKET = new ExBasicActionList(DEFAULT_ACTION_LIST);
|
||||
|
||||
private final int[] _actionIds;
|
||||
|
||||
public ExBasicActionList(int[] actionIds)
|
||||
{
|
||||
_actionIds = actionIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x60);
|
||||
writeD(_actionIds.length);
|
||||
for (int _actionId : _actionIds)
|
||||
{
|
||||
writeD(_actionId);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author KenM
|
||||
*/
|
||||
public final class ExBasicActionList implements IClientOutgoingPacket
|
||||
{
|
||||
//@formatter:off
|
||||
public static final int[] ACTIONS_ON_TRANSFORM =
|
||||
{
|
||||
1, 3, 4, 5,
|
||||
6, 7, 8, 9,
|
||||
11, 15, 16, 17,
|
||||
18, 19, 21, 22,
|
||||
23, 32, 36, 39,
|
||||
40, 41, 42, 43,
|
||||
44, 45, 46, 47,
|
||||
48, 50, 52, 53,
|
||||
54, 55, 56, 57,
|
||||
63, 64, 65, 70,
|
||||
86, 1000, 1001, 1003,
|
||||
1004, 1005, 1006, 1007,
|
||||
1008, 1009, 1010, 1011,
|
||||
1012, 1013, 1014, 1015,
|
||||
1016, 1017, 1018, 1019,
|
||||
1020, 1021, 1022, 1023,
|
||||
1024, 1025, 1026, 1027,
|
||||
1028, 1029, 1030, 1031,
|
||||
1032, 1033, 1034, 1035,
|
||||
1036, 1037, 1038, 1039,
|
||||
1040, 1041, 1042, 1043,
|
||||
1044, 1045, 1046, 1047,
|
||||
1048, 1049, 1050, 1051,
|
||||
1052, 1053, 1054, 1055,
|
||||
1056, 1057, 1058, 1059,
|
||||
1060, 1061, 1062, 1063,
|
||||
1064, 1065, 1066, 1067,
|
||||
1068, 1069, 1070, 1071,
|
||||
1072, 1073, 1074, 1075,
|
||||
1076, 1077, 1078, 1079,
|
||||
1080, 1081, 1082, 1083,
|
||||
1084, 1089, 1090, 1091,
|
||||
1092, 1093, 1094, 1095,
|
||||
1096, 1097, 1098, 1099,
|
||||
1100, 1101, 1102, 1103,
|
||||
1104, 1106, 1107, 1108,
|
||||
1109, 1110, 1111, 1113,
|
||||
1114, 1115, 1116, 1117,
|
||||
1118, 1120, 1121, 1124,
|
||||
1125, 1126, 1127, 1128,
|
||||
1129, 1130, 1131, 1132,
|
||||
1133, 1134, 1135, 1136,
|
||||
1137, 1138, 1139, 1140,
|
||||
1141, 1142, 1143, 1144,
|
||||
1145, 1146, 1147, 1148,
|
||||
1149, 1150, 1151, 1152,
|
||||
1153, 1154, 1155
|
||||
};
|
||||
|
||||
public static final int[] DEFAULT_ACTION_LIST =
|
||||
{
|
||||
0, 1, 2, 3,
|
||||
4, 5, 6, 7,
|
||||
8, 9, 10, 11,
|
||||
12, 13, 14, 15,
|
||||
16, 17, 18, 19,
|
||||
20, 21, 22, 23,
|
||||
24, 25, 26, 27,
|
||||
28, 29, 30, 31,
|
||||
32, 33, 34, 35,
|
||||
36, 37, 38, 39,
|
||||
40, 41, 42, 43,
|
||||
44, 45, 46, 47,
|
||||
48, 49, 50, 51,
|
||||
52, 53, 54, 55,
|
||||
56, 57, 58, 59,
|
||||
60, 61, 62, 63,
|
||||
64, 65, 66, 67,
|
||||
68, 69, 70, 71,
|
||||
72, 73, 74, 76,
|
||||
77, 78, 79, 80,
|
||||
81, 82, 83, 84,
|
||||
85, 86, 87, 88,
|
||||
89, 90, 1000, 1001,
|
||||
1002, 1003, 1004, 1005,
|
||||
1006, 1007, 1008, 1009,
|
||||
1010, 1011, 1012, 1013,
|
||||
1014, 1015, 1016, 1017,
|
||||
1018, 1019, 1020, 1021,
|
||||
1022, 1023, 1024, 1025,
|
||||
1026, 1027, 1028, 1029,
|
||||
1030, 1031, 1032, 1033,
|
||||
1034, 1035, 1036, 1037,
|
||||
1038, 1039, 1040, 1041,
|
||||
1042, 1043, 1044, 1045,
|
||||
1046, 1047, 1048, 1049,
|
||||
1050, 1051, 1052, 1053,
|
||||
1054, 1055, 1056, 1057,
|
||||
1058, 1059, 1060, 1061,
|
||||
1062, 1063, 1064, 1065,
|
||||
1066, 1067, 1068, 1069,
|
||||
1070, 1071, 1072, 1073,
|
||||
1074, 1075, 1076, 1077,
|
||||
1078, 1079, 1080, 1081,
|
||||
1082, 1083, 1084, 1086,
|
||||
1087, 1088, 1089, 1090,
|
||||
1091, 1092, 1093, 1094,
|
||||
1095, 1096, 1097, 1098,
|
||||
1099, 1100, 1101, 1102,
|
||||
1103, 1104, 1106, 1107,
|
||||
1108, 1109, 1110, 1111,
|
||||
1112, 1113, 1114, 1115,
|
||||
1116, 1117, 1118, 1119,
|
||||
1120, 1121, 1122, 1123,
|
||||
1124, 1125, 1126, 1127,
|
||||
1128, 1129, 1130, 1131,
|
||||
1132, 1133, 1134, 1135,
|
||||
1136, 1137, 1138, 1139,
|
||||
1140, 1141, 1142, 1143,
|
||||
1144, 1145, 1146, 1147,
|
||||
1148, 1149, 1150, 1151,
|
||||
1152, 1153, 1154, 1155,
|
||||
5000, 5001, 5002, 5003,
|
||||
5004, 5005, 5006, 5007,
|
||||
5008, 5009, 5010, 5011,
|
||||
5012, 5013, 5014, 5015
|
||||
};
|
||||
//@formatter:on
|
||||
|
||||
public static final ExBasicActionList STATIC_PACKET = new ExBasicActionList(DEFAULT_ACTION_LIST);
|
||||
|
||||
private final int[] _actionIds;
|
||||
|
||||
public ExBasicActionList(int[] actionIds)
|
||||
{
|
||||
_actionIds = actionIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_BASIC_ACTION_LIST.writeId(packet);
|
||||
|
||||
packet.writeD(_actionIds.length);
|
||||
for (int _actionId : _actionIds)
|
||||
{
|
||||
packet.writeD(_actionId);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,101 +1,104 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.l2jmobius.gameserver.data.xml.impl.BeautyShopData;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.beautyshop.BeautyData;
|
||||
import com.l2jmobius.gameserver.model.beautyshop.BeautyItem;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public class ExBeautyItemList extends L2GameServerPacket
|
||||
{
|
||||
private int _colorCount;
|
||||
private final BeautyData _beautyData;
|
||||
private final Map<Integer, List<BeautyItem>> _colorData = new HashMap<>();
|
||||
private static final int HAIR_TYPE = 0;
|
||||
private static final int FACE_TYPE = 1;
|
||||
private static final int COLOR_TYPE = 2;
|
||||
|
||||
public ExBeautyItemList(L2PcInstance activeChar)
|
||||
{
|
||||
_beautyData = BeautyShopData.getInstance().getBeautyData(activeChar.getRace(), activeChar.getAppearance().getSexType());
|
||||
|
||||
for (BeautyItem hair : _beautyData.getHairList().values())
|
||||
{
|
||||
final List<BeautyItem> colors = new ArrayList<>();
|
||||
for (BeautyItem color : hair.getColors().values())
|
||||
{
|
||||
colors.add(color);
|
||||
_colorCount++;
|
||||
}
|
||||
_colorData.put(hair.getId(), colors);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x177);
|
||||
writeD(HAIR_TYPE);
|
||||
writeD(_beautyData.getHairList().size());
|
||||
for (BeautyItem hair : _beautyData.getHairList().values())
|
||||
{
|
||||
writeD(0); // ?
|
||||
writeD(hair.getId());
|
||||
writeD(hair.getAdena());
|
||||
writeD(hair.getResetAdena());
|
||||
writeD(hair.getBeautyShopTicket());
|
||||
writeD(99999999); // Limit
|
||||
}
|
||||
|
||||
writeD(FACE_TYPE);
|
||||
writeD(_beautyData.getFaceList().size());
|
||||
for (BeautyItem face : _beautyData.getFaceList().values())
|
||||
{
|
||||
writeD(0); // ?
|
||||
writeD(face.getId());
|
||||
writeD(face.getAdena());
|
||||
writeD(face.getResetAdena());
|
||||
writeD(face.getBeautyShopTicket());
|
||||
writeD(99999999); // Limit
|
||||
}
|
||||
|
||||
writeD(COLOR_TYPE);
|
||||
writeD(_colorCount);
|
||||
for (int hairId : _colorData.keySet())
|
||||
{
|
||||
for (BeautyItem color : _colorData.get(hairId))
|
||||
{
|
||||
writeD(hairId);
|
||||
writeD(color.getId());
|
||||
writeD(color.getAdena());
|
||||
writeD(color.getResetAdena());
|
||||
writeD(color.getBeautyShopTicket());
|
||||
writeD(99999999);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.BeautyShopData;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.beautyshop.BeautyData;
|
||||
import com.l2jmobius.gameserver.model.beautyshop.BeautyItem;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public class ExBeautyItemList implements IClientOutgoingPacket
|
||||
{
|
||||
private int _colorCount;
|
||||
private final BeautyData _beautyData;
|
||||
private final Map<Integer, List<BeautyItem>> _colorData = new HashMap<>();
|
||||
private static final int HAIR_TYPE = 0;
|
||||
private static final int FACE_TYPE = 1;
|
||||
private static final int COLOR_TYPE = 2;
|
||||
|
||||
public ExBeautyItemList(L2PcInstance activeChar)
|
||||
{
|
||||
_beautyData = BeautyShopData.getInstance().getBeautyData(activeChar.getRace(), activeChar.getAppearance().getSexType());
|
||||
|
||||
for (BeautyItem hair : _beautyData.getHairList().values())
|
||||
{
|
||||
final List<BeautyItem> colors = new ArrayList<>();
|
||||
for (BeautyItem color : hair.getColors().values())
|
||||
{
|
||||
colors.add(color);
|
||||
_colorCount++;
|
||||
}
|
||||
_colorData.put(hair.getId(), colors);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_BEAUTY_ITEM_LIST.writeId(packet);
|
||||
|
||||
packet.writeD(HAIR_TYPE);
|
||||
packet.writeD(_beautyData.getHairList().size());
|
||||
for (BeautyItem hair : _beautyData.getHairList().values())
|
||||
{
|
||||
packet.writeD(0); // ?
|
||||
packet.writeD(hair.getId());
|
||||
packet.writeD(hair.getAdena());
|
||||
packet.writeD(hair.getResetAdena());
|
||||
packet.writeD(hair.getBeautyShopTicket());
|
||||
packet.writeD(1); // Limit
|
||||
}
|
||||
|
||||
packet.writeD(FACE_TYPE);
|
||||
packet.writeD(_beautyData.getFaceList().size());
|
||||
for (BeautyItem face : _beautyData.getFaceList().values())
|
||||
{
|
||||
packet.writeD(0); // ?
|
||||
packet.writeD(face.getId());
|
||||
packet.writeD(face.getAdena());
|
||||
packet.writeD(face.getResetAdena());
|
||||
packet.writeD(face.getBeautyShopTicket());
|
||||
packet.writeD(1); // Limit
|
||||
}
|
||||
|
||||
packet.writeD(COLOR_TYPE);
|
||||
packet.writeD(_colorCount);
|
||||
for (int hairId : _colorData.keySet())
|
||||
{
|
||||
for (BeautyItem color : _colorData.get(hairId))
|
||||
{
|
||||
packet.writeD(hairId);
|
||||
packet.writeD(color.getId());
|
||||
packet.writeD(color.getAdena());
|
||||
packet.writeD(color.getResetAdena());
|
||||
packet.writeD(color.getBeautyShopTicket());
|
||||
packet.writeD(1);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,41 +1,40 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
* @author Gnat
|
||||
**/
|
||||
|
||||
public class ExBirthdayPopup extends L2GameServerPacket
|
||||
{
|
||||
private final L2PcInstance _activeChar;
|
||||
|
||||
public ExBirthdayPopup(L2PcInstance character)
|
||||
{
|
||||
_activeChar = character;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x90);
|
||||
writeD(_activeChar.getObjectId());
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author Gnacik
|
||||
**/
|
||||
public class ExBirthdayPopup implements IClientOutgoingPacket
|
||||
{
|
||||
public static final ExBirthdayPopup STATIC_PACKET = new ExBirthdayPopup();
|
||||
|
||||
private ExBirthdayPopup()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_NOTIFY_BIRTH_DAY.writeId(packet);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,76 +1,80 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* Special event info packet.
|
||||
* @author Kerberos
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExBrBroadcastEventState extends L2GameServerPacket
|
||||
{
|
||||
private final int _eventId;
|
||||
private final int _eventState;
|
||||
private int _param0;
|
||||
private int _param1;
|
||||
private int _param2;
|
||||
private int _param3;
|
||||
private int _param4;
|
||||
private String _param5;
|
||||
private String _param6;
|
||||
|
||||
public static final int APRIL_FOOLS = 20090401;
|
||||
public static final int EVAS_INFERNO = 20090801; // event state (0 - hide, 1 - show), day (1-14), percent (0-100)
|
||||
public static final int HALLOWEEN_EVENT = 20091031; // event state (0 - hide, 1 - show)
|
||||
public static final int RAISING_RUDOLPH = 20091225; // event state (0 - hide, 1 - show)
|
||||
public static final int LOVERS_JUBILEE = 20100214; // event state (0 - hide, 1 - show)
|
||||
|
||||
public ExBrBroadcastEventState(int eventId, int eventState)
|
||||
{
|
||||
_eventId = eventId;
|
||||
_eventState = eventState;
|
||||
}
|
||||
|
||||
public ExBrBroadcastEventState(int eventId, int eventState, int param0, int param1, int param2, int param3, int param4, String param5, String param6)
|
||||
{
|
||||
_eventId = eventId;
|
||||
_eventState = eventState;
|
||||
_param0 = param0;
|
||||
_param1 = param1;
|
||||
_param2 = param2;
|
||||
_param3 = param3;
|
||||
_param4 = param4;
|
||||
_param5 = param5;
|
||||
_param6 = param6;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0xBD);
|
||||
writeD(_eventId);
|
||||
writeD(_eventState);
|
||||
writeD(_param0);
|
||||
writeD(_param1);
|
||||
writeD(_param2);
|
||||
writeD(_param3);
|
||||
writeD(_param4);
|
||||
writeS(_param5);
|
||||
writeS(_param6);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* Special event info packet.
|
||||
* @author Kerberos
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExBrBroadcastEventState implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _eventId;
|
||||
private final int _eventState;
|
||||
private int _param0;
|
||||
private int _param1;
|
||||
private int _param2;
|
||||
private int _param3;
|
||||
private int _param4;
|
||||
private String _param5;
|
||||
private String _param6;
|
||||
|
||||
public static final int APRIL_FOOLS = 20090401;
|
||||
public static final int EVAS_INFERNO = 20090801; // event state (0 - hide, 1 - show), day (1-14), percent (0-100)
|
||||
public static final int HALLOWEEN_EVENT = 20091031; // event state (0 - hide, 1 - show)
|
||||
public static final int RAISING_RUDOLPH = 20091225; // event state (0 - hide, 1 - show)
|
||||
public static final int LOVERS_JUBILEE = 20100214; // event state (0 - hide, 1 - show)
|
||||
|
||||
public ExBrBroadcastEventState(int eventId, int eventState)
|
||||
{
|
||||
_eventId = eventId;
|
||||
_eventState = eventState;
|
||||
}
|
||||
|
||||
public ExBrBroadcastEventState(int eventId, int eventState, int param0, int param1, int param2, int param3, int param4, String param5, String param6)
|
||||
{
|
||||
_eventId = eventId;
|
||||
_eventState = eventState;
|
||||
_param0 = param0;
|
||||
_param1 = param1;
|
||||
_param2 = param2;
|
||||
_param3 = param3;
|
||||
_param4 = param4;
|
||||
_param5 = param5;
|
||||
_param6 = param6;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_BR_BROADCAST_EVENT_STATE.writeId(packet);
|
||||
|
||||
packet.writeD(_eventId);
|
||||
packet.writeD(_eventState);
|
||||
packet.writeD(_param0);
|
||||
packet.writeD(_param1);
|
||||
packet.writeD(_param2);
|
||||
packet.writeD(_param3);
|
||||
packet.writeD(_param4);
|
||||
packet.writeS(_param5);
|
||||
packet.writeS(_param6);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,50 +1,54 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* Eva's Inferno event packet. info params: <br>
|
||||
* type (1 - %, 2 - npcId), <br>
|
||||
* value (depending on type: for type 1 - % value; for type 2 - 20573-20575), <br>
|
||||
* state (0-1), endtime (only when type 2)
|
||||
*/
|
||||
public class ExBrBuffEventState extends L2GameServerPacket
|
||||
{
|
||||
private final int _type; // 1 - %, 2 - npcId
|
||||
private final int _value; // depending on type: for type 1 - % value; for type 2 - 20573-20575
|
||||
private final int _state; // 0-1
|
||||
private final int _endtime; // only when type 2 as unix time in seconds from 1970
|
||||
|
||||
public ExBrBuffEventState(int type, int value, int state, int endtime)
|
||||
{
|
||||
_type = type;
|
||||
_value = value;
|
||||
_state = state;
|
||||
_endtime = endtime;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0xDC);
|
||||
writeD(_type);
|
||||
writeD(_value);
|
||||
writeD(_state);
|
||||
writeD(_endtime);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* Eva's Inferno event packet. info params: <br>
|
||||
* type (1 - %, 2 - npcId), <br>
|
||||
* value (depending on type: for type 1 - % value; for type 2 - 20573-20575), <br>
|
||||
* state (0-1), endtime (only when type 2)
|
||||
*/
|
||||
public class ExBrBuffEventState implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _type; // 1 - %, 2 - npcId
|
||||
private final int _value; // depending on type: for type 1 - % value; for type 2 - 20573-20575
|
||||
private final int _state; // 0-1
|
||||
private final int _endtime; // only when type 2 as unix time in seconds from 1970
|
||||
|
||||
public ExBrBuffEventState(int type, int value, int state, int endtime)
|
||||
{
|
||||
_type = type;
|
||||
_value = value;
|
||||
_state = state;
|
||||
_endtime = endtime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_BR_BUFF_EVENT_STATE.writeId(packet);
|
||||
|
||||
packet.writeD(_type);
|
||||
packet.writeD(_value);
|
||||
packet.writeD(_state);
|
||||
packet.writeD(_endtime);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,50 +1,54 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* Halloween rank list server packet.
|
||||
*/
|
||||
public class ExBrLoadEventTopRankers extends L2GameServerPacket
|
||||
{
|
||||
private final int _eventId;
|
||||
private final int _day;
|
||||
private final int _count;
|
||||
private final int _bestScore;
|
||||
private final int _myScore;
|
||||
|
||||
public ExBrLoadEventTopRankers(int eventId, int day, int count, int bestScore, int myScore)
|
||||
{
|
||||
_eventId = eventId;
|
||||
_day = day;
|
||||
_count = count;
|
||||
_bestScore = bestScore;
|
||||
_myScore = myScore;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0xBE);
|
||||
writeD(_eventId);
|
||||
writeD(_day);
|
||||
writeD(_count);
|
||||
writeD(_bestScore);
|
||||
writeD(_myScore);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* Halloween rank list server packet.
|
||||
*/
|
||||
public class ExBrLoadEventTopRankers implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _eventId;
|
||||
private final int _day;
|
||||
private final int _count;
|
||||
private final int _bestScore;
|
||||
private final int _myScore;
|
||||
|
||||
public ExBrLoadEventTopRankers(int eventId, int day, int count, int bestScore, int myScore)
|
||||
{
|
||||
_eventId = eventId;
|
||||
_day = day;
|
||||
_count = count;
|
||||
_bestScore = bestScore;
|
||||
_myScore = myScore;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_BR_LOAD_EVENT_TOP_RANKERS.writeId(packet);
|
||||
|
||||
packet.writeD(_eventId);
|
||||
packet.writeD(_day);
|
||||
packet.writeD(_count);
|
||||
packet.writeD(_bestScore);
|
||||
packet.writeD(_myScore);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,41 +1,45 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author GodKratos
|
||||
*/
|
||||
public class ExBrPremiumState extends L2GameServerPacket
|
||||
{
|
||||
private final int _objId;
|
||||
private final int _state;
|
||||
|
||||
public ExBrPremiumState(int id, int state)
|
||||
{
|
||||
_objId = id;
|
||||
_state = state;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0xDA);
|
||||
writeD(_objId);
|
||||
writeC(_state);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author GodKratos
|
||||
*/
|
||||
public class ExBrPremiumState implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _objId;
|
||||
private final int _state;
|
||||
|
||||
public ExBrPremiumState(int id, int state)
|
||||
{
|
||||
_objId = id;
|
||||
_state = state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_BR_PREMIUM_STATE.writeId(packet);
|
||||
|
||||
packet.writeD(_objId);
|
||||
packet.writeC(_state);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,100 +1,93 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
|
||||
/**
|
||||
* @author ShanSoft
|
||||
*/
|
||||
public class ExBuySellList extends AbstractItemPacket
|
||||
{
|
||||
private final List<L2ItemInstance> _items = new ArrayList<>();
|
||||
private final List<L2ItemInstance> _sellList = new ArrayList<>();
|
||||
private L2ItemInstance[] _refundList = null;
|
||||
private final boolean _done;
|
||||
|
||||
public ExBuySellList(L2PcInstance player, boolean done)
|
||||
{
|
||||
for (L2ItemInstance item : player.getInventory().getItems())
|
||||
{
|
||||
if (!item.isQuestItem())
|
||||
{
|
||||
_items.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
for (L2ItemInstance item : player.getInventory().getAvailableItems(false, false, false))
|
||||
{
|
||||
if (item.isSellable())
|
||||
{
|
||||
_sellList.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
if (player.hasRefund())
|
||||
{
|
||||
_refundList = player.getRefund().getItems();
|
||||
}
|
||||
_done = done;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0xB8);
|
||||
writeD(0x01);
|
||||
writeD(_items.size());
|
||||
|
||||
if (_sellList.size() > 0)
|
||||
{
|
||||
writeH(_sellList.size());
|
||||
for (L2ItemInstance item : _sellList)
|
||||
{
|
||||
writeItem(item);
|
||||
writeQ(item.getItem().getReferencePrice() / 2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
writeH(0x00);
|
||||
}
|
||||
|
||||
if ((_refundList != null) && (_refundList.length > 0))
|
||||
{
|
||||
writeH(_refundList.length);
|
||||
int i = 0;
|
||||
for (L2ItemInstance item : _refundList)
|
||||
{
|
||||
writeItem(item);
|
||||
writeD(i++);
|
||||
writeQ((item.getItem().getReferencePrice() / 2) * item.getCount());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
writeH(0x00);
|
||||
}
|
||||
|
||||
writeC(_done ? 0x01 : 0x00);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author ShanSoft
|
||||
*/
|
||||
public class ExBuySellList extends AbstractItemPacket
|
||||
{
|
||||
private Collection<L2ItemInstance> _sellList = null;
|
||||
private Collection<L2ItemInstance> _refundList = null;
|
||||
private final boolean _done;
|
||||
private double _taxRate = 1;
|
||||
|
||||
public ExBuySellList(L2PcInstance player, boolean done)
|
||||
{
|
||||
_sellList = player.getInventory().getAvailableItems(false, false, false);
|
||||
if (player.hasRefund())
|
||||
{
|
||||
_refundList = player.getRefund().getItems();
|
||||
}
|
||||
_done = done;
|
||||
}
|
||||
|
||||
public ExBuySellList(L2PcInstance player, boolean done, double taxRate)
|
||||
{
|
||||
this(player, done);
|
||||
_taxRate = 1 - taxRate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_BUY_SELL_LIST.writeId(packet);
|
||||
|
||||
packet.writeD(0x01); // Type SELL
|
||||
packet.writeD(0x00); // TODO: inventory count
|
||||
|
||||
if ((_sellList != null))
|
||||
{
|
||||
packet.writeH(_sellList.size());
|
||||
for (L2ItemInstance item : _sellList)
|
||||
{
|
||||
writeItem(packet, item);
|
||||
packet.writeQ((long) ((item.getItem().getReferencePrice() / 2) * _taxRate));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
packet.writeH(0x00);
|
||||
}
|
||||
|
||||
if ((_refundList != null) && !_refundList.isEmpty())
|
||||
{
|
||||
packet.writeH(_refundList.size());
|
||||
int i = 0;
|
||||
for (L2ItemInstance item : _refundList)
|
||||
{
|
||||
writeItem(packet, item);
|
||||
packet.writeD(i++);
|
||||
packet.writeQ((item.getItem().getReferencePrice() / 2) * item.getCount());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
packet.writeH(0x00);
|
||||
}
|
||||
|
||||
packet.writeC(_done ? 0x01 : 0x00);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author KenM
|
||||
*/
|
||||
public class ExCaptureOrc extends L2GameServerPacket
|
||||
{
|
||||
private static final byte[] _test;
|
||||
static
|
||||
{
|
||||
// TODO: Verify the data
|
||||
//@formatter:off
|
||||
_test = new byte[]
|
||||
{
|
||||
(byte) 0xE4 ,(byte) 0xAB ,(byte) 0x8E ,(byte) 0xC5 ,(byte) 0xE9 ,(byte) 0xF9 ,(byte) 0x86 ,(byte) 0x7B,
|
||||
(byte) 0x9E ,(byte) 0x5D ,(byte) 0x83 ,(byte) 0x14 ,(byte) 0x05 ,(byte) 0xD4 ,(byte) 0x48 ,(byte) 0x01,
|
||||
(byte) 0xCD ,(byte) 0xA2 ,(byte) 0x8D ,(byte) 0x90 ,(byte) 0x62 ,(byte) 0x8C ,(byte) 0xDA ,(byte) 0x32,
|
||||
(byte) 0x7B ,(byte) 0x1B ,(byte) 0x87 ,(byte) 0x6D ,(byte) 0x08 ,(byte) 0xC4 ,(byte) 0xE1 ,(byte) 0x56,
|
||||
(byte) 0x9B ,(byte) 0x3B ,(byte) 0xC3 ,(byte) 0x40 ,(byte) 0xDF ,(byte) 0xE8 ,(byte) 0xD7 ,(byte) 0xE1,
|
||||
(byte) 0x98 ,(byte) 0x38 ,(byte) 0x1C ,(byte) 0xA5 ,(byte) 0x8E ,(byte) 0x45 ,(byte) 0x3F ,(byte) 0xF2,
|
||||
(byte) 0x5E ,(byte) 0x1C ,(byte) 0x59 ,(byte) 0x8E ,(byte) 0x74 ,(byte) 0x01 ,(byte) 0x9E ,(byte) 0xC2,
|
||||
(byte) 0x00 ,(byte) 0x95 ,(byte) 0xB0 ,(byte) 0x1D ,(byte) 0x87 ,(byte) 0xED ,(byte) 0x9C ,(byte) 0x8A
|
||||
};
|
||||
//@formatter:on
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x45);
|
||||
writeB(_test);
|
||||
}
|
||||
}
|
||||
@@ -1,44 +1,47 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.CastleSide;
|
||||
import com.l2jmobius.gameserver.model.entity.Castle;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class ExCastleState extends L2GameServerPacket
|
||||
{
|
||||
private final int _castleId;
|
||||
private final CastleSide _castleSide;
|
||||
|
||||
public ExCastleState(Castle castle)
|
||||
{
|
||||
_castleId = castle.getResidenceId();
|
||||
_castleSide = castle.getSide();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x12D);
|
||||
writeD(_castleId);
|
||||
writeD(_castleSide.ordinal());
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.enums.CastleSide;
|
||||
import com.l2jmobius.gameserver.model.entity.Castle;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class ExCastleState implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _castleId;
|
||||
private final CastleSide _castleSide;
|
||||
|
||||
public ExCastleState(Castle castle)
|
||||
{
|
||||
_castleId = castle.getResidenceId();
|
||||
_castleSide = castle.getSide();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_CASTLE_STATE.writeId(packet);
|
||||
|
||||
packet.writeD(_castleId);
|
||||
packet.writeD(_castleSide.ordinal());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author Erlandys
|
||||
*/
|
||||
public class ExChangeAttributeFail extends L2GameServerPacket
|
||||
{
|
||||
public static final ExChangeAttributeFail STATIC_PACKET = new ExChangeAttributeFail();
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x116);
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
/*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author Erlandys
|
||||
*/
|
||||
public class ExChangeAttributeInfo extends L2GameServerPacket
|
||||
{
|
||||
private final int attributeOID;
|
||||
private final int attributes;
|
||||
|
||||
public ExChangeAttributeInfo(int _attributeOID, int _attribute)
|
||||
{
|
||||
attributeOID = _attributeOID;
|
||||
switch (_attribute)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
attributes = -2;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
attributes = -3;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
attributes = -5;
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
attributes = -9;
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
attributes = -17;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
attributes = -33;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x114);
|
||||
writeD(attributeOID);
|
||||
writeD(attributes);
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
|
||||
/**
|
||||
* @author Erlandys TODO: Fix this class to Infinity Odyssey !!!
|
||||
*/
|
||||
public class ExChangeAttributeItemList extends AbstractItemPacket
|
||||
{
|
||||
private final ArrayList<L2ItemInstance> _itemsList;
|
||||
private final int _itemOID;
|
||||
|
||||
public ExChangeAttributeItemList(L2PcInstance player, int itemOID)
|
||||
{
|
||||
_itemsList = new ArrayList<>();
|
||||
for (L2ItemInstance item : player.getInventory().getItems())
|
||||
{
|
||||
if (item.isWeapon() && (item.getAttackElementPower() > 0))
|
||||
{
|
||||
_itemsList.add(item);
|
||||
}
|
||||
}
|
||||
_itemOID = itemOID;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x113);
|
||||
writeD(_itemOID);
|
||||
writeD(_itemsList.size());
|
||||
for (L2ItemInstance item : _itemsList)
|
||||
{
|
||||
writeItem(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author Erlandys
|
||||
*/
|
||||
public class ExChangeAttributeOk extends L2GameServerPacket
|
||||
{
|
||||
public static final ExChangeAttributeOk STATIC_PACKET = new ExChangeAttributeOk();
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x115);
|
||||
}
|
||||
}
|
||||
@@ -1,55 +1,59 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class ExChangeClientEffectInfo extends L2GameServerPacket
|
||||
{
|
||||
public static final ExChangeClientEffectInfo STATIC_FREYA_DEFAULT = new ExChangeClientEffectInfo(0, 0, 1);
|
||||
public static final ExChangeClientEffectInfo STATIC_FREYA_DESTROYED = new ExChangeClientEffectInfo(0, 0, 2);
|
||||
|
||||
private final int _type, _key, _value;
|
||||
|
||||
/**
|
||||
* @param type
|
||||
* <ul>
|
||||
* <li>0 - ChangeZoneState</li>
|
||||
* <li>1 - SetL2Fog</li>
|
||||
* <li>2 - postEffectData</li>
|
||||
* </ul>
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
public ExChangeClientEffectInfo(int type, int key, int value)
|
||||
{
|
||||
_type = type;
|
||||
_key = key;
|
||||
_value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0xC3);
|
||||
writeD(_type);
|
||||
writeD(_key);
|
||||
writeD(_value);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class ExChangeClientEffectInfo implements IClientOutgoingPacket
|
||||
{
|
||||
public static final ExChangeClientEffectInfo STATIC_FREYA_DEFAULT = new ExChangeClientEffectInfo(0, 0, 1);
|
||||
public static final ExChangeClientEffectInfo STATIC_FREYA_DESTROYED = new ExChangeClientEffectInfo(0, 0, 2);
|
||||
|
||||
private final int _type, _key, _value;
|
||||
|
||||
/**
|
||||
* @param type
|
||||
* <ul>
|
||||
* <li>0 - ChangeZoneState</li>
|
||||
* <li>1 - SetL2Fog</li>
|
||||
* <li>2 - postEffectData</li>
|
||||
* </ul>
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
public ExChangeClientEffectInfo(int type, int key, int value)
|
||||
{
|
||||
_type = type;
|
||||
_key = key;
|
||||
_value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_CHANGE_CLIENT_EFFECT_INFO.writeId(packet);
|
||||
|
||||
packet.writeD(_type);
|
||||
packet.writeD(_key);
|
||||
packet.writeD(_value);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,41 +1,45 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author JIV
|
||||
*/
|
||||
public class ExChangeNpcState extends L2GameServerPacket
|
||||
{
|
||||
private final int _objId;
|
||||
private final int _state;
|
||||
|
||||
public ExChangeNpcState(int objId, int state)
|
||||
{
|
||||
_objId = objId;
|
||||
_state = state;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0xBF);
|
||||
writeD(_objId);
|
||||
writeD(_state);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author JIV
|
||||
*/
|
||||
public class ExChangeNpcState implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _objId;
|
||||
private final int _state;
|
||||
|
||||
public ExChangeNpcState(int objId, int state)
|
||||
{
|
||||
_objId = objId;
|
||||
_state = state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_CHANGE_NPC_STATE.writeId(packet);
|
||||
|
||||
packet.writeD(_objId);
|
||||
packet.writeD(_state);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,58 +1,62 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author Migi
|
||||
*/
|
||||
public class ExChangePostState extends L2GameServerPacket
|
||||
{
|
||||
private final boolean _receivedBoard;
|
||||
private final int[] _changedMsgIds;
|
||||
private final int _changeId;
|
||||
|
||||
public ExChangePostState(boolean receivedBoard, int[] changedMsgIds, int changeId)
|
||||
{
|
||||
_receivedBoard = receivedBoard;
|
||||
_changedMsgIds = changedMsgIds;
|
||||
_changeId = changeId;
|
||||
}
|
||||
|
||||
public ExChangePostState(boolean receivedBoard, int changedMsgId, int changeId)
|
||||
{
|
||||
_receivedBoard = receivedBoard;
|
||||
_changedMsgIds = new int[]
|
||||
{
|
||||
changedMsgId
|
||||
};
|
||||
_changeId = changeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0xB4);
|
||||
writeD(_receivedBoard ? 1 : 0);
|
||||
writeD(_changedMsgIds.length);
|
||||
for (int postId : _changedMsgIds)
|
||||
{
|
||||
writeD(postId); // postId
|
||||
writeD(_changeId); // state
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author Migi
|
||||
*/
|
||||
public class ExChangePostState implements IClientOutgoingPacket
|
||||
{
|
||||
private final boolean _receivedBoard;
|
||||
private final int[] _changedMsgIds;
|
||||
private final int _changeId;
|
||||
|
||||
public ExChangePostState(boolean receivedBoard, int[] changedMsgIds, int changeId)
|
||||
{
|
||||
_receivedBoard = receivedBoard;
|
||||
_changedMsgIds = changedMsgIds;
|
||||
_changeId = changeId;
|
||||
}
|
||||
|
||||
public ExChangePostState(boolean receivedBoard, int changedMsgId, int changeId)
|
||||
{
|
||||
_receivedBoard = receivedBoard;
|
||||
_changedMsgIds = new int[]
|
||||
{
|
||||
changedMsgId
|
||||
};
|
||||
_changeId = changeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_CHANGE_POST_STATE.writeId(packet);
|
||||
|
||||
packet.writeD(_receivedBoard ? 1 : 0);
|
||||
packet.writeD(_changedMsgIds.length);
|
||||
for (int postId : _changedMsgIds)
|
||||
{
|
||||
packet.writeD(postId); // postId
|
||||
packet.writeD(_changeId); // state
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,39 +1,42 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public class ExChangeToAwakenedClass extends L2GameServerPacket
|
||||
{
|
||||
private final int _classId;
|
||||
|
||||
public ExChangeToAwakenedClass(int classId)
|
||||
{
|
||||
_classId = classId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0xFF);
|
||||
|
||||
writeD(_classId);
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public class ExChangeToAwakenedClass implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _classId;
|
||||
|
||||
public ExChangeToAwakenedClass(int classId)
|
||||
{
|
||||
_classId = classId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_CHANGE_TO_AWAKENED_CLASS.writeId(packet);
|
||||
|
||||
packet.writeD(_classId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,75 +1,79 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jmobius.gameserver.model.Elementals;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
|
||||
/**
|
||||
* @author Kerberos
|
||||
*/
|
||||
public class ExChooseInventoryAttributeItem extends L2GameServerPacket
|
||||
{
|
||||
private final int _itemId;
|
||||
private final long _count;
|
||||
private final byte _atribute;
|
||||
private final int _level;
|
||||
private final Set<Integer> _items = new HashSet<>();
|
||||
|
||||
public ExChooseInventoryAttributeItem(L2PcInstance activeChar, L2ItemInstance stone)
|
||||
{
|
||||
_itemId = stone.getDisplayId();
|
||||
_count = stone.getCount();
|
||||
_atribute = Elementals.getItemElement(_itemId);
|
||||
if (_atribute == Elementals.NONE)
|
||||
{
|
||||
throw new IllegalArgumentException("Undefined Atribute item: " + stone);
|
||||
}
|
||||
_level = Elementals.getMaxElementLevel(_itemId);
|
||||
|
||||
// Register only items that can be put an attribute stone/crystal
|
||||
for (L2ItemInstance item : activeChar.getInventory().getItems())
|
||||
{
|
||||
if (item.isElementable())
|
||||
{
|
||||
_items.add(item.getObjectId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x63);
|
||||
writeD(_itemId);
|
||||
writeQ(_count);
|
||||
writeD(_atribute == Elementals.FIRE ? 1 : 0); // Fire
|
||||
writeD(_atribute == Elementals.WATER ? 1 : 0); // Water
|
||||
writeD(_atribute == Elementals.WIND ? 1 : 0); // Wind
|
||||
writeD(_atribute == Elementals.EARTH ? 1 : 0); // Earth
|
||||
writeD(_atribute == Elementals.HOLY ? 1 : 0); // Holy
|
||||
writeD(_atribute == Elementals.DARK ? 1 : 0); // Unholy
|
||||
writeD(_level); // Item max attribute level
|
||||
writeD(_items.size());
|
||||
_items.forEach(this::writeD);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.enums.AttributeType;
|
||||
import com.l2jmobius.gameserver.model.Elementals;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author Kerberos
|
||||
*/
|
||||
public class ExChooseInventoryAttributeItem implements IClientOutgoingPacket
|
||||
{
|
||||
private final int _itemId;
|
||||
private final long _count;
|
||||
private final AttributeType _atribute;
|
||||
private final int _level;
|
||||
private final Set<Integer> _items = new HashSet<>();
|
||||
|
||||
public ExChooseInventoryAttributeItem(L2PcInstance activeChar, L2ItemInstance stone)
|
||||
{
|
||||
_itemId = stone.getDisplayId();
|
||||
_count = stone.getCount();
|
||||
_atribute = AttributeType.findByClientId(Elementals.getItemElement(_itemId));
|
||||
if ((_atribute == AttributeType.NONE) || (_atribute == AttributeType.NONE_ARMOR))
|
||||
{
|
||||
throw new IllegalArgumentException("Undefined Atribute item: " + stone);
|
||||
}
|
||||
_level = Elementals.getMaxElementLevel(_itemId);
|
||||
|
||||
// Register only items that can be put an attribute stone/crystal
|
||||
for (L2ItemInstance item : activeChar.getInventory().getItems())
|
||||
{
|
||||
if (item.isElementable())
|
||||
{
|
||||
_items.add(item.getObjectId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_CHOOSE_INVENTORY_ATTRIBUTE_ITEM.writeId(packet);
|
||||
|
||||
packet.writeD(_itemId);
|
||||
packet.writeQ(_count);
|
||||
packet.writeD(_atribute == AttributeType.FIRE ? 1 : 0); // Fire
|
||||
packet.writeD(_atribute == AttributeType.WATER ? 1 : 0); // Water
|
||||
packet.writeD(_atribute == AttributeType.WIND ? 1 : 0); // Wind
|
||||
packet.writeD(_atribute == AttributeType.EARTH ? 1 : 0); // Earth
|
||||
packet.writeD(_atribute == AttributeType.HOLY ? 1 : 0); // Holy
|
||||
packet.writeD(_atribute == AttributeType.DARK ? 1 : 0); // Unholy
|
||||
packet.writeD(_level); // Item max attribute level
|
||||
packet.writeD(_items.size());
|
||||
_items.forEach(packet::writeD);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,41 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* Close the CommandChannel Information window
|
||||
* @author chris_00
|
||||
*/
|
||||
public class ExCloseMPCC extends L2GameServerPacket
|
||||
{
|
||||
public ExCloseMPCC()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xfe);
|
||||
writeH(0x13);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* Close the CommandChannel Information window
|
||||
* @author chris_00
|
||||
*/
|
||||
public class ExCloseMPCC implements IClientOutgoingPacket
|
||||
{
|
||||
public static final ExCloseMPCC STATIC_PACKET = new ExCloseMPCC();
|
||||
|
||||
private ExCloseMPCC()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_CLOSE_MPCC.writeId(packet);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,34 +1,40 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author Gnacik
|
||||
*/
|
||||
public class ExClosePartyRoom extends L2GameServerPacket
|
||||
{
|
||||
public ExClosePartyRoom()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xfe);
|
||||
writeH(0x09);
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author Gnacik
|
||||
*/
|
||||
public class ExClosePartyRoom implements IClientOutgoingPacket
|
||||
{
|
||||
public static final ExClosePartyRoom STATIC_PACKET = new ExClosePartyRoom();
|
||||
|
||||
private ExClosePartyRoom()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_CLOSE_PARTY_ROOM.writeId(packet);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,41 +1,45 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author mrTJO & UnAfraid
|
||||
*/
|
||||
public class ExConfirmAddingContact extends L2GameServerPacket
|
||||
{
|
||||
private final String _charName;
|
||||
private final boolean _added;
|
||||
|
||||
public ExConfirmAddingContact(String charName, boolean added)
|
||||
{
|
||||
_charName = charName;
|
||||
_added = added;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0xD3);
|
||||
writeS(_charName);
|
||||
writeD(_added ? 0x01 : 0x00);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author mrTJO & UnAfraid
|
||||
*/
|
||||
public class ExConfirmAddingContact implements IClientOutgoingPacket
|
||||
{
|
||||
private final String _charName;
|
||||
private final boolean _added;
|
||||
|
||||
public ExConfirmAddingContact(String charName, boolean added)
|
||||
{
|
||||
_charName = charName;
|
||||
_added = added;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_AGIT_AUCTION_CMD.writeId(packet);
|
||||
|
||||
packet.writeS(_charName);
|
||||
packet.writeD(_added ? 0x01 : 0x00);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,44 +1,40 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class ExFishingEnd extends L2GameServerPacket
|
||||
{
|
||||
private final int _win;
|
||||
private final L2Character _activeChar;
|
||||
|
||||
public ExFishingEnd(int win, L2PcInstance character)
|
||||
{
|
||||
_win = win;
|
||||
_activeChar = character;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x1F);
|
||||
writeD(_activeChar.getObjectId());
|
||||
writeC(_win); // lose 0 - win 1 - quit 2
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public class ExConnectedTimeAndGettableReward implements IClientOutgoingPacket
|
||||
{
|
||||
public static final ExConnectedTimeAndGettableReward STATIC_PACKET = new ExConnectedTimeAndGettableReward();
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_CONNECTED_TIME_AND_GETTABLE_REWARD.writeId(packet);
|
||||
for (int i = 0; i < 16; i++) // TODO : Find what the hell it is
|
||||
{
|
||||
packet.writeD(0x00);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,53 +1,56 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExCubeGameAddPlayer extends L2GameServerPacket
|
||||
{
|
||||
L2PcInstance _player;
|
||||
boolean _isRedTeam;
|
||||
|
||||
/**
|
||||
* Add Player To Minigame Waiting List
|
||||
* @param player Player Instance
|
||||
* @param isRedTeam Is Player from Red Team?
|
||||
*/
|
||||
public ExCubeGameAddPlayer(L2PcInstance player, boolean isRedTeam)
|
||||
{
|
||||
_player = player;
|
||||
_isRedTeam = isRedTeam;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x98);
|
||||
writeD(0x01);
|
||||
|
||||
writeD(0xffffffff);
|
||||
|
||||
writeD(_isRedTeam ? 0x01 : 0x00);
|
||||
writeD(_player.getObjectId());
|
||||
writeS(_player.getName());
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExCubeGameAddPlayer implements IClientOutgoingPacket
|
||||
{
|
||||
L2PcInstance _player;
|
||||
boolean _isRedTeam;
|
||||
|
||||
/**
|
||||
* Add Player To Minigame Waiting List
|
||||
* @param player Player Instance
|
||||
* @param isRedTeam Is Player from Red Team?
|
||||
*/
|
||||
public ExCubeGameAddPlayer(L2PcInstance player, boolean isRedTeam)
|
||||
{
|
||||
_player = player;
|
||||
_isRedTeam = isRedTeam;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet);
|
||||
|
||||
packet.writeD(0x01);
|
||||
|
||||
packet.writeD(0xffffffff);
|
||||
|
||||
packet.writeD(_isRedTeam ? 0x01 : 0x00);
|
||||
packet.writeD(_player.getObjectId());
|
||||
packet.writeS(_player.getName());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,52 +1,56 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExCubeGameChangePoints extends L2GameServerPacket
|
||||
{
|
||||
int _timeLeft;
|
||||
int _bluePoints;
|
||||
int _redPoints;
|
||||
|
||||
/**
|
||||
* Change Client Point Counter
|
||||
* @param timeLeft Time Left before Minigame's End
|
||||
* @param bluePoints Current Blue Team Points
|
||||
* @param redPoints Current Red Team Points
|
||||
*/
|
||||
public ExCubeGameChangePoints(int timeLeft, int bluePoints, int redPoints)
|
||||
{
|
||||
_timeLeft = timeLeft;
|
||||
_bluePoints = bluePoints;
|
||||
_redPoints = redPoints;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x99);
|
||||
writeD(0x02);
|
||||
|
||||
writeD(_timeLeft);
|
||||
writeD(_bluePoints);
|
||||
writeD(_redPoints);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExCubeGameChangePoints implements IClientOutgoingPacket
|
||||
{
|
||||
int _timeLeft;
|
||||
int _bluePoints;
|
||||
int _redPoints;
|
||||
|
||||
/**
|
||||
* Change Client Point Counter
|
||||
* @param timeLeft Time Left before Minigame's End
|
||||
* @param bluePoints Current Blue Team Points
|
||||
* @param redPoints Current Red Team Points
|
||||
*/
|
||||
public ExCubeGameChangePoints(int timeLeft, int bluePoints, int redPoints)
|
||||
{
|
||||
_timeLeft = timeLeft;
|
||||
_bluePoints = bluePoints;
|
||||
_redPoints = redPoints;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_BLOCK_UP_SET_STATE.writeId(packet);
|
||||
|
||||
packet.writeD(0x02);
|
||||
|
||||
packet.writeD(_timeLeft);
|
||||
packet.writeD(_bluePoints);
|
||||
packet.writeD(_redPoints);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,51 +1,54 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExCubeGameChangeTeam extends L2GameServerPacket
|
||||
{
|
||||
L2PcInstance _player;
|
||||
boolean _fromRedTeam;
|
||||
|
||||
/**
|
||||
* Move Player from Team x to Team y
|
||||
* @param player Player Instance
|
||||
* @param fromRedTeam Is Player from Red Team?
|
||||
*/
|
||||
public ExCubeGameChangeTeam(L2PcInstance player, boolean fromRedTeam)
|
||||
{
|
||||
_player = player;
|
||||
_fromRedTeam = fromRedTeam;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x98);
|
||||
writeD(0x05);
|
||||
|
||||
writeD(_player.getObjectId());
|
||||
writeD(_fromRedTeam ? 0x01 : 0x00);
|
||||
writeD(_fromRedTeam ? 0x00 : 0x01);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExCubeGameChangeTeam implements IClientOutgoingPacket
|
||||
{
|
||||
L2PcInstance _player;
|
||||
boolean _fromRedTeam;
|
||||
|
||||
/**
|
||||
* Move Player from Team x to Team y
|
||||
* @param player Player Instance
|
||||
* @param fromRedTeam Is Player from Red Team?
|
||||
*/
|
||||
public ExCubeGameChangeTeam(L2PcInstance player, boolean fromRedTeam)
|
||||
{
|
||||
_player = player;
|
||||
_fromRedTeam = fromRedTeam;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet);
|
||||
|
||||
packet.writeD(0x05);
|
||||
|
||||
packet.writeD(_player.getObjectId());
|
||||
packet.writeD(_fromRedTeam ? 0x01 : 0x00);
|
||||
packet.writeD(_fromRedTeam ? 0x00 : 0x01);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,44 +1,48 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExCubeGameChangeTimeToStart extends L2GameServerPacket
|
||||
{
|
||||
int _seconds;
|
||||
|
||||
/**
|
||||
* Update Minigame Waiting List Time to Start
|
||||
* @param seconds
|
||||
*/
|
||||
public ExCubeGameChangeTimeToStart(int seconds)
|
||||
{
|
||||
_seconds = seconds;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x98);
|
||||
writeD(0x03);
|
||||
|
||||
writeD(_seconds);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExCubeGameChangeTimeToStart implements IClientOutgoingPacket
|
||||
{
|
||||
int _seconds;
|
||||
|
||||
/**
|
||||
* Update Minigame Waiting List Time to Start
|
||||
* @param seconds
|
||||
*/
|
||||
public ExCubeGameChangeTimeToStart(int seconds)
|
||||
{
|
||||
_seconds = seconds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet);
|
||||
|
||||
packet.writeD(0x03);
|
||||
|
||||
packet.writeD(_seconds);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,38 +1,42 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExCubeGameCloseUI extends L2GameServerPacket
|
||||
{
|
||||
/**
|
||||
* Close Minigame Waiting List
|
||||
*/
|
||||
public ExCubeGameCloseUI()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x98);
|
||||
writeD(0xffffffff);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* Close Minigame Waiting List
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExCubeGameCloseUI implements IClientOutgoingPacket
|
||||
{
|
||||
public static final ExCubeGameCloseUI STATIC_PACKET = new ExCubeGameCloseUI();
|
||||
|
||||
private ExCubeGameCloseUI()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet);
|
||||
|
||||
packet.writeD(0xffffffff);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,46 +1,50 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* *
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExCubeGameEnd extends L2GameServerPacket
|
||||
{
|
||||
boolean _isRedTeamWin;
|
||||
|
||||
/**
|
||||
* Show Minigame Results
|
||||
* @param isRedTeamWin Is Red Team Winner?
|
||||
*/
|
||||
public ExCubeGameEnd(boolean isRedTeamWin)
|
||||
{
|
||||
_isRedTeamWin = isRedTeamWin;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x99);
|
||||
writeD(0x01);
|
||||
|
||||
writeD(_isRedTeamWin ? 0x01 : 0x00);
|
||||
writeD(0x00); // TODO: Find me!
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* *
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExCubeGameEnd implements IClientOutgoingPacket
|
||||
{
|
||||
boolean _isRedTeamWin;
|
||||
|
||||
/**
|
||||
* Show Minigame Results
|
||||
* @param isRedTeamWin Is Red Team Winner?
|
||||
*/
|
||||
public ExCubeGameEnd(boolean isRedTeamWin)
|
||||
{
|
||||
_isRedTeamWin = isRedTeamWin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_BLOCK_UP_SET_STATE.writeId(packet);
|
||||
|
||||
packet.writeD(0x01);
|
||||
|
||||
packet.writeD(_isRedTeamWin ? 0x01 : 0x00);
|
||||
packet.writeD(0x00); // TODO: Find me!
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,67 +1,70 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExCubeGameExtendedChangePoints extends L2GameServerPacket
|
||||
{
|
||||
int _timeLeft;
|
||||
int _bluePoints;
|
||||
int _redPoints;
|
||||
boolean _isRedTeam;
|
||||
L2PcInstance _player;
|
||||
int _playerPoints;
|
||||
|
||||
/**
|
||||
* Update a Secret Point Counter (used by client when receive ExCubeGameEnd)
|
||||
* @param timeLeft Time Left before Minigame's End
|
||||
* @param bluePoints Current Blue Team Points
|
||||
* @param redPoints Current Blue Team points
|
||||
* @param isRedTeam Is Player from Red Team?
|
||||
* @param player Player Instance
|
||||
* @param playerPoints Current Player Points
|
||||
*/
|
||||
public ExCubeGameExtendedChangePoints(int timeLeft, int bluePoints, int redPoints, boolean isRedTeam, L2PcInstance player, int playerPoints)
|
||||
{
|
||||
_timeLeft = timeLeft;
|
||||
_bluePoints = bluePoints;
|
||||
_redPoints = redPoints;
|
||||
_isRedTeam = isRedTeam;
|
||||
_player = player;
|
||||
_playerPoints = playerPoints;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x99);
|
||||
writeD(0x00);
|
||||
|
||||
writeD(_timeLeft);
|
||||
writeD(_bluePoints);
|
||||
writeD(_redPoints);
|
||||
|
||||
writeD(_isRedTeam ? 0x01 : 0x00);
|
||||
writeD(_player.getObjectId());
|
||||
writeD(_playerPoints);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExCubeGameExtendedChangePoints implements IClientOutgoingPacket
|
||||
{
|
||||
int _timeLeft;
|
||||
int _bluePoints;
|
||||
int _redPoints;
|
||||
boolean _isRedTeam;
|
||||
L2PcInstance _player;
|
||||
int _playerPoints;
|
||||
|
||||
/**
|
||||
* Update a Secret Point Counter (used by client when receive ExCubeGameEnd)
|
||||
* @param timeLeft Time Left before Minigame's End
|
||||
* @param bluePoints Current Blue Team Points
|
||||
* @param redPoints Current Blue Team points
|
||||
* @param isRedTeam Is Player from Red Team?
|
||||
* @param player Player Instance
|
||||
* @param playerPoints Current Player Points
|
||||
*/
|
||||
public ExCubeGameExtendedChangePoints(int timeLeft, int bluePoints, int redPoints, boolean isRedTeam, L2PcInstance player, int playerPoints)
|
||||
{
|
||||
_timeLeft = timeLeft;
|
||||
_bluePoints = bluePoints;
|
||||
_redPoints = redPoints;
|
||||
_isRedTeam = isRedTeam;
|
||||
_player = player;
|
||||
_playerPoints = playerPoints;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_BLOCK_UP_SET_STATE.writeId(packet);
|
||||
|
||||
packet.writeD(0x00);
|
||||
|
||||
packet.writeD(_timeLeft);
|
||||
packet.writeD(_bluePoints);
|
||||
packet.writeD(_redPoints);
|
||||
|
||||
packet.writeD(_isRedTeam ? 0x01 : 0x00);
|
||||
packet.writeD(_player.getObjectId());
|
||||
packet.writeD(_playerPoints);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,52 +1,55 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExCubeGameRemovePlayer extends L2GameServerPacket
|
||||
{
|
||||
L2PcInstance _player;
|
||||
boolean _isRedTeam;
|
||||
|
||||
/**
|
||||
* Remove Player from Minigame Waiting List
|
||||
* @param player Player to Remove
|
||||
* @param isRedTeam Is Player from Red Team?
|
||||
*/
|
||||
public ExCubeGameRemovePlayer(L2PcInstance player, boolean isRedTeam)
|
||||
{
|
||||
_player = player;
|
||||
_isRedTeam = isRedTeam;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x98);
|
||||
writeD(0x02);
|
||||
|
||||
writeD(0xffffffff);
|
||||
|
||||
writeD(_isRedTeam ? 0x01 : 0x00);
|
||||
writeD(_player.getObjectId());
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExCubeGameRemovePlayer implements IClientOutgoingPacket
|
||||
{
|
||||
L2PcInstance _player;
|
||||
boolean _isRedTeam;
|
||||
|
||||
/**
|
||||
* Remove Player from Minigame Waiting List
|
||||
* @param player Player to Remove
|
||||
* @param isRedTeam Is Player from Red Team?
|
||||
*/
|
||||
public ExCubeGameRemovePlayer(L2PcInstance player, boolean isRedTeam)
|
||||
{
|
||||
_player = player;
|
||||
_isRedTeam = isRedTeam;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet);
|
||||
|
||||
packet.writeD(0x02);
|
||||
|
||||
packet.writeD(0xffffffff);
|
||||
|
||||
packet.writeD(_isRedTeam ? 0x01 : 0x00);
|
||||
packet.writeD(_player.getObjectId());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,39 +1,43 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* Format: (chd)
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExCubeGameRequestReady extends L2GameServerPacket
|
||||
{
|
||||
/**
|
||||
* Show Confirm Dialog for 10 seconds
|
||||
*/
|
||||
public ExCubeGameRequestReady()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x98);
|
||||
writeD(0x04);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.network.client.OutgoingPackets;
|
||||
|
||||
/**
|
||||
* Show Confirm Dialog for 10 seconds
|
||||
* @author mrTJO
|
||||
*/
|
||||
public class ExCubeGameRequestReady implements IClientOutgoingPacket
|
||||
{
|
||||
public static final ExCubeGameRequestReady STATIC_PACKET = new ExCubeGameRequestReady();
|
||||
|
||||
private ExCubeGameRequestReady()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet);
|
||||
|
||||
packet.writeD(0x04);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user