[Resolved]precise spawn for minions

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
Nemesis_hommage
Posts: 53
Joined: Fri Nov 06, 2009 9:42 am

[Resolved]precise spawn for minions

Post by Nemesis_hommage »

L2J Revision 4420:
L2JDP Revision 7668: customized

Hi
I've created a custom quest, with custom mobs
they are linked by the minion table

I woud like that the minion spawn on a precise location
but if i indicate the location on the spawnlist, i've 2 minions: one on the location and one who spawn where he want

some help please,thx
Last edited by Nemesis_hommage on Fri Apr 22, 2011 6:26 pm, edited 1 time in total.
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: precise spawn for minions

Post by _DS_ »

Minions spawn around master and does not have own spawns. You can teleport them later.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
Nemesis_hommage
Posts: 53
Joined: Fri Nov 06, 2009 9:42 am

Re: precise spawn for minions

Post by Nemesis_hommage »

how can i do that ?
if i select a minion and go on the right place, the function NPCrecall doesn't work
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: precise spawn for minions

Post by _DS_ »

Ofc it will not work. Teleport them from your quest script, and disable random walk for master, or minions will return to him.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
Nemesis_hommage
Posts: 53
Joined: Fri Nov 06, 2009 9:42 am

Re: precise spawn for minions

Post by Nemesis_hommage »

So i resolved the problem with the precise location for the minions .
My problem now is the fact that minions appears only if somebody attacks the referent.
I'm looking to spawn the minions in the same time as the referent.

if i change "onAttack" in "onSpawn", it doesn't work anymore.
I'm not a great java writer, i only search for the players have fun in our server.
if you can help me, it would be great, thx.

Code: Select all

 /* * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. *  * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. *  * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. * * code java des minions Sel mahums custom elegia */package ai.individual;  import com.l2jserver.gameserver.ai.CtrlIntention;import com.l2jserver.gameserver.model.actor.L2Attackable;import com.l2jserver.gameserver.model.actor.L2Character;import com.l2jserver.gameserver.model.actor.L2Npc;import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import javolution.util.FastList;import javolution.util.FastSet;import ai.group_template.L2AttackableAIScript; public class sel65210minion extends L2AttackableAIScript{    private static final int REFERENT = 65210;    private static final int MINION1 = 65202;    private static final int MINION2 = 65203;    private static final int MINION3 = 65204;    private static final int MINION4 = 65205;    private static final int MINION5 = 65206;    private static final int MINION6 = 65207;    private static final int MINION7 = 65208;    private static final int MINION8 = 65209;    private static final int MINION9 = 65201;    private static int _HasSpawned1;     private static FastSet<Integer> secondSpawn = new FastSet<Integer>();     private static FastSet<Integer> myTrackingSet = new FastSet<Integer>();         public sel65210minion(int id, String name, String descr)    {        super(id,name,descr);        int[] mobs = {REFERENT, MINION1, MINION2, MINION3, MINION4, MINION5, MINION6, MINION7, MINION8, MINION9};        this.registerMobs(mobs);        _HasSpawned1 = 0;        myTrackingSet.clear();        secondSpawn.clear();    }       public String onAttack (L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)    {            int npcId = npc.getNpcId();        int npcObjId = npc.getObjectId();    _HasSpawned1==npcObjId;        if (npcId == MINION)        {            if (!myTrackingSet.contains(npcObjId)) //traqueur de party                {                    myTrackingSet.add(npcObjId);                    _HasSpawned1 = npcObjId;                }                if ((_HasSpawned1==npcObjId))                {                    //Spawn des minions                    int x = npc.getX();                    int y = npc.getY();                    FastList<L2Attackable> _minion = new FastList<L2Attackable>();                    _minion.add((L2Attackable) addSpawn(MINION1,89583,67567,-3710,0,false,40000);                    _minion.add((L2Attackable) addSpawn(MINION2,89583,67717,-3710,0,false,40000);                    _minion.add((L2Attackable) addSpawn(MINION3,89733,67417,-3710,0,false,40000);                    _minion.add((L2Attackable) addSpawn(MINION6,89883,67417,-3710,0,false,40000);                    _minion.add((L2Attackable) addSpawn(MINION7,89883,67567,-3710,0,false,40000);                    _minion.add((L2Attackable) addSpawn(MINION4,89733,67567,-3710,0,false,40000);                    _minion.add((L2Attackable) addSpawn(MINION5,89733,67717,-3710,0,false,40000);                    _minion.add((L2Attackable) addSpawn(MINION8,89883,67717,-3710,0,false,40000);                    _minion.add((L2Attackable) addSpawn(MINION9,90058,67342,-3710,0,false,40000);                      _HasSpawned1 = 0;                    L2Character originalAttacker = isPet? attacker.getPet(): attacker;                    for (int i=0;i<_minion.size();i++)                     {                        L2Attackable minion = _minion.get(i);                        minion.setRunning();                        minion.addDamageHate(originalAttacker,0,999);                        minion.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, originalAttacker);                    }                    _minion.clear();                }            }        return super.onAttack(npc, attacker, damage, isPet);    }     public static void main(String[] args)    {        // Quest class and state definition        new sel65210minion(-1,"sel65210minion","ai");    }} 
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: precise spawn for minions

Post by _DS_ »

This script has nothing with normal minion's handling.
Add minions to the table.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
Nemesis_hommage
Posts: 53
Joined: Fri Nov 06, 2009 9:42 am

Re: precise spawn for minions

Post by Nemesis_hommage »

i know that
if i use this script i haven't to use the minion table
but in this case, what have i to add or modifiy in this script to spawn the "minions" the same time as the referent?
Post Reply