Prelude of War branch.
This commit is contained in:
115
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/AbstractNpcAI.java
vendored
Normal file
115
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/AbstractNpcAI.java
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* 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 org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.holders.MinionHolder;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* Abstract NPC AI class for datapack based AIs.
|
||||
* @author UnAfraid, Zoey76
|
||||
*/
|
||||
public abstract class AbstractNpcAI extends Quest
|
||||
{
|
||||
protected final Logger LOGGER = Logger.getLogger(getClass().getName());
|
||||
|
||||
public AbstractNpcAI()
|
||||
{
|
||||
super(-1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple on first talk event handler.
|
||||
*/
|
||||
@Override
|
||||
public String onFirstTalk(Npc npc, PlayerInstance 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);
|
||||
}
|
||||
|
||||
public void spawnMinions(Npc npc, String spawnName)
|
||||
{
|
||||
for (MinionHolder is : npc.getParameters().getMinionList(spawnName))
|
||||
{
|
||||
addMinion((MonsterInstance) npc, is.getId());
|
||||
}
|
||||
}
|
||||
|
||||
protected void followNpc(Npc npc, int followedNpcId, int followingAngle, int minDistance, int maxDistance)
|
||||
{
|
||||
World.getInstance().forEachVisibleObject(npc, Npc.class, npcAround ->
|
||||
{
|
||||
if (npcAround.getId() != followedNpcId)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final double distance = npc.calculateDistance3D(npcAround);
|
||||
if ((distance >= maxDistance) && npc.isScriptValue(0))
|
||||
{
|
||||
npc.setRunning();
|
||||
npc.setScriptValue(1);
|
||||
}
|
||||
else if ((distance <= (minDistance * 1.5)) && npc.isScriptValue(1))
|
||||
{
|
||||
npc.setWalking();
|
||||
npc.setScriptValue(0);
|
||||
}
|
||||
|
||||
final double course = Math.toRadians(followingAngle);
|
||||
final double radian = Math.toRadians(Util.convertHeadingToDegree(npcAround.getHeading()));
|
||||
final double nRadius = npc.getCollisionRadius() + npcAround.getCollisionRadius() + minDistance;
|
||||
final int x = npcAround.getLocation().getX() + (int) (Math.cos(Math.PI + radian + course) * nRadius);
|
||||
final int y = npcAround.getLocation().getY() + (int) (Math.sin(Math.PI + radian + course) * nRadius);
|
||||
final int z = npcAround.getLocation().getZ();
|
||||
|
||||
npc.getAI().moveTo(new Location(x, y, z));
|
||||
});
|
||||
}
|
||||
}
|
||||
141
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/CemeteryMonsters.java
vendored
Normal file
141
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/CemeteryMonsters.java
vendored
Normal file
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* 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.Aden;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.ChatType;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.network.NpcStringId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.NpcSay;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Cemetery Monsters AI
|
||||
* @author Gigi
|
||||
* @date 2018-07-10 - [20:17:37]
|
||||
*/
|
||||
public class CemeteryMonsters extends AbstractNpcAI
|
||||
{
|
||||
private static final int CHIEF_QUARTERMASTER = 23296;
|
||||
private static final int ROYAL_QUARTERMASTER = 23298;
|
||||
private static final int PERSONAL_MAGICIAN = 23291;
|
||||
private static final int ADEN_RAIDER = 19455;
|
||||
|
||||
private static final int[] MONSTERS =
|
||||
{
|
||||
23290, // Royal Knight
|
||||
PERSONAL_MAGICIAN, // Personal Magician
|
||||
23292, // Royal Guard
|
||||
23293, // Royal Guard Captain
|
||||
23294, // Chief Magician
|
||||
23295, // Operations Manager
|
||||
CHIEF_QUARTERMASTER, // Chief Quartermaster
|
||||
23297, // Escort
|
||||
ROYAL_QUARTERMASTER, // Royal Quartermaster
|
||||
23299, // Operations Chief of the 7th Divisiony
|
||||
23300 // Commander of Operations
|
||||
};
|
||||
|
||||
private static final NpcStringId[] SHOUT_MSG =
|
||||
{
|
||||
NpcStringId.WHAT_IS_THIS_SO_DISORIENTING,
|
||||
NpcStringId.WHAT_WOULD_YOU_KNOW_OF_LOYALTY,
|
||||
NpcStringId.I_CANNOT_I_WILL_NOT_BACK_DOWN,
|
||||
NpcStringId.MY_STRENGTH_HAS_NOT_YET_FULLY_RETURNED,
|
||||
NpcStringId.DO_NOT_DEFILE_THIS_PLACE_WITH_YOUR_PRESENCE,
|
||||
NpcStringId.HEH_INTERESTING_TRICK_YOU_USE_THERE,
|
||||
NpcStringId.I_WILL_REMEMBER_YOU,
|
||||
NpcStringId.I_WON_T_BEG_FOR_MY_LIFE_DO_WHAT_YOU_WILL,
|
||||
NpcStringId.BEHOLD_MY_POWER,
|
||||
NpcStringId.HIS_MAJESTY_TRAVIS_HAS_ORDERED_IMMEDIATE_EXECUTION,
|
||||
NpcStringId.ARE_YOU_TRYING_TO_MAKE_ME_DIE_A_SECOND_DEATH,
|
||||
NpcStringId.WHAT_FOOLISHNESS,
|
||||
NpcStringId.FOOL,
|
||||
NpcStringId.REMEMBER_OUR_HISTORY_OUR_GLORIOUS_HISTORY,
|
||||
NpcStringId.WHO_ARE_YOU_YOU_WEREN_T_HERE_BEFORE,
|
||||
NpcStringId.I_DON_T_HAVE_MUCH_TIME_LEFT,
|
||||
NpcStringId.I_M_TEN_STEPS_AHEAD_OF_YOU_DON_T_BOTHER_TRYING,
|
||||
NpcStringId.MAY_ADEN_LIVE_ON_FOREVER,
|
||||
NpcStringId.YOU_WON_T_LAY_A_FINGER_ON_HIS_MAJESTY_TRAVIS,
|
||||
NpcStringId.I_WILL_AVENGE_MY_FALLEN_COMRADES,
|
||||
NpcStringId.I_DON_T_HAVE_MUCH_TIME_LEFT,
|
||||
NpcStringId.A_MOUNTAIN_OF_CORPSES,
|
||||
NpcStringId.I_WILL_DESTROY_YOU_JUST_AS_I_HAVE_DESTROYED_THE_ENEMY_FORCES,
|
||||
NpcStringId.WELL_WHAT_DO_YOU_KNOW_YOU_RE_GUTSIER_THAN_YOU_LOOK,
|
||||
NpcStringId.WE_WERE_THE_ONES_WHO_CLEANSED_THIS_PLACE_OF_EVIL_PESTS,
|
||||
NpcStringId.TODAY_S_YOUR_JUDGMENT_DAY,
|
||||
NpcStringId.A_LONG_SLUMBER_HAS_COME_TO_AN_END,
|
||||
NpcStringId.LOOK_UPON_THIS_GREAT_GRAVE_AND_TELL_ME_YOU_SEE_NOTHING,
|
||||
NpcStringId.YOU,
|
||||
NpcStringId.AGH_MY_EYE_MY_EYE,
|
||||
NpcStringId.SO_THIS_IS_THE_END,
|
||||
NpcStringId.NO_USE_TRYING_YOUR_PETTY_TRICKS,
|
||||
NpcStringId.FEEL_FOR_YOURSELF_THE_STRENGTH_OF_MY_WILL,
|
||||
NpcStringId.I_HEAR_HIS_MAJESTY_S_VOICE_I_HEAR_IT_EVERY_WAKING_MOMENT,
|
||||
};
|
||||
|
||||
private CemeteryMonsters()
|
||||
{
|
||||
addAttackId(MONSTERS);
|
||||
addKillId(CHIEF_QUARTERMASTER, ROYAL_QUARTERMASTER, PERSONAL_MAGICIAN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon)
|
||||
{
|
||||
if (getRandom(25) < 5)
|
||||
{
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), SHOUT_MSG[getRandom(SHOUT_MSG.length)]));
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
|
||||
{
|
||||
if (getRandom(100) < 5)
|
||||
{
|
||||
switch (npc.getId())
|
||||
{
|
||||
case CHIEF_QUARTERMASTER:
|
||||
case ROYAL_QUARTERMASTER:
|
||||
{
|
||||
killer.addExpAndSp(getRandom(15_000_000, 20_000_00), 0);
|
||||
npc.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_HAS_OBTAINED_BONUS_XP_FOR_DEFEATING_A_RARE_A_GRADE_SOLDIER, ExShowScreenMessage.BOTTOM_CENTER, 10000, false, killer.getName()));
|
||||
break;
|
||||
}
|
||||
case PERSONAL_MAGICIAN:
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
Npc raider = addSpawn(ADEN_RAIDER, killer, true, 180000, false);
|
||||
addAttackPlayerDesire(raider, killer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new CemeteryMonsters();
|
||||
}
|
||||
}
|
||||
5
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-01.html
vendored
Normal file
5
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-01.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Herphah:<br>
|
||||
How about meeting <font color="LEVEL">Ruine </font>?<br>
|
||||
He's looking for men to search the <font color="LEVEL">Dimensional Rift</font>. There must be some problem in the <font color="LEVEL">Dimensional Rift</font>. If so, you can go wherever you want.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Herphah 34362-02.html">"I'd like to know about the Hunting Zone for growth."</Button>
|
||||
</body></html>
|
||||
12
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-02.html
vendored
Normal file
12
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-02.html
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<html><body>Herphah:<br>
|
||||
Aden is a vast continent. you can easily find places helpful for your growth.<br>
|
||||
There are countless Hunting Zones. I can recommend the best of them. Which zones are you interested in?<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Herphah 34362-03.html">"Hunting Zones recommended for level 85 or lower."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Herphah 34362-04.html">"Hunting Zones recommended for level 85 to 87."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Herphah 34362-05.html">"Hunting Zones recommended for level 88 to 92."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Herphah 34362-06.html">"Hunting Zones recommended for level 93 to 94."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Herphah 34362-07.html">"Hunting Zones recommended for level 95 to 96."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Herphah 34362-08.html">"Hunting Zones recommended for level 97 to 98."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Herphah 34362-09.html">"Hunting Zones recommended for level 99 or higher."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Herphah 34362-10.html">"Instanced Dungeon Hunting Zones recommended for each level."</Button>
|
||||
</body></html>
|
||||
8
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-03.html
vendored
Normal file
8
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-03.html
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<html><body>Herphah:<br>
|
||||
Hmm... Zones recommended for level 85 or lower?<br>
|
||||
The question is too broad. Aden is vast and has many hunting zones. But it's really hard to answer your question without knowing exactly what level is recommendable to you.<br>
|
||||
Ah! Right. Did you read the <font color="LEVEL">letters</font> from <font color="LEVEL">Kekropus</font> and <font color="LEVEL">Queen Navari</font>?<br>
|
||||
Some <font color="LEVEL">scrolls</font> must be regularly delivered to you. Worried that young adventurers grow fast but don't know what to do or what to aim for, Kekropus and Queen Navari have regularly sent you letters to tell where to go.<br>
|
||||
If you haven't read them, go to the bottom right. You see some scrolls. They are the letters from Kekropus or Queen Navari.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Herphah 34362-02.html">"Tell me more about the hunting zones."</Button>
|
||||
</body></html>
|
||||
7
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-04.html
vendored
Normal file
7
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-04.html
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<html><body>Herphah:<br>
|
||||
Levels 85 to 87... You can do more things now.<br>
|
||||
How about visiting the <font color="LEVEL">Hamak Underground Ruins</font>? You see <font color="LEVEL">Gatekeeper Elisa</font> up there? She will teleport you to the <font color="LEVEL">Talking Island</font>. From there, Sayunes will send you to the <font color="LEVEL">Ruins od Ye Sagira</font>, where you can find <font color="LEVEL">Giant's Minion Hadel</font>. He will give you missions.<br>
|
||||
Alternatively, you can go to the <font color="LEVEL">Altar of Evil</font> andr the <font color="LEVEL">Blood Swampland</font>. <font color="LEVEL">gatekeeper Elisa</font> will teleport you to the <font color="LEVEL">Town of Gludio</font>. From there, <font color="LEVEL">Gatekeeper Bella</font> will send you to the <font color="LEVEL">Dark Elf Village</font>. Use the <font color="LEVEL">Teleport Device</font> in the village to teleport to the <font color="LEVEL">Blood Swampland</font>.<br>
|
||||
<font color="LEVEL">Black Wizard Lepathia</font> and <font color="LEVEL">Vollodos</font> there desperately need help. Their mission will be helpful for your growth.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Herphah 34362-02.html">"Tell me more about the hunting zones."</Button>
|
||||
</body></html>
|
||||
7
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-05.html
vendored
Normal file
7
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-05.html
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<html><body>Herphah:<br>
|
||||
You mean those for levels 88 to 92?<br>
|
||||
Have you heard about the <font color="LEVEL">Fairy Settlement</font>? I recommend that zone. To get there, ask <font color="LEVEL">Gatekeeper Elisa</font> to teleport you to the <font color="LEVEL">Hunters Village</font>.<br>
|
||||
If you've never been there, you'd better perform the quest <font color="LEVEL">Shadow of Terror: Blackish Red Fog</font> Through <font color="LEVEL">Magmeld Delegation Leader Lada</font> before heading to the Fairy Settlement.<br>
|
||||
Then, <font color="LEVEL">Gatekeeper Sookie</font> in the <font color="LEVEL">Arms of Timiniel</font>. When you get there, ask <font color="LEVEL">Fairy Refugees</font> and <font color="LEVEL">Nerupa</font> what you have to do. The <font color="LEVEL">Mother Tree Guardians</font> has recently dispatched <font color="LEVEL">Rafini</font> to the Arms of Timiniel. <font color="LEVEL">Rafini</font> may need your help.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Herphah 34362-02.html">"Tell me more about the hunting zones."</Button>
|
||||
</body></html>
|
||||
6
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-06.html
vendored
Normal file
6
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-06.html
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Herphah:<br>
|
||||
Of the zones for levels 93 to 94, the <font color="LEVEL">Isle of Souls</font> is the most important. The island has a long history with Kamaels. I'm sure that what happened in the Isle of Souls drove Kamaels to create the Giant Trackers.<br>
|
||||
If this is your first visit, ask <font color="LEVEL">Gatekeeper Elisa</font> to teleport you to the <font color="LEVEL">Town of Gludio</font>. From there go to the <font color="LEVEL">Gludin Village</font> through <font color="LEVEL">Gatekeeper Bella</font>. Receive the quest <font color="LEVEL">Mysterious Journey</font> from <font color="LEVEL">Head Blacksmith Tapoy</font> there and go to the <font color="LEVEL">Isle of Souls Harbor</font> through <font color="LEVEL">Gatekeeper Richlin</font> If you're been there, go to <font color="LEVEL">Kamael Village</font> through <font color="LEVEL">Gatekeeper Elisa</font>. Use the <font color="LEVEL">Teleport Device</font> there to teleport to the <font color="LEVEL">Isle of Souls Harbor</font>.<br>
|
||||
Once you arrive at the Isle of Souls, you can undertake from <font color="LEVEL">Hesed</font> the missions related with the quests <font color="LEVEL">Uncover the Secret</font> and <font color="LEVEL">More Aggressive Operation</font>.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Herphah 34362-02.html">"Tell me more about the hunting zones."</Button>
|
||||
</body></html>
|
||||
5
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-07.html
vendored
Normal file
5
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-07.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Herphah:<br>
|
||||
There's a hunting zone for levels 95 to 96 not far from here.<br>
|
||||
Go up the stairs, and you will see <font color="LEVEL">Agent Georgio</font>. Ask him about the quest <font color="LEVEL">Kicking Out Unwelcome Guests</font>. He wil probably tell you to go to the <font color="LEVEL">Seal of Shilen</font>.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Herphah 34362-02.html">"Tell me more about the hunting zones."</Button>
|
||||
</body></html>
|
||||
7
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-08.html
vendored
Normal file
7
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-08.html
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<html><body>Herphah:<br>
|
||||
From levels 97 to 99... You should start to find appropriate zones on your own. I'd like to recommend three zones.<br>
|
||||
The first is the <font color="LEVEL">Cemetery</font>. It is the closest one of the three. Go to the <font color="LEVEL">Seal of Shilen</font> through the gatekeeper here, and find the <font color="LEVEL">Aden Vanguard Quartermaster</font>. He will give you missions related with <font color="LEVEL">the Fallen King's Men</font>.<br>
|
||||
The second is the <font color="LEVEL">Blazing Swamp</font>. It is not far from here. Go to the <font color="LEVEL">Blazing Swamp</font> through the gatekeeper and find a little unusual orc. Ask the orc about the quest <font color="LEVEL">Waiting for Pa'agrio</font>. Oh, don't worry. Some orcs are quite friendly.<br>
|
||||
The last is the <font color="LEVEL">Pagan Temple</font>. To get there, you should first go to the <font color="LEVEL">Town of Rune</font> through the gatekeeper. Find <font color="LEVEL">Priestess of Light Razen</font> inside the Pagan Temple and ask him about <font color="LEVEL">Triol's Movement</font>. He will tell you what to do.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Herphah 34362-02.html">"Tell me more about the hunting zones."</Button>
|
||||
</body></html>
|
||||
8
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-09.html
vendored
Normal file
8
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-09.html
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<html><body>Herphah:<br>
|
||||
You have to establish close relationships with many <font color="LEVEL">factions</font>.<br>
|
||||
First, for <font color="LEVEL">level 99</font>, I recommend the <font color="LEVEL">Blackbird Clan</font> in <font color="LEVEL">Hellbound</font> led by Leona Blackbird. If you are <font color="LEVEL">level 100</font>, I recommend you to go to the <font color="LEVEL">Giant's Cave</font>, where you can find the <font color="LEVEL">Giant Trackers</font>.<br>
|
||||
If you reach <font color="LEVEL">level 101</font>, go to the <font color="LEVEL">Atelia Fortress</font> and meet the <font color="LEVEL">Kingdom's Royal Guard</font>. it was establish by the order of King of Aden.<b>
|
||||
If you are <font color="LEVEL">level 102</font> or higher, help the <font color="LEVEL">Mother Tree Guardians</font> in the <font color="LEVEL">Enchanted Valley</font>. Or you can interact with the <font color="LEVEL">Unworldly Visitors</font> in the <font color="LEVEL">Guarden of Spirits</font>. You can also go to the <font color="LEVEL">Superion Fortress</font>, the final stronghold of the <font color="LEVEL">Giant Trackers</font>.<br>
|
||||
If you are <font color="LEVEL">level 103</font> or higher, go to the <font color="LEVEL">Shadow of the Mother Tree</font>. The <font color="LEVEL">Mother Tree Guardians</font> will be waiting for you in the Elven Village.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Herphah 34362-02.html">"Tell me more about the hunting zones."</Button>
|
||||
</body></html>
|
||||
8
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-10.html
vendored
Normal file
8
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362-10.html
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<html><body>Herphah:<br>
|
||||
Do you want to know the <font color="LEVEL">instanced dungeons</font> recommendable for each level?<br>
|
||||
Well, do you see the <font color="LEVEL">Kartia's Researcher</font> over there? The researcher can send you into the <font color="LEVEL">Kartia's Labyrinth</font>. From <font color="LEVEL">level 85 to level 90 and up to level 95</font>, you can enter there <font color="LEVEL">alone</font> or <font color="LEVEL">with other colleagues</font>.<br>
|
||||
For <font color="LEVEL">level 99 or higher</font>, I recommend the <font color="LEVEL">Nightmare Kamaloka</font> You can enter through <font color="LEVEL">Captain Kurtiz</font>. Or, you can go to the <font color="LEVEL">Town of Gludio</font> and ask <font color="LEVEL">Refugee Neti</font> about the <font color="LEVEL">Ashen Shadow Revolutionaries</font>. It's a little far, but I recommend <font color="LEVEL">Mystic Tavern</font> in the <font color="LEVEL">underground Gainak</font>.<br>
|
||||
If you are <font color="LEVEL">level 100</font>, raid the <font color="LEVEL">Command Post</font> in the <font color="LEVEL">Atelia Fortress</font>. If your level is higher, ask <font color="LEVEL">Agent Georgio</font> at the top of the stairs to teleport you to the <font color="LEVEL">Altar of Shilen</font>.<br>
|
||||
Are you above <font color="LEVEL">level 103</font>? If som I recommend you to create a <font color="LEVEL">coalition</font> and join the <font color="LEVEL">Spezion Epic Battle</font>. You have a great number of options.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Herphah 34362-02.html">"Tell me more about the hunting zones."</Button>
|
||||
</body></html>
|
||||
9
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362.html
vendored
Normal file
9
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/34362.html
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<html><body>Herphah:<br>
|
||||
I traveled around the continent and decided to stay here for a while... Then, I saw you! What fate!<br>
|
||||
If you are wandering without knowing what to do, I can help you. How about starting the <font color="LEVEL">Way of Wandering Knight </font>?
|
||||
I also recommend visiting the Adventure Guild, which has many missions appropriate for you.<br>
|
||||
I'm now working with the <font color="LEVEL">Adventure Guild </font>so you can trust them.<br>
|
||||
Let me know if you need any advice.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Herphah 34362-01.html"><font color="LEVEL">"Is there any other ways of growth?"</font></button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
||||
86
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/Herphah.java
vendored
Normal file
86
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Herphah/Herphah.java
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* 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.Aden.Herphah;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Aden Faction Npc AI
|
||||
* @author NightBR
|
||||
* @date 2019-03-27
|
||||
*/
|
||||
public class Herphah extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
private static final int HERPHAH = 34362;
|
||||
// Misc
|
||||
@SuppressWarnings("unused")
|
||||
private static final String[] RANDOM_VOICE =
|
||||
{
|
||||
"Npcdialog1.herphah_ep50_greeting_1",
|
||||
"Npcdialog1.herphah_ep50_greeting_2",
|
||||
"Npcdialog1.herphah_ep50_greeting_3"
|
||||
};
|
||||
|
||||
private Herphah()
|
||||
{
|
||||
addStartNpc(HERPHAH);
|
||||
addTalkId(HERPHAH);
|
||||
addFirstTalkId(HERPHAH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "34362-01.html":
|
||||
case "34362-02.html":
|
||||
case "34362-03.html":
|
||||
case "34362-04.html":
|
||||
case "34362-05.html":
|
||||
case "34362-06.html":
|
||||
case "34362-07.html":
|
||||
case "34362-08.html":
|
||||
case "34362-09.html":
|
||||
case "34362-10.html":
|
||||
{
|
||||
return event;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(Npc npc, PlayerInstance player)
|
||||
{
|
||||
// Chance to broadcast at nearby players?
|
||||
// player.sendPacket(new PlaySound(RANDOM_VOICE[getRandom(3)]));
|
||||
return "34362.html";
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Herphah();
|
||||
}
|
||||
}
|
||||
8
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Penny/34413.html
vendored
Normal file
8
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Penny/34413.html
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<html><body>Adventure Guildsman Penny:<br>
|
||||
Your ability is a reflection of your life. If you continue to do your best, your ability will grow.<br>
|
||||
Me? As you see, I don't have any talent for hunting, but I'm quite good at distributing tasks to adventures.<br>
|
||||
If you have a <font color="LEVEL">Medal of Honor </font>or a<font color="LEVEL"> Grand Medal of Honor </font>I'll raise your amity points, so let me know.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Penny medal"><font color="LEVEL">"I have a Medal of Honor."</font></button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Penny grand_medal"><font color="LEVEL">"I have a Grand Medal of Honor."</font></button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
||||
79
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Penny/Penny.java
vendored
Normal file
79
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Penny/Penny.java
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* 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.Aden.Penny;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PlaySound;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Aden Faction Npc AI
|
||||
* @author NightBR
|
||||
* @date 2019-03-27
|
||||
*/
|
||||
public class Penny extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
private static final int PENNY = 34413;
|
||||
// Misc
|
||||
private static final String[] RANDOM_VOICE =
|
||||
{
|
||||
"Npcdialog1.peny_ep50_greeting_7",
|
||||
"Npcdialog1.peny_ep50_greeting_8",
|
||||
"Npcdialog1.peny_ep50_greeting_9"
|
||||
};
|
||||
|
||||
private Penny()
|
||||
{
|
||||
addStartNpc(PENNY);
|
||||
addTalkId(PENNY);
|
||||
addFirstTalkId(PENNY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "medal":
|
||||
{
|
||||
// Take medal / Give rep?
|
||||
return null;
|
||||
}
|
||||
case "grand_medal":
|
||||
{
|
||||
// Take medal / Give rep?
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(Npc npc, PlayerInstance player)
|
||||
{
|
||||
player.sendPacket(new PlaySound(3, RANDOM_VOICE[getRandom(3)], 0, 0, 0, 0, 0));
|
||||
return "34413.html";
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Penny();
|
||||
}
|
||||
}
|
||||
96
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Ruine/Ruine.java
vendored
Normal file
96
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Ruine/Ruine.java
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* 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.Aden.Ruine;
|
||||
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Ruine AI
|
||||
* @author Gigi
|
||||
* @date 2017-02-18 - [20:14:22]
|
||||
*/
|
||||
public class Ruine extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
private static final int COD_ADEN_OFFICER = 34229;
|
||||
// Level checks
|
||||
private static final int MIN_LEVEL_CRACK = 95;
|
||||
private static final int MIN_LEVEL_RIFT = 100;
|
||||
// Teleports
|
||||
private static final Location DIMENSIONAL_CRACK = new Location(-119304, -182456, -6752);
|
||||
private static final Location DIMENSIONAL_RIFT = new Location(140629, 79672, -5424);
|
||||
|
||||
private Ruine()
|
||||
{
|
||||
addStartNpc(COD_ADEN_OFFICER);
|
||||
addFirstTalkId(COD_ADEN_OFFICER);
|
||||
addTalkId(COD_ADEN_OFFICER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
|
||||
{
|
||||
String htmltext = null;
|
||||
|
||||
switch (event)
|
||||
{
|
||||
case "cod_aden_officer001.htm":
|
||||
case "cod_aden_officer004.htm":
|
||||
case "cod_aden_officer005.htm":
|
||||
{
|
||||
htmltext = event;
|
||||
break;
|
||||
}
|
||||
case "crack_teleport":
|
||||
{
|
||||
if (player.getLevel() >= MIN_LEVEL_CRACK)
|
||||
{
|
||||
player.teleToLocation(DIMENSIONAL_CRACK);
|
||||
break;
|
||||
}
|
||||
htmltext = "cod_aden_officer003.htm";
|
||||
break;
|
||||
}
|
||||
case "rift_teleport":
|
||||
{
|
||||
if (player.getLevel() >= MIN_LEVEL_RIFT)
|
||||
{
|
||||
player.teleToLocation(DIMENSIONAL_RIFT);
|
||||
break;
|
||||
}
|
||||
htmltext = "cod_aden_officer003.htm";
|
||||
break;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(Npc npc, PlayerInstance player)
|
||||
{
|
||||
return "cod_aden_officer001.htm";
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Ruine();
|
||||
}
|
||||
}
|
||||
10
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Ruine/cod_aden_officer001.htm
vendored
Normal file
10
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Ruine/cod_aden_officer001.htm
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<html><body>Dimension Seeker Ruine:<br>
|
||||
Nice to meet you. I am Dimension Seeker Ruine.<br>
|
||||
Many problems associated with the dimensions have been occurring nowadays. I have been asked by Aden Castle to investigate, and that is what brings me here.<br>
|
||||
Among the various issues relating to the dimension, the issues that I am involved with are the <font color="LEVEL">Dimensional Crack</font> and the <font color="LEVEL">Dimensional Rift</font>.<br>
|
||||
If you would like, I will send you to the <font color="LEVEL">Dimensional Crack</font> and the <font color="LEVEL">Dimensional Rift</font>. Please help me with searching the dimension.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Ruine cod_aden_officer004.htm">"Tell me about the Dimensional Crack."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Ruine cod_aden_officer005.htm">"Tell me about the Dimensional Rift."</Button>
|
||||
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest Ruine crack_teleport">"I want to teleport to the Dimensional Crack (Lv. 95+)."</Button>
|
||||
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest Ruine rift_teleport">"I want to teleport to the Dimensional Rift (Lv. 100+)."</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><body>Dimension Seeker Ruine:<br>
|
||||
Something has happened with the dimension, and I am investigating it at the moment. Could you please return later?<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest Ruine cod_aden_officer001.htm">Back</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><body>Dimension Seeker Ruine:<br>
|
||||
I don't think that you meet our qualifications for dimension seekers.<br>
|
||||
(Your level is too low.)
|
||||
</body></html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<html><body>Dimension Seeker Ruine:<br>
|
||||
The <font color="LEVEL">Dimensional Crack</font>, they say, is originally a labyrinth that was created by the influence of the Seven Signs. However, one day, it was closed shut. Because it happened before the Ertheia came into the Material Realm, we knew nothing of the Dimensional Crack.<br>
|
||||
We were investigating the warping of the dimension, which we discovered in Faeron Village. In the process, we found that the dimensional warp was linked to the Dimensional Crack, and that the Dimensional Crack was growing in the process.<br>
|
||||
Also, we found that the monsters that appear in the Dimensional Crack were similar to the monsters that had attacked Faeron Village, and started investigating this fact.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest Ruine cod_aden_officer001.htm">Back</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><body>Dimension Seeker Ruine:<br>
|
||||
<font color="LEVEL">The Dimensional Rift</font> was a phenomenon that was identified after the Dimensional Crack was discovered, during additional investigations of Aden Castle and the Ivory Tower. It all began when strange movement was detected in the sealed off Catacomb of the Witch.<br>
|
||||
Monsters began appearing in the Catacomb of the Witch. We felt they were out of place, and got to thinking that they might have something to do with the various recent events that have to do with the dimension. We therefore participated in the survey as well.<br>
|
||||
What we found was that as the Dimensional Crack grew, the Dimensional Rift which had existed previously had been growing. The Catacomb of the Witch has now been completely consumed by the Dimensional Rift. I don't know if this is a good or bad thing, but the Dimensional Rift has not expanded beyond the size of the Catacomb of the Witch. However, we could not leave the situation as it was, and thus we began our expedition of the Dimensional Rift.<br>
|
||||
The Dimensional Rift is even more dangerous than then Dimensional Crack. You must be even more careful there.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest Ruine cod_aden_officer001.htm">Back</Button>
|
||||
</body></html>
|
||||
4
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Tarti/34360.html
vendored
Normal file
4
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Tarti/34360.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Tarti:<br>
|
||||
What is it? Just tell me if you want to undertake the missions of Unworldly Visitors.<br>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
||||
59
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Tarti/Tarti.java
vendored
Normal file
59
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Aden/Tarti/Tarti.java
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 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.Aden.Tarti;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PlaySound;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Tarti AI
|
||||
* @author Gigi
|
||||
* @date 2019-08-17 - [22:44:02]
|
||||
*/
|
||||
public class Tarti extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
private static final int TARTI = 34360;
|
||||
// Misc
|
||||
private static final String[] TARTI_VOICE =
|
||||
{
|
||||
"Npcdialog1.tarti_ep50_greeting_8",
|
||||
"Npcdialog1.tarti_ep50_greeting_9",
|
||||
"Npcdialog1.tarti_ep50_greeting_10"
|
||||
};
|
||||
|
||||
private Tarti()
|
||||
{
|
||||
addStartNpc(TARTI);
|
||||
addFirstTalkId(TARTI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(Npc npc, PlayerInstance player)
|
||||
{
|
||||
player.sendPacket(new PlaySound(3, TARTI_VOICE[getRandom(3)], 0, 0, 0, 0, 0));
|
||||
return "34360.html";
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Tarti();
|
||||
}
|
||||
}
|
||||
169
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/AncientCityArcan/AncientArcanCity.java
vendored
Normal file
169
L2J_Mobius_7.0_PreludeOfWar/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 org.l2jmobius.gameserver.enums.Movie;
|
||||
import org.l2jmobius.gameserver.instancemanager.QuestManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.model.quest.QuestState;
|
||||
import org.l2jmobius.gameserver.model.spawns.SpawnGroup;
|
||||
import org.l2jmobius.gameserver.model.spawns.SpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.ScriptZone;
|
||||
import org.l2jmobius.gameserver.network.NpcStringId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.Earthquake;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
import org.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 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 ScriptZone BROADCAST_ZONE = ZoneManager.getInstance().getZoneById(23600, ScriptZone.class); // Ancient Arcan City zone
|
||||
private static final ScriptZone TELEPORT_ZONE = ZoneManager.getInstance().getZoneById(12015, ScriptZone.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, Npc npc, PlayerInstance player)
|
||||
{
|
||||
if (event.equals("CHANGE_STATE"))
|
||||
{
|
||||
isCeremonyRunning = !isCeremonyRunning;
|
||||
|
||||
for (PlayerInstance 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(Creature creature, ZoneType zone)
|
||||
{
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
final PlayerInstance 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, Npc 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();
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Enchant Setter Lykus:<br>
|
||||
Just trust me and enchant only once! Believe in yourself!
|
||||
</body></html>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/AncientCityArcan/Lykus/Lykus.java
vendored
Normal file
94
L2J_Mobius_7.0_PreludeOfWar/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 org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Lykus AI.
|
||||
* @author St3eT
|
||||
*/
|
||||
public 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, Npc npc, PlayerInstance 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();
|
||||
}
|
||||
}
|
||||
@@ -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
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/AncientCityArcan/Mumu/32900.html
vendored
Normal file
6
L2J_Mobius_7.0_PreludeOfWar/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
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/AncientCityArcan/Mumu/Mumu.java
vendored
Normal file
65
L2J_Mobius_7.0_PreludeOfWar/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 org.l2jmobius.gameserver.enums.Movie;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Mumu AI.
|
||||
* @author St3eT
|
||||
*/
|
||||
public 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, Npc npc, PlayerInstance 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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<html><body>Aden Vanguard Barton:<br>
|
||||
Who are you! Identify yourself!<br>
|
||||
Well, you don't look like the enemy. What brings you to this dangerous place? <br>
|
||||
Have you come after hearing that the Aden Vanguard has secured strongholds in the Atelia Fortress? What? I wasn't captured. It's called infiltration. Hmph.<br>
|
||||
Anyway thanks to you and your friends we were to secure this stronghold, so I should reward you.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager give_tp_st_1">"Thanks."</Button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<html><body>Aden Vanguard Barton:<br>
|
||||
Although this place is the closest to the entrance, you still have to face many Embryo on the way here.<br>
|
||||
Elikia heard of the situation and made this Teleport Device for us. If you'll be staying for a while, it will be very useful.<br>
|
||||
But I heard that it only works for 24 hours, since it's not perfect. Still, you should find it useful.<br>If you come back tomorrow, I'll prepare a new one for you.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h tutorial_close">"Thanks."</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<html><body>Aden Vanguard Hayuk:<br>
|
||||
Who are you! Identify yourself!<br>
|
||||
Well, you don't look like the enemy. What brings you to this dangerous place? <br>
|
||||
Have you come after hearing that the Aden Vanguard has secured strongholds in the Atelia Fortress? What? I wasn't captured. It's called infiltration. Hmph.<br>
|
||||
Anyway thanks to you and your friends we were to secure this stronghold, so I should reward you.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager give_tp_st_2">"Thanks."</Button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<html><body>Aden Vanguard Hayuk:<br>
|
||||
Although this place is the closest to the entrance, you still have to face many Embryo on the way here.<br>
|
||||
Elikia heard of the situation and made this Teleport Device for us. If you'll be staying for a while, it will be very useful.<br>
|
||||
But I heard that it only works for 24 hours, since it's not perfect. Still, you should find it useful.<br>If you come back tomorrow, I'll prepare a new one for you.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h tutorial_close">"Thanks."</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><body>Aden Vanguard Elise:<br>
|
||||
Who are you? Oh, you are not the enemy. I'm sorry. This place is just so dangerous...<br>
|
||||
What brings you here? I've come to secure this stronghold. I've just been hiding away, since the resistance of the Embryo has gotten worse.<br>
|
||||
I know you've helped me here, so I'll reward you for that.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager give_tp_st_3">"Thanks."</Button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><body>Aden Vanguard Elise:<br>
|
||||
You can use this Teleport Device to teleport near this stronghold. Impressing, right?<br>
|
||||
It was made by Elikia. It will be useful if you'll be staying around for a while. Here, take it.<br>
|
||||
Elikia did say that the device doesn't last long. He said it lasts for 24 hours...<br>
|
||||
But if you come back tomorrow, I'll have another one ready for you.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h tutorial_close">"Thanks."</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,9 @@
|
||||
<html><body>Aden Vanguard Eliyah:<br>
|
||||
Who are you? Do you want to experience the wrath of my spirit?<br>
|
||||
Hmm... You don't look like the enemy. Be glad. You would've been beat to death by my spirits.<br>
|
||||
I'm busy protecting this stronghold. What do you want? I've been taking a break, since the Embryo are so scared of me and have been trying to escape.<br>
|
||||
Well, since you helped me regain the stronghold, I'll give you a little something.<br>
|
||||
Anyway thanks to you and your friends we were to secure this stronghold, so I should reward you.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager give_tp_st_4">"Thanks."</Button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><body>Aden Vanguard Eliyah:<br>
|
||||
This is a device that lets you teleport to Stronghold IV very easily.<br>
|
||||
This was made by Elikia. It will be very useful if you'll be staying here for a while.<br>
|
||||
Just remember that the device lasts for 24 hours, since this place is very unstable.<br>
|
||||
If you need it again, come back tomorrow. I'll give you a new one.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h tutorial_close">"Thanks."</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<html><body>Blackbird Clan Member Glenkinchie:<br>
|
||||
Who are you? I'm Glenkinchie from the honorable Blackbird clan.<br>
|
||||
Those vicious Embryos are up to something in the Atelia Fortress. They are still within our sight, but we are having a hard time infiltrating the Command Post on the 3rd floor. <br>
|
||||
But I don't mind working this hard for Leona. Don't you agree?<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager 34063-2.htm">"Tell me about the Command Post."</Button><Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><body>Blackbird Clan Member Glenkinchie:<br>
|
||||
The <font color="LEVEL">Command Post</font> is known to be the place where new soldiers are trained. We don't know what kind of soldiers they are creating, though.<br>
|
||||
What we do know is that the gate opens when <font color="LEVEL">Burnstein</font> <font color="LEVEL">comes out and goes back inside the Command Post</font>. Since the gate rarely opens, it's hard for us to go inside the investigate.<br>
|
||||
That's why we asked Devianne for help to hold the gate open.<br>
|
||||
The only way we can get inside is by having <font color="LEVEL">Devianne</font>, who is hiding near the <font color="LEVEL">entrance to the Command Post</font>, hold the gate open when Burnstein goes back inside.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<html><body>Blackbird Clan Member Hurak:<br>
|
||||
I trust Leona, but that doesn't mean I trust everyone easily.<br>
|
||||
I can't believe I fell for such a simple trick. You should be careful too. Things are just getting started...<br>They've even created a command post within the fortress, so we have to put our guard up.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager 34064-2.htm">"Tell me about the Command Post."</Button><Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<html><body>Blackbird Clan Member Hurak:<br>
|
||||
The Embryo are training their new recruits in the <font color="LEVEL">Command Post</font>.
|
||||
The security is so tight, that going inside is hard in itself.<br>The one way to go in is when <font color="LEVEL">Burnstein</font> comes out and <font color="LEVEL">tries to go back inside the Command Post</font>. We have our own method to do that.<br>
|
||||
<font color="LEVEL">Devianne</font> is hiding near the <font color="LEVEL">entrance to the Command Post</font> on the 3rd floor, to hold the gate open whenever Burnstein goes back inside. It should be helpful when you are trying to go inside.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<html><body>Blackbird Clan Member Laffian:<br>
|
||||
I trust Leona, but that doesn't mean I trust everyone easily.<br>
|
||||
I can't believe I fell for such a simple trick. You should be careful too. Things are just getting started...<br>They've even created a command post within the fortress, so we have to put our guard up.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager 34065-2.htm">"Tell me about the Command Post."</Button><Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<html><body>Blackbird Clan Member Laffian:<br>
|
||||
The Embryo are training their new recruits in the <font color="LEVEL">Command Post</font>.
|
||||
The security is so tight, that going inside is hard in itself.<br>The one way to go in is when <font color="LEVEL">Burnstein</font> comes out and <font color="LEVEL">tries to go back inside the Command Post</font>. We have our own method to do that.<br>
|
||||
<font color="LEVEL">Devianne</font> is hiding near the <font color="LEVEL">entrance to the Command Post</font> on the 3rd floor, to hold the gate open whenever Burnstein goes back inside. It should be helpful when you are trying to go inside.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<html><body>Blackbird Clan Member Sherry:<br>
|
||||
Oh! Who are you?<br>This place is dangerous!<br>
|
||||
Stay away. The Embryo have built a Command Post and are increasing their power day by day.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager 34066-2.htm">"Tell me about the Command Post."</Button><Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><body>Blackbird Clan Member Sherry:<br>
|
||||
The <font color="LEVEL">Command Post</font> is on the <font color="LEVEL">3rd floor of the Atelia Fortress</font>. <font color="LEVEL">Burnstein</font> is the leader, and it is said that he comes out from time to time to train the new recruits.<br>
|
||||
No one knows what's going on inside, and it's very difficult to go inside because you have to hold the gate when <font color="LEVEL">Commander Burnstein</font> <font color="LEVEL">goes back inside the Command Post from outside</font>.<br>
|
||||
<font color="LEVEL">Devianne</font> has come all the way here, and is hiding near the <font color="LEVEL">entrance to the Command Post</font>, to hold the gate open whenever Burnstein comes and goes back in.<br>
|
||||
If you are trying to go inside the Command Post, go find Devianne.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<html><body>Warehouse Keeper Julia:<br>
|
||||
If you have something precious, leave it with me. I'll keep it safe at all costs.<br>
|
||||
Even if this stronghold becomes dangerous, no harm shall be done to your items!<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager 34074-2.htm">Private warehouse</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager 34074-3.htm">Clan warehouse</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Link common/g_cube_warehouse001.htm"><font color="LEVEL">Wondrous Cubic</font></Button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><body>Warehouse Keeper Julia:<br>
|
||||
<center>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_DepositP">Deposit an item. (Private Warehouse)</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_WithdrawP">Withdraw an item. (Private Warehouse)</Button><br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Return</Button>
|
||||
</center>
|
||||
</body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><body>Warehouse Keeper Julia:<br>
|
||||
<center>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_DepositC" msg="1039">Deposit an item (Clan Warehouse)</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_WithdrawC">Withdraw an item (Clan Warehouse)</Button>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
|
||||
</center>
|
||||
</body></html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<html><body>Warehouse Keeper Saylem:<br>
|
||||
Hello! I'm Saylem.<br>
|
||||
Do you have any precious freight? Hmm? If you do, then you're in the right place! We, the Steel Door guild, store customer freight for low, low prices! What's more, you can conveniently reclaim the freight anytime, anywhere. Even if this place becomes dangerous, no harm shall be done to your things.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager 34075-2.htm">Private warehouse</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AteliaManager 34075-3.htm">Clan warehouse</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Link common/g_cube_warehouse001.htm"><font color="LEVEL">Wondrous Cubic</font></Button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><body>Warehouse Keeper Saylem:<br>
|
||||
<center>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_DepositP">Deposit an item. (Private Warehouse)</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_WithdrawP">Withdraw an item. (Private Warehouse)</Button><br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Return</Button>
|
||||
</center>
|
||||
</body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><body>Warehouse Keeper Saylem:<br>
|
||||
<center>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_DepositC" msg="1039">Deposit an item (Clan Warehouse)</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_WithdrawC">Withdraw an item (Clan Warehouse)</Button>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
|
||||
</center>
|
||||
</body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><body>Trader Mion:<br>
|
||||
I came to this dangerous place because I thought someone might need my help. If there's anything you need, come to me, okay?<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Buy 3407700">"I want to trade consumables and minerals."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_exc_multisell 003">"I want to exchange equipment."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_TerritoryStatus">"Can you tell me about the local lord and tax rate?"</Button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<html><body>Nika:<br>
|
||||
Welcome, welcome. What can I help you find?<br>
|
||||
Oh, I've seen you before. You got stuff to do here too? I came because of a request. I'll be here for a while, so come find me any time.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Buy 3407700">"I want to trade consumables and minerals."</Button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,707 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.AteliaFortress.AteliaManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.gameserver.datatables.SpawnTable;
|
||||
import org.l2jmobius.gameserver.enums.ChatType;
|
||||
import org.l2jmobius.gameserver.enums.QuestSound;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.Spawn;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.skills.AbnormalType;
|
||||
import org.l2jmobius.gameserver.network.NpcStringId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.NpcSay;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* URL https://l2wiki.com/Atelia_Fortress
|
||||
* @author hlwrave, Stayway, Mobius
|
||||
*/
|
||||
public class AteliaManager extends AbstractNpcAI
|
||||
{
|
||||
// Npc Devianne
|
||||
private static final int DEVIANNE = 34089;
|
||||
// Location Devianne
|
||||
private static final Location DEVIANNE_LOC = new Location(-50063, 49439, -1760, 40362);
|
||||
// Door Atelia Fortess Guard
|
||||
private static final int GUARD = 23539;
|
||||
private static final NpcStringId[] ATELIA_MSG =
|
||||
{
|
||||
NpcStringId.HAVE_YOU_SEEN_KELBIM_S_POWER_WE_LL_SHOW_YOU_THE_WRATH_OF_THE_EMBRYO,
|
||||
NpcStringId.I_CAN_FEEL_THE_ENERGY_FROM_THE_ATELIA_FEEL_THE_POWER_OF_KELBIM,
|
||||
NpcStringId.LIONA_AND_THE_LOWLY_SOLDIERS_WILL_BE_BURIED_HERE,
|
||||
NpcStringId.SHOW_THEM_THE_POWER_OF_KELBIM
|
||||
};
|
||||
private static final SkillHolder[] ATELIA_POISON =
|
||||
{
|
||||
new SkillHolder(23653, 2), // Poisonous Atelia
|
||||
new SkillHolder(23653, 3), // Poisonous Atelia
|
||||
new SkillHolder(23653, 4), // Poisonous Atelia
|
||||
};
|
||||
// AI (Hummel,Geork,Burnstein) in Zone
|
||||
private static final SkillHolder SUPPLY_BLOCKADE = new SkillHolder(16526, 1);
|
||||
private static final SkillHolder POOR_EQUIPMENT = new SkillHolder(16542, 2);
|
||||
private static final SkillHolder INDISCEPLINE = new SkillHolder(16542, 3);
|
||||
// Bosses
|
||||
private static final int GEORK = 23586; // Geork
|
||||
private static final int BURNSTEIN = 23587; // Burnstein
|
||||
private static final int HUMMEL = 23588; // Hummel
|
||||
// Npcs Stronghold I
|
||||
private static final int BARTON = 34059; // Barton Aden Vanguard
|
||||
private static final int GLENKI = 34063; // Glenkinchie Blackbird Clan Member
|
||||
// Location Stronghold I
|
||||
private static final Location BARTON_LOC = new Location(-45675, 59130, -2904, 54353);
|
||||
private static final Location GLENKI_LOC = new Location(-45579, 59169, -2904, 55286);
|
||||
// Flag Stronghold I
|
||||
private static final Location FLAG_1_LOC = new Location(-45690, 58901, -2864, 36407);
|
||||
private static final Location FLAG_2_LOC = new Location(-45419, 59066, -2864, 54421);
|
||||
// Npcs Stronghold II
|
||||
private static final int HAYUK = 34060; // Hayuk Aden Vanguard
|
||||
private static final int HURAK = 34064; // Hurak Blackbird Clan Member
|
||||
// Location Stronghold II
|
||||
private static final Location HURAK_LOC = new Location(-41766, 50416, -2032, 54353);//
|
||||
private static final Location HAYUK_LOC = new Location(-41879, 50389, -2032, 55286);//
|
||||
// Flag Stronghold II
|
||||
private static final Location FLAG_3_LOC = new Location(-41962, 50182, -1988, 36407);//
|
||||
private static final Location FLAG_4_LOC = new Location(-41631, 50246, -2001, 54421);//
|
||||
// Npcs Stronghold III
|
||||
private static final int ELISE = 34061; // Elise Aden Vanguard
|
||||
private static final int LAFFIAN = 34065; // Laffian Blackbird Clan Member
|
||||
// Other Stronghold III
|
||||
private static final int JULIA = 34074; // Julia Warehouse Keeper
|
||||
private static final int MION = 34076; // Mion Grocer
|
||||
// Location Stronghold III
|
||||
private static final Location ELISE_LOC = new Location(-44715, 40358, -1416, 29326);
|
||||
private static final Location LAFFIAN_LOC = new Location(-44574, 40318, -1416, 28937);
|
||||
private static final Location JULIA_LOC = new Location(-44603, 40202, -1416, 32350);
|
||||
private static final Location MION_LOC = new Location(-44525, 40430, -1416, 22568);
|
||||
// Flag Stronghold III
|
||||
private static final Location FLAG_5_LOC = new Location(-44778, 40556, -1384, 22322);
|
||||
private static final Location FLAG_6_LOC = new Location(-44860, 40254, -1376, 23239);
|
||||
// Npcs Stronghold IV
|
||||
private static final int ELIYAH = 34062; // Eliyah Aden Vanguard
|
||||
private static final int SHERRY = 34066; // Sherry Blackbird Clan Member
|
||||
// Other Stronghold IV
|
||||
private static final int SAYLEM = 34075; // Saylem Warehouse Keeper
|
||||
private static final int NIKA = 34077; // Nika Grocer
|
||||
// Location Stronghold IV
|
||||
private static final Location ELIYAH_LOC = new Location(-58480, 44000, -1552, 25300);
|
||||
private static final Location SHERRY_LOC = new Location(-58395, 43905, -1552, 28798);
|
||||
private static final Location SAYLEM_LOC = new Location(-58327, 43957, -1552, 25179);
|
||||
private static final Location NIKA_LOC = new Location(-58450, 43843, -1552, 32767);
|
||||
// Flag Stronghold IV
|
||||
private static final Location FLAG_7_LOC = new Location(-58449, 44207, -1512, 20327);
|
||||
private static final Location FLAG_8_LOC = new Location(-58693, 43986, -1520, 17904);
|
||||
// Stages (Floors)
|
||||
private static final int[] FLOOR_MOBS =
|
||||
{
|
||||
23505,
|
||||
23506,
|
||||
23507,
|
||||
23508,
|
||||
23509,
|
||||
23510,
|
||||
23511,
|
||||
23512
|
||||
};
|
||||
private static final int[] ALERT =
|
||||
{
|
||||
23595,
|
||||
23596,
|
||||
23597,
|
||||
23598,
|
||||
23599,
|
||||
23600,
|
||||
23601,
|
||||
23602
|
||||
};
|
||||
// Skills Stages
|
||||
private static final int[] ATELIA_CURSE =
|
||||
{
|
||||
23506,
|
||||
23508,
|
||||
23511,
|
||||
23512
|
||||
};
|
||||
// PART OF BOSS AI
|
||||
private static final int[] SB_GROUP =
|
||||
{
|
||||
23505,
|
||||
23506,
|
||||
23507,
|
||||
23508,
|
||||
23509,
|
||||
23510,
|
||||
23511,
|
||||
23512
|
||||
};
|
||||
static final int[][] FORTESS_SPY =
|
||||
{
|
||||
{
|
||||
23589,
|
||||
-41659,
|
||||
44081,
|
||||
-1448,
|
||||
0
|
||||
},
|
||||
{
|
||||
23589,
|
||||
-50091,
|
||||
48822,
|
||||
-1760,
|
||||
0
|
||||
},
|
||||
{
|
||||
23589,
|
||||
-49263,
|
||||
50204,
|
||||
-2400,
|
||||
0
|
||||
},
|
||||
{
|
||||
23589,
|
||||
-48556,
|
||||
45595,
|
||||
-1768,
|
||||
0
|
||||
},
|
||||
{
|
||||
23589,
|
||||
-44548,
|
||||
58729,
|
||||
-2928,
|
||||
0
|
||||
},
|
||||
{
|
||||
23589,
|
||||
-44636,
|
||||
45261,
|
||||
-1528,
|
||||
0
|
||||
},
|
||||
{
|
||||
23589,
|
||||
-45055,
|
||||
44769,
|
||||
-1544,
|
||||
0
|
||||
},
|
||||
{
|
||||
23589,
|
||||
-45729,
|
||||
41010,
|
||||
-1512,
|
||||
0
|
||||
},
|
||||
{
|
||||
23589,
|
||||
-46178,
|
||||
49001,
|
||||
-2400,
|
||||
0
|
||||
},
|
||||
{
|
||||
23589,
|
||||
-46466,
|
||||
56947,
|
||||
-3184,
|
||||
0
|
||||
},
|
||||
{
|
||||
23589,
|
||||
-46619,
|
||||
43794,
|
||||
-1560,
|
||||
0
|
||||
},
|
||||
{
|
||||
23589,
|
||||
-46814,
|
||||
50187,
|
||||
-2376,
|
||||
0
|
||||
},
|
||||
{
|
||||
23589,
|
||||
-47309,
|
||||
55932,
|
||||
-3184,
|
||||
0
|
||||
},
|
||||
{
|
||||
23589,
|
||||
-47470,
|
||||
52576,
|
||||
-2392,
|
||||
0
|
||||
},
|
||||
{
|
||||
23589,
|
||||
-47503,
|
||||
58967,
|
||||
-3192,
|
||||
0
|
||||
},
|
||||
{
|
||||
23589,
|
||||
-47815,
|
||||
51378,
|
||||
-2400,
|
||||
0
|
||||
},
|
||||
{
|
||||
23589,
|
||||
-48077,
|
||||
55335,
|
||||
-3160,
|
||||
0
|
||||
},
|
||||
{
|
||||
23589,
|
||||
-43866,
|
||||
47379,
|
||||
-2048,
|
||||
0
|
||||
},
|
||||
{
|
||||
23589,
|
||||
-43866,
|
||||
47379,
|
||||
-2048,
|
||||
0
|
||||
}
|
||||
|
||||
};
|
||||
// Infusers
|
||||
private static final int INFUSER_1 = 23537;
|
||||
private static final int INFUSER_2 = 23538;
|
||||
// Static Npcs
|
||||
private static final int FLAG = 19594; // Stronghold Flag
|
||||
// Items
|
||||
private static final int TPST_1 = 46146; // Atelia Fortress Stronghold I Teleport Device
|
||||
private static final int TPST_2 = 46147; // Atelia Fortress Stronghold II Teleport Device
|
||||
private static final int TPST_3 = 46148; // Atelia Fortress Stronghold III Teleport Device
|
||||
private static final int TPST_4 = 46149; // Atelia Fortress Stronghold VI Teleport Device
|
||||
// Misc
|
||||
private static int _killCount = 0;
|
||||
// Other
|
||||
private static final int DESPAWN = 1800000; // Time 30 Min
|
||||
private static final int SBCANCEL = 3600000; // Time 1 Hour
|
||||
private static final int DDESPAWN = 10800000; // Time 3 Hour
|
||||
|
||||
static ArrayList<Npc> FortessSpawns = new ArrayList<>();
|
||||
|
||||
private AteliaManager()
|
||||
{
|
||||
addStartNpc(BARTON, GLENKI, HAYUK, HURAK, ELISE, LAFFIAN, JULIA, MION, ELIYAH, SHERRY, SAYLEM, NIKA);
|
||||
addFirstTalkId(BARTON, GLENKI, HAYUK, HURAK, ELISE, LAFFIAN, JULIA, MION, ELIYAH, SHERRY, SAYLEM, NIKA);
|
||||
addTalkId(BARTON, GLENKI, HAYUK, HURAK, ELISE, LAFFIAN, JULIA, MION, ELIYAH, SHERRY, SAYLEM, NIKA);
|
||||
addKillId(FLOOR_MOBS);
|
||||
addKillId(ALERT);
|
||||
addKillId(GEORK, BURNSTEIN, HUMMEL, GUARD, INFUSER_1, INFUSER_2);
|
||||
addSpawnId(BARTON, GLENKI, FLAG, HAYUK, HURAK);
|
||||
addSpawnId(ELISE, LAFFIAN, JULIA, MION);
|
||||
addSpawnId(ELIYAH, SHERRY, SAYLEM, NIKA);
|
||||
addSpawnId(HUMMEL, GEORK, BURNSTEIN, DEVIANNE);
|
||||
addSpawnId(SB_GROUP);
|
||||
addAttackId(ATELIA_CURSE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
|
||||
{
|
||||
String htmltext = null;
|
||||
switch (event)
|
||||
{
|
||||
case "34059-1.htm":
|
||||
case "34060-1.htm":
|
||||
case "34061-1.htm":
|
||||
case "34062-1.htm":
|
||||
case "34063-1.htm":
|
||||
case "34063-2.htm":
|
||||
case "34064-1.htm":
|
||||
case "34064-2.htm":
|
||||
case "34065-1.htm":
|
||||
case "34065-2.htm":
|
||||
case "34066-1.htm":
|
||||
case "34066-2.htm":
|
||||
case "34074-1.htm":
|
||||
case "34074-2.htm":
|
||||
case "34074-3.htm":
|
||||
case "34075-1.htm":
|
||||
case "34075-2.htm":
|
||||
case "34075-3.htm":
|
||||
case "34076-1.htm":
|
||||
case "34077-1.htm":
|
||||
{
|
||||
htmltext = event;
|
||||
break;
|
||||
}
|
||||
case "give_tp_st_1":
|
||||
{
|
||||
if (!hasQuestItems(player, TPST_1))
|
||||
{
|
||||
giveItems(player, TPST_1, 1);
|
||||
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "34059-2.htm"; // fix
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "give_tp_st_2":
|
||||
{
|
||||
if (!hasQuestItems(player, TPST_2))
|
||||
{
|
||||
giveItems(player, TPST_2, 1);
|
||||
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "34060-2.htm"; // todo off html text
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "give_tp_st_3":
|
||||
{
|
||||
if (!hasQuestItems(player, TPST_3))
|
||||
{
|
||||
giveItems(player, TPST_3, 1);
|
||||
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "34061-2.htm"; // fix
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "give_tp_st_4":
|
||||
{
|
||||
if (!hasQuestItems(player, TPST_4))
|
||||
{
|
||||
giveItems(player, TPST_4, 1);
|
||||
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "34062-2.htm"; // fix
|
||||
}
|
||||
break;
|
||||
}
|
||||
// Stronghold's
|
||||
case "SH_1":
|
||||
{
|
||||
if (npc == null)
|
||||
{
|
||||
addSpawn(BARTON, BARTON_LOC, false, DESPAWN);
|
||||
addSpawn(GLENKI, GLENKI_LOC, false, DESPAWN);
|
||||
addSpawn(FLAG, FLAG_1_LOC, false, DESPAWN);
|
||||
addSpawn(FLAG, FLAG_2_LOC, false, DESPAWN);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SH_2":
|
||||
{
|
||||
if (npc == null)
|
||||
{
|
||||
addSpawn(HAYUK, HAYUK_LOC, false, DESPAWN);
|
||||
addSpawn(HURAK, HURAK_LOC, false, DESPAWN);
|
||||
addSpawn(FLAG, FLAG_3_LOC, false, DESPAWN);
|
||||
addSpawn(FLAG, FLAG_4_LOC, false, DESPAWN);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SH_3":
|
||||
{
|
||||
if (npc == null)
|
||||
{
|
||||
addSpawn(ELISE, ELISE_LOC, false, DESPAWN);
|
||||
addSpawn(LAFFIAN, LAFFIAN_LOC, false, DESPAWN);
|
||||
addSpawn(JULIA, JULIA_LOC, false, DESPAWN);
|
||||
addSpawn(MION, MION_LOC, false, DESPAWN);
|
||||
addSpawn(FLAG, FLAG_5_LOC, false, DESPAWN);
|
||||
addSpawn(FLAG, FLAG_6_LOC, false, DESPAWN);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SH_4":
|
||||
{
|
||||
if (npc == null)
|
||||
{
|
||||
addSpawn(ELIYAH, ELIYAH_LOC, false, DESPAWN);
|
||||
addSpawn(SHERRY, SHERRY_LOC, false, DESPAWN);
|
||||
addSpawn(SAYLEM, SAYLEM_LOC, false, DESPAWN);
|
||||
addSpawn(NIKA, NIKA_LOC, false, DESPAWN);
|
||||
addSpawn(FLAG, FLAG_7_LOC, false, DESPAWN);
|
||||
addSpawn(FLAG, FLAG_8_LOC, false, DESPAWN);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SB_1":
|
||||
{
|
||||
for (int sb : SB_GROUP)
|
||||
{
|
||||
for (Spawn spawn : SpawnTable.getInstance().getSpawns(sb))
|
||||
{
|
||||
for (Npc monster : spawn.getSpawnedNpcs())
|
||||
{
|
||||
if ((monster.getZ() <= -2759) && (monster.getZ() >= -3246))
|
||||
{
|
||||
monster.setTarget(monster);
|
||||
monster.doCast(SUPPLY_BLOCKADE.getSkill());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SB_2":
|
||||
{
|
||||
for (int sb : SB_GROUP)
|
||||
{
|
||||
for (Spawn spawn : SpawnTable.getInstance().getSpawns(sb))
|
||||
{
|
||||
for (Npc monster : spawn.getSpawnedNpcs())
|
||||
{
|
||||
if ((monster.getZ() <= -2020) && (monster.getZ() >= -2759))
|
||||
{
|
||||
monster.setTarget(monster);
|
||||
monster.doCast(POOR_EQUIPMENT.getSkill());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SB_3":
|
||||
{
|
||||
for (int sb : SB_GROUP)
|
||||
{
|
||||
for (Spawn spawn : SpawnTable.getInstance().getSpawns(sb))
|
||||
{
|
||||
for (Npc monster : spawn.getSpawnedNpcs())
|
||||
{
|
||||
if ((monster.getZ() <= -1477) && (monster.getZ() >= -2212)) // need correct!
|
||||
{
|
||||
monster.setTarget(monster);
|
||||
monster.doCast(INDISCEPLINE.getSkill());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SB_1_C":
|
||||
{
|
||||
for (int sb : SB_GROUP)
|
||||
{
|
||||
for (Spawn spawn : SpawnTable.getInstance().getSpawns(sb))
|
||||
{
|
||||
for (Npc monster : spawn.getSpawnedNpcs())
|
||||
{
|
||||
monster.getEffectList().stopEffects(AbnormalType.ALL_ATTACK_DOWN);
|
||||
monster.stopSkillEffects(true, 16526);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SB_2_C":
|
||||
{
|
||||
for (int sb : SB_GROUP)
|
||||
{
|
||||
for (Spawn spawn : SpawnTable.getInstance().getSpawns(sb))
|
||||
{
|
||||
for (Npc monster : spawn.getSpawnedNpcs())
|
||||
{
|
||||
monster.getEffectList().stopEffects(AbnormalType.MAX_HP_DOWN);
|
||||
monster.stopSkillEffects(true, 16542);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SB_3_C":
|
||||
{
|
||||
for (int sb : SB_GROUP)
|
||||
{
|
||||
for (Spawn spawn : SpawnTable.getInstance().getSpawns(sb))
|
||||
{
|
||||
for (Npc monster : spawn.getSpawnedNpcs())
|
||||
{
|
||||
monster.getEffectList().stopEffects(AbnormalType.MAX_HP_DOWN);
|
||||
monster.stopSkillEffects(true, 16542);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SPY_CLEAR":
|
||||
{
|
||||
for (Npc spawn : FortessSpawns)
|
||||
{
|
||||
if (spawn != null)
|
||||
{
|
||||
spawn.deleteMe();
|
||||
}
|
||||
}
|
||||
FortessSpawns.clear();
|
||||
break;
|
||||
}
|
||||
case "SPY_SPAWN":
|
||||
{
|
||||
for (int[] spawn : FORTESS_SPY)
|
||||
{
|
||||
FortessSpawns.add(addSpawn(spawn[0], spawn[1], spawn[2], spawn[3], spawn[4], false, 0, false, 0));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "DOOR_CLOSE":
|
||||
{
|
||||
_killCount = 0;
|
||||
closeDoor(18190002, 0);
|
||||
closeDoor(18190004, 0);
|
||||
break;
|
||||
}
|
||||
case "ALERT":
|
||||
{
|
||||
final int rnd = getRandom(3, 4);
|
||||
for (int i = 0; i < rnd; i++)
|
||||
{
|
||||
final Npc alert = addSpawn(ALERT[i], npc.getX() + 10, npc.getY() + 10, npc.getZ() + 10, npc.getHeading(), false, 0, false);
|
||||
alert.setTitle("On Alert Stage 1");
|
||||
addAttackDesire(alert, player);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon)
|
||||
{
|
||||
final int chance = getRandom(1000);
|
||||
if (CommonUtil.contains(ATELIA_CURSE, npc.getId()))
|
||||
{
|
||||
if (!npc.isCastingNow() && (chance <= 20))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(ATELIA_POISON[getRandom(ATELIA_POISON.length)].getSkill());
|
||||
}
|
||||
}
|
||||
else if (CommonUtil.contains(FLOOR_MOBS, npc.getId()) && (chance > 90))
|
||||
{
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), ATELIA_MSG[getRandom(1)]));
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
|
||||
{
|
||||
|
||||
if ((npc.getZ() <= -2804) && (npc.getZ() >= -2999) && (npc.getId() == INFUSER_1))
|
||||
{
|
||||
startQuestTimer("SH_1", 100, null, null);
|
||||
}
|
||||
if ((npc.getZ() <= -2029) && (npc.getZ() >= -2050) && (npc.getId() == INFUSER_1))
|
||||
{
|
||||
startQuestTimer("SH_2", 100, null, null);
|
||||
}
|
||||
if ((npc.getZ() <= -1419) && (npc.getZ() >= -1520) && (npc.getId() == INFUSER_2))
|
||||
{
|
||||
startQuestTimer("SH_3", 100, null, null);
|
||||
}
|
||||
if ((npc.getZ() <= -1552) && (npc.getZ() >= -1580) && (npc.getId() == INFUSER_2))
|
||||
{
|
||||
startQuestTimer("SH_4", 100, null, null);
|
||||
}
|
||||
if (npc.getId() == GUARD)
|
||||
{
|
||||
_killCount++;
|
||||
if (_killCount == 2)
|
||||
{
|
||||
openDoor(18190002, 0);
|
||||
openDoor(18190004, 0);
|
||||
startQuestTimer("DOOR_CLOSE", SBCANCEL, npc, killer);
|
||||
}
|
||||
}
|
||||
else if (npc.getId() == HUMMEL)
|
||||
{
|
||||
startQuestTimer("SB_1", 100, npc, killer);
|
||||
}
|
||||
else if (npc.getId() == GEORK)
|
||||
{
|
||||
startQuestTimer("SB_2", 100, npc, killer);
|
||||
}
|
||||
else if (npc.getId() == BURNSTEIN)
|
||||
{
|
||||
addSpawn(DEVIANNE, DEVIANNE_LOC, false, DDESPAWN);
|
||||
startQuestTimer("SPY_CLEAR", 100, npc, null);
|
||||
startQuestTimer("SB_3", 100, npc, killer);
|
||||
}
|
||||
else if (CommonUtil.contains(FLOOR_MOBS, npc.getId()) && (getRandom(100) <= 6))
|
||||
{
|
||||
startQuestTimer("ALERT", 100, npc, killer);
|
||||
}
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(Npc npc, PlayerInstance player)
|
||||
{
|
||||
return npc.getId() + "-1.htm";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(Npc npc)
|
||||
{
|
||||
switch (npc.getId())
|
||||
{
|
||||
case HUMMEL:
|
||||
{
|
||||
startQuestTimer("SB_1_C", 100, npc, null);
|
||||
break;
|
||||
}
|
||||
case GEORK:
|
||||
{
|
||||
startQuestTimer("SB_2_C", 100, npc, null);
|
||||
break;
|
||||
}
|
||||
case BURNSTEIN:
|
||||
{
|
||||
startQuestTimer("SB_3_C", 100, npc, null);
|
||||
startQuestTimer("SPY_SPAWN", 100, npc, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new AteliaManager();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><body>Kingdom's Royal Guard Teleport Device:<br>
|
||||
This teleport device can be used to move from within the Enchanted Valley to the center.<br>
|
||||
Your faction level with the Kingdom's Royal Guard is below 3, and you may not use the teleport device.
|
||||
</body></html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<html><body>Kingdom's Royal Guard Teleport Device:<br>
|
||||
This is a teleport device installed by the Kingdom's Royal Guard for the purpose of teleporting to the various strongholds of Atelia Fortress.<br>
|
||||
To use it, you need some special qualifications. The necessary qualifications, and the available teleport destinations, are as follow.<br><br>
|
||||
<center>Qualification - <font color="LEVEL">Kingdom's Royal Guard Faction level 3 and above</font><br1>
|
||||
Location - Atelia Fortress Strongholds</center><br><br>
|
||||
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest TeleportDevice teleport1">Teleport to Stronghold I</Button>
|
||||
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest TeleportDevice teleport2">Teleport to Stronghold II</Button>
|
||||
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest TeleportDevice teleport3">Teleport to Stronghold III</Button>
|
||||
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest TeleportDevice teleport4">Teleport to Stronghold IV</Button>
|
||||
</body></html>
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.AteliaFortress.TeleportDevice;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.Faction;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Kingdom's Royal Guard Teleport Device
|
||||
* @author Gigi
|
||||
* @date 2018-04-30 - [23:32:48]
|
||||
*/
|
||||
public class TeleportDevice extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
private static final int TELEPORT_DEVICE = 34242;
|
||||
// Teleport's
|
||||
private static final Location LOCATION1 = new Location(-46335, 59575, -2960);
|
||||
private static final Location LOCATION2 = new Location(-42307, 51232, -2032);
|
||||
private static final Location LOCATION3 = new Location(-44060, 40139, -1432);
|
||||
private static final Location LOCATION4 = new Location(-57242, 43811, -1552);
|
||||
|
||||
private TeleportDevice()
|
||||
{
|
||||
addFirstTalkId(TELEPORT_DEVICE);
|
||||
addTalkId(TELEPORT_DEVICE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
|
||||
{
|
||||
if (player.getFactionLevel(Faction.KINGDOM_ROYAL_GUARDS) < 3)
|
||||
{
|
||||
return "34242-01.html";
|
||||
}
|
||||
switch (event)
|
||||
{
|
||||
case "teleport1":
|
||||
{
|
||||
player.teleToLocation(LOCATION1);
|
||||
break;
|
||||
}
|
||||
case "teleport2":
|
||||
{
|
||||
player.teleToLocation(LOCATION2);
|
||||
break;
|
||||
}
|
||||
case "teleport3":
|
||||
{
|
||||
player.teleToLocation(LOCATION3);
|
||||
break;
|
||||
}
|
||||
case "teleport4":
|
||||
{
|
||||
player.teleToLocation(LOCATION4);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(Npc npc, PlayerInstance player)
|
||||
{
|
||||
return "34242.html";
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new TeleportDevice();
|
||||
}
|
||||
}
|
||||
125
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/BabyPets.java
vendored
Normal file
125
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/BabyPets.java
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.BeastFarm;
|
||||
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Summon;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
|
||||
import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
|
||||
import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.skills.SkillCaster;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Baby Pets AI.
|
||||
* @author St3eT
|
||||
*/
|
||||
public class BabyPets extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int[] BABY_PETS =
|
||||
{
|
||||
12780, // Baby Buffalo
|
||||
12781, // Baby Kookaburra
|
||||
12782, // Baby Cougar
|
||||
};
|
||||
// Skills
|
||||
private static final int HEAL_1 = 4717; // Heal Trick
|
||||
private static final int HEAL_2 = 4718; // Greater Heal Trick
|
||||
|
||||
private BabyPets()
|
||||
{
|
||||
addSummonSpawnId(BABY_PETS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
|
||||
{
|
||||
if (event.equals("HEAL") && (player != null))
|
||||
{
|
||||
final Summon summon = player.getPet();
|
||||
|
||||
if (summon != null)
|
||||
{
|
||||
if (getRandom(100) <= 25)
|
||||
{
|
||||
castHeal(summon, new SkillHolder(HEAL_1, getHealLv(summon)), 80);
|
||||
}
|
||||
|
||||
if (getRandom(100) <= 75)
|
||||
{
|
||||
castHeal(summon, new SkillHolder(HEAL_2, getHealLv(summon)), 15);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cancelQuestTimer("HEAL", null, player);
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@RegisterEvent(EventType.ON_PLAYER_LOGOUT)
|
||||
@RegisterType(ListenerRegisterType.GLOBAL)
|
||||
public void OnPlayerLogout(OnPlayerLogout event)
|
||||
{
|
||||
cancelQuestTimer("HEAL", null, event.getPlayer());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSummonSpawn(Summon summon)
|
||||
{
|
||||
startQuestTimer("HEAL", 5000, null, summon.getOwner(), true);
|
||||
}
|
||||
|
||||
private int getHealLv(Summon summon)
|
||||
{
|
||||
final int summonLv = summon.getLevel();
|
||||
return CommonUtil.constrain(summonLv < 70 ? (summonLv / 10) : (7 + ((summonLv - 70) / 5)), 1, 12);
|
||||
}
|
||||
|
||||
private void castHeal(Summon summon, SkillHolder skill, int maxHpPer)
|
||||
{
|
||||
final boolean previousFollowStatus = summon.getFollowStatus();
|
||||
final PlayerInstance owner = summon.getOwner();
|
||||
|
||||
if (!owner.isDead() && (((owner.getCurrentHp() / owner.getMaxHp()) * 100) < maxHpPer) && !summon.isHungry() && SkillCaster.checkUseConditions(summon, skill.getSkill()))
|
||||
{
|
||||
summon.getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, skill.getSkill(), owner);
|
||||
summon.sendPacket(new SystemMessage(SystemMessageId.YOUR_PET_USES_S1).addSkillName(skill.getSkill()));
|
||||
|
||||
if (previousFollowStatus != summon.getFollowStatus())
|
||||
{
|
||||
summon.setFollowStatus(previousFollowStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new BabyPets();
|
||||
}
|
||||
}
|
||||
489
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/BeastFarm.java
vendored
Normal file
489
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/BeastFarm.java
vendored
Normal file
@@ -0,0 +1,489 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.BeastFarm;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.data.xml.impl.SkillData;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.TamedBeastInstance;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.skills.Skill;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.NpcInfo;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Growth-capable mobs: Polymorphing upon successful feeding.<br>
|
||||
* Updated to Freya.
|
||||
* @author Fulminus, Gigiikun
|
||||
*/
|
||||
public class BeastFarm extends AbstractNpcAI
|
||||
{
|
||||
private static final int GOLDEN_SPICE = 15474;
|
||||
private static final int CRYSTAL_SPICE = 15475;
|
||||
private static final int SKILL_GOLDEN_SPICE = 9049;
|
||||
private static final int SKILL_CRYSTAL_SPICE = 9050;
|
||||
private static final int SKILL_BLESSED_GOLDEN_SPICE = 9051;
|
||||
private static final int SKILL_BLESSED_CRYSTAL_SPICE = 9052;
|
||||
private static final int SKILL_SGRADE_GOLDEN_SPICE = 9053;
|
||||
private static final int SKILL_SGRADE_CRYSTAL_SPICE = 9054;
|
||||
private static final int[] TAMED_BEASTS =
|
||||
{
|
||||
18869,
|
||||
18870,
|
||||
18871,
|
||||
18872
|
||||
};
|
||||
private static final int TAME_CHANCE = 20;
|
||||
protected static final int[] SPECIAL_SPICE_CHANCES =
|
||||
{
|
||||
33,
|
||||
75
|
||||
};
|
||||
|
||||
// all mobs that can eat...
|
||||
private static final int[] FEEDABLE_BEASTS =
|
||||
{
|
||||
// Kookaburras
|
||||
18873,
|
||||
18874,
|
||||
18875,
|
||||
18876,
|
||||
18877,
|
||||
18878,
|
||||
18879,
|
||||
// Cougars
|
||||
18880,
|
||||
18881,
|
||||
18882,
|
||||
18883,
|
||||
18884,
|
||||
18885,
|
||||
18886,
|
||||
// Buffalos
|
||||
18887,
|
||||
18888,
|
||||
18889,
|
||||
18890,
|
||||
18891,
|
||||
18892,
|
||||
18893,
|
||||
// Grendels
|
||||
18894,
|
||||
18895,
|
||||
18896,
|
||||
18897,
|
||||
18898,
|
||||
18899,
|
||||
18900
|
||||
};
|
||||
|
||||
private static Map<Integer, GrowthCapableMob> GROWTH_CAPABLE_MOBS = new HashMap<>();
|
||||
private static List<TamedBeast> TAMED_BEAST_DATA = new ArrayList<>();
|
||||
private final Map<Integer, Integer> _feedInfo = new ConcurrentHashMap<>();
|
||||
|
||||
private BeastFarm()
|
||||
{
|
||||
addSkillSeeId(FEEDABLE_BEASTS);
|
||||
addKillId(FEEDABLE_BEASTS);
|
||||
|
||||
GrowthCapableMob temp;
|
||||
|
||||
// Kookabura
|
||||
temp = new GrowthCapableMob(100, 0, 18869);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18874);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18875);
|
||||
temp.addNpcIdForSkillId(SKILL_BLESSED_GOLDEN_SPICE, 18869);
|
||||
temp.addNpcIdForSkillId(SKILL_BLESSED_CRYSTAL_SPICE, 18869);
|
||||
temp.addNpcIdForSkillId(SKILL_SGRADE_GOLDEN_SPICE, 18878);
|
||||
temp.addNpcIdForSkillId(SKILL_SGRADE_CRYSTAL_SPICE, 18879);
|
||||
GROWTH_CAPABLE_MOBS.put(18873, temp);
|
||||
|
||||
temp = new GrowthCapableMob(40, 1, 18869);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18876);
|
||||
GROWTH_CAPABLE_MOBS.put(18874, temp);
|
||||
|
||||
temp = new GrowthCapableMob(40, 1, 18869);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18877);
|
||||
GROWTH_CAPABLE_MOBS.put(18875, temp);
|
||||
|
||||
temp = new GrowthCapableMob(25, 2, 18869);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18878);
|
||||
GROWTH_CAPABLE_MOBS.put(18876, temp);
|
||||
|
||||
temp = new GrowthCapableMob(25, 2, 18869);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18879);
|
||||
GROWTH_CAPABLE_MOBS.put(18877, temp);
|
||||
|
||||
// Cougar
|
||||
temp = new GrowthCapableMob(100, 0, 18870);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18881);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18882);
|
||||
temp.addNpcIdForSkillId(SKILL_BLESSED_GOLDEN_SPICE, 18870);
|
||||
temp.addNpcIdForSkillId(SKILL_BLESSED_CRYSTAL_SPICE, 18870);
|
||||
temp.addNpcIdForSkillId(SKILL_SGRADE_GOLDEN_SPICE, 18885);
|
||||
temp.addNpcIdForSkillId(SKILL_SGRADE_CRYSTAL_SPICE, 18886);
|
||||
GROWTH_CAPABLE_MOBS.put(18880, temp);
|
||||
|
||||
temp = new GrowthCapableMob(40, 1, 18870);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18883);
|
||||
GROWTH_CAPABLE_MOBS.put(18881, temp);
|
||||
|
||||
temp = new GrowthCapableMob(40, 1, 18870);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18884);
|
||||
GROWTH_CAPABLE_MOBS.put(18882, temp);
|
||||
|
||||
temp = new GrowthCapableMob(25, 2, 18870);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18885);
|
||||
GROWTH_CAPABLE_MOBS.put(18883, temp);
|
||||
|
||||
temp = new GrowthCapableMob(25, 2, 18870);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18886);
|
||||
GROWTH_CAPABLE_MOBS.put(18884, temp);
|
||||
|
||||
// Buffalo
|
||||
temp = new GrowthCapableMob(100, 0, 18871);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18888);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18889);
|
||||
temp.addNpcIdForSkillId(SKILL_BLESSED_GOLDEN_SPICE, 18871);
|
||||
temp.addNpcIdForSkillId(SKILL_BLESSED_CRYSTAL_SPICE, 18871);
|
||||
temp.addNpcIdForSkillId(SKILL_SGRADE_GOLDEN_SPICE, 18892);
|
||||
temp.addNpcIdForSkillId(SKILL_SGRADE_CRYSTAL_SPICE, 18893);
|
||||
GROWTH_CAPABLE_MOBS.put(18887, temp);
|
||||
|
||||
temp = new GrowthCapableMob(40, 1, 18871);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18890);
|
||||
GROWTH_CAPABLE_MOBS.put(18888, temp);
|
||||
|
||||
temp = new GrowthCapableMob(40, 1, 18871);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18891);
|
||||
GROWTH_CAPABLE_MOBS.put(18889, temp);
|
||||
|
||||
temp = new GrowthCapableMob(25, 2, 18871);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18892);
|
||||
GROWTH_CAPABLE_MOBS.put(18890, temp);
|
||||
|
||||
temp = new GrowthCapableMob(25, 2, 18871);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18893);
|
||||
GROWTH_CAPABLE_MOBS.put(18891, temp);
|
||||
|
||||
// Grendel
|
||||
temp = new GrowthCapableMob(100, 0, 18872);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18895);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18896);
|
||||
temp.addNpcIdForSkillId(SKILL_BLESSED_GOLDEN_SPICE, 18872);
|
||||
temp.addNpcIdForSkillId(SKILL_BLESSED_CRYSTAL_SPICE, 18872);
|
||||
temp.addNpcIdForSkillId(SKILL_SGRADE_GOLDEN_SPICE, 18899);
|
||||
temp.addNpcIdForSkillId(SKILL_SGRADE_CRYSTAL_SPICE, 18900);
|
||||
GROWTH_CAPABLE_MOBS.put(18894, temp);
|
||||
|
||||
temp = new GrowthCapableMob(40, 1, 18872);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18897);
|
||||
GROWTH_CAPABLE_MOBS.put(18895, temp);
|
||||
|
||||
temp = new GrowthCapableMob(40, 1, 18872);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18898);
|
||||
GROWTH_CAPABLE_MOBS.put(18896, temp);
|
||||
|
||||
temp = new GrowthCapableMob(25, 2, 18872);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18899);
|
||||
GROWTH_CAPABLE_MOBS.put(18897, temp);
|
||||
|
||||
temp = new GrowthCapableMob(25, 2, 18872);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18900);
|
||||
GROWTH_CAPABLE_MOBS.put(18898, temp);
|
||||
|
||||
// Tamed beasts data
|
||||
TAMED_BEAST_DATA.add(new TamedBeast("%name% of Focus", new SkillHolder(6432, 1), new SkillHolder(6668, 1)));
|
||||
TAMED_BEAST_DATA.add(new TamedBeast("%name% of Guiding", new SkillHolder(6433, 1), new SkillHolder(6670, 1)));
|
||||
TAMED_BEAST_DATA.add(new TamedBeast("%name% of Swifth", new SkillHolder(6434, 1), new SkillHolder(6667, 1)));
|
||||
TAMED_BEAST_DATA.add(new TamedBeast("Berserker %name%", new SkillHolder(6671, 1)));
|
||||
TAMED_BEAST_DATA.add(new TamedBeast("%name% of Protect", new SkillHolder(6669, 1), new SkillHolder(6672, 1)));
|
||||
TAMED_BEAST_DATA.add(new TamedBeast("%name% of Vigor", new SkillHolder(6431, 1), new SkillHolder(6666, 1)));
|
||||
}
|
||||
|
||||
public void spawnNext(Npc npc, PlayerInstance player, int nextNpcId, int food)
|
||||
{
|
||||
// remove the feedinfo of the mob that got despawned, if any
|
||||
if (_feedInfo.containsKey(npc.getObjectId()))
|
||||
{
|
||||
if (_feedInfo.get(npc.getObjectId()) == player.getObjectId())
|
||||
{
|
||||
_feedInfo.remove(npc.getObjectId());
|
||||
}
|
||||
}
|
||||
// despawn the old mob
|
||||
// TODO: same code? FIXED?
|
||||
/*
|
||||
* if (_GrowthCapableMobs.get(npc.getNpcId()).getGrowthLevel() == 0) { npc.deleteMe(); } else {
|
||||
*/
|
||||
npc.deleteMe();
|
||||
// }
|
||||
|
||||
// if this is finally a trained mob, then despawn any other trained mobs that the
|
||||
// player might have and initialize the Tamed Beast.
|
||||
if (CommonUtil.contains(TAMED_BEASTS, nextNpcId))
|
||||
{
|
||||
final TamedBeastInstance nextNpc = new TamedBeastInstance(nextNpcId, player, food, npc.getX(), npc.getY(), npc.getZ(), true);
|
||||
|
||||
final TamedBeast beast = TAMED_BEAST_DATA.get(getRandom(TAMED_BEAST_DATA.size()));
|
||||
String name = beast.getName();
|
||||
switch (nextNpcId)
|
||||
{
|
||||
case 18869:
|
||||
{
|
||||
name = name.replace("%name%", "Alpine Kookaburra");
|
||||
break;
|
||||
}
|
||||
case 18870:
|
||||
{
|
||||
name = name.replace("%name%", "Alpine Cougar");
|
||||
break;
|
||||
}
|
||||
case 18871:
|
||||
{
|
||||
name = name.replace("%name%", "Alpine Buffalo");
|
||||
break;
|
||||
}
|
||||
case 18872:
|
||||
{
|
||||
name = name.replace("%name%", "Alpine Grendel");
|
||||
break;
|
||||
}
|
||||
}
|
||||
nextNpc.setName(name);
|
||||
nextNpc.broadcastPacket(new NpcInfo(nextNpc));
|
||||
nextNpc.setRunning();
|
||||
|
||||
final SkillData st = SkillData.getInstance();
|
||||
for (SkillHolder sh : beast.getSkills())
|
||||
{
|
||||
nextNpc.addBeastSkill(st.getSkill(sh.getSkillId(), sh.getSkillLevel()));
|
||||
}
|
||||
|
||||
// TODO: Quest removed with Etina's Fate.
|
||||
// Q00020_BringUpWithLove.checkJewelOfInnocence(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
// if not trained, the newly spawned mob will automatically be agro against its feeder
|
||||
// (what happened to "never bite the hand that feeds you" anyway?!)
|
||||
final Attackable nextNpc = (Attackable) addSpawn(nextNpcId, npc);
|
||||
|
||||
// register the player in the feedinfo for the mob that just spawned
|
||||
_feedInfo.put(nextNpc.getObjectId(), player.getObjectId());
|
||||
nextNpc.setRunning();
|
||||
nextNpc.addDamageHate(player, 0, 99999);
|
||||
nextNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
|
||||
player.setTarget(nextNpc);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSkillSee(Npc npc, PlayerInstance caster, Skill skill, WorldObject[] targets, boolean isSummon)
|
||||
{
|
||||
// this behavior is only run when the target of skill is the passed npc (chest)
|
||||
// i.e. when the player is attempting to open the chest using a skill
|
||||
if (!CommonUtil.contains(targets, npc))
|
||||
{
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
}
|
||||
// gather some values on local variables
|
||||
final int npcId = npc.getId();
|
||||
final int skillId = skill.getId();
|
||||
// check if the npc and skills used are valid for this script. Exit if invalid.
|
||||
if (!CommonUtil.contains(FEEDABLE_BEASTS, npcId) || ((skillId != SKILL_GOLDEN_SPICE) && (skillId != SKILL_CRYSTAL_SPICE) && (skillId != SKILL_BLESSED_GOLDEN_SPICE) && (skillId != SKILL_BLESSED_CRYSTAL_SPICE) && (skillId != SKILL_SGRADE_GOLDEN_SPICE) && (skillId != SKILL_SGRADE_CRYSTAL_SPICE)))
|
||||
{
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
}
|
||||
|
||||
// first gather some values on local variables
|
||||
final int objectId = npc.getObjectId();
|
||||
int growthLevel = 3; // if a mob is in FEEDABLE_BEASTS but not in _GrowthCapableMobs, then it's at max growth (3)
|
||||
if (GROWTH_CAPABLE_MOBS.containsKey(npcId))
|
||||
{
|
||||
growthLevel = GROWTH_CAPABLE_MOBS.get(npcId).getGrowthLevel();
|
||||
}
|
||||
|
||||
// prevent exploit which allows 2 players to simultaneously raise the same 0-growth beast
|
||||
// If the mob is at 0th level (when it still listens to all feeders) lock it to the first feeder!
|
||||
if ((growthLevel == 0) && _feedInfo.containsKey(objectId))
|
||||
{
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
}
|
||||
|
||||
_feedInfo.put(objectId, caster.getObjectId());
|
||||
|
||||
// display the social action of the beast eating the food.
|
||||
npc.broadcastSocialAction(2);
|
||||
|
||||
int food = 0;
|
||||
if ((skillId == SKILL_GOLDEN_SPICE) || (skillId == SKILL_BLESSED_GOLDEN_SPICE))
|
||||
{
|
||||
food = GOLDEN_SPICE;
|
||||
}
|
||||
else if ((skillId == SKILL_CRYSTAL_SPICE) || (skillId == SKILL_BLESSED_CRYSTAL_SPICE))
|
||||
{
|
||||
food = CRYSTAL_SPICE;
|
||||
}
|
||||
|
||||
// if this pet can't grow, it's all done.
|
||||
if (GROWTH_CAPABLE_MOBS.containsKey(npcId))
|
||||
{
|
||||
// do nothing if this mob doesn't eat the specified food (food gets consumed but has no effect).
|
||||
final int newNpcId = GROWTH_CAPABLE_MOBS.get(npcId).getLeveledNpcId(skillId);
|
||||
if (newNpcId == -1)
|
||||
{
|
||||
if (growthLevel == 0)
|
||||
{
|
||||
_feedInfo.remove(objectId);
|
||||
npc.setRunning();
|
||||
((Attackable) npc).addDamageHate(caster, 0, 1);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, caster);
|
||||
}
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
}
|
||||
else if ((growthLevel > 0) && (_feedInfo.get(objectId) != caster.getObjectId()))
|
||||
{
|
||||
// check if this is the same player as the one who raised it from growth 0.
|
||||
// if no, then do not allow a chance to raise the pet (food gets consumed but has no effect).
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
}
|
||||
spawnNext(npc, caster, newNpcId, food);
|
||||
}
|
||||
else
|
||||
{
|
||||
caster.sendMessage("The beast spit out the feed instead of eating it.");
|
||||
npc.dropItem(caster, food, 1);
|
||||
}
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
|
||||
{
|
||||
// remove the feedinfo of the mob that got killed, if any
|
||||
if (_feedInfo.containsKey(npc.getObjectId()))
|
||||
{
|
||||
_feedInfo.remove(npc.getObjectId());
|
||||
}
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
|
||||
// all mobs that grow by eating
|
||||
private static class GrowthCapableMob
|
||||
{
|
||||
private final int _chance;
|
||||
private final int _growthLevel;
|
||||
private final int _tameNpcId;
|
||||
private final Map<Integer, Integer> _skillSuccessNpcIdList = new ConcurrentHashMap<>();
|
||||
|
||||
public GrowthCapableMob(int chance, int growthLevel, int tameNpcId)
|
||||
{
|
||||
_chance = chance;
|
||||
_growthLevel = growthLevel;
|
||||
_tameNpcId = tameNpcId;
|
||||
}
|
||||
|
||||
public void addNpcIdForSkillId(int skillId, int npcId)
|
||||
{
|
||||
_skillSuccessNpcIdList.put(skillId, npcId);
|
||||
}
|
||||
|
||||
public int getGrowthLevel()
|
||||
{
|
||||
return _growthLevel;
|
||||
}
|
||||
|
||||
public int getLeveledNpcId(int skillId)
|
||||
{
|
||||
if (!_skillSuccessNpcIdList.containsKey(skillId))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else if ((skillId == SKILL_BLESSED_GOLDEN_SPICE) || (skillId == SKILL_BLESSED_CRYSTAL_SPICE) || (skillId == SKILL_SGRADE_GOLDEN_SPICE) || (skillId == SKILL_SGRADE_CRYSTAL_SPICE))
|
||||
{
|
||||
if (getRandom(100) < SPECIAL_SPICE_CHANCES[0])
|
||||
{
|
||||
if (getRandom(100) < SPECIAL_SPICE_CHANCES[1])
|
||||
{
|
||||
return _skillSuccessNpcIdList.get(skillId);
|
||||
}
|
||||
else if ((skillId == SKILL_BLESSED_GOLDEN_SPICE) || (skillId == SKILL_SGRADE_GOLDEN_SPICE))
|
||||
{
|
||||
return _skillSuccessNpcIdList.get(SKILL_GOLDEN_SPICE);
|
||||
}
|
||||
else
|
||||
{
|
||||
return _skillSuccessNpcIdList.get(SKILL_CRYSTAL_SPICE);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
else if ((_growthLevel == 2) && (getRandom(100) < TAME_CHANCE))
|
||||
{
|
||||
return _tameNpcId;
|
||||
}
|
||||
else if (getRandom(100) < _chance)
|
||||
{
|
||||
return _skillSuccessNpcIdList.get(skillId);
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class TamedBeast
|
||||
{
|
||||
private final String name;
|
||||
private final SkillHolder[] sh;
|
||||
|
||||
public TamedBeast(String beastName, SkillHolder... holders)
|
||||
{
|
||||
name = beastName;
|
||||
sh = holders;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public SkillHolder[] getSkills()
|
||||
{
|
||||
return sh;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new BeastFarm();
|
||||
}
|
||||
}
|
||||
601
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/FeedableBeasts.java
vendored
Normal file
601
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/FeedableBeasts.java
vendored
Normal file
@@ -0,0 +1,601 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.BeastFarm;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.enums.ChatType;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.TamedBeastInstance;
|
||||
import org.l2jmobius.gameserver.model.skills.Skill;
|
||||
import org.l2jmobius.gameserver.network.NpcStringId;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Growth-capable mobs: Polymorphing upon successful feeding.
|
||||
* @author Fulminus
|
||||
*/
|
||||
public class FeedableBeasts extends AbstractNpcAI
|
||||
{
|
||||
private static final int GOLDEN_SPICE = 6643;
|
||||
private static final int CRYSTAL_SPICE = 6644;
|
||||
private static final int SKILL_GOLDEN_SPICE = 2188;
|
||||
private static final int SKILL_CRYSTAL_SPICE = 2189;
|
||||
private static final int FOODSKILLDIFF = GOLDEN_SPICE - SKILL_GOLDEN_SPICE;
|
||||
// Tamed Wild Beasts
|
||||
private static final int TRAINED_BUFFALO1 = 16013;
|
||||
private static final int TRAINED_BUFFALO2 = 16014;
|
||||
private static final int TRAINED_COUGAR1 = 16015;
|
||||
private static final int TRAINED_COUGAR2 = 16016;
|
||||
private static final int TRAINED_KOOKABURRA1 = 16017;
|
||||
private static final int TRAINED_KOOKABURRA2 = 16018;
|
||||
// private static final int TRAINED_TINY_BABY_BUFFALO = 16020; // TODO: Implement.
|
||||
// private static final int TRAINED_TINY_BABY_COUGAR = 16022; // TODO: Implement.
|
||||
// private static final int TRAINED_TINY_BABY_KOOKABURRA = 16024; // TODO: Implement.
|
||||
// @formatter:off
|
||||
private static final int[] TAMED_BEASTS =
|
||||
{
|
||||
TRAINED_BUFFALO1, TRAINED_BUFFALO2, TRAINED_COUGAR1, TRAINED_COUGAR2, TRAINED_KOOKABURRA1, TRAINED_KOOKABURRA2
|
||||
};
|
||||
// all mobs that can eat...
|
||||
private static final int[] FEEDABLE_BEASTS =
|
||||
{
|
||||
TRAINED_BUFFALO1, TRAINED_BUFFALO2, TRAINED_COUGAR1, TRAINED_COUGAR2, TRAINED_KOOKABURRA1, TRAINED_KOOKABURRA2
|
||||
};
|
||||
// @formatter:on
|
||||
|
||||
private static final Map<Integer, Integer> MAD_COW_POLYMORPH = new HashMap<>(6);
|
||||
|
||||
static
|
||||
{
|
||||
MAD_COW_POLYMORPH.put(21824, 21468);
|
||||
MAD_COW_POLYMORPH.put(21825, 21469);
|
||||
MAD_COW_POLYMORPH.put(21826, 21487);
|
||||
MAD_COW_POLYMORPH.put(21827, 21488);
|
||||
MAD_COW_POLYMORPH.put(21828, 21506);
|
||||
MAD_COW_POLYMORPH.put(21829, 21507);
|
||||
}
|
||||
|
||||
private static final NpcStringId[][] TEXT =
|
||||
{
|
||||
{
|
||||
NpcStringId.WHAT_DID_YOU_JUST_DO_TO_ME,
|
||||
NpcStringId.ARE_YOU_TRYING_TO_TAME_ME_DON_T_DO_THAT,
|
||||
NpcStringId.DON_T_GIVE_SUCH_A_THING_YOU_CAN_ENDANGER_YOURSELF,
|
||||
NpcStringId.YUCK_WHAT_IS_THIS_IT_TASTES_TERRIBLE,
|
||||
NpcStringId.I_M_HUNGRY_GIVE_ME_A_LITTLE_MORE_PLEASE,
|
||||
NpcStringId.WHAT_IS_THIS_IS_THIS_EDIBLE,
|
||||
NpcStringId.DON_T_WORRY_ABOUT_ME,
|
||||
NpcStringId.THANK_YOU_THAT_WAS_DELICIOUS,
|
||||
NpcStringId.I_THINK_I_AM_STARTING_TO_LIKE_YOU,
|
||||
NpcStringId.EEEEEK_EEEEEK
|
||||
},
|
||||
{
|
||||
NpcStringId.DON_T_KEEP_TRYING_TO_TAME_ME_I_DON_T_WANT_TO_BE_TAMED,
|
||||
NpcStringId.IT_IS_JUST_FOOD_TO_ME_ALTHOUGH_IT_MAY_ALSO_BE_YOUR_HAND,
|
||||
NpcStringId.IF_I_KEEP_EATING_LIKE_THIS_WON_T_I_BECOME_FAT_CHOMP_CHOMP,
|
||||
NpcStringId.WHY_DO_YOU_KEEP_FEEDING_ME,
|
||||
NpcStringId.DON_T_TRUST_ME_I_M_AFRAID_I_MAY_BETRAY_YOU_LATER
|
||||
},
|
||||
{
|
||||
NpcStringId.GRRRRR,
|
||||
NpcStringId.YOU_BROUGHT_THIS_UPON_YOURSELF,
|
||||
NpcStringId.I_FEEL_STRANGE_I_KEEP_HAVING_THESE_EVIL_THOUGHTS,
|
||||
NpcStringId.ALAS_SO_THIS_IS_HOW_IT_ALL_ENDS,
|
||||
NpcStringId.I_DON_T_FEEL_SO_GOOD_OH_MY_MIND_IS_VERY_TROUBLED
|
||||
}
|
||||
};
|
||||
|
||||
private static final NpcStringId[] TAMED_TEXT =
|
||||
{
|
||||
NpcStringId.S1_SO_WHAT_DO_YOU_THINK_IT_IS_LIKE_TO_BE_TAMED,
|
||||
NpcStringId.S1_WHENEVER_I_SEE_SPICE_I_THINK_I_WILL_MISS_YOUR_HAND_THAT_USED_TO_FEED_IT_TO_ME,
|
||||
NpcStringId.S1_DON_T_GO_TO_THE_VILLAGE_I_DON_T_HAVE_THE_STRENGTH_TO_FOLLOW_YOU,
|
||||
NpcStringId.THANK_YOU_FOR_TRUSTING_ME_S1_I_HOPE_I_WILL_BE_HELPFUL_TO_YOU,
|
||||
NpcStringId.S1_WILL_I_BE_ABLE_TO_HELP_YOU,
|
||||
NpcStringId.I_GUESS_IT_S_JUST_MY_ANIMAL_MAGNETISM,
|
||||
NpcStringId.TOO_MUCH_SPICY_FOOD_MAKES_ME_SWEAT_LIKE_A_BEAST,
|
||||
NpcStringId.ANIMALS_NEED_LOVE_TOO
|
||||
};
|
||||
|
||||
private final Map<Integer, Integer> _feedInfo = new ConcurrentHashMap<>();
|
||||
private static Map<Integer, GrowthCapableMob> GROWTH_CAPABLE_MOBS = new HashMap<>();
|
||||
|
||||
// all mobs that grow by eating
|
||||
private static class GrowthCapableMob
|
||||
{
|
||||
private final int _growthLevel;
|
||||
private final int _chance;
|
||||
|
||||
private final Map<Integer, int[][]> _spiceToMob = new ConcurrentHashMap<>();
|
||||
|
||||
public GrowthCapableMob(int growthLevel, int chance)
|
||||
{
|
||||
_growthLevel = growthLevel;
|
||||
_chance = chance;
|
||||
}
|
||||
|
||||
public void addMobs(int spice, int[][] Mobs)
|
||||
{
|
||||
_spiceToMob.put(spice, Mobs);
|
||||
}
|
||||
|
||||
public Integer getMob(int spice, int mobType, int classType)
|
||||
{
|
||||
if (_spiceToMob.containsKey(spice))
|
||||
{
|
||||
return _spiceToMob.get(spice)[mobType][classType];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Integer getRandomMob(int spice)
|
||||
{
|
||||
int[][] temp;
|
||||
temp = _spiceToMob.get(spice);
|
||||
final int rand = getRandom(temp[0].length);
|
||||
return temp[0][rand];
|
||||
}
|
||||
|
||||
public Integer getChance()
|
||||
{
|
||||
return _chance;
|
||||
}
|
||||
|
||||
public Integer getGrowthLevel()
|
||||
{
|
||||
return _growthLevel;
|
||||
}
|
||||
}
|
||||
|
||||
private FeedableBeasts()
|
||||
{
|
||||
addKillId(FEEDABLE_BEASTS);
|
||||
addSkillSeeId(FEEDABLE_BEASTS);
|
||||
|
||||
// TODO: no grendels?
|
||||
GrowthCapableMob temp;
|
||||
|
||||
//@formatter:off
|
||||
final int[][] Kookabura_0_Gold = {{ 21452, 21453, 21454, 21455 }};
|
||||
final int[][] Kookabura_0_Crystal = {{ 21456, 21457, 21458, 21459 }};
|
||||
final int[][] Kookabura_1_Gold_1= {{ 21460, 21462 }};
|
||||
final int[][] Kookabura_1_Gold_2 = {{ 21461, 21463 }};
|
||||
final int[][] Kookabura_1_Crystal_1 = {{ 21464, 21466 }};
|
||||
final int[][] Kookabura_1_Crystal_2 = {{ 21465, 21467 }};
|
||||
final int[][] Kookabura_2_1 = {{ 21468, 21824}, { TRAINED_KOOKABURRA1, TRAINED_KOOKABURRA2 }};
|
||||
final int[][] Kookabura_2_2 = {{ 21469, 21825}, { TRAINED_KOOKABURRA1, TRAINED_KOOKABURRA2 }};
|
||||
|
||||
final int[][] Buffalo_0_Gold = {{ 21471, 21472, 21473, 21474 }};
|
||||
final int[][] Buffalo_0_Crystal = {{ 21475, 21476, 21477, 21478 }};
|
||||
final int[][] Buffalo_1_Gold_1 = {{ 21479, 21481 }};
|
||||
final int[][] Buffalo_1_Gold_2 = {{ 21481, 21482 }};
|
||||
final int[][] Buffalo_1_Crystal_1 = {{ 21483, 21485 }};
|
||||
final int[][] Buffalo_1_Crystal_2 = {{ 21484, 21486 }};
|
||||
final int[][] Buffalo_2_1 = {{ 21487, 21826}, {TRAINED_BUFFALO1, TRAINED_BUFFALO2 }};
|
||||
final int[][] Buffalo_2_2 = {{ 21488, 21827}, {TRAINED_BUFFALO1, TRAINED_BUFFALO2 }};
|
||||
|
||||
final int[][] Cougar_0_Gold = {{ 21490, 21491, 21492, 21493 }};
|
||||
final int[][] Cougar_0_Crystal = {{ 21494, 21495, 21496, 21497 }};
|
||||
final int[][] Cougar_1_Gold_1 = {{ 21498, 21500 }};
|
||||
final int[][] Cougar_1_Gold_2 = {{ 21499, 21501 }};
|
||||
final int[][] Cougar_1_Crystal_1 = {{ 21502, 21504 }};
|
||||
final int[][] Cougar_1_Crystal_2 = {{ 21503, 21505 }};
|
||||
final int[][] Cougar_2_1 = {{ 21506, 21828 }, { TRAINED_COUGAR1, TRAINED_COUGAR2 }};
|
||||
final int[][] Cougar_2_2 = {{ 21507, 21829 }, { TRAINED_COUGAR1, TRAINED_COUGAR2 }};
|
||||
//@formatter:on
|
||||
|
||||
// Alpen Kookabura
|
||||
temp = new GrowthCapableMob(0, 100);
|
||||
temp.addMobs(GOLDEN_SPICE, Kookabura_0_Gold);
|
||||
temp.addMobs(CRYSTAL_SPICE, Kookabura_0_Crystal);
|
||||
GROWTH_CAPABLE_MOBS.put(21451, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(GOLDEN_SPICE, Kookabura_1_Gold_1);
|
||||
GROWTH_CAPABLE_MOBS.put(21452, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21454, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(GOLDEN_SPICE, Kookabura_1_Gold_2);
|
||||
GROWTH_CAPABLE_MOBS.put(21453, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21455, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(CRYSTAL_SPICE, Kookabura_1_Crystal_1);
|
||||
GROWTH_CAPABLE_MOBS.put(21456, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21458, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(CRYSTAL_SPICE, Kookabura_1_Crystal_2);
|
||||
GROWTH_CAPABLE_MOBS.put(21457, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21459, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(GOLDEN_SPICE, Kookabura_2_1);
|
||||
GROWTH_CAPABLE_MOBS.put(21460, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21462, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(GOLDEN_SPICE, Kookabura_2_2);
|
||||
GROWTH_CAPABLE_MOBS.put(21461, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21463, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(CRYSTAL_SPICE, Kookabura_2_1);
|
||||
GROWTH_CAPABLE_MOBS.put(21464, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21466, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(CRYSTAL_SPICE, Kookabura_2_2);
|
||||
GROWTH_CAPABLE_MOBS.put(21465, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21467, temp);
|
||||
|
||||
// Alpen Buffalo
|
||||
temp = new GrowthCapableMob(0, 100);
|
||||
temp.addMobs(GOLDEN_SPICE, Buffalo_0_Gold);
|
||||
temp.addMobs(CRYSTAL_SPICE, Buffalo_0_Crystal);
|
||||
GROWTH_CAPABLE_MOBS.put(21470, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(GOLDEN_SPICE, Buffalo_1_Gold_1);
|
||||
GROWTH_CAPABLE_MOBS.put(21471, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21473, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(GOLDEN_SPICE, Buffalo_1_Gold_2);
|
||||
GROWTH_CAPABLE_MOBS.put(21472, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21474, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(CRYSTAL_SPICE, Buffalo_1_Crystal_1);
|
||||
GROWTH_CAPABLE_MOBS.put(21475, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21477, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(CRYSTAL_SPICE, Buffalo_1_Crystal_2);
|
||||
GROWTH_CAPABLE_MOBS.put(21476, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21478, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(GOLDEN_SPICE, Buffalo_2_1);
|
||||
GROWTH_CAPABLE_MOBS.put(21479, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21481, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(GOLDEN_SPICE, Buffalo_2_2);
|
||||
GROWTH_CAPABLE_MOBS.put(21480, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21482, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(CRYSTAL_SPICE, Buffalo_2_1);
|
||||
GROWTH_CAPABLE_MOBS.put(21483, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21485, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(CRYSTAL_SPICE, Buffalo_2_2);
|
||||
GROWTH_CAPABLE_MOBS.put(21484, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21486, temp);
|
||||
|
||||
// Alpen Cougar
|
||||
temp = new GrowthCapableMob(0, 100);
|
||||
temp.addMobs(GOLDEN_SPICE, Cougar_0_Gold);
|
||||
temp.addMobs(CRYSTAL_SPICE, Cougar_0_Crystal);
|
||||
GROWTH_CAPABLE_MOBS.put(21489, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(GOLDEN_SPICE, Cougar_1_Gold_1);
|
||||
GROWTH_CAPABLE_MOBS.put(21490, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21492, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(GOLDEN_SPICE, Cougar_1_Gold_2);
|
||||
GROWTH_CAPABLE_MOBS.put(21491, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21493, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(CRYSTAL_SPICE, Cougar_1_Crystal_1);
|
||||
GROWTH_CAPABLE_MOBS.put(21494, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21496, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(CRYSTAL_SPICE, Cougar_1_Crystal_2);
|
||||
GROWTH_CAPABLE_MOBS.put(21495, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21497, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(GOLDEN_SPICE, Cougar_2_1);
|
||||
GROWTH_CAPABLE_MOBS.put(21498, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21500, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(GOLDEN_SPICE, Cougar_2_2);
|
||||
GROWTH_CAPABLE_MOBS.put(21499, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21501, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(CRYSTAL_SPICE, Cougar_2_1);
|
||||
GROWTH_CAPABLE_MOBS.put(21502, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21504, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(CRYSTAL_SPICE, Cougar_2_2);
|
||||
GROWTH_CAPABLE_MOBS.put(21503, temp);
|
||||
GROWTH_CAPABLE_MOBS.put(21505, temp);
|
||||
}
|
||||
|
||||
private void spawnNext(Npc npc, int growthLevel, PlayerInstance player, int food)
|
||||
{
|
||||
final int npcId = npc.getId();
|
||||
int nextNpcId = 0;
|
||||
|
||||
// find the next mob to spawn, based on the current npcId, growthlevel, and food.
|
||||
if (growthLevel == 2)
|
||||
{
|
||||
// if tamed, the mob that will spawn depends on the class type (fighter/mage) of the player!
|
||||
if (getRandom(2) == 0)
|
||||
{
|
||||
if (player.getClassId().isMage())
|
||||
{
|
||||
nextNpcId = GROWTH_CAPABLE_MOBS.get(npcId).getMob(food, 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
nextNpcId = GROWTH_CAPABLE_MOBS.get(npcId).getMob(food, 1, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// if not tamed, there is a small chance that have "mad cow" disease.
|
||||
// that is a stronger-than-normal animal that attacks its feeder
|
||||
if (getRandom(5) == 0)
|
||||
{
|
||||
nextNpcId = GROWTH_CAPABLE_MOBS.get(npcId).getMob(food, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
nextNpcId = GROWTH_CAPABLE_MOBS.get(npcId).getMob(food, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// all other levels of growth are straight-forward
|
||||
nextNpcId = GROWTH_CAPABLE_MOBS.get(npcId).getRandomMob(food);
|
||||
}
|
||||
|
||||
// remove the feedinfo of the mob that got despawned, if any
|
||||
if (_feedInfo.containsKey(npc.getObjectId()))
|
||||
{
|
||||
if (_feedInfo.get(npc.getObjectId()) == player.getObjectId())
|
||||
{
|
||||
_feedInfo.remove(npc.getObjectId());
|
||||
}
|
||||
}
|
||||
// despawn the old mob
|
||||
// TODO: same code? FIXED?
|
||||
// @formatter:off
|
||||
/*
|
||||
* if (_GrowthCapableMobs.get(npcId).getGrowthLevel() == 0)
|
||||
{
|
||||
npc.deleteMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
*/
|
||||
npc.deleteMe();
|
||||
// }
|
||||
// @formatter:on
|
||||
|
||||
// if this is finally a trained mob, then despawn any other trained mobs that the
|
||||
// player might have and initialize the Tamed Beast.
|
||||
if (CommonUtil.contains(TAMED_BEASTS, nextNpcId))
|
||||
{
|
||||
for (TamedBeastInstance oldTrained : player.getTrainedBeasts())
|
||||
{
|
||||
oldTrained.deleteMe();
|
||||
}
|
||||
|
||||
final TamedBeastInstance nextNpc = new TamedBeastInstance(nextNpcId, player, food - FOODSKILLDIFF, npc.getX(), npc.getY(), npc.getZ());
|
||||
nextNpc.setRunning();
|
||||
// TODO: Quest removed with Etina's Fate.
|
||||
// Q00020_BringUpWithLove.checkJewelOfInnocence(player);
|
||||
|
||||
// Support for A Grand Plan for Taming Wild Beasts (655) quest.
|
||||
// Q00655_AGrandPlanForTamingWildBeasts.reward(player, nextNpc); TODO: Replace me?
|
||||
|
||||
// also, perform a rare random chat
|
||||
if (getRandom(20) == 0)
|
||||
{
|
||||
final NpcStringId message = NpcStringId.getNpcStringId(getRandom(2024, 2029));
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, message, message.getParamCount() > 0 ? player.getName() : null);
|
||||
}
|
||||
// @formatter:off
|
||||
/*
|
||||
TODO: The tamed beast consumes one golden/crystal spice
|
||||
every 60 seconds with an initial delay of 60 seconds
|
||||
if (tamed beast exists and is alive)
|
||||
{
|
||||
if (player has 1+ golden/crystal spice)
|
||||
{
|
||||
take one golden/crystal spice;
|
||||
say random NpcString(getRandom(2029, 2038));
|
||||
}
|
||||
}
|
||||
*/
|
||||
// @formatter:on
|
||||
}
|
||||
else
|
||||
{
|
||||
// if not trained, the newly spawned mob will automatically be aggro against its feeder
|
||||
// (what happened to "never bite the hand that feeds you" anyway?!)
|
||||
final Attackable nextNpc = (Attackable) addSpawn(nextNpcId, npc);
|
||||
|
||||
if (MAD_COW_POLYMORPH.containsKey(nextNpcId))
|
||||
{
|
||||
startQuestTimer("polymorph Mad Cow", 10000, nextNpc, player);
|
||||
}
|
||||
|
||||
// register the player in the feedinfo for the mob that just spawned
|
||||
_feedInfo.put(nextNpc.getObjectId(), player.getObjectId());
|
||||
nextNpc.setRunning();
|
||||
nextNpc.addDamageHate(player, 0, 99999);
|
||||
nextNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
|
||||
{
|
||||
if (event.equalsIgnoreCase("polymorph Mad Cow") && (npc != null) && (player != null))
|
||||
{
|
||||
if (MAD_COW_POLYMORPH.containsKey(npc.getId()))
|
||||
{
|
||||
// remove the feed info from the previous mob
|
||||
if (_feedInfo.get(npc.getObjectId()) == player.getObjectId())
|
||||
{
|
||||
_feedInfo.remove(npc.getObjectId());
|
||||
}
|
||||
// despawn the mad cow
|
||||
npc.deleteMe();
|
||||
// spawn the new mob
|
||||
final Attackable nextNpc = (Attackable) addSpawn(MAD_COW_POLYMORPH.get(npc.getId()), npc);
|
||||
|
||||
// register the player in the feedinfo for the mob that just spawned
|
||||
_feedInfo.put(nextNpc.getObjectId(), player.getObjectId());
|
||||
nextNpc.setRunning();
|
||||
nextNpc.addDamageHate(player, 0, 99999);
|
||||
nextNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSkillSee(Npc npc, PlayerInstance caster, Skill skill, WorldObject[] targets, boolean isSummon)
|
||||
{
|
||||
// this behavior is only run when the target of skill is the passed npc (chest)
|
||||
// i.e. when the player is attempting to open the chest using a skill
|
||||
if (!CommonUtil.contains(targets, npc))
|
||||
{
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
}
|
||||
// gather some values on local variables
|
||||
final int npcId = npc.getId();
|
||||
final int skillId = skill.getId();
|
||||
// check if the npc and skills used are valid for this script. Exit if invalid.
|
||||
if ((skillId != SKILL_GOLDEN_SPICE) && (skillId != SKILL_CRYSTAL_SPICE))
|
||||
{
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
}
|
||||
|
||||
// first gather some values on local variables
|
||||
final int objectId = npc.getObjectId();
|
||||
int growthLevel = 3; // if a mob is in FEEDABLE_BEASTS but not in _GrowthCapableMobs, then it's at max growth (3)
|
||||
if (GROWTH_CAPABLE_MOBS.containsKey(npcId))
|
||||
{
|
||||
growthLevel = GROWTH_CAPABLE_MOBS.get(npcId).getGrowthLevel();
|
||||
}
|
||||
|
||||
// prevent exploit which allows 2 players to simultaneously raise the same 0-growth beast
|
||||
// If the mob is at 0th level (when it still listens to all feeders) lock it to the first feeder!
|
||||
if ((growthLevel == 0) && _feedInfo.containsKey(objectId))
|
||||
{
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
}
|
||||
|
||||
_feedInfo.put(objectId, caster.getObjectId());
|
||||
|
||||
int food = 0;
|
||||
if (skillId == SKILL_GOLDEN_SPICE)
|
||||
{
|
||||
food = GOLDEN_SPICE;
|
||||
}
|
||||
else if (skillId == SKILL_CRYSTAL_SPICE)
|
||||
{
|
||||
food = CRYSTAL_SPICE;
|
||||
}
|
||||
|
||||
// display the social action of the beast eating the food.
|
||||
npc.broadcastSocialAction(2);
|
||||
|
||||
// if this pet can't grow, it's all done.
|
||||
if (GROWTH_CAPABLE_MOBS.containsKey(npcId))
|
||||
{
|
||||
// do nothing if this mob doesn't eat the specified food (food gets consumed but has no effect).
|
||||
if (GROWTH_CAPABLE_MOBS.get(npcId).getMob(food, 0, 0) == null)
|
||||
{
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
}
|
||||
|
||||
// rare random talk...
|
||||
if (getRandom(20) == 0)
|
||||
{
|
||||
final NpcStringId message = TEXT[growthLevel][getRandom(TEXT[growthLevel].length)];
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, message, message.getParamCount() > 0 ? caster.getName() : null);
|
||||
}
|
||||
|
||||
if ((growthLevel > 0) && (_feedInfo.get(objectId) != caster.getObjectId()))
|
||||
{
|
||||
// check if this is the same player as the one who raised it from growth 0.
|
||||
// if no, then do not allow a chance to raise the pet (food gets consumed but has no effect).
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
}
|
||||
|
||||
// Polymorph the mob, with a certain chance, given its current growth level
|
||||
if (getRandom(100) < GROWTH_CAPABLE_MOBS.get(npcId).getChance())
|
||||
{
|
||||
spawnNext(npc, growthLevel, caster, food);
|
||||
}
|
||||
}
|
||||
else if (CommonUtil.contains(TAMED_BEASTS, npcId) && (npc instanceof TamedBeastInstance))
|
||||
{
|
||||
final TamedBeastInstance beast = ((TamedBeastInstance) npc);
|
||||
if (skillId == beast.getFoodType())
|
||||
{
|
||||
beast.onReceiveFood();
|
||||
final NpcStringId message = TAMED_TEXT[getRandom(TAMED_TEXT.length)];
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, message, message.getParamCount() > 0 ? caster.getName() : null);
|
||||
}
|
||||
}
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
|
||||
{
|
||||
// remove the feedinfo of the mob that got killed, if any
|
||||
if (_feedInfo.containsKey(npc.getObjectId()))
|
||||
{
|
||||
_feedInfo.remove(npc.getObjectId());
|
||||
}
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new FeedableBeasts();
|
||||
}
|
||||
}
|
||||
211
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/ImprovedBabyPets.java
vendored
Normal file
211
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/ImprovedBabyPets.java
vendored
Normal file
@@ -0,0 +1,211 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.BeastFarm;
|
||||
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.model.StatsSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Summon;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
|
||||
import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
|
||||
import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.skills.SkillCaster;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Improved Baby Pets AI.
|
||||
* @author St3eT
|
||||
*/
|
||||
public class ImprovedBabyPets extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int[] BABY_PETS =
|
||||
{
|
||||
16034, // Improved Baby Buffalo
|
||||
16035, // Improved Baby Kookaburra
|
||||
16036, // Improved Baby Cougar
|
||||
};
|
||||
// Skills
|
||||
private static final int PET_CONTROL = 5771;
|
||||
|
||||
private ImprovedBabyPets()
|
||||
{
|
||||
addSummonSpawnId(BABY_PETS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
|
||||
{
|
||||
if (player != null)
|
||||
{
|
||||
final Summon summon = player.getPet();
|
||||
|
||||
if (summon == null)
|
||||
{
|
||||
cancelQuestTimer("HEAL", null, player);
|
||||
cancelQuestTimer("BUFF", null, player);
|
||||
}
|
||||
else if (event.equals("HEAL") && player.isInCombat() && !summon.isHungry())
|
||||
{
|
||||
final double hpPer = (player.getCurrentHp() / player.getMaxHp()) * 100;
|
||||
final double mpPer = (player.getCurrentMp() / player.getMaxMp()) * 100;
|
||||
final int healType = summon.getTemplate().getParameters().getInt("heal_type", 0);
|
||||
final int skillLv = (int) Math.floor((summon.getLevel() / 5) - 11);
|
||||
|
||||
if (healType == 1)
|
||||
{
|
||||
final int stepLv = CommonUtil.constrain(skillLv, 0, 3);
|
||||
|
||||
if ((hpPer >= 30) && (hpPer < 70))
|
||||
{
|
||||
castHeal(summon, stepLv, 1);
|
||||
}
|
||||
else if (hpPer < 30)
|
||||
{
|
||||
castHeal(summon, stepLv, 2);
|
||||
}
|
||||
}
|
||||
else if (healType == 0)
|
||||
{
|
||||
if (hpPer < 30)
|
||||
{
|
||||
castHeal(summon, CommonUtil.constrain(skillLv, 0, 3), 2);
|
||||
}
|
||||
else if (mpPer < 60)
|
||||
{
|
||||
castHeal(summon, CommonUtil.constrain(skillLv, 0, 5), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (event.equals("BUFF") && !summon.isAffectedBySkill(PET_CONTROL) && !summon.isHungry())
|
||||
{
|
||||
final int buffStep = (int) CommonUtil.constrain(Math.floor((summon.getLevel() / 5) - 11), 0, 3);
|
||||
|
||||
for (int i = 1; i <= (2 * (1 + buffStep)); i++)
|
||||
{
|
||||
if (castBuff(summon, buffStep, i))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSummonSpawn(Summon summon)
|
||||
{
|
||||
startQuestTimer("HEAL", 5000, null, summon.getOwner(), true);
|
||||
startQuestTimer("BUFF", 10000, null, summon.getOwner(), true);
|
||||
}
|
||||
|
||||
@RegisterEvent(EventType.ON_PLAYER_LOGOUT)
|
||||
@RegisterType(ListenerRegisterType.GLOBAL)
|
||||
public void OnPlayerLogout(OnPlayerLogout event)
|
||||
{
|
||||
cancelQuestTimer("HEAL", null, event.getPlayer());
|
||||
cancelQuestTimer("BUFF", null, event.getPlayer());
|
||||
}
|
||||
|
||||
private boolean castBuff(Summon summon, int stepNumber, int buffNumber)
|
||||
{
|
||||
final PlayerInstance owner = summon.getOwner();
|
||||
final StatsSet parameters = summon.getTemplate().getParameters();
|
||||
final SkillHolder skill = parameters.getObject("step" + stepNumber + "_buff0" + buffNumber, SkillHolder.class);
|
||||
|
||||
if ((skill != null) && (owner != null))
|
||||
{
|
||||
final boolean previousFollowStatus = summon.getFollowStatus();
|
||||
final SkillHolder mergedSkill = parameters.getObject("step" + stepNumber + "_merged_buff0" + buffNumber, SkillHolder.class);
|
||||
final int targetType = parameters.getInt("step" + stepNumber + "_buff_target0" + buffNumber, 0);
|
||||
|
||||
if (!owner.hasAbnormalType(skill.getSkill().getAbnormalType()) && SkillCaster.checkUseConditions(summon, skill.getSkill()) && !owner.isDead())
|
||||
{
|
||||
if (mergedSkill != null)
|
||||
{
|
||||
if (owner.hasAbnormalType(mergedSkill.getSkill().getAbnormalType()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!previousFollowStatus && !summon.isInsideRadius3D(owner, skill.getSkill().getCastRange()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((targetType >= 0) && (targetType <= 2))
|
||||
{
|
||||
summon.getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, skill.getSkill(), (targetType == 1) ? summon : owner);
|
||||
summon.sendPacket(new SystemMessage(SystemMessageId.YOUR_PET_USES_S1).addSkillName(skill.getSkill()));
|
||||
|
||||
if (previousFollowStatus != summon.getFollowStatus())
|
||||
{
|
||||
summon.setFollowStatus(previousFollowStatus);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void castHeal(Summon summon, int stepNumber, int healNumber)
|
||||
{
|
||||
final boolean previousFollowStatus = summon.getFollowStatus();
|
||||
final PlayerInstance owner = summon.getOwner();
|
||||
final StatsSet parameters = summon.getTemplate().getParameters();
|
||||
final SkillHolder skill = parameters.getObject("step" + stepNumber + "_heal0" + healNumber, SkillHolder.class);
|
||||
final int targetType = parameters.getInt("step" + stepNumber + "_heal_target0" + healNumber, 0);
|
||||
|
||||
if ((skill != null) && (owner != null) && SkillCaster.checkUseConditions(summon, skill.getSkill()) && !owner.isDead())
|
||||
{
|
||||
if (!previousFollowStatus && !summon.isInsideRadius3D(owner, skill.getSkill().getCastRange()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!owner.hasAbnormalType(skill.getSkill().getAbnormalType()))
|
||||
{
|
||||
if ((targetType >= 0) && (targetType <= 2))
|
||||
{
|
||||
summon.getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, skill.getSkill(), (targetType == 1) ? summon : owner);
|
||||
summon.sendPacket(new SystemMessage(SystemMessageId.YOUR_PET_USES_S1).addSkillName(skill.getSkill()));
|
||||
|
||||
if (previousFollowStatus != summon.getFollowStatus())
|
||||
{
|
||||
summon.setFollowStatus(previousFollowStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new ImprovedBabyPets();
|
||||
}
|
||||
}
|
||||
4
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-01.html
vendored
Normal file
4
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-01.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Beast Herder Tunatun:<br>
|
||||
You wanted a Whip? Don't you already have one?<br>
|
||||
If you don't, I can give you one again. Unfortunately, if you already have one, I can't give you another. Resources are pretty limited out here, I'm sure you can understand.
|
||||
</body></html>
|
||||
5
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-02.html
vendored
Normal file
5
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-02.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Beast Herder Tunatun:<br>
|
||||
You...? You don't look that strong. Raising beasts is not an easy thing.<br>
|
||||
It could be really dangerious if something goes wrong. It's OK when they are young, but it becomes too dangerous for you to handle when they're are fully grown up.<br>
|
||||
Maybe it would be better for you to come back again when you become a little more stronger. Then, I will gladly give you this Beast Handler's Whip.
|
||||
</body></html>
|
||||
6
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-03.html
vendored
Normal file
6
L2J_Mobius_7.0_PreludeOfWar/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
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-04.html
vendored
Normal file
5
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-04.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Beast Herder Tunatun:<br>
|
||||
In order to give orders to the beasts, you need this Whip.<br>
|
||||
One beast used to be our limit, but thanks to the Beast Handler's Whip, it isn't a problem controlling more.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Tunatun 31537-05.html">Go on</Button>
|
||||
</body></html>
|
||||
3
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-05.html
vendored
Normal file
3
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-05.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Beast Herder Tunatun:<br>
|
||||
Look for Feed Sellers in this area like the one standing next to me. The feed you buy from them can be given to <font color="LEVEL">Alpine Buffalo, Alpine Grendel, Alpine Kookaburra, and Alpine Buffalo</font>. The more feed you give each beast, the more they'll grow.<br>Remember though, tamed beasts will run away if you run out of feed to give them. So be careful.
|
||||
</body></html>
|
||||
3
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-06.html
vendored
Normal file
3
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537-06.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Beast Herder Tunatun:<br>
|
||||
Oh, I see. I hope you will get a good result.
|
||||
</body></html>
|
||||
5
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537.html
vendored
Normal file
5
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/31537.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Beast Herder Tunatun:<br>
|
||||
Hi! Welcome to the Beast Farm. My name is Tunatun and I'm the one in charge here. I got this job because I thought I'd be able to commune with the beasts. After all, my pet kitty back home absolutely loved me. On this farm though, it's not so easy.<br>As a matter of fact, I'm having a lot of trouble with these beasts. They tend to fight back if you try to feed or tame them, so I've hired a Feed Seller and various adventurers to help me manage and protect the farm. At this point, there's not much else I can do.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Tunatun whip">Take the Beast Handler's Whip</Button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
||||
88
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/Tunatun.java
vendored
Normal file
88
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BeastFarm/Tunatun/Tunatun.java
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.BeastFarm.Tunatun;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Beast Herder Tunatun AI.
|
||||
* @author Adry_85
|
||||
*/
|
||||
public 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, Npc npc, PlayerInstance 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();
|
||||
}
|
||||
}
|
||||
53
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BloodySwampland/BloodySwampland.java
vendored
Normal file
53
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/BloodySwampland/BloodySwampland.java
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.BloodySwampland;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Bloody Swampland AI.
|
||||
* @author St3eT
|
||||
*/
|
||||
public class BloodySwampland extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int COLLECTOR = 23171; // Corpse Collector
|
||||
|
||||
public BloodySwampland()
|
||||
{
|
||||
addAttackId(COLLECTOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon)
|
||||
{
|
||||
if (npc.isScriptValue(0) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.3)))
|
||||
{
|
||||
addSkillCastDesire(npc, attacker, npc.getParameters().getSkillHolder("Skill01_ID"), 23);
|
||||
npc.setScriptValue(1);
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new BloodySwampland();
|
||||
}
|
||||
}
|
||||
4
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-01.html
vendored
Normal file
4
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-01.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Alarm System:<br>
|
||||
As the alarm rings, a window for the passcode pops up. On the screen you see the number 120, which begins counting down. It looks like the alarm system will be activated in about 2 minutes unless the passcode is successfully entered.<br>
|
||||
<a action="bypass -h Quest Alarm 2">Enter the passcode.</a>
|
||||
</body></html>
|
||||
4
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-02.html
vendored
Normal file
4
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-02.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Alarm System:<br>
|
||||
The alarm is ringing loudly. You should leave here immediately.<br>
|
||||
(Another person has already undertaken the quest.)
|
||||
</body></html>
|
||||
42
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-184_02.html
vendored
Normal file
42
L2J_Mobius_7.0_PreludeOfWar/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
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-184_04.html
vendored
Normal file
42
L2J_Mobius_7.0_PreludeOfWar/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
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-184_06.html
vendored
Normal file
42
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-184_06.html
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<html><body>Alarm System:<br>
|
||||
########################<br>
|
||||
Enter the passcode for communication.<br>
|
||||
Passcode : **|<br>
|
||||
########################<br>
|
||||
The third number is...
|
||||
<table border="0" border color="white" width="65" height="65">
|
||||
<tr>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 32367-184_08.html">1</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 32367-184_08.html">2</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 32367-184_08.html">3</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 32367-184_08.html">4</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 32367-184_08.html">5</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 32367-184_08.html">6</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 32367-184_08.html">7</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 32367-184_08.html">8</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 5">9</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body></html>
|
||||
43
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-184_08.html
vendored
Normal file
43
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-184_08.html
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<html><body>
|
||||
Alarm System:<br>
|
||||
########################<br>
|
||||
Enter the passcode for communication.<br>
|
||||
Passcode : ***|<br>
|
||||
########################<br>
|
||||
The fourth number is...
|
||||
<table border="0" border color="white" width="65" height="65">
|
||||
<tr>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 6">1</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 6">2</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 6">3</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 6">4</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 6">5</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 6">6</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 6">7</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 6">8</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 6">9</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><body>Alarm System:<br>
|
||||
########################<br>
|
||||
Enter the passcode for communication.<br>
|
||||
Passcode : ****<br>
|
||||
########################<br>
|
||||
Validation completed. Alarm has been disabled.
|
||||
</body></html>
|
||||
@@ -0,0 +1,9 @@
|
||||
<html><body>Alarm System:<br>
|
||||
########################<br>
|
||||
Enter the passcode for communication.<br>
|
||||
Passcode : ****<br>
|
||||
########################<br>
|
||||
Validation has failed. <br>
|
||||
<br>
|
||||
<a action="bypass -h Quest Alarm 2">Re-enter passcode.</a>
|
||||
</body></html>
|
||||
42
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-185_02.html
vendored
Normal file
42
L2J_Mobius_7.0_PreludeOfWar/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
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-185_04.html
vendored
Normal file
43
L2J_Mobius_7.0_PreludeOfWar/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
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-185_06.html
vendored
Normal file
41
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-185_06.html
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
<html><body>Alarm System:<br>
|
||||
########################<br>
|
||||
Enter the passcode for communication.<br>
|
||||
Passcode : **|<br>
|
||||
########################<br>
|
||||
The third number is...
|
||||
<table border="0" border color="white" width="65" height="65">
|
||||
<tr>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 32367-184_08.html">1</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 32367-184_08.html">2</a>
|
||||
</td> <td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 32367-184_08.html">3</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 32367-184_08.html">4</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 32367-184_08.html">5</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 32367-184_08.html">6</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 32367-184_08.html">7</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 32367-184_08.html">8</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 5">9</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body></html>
|
||||
42
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-185_08.html
vendored
Normal file
42
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/32367-185_08.html
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<html><body>Alarm System:<br>
|
||||
########################<br>
|
||||
Enter the passcode for communication.<br>
|
||||
Passcode : ***| <br>
|
||||
########################<br>
|
||||
The fourth number is...
|
||||
<table border="0" border color="white" width="65" height="65">
|
||||
<tr>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 6">1</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 6">2</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 6">3</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 6">4</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 6">5</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 6">6</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 6">7</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 6">8</a>
|
||||
</td>
|
||||
<td width="20" height="20" align="center">
|
||||
<a action="bypass -h Quest Alarm 6">9</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><body>Alarm System:<br>
|
||||
########################<br>
|
||||
Enter the passcode for communication.<br>
|
||||
Passcode : **** <br>
|
||||
########################<br>
|
||||
Validation completed. Alarm has been disabled.
|
||||
</body></html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<html><body>Alarm System:<br>
|
||||
########################<br>
|
||||
Enter passcode for communication.<br>
|
||||
Passcode : **** <br>########################<br>
|
||||
Validation has failed.<br>
|
||||
<br>
|
||||
<a action="bypass -h Quest Alarm 2">Re-enter passcode.</a>
|
||||
</body></html>
|
||||
357
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/Alarm.java
vendored
Normal file
357
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/Alarm.java
vendored
Normal file
@@ -0,0 +1,357 @@
|
||||
/*
|
||||
* 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 org.l2jmobius.gameserver.enums.ChatType;
|
||||
import org.l2jmobius.gameserver.enums.QuestSound;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.QuestState;
|
||||
import org.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 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, Npc npc, PlayerInstance player)
|
||||
{
|
||||
String htmltext = null;
|
||||
final PlayerInstance player0 = npc.getVariables().getObject("player0", PlayerInstance.class);
|
||||
final Npc npc0 = npc.getVariables().getObject("npc0", Npc.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(Npc npc, PlayerInstance talker)
|
||||
{
|
||||
String htmltext = getNoQuestMsg(talker);
|
||||
if (verifyMemoState(talker, ART_OF_PERSUASION_ID, 3) || verifyMemoState(talker, NIKOLAS_COOPERATION_ID, 3))
|
||||
{
|
||||
final PlayerInstance player = npc.getVariables().getObject("player0", PlayerInstance.class);
|
||||
if (player == talker)
|
||||
{
|
||||
htmltext = "32367-01.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "32367-02.html";
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(Npc npc)
|
||||
{
|
||||
cancelQuestTimer("SELF_DESTRUCT_IN_60", npc, null);
|
||||
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 PlayerInstance player = npc.getVariables().getObject("player0", PlayerInstance.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(PlayerInstance 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 void setMemoState(PlayerInstance 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(PlayerInstance 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 void setMemoStateEx(PlayerInstance 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();
|
||||
}
|
||||
}
|
||||
87
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/CrumaTower.java
vendored
Normal file
87
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/CrumaTower/CrumaTower.java
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* 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 org.l2jmobius.gameserver.enums.ChatType;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.events.EventType;
|
||||
import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
|
||||
import org.l2jmobius.gameserver.model.events.annotations.Id;
|
||||
import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
|
||||
import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
|
||||
import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureDamageReceived;
|
||||
import org.l2jmobius.gameserver.network.NpcStringId;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Cruma Tower AI
|
||||
* @author malyelfik
|
||||
*/
|
||||
public class CrumaTower extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int CARSUS = 30483;
|
||||
private static final int TELEPORT_DEVICE = 33157;
|
||||
|
||||
public CrumaTower()
|
||||
{
|
||||
addSpawnId(CARSUS);
|
||||
addAttackId(TELEPORT_DEVICE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
|
||||
{
|
||||
if (event.equals("MESSAGE") && (npc != null))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_CAN_GO_TO_UNDERGROUND_LV_3_USING_THE_ELEVATOR_IN_THE_BACK);
|
||||
startQuestTimer(event, 15000, npc, player);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(Npc npc)
|
||||
{
|
||||
startQuestTimer("MESSAGE", 15000, npc, null);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
@RegisterEvent(EventType.ON_CREATURE_DAMAGE_RECEIVED)
|
||||
@RegisterType(ListenerRegisterType.NPC)
|
||||
@Id(TELEPORT_DEVICE)
|
||||
public void onCreatureDamageReceived(OnCreatureDamageReceived event)
|
||||
{
|
||||
try
|
||||
{
|
||||
final Npc npc = (Npc) event.getTarget();
|
||||
final int[] location = npc.getParameters().getIntArray("teleport", ";");
|
||||
event.getAttacker().teleToLocation(location[0], location[1], location[2]);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.warning("Invalid location for Cruma Tower teleport device.");
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new CrumaTower();
|
||||
}
|
||||
}
|
||||
234
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/DenOfEvil/DenOfEvil.java
vendored
Normal file
234
L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/DenOfEvil/DenOfEvil.java
vendored
Normal file
@@ -0,0 +1,234 @@
|
||||
/*
|
||||
* 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.DenOfEvil;
|
||||
|
||||
import org.l2jmobius.commons.concurrent.ThreadPool;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.gameserver.data.xml.impl.SkillData;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.skills.Skill;
|
||||
import org.l2jmobius.gameserver.model.zone.type.EffectZone;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import org.l2jmobius.gameserver.scripting.annotations.Disabled;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Dummy AI for spawns/respawns only for testing.
|
||||
* @author Gnacik
|
||||
*/
|
||||
@Disabled // Mobius: this needs to be rewritten.
|
||||
public class DenOfEvil extends AbstractNpcAI
|
||||
{
|
||||
// private static final int _buffer_id = 32656;
|
||||
protected static final int[] EYE_IDS =
|
||||
{
|
||||
18812,
|
||||
18813,
|
||||
18814
|
||||
};
|
||||
private static final int SKILL_ID = 6150; // others +2
|
||||
|
||||
private static final Location[] EYE_SPAWNS =
|
||||
{
|
||||
new Location(71544, -129400, -3360, 16472),
|
||||
new Location(70954, -128854, -3360, 16),
|
||||
new Location(72145, -128847, -3368, 32832),
|
||||
new Location(76147, -128372, -3144, 16152),
|
||||
new Location(71573, -128309, -3360, 49152),
|
||||
new Location(75211, -127441, -3152, 0),
|
||||
new Location(77005, -127406, -3144, 32784),
|
||||
new Location(75965, -126486, -3144, 49120),
|
||||
new Location(70972, -126429, -3016, 19208),
|
||||
new Location(69916, -125838, -3024, 2840),
|
||||
new Location(71658, -125459, -3016, 35136),
|
||||
new Location(70605, -124646, -3040, 52104),
|
||||
new Location(67283, -123237, -2912, 12376),
|
||||
new Location(68383, -122754, -2912, 27904),
|
||||
new Location(74137, -122733, -3024, 13272),
|
||||
new Location(66736, -122007, -2896, 60576),
|
||||
new Location(73289, -121769, -3024, 1024),
|
||||
new Location(67894, -121491, -2912, 43872),
|
||||
new Location(75530, -121477, -3008, 34424),
|
||||
new Location(74117, -120459, -3024, 52344),
|
||||
new Location(69608, -119855, -2534, 17251),
|
||||
new Location(71014, -119027, -2520, 31904),
|
||||
new Location(68944, -118964, -2527, 59874),
|
||||
new Location(62261, -118263, -3072, 12888),
|
||||
new Location(70300, -117942, -2528, 46208),
|
||||
new Location(74312, -117583, -2272, 15280),
|
||||
new Location(63276, -117409, -3064, 24760),
|
||||
new Location(68104, -117192, -2168, 15888),
|
||||
new Location(73758, -116945, -2216, 0),
|
||||
new Location(74944, -116858, -2220, 30892),
|
||||
new Location(61715, -116623, -3064, 59888),
|
||||
new Location(69140, -116464, -2168, 28952),
|
||||
new Location(67311, -116374, -2152, 1280),
|
||||
new Location(62459, -116370, -3064, 48624),
|
||||
new Location(74475, -116260, -2216, 47456),
|
||||
new Location(68333, -115015, -2168, 45136),
|
||||
new Location(68280, -108129, -1160, 17992),
|
||||
new Location(62983, -107259, -2384, 12552),
|
||||
new Location(67062, -107125, -1144, 64008),
|
||||
new Location(68893, -106954, -1160, 36704),
|
||||
new Location(63848, -106771, -2384, 32784),
|
||||
new Location(62372, -106514, -2384, 0),
|
||||
new Location(67838, -106143, -1160, 51232),
|
||||
new Location(62905, -106109, -2384, 51288)
|
||||
};
|
||||
|
||||
private DenOfEvil()
|
||||
{
|
||||
addKillId(EYE_IDS);
|
||||
addSpawnId(EYE_IDS);
|
||||
for (Location loc : EYE_SPAWNS)
|
||||
{
|
||||
addSpawn(EYE_IDS[getRandom(EYE_IDS.length)], loc, false, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private int getSkillIdByNpcId(int npcId)
|
||||
{
|
||||
int diff = npcId - EYE_IDS[0];
|
||||
diff *= 2;
|
||||
return SKILL_ID + diff;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(Npc npc)
|
||||
{
|
||||
npc.disableCoreAI(true);
|
||||
npc.setIsImmobilized(true);
|
||||
final EffectZone zone = ZoneManager.getInstance().getZone(npc, EffectZone.class);
|
||||
if (zone == null)
|
||||
{
|
||||
LOGGER.warning("NPC " + npc + " spawned outside of EffectZone, check your zone coords! X:" + npc.getX() + " Y:" + npc.getY() + " Z:" + npc.getZ());
|
||||
return null;
|
||||
}
|
||||
final int skillId = getSkillIdByNpcId(npc.getId());
|
||||
final int skillLevel = zone.getSkillLevel(skillId);
|
||||
zone.addSkill(skillId, skillLevel + 1);
|
||||
if (skillLevel == 3) // 3+1=4
|
||||
{
|
||||
ThreadPool.schedule(new KashaDestruction(zone), 2 * 60 * 1000);
|
||||
zone.broadcastPacket(new SystemMessage(SystemMessageId.DEFEAT_KASHA_S_EYES_TO_LIFT_THE_GREAT_CURSE));
|
||||
}
|
||||
else if (skillLevel == 2)
|
||||
{
|
||||
zone.broadcastPacket(new SystemMessage(SystemMessageId.A_GREAT_CURSE_CAN_BE_FELT_FROM_KASHA_S_EYES));
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
|
||||
{
|
||||
ThreadPool.schedule(new RespawnNewEye(npc.getLocation()), 15000);
|
||||
final EffectZone zone = ZoneManager.getInstance().getZone(npc, EffectZone.class);
|
||||
if (zone == null)
|
||||
{
|
||||
LOGGER.warning("NPC " + npc + " killed outside of EffectZone, check your zone coords! X:" + npc.getX() + " Y:" + npc.getY() + " Z:" + npc.getZ());
|
||||
return null;
|
||||
}
|
||||
final int skillId = getSkillIdByNpcId(npc.getId());
|
||||
final int skillLevel = zone.getSkillLevel(skillId);
|
||||
zone.addSkill(skillId, skillLevel - 1);
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
|
||||
private class RespawnNewEye implements Runnable
|
||||
{
|
||||
private final Location _loc;
|
||||
|
||||
public RespawnNewEye(Location loc)
|
||||
{
|
||||
_loc = loc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
addSpawn(EYE_IDS[getRandom(EYE_IDS.length)], _loc, false, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private class KashaDestruction implements Runnable
|
||||
{
|
||||
EffectZone _zone;
|
||||
|
||||
public KashaDestruction(EffectZone zone)
|
||||
{
|
||||
_zone = zone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
for (int i = SKILL_ID; i <= (SKILL_ID + 4); i += 2)
|
||||
{
|
||||
// test 3 skills if some is lvl 4
|
||||
if (_zone.getSkillLevel(i) > 3)
|
||||
{
|
||||
destroyZone();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void destroyZone()
|
||||
{
|
||||
for (Creature creature : _zone.getCharactersInside())
|
||||
{
|
||||
if (creature == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (creature.isPlayable())
|
||||
{
|
||||
final Skill skill = SkillData.getInstance().getSkill(6149, 1);
|
||||
skill.applyEffects(creature, creature);
|
||||
}
|
||||
else if (creature.doDie(null)) // mobs die
|
||||
{
|
||||
if (creature.isNpc())
|
||||
{
|
||||
// respawn eye
|
||||
final Npc npc = (Npc) creature;
|
||||
if (CommonUtil.contains(EYE_IDS, npc.getId()))
|
||||
{
|
||||
ThreadPool.schedule(new RespawnNewEye(npc.getLocation()), 15000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = SKILL_ID; i <= (SKILL_ID + 4); i += 2)
|
||||
{
|
||||
_zone.removeSkill(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new DenOfEvil();
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user