Jump to content

Recommended Posts

Posted

change name  :)  *L2CustomPvP

 

delete this *

 

I see but i wrote the new file correct L2CustomPvP.java without the * But when i paste the code inside the * appears automtic in the name. oO

When i paste the old code:

 

3)Create a new zone type with name L2CustomPvP.java and inside put this code :

(+++ java/com/l2jserver/gameserver/model/zone/type/L2CustomPvP.java)

 

/*
* 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 com.l2jserver.gameserver.model.zone.type;

import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.zone.L2SpawnZone;
import com.l2jserver.util.Rnd;


/**
* An Custom PvP Zone
*
* @author  NeverMore
*/
public class L2CustomPvP extends L2SpawnZone
{
//Ramdom Locations configs
    private static int[] _x = {11551, 10999, 10401};
    private static int[] _y = {-24264, -23576, -24030};
    private static int[] _z = {-3644, -3651, -3660 };

public L2CustomPvP(int id)
{
	super(5555);
}

@Override
protected void onEnter(L2Character character)
{
	character.setInsideZone(L2Character.ZONE_PVP, true);
	character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, true);

       if (character instanceof L2PcInstance)
       {
    	   ((L2PcInstance) character).sendMessage("You enter a PvP Area");
           ((L2PcInstance) character).setPvpFlag(1);	           
       }
}

@Override
protected void onExit(L2Character character)
{
	character.setInsideZone(L2Character.ZONE_PVP, false);
	character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, false);

	if (character instanceof L2PcInstance)
	{
		((L2PcInstance) character).stopNoblesseBlessing(null);
		((L2PcInstance) character).setPvpFlag(0);
    	((L2PcInstance) character).sendMessage("You exit from a PvP Area");
	}
}

static class BackToPvp implements Runnable
{
	private L2Character _activeChar;

	BackToPvp(L2Character character)
	{
		_activeChar = character;
	}

        @Override
        public void run()
        {
            int r = Rnd.get(3);
            _activeChar.teleToLocation(_x[r] , _y[r], _z[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();
}
}

 

fOrNq.jpg

 

I don't get the errors i don¡t know what happend here. But since Nevermore said this will not work i need to get working the Update One.

Posted

Well here a -beep-ing comparition of the damn codes:

 

gr3yd.jpg

 

So the old code don't give errors but don't will work, the update Code give errors. We can see the diferences between those codes so someone can tell the damn correct way for get the update Code working?

Since Nevermore don't give a shit helping me and i send a Private message, he should change the nick to NeverCareaShit.

Posted

Since Nevermore don't give a shit helping me and i send a Private message, he should change the nick to NeverCareaShit.

since you don't know java why you trying to add codes? learn first and then make anything you want :S
Posted

since you don't know java why you trying to add codes? learn first and then make anything you want :S

 

First of all he posted a Code so he should put a Warning or something if the code don't work (in this case the Update one) and i m not any good at java but i know how apply a patch and this sin't a patch is creating a new java file. The Update Patch have something wrong cuz i follow all the steps and 1 code isn't giving errors and the Update yes so there is something wrong.

Posted

First of all he posted a Code so he should put a Warning or something if the code don't work (in this case the Update one) and i m not any good at java but i know how apply a patch and this sin't a patch is creating a new java file. The Update Patch have something wrong cuz i follow all the steps and 1 code isn't giving errors and the Update yes so there is something wrong.

 

try this meng..

 

/*
* 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 com.l2jserver.gameserver.model.zone.type;

import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.zone.L2SpawnZone;
import com.l2jserver.util.Rnd;


/**
* An Custom PvP Zone
*
* @author  NeverMore
*/
public class L2CustomPvP extends L2SpawnZone
{
//Ramdom Locations configs
    private static int[] _x = {11551, 10999, 10401};
    private static int[] _y = {-24264, -23576, -24030};
    private static int[] _z = {-3644, -3651, -3660 };

public L2CustomPvP(int id)
{
	super(5555);
}

protected void onEnter(L2Character character)
{
	character.setInsideZone(L2Character.ZONE_PVP, true);
	character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, true);

       if (character instanceof L2PcInstance)
       {
    	   ((L2PcInstance) character).sendMessage("You enter a PvP Area");
           ((L2PcInstance) character).setPvpFlag(1);	           
       }
}

protected void onExit(L2Character character)
{
	character.setInsideZone(L2Character.ZONE_PVP, false);
	character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, false);

	if (character instanceof L2PcInstance)
	{
		((L2PcInstance) character).stopNoblesseBlessing(null);
		((L2PcInstance) character).setPvpFlag(0);
    	((L2PcInstance) character).sendMessage("You exit from a PvP Area");
	}
}

static class BackToPvp implements Runnable
{
	private L2Character _activeChar;

	BackToPvp(L2Character character)
	{
		_activeChar = character;
	}

