Jump to content

Recommended Posts

Posted (edited)
mini event to let the happy friends! rsrs ^^
 
info:
set //dropmonsters and wait 60secs to start
 
==========================================================
 
go to com.seuprojeto.gameserver.model.event
new DropMonstersEvent.java
package com.l2jdemonniac.gameserver.model.event;
 
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;
 
import javolution.util.FastList;
 
import com.l2jdemonniac.Config;
import com.l2jdemonniac.gameserver.datatables.sql.NpcTable;
import com.l2jdemonniac.gameserver.datatables.sql.SpawnTable;
import com.l2jdemonniac.gameserver.model.L2World;
import com.l2jdemonniac.gameserver.model.actor.instance.L2ItemInstance;
import com.l2jdemonniac.gameserver.model.actor.instance.L2PcInstance;
import com.l2jdemonniac.gameserver.model.entity.Announcements;
import com.l2jdemonniac.gameserver.model.spawn.L2Spawn;
import com.l2jdemonniac.gameserver.templates.L2NpcTemplate;
import com.l2jdemonniac.gameserver.thread.ThreadPoolManager;
import com.l2jdemonniac.util.database.L2DatabaseFactory;
import com.l2jdemonniac.util.random.Rnd;
 
/**
 * @author allanalcantara
 *         
 */
 
