Forcing mob to attack another

This is not a Support area! Discuss about the Server here. Non-Server related discussion goes in Off-Topic Discussion.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
TehDavid
Posts: 2
Joined: Tue Nov 03, 2009 12:19 am
Location: Russia

Forcing mob to attack another

Post by TehDavid »

I am trying to make one thing for Event (not mobgroup):
A heap of mobs (L2Monster) should attack another npc (L2Npc).
I've tried through getAI().setIntention(...,EnemyNPC);

But this not worked, mobs are just walking around (nothing happened).

Any ideas, examples, hints ...please? :roll:

p.s L2j Rev: Interlude
User avatar
JIV
L2j Veteran
L2j Veteran
Posts: 1882
Joined: Sun Jan 06, 2008 8:17 pm
Location: Slovakia
Contact:

Re: Forcing mob to attack another

Post by JIV »

try

Code: Select all

mob.addDamageHate(npc,0,99999);mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK,npc,null);
TehDavid
Posts: 2
Joined: Tue Nov 03, 2009 12:19 am
Location: Russia

Re: Forcing mob to attack another

Post by TehDavid »

Ehh...no. Still nothing.
I've also noticed in debug, that Intention magically changes to "AI_INTENTION_ACTIVE".
And L2AttackableAI->onEvtThink executes thinkActive(), instead of desired thinkAttack().

Code: Select all

             // Manage AI thinks of a L2Attackable            if (getIntention() == AI_INTENTION_ACTIVE) thinkActive(); // << - Only this            else if (getIntention() == AI_INTENTION_ATTACK) thinkAttack(); 
Also, i think "addDamageHate" will not work with mobs.
Because:

Code: Select all

 public void addDamageHate(L2Character attacker, int damage, int aggro)    {        if (!(attacker instanceof L2MonsterInstance)) 
Eh, More ideas? :?

UPD:

I made an experiment.

Code: Select all

 mob.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(_enemy.getX(), _enemy.getY(), _enemy.getZ(), 0));
Mobs are moving to this point with pleasure, BUT when they reach this point - they will begin moving back immediately...to the spawn point.
I tried to use stopAITask() - same...zero results.
And AI_INTENTION_ATTACK is just ignored.

Now i am really stuck. :|
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: Forcing mob to attack another

Post by _DS_ »

Currently mobs unable to attack other mobs. You can try npc.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
Post Reply