Re-organisation of some AI scripts from group folder.

This commit is contained in:
MobiusDev
2016-06-18 12:06:43 +00:00
parent 4898ba65a2
commit f768338b37
13 changed files with 72 additions and 278 deletions

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.group; package ai.areas.BeastFarm;
import com.l2jmobius.commons.util.CommonUtil; import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.ai.CtrlIntention; import com.l2jmobius.gameserver.ai.CtrlIntention;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.group; package ai.areas.BeastFarm;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.group; package ai.areas.BeastFarm;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.group; package ai.areas.BeastFarm;
import com.l2jmobius.commons.util.CommonUtil; import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.ai.CtrlIntention; import com.l2jmobius.gameserver.ai.CtrlIntention;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.group; package ai.areas.DenOfDevil;
import com.l2jmobius.commons.util.CommonUtil; import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.ThreadPoolManager; import com.l2jmobius.gameserver.ThreadPoolManager;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.group; package ai.areas.DragonValley;
import com.l2jmobius.gameserver.enums.ChatType; import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Attackable;

View File

@@ -1,97 +1,64 @@
/* /*
* This file is part of the L2J Mobius project. * This file is part of the L2J Mobius project.
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.OrbisTemple; package ai.areas.OrbisTemple;
import com.l2jmobius.gameserver.model.Location; import java.util.HashMap;
import com.l2jmobius.gameserver.model.actor.L2Character; import java.util.Map;
import com.l2jmobius.gameserver.model.zone.L2ZoneType;
import com.l2jmobius.gameserver.model.Location;
import ai.AbstractNpcAI; import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.zone.L2ZoneType;
/**
* Orbis Temple teleport AI. import ai.AbstractNpcAI;
* @author Mobius
*/ /**
public final class OrbisTempleTeleports extends AbstractNpcAI * Orbis Temple AI.
{ * @author Gladicek
// Zones */
private static final int ZONE_ID_1 = 200201; public final class OrbisTempleTeleports extends AbstractNpcAI
private static final int ZONE_ID_2 = 200202; {
private static final int ZONE_ID_3 = 200203; private static final Map<Integer, Location> TELEPORT_DATA = new HashMap<>();
private static final int ZONE_ID_4 = 200204; static
private static final int ZONE_ID_5 = 200205; {
private static final int ZONE_ID_6 = 200206; TELEPORT_DATA.put(12036, new Location(213983, 53250, -8176));
// Teleport Locations TELEPORT_DATA.put(12037, new Location(198022, 90032, -192));
private static final Location TELEPORT_LOC_1 = new Location(198022, 90032, -192); TELEPORT_DATA.put(12038, new Location(213799, 53253, -14432));
private static final Location TELEPORT_LOC_2 = new Location(213983, 53250, -8176); TELEPORT_DATA.put(12039, new Location(215056, 50467, -8416));
private static final Location TELEPORT_LOC_3 = new Location(215056, 50467, -8416); TELEPORT_DATA.put(12040, new Location(211641, 115547, -12736));
private static final Location TELEPORT_LOC_4 = new Location(213799, 53253, -14432); TELEPORT_DATA.put(12041, new Location(211137, 50501, -14624));
private static final Location TELEPORT_LOC_5 = new Location(211137, 50501, -14624); }
private static final Location TELEPORT_LOC_6 = new Location(211641, 115547, -12736);
public OrbisTempleTeleports()
private OrbisTempleTeleports() {
{ addEnterZoneId(TELEPORT_DATA.keySet());
addEnterZoneId(ZONE_ID_1, ZONE_ID_2, ZONE_ID_3, ZONE_ID_4, ZONE_ID_5, ZONE_ID_6); }
}
@Override
@Override public String onEnterZone(L2Character creature, L2ZoneType zone)
public String onEnterZone(L2Character character, L2ZoneType zone) {
{ if (creature.isPlayer() && (creature.getInstanceWorld() == null))
if (character.isPlayer()) {
{ creature.teleToLocation(TELEPORT_DATA.get(zone.getId()));
switch (zone.getId()) }
{ return super.onEnterZone(creature, zone);
case ZONE_ID_1: }
{
character.teleToLocation(TELEPORT_LOC_2); public static void main(String[] args)
break; {
} new OrbisTempleTeleports();
case ZONE_ID_2: }
{
character.teleToLocation(TELEPORT_LOC_1);
break;
}
case ZONE_ID_3:
{
character.teleToLocation(TELEPORT_LOC_4);
break;
}
case ZONE_ID_4:
{
character.teleToLocation(TELEPORT_LOC_3);
break;
}
case ZONE_ID_5:
{
character.teleToLocation(TELEPORT_LOC_6);
break;
}
case ZONE_ID_6:
{
character.teleToLocation(TELEPORT_LOC_5);
break;
}
}
}
return super.onEnterZone(character, zone);
}
public static void main(String[] args)
{
new OrbisTempleTeleports();
}
} }

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.group; package ai.areas.TalkingIsland;
import com.l2jmobius.gameserver.instancemanager.WalkingManager; import com.l2jmobius.gameserver.instancemanager.WalkingManager;
import com.l2jmobius.gameserver.model.Location; import com.l2jmobius.gameserver.model.Location;

View File

