Jump to content

Question

7 answers to this question

Recommended Posts

  • 0
Posted

If you speak about the event, and then it's a script, on "advanced" (maybe on older version, I don't rem) script engine you got addSpawn, which holds a parameter to auto despawn the spawned npc.

  • 0
Posted (edited)

im talking for this item large squash seed

big_seed.jpg

where they spawn this mob Large Young Squash

 

i dont use any script i have add them to droplist but i want to make them have limit becouse when someone spawn 100-200 they make lag.

 

i think is this script for it

/*
 * L2jFrozen Project - www.l2jfrozen.com 
 * 
 * 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/>.
 */

package com.l2jfrozen.gameserver.model.actor.instance;

import com.l2jfrozen.gameserver.model.L2Character;
import com.l2jfrozen.gameserver.taskmanager.DecayTaskManager;
import com.l2jfrozen.gameserver.templates.L2NpcTemplate;

public final class L2GourdInstance extends L2MonsterInstance
{
	// private static Logger LOGGER = Logger.getLogger(L2GourdInstance.class);
	
	private String _name;
	private byte _nectar = 0;
	private byte _good = 0;
	
	public L2GourdInstance(final int objectId, final L2NpcTemplate template)
	{
		super(objectId, template);
		DecayTaskManager.getInstance().addDecayTask(this, 180000);
	}
	
	public void setOwner(final String name)
	{
		_name = name;
	}
	
	public String getOwner()
	{
		return _name;
	}
	
	public void addNectar()
	{
		_nectar++;
	}
	
	public byte getNectar()
	{
		return _nectar;
	}
	
	public void addGood()
	{
		_good++;
	}
	
	public byte getGood()
	{
		return _good;
	}
	
	@Override
	public void reduceCurrentHp(double damage, final L2Character attacker, final boolean awake)
	{
		if (!attacker.getName().equalsIgnoreCase(getOwner()))
		{
			damage = 0;
		}
		if (getTemplate().npcId == 12778 || getTemplate().npcId == 12779)
			if (attacker.getActiveWeaponInstance().getItemId() == 4202 || attacker.getActiveWeaponInstance().getItemId() == 5133 || attacker.getActiveWeaponInstance().getItemId() == 5817 || attacker.getActiveWeaponInstance().getItemId() == 7058)
			{
				super.reduceCurrentHp(damage, attacker, awake);
			}
			else if (damage > 0)
			{
				damage = 0;
			}
		super.reduceCurrentHp(damage, attacker, awake);
	}
}

Edited by haskovo
  • 0
Posted (edited)

Well as I said it's supposed to be an event type. Dunno why on L2JFrozen they're implemented like that. And that instance doesn't control that aspect. Search for the event or the itemhandler/skillhandler which spawns such L2GourdInstance.

Edited by Tryskell
  • 0
Posted

i found only this but i think is not what we looking :C 

/*
 * L2jFrozen Project - www.l2jfrozen.com 
 * 
 * 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 2, 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, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 * http://www.gnu.org/copyleft/gpl.html
 */

package com.l2jfrozen.gameserver.handler.itemhandlers;

import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.datatables.SkillTable;
import com.l2jfrozen.gameserver.datatables.csv.SummonItemsData;
import com.l2jfrozen.gameserver.datatables.sql.NpcTable;
import com.l2jfrozen.gameserver.handler.IItemHandler;
import com.l2jfrozen.gameserver.idfactory.IdFactory;
import com.l2jfrozen.gameserver.model.L2Skill;
import com.l2jfrozen.gameserver.model.L2SummonItem;
import com.l2jfrozen.gameserver.model.L2World;
import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance.SkillDat;
import com.l2jfrozen.gameserver.model.actor.instance.L2PetInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;
import com.l2jfrozen.gameserver.model.entity.event.CTF;
import com.l2jfrozen.gameserver.model.entity.event.DM;
import com.l2jfrozen.gameserver.model.entity.event.TvT;
import com.l2jfrozen.gameserver.model.spawn.L2Spawn;
import com.l2jfrozen.gameserver.network.SystemMessageId;
import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;
import com.l2jfrozen.gameserver.network.serverpackets.MagicSkillLaunched;
import com.l2jfrozen.gameserver.network.serverpackets.PetInfo;
import com.l2jfrozen.gameserver.network.serverpackets.Ride;
import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
import com.l2jfrozen.gameserver.thread.ThreadPoolManager;

