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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...