Merged with released L2J-Unity files.
This commit is contained in:
169
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/AncientArcanCity.java
vendored
Normal file
169
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/AncientArcanCity.java
vendored
Normal file
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
9
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-01.html
vendored
Normal file
9
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-01.html
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<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>
|
3
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-02.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-02.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Enchant Setter Lykus:<br>
|
||||
Just trust me and enchant only once! Believe in yourself!
|
||||
</body></html>
|
6
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-03.html
vendored
Normal file
6
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-03.html
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<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>
|
8
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-04.html
vendored
Normal file
8
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-04.html
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<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>
|
7
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-05.html
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-05.html
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<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>
|
6
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-06.html
vendored
Normal file
6
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-06.html
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<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>
|
6
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-07.html
vendored
Normal file
6
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-07.html
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<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>
|
4
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-08.html
vendored
Normal file
4
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-08.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<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>
|
5
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-09.html
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-09.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<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>
|
4
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-10.html
vendored
Normal file
4
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-10.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<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>
|
4
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-11.html
vendored
Normal file
4
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-11.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<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>
|
5
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-12.html
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521-12.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<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>
|
7
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521.html
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/33521.html
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<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>
|
94
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/Lykus.java
vendored
Normal file
94
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/Lykus.java
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
5
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Mumu/32900-1.html
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Mumu/32900-1.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<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>
|
6
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Mumu/32900.html
vendored
Normal file
6
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Mumu/32900.html
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<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>
|
65
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Mumu/Mumu.java
vendored
Normal file
65
trunk/dist/game/data/scripts/ai/areas/AncientCityArcan/Mumu/Mumu.java
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
8
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34059-1.htm
vendored
Normal file
8
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34059-1.htm
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<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 AteliaStatus give_tp_st_1">"Thanks."</Button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
6
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34059-2.htm
vendored
Normal file
6
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34059-2.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<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>
|
8
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34060-1.htm
vendored
Normal file
8
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34060-1.htm
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<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 AteliaStatus give_tp_st_2">"Thanks."</Button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
6
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34060-2.htm
vendored
Normal file
6
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34060-2.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<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>
|
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34061-1.htm
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34061-1.htm
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<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 AteliaStatus give_tp_st_3">"Thanks."</Button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34061-2.htm
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34061-2.htm
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<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>
|
9
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34062-1.htm
vendored
Normal file
9
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34062-1.htm
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<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 AteliaStatus give_tp_st_4">"Thanks."</Button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34062-2.htm
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34062-2.htm
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<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>
|
6
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34063-1.htm
vendored
Normal file
6
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34063-1.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<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 AteliaStatus 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>
|
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34063-2.htm
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34063-2.htm
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<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>
|
5
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34064-1.htm
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34064-1.htm
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<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 AteliaStatus 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>
|
6
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34064-2.htm
vendored
Normal file
6
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34064-2.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<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>
|
5
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34065-1.htm
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34065-1.htm
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<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 AteliaStatus 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>
|
6
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34065-2.htm
vendored
Normal file
6
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34065-2.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<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>
|
5
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34066-1.htm
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34066-1.htm
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<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 AteliaStatus 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>
|
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34066-2.htm
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34066-2.htm
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<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>
|
8
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34074-1.htm
vendored
Normal file
8
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34074-1.htm
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<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 AteliaStatus 34074-2.htm">Private warehouse</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaStatus 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>
|
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34074-2.htm
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34074-2.htm
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<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>
|
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34074-3.htm
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34074-3.htm
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<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>
|
8
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34075-1.htm
vendored
Normal file
8
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34075-1.htm
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<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 AteliaStatus 34075-2.htm">Private warehouse</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaStatus 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>
|
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34075-2.htm
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34075-2.htm
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<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>
|
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34075-3.htm
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34075-3.htm
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<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>
|
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34076-1.htm
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34076-1.htm
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<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>
|
6
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34077-1.htm
vendored
Normal file
6
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/34077-1.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<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>
|
707
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/AteliaManager.java
vendored
Normal file
707
trunk/dist/game/data/scripts/ai/areas/AteliaFortress/AteliaManager/AteliaManager.java
vendored
Normal file
@@ -0,0 +1,707 @@
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
4
trunk/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-01.html
vendored
Normal file
4
trunk/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-01.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<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>
|
5
trunk/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-02.html
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-02.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<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>
|
6
trunk/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-03.html
vendored
Normal file
6
trunk/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-03.html
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<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>
|
5
trunk/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-04.html
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-04.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<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>
|
3
trunk/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-05.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-05.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<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>
|
3
trunk/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-06.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-06.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Beast Herder Tunatun:<br>
|
||||
Oh, I see. I hope you will get a good result.
|
||||
</body></html>
|
5
trunk/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537.html
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<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>
|
88
trunk/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/Tunatun.java
vendored
Normal file
88
trunk/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/Tunatun.java
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
4
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-01.html
vendored
Normal file
4
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-01.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<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>
|
4
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-02.html
vendored
Normal file
4
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-02.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<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>
|
42
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-184_02.html
vendored
Normal file
42
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-184_02.html
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<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>
|
42
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-184_04.html
vendored
Normal file
42
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-184_04.html
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<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>
|
42
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-184_06.html
vendored
Normal file
42
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-184_06.html
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<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>
|
43
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-184_08.html
vendored
Normal file
43
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-184_08.html
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<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>
|
7
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-184_09.html
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-184_09.html
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<html><body>Alarm System:<br>
|
||||
########################<br>
|
||||
Enter the passcode for communication.<br>
|
||||
Passcode : ****<br>
|
||||
########################<br>
|
||||
Validation completed. Alarm has been disabled.
|
||||
</body></html>
|
9
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-184_10.html
vendored
Normal file
9
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-184_10.html
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<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>
|
42
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-185_02.html
vendored
Normal file
42
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-185_02.html
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<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>
|
43
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-185_04.html
vendored
Normal file
43
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-185_04.html
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<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>
|
||||
|
41
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-185_06.html
vendored
Normal file
41
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-185_06.html
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
<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>
|
42
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-185_08.html
vendored
Normal file
42
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-185_08.html
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<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>
|
7
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-185_09.html
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-185_09.html
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<html><body>Alarm System:<br>
|
||||
########################<br>
|
||||
Enter the passcode for communication.<br>
|
||||
Passcode : **** <br>
|
||||
########################<br>
|
||||
Validation completed. Alarm has been disabled.
|
||||
</body></html>
|
8
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-185_10.html
vendored
Normal file
8
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-185_10.html
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<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>
|
356
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/Alarm.java
vendored
Normal file
356
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/Alarm.java
vendored
Normal file
@@ -0,0 +1,356 @@
|
||||
/*
|
||||
* 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 final 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 final 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 final 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 final 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();
|
||||
}
|
||||
}
|
228
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Core.java
vendored
Normal file
228
trunk/dist/game/data/scripts/ai/areas/CrumaTower/Core.java
vendored
Normal file
@@ -0,0 +1,228 @@
|
||||
/*
|
||||
* 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 java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2GrandBossInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Core AI.
|
||||
* @author DrLecter, Emperorc
|
||||
*/
|
||||
public final class Core extends AbstractNpcAI
|
||||
{
|
||||
private static final int CORE = 29006;
|
||||
private static final int DEATH_KNIGHT = 29007;
|
||||
private static final int DOOM_WRAITH = 29008;
|
||||
// private static final int DICOR = 29009;
|
||||
// private static final int VALIDUS = 29010;
|
||||
private static final int SUSCEPTOR = 29011;
|
||||
// private static final int PERUM = 29012;
|
||||
// private static final int PREMO = 29013;
|
||||
|
||||
// Core Status Tracking :
|
||||
private static final byte ALIVE = 0; // Core is spawned.
|
||||
private static final byte DEAD = 1; // Core has been killed.
|
||||
|
||||
private static boolean _firstAttacked;
|
||||
|
||||
private final List<L2Attackable> _minions = new CopyOnWriteArrayList<>();
|
||||
|
||||
private Core()
|
||||
{
|
||||
registerMobs(CORE, DEATH_KNIGHT, DOOM_WRAITH, SUSCEPTOR);
|
||||
|
||||
_firstAttacked = false;
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
|
||||
final int status = GrandBossManager.getInstance().getBossStatus(CORE);
|
||||
if (status == DEAD)
|
||||
{
|
||||
// load the unlock date and time for Core from DB
|
||||
final long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||
// if Core is locked until a certain time, mark it so and start the unlock timer
|
||||
// the unlock time has not yet expired.
|
||||
if (temp > 0)
|
||||
{
|
||||
startQuestTimer("core_unlock", temp, null, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
// the time has already expired while the server was offline. Immediately spawn Core.
|
||||
final L2GrandBossInstance core = (L2GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(CORE, ALIVE);
|
||||
spawnBoss(core);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
final String test = loadGlobalQuestVar("Core_Attacked");
|
||||
if (test.equalsIgnoreCase("true"))
|
||||
{
|
||||
_firstAttacked = true;
|
||||
}
|
||||
final int loc_x = info.getInt("loc_x");
|
||||
final int loc_y = info.getInt("loc_y");
|
||||
final int loc_z = info.getInt("loc_z");
|
||||
final int heading = info.getInt("heading");
|
||||
final double hp = info.getDouble("currentHP");
|
||||
final double mp = info.getDouble("currentMP");
|
||||
final L2GrandBossInstance core = (L2GrandBossInstance) addSpawn(CORE, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
core.setCurrentHpMp(hp, mp);
|
||||
spawnBoss(core);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSave()
|
||||
{
|
||||
saveGlobalQuestVar("Core_Attacked", Boolean.toString(_firstAttacked));
|
||||
}
|
||||
|
||||
public void spawnBoss(L2GrandBossInstance npc)
|
||||
{
|
||||
GrandBossManager.getInstance().addBoss(npc);
|
||||
npc.broadcastPacket(new PlaySound(1, "BS01_A", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
// Spawn minions
|
||||
L2Attackable mob;
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
final int x = 16800 + (i * 360);
|
||||
mob = (L2Attackable) addSpawn(DEATH_KNIGHT, x, 110000, npc.getZ(), 280 + getRandom(40), false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
_minions.add(mob);
|
||||
mob = (L2Attackable) addSpawn(DEATH_KNIGHT, x, 109000, npc.getZ(), 280 + getRandom(40), false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
_minions.add(mob);
|
||||
final int x2 = 16800 + (i * 600);
|
||||
mob = (L2Attackable) addSpawn(DOOM_WRAITH, x2, 109300, npc.getZ(), 280 + getRandom(40), false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
_minions.add(mob);
|
||||
}
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
final int x = 16800 + (i * 450);
|
||||
mob = (L2Attackable) addSpawn(SUSCEPTOR, x, 110300, npc.getZ(), 280 + getRandom(40), false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
_minions.add(mob);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equalsIgnoreCase("core_unlock"))
|
||||
{
|
||||
final L2GrandBossInstance core = (L2GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(CORE, ALIVE);
|
||||
spawnBoss(core);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("spawn_minion"))
|
||||
{
|
||||
final L2Attackable mob = (L2Attackable) addSpawn(npc.getId(), npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
_minions.add(mob);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("despawn_minions"))
|
||||
{
|
||||
_minions.forEach(L2Attackable::decayMe);
|
||||
_minions.clear();
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
|
||||
{
|
||||
if (npc.getId() == CORE)
|
||||
{
|
||||
if (_firstAttacked)
|
||||
{
|
||||
if (getRandom(100) == 0)
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.REMOVING_INTRUDERS);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_firstAttacked = true;
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.A_NON_PERMITTED_TARGET_HAS_BEEN_DISCOVERED);
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.INTRUDER_REMOVAL_SYSTEM_INITIATED);
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||
{
|
||||
final int npcId = npc.getId();
|
||||
if (npcId == CORE)
|
||||
{
|
||||
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.A_FATAL_ERROR_HAS_OCCURRED);
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SYSTEM_IS_BEING_SHUT_DOWN);
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EMPTY);
|
||||
_firstAttacked = false;
|
||||
GrandBossManager.getInstance().setBossStatus(CORE, DEAD);
|
||||
// Calculate Min and Max respawn times randomly.
|
||||
long respawnTime = (Config.CORE_SPAWN_INTERVAL + getRandom(-Config.CORE_SPAWN_RANDOM, Config.CORE_SPAWN_RANDOM)) * 3600000;
|
||||
respawnTime *= 3600000;
|
||||
|
||||
startQuestTimer("core_unlock", respawnTime, null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
|
||||
info.set("respawn_time", (System.currentTimeMillis() + respawnTime));
|
||||
GrandBossManager.getInstance().setStatsSet(CORE, info);
|
||||
startQuestTimer("despawn_minions", 20000, null, null);
|
||||
cancelQuestTimers("spawn_minion");
|
||||
}
|
||||
else if ((GrandBossManager.getInstance().getBossStatus(CORE) == ALIVE) && (_minions != null) && _minions.contains(npc))
|
||||
{
|
||||
_minions.remove(npc);
|
||||
startQuestTimer("spawn_minion", 60000, npc, null);
|
||||
}
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
if (npc.getId() == CORE)
|
||||
{
|
||||
npc.setIsImmobilized(true);
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Core();
|
||||
}
|
||||
}
|
145
trunk/dist/game/data/scripts/ai/areas/DenOfDevil/FrightenedRagnaOrc.java
vendored
Normal file
145
trunk/dist/game/data/scripts/ai/areas/DenOfDevil/FrightenedRagnaOrc.java
vendored
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
48
trunk/dist/game/data/scripts/ai/areas/DenOfDevil/RagnaOrcCommander.java
vendored
Normal file
48
trunk/dist/game/data/scripts/ai/areas/DenOfDevil/RagnaOrcCommander.java
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
47
trunk/dist/game/data/scripts/ai/areas/DenOfDevil/RagnaOrcHero.java
vendored
Normal file
47
trunk/dist/game/data/scripts/ai/areas/DenOfDevil/RagnaOrcHero.java
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
47
trunk/dist/game/data/scripts/ai/areas/DenOfDevil/RagnaOrcSeer.java
vendored
Normal file
47
trunk/dist/game/data/scripts/ai/areas/DenOfDevil/RagnaOrcSeer.java
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
3
trunk/dist/game/data/scripts/ai/areas/DragonValley/DragonVortex/32871-noItem.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/areas/DragonValley/DragonVortex/32871-noItem.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<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>
|
3
trunk/dist/game/data/scripts/ai/areas/DragonValley/DragonVortex/32871-noTime.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/areas/DragonValley/DragonVortex/32871-noTime.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Dragon Vortex:<br>
|
||||
You can't summon the monster this soon. Please wait a little.
|
||||
</body></html>
|
13
trunk/dist/game/data/scripts/ai/areas/DragonValley/DragonVortex/32871.html
vendored
Normal file
13
trunk/dist/game/data/scripts/ai/areas/DragonValley/DragonVortex/32871.html
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<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>
|
111
trunk/dist/game/data/scripts/ai/areas/DragonValley/DragonVortex/DragonVortex.java
vendored
Normal file
111
trunk/dist/game/data/scripts/ai/areas/DragonValley/DragonVortex/DragonVortex.java
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
114
trunk/dist/game/data/scripts/ai/areas/DragonValley/LeopardDragonHachling.java
vendored
Normal file
114
trunk/dist/game/data/scripts/ai/areas/DragonValley/LeopardDragonHachling.java
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
66
trunk/dist/game/data/scripts/ai/areas/DragonValley/MercenaryCaptain.java
vendored
Normal file
66
trunk/dist/game/data/scripts/ai/areas/DragonValley/MercenaryCaptain.java
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
66
trunk/dist/game/data/scripts/ai/areas/DragonValley/Namo.java
vendored
Normal file
66
trunk/dist/game/data/scripts/ai/areas/DragonValley/Namo.java
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
66
trunk/dist/game/data/scripts/ai/areas/DragonValley/Rakun.java
vendored
Normal file
66
trunk/dist/game/data/scripts/ai/areas/DragonValley/Rakun.java
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
108
trunk/dist/game/data/scripts/ai/areas/DragonValley/SeparatedSoul/SeparatedSoul.java
vendored
Normal file
108
trunk/dist/game/data/scripts/ai/areas/DragonValley/SeparatedSoul/SeparatedSoul.java
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
3
trunk/dist/game/data/scripts/ai/areas/DragonValley/SeparatedSoul/no-items.htm
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/areas/DragonValley/SeparatedSoul/no-items.htm
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<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>
|
5
trunk/dist/game/data/scripts/ai/areas/DragonValley/SeparatedSoul/no-level.htm
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/areas/DragonValley/SeparatedSoul/no-level.htm
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<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>
|
3
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920-1.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920-1.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Altar of Souls:<br>
|
||||
You've challenged <font color="LEVEL">Earth Terakan</font> to a battle.
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920-2.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920-2.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Altar of Souls:<br>
|
||||
You've challenged <font color="LEVEL">Wind Cassius</font> to a battle.
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920-3.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920-3.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Altar of Souls:<br>
|
||||
You've challenged <font color="LEVEL">Flaming Ladar</font> to a battle.
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920-4.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920-4.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Altar of Souls:<br>
|
||||
<font color="LEVEL">Earth Terakan</font> is already engaged into a battle.
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920-5.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920-5.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Altar of Souls:<br>
|
||||
<font color="LEVEL">Wind Cassius</font> is already engaged into a battle.
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920-6.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920-6.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Altar of Souls:<br>
|
||||
<font color="LEVEL">Flaming Ladar</font> is already engaged into a battle.
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920-7.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920-7.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Altar of Souls:<br>
|
||||
To summon Earth Terakan, you must have an <font color="LEVEL">Apparition Stone (Lv. 88)</font>.
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920-8.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920-8.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Altar of Souls:<br>
|
||||
To summon Wind Cassius, you must have an <font color="LEVEL">Apparition Stone (Lv. 93)</font>.
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920-9.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920-9.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Altar of Souls:<br>
|
||||
To summon Flaming Ladar, you must have an <font color="LEVEL">Apparition Stone (Lv. 98)</font>.
|
||||
</body></html>
|
7
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920.html
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/33920.html
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<html><body>Altar of Souls:<br>
|
||||
Ordinary-looking, but this altar has seen many bloody sacrifices.<br>
|
||||
There is transparent space where you can place an <font color="LEVEL">Apparition Stone (Lv. 88)</font>, an <font color="LEVEL">Apparition Stone (Lv. 93)</font> and an <font color="LEVEL">Apparition Stone (Lv. 98)</font>.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AltarOfSouls request_boss_88">Place an Apparition Stone (Lv. 88) there</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AltarOfSouls request_boss_93">Place an Apparition Stone (Lv. 93) there</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AltarOfSouls request_boss_98">Place an Apparition Stone (Lv. 98) there</Button>
|
||||
</body></html>
|
112
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/AltarOfSouls.java
vendored
Normal file
112
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/AltarOfSouls/AltarOfSouls.java
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* 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.FaeronVillage.AltarOfSouls;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Altar of Souls AI.
|
||||
* @author Mobius
|
||||
*/
|
||||
public final class AltarOfSouls extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int ALTAR_OF_SOULS = 33920;
|
||||
private static final int LADAR = 25942;
|
||||
private static final int CASSIUS = 25943;
|
||||
private static final int TERAKAN = 25944;
|
||||
// Items
|
||||
private static final int APPARITION_STONE_88 = 38572;
|
||||
private static final int APPARITION_STONE_93 = 38573;
|
||||
private static final int APPARITION_STONE_98 = 38574;
|
||||
// Misc
|
||||
private L2Npc BOSS_88;
|
||||
private L2Npc BOSS_93;
|
||||
private L2Npc BOSS_98;
|
||||
|
||||
private AltarOfSouls()
|
||||
{
|
||||
addStartNpc(ALTAR_OF_SOULS);
|
||||
addFirstTalkId(ALTAR_OF_SOULS);
|
||||
addTalkId(ALTAR_OF_SOULS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "request_boss_88":
|
||||
{
|
||||
if ((BOSS_88 != null) && !BOSS_88.isDead())
|
||||
{
|
||||
return "33920-4.html";
|
||||
}
|
||||
if (hasQuestItems(player, APPARITION_STONE_88))
|
||||
{
|
||||
takeItems(player, APPARITION_STONE_88, 1);
|
||||
BOSS_88 = addSpawn(TERAKAN, player.getX() + getRandom(-300, 300), player.getY() + getRandom(-300, 300), player.getZ() + 10, getRandom(64000), false, 0, true);
|
||||
return "33920-1.html";
|
||||
}
|
||||
return "33920-7.html";
|
||||
}
|
||||
case "request_boss_93":
|
||||
{
|
||||
if ((BOSS_93 != null) && !BOSS_93.isDead())
|
||||
{
|
||||
return "33920-5.html";
|
||||
}
|
||||
if (hasQuestItems(player, APPARITION_STONE_93))
|
||||
{
|
||||
takeItems(player, APPARITION_STONE_93, 1);
|
||||
BOSS_93 = addSpawn(CASSIUS, player.getX() + getRandom(-300, 300), player.getY() + getRandom(-300, 300), player.getZ() + 10, getRandom(64000), false, 0, true);
|
||||
return "33920-2.html";
|
||||
}
|
||||
return "33920-8.html";
|
||||
}
|
||||
case "request_boss_98":
|
||||
{
|
||||
if ((BOSS_98 != null) && !BOSS_98.isDead())
|
||||
{
|
||||
return "33920-6.html";
|
||||
}
|
||||
if (hasQuestItems(player, APPARITION_STONE_98))
|
||||
{
|
||||
takeItems(player, APPARITION_STONE_98, 1);
|
||||
BOSS_98 = addSpawn(LADAR, player.getX() + getRandom(-300, 300), player.getY() + getRandom(-300, 300), player.getZ() + 10, getRandom(64000), false, 0, true);
|
||||
return "33920-3.html";
|
||||
}
|
||||
return "33920-9.html";
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
return "33920.html";
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new AltarOfSouls();
|
||||
}
|
||||
}
|
8
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/RemembranceTower/33989.html
vendored
Normal file
8
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/RemembranceTower/33989.html
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<html><body>Remembrance Tower:<br>
|
||||
On the day Faeron passed through the Dimensional Rift into the Material Realm, we were attacked by the monsters of the Material Realm.<br>
|
||||
We were not prepared for such a sudden attack and suffered a great loss of life.<br>
|
||||
In remembrance of those poor lives we could not protect, this tower is hereby erected.<br>
|
||||
<center>Queen Navari</center><br>
|
||||
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest RemembranceTower action">"I offer my condolences for the dead."</Button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</button>
|
||||
</body></html>
|
64
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/RemembranceTower/RemembranceTower.java
vendored
Normal file
64
trunk/dist/game/data/scripts/ai/areas/FaeronVillage/RemembranceTower/RemembranceTower.java
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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.FaeronVillage.RemembranceTower;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.OnEventTrigger;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Remembrance Tower AI.
|
||||
* @author St3eT
|
||||
*/
|
||||
public final class RemembranceTower extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int REMEMBRANCE_TOWER = 33989;
|
||||
// Misc
|
||||
private static final int EMMITER_ID = 17250700;
|
||||
|
||||
private RemembranceTower()
|
||||
{
|
||||
addStartNpc(REMEMBRANCE_TOWER);
|
||||
addTalkId(REMEMBRANCE_TOWER);
|
||||
addFirstTalkId(REMEMBRANCE_TOWER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("action") && npc.isScriptValue(0))
|
||||
{
|
||||
npc.broadcastPacket(new OnEventTrigger(EMMITER_ID, true));
|
||||
npc.setScriptValue(1);
|
||||
startQuestTimer("TRIGGER", 3000, npc, null);
|
||||
}
|
||||
else if (event.equals("TRIGGER"))
|
||||
{
|
||||
npc.setScriptValue(0);
|
||||
npc.broadcastPacket(new OnEventTrigger(EMMITER_ID, false));
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new RemembranceTower();
|
||||
}
|
||||
}
|
8
trunk/dist/game/data/scripts/ai/areas/FairySettlement/LargeCocoon/32920.html
vendored
Normal file
8
trunk/dist/game/data/scripts/ai/areas/FairySettlement/LargeCocoon/32920.html
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<html><body>Large Cocoon:<br>
|
||||
You can see... many fairy citizens are being changed within these... cocoons,<br>
|
||||
but it's not too late... to stop them! Attack the cocoons, while they are still forming, and you will destroy them.<br>
|
||||
Otherwise, you can promote the mutation by injecting <font color="LEVEL">Glimmer</font> into them channel where nutrients are supplied.<br><br>
|
||||
(To use <font color="LEVEL">Glimmer</font>, target a cocoon and click Glimmer. To attack the cocoon, initiate an attack while pressing the Ctrl key. For a powerful attack, use your skills.)<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LargeCocoon attack">Attack</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LargeCocoon attackPowerful">Launch a powerful attack</Button>
|
||||
</body></html>
|
282
trunk/dist/game/data/scripts/ai/areas/FairySettlement/LargeCocoon/LargeCocoon.java
vendored
Normal file
282
trunk/dist/game/data/scripts/ai/areas/FairySettlement/LargeCocoon/LargeCocoon.java
vendored
Normal file
@@ -0,0 +1,282 @@
|
||||
/*
|
||||
* 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.FairySettlement.LargeCocoon;
|
||||
|
||||
import com.l2jmobius.gameserver.instancemanager.QuestManager;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.events.impl.character.OnCreatureAttacked;
|
||||
import com.l2jmobius.gameserver.model.quest.Quest;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
import quests.Q10305_UnstoppableFutileEfforts.Q10305_UnstoppableFutileEfforts;
|
||||
|
||||
/**
|
||||
* Large Cocoon AI.
|
||||
* @author St3eT
|
||||
*/
|
||||
public final class LargeCocoon extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int LARGE_COCOON = 32920;
|
||||
private static final int COCOON = 32919;
|
||||
private static final int LARGE_CONTAMINED_COCOON = 19394;
|
||||
private static final int COCOON_DESTROYER = 19294;
|
||||
private static final int FAIRY_WARRIOR = 22867;
|
||||
private static final int FAIRY_WARRIOR_HARD = 22870;
|
||||
private static final int FAIRY_ROGUE = 22875;
|
||||
private static final int FAIRY_ROGUE_HARD = 22878;
|
||||
private static final int FAIRY_KNIGHT = 22883;
|
||||
private static final int FAIRY_KNIGHT_HARD = 22886;
|
||||
private static final int FAIRY_SUMMONER = 22899;
|
||||
private static final int FAIRY_SUMMONER_HARD = 22902;
|
||||
private static final int FAIRY_WIZARD = 22891;
|
||||
private static final int FAIRY_WIZARD_HARD = 22894;
|
||||
private static final int FAIRY_WITCH = 22907;
|
||||
private static final int FAIRY_WITCH_HARD = 22910;
|
||||
|
||||
private LargeCocoon()
|
||||
{
|
||||
addStartNpc(COCOON, LARGE_COCOON);
|
||||
addTalkId(COCOON, LARGE_COCOON);
|
||||
addFirstTalkId(COCOON, LARGE_COCOON);
|
||||
addSpawnId(COCOON, LARGE_COCOON);
|
||||
setCreatureAttackedId(this::onCreatureAttacked, LARGE_COCOON);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "attack":
|
||||
{
|
||||
onCreatureAttacked(new OnCreatureAttacked(player, npc));
|
||||
break;
|
||||
}
|
||||
case "attackPowerful":
|
||||
{
|
||||
// TODO: Quest 466 stuffs
|
||||
final Quest qs10305 = QuestManager.getInstance().getQuest(Q10305_UnstoppableFutileEfforts.class.getSimpleName());
|
||||
if (qs10305 != null)
|
||||
{
|
||||
qs10305.notifyEvent("NOTIFY_Q10305", npc, player);
|
||||
}
|
||||
|
||||
if (getRandom(3) < 1)
|
||||
{
|
||||
addSpawn(LARGE_CONTAMINED_COCOON, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 30000);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (getRandom(6))
|
||||
{
|
||||
case 0:
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WARRIOR_HARD, npc, false, 90000), player);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_ROGUE_HARD, npc, false, 90000), player);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WIZARD_HARD, npc, false, 90000), player);
|
||||
break;
|
||||
case 1:
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_KNIGHT_HARD, npc, false, 90000), player);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WITCH_HARD, npc, false, 90000), player);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_SUMMONER_HARD, npc, false, 90000), player);
|
||||
break;
|
||||
case 2:
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WARRIOR_HARD, npc, false, 90000), player);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WIZARD_HARD, npc, false, 90000), player);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WITCH_HARD, npc, false, 90000), player);
|
||||
break;
|
||||
case 3:
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_ROGUE_HARD, npc, false, 90000), player);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WARRIOR_HARD, npc, false, 90000), player);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_ROGUE_HARD, npc, false, 90000), player);
|
||||
break;
|
||||
case 4:
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WIZARD_HARD, npc, false, 90000), player);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_SUMMONER_HARD, npc, false, 90000), player);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WITCH_HARD, npc, false, 90000), player);
|
||||
break;
|
||||
case 5:
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_KNIGHT_HARD, npc, false, 90000), player);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_KNIGHT_HARD, npc, false, 90000), player);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WITCH_HARD, npc, false, 90000), player);
|
||||
break;
|
||||
}
|
||||
}
|
||||
npc.deleteMe();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
if (getRandom(3) < 1)
|
||||
{
|
||||
addSpawn(COCOON_DESTROYER, npc.getX() + 120, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
}
|
||||
|
||||
switch (getRandom(6))
|
||||
{
|
||||
case 0:
|
||||
addSpawn(FAIRY_WARRIOR, npc.getX() + 270, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
addSpawn(FAIRY_ROGUE, npc.getX() + 230, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
break;
|
||||
case 1:
|
||||
addSpawn(FAIRY_KNIGHT, npc.getX() + 270, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
addSpawn(FAIRY_ROGUE, npc.getX() + 230, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
break;
|
||||
case 2:
|
||||
addSpawn(FAIRY_WARRIOR, npc.getX() + 270, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
addSpawn(FAIRY_KNIGHT, npc.getX() + 230, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
break;
|
||||
case 3:
|
||||
addSpawn(FAIRY_SUMMONER, npc.getX() + 270, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
addSpawn(FAIRY_WARRIOR, npc.getX() + 230, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
break;
|
||||
case 4:
|
||||
addSpawn(FAIRY_WITCH, npc.getX() + 270, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
addSpawn(FAIRY_SUMMONER, npc.getX() + 230, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
break;
|
||||
case 5:
|
||||
addSpawn(FAIRY_SUMMONER, npc.getX() + 270, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
addSpawn(FAIRY_WITCH, npc.getX() + 230, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
switch (getRandom(6))
|
||||
{
|
||||
case 0:
|
||||
addSpawn(FAIRY_ROGUE, npc.getX() - 270, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
addSpawn(FAIRY_WARRIOR, npc.getX() - 230, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
break;
|
||||
case 1:
|
||||
addSpawn(FAIRY_KNIGHT, npc.getX() - 270, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
addSpawn(FAIRY_ROGUE, npc.getX() - 230, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
break;
|
||||
case 2:
|
||||
addSpawn(FAIRY_WARRIOR, npc.getX() - 270, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
addSpawn(FAIRY_KNIGHT, npc.getX() - 230, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
break;
|
||||
case 3:
|
||||
addSpawn(FAIRY_SUMMONER, npc.getX() - 270, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
addSpawn(FAIRY_WIZARD, npc.getX() - 230, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
break;
|
||||
case 4:
|
||||
addSpawn(FAIRY_WITCH, npc.getX() - 270, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
addSpawn(FAIRY_SUMMONER, npc.getX() - 230, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
break;
|
||||
case 5:
|
||||
addSpawn(FAIRY_WIZARD, npc.getX() - 270, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
addSpawn(FAIRY_WITCH, npc.getX() - 230, npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
switch (getRandom(6))
|
||||
{
|
||||
case 0:
|
||||
addSpawn(FAIRY_ROGUE, npc.getX(), npc.getY() + 270, npc.getZ(), npc.getHeading(), false, 0);
|
||||
addSpawn(FAIRY_WARRIOR, npc.getX(), npc.getY() + 230, npc.getZ(), npc.getHeading(), false, 0);
|
||||
break;
|
||||
case 1:
|
||||
addSpawn(FAIRY_KNIGHT, npc.getX(), npc.getY() + 270, npc.getZ(), npc.getHeading(), false, 0);
|
||||
addSpawn(FAIRY_ROGUE, npc.getX(), npc.getY() + 230, npc.getZ(), npc.getHeading(), false, 0);
|
||||
break;
|
||||
case 2:
|
||||
addSpawn(FAIRY_WARRIOR, npc.getX(), npc.getY() + 270, npc.getZ(), npc.getHeading(), false, 0);
|
||||
addSpawn(FAIRY_KNIGHT, npc.getX(), npc.getY() + 230, npc.getZ(), npc.getHeading(), false, 0);
|
||||
break;
|
||||
case 3:
|
||||
addSpawn(FAIRY_SUMMONER, npc.getX(), npc.getY() + 270, npc.getZ(), npc.getHeading(), false, 0);
|
||||
addSpawn(FAIRY_WIZARD, npc.getX(), npc.getY() + 230, npc.getZ(), npc.getHeading(), false, 0);
|
||||
break;
|
||||
case 4:
|
||||
addSpawn(FAIRY_WITCH, npc.getX(), npc.getY() + 270, npc.getZ(), npc.getHeading(), false, 0);
|
||||
addSpawn(FAIRY_SUMMONER, npc.getX(), npc.getY() + 230, npc.getZ(), npc.getHeading(), false, 0);
|
||||
break;
|
||||
case 5:
|
||||
addSpawn(FAIRY_WIZARD, npc.getX(), npc.getY() + 270, npc.getZ(), npc.getHeading(), false, 0);
|
||||
addSpawn(FAIRY_WITCH, npc.getX(), npc.getY() + 230, npc.getZ(), npc.getHeading(), false, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
public void onCreatureAttacked(OnCreatureAttacked event)
|
||||
{
|
||||
final L2Npc npc = (L2Npc) event.getTarget();
|
||||
final L2Playable playable = (L2Playable) event.getAttacker();
|
||||
|
||||
// TODO: Quest 466 stuffs
|
||||
final Quest qs10305 = QuestManager.getInstance().getQuest(Q10305_UnstoppableFutileEfforts.class.getSimpleName());
|
||||
if (qs10305 != null)
|
||||
{
|
||||
qs10305.notifyEvent("NOTIFY_Q10305", npc, playable.getActingPlayer());
|
||||
}
|
||||
|
||||
if (getRandom(3) < 1)
|
||||
{
|
||||
addSpawn(LARGE_CONTAMINED_COCOON, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 30000);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (getRandom(6))
|
||||
{
|
||||
case 0:
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WARRIOR, npc, false, 90000), playable);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_ROGUE, npc, false, 90000), playable);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WIZARD, npc, false, 90000), playable);
|
||||
break;
|
||||
case 1:
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_KNIGHT, npc, false, 90000), playable);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WITCH, npc, false, 90000), playable);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_SUMMONER, npc, false, 90000), playable);
|
||||
break;
|
||||
case 2:
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WARRIOR, npc, false, 90000), playable);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WIZARD, npc, false, 90000), playable);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WITCH, npc, false, 90000), playable);
|
||||
break;
|
||||
case 3:
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_ROGUE, npc, false, 90000), playable);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WARRIOR, npc, false, 90000), playable);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_ROGUE, npc, false, 90000), playable);
|
||||
break;
|
||||
case 4:
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WIZARD, npc, false, 90000), playable);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_SUMMONER, npc, false, 90000), playable);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WITCH, npc, false, 90000), playable);
|
||||
break;
|
||||
case 5:
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_KNIGHT, npc, false, 90000), playable);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_KNIGHT, npc, false, 90000), playable);
|
||||
addAttackPlayerDesire(addSpawn(FAIRY_WITCH, npc, false, 90000), playable);
|
||||
break;
|
||||
}
|
||||
}
|
||||
npc.deleteMe();
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new LargeCocoon();
|
||||
}
|
||||
}
|
103
trunk/dist/game/data/scripts/ai/areas/FairySettlement/Wisp.java
vendored
Normal file
103
trunk/dist/game/data/scripts/ai/areas/FairySettlement/Wisp.java
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* 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.FairySettlement;
|
||||
|
||||
import com.l2jmobius.gameserver.model.L2Spawn;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
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.events.impl.character.OnCreatureSee;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Wisp AI.
|
||||
* @author St3eT
|
||||
*/
|
||||
public final class Wisp extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int WISP = 32915;
|
||||
private static final int LARGE_WISP = 32916;
|
||||
// Skills
|
||||
private static final SkillHolder WISP_HEAL = new SkillHolder(14064, 1);
|
||||
private static final SkillHolder LARGE_WISP_HEAL = new SkillHolder(14065, 1);
|
||||
// Misc
|
||||
private static final int RESPAWN_MIN = 60000;
|
||||
private static final int RESPAWN_MAX = 120000;
|
||||
|
||||
private Wisp()
|
||||
{
|
||||
addSpawnId(WISP, LARGE_WISP);
|
||||
setCreatureSeeId(this::onCreatureSee, WISP, LARGE_WISP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("DELETE_NPC"))
|
||||
{
|
||||
params = new StatsSet();
|
||||
params.set("LOCATION_OBJECT", npc.getLocation());
|
||||
getTimers().addTimer("RESPAWN_WISP_" + npc.getObjectId(), params, getRandom(RESPAWN_MIN, RESPAWN_MAX), null, null);
|
||||
npc.deleteMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
addSpawn(WISP, params.getObject("LOCATION_OBJECT", Location.class));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
final L2Spawn spawn = npc.getSpawn();
|
||||
spawn.stopRespawn();
|
||||
|
||||
if ((npc.getId() == WISP) && (getRandom(100) < 10))
|
||||
{
|
||||
addSpawn(LARGE_WISP, npc);
|
||||
npc.deleteMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.initSeenCreatures();
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
public void onCreatureSee(OnCreatureSee event)
|
||||
{
|
||||
final L2Character creature = event.getSeen();
|
||||
final L2Npc npc = (L2Npc) event.getSeer();
|
||||
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
npc.setTarget(creature);
|
||||
npc.doCast(npc.getId() == WISP ? WISP_HEAL.getSkill() : LARGE_WISP_HEAL.getSkill());
|
||||
getTimers().addTimer("DELETE_NPC", 5000, npc, null);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Wisp();
|
||||
}
|
||||
}
|
113
trunk/dist/game/data/scripts/ai/areas/FantasyIsle/HandysBlockCheckerEvent.java
vendored
Normal file
113
trunk/dist/game/data/scripts/ai/areas/FantasyIsle/HandysBlockCheckerEvent.java
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* 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.FantasyIsle;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.instancemanager.HandysBlockCheckerManager;
|
||||
import com.l2jmobius.gameserver.model.ArenaParticipantsHolder;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExCubeGameChangeTimeToStart;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExCubeGameRequestReady;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExCubeGameTeamList;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Handys Block Checker Event AI.
|
||||
* @authors BiggBoss, Gigiikun
|
||||
*/
|
||||
public class HandysBlockCheckerEvent extends AbstractNpcAI
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger(HandysBlockCheckerEvent.class.getName());
|
||||
|
||||
// Arena Managers
|
||||
private static final int A_MANAGER_1 = 32521;
|
||||
private static final int A_MANAGER_2 = 32522;
|
||||
private static final int A_MANAGER_3 = 32523;
|
||||
private static final int A_MANAGER_4 = 32524;
|
||||
|
||||
public HandysBlockCheckerEvent()
|
||||
{
|
||||
addFirstTalkId(A_MANAGER_1, A_MANAGER_2, A_MANAGER_3, A_MANAGER_4);
|
||||
HandysBlockCheckerManager.getInstance().startUpParticipantsQueue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if ((npc == null) || (player == null))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
final int arena = npc.getId() - A_MANAGER_1;
|
||||
if (eventIsFull(arena))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_CANNOT_REGISTER_BECAUSE_CAPACITY_HAS_BEEN_EXCEEDED);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (HandysBlockCheckerManager.getInstance().arenaIsBeingUsed(arena))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.THE_MATCH_IS_BEING_PREPARED_PLEASE_TRY_AGAIN_LATER);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (HandysBlockCheckerManager.getInstance().addPlayerToArena(player, arena))
|
||||
{
|
||||
final ArenaParticipantsHolder holder = HandysBlockCheckerManager.getInstance().getHolder(arena);
|
||||
|
||||
final ExCubeGameTeamList tl = new ExCubeGameTeamList(holder.getRedPlayers(), holder.getBluePlayers(), arena);
|
||||
|
||||
player.sendPacket(tl);
|
||||
|
||||
final int countBlue = holder.getBlueTeamSize();
|
||||
final int countRed = holder.getRedTeamSize();
|
||||
final int minMembers = Config.MIN_BLOCK_CHECKER_TEAM_MEMBERS;
|
||||
|
||||
if ((countBlue >= minMembers) && (countRed >= minMembers))
|
||||
{
|
||||
holder.updateEvent();
|
||||
holder.broadCastPacketToTeam(ExCubeGameRequestReady.STATIC_PACKET);
|
||||
holder.broadCastPacketToTeam(new ExCubeGameChangeTimeToStart(10));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean eventIsFull(int arena)
|
||||
{
|
||||
return HandysBlockCheckerManager.getInstance().getHolder(arena).getAllPlayers().size() == 12;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
if (Config.ENABLE_BLOCK_CHECKER_EVENT)
|
||||
{
|
||||
new HandysBlockCheckerEvent();
|
||||
LOGGER.info("Handy's Block Checker Event is enabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.info("Handy's Block Checker Event is disabled");
|
||||
}
|
||||
}
|
||||
}
|
259
trunk/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
vendored
Normal file
259
trunk/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
vendored
Normal file
@@ -0,0 +1,259 @@
|
||||
/*
|
||||
* 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.FantasyIsle;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
|
||||
import com.l2jmobius.gameserver.GameTimeController;
|
||||
import com.l2jmobius.gameserver.ThreadPoolManager;
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Fantasy Isle Parade
|
||||
* @author JOJO, Pandragon
|
||||
*/
|
||||
public final class Parade extends AbstractNpcAI
|
||||
{
|
||||
// @formatter:off
|
||||
final int[] ACTORS =
|
||||
{
|
||||
32379, 0, 32379,
|
||||
32379, 0, 32379,
|
||||
32379, 0, 32379,
|
||||
0, 0, 0,
|
||||
32380, 0, 32380,
|
||||
32380, 32381, 32380,
|
||||
32380, 0, 32380,
|
||||
32380, 32381, 32380,
|
||||
0, 0, 0,
|
||||
32382, 32382, 32382,
|
||||
32382, 32383, 32382,
|
||||
32383, 32384, 32383,
|
||||
32383, 32384, 32383,
|
||||
0, 0, 0,
|
||||
0, 32385, 0,
|
||||
32385, 0, 32385,
|
||||
0, 32385, 0,
|
||||
0, 0, 0,
|
||||
32412, 0, 32411,
|
||||
0, 0, 0,
|
||||
32421, 0, 32409,
|
||||
32423, 0, 32422,
|
||||
0, 0, 0,
|
||||
32420, 32419, 32417,
|
||||
32418, 0, 32416,
|
||||
0, 0, 0,
|
||||
32414, 0, 32414,
|
||||
0, 32413, 0,
|
||||
32414, 0, 32414,
|
||||
0, 0, 0,
|
||||
32393, 0, 32394,
|
||||
0, 32430, 0,
|
||||
32392, 0, 32391,
|
||||
0, 0, 0,
|
||||
0, 32404, 0,
|
||||
32403, 0, 32401,
|
||||
0, 0, 0,
|
||||
0, 32408, 0,
|
||||
32406, 0, 32407,
|
||||
0, 32405, 0,
|
||||
0, 0, 0,
|
||||
32390, 32389, 32387,
|
||||
32388, 0, 32386,
|
||||
0, 0, 0,
|
||||
0, 32400, 0,
|
||||
32397, 32398, 32396,
|
||||
0, 0, 0,
|
||||
0, 32450, 0,
|
||||
32448, 32449, 32447,
|
||||
0, 0, 0,
|
||||
32380, 0, 32380,
|
||||
32380, 32381, 32380,
|
||||
32380, 0, 32380,
|
||||
32380, 32381, 32380,
|
||||
0, 0, 0,
|
||||
32379, 0, 32379,
|
||||
32379, 0, 32379,
|
||||
32379, 0, 32379,
|
||||
0, 0, 0,
|
||||
0, 32415, 0
|
||||
};
|
||||
|
||||
//(Northbound 270 degrees) Route 1
|
||||
private final int[][] START1 = {{-54780, -56810, -2015, 49152},{-54860, -56810, -2015, 49152},{-54940, -56810, -2015, 49152}};
|
||||
private final int[][] GOAL1 = {{-54780, -57965, -2015, 49152},{-54860, -57965, -2015, 49152},{-54940, -57965, -2015, 49152}};
|
||||
//(Westbound 180 degrees) Route 2
|
||||
private final int[][] START2 = {{-55715, -58900, -2015, 32768},{-55715, -58820, -2015, 32768},{-55715, -58740, -2015, 32768}};
|
||||
private final int[][] GOAL2 = {{-60850, -58900, -2015, 32768},{-60850, -58820, -2015, 32768},{-60850, -58740, -2015, 32768}};
|
||||
//(Southbound 90 degrees) Route 3
|
||||
private final int[][] START3 = {{-61790, -57965, -2015, 16384},{-61710, -57965, -2015, 16384},{-61630, -57965, -2015, 16384}};
|
||||
private final int[][] GOAL3 = {{-61790, -53890, -2116, 16384},{-61710, -53890, -2116, 16384},{-61630, -53890, -2116, 16384}};
|
||||
//(Eastbound 0 degrees) Route 4
|
||||
private final int[][] START4 = {{-60840, -52990, -2108, 0},{-60840, -53070, -2108, 0},{-60840, -53150, -2108, 0}};
|
||||
private final int[][] GOAL4 = {{-58620, -52990, -2015, 0},{-58620, -53070, -2015, 0},{-58620, -53150, -2015, 0}};
|
||||
//(To 315 degrees northeast) Route 5
|
||||
private final int[][] START5 = {{-57233, -53554, -2015, 57344},{-57290, -53610, -2015, 57344},{-57346, -53667, -2015, 57344}};
|
||||
private final int[][] GOAL5 = {{-55338, -55435, -2015, 57344},{-55395, -55491, -2015, 57344},{-55451, -55547, -2015, 57344}};
|
||||
|
||||
final int[][][] START = {START1, START2, START3, START4, START5};
|
||||
final int[][][] GOAL = {GOAL1, GOAL2, GOAL3, GOAL4, GOAL5};
|
||||
// @formatter:on
|
||||
|
||||
int npcIndex;
|
||||
CopyOnWriteArrayList<L2Npc> spawns;
|
||||
ScheduledFuture<?> spawnTask;
|
||||
ScheduledFuture<?> deleteTask;
|
||||
ScheduledFuture<?> cleanTask;
|
||||
|
||||
public Parade()
|
||||
{
|
||||
// Starts at 8:00 and repeats every 6 hours.
|
||||
final long diff = timeLeftMilli(8, 0, 0), cycle = 3600000L;
|
||||
ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Start(), diff, cycle);
|
||||
|
||||
// Test - Starts 3 minutes after server startup and repeats every 20 minutes.
|
||||
// final long diff = timeLeftMilli(8, 0, 0), cycle = 600000L;
|
||||
// ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Start(), 180000L, cycle);
|
||||
|
||||
_log.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(System.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
|
||||
}
|
||||
|
||||
void load()
|
||||
{
|
||||
npcIndex = 0;
|
||||
spawns = new CopyOnWriteArrayList<>();
|
||||
}
|
||||
|
||||
void clean()
|
||||
{
|
||||
if (spawns != null)
|
||||
{
|
||||
spawns.forEach(L2Npc::deleteMe);
|
||||
}
|
||||
spawns = null;
|
||||
}
|
||||
|
||||
private long timeLeftMilli(int hh, int mm, int ss)
|
||||
{
|
||||
final int now = (GameTimeController.getInstance().getGameTicks() * 60) / 100;
|
||||
int dd = ((hh * 3600) + (mm * 60) + ss) - (now % 86400);
|
||||
if (dd < 0)
|
||||
{
|
||||
dd += 86400;
|
||||
}
|
||||
|
||||
return (dd * 1000L) / 6L;
|
||||
}
|
||||
|
||||
class Start implements Runnable
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
load();
|
||||
spawnTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Spawn(), 0, 5000);
|
||||
deleteTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Delete(), 10000, 1000);
|
||||
cleanTask = ThreadPoolManager.getInstance().scheduleGeneral(new Clean(), 420000);
|
||||
}
|
||||
}
|
||||
|
||||
class Spawn implements Runnable
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
if (npcIndex >= ACTORS.length)
|
||||
{
|
||||
spawnTask.cancel(false);
|
||||
break;
|
||||
}
|
||||
final int npcId = ACTORS[npcIndex++];
|
||||
if (npcId == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
for (int route = 0; route < 5; ++route)
|
||||
{
|
||||
final int[] start = START[route][i];
|
||||
final int[] goal = GOAL[route][i];
|
||||
final L2Npc actor = addSpawn(npcId, start[0], start[1], start[2], start[3], false, 0);
|
||||
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(goal[0], goal[1], goal[2], goal[3]));
|
||||
spawns.add(actor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Delete implements Runnable
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (spawns.size() <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (L2Npc actor : spawns)
|
||||
{
|
||||
if (actor != null)
|
||||
{
|
||||
if (actor.calculateDistance(actor.getXdestination(), actor.getYdestination(), 0, false, true) < (100 * 100))
|
||||
{
|
||||
actor.deleteMe();
|
||||
spawns.remove(actor);
|
||||
}
|
||||
else if (!actor.isMoving())
|
||||
{
|
||||
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(actor.getXdestination(), actor.getYdestination(), actor.getZdestination(), actor.getHeading()));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (spawns.size() == 0)
|
||||
{
|
||||
deleteTask.cancel(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Clean implements Runnable
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
spawnTask.cancel(false);
|
||||
spawnTask = null;
|
||||
deleteTask.cancel(false);
|
||||
deleteTask = null;
|
||||
cleanTask.cancel(false);
|
||||
cleanTask = null;
|
||||
clean();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Parade();
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user