Jump to content
  • 0

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


xXObanXx

Question

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.!)

Link to comment
Share on other sites

Recommended Posts

  • 0

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

 

Error!

Exception in thread "AISTPool-5" java.lang.NullPointerException
	at com.l2jserver.gameserver.model.actor.L2Character.onHitTimer(L2Character.java:5092)
	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)

wait a sec... i'm gonna restart the server and try again..!

 

EDIT: Error after restart on server..!

Exception in thread "AISTPool-5" null
java.lang.NullPointerException
	at com.l2jserver.gameserver.model.actor.L2Character.onHitTimer(L2Character.java:5092)
	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)
null
Exception in thread "AISTPool-1" java.lang.NullPointerException
	at com.l2jserver.gameserver.model.actor.L2Character.onHitTimer(L2Character.java:5092)
	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)
null
Exception in thread "AISTPool-3" java.lang.NullPointerException
	at com.l2jserver.gameserver.model.actor.L2Character.onHitTimer(L2Character.java:5092)
	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)

Edited by xXObanXx
Link to comment
Share on other sites

  • 0

This thing is pissing me off xDDD i forgot null checks but... however..

 

 

						if (absorbDamage > 0)
 						{
+							if (this != null && (this instanceof L2PcInstance) && (target instanceof L2MonsterInstance) && (((L2PcInstance) this).getPvpFlag() > 0))
+							{
+								absorbDamage = 0;
+							}
 							setCurrentHp(getCurrentHp() + absorbDamage);
 						}
 					}
It's just the wrong way, SkillDrain.java was the correct way :3 Edited by ^Wyatt
Link to comment
Share on other sites

  • 0

This thing is pissing me off xDDD i forgot null checks but... however..

 

 

						if (absorbDamage > 0)
 						{
+							if (this != null && (this instanceof L2PcInstance) && (target instanceof L2MonsterInstance) && (((L2PcInstance) this).getPvpFlag() > 0))
+							{
+								absorbDamage = 0;
+							}
 							setCurrentHp(getCurrentHp() + absorbDamage);
 						}
 					}
It's just the wrong way, SkillDrain.java was the correct way :3

 

sorry... was my fault... i was have error here: 

System.out.println(activeChar);

now i removed this line and working properly..!

problem fixed!!!

thank you very much man!

now... any idea about my first question? (player cannot drop down HP if is in olympiad and match didn't started) (avoid prefrenzy)

Link to comment
Share on other sites

  • 0

If I'm not wrong the only way to prefrenzy is with Conversion weapon so you could just go to .xml of Converstion type weapons and add isolyrestricted="true"

and if you don't want angelic icon I think if u put npc no-attackables it blocks heal too, not sure u should test

Link to comment
Share on other sites

  • 0

If I'm not wrong the only way to prefrenzy is with Conversion weapon so you could just go to .xml of Converstion type weapons and add isolyrestricted="true"

and if you don't want angelic icon I think if u put npc no-attackables it blocks heal too, not sure u should test

i don't think this will help... a good way is to put the items that are giving HP to restricted items in oly or just with some way to make while player is in oly and the match didn't start yet, the hp will update automaticall every second until the match beggins!

Link to comment
Share on other sites

  • 0

It's not about items that give HP, is about items that takes your XP far away :P

As I said, Conversion items :>

 

And no... updating your HP every X time is not a "good way" x'D

Link to comment
Share on other sites

  • 0

It's not about items that give HP, is about items that takes your XP far away :P

As I said, Conversion items :>

 

And no... updating your HP every X time is not a "good way" x'D

hmmm... i will check it.... btw... thank you very much for your help..! you can lock this topic now! ;)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...