Jump to content

Question

Recommended Posts

  • 0
Posted
1 hour ago, xTakegawa said:

hello guys i try to found something about zaken script but that pack l2jacis dont have zaken.java anyone here know how to put zaken script or code?

 

Zaken.java

Spoiler

package net.sf.l2j.gameserver.scripting.scripts.ai.individual;

import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

import net.sf.l2j.commons.random.Rnd;
import net.sf.l2j.commons.util.StatsSet;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.data.SkillTable.FrequentSkill;
import net.sf.l2j.gameserver.data.manager.GrandBossManager;
import net.sf.l2j.gameserver.data.manager.ZoneManager;
import net.sf.l2j.gameserver.data.xml.DoorData;
import net.sf.l2j.gameserver.enums.IntentionType;
import net.sf.l2j.gameserver.model.L2Skill;
import net.sf.l2j.gameserver.model.WorldObject;
import net.sf.l2j.gameserver.model.actor.Attackable;
import net.sf.l2j.gameserver.model.actor.Creature;
import net.sf.l2j.gameserver.model.actor.Npc;
import net.sf.l2j.gameserver.model.actor.Playable;
import net.sf.l2j.gameserver.model.actor.Player;
import net.sf.l2j.gameserver.model.actor.instance.Door;
import net.sf.l2j.gameserver.model.actor.instance.GrandBoss;
import net.sf.l2j.gameserver.model.location.Location;
import net.sf.l2j.gameserver.model.zone.type.BossZone;
import net.sf.l2j.gameserver.network.serverpackets.PlaySound;
import net.sf.l2j.gameserver.scripting.scripts.ai.L2AttackableAIScript;
import net.sf.l2j.gameserver.taskmanager.GameTimeTaskManager;

public class Zaken extends L2AttackableAIScript
{
	private static final BossZone ZONE = ZoneManager.getInstance().getZoneById(110000, BossZone.class);
	private static final Set<Player> VICTIMS = ConcurrentHashMap.newKeySet();
	
	private static final Location[] LOCS =
	{
		new Location(53950, 219860, -3488),
		new Location(55980, 219820, -3488),
		new Location(54950, 218790, -3488),
		new Location(55970, 217770, -3488),
		new Location(53930, 217760, -3488),
		
		new Location(55970, 217770, -3216),
		new Location(55980, 219920, -3216),
		new Location(54960, 218790, -3216),
		new Location(53950, 219860, -3216),
		new Location(53930, 217760, -3216),
		
		new Location(55970, 217770, -2944),
		new Location(55980, 219920, -2944),
		new Location(54960, 218790, -2944),
		new Location(53950, 219860, -2944),
		new Location(53930, 217760, -2944)
	};
	
	private static final int ZAKEN = 29022;
	private static final int DOLL_BLADER = 29023;
	private static final int VALE_MASTER = 29024;
	private static final int PIRATE_CAPTAIN = 29026;
	private static final int PIRATE_ZOMBIE = 29027;
	
	private static final byte ALIVE = 0;
	private static final byte DEAD = 1;
	
	private final Location _zakenLocation = new Location(0, 0, 0);
	
	private int _teleportCheck;
	private int _minionStatus;
	private int _hate;
	
	private boolean _hasTeleported;
	
	private Creature _mostHated;
	
	public Zaken()
	{
		super("ai/individual");
		
		final StatsSet info = GrandBossManager.getInstance().getStatsSet(ZAKEN);
		
		// Zaken is dead, calculate the respawn time. If passed, we spawn it directly, otherwise we set a task to spawn it lately.
		if (GrandBossManager.getInstance().getBossStatus(ZAKEN) == DEAD)
		{
			final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
			if (temp > 0)
				startQuestTimer("zaken_unlock", temp, null, null, false);
			else
				spawnBoss(true);
		}
		// Zaken is alive, spawn it using stored data.
		else
			spawnBoss(false);
	}
	
