Merged with released L2J-Unity files.
This commit is contained in:
111
trunk/dist/game/data/scripts/ai/areas/StakatoNest/QueenShyeed.java
vendored
Normal file
111
trunk/dist/game/data/scripts/ai/areas/StakatoNest/QueenShyeed.java
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* 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.StakatoNest;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.zone.type.L2EffectZone;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Queen Shyeed AI
|
||||
* @author malyelfik
|
||||
*/
|
||||
public final class QueenShyeed extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
private static final int SHYEED = 25671;
|
||||
private static final Location SHYEED_LOC = new Location(79634, -55428, -6104, 0);
|
||||
|
||||
// Respawn
|
||||
private static final int RESPAWN = 86400000; // 24 h
|
||||
private static final int RANDOM_RESPAWN = 43200000; // 12 h
|
||||
|
||||
// Zones
|
||||
private static final L2EffectZone MOB_BUFF_ZONE = ZoneManager.getInstance().getZoneById(200103, L2EffectZone.class);
|
||||
private static final L2EffectZone MOB_BUFF_DISPLAY_ZONE = ZoneManager.getInstance().getZoneById(200104, L2EffectZone.class);
|
||||
private static final L2EffectZone PC_BUFF_ZONE = ZoneManager.getInstance().getZoneById(200105, L2EffectZone.class);
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "respawn":
|
||||
spawnShyeed();
|
||||
break;
|
||||
case "despawn":
|
||||
if (!npc.isDead())
|
||||
{
|
||||
npc.deleteMe();
|
||||
startRespawn();
|
||||
}
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SHYEED_S_CRY_IS_STEADILY_DYING_DOWN);
|
||||
startRespawn();
|
||||
PC_BUFF_ZONE.setEnabled(true);
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
|
||||
private QueenShyeed()
|
||||
{
|
||||
addKillId(SHYEED);
|
||||
spawnShyeed();
|
||||
}
|
||||
|
||||
private void spawnShyeed()
|
||||
{
|
||||
final String respawn = loadGlobalQuestVar("Respawn");
|
||||
final long remain = (!respawn.isEmpty()) ? Long.parseLong(respawn) - System.currentTimeMillis() : 0;
|
||||
if (remain > 0)
|
||||
{
|
||||
startQuestTimer("respawn", remain, null, null);
|
||||
return;
|
||||
}
|
||||
final L2Npc npc = addSpawn(SHYEED, SHYEED_LOC, false, 0);
|
||||
startQuestTimer("despawn", 10800000, npc, null);
|
||||
PC_BUFF_ZONE.setEnabled(false);
|
||||
MOB_BUFF_ZONE.setEnabled(true);
|
||||
MOB_BUFF_DISPLAY_ZONE.setEnabled(true);
|
||||
}
|
||||
|
||||
private void startRespawn()
|
||||
{
|
||||
final int respawnTime = RESPAWN - getRandom(RANDOM_RESPAWN);
|
||||
saveGlobalQuestVar("Respawn", Long.toString(System.currentTimeMillis() + respawnTime));
|
||||
startQuestTimer("respawn", respawnTime, null, null);
|
||||
MOB_BUFF_ZONE.setEnabled(false);
|
||||
MOB_BUFF_DISPLAY_ZONE.setEnabled(false);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new QueenShyeed();
|
||||
}
|
||||
}
|
4
trunk/dist/game/data/scripts/ai/areas/StakatoNest/StakatoNestTeleporter/32640-no.htm
vendored
Normal file
4
trunk/dist/game/data/scripts/ai/areas/StakatoNest/StakatoNestTeleporter/32640-no.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Bounty Hunter Kintaijin:<br>
|
||||
In order to use the teleport option, you must complete my first mission. Then and only then will I offer this option to you.<br>
|
||||
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
|
||||
</body></html>
|
8
trunk/dist/game/data/scripts/ai/areas/StakatoNest/StakatoNestTeleporter/32640.htm
vendored
Normal file
8
trunk/dist/game/data/scripts/ai/areas/StakatoNest/StakatoNestTeleporter/32640.htm
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<html><body>Bounty Hunter Kintaijin:<br>
|
||||
I will teleport you and your party members to the major area of Stakato Nest. But party members who are not near me won't be teleported, so you need to make sure the members who you want to move are nicely gathered around me.<br>
|
||||
<a action="bypass -h Quest StakatoNestTeleporter 1">Waiting Room of Stakato Queen</a><br>
|
||||
<a action="bypass -h Quest StakatoNestTeleporter 2">Nest Introduction</a><br>
|
||||
<a action="bypass -h Quest StakatoNestTeleporter 3">Nest Water Supply</a><br>
|
||||
<a action="bypass -h Quest StakatoNestTeleporter 4">Nest Deepest Layer</a><br>
|
||||
<a action="bypass -h Quest StakatoNestTeleporter 5">Nest Entrance</a>
|
||||
</body></html>
|
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* 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.StakatoNest.StakatoNestTeleporter;
|
||||
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.quest.QuestState;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
import quests.Q00240_ImTheOnlyOneYouCanTrust.Q00240_ImTheOnlyOneYouCanTrust;
|
||||
|
||||
/**
|
||||
* Stakato Nest Teleport AI.
|
||||
* @author Charus
|
||||
*/
|
||||
public final class StakatoNestTeleporter extends AbstractNpcAI
|
||||
{
|
||||
// Locations
|
||||
private final static Location[] LOCS =
|
||||
{
|
||||
new Location(80456, -52322, -5640),
|
||||
new Location(88718, -46214, -4640),
|
||||
new Location(87464, -54221, -5120),
|
||||
new Location(80848, -49426, -5128),
|
||||
new Location(87682, -43291, -4128)
|
||||
};
|
||||
// NPC
|
||||
private final static int KINTAIJIN = 32640;
|
||||
|
||||
private StakatoNestTeleporter()
|
||||
{
|
||||
addStartNpc(KINTAIJIN);
|
||||
addTalkId(KINTAIJIN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
final int index = Integer.parseInt(event) - 1;
|
||||
|
||||
if (LOCS.length > index)
|
||||
{
|
||||
final Location loc = LOCS[index];
|
||||
|
||||
if (player.getParty() != null)
|
||||
{
|
||||
for (L2PcInstance partyMember : player.getParty().getMembers())
|
||||
{
|
||||
if (partyMember.isInsideRadius(player, 1000, true, true))
|
||||
{
|
||||
partyMember.teleToLocation(loc, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
player.teleToLocation(loc, false);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
final QuestState accessQuest = player.getQuestState(Q00240_ImTheOnlyOneYouCanTrust.class.getSimpleName());
|
||||
return (((accessQuest != null) && accessQuest.isCompleted()) ? "32640.htm" : "32640-no.htm");
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new StakatoNestTeleporter();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user