kimerateam Posted March 9, 2011 Posted March 9, 2011 help create auto Spawn NPC time 06.00 ,09.00 ,12.30 , 14.00 ,20.00, 00.00, 03.00 spawn 60 Minutes. Quote
0 Matim Posted March 10, 2011 Posted March 10, 2011 You can create new TASK, take a look at tasks from: \gameserver\taskmanager\tasks And take a look about how does it work. Also there is guide about task manager shared already aswell. Use search. Quote
0 Tryskell Posted March 12, 2011 Posted March 12, 2011 I invite you to search how mammons NPCs are spawned and removed. Quote
0 kimerateam Posted March 16, 2011 Author Posted March 16, 2011 I invite you to search how mammons NPCs are spawned and removed. No search not found search for key spawned and removed, NPCs are spawned, Quote
0 eKo Posted March 16, 2011 Posted March 16, 2011 package custom.Test; import java.util.Calendar; import com.l2jserver.Config; import com.l2jserver.gameserver._announcements; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.quest.Quest; public class Test extends Quest { private static final boolean _announce = true; private static final int _event_duration = 2; private static final int _event_delay = 3; private static final Byte _start_hour = 0; private static final Byte _start_minute = 0; private static final int _event_frequency = 360; public Test(int questId, String name, String descr) { super(questId, name, descr); if (loadGlobalQuestVar("") == "") { if (_start_hour > 0) startQuestTimer("START", setStartTime(_start_hour, _start_minute), null, null); else startQuestTimer("START", _event_delay * 60000, null, null); } else startQuestTimer("RESTORE", 60000, null, null); } private long setStartTime(Byte minute, Byte hour) { Calendar starttime = Calendar.getInstance(); if (hour > 0 && hour < 24) starttime.set( Calendar.HOUR_OF_DAY, hour ); else _log.info("Skipped."); if (minute > 0 && minute < 60) starttime.set( Calendar.MINUTE, minute ); else if (minute > 60) starttime.set( Calendar.MINUTE, minute % 60 ); if ((starttime.getTimeInMillis() - Calendar.getInstance().getTimeInMillis()) > 0) return (starttime.getTimeInMillis() - Calendar.getInstance().getTimeInMillis()); else return 60000L; } public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { if (event.equalsIgnoreCase("START")) { } if (event.equalsIgnoreCase("RESTORE")) { if (_start_hour > 0) startQuestTimer("START", setStartTime(_start_hour, _start_minute), null, null); else if (_event_frequency > 0) startQuestTimer("START", _event_frequency * 60000, null, null); } return ""; } public static void main(String[] args) { new Test(-1, "Test", "custom"); } } example for your spawn. now just add spawn func to it. look at event "elpys" in DP side if you use freya Quote
0 Tryskell Posted March 16, 2011 Posted March 16, 2011 public void spawnSevenSignsNPC() eKo, such a big code for a little thing o_o. Quote
0 eKo Posted March 16, 2011 Posted March 16, 2011 public void spawnSevenSignsNPC() eKo, such a big code for a little thing o_o. just as an example o_o, i had it on my files was used for smth else Quote
Question
kimerateam
help create auto Spawn NPC time 06.00 ,09.00 ,12.30 , 14.00 ,20.00, 00.00, 03.00
spawn 60 Minutes.
6 answers to this question
Recommended Posts
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.