Jump to content
  • 0

L2j (pride pack) Auto Flag Pvp Zone


Question

Recommended Posts

  • 0
Posted
1 hour ago, Kara said:

Not working because the code he gave you is trash 

The guy's code first broadcast the packet and then change the flag.

 

Check setPvPFlag and similar methods and check which method simple change the flag (asign the variable you want) without add object to the PvPTaskManager. You want avoid that cause flag will be removed afterwards. 

 

In addition those who try help by giving codes at least CODE IT PROPERLY. Do not share a random trash code please.

True and even if those codes were correct, even then they could possibly not suit your case. You need to find a way for the flag to stay even if players attack each other 

  • 0
Posted
7 hours ago, JaharakaL said:

There is a shared pack with all these features and somehow you still want someone to send you the code and the implementation of it

the pack u share have nothing about pvp zone "hunters" i go there and no flag nothing

  • 0
Posted (edited)
protected void onEnter(Creature creature)
	{
		creature.setInsideZone(ZoneId.PVP_FLAG, true);
		creature.setInsideZone(ZoneId.NO_SUMMON_FRIEND, true);
		if (creature instanceof PlayerInstance)
		{
			((PlayerInstance) creature).sendMessage("You have entered a flag zone.");
			((PlayerInstance) creature).leaveParty();
			((PlayerInstance) creature).setPvpFlag(1);
			((PlayerInstance) creature).broadcastUserInfo();
		}
	}
	
	@Override
	protected void onExit(Creature creature)
	{
		creature.setInsideZone(ZoneId.PVP_FLAG, false);
		creature.setInsideZone(ZoneId.NO_SUMMON_FRIEND, false);
		if (creature instanceof PlayerInstance)
		{
			((PlayerInstance) creature).sendMessage("You have left a flag zone.");
			((PlayerInstance) creature).setPvpFlag(0);
			((PlayerInstance) creature).broadcastUserInfo();
		}
	}

 

this is a part from multifunction zone shared here in MxC. adapted to L2jmobius. works 100%. this part alone tho is not enough for everything to work. u need some some additions and some changes in your files. like "PVP_FLAG"(zone name for me)  you need to add to zonetypes etc.

 

after this You need to change your desired zone like PI from "town" "arena" or w/e it is to PVP_FLAG(my case) just code is not enough

 

you can ignore ".leaveParty();" mine is a no party - no res zone.

 

P.S. dont judge my code. i learn alone and since it works 100% of the time im ok with it. i try to improve.

Edited by Drazeal
Guest
This topic is now closed to further replies.


×
×
  • Create New...