Jump to content

Question

Posted (edited)

Hi, im working in this faction mod, and adapted a TvT event from the forum, now its working fine.

The only problem is that faction attack restriction interferes with TVT Event, so when 2 players from same faction are in tvt , they cannot attack each other,

 

found this in l2character:

 

if (this instanceof L2PcInstance)
		{
		    L2PcInstance player = (L2PcInstance) this;
		    L2PcInstance trgtF = null;
		    boolean cond = true;
			if (!player.isInSiege() && !player.isInOlympiadMode() && !player.isInsideZone(ZONE_PVP)) { 
				if (target instanceof L2PcInstance)
					trgtF = (L2PcInstance) target;
				else if (target instanceof L2SummonInstance)
					trgtF = ((L2SummonInstance)target).getOwner();
				else if (target instanceof L2PetInstance)
					trgtF = ((L2PetInstance)target).getOwner();
				if (trgtF != null && trgtF != player)
				{
					if (trgtF.getFactionId() == player.getFactionId() && player.getFactionId() > 0)
						cond = false;
					else if (trgtF.getFactionId() == 0 || player.getFactionId() == 0)
						cond = false;
				}
				if (!cond)
					return;
			}

 

and this in l2pcinstance:

 

if (skill.isPvpSkill()) // pvp skill
			{
				// CHECK IF OKAY
				if (!isInSiege() && !isInOlympiadMode()) { 
					if (getFactionId() != target.getActingPlayer().getFactionId() && !isInsidePeaceZone(this, target))
						return true;
				}

				// in clan war player can attack whites even with sleep etc.
				if (getClan() != null && ((L2PcInstance)target).getClan() != null)
				{
					if(getClan().isAtWarWith(((L2PcInstance)target).getClan().getClanId()))
						return true;
				}
			}
			else if ((skilldat != null && !skilldat.isCtrlPressed() && skill.isOffensive() && !srcIsSummon)
				|| (skilldatpet != null && !skilldatpet.isCtrlPressed() && skill.isOffensive() && srcIsSummon))
			{
				if (!isInSiege() && !isInOlympiadMode()) {
					if (getFactionId() != target.getActingPlayer().getFactionId() && !isInsidePeaceZone(this, target))
						return true;
				}

				// in clan war player can attack whites even with sleep etc.
				if (getClan() != null && ((L2PcInstance)target).getClan() != null)
				{
					if (getClan().isAtWarWith(((L2PcInstance)target).getClan().getClanId()))
						return true;
				}

 

 

i tried adding  "if (!isInSiege() && !isInOlympiadMode() && !isInFunEvent) {   but it does not work.

 

Any idea or suggestion ? it will be appreciated 

Edited by Kotegaeshi92

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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