Jump to content

Recommended Posts

Posted

Hello again !

 

I decided to re-share this code , ( i got many pm's requesting it )

 

So :

 


I want to share here , a mod i used to use on my server !

 

It is a custom PvP Zone That have some nice features to enjoy PvP's !

 

 

This Zone have :

 

1)Auto Nobless every time you die

2)Auto Flag on Enter

3)When you die , you have the oportunity to write .res and automatically you will respawed into the PvP zone on random locations !

 

For Example ,

 

Player2 got killed from player1

 

Then he have 2 options !

 

1st ) Is to press to village , and go to nearest town

2nd) is to write .res and re-spawned ( with auto noblesse ) into pvp zone  in different location each time !

 

 

In order to use .res feature player will need some Gold knight ( You can change this )

 

 

Ok , credits are mine (*NeverMore*)

 

 

How to apply ?

 

1) Create a new voicedcommandhandler with name Res.java and inside put this code :

 

/*
* 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 handlers.voicedcommandhandlers;

import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;


/**
* *NeverMore*
*
*/
public class Res implements IVoicedCommandHandler
{
    private static final String[] VOICED_COMMANDS = { "res" };

    public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
    {    
        if (command.equalsIgnoreCase("res"))
        {
              if (!activeChar.isAlikeDead())
              {
                 activeChar.sendMessage("You cannot be ressurected while alive.");
                 return false;
              }
           if(activeChar.isInOlympiadMode())
              {
              activeChar.sendMessage("You cannot use this feature during olympiad.");
             return false;
           }
           if(activeChar.isInJail())
             {
              activeChar.sendMessage("You cannot use this command while you are in Jail.");
             return false;
           }
           if(activeChar.isInDuel())
            {
             activeChar.sendMessage("You cannot use this feature during Duel.");
            return false;
          }
          if(activeChar.isFestivalParticipant())
           {
            activeChar.sendMessage("You cannot use this feature during a Festival.");
           return false;
          }
          if(activeChar.inObserverMode())
           {
            activeChar.sendMessage("You cannot use this feature during Observer Mode.");
           return false;
          }
           if(activeChar.getInventory().getItemByItemId(3483) == null)
           {
              activeChar.sendMessage("You need 500 or more Gold Knights to use the .res");
             return false;
           }   
       	if(activeChar instanceof L2PcInstance && ((L2PcInstance)activeChar).getWorldRegion().containsZone(5555))
       	{
              activeChar.sendMessage("You have been ressurected!");
              activeChar.getInventory().destroyItemByItemId("root", 3483, 500, activeChar, activeChar.getTarget());
              activeChar.doRevive();
              activeChar.broadcastUserInfo();
              activeChar.sendMessage("Good Fight !");     
        }
       	else 
       	{
       		activeChar.sendMessage(".res can only be used in PvP Area");
       	}
        }
       return true;
    }
    public String[] getVoicedCommandList()
    {
        return VOICED_COMMANDS;
    }

}

 

2)Now we need to import the vcm , so go to data/scripts/handlers/MasterHandler.java apply this code :

 

@@ -250 +258 @@
import handlers.voicedcommandhandlers.Lang;
+import handlers.voicedcommandhandlers.Res;
import handlers.voicedcommandhandlers.Wedding;

@@ -555 +570 @@

private static void loadVoicedHandlers()
{	
      +VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Res());
	if (Config.L2JMOD_ALLOW_WEDDING)
		VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Wedding());

 

 

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();
}
}

 

4) Now we should change the Zone Type of the area  ( I use Primeval Isle Warf )

go to : data/zones/peace_zones.xml and aply this code :

 

@@ -834 +847 @@
-	<zone name="primeval_peace1" type="PeaceZone" shape="NPoly" minZ="-4290" maxZ="-1290"> <!-- [20_17] -->
-		<node X="10408" Y="-27395" />
-		<node X="12065" Y="-25334" />
-		<node X="12223" Y="-23159" />
-		<node X="10424" Y="-22340" />
-		<node X="9566" Y="-23131" />
-		<node X="9290" Y="-24261" />
-	</zone>
-	<zone name=" primeval_peace2" type="PeaceZone" shape="NPoly" minZ="-4792" maxZ="208"> <!-- [20_17] -->
-		<node X="4850" Y="-4736" />
-		<node X="7294" Y="-4712" />
-		<node X="8529" Y="-820" />
-		<node X="3615" Y="-737" />
-	</zone>
+	<zone name="primeval_peace1" type="CustomPvP" shape="NPoly" minZ="-4290" maxZ="-1290"> <!-- [20_17] -->
+		<node X="10408" Y="-27395" />
+		<node X="12065" Y="-25334" />
+		<node X="12223" Y="-23159" />
+		<node X="10424" Y="-22340" />
+		<node X="9566" Y="-23131" />
+		<node X="9290" Y="-24261" />
+	</zone>
+	<zone name=" primeval_peace2" type="CustomPvP" shape="NPoly" minZ="-4792" maxZ="208"> <!-- [20_17] -->
+		<node X="4850" Y="-4736" />
+		<node X="7294" Y="-4712" />
+		<node X="8529" Y="-820" />
+		<node X="3615" Y="-737" />
+	</zone>

 

 

Here is an example , on how to add the coordinates

 

loc 1  x=1 y=2 z=3

loc 2  x=4 y=5 z=6

loc 3  x=7 y=8 z=9

 

you should make it like this

 

 

 

 private static int[] _x = {1, 4, 7};
    private static int[] _y = {2, 5, 8};
    private static int[] _z = {7, 8, 9 };

 


 

