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

    • Dear friends, right now we are holding a grand competition with a prize fund of more than $ 1000 in our stores https://socnet.store , telegram store: https://socnet.shop and SMM panel: https://socnet.pro There are more than 50 prize places in our competition, each lucky person can take one of the places. Important condition: you must make a purchase at any time before June 1, 2025. The more purchases you make - the more chances you have to win the main prize in the community of $ 300! ➡ Our Online Shop: socnet.store  ➡ Our SMM-Boosting Panel: socnet.pro  ➡ Telegram Shop Bot: socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: 79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
    • Dear friends, right now we are holding a grand competition with a prize fund of more than $ 1000 in our stores https://socnet.store , telegram store: https://socnet.shop and SMM panel: https://socnet.pro There are more than 50 prize places in our competition, each lucky person can take one of the places. Important condition: you must make a purchase at any time before June 1, 2025. The more purchases you make - the more chances you have to win the main prize in the community of $ 300! ➡ Our Online Shop: socnet.store  ➡ Our SMM-Boosting Panel: socnet.pro  ➡ Telegram Shop Bot: socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: 79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
    • REBORN ETERNAL IL x10 WTS  1gb 8e (a lot in stock) DR set +6 180e Frintezza+6 200e Zaken+6 200e AQ+6 200e You must go first or Pufa middleman service
    • There's many reasons why it would be more NO than YES : Using NCSoft assets is a death wish, they can lawyer any LU3/Unity if they wanted, since it's a plain steal of intellectual property. It's an hobby, as you said it, and it's not specially about money. Money is a way to filter idiots/resellers, nothing more. It's really about trying to replicate old content and optimize it which I find it fun. I just align with the basic idea than an emulator emulates. When you launch Project64 and SuperMario 64, you don't expect to get something more than 120 stars and Bowser boss in the end - which should have been L2J project to begin with Even if I played a lot with TESCS from Morrowind, back in time, it's not enough to handle current engines, and I'm too lazy to learn Unity/Unreal Engine. Moreover, it would mean buying assets. While doing it alone would be a fail, coupling to L2J / L2 community would still be shitty (since the majority is RU/BR) ; people is only about fame/glory/reselling shit on back of others. Opening to others, the project would be leaked day 1, rebranded and resold. MMO genre is basically dead, and that's not a reboot of any game (l2/wow classic :D) which will turn the tide. Regarding L2 or an remastered version of it, you can obviously blatantly copy-cat it (as Propnight did for Dead by daylight).   All frenchies aren't supposed to do Expedition 33 :).
    • 190euro until last month, don't miss it.
  • 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