public class SummonItems implements IItemHandler
{
	@Override
	public void useItem(final L2PlayableInstance playable, final L2ItemInstance item)
	{
		if (!(playable instanceof L2PcInstance))
			return;
		
		L2PcInstance activeChar = (L2PcInstance) playable;
		
		if (!activeChar.getFloodProtectors().getItemPetSummon().tryPerformAction("summon pet"))
		{
			playable.sendPacket(ActionFailed.STATIC_PACKET);
			return;
		}
		
		// if(activeChar._inEventTvT && TvT._started && !Config.TVT_ALLOW_SUMMON)
		if (activeChar._inEventTvT && TvT.is_started() && !Config.TVT_ALLOW_SUMMON)
		{
			final ActionFailed af = ActionFailed.STATIC_PACKET;
			activeChar.sendPacket(af);
			return;
		}
		
		// if(activeChar._inEventDM && DM._started && !Config.DM_ALLOW_SUMMON)
		if (activeChar._inEventDM && DM.is_started() && !Config.DM_ALLOW_SUMMON)
		{
			final ActionFailed af = ActionFailed.STATIC_PACKET;
			activeChar.sendPacket(af);
			return;
		}
		
		// if(activeChar._inEventCTF && CTF._started && !Config.CTF_ALLOW_SUMMON)
		if (activeChar._inEventCTF && CTF.is_started() && !Config.CTF_ALLOW_SUMMON)
		{
			final ActionFailed af = ActionFailed.STATIC_PACKET;
			activeChar.sendPacket(af);
			return;
		}
		
		if (activeChar.isSitting())
		{
			activeChar.sendPacket(new SystemMessage(SystemMessageId.CANT_MOVE_SITTING));
			return;
		}
		
		if (activeChar.isParalyzed())
		{
			activeChar.sendMessage("You Cannot Use This While You Are Paralyzed");
			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
			return;
		}
		
		if (activeChar.inObserverMode())
			return;
		
		if (activeChar.isInOlympiadMode())
		{
			activeChar.sendPacket(new SystemMessage(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT));
			return;
		}
		
		L2SummonItem sitem = SummonItemsData.getInstance().getSummonItem(item.getItemId());
		
		if ((activeChar.getPet() != null || activeChar.isMounted()) && sitem.isPetSummon())
		{
			activeChar.sendPacket(new SystemMessage(SystemMessageId.YOU_ALREADY_HAVE_A_PET));
			return;
		}
		
		// Like L2OFF you can't summon pet in combat
		if (activeChar.isAttackingNow() || activeChar.isInCombat())
		{
			activeChar.sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_SUMMON_IN_COMBAT));
			return;
		}
		
		if (activeChar.isCursedWeaponEquiped() && sitem.isPetSummon())
		{
			activeChar.sendPacket(new SystemMessage(SystemMessageId.STRIDER_CANT_BE_RIDDEN_WHILE_IN_BATTLE));
			return;
		}
		
		final int npcID = sitem.getNpcId();
		
		if (npcID == 0)
			return;
		
		L2NpcTemplate npcTemplate = NpcTable.getInstance().getTemplate(npcID);
		
		if (npcTemplate == null)
			return;
		
		switch (sitem.getType())
		{
			case 0: // static summons (like christmas tree)
				try
				{
					L2Spawn spawn = new L2Spawn(npcTemplate);
					
					// if(spawn == null)
					// return;
					
					spawn.setId(IdFactory.getInstance().getNextId());
					spawn.setLocx(activeChar.getX());
					spawn.setLocy(activeChar.getY());
					spawn.setLocz(activeChar.getZ());
					L2World.getInstance().storeObject(spawn.spawnOne());
					activeChar.destroyItem("Summon", item.getObjectId(), 1, null, false);
					activeChar.sendMessage("Created " + npcTemplate.name + " at x: " + spawn.getLocx() + " y: " + spawn.getLocy() + " z: " + spawn.getLocz());
					spawn = null;
				}
				catch (final Exception e)
				{
					if (Config.ENABLE_ALL_EXCEPTIONS)
						e.printStackTrace();
					
					activeChar.sendMessage("Target is not ingame.");
				}
				
				break;
			case 1: // pet summons
				activeChar.setTarget(activeChar);
				// Skill 2046 used only for animation
				final L2Skill skill = SkillTable.getInstance().getInfo(2046, 1);
				activeChar.useMagic(skill, true, true);
				activeChar.sendPacket(new SystemMessage(SystemMessageId.SUMMON_A_PET));
				ThreadPoolManager.getInstance().scheduleGeneral(new PetSummonFinalizer(activeChar, npcTemplate, item), 4800);
				
				break;
			case 2: // wyvern
				if (!activeChar.disarmWeapons())
					return;
				
				final Ride mount = new Ride(activeChar.getObjectId(), Ride.ACTION_MOUNT, sitem.getNpcId());
				activeChar.sendPacket(mount);
				activeChar.broadcastPacket(mount);
				activeChar.setMountType(mount.getMountType());
				activeChar.setMountObjectID(item.getObjectId());
		}
		
		activeChar = null;
		sitem = null;
		npcTemplate = null;
	}
	
	static class PetSummonFeedWait implements Runnable
	{
		private final L2PcInstance _activeChar;
		private final L2PetInstance _petSummon;
		
		PetSummonFeedWait(final L2PcInstance activeChar, final L2PetInstance petSummon)
		{
			_activeChar = activeChar;
			_petSummon = petSummon;
		}
		
		@Override
		public void run()
		{
			try
			{
				if (_petSummon.getCurrentFed() <= 0)
				{
					_petSummon.unSummon(_activeChar);
				}
				else
				{
					_petSummon.startFeed(false);
				}
			}
			catch (final Throwable e)
			{
				if (Config.ENABLE_ALL_EXCEPTIONS)
					e.printStackTrace();
			}
		}
	}
	
	static class PetSummonFinalizer implements Runnable
	{
		private final L2PcInstance _activeChar;
		private final L2ItemInstance _item;
		private final L2NpcTemplate _npcTemplate;
		
		PetSummonFinalizer(final L2PcInstance activeChar, final L2NpcTemplate npcTemplate, final L2ItemInstance item)
		{
			_activeChar = activeChar;
			_npcTemplate = npcTemplate;
			_item = item;
		}
		
		@Override
		public void run()
		{
			try
			{
				final SkillDat skilldat = _activeChar.getCurrentSkill();
				
				if (!_activeChar.isCastingNow() || (skilldat != null && skilldat.getSkillId() != 2046))
					return;
				
				_activeChar.sendPacket(new MagicSkillLaunched(_activeChar, 2046, 1));
				
				// check for summon item validity
				if (_item == null || _item.getOwnerId() != _activeChar.getObjectId() || _item.getLocation() != L2ItemInstance.ItemLocation.INVENTORY)
					return;
				
				final L2PetInstance petSummon = L2PetInstance.spawnPet(_npcTemplate, _activeChar, _item);
				
				if (petSummon == null)
					return;
				
				petSummon.setTitle(_activeChar.getName());
				
				if (!petSummon.isRespawned())
				{
					petSummon.setCurrentHp(petSummon.getMaxHp());
					petSummon.setCurrentMp(petSummon.getMaxMp());
					petSummon.getStat().setExp(petSummon.getExpForThisLevel());
					petSummon.setCurrentFed(petSummon.getMaxFed());
				}
				
				petSummon.setRunning();
				
				if (!petSummon.isRespawned())
				{
					petSummon.store();
				}
				
				_activeChar.setPet(petSummon);
				
				L2World.getInstance().storeObject(petSummon);
				petSummon.spawnMe(_activeChar.getX() + 50, _activeChar.getY() + 100, _activeChar.getZ());
				_activeChar.sendPacket(new PetInfo(petSummon));
				petSummon.startFeed(false);
				_item.setEnchantLevel(petSummon.getLevel());
				
				if (petSummon.getCurrentFed() <= 0)
				{
					ThreadPoolManager.getInstance().scheduleGeneral(new PetSummonFeedWait(_activeChar, petSummon), 60000);
				}
				else
				{
					petSummon.startFeed(false);
				}
				
				petSummon.setFollowStatus(true);
				petSummon.setShowSummonAnimation(false);
				petSummon.broadcastStatusUpdate();
			}
			catch (final Throwable e)
			{
				if (Config.ENABLE_ALL_EXCEPTIONS)
					e.printStackTrace();
			}
		}
	}
	
	@Override
	public int[] getItemIds()
	{
		return SummonItemsData.getInstance().itemIDs();
	}
}
  • 0
