public static void addFlagToPlayer(L2PcInstance _player)
{
//remove items from the player hands (right, left, both)
// This is NOT a BUG, I don't want them to see the icon they have 8D
L2ItemInstance wpn = _player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
if (wpn == null)
{
wpn = _player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
if (wpn != null)
_player.getInventory().unEquipItemInBodySlotAndRecord(Inventory.PAPERDOLL_RHAND);
}
else
{
_player.getInventory().unEquipItemInBodySlotAndRecord(Inventory.PAPERDOLL_RHAND);
wpn = _player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND);
if (wpn != null)
_player.getInventory().unEquipItemInBodySlotAndRecord(Inventory.PAPERDOLL_LHAND);
}
//add the flag in his hands
_player.getInventory().equipItem(ItemTable.getInstance().createItem("", CTF._FLAG_IN_HAND_ITEM_ID, 1, _player, null));
_player.broadcastPacket(new SocialAction(_player.getObjectId(), 16)); //amazing glow
_player._haveFlagCTF = true;
_player.broadcastUserInfo();
_player.sendPacket(new CreatureSay(_player.getObjectId(), 15, ":", "You got it! Run back! ::")); // 8D
}
public static void removeFlagFromPlayer(L2PcInstance player)
{
final L2ItemInstance wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
player._haveFlagCTF = false;
if (wpn != null)
{
final L2ItemInstance[] unequiped = player.getInventory().unEquipItemInBodySlotAndRecord(wpn.getItem().getBodyPart());
player.getInventory().destroyItemByItemId("", CTF._FLAG_IN_HAND_ITEM_ID, 1, player, null);
InventoryUpdate iu = new InventoryUpdate();
for (L2ItemInstance element : unequiped)
iu.addModifiedItem(element);
player.sendPacket(iu);
player.sendPacket(new ItemList(player, true)); // get your weapon back now ...
player.abortAttack();
player.broadcastUserInfo();
}
else
{
player.getInventory().destroyItemByItemId("", CTF._FLAG_IN_HAND_ITEM_ID, 1, player, null);
player.sendPacket(new ItemList(player, true)); // get your weapon back now ...
player.abortAttack();
player.broadcastUserInfo();
}
}
Dear friends, we are excited to announce a new thrilling event — the "Path of Glory" tournament!
Only the bravest and most skilled fighters will be able to prove their strength and mastery in battle!
Tournament Dates and Formats:
- May 24, 2025 at 16:00 GMT +2 — 2 vs 2
- May 25, 2025 at 16:00 GMT +2 — 4 vs 4
Battle Venue: Gludin Arena
All participants will receive rewards!
Learn more about the tournament and register on the forum.
I have completed global work on player synchronization. Now I continue to implement the UI.
Added to the store: processes any size of the list of products, the store itself expands the cells or removes unnecessary ones.
Added ToolTips for accessories.
Added optimization for the store so that a large number of items can be processed quickly.
Added movement by double clicking in the sell - buy field and back.
Question
l2redkiller
i got some errors in ctf event engine :
thannkss for help
if need the code :
14 answers to this question
Recommended Posts