GameServer: Loading Server Scripts
----------
1. ERROR in \Vesper.java (at line 50)
st.setState(State.STARTED);
^^^^^^^^^^^^^
State.STARTED cannot be resolved
----------
1 problem (1 error)State.STARTED cannot be resolved
Failed executing script: I:\server\gameserver\data\scripts\quests\Vesper\Vesper.
java. See Vesper.java.error.log for details.
Ошибка
Скрытый текстError on: I:\server\gameserver\data\scripts\quests\Vesper\Vesper.java.error.logLine: -1 - Column: -1
compilation failed
Квест
Скрытый текстpackage quests.Vesper;import net.sf.l2j.gameserver.model.L2Party;
import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.quest.Quest;
import net.sf.l2j.gameserver.model.quest.QuestState;
import net.sf.l2j.gameserver.model.quest.State;
import net.sf.l2j.util.Rnd;
public class Vesper extends Quest {
private static final String qn = "Vesper";
private final static int npcId = 77778;
private final static int[] MOBS = {21376,21377,21378,21394,21652,21379,21653,21380,21383,21654,21382};
private final static int RaidBoss = 70021;
private final static int BLACK_FEATHER = 10596;
private final static int ITEM_FROM_RB = 10598;
private final static int chance1 = 100;
private final static int chance2 = 100;
private final static int FEATHER = 10599;
private int count;
private static boolean REPEATABLE = true;
private int cond = 0;
public Vesper(int questId, String name, String descr) {
super(questId, name, descr);
addStartNpc(npcId);
addTalkId(npcId);
for (int mobs : MOBS) {
addKillId(mobs);
}
addKillId(RaidBoss);
}
@Override
public String onAdvEvent(String event, L2NpcInstance npc, L2PcInstance player) {
String htmltext = event;
QuestState st = player.getQuestState(qn);
if (st == null) {
return htmltext;
}
switch (npc.getNpcId()) {
case npcId:
if (event.equals("start")) {
st.set("cond", "1");
htmltext = "77778-2.htm";
st.setState(State.STARTED);
st.playSound("ItemSound.quest_accept");
} else if (event.equals("sobral")) {
count = player.getInventory().getInventoryItemCount(BLACK_FEATHER, 0);
if (count < 1000) {
htmltext = "77778-no.htm";
} else {
st.takeItems(BLACK_FEATHER, 1000);
st.set("cond", "2");
htmltext = "77778-4.htm";
}
} else if (event.equals("item_RB")) {
count = player.getInventory().getInventoryItemCount(ITEM_FROM_RB, 0);
if (count < 1) {
htmltext = "77778-no1.htm";
} else {
st.takeItems(ITEM_FROM_RB, 1);
st.giveItems(FEATHER, 1);
st.exitQuest(REPEATABLE);
htmltext = "<html><body>Quest for vesper passed successfully.</body><html>";
}
} else if (event.equals("otmena")) {
htmltext = "<html><body>Quest for vesper canceled.</body></html>";
st.exitQuest(true);
}
break;
}
return htmltext;
}
@Override
public String onTalk(L2NpcInstance npc, L2PcInstance player) {
QuestState st = player.getQuestState(getName());
String htmltext = "";
if (st == null) {
return htmltext;
}
int npcId = npc.getNpcId();
cond = st.getInt("cond");
if (npcId == npcId) {
if (cond == 0) {
htmltext = "77778-1.htm";
} else if (cond == 1) {
htmltext = "77778-3.htm";
} else if (cond == 2) {
htmltext = "77778-5.htm";
}
}
return htmltext;
}
@Override
public String onKill(L2NpcInstance npc, L2PcInstance killer, boolean isPet) {
QuestState st = killer.getQuestState(getName());
if (st == null) {
return null;
}
int npcId = npc.getNpcId();
int cond = st.getInt("cond");
L2Party party = killer.getParty();
switch (cond) {
case 1:
for (int id : MOBS) {
if (npcId == id) {
if (Rnd.get(100) < chance1) {
if (st.getPlayer().getInventory().getInventoryItemCount(BLACK_FEATHER, 0) < 1000) {
st.giveItems(BLACK_FEATHER, 1);
}
}
}
}
break;
case 2:
if (npcId == RaidBoss) {
if (Rnd.get(100) < chance2) {
if (party != null) {
for (L2PcInstance member : party.getPartyMembers()) {
if (member.getInventory().getInventoryItemCount(ITEM_FROM_RB, 0) == 0) {
member.getQuestState(getName()).giveItems(ITEM_FROM_RB, 1);
} else if (killer.getInventory().getInventoryItemCount(ITEM_FROM_RB, 0) == 0) {
st.giveItems(ITEM_FROM_RB, 1);
}
}
}
}
}
break;
}
return null;
}
public static void main(String[] args) {
new Vesper(-1, qn, "quests");
}
}
Предупреждение от модератора †DeMoN†™
4.12 Неинформативный заголовок: "помогите"