Jump to content
  • 0

Summon Pking


Question

Posted

Hello guys, i need some help, if you summon pet in town and you try to use it to attack players its not working, if you first use the pet to attack npc and then a player its working and people are pking in town by using their pets.

My npcs are not attackable but i dont know why pets or summons can attack them.

I have to make npcs not attackable from pets too or fix this with another way. Any help?

9 answers to this question

Recommended Posts

  • 0
Posted

i am using l2jesios

 

	protected void doAttack(L2Character target)
{
	if (Config.DEBUG)
		_log.fine(getName() + " doAttack: target=" + target);

	if (!isAlikeDead() && target != null)
	{
		if (this instanceof L2Npc && target.isAlikeDead() || !getKnownList().knowsObject(target))
		{
			getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
			sendPacket(ActionFailed.STATIC_PACKET);
			return;
		}
		else if (this instanceof L2PcInstance)
		{
			if (target.isDead())
			{
				getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
				sendPacket(ActionFailed.STATIC_PACKET);
				return;
			}

			L2PcInstance actor = (L2PcInstance) this;
			// Players riding wyvern can only do melee attacks
			if (actor.isMounted() && actor.getMountNpcId() == 12621)
			{
				sendPacket(ActionFailed.STATIC_PACKET);
				return;
			}
		}
	}

	if (isAttackingDisabled())
		return;

	if (this instanceof L2PcInstance)
	{
		if (((L2PcInstance) this).inObserverMode())
		{
			sendPacket(SystemMessage.getSystemMessage(SystemMessageId.OBSERVERS_CANNOT_PARTICIPATE));
			sendPacket(ActionFailed.STATIC_PACKET);
			return;
		}

		// Checking if target has moved to peace zone
		if (target.isInsidePeaceZone((L2PcInstance) this))
		{
			getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
			sendPacket(ActionFailed.STATIC_PACKET);
			return;
		}
	}

  • 0
Posted

Soz, post me the onForcedAttack() method too, if u can :P

 

	public void onForcedAttack(L2PcInstance player)
{
	if (isInsidePeaceZone(player))
	{
		// If L2Character or target is in a peace zone, send a system message TARGET_IN_PEACEZONE a Server->Client packet ActionFailed
		player.sendPacket(SystemMessageId.TARGET_IN_PEACEZONE);
		player.sendPacket(ActionFailed.STATIC_PACKET);
		return;
	}

	if (player.isInOlympiadMode() && player.getTarget() != null && player.getTarget() instanceof L2Playable)
	{
		L2PcInstance target = player.getTarget().getActingPlayer();
		if (target == null || (target.isInOlympiadMode() && (!player.isOlympiadStart() || player.getOlympiadGameId() != target.getOlympiadGameId())))
		{
			// if L2PcInstance is in Olympia and the match isn't already start, send a Server->Client packet ActionFailed
			player.sendPacket(ActionFailed.STATIC_PACKET);
			return;
		}
	}

	if (player.getTarget() != null && !player.getTarget().isAttackable() && !player.getAccessLevel().allowPeaceAttack())
	{
		// If target is not attackable, send a Server->Client packet ActionFailed
		player.sendPacket(ActionFailed.STATIC_PACKET);
		return;
	}

	if (player.isConfused())
	{
		// If target is confused, send a Server->Client packet ActionFailed
		player.sendPacket(ActionFailed.STATIC_PACKET);
		return;
	}

	// GeoData Los Check or dz > 1000
	if (!GeoData.getInstance().canSeeTarget(player, this))
	{
		player.sendPacket(SystemMessageId.CANT_SEE_TARGET);
		player.sendPacket(ActionFailed.STATIC_PACKET);
		return;
	}

	// Notify AI with AI_INTENTION_ATTACK
	player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);
}

  • 0
Posted

-beep-, I'm just sleepy as hell.

More than probably the 2 methods I told you to post, don't matter at all.

We need to check the canAttack() from L2Summon, if you have that file in that pack.

:rage: :rage: :rage:

  • 0
Posted

-beep-, I'm just sleepy as hell.

More than probably the 2 methods I told you to post, don't matter at all.

We need to check the canAttack() from L2Summon, if you have that file in that pack.

:rage: :rage: :rage:

haha okay, i dont have this method in l2summon

  • 0
Posted

And do you have this one?

 

/**
 * Performs an attack to the owner's target.
 */
public void doAttack()
{
	if (getOwner() != null)
	{
		final L2Object target = getOwner().getTarget();
		if (target != null)
		{
			setTarget(target);
			getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
		}
	}
}

 

If yes, you could try with (not the best option but could work):

 

/**
 * Performs an attack to the owner's target.
 */
public void doAttack()
{
	if (getOwner() != null)
	{
		final L2Object target = getOwner().getTarget();
		if (target != null)
		{
			if(target instanceof L2Npc /* or u can try with target instanceof L2PcInstance too, if u want NPC attackables */ && isInsidePeaceZone(target)
			{
				return;
			}
			setTarget(target);
			getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
		}
	}
}

 

  • 0
Posted

Stupid me i didnt even had a doattack method...

 

I used this one

	protected void doAttack(L2Character target)
{
	if(getOwner() != null && getOwner() == target && !getOwner().isBetrayed())
	{
		sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
		return;
	}
	if(isInsidePeaceZone(this, target))
	{
		getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
		return;
	}
	if(!target.isAttackable())
	{
		if (!(this instanceof L2SiegeSummonInstance))
		{
		getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
		return;
		}
	}

	super.doAttack(target);
}

 

Thx for helping anyway Wyatt ;)

Guest
This topic is now closed to further replies.


  • Posts

    • SocNet is now on Medium! Check out our new article showcasing the full potential of our store and SMM Panel! Article: Click   🚀 Promo code: MEDIUM5 (5% Discount)   ➡️ Online Store: Click ✅ ➡️ Telegram Bot: Click ✅ ➡️ SMM Panel: Click ✅   Regular customers receive additional discounts and promo codes!   Support: ➡️ Telegram: https://t.me/solomon_bog ✅ ➡️ Discord: https://discord.gg/y9AStFFsrh ✅ ➡️ WhatsApp: https://wa.me/79051904467 ✅ ➡️ Email: solomonbog@socnet.store ✅   ➡️ Telegram Channel: https://t.me/accsforyou_shop ✅   You can also contact us for: — Wholesale inquiries — Partnership opportunities (Current partners: https://socnet.bgng.io/partners )  — Becoming a supplier   SocNet — your store for digital goods and premium subscriptions ✅
    • SocNet is now on Medium! Check out our new article showcasing the full potential of our store and SMM Panel! Article: Click Promo code: MEDIUM5 (5% Discount) Online Store: Click Telegram Bot: Click SMM Panel: Click Regular customers receive additional discounts and promo codes! Support: Telegram: https://t.me/solomon_bog Discord: https://discord.gg/y9AStFFsrh WhatsApp: https://wa.me/79051904467 Email: solomonbog@socnet.store  Telegram Channel: https://t.me/accsforyou_shop You can also contact us for: — Wholesale inquiries — Partnership opportunities (Current partners: https://socnet.bgng.io/partners ) — Becoming a supplier SocNet — your store for digital goods and premium subscriptions  Want to expand your business network or promote services through the largest B2B platform? LinkedIn accounts are your tool for marketing, recruiting, and outreach automation. Perfect for SMM, hiring, lead generation, and business scaling. ➡ Ready-made accounts — fast, convenient, no hassle. Promo code: LINKEDIN5 (5% discount) Payment: Bank cards · Cryptocurrency · Other popular methods How to buy: ➡ Online Store: Click ➡ Telegram Bot: Click Other services: ➡ SMM Panel: Click Product range: ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM USA IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM EUROPE IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM MIX IP | Price from: $2.5 ➡ LinkedIn Old Brute Account with Real Connections (0 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $10 ➡ LinkedIn Premium Brute Account (Premium) with active 1-month Premium subscription | Geo: MIX | Registered on real device | Full account access | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (50 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (100+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $39 ➡ LinkedIn Old Brute Account with Real Connections (500+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $69 ➡ LinkedIn Verified Brute Account with verified documents | Geo: MIX | Registered on real device | Full account access | Price from: $89 Loyal customers — additional discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop Also via these contacts you can: — Consult about wholesale purchases — Set up a partnership (current partners: https://socnet.bgng.io/partners ) — Become our supplier SocNet — Digital Goods and Premium Subscriptions Store
    • SocNet is now on Medium! Check out our new article showcasing the full potential of our store and SMM Panel! Article: Click Promo code: MEDIUM5 (5% Discount) Online Store: Click Telegram Bot: Click SMM Panel: Click Regular customers receive additional discounts and promo codes! Support: Telegram: https://t.me/solomon_bog Discord: https://discord.gg/y9AStFFsrh WhatsApp: https://wa.me/79051904467 Email: solomonbog@socnet.store  Telegram Channel: https://t.me/accsforyou_shop You can also contact us for: — Wholesale inquiries — Partnership opportunities (Current partners: https://socnet.bgng.io/partners ) — Becoming a supplier SocNet — your store for digital goods and premium subscriptions  Want to expand your business network or promote services through the largest B2B platform? LinkedIn accounts are your tool for marketing, recruiting, and outreach automation. Perfect for SMM, hiring, lead generation, and business scaling. ➡ Ready-made accounts — fast, convenient, no hassle. Promo code: LINKEDIN5 (5% discount) Payment: Bank cards · Cryptocurrency · Other popular methods How to buy: ➡ Online Store: Click ➡ Telegram Bot: Click Other services: ➡ SMM Panel: Click Product range: ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM USA IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM EUROPE IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM MIX IP | Price from: $2.5 ➡ LinkedIn Old Brute Account with Real Connections (0 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $10 ➡ LinkedIn Premium Brute Account (Premium) with active 1-month Premium subscription | Geo: MIX | Registered on real device | Full account access | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (50 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (100+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $39 ➡ LinkedIn Old Brute Account with Real Connections (500+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $69 ➡ LinkedIn Verified Brute Account with verified documents | Geo: MIX | Registered on real device | Full account access | Price from: $89 Loyal customers — additional discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop Also via these contacts you can: — Consult about wholesale purchases — Set up a partnership (current partners: https://socnet.bgng.io/partners ) — Become our supplier SocNet — Digital Goods and Premium Subscriptions Store
    • Buying & Selling Torn City Cash
  • 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