Jump to content
  • 0

[Help][H5] Questions About 2 Codes (In Olympiad And Skills)


Question

Posted

Hello maxcheaters..!
so i have an idea about 2 fixes for my server but i need your usefull help to do it right..!

so the first code is about Olympiad... i was thinking how to avoid the prefrenzy, angelic icon and other things like that...!

so i was thinking... if i can put a code that when you are in Oly before start the match, the hp will cannot drop down...! i mean... as much as hp you receive (from buffs or armors, weapons etc.)

the HP cannot drop down! just to staying full! can we do that?!

 

the second code is something about the drain from mobs while in flag...!

i've tried this code on L2PcInstance.java:

		public void doAttack(L2Character target)
		{
			super.doAttack(target);
			
+			if ((getPlayer().getPvpFlag() > 0) && target.isMonster())
+			{
+				getPlayer().stopSkillEffects(false, 310);
+				return;
+			}
			
			// cancel the recent fake-death protection instantly if the player attacks or casts spells
			getPlayer().setRecentFakeDeath(false);
		}

It's working as i want, but...
with the command: 

getPlayer().stopSkillEffects(false, 310);

the skill is getting removed!
what method i have to put for the skill to just don't work while player if flaged but doesn't getting removed?! can we fix that too?!

(if the "false" in stopSkillEffects means that the buff will not removed and if "true" will removed... i checked it and doesn't work.!)

Recommended Posts

  • 0
Posted (edited)

I just checked the code where are you acting and I don't really get why u used "activeChar", wait a second I post you another try

 

						if (absorbDamage > 0)
 						{
+							if ((this instanceof L2PcInstance) && (target instanceof L2MonsterInstance) && (((L2PcInstance) this).getPvpFlag() > 0))
+							{
+								absorbDamage = 0;
+							}
 							setCurrentHp(getCurrentHp() + absorbDamage);
 						}
 					}
try it Edited by ^Wyatt
  • 0
Posted

Could you please, post, for once, in the correct section?  :rage:

Moving it...

am i in wrong section? sorry didn't know that... where i have to post it?!

  • 0
Posted

Dev help, you posted it in shares or in general discussion, now it's moved.

seriusly? i'm so sorry! didn't see that.!

but... do you have any solution for my questions?!

  • 0
Posted

about skill drain... which pack are u using?

because here it is com.l2jserver.gameserver.model.skills.l2skills.L2SkillDrain, you could simply add a check there, i'll check the rest after eating ;D

  • 0
Posted (edited)

about skill drain... which pack are u using?

because here it is com.l2jserver.gameserver.model.skills.l2skills.L2SkillDrain, you could simply add a check there, i'll check the rest after eating ;D

i have the latest version of L2j H5 and this location doesn't exist anymore... and L2SkillDrain.java too!

 

edit: this location exists..! but the only files that have inside the folder is: L2SkillDefault.java, L2SkillsSiegeFlag.java, L2SkillSummon.java

Edited by xXObanXx
  • 0
Posted

latest h5:

 

5ed3cb03ea.png

 

If you're using unstable... just move to stable if you don't wanna be here 24/7 requesting help coz of strange bugs.

  • 0
Posted

latest h5:

 

5ed3cb03ea.png

 

If you're using unstable... just move to stable if you don't wanna be here 24/7 requesting help coz of strange bugs.

 

just few seconds ago i found a way to stop the drain while have flag..

L2Character.java

				// Absorb HP from the damage inflicted
				double absorbPercent = getStat().calcStat(Stats.ABSORB_DAMAGE_PERCENT, 0, null, null);
				
				if (absorbPercent > 0)
				{
					int maxCanAbsorb = (int) (getMaxRecoverableHp() - getCurrentHp());
					int absorbDamage = (int) ((absorbPercent / 100.) * damage);
					
					if (absorbDamage > maxCanAbsorb)
					{
						absorbDamage = maxCanAbsorb; // Can't absord more than max hp
					}

-                                       if ((absorbDamage > 0)
-                                       {
-                                           setCurrentHp(getCurrentHp() + absorbDamage);
-                                       }					
+					if ((absorbDamage > 0) && (activeChar.getPvpFlag() > 0))
+					{
+						absorbDamage = 0;
+					}
+					else
+					{
+						setCurrentHp(getCurrentHp() + absorbDamage);
+					}
				}

working well in game... but on every normal attack i do i got this error:

Exception in thread "AISTPool-3" java.lang.NullPointerException
	at com.l2jserver.gameserver.model.actor.L2Character.onHitTimer(L2Character.java:5084)
	at com.l2jserver.gameserver.model.actor.tasks.character.HitTask.run(HitTask.java:60)
	at com.l2jserver.gameserver.ThreadPoolManager$RunnableWrapper.run(ThreadPoolManager.java:93)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:724)

any idea how to stop this annoying error?!

  • 0
Posted (edited)

Take care coz you won't get hp if you are hitting players.

You must create a check like..

 

if (absorbDamage > 0 && activeChar != null && activeChar.getPvpFlag() > 0 && activeChar.getTarget() != null && !(activeChar.getTarget() instanceof L2PcInstance) && !(activeChar.getTarget() instanceof L2Summon))
{
absorbDamage = 0;
}
Edited by ^Wyatt
  • 0
Posted (edited)

Take care coz you won't get hp if you are hitting players.

You must create a check like..

 

if (absorbDamage > 0 && activeChar != null && activeChar.getPvpFlag() > 0 && activeChar.getTarget() != null && !(activeChar.getTarget() instanceof L2PcInstance) && !(activeChar.getTarget() instanceof L2Summon))
{
absorbDamage = 0;
}

