Jump to content

Recommended Posts

Posted (edited)

Well, this event, like the title says, is about hunting the PK. (easy to code but funny for players, at least for me xd)

How it works? Whenever someone of your server gets PK there is a chance of 1/X to start the event, if the PK is unlucky and the event starts, automatically appear one announcement saying, for example, "PkHunter Event started: Wyatt is the PK, write .gopk to teleport where the pk was done.". Then, all players except the PK can use the command .gopk to teleport to that area.

You can also use .pkinfo to know if you are far or near from the pk location.

The first player that kills the PK will win the event.

While you are the PK of the event you can't use /unstuck, teleport scrolls, summon skills, mount, logout, restart, etc. and the system set 900000 karma to you.

 

Does the PK has any survival chance? Yes, one way is killing mobs to remove ALL karma; if the PK gets 0 karma, the PK wins.

There is another way to finish the event: if mobs kill the PK, also with no winners.

If the time of the event passes and the pk is still alive, the PK wins.

 

It's coded for L2jServer H5 stable but can easy be adapted to any pack/chronicle.

 

 

V.1 - Tested

DP side

Core Side

 

V.2 - Mostly tested, awaiting for reports

Added Timer to end the event if nothing happens.

Added reward for the pk if he survives when time/karma is over.

Added command .pkinfo to know if you are near or far from the pk location.

Added L2SkillTeleport instead of teleToLocation(), to move to event area.

DP side

Core Side

 

 

 

Credits: Wyatt

Location command: Leluche

Edited by ^Wyatt
  • Upvote 1
Posted

Quite good idea, but the PK guy won't be happy when he get killed and drop some nice items.. :D

 

As I see, there is only reward for killing the PK guy, right? I think there should be also a reward for survival :D

Posted

Quite good idea, but the PK guy won't be happy when he get killed and drop some nice items.. :D

Yep but in the event the Pk is protecting about dropping.

Nice that u told it coz I forgot to add it to the patch, I'm editing it in some minutes :P.

Posted

Yep but in the event the Pk is protecting about dropping.

Nice that u told it coz I forgot to add it to the patch, I'm editing it in some minutes :P.

 

Ohh, that's good. But from the other hand, not rly. Maybe make it configurable :)

 

Also, why not to let him mount a strider for example, he will have more chances to survive :D

Posted

Ohh, that's good. But from the other hand, not rly. Maybe make it configurable :)

 

Also, why not to let him mount a strider for example, he will have more chances to survive :D

That's up to users then, don't add the mount restriction XD I won't create 1000 configs, it's boring t.t...

 

edit:updated with the pk drop thing

Posted

There's some duration in this event? If the PK manage to get in a peace zone or restart/logout the event will keep run?

Yep there isn't but i'll update it with this kinda things I forgot in a v2. I'll put a timer, X minutes by config.

Btw if he manages to restart the event finishes.

 

Edit: there you go :D V.2

Posted

No found :S

 

Index: java/com/l2jserver/gameserver/network/clientpackets/RequestRestartPoint.java

===================================================================

--- java/com/l2jserver/gameserver/network/clientpackets/RequestRestartPoint.java (revision 5822)

+++ java/com/l2jserver/gameserver/network/clientpackets/RequestRestartPoint.java (working copy)

@@ -28,6 +28,7 @@

import com.l2jserver.gameserver.model.entity.Castle;

import com.l2jserver.gameserver.model.entity.ClanHall;

import com.l2jserver.gameserver.model.entity.Fort;

+import com.l2jserver.gameserver.model.entity.PkHunterEvent;

import com.l2jserver.gameserver.model.entity.TvTEvent;

import com.l2jserver.gameserver.model.entity.clanhall.SiegableHall;

 

@@ -76,6 +77,10 @@

if (TvTEvent.isStarted() && TvTEvent.isPlayerParticipant(activeChar.getObjectId()))

return;

 

+ if (PkHunterEvent.isPk(activeChar))

