Removed several scripts.

This commit is contained in:
MobiusDev 2017-05-01 17:26:21 +00:00
parent 7dd2ed4eb5
commit 33152bba93
8494 changed files with 5 additions and 190410 deletions

View File

@ -1,169 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.AncientCityArcan;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import com.l2jmobius.gameserver.enums.Movie;
import com.l2jmobius.gameserver.instancemanager.QuestManager;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.spawns.SpawnGroup;
import com.l2jmobius.gameserver.model.spawns.SpawnTemplate;
import com.l2jmobius.gameserver.model.zone.L2ZoneType;
import com.l2jmobius.gameserver.model.zone.type.L2ScriptZone;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.Earthquake;
import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import com.l2jmobius.gameserver.network.serverpackets.OnEventTrigger;
import ai.AbstractNpcAI;
import instances.TaintedDimension.TaintedDimension;
import quests.Q10301_ShadowOfTerrorBlackishRedFog.Q10301_ShadowOfTerrorBlackishRedFog;
/**
* Ancient Arcan City AI.
* @author St3eT
*/
public final class AncientArcanCity extends AbstractNpcAI
{
// NPC
private static final int CEREMONIAL_CAT = 33093;
// Location
private static final Location ANCIENT_ARCAN_CITY = new Location(207559, 86429, -1000);
private static final Location EARTHQUAKE = new Location(207088, 88720, -1128);
// Zones
private static final L2ScriptZone BROADCAST_ZONE = ZoneManager.getInstance().getZoneById(23600, L2ScriptZone.class); // Ancient Arcan City zone
private static final L2ScriptZone TELEPORT_ZONE = ZoneManager.getInstance().getZoneById(12015, L2ScriptZone.class); // Anghel Waterfall teleport zone
// Misc
private static final int CHANGE_STATE_TIME = 1800000; // 30min
private boolean isCeremonyRunning = false;
private final Set<SpawnTemplate> _templates = ConcurrentHashMap.newKeySet();
private AncientArcanCity()
{
addEnterZoneId(BROADCAST_ZONE.getId(), TELEPORT_ZONE.getId());
startQuestTimer("CHANGE_STATE", CHANGE_STATE_TIME, null, null, true);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("CHANGE_STATE"))
{
isCeremonyRunning = !isCeremonyRunning;
for (L2PcInstance temp : BROADCAST_ZONE.getPlayersInside())
{
temp.sendPacket(new OnEventTrigger(262001, !isCeremonyRunning));
temp.sendPacket(new OnEventTrigger(262003, isCeremonyRunning));
if (isCeremonyRunning)
{
showOnScreenMsg(temp, NpcStringId.THE_INCREASED_GRASP_OF_DARK_ENERGY_CAUSES_THE_GROUND_TO_SHAKE, ExShowScreenMessage.TOP_CENTER, 5000, true);
temp.sendPacket(new Earthquake(EARTHQUAKE, 10, 5));
}
}
if (isCeremonyRunning)
{
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase("Ceremony"), null));
}
else
{
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase("Ceremony")));
cancelQuestTimers("SOCIAL_ACTION");
}
}
else if (event.contains("SOCIAL_ACTION") && (npc != null))
{
npc.broadcastSocialAction(2);
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onEnterZone(L2Character creature, L2ZoneType zone)
{
if (creature.isPlayer())
{
final L2PcInstance player = creature.getActingPlayer();
if (zone.getId() == TELEPORT_ZONE.getId())
{
final QuestState qs = creature.getActingPlayer().getQuestState(Q10301_ShadowOfTerrorBlackishRedFog.class.getSimpleName());
if ((qs != null) && qs.isCond(3))
{
final Quest instance = QuestManager.getInstance().getQuest(TaintedDimension.class.getSimpleName());
if (instance != null)
{
instance.notifyEvent("enterInstance", null, player);
}
}
else
{
player.teleToLocation(ANCIENT_ARCAN_CITY);
}
}
else
{
player.sendPacket(new OnEventTrigger(262001, !isCeremonyRunning));
player.sendPacket(new OnEventTrigger(262003, isCeremonyRunning));
if (player.getVariables().getBoolean("ANCIENT_ARCAN_CITY_SCENE", true))
{
player.getVariables().set("ANCIENT_ARCAN_CITY_SCENE", false);
playMovie(player, Movie.SI_ARKAN_ENTER);
}
}
}
return super.onEnterZone(creature, zone);
}
@Override
public void onSpawnActivate(SpawnTemplate template)
{
_templates.add(template);
}
// @Override
// public void onSpawnDeactivate(SpawnTemplate template)
// {
// _templates.remove(template);
// }
@Override
public void onSpawnNpc(SpawnTemplate template, SpawnGroup group, L2Npc npc)
{
if (npc.getId() == CEREMONIAL_CAT)
{
npc.setRandomAnimation(npc.getParameters().getBoolean("disableRandomAnimation", false));
startQuestTimer("SOCIAL_ACTION", 4500, npc, null, true);
}
}
public static void main(String[] args)
{
new AncientArcanCity();
}
}

View File

@ -1,9 +0,0 @@
<html><body>Enchanter Lykus:<br>
Enchantment requires a lot of effort. Repeat what I do if you want to be good at it!<br><br>
First! Shout my name three times!<br>
Second! Circle Ancient City Arcan three times!<br>
Lastly! Go to a quiet place, and imagine yourself holding the enchanted weapons or armor! Right!<br><br>
You can't skip any of the steps!<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lykus 33521-02.html">"My heart is weak so I can't enchant."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lykus 33521-03.html">"I did what you said but nothing happened."</Button>
</body></html>

View File

@ -1,3 +0,0 @@
<html><body>Enchant Setter Lykus:<br>
Just trust me and enchant only once! Believe in yourself!
</body></html>

View File

@ -1,6 +0,0 @@
<html><body>Enchant Setter Lykus:<br>
No...! Really?<br>
I can't believe it...!<br>
Did you really follow what I said?<br>
I must... say I'm sorry! Hit me as much as you want! I'm sorry! Hit me!
</body></html>

View File

@ -1,8 +0,0 @@
<html><body>Enchanter Lykus:<br>
Go and enchant a +16 weapon to make it +17!<br>
You can't fail since I bestowed you with my blessing!<br>
Don't worry and just do as I told you!<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lykus 33521-01.html">"I would like to learn from you."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lykus 33521-03.html">"I failed while enchanting +16."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lykus 33521-05.html">"I succeeded and made a +17!"</Button>
</body></html>

View File

@ -1,7 +0,0 @@
<html><body>Enchanter Lykus:<br>
Excellent! Great work!<br>
You are quite brave!<br>
Now, if you can step up with one more enchant, I'll give you a wonderful thing.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lykus 33521-03.html">"Enchanting failed!"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lykus 33521-12.html">"I did already...! (Really?)"</Button>
</body></html>

View File

@ -1,6 +0,0 @@
<html><body>Enchant Setter Lykus:<br>
Re...really?!<br>
...Umm, actually, I don't have anything to give. That was to give you some confidence!<br>
It worked for you, and I'm happy.<br>
Confidence is everything in enchantment! Trust yourself then enchant! Ha ha ha! Luck is on your side!
</body></html>

View File

@ -1,6 +0,0 @@
<html><body>Enchanter Lykus:<br>
You brought a shield from Orbis Temple! That is a powerful shield used by the ancient heroes - very useful!<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lykus 33521-08.html">"Do you know how to use this shield?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lykus trade1">"I want to enchant it." (5000 Adena)</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lykus tradeAll">"I actually brought more than one. I want to enchant all of them." (5000 Adena per shield)</Button>
</body></html>

View File

@ -1,4 +0,0 @@
<html><body>Enchant Setter Lykus:<br>
This shield has amazing power that can push dark power away.<br>
If you do enchant, you will be able to <font color="LEVEL">defeat the power of darkness</font> that is deeply embedded into Orbis Temple or <font color="LEVEL">reflect the petrification</font> that is used.
</body></html>

View File

@ -1,5 +0,0 @@
<html><body>Enchant Setter Lykus:<br>
Here it is!<br>
You weren't worried that I would somehow break your shield, were you? There's no chance of that - I'm an expert at enchantment!<br>
As you may know, the <font color="LEVEL">Polished Ancient Hero's Shield</font> can <font color="LEVEL">defeat the power of darkness</font> or on special occasions, <font color="LEVEL">reflect the petrification</font>deep inside Orbis Temple!
</body></html>

View File

@ -1,4 +0,0 @@
<html><body>Enchant Setter Lykus:<br>
My abilities do not come cheaply! Prime prices for prime services!<br>
(You need 5000 Adena for 1 Shield)
</body></html>

View File

@ -1,4 +0,0 @@
<html><body>Enchant Setter Lykus:<br>
Are you joking with me? I cannot work on thin air!<br>
(You don't have the Orbis Ancient Hero's Shield)
</body></html>

View File

@ -1,5 +0,0 @@
<html><body>Enchant Setter Lykus:<br>
Ah, are you... serious? Ha. Hahahahaha!<br>
Someone actually did it. I apologize. I don't have anything ready, to tell you the truth. I'm really sorry....<br>
I didn't mean to make fun of you!
</body></html>

View File

@ -1,7 +0,0 @@
<html><body>Enchanter Lykus:<br>
Stronger! Harder! I am an enchant expert, name's Lykus.<br>
Would you like to use my services? <font color="LEVEL">Go for it! Then you'll get it!</font><br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lykus 33521-07.html">"I want to enchant the shield I got at Orbis Temple."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lykus 33521-01.html">"Any advice on enchantment?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lykus 33521-04.html">"Do you have any quests?"</Button>
</body></html>

View File

@ -1,94 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.AncientCityArcan.Lykus;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
import ai.AbstractNpcAI;
/**
* Lykus AI.
* @author St3eT
*/
public final class Lykus extends AbstractNpcAI
{
// NPCs
private static final int LYKUS = 33521;
// Items
private static final int POLISHED_SHIELD = 17723; // Polished Ancient Hero's Shield
private static final int OLD_SHIELD = 17724; // Orbis Ancient Hero's Shield
public Lykus()
{
addFirstTalkId(LYKUS);
addTalkId(LYKUS);
addStartNpc(LYKUS);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = null;
switch (event)
{
case "33521-01.html":
case "33521-02.html":
case "33521-03.html":
case "33521-04.html":
case "33521-05.html":
case "33521-07.html":
case "33521-08.html":
case "33521-12.html":
{
htmltext = event;
break;
}
default:
{
if (event.startsWith("trade"))
{
final int count = (int) (event.equals("trade1") ? 1 : getQuestItemsCount(player, OLD_SHIELD));
if (!hasAtLeastOneQuestItem(player, OLD_SHIELD))
{
htmltext = "33521-11.html";
}
else if (player.getAdena() < (5000 * count))
{
htmltext = "33521-10.html";
}
else
{
takeItems(player, Inventory.ADENA_ID, 5000 * count);
takeItems(player, OLD_SHIELD, count);
giveItems(player, POLISHED_SHIELD, count);
htmltext = "33521-09.html";
}
}
}
}
return htmltext;
}
public static void main(String[] args)
{
new Lykus();
}
}

View File

@ -1,5 +0,0 @@
<html><body>Mumu:<br>
Well, there's a warehouse and shops - just enter the village and turn left! Otherwise, if you turn right, you'll see people from the Elf village.<br>
The tall building here is the Arcan tower, where our brave hero, Slaski, resides!<br>
Lastly, the thing in the center of the village is the axis of this place, but recently there have been strange people appearing there, and now we can't approach because of the dark energy...
</body></html>

View File

@ -1,6 +0,0 @@
<html><body>Mumu:<br>
Welcome to Arcan! If you have questions or would like to look around, simply let me know!<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Mumu 32900-1.html">"What are the major elements here?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Mumu playMovie">"I want to look around."</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -1,65 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.AncientCityArcan.Mumu;
import com.l2jmobius.gameserver.enums.Movie;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import ai.AbstractNpcAI;
/**
* Mumu AI.
* @author St3eT
*/
public final class Mumu extends AbstractNpcAI
{
// NPC
private static final int MUMU = 32900; // Mumu
public Mumu()
{
addStartNpc(MUMU);
addFirstTalkId(MUMU);
addTalkId(MUMU);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = null;
switch (event)
{
case "32900-1.html":
{
htmltext = event;
break;
}
case "playMovie":
{
playMovie(player, Movie.SI_ARKAN_ENTER);
break;
}
}
return htmltext;
}
public static void main(String[] args)
{
new Mumu();
}
}

View File

@ -1,8 +0,0 @@
<html><body>Aden Vanguard Barton:<br>
Who are you! Identify yourself!<br>
Well, you don't look like the enemy. What brings you to this dangerous place? <br>
Have you come after hearing that the Aden Vanguard has secured strongholds in the Atelia Fortress? What? I wasn't captured. It's called infiltration. Hmph.<br>
Anyway thanks to you and your friends we were to secure this stronghold, so I should reward you.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager give_tp_st_1">"Thanks."</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -1,6 +0,0 @@
<html><body>Aden Vanguard Barton:<br>
Although this place is the closest to the entrance, you still have to face many Embryo on the way here.<br>
Elikia heard of the situation and made this Teleport Device for us. If you'll be staying for a while, it will be very useful.<br>
But I heard that it only works for 24 hours, since it's not perfect. Still, you should find it useful.<br>If you come back tomorrow, I'll prepare a new one for you.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h tutorial_close">"Thanks."</Button>
</body></html>

View File

@ -1,8 +0,0 @@
<html><body>Aden Vanguard Hayuk:<br>
Who are you! Identify yourself!<br>
Well, you don't look like the enemy. What brings you to this dangerous place? <br>
Have you come after hearing that the Aden Vanguard has secured strongholds in the Atelia Fortress? What? I wasn't captured. It's called infiltration. Hmph.<br>
Anyway thanks to you and your friends we were to secure this stronghold, so I should reward you.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager give_tp_st_2">"Thanks."</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -1,6 +0,0 @@
<html><body>Aden Vanguard Hayuk:<br>
Although this place is the closest to the entrance, you still have to face many Embryo on the way here.<br>
Elikia heard of the situation and made this Teleport Device for us. If you'll be staying for a while, it will be very useful.<br>
But I heard that it only works for 24 hours, since it's not perfect. Still, you should find it useful.<br>If you come back tomorrow, I'll prepare a new one for you.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h tutorial_close">"Thanks."</Button>
</body></html>

View File

@ -1,7 +0,0 @@
<html><body>Aden Vanguard Elise:<br>
Who are you? Oh, you are not the enemy. I'm sorry. This place is just so dangerous...<br>
What brings you here? I've come to secure this stronghold. I've just been hiding away, since the resistance of the Embryo has gotten worse.<br>
I know you've helped me here, so I'll reward you for that.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager give_tp_st_3">"Thanks."</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -1,7 +0,0 @@
<html><body>Aden Vanguard Elise:<br>
You can use this Teleport Device to teleport near this stronghold. Impressing, right?<br>
It was made by Elikia. It will be useful if you'll be staying around for a while. Here, take it.<br>
Elikia did say that the device doesn't last long. He said it lasts for 24 hours...<br>
But if you come back tomorrow, I'll have another one ready for you.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h tutorial_close">"Thanks."</Button>
</body></html>

View File

@ -1,9 +0,0 @@
<html><body>Aden Vanguard Eliyah:<br>
Who are you? Do you want to experience the wrath of my spirit?<br>
Hmm... You don't look like the enemy. Be glad. You would've been beat to death by my spirits.<br>
I'm busy protecting this stronghold. What do you want? I've been taking a break, since the Embryo are so scared of me and have been trying to escape.<br>
Well, since you helped me regain the stronghold, I'll give you a little something.<br>
Anyway thanks to you and your friends we were to secure this stronghold, so I should reward you.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager give_tp_st_4">"Thanks."</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -1,7 +0,0 @@
<html><body>Aden Vanguard Eliyah:<br>
This is a device that lets you teleport to Stronghold IV very easily.<br>
This was made by Elikia. It will be very useful if you'll be staying here for a while.<br>
Just remember that the device lasts for 24 hours, since this place is very unstable.<br>
If you need it again, come back tomorrow. I'll give you a new one.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h tutorial_close">"Thanks."</Button>
</body></html>

View File

