Jump to content

allanalcantara

Members
  • Posts

    155
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by allanalcantara

  1. Hey guys, Everything is right ? I came to bring a video on how to install server LINEAGE in linux. They were separated into two videos. Parte1: Is subtitled . Parte2: by me!
  2. 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!
  3. I think there are several people who have this system.! :/ but I will contact him to see if he can send me. thanks! :/
  4. yes friend, or at least at the time I saw him ... case is not thinking that it is good, say to me
  5. I need the source code to create a new config maager: topic : http://www.maxcheaters.com/topic/90051-sharel2server-manager/?hl=%2Bserver+%2Bmanager is old but works ^^ anyone have a valid link? thanks!
  6. if is dead or not, what matters is that it is a good source!!! :D :D :D :D without unnecessary discussions, please
  7. shut up b***! ;) i will go, trying! ¬¬' ====== fixed: problem: my stupidity, and donkeys who do not know answer! :D :D :D :D
  8. like it ------ I prefer the traditional, 100% works best. and works on any revision and Chronicle
  9. these things make me want to kill -'- ------------------------------------ take acm: but you need to translate link: http://www.mediafire.com/download/6piweq7cab3pqhp/Painel+de+Cadastro+-+acm.rar ss: after take a ban, or something does.. you not know why. stupid
  10. I have not used in h5, stupid. I'm saying, they are no calling random players, adapt IL.. Thank you for your help
  11. omg, friend, do you not understand? works with 500 players registed, but not calls, THE 2 .. know now?
  12. work in IL, but the event works only for 2 players More than two, error... protected void pickPlayers() { if(players.isEmpty() || players.size() < 2) { Announcements.getInstance().gameRandonFight("Random Fight Event aborted because no many partitipations, we are sorry."); clean(); return; } for(L2PcInstance p : players) if(p.isInOlympiadMode() || Olympiad.getInstance().isRegistered(p)) { players.remove(p); p.sendMessage("You automatically left from event because of your olympiad obligations."); } int rnd1=Rnd.get(players.size()); int rnd2=Rnd.get(players.size()); while(rnd2==rnd1) rnd2=Rnd.get(players.size()); for(L2PcInstance player : players) { if(player != players.get(rnd1) && player != players.get(rnd2)) players.remove(player); } Announcements.getInstance().gameRandonFight("Players selected: "+players.firstElement().getName()+" || "+players.lastElement().getName()); Announcements.getInstance().gameRandonFight("Players will be teleported in 15 seconds"); ThreadPoolManager.getInstance().scheduleGeneral(new teleportPlayers(), 15000); } rsrs
  13. problem, so little space in virtual memory, open you gameserver.bat and edit: java blablablabla -XX:MaxPermSize=512m (java 8 remove this option)
  14. Index: D:/workspace/aqua-core/src/main/java/com/l2jfree/Config.java =================================================================== --- D:/workspace/aqua-core/src/main/java/com/l2jfree/Config.java (revision 4934) +++ D:/workspace/aqua-core/src/main/java/com/l2jfree/Config.java (working copy) @@ -1473,6 +1473,34 @@ public static boolean ALT_ITEM_SKILLS_NOT_INFLUENCED; public static boolean ALT_MANA_POTIONS; public static int ALT_AUTOCHAT_DELAY; + + public static int CUBE_ITEM_1_REWARD; + public static int CUBE_CHANCE_1_MAX; + public static int CUBE_CHANCE_1_MIN; + public static int CUBE_ITEM_2_REWARD; + public static int CUBE_CHANCE_2_MAX; + public static int CUBE_CHANCE_2_MIN; + public static int CUBE_ITEM_3_REWARD; + public static int CUBE_CHANCE_3_MAX; + public static int CUBE_CHANCE_3_MIN; + public static int CUBE_ITEM_4_REWARD; + public static int CUBE_CHANCE_4_MAX; + public static int CUBE_CHANCE_4_MIN; + public static int CUBE_ITEM_5_REWARD; + public static int CUBE_CHANCE_5_MAX; + public static int CUBE_CHANCE_5_MIN; + public static int CUBE_ITEM_6_REWARD; + public static int CUBE_CHANCE_6_MAX; + public static int CUBE_CHANCE_6_MIN; + public static int CUBE_ITEM_7_REWARD; + public static int CUBE_CHANCE_7_MAX; + public static int CUBE_CHANCE_7_MIN; + public static int CUBE_ITEM_8_REWARD; + public static int CUBE_CHANCE_8_MAX; + public static int CUBE_CHANCE_8_MIN; + public static int CUBE_ITEM_9_REWARD; + public static int CUBE_CHANCE_9_MAX; + public static int CUBE_CHANCE_9_MIN; // ******************************************************************************************* // ******************************************************************************************* @@ -1686,6 +1714,34 @@ ALT_MANA_POTIONS = Boolean.parseBoolean(altSettings.getProperty("AllowManaPotions", "false")); ALT_AUTOCHAT_DELAY = Integer.parseInt(altSettings.getProperty("AutoChatDelay", "30000")); + + CUBE_ITEM_1_REWARD = Integer.parseInt(altSettings.getProperty("CubeEventReward1", "10634")); + CUBE_CHANCE_1_MAX = Integer.parseInt(altSettings.getProperty("RewardChanceMax1", "10")); + CUBE_CHANCE_1_MIN = Integer.parseInt(altSettings.getProperty("RewardChanceMin1", "1")); + CUBE_ITEM_2_REWARD = Integer.parseInt(altSettings.getProperty("CubeEventReward2", "10635")); + CUBE_CHANCE_2_MAX = Integer.parseInt(altSettings.getProperty("RewardChanceMax2", "20")); + CUBE_CHANCE_2_MIN = Integer.parseInt(altSettings.getProperty("RewardChanceMin2", "10")); + CUBE_ITEM_3_REWARD = Integer.parseInt(altSettings.getProperty("CubeEventReward3", "10636")); + CUBE_CHANCE_3_MAX = Integer.parseInt(altSettings.getProperty("RewardChanceMax3", "30")); + CUBE_CHANCE_3_MIN = Integer.parseInt(altSettings.getProperty("RewardChanceMin3", "20")); + CUBE_ITEM_4_REWARD = Integer.parseInt(altSettings.getProperty("CubeEventReward4", "10637")); + CUBE_CHANCE_4_MAX = Integer.parseInt(altSettings.getProperty("RewardChanceMax4", "40")); + CUBE_CHANCE_4_MIN = Integer.parseInt(altSettings.getProperty("RewardChanceMin4", "30")); + CUBE_ITEM_5_REWARD = Integer.parseInt(altSettings.getProperty("CubeEventReward5", "10638")); + CUBE_CHANCE_5_MAX = Integer.parseInt(altSettings.getProperty("RewardChanceMax5", "50")); + CUBE_CHANCE_5_MIN = Integer.parseInt(altSettings.getProperty("RewardChanceMin5", "40")); + CUBE_ITEM_6_REWARD = Integer.parseInt(altSettings.getProperty("CubeEventReward6", "10639")); + CUBE_CHANCE_6_MAX = Integer.parseInt(altSettings.getProperty("RewardChanceMax6", "60")); + CUBE_CHANCE_6_MIN = Integer.parseInt(altSettings.getProperty("RewardChanceMin6", "50")); + CUBE_ITEM_7_REWARD = Integer.parseInt(altSettings.getProperty("CubeEventReward7", "10640")); + CUBE_CHANCE_7_MAX = Integer.parseInt(altSettings.getProperty("RewardChanceMax7", "70")); + CUBE_CHANCE_7_MIN = Integer.parseInt(altSettings.getProperty("RewardChanceMin7", "60")); + CUBE_ITEM_8_REWARD = Integer.parseInt(altSettings.getProperty("CubeEventReward8", "10641")); + CUBE_CHANCE_8_MAX = Integer.parseInt(altSettings.getProperty("RewardChanceMax8", "80")); + CUBE_CHANCE_8_MIN = Integer.parseInt(altSettings.getProperty("RewardChanceMin8", "70")); + CUBE_ITEM_9_REWARD = Integer.parseInt(altSettings.getProperty("CubeEventReward9", "10642")); + CUBE_CHANCE_9_MAX = Integer.parseInt(altSettings.getProperty("RewardChanceMax9", "90")); + CUBE_CHANCE_9_MIN = Integer.parseInt(altSettings.getProperty("RewardChanceMin1", "80")); } catch (Exception e) { Index: D:/workspace/aqua-core/config/altsettings.properties =================================================================== --- D:/workspace/aqua-core/config/altsettings.properties (revision 4934) +++ D:/workspace/aqua-core/config/altsettings.properties (working copy) @@ -520,3 +520,44 @@ # ------------------------------------------------------------- # Allow usage of mana potions AllowManaPotions = False + +# ------------------------------------------------------------- +# Misterious Cube Event +# reward item ID es chance ertekek koztes ertek eseten adja a jutalmat +# ------------------------------------------------------------- +# reward 1 +CubeEventReward1 = 10634 +RewardChanceMax1 = 10 +RewardChanceMin1 = 1 +# reward 2 +CubeEventReward2 = 10635 +RewardChanceMax2 = 20 +RewardChanceMin2 = 10 +# reward 3 +CubeEventReward3 = 10636 +RewardChanceMax3 = 30 +RewardChanceMin3 = 20 +# reward 4 +CubeEventReward4 = 10637 +RewardChanceMax4 = 40 +RewardChanceMin4 = 30 +# reward 5 +CubeEventReward5 = 10638 +RewardChanceMax5 = 50 +RewardChanceMin5 = 40 +# reward 6 +CubeEventReward6 = 10639 +RewardChanceMax6 = 60 +RewardChanceMin6 = 50 +# reward 7 +CubeEventReward7 = 10640 +RewardChanceMax7 = 70 +RewardChanceMin7 = 60 +# reward 8 +CubeEventReward8 = 10641 +RewardChanceMax8 = 80 +RewardChanceMin8 = 70 +# reward 9 +CubeEventReward9 = 10642 +RewardChanceMax9 = 90 +RewardChanceMin9 = 80 \ No newline at end of file Index: D:/workspace/aqua-data/stats/skills/2400-2599.xml =================================================================== --- D:/workspace/aqua-data/stats/skills/2400-2599.xml (revision 4934) +++ D:/workspace/aqua-data/stats/skills/2400-2599.xml (working copy) + +<skill id="2510" levels="1" name="Mysterious Cube"> + <set name="target" val="TARGET_SELF"/> + <set name="skillType" val="MYSTERIOUS_CUBE"/> + <set name="operateType" val="OP_ACTIVE"/> + <set name="hitTime" val="1000"/> + <set name="reuseDelay" val="600000"/> + <set name="staticReuse" val="true"/> + <set name="castRange" val="-1"/> + <set name="effectRange" val="-1"/> +</skill> \ No newline at end of file Index: D:/workspace/aqua-core/src/main/java/com/l2jfree/gameserver/handler/ItemHandler.java =================================================================== --- D:/workspace/aqua-core/src/main/java/com/l2jfree/gameserver/handler/ItemHandler.java (revision 4934) +++ D:/workspace/aqua-core/src/main/java/com/l2jfree/gameserver/handler/ItemHandler.java (working copy) @@ -97,6 +97,7 @@ registerItemHandler(new SoulCrystals()); registerItemHandler(new SoulShots()); registerItemHandler(new SpiritLake()); + registerItemHandler(new WondrousCubic()); registerItemHandler(new SpiritShot()); registerItemHandler(new SummonItems()); registerItemHandler(new TransformationItems()); Index: D:/workspace/aqua-core/src/main/java/com/l2jfree/util/MTRandom.java =================================================================== --- D:/workspace/aqua-core/src/main/java/com/l2jfree/util/Rnd.java (revision 4934) +++ D:/workspace/aqua-core/src/main/java/com/l2jfree/util/Rnd.java (working copy) +/* + * 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.l2jfree.util; + +/**$ + * + * @author Balancer + * + */ +public class Rnd +{ + public static final double get() // get random number from 0 to 1 + { + return MTRandom.getInstance().getSecureRandom().nextDouble(); + } + + /** + * Gets a random number from 0(inclusive) to n(exclusive) + * + * @param n The superior limit (exclusive) + * @return A number from 0 to n-1 + */ + public static final int get(int n) // get random number from 0 to n-1 + { + return (int) (MTRandom.getInstance().getSecureRandom().nextDouble() * n); + } + + public static final int get(int min, int max) // get random number from min to max (not max-1 !) + { + return min + (int) Math.floor(MTRandom.getInstance().getSecureRandom().nextDouble() * (max - min + 1)); + } + + public static final int nextInt(int n) + { + return (int) Math.floor(MTRandom.getInstance().getSecureRandom().nextDouble() * n); + } + + public static final int nextInt() + { + return MTRandom.getInstance().getSecureRandom().nextInt(); + } + + public static final double nextDouble() + { + return MTRandom.getInstance().getSecureRandom().nextDouble(); + } + + public static final double nextGaussian() + { + return MTRandom.getInstance().getSecureRandom().nextGaussian(); + } + + public static final boolean nextBoolean() + { + return MTRandom.getInstance().getSecureRandom().nextBoolean(); + } + + public static final void nextBytes(byte[] array) + { + MTRandom.getInstance().getSecureRandom().nextBytes(array); + } +} Index: D:/workspace/aqua-core/src/main/java/com/l2jfree/util/MTRandom.java =================================================================== --- D:/workspace/aqua-core/src/main/java/com/l2jfree/util/MTRandom.java (revision 4934) +++ D:/workspace/aqua-core/src/main/java/com/l2jfree/util/MTRandom.java (working copy) +/* + * 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.l2jfree.util; + +import java.util.Random; + +public class MTRandom +{ + private Random _random = new Random(); + + private static MTRandom _instance; + + public Random getSecureRandom() + { + return _random; + } + + public static final MTRandom getInstance() + { + if (_instance == null) + _instance = new MTRandom(); + return _instance; + } + + private MTRandom() + { + } +} Index: D:/workspace/aqua-core/src/main/java/com/l2jfree/gameserver/handler/SkillHandler.java =================================================================== --- D:/workspace/aqua-core/src/main/java/com/l2jfree/gameserver/handler/SkillHandler.java (revision 4934) +++ D:/workspace/aqua-core/src/main/java/com/l2jfree/gameserver/handler/SkillHandler.java (working copy) @@ -63,6 +63,7 @@ registerSkillHandler(new Harvest()); registerSkillHandler(new Heal()); registerSkillHandler(new InstantJump()); + registerSkillHandler(new MysteriousCube()); registerSkillHandler(new MakeKillable()); registerSkillHandler(new Manadam()); registerSkillHandler(new ManaHeal()); Index: D:/workspace/aqua-core/src/main/java/com/l2jfree/gameserver/handler/skillhandlers/MysteriousCube.java =================================================================== --- D:/workspace/aqua-core/src/main/java/com/l2jfree/gameserver/handler/skillhandlers/MysteriousCube.java (revision 4934) +++ D:/workspace/aqua-core/src/main/java/com/l2jfree/gameserver/handler/skillhandlers/MysteriousCube.java (working copy) @@ -63,6 +63,7 @@ +/* + * 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.l2jfree.gameserver.handler.skillhandlers; + +import com.l2jfree.Config; +import com.l2jfree.gameserver.handler.ISkillHandler; +import com.l2jfree.gameserver.model.L2Character; +import com.l2jfree.gameserver.model.L2ItemInstance; +import com.l2jfree.gameserver.model.L2Object; +import com.l2jfree.gameserver.model.L2Skill; +import com.l2jfree.gameserver.model.actor.instance.L2PcInstance; +import com.l2jfree.gameserver.network.SystemMessageId; +import com.l2jfree.gameserver.network.serverpackets.InventoryUpdate; +import com.l2jfree.gameserver.network.serverpackets.SystemMessage; +import com.l2jfree.gameserver.templates.skills.L2SkillType; +import com.l2jfree.util.Rnd; + + +public class MysteriousCube implements ISkillHandler +{ + private static final L2SkillType[] SKILL_IDS = + { + L2SkillType.MYSTERIOUS_CUBE + }; + + public void useSkill(L2Character activeChar, L2Skill skill, L2Object[] targets) + { + int CUBE_EVENT_1_MAX = Config.CUBE_CHANCE_1_MAX; + int CUBE_EVENT_1_MIN = Config.CUBE_CHANCE_1_MIN; + int CUBE_EVENT_2_MAX = Config.CUBE_CHANCE_2_MAX; + int CUBE_EVENT_2_MIN = Config.CUBE_CHANCE_2_MIN; + int CUBE_EVENT_3_MAX = Config.CUBE_CHANCE_3_MAX; + int CUBE_EVENT_3_MIN = Config.CUBE_CHANCE_3_MIN; + int CUBE_EVENT_4_MAX = Config.CUBE_CHANCE_4_MAX; + int CUBE_EVENT_4_MIN = Config.CUBE_CHANCE_4_MIN; + int CUBE_EVENT_5_MAX = Config.CUBE_CHANCE_5_MAX; + int CUBE_EVENT_5_MIN = Config.CUBE_CHANCE_5_MIN; + int CUBE_EVENT_6_MAX = Config.CUBE_CHANCE_6_MAX; + int CUBE_EVENT_6_MIN = Config.CUBE_CHANCE_6_MIN; + int CUBE_EVENT_7_MAX = Config.CUBE_CHANCE_7_MAX; + int CUBE_EVENT_7_MIN = Config.CUBE_CHANCE_7_MIN; + int CUBE_EVENT_8_MAX = Config.CUBE_CHANCE_8_MAX; + int CUBE_EVENT_8_MIN = Config.CUBE_CHANCE_8_MIN; + int CUBE_EVENT_9_MAX = Config.CUBE_CHANCE_9_MAX; + int CUBE_EVENT_9_MIN = Config.CUBE_CHANCE_9_MIN; + + int chance = Rnd.get(1, 90); + + if ((chance > CUBE_EVENT_1_MIN) && (chance <= CUBE_EVENT_1_MAX)) + { + int itemId = Config.CUBE_ITEM_1_REWARD; + rewardPlayer(activeChar, itemId); + } + else if ((chance > CUBE_EVENT_2_MIN) && (chance <= CUBE_EVENT_2_MAX)) + { + int itemId = Config.CUBE_ITEM_2_REWARD; + rewardPlayer(activeChar, itemId); + } + else if ((chance > CUBE_EVENT_3_MIN) && (chance <= CUBE_EVENT_3_MAX)) + { + int itemId = Config.CUBE_ITEM_3_REWARD; + rewardPlayer(activeChar, itemId); + } + else if ((chance > CUBE_EVENT_4_MIN) && (chance <= CUBE_EVENT_4_MAX)) + { + int itemId = Config.CUBE_ITEM_4_REWARD; + rewardPlayer(activeChar, itemId); + } + else if ((chance > CUBE_EVENT_5_MIN) && (chance <= CUBE_EVENT_5_MAX)) + { + int itemId = Config.CUBE_ITEM_5_REWARD; + rewardPlayer(activeChar, itemId); + } + else if ((chance > CUBE_EVENT_6_MIN) && (chance <= CUBE_EVENT_6_MAX)) + { + int itemId = Config.CUBE_ITEM_6_REWARD; + rewardPlayer(activeChar, itemId); + } + else if ((chance > CUBE_EVENT_7_MIN) && (chance <= CUBE_EVENT_7_MAX)) + { + int itemId = Config.CUBE_ITEM_7_REWARD; + rewardPlayer(activeChar, itemId); + } + else if ((chance > CUBE_EVENT_8_MIN) && (chance <= CUBE_EVENT_8_MAX)) + { + int itemId = Config.CUBE_ITEM_8_REWARD; + rewardPlayer(activeChar, itemId); + } + else if ((chance > CUBE_EVENT_9_MIN) && (chance <= CUBE_EVENT_9_MAX)) + { + int itemId = Config.CUBE_ITEM_9_REWARD; + rewardPlayer(activeChar, itemId); + } + } + + private void rewardPlayer(L2Character activeChar, int itemId) + { + L2PcInstance player = (L2PcInstance) activeChar; + L2ItemInstance createdItem = player.getInventory().addItem("MystetiousCube", itemId, 1, player, player); + SystemMessage msg; + msg = new SystemMessage(SystemMessageId.EARNED_ITEM); + msg.addItemName(createdItem); + activeChar.sendPacket(msg); + + InventoryUpdate iu = new InventoryUpdate(); + iu.addModifiedItem(createdItem); + activeChar.sendPacket(iu); + } + + public L2SkillType[] getSkillIds() + { + return SKILL_IDS; + } +} Index: D:/workspace/aqua-core/src/main/java/com/l2jfree/gameserver/templates/skills/L2SkillType.java =================================================================== --- D:/workspace/aqua-core/src/main/java/com/l2jfree/gameserver/templates/skills/L2SkillType.java (revision 4934) +++ D:/workspace/aqua-core/src/main/java/com/l2jfree/gameserver/templates/skills/L2SkillType.java (working copy) @@ -126,6 +126,7 @@ REMOVE_TRAP, SHIFT_TARGET, INSTANT_JUMP, + MYSTERIOUS_CUBE, AGATHION(L2SkillAgathion.class), CHANGEWEAPON(L2SkillChangeWeapon.class), Index: D:/workspace/aqua-core/src/main/java/com/l2jfree/gameserver/handler/itemhandlers/WondrousCubic.jav =================================================================== --- D:/workspace/aqua-core/src/main/java/com/l2jfree/gameserver/handler/itemhandlers/WondrousCubic.jav (revision 4934) +++ D:/workspace/aqua-core/src/main/java/com/l2jfree/gameserver/handler/itemhandlers/WondrousCubic.java (working copy) @@ 00,00 +206,7 @@ +/* + * 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.l2jfree.gameserver.handler.itemhandlers; + +import com.l2jfree.gameserver.datatables.SkillTable; +import com.l2jfree.gameserver.handler.IItemHandler; +import com.l2jfree.gameserver.model.L2ItemInstance; +import com.l2jfree.gameserver.model.actor.instance.L2PcInstance; +import com.l2jfree.gameserver.model.actor.instance.L2PlayableInstance; +import com.l2jfree.gameserver.network.SystemMessageId; +import com.l2jfree.gameserver.network.serverpackets.SystemMessage; + +public class WondrousCubic implements IItemHandler +{ + private static final int[] ITEM_IDS = + { 10632 }; + + /** + * @see net.sf.l2j.gameserver.handler.IItemHandler#useItem(net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance, net.sf.l2j.gameserver.model.L2ItemInstance) + */ + public void useItem(L2PlayableInstance playable, L2ItemInstance item) + { + L2PcInstance activeChar = (L2PcInstance) playable; + + if (activeChar.getWeightPenalty() >= 3 || activeChar.getInventoryLimit() * 0.8 <= activeChar.getInventory().getSize()) + { + activeChar.sendPacket(new SystemMessage(SystemMessageId.SLOTS_FULL)); + return; + } + + + if (item.getItemId() == 10632) + { + activeChar.useMagic(SkillTable.getInstance().getInfo(2510, 1), true, false); + playable.destroyItem("Consume", item.getObjectId(), 1, null, false); + } + } + + /** + * @see net.sf.l2j.gameserver.handler.IItemHandler#getItemIds() + */ + public int[] getItemIds() + { + return ITEM_IDS; + } +} author; Balancer
×
×
  • Create New...