Posted

1) Create a boolean property that handles the spawn status.

2) Create its getter and setter methods.

3) On spawn first check via the getter if the property isn't set to true... if it is - send an message for fail, if it's not - spawn it and use the setter to set the property to true, so when someone who already have a spawned egg, will get the fail message. When the owner kill the egg, use again the setter to set the property back to false.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Dynamic traffic, static ISP, unlimited traffic and bandwidth packages HTTP, HTTPS, SOCKS5 Over 195 countries/regions Over 100 million real residential IP address pools, with a normal uptime of 99.9%. Special discount code:VIP999
    • Here is the translation, formatted to look professional, clean, and highly scannable for your forum post: Hello L2JBrasil community! I present to you the newest development from MiaCodeWeb. We have created a robust and advanced adaptation of the Phantom system for aCis / L2JAcis 409, focused on Interlude C6 servers. Our main goal was to transform traditional "ornamental bots" into highly realistic, autonomous players. They are capable of creating themselves, restoring themselves, farming, auto-equipping, using skills, responding in chat using Artificial Intelligence, and being managed directly via an in-game panel. GitHub: https://github.com/miacodeweb/L2-Phantom-AI Video Demonstration: [Insert link here]   ## Main Features and Implementation We implemented the core of the Phantom system directly into the aCis gameserver. The architecture was divided into independent modules for AI, combat, chat, equipment, inventory, progression, logs, and administration. In-Game Admin Panel: Fully functional //phantom command. It allows you to create new phantoms, restore saved ones, reload configs, start/stop the AI, view online phantoms, kill bugged phantoms, delete them individually, and navigate through pages. Data Persistence: Created phantoms can be registered in phantoms.properties, allowing them to be restored later while maintaining all their progress directly from the database. Centralized Configuration: Everything is controlled by the phantoms.properties file, organized by sections: AI, Loot, Skills, Equipment, Zones, PVP/PK, Gemini (Chat), Logs, Respawn, and Anti-Stuck system. ## Phantom Skills and Behavior Smart Combat: They patrol, search for mobs, and claim targets to prevent multiple phantoms from attacking the same monster. Mages rest when they run out of MP and avoid hitting with physical weapons unnecessarily. Automatic Progression: Auto-learning of skills, automatic class changes following the logical tree of the chosen profession, receiving buffs, and inventory clearing when reaching a certain weight/space percentage. Dynamic Equipment System: They auto-equip based on class and level, using varying item combinations so they don't all look the same. Optimized Loot: Each phantom focuses on picking up drops/herbs from its own mob, avoiding that ugly scene of 10 phantoms chasing the same adena. PVP/PK Behavior (Configurable): Immediate response to attacks, detection of PK players in the visible area, and an optional "PK Rage Mode". ## AI and Movement Navigation and Anti-Stuck: Patrol system, free wandering, obstacle and stuck detection, with Geodata validation (when enabled on the server). Respawn: Automatic return to town after death, alongside safety rules to prevent them from getting permanently stuck in textures. Leveling Zones: Configurable leveling zones (automatic teleports to farm zones are disabled by default, as in Interlude/aCis they rely heavily on geodata accuracy and the real coordinates of your server). ## AI Chat Integration (Gemini 2.5 Flash) We integrated a Whisper system via the Gemini 2.5 Flash API, making the phantoms respond like real Lineage 2 players. Support for both free and paid API tiers. Configurable parameters: GeminiApiTier, Keys, Cooldowns, and DailyLimits. The system detects connection failures, API limits, and empty responses, and logs everything. The prompt has been adjusted so that the phantom doesn't reply with empty or robotic phrases when asked where to level up or what it's doing. ## Dedicated Log System We created an exclusive log file located at gameserver/log/phantoms.log. It records: loading of phantoms, auto-skills, buffs, Gemini API errors/successes, anti-stuck actions, kills/deletes by admin, and configuration issues. ## Simplified Distribution and Installation Thinking about ease of use for administrators, the mod is delivered in a ready-to-use package: phantom-acis-installer-client.zip. Includes an automatic PowerShell installer that injects the code into your Eclipse project. Contains README.md, INSTALL_MAP.md, and the payload/ folder with ready-made routes for aCis. Clean configuration files (without my API keys). Just run the installer over your copy of aCis, refresh Eclipse, compile, and test. ## Custom Jobs The project already has a solid and functional base for aCis 409. The ideal next steps would be to refine the farm routes by level and social behavior with long-term testing on live servers. I accept custom jobs! If you need this system adapted for another revision, exclusive modules, or any other development for your server, get in touch. Through MiaCodeWeb, I also offer complete services involving geodata optimization, advanced VPS administration (Linux), and Java backend management for L2J. Send a PM or visit the GitHub!   https://www.l2jbrasil.com/applications/core/interface/file/attachment.php?id=17801&key=135fc8d831b84c05089851b18bfca58a   Link dowload:https://github.com/miacodeweb/L2-Phantom-Acis-409
    • TG Support: https://t.me/buyingproxysup | Channel: https://t.me/buyingproxycom Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server!  Create your free account here
    • PERFECT PERSPECTIVE IS ALMOST ALWAYS A DEATH SENTENCE ▪ Think if the document lies perfectly flat and everything is “level” it’ll be fine? Most of the time, that’s exactly what gives away the fake. Real smartphones, especially wide-angle cameras, always add natural distortions: - Slight warping at the edges of the document - Perspective distortions in the corners - Light curvature of the plane due to distance and shooting angle When everything is perfectly flat and geometrically flawless — algorithms and verifiers immediately recognize a “staged scene.” ▪ A genuine shot is never mathematically perfect. It’s these small lens distortions that make the frame look alive and believable.  Want perspective that won’t raise questions even from the most demanding verifiers? Write to us — we’ll create geometry that looks like it was shot with a real phone in real conditions. › TG: @mustang_service_ms ( https:// t.me/ mustang_service_ms ) › Channel: Mustang Service ( https:// t.me/ +JPpJCETg-xM1NjNl ) #documents #drawing #perspective #editing #geometry
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..