Jump to content

12 Anos Online! 🎂


⭐ Links Úteis




⚔️ Servers Apoiadores



🎁 Ofertas







  • 0

(Resolvido) Quem tem o Mod NewbieBuff


Go to solution Solved by Undergr[O]und c#0de$,

Question

boa noite a todos quem estiver esse mod " NewbieBuff "( Para quando o player começar já nascer com os buffers básicos  base l2jacis ) e puder compartilhar conosco eu agradecerei muito obrigado.

" Os homens tendem a acreditar sobretudo naquilo que menos compreendem. "

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
  • Solution

Oi! Como vai? Compartilho o código que você está procurando para jfrozen. Você simplesmente tem que adaptá-lo para a revisão Acis que você está usando :)

 

### Eclipse Workspace Patch 1.0
#P L2jFrozen_GameServer
Index: head-src/com/l2jfrozen/Config.java
===================================================================
--- head-src/com/l2jfrozen/Config.java	(revision 939)
+++ head-src/com/l2jfrozen/Config.java	(working copy)
@@ -2121,8 +2121,11 @@
 	public static String PM_TEXT1;
 	public static String PM_TEXT2;
 	public static boolean NEW_PLAYER_EFFECT;
-	
+	public static boolean NEW_PLAYER_BUFFS;
+	public static Map<Integer, Integer> FIGHTER_BUFF_LIST;
+	public static Map<Integer, Integer> MAGE_BUFF_LIST;
 