@ -1,6 +0,0 @@
<html><body>Blackbird Clan Member Glenkinchie:<br>
Who are you? I'm Glenkinchie from the honorable Blackbird clan.<br>
Those vicious Embryos are up to something in the Atelia Fortress. They are still within our sight, but we are having a hard time infiltrating the Command Post on the 3rd floor. <br>
But I don't mind working this hard for Leona. Don't you agree?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager 34063-2.htm">"Tell me about the Command Post."</Button><Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -1,7 +0,0 @@
<html><body>Blackbird Clan Member Glenkinchie:<br>
The <font color="LEVEL">Command Post</font> is known to be the place where new soldiers are trained. We don't know what kind of soldiers they are creating, though.<br>
What we do know is that the gate opens when <font color="LEVEL">Burnstein</font> <font color="LEVEL">comes out and goes back inside the Command Post</font>. Since the gate rarely opens, it's hard for us to go inside the investigate.<br>
That's why we asked Devianne for help to hold the gate open.<br>
The only way we can get inside is by having <font color="LEVEL">Devianne</font>, who is hiding near the <font color="LEVEL">entrance to the Command Post</font>, hold the gate open when Burnstein goes back inside.<br>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -1,5 +0,0 @@
<html><body>Blackbird Clan Member Hurak:<br>
I trust Leona, but that doesn't mean I trust everyone easily.<br>
I can't believe I fell for such a simple trick. You should be careful too. Things are just getting started...<br>They've even created a command post within the fortress, so we have to put our guard up.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager 34064-2.htm">"Tell me about the Command Post."</Button><Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -1,6 +0,0 @@
<html><body>Blackbird Clan Member Hurak:<br>
The Embryo are training their new recruits in the <font color="LEVEL">Command Post</font>.
The security is so tight, that going inside is hard in itself.<br>The one way to go in is when <font color="LEVEL">Burnstein</font> comes out and <font color="LEVEL">tries to go back inside the Command Post</font>. We have our own method to do that.<br>
<font color="LEVEL">Devianne</font> is hiding near the <font color="LEVEL">entrance to the Command Post</font> on the 3rd floor, to hold the gate open whenever Burnstein goes back inside. It should be helpful when you are trying to go inside.<br>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -1,5 +0,0 @@
<html><body>Blackbird Clan Member Laffian:<br>
I trust Leona, but that doesn't mean I trust everyone easily.<br>
I can't believe I fell for such a simple trick. You should be careful too. Things are just getting started...<br>They've even created a command post within the fortress, so we have to put our guard up.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager 34065-2.htm">"Tell me about the Command Post."</Button><Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -1,6 +0,0 @@
<html><body>Blackbird Clan Member Laffian:<br>
The Embryo are training their new recruits in the <font color="LEVEL">Command Post</font>.
The security is so tight, that going inside is hard in itself.<br>The one way to go in is when <font color="LEVEL">Burnstein</font> comes out and <font color="LEVEL">tries to go back inside the Command Post</font>. We have our own method to do that.<br>
<font color="LEVEL">Devianne</font> is hiding near the <font color="LEVEL">entrance to the Command Post</font> on the 3rd floor, to hold the gate open whenever Burnstein goes back inside. It should be helpful when you are trying to go inside.<br>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -1,5 +0,0 @@
<html><body>Blackbird Clan Member Sherry:<br>
Oh! Who are you?<br>This place is dangerous!<br>
Stay away. The Embryo have built a Command Post and are increasing their power day by day.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager 34066-2.htm">"Tell me about the Command Post."</Button><Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -1,7 +0,0 @@
<html><body>Blackbird Clan Member Sherry:<br>
The <font color="LEVEL">Command Post</font> is on the <font color="LEVEL">3rd floor of the Atelia Fortress</font>. <font color="LEVEL">Burnstein</font> is the leader, and it is said that he comes out from time to time to train the new recruits.<br>
No one knows what's going on inside, and it's very difficult to go inside because you have to hold the gate when <font color="LEVEL">Commander Burnstein</font> <font color="LEVEL">goes back inside the Command Post from outside</font>.<br>
<font color="LEVEL">Devianne</font> has come all the way here, and is hiding near the <font color="LEVEL">entrance to the Command Post</font>, to hold the gate open whenever Burnstein comes and goes back in.<br>
If you are trying to go inside the Command Post, go find Devianne.<br>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -1,8 +0,0 @@
<html><body>Warehouse Keeper Julia:<br>
If you have something precious, leave it with me. I'll keep it safe at all costs.<br>
Even if this stronghold becomes dangerous, no harm shall be done to your items!<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager 34074-2.htm">Private warehouse</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager 34074-3.htm">Clan warehouse</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Link common/g_cube_warehouse001.htm"><font color="LEVEL">Wondrous Cubic</font></Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -1,7 +0,0 @@
<html><body>Warehouse Keeper Julia:<br>
<center>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_DepositP">Deposit an item. (Private Warehouse)</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_WithdrawP">Withdraw an item. (Private Warehouse)</Button><br>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Return</Button>
</center>
</body></html>

View File

@ -1,7 +0,0 @@
<html><body>Warehouse Keeper Julia:<br>
<center>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_DepositC" msg="1039">Deposit an item (Clan Warehouse)</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_WithdrawC">Withdraw an item (Clan Warehouse)</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</center>
</body></html>

View File

@ -1,8 +0,0 @@
<html><body>Warehouse Keeper Saylem:<br>
Hello! I'm Saylem.<br>
Do you have any precious freight? Hmm? If you do, then you're in the right place! We, the Steel Door guild, store customer freight for low, low prices! What's more, you can conveniently reclaim the freight anytime, anywhere. Even if this place becomes dangerous, no harm shall be done to your things.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager 34075-2.htm">Private warehouse</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager 34075-3.htm">Clan warehouse</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Link common/g_cube_warehouse001.htm"><font color="LEVEL">Wondrous Cubic</font></Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -1,7 +0,0 @@
<html><body>Warehouse Keeper Saylem:<br>
<center>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_DepositP">Deposit an item. (Private Warehouse)</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_WithdrawP">Withdraw an item. (Private Warehouse)</Button><br>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Return</Button>
</center>
</body></html>

View File

@ -1,7 +0,0 @@
<html><body>Warehouse Keeper Saylem:<br>
<center>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_DepositC" msg="1039">Deposit an item (Clan Warehouse)</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_WithdrawC">Withdraw an item (Clan Warehouse)</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</center>
</body></html>

View File

@ -1,7 +0,0 @@
<html><body>Trader Mion:<br>
I came to this dangerous place because I thought someone might need my help. If there's anything you need, come to me, okay?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Buy 3407700">"I want to trade consumables and minerals."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_exc_multisell 003">"I want to exchange equipment."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_TerritoryStatus">"Can you tell me about the local lord and tax rate?"</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -1,6 +0,0 @@
<html><body>Nika:<br>
Welcome, welcome. What can I help you find?<br>
Oh, I've seen you before. You got stuff to do here too? I came because of a request. I'll be here for a while, so come find me any time.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Buy 3407700">"I want to trade consumables and minerals."</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -1,707 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.AteliaFortress.AteliaManager;
import java.util.ArrayList;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.datatables.SpawnTable;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.model.L2Spawn;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
import com.l2jmobius.gameserver.model.skills.AbnormalType;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import ai.AbstractNpcAI;
/**
* URL https://l2wiki.com/Atelia_Fortress
* @author hlwrave, Stayway, Mobius
*/
public final class AteliaManager extends AbstractNpcAI
{
// Npc Devianne
private static final int DEVIANNE = 34089;
// Location Devianne
private static final Location DEVIANNE_LOC = new Location(-50063, 49439, -1760, 40362);
// Door Atelia Fortess Guard
private static final int GUARD = 23539;
private static final NpcStringId[] ATELIA_MSG =
{
NpcStringId.HAVE_YOU_SEEN_KELBIM_S_POWER_WE_LL_SHOW_YOU_THE_WRATH_OF_THE_EMBRYO,
NpcStringId.I_CAN_FEEL_THE_ENERGY_FROM_THE_ATELIA_FEEL_THE_POWER_OF_KELBIM,
NpcStringId.LIONA_AND_THE_LOWLY_SOLDIERS_WILL_BE_BURIED_HERE,
NpcStringId.SHOW_THEM_THE_POWER_OF_KELBIM
};
private static final SkillHolder[] ATELIA_POISON =
{
new SkillHolder(23653, 2), // Poisonous Atelia
new SkillHolder(23653, 3), // Poisonous Atelia
new SkillHolder(23653, 4), // Poisonous Atelia
};
// AI (Hummel,Geork,Burnstein) in Zone
private static final SkillHolder SUPPLY_BLOCKADE = new SkillHolder(16526, 1);
private static final SkillHolder POOR_EQUIPMENT = new SkillHolder(16542, 2);
private static final SkillHolder INDISCEPLINE = new SkillHolder(16542, 3);
// Bosses
private static final int GEORK = 23586; // Geork
private static final int BURNSTEIN = 23587; // Burnstein
private static final int HUMMEL = 23588; // Hummel
// Npcs Stronghold I
private static final int BARTON = 34059; // Barton Aden Vanguard
private static final int GLENKI = 34063; // Glenkinchie Blackbird Clan Member
// Location Stronghold I
private static final Location BARTON_LOC = new Location(-45675, 59130, -2904, 54353);
private static final Location GLENKI_LOC = new Location(-45579, 59169, -2904, 55286);
// Flag Stronghold I
private static final Location FLAG_1_LOC = new Location(-45690, 58901, -2864, 36407);
private static final Location FLAG_2_LOC = new Location(-45419, 59066, -2864, 54421);
// Npcs Stronghold II
private static final int HAYUK = 34060; // Hayuk Aden Vanguard
private static final int HURAK = 34064; // Hurak Blackbird Clan Member
// Location Stronghold II
private static final Location HURAK_LOC = new Location(-41766, 50416, -2032, 54353);//
private static final Location HAYUK_LOC = new Location(-41879, 50389, -2032, 55286);//
// Flag Stronghold II
private static final Location FLAG_3_LOC = new Location(-41962, 50182, -1988, 36407);//
private static final Location FLAG_4_LOC = new Location(-41631, 50246, -2001, 54421);//
// Npcs Stronghold III
private static final int ELISE = 34061; // Elise Aden Vanguard
private static final int LAFFIAN = 34065; // Laffian Blackbird Clan Member
// Other Stronghold III
private static final int JULIA = 34074; // Julia Warehouse Keeper
private static final int MION = 34076; // Mion Grocer
// Location Stronghold III
private static final Location ELISE_LOC = new Location(-44715, 40358, -1416, 29326);
private static final Location LAFFIAN_LOC = new Location(-44574, 40318, -1416, 28937);
private static final Location JULIA_LOC = new Location(-44603, 40202, -1416, 32350);
private static final Location MION_LOC = new Location(-44525, 40430, -1416, 22568);
// Flag Stronghold III
private static final Location FLAG_5_LOC = new Location(-44778, 40556, -1384, 22322);
private static final Location FLAG_6_LOC = new Location(-44860, 40254, -1376, 23239);
// Npcs Stronghold IV
private static final int ELIYAH = 34062; // Eliyah Aden Vanguard
private static final int SHERRY = 34066; // Sherry Blackbird Clan Member
// Other Stronghold IV
private static final int SAYLEM = 34075; // Saylem Warehouse Keeper
private static final int NIKA = 34077; // Nika Grocer
// Location Stronghold IV
private static final Location ELIYAH_LOC = new Location(-58480, 44000, -1552, 25300);
private static final Location SHERRY_LOC = new Location(-58395, 43905, -1552, 28798);
private static final Location SAYLEM_LOC = new Location(-58327, 43957, -1552, 25179);
private static final Location NIKA_LOC = new Location(-58450, 43843, -1552, 32767);
// Flag Stronghold IV
private static final Location FLAG_7_LOC = new Location(-58449, 44207, -1512, 20327);
private static final Location FLAG_8_LOC = new Location(-58693, 43986, -1520, 17904);
// Stages (Floors)
private static final int[] FLOOR_MOBS =
{
23505,
23506,
23507,
23508,
23509,
23510,
23511,
23512
};
private static final int[] ALERT =
{
23595,
23596,
23597,
23598,
23599,
23600,
23601,
23602
};
// Skills Stages
private static final int[] ATELIA_CURSE =
{
23506,
23508,
23511,
23512
};
// PART OF BOSS AI
private static final int[] SB_GROUP =
{
23505,
23506,
23507,
23508,
23509,
23510,
23511,
23512
};
static final int[][] FORTESS_SPY =
{
{
23589,
-41659,
44081,
-1448,
0
},
{
23589,
-50091,
48822,
-1760,
0
},
{
23589,
-49263,
50204,
-2400,
0
},
{
23589,
-48556,
45595,
-1768,
0
},
{
23589,
-44548,
58729,
-2928,
0
},
{
23589,
-44636,
45261,
-1528,
0
},
{
23589,
-45055,
44769,
-1544,
0
},
{
23589,
-45729,
41010,
-1512,
0
},
{
23589,
-46178,
49001,
-2400,
0
},
{
23589,
-46466,
56947,
-3184,
0
},
{
23589,
-46619,
43794,
-1560,
0
},
{
23589,
-46814,
50187,
-2376,
0
},
{
23589,
-47309,
55932,
-3184,
0
},
{
23589,
-47470,
52576,
-2392,
0
},
{
23589,
-47503,
58967,
-3192,
0
},
{
23589,
-47815,
51378,
-2400,
0
},
{
23589,
-48077,
55335,
-3160,
0
},
{
23589,
-43866,
47379,
-2048,
0
},
{
23589,
-43866,
47379,
-2048,
0
}
};
// Infusers
private static final int INFUSER_1 = 23537;
private static final int INFUSER_2 = 23538;
// Static Npcs
private static final int FLAG = 19594; // Stronghold Flag
// Items
private static final int TPST_1 = 46146; // Atelia Fortress Stronghold I Teleport Device
private static final int TPST_2 = 46147; // Atelia Fortress Stronghold II Teleport Device
private static final int TPST_3 = 46148; // Atelia Fortress Stronghold III Teleport Device
private static final int TPST_4 = 46149; // Atelia Fortress Stronghold VI Teleport Device
// Misc
private static int _killCount = 0;
// Other
private static final int DESPAWN = 1800000; // Time 30 Min
private static final int SBCANCEL = 3600000; // Time 1 Hour
private static final int DDESPAWN = 10800000; // Time 3 Hour
static ArrayList<L2Npc> FortessSpawns = new ArrayList<>();
private AteliaManager()
{
addStartNpc(BARTON, GLENKI, HAYUK, HURAK, ELISE, LAFFIAN, JULIA, MION, ELIYAH, SHERRY, SAYLEM, NIKA);
addFirstTalkId(BARTON, GLENKI, HAYUK, HURAK, ELISE, LAFFIAN, JULIA, MION, ELIYAH, SHERRY, SAYLEM, NIKA);
addTalkId(BARTON, GLENKI, HAYUK, HURAK, ELISE, LAFFIAN, JULIA, MION, ELIYAH, SHERRY, SAYLEM, NIKA);
addKillId(FLOOR_MOBS);
addKillId(ALERT);
addKillId(GEORK, BURNSTEIN, HUMMEL, GUARD, INFUSER_1, INFUSER_2);
addSpawnId(BARTON, GLENKI, FLAG, HAYUK, HURAK);
addSpawnId(ELISE, LAFFIAN, JULIA, MION);
addSpawnId(ELIYAH, SHERRY, SAYLEM, NIKA);
addSpawnId(HUMMEL, GEORK, BURNSTEIN, DEVIANNE);
addSpawnId(SB_GROUP);
addAttackId(ATELIA_CURSE);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = null;
switch (event)
{
case "34059-1.htm":
case "34060-1.htm":
case "34061-1.htm":
case "34062-1.htm":
case "34063-1.htm":
case "34063-2.htm":
case "34064-1.htm":
case "34064-2.htm":
case "34065-1.htm":
case "34065-2.htm":
case "34066-1.htm":
case "34066-2.htm":
case "34074-1.htm":
case "34074-2.htm":
case "34074-3.htm":
case "34075-1.htm":
case "34075-2.htm":
case "34075-3.htm":
case "34076-1.htm":
case "34077-1.htm":
{
htmltext = event;
break;
}
case "give_tp_st_1":
{
if (!hasQuestItems(player, TPST_1))
{
giveItems(player, TPST_1, 1);
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
else
{
htmltext = "34059-2.htm"; // fix
}
break;
}
case "give_tp_st_2":
{
if (!hasQuestItems(player, TPST_2))
{
giveItems(player, TPST_2, 1);
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
else
{
htmltext = "34060-2.htm"; // todo off html text
}
break;
}
case "give_tp_st_3":
{
if (!hasQuestItems(player, TPST_3))
{
giveItems(player, TPST_3, 1);
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
else
{
htmltext = "34061-2.htm"; // fix
}
break;
}
case "give_tp_st_4":
{
if (!hasQuestItems(player, TPST_4))
{
giveItems(player, TPST_4, 1);
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
else
{
htmltext = "34062-2.htm"; // fix
}
break;
}
// Stronghold's
case "SH_1":
{
if (npc == null)
{
addSpawn(BARTON, BARTON_LOC, false, DESPAWN);
addSpawn(GLENKI, GLENKI_LOC, false, DESPAWN);
addSpawn(FLAG, FLAG_1_LOC, false, DESPAWN);
addSpawn(FLAG, FLAG_2_LOC, false, DESPAWN);
}
break;
}
case "SH_2":
{
if (npc == null)
{
addSpawn(HAYUK, HAYUK_LOC, false, DESPAWN);
addSpawn(HURAK, HURAK_LOC, false, DESPAWN);
addSpawn(FLAG, FLAG_3_LOC, false, DESPAWN);
addSpawn(FLAG, FLAG_4_LOC, false, DESPAWN);
}
break;
}
case "SH_3":
{
if (npc == null)
{
addSpawn(ELISE, ELISE_LOC, false, DESPAWN);
addSpawn(LAFFIAN, LAFFIAN_LOC, false, DESPAWN);
addSpawn(JULIA, JULIA_LOC, false, DESPAWN);
addSpawn(MION, MION_LOC, false, DESPAWN);
addSpawn(FLAG, FLAG_5_LOC, false, DESPAWN);
addSpawn(FLAG, FLAG_6_LOC, false, DESPAWN);
}
break;
}
case "SH_4":
{
if (npc == null)
{
addSpawn(ELIYAH, ELIYAH_LOC, false, DESPAWN);
addSpawn(SHERRY, SHERRY_LOC, false, DESPAWN);
addSpawn(SAYLEM, SAYLEM_LOC, false, DESPAWN);
addSpawn(NIKA, NIKA_LOC, false, DESPAWN);
addSpawn(FLAG, FLAG_7_LOC, false, DESPAWN);
addSpawn(FLAG, FLAG_8_LOC, false, DESPAWN);
}
break;
}
case "SB_1":
{
for (int sb : SB_GROUP)
{
for (L2Spawn spawn : SpawnTable.getInstance().getSpawns(sb))
{
for (L2Npc monster : spawn.getSpawnedNpcs())
{
if ((monster.getZ() <= -2759) && (monster.getZ() >= -3246))
{
monster.setTarget(monster);
monster.doCast(SUPPLY_BLOCKADE.getSkill());
}
}
}
}
break;
}
case "SB_2":
{
for (int sb : SB_GROUP)
{
for (L2Spawn spawn : SpawnTable.getInstance().getSpawns(sb))
{
for (L2Npc monster : spawn.getSpawnedNpcs())
{
if ((monster.getZ() <= -2020) && (monster.getZ() >= -2759))
{
monster.setTarget(monster);
monster.doCast(POOR_EQUIPMENT.getSkill());
}
}
}
}
break;
}
case "SB_3":
{
for (int sb : SB_GROUP)
{
for (L2Spawn spawn : SpawnTable.getInstance().getSpawns(sb))
{
for (L2Npc monster : spawn.getSpawnedNpcs())
{
if ((monster.getZ() <= -1477) && (monster.getZ() >= -2212)) // need correct!
{
monster.setTarget(monster);
monster.doCast(INDISCEPLINE.getSkill());
}
}
}
}
break;
}
case "SB_1_C":
{
for (int sb : SB_GROUP)
{
for (L2Spawn spawn : SpawnTable.getInstance().getSpawns(sb))
{
for (L2Npc monster : spawn.getSpawnedNpcs())
{
monster.getEffectList().stopSkillEffects(true, AbnormalType.ALL_ATTACK_DOWN);
monster.stopSkillEffects(true, 16526);
}
}
}
break;
}
case "SB_2_C":
{
for (int sb : SB_GROUP)
{
for (L2Spawn spawn : SpawnTable.getInstance().getSpawns(sb))
{
for (L2Npc monster : spawn.getSpawnedNpcs())
{
monster.getEffectList().stopSkillEffects(true, AbnormalType.MAX_HP_DOWN);
monster.stopSkillEffects(true, 16542);
}
}
}
break;
}
case "SB_3_C":
{
for (int sb : SB_GROUP)
{
for (L2Spawn spawn : SpawnTable.getInstance().getSpawns(sb))
{
for (L2Npc monster : spawn.getSpawnedNpcs())
{
monster.getEffectList().stopSkillEffects(true, AbnormalType.MAX_HP_DOWN);
monster.stopSkillEffects(true, 16542);
}
}
}
break;
}
case "SPY_CLEAR":
{
for (L2Npc spawn : FortessSpawns)
{
if (spawn != null)
{
spawn.deleteMe();
}
}
FortessSpawns.clear();
break;
}
case "SPY_SPAWN":
{
for (int[] spawn : FORTESS_SPY)
{
FortessSpawns.add(addSpawn(spawn[0], spawn[1], spawn[2], spawn[3], spawn[4], false, 0, false, 0));
}
break;
}
case "DOOR_CLOSE":
{
_killCount = 0;
closeDoor(18190002, 0);
closeDoor(18190004, 0);
break;
}
case "ALERT":
{
final int rnd = getRandom(3, 4);
for (int i = 0; i < rnd; i++)
{
final L2Npc alert = addSpawn(ALERT[i], npc.getX() + 10, npc.getY() + 10, npc.getZ() + 10, npc.getHeading(), false, 0, false);
alert.setTitle("On Alert Stage 1");
addAttackDesire(alert, player);
}
break;
}
}
return htmltext;
}
@Override
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
{
final int chance = getRandom(1000);
if (CommonUtil.contains(ATELIA_CURSE, npc.getId()))
{
if (!npc.isCastingNow() && (chance <= 20))
{
npc.setTarget(attacker);
npc.doCast(ATELIA_POISON[getRandom(ATELIA_POISON.length)].getSkill());
}
}
else if (CommonUtil.contains(FLOOR_MOBS, npc.getId()) && (chance > 90))
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), ATELIA_MSG[getRandom(1)]));
}
return super.onAttack(npc, attacker, damage, isSummon);
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
if ((npc.getZ() <= -2804) && (npc.getZ() >= -2999) && (npc.getId() == INFUSER_1))
{
startQuestTimer("SH_1", 100, null, null);
}
if ((npc.getZ() <= -2029) && (npc.getZ() >= -2050) && (npc.getId() == INFUSER_1))
{
startQuestTimer("SH_2", 100, null, null);
}
if ((npc.getZ() <= -1419) && (npc.getZ() >= -1520) && (npc.getId() == INFUSER_2))
{
startQuestTimer("SH_3", 100, null, null);
}
if ((npc.getZ() <= -1552) && (npc.getZ() >= -1580) && (npc.getId() == INFUSER_2))
{
startQuestTimer("SH_4", 100, null, null);
}
if (npc.getId() == GUARD)
{
_killCount++;
if (_killCount == 2)
{
openDoor(18190002, 0);
openDoor(18190004, 0);
startQuestTimer("DOOR_CLOSE", SBCANCEL, npc, killer);
}
}
else if (npc.getId() == HUMMEL)
{
startQuestTimer("SB_1", 100, npc, killer);
}
else if (npc.getId() == GEORK)
{
startQuestTimer("SB_2", 100, npc, killer);
}
else if (npc.getId() == BURNSTEIN)
{
addSpawn(DEVIANNE, DEVIANNE_LOC, false, DDESPAWN);
startQuestTimer("SPY_CLEAR", 100, npc, null);
startQuestTimer("SB_3", 100, npc, killer);
}
else if (CommonUtil.contains(FLOOR_MOBS, npc.getId()) && (getRandom(100) <= 6))
{
startQuestTimer("ALERT", 100, npc, killer);
}
return super.onKill(npc, killer, isSummon);
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
return npc.getId() + "-1.htm";
}
@Override
public String onSpawn(L2Npc npc)
{
switch (npc.getId())
{
case HUMMEL:
{
startQuestTimer("SB_1_C", 100, npc, null);
break;
}
case GEORK:
{
startQuestTimer("SB_2_C", 100, npc, null);
break;
}
case BURNSTEIN:
{
startQuestTimer("SB_3_C", 100, npc, null);
startQuestTimer("SPY_SPAWN", 100, npc, null);
break;
}
}
return super.onSpawn(npc);
}
public static void main(String[] args)
{
new AteliaManager();
}
}

