Merged with released L2J-Unity files.

This commit is contained in:
mobiusdev
2016-06-12 01:34:09 +00:00
parent e003e87887
commit 635557f5da
18352 changed files with 3245113 additions and 2892959 deletions

View 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();
}
}

View 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>

View File

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

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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();
}
}

View 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>

View 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>

View 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();
}
}