Показать сообщение отдельно
Непрочитано 10.07.2010, 20:12   #1
Аватар для Дух системы
Пользователь

Автор темы (Топик Стартер) Помогите включить функцию в java

доброго вечера.

есть кастом квест

Код:
package events.DemonicItems;

import com.l2open.gameserver.model.actor.L2Npc;
import com.l2open.gameserver.model.actor.instance.L2PcInstance;
import com.l2open.gameserver.model.quest.Quest;
import com.l2open.gameserver.model.quest.QuestState;
import com.l2open.gameserver.model.CursedWeapon;

public class DemonicItems extends Quest
{
	// NPC
	private final static int PRIEST = 78945;

	public DemonicItems(int questId, String name, String descr)
	{
		super(questId, name, descr);
		addStartNpc(PRIEST);
		addTalkId(PRIEST);
	}
	
	public String onEvent(String event, QuestState qs)
	{
		String htmltext = "";
		int cond = qs.getInt("cond");
		if(event.equalsIgnoreCase("removecw"))
		{
			if (cond == 0)
			{
				if(qs.getQuestItemsCount(8689) >= 1)
				{
					cw.endOfLife();
					qs.takeItems(8689, 1);
					qs.giveItems(90000, 1);
					qs.playSound("ItemSound.quest_itemget");
					htmltext = "2.htm";
				}
				else
					htmltext = "3.htm";
			}
		}
		return htmltext;
	}

	public String onTalk(L2Npc npc, L2PcInstance player)
	{
		String htmltext = "";
		QuestState st = player.getQuestState(getName());
		htmltext = "<html><body>I have nothing to say to you.</body></html>";
		if (st == null)
			return htmltext;
		int npcId = npc.getNpcId();
		if (npcId == PRIEST)
		{
			htmltext = "1.htm";
			st.set("cond", "0");
		}
		return htmltext;
	}

	public static void main(String[] args)
	{
		new DemonicItems(-1, "DemonicItems", "events");
	}
}
собсно ругается на cw.endOfLife();
endOfLife() находится в com.l2open.gameserver.model.CursedWeapon;
как определить эту cw?
__________________
Дух системы вне форума Отправить сообщение для Дух системы с помощью ICQ Ответить с цитированием