I want to make custom event for mine Interlude server. I already done NPCs running and shouting, but think I want is to make that running npcs shot fireworks each 5 minutes.
Currently mine code looks like this:
Code: Select all
package net.sf.l2j.gameserver.ai.special; // yes i made this to be loaded from core. i am not familiar to py import net.sf.l2j.gameserver.model.quest.Quest;import net.sf.l2j.gameserver.model.L2Skill;import net.sf.l2j.gameserver.datatables.SkillTable;import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; /* * @author Airin */ public class SantaHelper extends Quest implements Runnable{ private static final int SANTA_HELPER = 56; private static final int SANTA_HELPER2 = 57; public SantaHelper(int questId, String name, String descr) { super(questId, name, descr); addEventId(SANTA_HELPER, Quest.QuestEventType.ON_SPAWN); addEventId(SANTA_HELPER2, Quest.QuestEventType.ON_SPAWN); } @Override public String onSpawn(L2NpcInstance npc) { if(npc.getNpcId() == SANTA_HELPER || npc.getNpcId() == SANTA_HELPER2) { startQuestTimer("Firework", 300000, npc, null); } return super.onSpawn(npc); } @Override public String onAdvEvent(String event, L2NpcInstance npc, L2PcInstance player) { if(event == "Firework") { L2Skill skill = SkillTable.getInstance().getInfo(2024, 1); if(skill != null) { npc.doCast(skill); } startQuestTimer("Firework", 300000, npc, null); } return super.onAdvEvent(event, npc, player); } @Override public void run() {}}
Can somebody help me a bit with this?