Custom Faction certificate script and NPC html updates.

Contributed by CostyKiller.
This commit is contained in:
MobiusDevelopment 2020-10-12 10:52:22 +00:00
parent 8460eda6eb
commit bdfa4a7240
8 changed files with 135 additions and 0 deletions

View File

@ -1,5 +1,6 @@
<html><body>Ferin:<br>
What brings you here? Well, I don't really care about what you are up to. Can you stop looking down at me like that? I'm not a kid.<b>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 1">"What happened to the Ertheia?"</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h Quest FactionCertificates getCertificate">Get guild certificate.</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -2,5 +2,6 @@
Greetings. I am Irene, leader of the Mother Tree Guardians.<br>
We the Mother Tree Guardians are engaged in a variety of activities to revive the dying Mother Tree.<br>
There is still so much we need to talk about. I hope that we can talk some more when the opportunity is right.<br>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h Quest FactionCertificates getCertificate">Get guild certificate.</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -3,5 +3,6 @@ Who goes there! What is your affiliation?<br>
I am Captain Logart Van Dyke of the Kingdom's Royal Guard, successor of the Van Dyke household. <br>
We, Kingdom's Royal Guard, are under the direct command of Amadeo Cadmus, King of Aden.<br>
You must consider all assignments I give you to be directly from the king himself, and apply yourself with diligence!<br>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h Quest FactionCertificates getCertificate">Get guild certificate.</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -5,5 +5,6 @@ Until now, I was watching the situation on the continent. What would one as old
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest Kekropus teleport"><font color="LEVEL">Go up to the Superion</font></Button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest Kekropus helios"><font color="LEVEL">Open the path to Helios' Throne</font></Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 3422201">Exchange supplies to take on Helios</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h Quest FactionCertificates getCertificate">Get guild certificate.</Button>
<Button ALIGN=LEFT ICON="Quest" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -4,5 +4,6 @@ Have we met...? I am a Dreadnought from Innadril. I feel as if I have known you
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LeonaBlackbird 31595-01.html">"I heard something about slave trading. What's going on?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LeonaBlackbird 31595-02.html">"Tell me about the Fragments of Chaos?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LeonaBlackbird 31595-03.html">"What is a Giant's Grinder?"</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h Quest FactionCertificates getCertificate">Get guild certificate.</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -0,0 +1,123 @@
/*
* 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.others.FactionCertificates;
import org.l2jmobius.gameserver.enums.Faction;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.quest.QuestState;
import ai.AbstractNpcAI;
import quests.Q10875_ForReputation.Q10875_ForReputation;
import quests.Q10881_ForThePride.Q10881_ForThePride;
/**
* Custom Faction Certificates AI.
* @author CostyKiller
*/
public class FactionCertificates extends AbstractNpcAI
{
// NPCs
private static final int LEONA_BLACKBIRD = 31595; // Blackbird Guild Leader
private static final int KEKROPUS = 34222; // Giant Trackers Guild Leader
private static final int IRENE = 34233; // Mother Tree Guardians Guild Leader
private static final int FERIN = 34054; // Unwordly Visitors Guild Leader
private static final int LOGART_VAN_DIKE = 34235; // Royal Kingdom Guards Guild Leader
// Certificates
private static final int BLACKBIRD_CLAN_CERTIFICATION = 47840;
private static final int GIANT_TRACKERS_CERTIFICATION = 47841;
private static final int MOTHER_TREE_GUARDIANS_CERTIFICATION = 47844;
private static final int UNWORDLY_VISITORS_CERTIFICATION = 47845;
private static final int KINGDOM_ROYAL_GUARDS_CERTIFICATION = 47846;
// Other
private static final int FACTION_LEVEL = 6;
private FactionCertificates()
{
addStartNpc(LEONA_BLACKBIRD, KEKROPUS, IRENE, FERIN, LOGART_VAN_DIKE);
addTalkId(LEONA_BLACKBIRD, KEKROPUS, IRENE, FERIN, LOGART_VAN_DIKE);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
String htmltext = null;
final QuestState qs1 = player.getQuestState(Q10875_ForReputation.class.getSimpleName());
final QuestState qs2 = player.getQuestState(Q10881_ForThePride.class.getSimpleName());
if (((qs1 != null) && qs1.isStarted()) || ((qs2 != null) && qs2.isStarted()))
{
if (event.equals("getCertificate"))
{
switch (npc.getId())
{
case LEONA_BLACKBIRD:
{
if (!hasQuestItems(player, BLACKBIRD_CLAN_CERTIFICATION) && (player.getFactionLevel(Faction.BLACKBIRD_CLAN) >= FACTION_LEVEL))
{
giveItems(player, BLACKBIRD_CLAN_CERTIFICATION, 1);
htmltext = "certificate.html";
}
break;
}
case KEKROPUS:
{
if (!hasQuestItems(player, GIANT_TRACKERS_CERTIFICATION) && (player.getFactionLevel(Faction.GIANT_TRACKERS) >= FACTION_LEVEL))
{
giveItems(player, GIANT_TRACKERS_CERTIFICATION, 1);
htmltext = "certificate.html";
}
break;
}
case IRENE:
{
if (!hasQuestItems(player, MOTHER_TREE_GUARDIANS_CERTIFICATION) && (player.getFactionLevel(Faction.MOTHER_TREE_GUARDIANS) >= FACTION_LEVEL))
{
giveItems(player, MOTHER_TREE_GUARDIANS_CERTIFICATION, 1);
htmltext = "certificate.html";
}
break;
}
case FERIN:
{
if (!hasQuestItems(player, UNWORDLY_VISITORS_CERTIFICATION) && (player.getFactionLevel(Faction.UNWORLDLY_VISITORS) >= FACTION_LEVEL))
{
giveItems(player, UNWORDLY_VISITORS_CERTIFICATION, 1);
htmltext = "certificate.html";
}
break;
}
case LOGART_VAN_DIKE:
{
if (!hasQuestItems(player, KINGDOM_ROYAL_GUARDS_CERTIFICATION) && (player.getFactionLevel(Faction.KINGDOM_ROYAL_GUARDS) >= FACTION_LEVEL))
{
giveItems(player, KINGDOM_ROYAL_GUARDS_CERTIFICATION, 1);
htmltext = "certificate.html";
}
break;
}
}
}
}
htmltext = "not-ready.html";
return htmltext;
}
public static void main(String[] args)
{
new FactionCertificates();
}
}

View File

@ -0,0 +1,3 @@
<html><body>Guild Leader:<br>
Here is our guild certificate. Use it wisely.<br>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Guild Leader:<br>
You are not ready to get our certificate. Come back when you are ready.<br>
(For Reputation or For The Pride exalted sub quests must be in progress.)
</body></html>