public class DropMonstersEvent implements Runnable
{
 
public static L2Spawn _mobsSpawn;
public static boolean TownMonsterAtivo = false;
public static int _bossHeading = 0;
@SuppressWarnings("unused")
public List<L2Spawn> _MonsterSpawn = new FastList<L2Spawn>();
 
static int[] mobs={ 21162, 21253, 21184, 21205, 21163, 21254, 21206, 21185, 21255, 21207, 21165, 21186 };
 
 
public void eventomanager()
{
TownMonsterAtivo = true;
Announcements.getInstance().gameAnnouncetoEvents("The event will start at 60 Seconds.");
waitSecs(60);
spawnMonstersEvent();
Announcements.getInstance().gameAnnouncetoEvents("The event will finish in 30 Minutes.");
wait(30);
ThreadPoolManager.getInstance().scheduleGeneral(new unspawnMonstersrun(), 1);
waitSecs(10);
TownMonsterAtivo = false;
Announcements.getInstance().gameAnnouncetoEvents("The event ended.");
}
 
class unspawnMonstersrun implements Runnable
{
@Override
public void run()
{
unspawnMonsters();
}
}
 
private void SpawnMonster1()
{
L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(mobs[Rnd.get(0, 11)]);// ID do mob
 
try
{
int valorr = 1;
 
while (valorr < 25)
{
_mobsSpawn = new L2Spawn(tmpl);
 
_mobsSpawn.setLocx(149013 + Rnd.get(950) - Rnd.get(350) + Rnd.get(150)); // loc x
_mobsSpawn.setLocy(16694 + Rnd.get(950) - Rnd.get(250) + Rnd.get(140)); // loc y
_mobsSpawn.setLocz(-1541); // loc z
 
_mobsSpawn.setAmount(1);
_mobsSpawn.setHeading(0);
_mobsSpawn.setRespawnDelay(150000);
_mobsSpawn.setLocation(0);
 
//SpawnTable.getInstance().addNewSpawn(_mobsSpawn, false); 
_MonsterSpawn.add(_mobsSpawn);
_mobsSpawn = null;
 
valorr++;
 
}
}
catch (Exception e)
{
System.out.println("Error in event");
}
}
 
private void SpawnMonster01()
{
L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(mobs[Rnd.get(0, 11)]);// ID do mob
 
try
{
int valorr = 1;
Announcements.getInstance().gameAnnouncetoEvents("The boxes are in Aden Castle.");
 
while (valorr < 30)
{
_mobsSpawn = new L2Spawn(tmpl);
 
_mobsSpawn.setLocx(145885 + Rnd.get(950) + (Rnd.get(50) * 2) - Rnd.get(350) + Rnd.get(150)); // loc x
_mobsSpawn.setLocy(16830 + Rnd.get(950) + (Rnd.get(30) * 2) - Rnd.get(310) + Rnd.get(130)); // loc y
_mobsSpawn.setLocz(-1560); // loc z
 
_mobsSpawn.setAmount(1);
_mobsSpawn.setHeading(0);
_mobsSpawn.setRespawnDelay(150000);
_mobsSpawn.setLocation(0);
 
//SpawnTable.getInstance().addNewSpawn(_mobsSpawn, false); 
_MonsterSpawn.add(_mobsSpawn);
_mobsSpawn = null;
 
valorr++;
 
}
}
catch (Exception e)
{
System.out.println("Error in event");
}
}
 
private void SpawnMonster2()
{
L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(mobs[Rnd.get(0, 11)]);// ID do mob
 
try
{
int valorr = 1;
 
while (valorr < 25)
{
_mobsSpawn = new L2Spawn(tmpl);
 
_mobsSpawn.setLocx(87054 + Rnd.get(950) + (Rnd.get(50) * 2) - Rnd.get(350) + Rnd.get(150)); // loc x
_mobsSpawn.setLocy(148844 + Rnd.get(950) - (Rnd.get(30) * 2) + Rnd.get(200) + Rnd.get(110)); // loc y
_mobsSpawn.setLocz(-3061); // loc z
 
_mobsSpawn.setAmount(1);
_mobsSpawn.setHeading(0);
_mobsSpawn.setRespawnDelay(150000);
_mobsSpawn.setLocation(0);
 
//SpawnTable.getInstance().addNewSpawn(_mobsSpawn, false); 
_MonsterSpawn.add(_mobsSpawn);
_mobsSpawn = null;
 
valorr++;
 
}
}
catch (Exception e)
{
System.out.println("Error in event");
}
}
 
private void SpawnMonster02()
{
L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(mobs[Rnd.get(0, 11)]);// ID do mob
 
try
{
int valorr = 1;
Announcements.getInstance().gameAnnouncetoEvents("The boxes are in entrance of Monastery.");
 
while (valorr < 30)
{
_mobsSpawn = new L2Spawn(tmpl);
 
_mobsSpawn.setLocx(124109 + Rnd.get(950) + (Rnd.get(50) * 2) - Rnd.get(350) + Rnd.get(150)); // loc x
_mobsSpawn.setLocy(-74952 + Rnd.get(950) + (Rnd.get(30) * 2) - Rnd.get(310) + Rnd.get(130)); // loc y
_mobsSpawn.setLocz(-2915); // loc z
 
_mobsSpawn.setAmount(1);
_mobsSpawn.setHeading(0);
_mobsSpawn.setRespawnDelay(150000);
_mobsSpawn.setLocation(0);
 
//SpawnTable.getInstance().addNewSpawn(_mobsSpawn, false); 
_MonsterSpawn.add(_mobsSpawn);
_mobsSpawn = null;
 
valorr++;
 
}
}
catch (Exception e)
{
System.out.println("Error in event");
}
}
 
private void SpawnMonster3()
{
L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(mobs[Rnd.get(0, 11)]);// ID do mob
 
try
{
int valorr = 1;
 
while (valorr < 25)
{
_mobsSpawn = new L2Spawn(tmpl);
 
_mobsSpawn.setLocx(124860 + Rnd.get(950) + (Rnd.get(50) * 2) - Rnd.get(350) + Rnd.get(150)); // loc x
_mobsSpawn.setLocy(-75504 + Rnd.get(950) + (Rnd.get(20) * 2) - Rnd.get(200) + Rnd.get(110)); // loc y
_mobsSpawn.setLocz(-2912); // loc z
 
_mobsSpawn.setAmount(1);
_mobsSpawn.setHeading(0);
_mobsSpawn.setRespawnDelay(150000);
_mobsSpawn.setLocation(0);
 
//SpawnTable.getInstance().addNewSpawn(_mobsSpawn, false); 
_MonsterSpawn.add(_mobsSpawn);
_mobsSpawn = null;
 
valorr++;
 
}
}
catch (Exception e)
{
System.out.println("Error in event");
}
}
 
private void SpawnMonster03()
{
L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(mobs[Rnd.get(0, 11)]);// ID do mob
 
try
{
int valorr = 1;
Announcements.getInstance().gameAnnouncetoEvents("The boxes are in Giran.");
 
while (valorr < 20)
{
_mobsSpawn = new L2Spawn(tmpl);
 
_mobsSpawn.setLocx(82732 + Rnd.get(950) + (Rnd.get(50) * 2) - Rnd.get(350) + Rnd.get(150)); // loc x
_mobsSpawn.setLocy(148723 + Rnd.get(950) + (Rnd.get(30) * 2) - Rnd.get(310) + Rnd.get(130)); // loc y
_mobsSpawn.setLocz(-3471); // loc z
 
_mobsSpawn.setAmount(1);
_mobsSpawn.setHeading(0);
_mobsSpawn.setRespawnDelay(150000);
_mobsSpawn.setLocation(0);
 
//SpawnTable.getInstance().addNewSpawn(_mobsSpawn, false); 
_MonsterSpawn.add(_mobsSpawn);
_mobsSpawn = null;
 
valorr++;
 
}
}
catch (Exception e)
{
System.out.println("Error in event");
}
}
 
private void SpawnMonster4()
{
L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(mobs[Rnd.get(0, 11)]);// ID do mob
 
try
{
int valorr = 1;
 
while (valorr < 25)
{
_mobsSpawn = new L2Spawn(tmpl);
 
_mobsSpawn.setLocx(81948 + Rnd.get(950) + (Rnd.get(30) * 2) - Rnd.get(350) + Rnd.get(150)); // loc x
_mobsSpawn.setLocy(147837 + Rnd.get(950) + (Rnd.get(30) * 2) - Rnd.get(200) + Rnd.get(110)); // loc y
_mobsSpawn.setLocz(-3471); // loc z
 
_mobsSpawn.setAmount(1);
_mobsSpawn.setHeading(0);
_mobsSpawn.setRespawnDelay(150000);
_mobsSpawn.setLocation(0);
 
//SpawnTable.getInstance().addNewSpawn(_mobsSpawn, false); 
_MonsterSpawn.add(_mobsSpawn);
_mobsSpawn = null;
 
valorr++;
 
}
}
catch (Exception e)
{
System.out.println("Error in event");
}
}
 
private void SpawnMonster04()
{
L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(mobs[Rnd.get(0, 11)]);// ID do mob
 
try
{
int valorr = 1;
Announcements.getInstance().gameAnnouncetoEvents("The boxes are in Near the Town of Dion.");
 
while (valorr < 15)
{
_mobsSpawn = new L2Spawn(tmpl);
 
_mobsSpawn.setLocx(19023 + Rnd.get(950) + (Rnd.get(50) * 2) - Rnd.get(350) + Rnd.get(150)); // loc x
_mobsSpawn.setLocy(141199 + Rnd.get(950) - (Rnd.get(30) * 2) + Rnd.get(200) + Rnd.get(110)); // loc y
_mobsSpawn.setLocz(-3340); // loc z
 
_mobsSpawn.setAmount(1);
_mobsSpawn.setHeading(0);
_mobsSpawn.setRespawnDelay(150000);
_mobsSpawn.setLocation(0);
 
//SpawnTable.getInstance().addNewSpawn(_mobsSpawn, false); 
_MonsterSpawn.add(_mobsSpawn);
_mobsSpawn = null;
 
valorr++;
 
}
}
catch (Exception e)
{
System.out.println("Error in event");
}
}
 
private void SpawnMonster5()
{
L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(mobs[Rnd.get(0, 11)]);// ID do mob
 
try
{
int valorr = 1;
 
while (valorr < 25)
{
_mobsSpawn = new L2Spawn(tmpl);
 
_mobsSpawn.setLocx(20781 + Rnd.get(950) + (Rnd.get(50) * 2) - Rnd.get(350) + Rnd.get(150)); // loc x
_mobsSpawn.setLocy(140355 + Rnd.get(950) - (Rnd.get(30) * 2) + Rnd.get(200) + Rnd.get(110)); // loc y
_mobsSpawn.setLocz(-3464); // loc z
 
_mobsSpawn.setAmount(1);
_mobsSpawn.setHeading(0);
_mobsSpawn.setRespawnDelay(150000);
_mobsSpawn.setLocation(0);
 
//SpawnTable.getInstance().addNewSpawn(_mobsSpawn, false); 
_MonsterSpawn.add(_mobsSpawn);
_mobsSpawn = null;
 
valorr++;
 
}
}
catch (Exception e)
{
System.out.println("Error in event");
}
}
 
private void SpawnMonster05()
{
L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(mobs[Rnd.get(0, 11)]);// ID do mob
 
try
{
int valorr = 1;
Announcements.getInstance().gameAnnouncetoEvents("The boxes are in west of gludin, Near the harbor.");
 
while (valorr < 20)
{
_mobsSpawn = new L2Spawn(tmpl);
 
_mobsSpawn.setLocx(-86372 + Rnd.get(950) + (Rnd.get(50) * 2) - Rnd.get(350) + Rnd.get(150)); // loc x
_mobsSpawn.setLocy(150012 + Rnd.get(950) - (Rnd.get(30) * 2) + Rnd.get(200) + Rnd.get(110)); // loc y
_mobsSpawn.setLocz(-3061); // loc z
 
_mobsSpawn.setAmount(1);
_mobsSpawn.setHeading(0);
_mobsSpawn.setRespawnDelay(150000);
_mobsSpawn.setLocation(0);
 
//SpawnTable.getInstance().addNewSpawn(_mobsSpawn, false); 
_MonsterSpawn.add(_mobsSpawn);
_mobsSpawn = null;
 
valorr++;
 
}
}
catch (Exception e)
{
System.out.println("Error in event");
}
}
 
public static void waitSecs(int i)
{
try
{
Thread.sleep(i * 1000);
}
catch (InterruptedException ie)
{
ie.printStackTrace();
}
}
 
public static void wait(int i)
{
try
{
Thread.sleep(i * 60000);
}
catch (InterruptedException ie)
{
ie.printStackTrace();
}
}
 
public final List<L2Spawn> getMonsterIds()
{
return _MonsterSpawn;
}
 
public void unspawnMonsters()
{
for (L2Spawn spawn : getMonsterIds())
{
spawn.stopRespawn();
spawn.getLastSpawn().doDie(spawn.getLastSpawn());
}
 
getMonsterIds().clear();
}
 
public void spawnMonstersEvent()
{
int city = Rnd.get(5) + 1;
if (city == 1)
{
SpawnMonster1();
SpawnMonster01();
}
else if (city == 2)
{
SpawnMonster2();
SpawnMonster02();
}
else if (city == 3)
{
SpawnMonster3();
SpawnMonster03();
}
else if (city == 4)
{
SpawnMonster4();
SpawnMonster04();
}
else if (city == 5)
{
SpawnMonster5();
SpawnMonster05();
}
for (L2Spawn spawn : getMonsterIds())
if (spawn != null)
{
spawn.init();
}
}
 
@Override
public void run()
{
if (TownMonsterAtivo == true)
{
return;
}
 
eventomanager();
 
} 
}
 
