05-07-2012, 05:00 PM
package custom.MusicNPC;
import com.l2jfrozen.gameserver.model.actor.L2Npc;
import com.l2jfrozen.gameserver.model.actor.instance.L2Pc Instance;
import com.l2jfrozen.gameserver.model.quest.Quest;
import com.l2jfrozen.gameserver.model.quest.QuestState;
import com.l2jfrozen.gameserver.network.serverpackets.PlaySound;
public class MusicNPC extends Quest
{
private static final String qn = "MusicNPC";
private static final int MusNPC = 9211; // id npc
// enable/disable
private static final boolean Music_NPC_ENABLED = true;
public MusicNPC(int id, String name, String descr)
{
super(id, name, descr);
addStartNpc(MusNPC);
addTalkId(MusNPC);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = event;
if (!Music_NPC_ENABLED)
return htmltext;
QuestState st = player.getQuestState(qn);
if (event.equals("Rap"))
{
player.sendPacket(new PlaySound(1, "SF_P_01", 0, 0, 0, 0, 0));
}
else if (event.equals("Rock"))
{
player.sendPacket(new PlaySound(1, "SF_P_01", 0, 0, 0, 0, 0));
}
else if (event.equals("Punk"))
{
player.sendPacket(new PlaySound(1, "SF_P_01", 0, 0, 0, 0, 0));
}
else if (event.equals("Metal"))
{
player.sendPacket(new PlaySound(1, "SF_P_01", 0, 0, 0, 0, 0));
}
return htmltext;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
QuestState st = player.getQuestState(qn);
if (st == null)
st = this.newQuestState(player);
return "9211.htm";
}
public static void main(String args[])
{
new MusicNPC(-1, qn, "custom");
}
}
import com.l2jfrozen.gameserver.model.actor.L2Npc;
import com.l2jfrozen.gameserver.model.actor.instance.L2Pc Instance;
import com.l2jfrozen.gameserver.model.quest.Quest;
import com.l2jfrozen.gameserver.model.quest.QuestState;
import com.l2jfrozen.gameserver.network.serverpackets.PlaySound;
public class MusicNPC extends Quest
{
private static final String qn = "MusicNPC";
private static final int MusNPC = 9211; // id npc
// enable/disable
private static final boolean Music_NPC_ENABLED = true;
public MusicNPC(int id, String name, String descr)
{
super(id, name, descr);
addStartNpc(MusNPC);
addTalkId(MusNPC);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = event;
if (!Music_NPC_ENABLED)
return htmltext;
QuestState st = player.getQuestState(qn);
if (event.equals("Rap"))
{
player.sendPacket(new PlaySound(1, "SF_P_01", 0, 0, 0, 0, 0));
}
else if (event.equals("Rock"))
{
player.sendPacket(new PlaySound(1, "SF_P_01", 0, 0, 0, 0, 0));
}
else if (event.equals("Punk"))
{
player.sendPacket(new PlaySound(1, "SF_P_01", 0, 0, 0, 0, 0));
}
else if (event.equals("Metal"))
{
player.sendPacket(new PlaySound(1, "SF_P_01", 0, 0, 0, 0, 0));
}
return htmltext;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
QuestState st = player.getQuestState(qn);
if (st == null)
st = this.newQuestState(player);
return "9211.htm";
}
public static void main(String args[])
{
new MusicNPC(-1, qn, "custom");
}
}