Aion 4.6 emu forcing a spawned mob to move to target [SOLVED

Newbie Spellweaver
Joined
Mar 12, 2025
Messages
12
Reaction score
5
Hello, im using AionGer 4.6 java emulator and im making a command which spawns a custom spatalos npc and some tursins and im trying to get the tursins to go to spatalos and attack him.
Ive implemented custom ai for the tursins but nothing seems to be working as i want it to. More specifically the tursin moves towards spatalos but then pops back at his home location even tho i literally made it so that nothing happens on handleNotAtHome(). After some testing i realised that even tho he looks like he is moving his actual location data does not change so im probably doing this wrong. Here is the code that spawns the npc's sets targets and makes the one "move" towards spatalos.
this is executed when doing a command:

Java:
SpawnTemplate st_spatalos = SpawnEngine.addNewSingleTimeSpawn(worldId, 860001, (float)1668, (float)1497, (float)119, (byte)47);
            VisibleObject spatalos = SpawnEngine.spawnObject(st_spatalos, instid);
          
            //pc_id="210158" level="17" name="tursin loudmouth boss"
            //npc_id="210159" level="19" name="tursin loudmouth chief"
          
            SpawnTemplate st_attacker_17_1 = SpawnEngine.addNewSingleTimeSpawn(worldId, 210158, (float)1575, (float)1594, (float)105, (byte)97);
            SpawnTemplate st_attacker_17_2 = SpawnEngine.addNewSingleTimeSpawn(worldId, 210158, (float)1570, (float)1594, (float)105, (byte)97);
            Npc attacker_17_1 = (Npc)SpawnEngine.spawnObject(st_attacker_17_1, instid);
            Npc attacker_17_2 = (Npc)SpawnEngine.spawnObject(st_attacker_17_2, instid);
          
            attacker_17_1.setTarget(spatalos);
            attacker_17_2.setTarget(spatalos);
          
            attacker_17_1.getMoveController().moveToTargetObject();

now my guess is that its not proper to just call moveToTargetObject() like this and im more than likely skipping a step. So does anyone know the proper way to make a mob move through code? Any info is appreciated.

EDIT SOLUTION: after wasting countless hours into this, the solution is to simply ((AbstractAI) attacker_17_1.getAi2()).setStateIfNot(AIState.WALKING); before starting to move. (i dont know how to set the post to solved cause when i try to reply witht he answer it just gets added as an edit)
 
Last edited:
Back