From 5a8aa867eefa0678cf28a946b23bba5480811cd7 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Fri, 14 Oct 2016 19:08:53 +0000 Subject: [PATCH] Parnassus Entrance trigger effects. Contributed by gigilo1968. --- .../Parnassus/ParnassusEntranceEffects.java | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/Parnassus/ParnassusEntranceEffects.java diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/Parnassus/ParnassusEntranceEffects.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/Parnassus/ParnassusEntranceEffects.java new file mode 100644 index 0000000000..30e63ec9c1 --- /dev/null +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/Parnassus/ParnassusEntranceEffects.java @@ -0,0 +1,68 @@ +/* + * 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 . + */ +package ai.areas.Parnassus; + +import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.network.serverpackets.OnEventTrigger; + +import ai.AbstractNpcAI; + +/** + * @author Gigi + */ +public class ParnassusEntranceEffects extends AbstractNpcAI +{ + // NPCs + private static final int PRISON_ENTRACE = 33523; + private static final int CAVERNS_ENTRACE = 33522; + // Misc + private static final int PRISON_ENTRACE_TRIGGER_1 = 24230010; + private static final int PRISON_ENTRACE_TRIGGER_2 = 24230012; + private static final int CAVERNS_ENTRACE_TRIGGER_1 = 24230018; + private static final int CAVERNS_ENTRACE_TRIGGER_2 = 24230020; + + private ParnassusEntranceEffects() + { + addSeeCreatureId(PRISON_ENTRACE); + addSeeCreatureId(CAVERNS_ENTRACE); + } + + @Override + public String onSeeCreature(L2Npc npc, L2Character creature, boolean isSummon) + { + if (creature != null) + { + if (npc.getId() == PRISON_ENTRACE) + { + creature.sendPacket(new OnEventTrigger(PRISON_ENTRACE_TRIGGER_1, true)); + creature.sendPacket(new OnEventTrigger(PRISON_ENTRACE_TRIGGER_2, true)); + } + else + { + creature.sendPacket(new OnEventTrigger(CAVERNS_ENTRACE_TRIGGER_1, true)); + creature.sendPacket(new OnEventTrigger(CAVERNS_ENTRACE_TRIGGER_2, true)); + } + } + return super.onSeeCreature(npc, creature, isSummon); + } + + public static void main(String[] args) + { + new ParnassusEntranceEffects(); + } +} \ No newline at end of file