Jump to content
  • 0

Block Bs In Flagzone


Question

Posted

Hellow guys! I'am from brasil, but sorry my very english bad ..

I need code to block bs in flagzone, can someone help me?

::)  ::)  ::)  ::)  :okey:

I need a code to block the bs in flagzone

Recommended Posts

  • 0
Posted

I  have erro:

sm61c4.png

 

Sorry i forget about that... Do it like

+if (character instanceof L2PcInstance)
+{
+	_player = (L2PcInstance)character;
+	final int[] supporters = {15,16,29,30,42,43,97,105,112,115,136,116}; // support classes ID's
+	for (int act : supporters)
+	if  (_player.getActiveClass() == act)
+	{
+		_player.sendMessage("You can't enter in flag zone with a support class.");
+		_player.teleToLocation(83417 + Rnd.get(101) - 50, 149028 + Rnd.get(101) - 50, -3408);
+	}
+}
  • 0
Posted

What the "bs" standing for?

 

The only that makes sense, is backstab...but wtf, you dont want backstab in your flag zone? :P

  • 0
Posted (edited)

What the "bs" standing for?

 

The only that makes sense, is backstab...but wtf, you dont want backstab in your flag zone? :P

Sorry man.. Bs = Bishop/Cardinal .. 

 

You can help me?

Edited by nortim
  • 0
Posted (edited)

Sorry man.. Bs = Bishop/Cardinal .. 

You could make the following:

 

onEnter method:

+               final int[] supporters = {15,16,29,30,42,43,97,105,112,115,136,116}; // support classes ID's
+        	for (int act : supporters)
+            	if  (_player.getActiveClass() == act)
+            	{
+            		_player.sendMessage("You can't enter in flag zone with a support class.");
+            		_player.teleToLocation(83417 + Rnd.get(101) - 50, 149028 + Rnd.get(101) - 50, -3408);
+            	}

supporters array has all supporters id (bishop,cardinal,evas saint etc etc). If you want to restrict only bishop keep id 15 and 97.

 

Edit: Whenever a supporter enters the zone, he gets teleport to Giran (with some random offset, which you can remove).

Edited by Solomun
  • 0
Posted

in heal.java

change id with your zone id
and here use class bishop
player.getClassId().getId() == 12

if(activeChar.isInsideZone(12345) && player.getClassId().getId() == 12)
{
	activeChar.getActingPlayer().sendMessage("You can't heal in this zone..");
	continue;
}
  • 0
Posted

 

in heal.java

change id with your zone id
and here use class bishop
player.getClassId().getId() == 12

if(activeChar.isInsideZone(12345) && player.getClassId().getId() == 12)
{
	activeChar.getActingPlayer().sendMessage("You can't heal in this zone..");
	continue;
}

 

This way, he could use cleanse and such skills right?

  • 0
Posted

is bad can't enter to pvp zone if bishop have augment skill and need play pvp ? how to play ?

He said to block bishop, not his heal.

 

This restricted bishop could get a subclass and play.

  • 0
Posted

is bad can't enter to pvp zone if bishop have augment skill and need play pvp ? how to play ?

with buffed players bp have no chance

  • 0
Posted

OMG! THX , YOU IS GOOOD !

Do I add these codes in flagzone.java?

Do I add these codes in flagzone.java?

 

Yes...onEnter method.

  • 0
Posted

What FlagZone code are you using?

 

package net.l2jpx.gameserver.model.zone.type;

 
import java.util.List;
 
import org.w3c.dom.Node;
 
import javolution.util.FastList;
 
import net.l2jpx.Config;
import net.l2jpx.gameserver.datatables.SkillTable;
import net.l2jpx.gameserver.model.L2Character;
import net.l2jpx.gameserver.model.L2Skill;
import net.l2jpx.gameserver.model.actor.instance.L2PcInstance;
import net.l2jpx.gameserver.model.zone.L2ZoneType;
import net.l2jpx.gameserver.network.serverpackets.ActionFailed;
import net.l2jpx.gameserver.network.serverpackets.NpcHtmlMessage;
import net.l2jpx.util.random.Rnd;
 