@@ -1,72 +0,0 @@
/*
* 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.Wasteland;
import com.l2jmobius.gameserver.model.L2World;
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;
/**
* Wasteland AI.
* @author Stayway, Mobius
*/
public final class Wasteland extends AbstractNpcAI
{
// NPCs
private static final int JOEL = 33516;
private static final int SHUAZEN = 33517;
private static final int GUARD = 19126;
public Wasteland()
{
addSpawnId(JOEL, SHUAZEN, GUARD);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("GUARD_AGGRO") && (npc != null) && !npc.isDead())
{
L2World.getInstance().forEachVisibleObject(npc, L2MonsterInstance.class, npc.getAggroRange(), nearby ->
{
if (npc.isInCombat())
{
return;
}
addAttackDesire(npc, nearby);
return;
});
startQuestTimer("GUARD_AGGRO", 10000, npc, null);
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onSpawn(L2Npc npc)
{
startQuestTimer("GUARD_AGGRO", 5000, npc, null);
return super.onSpawn(npc);
}
public static void main(String[] args)
{
new Wasteland();
}
}

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.areas.Wasteland; package ai.areas.Wastelands;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package ai.group; package ai.areas.Wastelands;
import com.l2jmobius.gameserver.ai.CtrlIntention; import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType; import com.l2jmobius.gameserver.enums.ChatType;

View File

@@ -1,65 +0,0 @@
/*
* 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.group;
import java.util.HashMap;
import java.util.Map;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.zone.L2ZoneType;
import ai.AbstractNpcAI;
/**
* Orbis Temple AI.
* @author Gladicek
*/
public final class OrbisTemple extends AbstractNpcAI
{
private static final Map<Integer, Location> TELEPORT_DATA = new HashMap<>();
static
{
TELEPORT_DATA.put(12036, new Location(213983, 53250, -8176));
TELEPORT_DATA.put(12037, new Location(198022, 90032, -192));
TELEPORT_DATA.put(12038, new Location(213799, 53253, -14432));
TELEPORT_DATA.put(12039, new Location(215056, 50467, -8416));
TELEPORT_DATA.put(12040, new Location(211641, 115547, -12736));
TELEPORT_DATA.put(12041, new Location(211137, 50501, -14624));
}
public OrbisTemple()
{
addEnterZoneId(TELEPORT_DATA.keySet());
}
@Override
public String onEnterZone(L2Character creature, L2ZoneType zone)
{
if (creature.isPlayer() && (creature.getInstanceWorld() == null))
{
creature.teleToLocation(TELEPORT_DATA.get(zone.getId()));
}
return super.onEnterZone(creature, zone);
}
public static void main(String[] args)
{
new OrbisTemple();
}
}

View File

@@ -626,42 +626,6 @@
<node X="109830" Y="-39550" /> <node X="109830" Y="-39550" />
<node X="110457" Y="-39540" /> <node X="110457" Y="-39540" />
</zone> </zone>
<zone name="orbis_temple_teleport_zone_1" id="200201" type="ScriptZone" shape="NPoly" minZ="-450" maxZ="-350">
<node X="198285" Y="90497" />
<node X="198285" Y="90685" />
<node X="198086" Y="90693" />
<node X="198085" Y="90483" />
</zone>
<zone name="orbis_temple_teleport_zone_2" id="200202" type="ScriptZone" shape="NPoly" minZ="-8050" maxZ="-7950">
<node X="214876" Y="52971" />
<node X="214918" Y="52736" />
<node X="215269" Y="52736" />
<node X="215318" Y="53502" />
</zone>
<zone name="orbis_temple_teleport_zone_3" id="200203" type="ScriptZone" shape="NPoly" minZ="-8850" maxZ="-8750">
<node X="215475" Y="52042" />
<node X="215967" Y="52078" />
<node X="215967" Y="52441" />
<node X="214971" Y="52490" />
</zone>
<zone name="orbis_temple_teleport_zone_4" id="200204" type="ScriptZone" shape="NPoly" minZ="-14250" maxZ="-14150">
<node X="214877" Y="52978" />
<node X="214924" Y="52736" />
<node X="215281" Y="52737" />
<node X="215323" Y="53502" />
</zone>
<zone name="orbis_temple_teleport_zone_5" id="200205" type="ScriptZone" shape="NPoly" minZ="-15050" maxZ="-14950">
<node X="210565" Y="48960" />
<node X="210079" Y="48923" />
<node X="210085" Y="48570" />
<node X="211102" Y="48525" />
</zone>
<zone name="orbis_temple_teleport_zone_6" id="200206" type="ScriptZone" shape="NPoly" minZ="-12750" maxZ="-12500">
<node X="211303" Y="114656" />
<node X="211729" Y="114661" />
<node X="211764" Y="114982" />
<node X="211276" Y="115023" />
</zone>
<zone name="gainak_underground_teleport_zone_1" id="200207" type="ScriptZone" shape="NPoly" minZ="-680" maxZ="-220"> <zone name="gainak_underground_teleport_zone_1" id="200207" type="ScriptZone" shape="NPoly" minZ="-680" maxZ="-220">
<node X="17691" Y="-113777" /> <node X="17691" Y="-113777" />
<node X="17502" Y="-113884" /> <node X="17502" Y="-113884" />