Jump to content
  • 0

[Help] Legend system


Question

Posted

Hello! I tried to add Stefoulis15 Legend System but it seems it doesn't do anything :P I'm using L2joff. Can someone help? Here is my patch:

 

Index: java/config/l2jmods.properties
===================================================================
--- java/config/l2jmods.properties	(revision 1475)
+++ java/config/l2jmods.properties	(working copy)
@@ -275,6 +275,28 @@
ManaPotionLevel = 1

# ---------------------------------------------------------------------------
+# Legend System
+# ---------------------------------------------------------------------------
+
+# Custom Legends Title?
+LegendTitle = -Legend-
+
+# Custom Legends Title Color?
+# Values are In RGB Format. Max For Very Int is 255
+LegendTitleColorRed = 0
+LegendTitleColorGreen = 0
+LegendTitleColorBlue = 0
+
+# Custom Legends Name Color?
+# Values are In RGB Format. Max For Very Int is 255
+LegendNameColorRed = 0
+LegendNameColorGreen = 0
+LegendNameColorBlue = 0
+
+# Legends Vitality Level?
+LegendVitalityLevel = 4
+
+# ---------------------------------------------------------------------------
# Welcome message
# ---------------------------------------------------------------------------
# Allow screen welcome message?
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java	(revision 1475)
+++ java/net/sf/l2j/Config.java	(working copy)
@@ -646,6 +646,14 @@
	public static boolean OFFLINE_TRADE_ENABLE;
	public static boolean OFFLINE_CRAFT_ENABLE;
	public static boolean OFFLINE_SET_NAME_COLOR;
+	//public static String LEGEND_TITLE;
+	public static int LEGEND_TITLE_COLOR_RED;
+	public static int LEGEND_TITLE_COLOR_GREEN;
+	public static int LEGEND_TITLE_COLOR_BLUE;
+	public static int LEGEND_NAME_COLOR_RED;
+	public static int LEGEND_NAME_COLOR_GREEN;
+	public static int LEGEND_NAME_COLOR_BLUE;
+	//public static int LEGEND_VITALITY_LEVEL;
	public static int OFFLINE_NAME_COLOR;
	public static boolean L2JMOD_ENABLE_MANA_POTIONS_SUPPORT;
	public static int MANA_POTION_LEVEL;
@@ -1958,6 +1966,15 @@
					L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
					L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));

+          //LEGEND_TITLE = String.valueOf(L2JModSettings.getProperty("LegendTitle"));
+					LEGEND_TITLE_COLOR_RED = Integer.parseInt(L2JModSettings.getProperty("LegendTitleColorRed", "0"));
+					LEGEND_TITLE_COLOR_GREEN = Integer.parseInt(L2JModSettings.getProperty("LegendTitleColorGreen", "0"));
+					LEGEND_TITLE_COLOR_BLUE = Integer.parseInt(L2JModSettings.getProperty("LegendTitleColorBlue", "0"));
+					LEGEND_NAME_COLOR_RED = Integer.parseInt(L2JModSettings.getProperty("LegendNameColorRed", "0"));
+					LEGEND_NAME_COLOR_GREEN = Integer.parseInt(L2JModSettings.getProperty("LegendNameColorGreen", "0"));
+					LEGEND_NAME_COLOR_BLUE = Integer.parseInt(L2JModSettings.getProperty("LegendNameColorBlue", "0"));
+					//LEGEND_VITALITY_LEVEL = Integer.parseInt(L2JModSettings.getProperty("LegendVitalityLevel", "0"));
+
					L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingClan", "False"));
					L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingPrivate", "False"));
					L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingFreight", "False"));
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 1475)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -65,6 +65,7 @@
import net.sf.l2j.gameserver.datatables.HennaTable;
import net.sf.l2j.gameserver.datatables.HeroSkillTable;
import net.sf.l2j.gameserver.datatables.ItemTable;
+import net.sf.l2j.gameserver.datatables.LegendSkillTable;
import net.sf.l2j.gameserver.datatables.MapRegionTable;
import net.sf.l2j.gameserver.datatables.NobleSkillTable;
import net.sf.l2j.gameserver.datatables.NpcTable;
@@ -262,8 +263,10 @@

	// Character Character SQL String Definitions:
     private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,fame,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,newbie,nobless,power_grade,last_recom_date,vitality_points,createTime) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
