Jump to content

Recommended Posts

Posted

one more smile code i make l2jroboto eflocrash code the fake players play pvp..

but the problem is for have all time pvp you need make a zone with respawn teleport like primeval isle

i think you like it.

enjoy

com/elfocrash/roboto/ai/FakePlayerAI.java

find this

-	protected void tryTargetRandomCreatureByTypeInRadius(Class<? extends Creature> creatureClass, int radius)
-	{
-		if(_fakePlayer.getTarget() == null) {
-			List<Creature> targets = _fakePlayer.getKnownTypeInRadius(creatureClass, radius).stream().filter(x->!x.isDead()).collect(Collectors.toList());
-			if(!targets.isEmpty()) {
-				Creature target = targets.get(Rnd.get(0, targets.size() -1 ));
-				_fakePlayer.setTarget(target);				
-			}
-		}else {
-			if(((Creature)_fakePlayer.getTarget()).isDead())
-			_fakePlayer.setTarget(null);
-		}	
-	}

change wtih this
+  protected void tryTargetRandomCreatureByTypeInRadius(Class<? extends L2Character> creatureClass, int radius)
+	{
+		if (_fakePlayer.getTarget() == null)
+		{
+			if(_fakePlayer.isInsideZone(ZoneId.PEACE) || _fakePlayer.isInsideZone(ZoneId.TOWN))
+				return;
+			
+			List<L2Character> targets = _fakePlayer.getKnownTypeInRadius(creatureClass, radius).stream().filter(x -> !x.isDead()).collect(Collectors.toList());
+			if (!targets.isEmpty())
+			{
+				L2Character target = targets.get(Rnd.get(0, targets.size() - 1));
+				
+				if (_fakePlayer.getPvpFlag() == 0 && target.getActingPlayer().getPvpFlag() == 0 || _fakePlayer.getPvpFlag() != 0 && target.getActingPlayer().getPvpFlag() == 0 || _fakePlayer.getPvpFlag() == 0 && target.getActingPlayer().getPvpFlag() != 0 || _fakePlayer.getPvpFlag() != 0 && target.getActingPlayer().getPvpFlag() != 0)
+					_fakePlayer.setTarget(target);
+				
+				else if (_fakePlayer.getKarma() > 0 && target.getActingPlayer().getKarma() == 0 || _fakePlayer.getPvpFlag() == 0 && target.getActingPlayer().getKarma() > 0 || _fakePlayer.getPvpFlag() > 0 && target.getActingPlayer().getKarma() > 0)
+					_fakePlayer.setTarget(target);
+				
+			}
+		}
+		else
+		{
+			if (((L2Character) _fakePlayer.getTarget()).isDead())
+				_fakePlayer.setTarget(null);
+		}
+	}

and from all class name AI with name this *** public void thinkAndAct() ***

find all this

-	tryTargetRandomCreatureByTypeInRadius(FakeHelpers.getTestTargetClass(), FakeHelpers.getTestTargetRange());

and change with this

+		if (_fakePlayer.getKnownTypeInRadius(FakePlayer.class, FakeHelpers.getTestTargetRange()) != null)
+		{
+			tryTargetRandomCreatureByTypeInRadius(FakeHelpers.getTargetPvPClass(), FakeHelpers.getTestTargetRange());
+		}
+		
+		else if (_fakePlayer.getKnownTypeInRadius(Monster.class, FakeHelpers.getTestTargetRange()) != null)
+		{
+			tryTargetRandomCreatureByTypeInRadius(FakeHelpers.getTargetMobClass(), FakeHelpers.getTestTargetRange());
+		}

on FakeHelpers.java
after this
	public static Class<? extends L2Character> getTargetMobClass()
	{
		return Monster.class;
	}

put this
	
+	//target fakeplayers instance only...
+	public static Class<? extends L2Character> getTargetPvPClass()
+	{
+		return FakePlayer.class;
+	}