+ {

+ return;

+ }

//SystemMessage sm2 = SystemMessage.getSystemMessage(SystemMessage.S1_S2);

//sm2.addString("type:"+requestedPointType);

//activeChar.sendPacket(sm2);

 

Posted

Wow very interesting! You don't see such ideas very often. Here's some changes I propose :

 

1)Make the pk lose gear if he dies. There's no better survival motivation than protecting your gear. Else the PK will just die to get done with it and go do his things.

 

2).gotopk command should only move you to the location that the pk happened, not where the PK is. Also the command should be available about 20-30 secs after the pk has happened. This gives the pk some time to make a run for it.

 

3)The event should be on a timer, lets say 30 mins. If in 30 mins people can't get the pk, he wins and he gets some very very good prize.

 

4)Add a locate command so as people can see where the pk is going. I will contribute that command from my private collection :P

 

package org.bitbucket.customacis.herosystem.handlers;

import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.L2World;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.util.Util;

public class LocateHandler implements IVoicedCommandHandler{

@Override
public boolean useVoicedCommand(String command, L2PcInstance activeChar,
		String params) {

	if(params == null)
	{
		activeChar.sendMessage("Usage: .locate <playername> | Example: .locate xXBestArcherXx");
		return false;
	}

	L2PcInstance target = L2World.getInstance().getPlayer(params);

	if(target == null)
	{
		activeChar.sendMessage(params +" is not online.");
		return false;
	}

	double angle = activeChar.getHeading()/182.044444444;

	double angle2 = Util.calculateAngleFrom(activeChar, target);

	String location = "";
	String distance = "";

	double finalAngle = angle - angle2;

	if(finalAngle < 0)
		finalAngle +=360;

	double octamore = 22.5;

	if(finalAngle>=octamore*15 && finalAngle <octamore*17)
	{
		location = "infront of you";
	}
	else if(finalAngle >= octamore*1 && finalAngle < octamore * 3)
	{
		location = "infront of you on your left";
	}
	else if(finalAngle >= octamore*3 && finalAngle < octamore * 5)
	{
		location = "on your left";
	}
	else if(finalAngle >= octamore*5 && finalAngle < octamore * 7)
	{
		location = "behind you on your left";
	}
	else if(finalAngle >= octamore*7 && finalAngle < octamore * 9)
	{
		location = "behind you";
	}
	else if(finalAngle >= octamore*9 && finalAngle < octamore * 11)
	{
		location = "behind you on your right";
	}
	else if(finalAngle >= octamore*11 && finalAngle < octamore * 13)
	{
		location = "on your right";
	}
	else if(finalAngle >= octamore*13 && finalAngle < octamore * 15)
	{
		location = "infront of you on your right";
	}

	double dist = Util.calculateDistance(activeChar, target, false);

	if(dist < 400)
		distance = "very close";
	else if(dist < 1000)
		distance = "close";
	else if(dist < 4000)
		distance = "at medium range";
	else if(dist < 12000)
		distance = "quite some distance away";
	else if(dist < 20000)
		distance = "far away";
	else
		distance = "very very far away";
		activeChar.sendMessage(target.getName()+ " is " + location + " "+ distance+".");
	return false;
}

@Override
public String[] getVoicedCommandList() {

	return new String[]{"locate"};
}

}

 

Adjust it accordingly.

Posted

Wow very interesting! You don't see such ideas very often. Here's some changes I propose :

 

1)Make the pk lose gear if he dies. There's no better survival motivation than protecting your gear. Else the PK will just die to get done with it and go do his things.

2).gotopk command should only move you to the location that the pk happened, not where the PK is. Also the command should be available about 20-30 secs after the pk has happened. This gives the pk some time to make a run for it.

3)The event should be on a timer, lets say 30 mins. If in 30 mins people can't get the pk, he wins and he gets some very very good prize.

4)Add a locate command so as people can see where the pk is going. I will contribute that command from my private collection :P

1-I already put the config to set if the pk can drop or not

