Replaced old Giants Cave AI with the new one.

This commit is contained in:
MobiusDev 2017-03-19 12:00:35 +00:00
parent 1de2f9f082
commit bf05980f3b
15 changed files with 145 additions and 257 deletions

View File

@ -1,132 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ai.areas.Aden.GiantsCaveNpc;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
import ai.AbstractNpcAI;
/**
* Giants Cave Npcs AI
* @author Gigi
* @date 2017-03-04 - [17:33:25]
*/
public class GiantsCaveNpc extends AbstractNpcAI
{
// NPC
private static final int SUMADRIBA = 34217;
private static final int KRENAHT = 34237;
private static final int STHOR = 34219;
private static final int GIANT_TELEPORT = 34223;
private GiantsCaveNpc()
{
addTalkId(SUMADRIBA, KRENAHT, GIANT_TELEPORT, STHOR);
addFirstTalkId(SUMADRIBA, KRENAHT, GIANT_TELEPORT, STHOR);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = null;
switch (event)
{
case "34237.html":
case "34237-1.html":
case "34237-2.html":
case "34237-3.html":
case "34237-4.html":
case "34237-5.html":
case "34237-6.html":
{
htmltext = event;
break;
}
case "first_area":
{
htmltext = "34223-1.html";
break;
}
case "second_area":
{
htmltext = "34223-1.html";
break;
}
case "thrid_area":
{
htmltext = "34223-1.html";
break;
}
case "stronghold":
{
htmltext = "34223-2.html";
break;
}
case "relics_rooom":
{
htmltext = "34223-3.html";
break;
}
}
return htmltext;
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
switch (npc.getId())
{
case SUMADRIBA:
{
player.sendPacket(new PlaySound(3, "Npcdialog1.schmadriba_faction_1", 0, 0, 0, 0, 0));
break;
}
case KRENAHT:
{
if (getRandom(10) < 5)
{
player.sendPacket(new PlaySound(3, "Npcdialog1.krenat_faction_2", 0, 0, 0, 0, 0));
}
else
{
player.sendPacket(new PlaySound(3, "Npcdialog1.krenat_faction_1", 0, 0, 0, 0, 0));
}
break;
}
case STHOR:
{
if (getRandom(10) < 4)
{
player.sendPacket(new PlaySound(3, "Npcdialog1.stor_faction_2", 0, 0, 0, 0, 0));
}
else
{
player.sendPacket(new PlaySound(3, "Npcdialog1.stor_faction_1", 0, 0, 0, 0, 0));
}
break;
}
}
return npc.getId() + ".html";
}
public static void main(String[] args)
{
new GiantsCaveNpc();
}
}

View File

@ -3,9 +3,9 @@ This is a Teleport Device installed by the Giant Pursuers to teleport into the G
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">Giant Pursuers faction level 2 and above</font><br1>
Location - Upper level of the Giant's Cave, Kamael's Stronghold,<br1>entrance to the Giants' Room of Relics</center><br><br>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest GiantsCaveNpc first_area">Teleport to the first area</Button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest GiantsCaveNpc second_area">Teleport to the second area</Button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest GiantsCaveNpc thrid_area">Teleport to the third area</Button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest GiantsCaveNpc stronghold">Teleport to Kamael's Stronghold</Button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest GiantsCaveNpc relics_rooom">Teleport to the entrance to the Giants' Room of Relics</Button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest GiantsCave first_area">Teleport to the first area</Button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest GiantsCave second_area">Teleport to the second area</Button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest GiantsCave thrid_area">Teleport to the third area</Button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest GiantsCave stronghold">Teleport to Kamael's Stronghold</Button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest GiantsCave relics_rooom">Teleport to the entrance to the Giants' Room of Relics</Button>
</body></html>

View File

