Jump to content

SweeTs

Legendary Member
  • Posts

    8,941
  • Joined

  • Last visited

  • Days Won

    25
  • Feedback

    0%

Everything posted by SweeTs

  1. I have no idea where are defined buffs in his buffer. But generally it's in __init__, if event bla bla. ----- If you don't do it on your own, you won't learn. Search where are defined buffs, and change it's lvl's. Ex. Dance of Vampire ID 3120 lvl 1 - it's normal vampire buff, but when u set lvl 130, it will be +30 Time. Check enchantskill .sql or .xml format, search for lvl and edit it in scheme.
  2. Check what id/lvl of skill is defined for ++ buff and change to it in buffers __init__?
  3. Yea, almost the same.
  4. While saving your changes, choose 413 version. Otherwise your system is bad patched :P
  5. I have no idea, try this MagicSkillUse MSU = new MagicSkillUse(player, player, 2024, 1, 1, 0); Anyway, here you go Casino with such effects. ### Eclipse Workspace Patch 1.0 #P aCis_gameserver Index: java/net/sf/l2j/gameserver/model/actor/instance/L2CasinoInstance.java =================================================================== --- java/net/sf/l2j/gameserver/model/actor/instance/L2CasinoInstance.java (revision 0) +++ java/net/sf/l2j/gameserver/model/actor/instance/L2CasinoInstance.java (revision 0) @@ -0,0 +1,469 @@ +package net.sf.l2j.gameserver.model.actor.instance; + +import javolution.text.TextBuilder; + +import net.sf.l2j.gameserver.ai.CtrlIntention; +import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse; +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage; +import net.sf.l2j.gameserver.network.serverpackets.SetupGauge; +import net.sf.l2j.gameserver.network.serverpackets.SocialAction; +import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate; +import net.sf.l2j.gameserver.ThreadPoolManager; +import net.sf.l2j.gameserver.util.Broadcast; +import net.sf.l2j.util.Rnd; + +public class L2CasinoInstance extends L2NpcInstance +{ + public String filename; + + public L2CasinoInstance(int objectId, L2NpcTemplate template) + { + super(objectId, template); + } + + @Override + public void onBypassFeedback(L2PcInstance player, String command) + { + if(player == null) + return; + + if(command.startsWith("play1") && player.getInventory().getInventoryItemCount(9142, 0) >= 2) + Casino1(player); + if(command.startsWith("play2") && player.getInventory().getInventoryItemCount(9142, 0) >= 4) + Casino2(player); + if(command.startsWith("play3") && player.getInventory().getInventoryItemCount(9142, 0) >= 8) + Casino3(player); + if(command.startsWith("play4") && player.getInventory().getInventoryItemCount(9142, 0) >= 16) + Casino4(player); + if(command.startsWith("play5") && player.getInventory().getInventoryItemCount(57, 0) >= 500000) + Casino5(player); + if(command.startsWith("play6") && player.getInventory().getInventoryItemCount(57, 0) >= 1000000) + Casino6(player); + if(command.startsWith("play7") && player.getInventory().getInventoryItemCount(57, 0) >= 10000000) + Casino7(player); + } + + public static void displayCongrats(L2PcInstance player) + { + player.broadcastPacket(new SocialAction(player, 3)); + MagicSkillUse MSU = new MagicSkillUse(player, player, 2024, 1, 1, 0); + player.broadcastPacket(MSU); + player.sendMessage("Congratulations! you won"); + } + + @Override + public void showChatWindow(L2PcInstance player, int val) + { + filename = (getHtmlPath(getNpcId(), val)); + NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId()); + msg.setHtml(casinoWindow(player)); + msg.replace("%objectId%", String.valueOf(this.getObjectId())); + player.sendPacket(msg); + } + + private String casinoWindow(L2PcInstance player) + { + TextBuilder tb = new TextBuilder(); + tb.append("<html><title>Casino Manager</title><body>"); + tb.append("<center>"); + tb.append("<br>"); + tb.append("<font color=\"999999\">Chance to win : 50%</font><br>"); + tb.append("<img src=\"L2UI.SquareGray\" width=\"200\" height=\"1\"><br>"); + tb.append("Welcome "+player.getName()+"<br>"); + tb.append("<tr><td>Double or Nothing ?</td></tr><br>"); + tb.append("<img src=\"L2UI.SquareGray\" width=\"280\" height=\"1\"></center><br>"); + tb.append("<center>"); + tb.append("Place your bets"); + tb.append("</center>"); + tb.append("<img src=\"L2UI.SquareGray\" width=\"280\" height=\"1\"></center><br>"); + tb.append("<br>"); + tb.append("<center>"); + tb.append("<tr>"); + tb.append("<td><button value=\"2 Apiga\" action=\"bypass -h npc_%objectId%_play1\" back=\"L2UI_ch3.bigbutton_over\" fore=\"L2UI_ch3.bigbutton\" width=95 height=21></td>"); + tb.append("<td><button value=\"4 Apiga\" action=\"bypass -h npc_%objectId%_play2\" back=\"L2UI_ch3.bigbutton_over\" fore=\"L2UI_ch3.bigbutton\" width=95 height=21></td>"); + tb.append("</tr>"); + tb.append("<tr>"); + tb.append("<td><button value=\"8 Apiga\" action=\"bypass -h npc_%objectId%_play3\" back=\"L2UI_ch3.bigbutton_over\" fore=\"L2UI_ch3.bigbutton\" width=95 height=21></td>"); + tb.append("<td><button value=\"16 Apiga\" action=\"bypass -h npc_%objectId%_play4\" back=\"L2UI_ch3.bigbutton_over\" fore=\"L2UI_ch3.bigbutton\" width=95 height=21></td>"); + tb.append("</tr>"); + tb.append("<tr>"); + tb.append("<td><button value=\"500k\" action=\"bypass -h npc_%objectId%_play5\" back=\"L2UI_ch3.bigbutton_over\" fore=\"L2UI_ch3.bigbutton\" width=95 height=21></td>"); + tb.append("<td><button value=\"1kk\" action=\"bypass -h npc_%objectId%_play6\" back=\"L2UI_ch3.bigbutton_over\" fore=\"L2UI_ch3.bigbutton\" width=95 height=21></td>"); + tb.append("</tr>"); + tb.append("<tr>"); + tb.append("<td><button value=\"10kk\" action=\"bypass -h npc_%objectId%_play7\" back=\"L2UI_ch3.bigbutton_over\" fore=\"L2UI_ch3.bigbutton\" width=95 height=21></td>"); + tb.append("</tr>"); + tb.append("</center>"); + tb.append("<center><img src=\"L2UI.SquareGray\" width=\"280\" height=\"1\">"); + tb.append("</body></html>"); + return tb.toString(); + } + + public static void Casino1(L2PcInstance player) + { + int unstuckTimer = 1000; + player.setTarget(player); + player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); + player.disableAllSkills(); + MagicSkillUse msk = new MagicSkillUse(player, 361, 1, unstuckTimer, 0); + Broadcast.toSelfAndKnownPlayersInRadius(player, msk, 810000); + SetupGauge sg = new SetupGauge(0, unstuckTimer); + player.sendPacket(sg); + + Casino1 ef = new Casino1(player); + ThreadPoolManager.getInstance().scheduleGeneral(ef, unstuckTimer); + } + + static class Casino1 implements Runnable + { + private L2PcInstance _player; + Casino1(L2PcInstance player) + { + _player = player; + } + public void run() + { + if(_player.isDead()) + return; + + _player.setIsIn7sDungeon(false); + _player.enableAllSkills(); + int chance = Rnd.get(2); + + if(_player.getInventory().getInventoryItemCount(9142, 0) >= 2) + { + if(chance == 0) + { + displayCongrats(_player); + _player.getInventory().addItem("Adena", 9142, 2, _player, null); + } + if(chance == 1) + { + _player.sendMessage("You lost the bet"); + _player.getInventory().destroyItemByItemId("Adena", 9142, 2, _player, null); + } + } + else + _player.sendMessage("You do not have eneough items."); + } + } + + public static void Casino2(L2PcInstance player) + { + int unstuckTimer = 1000; + player.setTarget(player); + player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); + player.disableAllSkills(); + MagicSkillUse msk = new MagicSkillUse(player, 361, 1, unstuckTimer, 0); + Broadcast.toSelfAndKnownPlayersInRadius(player, msk, 810000); + SetupGauge sg = new SetupGauge(0, unstuckTimer); + player.sendPacket(sg); + + Casino2 ef = new Casino2(player); + ThreadPoolManager.getInstance().scheduleGeneral(ef, unstuckTimer); + } + + static class Casino2 implements Runnable + { + private L2PcInstance _player; + Casino2(L2PcInstance player) + { + _player = player; + } + public void run() + { + if(_player.isDead()) + return; + + _player.setIsIn7sDungeon(false); + _player.enableAllSkills(); + int chance = Rnd.get(3); + + if(_player.getInventory().getInventoryItemCount(9142, 0) >= 4) + { + if(chance == 0) + { + displayCongrats(_player); + _player.getInventory().addItem("Adena", 9142, 4, _player, null); + } + if(chance == 1) + { + _player.sendMessage("You lost the bet"); + _player.getInventory().destroyItemByItemId("Adena", 9142, 4, _player, null); + } + if(chance == 2) + { + _player.sendMessage("You lost the bet"); + _player.getInventory().destroyItemByItemId("Adena", 9142, 4, _player, null); + } + } + else + _player.sendMessage("You do not have eneough items."); + } + } + + public static void Casino3(L2PcInstance player) + { + int unstuckTimer = 1000; + player.setTarget(player); + player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); + player.disableAllSkills(); + MagicSkillUse msk = new MagicSkillUse(player, 361, 1, unstuckTimer, 0); + Broadcast.toSelfAndKnownPlayersInRadius(player, msk, 810000); + SetupGauge sg = new SetupGauge(0, unstuckTimer); + player.sendPacket(sg); + + Casino3 ef = new Casino3(player); + ThreadPoolManager.getInstance().scheduleGeneral(ef, unstuckTimer); + } + + static class Casino3 implements Runnable + { + private L2PcInstance _player; + Casino3(L2PcInstance player) + { + _player = player; + } + public void run() + { + if(_player.isDead()) + return; + + _player.setIsIn7sDungeon(false); + _player.enableAllSkills(); + int chance = Rnd.get(3); + + if(_player.getInventory().getInventoryItemCount(9142, 0) >= 8) + { + if(chance == 0) + { + displayCongrats(_player); + _player.getInventory().addItem("Adena", 9142, 8, _player, null); + } + if(chance == 1) + { + _player.sendMessage("You lost the bet"); + _player.getInventory().destroyItemByItemId("Adena", 9142, 8, _player, null); + } + if(chance == 2) + { + _player.sendMessage("You lost the bet"); + _player.getInventory().destroyItemByItemId("Adena", 9142, 8, _player, null); + } + } + else + _player.sendMessage("You do not have eneough items."); + } + } + + public static void Casino4(L2PcInstance player) + { + int unstuckTimer = 1000; + player.setTarget(player); + player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); + player.disableAllSkills(); + MagicSkillUse msk = new MagicSkillUse(player, 361, 1, unstuckTimer, 0); + Broadcast.toSelfAndKnownPlayersInRadius(player, msk, 810000); + SetupGauge sg = new SetupGauge(0, unstuckTimer); + player.sendPacket(sg); + + Casino4 ef = new Casino4(player); + ThreadPoolManager.getInstance().scheduleGeneral(ef, unstuckTimer); + } + + static class Casino4 implements Runnable + { + private L2PcInstance _player; + Casino4(L2PcInstance player) + { + _player = player; + } + public void run() + { + if(_player.isDead()) + return; + + _player.setIsIn7sDungeon(false); + _player.enableAllSkills(); + int chance = Rnd.get(3); + + if(_player.getInventory().getInventoryItemCount(9142, 0) >= 16) + { + if(chance == 0) + { + displayCongrats(_player); + _player.getInventory().addItem("Adena", 9142, 16, _player, null); + } + if(chance == 1) + { + _player.sendMessage("You lost the bet"); + _player.getInventory().destroyItemByItemId("Adena", 9142, 16, _player, null); + } + if(chance == 2) + { + _player.sendMessage("You lost the bet"); + _player.getInventory().destroyItemByItemId("Adena", 9142, 16, _player, null); + } + } + else + _player.sendMessage("You do not have eneough items."); + } + } + + public static void Casino5(L2PcInstance player) + { + int unstuckTimer = 1000; + player.setTarget(player); + player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); + player.disableAllSkills(); + MagicSkillUse msk = new MagicSkillUse(player, 361, 1, unstuckTimer, 0); + Broadcast.toSelfAndKnownPlayersInRadius(player, msk, 810000); + SetupGauge sg = new SetupGauge(0, unstuckTimer); + player.sendPacket(sg); + + Casino5 ef = new Casino5(player); + ThreadPoolManager.getInstance().scheduleGeneral(ef, unstuckTimer); + } + + static class Casino5 implements Runnable + { + private L2PcInstance _player; + Casino5(L2PcInstance player) + { + _player = player; + } + public void run() + { + if(_player.isDead()) + return; + + _player.setIsIn7sDungeon(false); + _player.enableAllSkills(); + int chance = Rnd.get(2); + + if(_player.getInventory().getInventoryItemCount(57, 0) >= 500000) + { + if(chance == 0) + { + displayCongrats(_player); + _player.getInventory().addItem("Adena", 57, 500000, _player, null); + } + if(chance == 1) + { + _player.sendMessage("You lost the bet"); + _player.getInventory().destroyItemByItemId("Adena", 57, 500000, _player, null); + } + } + else + _player.sendMessage("You do not have eneough items."); + } + } + + public static void Casino6(L2PcInstance player) + { + int unstuckTimer = 1000; + player.setTarget(player); + player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); + player.disableAllSkills(); + MagicSkillUse msk = new MagicSkillUse(player, 361, 1, unstuckTimer, 0); + Broadcast.toSelfAndKnownPlayersInRadius(player, msk, 810000); + SetupGauge sg = new SetupGauge(0, unstuckTimer); + player.sendPacket(sg); + + Casino6 ef = new Casino6(player); + ThreadPoolManager.getInstance().scheduleGeneral(ef, unstuckTimer); + } + + static class Casino6 implements Runnable + { + private L2PcInstance _player; + Casino6(L2PcInstance player) + { + _player = player; + } + public void run() + { + if(_player.isDead()) + return; + + _player.setIsIn7sDungeon(false); + _player.enableAllSkills(); + int chance = Rnd.get(3); + + if(_player.getInventory().getInventoryItemCount(57, 0) >= 1000000) + { + if(chance == 0) + { + displayCongrats(_player); + _player.getInventory().addItem("Adena", 57, 1000000, _player, null); + } + if(chance == 1) + { + _player.sendMessage("You lost the bet"); + _player.getInventory().destroyItemByItemId("Adena", 57, 1000000, _player, null); + } + if(chance == 2) + { + _player.sendMessage("You lost the bet"); + _player.getInventory().destroyItemByItemId("Adena", 57, 1000000, _player, null); + } + } + else + _player.sendMessage("You do not have eneough items."); + } + } + + public static void Casino7(L2PcInstance player) + { + int unstuckTimer = 1000; + player.setTarget(player); + player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); + player.disableAllSkills(); + MagicSkillUse msk = new MagicSkillUse(player, 361, 1, unstuckTimer, 0); + Broadcast.toSelfAndKnownPlayersInRadius(player, msk, 810000); + SetupGauge sg = new SetupGauge(0, unstuckTimer); + player.sendPacket(sg); + + Casino7 ef = new Casino7(player); + ThreadPoolManager.getInstance().scheduleGeneral(ef, unstuckTimer); + } + + static class Casino7 implements Runnable + { + private L2PcInstance _player; + Casino7(L2PcInstance player) + { + _player = player; + } + public void run() + { + if(_player.isDead()) + return; + + _player.setIsIn7sDungeon(false); + _player.enableAllSkills(); + int chance = Rnd.get(3); + + if(_player.getInventory().getInventoryItemCount(57, 0) >= 10000000) + { + if(chance == 0) + { + displayCongrats(_player); + _player.getInventory().addItem("Adena", 57, 10000000, _player, null); + } + if(chance == 1) + { + _player.sendMessage("You lost the bet"); + _player.getInventory().destroyItemByItemId("Adena", 57, 10000000, _player, null); + } + if(chance == 2) + { + _player.sendMessage("You lost the bet"); + _player.getInventory().destroyItemByItemId("Adena", 57, 10000000, _player, null); + } + } + else + _player.sendMessage("You do not have eneough items."); + } + } +} \ No newline at end of file
  6. It's all about facking (useless) configs, so take a look there
  7. 1050 it's id of the skill, so simply check what skill uses fireworks.
  8. As you said, there is a lot of quest, so don't think that you will find someone who have test them. Anyway, most of them or all, who knows, probably works, but surely those quests has small bugs.
  9. Just read what he said..
  10. /target maximilion2 -- //kill ;D
  11. Once again wrong section, it should be HERE. Also, lmao at this [Hidden Text: You have to become a VIP or Donator Member to see it]
  12. Download and check.. It's script so you don't need any adaptation via eclipse..
  13. I just searched on google and I found something on russian site, and IF I understood well, it's smthing about java or mysql. So maybe try to reinstall it. :P
  14. Check your loginserver.prop configs, something may be wrong there.
  15. Some info to understand how it works :P Square shape just use 2 vertices: X------------- | | | | | | | | --------------X top left and bottom right, and then calculate the 2 others to form automatically a perfect square. --- Simply check XMLs on data/xml/zones, XMLs are listed according to their types, and you got plenty of examples for each type of zones.
  16. May be useful, but use [ code ] tag instead of [ quote ] and add [sHARE] tag to the topic name (all of your shares included).
  17. Jaj.. Read, read and once again read description.
  18. Damn, I'm not (100%) sure if it's a good idea about auto target. But, we will see how it goes when you create it. :) Great mod && idea ;)
  19. And I need someone to tell me the lucky numbers in Lotto. Please help me!
  20. Cool story bro.. but what's the problem?
  21. Nice, but you could (read should) translate it into English, even with google trans.
  22. w00t, did I missed something? :o
  23. Well, he means every position server gets (10,9,8 and up), there is a double reward. Your code works like this, or just if server go to the 1st page? Because I have doubt :P Ahh, that's good then ;)
  24. Surely, it's useful share since there is many old crappy non working codes. Good job :) For sure it's good and unique* idea :) * - Here I can quote our Mama Tryskell :D
×
×
  • 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