Replacements for last boss python scripts.
This commit is contained in:
@@ -32008,14 +32008,6 @@ INSERT INTO `spawnlist` VALUES
|
||||
(NULL, "4Sepulchers", 1, 31943, 175413, -75859, -7218, 0, 0, 49152, 60, 0, 0),
|
||||
(NULL, "4Sepulchers", 1, 31944, 175413, -74048, -7218, 0, 0, 49152, 60, 0, 0),
|
||||
(NULL, "ImperialTomb", 1, 32011, 181376, -81008, -2728, 0, 0, 16500, 60, 0, 0);
|
||||
|
||||
INSERT INTO `spawnlist` VALUES
|
||||
(NULL,'rune_chamberlain_etc',1,35503,18376,-49020,-1212,0,0,37945,60,0,0),
|
||||
(NULL,'rune_chamberlain_etc',1,35503,18625,-49359,-1220,0,0,64153,60,0,0),
|
||||
(NULL,'rune_chamberlain_etc',1,35504,15668,-49024,-1058,0,0,34435,60,0,0),
|
||||
(NULL,'rune_chamberlain_etc',1,35504,15868,-49283,-1058,0,0,65149,60,0,0),
|
||||
(NULL,'rune_chamberlain_etc',1,35505,15272,-49075,-1058,0,0,31547,60,0,0),
|
||||
(NULL,'rune_chamberlain_etc',1,35505,15428,-49274,-1058,0,0,1523,60,0,0);
|
||||
|
||||
INSERT INTO `spawnlist` VALUES
|
||||
(NULL,'schuttgart_chmberlain_etc',1,35555,77495,-153314,-415,0,0,2059,60,0,0),
|
||||
@@ -32027,9 +32019,7 @@ INSERT INTO `spawnlist` VALUES
|
||||
(NULL,'schuttgart_chmberlain_etc',1,35545,76346,-153227,1050,0,0,35323,60,0,0),
|
||||
(NULL,'schuttgart_chmberlain_etc',1,35544,78752,-153229,1050,0,0,53375,60,0,0),
|
||||
(NULL,'schuttgart_chmberlain_etc',1,35549,75731,-152159,-678,0,0,30710,60,0,0),
|
||||
(NULL,'schuttgart_chmberlain_etc',1,35549,76006,-152166,-678,0,0,62180,60,0,0),
|
||||
(NULL,'schuttgart_chmberlain_etc',1,35548,77365,-149682,-353,0,0,57062,60,0,0),
|
||||
(NULL,'schuttgart_chmberlain_etc',1,35548,77893,-149383,-379,0,0,15733,60,0,0);
|
||||
(NULL,'schuttgart_chmberlain_etc',1,35549,76006,-152166,-678,0,0,62180,60,0,0);
|
||||
|
||||
INSERT INTO `spawnlist` VALUES
|
||||
(NULL,'Crypts of Disgrace',1,22001,46734,-115708,-3815,0,0,31429,60,0,0),
|
||||
|
@@ -343,7 +343,7 @@ DisableAttackToNpcs = False
|
||||
|
||||
# List of NPC's that allow casting skills on them
|
||||
# Any other type will not allow casting
|
||||
AllowedNPCTypes = L2GrandBoss,L2Chest,L2FestivalMonster,L2Minion,L2Monster,L2Pet,L2RaidBoss,L2SiegeGuard,L2SiegeNpc,L2ControlTower,L2Artefact,L2PenaltyMonster,L2FeedableBeast,L2SiegeFlag,L2RiftInvader,L2Guard,L2GuardNoHTML
|
||||
AllowedNPCTypes = GrandBoss,Chest,FestivalMonster,Minion,Monster,Pet,RaidBoss,SiegeGuard,SiegeNpc,ControlTower,Artefact,PenaltyMonster,FeedableBeast,SiegeFlag,RiftInvader,Guard,GuardNoHTML
|
||||
|
||||
# Allows Players to Shift-click Mobs and view their Stats and Droplist
|
||||
AltGameViewNpc = False
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<html><body>Shilen's Stone Statue:<br>
|
||||
Only a party whose leader weilds Gazkh can enter Sailren's Stronghold and battle the creature.<br>
|
||||
Be aware that any party member who is far away at the time of entry cannot enter the Stronghold. Nor can another party enter until first party has exited.<br>
|
||||
<a action="bypass -h npc_%objectId%_Quest sailren">"Take my party to Sailren!"</a>
|
||||
<a action="bypass -h npc_%objectId%_Quest Sailren">"Take my party to Sailren!"</a>
|
||||
</body></html>
|
@@ -4,5 +4,5 @@ This is not so easy as you think. For a start you must register!<br>
|
||||
To do this you must be the leader of the clan, your clan must be level 3 or higher, you should not have any other clanhalls,
|
||||
or other bids at the auction.<br>
|
||||
If you conform all the requirements - you may Register.<br>
|
||||
<a action="bypass -h npc_%objectId%_Quest nurka">Register to attack Bloody Nurka</a>
|
||||
<a action="bypass -h npc_%objectId%_Quest Nurka">Register to attack Bloody Nurka</a>
|
||||
</body></html>
|
@@ -4,5 +4,5 @@ This is not so easy as you think. For a start you must register!<br>
|
||||
To do this you must be the leader of the clan, your clan must be level 4 or higher, you should not have any other clanhalls,
|
||||
or bids at the auction.<br>
|
||||
If you conform all the requirements - you may Register.<br>
|
||||
<a action="bypass -h npc_%objectId%_Quest gustav">Register to attack Devastated castle</a>
|
||||
<a action="bypass -h npc_%objectId%_Quest Gustav">Register to attack Devastated castle</a>
|
||||
</body></html>
|
345
L2J_Mobius_C6_Interlude_OpenJDK12/dist/game/data/scripts/ai/bosses/Benom.java
vendored
Normal file
345
L2J_Mobius_C6_Interlude_OpenJDK12/dist/game/data/scripts/ai/bosses/Benom.java
vendored
Normal file
@@ -0,0 +1,345 @@
|
||||
/*
|
||||
* 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.bosses;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.datatables.csv.DoorTable;
|
||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.position.Location;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SpecialCamera;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class Benom extends Quest
|
||||
{
|
||||
// NPCs
|
||||
private static final int BENOM = 29054;
|
||||
private static final int BENOM_TELEPORT = 13101;
|
||||
// Locations
|
||||
private final static Location[] WALK_ROUTES =
|
||||
{
|
||||
new Location(12565, -49739, -547),
|
||||
new Location(11242, -49689, -33),
|
||||
new Location(10751, -49702, 83),
|
||||
new Location(10824, -50808, 316),
|
||||
new Location(9084, -50786, 972),
|
||||
new Location(9095, -49787, 1252),
|
||||
new Location(8371, -49711, 1252),
|
||||
new Location(8423, -48545, 1252),
|
||||
new Location(9105, -48474, 1252),
|
||||
new Location(9085, -47488, 972),
|
||||
new Location(10858, -47527, 316),
|
||||
new Location(10842, -48626, 75),
|
||||
new Location(12171, -48464, -547),
|
||||
new Location(13565, -49145, -535),
|
||||
new Location(15653, -49159, -1059),
|
||||
new Location(15423, -48402, -839),
|
||||
new Location(15066, -47438, -419),
|
||||
new Location(13990, -46843, -292),
|
||||
new Location(13685, -47371, -163),
|
||||
new Location(13384, -47470, -163),
|
||||
new Location(14609, -48608, 346),
|
||||
new Location(13878, -47449, 747),
|
||||
new Location(12894, -49109, 980),
|
||||
new Location(10135, -49150, 996),
|
||||
new Location(12894, -49109, 980),
|
||||
new Location(13738, -50894, 747),
|
||||
new Location(14579, -49698, 347),
|
||||
new Location(12896, -51135, -166),
|
||||
new Location(12971, -52046, -292),
|
||||
new Location(15140, -50781, -442),
|
||||
new Location(15328, -50406, -603),
|
||||
new Location(15594, -49192, -1059),
|
||||
new Location(13175, -49153, -537)
|
||||
};
|
||||
// Misc
|
||||
private final static int[] WALK_TIMES =
|
||||
{
|
||||
18000,
|
||||
17000,
|
||||
4500,
|
||||
16000,
|
||||
22000,
|
||||
14000,
|
||||
10500,
|
||||
14000,
|
||||
9500,
|
||||
12500,
|
||||
20500,
|
||||
14500,
|
||||
17000,
|
||||
20000,
|
||||
22000,
|
||||
11000,
|
||||
11000,
|
||||
20000,
|
||||
8000,
|
||||
5500,
|
||||
20000,
|
||||
18000,
|
||||
25000,
|
||||
28000,
|
||||
25000,
|
||||
25000,
|
||||
25000,
|
||||
25000,
|
||||
10000,
|
||||
24000,
|
||||
7000,
|
||||
12000,
|
||||
20000
|
||||
};
|
||||
private final static String[] TALK =
|
||||
{
|
||||
"You should have finished me when you had the chance!!!",
|
||||
"I will crush all of you!!!",
|
||||
"I am not finished here, come face me!!!",
|
||||
"You cowards!!! I will torture each and everyone of you!!!"
|
||||
};
|
||||
private final static int ALIVE = 0;
|
||||
private final static int DEAD = 1;
|
||||
private static int _benomWalkRouteStep = 0;
|
||||
private static int _benomIsSpawned = 0;
|
||||
private static NpcInstance _benomInstance;
|
||||
private static NpcInstance _teleportInstance;
|
||||
|
||||
public Benom()
|
||||
{
|
||||
super(-1, "Benom", "ai/bosses");
|
||||
|
||||
addStartNpc(BENOM_TELEPORT);
|
||||
addTalkId(BENOM_TELEPORT);
|
||||
addFirstTalkId(BENOM_TELEPORT);
|
||||
addAttackId(BENOM);
|
||||
addKillId(BENOM);
|
||||
|
||||
final int castleOwner = CastleManager.getInstance().getCastleById(8).getOwnerId();
|
||||
final long siegeDate = CastleManager.getInstance().getCastleById(8).getSiegeDate().getTimeInMillis();
|
||||
long benomTeleporterSpawn = (siegeDate - System.currentTimeMillis()) - 86400000;
|
||||
final long benomRaidRoomSpawn = (siegeDate - System.currentTimeMillis()) - 86400000;
|
||||
long benomRaidSiegeSpawn = (siegeDate - System.currentTimeMillis());
|
||||
if (benomTeleporterSpawn < 0)
|
||||
{
|
||||
benomTeleporterSpawn = 1;
|
||||
}
|
||||
if (benomRaidSiegeSpawn < 0)
|
||||
{
|
||||
benomRaidSiegeSpawn = 1;
|
||||
}
|
||||
if (castleOwner > 0)
|
||||
{
|
||||
if (benomTeleporterSpawn >= 1)
|
||||
{
|
||||
startQuestTimer("BenomTeleSpawn", benomTeleporterSpawn, null, null);
|
||||
}
|
||||
if ((siegeDate - System.currentTimeMillis()) > 0)
|
||||
{
|
||||
startQuestTimer("BenomRaidRoomSpawn", benomRaidRoomSpawn, null, null);
|
||||
}
|
||||
startQuestTimer("BenomRaidSiegeSpawn", benomRaidSiegeSpawn, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "BenomTeleSpawn":
|
||||
{
|
||||
_teleportInstance = addSpawn(BENOM_TELEPORT, 11013, -49629, -547, 13400, false, 0);
|
||||
break;
|
||||
}
|
||||
case "BenomRaidRoomSpawn":
|
||||
{
|
||||
if ((_benomIsSpawned == 0) && (GrandBossManager.getInstance().getBossStatus(BENOM) == 0))
|
||||
{
|
||||
_benomInstance = addSpawn(BENOM, 12047, -49211, -3009, 0, false, 0);
|
||||
_benomIsSpawned = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "BenomRaidSiegeSpawn":
|
||||
{
|
||||
if (GrandBossManager.getInstance().getBossStatus(BENOM) == 0)
|
||||
{
|
||||
if (_benomIsSpawned == 0)
|
||||
{
|
||||
_benomInstance = addSpawn(BENOM, 11025, -49152, -537, 0, false, 0);
|
||||
_benomIsSpawned = 1;
|
||||
}
|
||||
else if (_benomIsSpawned == 1)
|
||||
{
|
||||
_benomInstance.teleToLocation(11025, -49152, -537);
|
||||
}
|
||||
startQuestTimer("BenomSpawnEffect", 100, null, null);
|
||||
startQuestTimer("BenomBossDespawn", 5400000, null, null);
|
||||
_teleportInstance.deleteMe();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "BenomSpawnEffect":
|
||||
{
|
||||
_benomInstance.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
_benomInstance.broadcastPacket(new SpecialCamera(_benomInstance.getObjectId(), 200, 0, 150, 0, 5000));
|
||||
_benomInstance.broadcastPacket(new SocialAction(_benomInstance.getObjectId(), 3));
|
||||
startQuestTimer("BenomWalk", 5000, _benomInstance, null);
|
||||
_benomWalkRouteStep = 0;
|
||||
break;
|
||||
}
|
||||
case "Attacking":
|
||||
{
|
||||
final Collection<PlayerInstance> knownPlayers = npc.getKnownList().getKnownPlayers().values();
|
||||
if (knownPlayers.size() > 0)
|
||||
{
|
||||
final PlayerInstance target = knownPlayers.stream().findAny().get();
|
||||
((MonsterInstance) npc).addDamageHate(target, 0, 999);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
startQuestTimer("Attacking", 2000, npc, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
startQuestTimer("BenomWalkFinish", 2000, npc, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "BenomWalkFinish":
|
||||
{
|
||||
if (npc.getCastle().getSiege().getIsInProgress())
|
||||
{
|
||||
cancelQuestTimer("Attacking", npc, player);
|
||||
npc.teleToLocation(WALK_ROUTES[_benomWalkRouteStep], false);
|
||||
npc.setWalking();
|
||||
_benomWalkRouteStep = 0;
|
||||
startQuestTimer("BenomWalk", 2200, npc, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "BenomWalk":
|
||||
{
|
||||
if (_benomWalkRouteStep == 33)
|
||||
{
|
||||
_benomWalkRouteStep = 0;
|
||||
startQuestTimer("BenomWalk", 100, npc, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
startQuestTimer("Talk", 100, npc, null);
|
||||
if (_benomWalkRouteStep == 14)
|
||||
{
|
||||
startQuestTimer("DoorOpen", 15000, null, null);
|
||||
startQuestTimer("DoorClose", 23000, null, null);
|
||||
}
|
||||
if (_benomWalkRouteStep == 32)
|
||||
{
|
||||
startQuestTimer("DoorOpen", 500, null, null);
|
||||
startQuestTimer("DoorClose", 4000, null, null);
|
||||
}
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, WALK_ROUTES[_benomWalkRouteStep]);
|
||||
startQuestTimer("BenomWalk", WALK_TIMES[_benomWalkRouteStep], npc, null);
|
||||
System.out.println(WALK_TIMES[_benomWalkRouteStep]);
|
||||
_benomWalkRouteStep = _benomWalkRouteStep + 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "DoorOpen":
|
||||
{
|
||||
DoorTable.getInstance().getDoor(20160005).openMe();
|
||||
break;
|
||||
}
|
||||
case "DoorClose":
|
||||
{
|
||||
DoorTable.getInstance().getDoor(20160005).closeMe();
|
||||
break;
|
||||
}
|
||||
case "Talk":
|
||||
{
|
||||
if (Rnd.get(100) < 40)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, "Benom", TALK[Rnd.get(4)]));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "BenomBossDespawn":
|
||||
{
|
||||
GrandBossManager.getInstance().setBossStatus(BENOM, ALIVE);
|
||||
_benomIsSpawned = 0;
|
||||
_benomInstance.deleteMe();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
final int castleOwner = CastleManager.getInstance().getCastleById(8).getOwnerId();
|
||||
final int clanId = player.getClanId();
|
||||
if ((castleOwner > 0) && (clanId > 0))
|
||||
{
|
||||
if (castleOwner == clanId)
|
||||
{
|
||||
final int x = 12558 + (Rnd.get(200) - 100);
|
||||
final int y = -49279 + (Rnd.get(200) - 100);
|
||||
player.teleToLocation(x, y, -3007);
|
||||
return null;
|
||||
}
|
||||
return "<html><body>Benom's Avatar:<br>Your clan does not own this castle. Only members of this Castle's owning clan can challenge Benom.</body></html>";
|
||||
}
|
||||
return "<html><body>Benom's Avatar:<br>Your clan does not own this castle. Only members of this Castle's owning clan can challenge Benom.</body></html>";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
cancelQuestTimer("BenomWalk", npc, null);
|
||||
cancelQuestTimer("BenomWalkFinish", npc, null);
|
||||
startQuestTimer("Attacking", 100, npc, attacker);
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet)
|
||||
{
|
||||
GrandBossManager.getInstance().setBossStatus(BENOM, DEAD);
|
||||
cancelQuestTimer("BenomWalk", npc, null);
|
||||
cancelQuestTimer("BenomWalkFinish", npc, null);
|
||||
cancelQuestTimer("BenomBossDespawn", npc, null);
|
||||
cancelQuestTimer("Talk", npc, null);
|
||||
cancelQuestTimer("Attacking", npc, null);
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Benom();
|
||||
}
|
||||
}
|
145
L2J_Mobius_C6_Interlude_OpenJDK12/dist/game/data/scripts/ai/bosses/DrChaos.java
vendored
Normal file
145
L2J_Mobius_C6_Interlude_OpenJDK12/dist/game/data/scripts/ai/bosses/DrChaos.java
vendored
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* 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.bosses;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.datatables.sql.SpawnTable;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.position.Location;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.model.spawn.Spawn;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PlaySound;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SpecialCamera;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class DrChaos extends Quest
|
||||
{
|
||||
// NPCs
|
||||
private static final int STRANGE_MACHINE = 32032;
|
||||
private static final int DR_CHAOS = 32033;
|
||||
private static final int CHAOS_GOLEM = 25512;
|
||||
// Misc
|
||||
private static int _golemSpawned = 0;
|
||||
private static int _chaosSpawned = 1;
|
||||
|
||||
private DrChaos()
|
||||
{
|
||||
super(-1, "DrChaos", "ai/bosses");
|
||||
|
||||
addFirstTalkId(DR_CHAOS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "1":
|
||||
{
|
||||
final NpcInstance strangeMachine = findTemplate(STRANGE_MACHINE);
|
||||
if (strangeMachine != null)
|
||||
{
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, strangeMachine);
|
||||
strangeMachine.broadcastPacket(new SpecialCamera(strangeMachine.getObjectId(), 1, -200, 15, 10000, 20000));
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning("Dr Chaos AI: problem finding Strange Machine (npcid = " + STRANGE_MACHINE + "). Error: not spawned!");
|
||||
}
|
||||
startQuestTimer("2", 2000, npc, player);
|
||||
startQuestTimer("3", 10000, npc, player);
|
||||
if (_chaosSpawned == 0)
|
||||
{
|
||||
addSpawn(DR_CHAOS, 96471, -111425, -3334, 0, false, 0);
|
||||
_chaosSpawned = 1;
|
||||
}
|
||||
startQuestTimer("2", 2000, npc, player);
|
||||
startQuestTimer("3", 10000, npc, player);
|
||||
break;
|
||||
}
|
||||
case "2":
|
||||
{
|
||||
npc.broadcastPacket(new SocialAction(npc.getObjectId(), 3));
|
||||
break;
|
||||
}
|
||||
case "3":
|
||||
{
|
||||
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1, -150, 10, 3000, 20000));
|
||||
startQuestTimer("4", 2500, npc, player);
|
||||
break;
|
||||
}
|
||||
case "4":
|
||||
{
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(96055, -110759, -3312));
|
||||
startQuestTimer("5", 2000, npc, player);
|
||||
break;
|
||||
}
|
||||
case "5":
|
||||
{
|
||||
player.teleToLocation(94832, -112624, -3304);
|
||||
npc.teleToLocation(-113091, -243942, -15536);
|
||||
if (_golemSpawned == 0)
|
||||
{
|
||||
final NpcInstance golem = addSpawn(CHAOS_GOLEM, 94640, -112496, -3336, 0, false, 0);
|
||||
_golemSpawned = 1;
|
||||
startQuestTimer("6", 1000, golem, player);
|
||||
player.sendPacket(new PlaySound(1, "Rm03_A", 0, 0, 0, 0, 0));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "6":
|
||||
{
|
||||
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 30, -200, 20, 6000, 8000));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
player.setTarget(null);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(96323, -110914, -3328));
|
||||
startQuestTimer("1", 3000, npc, player);
|
||||
return null;
|
||||
}
|
||||
|
||||
private NpcInstance findTemplate(int npcId)
|
||||
{
|
||||
NpcInstance npcInstance = null;
|
||||
for (Spawn spawn : SpawnTable.getInstance().getSpawnTable().values())
|
||||
{
|
||||
if ((spawn != null) && (spawn.getNpcId() == npcId))
|
||||
{
|
||||
npcInstance = spawn.getLastSpawn();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return npcInstance;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new DrChaos();
|
||||
}
|
||||
}
|
183
L2J_Mobius_C6_Interlude_OpenJDK12/dist/game/data/scripts/ai/bosses/Sailren.java
vendored
Normal file
183
L2J_Mobius_C6_Interlude_OpenJDK12/dist/game/data/scripts/ai/bosses/Sailren.java
vendored
Normal file
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* 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.bosses;
|
||||
|
||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||
import org.l2jmobius.gameserver.model.Party;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.model.zone.type.BossZone;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SpecialCamera;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class Sailren extends Quest
|
||||
{
|
||||
// NPCs
|
||||
private static final int STATUE = 32109;
|
||||
private static final int SAILREN = 29065;
|
||||
private static final int VELO = 22196;
|
||||
private static final int PTERO = 22199;
|
||||
private static final int TREX = 22215;
|
||||
private static final int STONE = 8784;
|
||||
// Misc
|
||||
private static NpcInstance _vlcInstance;
|
||||
private static NpcInstance _ptrInstance;
|
||||
private static NpcInstance _trxInstance;
|
||||
private static NpcInstance _slrnInstance;
|
||||
|
||||
private Sailren()
|
||||
{
|
||||
super(-1, "Sailren", "ai/bosses");
|
||||
|
||||
addStartNpc(STATUE);
|
||||
addTalkId(STATUE);
|
||||
addKillId(VELO, PTERO, TREX, SAILREN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "start":
|
||||
{
|
||||
_vlcInstance = addSpawn(VELO, 27845, -5567, -1982, 45000, false, 0);
|
||||
startQuestTimer("camera", 2000, _vlcInstance, player);
|
||||
cancelQuestTimer("start", npc, null);
|
||||
break;
|
||||
}
|
||||
case "round2":
|
||||
{
|
||||
_ptrInstance = addSpawn(PTERO, 27838, -5578, -1982, 45000, false, 0);
|
||||
startQuestTimer("camera", 2000, _ptrInstance, player);
|
||||
cancelQuestTimer("round2", npc, null);
|
||||
break;
|
||||
}
|
||||
case "round3":
|
||||
{
|
||||
_trxInstance = addSpawn(TREX, 27838, -5578, -1982, 45000, false, 0);
|
||||
startQuestTimer("camera", 2000, _trxInstance, player);
|
||||
cancelQuestTimer("round3", npc, null);
|
||||
break;
|
||||
}
|
||||
case "sailren":
|
||||
{
|
||||
_slrnInstance = addSpawn(SAILREN, 27489, -6223, -1982, 45000, false, 0);
|
||||
startQuestTimer("camera", 2000, _slrnInstance, player);
|
||||
startQuestTimer("vkrovatku", 1200000, _slrnInstance, null);
|
||||
cancelQuestTimer("round4", npc, null);
|
||||
break;
|
||||
}
|
||||
case "camera":
|
||||
{
|
||||
player.broadcastPacket(new SpecialCamera(npc.getObjectId(), 400, -75, 3, -150, 5000));
|
||||
npc.broadcastPacket(new SocialAction(npc.getObjectId(), 1));
|
||||
break;
|
||||
}
|
||||
case "open":
|
||||
{
|
||||
deleteGlobalQuestVar("close");
|
||||
cancelQuestTimer("open", npc, null);
|
||||
break;
|
||||
}
|
||||
case "vkrovatku":
|
||||
{
|
||||
npc.deleteMe();
|
||||
deleteGlobalQuestVar("close");
|
||||
cancelQuestTimer("open", npc, null);
|
||||
cancelQuestTimer("vkrovatku", npc, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onTalk(NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
if (player.getInventory().getItemByItemId(STONE) != null)
|
||||
{
|
||||
final String close = loadGlobalQuestVar("close");
|
||||
if (close.equals(""))
|
||||
{
|
||||
final Party party = player.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
player.destroyItemByItemId("Sailren", STONE, 1, player, true);
|
||||
saveGlobalQuestVar("close", "1");
|
||||
final BossZone zone = GrandBossManager.getInstance().getZone(27244, -7026, -1974);
|
||||
for (PlayerInstance member : party.getPartyMembers())
|
||||
{
|
||||
if (zone != null)
|
||||
{
|
||||
zone.allowPlayerEntry(member, 3600);
|
||||
}
|
||||
member.teleToLocation(27244, -7026, -1974);
|
||||
}
|
||||
startQuestTimer("start", 30000, npc, player);
|
||||
startQuestTimer("open", 1800000, npc, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
return "<html><body><font color=LEVEL>Only with party...</font></body></html>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "<html><body><font color=LEVEL>Some one else is inside...</font></body></html>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "<html><body>You need quest item: <font color=LEVEL>Gazkh...</font></body></html>";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet)
|
||||
{
|
||||
if (npc == _vlcInstance)
|
||||
{
|
||||
startQuestTimer("round2", 30000, npc, killer);
|
||||
}
|
||||
else if (npc == _ptrInstance)
|
||||
{
|
||||
startQuestTimer("round3", 60000, npc, killer);
|
||||
}
|
||||
else if (npc == _trxInstance)
|
||||
{
|
||||
startQuestTimer("sailren", 180000, npc, killer);
|
||||
}
|
||||
else if (npc == _slrnInstance)
|
||||
{
|
||||
deleteGlobalQuestVar("close");
|
||||
cancelQuestTimer("open", npc, null);
|
||||
}
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Sailren();
|
||||
}
|
||||
}
|
@@ -51,9 +51,9 @@ public class Tyrannosaurus extends Quest
|
||||
new Location(26740, -16596, -2688, 13790)
|
||||
};
|
||||
|
||||
public Tyrannosaurus(int questId, String name, String descr)
|
||||
public Tyrannosaurus()
|
||||
{
|
||||
super(questId, name, descr);
|
||||
super(-1, "Tyrannosaurus", "ai/bosses");
|
||||
addKillId(TREX);
|
||||
addSpawn(TREX[Rnd.get(TREX.length)], SPAWNS[Rnd.get(SPAWNS.length)], false, 0);
|
||||
}
|
||||
@@ -70,6 +70,6 @@ public class Tyrannosaurus extends Quest
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Tyrannosaurus(-1, "Tyrannosaurus", "ai");
|
||||
new Tyrannosaurus();
|
||||
}
|
||||
}
|
||||
|
@@ -1,202 +0,0 @@
|
||||
import sys
|
||||
from org.l2jmobius.gameserver.ai import CtrlIntention
|
||||
from org.l2jmobius.gameserver.datatables.csv import DoorTable
|
||||
from org.l2jmobius.gameserver.instancemanager import CastleManager
|
||||
from org.l2jmobius.gameserver.instancemanager import GrandBossManager
|
||||
from org.l2jmobius.gameserver.model.actor.position import Location
|
||||
from org.l2jmobius.gameserver.model.quest import QuestState
|
||||
from org.l2jmobius.gameserver.model.quest import State
|
||||
from org.l2jmobius.gameserver.model.quest.jython import QuestJython as JQuest
|
||||
from org.l2jmobius.gameserver.network.serverpackets import CreatureSay
|
||||
from org.l2jmobius.gameserver.network.serverpackets import SocialAction
|
||||
from org.l2jmobius.gameserver.network.serverpackets import SpecialCamera
|
||||
from org.l2jmobius.commons.util import Rnd
|
||||
from java.lang import System
|
||||
|
||||
Benom = 29054
|
||||
BenomTeleport = 13101
|
||||
|
||||
BenomSpeak = [ "You should have finished me when you had the chance!!!", "I will crush all of you!!!", "I am not finished here, come face me!!!", "You cowards!!! I will torture each and everyone of you!!!" ]
|
||||
|
||||
WalkTimes = [ 18000,17000,4500,16000,22000,14000,10500,14000,9500,12500,20500,14500,17000,20000,22000,11000,11000,20000,8000,5500,20000,18000,25000,28000,25000,25000,25000,25000,10000,24000,7000,12000,20000 ]
|
||||
|
||||
# Benom status tracking
|
||||
LIVE = 0
|
||||
DEAD = 1
|
||||
|
||||
benomWalkRoutes = {
|
||||
0: [ 12565, -49739, -547 ],
|
||||
1: [ 11242, -49689, -33 ],
|
||||
2: [ 10751, -49702, 83 ],
|
||||
3: [ 10824, -50808, 316 ],
|
||||
4: [ 9084, -50786, 972 ],
|
||||
5: [ 9095, -49787, 1252 ],
|
||||
6: [ 8371, -49711, 1252 ],
|
||||
7: [ 8423, -48545, 1252 ],
|
||||
8: [ 9105, -48474, 1252 ],
|
||||
9: [ 9085, -47488, 972 ],
|
||||
10: [ 10858, -47527, 316 ],
|
||||
11: [ 10842, -48626, 75 ],
|
||||
12: [ 12171, -48464, -547 ],
|
||||
13: [ 13565, -49145, -535 ],
|
||||
14: [ 15653, -49159, -1059 ],
|
||||
15: [ 15423, -48402, -839 ],
|
||||
16: [ 15066, -47438, -419 ],
|
||||
17: [ 13990, -46843, -292 ],
|
||||
18: [ 13685, -47371, -163 ],
|
||||
19: [ 13384, -47470, -163 ],
|
||||
20: [ 14609, -48608, 346 ],
|
||||
21: [ 13878, -47449, 747 ],
|
||||
22: [ 12894, -49109, 980 ],
|
||||
23: [ 10135, -49150, 996 ],
|
||||
24: [ 12894, -49109, 980 ],
|
||||
25: [ 13738, -50894, 747 ],
|
||||
26: [ 14579, -49698, 347 ],
|
||||
27: [ 12896, -51135, -166 ],
|
||||
28: [ 12971, -52046, -292, ],
|
||||
29: [ 15140, -50781, -442, ],
|
||||
30: [ 15328, -50406, -603 ],
|
||||
31: [ 15594, -49192, -1059 ],
|
||||
32: [ 13175, -49153, -537 ],
|
||||
}
|
||||
|
||||
class benom (JQuest):
|
||||
|
||||
def __init__(self, id, name, descr) :
|
||||
JQuest.__init__(self, id, name, descr)
|
||||
self.Teleport = []
|
||||
self.Benomm = []
|
||||
castleOwner = CastleManager.getInstance().getCastleById(8).getOwnerId()
|
||||
siegeDate = CastleManager.getInstance().getCastleById(8).getSiegeDate().getTimeInMillis()
|
||||
benomTeleporterSpawn = (siegeDate - System.currentTimeMillis()) - 86400000
|
||||
benomRaidRoomSpawn = (siegeDate - System.currentTimeMillis()) - 86400000
|
||||
benomRaidSiegeSpawn = (siegeDate - System.currentTimeMillis())
|
||||
if benomTeleporterSpawn < 0 :
|
||||
benomTeleporterSpawn = 1
|
||||
if benomRaidSiegeSpawn < 0 :
|
||||
benomRaidSiegeSpawn = 1
|
||||
self.BenomWalkRouteStep = 0
|
||||
self.BenomIsSpawned = 0
|
||||
if castleOwner > 0 :
|
||||
if benomTeleporterSpawn >= 1 :
|
||||
self.startQuestTimer("BenomTeleSpawn", benomTeleporterSpawn, None, None)
|
||||
if (siegeDate - System.currentTimeMillis()) > 0 :
|
||||
self.startQuestTimer("BenomRaidRoomSpawn", benomRaidRoomSpawn, None, None)
|
||||
self.startQuestTimer("BenomRaidSiegeSpawn", benomRaidSiegeSpawn, None, None)
|
||||
self.Benom = Benom
|
||||
|
||||
def onTalk(self, npc, player) :
|
||||
npcId = npc.getNpcId()
|
||||
castleOwner = CastleManager.getInstance().getCastleById(8).getOwnerId()
|
||||
clanId = player.getClanId()
|
||||
if castleOwner and clanId :
|
||||
if castleOwner == clanId :
|
||||
X = 12558 + (Rnd.get(200) - 100)
|
||||
Y = -49279 + (Rnd.get(200) - 100)
|
||||
player.teleToLocation(X, Y, -3007)
|
||||
return
|
||||
else :
|
||||
htmltext = "<html><body>Benom's Avatar:<br>Your clan does not own this castle. Only members of this Castle's owning clan can challenge Benom.</body></html>"
|
||||
else :
|
||||
htmltext = "<html><body>Benom's Avatar:<br>Your clan does not own this castle. Only members of this Castle's owning clan can challenge Benom.</body></html>"
|
||||
return htmltext
|
||||
|
||||
def onAdvEvent(self, event, npc, player) :
|
||||
status = GrandBossManager.getInstance().getBossStatus(Benom)
|
||||
if event == "BenomTeleSpawn" :
|
||||
self.Teleport = self.addSpawn(BenomTeleport, 11013, -49629, -547, 13400, False, 0)
|
||||
elif event == "BenomRaidRoomSpawn" :
|
||||
if self.BenomIsSpawned == 0 and status == 0 :
|
||||
self.Benomm = self.addSpawn(Benom, 12047, -49211, -3009, 0, False, 0)
|
||||
self.BenomIsSpawned = 1
|
||||
elif event == "BenomRaidSiegeSpawn" :
|
||||
if status == 0 :
|
||||
if self.BenomIsSpawned == 0 :
|
||||
self.Benomm = self.addSpawn(Benom, 11025, -49152, -537, 0, False, 0)
|
||||
self.BenomIsSpawned = 1
|
||||
elif self.BenomIsSpawned == 1 :
|
||||
self.Benomm.teleToLocation(11025, -49152, -537)
|
||||
self.startQuestTimer("BenomSpawnEffect", 100, None, None)
|
||||
self.startQuestTimer("BenomBossDespawn", 5400000, None, None)
|
||||
self.Teleport.deleteMe()
|
||||
elif event == "BenomSpawnEffect" :
|
||||
self.Benomm.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE)
|
||||
self.Benomm.broadcastPacket(SpecialCamera(self.Benomm.getObjectId(), 200, 0, 150, 0, 5000))
|
||||
self.Benomm.broadcastPacket(SocialAction(self.Benomm.getObjectId(), 3))
|
||||
self.startQuestTimer("BenomWalk", 5000, self.Benomm, None)
|
||||
self.BenomWalkRouteStep = 0
|
||||
elif event == "Attacking" :
|
||||
NumPlayers = []
|
||||
for player in npc.getKnownList().getKnownPlayers().values() :
|
||||
NumPlayers.append(player)
|
||||
if len(NumPlayers) > 0 :
|
||||
target = NumPlayers[Rnd.get(len(NumPlayers))]
|
||||
npc.addDamageHate(target, 0, 999)
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target)
|
||||
self.startQuestTimer("Attacking", 2000, npc, player)
|
||||
elif len(NumPlayers) == 0 :
|
||||
self.startQuestTimer("BenomWalkFinish", 2000, npc, None)
|
||||
elif event == "BenomWalkFinish" :
|
||||
if npc.getCastle().getSiege().getIsInProgress() :
|
||||
self.cancelQuestTimer("Attacking", npc, player)
|
||||
X = benomWalkRoutes[self.BenomWalkRouteStep][0]
|
||||
Y = benomWalkRoutes[self.BenomWalkRouteStep][1]
|
||||
Z = benomWalkRoutes[self.BenomWalkRouteStep][2]
|
||||
npc.teleToLocation(X, Y, Z)
|
||||
npc.setWalking()
|
||||
self.BenomWalkRouteStep = 0
|
||||
self.startQuestTimer("BenomWalk", 2200, npc, None)
|
||||
elif event == "BenomWalk" :
|
||||
if self.BenomWalkRouteStep == 33 :
|
||||
self.BenomWalkRouteStep = 0
|
||||
self.startQuestTimer("BenomWalk", 100, npc, None)
|
||||
else :
|
||||
self.startQuestTimer("Talk", 100, npc, None)
|
||||
if self.BenomWalkRouteStep == 14 :
|
||||
self.startQuestTimer("DoorOpen", 15000, None, None)
|
||||
self.startQuestTimer("DoorClose", 23000, None, None)
|
||||
if self.BenomWalkRouteStep == 32 :
|
||||
self.startQuestTimer("DoorOpen", 500, None, None)
|
||||
self.startQuestTimer("DoorClose", 4000, None, None)
|
||||
Time = WalkTimes[self.BenomWalkRouteStep]
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE)
|
||||
X = benomWalkRoutes[self.BenomWalkRouteStep][0]
|
||||
Y = benomWalkRoutes[self.BenomWalkRouteStep][1]
|
||||
Z = benomWalkRoutes[self.BenomWalkRouteStep][2]
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, Location(X, Y, Z, 0))
|
||||
self.BenomWalkRouteStep = int(self.BenomWalkRouteStep) + 1
|
||||
self.startQuestTimer("BenomWalk", Time, npc, None)
|
||||
elif event == "DoorOpen" :
|
||||
DoorTable.getInstance().getDoor(20160005).openMe()
|
||||
elif event == "DoorClose" :
|
||||
DoorTable.getInstance().getDoor(20160005).closeMe()
|
||||
elif event == "Talk" :
|
||||
if Rnd.get(100) < 40 :
|
||||
npc.broadcastPacket(CreatureSay(npc.getObjectId(), 0, "Benom", BenomSpeak[Rnd.get(4)]))
|
||||
elif event == "BenomBossDespawn" :
|
||||
GrandBossManager.getInstance().setBossStatus(Benom,LIVE)
|
||||
self.BenomIsSpawned = 0
|
||||
self.Benomm.deleteMe()
|
||||
return
|
||||
|
||||
def onAttack (self,npc,player,damage,isPet) :
|
||||
self.cancelQuestTimer("BenomWalk", npc, None)
|
||||
self.cancelQuestTimer("BenomWalkFinish", npc, None)
|
||||
self.startQuestTimer("Attacking", 100, npc, player)
|
||||
return
|
||||
|
||||
def onKill(self, npc, player, isPet) :
|
||||
GrandBossManager.getInstance().setBossStatus(Benom,DEAD)
|
||||
self.cancelQuestTimer("BenomWalk", npc, None)
|
||||
self.cancelQuestTimer("BenomWalkFinish", npc, None)
|
||||
self.cancelQuestTimer("BenomBossDespawn", npc, None)
|
||||
self.cancelQuestTimer("Talk", npc, None)
|
||||
self.cancelQuestTimer("Attacking", npc, None)
|
||||
return
|
||||
|
||||
QUEST = benom(-1, "benom", "ai")
|
||||
|
||||
QUEST.addStartNpc(BenomTeleport)
|
||||
QUEST.addTalkId(BenomTeleport)
|
||||
QUEST.addAttackId(Benom)
|
||||
QUEST.addKillId(Benom)
|
@@ -1,76 +0,0 @@
|
||||
import sys
|
||||
from org.l2jmobius.gameserver.ai import CtrlIntention
|
||||
from org.l2jmobius.gameserver.datatables.sql import SpawnTable
|
||||
from org.l2jmobius.gameserver.model.actor.position import Location
|
||||
from org.l2jmobius.gameserver.model.quest import State
|
||||
from org.l2jmobius.gameserver.model.quest import QuestState
|
||||
from org.l2jmobius.gameserver.model.quest.jython import QuestJython as JQuest
|
||||
from org.l2jmobius.gameserver.network.serverpackets import ActionFailed
|
||||
from org.l2jmobius.gameserver.network.serverpackets import PlaySound
|
||||
from org.l2jmobius.gameserver.network.serverpackets import SocialAction
|
||||
from org.l2jmobius.gameserver.network.serverpackets import SpecialCamera
|
||||
|
||||
Doctor_Chaos = 32033
|
||||
Strange_Machine = 32032
|
||||
Chaos_Golem = 25512
|
||||
|
||||
class Quest (JQuest) :
|
||||
def __init__(self,id,name,descr):
|
||||
JQuest.__init__(self,id,name,descr)
|
||||
self.isGolemSpawned = 0
|
||||
self.isChaosSpawned = 1
|
||||
|
||||
def FindTemplate (self, npcId) :
|
||||
npcinstance = 0
|
||||
for spawn in SpawnTable.getInstance().getSpawnTable().values():
|
||||
if spawn :
|
||||
if spawn.getNpcId() == npcId:
|
||||
npcinstance = spawn.getLastSpawn()
|
||||
break
|
||||
return npcinstance
|
||||
|
||||
def onAdvEvent (self,event,npc, player) :
|
||||
if event == "1" :
|
||||
machine_instance = self.FindTemplate(Strange_Machine)
|
||||
if machine_instance :
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, machine_instance)
|
||||
machine_instance.broadcastPacket(SpecialCamera(machine_instance.getObjectId(),1,-200,15,10000,20000))
|
||||
else :
|
||||
print "Dr Chaos AI: problem finding Strange Machine (npcid = "+Strange_Machine+"). Error: not spawned!"
|
||||
self.startQuestTimer("2",2000,npc,player)
|
||||
self.startQuestTimer("3",10000,npc,player)
|
||||
if self.isChaosSpawned == 0 :
|
||||
chaos = self.addSpawn(32033,96471,-111425,-3334,0,False,0)
|
||||
self.isChaosSpawned == 1
|
||||
self.startQuestTimer("2",2000,npc,player)
|
||||
self.startQuestTimer("3",10000,npc,player)
|
||||
elif event == "2" :
|
||||
npc.broadcastPacket(SocialAction(npc.getObjectId(),3))
|
||||
elif event == "3" :
|
||||
npc.broadcastPacket(SpecialCamera(npc.getObjectId(),1,-150,10,3000,20000))
|
||||
self.startQuestTimer("4",2500,npc,player)
|
||||
elif event == "4" :
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, Location(96055,-110759,-3312,0))
|
||||
self.startQuestTimer("5",2000,npc,player)
|
||||
elif event == "5" :
|
||||
player.teleToLocation(94832,-112624,-3304)
|
||||
npc.teleToLocation(-113091,-243942,-15536)
|
||||
if self.isGolemSpawned == 0 :
|
||||
golem = self.addSpawn(25512,94640,-112496,-3336,0,False,0)
|
||||
self.isGolemSpawned == 1
|
||||
self.startQuestTimer("6",1000,golem,player)
|
||||
player.sendPacket(PlaySound(1,"Rm03_A",0,0,0,0,0))
|
||||
elif event == "6" :
|
||||
npc.broadcastPacket(SpecialCamera(npc.getObjectId(),30,-200,20,6000,8000))
|
||||
return
|
||||
|
||||
def onFirstTalk (self,npc,player):
|
||||
npcId = npc.getNpcId()
|
||||
if npcId == Doctor_Chaos :
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, Location(96323,-110914,-3328,0))
|
||||
self.startQuestTimer("1",3000,npc,player)
|
||||
return ""
|
||||
|
||||
QUEST = Quest(-1,"Doctor Chaos","ai")
|
||||
|
||||
QUEST.addFirstTalkId(32033)
|
@@ -1,106 +0,0 @@
|
||||
import sys
|
||||
from org.l2jmobius.gameserver.ai import CtrlIntention
|
||||
from org.l2jmobius.gameserver.instancemanager import GrandBossManager
|
||||
from org.l2jmobius.gameserver.model.quest import State
|
||||
from org.l2jmobius.gameserver.model.quest import QuestState
|
||||
from org.l2jmobius.gameserver.model.quest.jython import QuestJython as JQuest
|
||||
from org.l2jmobius.gameserver.network.serverpackets import SocialAction
|
||||
from org.l2jmobius.gameserver.network.serverpackets import SpecialCamera
|
||||
from org.l2jmobius.commons.util import Rnd
|
||||
from java.lang import System
|
||||
|
||||
STATUE = 32109
|
||||
SAILREN = 29065
|
||||
VELO = 22196
|
||||
PTERO = 22199
|
||||
TREX = 22215
|
||||
|
||||
STONE = 8784
|
||||
|
||||
class Sailren(JQuest) :
|
||||
|
||||
def __init__(self,id,name,descr):
|
||||
self.vlc = []
|
||||
self.ptr = []
|
||||
self.trx = []
|
||||
self.slrn = []
|
||||
JQuest.__init__(self,id,name,descr)
|
||||
|
||||
def onAdvEvent (self,event,npc,player):
|
||||
if event == "start" :
|
||||
self.vlc = self.addSpawn(VELO,27845,-5567,-1982,45000,False,0)
|
||||
self.startQuestTimer("camera",2000, self.vlc, player)
|
||||
self.cancelQuestTimer("start",npc,None)
|
||||
if event == "round2" :
|
||||
self.ptr = self.addSpawn(PTERO,27838,-5578,-1982,45000,False,0)
|
||||
self.startQuestTimer("camera",2000, self.ptr, player)
|
||||
self.cancelQuestTimer("round2",npc,None)
|
||||
if event == "round3" :
|
||||
self.trx = self.addSpawn(TREX,27838,-5578,-1982,45000,False,0)
|
||||
self.startQuestTimer("camera",2000, self.trx, player)
|
||||
self.cancelQuestTimer("round3",npc,None)
|
||||
if event == "sailren" :
|
||||
self.slrn = self.addSpawn(SAILREN,27489,-6223,-1982,45000,False,0)
|
||||
self.startQuestTimer("camera",2000, self.slrn, player)
|
||||
self.startQuestTimer("vkrovatku",1200000, self.slrn, None)
|
||||
self.cancelQuestTimer("round4",npc,None)
|
||||
elif event == "camera" :
|
||||
player.broadcastPacket(SpecialCamera(npc.getObjectId(),400,-75,3,-150,5000))
|
||||
npc.broadcastPacket(SocialAction(npc.getObjectId(),1))
|
||||
elif event == "open" :
|
||||
self.deleteGlobalQuestVar("close")
|
||||
self.cancelQuestTimer("open",npc,None)
|
||||
elif event == "vkrovatku" :
|
||||
npc.deleteMe()
|
||||
self.deleteGlobalQuestVar("close")
|
||||
self.cancelQuestTimer("open",npc,None)
|
||||
self.cancelQuestTimer("vkrovatku",npc,None)
|
||||
return
|
||||
|
||||
def onTalk (self,npc,player):
|
||||
st = player.getQuestState("sailren")
|
||||
npcId = npc.getNpcId()
|
||||
close = self.loadGlobalQuestVar("close")
|
||||
time = self.loadGlobalQuestVar("time")
|
||||
party = player.getParty()
|
||||
if npcId == STATUE :
|
||||
if st.getQuestItemsCount(STONE) >= 1:
|
||||
if close == "" :
|
||||
if party:
|
||||
for player in party.getPartyMembers() :
|
||||
st.takeItems(STONE,1)
|
||||
self.saveGlobalQuestVar("close", "1")
|
||||
zone = GrandBossManager.getInstance().getZone(27244,-7026,-1974)
|
||||
if zone:
|
||||
zone.allowPlayerEntry(player, 3600)
|
||||
player.teleToLocation(27244,-7026,-1974)
|
||||
self.startQuestTimer("start",30000,npc,player)
|
||||
self.startQuestTimer("open",1800000,npc,None)
|
||||
else :
|
||||
return "<html><body><font color=LEVEL>Only with party...</font></body></html>"
|
||||
else :
|
||||
return "<html><body><font color=LEVEL>Some one else is inside...</font></body></html>"
|
||||
else :
|
||||
return "<html><body>You need quest item: <font color=LEVEL>Gazkh...</font></body></html>"
|
||||
return
|
||||
|
||||
def onKill(self,npc,player,isPet):
|
||||
if npc == self.vlc :
|
||||
self.startQuestTimer("round2",30000,npc,player)
|
||||
if npc == self.ptr :
|
||||
self.startQuestTimer("round3",60000,npc,player)
|
||||
if npc == self.trx :
|
||||
self.startQuestTimer("sailren",180000,npc,player)
|
||||
if npc == self.slrn :
|
||||
self.deleteGlobalQuestVar("close")
|
||||
self.cancelQuestTimer("open",npc,None)
|
||||
return
|
||||
|
||||
QUEST = Sailren(-1,"sailren","ai")
|
||||
|
||||
QUEST.addStartNpc(STATUE)
|
||||
QUEST.addTalkId(STATUE)
|
||||
QUEST.addKillId(VELO)
|
||||
QUEST.addKillId(PTERO)
|
||||
QUEST.addKillId(TREX)
|
||||
QUEST.addKillId(SAILREN)
|
Reference in New Issue
Block a user