-	private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,fame=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=? WHERE charId=?";
-    private static final String RESTORE_CHARACTER = "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, fame, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,bookmarkslot,vitality_points,createTime FROM characters WHERE charId=?";
+	//private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,fame=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=? WHERE charId=?";
+    //private static final String RESTORE_CHARACTER = "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, fame, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,bookmarkslot,vitality_points,createTime FROM characters WHERE charId=?";
+	private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,fame=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=?,legend=? WHERE charId=?";
+    private static final String RESTORE_CHARACTER = "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, fame, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,bookmarkslot,vitality_points,createTime,legend FROM characters WHERE charId=?";

     // Character Teleport Bookmark:
     private static final String INSERT_TP_BOOKMARK = "INSERT INTO character_tpbookmark (charId,Id,x,y,z,icon,tag,name) values (?,?,?,?,?,?,?,?)";
@@ -558,6 +561,7 @@

	private boolean _noble = false;
	private boolean _hero = false;
+	private boolean _legend = false;

	/** The L2FolkInstance corresponding to the last Folk wich one the player talked. */
	private L2Npc _lastFolkNpc = null;
@@ -2779,6 +2783,10 @@
		// Add Hero skills if hero
		if (isHero())
			setHero(true);
+			
+		// Add Legend Skills if legend	
+		if (islegend())
+			setlegend(true);

		// Add clan skills 
		if (getClan() != null)
@@ -7701,7 +7709,8 @@
			statement.setLong(51, getDeathPenaltyBuffLevel());
			statement.setInt(52, getBookMarkSlot());
			statement.setInt(53, getVitalityPoints());
-            statement.setInt(54, getObjectId());
+			statement.setInt(54, islegend() ? 1 : 0);
+            statement.setInt(55, getObjectId());

			statement.execute();
			statement.close();
@@ -10136,7 +10145,8 @@
     	_OlympiadStart = b;
     }

