Jump to content
  • 0

Guards attackable


carlos_69

Question

Hi:)

I have less than 10 posts so I have to post my question here.

 

I would like to make Guards attackable as a small kind of "bot protection". Bot choses targets randomly but cant target a PK Guard (ctrl needed). I would like to set a guard to be targeted without a ctrl.

 

I found this:

L2GuardInstance.java

if (containsTarget(player))

{

if (_log.isDebugEnabled())

_log.debug(player.getObjectId() + ": Attacked guard " + getObjectId());

 

// Set the L2PcInstance Intention to AI_INTENTION_ATTACK

player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);    <-----this should be modified

 

Please help me and give any info how do do this.

 

Thank you.

Regards.

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Well dude.. im not a pro but i dont think that this should be changed, cuz i think this sends packet that guard is auto-attackable... and as i understanded u wanna have a guard auto-attackable.

>> if (containsTarget(player))  this is checking if player is in aggroList (if he got karma or he had attacked guard), so...

 

Delete everything else and keep just the ATTACK_INTENTION or put something else instead  "if (containsTarget(player))" this.

Link to comment
Share on other sites

  • 0

well the control intention just the attack state the basic thing is applied to all kind of npc instance at the same place so i guess you need to lookup the l2npc.java maybe(idk what chronicle you use maybe its not there) or the attackableai.java

Link to comment
Share on other sites

  • 0

Dunno.. i just tried to delete aggroList check and Interact check, and put just an AI_INTENTION_ATTACK and it kinda worked...

 

well thats really depends on the ai engine so you cant say its work generally :)

Link to comment
Share on other sites

  • 0

what chronicle you use maybe its not there)

 

Gracia Final

 

Dunno.. i just tried to delete aggroList check and Interact check, and put just an AI_INTENTION_ATTACK and it kinda worked...

 

So code should be like this?

 

public void onAction(L2PcInstance player)
{
	if (!canTarget(player))
		return;

	// Check if the L2PcInstance already target the L2GuardInstance
	if (getObjectId() != player.getTargetId())
	{
		if (_log.isDebugEnabled())
			_log.debug(player.getObjectId() + ": Targetted guard " + getObjectId());

		// Set the target of the L2PcInstance player
		player.setTarget(this);
	}
	else
	{
                player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);
	}
       }

 

Once again thank you guys for your time to help me ;)

Link to comment
Share on other sites

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
Answer this question...

×   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

    • You are contradicting yourself! In your first message you clearly state "I want to create a GF server on the latest client." What this means is you want a GF server that is working on the latest client. You didn't say "not exactly like GF". You explicitly stated that the server would be GF and the client will be whichever new client you could find. You never asked for servers either. You asked how to do it, and more specifically: "to link Gracia Final Pack to that client. Do I just get a clean install and edit ini in the client", which brought me to the conclusion that you were completely oblivious and/or delusional, hense my EXTENSIVE and ON-POINT response, if I say so myself.      
    • oh, i didnt know that. I got everything i need. Thank you so much for your information and help!
    • In every mobius source there should be a readme file with all the links you need (system, client, IDEs etc). Best of luck!
    • I didnt say i dont know anything but i couldnt find a place to start. a guy here mentioned l2jmobius which is a good place to start. so i searched for it and its actually what i wanted. Now i just need to find a clean client to start. I know how to program and how to do changed to client but its hard to find clean clients. I dont really want to make my server exactly like gracia final. I just want to test out the clients and decide which one works better for me. I dont really like the awakening classes and the newest races. Can you please provide me with a couple of links of different clients so i can test them out before i start my project? As i said i cant really find any clean install client. Thank you in advance
    • OUR OFFICIAL WEBSITE / FORUM - MILLENNIUM-HOOK.NET CHEAT DESCRIPTION: Our cheat for Fortnite game has proven itself in the best way among players, the cheat has good optimization, a beautiful visual appearance and has extensive functionality. And reliable protection and HWID Spoofer give our cheat even more advantages over competitors! SUPPORTED ANTI-CHEATS: (read more on official website) - Easy Anti-Cheat (EAC): Undetected & Safe - BattlEye AC: Undetected & Safe - Hyperion AC: Undetected & Safe Our Fortnite cheat has a limited number of slots to ensure greater product security! (Available slots check on official website) FEATURES: AIMBOT: - Aim bone - Silent aim - Smooth - Fov - Distance - Key ESP: - Players - Loot - Vehicles - Traps - Other MISC: - No bloom - No spread - Vehicle flight - Instarevive - Aim while Jumping - Teleport to players within 4m (10m with pickaxe) or teleport downed players to you. - Teleport key - Fov changer REQUIREMENTS: - Included HWID Spoofer: Yes - Stream Bypass: No (Engineering works. Will be available again soon). - Supported game modes: Windowed, Borderless - Supported platforms: Steam / Uplay / Epic Games - Supported CPU: Intel & AMD - Supported OS: Windows 10 (1903,1909,2004,20H2,21H1, 22H2), Windows 11 (All version). Supported OS change and are added periodically. More check on official website.   IN-GAME SCREENSHOTS:   - Check on the official website.
  • Topics

×
×
  • Create New...