go com.seuprojeto.gameserver.handler.admincommandhandlers
new AdminDropMonstersEvent.java
package com.l2jdemonniac.gameserver.handler.admincommandhandlers;
 
import com.l2jdemonniac.Config;
import com.l2jdemonniac.gameserver.handler.IAdminCommandHandler;
import com.l2jdemonniac.gameserver.model.actor.instance.L2PcInstance;
import com.l2jdemonniac.gameserver.model.entity.event.DropMonstersEvent;
import com.l2jdemonniac.gameserver.thread.ThreadPoolManager;
 
public class AdminDropMonstersEvent implements IAdminCommandHandler
{
 
public AdminDropMonstersEvent()
{
}
 
@Override
public boolean useAdminCommand(String command, L2PcInstance activeChar)
{
if (command.startsWith("admin_dropmonsters"))
{
ThreadPoolManager.getInstance().scheduleGeneral(new DropMonstersEvent(), 1);
}
return true;
}
 
@Override
public String[] getAdminCommandList()
{
return ADMIN_COMMANDS;
}
 
private static final String ADMIN_COMMANDS[] =
{
"admin_dropmonsters"
};
 
}
 
dont forget:
 
AdminCommandHandler:
import com.l2jdemonniac.gameserver.handler.admincommandhandlers.AdminRandomFight;
+import com.l2jdemonniac.gameserver.handler.admincommandhandlers.AdminDropMonstersEvent;
======
registerAdminCommandHandler(new AdminRandomFight());
+registerAdminCommandHandler(new AdminDropMonstersEvent());

 