        @Override
        public void run()
        {
            int r = Rnd.get(3);
            _activeChar.teleToLocation(_x[r] , _y[r], _z[r]); 
        }
}

public void onDieInside(L2Character character)
{
       if (character instanceof L2PcInstance)
       {
       }
}

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

Posted

try this meng..

 

/*
* 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 com.l2jserver.gameserver.model.zone.type;

import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.zone.L2SpawnZone;
import com.l2jserver.util.Rnd;


/**
* An Custom PvP Zone
*
* @author  NeverMore
*/
public class L2CustomPvP extends L2SpawnZone
{
//Ramdom Locations configs
    private static int[] _x = {11551, 10999, 10401};
    private static int[] _y = {-24264, -23576, -24030};
    private static int[] _z = {-3644, -3651, -3660 };

public L2CustomPvP(int id)
{
	super(5555);
}

protected void onEnter(L2Character character)
{
	character.setInsideZone(L2Character.ZONE_PVP, true);
	character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, true);

       if (character instanceof L2PcInstance)
       {
    	   ((L2PcInstance) character).sendMessage("You enter a PvP Area");
           ((L2PcInstance) character).setPvpFlag(1);	           
       }
}

protected void onExit(L2Character character)
{
	character.setInsideZone(L2Character.ZONE_PVP, false);
	character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, false);

	if (character instanceof L2PcInstance)
	{
		((L2PcInstance) character).stopNoblesseBlessing(null);
		((L2PcInstance) character).setPvpFlag(0);
    	((L2PcInstance) character).sendMessage("You exit from a PvP Area");
	}
}

static class BackToPvp implements Runnable
{
	private L2Character _activeChar;

	BackToPvp(L2Character character)
	{
		_activeChar = character;
	}

        @Override
        public void run()
        {
            int r = Rnd.get(3);
            _activeChar.teleToLocation(_x[r] , _y[r], _z[r]); 
        }
}

public void onDieInside(L2Character character)
{
       if (character instanceof L2PcInstance)
       {
       }
}

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

 

Ty man this is working but there is other problem, the players only see the Flaged State on herself but not on the other players here the screen:

 

7rj40.jpg

 

width=1024 height=578http://i.imgur.com/emKS6.jpg[/img]

 

Ok the problem is when the players Sapwn inside the Flaged Zone the others players can't see the Flaged Status, but when player Join on the Flaged Zone for themself it's works.

Posted

well that could be client part problem.. but in that case, you can still attack the player even tho if the char's name is not pink?.. and try to port to town and port back to the pvp zone,maybe that could make a difference.. :D

Posted

Ty man this is working but there is other problem, the players only see the Flaged State on herself but not on the other players here the screen:

 

7rj40.jpg

 

width=1024 height=578http://i.imgur.com/emKS6.jpg[/img]

try to broadcast their status
Posted

well that could be client part problem.. but in that case, you can still attack the player even tho if the char's name is not pink?.. and try to port to town and port back to the pvp zone,maybe that could make a difference.. :D

 

Ok the problem is when the players Sapwn inside the Flaged Zone the others players can't see the Flaged Status, but when player Join on the Flaged Zone for themself like walking inside  it's works.

 

Now about the Feature for Player to Get Res for himself this never worked.

 

jips8.jpg

 

Anyway thx to all the users who take the time for help me.

Posted

Ok the problem is when the players Sapwn inside the Flaged Zone the others players can't see the Flaged Status, but when player Join on the Flaged Zone for themself like walking inside  it's works.

 

as long as you can still attack even without flag status, then nothing to worry or to fix..

Posted

Ok the problem is when the players Sapwn inside the Flaged Zone the others players can't see the Flaged Status, but when player Join on the Flaged Zone for themself like walking inside  it's works.

 

Now about the Feature for Player to Get Res for himself this never worked.

try to broadcast their status (for flag visual bug)

and the second check this

 

public void onDieInside(L2Character character)
{
       if (character instanceof L2PcInstance)
       {
       }
}

nothing here :S

 

you must make something like this

 

if activeChar.isDead())
   activeChar.doRevive();

 

public void onDieInside(L2Character character)
{
  if (character instanceof L2PcInstance && activeChar.isDead())
              activeChar.doRevive();
}

 

activeChar or player or character what ever it got :P

 

edit: in this case it got character

Posted

Ok, the for fix the flag bug on teleport inside Flag Zone:

 

if (character instanceof L2PcInstance)
       {
    	   ((L2PcInstance) character).sendMessage("You enter a PvP Area");
           ((L2PcInstance) character).setPvpFlag(1);	
         +((L2PcInstance) character).broadcastUserInfo();
       }
}

@Override
protected void onExit(L2Character character)
{
	character.setInsideZone(L2Character.ZONE_PVP, false);
	character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, false);

	if (character instanceof L2PcInstance)
	{
		((L2PcInstance) character).stopNoblesseBlessing(null);
		((L2PcInstance) character).setPvpFlag(0);
	     +((L2PcInstance) character).broadcastUserInfo(); 
    	((L2PcInstance) character).sendMessage("You exit from a PvP Area");

 

Thx to AbSoLuTePoWeR

 

The only think that still missing is the Random Respawn thing.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...