Addition of Tarba AI.

This commit is contained in:
MobiusDevelopment 2021-01-01 22:10:13 +00:00
parent 19204edb8c
commit c2c1df8cfb
6 changed files with 123 additions and 2 deletions

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/multisell.xsd">
<npcs>
<npc>34134</npc> <!-- Tarba -->
</npcs>
<item>
<!-- Adena -->
<ingredient count="10000000" id="57" />
<!-- Special Scroll of Escape: Orc Barracks -->
<production count="1" id="93335" />
</item>
</list>

View File

@ -0,0 +1,6 @@
<html><body>Tarba:<br>
Have you heard what happened in the Orc Barracks? Blood-thirsty Orcs built a settlement that would unite their tribesmen. There is no better place to hone your skills. But be careful, elite Orc Warriors might be roaming the area.<br>
I'll walk you through it. There is a special restricted area where you can go only enter once per 24 hours. If you want to go there again, you will have to pay a lot of money. Remember, it's not you regular Hunting Zone. Monsters are really tough there, but if you manage to defeat them, you will be handsomely rewarded.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Tarba teleport">Join</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 3413401">Buy a scroll</Button>
</body></html>

View File

@ -0,0 +1,5 @@
<html><body>Tarba:<br>
If you want to go back there, you need to <font color="LEVEL">buy a special Scroll of Escape to the Orc Barracks</font>! The price surprises you? This item lets you gain a lot of experience quickly and receive great rewards. Such items are never cheap!<br>
Don't forget that you can enter for free, but only once a day! If you want to go back, you will have to buy a scroll!<br>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -0,0 +1,71 @@
/*
* 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.OrcBarracks;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import ai.AbstractNpcAI;
/**
* @author Mobius
*/
public class Tarba extends AbstractNpcAI
{
// NPC
private static final int TARBA = 34134;
// Location
private static final Location LOCATION = new Location(-93255, 109021, -3696);
// Misc
private static final String TARBA_TIME_VAR = "TARBA_TIME";
private Tarba()
{
addStartNpc(TARBA);
addTalkId(TARBA);
addFirstTalkId(TARBA);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
if (event.equals("teleport"))
{
final long currentTime = System.currentTimeMillis();
if ((npc.getId() == TARBA) && ((player.getVariables().getLong(TARBA_TIME_VAR, 0) + 86400000) < currentTime))
{
player.getVariables().set(TARBA_TIME_VAR, currentTime);
player.teleToLocation(LOCATION);
return null;
}
return "34134-02.htm";
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onFirstTalk(Npc npc, PlayerInstance player)
{
return "34134-01.htm";
}
public static void main(String[] args)
{
new Tarba();
}
}

View File

@ -444,6 +444,15 @@
<set name="is_dropable" val="false" />
<set name="is_sellable" val="false" />
<set name="is_stackable" val="true" />
<set name="is_oly_restricted" val="true" />
<set name="handler" val="ItemSkills" />
<set name="commissionItemType" val="SCROLL_OTHER" />
<cond addName="1" msgId="113">
<player flyMounted="false" />
</cond>
<skills>
<skill id="40120" level="1" /> <!-- Special Scroll of Escape: Orc Barracks -->
</skills>
</item>
<item id="93336" name="Scroll of Escape: Antharas' Lair Interior" type="EtcItem">
<!-- Magic scroll that teleports one to Antharas' Lair Interior. -->

View File

@ -124,9 +124,27 @@
<operateType>A1</operateType>
</skill>
<skill id="40120" toLevel="1" name="Special Scroll of Escape: Orc Barracks">
<!-- AUTO GENERATED SKILL TODO: FIX IT -->
<icon>icon.skill0000</icon>
<operateType>A1</operateType>
<isMagic>4</isMagic>
<hitTime>200</hitTime>
<targetType>SELF</targetType>
<affectScope>SINGLE</affectScope>
<itemConsumeId>93335</itemConsumeId> <!-- Special Scroll of Escape: Orc Barracks -->
<itemConsumeCount>1</itemConsumeCount>
<conditions>
<condition name="OpAlignment">
<affectType>CASTER</affectType>
<alignment>LAWFUL</alignment>
</condition>
<condition name="OpCanEscape" />
</conditions>
<effects>
<effect name="Teleport">
<x>-93255</x>
<y>109021</y>
<z>-3696</z>
</effect>
</effects>
</skill>
<skill id="40121" toLevel="1" name="High-grade Red Lantern">
<!-- AUTO GENERATED SKILL TODO: FIX IT -->