View File

@ -1,125 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.BeastFarm;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.L2Summon;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.events.EventType;
import com.l2jmobius.gameserver.model.events.ListenerRegisterType;
import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
import com.l2jmobius.gameserver.model.events.annotations.RegisterType;
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLogout;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
import com.l2jmobius.gameserver.model.skills.SkillCaster;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import ai.AbstractNpcAI;
/**
* Baby Pets AI.
* @author St3eT
*/
public final class BabyPets extends AbstractNpcAI
{
// NPCs
private static final int[] BABY_PETS =
{
12780, // Baby Buffalo
12781, // Baby Kookaburra
12782, // Baby Cougar
};
// Skills
private static final int HEAL_1 = 4717; // Heal Trick
private static final int HEAL_2 = 4718; // Greater Heal Trick
private BabyPets()
{
addSummonSpawnId(BABY_PETS);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("HEAL") && (player != null))
{
final L2Summon summon = player.getPet();
if (summon != null)
{
if (getRandom(100) <= 25)
{
castHeal(summon, new SkillHolder(HEAL_1, getHealLv(summon)), 80);
}
if (getRandom(100) <= 75)
{
castHeal(summon, new SkillHolder(HEAL_2, getHealLv(summon)), 15);
}
}
else
{
cancelQuestTimer("HEAL", null, player);
}
}
return super.onAdvEvent(event, npc, player);
}
@RegisterEvent(EventType.ON_PLAYER_LOGOUT)
@RegisterType(ListenerRegisterType.GLOBAL)
public void OnPlayerLogout(OnPlayerLogout event)
{
cancelQuestTimer("HEAL", null, event.getActiveChar());
}
@Override
public void onSummonSpawn(L2Summon summon)
{
startQuestTimer("HEAL", 5000, null, summon.getOwner(), true);
}
private int getHealLv(L2Summon summon)
{
final int summonLv = summon.getLevel();
return CommonUtil.constrain(summonLv < 70 ? (summonLv / 10) : (7 + ((summonLv - 70) / 5)), 1, 12);
}
private void castHeal(L2Summon summon, SkillHolder skill, int maxHpPer)
{
final boolean previousFollowStatus = summon.getFollowStatus();
final L2PcInstance owner = summon.getOwner();
if (!owner.isDead() && (((owner.getCurrentHp() / owner.getMaxHp()) * 100) < maxHpPer) && !summon.isHungry() && SkillCaster.checkUseConditions(summon, skill.getSkill()))
{
summon.getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, skill.getSkill(), owner);
summon.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_PET_USES_S1).addSkillName(skill.getSkill()));
if (previousFollowStatus != summon.getFollowStatus())
{
summon.setFollowStatus(previousFollowStatus);
}
}
}
public static void main(String[] args)
{
new BabyPets();
}
}

View File

@ -1,481 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.BeastFarm;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2TamedBeastInstance;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.serverpackets.NpcInfo;
import ai.AbstractNpcAI;
import quests.Q00020_BringUpWithLove.Q00020_BringUpWithLove;
/**
* Growth-capable mobs: Polymorphing upon successful feeding.<br>
* Updated to Freya.
* @author Fulminus, Gigiikun
*/
public final class BeastFarm extends AbstractNpcAI
{
private static final int GOLDEN_SPICE = 15474;
private static final int CRYSTAL_SPICE = 15475;
private static final int SKILL_GOLDEN_SPICE = 9049;
private static final int SKILL_CRYSTAL_SPICE = 9050;
private static final int SKILL_BLESSED_GOLDEN_SPICE = 9051;
private static final int SKILL_BLESSED_CRYSTAL_SPICE = 9052;
private static final int SKILL_SGRADE_GOLDEN_SPICE = 9053;
private static final int SKILL_SGRADE_CRYSTAL_SPICE = 9054;
private static final int[] TAMED_BEASTS =
{
18869,
18870,
18871,
18872
};
private static final int TAME_CHANCE = 20;
protected static final int[] SPECIAL_SPICE_CHANCES =
{
33,
75
};
// all mobs that can eat...
private static final int[] FEEDABLE_BEASTS =
{
// Kookaburras
18873,
18874,
18875,
18876,
18877,
18878,
18879,
// Cougars
18880,
18881,
18882,
18883,
18884,
18885,
18886,
// Buffalos
18887,
18888,
18889,
18890,
18891,
18892,
18893,
// Grendels
18894,
18895,
18896,
18897,
18898,
18899,
18900
};
private static Map<Integer, GrowthCapableMob> GROWTH_CAPABLE_MOBS = new HashMap<>();
private static List<TamedBeast> TAMED_BEAST_DATA = new ArrayList<>();
private final Map<Integer, Integer> _feedInfo = new ConcurrentHashMap<>();
private BeastFarm()
{
addSkillSeeId(FEEDABLE_BEASTS);
addKillId(FEEDABLE_BEASTS);
GrowthCapableMob temp;
// Kookabura
temp = new GrowthCapableMob(100, 0, 18869);
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18874);
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18875);
temp.addNpcIdForSkillId(SKILL_BLESSED_GOLDEN_SPICE, 18869);
temp.addNpcIdForSkillId(SKILL_BLESSED_CRYSTAL_SPICE, 18869);
temp.addNpcIdForSkillId(SKILL_SGRADE_GOLDEN_SPICE, 18878);
temp.addNpcIdForSkillId(SKILL_SGRADE_CRYSTAL_SPICE, 18879);
GROWTH_CAPABLE_MOBS.put(18873, temp);
temp = new GrowthCapableMob(40, 1, 18869);
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18876);
GROWTH_CAPABLE_MOBS.put(18874, temp);
temp = new GrowthCapableMob(40, 1, 18869);
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18877);
GROWTH_CAPABLE_MOBS.put(18875, temp);
temp = new GrowthCapableMob(25, 2, 18869);
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18878);
GROWTH_CAPABLE_MOBS.put(18876, temp);
temp = new GrowthCapableMob(25, 2, 18869);
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18879);
GROWTH_CAPABLE_MOBS.put(18877, temp);
// Cougar
temp = new GrowthCapableMob(100, 0, 18870);
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18881);
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18882);
temp.addNpcIdForSkillId(SKILL_BLESSED_GOLDEN_SPICE, 18870);
temp.addNpcIdForSkillId(SKILL_BLESSED_CRYSTAL_SPICE, 18870);
temp.addNpcIdForSkillId(SKILL_SGRADE_GOLDEN_SPICE, 18885);
temp.addNpcIdForSkillId(SKILL_SGRADE_CRYSTAL_SPICE, 18886);
GROWTH_CAPABLE_MOBS.put(18880, temp);
temp = new GrowthCapableMob(40, 1, 18870);
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18883);
GROWTH_CAPABLE_MOBS.put(18881, temp);
temp = new GrowthCapableMob(40, 1, 18870);
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18884);
GROWTH_CAPABLE_MOBS.put(18882, temp);
temp = new GrowthCapableMob(25, 2, 18870);
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18885);
GROWTH_CAPABLE_MOBS.put(18883, temp);
temp = new GrowthCapableMob(25, 2, 18870);
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18886);
GROWTH_CAPABLE_MOBS.put(18884, temp);
// Buffalo
temp = new GrowthCapableMob(100, 0, 18871);
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18888);
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18889);
temp.addNpcIdForSkillId(SKILL_BLESSED_GOLDEN_SPICE, 18871);
temp.addNpcIdForSkillId(SKILL_BLESSED_CRYSTAL_SPICE, 18871);
temp.addNpcIdForSkillId(SKILL_SGRADE_GOLDEN_SPICE, 18892);
temp.addNpcIdForSkillId(SKILL_SGRADE_CRYSTAL_SPICE, 18893);
GROWTH_CAPABLE_MOBS.put(18887, temp);
temp = new GrowthCapableMob(40, 1, 18871);
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18890);
GROWTH_CAPABLE_MOBS.put(18888, temp);
temp = new GrowthCapableMob(40, 1, 18871);
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18891);
GROWTH_CAPABLE_MOBS.put(18889, temp);
temp = new GrowthCapableMob(25, 2, 18871);
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18892);
GROWTH_CAPABLE_MOBS.put(18890, temp);
temp = new GrowthCapableMob(25, 2, 18871);
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18893);
GROWTH_CAPABLE_MOBS.put(18891, temp);
// Grendel
temp = new GrowthCapableMob(100, 0, 18872);
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18895);
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18896);
temp.addNpcIdForSkillId(SKILL_BLESSED_GOLDEN_SPICE, 18872);
temp.addNpcIdForSkillId(SKILL_BLESSED_CRYSTAL_SPICE, 18872);
temp.addNpcIdForSkillId(SKILL_SGRADE_GOLDEN_SPICE, 18899);
temp.addNpcIdForSkillId(SKILL_SGRADE_CRYSTAL_SPICE, 18900);
GROWTH_CAPABLE_MOBS.put(18894, temp);
temp = new GrowthCapableMob(40, 1, 18872);
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18897);
GROWTH_CAPABLE_MOBS.put(18895, temp);
temp = new GrowthCapableMob(40, 1, 18872);
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18898);
GROWTH_CAPABLE_MOBS.put(18896, temp);
temp = new GrowthCapableMob(25, 2, 18872);
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18899);
GROWTH_CAPABLE_MOBS.put(18897, temp);
temp = new GrowthCapableMob(25, 2, 18872);
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18900);
GROWTH_CAPABLE_MOBS.put(18898, temp);
// Tamed beasts data
TAMED_BEAST_DATA.add(new TamedBeast("%name% of Focus", new SkillHolder(6432, 1), new SkillHolder(6668, 1)));
TAMED_BEAST_DATA.add(new TamedBeast("%name% of Guiding", new SkillHolder(6433, 1), new SkillHolder(6670, 1)));
TAMED_BEAST_DATA.add(new TamedBeast("%name% of Swifth", new SkillHolder(6434, 1), new SkillHolder(6667, 1)));
TAMED_BEAST_DATA.add(new TamedBeast("Berserker %name%", new SkillHolder(6671, 1)));
TAMED_BEAST_DATA.add(new TamedBeast("%name% of Protect", new SkillHolder(6669, 1), new SkillHolder(6672, 1)));
TAMED_BEAST_DATA.add(new TamedBeast("%name% of Vigor", new SkillHolder(6431, 1), new SkillHolder(6666, 1)));
}
public void spawnNext(L2Npc npc, L2PcInstance player, int nextNpcId, int food)
{
// remove the feedinfo of the mob that got despawned, if any
if (_feedInfo.containsKey(npc.getObjectId()))
{
if (_feedInfo.get(npc.getObjectId()) == player.getObjectId())
{
_feedInfo.remove(npc.getObjectId());
}
}
// despawn the old mob
// TODO: same code? FIXED?
/*
* if (_GrowthCapableMobs.get(npc.getNpcId()).getGrowthLevel() == 0) { npc.deleteMe(); } else {
*/
npc.deleteMe();
// }
// if this is finally a trained mob, then despawn any other trained mobs that the
// player might have and initialize the Tamed Beast.
if (CommonUtil.contains(TAMED_BEASTS, nextNpcId))
{
final L2TamedBeastInstance nextNpc = new L2TamedBeastInstance(nextNpcId, player, food, npc.getX(), npc.getY(), npc.getZ(), true);
final TamedBeast beast = TAMED_BEAST_DATA.get(getRandom(TAMED_BEAST_DATA.size()));
String name = beast.getName();
switch (nextNpcId)
{
case 18869:
name = name.replace("%name%", "Alpine Kookaburra");
break;
case 18870:
name = name.replace("%name%", "Alpine Cougar");
break;
case 18871:
name = name.replace("%name%", "Alpine Buffalo");
break;
case 18872:
name = name.replace("%name%", "Alpine Grendel");
break;
}
nextNpc.setName(name);
nextNpc.broadcastPacket(new NpcInfo(nextNpc));
nextNpc.setRunning();
final SkillData st = SkillData.getInstance();
for (SkillHolder sh : beast.getSkills())
{
nextNpc.addBeastSkill(st.getSkill(sh.getSkillId(), sh.getSkillLevel()));
}
Q00020_BringUpWithLove.checkJewelOfInnocence(player);
}
else
{
// if not trained, the newly spawned mob will automatically be agro against its feeder
// (what happened to "never bite the hand that feeds you" anyway?!)
final L2Attackable nextNpc = (L2Attackable) addSpawn(nextNpcId, npc);
// register the player in the feedinfo for the mob that just spawned
_feedInfo.put(nextNpc.getObjectId(), player.getObjectId());
nextNpc.setRunning();
nextNpc.addDamageHate(player, 0, 99999);
nextNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
player.setTarget(nextNpc);
}
}
@Override
public String onSkillSee(L2Npc npc, L2PcInstance caster, Skill skill, L2Object[] targets, boolean isSummon)
{
// this behavior is only run when the target of skill is the passed npc (chest)
// i.e. when the player is attempting to open the chest using a skill
if (!CommonUtil.contains(targets, npc))
{
return super.onSkillSee(npc, caster, skill, targets, isSummon);
}
// gather some values on local variables
final int npcId = npc.getId();
final int skillId = skill.getId();
// check if the npc and skills used are valid for this script. Exit if invalid.
if (!CommonUtil.contains(FEEDABLE_BEASTS, npcId) || ((skillId != SKILL_GOLDEN_SPICE) && (skillId != SKILL_CRYSTAL_SPICE) && (skillId != SKILL_BLESSED_GOLDEN_SPICE) && (skillId != SKILL_BLESSED_CRYSTAL_SPICE) && (skillId != SKILL_SGRADE_GOLDEN_SPICE) && (skillId != SKILL_SGRADE_CRYSTAL_SPICE)))
{
return super.onSkillSee(npc, caster, skill, targets, isSummon);
}
// first gather some values on local variables
final int objectId = npc.getObjectId();
int growthLevel = 3; // if a mob is in FEEDABLE_BEASTS but not in _GrowthCapableMobs, then it's at max growth (3)
if (GROWTH_CAPABLE_MOBS.containsKey(npcId))
{
growthLevel = GROWTH_CAPABLE_MOBS.get(npcId).getGrowthLevel();
}
// prevent exploit which allows 2 players to simultaneously raise the same 0-growth beast
// If the mob is at 0th level (when it still listens to all feeders) lock it to the first feeder!
if ((growthLevel == 0) && _feedInfo.containsKey(objectId))
{
return super.onSkillSee(npc, caster, skill, targets, isSummon);
}
_feedInfo.put(objectId, caster.getObjectId());
// display the social action of the beast eating the food.
npc.broadcastSocialAction(2);
int food = 0;
if ((skillId == SKILL_GOLDEN_SPICE) || (skillId == SKILL_BLESSED_GOLDEN_SPICE))
{
food = GOLDEN_SPICE;
}
else if ((skillId == SKILL_CRYSTAL_SPICE) || (skillId == SKILL_BLESSED_CRYSTAL_SPICE))
{
food = CRYSTAL_SPICE;
}
// if this pet can't grow, it's all done.
if (GROWTH_CAPABLE_MOBS.containsKey(npcId))
{
// do nothing if this mob doesn't eat the specified food (food gets consumed but has no effect).
final int newNpcId = GROWTH_CAPABLE_MOBS.get(npcId).getLeveledNpcId(skillId);
if (newNpcId == -1)
{
if (growthLevel == 0)
{
_feedInfo.remove(objectId);
npc.setRunning();
((L2Attackable) npc).addDamageHate(caster, 0, 1);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, caster);
}
return super.onSkillSee(npc, caster, skill, targets, isSummon);
}
else if ((growthLevel > 0) && (_feedInfo.get(objectId) != caster.getObjectId()))
{
// check if this is the same player as the one who raised it from growth 0.
// if no, then do not allow a chance to raise the pet (food gets consumed but has no effect).
return super.onSkillSee(npc, caster, skill, targets, isSummon);
}
spawnNext(npc, caster, newNpcId, food);
}
else
{
caster.sendMessage("The beast spit out the feed instead of eating it.");
npc.dropItem(caster, food, 1);
}
return super.onSkillSee(npc, caster, skill, targets, isSummon);
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
// remove the feedinfo of the mob that got killed, if any
if (_feedInfo.containsKey(npc.getObjectId()))
{
_feedInfo.remove(npc.getObjectId());
}
return super.onKill(npc, killer, isSummon);
}
// all mobs that grow by eating
private static class GrowthCapableMob
{
private final int _chance;
private final int _growthLevel;
private final int _tameNpcId;
private final Map<Integer, Integer> _skillSuccessNpcIdList = new ConcurrentHashMap<>();
public GrowthCapableMob(int chance, int growthLevel, int tameNpcId)
{
_chance = chance;
_growthLevel = growthLevel;
_tameNpcId = tameNpcId;
}
public void addNpcIdForSkillId(int skillId, int npcId)
{
_skillSuccessNpcIdList.put(skillId, npcId);
}
public int getGrowthLevel()
{
return _growthLevel;
}
public int getLeveledNpcId(int skillId)
{
if (!_skillSuccessNpcIdList.containsKey(skillId))
{
return -1;
}
else if ((skillId == SKILL_BLESSED_GOLDEN_SPICE) || (skillId == SKILL_BLESSED_CRYSTAL_SPICE) || (skillId == SKILL_SGRADE_GOLDEN_SPICE) || (skillId == SKILL_SGRADE_CRYSTAL_SPICE))
{
if (getRandom(100) < SPECIAL_SPICE_CHANCES[0])
{
if (getRandom(100) < SPECIAL_SPICE_CHANCES[1])
{
return _skillSuccessNpcIdList.get(skillId);
}
else if ((skillId == SKILL_BLESSED_GOLDEN_SPICE) || (skillId == SKILL_SGRADE_GOLDEN_SPICE))
{
return _skillSuccessNpcIdList.get(SKILL_GOLDEN_SPICE);
}
else
{
return _skillSuccessNpcIdList.get(SKILL_CRYSTAL_SPICE);
}
}
return -1;
}
else if ((_growthLevel == 2) && (getRandom(100) < TAME_CHANCE))
{
return _tameNpcId;
}
else if (getRandom(100) < _chance)
{
return _skillSuccessNpcIdList.get(skillId);
}
else
{
return -1;
}
}
}
private static class TamedBeast
{
private final String name;
private final SkillHolder[] sh;
public TamedBeast(String beastName, SkillHolder... holders)
{
name = beastName;
sh = holders;
}
public String getName()
{
return name;
}
public SkillHolder[] getSkills()
{
return sh;
}
}
public static void main(String[] args)
{
new BeastFarm();
}
}

