Page 1 of 1
Forcing mob to attack another
Posted: Tue Nov 03, 2009 12:32 am
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?
p.s L2j Rev: Interlude
Re: Forcing mob to attack another
Posted: Tue Nov 03, 2009 10:34 am
by JIV
try
Code: Select all
mob.addDamageHate(npc,0,99999);mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK,npc,null);
Re: Forcing mob to attack another
Posted: Tue Nov 03, 2009 3:00 pm
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.

Re: Forcing mob to attack another
Posted: Wed Nov 04, 2009 12:34 am
by _DS_
Currently mobs unable to attack other mobs. You can try npc.