	@Override
	protected void registerNpcs()
	{
		addAggroRangeEnterId(ZAKEN, DOLL_BLADER, VALE_MASTER, PIRATE_CAPTAIN, PIRATE_ZOMBIE);
		addAttackId(ZAKEN);
		addFactionCallId(DOLL_BLADER, VALE_MASTER, PIRATE_CAPTAIN, PIRATE_ZOMBIE);
		addKillId(ZAKEN, DOLL_BLADER, VALE_MASTER, PIRATE_CAPTAIN, PIRATE_ZOMBIE);
		addSkillSeeId(ZAKEN);
		addSpellFinishedId(ZAKEN);
		
		addGameTimeNotify();
	}
	
	@Override
	public String onAdvEvent(String event, Npc npc, Player player)
	{
		if (GrandBossManager.getInstance().getBossStatus(ZAKEN) == DEAD && !event.equalsIgnoreCase("zaken_unlock"))
			return super.onAdvEvent(event, npc, player);
		
		if (event.equalsIgnoreCase("1001"))
		{
			if (GameTimeTaskManager.getInstance().isNight())
			{
				L2Skill skill = FrequentSkill.ZAKEN_DAY_TO_NIGHT.getSkill();
				if (npc.getFirstEffect(skill) == null)
				{
					// Add effect "Day to Night" if not found.
					skill.getEffects(npc, npc);
					
					// Refresh stored Zaken location.
					_zakenLocation.set(npc.getPosition());
				}
				
				// Add Night regen if not found.
				skill = FrequentSkill.ZAKEN_REGEN_NIGHT.getSkill();
				if (npc.getFirstEffect(skill) == null)
					skill.getEffects(npc, npc);
				
				final Creature mostHated = ((Attackable) npc).getMostHated();
				
				// Under attack stance, but didn't yet teleported. Check most hated and current victims distance.
				if (npc.getAI().getDesire().getIntention() == IntentionType.ATTACK && !_hasTeleported)
				{
					boolean willTeleport = true;
					
					// Check most hated distance. If distance is low, Zaken doesn't teleport.
					if (mostHated != null && mostHated.isInsideRadius(_zakenLocation, 1500, true, false))
						willTeleport = false;
					
					// We're still under willTeleport possibility. Now we check each victim distance. If at least one is near Zaken, we cancel the teleport possibility.
					if (willTeleport)
					{
						for (Player ply : VICTIMS)
						{
							if (ply.isInsideRadius(_zakenLocation, 1500, true, false))
							{
								willTeleport = false;
								continue;
							}
						}
					}
					
					// All targets are far, clear victims list and Zaken teleport.
					if (willTeleport)
					{
						VICTIMS.clear();
						npc.doCast(FrequentSkill.ZAKEN_SELF_TELE.getSkill());
					}
				}
				
				// Potentially refresh the stored location.
				if (Rnd.get(20) < 1 && !_hasTeleported)
					_zakenLocation.set(npc.getPosition());
				
				// Process to cleanup hate from most hated upon 5 straight AI loops.
				if (npc.getAI().getDesire().getIntention() == IntentionType.ATTACK && mostHated != null)
				{
					if (_hate == 0)
					{
						_mostHated = mostHated;
						_hate = 1;
					}
					else
					{
						if (_mostHated == mostHated)
							_hate++;
						else
						{
							_hate = 1;
							_mostHated = mostHated;
						}
					}
				}
				
				// Cleanup build hate towards Intention IDLE.
				if (npc.getAI().getDesire().getIntention() == IntentionType.IDLE)
					_hate = 0;
				
				// We built enough hate ; release the current most hated target, reset the hate counter.
				if (_hate > 5)
				{
					((Attackable) npc).stopHating(_mostHated);
					
					_hate = 0;
				}
			}
			else
			{
				L2Skill skill = FrequentSkill.ZAKEN_NIGHT_TO_DAY.getSkill();
				if (npc.getFirstEffect(skill) == null)
				{
					// Add effect "Night to Day" if not found.
					skill.getEffects(npc, npc);
					
					_teleportCheck = 3;
				}
				
				// Add Day regen if not found.
				skill = FrequentSkill.ZAKEN_REGEN_DAY.getSkill();
				if (npc.getFirstEffect(skill) == null)
					skill.getEffects(npc, npc);
			}
			
			if (Rnd.get(40) < 1)
				npc.doCast(FrequentSkill.ZAKEN_SELF_TELE.getSkill());
			
			startQuestTimer("1001", 30000, npc, null, false);
		}
		else if (event.equalsIgnoreCase("1002"))
		{
			// Clear victims list.
			VICTIMS.clear();
			
			// Teleport Zaken.
			npc.doCast(FrequentSkill.ZAKEN_SELF_TELE.getSkill());
			
			// Flag the teleport as false.
			_hasTeleported = false;
		}
		else if (event.equalsIgnoreCase("1003"))
		{
			if (_minionStatus == 1)
			{
				spawnMinionOnEveryLocation(PIRATE_CAPTAIN, 1);
				
				// Pass to the next spawn cycle.
				_minionStatus = 2;
			}
			else if (_minionStatus == 2)
			{
				spawnMinionOnEveryLocation(DOLL_BLADER, 1);
				
				// Pass to the next spawn cycle.
				_minionStatus = 3;
			}
			else if (_minionStatus == 3)
			{
				spawnMinionOnEveryLocation(VALE_MASTER, 2);
				
				// Pass to the next spawn cycle.
				_minionStatus = 4;
			}
			else if (_minionStatus == 4)
			{
				spawnMinionOnEveryLocation(PIRATE_ZOMBIE, 5);
				
				// Pass to the next spawn cycle.
				_minionStatus = 5;
			}
			else if (_minionStatus == 5)
			{
				addSpawn(DOLL_BLADER, 52675, 219371, -3290, Rnd.get(65536), false, 0, true);
				addSpawn(DOLL_BLADER, 52687, 219596, -3368, Rnd.get(65536), false, 0, true);
				addSpawn(DOLL_BLADER, 52672, 219740, -3418, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 52857, 219992, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 52959, 219997, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(VALE_MASTER, 53381, 220151, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 54236, 220948, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 54885, 220144, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 55264, 219860, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 55399, 220263, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 55679, 220129, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(VALE_MASTER, 56276, 220783, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(VALE_MASTER, 57173, 220234, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 56267, 218826, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(DOLL_BLADER, 56294, 219482, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 56094, 219113, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(DOLL_BLADER, 56364, 218967, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 57113, 218079, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(DOLL_BLADER, 56186, 217153, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 55440, 218081, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 55202, 217940, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 55225, 218236, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 54973, 218075, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 53412, 218077, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(VALE_MASTER, 54226, 218797, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(VALE_MASTER, 54394, 219067, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 54139, 219253, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(DOLL_BLADER, 54262, 219480, -3488, Rnd.get(65536), false, 0, true);
				
				// Pass to the next spawn cycle.
				_minionStatus = 6;
			}
			else if (_minionStatus == 6)
			{
				addSpawn(PIRATE_ZOMBIE, 53412, 218077, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(VALE_MASTER, 54413, 217132, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(DOLL_BLADER, 54841, 217132, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(DOLL_BLADER, 55372, 217128, -3343, Rnd.get(65536), false, 0, true);
				addSpawn(DOLL_BLADER, 55893, 217122, -3488, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 56282, 217237, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(VALE_MASTER, 56963, 218080, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 56267, 218826, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(DOLL_BLADER, 56294, 219482, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 56094, 219113, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(DOLL_BLADER, 56364, 218967, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(VALE_MASTER, 56276, 220783, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(VALE_MASTER, 57173, 220234, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 54885, 220144, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 55264, 219860, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 55399, 220263, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 55679, 220129, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 54236, 220948, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 54464, 219095, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(VALE_MASTER, 54226, 218797, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(VALE_MASTER, 54394, 219067, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 54139, 219253, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(DOLL_BLADER, 54262, 219480, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 53412, 218077, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 55440, 218081, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 55202, 217940, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 55225, 218236, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 54973, 218075, -3216, Rnd.get(65536), false, 0, true);
				
				// Pass to the next spawn cycle.
				_minionStatus = 7;
			}
			else if (_minionStatus == 7)
			{
				addSpawn(PIRATE_ZOMBIE, 54228, 217504, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(VALE_MASTER, 54181, 217168, -3216, Rnd.get(65536), false, 0, true);
				addSpawn(DOLL_BLADER, 54714, 217123, -3168, Rnd.get(65536), false, 0, true);
				addSpawn(DOLL_BLADER, 55298, 217127, -3073, Rnd.get(65536), false, 0, true);
				addSpawn(DOLL_BLADER, 55787, 217130, -2993, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 56284, 217216, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(VALE_MASTER, 56963, 218080, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 56267, 218826, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(DOLL_BLADER, 56294, 219482, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 56094, 219113, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(DOLL_BLADER, 56364, 218967, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(VALE_MASTER, 56276, 220783, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(VALE_MASTER, 57173, 220234, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 54885, 220144, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 55264, 219860, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 55399, 220263, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 55679, 220129, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 54236, 220948, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 54464, 219095, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(VALE_MASTER, 54226, 218797, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(VALE_MASTER, 54394, 219067, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 54139, 219253, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(DOLL_BLADER, 54262, 219480, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 53412, 218077, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 54280, 217200, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 55440, 218081, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_CAPTAIN, 55202, 217940, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 55225, 218236, -2944, Rnd.get(65536), false, 0, true);
				addSpawn(PIRATE_ZOMBIE, 54973, 218075, -2944, Rnd.get(65536), false, 0, true);
				
				cancelQuestTimer("1003", null, null);
			}
		}
		else if (event.equalsIgnoreCase("zaken_unlock"))
		{
			// Spawn the boss.
			spawnBoss(true);
		}
		else if (event.equalsIgnoreCase("CreateOnePrivateEx"))
			addSpawn(npc.getNpcId(), npc.getX(), npc.getY(), npc.getZ(), Rnd.get(65535), false, 0, true);
		
		return super.onAdvEvent(event, npc, player);
	}
	
	@Override
	public String onAggro(Npc npc, Player player, boolean isPet)
	{
		final Playable realBypasser = (isPet && player.getSummon() != null) ? player.getSummon() : player;
		
		if (ZONE.isInsideZone(npc))
			((Attackable) npc).addDamageHate(realBypasser, 1, 200);
		
		if (npc.getNpcId() == ZAKEN)
		{
			// Feed victims list, but only if not already full.
			if (Rnd.get(3) < 1 && VICTIMS.size() < 5)
				VICTIMS.add(player);
			
			// Cast a skill.
			if (Rnd.get(15) < 1)
				callSkills(npc, realBypasser);
		}
		else if (testCursesOnAggro(npc, realBypasser))
			return null;
		
		return super.onAggro(npc, player, isPet);
	}
	
	@Override
	public String onAttack(Npc npc, Creature attacker, int damage, L2Skill skill)
	{
		// Curses
		if (attacker instanceof Playable && testCursesOnAttack(npc, attacker))
			return null;
		
		if (Rnd.get(10) < 1)
			callSkills(npc, attacker);
		
		if (!GameTimeTaskManager.getInstance().isNight() && (npc.getCurrentHp() < (npc.getMaxHp() * _teleportCheck) / 4))
		{
			_teleportCheck -= 1;
			npc.doCast(FrequentSkill.ZAKEN_SELF_TELE.getSkill());
		}
		return super.onAttack(npc, attacker, damage, skill);
	}
	
	@Override
	public String onFactionCall(Npc npc, Npc caller, Player attacker, boolean isPet)
	{
		if (caller.getNpcId() == ZAKEN && GameTimeTaskManager.getInstance().isNight())
		{
			if (npc.getAI().getDesire().getIntention() == IntentionType.IDLE && !_hasTeleported && caller.getCurrentHp() < (0.9 * caller.getMaxHp()) && Rnd.get(450) < 1)
			{
				// Set the teleport flag as true.
				_hasTeleported = true;
				
				// Edit Zaken stored location.
				_zakenLocation.set(npc.getPosition());
				
				// Run the 1002 timer.
				startQuestTimer("1002", 300, caller, null, false);
			}
		}
		return super.onFactionCall(npc, caller, attacker, isPet);
	}
	
	@Override
	public String onKill(Npc npc, Creature killer)
	{
		if (npc.getNpcId() == ZAKEN)
		{
			// Broadcast death sound.
			npc.broadcastPacket(new PlaySound(1, "BS02_D", npc));
			
			// Flag Zaken as dead.
			GrandBossManager.getInstance().setBossStatus(ZAKEN, DEAD);
			
			// Calculate the next respawn time.
			final long respawnTime = (long) (Config.SPAWN_INTERVAL_ZAKEN + Rnd.get(-Config.RANDOM_SPAWN_TIME_ZAKEN, Config.RANDOM_SPAWN_TIME_ZAKEN)) * 3600000;
			
			// Cancel tasks.
			cancelQuestTimer("1001", npc, null);
			cancelQuestTimer("1003", null, null);
			
			// Start respawn timer.
			startQuestTimer("zaken_unlock", respawnTime, null, null, false);
			
			// Save the respawn time so that the info is maintained past reboots
			final StatsSet info = GrandBossManager.getInstance().getStatsSet(ZAKEN);
			info.set("respawn_time", System.currentTimeMillis() + respawnTime);
			GrandBossManager.getInstance().setStatsSet(ZAKEN, info);
		}
		else if (GrandBossManager.getInstance().getBossStatus(ZAKEN) == ALIVE)
			startQuestTimer("CreateOnePrivateEx", ((30 + Rnd.get(60)) * 1000), npc, null, false);
		
		return super.onKill(npc, killer);
	}
	
	@Override
	public String onSkillSee(Npc npc, Player caster, L2Skill skill, WorldObject[] targets, boolean isPet)
	{
		if (Rnd.get(12) < 1)
			callSkills(npc, caster);
		
		return super.onSkillSee(npc, caster, skill, targets, isPet);
	}
	
	@Override
	public String onSpellFinished(Npc npc, Player player, L2Skill skill)
	{
		switch (skill.getId())
		{
			case 4222: // Instant Move; a self teleport skill Zaken uses to move from one point to another. Location is computed on the fly, depending conditions/checks.
				((Attackable) npc).cleanAllHate();
				npc.teleportTo(_zakenLocation, 0);
				break;
			
			case 4216: // Scatter Enemy ; a target teleport skill, which teleports the targeted Player to a defined, random Location.
				((Attackable) npc).stopHating(player);
				player.teleportTo(Rnd.get(LOCS), 0);
				break;
			
			case 4217: // Mass Teleport ; teleport victims and targeted Player, each on a defined, random Location.
				for (Player ply : VICTIMS)
				{
					if (ply.isInsideRadius(player, 250, true, false))
					{
						((Attackable) npc).stopHating(ply);
						ply.teleportTo(Rnd.get(LOCS), 0);
					}
				}
				((Attackable) npc).stopHating(player);
				player.teleportTo(Rnd.get(LOCS), 0);
				break;
		}
		return super.onSpellFinished(npc, player, skill);
	}
	
	@Override
	public void onGameTime()
	{
		if (GameTimeTaskManager.getInstance().getGameTime() == 0)
		{
			final Door door = DoorData.getInstance().getDoor(21240006);
			if (door != null)
				door.openMe();
		}
	}
	
	/**
	 * Call skills depending of luck and specific events.
	 * @param npc : The npc who casts the spell (Zaken).
	 * @param target : The target Zaken currently aims at.
	 */
	private static void callSkills(Npc npc, WorldObject target)
	{
		if (npc.isCastingNow())
			return;
		
		npc.setTarget(target);
		
		final int chance = Rnd.get(225);
		if (chance < 1)
			npc.doCast(FrequentSkill.ZAKEN_TELE.getSkill());
		else if (chance < 2)
			npc.doCast(FrequentSkill.ZAKEN_MASS_TELE.getSkill());
		else if (chance < 4)
			npc.doCast(FrequentSkill.ZAKEN_HOLD.getSkill());
		else if (chance < 8)
			npc.doCast(FrequentSkill.ZAKEN_DRAIN.getSkill());
		else if (chance < 15)
		{
			if (target != ((Attackable) npc).getMostHated() && npc.isInsideRadius(target, 100, false, false))
				npc.doCast(FrequentSkill.ZAKEN_MASS_DUAL_ATTACK.getSkill());
		}
		
		if (Rnd.nextBoolean() && target == ((Attackable) npc).getMostHated())
			npc.doCast(FrequentSkill.ZAKEN_DUAL_ATTACK.getSkill());
	}
	
	/**
	 * Make additional actions on boss spawn : register the NPC as boss, activate tasks.
	 * @param freshStart : If true, it uses static data, otherwise it uses stored data.
	 */
	private void spawnBoss(boolean freshStart)
	{
		final GrandBoss zaken;
		if (freshStart)
		{
			GrandBossManager.getInstance().setBossStatus(ZAKEN, ALIVE);
			
			final Location loc = Rnd.get(LOCS);
			zaken = (GrandBoss) addSpawn(ZAKEN, loc.getX(), loc.getY(), loc.getZ(), 0, false, 0, false);
		}
		else
		{
			final StatsSet info = GrandBossManager.getInstance().getStatsSet(ZAKEN);
			
			zaken = (GrandBoss) addSpawn(ZAKEN, info.getInteger("loc_x"), info.getInteger("loc_y"), info.getInteger("loc_z"), info.getInteger("heading"), false, 0, false);
			zaken.setCurrentHpMp(info.getInteger("currentHP"), info.getInteger("currentMP"));
		}
		
		GrandBossManager.getInstance().addBoss(zaken);
		
		// Reset variables.
		_teleportCheck = 3;
		_hate = 0;
		_hasTeleported = false;
		_mostHated = null;
		
		// Store current Zaken position.
		_zakenLocation.set(zaken.getPosition());
		
		// Clear victims list.
		VICTIMS.clear();
		
		// If Zaken is on its lair, begin the minions spawn cycle.
		if (ZONE.isInsideZone(zaken))
		{
			_minionStatus = 1;
			startQuestTimer("1003", 1700, null, null, true);
		}
		
		// Generic task is running from now.
		startQuestTimer("1001", 1000, zaken, null, false);
		
		zaken.broadcastPacket(new PlaySound(1, "BS01_A", zaken));
	}
	
	/**
	 * Spawn one {@link Npc} on every {@link Location} from the LOCS array. Process it for the roundsNumber amount.
	 * @param npcId : The npcId to spawn.
	 * @param roundsNumber : The rounds number to process.
	 */
	private void spawnMinionOnEveryLocation(int npcId, int roundsNumber)
	{
		for (Location loc : LOCS)
		{
			for (int i = 0; i < roundsNumber; i++)
			{
				final int x = loc.getX() + Rnd.get(650);
				final int y = loc.getY() + Rnd.get(650);
				
				addSpawn(npcId, x, y, loc.getZ(), Rnd.get(65536), false, 0, true);
			}
		}
	}
}

 

 

Location File: aCis_gameserver\java\net\sf\l2j\gameserver\scripting\scripts\ai\individual\

 

Good Luck

  • Downvote 1
  • 0
Posted

i have many error like 

 

        addGameTimeNotify();

 

                L2Skill skill = FrequentSkill.ZAKEN_DAY_TO_NIGHT.getSkill();

 

                if (npc.getAI().getDesire().getIntention() == CtrlIntention.ATTACK && !_hasTeleported)

 

                    if (mostHated != null && mostHated.isInsideRadius(_zakenLocation, 1500, true, false))

 

                        npc.doCast(FrequentSkill.ZAKEN_SELF_TELE.getSkill());

 

        final Playable realBypasser = (isPet && player.getSummon() != null) ? player.getSummon() : player;

 

  • 0
Posted (edited)
2 hours ago, xTakegawa said:

hello guys i try to found something about zaken script but that pack l2jacis dont have zaken.java anyone here know how to put zaken script or code?

To avoid all of these ,u can simply create an another RaidBoss with zaken's templateId and drops ..fix time of respawn and location in navicat and all done.

Edited by scraw
  • 0
Posted
4 hours ago, Tryskell said:

Simply wait next free revision.

The one where summons leave you in combat state for 10 minutes and pvp attack breaks after 3 hits? Nice offer. Even basic things from 2008 simply don't work and most of your doing is renaming folders&classes. Even 389 rev is broken. What's the point in adding quests and clanhalls if the game basic mechanics just don't work? They're from C1 times, man. And you're making this pack for freakin' nine years...

  • 0
Posted (edited)
3 hours ago, Xtellia said:

The one where summons leave you in combat state for 10 minutes and pvp attack breaks after 3 hits? Nice offer. Even basic things from 2008 simply don't work and most of your doing is renaming folders&classes. Even 389 rev is broken. What's the point in adding quests and clanhalls if the game basic mechanics just don't work? They're from C1 times, man. And you're making this pack for freakin' nine years...

Help him to improve-fix any issue by doing reports on every thing that isn't working properly.

 

On the other hand, you can simply use any other project like frozen and be the code master there :).

 

What's the point to judge a person for incomplete work, while this guy is fixing broken things from reports that the community did? Did you ever help on that?

 

You know mate, you can just pick a base like for example acis and fix-add what ever you need in order to have a decent project and start your business.

 

By creating new accounts and cry here and there, you become stupid...

 

 

Edited by melron
  • 0
Posted (edited)
6 hours ago, Xtellia said:

The one where summons leave you in combat state for 10 minutes and pvp attack breaks after 3 hits? Nice offer. Even basic things from 2008 simply don't work and most of your doing is renaming folders&classes. Even 389 rev is broken. What's the point in adding quests and clanhalls if the game basic mechanics just don't work? They're from C1 times, man. And you're making this pack for freakin' nine years...

 

Use another project, or start your own. We will see how you will end. I got multiple hundreds of bug reports ready for you on my archive section.

 

Fucking genius.

Edited by Tryskell
  • 0
Posted
5 minutes ago, Tryskell said:

 

Use another project, or start your own. We will see how you will end. I got multiple hundreds of bug reports ready for you on my archive section.

I know it will end with a failure for sure. I'm not a senior developer to be able to fix every wrong thing I see. I'm able to make only minor fixes. All projects novadays are focusing on trash pew-pew board&donate addons instead of making a proper gameplay replica. I can understand why they can't make a good C5-Interlude realization but they have pure C1 and C4 servers in free access. None of the packs has a good-working C1 mechanics. When you enter the server you just say "ah, another L2JmegaPremiumTeamBanana server". I want at least to have doubts "Is that an emualtor or not?" for first couple hours of gameplay.

So it is not just about you, but about whole community itself.

p.s. Reparse the spawnlist. It got double mobs count for years...

  • 0
Posted (edited)
1 hour ago, Xtellia said:

I know it will end with a failure for sure. I'm not a senior developer to be able to fix every wrong thing I see. I'm able to make only minor fixes. All projects novadays are focusing on trash pew-pew board&donate addons instead of making a proper gameplay replica. I can understand why they can't make a good C5-Interlude realization but they have pure C1 and C4 servers in free access. None of the packs has a good-working C1 mechanics. When you enter the server you just say "ah, another L2JmegaPremiumTeamBanana server". I want at least to have doubts "Is that an emualtor or not?" for first couple hours of gameplay.

So it is not just about you, but about whole community itself.

p.s. Reparse the spawnlist. It got double mobs count for years...

 

Mate, I don't care about your considerations. You even tell you're not a developer, therefore your words are worthless, to say the least.

 

I'm the first IL pack focusing solely on retail gameplay implementation, so half your post is pointless.

 

You seem to follow aCis developement "since years", but I don't see your name on any of the changesets. Did you help reporting things, did you share any contribution ? Nope.

 

And spawnlist is on a developement branch. If you were reading what I say instead of random spreading shit from your mouth, you would eventually know.

 

Some people should stay far from developement, you're maybe one of them. Too many autoproclamed server admins which can't do shit, except whine since they got -1 knowledge, and not enough players.

 

Eventually PM Zemaitis, you can open a whining contest.

Edited by Tryskell
  • 0
Posted
2 minutes ago, Tryskell said:

 

Mate, I don't care about your considerations. You even tell you're not a developer, therefore your words are worthless, to say the least.

 

I'm the first IL pack focusing solely on retail gameplay implementation, so half your post is pointless.

 

You seem to follow aCis developement "since years", but I don't see your name on any of the changesets. Did you help reporting things, did you share any contribution ? Nope.

 

And spawnlist is on a developement branch. If you were reading what I say instead of random spreading shit from your mouth, you would eventually know.

 

Some people should stay far from developement, you're maybe one of them. Too many autoproclamed server admins which can't do shit, except whine since they got -1 knowledge, and not enough players.

 

Eventually PM Zemaitis, you can open a whining contest.

I'm a developer, but a weak one. You've said on your own site that you don't accept any commits.

You say you're focusing on gameplay implementation, that's true. But after 9 years of development core mechanics are still broken? really? It is not like i'm whining on anyone but its just a sad thing. And I'm not one of these freaks who call themselves "server admins". I'm only interested in improving packs, not in getting $$$ every week by selling runes and valakas wings.

  • 0
Posted (edited)
9 minutes ago, Xtellia said:

I'm a developer, but a weak one. You've said on your own site that you don't accept any commits.

You say you're focusing on gameplay implementation, that's true. But after 9 years of development core mechanics are still broken? really? It is not like i'm whining on anyone but its just a sad thing. And I'm not one of these freaks who call themselves "server admins". I'm only interested in improving packs, not in getting $$$ every week by selling runes and valakas wings.

 

Dude, if you were reading changesets you would maybe figure out by yourself both movement and queue system are under heavy rework.

 

If you're good enough to commit such thing without any problem, then take the place of the rework author, which is bowling4soup.

 

"You've said on your own site that you don't accept any commits." needs a quote of myself, I give you 10€ if you find it. What you say simply defeat the principle of "Inner Circle" member concept.

Edited by Tryskell
  • 0
Posted
14 hours ago, Tryskell said:

Simply wait next free revision.

After so many years still this pack is missing zaken? Still rework of that fail movement system that you commited?9 years of work and the pack still is not for live usage? When it will be ready that pack the interlude will be dead for ever....

  • 0
Posted
29 minutes ago, Stive said:

After so many years still this pack is missing zaken? Still rework of that fail movement system that you commited?9 years of work and the pack still is not for live usage? When it will be ready that pack the interlude will be dead for ever....

Not only Zaken. Valakas in just a placeholder, as well as Antharas malfunctioning. Their stats need to be changed to retail too.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...