Page 1 of 1

GrandBosses respawn

Posted: Mon Apr 26, 2010 9:46 pm
by nimeni
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number:
L2JDP Revision Number:

Hello.
where i can change respawn time for GrandBosses (low time) and reset respawnTime in grandboss_data.
ai.individual or com.l2jserver/config.java?


i have this in Config.java:

Code: Select all

					Interval_Of_QueenAnt_Spawn = Integer.parseInt(grandbossSettings.getProperty("IntervalOfQueenAntSpawn", "2"));					if (Interval_Of_QueenAnt_Spawn < 1 || Interval_Of_QueenAnt_Spawn > 4)						Interval_Of_QueenAnt_Spawn = 2;					Interval_Of_QueenAnt_Spawn = Interval_Of_QueenAnt_Spawn * 3600000; 					Random_Of_QueenAnt_Spawn = Integer.parseInt(grandbossSettings.getProperty("RandomOfQueenAntSpawn", "1"));					if (Random_Of_QueenAnt_Spawn < 1 || Random_Of_QueenAnt_Spawn > 2)						Random_Of_QueenAnt_Spawn = 1;					Random_Of_QueenAnt_Spawn = Random_Of_QueenAnt_Spawn * 3600000;
and this in ai.individual/QueenAnt.java

Code: Select all

	//QUEEN Status Tracking :	private static final byte ALIVE = 0; //Queen Ant is spawned.	private static final byte DEAD = 1; //Queen Ant has been killed. 	private static L2BossZone _Zone;	private static List<L2Attackable> _Minions = new FastList<L2Attackable>(); 	public QueenAnt(int questId, String name, String descr)	{		super(questId, name, descr);		int[] mobs =		{				QUEEN, LARVA, NURSE, GUARD, ROYAL		};		registerMobs(mobs);		_Zone = GrandBossManager.getInstance().getZone(-21610, 181594, -5734); 		StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);		int status = GrandBossManager.getInstance().getBossStatus(QUEEN);		if (status == DEAD)		{			// load the unlock date and time for queen ant from DB			long temp = info.getLong("respawn_time") - System.currentTimeMillis();			// if queen ant is locked until a certain time, mark it so and start the unlock timer			// the unlock time has not yet expired.			if (temp > 0)				startQuestTimer("queen_unlock", temp, null, null);			else			{				// the time has already expired while the server was offline. Immediately spawn queen ant.				L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, -21610, 181594, -5734, 0, false, 0);				GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE);				spawnBoss(queen);			}		}		else		{			int loc_x = info.getInteger("loc_x");			int loc_y = info.getInteger("loc_y");			int loc_z = info.getInteger("loc_z");			int heading = info.getInteger("heading");			int hp = info.getInteger("currentHP");			int mp = info.getInteger("currentMP");			L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, loc_x, loc_y, loc_z, heading, false, 0);			queen.setCurrentHpMp(hp, mp);			spawnBoss(queen);		}	} 	public void spawnBoss(L2GrandBossInstance npc)	{		GrandBossManager.getInstance().addBoss(npc);		if (Rnd.get(100) < 33)			_Zone.movePlayersTo(-19480, 187344, -5600);		else if (Rnd.get(100) < 50)			_Zone.movePlayersTo(-17928, 180912, -5520);		else			_Zone.movePlayersTo(-23808, 182368, -5600);		GrandBossManager.getInstance().addBoss(npc);		startQuestTimer("action", 10000, npc, null, true);		npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));		//Spawn minions		addSpawn(LARVA, -21600, 179482, -5846, Rnd.get(360), false, 0).setIsRaidMinion(true);		addSpawn(NURSE, -22000, 179482, -5846, 0, false, 0).setIsRaidMinion(true);		addSpawn(NURSE, -21200, 179482, -5846, 0, false, 0).setIsRaidMinion(true);		int radius = 400;		for (int i = 0; i < 6; i++)		{			int x = (int) (radius * Math.cos(i * 1.407)); //1.407~2pi/6			int y = (int) (radius * Math.sin(i * 1.407));			addSpawn(NURSE, npc.getX() + x, npc.getY() + y, npc.getZ(), 0, false, 0).setIsRaidMinion(true);		}		for (int i = 0; i < 8; i++)		{			int x = (int) (radius * Math.cos(i * .7854)); //.7854~2pi/8			int y = (int) (radius * Math.sin(i * .7854));			L2Npc mob = addSpawn(ROYAL, npc.getX() + x, npc.getY() + y, npc.getZ(), 0, false, 0);			mob.setIsRaidMinion(true);			_Minions.add((L2Attackable) mob);		}		startQuestTimer("check_royal__Zone", 120000, npc, null, true);	} 	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)	{		if (event.equalsIgnoreCase("action") && npc != null)		{			if (Rnd.get(3) == 0)			{				if (Rnd.get(2) == 0)				{					npc.broadcastPacket(new SocialAction(npc.getObjectId(), 3));				}				else				{					npc.broadcastPacket(new SocialAction(npc.getObjectId(), 4));				}			}		}		else if (event.equalsIgnoreCase("queen_unlock"))		{			L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, -21610, 181594, -5734, 0, false, 0);			GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE);			spawnBoss(queen);		}		else if (event.equalsIgnoreCase("check_royal__Zone") && npc != null)		{			for (int i = 0; i < _Minions.size(); i++)			{				L2Attackable mob = _Minions.get(i);				if (mob != null && !_Zone.isInsideZone(mob))				{					mob.teleToLocation(npc.getX(), npc.getY(), npc.getZ());				}			}		}		else if (event.equalsIgnoreCase("despawn_royals"))		{			for (int i = 0; i < _Minions.size(); i++)			{				L2Attackable mob = _Minions.get(i);				if (mob != null)				{					mob.decayMe();				}			}			_Minions.clear();		}		else if (event.equalsIgnoreCase("spawn_royal"))		{			L2Npc mob = addSpawn(ROYAL, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0);			mob.setIsRaidMinion(true);			_Minions.add((L2Attackable) mob);		}		else if (event.equalsIgnoreCase("spawn_nurse"))		{			addSpawn(NURSE, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0).setIsRaidMinion(true);		}		return super.onAdvEvent(event, npc, player);	} 	public String onFactionCall(L2Npc npc, L2Npc caller, L2PcInstance attacker, boolean isPet)	{		if (caller == null || npc == null)			return super.onFactionCall(npc, caller, attacker, isPet);		int npcId = npc.getNpcId();		int callerId = caller.getNpcId();		if (npcId == NURSE)		{			if (callerId == LARVA)			{				npc.setTarget(caller);				npc.doCast(SkillTable.getInstance().getInfo(4020, 1));				npc.doCast(SkillTable.getInstance().getInfo(4024, 1));				return null;			}			else if (callerId == QUEEN)			{				if (npc.getTarget() != null && npc.getTarget() instanceof L2Npc)				{					if (((L2Npc) npc.getTarget()).getNpcId() == LARVA)					{						return null;					}				}				npc.setTarget(caller);				npc.doCast(SkillTable.getInstance().getInfo(4020, 1));				return null;			}		}		return super.onFactionCall(npc, caller, attacker, isPet);	} 	public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)	{		int npcId = npc.getNpcId();		if (npcId == NURSE)		{			npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null, null);			return null;		}		return super.onAttack(npc, attacker, damage, isPet);	} 	public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)	{		int npcId = npc.getNpcId();		if (npcId == QUEEN)		{			npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));			GrandBossManager.getInstance().setBossStatus(QUEEN, DEAD);			//time is 36hour	+/- 17hour			long respawnTime = (long) Config.Interval_Of_QueenAnt_Spawn + Rnd.get(Config.Random_Of_QueenAnt_Spawn);			startQuestTimer("queen_unlock", respawnTime, null, null);			cancelQuestTimer("action", npc, null);			// also save the respawn time so that the info is maintained past reboots			StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);			info.set("respawn_time", System.currentTimeMillis() + respawnTime);			GrandBossManager.getInstance().setStatsSet(QUEEN, info);			startQuestTimer("despawn_royals", 20000, null, null);			this.cancelQuestTimers("spawn_minion");		}		else if (GrandBossManager.getInstance().getBossStatus(QUEEN) == ALIVE)		{			if (npcId == ROYAL)			{				_Minions.remove(npc);				this.startQuestTimer("spawn_royal", (280 + Rnd.get(40)) * 1000, npc, null);			}			else if (npcId == NURSE)			{				startQuestTimer("spawn_nurse", 10000, npc, null);			}		}		return super.onKill(npc, killer, isPet);	} 	public static void main(String[] args)	{		// now call the constructor (starts up the ai)		new QueenAnt(-1, "queen_ant", "ai");	}}
