Jump to content

Recommended Posts

Posted

Starting buffs for newbie characters.

### Eclipse Workspace Patch 1.0
#P Hero-GS
Index: config/players.properties
===================================================================
--- config/players.properties (revision 36)
+++ config/players.properties (working copy)
@@ -5,6 +5,15 @@
 #Amount of adenas that a new character is given, default is 100
 StartingAdena = 250000
 
+#Newbie Characters have starting buffs
+StartingBuffs = True
+
+#Starting Buffs for Mystics.
+StartingBuffsMage = 1204,2;1085,3;
+
+#Starting Buffs for Fighters.
+StartingBuffsFighter = 1204,2;1086,2;
+
 # If True, when effects of the same stack group are used, lesser
 # effects will be canceled if stronger effects are used. New effects
 # that are added will be canceled if they are of lesser priority to the old one.
Index: java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java (revision 35)
+++ java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java (working copy)
@@ -22,15 +22,18 @@
 import net.sf.l2j.gameserver.datatables.SkillTreeTable;
 import net.sf.l2j.gameserver.idfactory.IdFactory;
 import net.sf.l2j.gameserver.model.L2ShortCut;
+import net.sf.l2j.gameserver.model.L2Skill;
 import net.sf.l2j.gameserver.model.L2SkillLearn;
 import net.sf.l2j.gameserver.model.L2World;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.gameserver.model.actor.template.PcTemplate;
 import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
 import net.sf.l2j.gameserver.model.item.kind.Item;
+import net.sf.l2j.gameserver.network.SystemMessageId;
 import net.sf.l2j.gameserver.network.serverpackets.CharCreateFail;
 import net.sf.l2j.gameserver.network.serverpackets.CharCreateOk;
 import net.sf.l2j.gameserver.network.serverpackets.CharSelectInfo;
+import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
 import net.sf.l2j.gameserver.scripting.Quest;
 import net.sf.l2j.gameserver.scripting.ScriptManager;
 
@@ -146,6 +149,7 @@
  newChar.addAdena("Init", Config.STARTING_ADENA, null, false);
     }
+        if(Config.STARTING_BUFFS)
+        {
+         if(!newChar.isMageClass())
+         {
+         for (int[] buff : Config.STARTING_BUFFS_F) //Custom buffs for fighters
+         {
+         L2Skill skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
+         if (skill != null)
+         {
+         skill.getEffects(newChar, newChar);
+         newChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT).addSkillName(buff[0]));
+         }
+         }
+         }
+         else
+         {
+         for (int[] buff : Config.STARTING_BUFFS_M) //Custom buffs for mystics
+         {
+         L2Skill skill = SkillTable.getInstance().getInfo(buff[0], buff[1]); 
+         if (skill != null)
+         {
+         skill.getEffects(newChar, newChar);
+         newChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT).addSkillName(buff[0]));
+         }
+         }
+         }        
+        }
  newChar.setXYZInvisible(template.getSpawnX(), template.getSpawnY(), template.getSpawnZ());
  newChar.setTitle("");
  
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java (revision 46)
+++ java/net/sf/l2j/Config.java (working copy)
@@ -401,6 +401,9 @@
  
  /** Misc */
  public static int STARTING_ADENA;
+ public static boolean STARTING_BUFFS;
+ public static List<int[]> STARTING_BUFFS_M = new ArrayList<int[]>(); 
+ public static List<int[]> STARTING_BUFFS_F = new ArrayList<int[]>();
  public static boolean EFFECT_CANCELING;
  public static double HP_REGEN_MULTIPLIER;
  public static double MP_REGEN_MULTIPLIER;
@@ -1075,6 +1078,47 @@
  // players
  ExProperties players = load(PLAYERS_FILE);
  STARTING_ADENA = players.getProperty("StartingAdena", 100);
+ STARTING_BUFFS = players.getProperty("StartingBuffs", true);
+ String[] propertySplit = players.getProperty("StartingBuffsMage", "1204,2").split(";");
+ STARTING_BUFFS_M.clear();
+ for (String buff : propertySplit)
+ {
+ String[] buffSplit = buff.split(",");
+ if (buffSplit.length != 2)
+ _log.warning("StartingBuffsMage[Config.load()]: invalid config property -> StartingBuffsMage \"" + buff + "\"");
+ else
+ {
+ try
+ {
+ STARTING_BUFFS_M.add(new int[]{Integer.parseInt(buffSplit[0]), Integer.parseInt(buffSplit[1])});
+ }
+             catch (NumberFormatException nfe)
+             {
+             if (STARTING_BUFFS_M.equals(""))
+             System.out.println("EROOOOOOOOOOOR WITH STARTING BUFS");
+             }
+ }
+ }
+ propertySplit = players.getProperty("StartingBuffsFighter", "1204,2").split(";");
+ STARTING_BUFFS_F.clear();
+ for (String buff : propertySplit)
+ {
+ String[] buffSplit = buff.split(",");
+ if (buffSplit.length != 2)
+ _log.warning("StartingBuffsFighter[Config.load()]: invalid config property -> StartingBuffsFighter \"" + buff + "\"");
+ else
+ {
+ try
+ {
+ STARTING_BUFFS_F.add(new int[]{Integer.parseInt(buffSplit[0]), Integer.parseInt(buffSplit[1])});
+ }
+             catch (NumberFormatException nfe)
+             {
+             if (STARTING_BUFFS_F.equals(""))
+             System.out.println("EROOOOOOOOOOOR WITH STARTING BUFS");
+             }
+ }
+ }     
  EFFECT_CANCELING = players.getProperty("CancelLesserEffect", true);
  HP_REGEN_MULTIPLIER = players.getProperty("HpRegenMultiplier", 1.);
  MP_REGEN_MULTIPLIER = players.getProperty("MpRegenMultiplier", 1.);
Posted
+        if(Config.STARTING_BUFFS)
+        {
+         if(!newChar.isMageClass())
+         {
+         for (int[] buff : Config.STARTING_BUFFS_F) //Custom buffs for fighters
+         {
+         L2Skill skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
+         if (skill != null)
+         {
+         skill.getEffects(newChar, newChar);
+         newChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT).addSkillName(buff[0]));
+         }
+         }
+         }
+         else
+         {
+         for (int[] buff : Config.STARTING_BUFFS_M) //Custom buffs for mystics
+         {
+         L2Skill skill = SkillTable.getInstance().getInfo(buff[0], buff[1]); 
+         if (skill != null)
+         {
+         skill.getEffects(newChar, newChar);
+         newChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT).addSkillName(buff[0]));
+         }
+         }
+         }        
+        }

>

+        if(Config.STARTING_BUFFS)
+        {
+         for (int[] buff : (newChar.isMageClass()) ? Config.STARTING_BUFFS_M : Config.STARTING_BUFFS_F)
+         {
+         L2Skill skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
+         if (skill != null)
+         {
+         skill.getEffects(newChar, newChar);
+         newChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT).addSkillName(buff[0]));
+         }
+         }    
+        }
Posted

Good share. i select this code for create a guide.

http://www.maxcheaters.com/topic/202517-l2jacis-%CF%80%CF%89%CF%82-%CE%BD%CE%B1-%CF%80%CE%B5%CF%81%CE%BD%CE%B1%CE%BC%CE%B5-%CE%B5%CE%BD%CE%B1-config/

I hope not to have problems. and I put the link from this share. :D 

Posted

It's cleaner, and there is embbed getSkill().

 

whats the point of a getSkill() method since you CANT cache a L2Skill instance?

Posted (edited)

whats the point of a getSkill() method since you CANT cache a L2Skill instance?

 

Avoid to rewrite SkillTable.getInstance().getSkill everytime.

 

By definition, all skills are cached...

private static final Map<Integer, L2Skill> _skills = new HashMap<>();
Edited by Tryskell
Posted (edited)

 

Avoid to rewrite SkillTable.getInstance().getSkill everytime.

 

By definition, all skills are cached...

private static final Map<Integer, L2Skill> _skills = new HashMap<>();

 

lol, the _skills will be updated with new L2Skill instances uppon //reload skills, while ALL other L2Skill references will hold the old obsolete L2Skill with old data inside.

 

PS: "By definition"

Edited by xxdem
Posted (edited)

lol, the _skills will be updated with new L2Skill instances uppon //reload skills, while ALL other L2Skill references will hold the old obsolete L2Skill with old data inside.

 

PS: "By definition"

 

Lol, what is the point to cache old skills upon skills reload ? That's all you don't want to do on a server. That would lead to a lot of idiot issues, and making the whole reload command totally pointless. I don't get your point.

 

Moreover, reload commands are only for dev purposes, nothing more.

 

And yes, almost everything is mapped or listed, so... Cached. I doubt I learn you anything.

Edited by Tryskell
Posted

Lol, what is the point to cache old skills upon skills reload ? That's all you don't want to do on a server. That would lead to a lot of idiot issues, and making the whole reload command totally pointless. I don't get your point.

 

Moreover, reload commands are only for dev purposes, nothing more.

 

And yes, almost everything is mapped or listed, so... Cached. I doubt I learn you anything.

 

lmao, read again I won't bother

  • 6 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • L2REBORN x10 - 1gb - 4.2$ l2reborn x1 ( signature ) - 1kk - 1.3$ LU4 - 1kk - 2.3$ MASTERWORRK - 1kk - 3.8kk  discord - adver745645
    • I haven't tryied the subclass system because i will not use it but i can check it, for sure it has some dublicate ai's in npcdata.txt (two monsters have the same ai) so you need to change them, you can find them from other pack because it's easier that way. I can send you the system, i guess there is no point to send the whole client because my client is changing to c3 but also the pack reads specific files from the system thats why some people may get disconected when they are trying to login. https://www.mediafire.com/file/4nd8fb9nwmfmdb0/System.rar/file
    • Hlep i need pack full last van GF 
    • Dear friends! We are constantly growing and developing, and we are finally ready to offer you the opportunity to integrate advertising across all SOCNET projects! Our service provides the opportunity to place ads on the website socnet.store, in our SMM panel socnet.pro, in Telegram bots socnet.shop and socnet.cc (celebrity bot), as well as in another new (currently secret) project. Each platform provides detailed analytics and information about available ad banners. The document below contains all detailed information in two languages — Russian and English. Here you will find answers to frequently asked questions about exact ad placement locations, integration costs, purchasing process, restrictions, and many other details. The document also contains a table with the current advertising placement queue in our projects. Document with detailed information: https://docs.google.com/document/d/1u4ro3fLkjfyvcp1Eu64rkgQy2Xl5lj87_1W25cVsqPM/edit?usp=sharing Thank you for your attention and support! Sincerely, the SOCNET team. Active project links: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store through Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and profitable purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing goods and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, Bot) during October! You can also use the promo code for your first purchase: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply post your username after registration on our website using the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a ticket titled "Get Trial Bonus" on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • 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