basically its a event where you choose the id of the monsters " make some specials ones or w.e"  setup a spawner, with random spawn " X coordinate - randomly generated number etc.) From what the code states there are 4 different spawner's, and it gets picked at random, so for example if it rolls aden castle, like the coordinates suggests then it will spawn the monsters there, and so on.

People have X amount of time to kill them and get special rewards, then after that X amount of time mobs disappear and then you can set the timer or set them manually from the admin commands.

events by me

 
thx, enjoy!
Edited by allanalcantara
Posted

From reading the code, 

 

basically its a event where you choose the id of the monsters " make some specials ones or w.e"  setup a spawner, with random spawn " X coordinate - randomly generated number etc.) From what the code states there are 4 different spawner's, and it gets picked at random, so for example if it rolls aden castle, like the coordinates suggests then it will spawn the monsters there, and so on.

 

People have X amount of time to kill them and get special rewards, then after that X amount of time mobs disappear and then you can set the timer or set them manually from the admin commands.

Posted

Maybe you could add a description ?

What the hell is that event .. ?!

¬¬'

 

From reading the code, 

 

basically its a event where you choose the id of the monsters " make some specials ones or w.e"  setup a spawner, with random spawn " X coordinate - randomly generated number etc.) From what the code states there are 4 different spawner's, and it gets picked at random, so for example if it rolls aden castle, like the coordinates suggests then it will spawn the monsters there, and so on.

 