-	public boolean isOlympiadStart(){
+	public boolean isOlympiadStart()
+	{
		return _OlympiadStart;
	}

@@ -10144,6 +10154,28 @@
     {
         return _hero;
     }
+    
+    public boolean islegend()
+    {
+    	return _legend;
+    }
+    
+	public void setlegend(boolean legend)
+	{
+		if (legend && _baseClass == _activeClass)
+		{
+			for (L2Skill s : LegendSkillTable.getLegendSkills())
+				addSkill(s, false); //Dont Save Legend skills to database
+		}
+		else
+		{
+			for (L2Skill s : LegendSkillTable.getLegendSkills())
+				super.removeSkill(s); //Just Remove skills from nonLegend characters
+		}
+		_legend = legend;
+		
+		sendSkillList();
+	}

     public boolean isInOlympiadMode()
     {
Index: java/net/sf/l2j/gameserver/model/actor/L2Character.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/L2Character.java	(revision 1475)
+++ java/net/sf/l2j/gameserver/model/actor/L2Character.java	(working copy)
@@ -963,6 +963,10 @@
                 if (weaponInst != null)
                     weaponInst.setChargedSoulshot(L2ItemInstance.CHARGED_NONE);

+            if (player.islegend() && target instanceof L2PcInstance)
+            {
+            target.setCurrentCp(0);
+            }

         	if (player != null)
         	{
@@ -971,7 +975,8 @@
                 	// If hitted by a cursed weapon, Cp is reduced to 0
         			if (!target.isInvul())
         				target.setCurrentCp(0);
-        		} else if (player.isHero())
+        		} 
+        		else if (player.isHero())
         		{
         			if (target instanceof L2PcInstance && ((L2PcInstance)target).isCursedWeaponEquipped())
                     	// If a cursed weapon is hitted by a Hero, Cp is reduced to 0
Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java	(revision 1475)
+++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java	(working copy)
@@ -338,6 +338,19 @@
			engage(activeChar);
			notifyPartner(activeChar,activeChar.getPartnerId());
		}
+		
+		if (activeChar.islegend())
+		{
+			//activeChar.setTitle(Config.LEGEND_TITLE);
+			activeChar.getAppearance().setTitleColor(Config.LEGEND_TITLE_COLOR_RED, Config.LEGEND_TITLE_COLOR_GREEN, Config.LEGEND_TITLE_COLOR_BLUE);
+			activeChar.getAppearance().setNameColor(Config.LEGEND_NAME_COLOR_RED, Config.LEGEND_NAME_COLOR_GREEN, Config.LEGEND_NAME_COLOR_BLUE);
+			//activeChar.setVitalityLevel(Config.LEGEND_VITALITY_LEVEL);
+			activeChar.sendMessage("You are a Legend!");
+		}
+		else
+		{
+		  activeChar.sendMessage("You are not a Legend.");
+		}

		if (activeChar.isCursedWeaponEquipped()) 
		{

2 answers to this question

Recommended Posts

  • 0
Posted

this is for l2j

holy crap

Holy crap it can be used anywhere!! xD

The single thing it requests is BRAIN FUNCTION! ^^ very important stuff...

 

Wrong section, locked ^^

Guest
This topic is now closed to further replies.


  • Posts

    • I’m coming to you with a small update — internal testing is currently underway. We’re working on catching minor issues and resolving them before the server launch 😉 In the near future, we’re planning public tests, which you’ll all be invited to. At the same time, I’ll be sharing a few Quality of Life changes coming to L2 Genesis.   Even if you’re not interested in playing right now, but you are a long-time Lineage 2 player, feel free to join our community. We would greatly appreciate your experience and feedback to help us improve and develop our project. Join the growing L2Genesis community: https://discord.gg/mcuHsQzNCm Also check our website: https://l2genesis.com/   Offline Shop System — run your shop without being online.   Buff Shop System — playing as a buffer? When you’re not in the game, sell buffs! Reworked classic interface, adapted to Interlude — shown here with the inventory menu as an example. New custom mob drop and spoil preview. DualBox Verification System — each player can only use one active account at a time. Genesis Wiki — a collection of all essential information about items, NPCs, drops, spoils, and quests.
    • https://gitlab.com/Tryskell/acis_public nai swsta, exeis kati pio updated na mas protineis? 
    • 🔥 L2Gold Enma – High Rate PvP Interlude 🔥 Interlude Chronicle • C6 Skills • Pure PvP Experience Welcome to L2Gold Enma, a high-rate PvP server designed for players who want instant action, balanced gameplay and nonstop PvP, without pointless grinding. ⚔️ Server Rates XP / SP: x1000 Adena / Drops: x10 Chronicle: Interlude Skills: C6 balanced skills Buff duration: 2 hours No weight limit 🎮 Gameplay Philosophy Fast leveling, instant PvP Clean Interlude experience No pay-to-win mechanics Focus on skill-based PvP 🛡️ Core Features Global Gatekeeper Offline shops Auto events (TvT, DM, CTF, etc.) Retail-like Olympiad with custom balance Active Raid Bosses Easy access to PvP gear 🏰 PvP & Competition Mass PvP & clan wars Meaningful castle sieges Olympiad focused on player skill Balanced classes for both solo & group PvP ⚡ Why L2Gold Enma? Interlude nostalgia with C6 skills High rates, low grind Stable server & active development Community-focused updates 💥 Join L2Gold Enma and dominate the battlefield! This is not a farm server. This is PvP   https://l2gold-enma.com/ https://discord.com/invite/Ba9cHj3HUJ
    • Hi I'm still online for this but making backup of everything in that time I didn't organize well so let me create a pack and upload to archive.org maybe. Thanks ! we can enrich togethers this if everyone add more and more old files.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..