View File

@ -1,610 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.BeastFarm;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2TamedBeastInstance;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
import quests.Q00020_BringUpWithLove.Q00020_BringUpWithLove;
/**
* Growth-capable mobs: Polymorphing upon successful feeding.
* @author Fulminus
*/
public final class FeedableBeasts extends AbstractNpcAI
{
private static final int GOLDEN_SPICE = 6643;
private static final int CRYSTAL_SPICE = 6644;
private static final int SKILL_GOLDEN_SPICE = 2188;
private static final int SKILL_CRYSTAL_SPICE = 2189;
private static final int FOODSKILLDIFF = GOLDEN_SPICE - SKILL_GOLDEN_SPICE;
// Tamed Wild Beasts
private static final int TRAINED_BUFFALO1 = 16013;
private static final int TRAINED_BUFFALO2 = 16014;
private static final int TRAINED_COUGAR1 = 16015;
private static final int TRAINED_COUGAR2 = 16016;
private static final int TRAINED_KOOKABURRA1 = 16017;
private static final int TRAINED_KOOKABURRA2 = 16018;
// private static final int TRAINED_TINY_BABY_BUFFALO = 16020; // TODO: Implement.
// private static final int TRAINED_TINY_BABY_COUGAR = 16022; // TODO: Implement.
// private static final int TRAINED_TINY_BABY_KOOKABURRA = 16024; // TODO: Implement.
// @formatter:off
private static final int[] TAMED_BEASTS =
{
TRAINED_BUFFALO1, TRAINED_BUFFALO2, TRAINED_COUGAR1, TRAINED_COUGAR2, TRAINED_KOOKABURRA1, TRAINED_KOOKABURRA2
};
// all mobs that can eat...
private static final int[] FEEDABLE_BEASTS =
{
21451, 21452, 21453, 21454, 21455, 21456, 21457, 21458, 21459, 21460,
21461, 21462, 21463, 21464, 21465, 21466, 21467, 21468, 21469, 21470,
21471, 21472, 21473, 21474, 21475, 21476, 21477, 21478, 21479, 21480,
21481, 21482, 21483, 21484, 21485, 21486, 21487, 21488, 21489, 21490,
21491, 21492, 21493, 21494, 21495, 21496, 21497, 21498, 21499, 21500,
21501, 21502, 21503, 21504, 21505, 21506, 21507, 21824, 21825, 21826,
21827, 21828, 21829, TRAINED_BUFFALO1, TRAINED_BUFFALO2, TRAINED_COUGAR1, TRAINED_COUGAR2, TRAINED_KOOKABURRA1, TRAINED_KOOKABURRA2
};
// @formatter:on
private static final Map<Integer, Integer> MAD_COW_POLYMORPH = new HashMap<>(6);
static
{
MAD_COW_POLYMORPH.put(21824, 21468);
MAD_COW_POLYMORPH.put(21825, 21469);
MAD_COW_POLYMORPH.put(21826, 21487);
MAD_COW_POLYMORPH.put(21827, 21488);
MAD_COW_POLYMORPH.put(21828, 21506);
MAD_COW_POLYMORPH.put(21829, 21507);
}
private static final NpcStringId[][] TEXT =
{
{
NpcStringId.WHAT_DID_YOU_JUST_DO_TO_ME,
NpcStringId.ARE_YOU_TRYING_TO_TAME_ME_DON_T_DO_THAT,
NpcStringId.DON_T_GIVE_SUCH_A_THING_YOU_CAN_ENDANGER_YOURSELF,
NpcStringId.YUCK_WHAT_IS_THIS_IT_TASTES_TERRIBLE,
NpcStringId.I_M_HUNGRY_GIVE_ME_A_LITTLE_MORE_PLEASE,
NpcStringId.WHAT_IS_THIS_IS_THIS_EDIBLE,
NpcStringId.DON_T_WORRY_ABOUT_ME,
NpcStringId.THANK_YOU_THAT_WAS_DELICIOUS,
NpcStringId.I_THINK_I_AM_STARTING_TO_LIKE_YOU,
NpcStringId.EEEEEK_EEEEEK
},
{
NpcStringId.DON_T_KEEP_TRYING_TO_TAME_ME_I_DON_T_WANT_TO_BE_TAMED,
NpcStringId.IT_IS_JUST_FOOD_TO_ME_ALTHOUGH_IT_MAY_ALSO_BE_YOUR_HAND,
NpcStringId.IF_I_KEEP_EATING_LIKE_THIS_WON_T_I_BECOME_FAT_CHOMP_CHOMP,
NpcStringId.WHY_DO_YOU_KEEP_FEEDING_ME,
NpcStringId.DON_T_TRUST_ME_I_M_AFRAID_I_MAY_BETRAY_YOU_LATER
},
{
NpcStringId.GRRRRR,
NpcStringId.YOU_BROUGHT_THIS_UPON_YOURSELF,
NpcStringId.I_FEEL_STRANGE_I_KEEP_HAVING_THESE_EVIL_THOUGHTS,
NpcStringId.ALAS_SO_THIS_IS_HOW_IT_ALL_ENDS,
NpcStringId.I_DON_T_FEEL_SO_GOOD_OH_MY_MIND_IS_VERY_TROUBLED
}
};
private static final NpcStringId[] TAMED_TEXT =
{
NpcStringId.S1_SO_WHAT_DO_YOU_THINK_IT_IS_LIKE_TO_BE_TAMED,
NpcStringId.S1_WHENEVER_I_SEE_SPICE_I_THINK_I_WILL_MISS_YOUR_HAND_THAT_USED_TO_FEED_IT_TO_ME,
NpcStringId.S1_DON_T_GO_TO_THE_VILLAGE_I_DON_T_HAVE_THE_STRENGTH_TO_FOLLOW_YOU,
NpcStringId.THANK_YOU_FOR_TRUSTING_ME_S1_I_HOPE_I_WILL_BE_HELPFUL_TO_YOU,
NpcStringId.S1_WILL_I_BE_ABLE_TO_HELP_YOU,
NpcStringId.I_GUESS_IT_S_JUST_MY_ANIMAL_MAGNETISM,
NpcStringId.TOO_MUCH_SPICY_FOOD_MAKES_ME_SWEAT_LIKE_A_BEAST,
NpcStringId.ANIMALS_NEED_LOVE_TOO
};
private final Map<Integer, Integer> _feedInfo = new ConcurrentHashMap<>();
private static Map<Integer, GrowthCapableMob> GROWTH_CAPABLE_MOBS = new HashMap<>();
// all mobs that grow by eating
private static class GrowthCapableMob
{
private final int _growthLevel;
private final int _chance;
private final Map<Integer, int[][]> _spiceToMob = new ConcurrentHashMap<>();
public GrowthCapableMob(int growthLevel, int chance)
{
_growthLevel = growthLevel;
_chance = chance;
}
public void addMobs(int spice, int[][] Mobs)
{
_spiceToMob.put(spice, Mobs);
}
public Integer getMob(int spice, int mobType, int classType)
{
if (_spiceToMob.containsKey(spice))
{
return _spiceToMob.get(spice)[mobType][classType];
}
return null;
}
public Integer getRandomMob(int spice)
{
int[][] temp;
temp = _spiceToMob.get(spice);
final int rand = getRandom(temp[0].length);
return temp[0][rand];
}
public Integer getChance()
{
return _chance;
}
public Integer getGrowthLevel()
{
return _growthLevel;
}
}
private FeedableBeasts()
{
addKillId(FEEDABLE_BEASTS);
addSkillSeeId(FEEDABLE_BEASTS);
// TODO: no grendels?
GrowthCapableMob temp;
//@formatter:off
final int[][] Kookabura_0_Gold = {{ 21452, 21453, 21454, 21455 }};
final int[][] Kookabura_0_Crystal = {{ 21456, 21457, 21458, 21459 }};
final int[][] Kookabura_1_Gold_1= {{ 21460, 21462 }};
final int[][] Kookabura_1_Gold_2 = {{ 21461, 21463 }};
final int[][] Kookabura_1_Crystal_1 = {{ 21464, 21466 }};
final int[][] Kookabura_1_Crystal_2 = {{ 21465, 21467 }};
final int[][] Kookabura_2_1 = {{ 21468, 21824}, { TRAINED_KOOKABURRA1, TRAINED_KOOKABURRA2 }};
final int[][] Kookabura_2_2 = {{ 21469, 21825}, { TRAINED_KOOKABURRA1, TRAINED_KOOKABURRA2 }};
final int[][] Buffalo_0_Gold = {{ 21471, 21472, 21473, 21474 }};
final int[][] Buffalo_0_Crystal = {{ 21475, 21476, 21477, 21478 }};
final int[][] Buffalo_1_Gold_1 = {{ 21479, 21481 }};
final int[][] Buffalo_1_Gold_2 = {{ 21481, 21482 }};
final int[][] Buffalo_1_Crystal_1 = {{ 21483, 21485 }};
final int[][] Buffalo_1_Crystal_2 = {{ 21484, 21486 }};
final int[][] Buffalo_2_1 = {{ 21487, 21826}, {TRAINED_BUFFALO1, TRAINED_BUFFALO2 }};
final int[][] Buffalo_2_2 = {{ 21488, 21827}, {TRAINED_BUFFALO1, TRAINED_BUFFALO2 }};
final int[][] Cougar_0_Gold = {{ 21490, 21491, 21492, 21493 }};
final int[][] Cougar_0_Crystal = {{ 21494, 21495, 21496, 21497 }};
final int[][] Cougar_1_Gold_1 = {{ 21498, 21500 }};
final int[][] Cougar_1_Gold_2 = {{ 21499, 21501 }};
final int[][] Cougar_1_Crystal_1 = {{ 21502, 21504 }};
final int[][] Cougar_1_Crystal_2 = {{ 21503, 21505 }};
final int[][] Cougar_2_1 = {{ 21506, 21828 }, { TRAINED_COUGAR1, TRAINED_COUGAR2 }};
final int[][] Cougar_2_2 = {{ 21507, 21829 }, { TRAINED_COUGAR1, TRAINED_COUGAR2 }};
//@formatter:on
// Alpen Kookabura
temp = new GrowthCapableMob(0, 100);
temp.addMobs(GOLDEN_SPICE, Kookabura_0_Gold);
temp.addMobs(CRYSTAL_SPICE, Kookabura_0_Crystal);
GROWTH_CAPABLE_MOBS.put(21451, temp);
temp = new GrowthCapableMob(1, 40);
temp.addMobs(GOLDEN_SPICE, Kookabura_1_Gold_1);
GROWTH_CAPABLE_MOBS.put(21452, temp);
GROWTH_CAPABLE_MOBS.put(21454, temp);
temp = new GrowthCapableMob(1, 40);
temp.addMobs(GOLDEN_SPICE, Kookabura_1_Gold_2);
GROWTH_CAPABLE_MOBS.put(21453, temp);
GROWTH_CAPABLE_MOBS.put(21455, temp);
temp = new GrowthCapableMob(1, 40);
temp.addMobs(CRYSTAL_SPICE, Kookabura_1_Crystal_1);
GROWTH_CAPABLE_MOBS.put(21456, temp);
GROWTH_CAPABLE_MOBS.put(21458, temp);
temp = new GrowthCapableMob(1, 40);
temp.addMobs(CRYSTAL_SPICE, Kookabura_1_Crystal_2);
GROWTH_CAPABLE_MOBS.put(21457, temp);
GROWTH_CAPABLE_MOBS.put(21459, temp);
temp = new GrowthCapableMob(2, 25);
temp.addMobs(GOLDEN_SPICE, Kookabura_2_1);
GROWTH_CAPABLE_MOBS.put(21460, temp);
GROWTH_CAPABLE_MOBS.put(21462, temp);
temp = new GrowthCapableMob(2, 25);
temp.addMobs(GOLDEN_SPICE, Kookabura_2_2);
GROWTH_CAPABLE_MOBS.put(21461, temp);
GROWTH_CAPABLE_MOBS.put(21463, temp);
temp = new GrowthCapableMob(2, 25);
temp.addMobs(CRYSTAL_SPICE, Kookabura_2_1);
GROWTH_CAPABLE_MOBS.put(21464, temp);
GROWTH_CAPABLE_MOBS.put(21466, temp);
temp = new GrowthCapableMob(2, 25);
temp.addMobs(CRYSTAL_SPICE, Kookabura_2_2);
GROWTH_CAPABLE_MOBS.put(21465, temp);
GROWTH_CAPABLE_MOBS.put(21467, temp);
// Alpen Buffalo
temp = new GrowthCapableMob(0, 100);
temp.addMobs(GOLDEN_SPICE, Buffalo_0_Gold);
temp.addMobs(CRYSTAL_SPICE, Buffalo_0_Crystal);
GROWTH_CAPABLE_MOBS.put(21470, temp);
temp = new GrowthCapableMob(1, 40);
temp.addMobs(GOLDEN_SPICE, Buffalo_1_Gold_1);
GROWTH_CAPABLE_MOBS.put(21471, temp);
GROWTH_CAPABLE_MOBS.put(21473, temp);
temp = new GrowthCapableMob(1, 40);
temp.addMobs(GOLDEN_SPICE, Buffalo_1_Gold_2);
GROWTH_CAPABLE_MOBS.put(21472, temp);
GROWTH_CAPABLE_MOBS.put(21474, temp);
temp = new GrowthCapableMob(1, 40);
temp.addMobs(CRYSTAL_SPICE, Buffalo_1_Crystal_1);
GROWTH_CAPABLE_MOBS.put(21475, temp);
GROWTH_CAPABLE_MOBS.put(21477, temp);
temp = new GrowthCapableMob(1, 40);
temp.addMobs(CRYSTAL_SPICE, Buffalo_1_Crystal_2);
GROWTH_CAPABLE_MOBS.put(21476, temp);
GROWTH_CAPABLE_MOBS.put(21478, temp);
temp = new GrowthCapableMob(2, 25);
temp.addMobs(GOLDEN_SPICE, Buffalo_2_1);
GROWTH_CAPABLE_MOBS.put(21479, temp);
GROWTH_CAPABLE_MOBS.put(21481, temp);
temp = new GrowthCapableMob(2, 25);
temp.addMobs(GOLDEN_SPICE, Buffalo_2_2);
GROWTH_CAPABLE_MOBS.put(21480, temp);
GROWTH_CAPABLE_MOBS.put(21482, temp);
temp = new GrowthCapableMob(2, 25);
temp.addMobs(CRYSTAL_SPICE, Buffalo_2_1);
GROWTH_CAPABLE_MOBS.put(21483, temp);
GROWTH_CAPABLE_MOBS.put(21485, temp);
temp = new GrowthCapableMob(2, 25);
temp.addMobs(CRYSTAL_SPICE, Buffalo_2_2);
GROWTH_CAPABLE_MOBS.put(21484, temp);
GROWTH_CAPABLE_MOBS.put(21486, temp);
// Alpen Cougar
temp = new GrowthCapableMob(0, 100);
temp.addMobs(GOLDEN_SPICE, Cougar_0_Gold);
temp.addMobs(CRYSTAL_SPICE, Cougar_0_Crystal);
GROWTH_CAPABLE_MOBS.put(21489, temp);
temp = new GrowthCapableMob(1, 40);
temp.addMobs(GOLDEN_SPICE, Cougar_1_Gold_1);
GROWTH_CAPABLE_MOBS.put(21490, temp);
GROWTH_CAPABLE_MOBS.put(21492, temp);
temp = new GrowthCapableMob(1, 40);
temp.addMobs(GOLDEN_SPICE, Cougar_1_Gold_2);
GROWTH_CAPABLE_MOBS.put(21491, temp);
GROWTH_CAPABLE_MOBS.put(21493, temp);
temp = new GrowthCapableMob(1, 40);
temp.addMobs(CRYSTAL_SPICE, Cougar_1_Crystal_1);
GROWTH_CAPABLE_MOBS.put(21494, temp);
GROWTH_CAPABLE_MOBS.put(21496, temp);
temp = new GrowthCapableMob(1, 40);
temp.addMobs(CRYSTAL_SPICE, Cougar_1_Crystal_2);
GROWTH_CAPABLE_MOBS.put(21495, temp);
GROWTH_CAPABLE_MOBS.put(21497, temp);
temp = new GrowthCapableMob(2, 25);
temp.addMobs(GOLDEN_SPICE, Cougar_2_1);
GROWTH_CAPABLE_MOBS.put(21498, temp);
GROWTH_CAPABLE_MOBS.put(21500, temp);
temp = new GrowthCapableMob(2, 25);
temp.addMobs(GOLDEN_SPICE, Cougar_2_2);
GROWTH_CAPABLE_MOBS.put(21499, temp);
GROWTH_CAPABLE_MOBS.put(21501, temp);
temp = new GrowthCapableMob(2, 25);
temp.addMobs(CRYSTAL_SPICE, Cougar_2_1);
GROWTH_CAPABLE_MOBS.put(21502, temp);
GROWTH_CAPABLE_MOBS.put(21504, temp);
temp = new GrowthCapableMob(2, 25);
temp.addMobs(CRYSTAL_SPICE, Cougar_2_2);
GROWTH_CAPABLE_MOBS.put(21503, temp);
GROWTH_CAPABLE_MOBS.put(21505, temp);
}
private void spawnNext(L2Npc npc, int growthLevel, L2PcInstance player, int food)
{
final int npcId = npc.getId();
int nextNpcId = 0;
// find the next mob to spawn, based on the current npcId, growthlevel, and food.
if (growthLevel == 2)
{
// if tamed, the mob that will spawn depends on the class type (fighter/mage) of the player!
if (getRandom(2) == 0)
{
if (player.getClassId().isMage())
{
nextNpcId = GROWTH_CAPABLE_MOBS.get(npcId).getMob(food, 1, 1);
}
else
{
nextNpcId = GROWTH_CAPABLE_MOBS.get(npcId).getMob(food, 1, 0);
}
}
else
{
// if not tamed, there is a small chance that have "mad cow" disease.
// that is a stronger-than-normal animal that attacks its feeder
if (getRandom(5) == 0)
{
nextNpcId = GROWTH_CAPABLE_MOBS.get(npcId).getMob(food, 0, 1);
}
else
{
nextNpcId = GROWTH_CAPABLE_MOBS.get(npcId).getMob(food, 0, 0);
}
}
}
else
{
// all other levels of growth are straight-forward
nextNpcId = GROWTH_CAPABLE_MOBS.get(npcId).getRandomMob(food);
}
// remove the feedinfo of the mob that got despawned, if any
if (_feedInfo.containsKey(npc.getObjectId()))
{
if (_feedInfo.get(npc.getObjectId()) == player.getObjectId())
{
_feedInfo.remove(npc.getObjectId());
}
}
// despawn the old mob
// TODO: same code? FIXED?
// @formatter:off
/*
* if (_GrowthCapableMobs.get(npcId).getGrowthLevel() == 0)
{
npc.deleteMe();
}
else
{
*/
npc.deleteMe();
// }
// @formatter:on
// if this is finally a trained mob, then despawn any other trained mobs that the
// player might have and initialize the Tamed Beast.
if (CommonUtil.contains(TAMED_BEASTS, nextNpcId))
{
if ((player.getTrainedBeasts() != null) && !player.getTrainedBeasts().isEmpty())
{
for (L2TamedBeastInstance oldTrained : player.getTrainedBeasts())
{
oldTrained.deleteMe();
}
}
final L2TamedBeastInstance nextNpc = new L2TamedBeastInstance(nextNpcId, player, food - FOODSKILLDIFF, npc.getX(), npc.getY(), npc.getZ());
nextNpc.setRunning();
Q00020_BringUpWithLove.checkJewelOfInnocence(player);
// Support for A Grand Plan for Taming Wild Beasts (655) quest.
// Q00655_AGrandPlanForTamingWildBeasts.reward(player, nextNpc); TODO: Replace me?
// also, perform a rare random chat
if (getRandom(20) == 0)
{
final NpcStringId message = NpcStringId.getNpcStringId(getRandom(2024, 2029));
npc.broadcastSay(ChatType.NPC_GENERAL, message, message.getParamCount() > 0 ? player.getName() : null);
}
// @formatter:off
/*
TODO: The tamed beast consumes one golden/crystal spice
every 60 seconds with an initial delay of 60 seconds
if (tamed beast exists and is alive)
{
if (player has 1+ golden/crystal spice)
{
take one golden/crystal spice;
say random NpcString(getRandom(2029, 2038));
}
}
*/
// @formatter:on
}
else
{
// if not trained, the newly spawned mob will automatically be aggro against its feeder
// (what happened to "never bite the hand that feeds you" anyway?!)
final L2Attackable nextNpc = (L2Attackable) addSpawn(nextNpcId, npc);
if (MAD_COW_POLYMORPH.containsKey(nextNpcId))
{
startQuestTimer("polymorph Mad Cow", 10000, nextNpc, player);
}
// register the player in the feedinfo for the mob that just spawned
_feedInfo.put(nextNpc.getObjectId(), player.getObjectId());
nextNpc.setRunning();
nextNpc.addDamageHate(player, 0, 99999);
nextNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
}
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equalsIgnoreCase("polymorph Mad Cow") && (npc != null) && (player != null))
{
if (MAD_COW_POLYMORPH.containsKey(npc.getId()))
{
// remove the feed info from the previous mob
if (_feedInfo.get(npc.getObjectId()) == player.getObjectId())
{
_feedInfo.remove(npc.getObjectId());
}
// despawn the mad cow
npc.deleteMe();
// spawn the new mob
final L2Attackable nextNpc = (L2Attackable) addSpawn(MAD_COW_POLYMORPH.get(npc.getId()), npc);
// register the player in the feedinfo for the mob that just spawned
_feedInfo.put(nextNpc.getObjectId(), player.getObjectId());
nextNpc.setRunning();
nextNpc.addDamageHate(player, 0, 99999);
nextNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
}
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onSkillSee(L2Npc npc, L2PcInstance caster, Skill skill, L2Object[] targets, boolean isSummon)
{
// this behavior is only run when the target of skill is the passed npc (chest)
// i.e. when the player is attempting to open the chest using a skill
if (!CommonUtil.contains(targets, npc))
{
return super.onSkillSee(npc, caster, skill, targets, isSummon);
}
// gather some values on local variables
final int npcId = npc.getId();
final int skillId = skill.getId();
// check if the npc and skills used are valid for this script. Exit if invalid.
if ((skillId != SKILL_GOLDEN_SPICE) && (skillId != SKILL_CRYSTAL_SPICE))
{
return super.onSkillSee(npc, caster, skill, targets, isSummon);
}
// first gather some values on local variables
final int objectId = npc.getObjectId();
int growthLevel = 3; // if a mob is in FEEDABLE_BEASTS but not in _GrowthCapableMobs, then it's at max growth (3)
if (GROWTH_CAPABLE_MOBS.containsKey(npcId))
{
growthLevel = GROWTH_CAPABLE_MOBS.get(npcId).getGrowthLevel();
}
// prevent exploit which allows 2 players to simultaneously raise the same 0-growth beast
// If the mob is at 0th level (when it still listens to all feeders) lock it to the first feeder!
if ((growthLevel == 0) && _feedInfo.containsKey(objectId))
{
return super.onSkillSee(npc, caster, skill, targets, isSummon);
}
_feedInfo.put(objectId, caster.getObjectId());
int food = 0;
if (skillId == SKILL_GOLDEN_SPICE)
{
food = GOLDEN_SPICE;
}
else if (skillId == SKILL_CRYSTAL_SPICE)
{
food = CRYSTAL_SPICE;
}
// display the social action of the beast eating the food.
npc.broadcastSocialAction(2);
// if this pet can't grow, it's all done.
if (GROWTH_CAPABLE_MOBS.containsKey(npcId))
{
// do nothing if this mob doesn't eat the specified food (food gets consumed but has no effect).
if (GROWTH_CAPABLE_MOBS.get(npcId).getMob(food, 0, 0) == null)
{
return super.onSkillSee(npc, caster, skill, targets, isSummon);
}
// rare random talk...
if (getRandom(20) == 0)
{
final NpcStringId message = TEXT[growthLevel][getRandom(TEXT[growthLevel].length)];
npc.broadcastSay(ChatType.NPC_GENERAL, message, message.getParamCount() > 0 ? caster.getName() : null);
}
if ((growthLevel > 0) && (_feedInfo.get(objectId) != caster.getObjectId()))
{
// check if this is the same player as the one who raised it from growth 0.
// if no, then do not allow a chance to raise the pet (food gets consumed but has no effect).
return super.onSkillSee(npc, caster, skill, targets, isSummon);
}
// Polymorph the mob, with a certain chance, given its current growth level
if (getRandom(100) < GROWTH_CAPABLE_MOBS.get(npcId).getChance())
{
spawnNext(npc, growthLevel, caster, food);
}
}
else if (CommonUtil.contains(TAMED_BEASTS, npcId) && (npc instanceof L2TamedBeastInstance))
{
final L2TamedBeastInstance beast = ((L2TamedBeastInstance) npc);
if (skillId == beast.getFoodType())
{
beast.onReceiveFood();
final NpcStringId message = TAMED_TEXT[getRandom(TAMED_TEXT.length)];
npc.broadcastSay(ChatType.NPC_GENERAL, message, message.getParamCount() > 0 ? caster.getName() : null);
}
}
return super.onSkillSee(npc, caster, skill, targets, isSummon);
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
// remove the feedinfo of the mob that got killed, if any
if (_feedInfo.containsKey(npc.getObjectId()))
{
_feedInfo.remove(npc.getObjectId());
}
return super.onKill(npc, killer, isSummon);
}
public static void main(String[] args)
{
new FeedableBeasts();
}
}

View File

@ -1,211 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.BeastFarm;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.L2Summon;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.events.EventType;
import com.l2jmobius.gameserver.model.events.ListenerRegisterType;
import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
import com.l2jmobius.gameserver.model.events.annotations.RegisterType;
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLogout;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
import com.l2jmobius.gameserver.model.skills.SkillCaster;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import ai.AbstractNpcAI;
/**
* Improved Baby Pets AI.
* @author St3eT
*/
public final class ImprovedBabyPets extends AbstractNpcAI
{
// NPCs
private static final int[] BABY_PETS =
{
16034, // Improved Baby Buffalo
16035, // Improved Baby Kookaburra
16036, // Improved Baby Cougar
};
// Skills
private static final int PET_CONTROL = 5771;
private ImprovedBabyPets()
{
addSummonSpawnId(BABY_PETS);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (player != null)
{
final L2Summon summon = player.getPet();
if (summon == null)
{
cancelQuestTimer("HEAL", null, player);
cancelQuestTimer("BUFF", null, player);
}
else if (event.equals("HEAL") && player.isInCombat() && !summon.isHungry())
{
final double hpPer = (player.getCurrentHp() / player.getMaxHp()) * 100;
final double mpPer = (player.getCurrentMp() / player.getMaxMp()) * 100;
final int healType = summon.getTemplate().getParameters().getInt("heal_type", 0);
final int skillLv = (int) Math.floor((summon.getLevel() / 5) - 11);
if (healType == 1)
{
final int stepLv = CommonUtil.constrain(skillLv, 0, 3);
if ((hpPer >= 30) && (hpPer < 70))
{
castHeal(summon, stepLv, 1);
}
else if (hpPer < 30)
{
castHeal(summon, stepLv, 2);
}
}
else if (healType == 0)
{
if (hpPer < 30)
{
castHeal(summon, CommonUtil.constrain(skillLv, 0, 3), 2);
}
else if (mpPer < 60)
{
castHeal(summon, CommonUtil.constrain(skillLv, 0, 5), 1);
}
}
}
else if (event.equals("BUFF") && !summon.isAffectedBySkill(PET_CONTROL) && !summon.isHungry())
{
final int buffStep = (int) CommonUtil.constrain(Math.floor((summon.getLevel() / 5) - 11), 0, 3);
for (int i = 1; i <= (2 * (1 + buffStep)); i++)
{
if (castBuff(summon, buffStep, i))
{
break;
}
}
}
}
return super.onAdvEvent(event, npc, player);
}
@Override
public void onSummonSpawn(L2Summon summon)
{
startQuestTimer("HEAL", 5000, null, summon.getOwner(), true);
startQuestTimer("BUFF", 10000, null, summon.getOwner(), true);
}
@RegisterEvent(EventType.ON_PLAYER_LOGOUT)
@RegisterType(ListenerRegisterType.GLOBAL)
public void OnPlayerLogout(OnPlayerLogout event)
{
cancelQuestTimer("HEAL", null, event.getActiveChar());
cancelQuestTimer("BUFF", null, event.getActiveChar());
}
private boolean castBuff(L2Summon summon, int stepNumber, int buffNumber)
{
final L2PcInstance owner = summon.getOwner();
final StatsSet parameters = summon.getTemplate().getParameters();
final SkillHolder skill = parameters.getObject("step" + stepNumber + "_buff0" + buffNumber, SkillHolder.class);
if ((skill != null) && (owner != null))
{
final boolean previousFollowStatus = summon.getFollowStatus();
final SkillHolder mergedSkill = parameters.getObject("step" + stepNumber + "_merged_buff0" + buffNumber, SkillHolder.class);
final int targetType = parameters.getInt("step" + stepNumber + "_buff_target0" + buffNumber, 0);
if (!owner.hasAbnormalType(skill.getSkill().getAbnormalType()) && SkillCaster.checkUseConditions(summon, skill.getSkill()) && !owner.isDead())
{
if (mergedSkill != null)
{
if (owner.hasAbnormalType(mergedSkill.getSkill().getAbnormalType()))
{
return false;
}
}
if (!previousFollowStatus && !summon.isInsideRadius(owner, skill.getSkill().getCastRange(), true, true))
{
return false;
}
if ((targetType >= 0) && (targetType <= 2))
{
summon.getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, skill.getSkill(), (targetType == 1) ? summon : owner);
summon.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_PET_USES_S1).addSkillName(skill.getSkill()));
if (previousFollowStatus != summon.getFollowStatus())
{
summon.setFollowStatus(previousFollowStatus);
}
return true;
}
}
}
return false;
}
private void castHeal(L2Summon summon, int stepNumber, int healNumber)
{
final boolean previousFollowStatus = summon.getFollowStatus();
final L2PcInstance owner = summon.getOwner();
final StatsSet parameters = summon.getTemplate().getParameters();
final SkillHolder skill = parameters.getObject("step" + stepNumber + "_heal0" + healNumber, SkillHolder.class);
final int targetType = parameters.getInt("step" + stepNumber + "_heal_target0" + healNumber, 0);
if ((skill != null) && (owner != null) && SkillCaster.checkUseConditions(summon, skill.getSkill()) && !owner.isDead())
{
if (!previousFollowStatus && !summon.isInsideRadius(owner, skill.getSkill().getCastRange(), true, true))
{
return;
}
if (!owner.hasAbnormalType(skill.getSkill().getAbnormalType()))
{
if ((targetType >= 0) && (targetType <= 2))
{
summon.getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, skill.getSkill(), (targetType == 1) ? summon : owner);
summon.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_PET_USES_S1).addSkillName(skill.getSkill()));
if (previousFollowStatus != summon.getFollowStatus())
{
summon.setFollowStatus(previousFollowStatus);
}
}
}
}
}
public static void main(String[] args)
{
new ImprovedBabyPets();
}
}

