Jump to content
  • 0

Tvt Players Attack/cast Without Pressing Ctrl


Question

Posted

Hello,

I've came across this issue: TvT  players that are clan members to ttack/cast, if the opposite event team player is a clan memmber, they have to  be pressing CTRL to attack, if you're not a clan memmber all works fine. How to fix it?

[L2jFrozen]

2 answers to this question

Recommended Posts

  • 0
Posted (edited)

isAttackable / isAutoAttackable

I've found about it in actor/instance/L2PcInstance.java, is it the correct file?

I hope I was looking up to the right bit, If so where to set it correct for tvt/dm/cft?

else
{

player.sendPacket(new ValidateLocation(this));

// Check if the player is attackable (without a forced attack) and isn't dead
if (isAutoAttackable(player) && !isAlikeDead())
{
// Check the height difference
if (Math.abs(player.getZ() - getZ()) < 400) // this max heigth difference might need some tweaking
{
// Set the L2PcInstance Intention to AI_INTENTION_ATTACK
player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);
// player.startAttack(this);
}
else
{
// Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
player.sendPacket(ActionFailed.STATIC_PACKET);
}
}
else if (!isAutoAttackable(player))
{
// Calculate the distance between the L2PcInstance and the L2NpcInstance
if (!canInteract(player))
{
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this);
}
else
{
// Like L2OFF if char is dead, is sitting, is in trade or is in fakedeath can't interact with npc
if (player.isSitting() || player.isDead() || player.isFakeDeath() || player.getActiveTradeList() != null)
return;



I hope it's the right bit..

or somewhere among here?

public boolean isAutoAttackable(final L2Character attacker)
{
return false;
}

/**
* Return the Identifier of the item in the left hand of this L2NpcInstance contained in the L2NpcTemplate.<BR>
* <BR>
* @return the left hand item
*/
public int getLeftHandItem()
{
return _currentLHandId;
}

/**
Edited by zilbe333

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock