AI (without quest?)
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
-
- Posts: 72
- Joined: Wed Jul 06, 2005 4:27 pm
- Location: Netherlands
AI (without quest?)
L2J Revision Latest:
L2JDP Revision Latest:
Currently the AI inside data/scripts/ai/individual is only for quests if I'm correct.
This is probably the reason why FleeNpc.java doesn't work at the moment.
Is there some way to create AI for not-quest-mobs?
L2JDP Revision Latest:
Currently the AI inside data/scripts/ai/individual is only for quests if I'm correct.
This is probably the reason why FleeNpc.java doesn't work at the moment.
Is there some way to create AI for not-quest-mobs?
"If 64 bits isn't enough, the next logical step is 128 bits. That's enough to survive Moore's Law until I'm dead, and after that, it's not my problem."
©Jeff Bonwick
©Jeff Bonwick
- denser
- Posts: 1392
- Joined: Wed May 30, 2007 9:13 pm
- Location: Russia
- Contact:
Re: AI (without quest?)
flee works as i know...when you hit elpy he runs away..
Tiger, once tasted human flesh, will want to taste it again
L2J - the place where glad to see you any time!
L2J - the place where glad to see you any time!
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: AI (without quest?)
AI has no connection to quests. Check your scripts.cfg
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
- JIV
- L2j Veteran
- Posts: 1882
- Joined: Sun Jan 06, 2008 8:17 pm
- Location: Slovakia
- Contact:
Re: AI (without quest?)
what you mean? AI is quest based.
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: AI (without quest?)
Not in that meaning, AI is not controlled by quests, only based on them.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
-
- Posts: 72
- Joined: Wed Jul 06, 2005 4:27 pm
- Location: Netherlands
Re: AI (without quest?)
Mkay. Well I tried it on several servers and the elpies attack me instead of fleeing away.
Or do I is there some config that has to be changed?
Or do I is there some config that has to be changed?
"If 64 bits isn't enough, the next logical step is 128 bits. That's enough to survive Moore's Law until I'm dead, and after that, it's not my problem."
©Jeff Bonwick
©Jeff Bonwick
- Raikkon35
- Posts: 178
- Joined: Sat Mar 08, 2008 2:54 pm
Re: AI (without quest?)
I was going to open a new thread, but I take this.
A few days ago, I went around some places of L2. Ol Mahum should speak... but they say nothing.
Elpys don't run out of you...
In ai folder, there is no scripts for these mobs, I remember seeing them somewhere...
A few days ago, I went around some places of L2. Ol Mahum should speak... but they say nothing.
Elpys don't run out of you...
In ai folder, there is no scripts for these mobs, I remember seeing them somewhere...
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: AI (without quest?)
Ol Mahum ai is not implemented, same as many others.
Dunno about the Elpy stuff though, check if the IDs in ai/individual/FleeNpc.java are correct.
Dunno about the Elpy stuff though, check if the IDs in ai/individual/FleeNpc.java are correct.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
- Raikkon35
- Posts: 178
- Joined: Sat Mar 08, 2008 2:54 pm
Re: AI (without quest?)
Apparently Elpy okay, it appears in AI script (20432 ID).
It must be that I saw the Ol Mahum in L2jfree...
Greetings!
It must be that I saw the Ol Mahum in L2jfree...
Greetings!
-
- Posts: 72
- Joined: Wed Jul 06, 2005 4:27 pm
- Location: Netherlands
Re: AI (without quest?)
The id's are definitely correct.
I'm spawning the IDs found in FleeNpc.java
They seem to fly when you first attack but after a second they start attacking me.
I'm spawning the IDs found in FleeNpc.java
They seem to fly when you first attack but after a second they start attacking me.
"If 64 bits isn't enough, the next logical step is 128 bits. That's enough to survive Moore's Law until I'm dead, and after that, it's not my problem."
©Jeff Bonwick
©Jeff Bonwick
- Raikkon35
- Posts: 178
- Joined: Sat Mar 08, 2008 2:54 pm
Re: AI (without quest?)
Bump.
Elpy still not go away.
Elpy still not go away.
- Stake
- Posts: 383
- Joined: Sun Mar 23, 2008 9:33 pm
- Location: Hungary
- Contact:
Re: AI (without quest?)
This is what's wrong in FleeNpc.javaRaikkon35 wrote:Bump.
Elpy still not go away.
Code: Select all
if (npc.getNpcId() >= 18150 && npc.getNpcId() <= 18157) { npc.getAI().setIntention( CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition((npc.getX() + Rnd.get(-40, 40)), (npc.getY()+ Rnd.get(-40, 40)), npc.getZ(), npc.getHeading())); // npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null, null); return null; } else if (npc.getNpcId() == 20432 || npc.getNpcId() == 22228) { if (Rnd.get(3) == 2) npc.getAI().setIntention( CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition((npc.getX() + Rnd.get(-200, 200)), (npc.getY()+ Rnd.get(-200, 200)), npc.getZ(), npc.getHeading())); // npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null, null); return null; }

P.S.: Gz to the AI maker!



- LasTravel
- Posts: 888
- Joined: Tue Jan 05, 2010 12:08 am
- Location: Spain
Re: AI (without quest?)
Not work for me, elpy don't run!
- Gnacik
- L2j Veteran
- Posts: 925
- Joined: Tue Dec 16, 2008 3:49 pm
- Location: Wąchock ٩(̾●̮̮̃̾•̃̾)۶ Polska
- Contact:
Re: AI (without quest?)
Problem is different. Intention is changed from _MOVE to _ATTACK 

- Stake
- Posts: 383
- Joined: Sun Mar 23, 2008 9:33 pm
- Location: Hungary
- Contact:
Re: AI (without quest?)
Then there shouldn't be this:Gnacik wrote:Problem is different. Intention is changed from _MOVE to _ATTACK
Code: Select all
return super.onAttack(npc, attacker, damage, isPet);
Code: Select all
return null;

If it didn't work, the elpy should be put in the fear state.

Tested, and it worked perfectly for me.
L2Character.java:
Code: Select all
Index: java/com/l2jserver/gameserver/model/actor/L2Character.java===================================================================--- java/com/l2jserver/gameserver/model/actor/L2Character.java (revision 4407)+++ java/com/l2jserver/gameserver/model/actor/L2Character.java (working copy)@@ -5244,9 +5244,6 @@ } - // Notify AI with EVT_ATTACKED- if (target.hasAI())- target.getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, this); getAI().clientStartAutoAttack(); if (this instanceof L2Summon) {
Code: Select all
Index: data/scripts/ai/individual/FleeNpc.java===================================================================--- data/scripts/ai/individual/FleeNpc.java (revision 7664)+++ data/scripts/ai/individual/FleeNpc.java (working copy)@@ -16,6 +16,7 @@ import com.l2jserver.gameserver.ai.CtrlIntention; import com.l2jserver.gameserver.model.L2CharPosition;+import com.l2jserver.gameserver.model.actor.L2Attackable; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.quest.Quest;@@ -40,20 +41,27 @@ @Override public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet) {- if (npc.getNpcId() >= 18150 && npc.getNpcId() <= 18157)+ if(npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_MOVE_TO) {- npc.getAI().setIntention( CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition((npc.getX() + Rnd.get(-40, 40)), (npc.getY()+ Rnd.get(-40, 40)), npc.getZ(), npc.getHeading()));- npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null, null);- return null;+ if(npc.getNpcId() == 20432 || npc.getNpcId() == 22228)+ {+ if(Rnd.get(3) == 2)+ {+ ((L2Attackable)npc).reduceHate(null, ((L2Attackable)npc).getHating(((L2Attackable)npc).getMostHated()));+ npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition((npc.getX() + Rnd.get(-200, 200)), (npc.getY()+ Rnd.get(-200, 200)), npc.getZ(), npc.getHeading()));+ return null;+ }+ }+ else if(npc.getNpcId() >= 18150 && npc.getNpcId() <= 18157)+ {+ ((L2Attackable)npc).reduceHate(null, ((L2Attackable)npc).getHating(((L2Attackable)npc).getMostHated()));+ npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition((npc.getX() + Rnd.get(-40, 40)), (npc.getY()+ Rnd.get(-40, 40)), npc.getZ(), npc.getHeading()));+ return null;+ }+ return super.onAttack(npc, attacker, damage, isPet); }- else if (npc.getNpcId() == 20432 || npc.getNpcId() == 22228)- {- if (Rnd.get(3) == 2)- npc.getAI().setIntention( CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition((npc.getX() + Rnd.get(-200, 200)), (npc.getY()+ Rnd.get(-200, 200)), npc.getZ(), npc.getHeading()));- npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null, null);+ else return null;- }- return super.onAttack(npc, attacker, damage, isPet); } // Register the new Script at the Script System
Last edited by Stake on Sat Aug 07, 2010 2:14 pm, edited 4 times in total.

