Merged with released L2J-Unity files.
This commit is contained in:
62
trunk/dist/game/data/scripts/ai/areas/WharfGludioAirships/FortuneTelling/FortuneTelling.java
vendored
Normal file
62
trunk/dist/game/data/scripts/ai/areas/WharfGludioAirships/FortuneTelling/FortuneTelling.java
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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.WharfGludioAirships.FortuneTelling;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Fortune Telling AI.
|
||||
* @author Nyaran
|
||||
*/
|
||||
public final class FortuneTelling extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
private static final int MINE = 32616;
|
||||
// Misc
|
||||
private static final int COST = 1000;
|
||||
|
||||
public FortuneTelling()
|
||||
{
|
||||
addStartNpc(MINE);
|
||||
addTalkId(MINE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = null;
|
||||
if (player.getAdena() < COST)
|
||||
{
|
||||
htmltext = "lowadena.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
takeItems(player, Inventory.ADENA_ID, COST);
|
||||
htmltext = getHtm(player.getHtmlPrefix(), "fortune.htm").replace("%fortune%", String.valueOf(getRandom(1800309, 1800695)));
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new FortuneTelling();
|
||||
}
|
||||
}
|
6
trunk/dist/game/data/scripts/ai/areas/WharfGludioAirships/FortuneTelling/fortune.htm
vendored
Normal file
6
trunk/dist/game/data/scripts/ai/areas/WharfGludioAirships/FortuneTelling/fortune.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Fortune-Teller Mine:<br>
|
||||
I see an image approaching before you... It is difficult to put what I saw into words.<br>
|
||||
How can I say this? Okay, listen closely:<br>
|
||||
<center><fstring>%fortune%</fstring></center><br><br>
|
||||
Take these words to heart. You should seriously consider the meaning...
|
||||
</body></html>
|
4
trunk/dist/game/data/scripts/ai/areas/WharfGludioAirships/FortuneTelling/lowadena.htm
vendored
Normal file
4
trunk/dist/game/data/scripts/ai/areas/WharfGludioAirships/FortuneTelling/lowadena.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Fortune-Teller Mine:<br>
|
||||
Very well. I perceive you either cannot afford my offer or are not ready to learn your future.<br>
|
||||
No matter! Your future is still there waiting for you. Good luck!
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/areas/WharfGludioAirships/ZealotOfShilen/32628-01.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/areas/WharfGludioAirships/ZealotOfShilen/32628-01.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Airharbor Guard:<br>
|
||||
I'm so busy now! I'd be grateful if you could help me!
|
||||
</body></html>
|
5
trunk/dist/game/data/scripts/ai/areas/WharfGludioAirships/ZealotOfShilen/32628.html
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/areas/WharfGludioAirships/ZealotOfShilen/32628.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Wharf Patrol:<br>
|
||||
From here you can take an airship to Gracia. Our mission is to maintain the public peace, as ordered by the Magister and Master!<br>
|
||||
You should know that there are rumors of possible terrorist attacks on the airships, as well as reports of spies trying to infiltrate our realm here!<br>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
5
trunk/dist/game/data/scripts/ai/areas/WharfGludioAirships/ZealotOfShilen/32629.html
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/areas/WharfGludioAirships/ZealotOfShilen/32629.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Wharf Patrol:<br>
|
||||
From here you can take an airship to Gracia. Our mission is to maintain the public peace, as ordered by the Magister and Master!<br>
|
||||
You should know that there are rumors of possible terrorist attacks on the airships, as well as reports of spies trying to infiltrate our realm here!<br>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
99
trunk/dist/game/data/scripts/ai/areas/WharfGludioAirships/ZealotOfShilen/ZealotOfShilen.java
vendored
Normal file
99
trunk/dist/game/data/scripts/ai/areas/WharfGludioAirships/ZealotOfShilen/ZealotOfShilen.java
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* 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.WharfGludioAirships.ZealotOfShilen;
|
||||
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
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.L2MonsterInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Zealot of Shilen AI.
|
||||
* @author nonom
|
||||
*/
|
||||
public final class ZealotOfShilen extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int ZEALOT = 18782;
|
||||
private static final int[] GUARDS =
|
||||
{
|
||||
32628,
|
||||
32629
|
||||
};
|
||||
|
||||
public ZealotOfShilen()
|
||||
{
|
||||
addSpawnId(ZEALOT);
|
||||
addSpawnId(GUARDS);
|
||||
addFirstTalkId(GUARDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (npc == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
startQuestTimer("WATCHING", 10000, npc, null, true);
|
||||
if (event.equalsIgnoreCase("WATCHING") && !npc.isAttackingNow())
|
||||
{
|
||||
L2World.getInstance().forEachVisibleObject(npc, L2MonsterInstance.class, character ->
|
||||
{
|
||||
if (!character.isDead() && !character.isDecayed())
|
||||
{
|
||||
npc.setRunning();
|
||||
((L2Attackable) npc).addDamageHate(character, 0, 999);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, character, null);
|
||||
}
|
||||
});
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
return (npc.isAttackingNow()) ? "32628-01.html" : npc.getId() + ".html";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
if (npc.getId() == ZEALOT)
|
||||
{
|
||||
npc.setRandomWalking(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.setIsInvul(true);
|
||||
((L2Attackable) npc).setCanReturnToSpawnPoint(false);
|
||||
startQuestTimer("WATCHING", 10000, npc, null, true);
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new ZealotOfShilen();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user