Atelia door guard AI.

Contributed by hlwrave.
This commit is contained in:
MobiusDev
2016-03-15 12:45:25 +00:00
parent 76627d6618
commit e9c1218109
2 changed files with 75 additions and 0 deletions

View File

@@ -106,6 +106,7 @@ ai/npc/Zenya/Zenya.java
# Atelia Fortess # Atelia Fortess
ai/atelia_fortess/Devianne.java ai/atelia_fortess/Devianne.java
ai/atelia_fortess/AteliaDoorGuard.java
# Fantasy Isle # Fantasy Isle
ai/fantasy_isle/MC_Show.java ai/fantasy_isle/MC_Show.java

View File

@@ -0,0 +1,74 @@
/*
* 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.atelia_fortess;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import ai.npc.AbstractNpcAI;
/**
* @author hlwrave
*/
final class AteliaDoorGuard extends AbstractNpcAI
{
private static final int GUARD = 23539;
private static int _killCount = 0;
private AteliaDoorGuard()
{
super(AteliaDoorGuard.class.getSimpleName(), "ai/atelia_fortess");
addKillId(GUARD);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
switch (event)
{
case "Close_Atelia_Door":
{
closeDoor(18190002, 0);
closeDoor(18190004, 0);
break;
}
}
return "";
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
if (npc.getId() == GUARD)
{
_killCount++;
}
if (_killCount == 2)
{
openDoor(18190002, 0);
openDoor(18190004, 0);
startQuestTimer("Close_Atelia_Door", 3600000, null, null);
_killCount = 0;
}
return super.onKill(npc, killer, isSummon);
}
public static void main(String[] args)
{
new AteliaDoorGuard();
}
}