Jump to content

Recommended Posts

Posted

Title says it all, im looking for a script which would allow me to set maximum enchantment limit for olympiad (Chronicle - Interlude (c6)).
Yes. bla bla bla, im stupid enough and can't find the code myself. Sorry if i post in wrong section, ain't big user of this forum :<<<<
This should be not only important for me, but for those 'legit' servers, where you can't find balance in olympiad.

Posted (edited)

Title says it all, im looking for a script which would allow me to set maximum enchantment limit for olympiad (Chronicle - Interlude (c6)).

Yes. bla bla bla, im stupid enough and can't find the code myself. Sorry if i post in wrong section, ain't big user of this forum :<<<<

This should be not only important for me, but for those 'legit' servers, where you can't find balance in olympiad.

I have shared this restriction in acis share section.

But this restriction is included in a bigger much so you have to export it on your own. :P

 

//Edit

 

Code: http://www.maxcheaters.com/topic/174057-share-acis-patch-no1/

Edited by `iAndre
Posted

I got the code from iAndre and addapt in on my source (rev 300 - acis ). I'm not 100% that is works!

 

what I did is:

 

Config.java

 

ALT_OLY_DIVIDER_NON_CLASSED = events.getProperty("AltOlyDividerNonClassed", 3);
ALT_OLY_ANNOUNCE_GAMES = events.getProperty("AltOlyAnnounceGames", true);
+ALLOW_OLY_GRADE_RESTR = events.getProperty("AllowOlyGradeRestr", false);
+MAX_ENCHANT_RESTR = events.getProperty("MaxEnchantRestr", 65535);
 
 
public static int ALT_OLY_DIVIDER_CLASSED;
public static int ALT_OLY_DIVIDER_NON_CLASSED;
public static boolean ALT_OLY_ANNOUNCE_GAMES;
+public static boolean ALLOW_OLY_GRADE_RESTR;
+public static int MAX_ENCHANT_RESTR;
 
event.properties
 
# Divider for points in classed and non-classed games, default: 3, 5.
AltOlyDividerClassed = 3
AltOlyDividerNonClassed = 5
+
+# Oly Grade Restriction #
+AllowOlyGradeRestr= True
+MaxEnchantRestr = 8
 
 
l2olympiadmanagerinstance.java
 
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.model.L2ItemInstance;
import net.sf.l2j.gameserver.model.L2Multisell;
import net.sf.l2j.gameserver.model.entity.Hero;
+import net.sf.l2j.gameserver.model.itemcontainer.Inventory;
import net.sf.l2j.gameserver.model.olympiad.CompetitionType;
import net.sf.l2j.gameserver.model.olympiad.Olympiad;
 
 
 
case 3: // There are %points% Grand Olympiad points granted for this event.
int points = Olympiad.getInstance().getNoblePoints(player.getObjectId());
html.setFile(Olympiad.OLYMPIAD_HTML_PATH + "noble_points1.htm");
html.replace("%points%", String.valueOf(points));
html.replace("%objectId%", String.valueOf(getObjectId()));
player.sendPacket(html);
break;
 
case 4: // register non classed based
+                       if (meetsRequirements(player))
+                      {
+                          OlympiadManager.getInstance().registerNoble(player, CompetitionType.NON_CLASSED);
+                      }
+break;
 
+case 5: // register classed based
+if (meetsRequirements(player))
+{
+       OlympiadManager.getInstance().registerNoble(player, CompetitionType.CLASSED);
+}
+break;
 
case 6: // request tokens reward
passes = Olympiad.getInstance().getNoblessePasses(player, false);
if (passes > 0)
{
html.setFile(Olympiad.OLYMPIAD_HTML_PATH + "noble_settle.htm");
html.replace("%objectId%", String.valueOf(getObjectId()));
player.sendPacket(html);
}
else
{
html.setFile(Olympiad.OLYMPIAD_HTML_PATH + "noble_nopoints2.htm");
html.replace("%objectId%", String.valueOf(getObjectId()));
player.sendPacket(html);
}
break;
 
 
 
 
 
 
}
else
super.onBypassFeedback(player, command);
}
      
+       public boolean meetsRequirements(L2PcInstance p)
+      {
+               if (Config.ALLOW_OLY_GRADE_RESTR)
+               {
+                       // Enchant checks.
+                       if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
+                       {
+                               p.sendMessage("You may not register for the Olympiad, as your weapon's enchant level is not the appropriate.");
+                               return false;
+                       }
+                       if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
+                       {
+                               p.sendMessage("You may not register for the Olympiad, as your armor's enchant level is not the appropriate.");
+                               return false;
+                       }
+                       if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_HEAD).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
+                       {
+                               p.sendMessage("You may not register for the Olympiad, as your armor's enchant level is not the appropriate.");
+                               return false;
+                       }
+                       if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
+                       {
+                               p.sendMessage("You may not register for the Olympiad, as your armor's enchant level is not the appropriate.");
+                               return false;
+                       }
+                       if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
+                       {
+                               p.sendMessage("You may not register for the Olympiad, as your armor's enchant level is not the appropriate.");
+                               return false;
+                       }
+                       if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
+                       {
+                               p.sendMessage("You may not register for the Olympiad, as your armor's enchant level is not the appropriate.");
+                               return false;
+                       }
+                       if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_UNDER).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
+                       {
+                               p.sendMessage("You may not register for the Olympiad, as your tattoo's enchant level is not the appropriate.");
+                               return false;
+                       }
+                       if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_NECK).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
+                       {
+                               p.sendMessage("You may not register for the Olympiad, as your necklace's enchant level is not the appropriate.");
+                               return false;
+                       }
+                       if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEAR).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
+                       {
+                               p.sendMessage("You may not register for the Olympiad, as your earring's enchant level is not the appropriate.");
+                               return false;
+                       }
+                       if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_REAR).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
+                       {
+                               p.sendMessage("You may not register for the Olympiad, as your earring's enchant level is not the appropriate.");
+                               return false;
+                       }
+                       if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LFINGER).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
+                       {
+                               p.sendMessage("You may not register for the Olympiad, as your ring's enchant level is not the appropriate.");
+                               return false;
+                       }
+                       if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RFINGER).getEnchantLevel() > Config.MAX_ENCHANT_RESTR)
+                       {
+                               p.sendMessage("You may not register for the Olympiad, as your ring's enchant level is not the appropriate.");
+                               return false;
+                       }
+               }
+              
               return true;
       }
}
 
I know they way I post it is a mess but I don't know how to post them correctly (lazy ass here). If you have some decent skills you can adapt it. 
Hope it works, if no correct me.
 
thank you.
 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • someone ban again this piece of shit this guy is a virus we should make an antikara or karabytes
    • 🍂 The cost on Vibe-sms is dropping, like autumn leaves falling from the trees.     It’s a little sad to watch the last days of summer fade away with its warmth, but that’s how the world works  every season has its own rules. The same goes for our prices: they are gradually but steadily going down, opening up new opportunities and great deals. 💸   🌍 USA is already at the minimum, and Europe, Asia, and dozens of other countries will follow soon. Don’t miss out  fresh rates are waiting for you!   Website link — https://vibe-sms.net/ Our Telegram channel — https://t.me/vibe_sms
    • You didn't tell me anywhere that you wanted core.jar as proof, I have everything ready for an independent developer to review. All the conversations, all your edits. I won't settle anything with you, so you can threaten me again and damage my name.
    • So what? Did i say anything wrong? You have no idea what source/compile is. I still wait for your .jar or source to be posted since you say i destroyed the compiled version of yours. Why you don't post it? Are you afraid that people will just see few addon lines and you did not even know that your source and compiled had different things? I should not even waste 2 minute to fix your raidboss_spawnlist thing.    Your mentally ill. What you posted is our primary deal nothing against me.  Because all he does is post whatever i write as if i hide and i did not say any mod to join and check my discord. i want him actual post something against me or any offenses i did. I also requested him several hours ago to post his .jar where my code "HACKED" his server but he wont post.    Nobody should allow open a random topic and cause issues to other's life without proofs. I demand punishment and soon unless he post evidence that i hurt his server or left him or did not make what he asked. 
  • 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