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

    • New Dragon-Network Server – Vote Now!   We’re launching a new Dragon-Network (Multiskill) server under a new domain, created by the original Classic-Interlude team. We no longer have access to the old domain, but this is the official continuation — not a scam, just a new home. The new domain will host: A main migrated server (nothing lost – all chars/items kept) Plus seasonal servers (voted by players) All seasonal progress will be merged into the main realm Help shape the new server – vote now: https://dragon-network.eu/   Let’s build the future of DN – together.
    • Hello there, Im beyond confused and dont know what path to take. I want to start working on a L2 server, changing some stuff here and there and finally in the future if  im happy with the results, to launch the server, but... L2j or L2off? After all this years, is there a Interlude L2j close to off?   Ive spent some time lookin over this forum, searching what would be better and what files to take but I ain't near to a clear answer.  Most of the time everyone is trowing stones at everyone, "your filles are trash, my filles are good" and viceversa. Therefore, Im reaching out to a knowledge guy, hopefully from a neutral position to all this drama, that can pin point me in a direction.    To explain what I want for a base start is an Interlude with a classic interface (features), low rate. Mostly what this guy TravorJ is describing in his post TravorJ post , and to do some reworks on it, ex: mobs drop, rethink the augment system/interface, rethink learning skills/enchant skills, create some custom potions/buff effects, siege mechanics... Is that possible on off files? or is better to go with L2j? I also want to mention that I have little to none L2 dev experince (13-15yrs ago I had an L2j server running  for a month where I made some basics changes), but I have coding background so Im used to that and more than willing to learn.   So in conclusion, I dont want to get some free shared files without any support, that I need to wrap my head around and fix stuff for long time to make them work, stuff thats already fixed buy someone else. Instead im looking to buy something thats more updated and start working from there. Question is what and from whom? Kinda sux when you go and buy something and u dont know what the hell are you buying (need some guidance here)   Is L2j Orion a good choice? I saw that is regularly updated. Lucera2 I dont think is something that I want cuz they dont sell soruce, prefer to have control and not to be dependent on someone to much...   Big thanks in advance!   
    • L2 INSIDE - HTML DESIGN     Portfolio - protojahdesigns.com You can also join Protojah Designs Discord
    • Server / Discord Live Discord L2Fol Community . you are welcome to join on our latest updates.
  • 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