View File

@ -1,4 +0,0 @@
<html><body>Beast Herder Tunatun:<br>
You wanted a Whip? Don't you already have one?<br>
If you don't, I can give you one again. Unfortunately, if you already have one, I can't give you another. Resources are pretty limited out here, I'm sure you can understand.
</body></html>

View File

@ -1,5 +0,0 @@
<html><body>Beast Herder Tunatun:<br>
You...? You don't look that strong. Raising beasts is not an easy thing.<br>
It could be really dangerious if something goes wrong. It's OK when they are young, but it becomes too dangerous for you to handle when they're are fully grown up.<br>
Maybe it would be better for you to come back again when you become a little more stronger. Then, I will gladly give you this Beast Handler's Whip.
</body></html>

View File

@ -1,6 +0,0 @@
<html><body>Beast Herder Tunatun:<br>
Are you interested in Beast Training? I'll give you a Handler's Whip.<br>
You didn't forget about Beast Training techniques, did you? If you want, I can tell you about them again.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Tunatun 31537-04.html">Listen to the explanation on training techniques</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Tunatun 31537-06.html">Decline, as you already know about them</Button>
</body></html>

View File

@ -1,5 +0,0 @@
<html><body>Beast Herder Tunatun:<br>
In order to give orders to the beasts, you need this Whip.<br>
One beast used to be our limit, but thanks to the Beast Handler's Whip, it isn't a problem controlling more.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Tunatun 31537-05.html">Go on</Button>
</body></html>