@ -2,5 +2,5 @@
I have heard from Kekropus that the Resistance Mark has been handed to those of you who have helped us here.<br>
However, the Giants have found out about the mark, and we can no longer guarantee the safety of those who hold it.<br>
Kekropus finds this situation regrettable. He has instructed us to take the Resistance Marks back from those who hold it, and offer a reward for their hard work. However, only those who hold <font color="LEVEL">Stage 2 or above Resistance Marks</font> are eligible to receive rewards.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest GiantsCaveNpc 34237-2.html">"Thanks."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest GiantsCave 34237-2.html">"Thanks."</Button>
</body></html>

View File

@ -2,8 +2,8 @@
Are you curious about the Giant Pursuers Talisman? The Giant Pursuers Talisman is given to those who help the work of the Giant Pursuers. But it's not easy to make, and that means we can't just hand them out at will.<br>
If you would collect the ingredients necessary to make the Giant Pursuers Talisman, I can use those ingredients to make the Talisman.<br>
I can also help you to improve the performance of the Giant Pursuers Talisman.<br>
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest GiantsCaveNpc 34237-5.html">"Tell me how the talisman is made."</Button>
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest GiantsCaveNpc 34237-6.html">"Tell me about the effects."</Button>
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest GiantsCave 34237-5.html">"Tell me how the talisman is made."</Button>
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest GiantsCave 34237-6.html">"Tell me about the effects."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 2182">"I want to make a Giant Pursuers Talisman."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 2183">"I want to upgrade."</Button>
</body></html>

View File

@ -4,5 +4,5 @@ If you want to make a Giant Pursuers Talisman, you'll need to collect the core m
The core ingredients are the <font color="LEVEL">Giant Crystal</font> and the <font color="LEVEL">Giant's Energy</font>. The <font color="LEVEL">Giant Crystal</font> is contained in the supply box that we have given you in exchange for your hep with our missions.<br>
Also, the performance of the talismans can be improved, but that will require additional materials. Be sure to check beforehand.<br>
If you want to make a talisman, prepare the materials necessary. Also be prepared to pay the cost.<br>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest GiantsCaveNpc 34237-4.html">Back</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest GiantsCave 34237-4.html">Back</Button>
</body></html>

View File

@ -2,5 +2,5 @@
What effects does the Giant Pursuers Talisman have, you ask? You're quite the pragmatist, I see. Well, it's nothing difficult to tell you, so I will.<br>
We came to create the Giant TrPursuers Talisman while searching for a way to gain the advantage when taking on the Giants. If you wear the Giant Pursuers Talisman, we will be able to help you when you need to take on the Giants.<br>
Of course, it doesn't apply to all Giants. It'll be less than useless against such powerful beings as Mimir, Ramona, or Helios, but with the other run-of-the-mill giants, it should be quite potent.<br>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest GiantsCaveNpc 34237-4.html">Back</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest GiantsCave 34237-4.html">Back</Button>
</body></html>

View File

