Unhardcoded faction guards, fixed aggro and various improvements.

This commit is contained in:
MobiusDev
2019-02-28 12:02:37 +00:00
parent 945e0d7b50
commit 2b9c79367e
68 changed files with 185 additions and 357 deletions

View File

@@ -10,10 +10,6 @@ EnableFactionSystem = False
# Default: 85332,16199,-1252
StartingLocation = 85332,16199,-1252
# Faction manager NPC ID.
# Default: 500
FactionManagerNpcId = 500
# Spawn location for faction manager NPC.
# Default: 85712,15974,-1260,26808
ManagerSpawnLocation = 85712,15974,-1260,26808
@@ -47,14 +43,6 @@ EvilNameColor = 0000FF
# Default: True
EnableFactionGuards = True
# Good Guard NPC ID.
# Default: 501
GoodGuardNpcId = 501
# Evil Guard NPC ID.
# Default: 502
EvilGuardNpcId = 502
# Upon death, respawn at faction base.
# Default: True
RespawnAtFactionBase = True

View File

@@ -0,0 +1,4 @@
<html><body>Sentinel:<br>
You must use extreme caution, sir! There have been reports of roaming thugs in this area, who think nothing of killing for the sheer pleasure of it. Please let me know if you see any of them. My bow will protect you from these murderers.<br>
May the divine protection of Eva be with you always.
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Centurion:<br>
I am sworn by the will of Paagrio to destroy all evildoers! If you see any of them, tell me. My bow will put an end to their treachery!
</body></html>

View File

@@ -31,9 +31,7 @@ import ai.AbstractNpcAI;
public final class FactionSystem extends AbstractNpcAI
{
// NPCs
private static final int MANAGER = Config.FACTION_MANAGER_NPCID;
private static final int GOOD_GUARD = Config.FACTION_GOOD_GUARD_NPCID;
private static final int EVIL_GUARD = Config.FACTION_EVIL_GUARD_NPCID;
private static final int MANAGER = 500;
// Other
private static final String[] TEXTS =
{
@@ -48,7 +46,6 @@ public final class FactionSystem extends AbstractNpcAI
addStartNpc(MANAGER);
addTalkId(MANAGER);
addFirstTalkId(MANAGER);
addAggroRangeEnterId(EVIL_GUARD, GOOD_GUARD);
if (Config.FACTION_SYSTEM_ENABLED)
{
@@ -168,16 +165,6 @@ public final class FactionSystem extends AbstractNpcAI
}
}
@Override
public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon)
{
if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((player.isGood() && (npc.getId() == EVIL_GUARD)) || (player.isEvil() && (npc.getId() == GOOD_GUARD))))
{
addAttackDesire(npc, player);
}
return super.onAggroRangeEnter(npc, player, isSummon);
}
public static void main(String[] args)
{
new FactionSystem();

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/npcs.xsd">
<npc id="500" displayId="34210" name="Faction Manager" usingServerSideName="true" title=" " usingServerSideTitle="true" type="L2Npc">
<npc id="500" displayId="9000" name="Faction Manager" usingServerSideName="true" title=" " usingServerSideTitle="true" type="L2Npc">
<race>ELF</race>
<sex>FEMALE</sex>
<stats>