Jump to content

Recommended Posts

Posted (edited)

Hello!

 

This thing will give you temporary hero status on X kills (not configurable for now... I can add a config, maybe later). If you die or exit the game - you will lose the hero status.

 

Works on aCis... and all other packs, perhaps (maybe with a small corrections).

 

Just change "2" with any number you want :lol:

if (getKillStage() == 2 && !isHero()) 

Sorry if the code exists around, I didn't found.

Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 1)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -171,6 +171,7 @@
 import net.sf.l2j.gameserver.network.serverpackets.ExFishingStart;
 import net.sf.l2j.gameserver.network.serverpackets.ExOlympiadMode;
 import net.sf.l2j.gameserver.network.serverpackets.ExSetCompassZoneCode;
+import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;
 import net.sf.l2j.gameserver.network.serverpackets.ExStorageMaxCount;
 import net.sf.l2j.gameserver.network.serverpackets.FriendList;
 import net.sf.l2j.gameserver.network.serverpackets.GetOnVehicle;
@@ -392,6 +393,9 @@
 	private byte _siegeState = 0;
 	private int _curWeightPenalty = 0;
 	
+	private int _killStage;
+	private boolean _isHeroByKills = false;
+	
 	private int _lastCompassZone; // the last compass zone update send to the client
 	
 	private boolean _isInWater;
@@ -1442,6 +1446,32 @@
 	}
 	
 	/**
+	 * @return player's current kill stage.
+	 */
+	public int getKillStage()
+	{
+		return _killStage;
+	}
+	
+	/**
+	 * Set the kill stage of the L2PcInstance.
+	 * @param kills int.
+	 */
+	public void setKillStage(int kills)
+	{
+		_killStage = kills;
+	}
+	
+	/**
+	 * Checks if the players is a hero by kills.
+	 * @param hero
+	 */
+	public void setIsHeroByKills(boolean hero)
+	{
+		_isHeroByKills = hero;
+	}
+	
+	/**
 	 * @return The _deleteTimer of the L2PcInstance.
 	 */
 	public long getDeleteTimer()
@@ -4096,6 +4126,16 @@
 		// Icons update in order to get retained buffs list
 		updateEffectIcons();
 		
+		setKillStage(0);
+		
+		if (_isHeroByKills) 
+		{
+			setIsHeroByKills(false);
+			setHero(false);
+			broadcastUserInfo();
+			sendPacket(new ExShowScreenMessage("You lost your hero status!", 3000, 2, true));
+		}
+		
 		return true;
 	}
 	
@@ -4247,6 +4287,19 @@
 			// Send UserInfo packet to attacker with its Karma and PK Counter
 			sendPacket(new UserInfo(this));
 		}
+		
+		if (!isCursedWeaponEquipped() && !isInOlympiadMode())
+		{
+			setKillStage(getKillStage() + 1);
+		}
+		
+		if (getKillStage() == 2 && !isHero())
+		{
+			setIsHeroByKills(true);
+			setHero(true);
+			broadcastUserInfo();
+			sendPacket(new ExShowScreenMessage("Congratulations! You are now a hero by kills.", 3000, 2, true));
+		}
 	}
 	
 	public void updatePvPStatus()

EDIT: Some improvements for this thing (I will keep the old version if someone is interested ^_^)...

 

Some cleanup inspired by SweeTs and Tryskell :lol:

 

Config options are now available.

 

Your kill points will be saved in a column at the characters table (needs SQL update), which means you won't lose your hero status if you exit the game.

 

There are two ways of losing the hero status: If you being registered at Olympiad or die.

 

 

 

Get the improvements from http://pastebin.com/wJr9BQLi

 

Use this query to update the characters table:

ALTER TABLE characters ADD killStage TINYINT UNSIGNED NOT NULL DEFAULT 0;

EDIT: Final version for public ^_^

 

Some methods was renamed according to the good practices.

 

There are one more config option that allows you to choose if you want to save the heroes in the database or not.

Note that the SQL update is a requirement only if you set this to true!

 

Final edition http://pastebin.com/JFrSv4Yb

Edited by Tessa
Posted (edited)

_killStage++ and there is no need to check for equipped chaotic weapon and oly. Move it directly under pvp count add.

Edited by SweeTs
Posted

setKillStage++ and there is no need to check for equipped chaotic weapon and oly. Move it directly under pvp count add.

My idea was to count the kill, not if it's a pk or pvp point that is why I put it that way. I just don't want to repeat the code.

 

 

 

You can 

_killStage++;

 instead of 

setKillStage(getKillStage() + 1);

It's cleaner, but I was thinking about something bigger when I created the getters and setters. :)

Posted

and what about if someone is already hero with the same class by olympiad games? :S

 

you can make it from userinfo also charinfo ... just the fake hero effect...

Well, this mod works for those who are not a heroes... there are some kind of discrimination but you can add some other goodies for heroes :lol:

Posted (edited)

 

Hello!

 

This thing will give you temporary hero status on X kills (not configurable for now... I can add a config, maybe later). If you die or exit the game - you will lose the hero status.

 

Works on aCis... and all other packs, perhaps (maybe with a small corrections).

 

Just change "2" with any number you want :lol:

if (getKillStage() == 2 && !isHero()) 

Sorry if the code exists around, I didn't found.

Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 1)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -171,6 +171,7 @@
 import net.sf.l2j.gameserver.network.serverpackets.ExFishingStart;
 import net.sf.l2j.gameserver.network.serverpackets.ExOlympiadMode;
 import net.sf.l2j.gameserver.network.serverpackets.ExSetCompassZoneCode;
+import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;
 import net.sf.l2j.gameserver.network.serverpackets.ExStorageMaxCount;
 import net.sf.l2j.gameserver.network.serverpackets.FriendList;
 import net.sf.l2j.gameserver.network.serverpackets.GetOnVehicle;
@@ -392,6 +393,9 @@
 	private byte _siegeState = 0;
 	private int _curWeightPenalty = 0;
 	
+	private int _killStage;
+	private boolean _isHeroByKills = false;
+	
 	private int _lastCompassZone; // the last compass zone update send to the client
 	
 	private boolean _isInWater;
@@ -1442,6 +1446,32 @@
 	}
 	
 	/**
+	 * @return player's current kill stage.
+	 */
+	public int getKillStage()
+	{
+		return _killStage;
+	}
+	
+	/**
+	 * Set the kill stage of the L2PcInstance.
+	 * @param kills int.
+	 */
+	public void setKillStage(int kills)
+	{
+		_killStage = kills;
+	}
+	
+	/**
+	 * Checks if the players is a hero by kills.
+	 * @param hero
+	 */
+	public void setIsHeroByKills(boolean hero)
+	{
+		_isHeroByKills = hero;
+	}
+	
+	/**
 	 * @return The _deleteTimer of the L2PcInstance.
 	 */
 	public long getDeleteTimer()
@@ -4096,6 +4126,16 @@
 		// Icons update in order to get retained buffs list
 		updateEffectIcons();
 		
+		setKillStage(0);
+		
+		if (_isHeroByKills) 
+		{
+			setIsHeroByKills(false);
+			setHero(false);
+			broadcastUserInfo();
+			sendPacket(new ExShowScreenMessage("You lost your hero status!", 3000, 2, true));
+		}
+		
 		return true;
 	}
 	
@@ -4247,6 +4287,19 @@
 			// Send UserInfo packet to attacker with its Karma and PK Counter
 			sendPacket(new UserInfo(this));
 		}
+		
+		if (!isCursedWeaponEquipped() && !isInOlympiadMode())
+		{
+			setKillStage(getKillStage() + 1);
+		}
+		
+		if (getKillStage() == 2 && !isHero())
+		{
+			setIsHeroByKills(true);
+			setHero(true);
+			broadcastUserInfo();
+			sendPacket(new ExShowScreenMessage("Congratulations! You are now a hero by kills.", 3000, 2, true));
+		}
 	}
 	
 	public void updatePvPStatus()

EDIT: Some improvements for this thing (I will keep the old version if someone is interested ^_^)...

 

Some cleanup inspired by SweeTs and Tryskell :lol:

 

Config options are now available.

 

Your kill points will be saved in a column at the characters table (needs SQL update), which means you won't lose your hero status if you exit the game.

 

There are two ways of losing the hero status: If you being registered at Olympiad or die.

 

 

 

Get the improvements from http://pastebin.com/wJr9BQLi

 

Use this query to update the characters table:

ALTER TABLE characters ADD killStage TINYINT UNSIGNED NOT NULL DEFAULT 0;

I like this... It's a good idea for a pvp server.

and the shit i create yesterday is good idea but i have wrong on Item. :lol: In 1 hour will be ok.

Edited by 'Baggos'
Posted (edited)

If you want to make it kinda advanced. You could make new mothods for hero aura and hero skills, in addition for more kills add hero skills. So, you don't mess anything - heroes ranking for instance :)

 

I have done like that on my sources, so you have more possibilities for the code/methods. But well, why should we share everything.. The same server features everywhere. :)

 

 

Btw

 

 

player.setIsHeroByKills(true);
 
----
 
_isHeroByKills = true;

 

If you know what I mean :happyforever:

Edited by SweeTs
Posted

If you want to make it kinda advanced. You could make new mothods for hero aura and hero skills, in addition for more kills add hero skills. So, you don't mess anything - heroes ranking for instance :)

 

I have done like that on my sources, so you have more possibilities for the code/methods. But well, why should we share everything.. The same server features everywhere. :)

 

 

Btw

player.setIsHeroByKills(true);
 
----
 
_isHeroByKills = true;

If you know what I mean :happyforever:

Yep, I know but actually I prefer the methods instead of properties that is why the cleanup becomes a mess...

This could be a part of something bigger, but I'm currently thinking what exactly to do because this code was written in 5:30 AM and I still can't sleep. :lol:

Posted (edited)

Hehehe you lazy ass, I'd make you sleep immediatelly :)

 

 

Well, yes like I/you said, the code "could be a part of something bigger", that's why fake hero would be better, but don't do it :)

 

If you have some nice ideas, let me know. I'm searching something interesting for my project, since I'm empty of good ideas atm :D

Edited by SweeTs
Posted

Hehehe you lazy ass, I'd make you sleep immediatelly :)

 

 

Well, yes like I/you said, the code "could be a part of something bigger", that's why fake hero would be better, but don't do it :)

 

If you have some nice ideas, let me know. I'm searching something interesting for my project, since I'm empty of good ideas atm :D

Separating the aura and skills is a good start... I'm thinking about extending the kills for pvp servers, maybe this can become a currency? :lol:

Posted (edited)

Who knows. If you want to extend it, the kills stage, use switch :)

 

 

If you would like to ask something or so, let me know. We can even cooperate* :D

 

 

* - (when I'm not lazy)

Edited by SweeTs
Posted

Who knows. If you want to extend it, the kills stage, use switch :)

 

 

If you would like to ask something or so, let me know. We can even cooperate* :D

 

 

* - (when I'm not lazy)

Sure, we can! :lol:

About the switch I think it could be more fun if the player chooses from a list of rewards... I should try that way ^_^

Posted

Mmmm, that could be a way, but well. Why to give them the possibility to choose, life is brutal :D

It could be brutal for those who can't reach the required points :lol:

Lol, that reminds me about some dualbox/feed restrictions :P

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

    • From Salvation onwards I think you need a patched nwindow.dll that allows such modifications, try to see if you get what you need here: https://drive.google.com/drive/u/1/folders/1LLbQFGf8KlR-O0Iv5umfF-pwZgrDh9bd
    • hello everyone! I am wanting to save the files (Ini. - Data - ) of the EP5 Client: Salvation... But they generate the error "corrupt files"... I tried several versions of L2FileEditor without good results. I need help! Thank you!
    • Opening December 6th at 19:00 (GMT +3)! Open Beta Test from November 30th!   https://l2soe.com/   🌟 Introducing L2 Saga of Eternia: A Revolution in Lineage 2 High Five! 🌟   Dear Lineage 2 enthusiasts, Prepare to witness the future of private servers! L2 Saga of Eternia is not just another High Five project—it’s a game-changing experience designed to compete with the giants of the Lineage 2 private server scene. Built for the community, by the community, we’re here to raise the bar in quality, innovation, and longevity. What Sets Us Apart? 💎 No Wipes, Ever Say goodbye to the fear of losing your progress. Our server is built to last and will never close. Stability and consistency are our promises to you. ⚔️ Weekly New Content Our dedicated development team ensures fresh challenges, events, and updates every week. From custom quests to exclusive features, there will always be something exciting to explore. 💰 No Pay-to-Win Skill and strategy matter most here. Enjoy a balanced gameplay environment where your achievements come from effort, not your wallet. 🌍 A Massive Community With 2000+ players expected, join a vibrant and active community of like-minded adventurers ready to conquer the world of Aden. 🏆 Fair and Competitive Gameplay Our systems are designed to promote healthy competition while avoiding abusive mechanics and exploits. 🔧 Professional Development From advanced bug fixes to carefully curated content, we pride ourselves on smooth performance, no lag, and unparalleled server quality. Key Features Chronicle: High Five with unique interface Rate: Dynamic x10 rates Class Balance: Carefully fine-tuned for a fair experience PvP Focused: PvP Ranking & aura display effect for 3 Top PvPers every week Custom Events: Seasonal and permanent events to keep you engaged Additional Features:   Custom Endgame Content: Introduce unique dungeons, raids, or zones unavailable in other servers. Player-Driven Economy: Implement a strong market system and avoid overinflated drops or rewards. Epic Siege Battles: Announce special large-scale sieges and PvP events. Incentives for Streamers and Clans: Attract influencers and big clans to boost server publicity. Roadmap Transparency: Share a public roadmap of planned updates to build trust and excitemen   Here you can read all the features: https://l2soe.com/features   Video preview: Join the Revolution! This is your chance to be part of something legendary. L2 Saga of Eternia is not just a server; it’s a movement to redefine what Lineage 2 can be. Whether you’re a seasoned veteran or a newcomer to the world of Aden, we invite you to experience Lineage 2 at its finest.   Official Launch Date: December 6th 2024 Website: https://l2soe.com/ Facebook: https://www.facebook.com/l2soe Discord: https://discord.com/invite/l2eternia   Let’s build the ultimate Lineage 2 experience together. See you in-game! 🎮
    • That's like a tutorial on how to run l2 on MacOS Xd but good job for the investigation. 
    • small update: dc robe set sold   wts adena 1kk = 1.5$ 
  • Topics

×
×
  • Create New...