View File

@ -1,3 +0,0 @@
<html><body>Beast Herder Tunatun:<br>
Look for Feed Sellers in this area like the one standing next to me. The feed you buy from them can be given to <font color="LEVEL">Alpine Buffalo, Alpine Grendel, Alpine Kookaburra, and Alpine Buffalo</font>. The more feed you give each beast, the more they'll grow.<br>Remember though, tamed beasts will run away if you run out of feed to give them. So be careful.
</body></html>

View File

@ -1,3 +0,0 @@
<html><body>Beast Herder Tunatun:<br>
Oh, I see. I hope you will get a good result.
</body></html>

View File

@ -1,5 +0,0 @@
<html><body>Beast Herder Tunatun:<br>
Hi! Welcome to the Beast Farm. My name is Tunatun and I'm the one in charge here. I got this job because I thought I'd be able to commune with the beasts. After all, my pet kitty back home absolutely loved me. On this farm though, it's not so easy.<br>As a matter of fact, I'm having a lot of trouble with these beasts. They tend to fight back if you try to feed or tame them, so I've hired a Feed Seller and various adventurers to help me manage and protect the farm. At this point, there's not much else I can do.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Tunatun whip">Take the Beast Handler's Whip</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -1,88 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.BeastFarm.Tunatun;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import ai.AbstractNpcAI;
/**
* Beast Herder Tunatun AI.
* @author Adry_85
*/
public final class Tunatun extends AbstractNpcAI
{
// NPC
private static final int TUNATUN = 31537;
// Item
private static final int BEAST_HANDLERS_WHIP = 15473;
// Misc
private static final int MIN_LEVEL = 82;
private Tunatun()
{
addStartNpc(TUNATUN);
addFirstTalkId(TUNATUN);
addTalkId(TUNATUN);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = getNoQuestMsg(player);
switch (event)
{
case "31537-04.html":
case "31537-05.html":
case "31537-06.html":
{
htmltext = event;
break;
}
case "whip":
{
{
if (!hasQuestItems(player, BEAST_HANDLERS_WHIP))
{
if (player.getLevel() >= MIN_LEVEL)
{
giveItems(player, BEAST_HANDLERS_WHIP, 1);
htmltext = "31537-03.html";
}
else
{
htmltext = "31537-02.html";
}
}
else
{
htmltext = "31537-01.html";
}
}
break;
}
}
return htmltext;
}
public static void main(String[] args)
{
new Tunatun();
}
}

View File

@ -1,53 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.BloodySwampland;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import ai.AbstractNpcAI;
/**
* Bloody Swampland AI.
* @author St3eT
*/
public final class BloodySwampland extends AbstractNpcAI
{
// NPCs
private static final int COLLECTOR = 23171; // Corpse Collector
public BloodySwampland()
{
addAttackId(COLLECTOR);
}
@Override
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
{
if (npc.isScriptValue(0) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.3)))
{
addSkillCastDesire(npc, attacker, npc.getParameters().getSkillHolder("Skill01_ID"), 23);
npc.setScriptValue(1);
}
return super.onAttack(npc, attacker, damage, isSummon);
}
public static void main(String[] args)
{
new BloodySwampland();
}
}

View File

@ -1,4 +0,0 @@
<html><body>Alarm System:<br>
As the alarm rings, a window for the passcode pops up. On the screen you see the number 120, which begins counting down. It looks like the alarm system will be activated in about 2 minutes unless the passcode is successfully entered.<br>
<a action="bypass -h Quest Alarm 2">Enter the passcode.</a>
</body></html>

View File

@ -1,4 +0,0 @@
<html><body>Alarm System:<br>
The alarm is ringing loudly. You should leave here immediately.<br>
(Another person has already undertaken the quest.)
</body></html>

View File

@ -1,42 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode :|<br>
########################<br>
The first number is...
<table border="0" border color="white" width="65" height="65">
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">1</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">2</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 3">3</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">4</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">5</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">6</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">7</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">8</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">9</a>
</td>
</tr>
</table>
</body></html>

View File

@ -1,42 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode : *|<br>
########################<br>
The second number is...
<table border="0" border color="white" width="65" height="65">
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 4">1</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">2</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">3</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">4</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">5</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">6</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">7</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">8</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">9</a>
</td>
</tr>
</table>
</body></html>

View File

@ -1,42 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode : **|<br>
########################<br>
The third number is...
<table border="0" border color="white" width="65" height="65">
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">1</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">2</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">3</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">4</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">5</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">6</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">7</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">8</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 5">9</a>
</td>
</tr>
</table>
</body></html>

View File

@ -1,43 +0,0 @@
<html><body>
Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode : ***|<br>
########################<br>
The fourth number is...
<table border="0" border color="white" width="65" height="65">
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">1</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">2</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">3</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">4</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">5</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">6</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">7</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">8</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">9</a>
</td>
</tr>
</table>
</body></html>

View File

@ -1,7 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode : ****<br>
########################<br>
Validation completed. Alarm has been disabled.
</body></html>

View File

@ -1,9 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode : ****<br>
########################<br>
Validation has failed. <br>
<br>
<a action="bypass -h Quest Alarm 2">Re-enter passcode.</a>
</body></html>

View File

@ -1,42 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode :|<br>
########################<br>
The first number is...
<table border="0" border color="white" width="65" height="65">
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">1</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">2</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 3">3</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">4</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">5</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">6</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">7</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">8</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">9</a>
</td>
</tr>
</table>
</body></html>

View File

@ -1,43 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode : *|<br>
########################<br>
The second number is...
<table border="0" border color="white" width="65" height="65">
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 4">1</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">2</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">3</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">4</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">5</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">6</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">7</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">8</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">9</a>
</td>
</tr>
</table>
</body></html>

View File

@ -1,41 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode : **|<br>
########################<br>
The third number is...
<table border="0" border color="white" width="65" height="65">
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">1</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">2</a>
</td> <td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">3</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">4</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">5</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">6</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">7</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">8</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 5">9</a>
</td>
</tr>
</table>
</body></html>

View File

@ -1,42 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode : ***| <br>
########################<br>
The fourth number is...
<table border="0" border color="white" width="65" height="65">
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">1</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">2</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">3</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">4</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">5</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">6</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">7</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">8</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">9</a>
</td>
</tr>
</table>
</body></html>

View File

@ -1,7 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode : **** <br>
########################<br>
Validation completed. Alarm has been disabled.
</body></html>

View File

@ -1,8 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter passcode for communication.<br>
Passcode : **** <br>########################<br>
Validation has failed.<br>
<br>
<a action="bypass -h Quest Alarm 2">Re-enter passcode.</a>
</body></html>

View File

@ -1,356 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.CrumaTower.Alarm;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
import quests.Q00184_ArtOfPersuasion.Q00184_ArtOfPersuasion;
import quests.Q00185_NikolasCooperation.Q00185_NikolasCooperation;
/**
* Alarm AI for quests Art of Persuasion (184) and Nikola's Cooperation (185).
* @author Zoey76
*/
public final class Alarm extends AbstractNpcAI
{
// NPC
private static final int ALARM = 32367;
// Misc
private static final int ART_OF_PERSUASION_ID = 184;
private static final int NIKOLAS_COOPERATION_ID = 185;
private Alarm()
{
addStartNpc(ALARM);
addTalkId(ALARM);
addFirstTalkId(ALARM);
addSpawnId(ALARM);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = null;
final L2PcInstance player0 = npc.getVariables().getObject("player0", L2PcInstance.class);
final L2Npc npc0 = npc.getVariables().getObject("npc0", L2Npc.class);
switch (event)
{
case "SELF_DESTRUCT_IN_60":
{
startQuestTimer("SELF_DESTRUCT_IN_30", 30000, npc, null);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_60_SECONDS_ENTER_PASSCODE_TO_OVERRIDE);
break;
}
case "SELF_DESTRUCT_IN_30":
{
startQuestTimer("SELF_DESTRUCT_IN_10", 20000, npc, null);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_30_SECONDS_ENTER_PASSCODE_TO_OVERRIDE);
break;
}
case "SELF_DESTRUCT_IN_10":
{
startQuestTimer("RECORDER_CRUSHED", 10000, npc, null);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_10_SECONDS_ENTER_PASSCODE_TO_OVERRIDE);
break;
}
case "RECORDER_CRUSHED":
{
if (npc0 != null)
{
if (npc0.getVariables().getBoolean("SPAWNED"))
{
npc0.getVariables().set("SPAWNED", false);
if (player0 != null)
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.RECORDER_CRUSHED);
if (verifyMemoState(player0, ART_OF_PERSUASION_ID, -1))
{
setMemoState(player0, ART_OF_PERSUASION_ID, 5);
}
else if (verifyMemoState(player0, NIKOLAS_COOPERATION_ID, -1))
{
setMemoState(player0, NIKOLAS_COOPERATION_ID, 5);
}
}
}
}
npc.deleteMe();
break;
}
case "32367-184_04.html":
case "32367-184_06.html":
case "32367-184_08.html":
{
htmltext = event;
break;
}
case "2":
{
if (player0 == player)
{
if (verifyMemoState(player, ART_OF_PERSUASION_ID, 3))
{
htmltext = "32367-184_02.html";
}
else if (verifyMemoState(player, NIKOLAS_COOPERATION_ID, 3))
{
htmltext = "32367-185_02.html";
}
}
break;
}
case "3":
{
if (verifyMemoState(player, ART_OF_PERSUASION_ID, 3))
{
setMemoStateEx(player, ART_OF_PERSUASION_ID, 1, 1);
htmltext = "32367-184_04.html";
}
else if (verifyMemoState(player, NIKOLAS_COOPERATION_ID, 3))
{
setMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1, 1);
htmltext = "32367-185_04.html";
}
break;
}
case "4":
{
if (verifyMemoState(player, ART_OF_PERSUASION_ID, 3))
{
setMemoStateEx(player, ART_OF_PERSUASION_ID, 1, getMemoStateEx(player, ART_OF_PERSUASION_ID, 1) + 1);
htmltext = "32367-184_06.html";
}
else if (verifyMemoState(player, NIKOLAS_COOPERATION_ID, 3))
{
setMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1, getMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1) + 1);
htmltext = "32367-185_06.html";
}
break;
}
case "5":
{
if (verifyMemoState(player, ART_OF_PERSUASION_ID, 3))
{
setMemoStateEx(player, ART_OF_PERSUASION_ID, 1, getMemoStateEx(player, ART_OF_PERSUASION_ID, 1) + 1);
htmltext = "32367-184_08.html";
}
else if (verifyMemoState(player, NIKOLAS_COOPERATION_ID, 3))
{
setMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1, getMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1) + 1);
htmltext = "32367-185_08.html";
}
break;
}
case "6":
{
if (verifyMemoState(player, ART_OF_PERSUASION_ID, 3))
{
final int i0 = getMemoStateEx(player, ART_OF_PERSUASION_ID, 1);
if (i0 >= 3)
{
if ((npc0 != null) && npc0.getVariables().getBoolean("SPAWNED"))
{
npc0.getVariables().set("SPAWNED", false);
}
npc.deleteMe();
setMemoState(player, ART_OF_PERSUASION_ID, 4);
htmltext = "32367-184_09.html";
}
else
{
setMemoStateEx(player, ART_OF_PERSUASION_ID, 1, 0);
htmltext = "32367-184_10.html";
}
}
else if (verifyMemoState(player, NIKOLAS_COOPERATION_ID, 3))
{
final int i0 = getMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1);
if (i0 >= 3)
{
if ((npc0 != null) && npc0.getVariables().getBoolean("SPAWNED"))
{
npc0.getVariables().set("SPAWNED", false);
}
npc.deleteMe();
setMemoState(player, NIKOLAS_COOPERATION_ID, 4);
htmltext = "32367-185_09.html";
}
else
{
setMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1, 0);
htmltext = "32367-185_10.html";
}
}
break;
}
}
return htmltext;
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance talker)
{
String htmltext = getNoQuestMsg(talker);
if (verifyMemoState(talker, ART_OF_PERSUASION_ID, 3) || verifyMemoState(talker, NIKOLAS_COOPERATION_ID, 3))
{
final L2PcInstance player = npc.getVariables().getObject("player0", L2PcInstance.class);
if (player == talker)
{
htmltext = "32367-01.html";
}
else
{
htmltext = "32367-02.html";
}
}
return htmltext;
}
@Override
public String onSpawn(L2Npc npc)
{
startQuestTimer("SELF_DESTRUCT_IN_60", 60000, npc, null);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.INTRUDER_ALERT_THE_ALARM_WILL_SELF_DESTRUCT_IN_2_MINUTES);
final L2PcInstance player = npc.getVariables().getObject("player0", L2PcInstance.class);
if (player != null)
{
playSound(player, QuestSound.ITEMSOUND_SIREN);
}
return super.onSpawn(npc);
}
/**
* Verifies if the given player has the require memo state.
* @param player the player
* @param questId the quest ID
* @param memoState the memo state, if memo state is less than zero, only quest state is checked
* @return {@code true} if the player has the memo state, {@code false} otherwise
*/
private static boolean verifyMemoState(L2PcInstance player, int questId, int memoState)
{
QuestState qs = null;
switch (questId)
{
case ART_OF_PERSUASION_ID:
{
qs = player.getQuestState(Q00184_ArtOfPersuasion.class.getSimpleName());
break;
}
case NIKOLAS_COOPERATION_ID:
{
qs = player.getQuestState(Q00185_NikolasCooperation.class.getSimpleName());
break;
}
}
return (qs != null) && ((memoState < 0) || qs.isMemoState(memoState));
}
/**
* Sets the memo state for the given player and quest.
* @param player the player
* @param questId the quest ID
* @param memoState the memo state
*/
private static void setMemoState(L2PcInstance player, int questId, int memoState)
{
QuestState qs = null;
switch (questId)
{
case ART_OF_PERSUASION_ID:
{
qs = player.getQuestState(Q00184_ArtOfPersuasion.class.getSimpleName());
break;
}
case NIKOLAS_COOPERATION_ID:
{
qs = player.getQuestState(Q00185_NikolasCooperation.class.getSimpleName());
break;
}
}
if (qs != null)
{
qs.setMemoState(memoState);
}
}
/**
* Gets the memo state ex for the given player, quest and slot.
* @param player the player
* @param questId the quest ID
* @param slot the slot
* @return the memo state ex
*/
private static int getMemoStateEx(L2PcInstance player, int questId, int slot)
{
QuestState qs = null;
switch (questId)
{
case ART_OF_PERSUASION_ID:
{
qs = player.getQuestState(Q00184_ArtOfPersuasion.class.getSimpleName());
break;
}
case NIKOLAS_COOPERATION_ID:
{
qs = player.getQuestState(Q00185_NikolasCooperation.class.getSimpleName());
break;
}
}
return (qs != null) ? qs.getMemoStateEx(slot) : -1;
}
/**
* Sets the memo state ex for the given player and quest.
* @param player the player
* @param questId the quest ID
* @param slot the slot
* @param memoStateEx the memo state ex
*/
private static void setMemoStateEx(L2PcInstance player, int questId, int slot, int memoStateEx)
{
QuestState qs = null;
switch (questId)
{
case ART_OF_PERSUASION_ID:
{
qs = player.getQuestState(Q00184_ArtOfPersuasion.class.getSimpleName());
break;
}
case NIKOLAS_COOPERATION_ID:
{
qs = player.getQuestState(Q00185_NikolasCooperation.class.getSimpleName());
break;
}
}
if (qs != null)
{
qs.setMemoStateEx(slot, memoStateEx);
}
}
public static void main(String[] args)
{
new Alarm();
}
}

View File

@ -1,91 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.CrumaTower;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.events.EventType;
import com.l2jmobius.gameserver.model.events.ListenerRegisterType;
import com.l2jmobius.gameserver.model.events.annotations.Id;
import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
import com.l2jmobius.gameserver.model.events.annotations.RegisterType;
import com.l2jmobius.gameserver.model.events.impl.character.OnCreatureDamageReceived;
import com.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Cruma Tower AI
* @author malyelfik
*/
public final class CrumaTower extends AbstractNpcAI
{
// NPCs
private static final int CARSUS = 30483;
private static final int TELEPORT_DEVICE = 33157;
public CrumaTower()
{
addSpawnId(CARSUS);
addAttackId(TELEPORT_DEVICE);
}
@Override
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
{
if (event.equals("MESSAGE") && (npc != null))
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_CAN_GO_TO_UNDERGROUND_LV_3_USING_THE_ELEVATOR_IN_THE_BACK);
getTimers().addTimer(event, 15000, npc, player);
}
else
{
super.onTimerEvent(event, params, npc, player);
}
}
@Override
public String onSpawn(L2Npc npc)
{
getTimers().addTimer("MESSAGE", 15000, npc, null);
return super.onSpawn(npc);
}
@RegisterEvent(EventType.ON_CREATURE_DAMAGE_RECEIVED)
@RegisterType(ListenerRegisterType.NPC)
@Id(TELEPORT_DEVICE)
public void onCreatureDamageReceived(OnCreatureDamageReceived event)
{
try
{
final L2Npc npc = (L2Npc) event.getTarget();
final int[] location = npc.getParameters().getIntArray("teleport", ";");
event.getAttacker().teleToLocation(location[0], location[1], location[2]);
}
catch (Exception e)
{
_log.warning("Invalid location for Cruma Tower teleport device.");
}
}
public static void main(String[] args)
{
new CrumaTower();
}
}

