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

    • Gaining attention on Instagram today is more competitive than ever. Whether you're a content creator, entrepreneur, or influencer, building a loyal audience is essential—but often slow. That’s why many users turn to free Instagram followers to kickstart their growth and establish credibility early. With services like GoupSocial, you no longer have to wait months to build traction. By using tools such as instagram followers panel free and free smm panels, you can gain real followers and reach your goals faster. Why Free Instagram Followers Make a Difference Let’s face it—numbers matter. A higher follower count directly affects how others see your brand or profile. When people visit your account and see a big audience, they’re more likely to trust you, follow you, and engage with your content. Here’s how free Instagram followers impact your account: ✅ Boosted credibility: People associate large followings with trust and value. ✅ Greater reach: The Instagram algorithm favors high-engagement accounts. ✅ Brand appeal: Businesses want to collaborate with profiles that already have visibility. ✅ Faster momentum: Platforms like instagram free followers panel eliminate slow, organic-only growth paths. Add tools like free ig likes every 24 hours, and you're not just growing—you’re staying active and visible across the platform. Top Benefits of Using Free Instagram Followers 1. Gain Social Proof Instantly When visitors see a high follower count, it validates your profile. Tools like idigic Instagram followers allow you to generate this social proof fast—without compromising on quality. 2. Consistent Engagement With Likes and Views Pairing followers with tools like free ig likes every 24 hours ensures your content gets seen and interacted with. The algorithm loves engagement, and this keeps your posts fresh and prioritized. 3. Easier Entry Into Explore Page Profiles with high engagement have a better shot at being featured on trending pages. Platforms like igtools followers can help drive those early signals Instagram uses to recommend content. 4. Save Time While Looking Organic Building your presence takes time—unless you have help. With instagram free followers 100 real services, your account grows quickly and still looks natural, without spammy or fake-looking numbers. 5. Attract Collaborations With Brands Businesses look for influencers who can amplify their message. When your profile has strong numbers—boosted via instagram free followers like and free smm panels—you’re more likely to land partnerships and deals. Is It Safe to Get Free Instagram Followers? Yes, if done correctly. The key is using trusted sources. Some platforms fill your profile with bots, which can get your account flagged or banned. That’s why services like GoupSocial are essential—they deliver real, safe engagement through tools like instagram followers panel free. With idigic Instagram followers or igtools followers, the goal isn’t just more numbers—it’s smart, consistent growth that Instagram’s algorithm can respect. How to Use GoupSocial to Get Free Instagram Followers Getting started is simple: 🖊️ Enter your Instagram username 🎯 Choose the number of followers you want 🚀 Click "submit" and watch your count increase in real time Whether you want to test the waters with a few followers or boost engagement with free ig likes every 24 hours, GoupSocial has the tools to help. The Power of Using Growth Tools Strategically Gaining traction with free Instagram followers isn’t about cheating the system—it’s about working smarter. Using platforms that offer instagram free followers 100 real ensures you don’t just inflate numbers, but also increase your influence. Tools like instagram free followers like, free smm panels, and instagram followers panel free create a foundation of trust, engagement, and visibility. It’s the perfect launchpad for creators who want to focus on content—not on chasing every new follower manually. Start Strong, Grow Smarter Instagram success is no longer reserved for those with large budgets. With the right tools, anyone can build influence. Free Instagram followers from reputable services like GoupSocial help you achieve fast, safe, and impactful growth. Use features like free ig likes every 24 hours, explore tools like idigic Instagram followers, and make use of instagram free followers like strategies to grow with confidence. The power to scale is in your hands—start now and watch your audience thrive.
    • Buying & Selling FFXIV FFXI Horizon Eden and other server
    • Buying & Selling Torn City Cash
    • Added: payment method MidTrans - for Indonesia MercadoPago - for Brazil and etc.
  • 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