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

    • https://www.l2jbrasil.com/topic/149147-daily-reward-tested-on-l2jsunrise/  to h5 sunrise
    • https://www.l2jbrasil.com/topic/149147-daily-reward-tested-on-l2jsunrise/   
    • A lot of people say L2 is dead, and ACIS is still in development. But seriously, you’ve got the skills and knowledge why not make your own game with a clean brand new client from scratch? The only thing missing is client devs, and you can find plenty here or on freelance sites. Stop treating it like a hobby and turn it into something that can actually make money and people happy, you have the name just move forward, even AI can help you script quests, me first I would totally play any game you made similar to l2 anyway 🍪 have one i know you like them
    • Would it be possible to update the guide? The images are offline! 😞
    • In the fast-paced world of digital marketing, having the right tools makes all the difference. If you're searching for a reliable SMM panel Nigeria, GoUpSocial is here to take your online presence to the next level. Built for influencers, marketers, startups, and content creators, our platform is the ultimate solution for smart and scalable social media growth. With GoUpSocial, you get more than just numbers—you get engagement that drives real impact. As a trusted Nigerian SMM panel, we help you gain visibility across top platforms like Instagram, TikTok, YouTube, Facebook, and Twitter—all at the most competitive prices in the market. Experience the Power of the Best SMM Panel in Nigeria We understand that quality matters just as much as affordability. That’s why GoUpSocial has become the go-to platform for users seeking the best SMM panel in Nigeria. Here’s what makes us the preferred choice: 🚀 Real-Time Delivery: Get your orders processed and completed in minutes, not hours. 💼 All-in-One Dashboard: Manage all your campaigns with ease from a clean, simple interface. 💡 Effective Strategies: Our tools are tailored for organic-looking growth and high user engagement. 🧾 Transparent Pricing: No hidden fees—just straightforward, affordable packages. 👩‍💻 Expert Support: Our team is available 24/7 to guide you through every step of the process. Whether you need more followers, likes, views, or overall engagement, our SMM panel Nigeria services deliver measurable and meaningful results. Why We’re the Nigeria Fastest and Cheapest SMM Panel GoUpSocial isn’t just another provider—it’s the Nigeria fastest and cheapest SMM panel built with performance and value in mind. We combine automation, intelligent targeting, and local market understanding to help you scale effortlessly. Need to boost a campaign today? Our platform supports instant order processing, real-time tracking, and localized engagement strategies—making it ideal for any influencer or business operating in Nigeria. Plus, as the cheapest SMM panel in Nigeria, we make sure that even clients with limited budgets can access top-quality services without compromise. A Nigerian SMM Panel Built for 2025 and Beyond As social media algorithms evolve, traditional methods of gaining reach and engagement no longer work. That’s why we’ve built the SMM panel Nigeria 2025—a next-gen platform optimized for today’s challenges. From smart delivery settings to niche-specific targeting, GoUpSocial provides you with every advantage in a competitive digital world. Our system adapts to the latest platform changes, helping you stay relevant, visible, and in control. Looking for a localized service? Our SMM panel for Nigerian followers helps you connect directly with your audience—boosting both credibility and conversions. All-in-One Online Panel in Nigeria for Every Social Goal No matter your objective—brand awareness, follower growth, or engagement improvement—GoUpSocial is the online panel in Nigeria that offers it all. With flexible services, dynamic campaigns, and secure systems, we give you the tools to succeed in a crowded online space. And because we’re committed to your growth, our platform is continually updated to reflect the best practices of modern digital marketing. Take the Leap with the Best Nigerian SMM Panel Ready to grow smarter? With GoUpSocial, you don’t just gain social proof—you build real influence. As the cheapest Nigeria SMM panel, we combine speed, quality, and affordability in one seamless platform. Whether you're an aspiring influencer, a marketing agency, or a brand aiming for greater reach, GoUpSocial is the ultimate Nigerian SMM panel to help you reach your full potential. 👉 Sign up today and unlock the next level of social media growth with GoUpSocial.
  • 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