isn't better to put 

!(activeChar.getTarget() instanceof L2MonsterInstance)

where you have 

!(activeChar.getTarget() instanceof L2Summon)

?

Edited by xXObanXx
  • 0
Posted (edited)

No because like I posted, we are avoiding playerVsplayer and playerVsSummon

well u could put if target instanceof L2MonsterInstance without the "!", yep do it

 

 

if (absorbDamage > 0 && activeChar != null && activeChar.getPvpFlag() > 0 && activeChar.getTarget() != null && (activeChar.getTarget() instanceof L2MonsterInstance))
{
absorbDamage = 0;
}
Edited by ^Wyatt
  • 0
Posted

No because like I posted, we are avoiding playerVsplayer and playerVsSummon

well u could put if target instanceof L2MonsterInstance without the "!", yep do it

 

 

if (absorbDamage > 0 && activeChar != null && activeChar.getPvpFlag() > 0 && activeChar.getTarget() != null && (activeChar.getTarget() instanceof L2MonsterInstance))
{
absorbDamage = 0;
}

i don't know why... but it doesn't work... with this code:

if ((absorbDamage > 0) && (activeChar != null) && (activeChar.getPvpFlag() > 0) && (activeChar.getTarget() != null) && (activeChar.getTarget() instanceof L2MonsterInstance) && (!(activeChar.getTarget() instanceof L2PcInstance) && !(activeChar.getTarget() instanceof L2Summon)))
					{
						absorbDamage = 0;
					}
					else
					{
						setCurrentHp(getCurrentHp() + absorbDamage);
					}
  • 0
Posted (edited)

well it's not which I posted but should work too... messing up in L2Character is not the best option btw

u could try to System.out.println(activeChar); System.out.println(activeChar.getTarget()); to see if some of them is null when that method is called

Edited by ^Wyatt
  • 0
Posted

well it's not which I posted but should work too... messing up in L2Character is not the best option btw

u could try to System.out.println(activeChar); System.out.println(activeChar.getTarget()); to see if some of them is null when that method is called

am i doing it right? 

if ((absorbDamage > 0) && (activeChar != null) && (activeChar.getPvpFlag() > 0) && (activeChar.getTarget() != null) && (activeChar.getTarget() instanceof L2MonsterInstance))
					{
						System.out.println(activeChar);
						System.out.println(activeChar.getTarget());
						absorbDamage = 0;
					}

btw i've tried to delete activeChar != null and activeChar.getTarget() != null and it worked but with error Exception in thread "AISTPool-6"

Guest
This topic is now closed to further replies.


  • Posts

    • I wouldn't expect something less, since you work with Psadek (or I maybe mistake you with NightW0lf from itopz, in that case soz) Let's throw rocks at Java Golds and elevate "original L2OFF Golds", no?
    • We are delighted to announce our partnership with the leading resource, Active Anticheat, specializing in protection against bot programs, clickers, and additional modules for the game client that enhance the experience for both you and the players!   When you purchase Active Anticheat for our product, you will also receive a $50 discount.   Here's a brief overview of the features of Active Anticheat: Best protection against bots, including private and premium versions. Window limitation. HWID spoofing protection. Virtual machine protection. File hash protection for client files, preventing players from modifying them (e.g., interface files). Encryption of any game files. Integration with Discord to attract new players! Additional plugins: - Window with saved player logins/passwords. Players no longer need to enter them every time! - HWID sending to the game server. - Game window optimizer for quick switching. - Background FPS adjustment. - Window name customization in the format "%character_name% - %server_name%". - Ctrl+C/V permission. - Login and password saving (for Interlude -> High Five). - Launching the browser via server packets. - Launching interface events via server packets. - Interlude: fixing a known game bug (History: UpdateAnimation <- AActor::Tick <- TickAllActors <- ULevel::Tick <- (NetMode=0) <- TickLevel <- UGameEngine::Tick <- UpdateWorld <- MainLoop). - Interlude: debuff feature. 9) All of this is available without modifying the game server code (some plugins may require minor changes). Take note of newest plugin, which is highly useful: Guides section
    • The Lucera2 Multiprotocol is an advanced server branch for Lineage 2 that enables seamless support for multiple client versions on a single server instance. This allows players to connect and play using either the legacy (old) client or the newer Classic client simultaneously, without any compatibility issues or loss of functionality. Key Benefits Dual Client Support: Both the old Interlude client and Classic: Secret of Empire 2.6 client can run concurrently on the same server. All features from the Classic client (e.g., enhanced UI, new mechanics) remain fully available, while the old client retains its alternative features (e.g., simplified interfaces for lower-end hardware). Expanded Player Base: Ideal for regions with limited access to modern gaming setups, as it accommodates a wider range of devices and preferences, merging Legacy and Classic communities into one forum section for unified discussions. No Functionality Gaps: Extensive testing ensures zero disruptions—players on either client experience complete game integrity, including quests, PvP, raids, and custom Lucera2 subsystems. You can fully test and explore all aspects of Multiprotocol on the dedicated Test Server. Supported Protocols C6 (Old Client): Protocol versions 740–770. Classic Client (Secret of Empire 2.6): Protocol versions 166–192.
    • Connect to the server you need to >>>download<<< game client launch from /system_en/. Login server setup on auto registration, admin rights in game by default . Or you can use a patch specifying the l2.ini Connect to address classic.lucera2.com if you already have a game client Download updated patch All major/minor subsystems operate in a proper view. Absolutely ready to combat the server.
  • 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