Jump to content
  • 0

List zone ID to java file


Question

Posted

I have added this code to my pack and its not working...after trying to fix it 2hours...

 

  public void increasePvpKills(L2Character target)
  {
    if (((target instanceof L2PcInstance)) && (AntiFeedManager.getInstance().check(this, target)))
    {
      setPvpKills(getPvpKills() + 1);

      for (L2ZoneType zone : L2World.getInstance().getRegion(getX(), getY()).getZones()) {
        if ((zone.isCharacterInZone(this)) && (zone.getName() != null) && (zone.getId() == 40001)) {
          addItem("PvPReward", 14720, 1L, this, true);
        }

      }

      sendPacket(new UserInfo(this));
      sendPacket(new ExBrExtraUserInfo(this));
    }
  }

 

The location is Primival Isle, but when i kill someone as flagged [pvp] I don't get any reward...

5 answers to this question

Recommended Posts

  • 0
Posted

Retrieves the zone using existing stuff...

 

	/**
 * Returns zone from where the object is located by type
 *
 * @param object
 * @param type
 * @return zone
 */
public <T extends L2ZoneType> T getZone(L2Object object, Class<T> type)
{
	if (object == null)
		return null;
	return getZone(object.getX(), object.getY(), object.getZ(), type);
}

 

Once retrieved, compare both ids, and you're done.

 


 

Before all of that verify, you're on the good zone... Or even if a zone exists... What's the point to make such check if you don't even know you're actually on a zone or no.

 

//zone_check

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..