public class L2FlagZone extends L2ZoneType
{
private String _townName;
private int _townId;
private int _redirectTownId;
private int _taxById;
private boolean _FlagZone;
private FastList<int[]> _spawnLoc;
 
  public L2FlagZone(int id)
  {
    super(id);
 
_taxById = 0;
_spawnLoc = new FastList<>();
 
// Default to Giran
_redirectTownId = 1;
 
// Default peace zone
_FlagZone = false;
  }
 
@Override
public void setParameter(String name, String value)
{
if(name.equals("name"))
{
_townName = value;
}
else if(name.equals("townId"))
{
_townId = Integer.parseInt(value);
}
else if(name.equals("redirectTownId"))
{
_redirectTownId = Integer.parseInt(value);
}
else if(name.equals("taxById"))
{
_taxById = Integer.parseInt(value);
}
else if(name.equals("PvpZone"))
{
_FlagZone = Boolean.parseBoolean(value);
}
else
{
super.setParameter(name, value);
}
}
 
@Override
public void setSpawnLocs(Node node)
{
int ai[] = new int[3];
 
Node node1 = node.getAttributes().getNamedItem("X");
 
if(node1 != null)
{
ai[0] = Integer.parseInt(node1.getNodeValue());
}
 
node1 = node.getAttributes().getNamedItem("Y");
 
if(node1 != null)
{
ai[1] = Integer.parseInt(node1.getNodeValue());
}
 
node1 = node.getAttributes().getNamedItem("Z");
 
if(node1 != null)
{
ai[2] = Integer.parseInt(node1.getNodeValue());
}
_spawnLoc.add(ai);
}
 
  L2Skill noblesse = SkillTable.getInstance().getInfo(1323, 1);
  
  @Override
  protected void onEnter(L2Character character)
  {
    if ((character instanceof L2PcInstance))
    {
    if(character.getLevel() >= Config.ALLOW_FLAG_ZONE_MINILVL && character.getLevel() <= Config.ALLOW_FLAG_ZONE_MAXLVL)
    {
    ((L2PcInstance)character).teleToLocation(Config.ALLOW_FLAGl_ZONE_X, Config.ALLOW_FLAGl_ZONE_Y, Config.ALLOW_FLAGl_ZONE_Z);
    showHtmlLevel((L2PcInstance)character);
    return;
    }
 
      if (Config.RECEIVE_NOBLESSE)
      {
        this.noblesse.getEffects(character, character);
      }
      ((L2PcInstance)character).stopPvPFlag();
      ((L2PcInstance)character).updatePvPFlag(1);
      if (Config.MSG_ON_ENTER_FLAG)
      {
        ((L2PcInstance)character).sendMessage("[Wizard Zone]: " + Config.MESSAGE_ON_ENTER + ".");
      }
   
    
if (Config.ALLOW_FLAG_ZONE_TITLE)
{
  ((L2PcInstance)character).getAppearance().setTitleColor(Config.FLAG_ZONE_TITLE_COLOR);
}
   
if (Config.ALLOW_FLAG_ZONE_NAME)
{
  ((L2PcInstance)character).getAppearance().setNameColor(Config.FLAG_ZONE_NAME_COLOR);
}
 
    if(!_FlagZone && Config.ZONE_TOWN != 2)
{
character.setInsideZone(L2Character.ZONE_FLAGZONE, true);
}
    }
  }
 
  @Override
  protected void onExit(L2Character character)
  {
    if ((character instanceof L2PcInstance))
    {
      ((L2PcInstance)character).updatePvPFlag(0);
      if (Config.MSG_ON_ENTER_FLAG) {
        ((L2PcInstance)character).sendMessage("[Wizard Zone]: " + Config.MESSAGE_ON_EXIT + ".");
      }
    
if (Config.ALLOW_FLAG_ZONE_TITLE)
{
       ((L2PcInstance)character).getAppearance().setTitleColor(Config.NAME_COLOR);
}
if (Config.ALLOW_FLAG_ZONE_NAME)
{
       ((L2PcInstance)character).getAppearance().setNameColor(Config.TITLE_COLOR);
}
 
    if(!_FlagZone)
{
character.setInsideZone(L2Character.ZONE_FLAGZONE, false);
}
    }
  }
  
