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

    • Hi everyone, Since I’m no longer interested in L2 servers, if anyone is willing to continue the project, let me know. I’m currently selling the entire project. DM me for more information if you’re genuinely interested. I can offer limited free support for the first couple of months. It is not cheap. The sale includes the domain, the recently fully redesigned website, the updater, the interface, server files with Lucera ext source, and the database (excluding account passwords, emails, and other private information; character data can remain).   Server for test: https://lineage2.gold/download Server Info: https://lineage2.gold/info Over 110 videos YouTube playlist: https://www.youtube.com/watch?v=HO7BZaxUv2U&list=PLD9WZ0Nj-zstZaYeWxAxTKbX7ia2M_DUu&index=113  
    • You invent yourself a life - bad for you, one of the inner core dev, fernandopm, which worked hard over aCis quests from 2011 to 2016 is argentinian. I teached him back in time to work and make proper quests. My dev team comes from 10+ countries and I'm myself french. "Racist/nationalist" card ? Not working bro.   Not sure why I should thank you to send me questions, and regarding bug reports, so far, I got none of yours in either discord, gitlab, or forums. I'm sorry if you feel "ignored", but that's more a psychanalyst you need to speak with if you put emotions towards someones' appreciation over a forum. I never ignore a bug report, and if so (like skills reports), it's because I got a bigger plan (skills refactor, in that case). In any case, I delivered cookies for the bug report/fix, even if it dated of months, with proper credits over changesets. "Victim card" ? Not really working, but ok, maybe you're "emotional".   I barely make money out of aCis, for the spent time - simply selling my services, or even coding/administrating a minecraft/L2J server would make far more money. Breaking intentionally things would be stupid. If you don't understand I'm not the only one working on that pack, I can't help you. Also, the scale of edits is sometimes extreme - AI L2OFF ? 1800 files added. How do you want everything works in a single shot ? "Exploiting noobz for money" card ? Still not working, or I'm a terrible businessman.   Meanwhile - you shadow advertise your project, L2JOne (since 2017 btw) - you should maybe start by the beginning saying you're a competitor and aCis is actually a spike in your foot. That also explains why you act like that. RusAcis got the exact same strategy, speaking bad of me, saying they got unique fixes (you speak about I break things, they break and recode things 4 times sometimes, btw), but successfully reselling latest revision with poorly executed stuff. "aCis is good, Tryskell is ok, but I solve all issues in extreme low time so I can piss over him" card ? Mmmmhhhh.   Our conversation ends here if you want, I don't force ppl to speak with me if they don't want - hopefully, people would understand I'm not the arrogant one and the one who doesn't want to talk, or even collaborate. :). I understand you got your own project and got no will to improve aCis.   NOTE : I'm extremely happy for your call of ExShowServerPrimitive with getValidGeoLocation, extremely impressive. Arrogant, no. Sarcastic ? Maybe.   Good night everyone.
    • Hi. @GX-Ext, svn does not work. is there anywhere else where we can get source code? Thank you so much.
  • 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..

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