View File

@ -1,232 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.DenOfDevil;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.zone.type.L2EffectZone;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import ai.AbstractNpcAI;
/**
* Dummy AI for spawns/respawns only for testing.
* @author Gnacik
*/
public final class DenOfEvil extends AbstractNpcAI
{
// private static final int _buffer_id = 32656;
protected static final int[] EYE_IDS =
{
18812,
18813,
18814
};
private static final int SKILL_ID = 6150; // others +2
private static final Location[] EYE_SPAWNS =
{
new Location(71544, -129400, -3360, 16472),
new Location(70954, -128854, -3360, 16),
new Location(72145, -128847, -3368, 32832),
new Location(76147, -128372, -3144, 16152),
new Location(71573, -128309, -3360, 49152),
new Location(75211, -127441, -3152, 0),
new Location(77005, -127406, -3144, 32784),
new Location(75965, -126486, -3144, 49120),
new Location(70972, -126429, -3016, 19208),
new Location(69916, -125838, -3024, 2840),
new Location(71658, -125459, -3016, 35136),
new Location(70605, -124646, -3040, 52104),
new Location(67283, -123237, -2912, 12376),
new Location(68383, -122754, -2912, 27904),
new Location(74137, -122733, -3024, 13272),
new Location(66736, -122007, -2896, 60576),
new Location(73289, -121769, -3024, 1024),
new Location(67894, -121491, -2912, 43872),
new Location(75530, -121477, -3008, 34424),
new Location(74117, -120459, -3024, 52344),
new Location(69608, -119855, -2534, 17251),
new Location(71014, -119027, -2520, 31904),
new Location(68944, -118964, -2527, 59874),
new Location(62261, -118263, -3072, 12888),
new Location(70300, -117942, -2528, 46208),
new Location(74312, -117583, -2272, 15280),
new Location(63276, -117409, -3064, 24760),
new Location(68104, -117192, -2168, 15888),
new Location(73758, -116945, -2216, 0),
new Location(74944, -116858, -2220, 30892),
new Location(61715, -116623, -3064, 59888),
new Location(69140, -116464, -2168, 28952),
new Location(67311, -116374, -2152, 1280),
new Location(62459, -116370, -3064, 48624),
new Location(74475, -116260, -2216, 47456),
new Location(68333, -115015, -2168, 45136),
new Location(68280, -108129, -1160, 17992),
new Location(62983, -107259, -2384, 12552),
new Location(67062, -107125, -1144, 64008),
new Location(68893, -106954, -1160, 36704),
new Location(63848, -106771, -2384, 32784),
new Location(62372, -106514, -2384, 0),
new Location(67838, -106143, -1160, 51232),
new Location(62905, -106109, -2384, 51288)
};
private DenOfEvil()
{
addKillId(EYE_IDS);
addSpawnId(EYE_IDS);
for (Location loc : EYE_SPAWNS)
{
addSpawn(EYE_IDS[getRandom(EYE_IDS.length)], loc, false, 0);
}
}
private int getSkillIdByNpcId(int npcId)
{
int diff = npcId - EYE_IDS[0];
diff *= 2;
return SKILL_ID + diff;
}
@Override
public String onSpawn(L2Npc npc)
{
npc.disableCoreAI(true);
npc.setIsImmobilized(true);
final L2EffectZone zone = ZoneManager.getInstance().getZone(npc, L2EffectZone.class);
if (zone == null)
{
_log.warning("NPC " + npc + " spawned outside of L2EffectZone, check your zone coords! X:" + npc.getX() + " Y:" + npc.getY() + " Z:" + npc.getZ());
return null;
}
final int skillId = getSkillIdByNpcId(npc.getId());
final int skillLevel = zone.getSkillLevel(skillId);
zone.addSkill(skillId, skillLevel + 1);
if (skillLevel == 3) // 3+1=4
{
ThreadPoolManager.getInstance().scheduleAi(new KashaDestruction(zone), 2 * 60 * 1000l);
zone.broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.DEFEAT_KASHA_S_EYES_TO_LIFT_THE_GREAT_CURSE));
}
else if (skillLevel == 2)
{
zone.broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.A_GREAT_CURSE_CAN_BE_FELT_FROM_KASHA_S_EYES));
}
return super.onSpawn(npc);
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
ThreadPoolManager.getInstance().scheduleAi(new RespawnNewEye(npc.getLocation()), 15000);
final L2EffectZone zone = ZoneManager.getInstance().getZone(npc, L2EffectZone.class);
if (zone == null)
{
_log.warning("NPC " + npc + " killed outside of L2EffectZone, check your zone coords! X:" + npc.getX() + " Y:" + npc.getY() + " Z:" + npc.getZ());
return null;
}
final int skillId = getSkillIdByNpcId(npc.getId());
final int skillLevel = zone.getSkillLevel(skillId);
zone.addSkill(skillId, skillLevel - 1);
return super.onKill(npc, killer, isSummon);
}
private class RespawnNewEye implements Runnable
{
private final Location _loc;
public RespawnNewEye(Location loc)
{
_loc = loc;
}
@Override
public void run()
{
addSpawn(EYE_IDS[getRandom(EYE_IDS.length)], _loc, false, 0);
}
}
private class KashaDestruction implements Runnable
{
L2EffectZone _zone;
public KashaDestruction(L2EffectZone zone)
{
_zone = zone;
}
@Override
public void run()
{
for (int i = SKILL_ID; i <= (SKILL_ID + 4); i = i + 2)
{
// test 3 skills if some is lvl 4
if (_zone.getSkillLevel(i) > 3)
{
destroyZone();
break;
}
}
}
private void destroyZone()
{
for (L2Character character : _zone.getCharactersInside())
{
if (character == null)
{
continue;
}
if (character.isPlayable())
{
final Skill skill = SkillData.getInstance().getSkill(6149, 1);
skill.applyEffects(character, character);
}
else if (character.doDie(null)) // mobs die
{
if (character.isNpc())
{
// respawn eye
final L2Npc npc = (L2Npc) character;
if (CommonUtil.contains(EYE_IDS, npc.getId()))
{
ThreadPoolManager.getInstance().scheduleAi(new RespawnNewEye(npc.getLocation()), 15000);
}
}
}
}
for (int i = SKILL_ID; i <= (SKILL_ID + 4); i = i + 2)
{
_zone.removeSkill(i);
}
}
}
public static void main(String[] args)
{
new DenOfEvil();
}
}

View File

@ -1,145 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.DenOfDevil;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
import com.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Frightened Ragna Orc AI.
* @author Gladicek, malyelfik
*/
public final class FrightenedRagnaOrc extends AbstractNpcAI
{
// NPC ID
private static final int MOB_ID = 18807;
// Chances
private static final int ADENA = 10000;
private static final int CHANCE = 1000;
private static final int ADENA2 = 1000000;
private static final int CHANCE2 = 10;
// Skill
private static final SkillHolder SKILL = new SkillHolder(6234, 1);
private FrightenedRagnaOrc()
{
addAttackId(MOB_ID);
addKillId(MOB_ID);
}
@Override
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
{
if (npc.isScriptValue(0))
{
npc.setScriptValue(1);
startQuestTimer("say", (getRandom(5) + 3) * 1000, npc, null, true);
}
else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.2)) && npc.isScriptValue(1))
{
startQuestTimer("reward", 10000, npc, attacker);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAIT_WAIT_STOP_SAVE_ME_AND_I_LL_GIVE_YOU_10_000_000_ADENA);
npc.setScriptValue(2);
}
return super.onAttack(npc, attacker, damage, isSummon);
}
@Override
public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
{
final NpcStringId msg = getRandomBoolean() ? NpcStringId.UGH_A_CURSE_UPON_YOU : NpcStringId.I_REALLY_DIDN_T_WANT_TO_FIGHT;
npc.broadcastSay(ChatType.NPC_GENERAL, msg);
cancelQuestTimer("say", npc, null);
cancelQuestTimer("reward", npc, player);
return super.onKill(npc, player, isSummon);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
switch (event)
{
case "say":
{
if (npc.isDead() || !npc.isScriptValue(1))
{
cancelQuestTimer("say", npc, null);
return null;
}
final NpcStringId msg = getRandomBoolean() ? NpcStringId.I_DON_T_WANT_TO_FIGHT : NpcStringId.IS_THIS_REALLY_NECESSARY;
npc.broadcastSay(ChatType.NPC_GENERAL, msg);
break;
}
case "reward":
{
if (!npc.isDead() && npc.isScriptValue(2))
{
if (getRandom(100000) < CHANCE2)
{
final NpcStringId msg = getRandomBoolean() ? NpcStringId.TH_THANKS_I_COULD_HAVE_BECOME_GOOD_FRIENDS_WITH_YOU : NpcStringId.I_LL_GIVE_YOU_10_000_000_ADENA_LIKE_I_PROMISED_I_MIGHT_BE_AN_ORC_WHO_KEEPS_MY_PROMISES;
npc.broadcastSay(ChatType.NPC_GENERAL, msg);
npc.setScriptValue(3);
npc.doCast(SKILL.getSkill());
for (int i = 0; i < 10; i++)
{
npc.dropItem(player, Inventory.ADENA_ID, ADENA2);
}
}
else if (getRandom(100000) < CHANCE)
{
final NpcStringId msg = getRandomBoolean() ? NpcStringId.TH_THANKS_I_COULD_HAVE_BECOME_GOOD_FRIENDS_WITH_YOU : NpcStringId.SORRY_BUT_THIS_IS_ALL_I_HAVE_GIVE_ME_A_BREAK;
npc.broadcastSay(ChatType.NPC_GENERAL, msg);
npc.setScriptValue(3);
npc.doCast(SKILL.getSkill());
for (int i = 0; i < 10; i++)
{
npc.dropItem(player, Inventory.ADENA_ID, ADENA);
}
}
else
{
final NpcStringId msg = getRandomBoolean() ? NpcStringId.THANKS_BUT_THAT_THING_ABOUT_10_000_000_ADENA_WAS_A_LIE_SEE_YA : NpcStringId.YOU_RE_PRETTY_DUMB_TO_BELIEVE_ME;
npc.broadcastSay(ChatType.NPC_GENERAL, msg);
}
startQuestTimer("despawn", 1000, npc, null);
}
break;
}
case "despawn":
{
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location((npc.getX() + getRandom(-800, 800)), (npc.getY() + getRandom(-800, 800)), npc.getZ(), npc.getHeading()));
npc.deleteMe();
break;
}
}
return null;
}
public static void main(String[] args)
{
new FrightenedRagnaOrc();
}
}

View File

@ -1,48 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.DenOfDevil;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import ai.AbstractNpcAI;
/**
* Ragna Orc Commander AI.
* @author Zealar
*/
public final class RagnaOrcCommander extends AbstractNpcAI
{
private static final int RAGNA_ORC_COMMANDER = 22694;
private RagnaOrcCommander()
{
addSpawnId(RAGNA_ORC_COMMANDER);
}
@Override
public String onSpawn(L2Npc npc)
{
spawnMinions(npc, "Privates1");
spawnMinions(npc, getRandomBoolean() ? "Privates2" : "Privates3");
return super.onSpawn(npc);
}
public static void main(String[] args)
{
new RagnaOrcCommander();
}
}

View File

@ -1,47 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.DenOfDevil;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import ai.AbstractNpcAI;
/**
* Ragna Orc Hero AI.
* @author Zealar
*/
public final class RagnaOrcHero extends AbstractNpcAI
{
private static final int RAGNA_ORC_HERO = 22693;
private RagnaOrcHero()
{
addSpawnId(RAGNA_ORC_HERO);
}
@Override
public String onSpawn(L2Npc npc)
{
spawnMinions(npc, getRandom(100) < 70 ? "Privates1" : "Privates2");
return super.onSpawn(npc);
}
public static void main(String[] args)
{
new RagnaOrcHero();
}
}

View File

@ -1,47 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.DenOfDevil;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import ai.AbstractNpcAI;
/**
* Ragna Orc Seer AI.
* @author Zealar
*/
public final class RagnaOrcSeer extends AbstractNpcAI
{
private static final int RAGNA_ORC_SEER = 22697;
private RagnaOrcSeer()
{
addSpawnId(RAGNA_ORC_SEER);
}
@Override
public String onSpawn(L2Npc npc)
{
spawnMinions(npc, "Privates" + getRandom(1, 2));
return super.onSpawn(npc);
}
public static void main(String[] args)
{
new RagnaOrcSeer();
}
}

View File

@ -1,86 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.DragonValley;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Dragon Valley summoner NPC AI
* @author Gigi, Mobius
*/
public final class DragonValleySummoners extends AbstractNpcAI
{
// NPCs
private static final int BLOODY_GRAVE_WARRIOR = 23441;
private static final int DARK_GRAVE_WARRIOR = 23442;
private static final int CAVE_SERVANT_ARCHER = 23436;
private static final int CAVE_SERVANT_WARRIOR = 23437;
// Config
private static final int CHANCE = 15;
private DragonValleySummoners()
{
addKillId(BLOODY_GRAVE_WARRIOR, DARK_GRAVE_WARRIOR, CAVE_SERVANT_ARCHER, CAVE_SERVANT_WARRIOR);
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
if (getRandom(100) < CHANCE)
{
switch (npc.getId())
{
case BLOODY_GRAVE_WARRIOR:
{
final L2Npc summon1 = addSpawn(BLOODY_GRAVE_WARRIOR, npc.getX() + 40, npc.getY() + 40, npc.getZ(), npc.getHeading(), false, 120000, true);
addAttackPlayerDesire(summon1, killer);
break;
}
case DARK_GRAVE_WARRIOR:
{
final L2Npc summon2 = addSpawn(DARK_GRAVE_WARRIOR, npc.getX() + 40, npc.getY() + 40, npc.getZ(), npc.getHeading(), false, 120000, true);
addAttackPlayerDesire(summon2, killer);
break;
}
case CAVE_SERVANT_ARCHER:
{
final L2Npc summon3 = addSpawn(CAVE_SERVANT_ARCHER, npc.getX() + 40, npc.getY() + 40, npc.getZ(), npc.getHeading(), false, 120000, true);
addAttackPlayerDesire(summon3, killer);
break;
}
case CAVE_SERVANT_WARRIOR:
{
final L2Npc summon4 = addSpawn(CAVE_SERVANT_WARRIOR, npc.getX() + 40, npc.getY() + 40, npc.getZ(), npc.getHeading(), false, 120000, true);
addAttackPlayerDesire(summon4, killer);
break;
}
}
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_DEAD_ARE_CALLING_AND_I_ANSWER);
}
return super.onKill(npc, killer, isSummon);
}
public static void main(String[] args)
{
new DragonValleySummoners();
}
}

View File

@ -1,3 +0,0 @@
<html><body>Dragon Vortex:<br>
You do not possess a <font color="LEVEL">Large Dragon Bone</font> and cannot summon a dragon to fight.
</body></html>

View File

@ -1,3 +0,0 @@
<html><body>Dragon Vortex:<br>
You can't summon the monster this soon. Please wait a little.
</body></html>

View File

@ -1,13 +0,0 @@
<html><body>Dragon Vortex:<br>
A mysterious vortex which has the power to summon one of Antharas' high commanding dragons.<br>
To call forth one of these creatures, you must use a <font color="LEVEL">Large Dragon Bone</font>.<br>
Dragons to be summoned:<br1>
<font color="LEVEL">Emerald Horn<br1>
Dust Rider<br1>
Bleeding Fly<br1>
Blackdagger Wing<br1>
Shadow Summoner<br1>
Spike Slasher<br1>
Muscle Bomber</font><br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest DragonVortex Spawn">Use a Large Dragon Bone</Button>
</body></html>

View File

@ -1,111 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.DragonValley.DragonVortex;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import ai.AbstractNpcAI;
/**
* Dragon Vortex AI.
* @author UnAfraid, improved by Adry_85
*/
public final class DragonVortex extends AbstractNpcAI
{
// NPC
private static final int VORTEX = 32871;
// Raids
private static final int[] RAIDS =
{
25718, // Emerald Horn
25719, // Dust Rider
25720, // Bleeding Fly
25721, // Blackdagger Wing
25722, // Shadow Summoner
25723, // Spike Slasher
25724, // Muscle Bomber
};
// Item
private static final int LARGE_DRAGON_BONE = 17248;
// Misc
private static final int DESPAWN_DELAY = 1800000; // 30min
private DragonVortex()
{
addStartNpc(VORTEX);
addFirstTalkId(VORTEX);
addTalkId(VORTEX);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if ("Spawn".equals(event))
{
if (!hasQuestItems(player, LARGE_DRAGON_BONE))
{
return "32871-noItem.html";
}
else if (npc.isScriptValue(1))
{
return "32871-noTime.html";
}
takeItems(player, LARGE_DRAGON_BONE, 1);
final int random = getRandom(100);
int raid = 0;
if (random < 3)
{
raid = RAIDS[6]; // Muscle Bomber
}
else if (random < 8)
{
raid = RAIDS[5]; // Shadow Summoner
}
else if (random < 15)
{
raid = RAIDS[4]; // Spike Slasher
}
else if (random < 25)
{
raid = RAIDS[3]; // Blackdagger Wing
}
else if (random < 45)
{
raid = RAIDS[2]; // Bleeding Fly
}
else if (random < 67)
{
raid = RAIDS[1]; // Dust Rider
}
else
{
raid = RAIDS[0]; // Emerald Horn
}
addSpawn(raid, npc.getX() + getRandom(-500, 500), npc.getY() + getRandom(-500, 500), npc.getZ() + 10, 0, false, DESPAWN_DELAY, true);
getTimers().addTimer("RESET", 60000, t -> npc.setScriptValue(0));
}
return super.onAdvEvent(event, npc, player);
}
public static void main(String[] args)
{
new DragonVortex();
}
}

View File

@ -1,63 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.DragonValley;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.enums.Race;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* AI for Gust Spiral (23447)
* @author Gigi, Mobius
*/
public final class GustSpiral extends AbstractNpcAI
{
// NPC
private static final int GUST_SPIRAL = 23447;
private GustSpiral()
{
addAttackId(GUST_SPIRAL);
}
@Override
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
{
if (attacker.getRace() == Race.ERTHEIA)
{
if (getRandom(100) < 30)
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.MY_WIND_BARRIER_HOW_ONLY_THE_ERTHEIA_CAN_WAIT_UNLESS_YOU_ARE);
}
npc.setIsInvul(false);
}
else
{
npc.setIsInvul(true);
}
return super.onAttack(npc, attacker, damage, isSummon);
}
public static void main(String[] args)
{
new GustSpiral();
}
}

