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

    • Upgrade your Telegram Gifts to NFT level with SOCNET! Buy Telegram Stars quickly, conveniently, and at the best prices — maybe you’ll be lucky enough to get a rare black-background model! Active SOCNET Store Links: Digital goods store (Website): Go Store Telegram bot: Go – convenient access to the store through the Telegram messenger. Telegram bot for purchasing Telegram Stars: Go – fast and profitable way to buy Telegram Stars. SMM Panel: Go – promote your social media accounts. We would like to present you with the current list of promotions and special offers for purchasing products and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website or Bot) during September! You can also use the first-time promo code SOCNET (15% discount). 2. Get $1 credited to your store balance or a 10–20% discount — just post your username after registration on our website in the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — simply open a support ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly giveaways of Telegram Stars in our Telegram channel and in our Telegram bot for Star purchases! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Upgrade your Telegram Gifts to NFT level with SOCNET! Buy Telegram Stars quickly, conveniently, and at the best prices — maybe you’ll be lucky enough to get a rare black-background model! Active SOCNET Store Links: Digital goods store (Website): Go Store Telegram bot: Go – convenient access to the store through the Telegram messenger. Telegram bot for purchasing Telegram Stars: Go – fast and profitable way to buy Telegram Stars. SMM Panel: Go – promote your social media accounts. We would like to present you with the current list of promotions and special offers for purchasing products and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website or Bot) during September! You can also use the first-time promo code SOCNET (15% discount). 2. Get $1 credited to your store balance or a 10–20% discount — just post your username after registration on our website in the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — simply open a support ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly giveaways of Telegram Stars in our Telegram channel and in our Telegram bot for Star purchases! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Upgrade your Telegram Gifts to NFT level with SOCNET! Buy Telegram Stars quickly, conveniently, and at the best prices — maybe you’ll be lucky enough to get a rare black-background model! Active SOCNET Store Links: Digital goods store (Website): Go Store Telegram bot: Go – convenient access to the store through the Telegram messenger. Telegram bot for purchasing Telegram Stars: Go – fast and profitable way to buy Telegram Stars. SMM Panel: Go – promote your social media accounts. We would like to present you with the current list of promotions and special offers for purchasing products and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website or Bot) during September! You can also use the first-time promo code SOCNET (15% discount). 2. Get $1 credited to your store balance or a 10–20% discount — just post your username after registration on our website in the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — simply open a support ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly giveaways of Telegram Stars in our Telegram channel and in our Telegram bot for Star purchases! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • 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