2-the command is only moving where the pk happened yes >_< and about the delay I dunno if I'll add it, I don't like at all the idea

3-the timer is already added too! i'll add the reward for the pk if survives ok

4-I like it, i'll try use it

Posted

30 secs delay might be a lot indeed, but clearly 0 isnt that great either. Cause once the pk happens, everyone will use the command to get to the pk really fast and kill him before he can even move. If I was a player, I would set the command in macro and once I see the event message, BOOM press the command get there kill him before he can make a run for it.

 

Oh, HAMBURGERS!  in 1:50 till the end. ;)

 

PS: For those that didn't see the southpark episode, Butters lost the PK Event ;)

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

    • what pack you use  send me on discord for it
    • package custom.events.RandomZoneEvent; import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.concurrent.ScheduledFuture; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.l2jmobius.commons.threads.ThreadPool; import org.l2jmobius.commons.time.SchedulingPattern; import org.l2jmobius.commons.time.TimeUtil; import org.l2jmobius.commons.util.IXmlReader; import org.l2jmobius.gameserver.managers.ZoneManager; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.quest.Event; import org.l2jmobius.gameserver.model.zone.ZoneId; import org.l2jmobius.gameserver.model.zone.ZoneType; import org.l2jmobius.gameserver.model.zone.type.RandomZone; import org.l2jmobius.gameserver.util.Broadcast; /** * Random Zone Event - Activates one random PvP zone temporarily. No modifica la clase de la zona: usa flags PvP en runtime. * @author Juan */ public class RandomZoneEvent extends Event { private static final String CONFIG_FILE = "data/scripts/custom/events/RandomZoneEvent/config.xml"; private static int EVENT_DURATION_MINUTES = 15; private static boolean _isActive = false; private ScheduledFuture<?> _eventTask = null; private final List<ZoneType> _availableZones = new ArrayList<>(); private ZoneType _activeZone = null; public RandomZoneEvent() { loadConfig(); loadZones(); registerZoneListeners(); } /** * Registra listeners a TODAS LAS ZONAS random */ private void registerZoneListeners() { for (ZoneType zone : _availableZones) { addEnterZoneId(zone.getId()); addExitZoneId(zone.getId()); LOGGER.info("[RandomZoneEvent] Registered listener for zone: " + zone.getName()); } } private void loadConfig() { new IXmlReader() { @Override public void load() { parseDatapackFile(CONFIG_FILE); } @Override public void parseDocument(Document doc, File file) { forEach(doc, "event", eventNode -> { final StatSet att = new StatSet(parseAttributes(eventNode)); final String name = att.getString("name"); for (Node node = eventNode.getFirstChild(); node != null; node = node.getNextSibling()) { if ("schedule".equals(node.getNodeName())) { final StatSet attributes = new StatSet(parseAttributes(node)); final String pattern = attributes.getString("pattern"); final SchedulingPattern schedulingPattern = new SchedulingPattern(pattern); final StatSet params = new StatSet(); params.set("Name", name); params.set("SchedulingPattern", pattern); final long delay = schedulingPattern.getDelayToNextFromNow(); getTimers().addTimer("Schedule_" + name, params, delay + 5000, null, null); LOGGER.info("[RandomZoneEvent] Event " + name + " scheduled at " + TimeUtil.getDateTimeString(System.currentTimeMillis() + delay)); } } }); } }.load(); } private void loadZones() { for (ZoneType zone : ZoneManager.getInstance().getAllZones(RandomZone.class)) { if ((zone.getName() != null) && zone.getName().toLowerCase().startsWith("random_zone")) { _availableZones.add(zone); LOGGER.info("[RandomZoneEvent] Loaded zone: " + zone.getName() + " (id=" + zone.getId() + ")"); } } LOGGER.info("[RandomZoneEvent] Total random zones loaded: " + _availableZones.size()); } @Override public void onTimerEvent(String event, StatSet params, Npc npc, Player player) { if (event.startsWith("Schedule_")) { eventStart(null); final SchedulingPattern schedulingPattern = new SchedulingPattern(params.getString("SchedulingPattern")); final long delay = schedulingPattern.getDelayToNextFromNow(); getTimers().addTimer(event, params, delay + 5000, null, null); LOGGER.info("[RandomZoneEvent] Rescheduled for " + TimeUtil.getDateTimeString(System.currentTimeMillis() + delay)); } } @Override public boolean eventStart(Player eventMaker) { if (_isActive) { if (eventMaker != null) { eventMaker.sendMessage("RandomZoneEvent already active."); } return false; } if (_availableZones.isEmpty()) { Broadcast.toAllOnlinePlayers("[RandomZoneEvent] No zones configured."); return false; } _isActive = true; Broadcast.toAllOnlinePlayers("⚔️ Random Zone Event has started!"); _eventTask = ThreadPool.schedule(this::activateRandomZone, 5_000); return true; } private void activateRandomZone() { _activeZone = _availableZones.get(new Random().nextInt(_availableZones.size())); _activeZone.setEnabled(true); Broadcast.toAllOnlinePlayers("🔥 Random Zone Event: " + _activeZone.getName() + " is now PvP for " + EVENT_DURATION_MINUTES + " minutes!"); _eventTask = ThreadPool.schedule(this::eventStop, EVENT_DURATION_MINUTES * 60 * 1000L); } @Override public boolean eventStop() { if (!_isActive) { return false; } _isActive = false; if (_eventTask != null) { _eventTask.cancel(true); _eventTask = null; } if (_activeZone != null) { _activeZone.setEnabled(false); Broadcast.toAllOnlinePlayers("🏁 Random Zone Event ended. " + _activeZone.getName() + " is back to normal."); _activeZone = null; } else { Broadcast.toAllOnlinePlayers("🏁 Random Zone Event ended."); } return true; } @Override public void onEnterZone(Creature creature, ZoneType zone) { if (!_isActive || (_activeZone == null)) { return; } if ((zone == _activeZone) && creature.isPlayable()) { creature.setInsideZone(ZoneId.PVP, true); if (creature.isPlayer()) { creature.sendMessage("Esta zona está en modo PvP temporalmente."); } } } @Override public void onExitZone(Creature creature, ZoneType zone) { if (!_isActive || (_activeZone == null)) { return; } if ((zone == _activeZone) && creature.isPlayable()) { creature.setInsideZone(ZoneId.PVP, false); if (creature.isPlayer()) { creature.sendMessage("Abandonaste la zona PvP temporal."); } } } @Override public boolean eventBypass(Player player, String bypass) { return true; } @Override public String onEvent(String event, Npc npc, Player player) { return super.onEvent(event, npc, player); } @Override public String onFirstTalk(Npc npc, Player player) { return null; } public static void main(String[] args) { new RandomZoneEvent(); } } i have this but its not working
    • ZonePvPSpawnBossRadio=0 ZonePvPSpawnBossBarakiel=0 at the Customs.ini in L2Server folder. Im prety sure this is it because i had the same problem with you in cruma 1 floor for example and i couldn't fix it but i fixed it finally by changing these 2 lines
    • Siege Reward Start PM Msg Rework Config root BossDieAnnounce and BossDieSound in the L24Team.properties and Config.java files for global raid boss death notifications and sounds. Adds a new reward_list table to the DB.sql file to track castle rewards. Improves character creation logic for thread safety and validation. Adds extensive state checks to the RequestEnchantItem method to prevent enchantments during inappropriate player states. Fixed auto-attack animation bug (there was no attack animation, only damage animation) Clean Code Other fixes I forgot to list! Java 14 Fixed issue where deleting a character would prevent it from leaving the screen or being removed, or even after a delete CD (it would only exit when re-logging in or creating a new character). Added Premium System from the other C2 project (Needs testing and improvement). Added the "Improved" Community Board (incomplete).
  • 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