People have X amount of time to kill them and get special rewards, then after that X amount of time mobs disappear and then you can set the timer or set them manually from the admin commands.

thx you for informing! :]

  • 4 months later...
Posted (edited)

can you make it for Hi5 please

 

 Revision 6670 server
Revision 10490:DataPack_BETA

 

how and where i need to put  DropMonstersEvent.java

and were i need to put

registerAdminCommandHandler(new AdminDropMonstersEvent());

 

thanks

Edited by Attila
  • 2 weeks later...
  • Vision locked this topic
Guest
This topic is now closed to further replies.


  • Posts

    • From Salvation onwards I think you need a patched nwindow.dll that allows such modifications, try to see if you get what you need here: https://drive.google.com/drive/u/1/folders/1LLbQFGf8KlR-O0Iv5umfF-pwZgrDh9bd
    • hello everyone! I am wanting to save the files (Ini. - Data - ) of the EP5 Client: Salvation... But they generate the error "corrupt files"... I tried several versions of L2FileEditor without good results. I need help! Thank you!
    • Opening December 6th at 19:00 (GMT +3)! Open Beta Test from November 30th!   https://l2soe.com/   🌟 Introducing L2 Saga of Eternia: A Revolution in Lineage 2 High Five! 🌟   Dear Lineage 2 enthusiasts, Prepare to witness the future of private servers! L2 Saga of Eternia is not just another High Five project—it’s a game-changing experience designed to compete with the giants of the Lineage 2 private server scene. Built for the community, by the community, we’re here to raise the bar in quality, innovation, and longevity. What Sets Us Apart? 💎 No Wipes, Ever Say goodbye to the fear of losing your progress. Our server is built to last and will never close. Stability and consistency are our promises to you. ⚔️ Weekly New Content Our dedicated development team ensures fresh challenges, events, and updates every week. From custom quests to exclusive features, there will always be something exciting to explore. 💰 No Pay-to-Win Skill and strategy matter most here. Enjoy a balanced gameplay environment where your achievements come from effort, not your wallet. 🌍 A Massive Community With 2000+ players expected, join a vibrant and active community of like-minded adventurers ready to conquer the world of Aden. 🏆 Fair and Competitive Gameplay Our systems are designed to promote healthy competition while avoiding abusive mechanics and exploits. 🔧 Professional Development From advanced bug fixes to carefully curated content, we pride ourselves on smooth performance, no lag, and unparalleled server quality. Key Features Chronicle: High Five with unique interface Rate: Dynamic x10 rates Class Balance: Carefully fine-tuned for a fair experience PvP Focused: PvP Ranking & aura display effect for 3 Top PvPers every week Custom Events: Seasonal and permanent events to keep you engaged Additional Features:   Custom Endgame Content: Introduce unique dungeons, raids, or zones unavailable in other servers. Player-Driven Economy: Implement a strong market system and avoid overinflated drops or rewards. Epic Siege Battles: Announce special large-scale sieges and PvP events. Incentives for Streamers and Clans: Attract influencers and big clans to boost server publicity. Roadmap Transparency: Share a public roadmap of planned updates to build trust and excitemen   Here you can read all the features: https://l2soe.com/features   Video preview: Join the Revolution! This is your chance to be part of something legendary. L2 Saga of Eternia is not just a server; it’s a movement to redefine what Lineage 2 can be. Whether you’re a seasoned veteran or a newcomer to the world of Aden, we invite you to experience Lineage 2 at its finest.   Official Launch Date: December 6th 2024 Website: https://l2soe.com/ Facebook: https://www.facebook.com/l2soe Discord: https://discord.com/invite/l2eternia   Let’s build the ultimate Lineage 2 experience together. See you in-game! 🎮
    • That's like a tutorial on how to run l2 on MacOS Xd but good job for the investigation. 
    • small update: dc robe set sold   wts adena 1kk = 1.5$ 
  • Topics

×
×
  • Create New...