GunarStillis Posted February 6, 2012 Share Posted February 6, 2012 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... Link to comment Share on other sites More sharing options...
0 `NeverMore Posted February 6, 2012 Share Posted February 6, 2012 cronicle ? project ? zone.getId() == 40001) ??? Link to comment Share on other sites More sharing options...
0 GunarStillis Posted February 6, 2012 Author Share Posted February 6, 2012 Freya CT2.5 Link to comment Share on other sites More sharing options...
0 Tryskell Posted February 7, 2012 Share Posted February 7, 2012 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 Link to comment Share on other sites More sharing options...
0 GunarStillis Posted February 7, 2012 Author Share Posted February 7, 2012 I didn't really understand ur meanie. I tried to add Item to drop from pvp kills in speical areas,which I failed at... Link to comment Share on other sites More sharing options...
0 GunarStillis Posted February 7, 2012 Author Share Posted February 7, 2012 Zoey76 helped me to fix the code, thnx. close topic :) Link to comment Share on other sites More sharing options...
Question
GunarStillis
I have added this code to my pack and its not working...after trying to fix it 2hours...
The location is Primival Isle, but when i kill someone as flagged [pvp] I don't get any reward...
Link to comment
Share on other sites
5 answers to this question
Recommended Posts