Merged with released L2J-Unity files.
This commit is contained in:
236
trunk/dist/game/data/scripts/ai/AbstractNpcAI.java
vendored
236
trunk/dist/game/data/scripts/ai/AbstractNpcAI.java
vendored
@@ -1,134 +1,104 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.MinionHolder;
|
||||
import com.l2jmobius.gameserver.model.quest.Quest;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
|
||||
/**
|
||||
* Abstract NPC AI class for datapack based AIs.
|
||||
* @author UnAfraid, Zoey76
|
||||
*/
|
||||
public abstract class AbstractNpcAI extends Quest
|
||||
{
|
||||
public AbstractNpcAI(String name, String descr)
|
||||
{
|
||||
super(-1, name, descr);
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple on first talk event handler.
|
||||
*/
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
return npc.getId() + ".html";
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the following events to the current script:<br>
|
||||
* <ul>
|
||||
* <li>ON_ATTACK</li>
|
||||
* <li>ON_KILL</li>
|
||||
* <li>ON_SPAWN</li>
|
||||
* <li>ON_SPELL_FINISHED</li>
|
||||
* <li>ON_SKILL_SEE</li>
|
||||
* <li>ON_FACTION_CALL</li>
|
||||
* <li>ON_AGGR_RANGE_ENTER</li>
|
||||
* </ul>
|
||||
* @param mobs
|
||||
*/
|
||||
public void registerMobs(int... mobs)
|
||||
{
|
||||
addAttackId(mobs);
|
||||
addKillId(mobs);
|
||||
addSpawnId(mobs);
|
||||
addSpellFinishedId(mobs);
|
||||
addSkillSeeId(mobs);
|
||||
addAggroRangeEnterId(mobs);
|
||||
addFactionCallId(mobs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Broadcasts NpcSay packet to all known players with custom string.
|
||||
* @param npc
|
||||
* @param type
|
||||
* @param text
|
||||
*/
|
||||
protected void broadcastNpcSay(L2Npc npc, ChatType type, String text)
|
||||
{
|
||||
Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), type, npc.getTemplate().getDisplayId(), text));
|
||||
}
|
||||
|
||||
/**
|
||||
* Broadcasts NpcSay packet to all known players with npc string id.
|
||||
* @param npc
|
||||
* @param type
|
||||
* @param stringId
|
||||
*/
|
||||
protected void broadcastNpcSay(L2Npc npc, ChatType type, NpcStringId stringId)
|
||||
{
|
||||
Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), type, npc.getTemplate().getDisplayId(), stringId));
|
||||
}
|
||||
|
||||
/**
|
||||
* Broadcasts NpcSay packet to all known players with npc string id.
|
||||
* @param npc
|
||||
* @param type
|
||||
* @param stringId
|
||||
* @param parameters
|
||||
*/
|
||||
protected void broadcastNpcSay(L2Npc npc, ChatType type, NpcStringId stringId, String... parameters)
|
||||
{
|
||||
final NpcSay say = new NpcSay(npc.getObjectId(), type, npc.getTemplate().getDisplayId(), stringId);
|
||||
if (parameters != null)
|
||||
{
|
||||
for (String parameter : parameters)
|
||||
{
|
||||
say.addStringParameter(parameter);
|
||||
}
|
||||
}
|
||||
Broadcast.toKnownPlayers(npc, say);
|
||||
}
|
||||
|
||||
/**
|
||||
* Broadcasts NpcSay packet to all known players with npc string id in specific radius.
|
||||
* @param npc
|
||||
* @param type
|
||||
* @param stringId
|
||||
* @param radius
|
||||
*/
|
||||
protected void broadcastNpcSay(L2Npc npc, ChatType type, NpcStringId stringId, int radius)
|
||||
{
|
||||
Broadcast.toKnownPlayersInRadius(npc, new NpcSay(npc.getObjectId(), type, npc.getTemplate().getDisplayId(), stringId), radius);
|
||||
}
|
||||
|
||||
public void spawnMinions(L2Npc npc, String spawnName)
|
||||
{
|
||||
for (MinionHolder is : npc.getTemplate().getParameters().getMinionList(spawnName))
|
||||
{
|
||||
addMinion((L2MonsterInstance) npc, is.getId());
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.MinionHolder;
|
||||
import com.l2jmobius.gameserver.model.quest.Quest;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SocialAction;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
|
||||
/**
|
||||
* Abstract NPC AI class for datapack based AIs.
|
||||
* @author UnAfraid, Zoey76
|
||||
*/
|
||||
public abstract class AbstractNpcAI extends Quest
|
||||
{
|
||||
protected final Logger _log = Logger.getLogger(getClass().getName());
|
||||
|
||||
public AbstractNpcAI()
|
||||
{
|
||||
super(-1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple on first talk event handler.
|
||||
*/
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
return npc.getId() + ".html";
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the following events to the current script:<br>
|
||||
* <ul>
|
||||
* <li>ON_ATTACK</li>
|
||||
* <li>ON_KILL</li>
|
||||
* <li>ON_SPAWN</li>
|
||||
* <li>ON_SPELL_FINISHED</li>
|
||||
* <li>ON_SKILL_SEE</li>
|
||||
* <li>ON_FACTION_CALL</li>
|
||||
* <li>ON_AGGR_RANGE_ENTER</li>
|
||||
* </ul>
|
||||
* @param mobs
|
||||
*/
|
||||
public void registerMobs(int... mobs)
|
||||
{
|
||||
addAttackId(mobs);
|
||||
addKillId(mobs);
|
||||
addSpawnId(mobs);
|
||||
addSpellFinishedId(mobs);
|
||||
addSkillSeeId(mobs);
|
||||
addAggroRangeEnterId(mobs);
|
||||
addFactionCallId(mobs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Broadcasts SocialAction packet to self and known players.
|
||||
* @param character
|
||||
* @param actionId
|
||||
*/
|
||||
protected void broadcastSocialAction(L2Character character, int actionId)
|
||||
{
|
||||
Broadcast.toSelfAndKnownPlayers(character, new SocialAction(character.getObjectId(), actionId));
|
||||
}
|
||||
|
||||
/**
|
||||
* Broadcasts SocialAction packet to self and known players in specific radius.
|
||||
* @param character
|
||||
* @param actionId
|
||||
* @param radius
|
||||
*/
|
||||
protected void broadcastSocialAction(L2Character character, int actionId, int radius)
|
||||
{
|
||||
Broadcast.toSelfAndKnownPlayersInRadius(character, new SocialAction(character.getObjectId(), actionId), radius);
|
||||
}
|
||||
|
||||
public void spawnMinions(L2Npc npc, String spawnName)
|
||||
{
|
||||
for (MinionHolder is : npc.getParameters().getMinionList(spawnName))
|
||||
{
|
||||
addMinion((L2MonsterInstance) npc, is.getId());
|
||||
}
|
||||
}
|
||||
}
|
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();
|
||||
}
|
||||
}
|
@@ -14,10 +14,11 @@
|
||||
* 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.zones.AteliaFortress.AteliaManager;
|
||||
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;
|
||||
@@ -28,7 +29,7 @@ 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.util.Util;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
@@ -36,7 +37,7 @@ import ai.AbstractNpcAI;
|
||||
* URL https://l2wiki.com/Atelia_Fortress
|
||||
* @author hlwrave, Stayway, Mobius
|
||||
*/
|
||||
final class AteliaManager extends AbstractNpcAI
|
||||
public final class AteliaManager extends AbstractNpcAI
|
||||
{
|
||||
// Npc Devianne
|
||||
private static final int DEVIANNE = 34089;
|
||||
@@ -312,7 +313,6 @@ final class AteliaManager extends AbstractNpcAI
|
||||
|
||||
private AteliaManager()
|
||||
{
|
||||
super(AteliaManager.class.getSimpleName(), "ai/zones/AteliaFortress");
|
||||
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);
|
||||
@@ -603,7 +603,7 @@ final class AteliaManager extends AbstractNpcAI
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
|
||||
{
|
||||
final int chance = getRandom(1000);
|
||||
if (Util.contains(ATELIA_CURSE, npc.getId()))
|
||||
if (CommonUtil.contains(ATELIA_CURSE, npc.getId()))
|
||||
{
|
||||
if (!npc.isCastingNow() && (chance <= 20))
|
||||
{
|
||||
@@ -611,9 +611,9 @@ final class AteliaManager extends AbstractNpcAI
|
||||
npc.doCast(ATELIA_POISON[getRandom(ATELIA_POISON.length)].getSkill());
|
||||
}
|
||||
}
|
||||
else if (Util.contains(FLOOR_MOBS, npc.getId()) && (chance > 90))
|
||||
else if (CommonUtil.contains(FLOOR_MOBS, npc.getId()) && (chance > 90))
|
||||
{
|
||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, ATELIA_MSG[getRandom(1)], attacker.getName());
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), ATELIA_MSG[getRandom(1)]));
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
@@ -662,7 +662,7 @@ final class AteliaManager extends AbstractNpcAI
|
||||
startQuestTimer("SPY_CLEAR", 100, npc, null);
|
||||
startQuestTimer("SB_3", 100, npc, killer);
|
||||
}
|
||||
else if (Util.contains(FLOOR_MOBS, npc.getId()) && (getRandom(100) <= 6))
|
||||
else if (CommonUtil.contains(FLOOR_MOBS, npc.getId()) && (getRandom(100) <= 6))
|
||||
{
|
||||
startQuestTimer("ALERT", 100, npc, killer);
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
<html><body>Beast Herder Tunatun:<br>
|
||||
Are you talking about the Bull 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.
|
||||
<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>
|
@@ -1,5 +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.
|
||||
<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>
|
@@ -1,3 +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.
|
||||
<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>
|
@@ -1,5 +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>
|
||||
<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>
|
@@ -1,75 +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.npc.Tunatun;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.quest.QuestState;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
import quests.Q00020_BringUpWithLove.Q00020_BringUpWithLove;
|
||||
|
||||
/**
|
||||
* Beast Herder Tunatun AI.
|
||||
* @author Adry_85
|
||||
*/
|
||||
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()
|
||||
{
|
||||
super(Tunatun.class.getSimpleName(), "ai/npc");
|
||||
addStartNpc(TUNATUN);
|
||||
addFirstTalkId(TUNATUN);
|
||||
addTalkId(TUNATUN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if ("Whip".equals(event))
|
||||
{
|
||||
if (hasQuestItems(player, BEAST_HANDLERS_WHIP))
|
||||
{
|
||||
return "31537-01.html";
|
||||
}
|
||||
|
||||
final QuestState qs = player.getQuestState(Q00020_BringUpWithLove.class.getSimpleName());
|
||||
if ((qs == null) && (player.getLevel() < MIN_LEVEL))
|
||||
{
|
||||
return "31537-02.html";
|
||||
}
|
||||
else if ((qs != null) || (player.getLevel() >= MIN_LEVEL))
|
||||
{
|
||||
giveItems(player, BEAST_HANDLERS_WHIP, 1);
|
||||
return "31537-03.html";
|
||||
}
|
||||
}
|
||||
return event;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Tunatun();
|
||||
}
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
@@ -1,4 +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>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 2">Enter the passcode.</Button>
|
||||
<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>
|
@@ -1,4 +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.)
|
||||
<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>
|
@@ -1,43 +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">
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 6">1</Button>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 6">2</Button>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 6">3</Button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="20" height="20" align="center">
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 6">4</Button>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 6">5</Button>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 6">6</Button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="20" height="20" align="center">
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 6">7</Button>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 6">8</Button>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 6">9</Button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<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>
|
@@ -1,7 +1,7 @@
|
||||
<html><body>Alarm System:<br>
|
||||
########################<br>
|
||||
Enter the passcode for communication.<br>
|
||||
Passcode : ****<br>
|
||||
########################<br>
|
||||
Validation completed. Alarm has been disabled.
|
||||
<html><body>Alarm System:<br>
|
||||
########################<br>
|
||||
Enter the passcode for communication.<br>
|
||||
Passcode : ****<br>
|
||||
########################<br>
|
||||
Validation completed. Alarm has been disabled.
|
||||
</body></html>
|
@@ -1,9 +1,9 @@
|
||||
<html><body>Alarm System:<br>
|
||||
########################<br>
|
||||
Enter the passcode for communication.<br>
|
||||
Passcode : ****<br>
|
||||
########################<br>
|
||||
Validation has failed. <br>
|
||||
<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 2">Re-enter passcode.</Button>
|
||||
<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>
|
@@ -1,42 +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">
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 6">1</Button>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 6">2</Button>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 6">3</Button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="20" height="20" align="center">
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 6">4</Button>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 6">5</Button>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 6">6</Button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="20" height="20" align="center">
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 6">7</Button>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 6">8</Button>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 6">9</Button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<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>
|
@@ -1,7 +1,7 @@
|
||||
<html><body>Alarm System:<br>
|
||||
########################<br>
|
||||
Enter the passcode for communication.<br>
|
||||
Passcode : **** <br>
|
||||
########################<br>
|
||||
Validation completed. Alarm has been disabled.
|
||||
<html><body>Alarm System:<br>
|
||||
########################<br>
|
||||
Enter the passcode for communication.<br>
|
||||
Passcode : **** <br>
|
||||
########################<br>
|
||||
Validation completed. Alarm has been disabled.
|
||||
</body></html>
|
@@ -1,8 +1,8 @@
|
||||
<html><body>Alarm System:<br>
|
||||
########################<br>
|
||||
Enter passcode for communication.<br>
|
||||
Passcode : **** <br>########################<br>
|
||||
Validation has failed.<br>
|
||||
<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alarm 2">Re-enter passcode.</Button>
|
||||
<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>
|
@@ -1,350 +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.npc.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
|
||||
*/
|
||||
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()
|
||||
{
|
||||
super(Alarm.class.getSimpleName(), "ai/npc");
|
||||
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);
|
||||
broadcastNpcSay(npc, 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);
|
||||
broadcastNpcSay(npc, 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);
|
||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_10_SECONDS_ENTER_PASSCODE_TO_OVERRIDE);
|
||||
break;
|
||||
}
|
||||
case "RECORDER_CRUSHED":
|
||||
{
|
||||
if ((npc0 != null) && npc0.getVariables().getBoolean("SPAWNED"))
|
||||
{
|
||||
npc0.getVariables().set("SPAWNED", false);
|
||||
if (player0 != null)
|
||||
{
|
||||
broadcastNpcSay(npc, 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))
|
||||
{
|
||||
if (getMemoStateEx(player, ART_OF_PERSUASION_ID, 1) >= 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))
|
||||
{
|
||||
if (getMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1) >= 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))
|
||||
{
|
||||
if (npc.getVariables().getObject("player0", L2PcInstance.class) == 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);
|
||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.INTRUDER_ALERT_THE_ALARM_WILL_SELF_DESTRUCT_IN_2_MINUTES);
|
||||
final L2PcInstance player = npc.getVariables().getObject("player0", L2PcInstance.class);
|
||||
if (player != null)
|
||||
{
|
||||
playSound(player, QuestSound.ITEMSOUND_SIREN);
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies if the given player has the require memo state.
|
||||
* @param player the player
|
||||
* @param questId the quest ID
|
||||
* @param memoState the memo state, if memo state is less than zero, only quest state is checked
|
||||
* @return {@code true} if the player has the memo state, {@code false} otherwise
|
||||
*/
|
||||
private static boolean verifyMemoState(L2PcInstance player, int questId, int memoState)
|
||||
{
|
||||
QuestState qs = null;
|
||||
switch (questId)
|
||||
{
|
||||
case ART_OF_PERSUASION_ID:
|
||||
{
|
||||
qs = player.getQuestState(Q00184_ArtOfPersuasion.class.getSimpleName());
|
||||
break;
|
||||
}
|
||||
case NIKOLAS_COOPERATION_ID:
|
||||
{
|
||||
qs = player.getQuestState(Q00185_NikolasCooperation.class.getSimpleName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (qs != null) && ((memoState < 0) || qs.isMemoState(memoState));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the memo state for the given player and quest.
|
||||
* @param player the player
|
||||
* @param questId the quest ID
|
||||
* @param memoState the memo state
|
||||
*/
|
||||
private static void setMemoState(L2PcInstance player, int questId, int memoState)
|
||||
{
|
||||
QuestState qs = null;
|
||||
switch (questId)
|
||||
{
|
||||
case ART_OF_PERSUASION_ID:
|
||||
{
|
||||
qs = player.getQuestState(Q00184_ArtOfPersuasion.class.getSimpleName());
|
||||
break;
|
||||
}
|
||||
case NIKOLAS_COOPERATION_ID:
|
||||
{
|
||||
qs = player.getQuestState(Q00185_NikolasCooperation.class.getSimpleName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (qs != null)
|
||||
{
|
||||
qs.setMemoState(memoState);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the memo state ex for the given player, quest and slot.
|
||||
* @param player the player
|
||||
* @param questId the quest ID
|
||||
* @param slot the slot
|
||||
* @return the memo state ex
|
||||
*/
|
||||
private static int getMemoStateEx(L2PcInstance player, int questId, int slot)
|
||||
{
|
||||
QuestState qs = null;
|
||||
switch (questId)
|
||||
{
|
||||
case ART_OF_PERSUASION_ID:
|
||||
{
|
||||
qs = player.getQuestState(Q00184_ArtOfPersuasion.class.getSimpleName());
|
||||
break;
|
||||
}
|
||||
case NIKOLAS_COOPERATION_ID:
|
||||
{
|
||||
qs = player.getQuestState(Q00185_NikolasCooperation.class.getSimpleName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (qs != null) ? qs.getMemoStateEx(slot) : -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the memo state ex for the given player and quest.
|
||||
* @param player the player
|
||||
* @param questId the quest ID
|
||||
* @param slot the slot
|
||||
* @param memoStateEx the memo state ex
|
||||
*/
|
||||
private static void setMemoStateEx(L2PcInstance player, int questId, int slot, int memoStateEx)
|
||||
{
|
||||
QuestState qs = null;
|
||||
switch (questId)
|
||||
{
|
||||
case ART_OF_PERSUASION_ID:
|
||||
{
|
||||
qs = player.getQuestState(Q00184_ArtOfPersuasion.class.getSimpleName());
|
||||
break;
|
||||
}
|
||||
case NIKOLAS_COOPERATION_ID:
|
||||
{
|
||||
qs = player.getQuestState(Q00185_NikolasCooperation.class.getSimpleName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (qs != null)
|
||||
{
|
||||
qs.setMemoStateEx(slot, memoStateEx);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Alarm();
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
@@ -1,224 +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.individual;
|
||||
|
||||
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.NpcSay;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Core AI.
|
||||
* @author DrLecter, Emperorc
|
||||
*/
|
||||
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()
|
||||
{
|
||||
super(Core.class.getSimpleName(), "ai/individual");
|
||||
registerMobs(CORE, DEATH_KNIGHT, DOOM_WRAITH, SUSCEPTOR);
|
||||
|
||||
_firstAttacked = false;
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
|
||||
if (GrandBossManager.getInstance().getBossStatus(CORE) == DEAD)
|
||||
{
|
||||
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
if (temp > 0)
|
||||
{
|
||||
startQuestTimer("core_unlock", temp, null, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
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 int hp = info.getInt("currentHP");
|
||||
final int mp = info.getInt("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 saveGlobalData()
|
||||
{
|
||||
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(m -> m.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.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.REMOVING_INTRUDERS));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_firstAttacked = true;
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.A_NON_PERMITTED_TARGET_HAS_BEEN_DISCOVERED));
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.INTRUDER_REMOVAL_SYSTEM_INITIATED));
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||
{
|
||||
if (npc.getId() == CORE)
|
||||
{
|
||||
final int objId = npc.getObjectId();
|
||||
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, objId, npc.getX(), npc.getY(), npc.getZ()));
|
||||
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.A_FATAL_ERROR_HAS_OCCURRED));
|
||||
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SYSTEM_IS_BEING_SHUT_DOWN));
|
||||
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.EMPTY));
|
||||
_firstAttacked = false;
|
||||
|
||||
GrandBossManager.getInstance().setBossStatus(CORE, DEAD);
|
||||
// Calculate Min and Max respawn times randomly.
|
||||
final long respawnTime = (Config.CORE_SPAWN_INTERVAL + getRandom(-Config.CORE_SPAWN_RANDOM, Config.CORE_SPAWN_RANDOM)) * 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.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();
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
@@ -1,146 +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.individual;
|
||||
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.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
|
||||
*/
|
||||
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()
|
||||
{
|
||||
super(FrightenedRagnaOrc.class.getSimpleName(), "ai/individual");
|
||||
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);
|
||||
broadcastNpcSay(npc, 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;
|
||||
broadcastNpcSay(npc, 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;
|
||||
broadcastNpcSay(npc, 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;
|
||||
broadcastNpcSay(npc, 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;
|
||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, msg);
|
||||
npc.setScriptValue(3);
|
||||
npc.doCast(SKILL.getSkill());
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
((L2Attackable) npc).dropItem(player, Inventory.ADENA_ID, ADENA);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, getRandomBoolean() ? NpcStringId.THANKS_BUT_THAT_THING_ABOUT_10_000_000_ADENA_WAS_A_LIE_SEE_YA : NpcStringId.YOU_RE_PRETTY_DUMB_TO_BELIEVE_ME);
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
@@ -1,49 +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.individual;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Ragna Orc Commander AI.
|
||||
* @author Zealar
|
||||
*/
|
||||
final class RagnaOrcCommander extends AbstractNpcAI
|
||||
{
|
||||
private static final int RAGNA_ORC_COMMANDER = 22694;
|
||||
|
||||
private RagnaOrcCommander()
|
||||
{
|
||||
super(RagnaOrcCommander.class.getSimpleName(), "ai/individual");
|
||||
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();
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
@@ -1,48 +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.individual;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Ragna Orc Hero AI.
|
||||
* @author Zealar
|
||||
*/
|
||||
final class RagnaOrcHero extends AbstractNpcAI
|
||||
{
|
||||
private static final int RAGNA_ORC_HERO = 22693;
|
||||
|
||||
private RagnaOrcHero()
|
||||
{
|
||||
super(RagnaOrcHero.class.getSimpleName(), "ai/individual");
|
||||
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();
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
@@ -1,48 +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.individual;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Ragna Orc Seer AI.
|
||||
* @author Zealar
|
||||
*/
|
||||
final class RagnaOrcSeer extends AbstractNpcAI
|
||||
{
|
||||
private static final int RAGNA_ORC_SEER = 22697;
|
||||
|
||||
private RagnaOrcSeer()
|
||||
{
|
||||
super(RagnaOrcSeer.class.getSimpleName(), "ai/individual");
|
||||
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();
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
@@ -1,3 +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.
|
||||
<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();
|
||||
}
|
||||
}
|
@@ -14,7 +14,7 @@
|
||||
* 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.zones.DragonValley;
|
||||
package ai.areas.DragonValley;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -27,7 +27,6 @@ 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 com.l2jmobius.util.Rnd;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
@@ -35,7 +34,7 @@ import ai.AbstractNpcAI;
|
||||
* Leopard Dragon Hachling AI.
|
||||
* @author Mobius
|
||||
*/
|
||||
final class LeopardDragonHachling extends AbstractNpcAI
|
||||
public final class LeopardDragonHachling extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int DRAGON_HACHLING = 23434;
|
||||
@@ -52,7 +51,6 @@ final class LeopardDragonHachling extends AbstractNpcAI
|
||||
|
||||
private LeopardDragonHachling()
|
||||
{
|
||||
super(LeopardDragonHachling.class.getSimpleName(), "ai/zones/DragonValley");
|
||||
addAttackId(DRAGON_HACHLING);
|
||||
}
|
||||
|
||||
@@ -63,7 +61,7 @@ final class LeopardDragonHachling extends AbstractNpcAI
|
||||
{
|
||||
if (npc.calculateDistance(nearestLocation(npc), false, false) < 100)
|
||||
{
|
||||
final int random = Rnd.get(1, 4);
|
||||
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
|
@@ -14,13 +14,14 @@
|
||||
* 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.zones.DragonValley;
|
||||
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;
|
||||
|
||||
@@ -28,14 +29,13 @@ import ai.AbstractNpcAI;
|
||||
* Mercenary Captain AI.
|
||||
* @author Mobius
|
||||
*/
|
||||
final class MercenaryCaptain extends AbstractNpcAI
|
||||
public final class MercenaryCaptain extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
private static final int MERCENARY_CAPTAIN = 33970;
|
||||
|
||||
private MercenaryCaptain()
|
||||
{
|
||||
super(MercenaryCaptain.class.getSimpleName(), "ai/zones/DragonValley");
|
||||
addSeeCreatureId(MERCENARY_CAPTAIN);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ final class MercenaryCaptain extends AbstractNpcAI
|
||||
{
|
||||
if (event.equals("BROADCAST_TEXT") && (npc != null))
|
||||
{
|
||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THE_SOUTHERN_PART_OF_DRAGON_VALLEY_IS_MUCH_MORE_DANGEROUS_THAN_THE_NORTH_BE_CAREFUL, 1000);
|
||||
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);
|
||||
}
|
@@ -14,13 +14,14 @@
|
||||
* 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.zones.DragonValley;
|
||||
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;
|
||||
|
||||
@@ -28,14 +29,13 @@ import ai.AbstractNpcAI;
|
||||
* Namo AI
|
||||
* @author Mobius
|
||||
*/
|
||||
final class Namo extends AbstractNpcAI
|
||||
public final class Namo extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
private static final int NAMO = 33973;
|
||||
|
||||
private Namo()
|
||||
{
|
||||
super(Namo.class.getSimpleName(), "ai/zones/DragonValley");
|
||||
addSeeCreatureId(NAMO);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ final class Namo extends AbstractNpcAI
|
||||
{
|
||||
if (event.equals("BROADCAST_TEXT") && (npc != null))
|
||||
{
|
||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THIS_PLACE_SWARMS_WITH_DRAGONS_BY_DAY_AND_UNDEAD_BY_NIGHT, 1000);
|
||||
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);
|
||||
}
|
@@ -14,13 +14,14 @@
|
||||
* 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.zones.DragonValley;
|
||||
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;
|
||||
|
||||
@@ -28,14 +29,13 @@ import ai.AbstractNpcAI;
|
||||
* Rakun AI.
|
||||
* @author Mobius
|
||||
*/
|
||||
final class Rakun extends AbstractNpcAI
|
||||
public final class Rakun extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
private static final int RAKUN = 33972;
|
||||
|
||||
private Rakun()
|
||||
{
|
||||
super(Rakun.class.getSimpleName(), "ai/zones/DragonValley");
|
||||
addSeeCreatureId(RAKUN);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ final class Rakun extends AbstractNpcAI
|
||||
{
|
||||
if (event.equals("BROADCAST_TEXT") && (npc != null))
|
||||
{
|
||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THIS_PLACE_SWARMS_WITH_DRAGONS_BY_DAY_AND_UNDEAD_BY_NIGHT, 1000);
|
||||
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);
|
||||
}
|
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();
|
||||
}
|
||||
}
|
@@ -1,3 +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's Lair or Dragon Valley.
|
||||
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>
|
@@ -1,5 +1,5 @@
|
||||
<html><body>Separated Soul:<br>
|
||||
The Claw of Antharas barely touched my face, but my soul was still ripped apart like this.<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>
|
@@ -14,7 +14,7 @@
|
||||
* 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.zones.FaeronVillage.AltarOfSouls;
|
||||
package ai.areas.FaeronVillage.AltarOfSouls;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
@@ -25,7 +25,7 @@ import ai.AbstractNpcAI;
|
||||
* Altar of Souls AI.
|
||||
* @author Mobius
|
||||
*/
|
||||
final class AltarOfSouls extends AbstractNpcAI
|
||||
public final class AltarOfSouls extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int ALTAR_OF_SOULS = 33920;
|
||||
@@ -43,7 +43,6 @@ final class AltarOfSouls extends AbstractNpcAI
|
||||
|
||||
private AltarOfSouls()
|
||||
{
|
||||
super(AltarOfSouls.class.getSimpleName(), "ai/zones/FaeronVillage");
|
||||
addStartNpc(ALTAR_OF_SOULS);
|
||||
addFirstTalkId(ALTAR_OF_SOULS);
|
||||
addTalkId(ALTAR_OF_SOULS);
|
@@ -1,8 +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>
|
||||
<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>
|
@@ -1,65 +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.zones.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
|
||||
*/
|
||||
final class RemembranceTower extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int REMEMBRANCE_TOWER = 33989;
|
||||
// Misc
|
||||
private static final int EMMITER_ID = 17250700;
|
||||
|
||||
private RemembranceTower()
|
||||
{
|
||||
super(RemembranceTower.class.getSimpleName(), "ai/zones/FaeronVillage");
|
||||
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();
|
||||
}
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
}
|
@@ -1,105 +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.zones.FantasyIsle;
|
||||
|
||||
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.model.quest.Quest;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Handys Block Checker Event AI.
|
||||
* @authors BiggBoss, Gigiikun
|
||||
*/
|
||||
final class HandysBlockCheckerEvent extends Quest
|
||||
{
|
||||
// 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()
|
||||
{
|
||||
super(-1, HandysBlockCheckerEvent.class.getSimpleName(), "Handy's Block Checker Event");
|
||||
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);
|
||||
|
||||
if ((holder.getBlueTeamSize() >= Config.MIN_BLOCK_CHECKER_TEAM_MEMBERS) && (holder.getRedTeamSize() >= Config.MIN_BLOCK_CHECKER_TEAM_MEMBERS))
|
||||
{
|
||||
holder.updateEvent();
|
||||
holder.broadCastPacketToTeam(new ExCubeGameRequestReady());
|
||||
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();
|
||||
_log.info("Handy's Block Checker Event is enabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
_log.info("Handy's Block Checker Event is disabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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");
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user