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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • Fix Visual Boundary for AutoFarm when entering a new zone. Fix Assassin Interface Automatic SoulShot usage. Fix Assassin Interface not displaying Castle/Base. Fix Achievements displaying item rewards for CommunityBoard & NPC. Fix Prevent players from purchasing their own Auctioned items. Added ''.raid'' and ''.achievement'' commands. Added support for multiple currencies on Auction Added Search feature to Auction. Added Offline Stores Added '.exit' & '.quit' command to Dungeon System so players can now exit/quit dungeons Added VIP Account System (Alternative XP, SP & Drop Rates, Unlocks Costumes) Added Loot Box System Changed DungeonsManager now displays reward list on dungeon pages. Changed GlobalShop to include pages for all currencies. HTML/XML edits
    • When I teleport to town, my current location is differ from the map. How do I fix this?    
    • A New Chapter Begins We're Rebuilding – Join Our Staff Team After many years of activity, growth, and challenges, it’s finally time for our community to restructure and move forward. We’re ready to turn a new page and evolve into something greater — but we can’t do it without the help of passionate and committed people. That’s why we’re now opening up staff applications for those who want to actively shape the future of our community. If you have the motivation, time, and patience to contribute to something meaningful, this is your chance to step in and make a real impact. What We're Looking For We’re building a fresh and dedicated team of individuals who are ready to support and grow this project. Open roles include: Moderators – to keep the forum clean, safe, and organized Gaming Moderators – to help manage gaming boards (e.g., Lineage, GTA FiveM) Content Creators – to post updates, guides, and articles Community Managers – to engage users and drive activity Technical Staff – for development, backend, and server work We’re not focusing only on Lineage anymore. Our vision is expanding to new areas — including GTA FiveM and other multiplayer games you might have expertise in. If you have a good idea, a server plan, or something new to suggest — we’re open to it. Now’s the time to bring it forward. Requirements We’re looking for individuals who have: A history of activity on the forum (preferred) Available time to contribute consistently A sense of teamwork and responsibility A genuine interest in gaming and community building If you're interested, just send a private message to me or Celestine. (or just reply here) Tell us a few things about yourself and how you’d like to contribute. Let’s bring this community back to life. Let’s rebuild something great — together.   M M G A 
  • Topics

×
×
  • Create New...