Addition of castle side effect script.
Contributed by gigilo1968.
This commit is contained in:
69
L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/CastleSideEffect.java
vendored
Normal file
69
L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/CastleSideEffect.java
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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.others;
|
||||
|
||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.entity.Castle;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExCastleState;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Shows castle side effect in cities.
|
||||
* @author Gigi
|
||||
* @date 2019-05-14 - [12:47:33]
|
||||
*/
|
||||
public class CastleSideEffect extends AbstractNpcAI
|
||||
{
|
||||
private static final int[] ZONE_ID =
|
||||
{
|
||||
11020, // Giran
|
||||
11027, // Gludio
|
||||
11028, // Dion
|
||||
11029, // Oren
|
||||
11031, // aden
|
||||
11032, // Goddard
|
||||
11033, // Rune
|
||||
11034, // Heine
|
||||
11035, // Shuttgard
|
||||
};
|
||||
|
||||
public CastleSideEffect()
|
||||
{
|
||||
addEnterZoneId(ZONE_ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onEnterZone(Creature character, ZoneType zone)
|
||||
{
|
||||
if (character.isPlayer())
|
||||
{
|
||||
for (Castle castle : CastleManager.getInstance().getCastles())
|
||||
{
|
||||
character.sendPacket(new ExCastleState(castle));
|
||||
}
|
||||
}
|
||||
return super.onEnterZone(character, zone);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new CastleSideEffect();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user