if any have problem post error only... tnx.

 

Posted (edited)

You just need to make a check function so that the fake player may know who is the enemy, this is my code based on L2J Server

 

	protected boolean checkTargetThreat(L2Character target)
	{
		if (target == null)
		{
			return false;
		}
		if (target.isDead() || target.isInvisible() || (_fakePlayer.getLeader() == target))
		{
			return false;
		}
		if (target.isPlayable() && (target.isInsideZone(ZoneId.PEACE) || target.isInsideZone(ZoneId.NO_SUMMON_FRIEND)))
		{
			return false;
		}
		if (target.isPlayer())
		{
			L2PcInstance player = (L2PcInstance) target;
			if (player.isFake() && _fakePlayer.isSameSide((FakePlayer) player))
			{
				return false;
			}
			if ((player.getKarma() > 0) || (player.getPvpFlag() > 0))
			{
				return true;
			}
			if ((player.isInsideZone(ZoneId.PVP) && (player.getActiveWeaponInstance() != null)) || player.isInsideZone(ZoneId.SIEGE))
			{
				return true;
			}
		}
		else if (target.isSummon())
		{
			L2Summon summon = (L2Summon) target;
			if ((summon.getKarma() > 0) || (summon.getPvpFlag() > 0))
			{
				return true;
			}
			if (summon.isInsideZone(ZoneId.PVP) || summon.isInsideZone(ZoneId.SIEGE))
			{
				return true;
			}
		}
		else if (target.isAttackable())
		{
			if (!target.isTargetable())
			{
				return false;
			}
			if (target.isRaid() && ((target.getLevel() + 8) < _fakePlayer.getLevel()))
			{
				return false;
			}
			if (target.isNpc() && ((((L2Npc) target).getId() == 2502) || (((L2Npc) target).getId() == 2503)))
			{
				return false;
			}
			if (target.isMonster())
			{
				return true;
			}
			if (target.getTarget() == _fakePlayer)
			{
				return true;
			}
			if ((target.getTarget() != null) && target.getTarget().isPlayer())
			{
				if (((L2PcInstance) target.getTarget()).isInPartyWith(_fakePlayer))
				{
					return true;
				}
			}
		}
		return false;
	}

 

 

 

 

Edited by ShinichiYao
Posted
On 9/12/2018 at 6:43 PM, tazerman2 said:

one more smile code i make l2jroboto eflocrash code the fake players play pvp..

but the problem is for have all time pvp you need make a zone with respawn teleport like primeval isle

i think you like it.

enjoy 


com/elfocrash/roboto/ai/FakePlayerAI.java

find this

-	protected void tryTargetRandomCreatureByTypeInRadius(Class<? extends Creature> creatureClass, int radius)
-	{
-		if(_fakePlayer.getTarget() == null) {
-			List<Creature> targets = _fakePlayer.getKnownTypeInRadius(creatureClass, radius).stream().filter(x->!x.isDead()).collect(Collectors.toList());
-			if(!targets.isEmpty()) {
-				Creature target = targets.get(Rnd.get(0, targets.size() -1 ));
-				_fakePlayer.setTarget(target);				
-			}
-		}else {
-			if(((Creature)_fakePlayer.getTarget()).isDead())
-			_fakePlayer.setTarget(null);
-		}	
-	}

