Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: frozen-core.htm
- ===================================================================
- --- frozen-core.htm (revision 0)
- +++ frozen-core.htm (working copy)
- @@ -0,0 +1,4 @@
- +<html><body>Jinia<br>
- +It´s a pieace of Frozen Core. But even you might not be able to derive all of its power.
- + Whatever happens be careful, you won´t be able to use it very often.<br>
- +</body></html>
- \ No newline at end of file
- Index: jinia-frozen-core-already.htm
- ===================================================================
- --- jinia-frozen-core-already.htm (revision 0)
- +++ jinia-frozen-core-already.htm (working copy)
- @@ -0,0 +1,3 @@
- +<html><body>Jinia<br>
- +Remember, Sirra gave us the Frozen Core. They should be power enough.<br>
- +</body></html>
- \ No newline at end of file
- Index: Jinia.java
- ===================================================================
- --- Jinia.java (revision 0)
- +++ Jinia.java (working copy)
- @@ -0,0 +1,73 @@
- +/*
- + * This program is free software: you can redistribute it and/or modify it under
- + * the terms of the GNU General Public License as published by the Free Software
- + * Foundation, either version 3 of the License, or (at your option) any later
- + * version.
- + *
- + * This program is distributed in the hope that it will be useful, but WITHOUT
- + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- + * details.
- + *
- + * You should have received a copy of the GNU General Public License along with
- + * this program. If not, see <http://www.gnu.org/licenses/>.
- + */
- +package ai.npc.Jinia;
- +
- +import ai.npc.AbstractNpcAI;
- +
- +import com.l2jserver.gameserver.instancemanager.QuestManager;
- +import com.l2jserver.gameserver.model.actor.L2Npc;
- +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jserver.gameserver.model.quest.Quest;
- +import com.l2jserver.gameserver.model.quest.QuestState;
- +
- +/**
- + ** @author Gladicek
- + */
- +
- +public class Jinia extends AbstractNpcAI
- +{
- +
- + // NPC
- + private static final int JINIA = 32781;
- + // Items
- + private static final int FROZEN_CORE = 15469;
- +
- + @Override
- + public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
- + {
- + String htmltext = event;
- +
- + QuestState st = player.getQuestState(getName());
- + if (st == null)
- + {
- + Quest q = QuestManager.getInstance().getQuest(getName());
- + st = q.newQuestState(player);
- + }
- +
- + if (event.equalsIgnoreCase("frozen_core"))
- + {
- + if (st.getQuestItemsCount(FROZEN_CORE) >= 1)
- + {
- + return "jinia-frozen-core-already.htm";
- + }
- + st.giveItems(FROZEN_CORE, 1);
- + return "frozen-core.htm";
- + }
- +
- + return htmltext;
- + }
- +
- + public Jinia(String name, String descr)
- + {
- + super(name, descr);
- + addStartNpc(JINIA);
- + addTalkId(JINIA);
- + }
- +
- + public static void main(String[] args)
- + {
- + new Jinia(Jinia.class.getSimpleName(), "ai/npc");
- + }
- +}
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment