Jump to content

[Share] Simple Buff Restriction (Only inside towns)


Horus

Recommended Posts

Today ,like most shares I make, a friend asked me to make him a small simple Script which I decided to share since its usefull and simple.

Basically this Script makes sure that people do not use Healers, Buffers ,globally, AIOs outside towns on their own Characters.In other words,this prevents players from Dual Boxing with a Buffer / Healer within its party.

 

if((skill.getSkillType() == L2SkillType.BUFF || skill.getSkillType() == L2SkillType.HEAL ||skill.getSkillType() == L2SkillType.HEAL_PERCENT ) && skill.getTargetType() == skill.getTargetType().TARGET_PARTY || skill.getTargetType() == skill.getTargetType().TARGET_ONE || skill.getTargetType() == skill.getTargetType().TARGET_PARTY_MEMBER && !isInsideZone(L2Zone.FLAG_PEACE))
			{
				L2PcInstance player = ((L2PlayableInstance) this).getActingPlayer();
				if(player.isInParty())
				{
					for(L2PcInstance partymember : getParty().getPartyMembers())
					{ 	  if(partymember.getClient().getHostAddress().equals(player.getClient().getHostAddress()))
						{	
							player.sendMessage("You cannot Buff your own Character unless you are inside a Town Area.");
							return false;
						}
					}
				}

			}

 

The code is pretty simple and self explanatory.

 

Hope you find it usefull.

Link to comment
Share on other sites

Use IP checks for that...This wont allow anyone..not only dualbox

Thats the intention.

If there is a Party Member that has the same IP as the Buffer then Buffing is NOT Allowed.

Link to comment
Share on other sites

Thats the intention.

If there is a Party Member that has the same IP as the Buffer then Buffing is NOT Allowed.

You didnt get what I posted above...THERE IS NO IP CHECK! YOU CANNOT BUFF A PARTY MEMBER EVEN IF ISNT A DUALBOX!!!

 

 

Edit : Nevermind...I read just the first line of the ifs. You're right...Delete both of my posts someone please.

Link to comment
Share on other sites

You didnt get what I posted above...THERE IS NO IP CHECK! YOU CANNOT BUFF A PARTY MEMBER EVEN IF ISNT A DUALBOX!!!

 

 

Edit : Nevermind...I read just the first line of the ifs. You're right...Delete both of my posts someone please.

Ofc I'm right ;) lool.

Link to comment
Share on other sites

  • 8 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...