change wtih this
+  protected void tryTargetRandomCreatureByTypeInRadius(Class<? extends L2Character> creatureClass, int radius)
+	{
+		if (_fakePlayer.getTarget() == null)
+		{
+			if(_fakePlayer.isInsideZone(ZoneId.PEACE) || _fakePlayer.isInsideZone(ZoneId.TOWN))
+				return;
+			
+			List<L2Character> targets = _fakePlayer.getKnownTypeInRadius(creatureClass, radius).stream().filter(x -> !x.isDead()).collect(Collectors.toList());
+			if (!targets.isEmpty())
+			{
+				L2Character target = targets.get(Rnd.get(0, targets.size() - 1));
+				
+				if (_fakePlayer.getPvpFlag() == 0 && target.getActingPlayer().getPvpFlag() == 0 || _fakePlayer.getPvpFlag() != 0 && target.getActingPlayer().getPvpFlag() == 0 || _fakePlayer.getPvpFlag() == 0 && target.getActingPlayer().getPvpFlag() != 0 || _fakePlayer.getPvpFlag() != 0 && target.getActingPlayer().getPvpFlag() != 0)
+					_fakePlayer.setTarget(target);
+				
+				else if (_fakePlayer.getKarma() > 0 && target.getActingPlayer().getKarma() == 0 || _fakePlayer.getPvpFlag() == 0 && target.getActingPlayer().getKarma() > 0 || _fakePlayer.getPvpFlag() > 0 && target.getActingPlayer().getKarma() > 0)
+					_fakePlayer.setTarget(target);
+				
+			}
+		}
+		else
+		{
+			if (((L2Character) _fakePlayer.getTarget()).isDead())
+				_fakePlayer.setTarget(null);
+		}
+	}

and from all class name AI with name this *** public void thinkAndAct() ***

find all this

-	tryTargetRandomCreatureByTypeInRadius(FakeHelpers.getTestTargetClass(), FakeHelpers.getTestTargetRange());

and change with this

+		if (_fakePlayer.getKnownTypeInRadius(FakePlayer.class, FakeHelpers.getTestTargetRange()) != null)
+		{
+			tryTargetRandomCreatureByTypeInRadius(FakeHelpers.getTargetPvPClass(), FakeHelpers.getTestTargetRange());
+		}
+		
+		else if (_fakePlayer.getKnownTypeInRadius(Monster.class, FakeHelpers.getTestTargetRange()) != null)
+		{
+			tryTargetRandomCreatureByTypeInRadius(FakeHelpers.getTargetMobClass(), FakeHelpers.getTestTargetRange());
+		}

on FakeHelpers.java
after this
	public static Class<? extends L2Character> getTargetMobClass()
	{
		return Monster.class;
	}

put this
	
+	//target fakeplayers instance only...
+	public static Class<? extends L2Character> getTargetPvPClass()
+	{
+		return FakePlayer.class;
+	}

if any have problem post error only... tnx.

 

 

 

organization the topic is missing the import

floods prevent
Posted
On 13/09/2018 at 01:26, ShinichiYao said:

Você só precisa fazer uma função de verificação para que o jogador falso saiba quem é o inimigo, este é o meu código baseado no servidor L2J.

 


 

 

 

 

Is this code you quoted going on FakePlayerAI.java?
Can you cite some reference line?

 

On 12/09/2018 at 18:43, tazerman2 said:

mais um código de sorriso eu faço código de eflocrash l2jroboto os jogadores falsos jogar pvp ..

mas o problema é ter todo o tempo pvp você precisa fazer uma zona com respawn teleport como a ilha primeva

eu acho que você gosta.

apreciar




   
	
		   
			
			 
				  
				
			
		 
			

			
	

     
	
		   
		
			 
				
			
			 
			 
			
  
				
				                        

				
				                   

				
			
		
		
		
			 

		
	

     


 

 

		    
		
 
		
		
		     
		
 
		

	   
	
		 
	

	
	
	   
	
		 
	

 

I'm having trouble implementing your code, I did not understand this, if you can help me I'll be grateful.

and from all class name AI with name this *** public void thinkAndAct() ***

find all this

-	tryTargetRandomCreatureByTypeInRadius(FakeHelpers.getTestTargetClass(), FakeHelpers.getTestTargetRange());

and change with this

