Contributed by Stayway.
This commit is contained in:
MobiusDev
2015-04-02 03:01:58 +00:00
parent c5f7b0587f
commit bf2c6f40cc
6 changed files with 185 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ ai/npc/Milia/Milia.java
ai/npc/Minigame/Minigame.java ai/npc/Minigame/Minigame.java
ai/npc/MonkOfChaos/MonkOfChaos.java ai/npc/MonkOfChaos/MonkOfChaos.java
ai/npc/MonumentOfHeroes/MonumentOfHeroes.java ai/npc/MonumentOfHeroes/MonumentOfHeroes.java
ai/npc/Nomi/Nomi.java
ai/npc/NpcBuffers/NpcBuffers.java ai/npc/NpcBuffers/NpcBuffers.java
ai/npc/Pantheon/Pantheon.java ai/npc/Pantheon/Pantheon.java
ai/npc/Proclaimer/Proclaimer.java ai/npc/Proclaimer/Proclaimer.java

View File

@@ -0,0 +1,159 @@
/*
* Copyright (C) 2004-2015 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack 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.
*
* L2J DataPack 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.Nomi;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.holders.SkillHolder;
import com.l2jserver.gameserver.model.skills.Skill;
/**
* Nomi AI.
* @author Stayway
*/
public final class Nomi extends AbstractNpcAI
{
// NPC
private static final int NOMI = 34007;
// Skills
private static final SkillHolder BLESS_PROTECTION = new SkillHolder(5182, 1); // Blessing of Protection
private static final SkillHolder KNIGHT = new SkillHolder(15648, 1); // Knight's Harmony (Adventurer)
private static final SkillHolder WARRIOR = new SkillHolder(15649, 1); // Warrior's Harmony (Adventurer)
private static final SkillHolder WIZARD = new SkillHolder(15650, 1); // Wizard's Harmony (Adventurer)
private static final SkillHolder[] GROUP_BUFFS =
{
new SkillHolder(15642, 1), // Horn Melody (Adventurer)
new SkillHolder(15643, 1), // Drum Melody (Adventurer)
new SkillHolder(15644, 1), // Pipe Organ Melody (Adventurer)
new SkillHolder(15645, 1), // Guitar Melody (Adventurer)
new SkillHolder(15646, 1), // Harp Melody (Adventurer)
new SkillHolder(15647, 1), // Lute Melody (Adventurer)
new SkillHolder(15651, 1), // Prevailing Sonata (Adventurer)
new SkillHolder(15652, 1), // Daring Sonata (Adventurer)
new SkillHolder(15653, 1), // Refreshing Sonata (Adventurer)
};
// Others
private static final Location[] SPAWN_LOCATIONS =
{
new Location(83505, 148375, -3405, 31863), // Giran
new Location(147445, 26874, -2204, 48319), // Aden
new Location(147722, -56376, -2781, 20021), // Goddart
new Location(42269, -48241, -803, 0), // Rune
new Location(18599, 145485, -3126, 30873), // Dion
new Location(82562, 53847, -1488, 65199), // Oren
new Location(-14535, 123732, -3104, 20229), // Gludio
new Location(-80687, 150254, -3044, 46168), // Gludin
new Location(87340, -141620, -1341, 16383), // Schuttgart
new Location(111728, 219962, -3659, 473), // Heine
new Location(116514, 75899, -2730, 6558), // Hunters
};
private static final int MAX_BLESS_PROTECTION_LEVEL = 40;
private static final int MAX_BUFF_LEVEL = 90;
private Nomi()
{
super(Nomi.class.getSimpleName(), "ai/npc");
addStartNpc(NOMI);
addTalkId(NOMI);
addFirstTalkId(NOMI);
for (Location loc : SPAWN_LOCATIONS)
{
addSpawn(NOMI, loc, false, 0);
}
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = null;
switch (event)
{
case "nomi.html":
case "nomi-01.html":
{
htmltext = event;
break;
}
case "weakenBreath":
{
if (player.getShilensBreathDebuffLevel() < 3)
{
htmltext = "guide-noBreath.html";
break;
}
player.setShilensBreathDebuffLevel(2);
htmltext = ""; // TODO: Any success html?
break;
}
case "knight":
{
htmltext = applyBuffs(npc, player, KNIGHT.getSkill());
break;
}
case "warrior":
{
htmltext = applyBuffs(npc, player, WARRIOR.getSkill());
break;
}
case "wizard":
{
htmltext = applyBuffs(npc, player, WIZARD.getSkill());
break;
}
}
return htmltext;
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
return "nomi.html";
}
private String applyBuffs(L2Npc npc, L2PcInstance player, Skill skill)
{
if (player.getLevel() > MAX_BUFF_LEVEL)
{
return "nomi-noBuffs.html";
}
for (SkillHolder holder : GROUP_BUFFS)
{
holder.getSkill().applyEffects(npc, player);
}
skill.applyEffects(npc, player);
if ((player.getLevel() < MAX_BLESS_PROTECTION_LEVEL) && (player.getClassId().level() <= 1))
{
BLESS_PROTECTION.getSkill().applyEffects(npc, player);
}
return null;
}
public static void main(String[] args)
{
new Nomi();
}
}

View File

@@ -0,0 +1,12 @@
<html>Nomi:<body><br>
The buff you will receive is this, that, and that.<br>
But if your level is 91 or above, you cannot receive it.<br>
Horn Melody / Drum Melody / Pipe Organ Melody<br1>
Guitar Melody / Harp Melody / Lute Melody<br1>
Prevailing Sonata / Daring Sonata / Refreshing Sonata<br1>
You can receive the above buffs as a group.<br>
You will have to choose one from Knight's Harmony / Warrior's Harmony / Wizard's Harmony.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest Nomi knight">"I want the Knight's Harmony."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest Nomi warrior">"Warrior's Harmony, please."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest Nomi wizard">"Wizard's Harmony, of course!"</Button>
</body></html>

View File

@@ -0,0 +1,4 @@
<html>Nomi:<body><br>
I can only weaken Shilen's Breath Lv. 3 or above.<br>
There is nothing I can do for you.
</body></html>

View File

@@ -0,0 +1,3 @@
<html>Nomi:<body><br>
Characters who are Lv. 91 or above cannot receive Newbie Buffs.
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Nomi:<br>
Don't talk to me!<br>
Go away! Antharas is mine.<br>
Plenty of you have bothered me already... But, I guess I can help you if you ask nicely. What do you want?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest Nomi nomi-01.html"><font color="LEVEL">"Can I see the list of available buffs?"</font></Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>