Jump to content

Question

Posted

hey guys can you tell me what is wrong with this  it gives basicly everywhere reward

if(isInsideZone(ZoneId.CUSTOMPVP))
				{
					sendMessage("is it working?");
					return;
				}
				else if (Config.ENABLE_PVP_FEATURES)
				{
					pvpReward();
				}

 

Recommended Posts

  • 0
Posted
21 minutes ago, melron said:

Assuming your reward table is not empty, the problem is located at your zone file. Perhaps there is no setIsInsideZone(ZoneId.CUSTOMPVP) (onEnter method of the zone). Check it ...

System.out.println(String.format("Player is inside zone %s, Config: %s", isInsideZone(ZoneId.CUSTOMPVP),Config.ENABLE_PVP_FEATURES));
if(Config.ENABLE_PVP_FEATURES && isInsideZone(ZoneId.CUSTOMPVP))
	pvpReward();

 

Player is inside zone false, Config: true

 

this is what i have inside my zone

/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package net.sf.l2j.gameserver.model.zone.type;

import net.sf.l2j.commons.random.Rnd;
import net.sf.l2j.gameserver.ThreadPoolManager;
import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.model.L2Skill;
import net.sf.l2j.gameserver.model.actor.L2Character;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.zone.L2SpawnZone;
import net.sf.l2j.gameserver.model.zone.ZoneId;


/**
 * An Custom PvP Zone
 *
 * @author  NeverMore
 */
public class L2CustomPvPZone extends L2SpawnZone
{
	//Ramdom Locations configs
    static int[] _x = {182240, 180199, 182296, 180185, 183254};
    static int[] _y = {22295, 22307, 18294, 18289, 20343};
    static int[] _z = {-3174, -3174, -3173, -3173, -3169};
    L2Skill noblesse = SkillTable.getInstance().getInfo(1323, 1);
    
	public L2CustomPvPZone(int id)
	{
		super(id);
	}
	
	@Override
	protected void onEnter(L2Character character)
	{
		character.setInsideZone(ZoneId.CustomPvPZone, true);
		character.setInsideZone(ZoneId.NO_SUMMON_FRIEND, true);
	}
	
	@Override
	protected void onExit(L2Character character)
	{
		character.setInsideZone(ZoneId.CustomPvPZone, false);
		character.setInsideZone(ZoneId.NO_SUMMON_FRIEND, false);
	}
	
	static class BackToPvp implements Runnable
	{
		private L2Character _activeChar;

		BackToPvp(L2Character character)
		{
			_activeChar = character;
		}

        @Override
        public void run()
        {
            int r = Rnd.get(5);
            _activeChar.teleToLocation(_x[r] , _y[r], _z[r], r); 
        }
	}
	
	@Override
	public void onDieInside(L2Character character)
	{
	       if (character instanceof L2PcInstance)
	       {
	       }
	}

	@Override
	public void onReviveInside(L2Character character)
	{
        ThreadPoolManager.getInstance().scheduleGeneral(new BackToPvp(character), 500);
        ((L2PcInstance) character).isNoblesseBlessed();
        noblesse.getEffects(character, character);
	}
}

 

  • 0
Posted
2 minutes ago, haskovo said:

it doesnt work even if im out of the zone...

Put the debug again. If both conditions are true, you have empty reward data

  • 0
Posted (edited)
7 minutes ago, melron said:

Put the debug again. If both conditions are true, you have empty reward data

i dont have empty reward it was working but i want to give the reward when im inside the pvp zone maybe this is the problem ?

Player is inside zone false

Edited by haskovo
  • 0
Posted

onEnter() function in this zone is not set for the character correctly if your code not work.

debug the setter

or you are simply not in a pvp zone

 

plus be sure the zone is loaded 🙂

  • 0
Posted
18 hours ago, haskovo said:

why do i need ip protection its just the code not working

Maybe you code is working , and your zones work too , but you have ip protection to avoid players dual box get reward , did you try with other player / pc ? 

  • 0
Posted (edited)
10 hours ago, haskovo said:

someone lock 🙂

 

ok, locked.

Edited by Vision
Guest
This topic is now closed to further replies.


  • Posts

    • IMPORTANT INFO: In a few days, I will switch to completely new code, written from scratch with a new download system, patch building and management system. The Updater will become true 2026 code with "foolproof systems". I'm going to create a Discord server for customers to request new ideas and features. FIRST CUSTOMERS ARE ALREADY USING THE NEW UPDATER ON LIVE SERVERS! Watch this topic for upcoming info because the new updater is around the corner! Yes, you can still use self-update on the previous updater! No, the new updater won't be compatible with the old patch system! A new build is required, but players who already have game files won't have to download the entire patch again! New templates and updates to existing templates are coming soon! Sneak peek:  
    • i used guytis IL project and source. i found in his project there are 3 Client version source... 1,CliExt_H5   --->this one cant be compiled in VS2005,i did know why..is it for H5 client? 2,CliExtNew  --->this one is IL version ,but when i compiled it and use it.player cant login game,MD5Checksum wrong.i check the source code,but not found any hints. 3,L2Server    --->this one for HB client?im not sure...   so my question is what are the differences between these three versions of cliext.dll?how can i fix the issue of the MD5Checksum not matching problem?   01/29/2026 21:04:11.366, [CCliExt::HandleCheckSum] Invalid Checksum[1130415144] vs [-721420287] packet[dd] len[29] sum[2698] key[30] HWID[] Account[]! 01/29/2026 21:04:11.366, SocketLimiter::UserSocketBadunknownprotocol 11111111111 01/29/2026 21:04:11.366, [usersocket]unknown protocol from ip[113.137.149.115]!      
    • ## [1.4.1] - 2026-01-29   ### ✨ New Features - **Short Description**: Server owners can add a short tagline (up to 240 characters) on the server info page, under the "Online" status. It appears in the server list (By Votes) for VIP, Gold VIP, and Pinned servers so players see a brief summary at a glance.   ### 🔄 Improvements - **Server Info Page**: Description field is limited to 3000 characters with a character counter; the textarea is vertically resizable. A second **Save Changes** button was added at the bottom (after the description) for easier saving. - **Server Name**: In My Servers → Edit, the server name is read-only and can no longer be changed (avoids accidental changes and naming conflicts). - **Server Rows (By Votes)**: Short descriptions wrap correctly and no longer affect row height; long text is clipped to two lines so the list stays tidy and consistent.   ---
    • @Celestine  sorry for mu question , and post it's to old but i want to ask  ?   do you have uncrypted interface x dat of this interface? i want to add custom autofarm button but when i open it with xdat say file seems  to be  encrypted. thanks!
  • Topics

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