@ -1,8 +1,8 @@
<html><body>Krenaht:<br>
You must be quite interested in the Giants to bring yourself to such a place. I am Krenaht, manager of the Giant Pursuers under Kekropus' command.<br>
When the Superion emerged, and Kekropus together with it, I have been placed in charge of matters relating to the Giant's Cave.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest GiantsCaveNpc 34237-1.html">"Tell me about returning the Resistance Mark."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest GiantsCaveNpc 34237-3.html">"Tell me about the Pursuers' Shine Stone."</Button>
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest GiantsCaveNpc 34237-4.html">"Tell me about the Giant Pursuers Talisman."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest GiantsCave 34237-1.html">"Tell me about returning the Resistance Mark."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest GiantsCave 34237-3.html">"Tell me about the Pursuers' Shine Stone."</Button>
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest GiantsCave 34237-4.html">"Tell me about the Giant Pursuers Talisman."</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -1,112 +1,132 @@
/*
* 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.GiantsCave;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Giant's Cave AI.
* @author Gnacik, St3eT
*/
public final class GiantsCave extends AbstractNpcAI
{
// NPC
private static final int[] SCOUTS =
{
22668, // Gamlin (Scout)
22669, // Leogul (Scout)
};
private GiantsCave()
{
addAttackId(SCOUTS);
addAggroRangeEnterId(SCOUTS);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("ATTACK") && (player != null) && (npc != null) && !npc.isDead())
{
if (npc.getId() == SCOUTS[0]) // Gamlin
{
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.INTRUDER_DETECTED);
}
else
{
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.OH_GIANTS_AN_INTRUDER_HAS_BEEN_DISCOVERED);
}
L2World.getInstance().forEachVisibleObjectInRange(npc, L2Attackable.class, 450, characters ->
{
if ((getRandomBoolean()))
{
addAttackPlayerDesire(characters, player);
}
});
}
else if (event.equals("CLEAR") && (npc != null) && !npc.isDead())
{
npc.setScriptValue(0);
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
{
if (npc.isScriptValue(0))
{
npc.setScriptValue(1);
startQuestTimer("ATTACK", 6000, npc, attacker);
startQuestTimer("CLEAR", 120000, npc, null);
}
return super.onAttack(npc, attacker, damage, isSummon);
}
@Override
public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon)
{
if (npc.isScriptValue(0))
{
npc.setScriptValue(1);
if (getRandomBoolean())
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_GUYS_ARE_DETECTED);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WHAT_KIND_OF_CREATURES_ARE_YOU);
}
startQuestTimer("ATTACK", 6000, npc, player);
startQuestTimer("CLEAR", 120000, npc, null);
}
return super.onAggroRangeEnter(npc, player, isSummon);
}
public static void main(String[] args)
{
new GiantsCave();
}
}
/*
* 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.GiantsCave;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
import ai.AbstractNpcAI;
/**
* Giants Cave Npcs AI
* @author Gigi
* @date 2017-03-04 - [17:33:25]
*/
public class GiantsCave extends AbstractNpcAI
{
// NPC
private static final int SUMADRIBA = 34217;
private static final int KRENAHT = 34237;
private static final int STHOR = 34219;
private static final int GIANT_TELEPORT = 34223;
private GiantsCave()
{
addTalkId(SUMADRIBA, KRENAHT, GIANT_TELEPORT, STHOR);
addFirstTalkId(SUMADRIBA, KRENAHT, GIANT_TELEPORT, STHOR);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = null;
switch (event)
{
case "34237.html":
case "34237-1.html":
case "34237-2.html":
case "34237-3.html":
case "34237-4.html":
case "34237-5.html":
case "34237-6.html":
{
htmltext = event;
break;
}
case "first_area":
{
htmltext = "34223-1.html";
break;
}
case "second_area":
{
htmltext = "34223-1.html";
break;
}
case "thrid_area":
{
htmltext = "34223-1.html";
break;
}
case "stronghold":
{
htmltext = "34223-2.html";
break;
}
case "relics_rooom":
{
htmltext = "34223-3.html";
break;
}
}
return htmltext;
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
switch (npc.getId())
{
case SUMADRIBA:
{
player.sendPacket(new PlaySound(3, "Npcdialog1.schmadriba_faction_1", 0, 0, 0, 0, 0));
break;
}
case KRENAHT:
{
if (getRandom(10) < 5)
{
player.sendPacket(new PlaySound(3, "Npcdialog1.krenat_faction_2", 0, 0, 0, 0, 0));
}
else
{
player.sendPacket(new PlaySound(3, "Npcdialog1.krenat_faction_1", 0, 0, 0, 0, 0));
}
break;
}
case STHOR:
{
if (getRandom(10) < 4)
{
player.sendPacket(new PlaySound(3, "Npcdialog1.stor_faction_2", 0, 0, 0, 0, 0));
}
else
{
player.sendPacket(new PlaySound(3, "Npcdialog1.stor_faction_1", 0, 0, 0, 0, 0));
}
break;
}
}
return npc.getId() + ".html";
}
public static void main(String[] args)
{
new GiantsCave();
}
}