Package net.sf.l2j.gameserver.model.actor.instance

Examples of net.sf.l2j.gameserver.model.actor.instance.L2MinionInstance


    {
        // Get the template of the Minion to spawn
        L2NpcTemplate minionTemplate = NpcTable.getInstance().getTemplate(minionid);

        // Create and Init the Minion and generate its Identifier
        L2MinionInstance monster = new L2MinionInstance(IdFactory.getInstance().getNextId(),
                                                        minionTemplate);

        // Set the Minion HP, MP and Heading
        monster.setCurrentHpMp(monster.getMaxHp(), monster.getMaxMp());
        monster.setHeading(master.getHeading());

        // Set the Minion leader to this RaidBoss
        monster.setLeader(master);

        // Init the position of the Minion and add it in the world as a visible object
        int spawnConstant;
        int randSpawnLim = 170;
        int randPlusMin = 1;
        spawnConstant = Rnd.nextInt(randSpawnLim);
        //randomize +/-
        randPlusMin = Rnd.nextInt(2);
        if (randPlusMin == 1) spawnConstant *= -1;
        int newX = master.getX() + Math.round(spawnConstant);
        spawnConstant = Rnd.nextInt(randSpawnLim);
        //randomize +/-
        randPlusMin = Rnd.nextInt(2);
        if (randPlusMin == 1) spawnConstant *= -1;
        int newY = master.getY() + Math.round(spawnConstant);

        monster.spawnMe(newX, newY, master.getZ());

        if (Config.DEBUG)
            _log.fine("Spawned minion template " + minionTemplate.npcId + " with objid: "
                + monster.getObjectId() + " to boss " + master.getObjectId() + " ,at: " + monster.getX()
                + " x, " + monster.getY() + " y, " + monster.getZ() + " z");
    }
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.model.actor.instance.L2MinionInstance

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.