+		if (_fakePlayer.getKnownTypeInRadius(FakePlayer.class, FakeHelpers.getTestTargetRange()) != null)
+		{
+			tryTargetRandomCreatureByTypeInRadius(FakeHelpers.getTargetPvPClass(), FakeHelpers.getTestTargetRange());
+		}
+		
+		else if (_fakePlayer.getKnownTypeInRadius(Monster.class, FakeHelpers.getTestTargetRange()) != null)
+		{
+			tryTargetRandomCreatureByTypeInRadius(FakeHelpers.getTargetMobClass(), FakeHelpers.getTestTargetRange());
+		}
  • 2 weeks later...
Posted

Yes it in FakePlayerAI.java

 

And you can get enemies like this

List<L2Character> targets = _fakePlayer.getKnownList().getKnownCharactersInRadius(radius).stream().filter(x -> (checkTargetThreat(x) && GeoData.getInstance().canSeeTarget(_fakePlayer, x))).collect(Collectors.toList());

 

  • Like 1
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • "I recently purchased the account panel from this developer and wanted to leave a positive review.   The transaction was smooth, and the developer demonstrated exceptional professionalism throughout the process.   What truly sets them apart is their outstanding post-sale support. They are responsive, patient, and genuinely helpful when addressing questions or issues. It's clear they care about their customers' experience beyond just the initial sale.   I am thoroughly satisfied and grateful for the service. This is a trustworthy seller who provides real value through both a quality product and reliable support. 100% recommended."
    • Server owners, Top.MaxCheaters.com is now live and accepting Lineage 2 server listings. There is no voting, no rankings manipulation, and no paid advantages. Visibility is clean and equal, and early listings naturally appear at the top while the platform grows. If your server is active, it should already be listed. Submit here https://Top.MaxCheaters.com This platform is part of the MaxCheaters.com network and is being built as a long-term reference point for the Lineage 2 community. — MaxCheaters.com Team
    • ⚙️ General Changed “No Carrier” title to “Disconnected” to avoid confusion after abnormal DC. On-screen Clan War kill notifications will no longer appear during Sieges, Epics, or Events. Bladedancer or SwordSinger classes can now log in even when Max Clients (2) is reached, you cannot have both at the same time. The max is 3 clients. Duels will now be aborted if a monster aggros players during a duel (retail-like behavior). Players can no longer send party requests to blocked players (retail-like). Fixed Researcher Euclie NPC dialogue HTML error. Changed Clan leave/kick penalty from 12 hours to 3 hours. 🧙 Skills Adjusted Decrease Atk. Spd. & Decrease Speed land rates in Varka & FoG. Fixed augmented weapons not getting cooldown when entering Olympiad. 🎉 Events New Team vs Team map added. New Save the King map added (old TvT map). Mounts disabled during Events. Letter Collector Event enabled Monsters drop letters until Feb. 13th Louie the Cat in Giran until Feb. 16th Inventory slots +10 during event period 📜 Quests Fixed “Possessor of a Precious Soul Part 1” rare stuck issue when exceeding max quest items. Fixed Seven Signs applying Strife buff/debuff every Monday until restart. 🏆 Milestones New milestone: “Defeat 700 Monsters in Varka” 🎁 Rewards: 200 Varka’s Mane + Daily Coin 🌍 NEW EXP Bonus Zones Hot Springs added Varka Silenos added (hidden spots excluded) As always, thank you for your support! L2Elixir keeps evolving, improving, and growing every day 💙   Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs
    • https://sms.pro/ — we are an SMS activation platform  seeking partners  mobile number providers  mobile number owners  owners of GSM modems  SIM card owners We process 1,000,000 activations every day.  寻找合作伙伴  手机号码提供商  手机号码持有者  GSM调制解调器持有者  SIM卡持有者 我们每天处理1,000,000次激活。  Ищем партнеров  Владельцы сим карт  провайдеров  владельцев мобильных номеров  владельцев модемов  Обрабатываем от 1 000 000 активаций в день ⚡️ Fast. Reliable.   https://sms.pro/ Support: https://t.me/alismsorg_bot
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..