  @Override
  public void onDieInside(L2Character character) {}
  
  @Override
  public void onReviveInside(L2Character character)
  {
    onEnter(character);
    if (Config.RECEIVE_NOBLESSE)
    {
      this.noblesse.getEffects(character, character);
    }
  }
 
/**
* Returns this town zones name
* @return
*/
@Deprecated
public String getName()
{
return _townName;
}
 
/**
* Returns this zones town id (if any)
* @return
*/
public int getTownId()
{
return _townId;
}
 
/**
* Gets the id for this town zones redir town
* @return
*/
@Deprecated
public int getRedirectTownId()
{
return _redirectTownId;
}
 
/**
* Returns this zones spawn location
* @return
*/
public final int[] getSpawnLoc()
{
int ai[] = new int[3];
 
ai = _spawnLoc.get(Rnd.get(_spawnLoc.size()));
 
return ai;
}
 
private void showHtmlLevel(L2PcInstance activeChar)
{
 NpcHtmlMessage msg = new NpcHtmlMessage(5);
 msg.setFile("data/html/mods/level.htm");
  
 activeChar.sendPacket(msg);
 activeChar.sendPacket(new ActionFailed());
}
 
/**
* Returns this town zones castle id
* @return
*/
public final int getTaxById()
{
return _taxById;
}
}

Guest
This topic is now closed to further replies.


  • Posts

    • Dear players, From April 19 to April 27 inc., the Bonus Start event will be active. It’s designed to help new and low-level characters get started more easily.   All characters that meet one of the following conditions: — created less than 3 days ago (regardless of level), — currently level 20 or below, — created during the event period, will receive upon login: — 10 sets of buff scrolls (phys or mage, depending on class), — 10 packs of +50% Drop/Spoil runes (2 hours each), — 10 packs of +50% Exp runes (2 hours each). Characters between level 21 and 30 will receive upon login: — 6 sets of buff scrolls, — 6 packs of +50% Drop/Spoil runes (2h each), — 6 packs of +50% Exp runes (2h each).   Event items will be removed approx. 09.05.2025 Server rates will be increased to x2.25. Take this chance to start your journey with ease or bring an old hero back into the fight — it’s the perfect time to test your strength! Open Beta Test is started!  Helper cats are waiting in towns — talk to them to receive the necessary equipment and level up your character. Siege Schedule:  - April 13 at 16:00 (GMT+2) – Innadrile Castle - April 14 at 20:00 (GMT+2) – Bandit Stronghold - April 15 at 20:00 (GMT+2) – Devastated Castle 📌 During the OBT, players who report bugs will receive CoL:   - 1 CoL for each reported staticmeshes bug (e.g., walking through textures, stairs, etc.) - 2 CoL or more for server-related issues (depending on severity) You can report bugs on the forum. The Open Beta Test will run approximately until April 15 at 23:00 (GMT+2). Your activity and feedback will help us improve the game.   Download links: Download client | Download updater 
    • begin if (user.dead) then begin delay(555); Engine.GoHome(rtCastle); print('User dead, going to castle..') end; end.  
    • Hello everyone. Long time no see. I've been trying to play L2 on my 4k monitor, however the UI is extremely small.  I checked around the internet and couldn't find a guide on how to keep the resolution high and the UI size a bit bigger. I either get small UI + full resolution (correct resolution of monitor), or normal sized UI but resolution set to full HD (which doesn't really look good on a 4k screen). Adjusting scaling on display settings doesn't change the UI just the text on L2. Does anyone know a way to increase the UI size only and keeping the screens resolution same (4k) ? I'll share a screenshot as an example, and it 's not even full screen mode. https://freeimage.host/i/3cvPVnI  
    • Hello guys. I want to know if there is a way(script or something) to make character go to castle after death in adrenaline bot
    • hahahahahahahahahahhaaahahaha
  • Topics

×
×
  • Create New...