UPDATE 1

 

 

I test it on H% and it is not working as it is

 

So Here is the new coded with simple changes to work fine at H5 ! [3rd Step ONLY]

 

/*
* 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.util.Rnd;


/**
* An Custom PvP Zone
*
* @author  NeverMore
*/
public class L2CustomPvP extends L2RespawnZone
{
//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();
}
}

 


 

UPDATE 2

 

 

Here is a small fix if you want players to stay Flagged 10 seconds after they exit my Custom Pvp Zone

 

Index: trunk/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- trunk/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java   (revision 308)
+++ trunk/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java   (revision 309)
@@ -657,13 +657,17 @@
    {
        updatePvPFlag(1);

-       _PvPRegTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new PvPFlag(), 1000, 1000);
+       if (_PvPRegTask == null)
+           _PvPRegTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new PvPFlag(), 10000, 10000);
    }

    public void stopPvpRegTask()
    {
        if (_PvPRegTask != null)
+       {
            _PvPRegTask.cancel(true);
+           _PvPRegTask = null;
+       }
    }

    public void stopPvPFlag()

 

PS: Dont forget to Start Flag onExit !

Posted

I won't use it but If you tested it and it works then I gratz you.

AND I'll award you if a member test it and say it works because it's the 1st cool share I see for Freya - Hi5

Works 100 % because i use it ..!

 

But ok , if any1 tested reply with results ;)

Posted

im gonna test this and if it works im gonna use it on my server you should protect this with 100 post or something :D

Posted

FOR ME WORKS.. !!! Cool Share M8!! Keep It Up!!

Np ! Report me any prob , to fix it ;)

im gonna test this and if it works im gonna use it on my server you should protect this with 100 post or something :D

Done !

 

 

Thanks for good words !

Posted

You just took this code http://l2jfrozen.com/index.php?topic=4869.0

and you removed some parts.Not really smart.And this won't work btw.You get the flag but on kill you got karma

 

also another one is here http://www.-leeching-.net/forum/index.php?topic=11648.0

 

First of all , i dont use IL and i even not have an account on this forum ... ( l2j frozen )

Second,

.Res command can be made this way . . . if you know something more edvance then tell me  ;)

(For Example if i ask some1 make me this command he will make it this way) [ i quess ]

 

And about Gp share is completely different ... if you know java and read my code you will understand what i mean !

I am not a leeacher and everyone here know it ;)

 

Thanks for reply !

Posted

You just took this code http://l2jfrozen.com/index.php?topic=4869.0

and you removed some parts.Not really smart.And this won't work btw.You get the flag but on kill you got karma

 

also another one is here http://www.-leeching-.net/forum/index.php?topic=11648.0

lol i cant believe that nevermore is leacher

i saw his post in L2 Dev help section about this mod

and i am  sure its done by him 100%

 

On topic : nice share it work in freya l2jserver last  rev ?

Posted

lol i cant believe that nevermore is leacher

i saw his post in L2 Dev help section about this mod

and i am  sure its done by him 100%

 

On topic : nice share it work in freya l2jserver last  rev ?

 

;)

 

Yes it should work and for latest rev ;) If you have any prob , post it here to help you !

 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • This update resaves 25_25 from the original (with sounds) (without the cave below) Some emitter fixes (removed waterfalls with high-poly meshes) The geodata is old, but it works Everything else is unchanged Download P.S. The effect files are taken from the high client for Interlude, so if you're experiencing critical skills, use the default ones for your Version.  
    • GX-Ext Which file of the svn files should i edit to make blow skills to have 100% chance so i can add the settings in the IlExt.ini? because when im changing it from the skilldata.txt it just helps
    • 我们感谢您的 反馈 并希望让服务变得更加 优秀! 如果您使用过我们的服务并愿意分享您的体验(任何体验——积极或建设性),请在Trustpilot上留下评价,并获得$1作为感谢。 链接: https://www.trustpilot.com/review/socnet.pro 如何获得奖励: 1. 前往Trustpilot并留下您的评价 2. 向我们发送发布确认截图,以及带有与评价用户名一致的授权账户截图。 3. 指定哪个商店应收到这 $1 奖励。根据商店不同,可能需要您的用户名/电子邮箱。 您的反馈帮助我们成长,并让项目对社区中的每一位成员变得更好。感谢您与我们同行! 条款: 此活动仅适用于一个唯一用户。不允许多账号行为。 项目有效链接: 数字商品商店(网站): 前往 商店 Telegram 机器人: 前往 – 通过 Telegram 方便访问商店。 虚拟号码服务: 前往 用于购买 Telegram Stars 的 Telegram 机器人: 前往 – 在 Telegram 中快捷且优惠地购买 Stars。 SMM 面板: 前往 – 推广您的社交媒体账户。 我们想向您展示当前的 促销和特别优惠列表 用于购买我们提供的产品与服务: 1. 您可在首次购买时使用优惠码:SOCNET(15% 折扣) 2. 获得 $1 商店余额或 10–20% 折扣——只需在我们网站注册后,按照模板填写您的用户名:“SEND ME BONUS, MY USERNAME IS...”并在我们的论坛主题中发布! 3. 首次启动 SMM 面板可获得 $1:只需在我们的网站(Support)提交主题为 “Get Trial Bonus” 的工单。 4. 我们的 Telegram 频道以及 Stars 购买机器人中每周都有 Telegram Stars 抽奖! 新闻: ➡ Telegram 频道: https://t.me/accsforyou_shop ➡ WhatsApp 频道: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器: https://discord.gg/y9AStFFsrh 联系方式与支持: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock