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

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

    • I was looking for  server with a low rates,eventually i found l2 elixir.I Joined beta and after so many years since 2008 i found  a friend that we played together, memories came back. i cant wait for the grand oppening!. dont miss it!
    • Seems legit, for sure deserves a try!
    • SOCNET VERIFICATION SERVICE — is a universal solution for those who value security, convenience, and quality. We turn the verification process into a convenient, fast, and highly confidential experience. Thanks to our service, any of your accounts receive identity confirmation, an increased level of trust from platforms and users, as well as protection from bans, fraud, and risks.   Promotion: Pay for your first verification and get a 10% discount on the second one! 💎 We help with verification on Fragment, crypto exchanges ByBit, Gate, Bitget, OKX, Binance, PayPal, KuCoin, and social networks LinkedIn, Facebook, Instagram, Twitter (X) and many other platforms! 💎 Verification for any service: crypto exchanges, trading platforms, hosting providers, casinos and other websites. Why choose us:   Premium quality — we use the most advanced verification methods. High processing speed — accelerated verification on leading platforms, online services and social networks. Full confidentiality — your personal information is protected. Increased trust and status — a verified account boosts influence and improves conversion. Individual approach — we work with bloggers, brands, businesses, and private clients. Simplifying complexity — we handle issues when dealing with foreign services. Important! Services related to illegal activities are strictly prohibited! 💳 Service pricing   ✅ Verification of individuals — from $30 (the exact cost depends on the required location and service/app/website). Learn more 👨‍💼 The cost of business verification for companies or legal entities is discussed individually with the service administration. Learn more If you want us to register your account on the required service and verify it — you will need to additionally pay 10% of the transaction amount. Available payment methods: cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot.   ⭐ Our Online Store ⭐ SOCNET.STORE ⭐ Telegram Store ⭐ SOCNET.SHOP ⭐ Our SMS Service ⭐ SOCNET.APP ⭐ Our Telegram Bot for buying Telegram Stars ⭐ SOCNET.CC ⭐ Our SMM Panel ⭐ SOCNET.PRO   ✅ News Resources ➡ Telegram Channel ➡ WhatsApp Channel ➡ Discord Server     ⭐ We invite you to COOPERATE and EARN with us ⭐ Would you like to sell your product or service in our stores and earn money? Become our partner or offer mutually beneficial collaboration? You can contact us via the CONTACTS listed in this topic. ✅ Contacts & Support ➡ Telegram Support ➡ WhatsApp Support ➡ Discord Support: socnet_support ➡ Email Support: solomonbog@socnet.store   Terms of Use and Refund Policy If you have any questions or issues, our fast support service is ready to respond to your requests! A refund for a completed service that does not fully meet the requirements or the declared quality is possible only if the product description includes a warranty and a valid warranty period. In other cases, a full refund for the service will not be provided! By purchasing such a service, you automatically agree to our refund rules for non-provided services! Refunds for countries selected by mistake are not provided after verification. To complete verification, you must provide full access to your account. We currently accept cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot! We value every client and provide replacements in case of invalid accounts via our contact channels! Attention: Your order will be delivered to your personal Google Drive/Mega.nz via a link (check the link, click “View content”) within 24 hours after the order confirmation! If you purchased more than 1 item at once, your entire order will be delivered via the first link! The remaining links will be empty! You will automatically receive an email notification after delivery! If you pay on our website via PayPal, you must pay an additional 20% commission (minimum $1). To avoid this commission, you can pay me directly via PayPal — instructions are available on the website! Refunds for items purchased by mistake or due to “I chose the wrong product and did not use it” are not accepted! You are fully responsible for your actions before and after purchase.
    • SOCNET VERIFICATION SERVICE — is a universal solution for those who value security, convenience, and quality. We turn the verification process into a convenient, fast, and highly confidential experience. Thanks to our service, any of your accounts receive identity confirmation, an increased level of trust from platforms and users, as well as protection from bans, fraud, and risks.   Promotion: Pay for your first verification and get a 10% discount on the second one! 💎 We help with verification on Fragment, crypto exchanges ByBit, Gate, Bitget, OKX, Binance, PayPal, KuCoin, and social networks LinkedIn, Facebook, Instagram, Twitter (X) and many other platforms! 💎 Verification for any service: crypto exchanges, trading platforms, hosting providers, casinos and other websites. Why choose us:   Premium quality — we use the most advanced verification methods. High processing speed — accelerated verification on leading platforms, online services and social networks. Full confidentiality — your personal information is protected. Increased trust and status — a verified account boosts influence and improves conversion. Individual approach — we work with bloggers, brands, businesses, and private clients. Simplifying complexity — we handle issues when dealing with foreign services. Important! Services related to illegal activities are strictly prohibited! 💳 Service pricing   ✅ Verification of individuals — from $30 (the exact cost depends on the required location and service/app/website). Learn more 👨‍💼 The cost of business verification for companies or legal entities is discussed individually with the service administration. Learn more If you want us to register your account on the required service and verify it — you will need to additionally pay 10% of the transaction amount. Available payment methods: cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot.   ⭐ Our Online Store ⭐ SOCNET.STORE ⭐ Telegram Store ⭐ SOCNET.SHOP ⭐ Our SMS Service ⭐ SOCNET.APP ⭐ Our Telegram Bot for buying Telegram Stars ⭐ SOCNET.CC ⭐ Our SMM Panel ⭐ SOCNET.PRO   ✅ News Resources ➡ Telegram Channel ➡ WhatsApp Channel ➡ Discord Server     ⭐ We invite you to COOPERATE and EARN with us ⭐ Would you like to sell your product or service in our stores and earn money? Become our partner or offer mutually beneficial collaboration? You can contact us via the CONTACTS listed in this topic. ✅ Contacts & Support ➡ Telegram Support ➡ WhatsApp Support ➡ Discord Support: socnet_support ➡ Email Support: solomonbog@socnet.store   Terms of Use and Refund Policy If you have any questions or issues, our fast support service is ready to respond to your requests! A refund for a completed service that does not fully meet the requirements or the declared quality is possible only if the product description includes a warranty and a valid warranty period. In other cases, a full refund for the service will not be provided! By purchasing such a service, you automatically agree to our refund rules for non-provided services! Refunds for countries selected by mistake are not provided after verification. To complete verification, you must provide full access to your account. We currently accept cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot! We value every client and provide replacements in case of invalid accounts via our contact channels! Attention: Your order will be delivered to your personal Google Drive/Mega.nz via a link (check the link, click “View content”) within 24 hours after the order confirmation! If you purchased more than 1 item at once, your entire order will be delivered via the first link! The remaining links will be empty! You will automatically receive an email notification after delivery! If you pay on our website via PayPal, you must pay an additional 20% commission (minimum $1). To avoid this commission, you can pay me directly via PayPal — instructions are available on the website! Refunds for items purchased by mistake or due to “I chose the wrong product and did not use it” are not accepted! You are fully responsible for your actions before and after purchase.
    • +8? Isnt +5 max per one stat?
  • 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