ex.. every 4 hours.
thanks.

Re: GrandBosses respawn

Posted: Mon Apr 26, 2010 10:36 pm
by kocinski
Did you check Grandboss.properties?

Re: GrandBosses respawn

Posted: Tue Apr 27, 2010 2:31 am
by nimeni
I changed like in Config.java all RaidBoss respawn normal as i want but the prb is:
"respawn_time" not supposed to have value 0 when raidboss is online?
I mean after he died and is back, not reset to the 0 value in column (respawn_time)
where can I change the respawn time when it appears again (respawn_time) to have value 0.
If I did not change anything, then everything is fine
with the current settings appears when I want, but respawn_time value does not updating


grandboss.properties

Code: Select all

# Antharas# ---------------------------------------------------------------------------# Delay of appearance time of Antharas. Value is minute. Range 3-60AntharasWaitTime = 10 # Interval time of Antharas. Value is hour. Range 1-480IntervalOfAntharasSpawn = 2 # Random interval. Range 1-192RandomOfAntharasSpawn = 1 # ---------------------------------------------------------------------------# Valakas# ---------------------------------------------------------------------------# Delay of appearance time of Valakas. Value is minute. Range 3-60ValakasWaitTime = 10 # Interval time of Valakas. Value is hour. Range 1-480IntervalOfValakasSpawn = 2 # Random interval. Range 1-192RandomOfValakasSpawn = 1 # ---------------------------------------------------------------------------# Baium# ---------------------------------------------------------------------------# Interval time of Baium. Value is hour. Range 1-480IntervalOfBaiumSpawn = 2 # Random interval. Range 1-192RandomOfBaiumSpawn = 1 # ---------------------------------------------------------------------------# Core# ---------------------------------------------------------------------------# Interval time of Core. Value is hour. Range 1-480IntervalOfCoreSpawn = 2 # Random interval. Range 1-192RandomOfCoreSpawn = 1 # ---------------------------------------------------------------------------# Orfen# ---------------------------------------------------------------------------# Interval time of Orfen. Value is hour. Range 1-480IntervalOfOrfenSpawn = 2 # Random interval. Range 1-192RandomOfOrfenSpawn = 1 # ---------------------------------------------------------------------------# Queen Ant# ---------------------------------------------------------------------------# Interval time of QueenAnt. Value is hour. Range 1-480IntervalOfQueenAntSpawn = 2 # Random interval. Range 1-192RandomOfQueenAntSpawn = 1 # ---------------------------------------------------------------------------# Zaken# ---------------------------------------------------------------------------# Interval time of Zaken. Value is hour. Range 1-480IntervalOfZakenSpawn = 2 # Random interval. Range 1-192RandomOfZakenSpawn = 1 

Re: GrandBosses respawn

Posted: Tue Apr 27, 2010 4:41 am
by janiii
you cannot talk about raidboss and then write grandboss config. these two things are really different. please try to explain which you mean, grandboss or raidboss.
there is nothing wrong with respawn_time, it is saved on server restart. if the respawn_time is lower then current time, then raidboss is spawned.

Re: GrandBosses respawn

Posted: Tue Apr 27, 2010 4:27 pm
by nimeni
sry janiii .... my mistake.
I mean to GrandBosses..where should I change if I want to be every 4 hours.
I want to appear every 4 hours, but not that's the problem ...my problem is that when it appears value does not change (respawn_time), value not supposed to change automatically when GrandBoss appear?
grandboss_data.sql / respawn_time value 0 if status = 0?

thanks