Skip to content

List zone ID to java file

Featured Replies

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...

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

  • Author

I didn't really understand ur meanie.

I tried to add Item to drop from pvp kills in speical areas,which I failed at...

  • Author

Zoey76 helped me to fix the code, thnx.

close topic :)

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.