Jump to content

Question

Posted

i got some errors in ctf event engine :

 

error1a.jpg

 

errordv.jpg

 

thannkss for help

 

if need the code :

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();
	}
}

14 answers to this question

Recommended Posts

  • 0
Posted

what i have to do with that in freya server ?

 

player.isOnline() == 0

 

and

 

player.isOnline() != 0

 

isOnline is boolean postIL.

 

So it becomes !player.isOnline() for 0, and player.isOnline() for 1.

 

Your first problem is due to the fact you try to unequip in a slot which is out of current possibilities. Aka you try to use an non-registered slot.

 

I invite you to check how unEquipItemInBodySlotAndRecord() method is used in your current pack.

  • 0
Posted

unEquipItemInBodySlotAndRecord

 

 

                     

 case PAPERDOLL_HAIR:		slot = L2Item.SLOT_HAIR;
		break;
		case PAPERDOLL_HAIR2:		slot = L2Item.SLOT_HAIR2;
		break;
		case PAPERDOLL_HEAD:		slot = L2Item.SLOT_HEAD;
		break;
		case PAPERDOLL_RHAND:		slot = L2Item.SLOT_R_HAND;
		break;
		case PAPERDOLL_LHAND:		slot = L2Item.SLOT_L_HAND;
		break;
		case PAPERDOLL_GLOVES:		slot = L2Item.SLOT_GLOVES;
		break;

 

ctf code :

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);
	}

 

or its anything of this :

 

_player.getInventory().equipItem(ItemTable.getInstance().createItem("", [color=orange]CTF._FLAG_IN_HAND_ITEM_ID, 1,[/color] _player, null));

  • 0
Posted

I invite you to check how unEquipItemInBodySlotAndRecord() method is used in your current pack.

 

TIP : The important word is "used". I didn't say to analyze this part of code, but to analyze how it is used on different parts of your pack.

 

Another thing, when happens your error ? When you try to pickup the flag ?

  • 0
Posted

i donno maybe you can help me with that ?

 

 

 

You "dunno" or you are simply to lazy to do it by your self and expect ready solution?

 

He gave you hint, now use it by yourself, its request dev help, not request ready code section.

  • 0
Posted

ye but i am just learn java so i dont know that much i had todo with oly / and some scripts for pvp pk announce and color not more

 

sorry

 

Without own effort you won't achieve anything, trust me.

 

Just read, use brain, analyze, TEST your own codes, fix your mistakes by trying.

 

And you will learn something for sure.

Guest
This topic is now closed to further replies.


  • Posts

    • Hello everyone, I am looking to purchase a Premium Lineage 2 High Five server pack. My main requirements are: Stability & Quality (Most Important): The pack must be highly stable with no system errors or major bugs. Custom Features: It must include ready-to-use custom features such as a fully functional Community Board, custom NPC Buffers, and Custom Item Sellers (GM Shops), etc. Complete Files: It is absolutely necessary that the full source code (src) and complete Geodata are included. If you are selling a pack that meets these criteria, please send me a PM or leave a reply with the following information: Brief details and key features of the pack Price Test server availability (I would like to test it before buying) Thank you!
    • L2jmobiusDevClon — Classic Interlude p110 Emulator L2jmobiusDevClon is actively developing a Lineage 2 Classic Interlude p110 emulator. Development is done in free time with a strong focus on: • Stability • Authentic Classic mechanics • Clean and optimized architecture The project is based on the L2jMobius source and is continuously evolving and improving. System Requirements: • Java 25 • MariaDB 12.0 • Client p110 Current Revision: 3.0 Development Status: Active Distribution: Free Official Website: https://www.l2jmobiusdevclon.pp.ua Discord Server: https://discord.gg/23a9S8g4Bn Contact: Telegram — @L2jmobiusDevClon Also available via private messages Project Goals: ✔ Improved stability ✔ Maximum Classic accuracy ✔ Core optimization We are currently looking for: • Testers • Server administrators Suggestions, bug reports, and ideas are always welcome. Contact us via: ✔ Discord ✔ Telegram ✔ Private Messages
    • i guess loading only the effects that are needed it will maybe work, like removing from reshade shader folder the ones that are not needed, depends on the pc also i guess, also limithing the game at 30fps can be better maybe
    • Up   SELL CHARACTERS L2 REBORN FRANZ x1     destroyer 74 lvl naked - 120 euro sws 71 lvl naked - 120 euro pp 66 skills - 120 euro se 64 lvl - 90 euro   Characters are legit with mail   i can wtt the characters for adena server franz   sell adena franz 250kk stock     add discord topeseller4081  
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..