View File

@ -1,139 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.DragonValley;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import ai.AbstractNpcAI;
/**
* Lair of Antharas AI.
* @author St3eT, UnAfraid
*/
public final class LairOfAntharas extends AbstractNpcAI
{
// NPC
private static final int KNORIKS = 22857;
private static final int DRAGON_KNIGHT = 22844;
private static final int DRAGON_KNIGHT2 = 22845;
private static final int ELITE_DRAGON_KNIGHT = 22846;
private static final int DRAGON_GUARD = 22852;
private static final int DRAGON_MAGE = 22853;
// Misc
private static final int KNIGHT_CHANCE = 30;
private static final int KNORIKS_CHANCE = 60;
private static final int KNORIKS_CHANCE2 = 50;
private LairOfAntharas()
{
addKillId(DRAGON_KNIGHT, DRAGON_KNIGHT2, DRAGON_GUARD, DRAGON_MAGE);
addSpawnId(DRAGON_KNIGHT, DRAGON_KNIGHT2, DRAGON_GUARD, DRAGON_MAGE);
addMoveFinishedId(DRAGON_GUARD, DRAGON_MAGE);
addAggroRangeEnterId(KNORIKS);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("CHECK_HOME") && (npc != null) && !npc.isDead())
{
if ((npc.calculateDistance(npc.getSpawn().getLocation(), false, false) > 10) && !npc.isInCombat())
{
((L2Attackable) npc).returnHome();
}
else if ((npc.getHeading() != npc.getSpawn().getHeading()) && !npc.isInCombat())
{
npc.setHeading(npc.getSpawn().getHeading());
npc.broadcastPacket(new ValidateLocation(npc));
}
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon)
{
if (npc.isScriptValue(0) && (getRandom(100) < KNORIKS_CHANCE))
{
if (getRandom(100) < KNORIKS_CHANCE2)
{
npc.setScriptValue(1);
}
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.WHO_S_THERE_IF_YOU_DISTURB_THE_TEMPER_OF_THE_GREAT_LAND_DRAGON_ANTHARAS_I_WILL_NEVER_FORGIVE_YOU);
}
return super.onAggroRangeEnter(npc, player, isSummon);
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
switch (npc.getId())
{
case DRAGON_KNIGHT:
{
if (getRandom(100) > KNIGHT_CHANCE)
{
final L2Npc newKnight = addSpawn(DRAGON_KNIGHT2, npc, false, 0, true);
npc.deleteMe();
newKnight.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.THOSE_WHO_SET_FOOT_IN_THIS_PLACE_SHALL_NOT_LEAVE_ALIVE);
addAttackPlayerDesire(newKnight, killer);
}
break;
}
case DRAGON_KNIGHT2:
{
if (getRandom(100) > KNIGHT_CHANCE)
{
final L2Npc eliteKnight = addSpawn(ELITE_DRAGON_KNIGHT, npc, false, 0, true);
npc.deleteMe();
eliteKnight.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.IF_YOU_WISH_TO_SEE_HELL_I_WILL_GRANT_YOU_YOUR_WISH);
addAttackPlayerDesire(eliteKnight, killer);
}
break;
}
case DRAGON_GUARD:
case DRAGON_MAGE:
{
cancelQuestTimer("CHECK_HOME", npc, null);
break;
}
}
return super.onKill(npc, killer, isSummon);
}
@Override
public String onSpawn(L2Npc npc)
{
if ((npc.getId() == DRAGON_GUARD) || (npc.getId() == DRAGON_MAGE))
{
npc.setRandomWalking(true);
startQuestTimer("CHECK_HOME", 10000, npc, null, true);
}
return super.onSpawn(npc);
}
public static void main(String[] args)
{
new LairOfAntharas();
}
}

View File

@ -1,114 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.DragonValley;
import java.util.ArrayList;
import java.util.List;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import ai.AbstractNpcAI;
/**
* Leopard Dragon Hachling AI.
* @author Mobius
*/
public final class LeopardDragonHachling extends AbstractNpcAI
{
// NPCs
private static final int DRAGON_HACHLING = 23434;
private static final int LEOPARD_DRAGON = 23435;
// Locations
private static final List<Location> TRANSFORM_LOCATIONS = new ArrayList<>();
{
TRANSFORM_LOCATIONS.add(new Location(84199, 120022, -2944));
TRANSFORM_LOCATIONS.add(new Location(92138, 113735, -3076));
TRANSFORM_LOCATIONS.add(new Location(103925, 122422, -3776));
TRANSFORM_LOCATIONS.add(new Location(122040, 115493, -3648));
}
private LeopardDragonHachling()
{
addAttackId(DRAGON_HACHLING);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if ((npc != null) && event.equals("MOVE_TO_TRANSFORM"))
{
if (npc.calculateDistance(nearestLocation(npc), false, false) < 100)
{
final int random = getRandom(1, 4);
for (int counter = 1; counter < random; counter++)
{
final L2Npc leopard = addSpawn(LEOPARD_DRAGON, npc.getLocation(), true, 300000); // 5 minute despawn time
leopard.broadcastPacket(new NpcSay(leopard.getObjectId(), ChatType.NPC_GENERAL, LEOPARD_DRAGON, NpcStringId.I_M_GOING_TO_TRANSFORM_WITH_THE_POWER_OF_THE_VORTEX_YOU_JUST_WATCH));
addAttackDesire(leopard, player);
}
cancelQuestTimer("MOVE_TO_TRANSFORM", npc, player);
npc.deleteMe();
}
else
{
npc.abortAttack();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, nearestLocation(npc));
}
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon, Skill skill)
{
if (npc.getScriptValue() == 0)
{
npc.setScriptValue(1);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, DRAGON_HACHLING, NpcStringId.HEY_THAT_HURT_YOU_JUST_WAIT_HERE_AND_I_LL_BE_BACK_AS_A_STRONGER_DRAGON));
startQuestTimer("MOVE_TO_TRANSFORM", 1000, npc, attacker, true);
}
npc.abortAttack();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, nearestLocation(npc));
return null;
}
private Location nearestLocation(L2Npc npc)
{
Location gotoLoc = TRANSFORM_LOCATIONS.get(0);
for (Location loc : TRANSFORM_LOCATIONS)
{
if (npc.calculateDistance(loc, false, false) < npc.calculateDistance(gotoLoc, false, false))
{
gotoLoc = loc;
}
}
return gotoLoc;
}
public static void main(String[] args)
{
new LeopardDragonHachling();
}
}

View File

@ -1,66 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.DragonValley;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import ai.AbstractNpcAI;
/**
* Mercenary Captain AI.
* @author Mobius
*/
public final class MercenaryCaptain extends AbstractNpcAI
{
// NPC
private static final int MERCENARY_CAPTAIN = 33970;
private MercenaryCaptain()
{
addSeeCreatureId(MERCENARY_CAPTAIN);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("BROADCAST_TEXT") && (npc != null))
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THE_SOUTHERN_PART_OF_DRAGON_VALLEY_IS_MUCH_MORE_DANGEROUS_THAN_THE_NORTH_BE_CAREFUL));
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onSeeCreature(L2Npc npc, L2Character creature, boolean isSummon)
{
if (creature.isPlayer())
{
startQuestTimer("BROADCAST_TEXT", 3000, npc, null, true);
}
return super.onSeeCreature(npc, creature, isSummon);
}
public static void main(String[] args)
{
new MercenaryCaptain();
}
}

View File

@ -1,12 +0,0 @@
<html><body>Mercenary Captain:<br>
During the <font color="LEVEL">day</font>, this place is crawling with <font color="LEVEL">dragons</font> and at <font color="LEVEL">night</font>, the <font color="LEVEL">Undead</font> fill up on Dragon Vitality, causing instability in the atmosphere.<br>
A red fissure appears only at night, and if you go near it, you might caught in the <font color="LEVEL">Reaper's Seal</font> effect, so be careful!<br>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest MercenaryTeleport NorthernDragonValley">Northern Dragon Valley</button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest MercenaryTeleport SouthernDragonValley">Southern Dragon Valley</button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest MercenaryTeleport NorthernWhirlingVortex">Northern Whirling Vortex</button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest MercenaryTeleport SouthernWhirlingVortex">Southern Whirling Vortex</button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest MercenaryTeleport DeepInWhirlingVortex">Deep in Whirling Vortex</button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest MercenaryTeleport EntranceToAntharasLair">Entrance to Antharas' Lair</button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest MercenaryTeleport AntharasLairBarrierBridge">Antharas' Lair - Barrier Bridge</button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest MercenaryTeleport DeepInAntharasLair">Deep in Antharas' Lair</button>
</body></html>

View File

@ -1,7 +0,0 @@
<html><body>Mercenary:<br>
Good work getting this far, considering the dangers of the dragons and the Undead. You're probably aware that Dragon Valley's <font color="LEVEL">southern region is way more dangerous</font> than the other parts.<br>
I will teleport you to some place safer, at least.<br>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest MercenaryTeleport TownOfGiran">Town of Giran</button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest MercenaryTeleport DragonValleyJunction">Dragon Valley Junction</button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest MercenaryTeleport WhirlingVortexJunction">Whirling Vortex Junction</button>
</body></html>

View File

@ -1,79 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.DragonValley.MercenaryTeleport;
import java.util.HashMap;
import java.util.Map;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import ai.AbstractNpcAI;
/**
* Mercenary and Mercenary Captain teleport AI.
* @author Gigi
*/
public final class MercenaryTeleport extends AbstractNpcAI
{
// NPCs
private static final int MERCENARY = 33971;
private static final int MERCENARY_CAPTAIN = 33970;
// Locations
private static final Map<String, Location> LOCATIONS = new HashMap<>();
static
{
// Captain
LOCATIONS.put("NorthernDragonValley", new Location(87712, 106060, -3176));
LOCATIONS.put("SouthernDragonValley", new Location(88016, 118852, -3056));
LOCATIONS.put("NorthernWhirlingVortex", new Location(108064, 112432, -3008));
LOCATIONS.put("SouthernWhirlingVortex", new Location(109918, 121266, -3720));
LOCATIONS.put("DeepInWhirlingVortex", new Location(119506, 112331, -3688));
LOCATIONS.put("EntranceToAntharasLair", new Location(131116, 114333, -3704));
LOCATIONS.put("AntharasLairBarrierBridge", new Location(146129, 111232, -3568));
LOCATIONS.put("DeepInAntharasLair", new Location(148447, 110582, -3944));
// Mercenary
LOCATIONS.put("TownOfGiran", new Location(83497, 148015, -3400));
LOCATIONS.put("DragonValleyJunction", new Location(80012, 115911, -3672));
LOCATIONS.put("WhirlingVortexJunction", new Location(102278, 113038, -3720));
}
private MercenaryTeleport()
{
addStartNpc(MERCENARY, MERCENARY_CAPTAIN);
addFirstTalkId(MERCENARY, MERCENARY_CAPTAIN);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
player.teleToLocation(LOCATIONS.get(event), true);
return super.onAdvEvent(event, npc, player);
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
return npc.getId() + ".html";
}
public static void main(String[] args)
{
new MercenaryTeleport();
}
}

View File

@ -1,66 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.DragonValley;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import ai.AbstractNpcAI;
/**
* Namo AI
* @author Mobius
*/
public final class Namo extends AbstractNpcAI
{
// NPC
private static final int NAMO = 33973;
private Namo()
{
addSeeCreatureId(NAMO);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("BROADCAST_TEXT") && (npc != null))
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THIS_PLACE_SWARMS_WITH_DRAGONS_BY_DAY_AND_UNDEAD_BY_NIGHT));
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onSeeCreature(L2Npc npc, L2Character creature, boolean isSummon)
{
if (creature.isPlayer())
{
startQuestTimer("BROADCAST_TEXT", 3000, npc, null, true);
}
return super.onSeeCreature(npc, creature, isSummon);
}
public static void main(String[] args)
{
new Namo();
}
}

View File

@ -1,66 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.DragonValley;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import ai.AbstractNpcAI;
/**
* Rakun AI.
* @author Mobius
*/
public final class Rakun extends AbstractNpcAI
{
// NPC
private static final int RAKUN = 33972;
private Rakun()
{
addSeeCreatureId(RAKUN);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("BROADCAST_TEXT") && (npc != null))
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THIS_PLACE_SWARMS_WITH_DRAGONS_BY_DAY_AND_UNDEAD_BY_NIGHT));
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onSeeCreature(L2Npc npc, L2Character creature, boolean isSummon)
{
if (creature.isPlayer())
{
startQuestTimer("BROADCAST_TEXT", 3000, npc, null, true);
}
return super.onSeeCreature(npc, creature, isSummon);
}
public static void main(String[] args)
{
new Rakun();
}
}

View File

@ -1,108 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.DragonValley.SeparatedSoul;
import java.util.HashMap;
import java.util.Map;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import ai.AbstractNpcAI;
/**
* Separated Soul teleport AI.
* @author UnAfraid, improved by Adry_85
*/
public final class SeparatedSoul extends AbstractNpcAI
{
// NPCs
private static final int[] SEPARATED_SOULS =
{
32864,
32865,
32866,
32867,
32868,
32869,
32870,
32891
};
// Items
private static final int WILL_OF_ANTHARAS = 17266;
private static final int SEALED_BLOOD_CRYSTAL = 17267;
private static final int ANTHARAS_BLOOD_CRYSTAL = 17268;
// Misc
private static final int MIN_LEVEL = 80;
// Locations
private static final Map<String, Location> LOCATIONS = new HashMap<>();
static
{
LOCATIONS.put("HuntersVillage", new Location(117031, 76769, -2696));
LOCATIONS.put("AntharasLair", new Location(131116, 114333, -3704));
LOCATIONS.put("AntharasLairDeep", new Location(148447, 110582, -3944));
LOCATIONS.put("AntharasLairMagicForceFieldBridge", new Location(146129, 111232, -3568));
LOCATIONS.put("DragonValley", new Location(73122, 118351, -3714));
LOCATIONS.put("DragonValleyCenter", new Location(99218, 110283, -3696));
LOCATIONS.put("DragonValleyNorth", new Location(116992, 113716, -3056));
LOCATIONS.put("DragonValleySouth", new Location(113203, 121063, -3712));
}
private SeparatedSoul()
{
addStartNpc(SEPARATED_SOULS);
addTalkId(SEPARATED_SOULS);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (LOCATIONS.containsKey(event))
{
if (player.getLevel() >= MIN_LEVEL)
{
player.teleToLocation(LOCATIONS.get(event), true);
}
else
{
return "no-level.htm";
}
}
else if ("Synthesis".equals(event)) // Request Item Synthesis
{
if (hasQuestItems(player, WILL_OF_ANTHARAS, SEALED_BLOOD_CRYSTAL))
{
takeItems(player, WILL_OF_ANTHARAS, 1);
takeItems(player, SEALED_BLOOD_CRYSTAL, 1);
giveItems(player, ANTHARAS_BLOOD_CRYSTAL, 1);
}
else
{
return "no-items.htm";
}
}
return super.onAdvEvent(event, npc, player);
}
public static void main(String[] args)
{
new SeparatedSoul();
}
}

View File

@ -1,3 +0,0 @@
<html><body>Separated Soul:<br>
In order for me to create a <font color="LEVEL">Blood Crystal of Antharas</font> you will need to bring me the <font color="LEVEL">Will of Antharas</font> and a <font color="LEVEL">Sealed Blood Crystal</font>. You can acquire these items from his commanders in either Antharas' Lair or Dragon Valley.<br>
</body></html>

View File

@ -1,5 +0,0 @@
<html><body>Separated Soul:<br>
The claw of Antharas barely touched my face,but my soul was still ripped apart!<br>
I can't gather the scattered souls in the area, but I can sense them. I could send you to the location of the souls, but you don't look capable yet of combining my ripped soul.<br>
(Moving to the location of the other separated souls requires the character to be at <font color="LEVEL">level 80 or above</font>.)
</body></html>

View File

@ -1,74 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.areas.EnchantedValley;
import java.util.ArrayList;
import java.util.List;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import ai.AbstractNpcAI;
/**
* AI from Flower Bud in Enchanted Valley, after kill random spawn<br>
* [Nymph Rose (Elegant), Nymph Lily (Elegant), Nymph Tulip (Elegant), Nymph Cosmos (Elegant)]
* @author Gigi
*/
public final class FlowerBud extends AbstractNpcAI
{
// NPCs
private static final int FLOWER_BUD = 19600;
private static final List<Integer> FLOWER_SPAWNS = new ArrayList<>();
static
{
FLOWER_SPAWNS.add(23582);
FLOWER_SPAWNS.add(23583);
FLOWER_SPAWNS.add(23584);
FLOWER_SPAWNS.add(23585);
}
private FlowerBud()
{
addKillId(FLOWER_BUD);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("spawn") && npc.isDead())
{
final L2Npc elegant = addSpawn(FLOWER_SPAWNS.get(Rnd.get(FLOWER_SPAWNS.size())), npc, false, 120000, false);
addAttackPlayerDesire(elegant, player);
}
return event;
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
startQuestTimer("spawn", 3000, npc, killer);
return super.onKill(npc, killer, isSummon);
}
public static void main(String[] args)
{
new FlowerBud();
}
}

View File

@ -1,3 +0,0 @@
<html><body>Altar of Souls:<br>
You've challenged <font color="LEVEL">Earth Terakan</font> to a battle.
</body></html>

View File

@ -1,3 +0,0 @@
<html><body>Altar of Souls:<br>
You've challenged <font color="LEVEL">Wind Cassius</font> to a battle.
</body></html>

View File

@ -1,3 +0,0 @@
<html><body>Altar of Souls:<br>
You've challenged <font color="LEVEL">Flaming Ladar</font> to a battle.
</body></html>

View File

@ -1,3 +0,0 @@
<html><body>Altar of Souls:<br>
<font color="LEVEL">Earth Terakan</font> is already engaged into a battle.
</body></html>

View File

@ -1,3 +0,0 @@
<html><body>Altar of Souls:<br>
<font color="LEVEL">Wind Cassius</font> is already engaged into a battle.
</body></html>

Some files were not shown because too many files have changed in this diff Show More