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

    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars 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
    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars 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
    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars 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
    • Yes, just keep this post=)
  • 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