+
 	//============================================================
 	public static void loadFrozenConfig()
 	{
@@ -2143,7 +2146,59 @@
 			PM_TEXT1  = frozenSettings.getProperty("PMText1", "Have Fun and Nice Stay on");
 			PM_TEXT2  = frozenSettings.getProperty("PMText2", "Vote for us every 24h");
 			NEW_PLAYER_EFFECT = Boolean.parseBoolean(frozenSettings.getProperty("NewPlayerEffect", "True"));
+			NEW_PLAYER_BUFFS = Boolean.parseBoolean(frozenSettings.getProperty("AltNewCharBuffs", "False"));
+			if(NEW_PLAYER_BUFFS)
+			{
+				String[] fighterBuffSplit = frozenSettings.getProperty("FighterBuffList", "").split(";");
+				FIGHTER_BUFF_LIST = new FastMap<Integer, Integer>(fighterBuffSplit.length);
+				for(String skill : fighterBuffSplit)
+				{
+					String[] skillSplit = skill.split(",");
+					if(skillSplit.length != 2)
+					{
+						System.out.println("invalid config property in " + Frozen + " -> FighterBuffList \"" + skill + "\"");
+					}
+					else
+					{
+						try
+						{
+							FIGHTER_BUFF_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
+						}
+						catch(NumberFormatException nfe)
+						{
+							if(!skill.equals(""))
+							{
+								System.out.println("invalid config property in " + Frozen + " -> FighterBuffList \"" + skillSplit[0] + "\"" + skillSplit[1]);
+							}
+						}
+					}
+				}
 
+				String[] mageBuffSplit = frozenSettings.getProperty("MageBuffList", "").split(";");
+				MAGE_BUFF_LIST = new FastMap<Integer, Integer>(mageBuffSplit.length);
+				for(String skill : mageBuffSplit)
+				{
+					String[] skillSplit = skill.split(",");
+					if(skillSplit.length != 2)
+					{
+						System.out.println("invalid config property in " + Frozen + " -> MageBuffList \"" + skill + "\"");
+					}
+					else
+					{
+						try
+						{
+							MAGE_BUFF_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
+						}
+						catch(NumberFormatException nfe)
+						{
+							if(!skill.equals(""))
+							{
+								System.out.println("invalid config property in" + Frozen + " -> MageBuffList \"" + skillSplit[0] + "\"" + skillSplit[1]);
+							}
+						}
+					}
+				}
+			}
 		}
 		catch(Exception e)
 		{
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java	(revision 939)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java	(working copy)
@@ -285,6 +285,9 @@
 		Announcements.getInstance().showAnnouncements(activeChar);
 
 		loadTutorial(activeChar);
+
+		if(activeChar.getFirstLog())
+			onEnterNewbie(activeChar);
 		
 		// Check for crowns
 		CrownManager.getInstance().checkCrowns(activeChar);
@@ -543,20 +546,6 @@
 		if (Config.ONLINE_PLAYERS_ON_LOGIN)
 			sendPacket(new SystemMessage(SystemMessageId.S1_S2).addString("There are " + L2World.getInstance().getAllPlayers().size() + " players online."));
 
-		if (activeChar.getFirstLog() && Config.NEW_PLAYER_EFFECT)
-		{
-			L2Skill skill = SkillTable.getInstance().getInfo(2025,1);
-			if (skill != null)
-			{
-				MagicSkillUser MSU = new MagicSkillUser(activeChar, activeChar, 2025, 1, 1, 0);
-				activeChar.sendPacket(MSU);
-				activeChar.broadcastPacket(MSU);
-				activeChar.useMagic(skill, false, false);
-			}
-			activeChar.setFirstLog(false);
-			activeChar.updateFirstLog();
-		}
-
 		if (Config.WELCOME_HTM && isValidName(activeChar.getName()))
 		{
 			String Welcome_Path = "data/html/welcome.htm";
@@ -688,6 +677,50 @@
 	}
 
 	/**
+	 * @param activeChar
+	 */
+	private void onEnterNewbie(L2PcInstance activeChar)
+	{
+		if(Config.NEW_PLAYER_EFFECT)
+		{
+			L2Skill skill = SkillTable.getInstance().getInfo(2025, 1);
+			if(skill != null)
+			{
+				MagicSkillUser MSU = new MagicSkillUser(activeChar, activeChar, 2025, 1, 1, 0);
+				activeChar.sendPacket(MSU);
+				activeChar.broadcastPacket(MSU);
+				activeChar.useMagic(skill, false, false);
+			}
+		}
+
+		if(Config.NEW_PLAYER_BUFFS)
+		{
+			if(activeChar.isMageClass())
+			{
+				for(Integer skillid : Config.MAGE_BUFF_LIST.keySet())
+				{
+					int skilllvl = Config.MAGE_BUFF_LIST.get(skillid);
+					L2Skill skill = SkillTable.getInstance().getInfo(skillid, skilllvl);
+					if(skill != null)
+						skill.getEffects(activeChar, activeChar);
+				}
+			}
+			else
+			{
+				for(Integer skillid : Config.FIGHTER_BUFF_LIST.keySet())
+				{
+					int skilllvl = Config.FIGHTER_BUFF_LIST.get(skillid);
+					L2Skill skill = SkillTable.getInstance().getInfo(skillid, skilllvl);
+					if(skill != null)
+						skill.getEffects(activeChar, activeChar);
+				}
+			}
+		}
+		activeChar.setFirstLog(false);
+		activeChar.updateFirstLog();
+	}
+
+	/**
 	 * @param cha 
 	 */
 	private void engage(L2PcInstance cha)
Index: config/frozen/frozen.properties
===================================================================
--- config/frozen/frozen.properties	(revision 939)
+++ config/frozen/frozen.properties	(working copy)
@@ -21,4 +21,18 @@
 
 # New players get fireworks the first time they log in
 # Default: False
-NewPlayerEffect = False
\ No newline at end of file
+NewPlayerEffect = False
+
+# Give buffs to character on first game log in.
+# Default: False
+AltNewCharBuffs = False
+
+# The List of Fighter Buffs
+# Format : skillid,skilllvl;skillid2,skilllvl2;....skillidn,skilllvln
+FighterBuffList = 1204,2;1068,3;1040,3;1035,4;1036,2;1045,6;1086,2;1077,3;1240,3;1242,3;\
+264,1;267,1;268,1;269,1;304,1;349,1;364,1;271,1;274,1;275,1;1363,1;1391,3;4699,1;4703,1
+
+# The List of Mage Buffs
+# Format : skillid,skilllvl;skillid2,skilllvl2;....skillidn,skilllvln
+MageBuffList = 1204,2;1040,3;1035,4;1045,6;1048,6;1036,2;1303,2;1085,3;1059,3;1078,6;\
+1062,2;1397,3;264,1;267,1;268,1;304,1;349,1;364,1;273,1;276,1;365,1;1413,1;1391,3;4703,1

 

  • Like 1

       Facebook friend: https://www.facebook.com/serious.development
         Facebook page: https://www.facebook.com/DevelopmentLineage2/

 

Desenvolvimento e venda de servidores privados, designs, banners, botões, logotipos, planos de fundo html, npcs, criptografia de arquivos, sites. Contate-me!

 

123.png

Link to post
Share on other sites
  • 0
13 horas atrás, Undergr[O]und c#0de$ disse:

Oi! Como vai? Compartilho o código que você está procurando para jfrozen. Você simplesmente tem que adaptá-lo para a revisão Acis que você está usando 🙂

 

### Eclipse Workspace Patch 1.0
#P L2jFrozen_GameServer
Index: head-src/com/l2jfrozen/Config.java
===================================================================
--- head-src/com/l2jfrozen/Config.java	(revision 939)
+++ head-src/com/l2jfrozen/Config.java	(working copy)
@@ -2121,8 +2121,11 @@
 	public static String PM_TEXT1;
 	public static String PM_TEXT2;
 	public static boolean NEW_PLAYER_EFFECT;
-	
+	public static boolean NEW_PLAYER_BUFFS;
+	public static Map<Integer, Integer> FIGHTER_BUFF_LIST;
+	public static Map<Integer, Integer> MAGE_BUFF_LIST;
 
+
 	//============================================================
 	public static void loadFrozenConfig()
 	{
@@ -2143,7 +2146,59 @@
 			PM_TEXT1  = frozenSettings.getProperty("PMText1", "Have Fun and Nice Stay on");
 			PM_TEXT2  = frozenSettings.getProperty("PMText2", "Vote for us every 24h");
 			NEW_PLAYER_EFFECT = Boolean.parseBoolean(frozenSettings.getProperty("NewPlayerEffect", "True"));
+			NEW_PLAYER_BUFFS = Boolean.parseBoolean(frozenSettings.getProperty("AltNewCharBuffs", "False"));
+			if(NEW_PLAYER_BUFFS)
+			{
+				String[] fighterBuffSplit = frozenSettings.getProperty("FighterBuffList", "").split(";");
+				FIGHTER_BUFF_LIST = new FastMap<Integer, Integer>(fighterBuffSplit.length);
+				for(String skill : fighterBuffSplit)
+				{
+					String[] skillSplit = skill.split(",");
+					if(skillSplit.length != 2)
+					{
+						System.out.println("invalid config property in " + Frozen + " -> FighterBuffList \"" + skill + "\"");
+					}
+					else
+					{
+						try
+						{
+							FIGHTER_BUFF_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
+						}
+						catch(NumberFormatException nfe)
+						{
+							if(!skill.equals(""))
+							{
+								System.out.println("invalid config property in " + Frozen + " -> FighterBuffList \"" + skillSplit[0] + "\"" + skillSplit[1]);
+							}
+						}
+					}
+				}
 
+				String[] mageBuffSplit = frozenSettings.getProperty("MageBuffList", "").split(";");
+				MAGE_BUFF_LIST = new FastMap<Integer, Integer>(mageBuffSplit.length);
+				for(String skill : mageBuffSplit)
+				{
+					String[] skillSplit = skill.split(",");
+					if(skillSplit.length != 2)
+					{
+						System.out.println("invalid config property in " + Frozen + " -> MageBuffList \"" + skill + "\"");
+					}
+					else
+					{
+						try
+						{
+							MAGE_BUFF_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
+						}
+						catch(NumberFormatException nfe)
+						{
+							if(!skill.equals(""))
+							{
+								System.out.println("invalid config property in" + Frozen + " -> MageBuffList \"" + skillSplit[0] + "\"" + skillSplit[1]);
+							}
+						}
+					}
+				}
+			}
 		}
 		catch(Exception e)
 		{
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java	(revision 939)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java	(working copy)
@@ -285,6 +285,9 @@
 		Announcements.getInstance().showAnnouncements(activeChar);
 
 		loadTutorial(activeChar);
+
+		if(activeChar.getFirstLog())
+			onEnterNewbie(activeChar);
 		
 		// Check for crowns
 		CrownManager.getInstance().checkCrowns(activeChar);
@@ -543,20 +546,6 @@
 		if (Config.ONLINE_PLAYERS_ON_LOGIN)
 			sendPacket(new SystemMessage(SystemMessageId.S1_S2).addString("There are " + L2World.getInstance().getAllPlayers().size() + " players online."));
 
-		if (activeChar.getFirstLog() && Config.NEW_PLAYER_EFFECT)
-		{
-			L2Skill skill = SkillTable.getInstance().getInfo(2025,1);
-			if (skill != null)
-			{
-				MagicSkillUser MSU = new MagicSkillUser(activeChar, activeChar, 2025, 1, 1, 0);
-				activeChar.sendPacket(MSU);
-				activeChar.broadcastPacket(MSU);
-				activeChar.useMagic(skill, false, false);
-			}
-			activeChar.setFirstLog(false);
-			activeChar.updateFirstLog();
-		}
-
 		if (Config.WELCOME_HTM && isValidName(activeChar.getName()))
 		{
 			String Welcome_Path = "data/html/welcome.htm";
@@ -688,6 +677,50 @@
 	}
 
 	/**
+	 * @param activeChar
+	 */
+	private void onEnterNewbie(L2PcInstance activeChar)
+	{
+		if(Config.NEW_PLAYER_EFFECT)
+		{
+			L2Skill skill = SkillTable.getInstance().getInfo(2025, 1);
+			if(skill != null)
+			{
+				MagicSkillUser MSU = new MagicSkillUser(activeChar, activeChar, 2025, 1, 1, 0);
+				activeChar.sendPacket(MSU);
+				activeChar.broadcastPacket(MSU);
+				activeChar.useMagic(skill, false, false);
+			}
+		}
+
+		if(Config.NEW_PLAYER_BUFFS)
+		{
+			if(activeChar.isMageClass())
+			{
+				for(Integer skillid : Config.MAGE_BUFF_LIST.keySet())
+				{
+					int skilllvl = Config.MAGE_BUFF_LIST.get(skillid);
+					L2Skill skill = SkillTable.getInstance().getInfo(skillid, skilllvl);
+					if(skill != null)
+						skill.getEffects(activeChar, activeChar);
+				}
+			}
+			else
+			{
+				for(Integer skillid : Config.FIGHTER_BUFF_LIST.keySet())
+				{
+					int skilllvl = Config.FIGHTER_BUFF_LIST.get(skillid);
+					L2Skill skill = SkillTable.getInstance().getInfo(skillid, skilllvl);
+					if(skill != null)
+						skill.getEffects(activeChar, activeChar);
+				}
+			}
+		}
+		activeChar.setFirstLog(false);
+		activeChar.updateFirstLog();
+	}
+
+	/**
 	 * @param cha 
 	 */
 	private void engage(L2PcInstance cha)
Index: config/frozen/frozen.properties
===================================================================
--- config/frozen/frozen.properties	(revision 939)
+++ config/frozen/frozen.properties	(working copy)
@@ -21,4 +21,18 @@
 
 # New players get fireworks the first time they log in
 # Default: False
-NewPlayerEffect = False
\ No newline at end of file
+NewPlayerEffect = False
+
+# Give buffs to character on first game log in.
+# Default: False
+AltNewCharBuffs = False
+
+# The List of Fighter Buffs
+# Format : skillid,skilllvl;skillid2,skilllvl2;....skillidn,skilllvln
+FighterBuffList = 1204,2;1068,3;1040,3;1035,4;1036,2;1045,6;1086,2;1077,3;1240,3;1242,3;\
+264,1;267,1;268,1;269,1;304,1;349,1;364,1;271,1;274,1;275,1;1363,1;1391,3;4699,1;4703,1
+
+# The List of Mage Buffs
+# Format : skillid,skilllvl;skillid2,skilllvl2;....skillidn,skilllvln
+MageBuffList = 1204,2;1040,3;1035,4;1045,6;1048,6;1036,2;1303,2;1085,3;1059,3;1078,6;\
+1062,2;1397,3;264,1;267,1;268,1;304,1;349,1;364,1;273,1;276,1;365,1;1413,1;1391,3;4703,1

 

muito obrigado adicionei e adaptei para acis que eu uso  para mais alguém que quiser ai esta o código para acis 

Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java

+/** Newbie Buffs */
+	public static boolean NEW_PLAYER_BUFFS;
+	public static HashMap<Integer, Integer> NEWBIE_BUFF_FIGHTER;
+	public static HashMap<Integer, Integer> NEWBIE_BUFF_MAGE;

//============================================================

+		NEW_PLAYER_BUFFS = Boolean.parseBoolean(skills.getProperty("Newbie_Player_Buff", "False"));
		
+		if(NEW_PLAYER_BUFFS)
+		{
+			String[] fighterBuffSplit = skills.getProperty("Newlbie_Buff_Fighter", "").split(";");
+			NEWBIE_BUFF_FIGHTER = new HashMap<>(fighterBuffSplit.length);
+			for(String skill : fighterBuffSplit)
+			{
+				String[] skillSplit = skill.split(",");
+				if(skillSplit.length != 2)
+				{
+					System.out.println("invalid config property -> SkillList " + fighterBuffSplit + " -> FighterBuffList \"" + skill + "\"");
+				}
+				else
+				{
+					try
+					{
+						NEWBIE_BUFF_FIGHTER.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
+					}
+					catch(NumberFormatException nfe)
+					{
+						if(!skill.equals(""))
+						{
+							System.out.println("invalid config property -> SkillList " + fighterBuffSplit + " -> FighterBuffList \"" + skillSplit[0] + "\"" + skillSplit[1]);
+						}
+					}
+				}
+			}

+			String[] mageBuffSplit = skills.getProperty("Newlbie_Buff_Mage", "").split(";");
+			NEWBIE_BUFF_MAGE = new HashMap<>(mageBuffSplit.length);
+			for(String skill : mageBuffSplit)
+			{
+				String[] skillSplit = skill.split(",");
+				if(skillSplit.length != 2)
+				{
+					System.out.println("invalid config property -> SkillList " + mageBuffSplit + " -> MageBuffList \"" + skill + "\"");
+				}
+				else
+				{
+					try
+					{
+						NEWBIE_BUFF_MAGE.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
+					}
+					catch(NumberFormatException nfe)
+					{
+						if(!skill.equals(""))
+						{
+							System.out.println("invalid config property -> SkillList " + mageBuffSplit + " -> MageBuffList \"" + skillSplit[0] + "\"" + skillSplit[1]);
+						}
+					}
+				}
+			}
+		}
 
Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
+import net.sf.l2j.gameserver.model.L2Skill;


+		if(activeChar.getFirstLog())
+			onEnterNewbie(activeChar);

+	private static void onEnterNewbie(Player activeChar)
+	{
+		if(Config.NEW_PLAYER_BUFFS)
+			{
+				if(activeChar.isMageClass())
+				{
+					for(Integer skillid : Config.NEWBIE_BUFF_MAGE.keySet())
+					{
+						int skilllvl = Config.NEWBIE_BUFF_MAGE.get(skillid);
+						L2Skill skill = SkillTable.getInstance().getInfo(skillid, skilllvl);
+						if(skill != null)
+							skill.getEffects(activeChar, activeChar);
+					}
+				}
+				else
+				{
+					for(Integer skillid : Config.NEWBIE_BUFF_FIGHTER.keySet())
++					{
+						int skilllvl = Config.NEWBIE_BUFF_FIGHTER.get(skillid);
+						L2Skill skill = SkillTable.getInstance().getInfo(skillid, skilllvl);
						if(skill != null)
+							skill.getEffects(activeChar, activeChar);
+					}
+				}
+			}
+			activeChar.setFirstLog(false);
+			activeChar.updateFirstLog();
+		}
	

Index: config/skills.properties
===================================================================

+# Give buffs to character on first game log in.
+# Default: False
+Newbie_Player_Buff = True

+# The List of Fighter Buffs
+# Format : skillid,skilllvl;skillid2,skilllvl2;....skillidn,skilllvln
+Newlbie_Buff_Fighter = 1204,2;1068,3;1040,3;1035,4;1036,2;1045,6;1086,2;1077,3;1240,3;1242,3;264,1;267,1;268,1;269,1;304,1;349,1;364,1;271,1;274,1;275,1;1363,1;1391,3;4699,1;4703,1

+# The List of Mage Buffs
+# Format : skillid,skilllvl;skillid2,skilllvl2;....skillidn,skilllvln
+Newlbie_Buff_Mage = 1204,2;1040,3;1035,4;1045,6;1048,6;1036,2;1303,2;1085,3;1059,3;1078,6;1062,2;1397,3;264,1;267,1;268,1;304,1;349,1;364,1;273,1;276,1;365,1;1413,1;1391,3;4703,1

 

  • Like 1

" Os homens tendem a acreditar sobretudo naquilo que menos compreendem. "

Link to post
Share on other sites
Guest
This topic is now closed to further replies.
×
×
  • Create New...