actual freya branch
This commit is contained in:
+128
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* 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.fantasy_isle;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.instancemanager.HandysBlockCheckerManager;
|
||||
import com.l2jserver.gameserver.instancemanager.HandysBlockCheckerManager.ArenaParticipantsHolder;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.quest.Quest;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExCubeGameChangeTimeToStart;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExCubeGameRequestReady;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExCubeGameTeamList;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
* @authors BiggBoss, Gigiikun
|
||||
*/
|
||||
public class HandysBlockCheckerEvent extends Quest
|
||||
{
|
||||
private static final String qn = "HandysBlockCheckerEvent";
|
||||
|
||||
// Arena Managers
|
||||
private static final int A_MANAGER_1 = 32521;
|
||||
private static final int A_MANAGER_2 = 32522;
|
||||
private static final int A_MANAGER_3 = 32523;
|
||||
private static final int A_MANAGER_4 = 32524;
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (npc == null || player == null) return null;
|
||||
|
||||
int npcId = npc.getNpcId();
|
||||
|
||||
int arena = -1;
|
||||
switch(npcId)
|
||||
{
|
||||
case A_MANAGER_1:
|
||||
arena = 0;
|
||||
break;
|
||||
case A_MANAGER_2:
|
||||
arena = 1;
|
||||
break;
|
||||
case A_MANAGER_3:
|
||||
arena = 2;
|
||||
break;
|
||||
case A_MANAGER_4:
|
||||
arena = 3;
|
||||
break;
|
||||
}
|
||||
|
||||
if (arena != -1)
|
||||
{
|
||||
if (eventIsFull(arena))
|
||||
{
|
||||
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CANNOT_REGISTER_CAUSE_QUEUE_FULL));
|
||||
return null;
|
||||
}
|
||||
if (HandysBlockCheckerManager.getInstance().arenaIsBeingUsed(arena))
|
||||
{
|
||||
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.MATCH_BEING_PREPARED_TRY_LATER));
|
||||
return null;
|
||||
}
|
||||
if(HandysBlockCheckerManager.getInstance().addPlayerToArena(player, arena))
|
||||
{
|
||||
ArenaParticipantsHolder holder = HandysBlockCheckerManager.getInstance().getHolder(arena);
|
||||
|
||||
final ExCubeGameTeamList tl = new ExCubeGameTeamList(holder.getRedPlayers(), holder.getBluePlayers(), arena);
|
||||
|
||||
player.sendPacket(tl);
|
||||
|
||||
int countBlue = holder.getBlueTeamSize();
|
||||
int countRed = holder.getRedTeamSize();
|
||||
int minMembers = Config.MIN_BLOCK_CHECKER_TEAM_MEMBERS;
|
||||
|
||||
if(countBlue >= minMembers && countRed >= minMembers)
|
||||
{
|
||||
holder.updateEvent();
|
||||
holder.broadCastPacketToTeam(new ExCubeGameRequestReady());
|
||||
holder.broadCastPacketToTeam(new ExCubeGameChangeTimeToStart(10));
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean eventIsFull(int arena)
|
||||
{
|
||||
if(HandysBlockCheckerManager.getInstance().getHolder(arena).getAllPlayers().size() == 12)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public HandysBlockCheckerEvent(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
addFirstTalkId(A_MANAGER_1);
|
||||
addFirstTalkId(A_MANAGER_2);
|
||||
addFirstTalkId(A_MANAGER_3);
|
||||
addFirstTalkId(A_MANAGER_4);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
if(!Config.ENABLE_BLOCK_CHECKER_EVENT)
|
||||
_log.info("Handy's Block Checker Event is disabled");
|
||||
else
|
||||
{
|
||||
new HandysBlockCheckerEvent(-1, qn, "Handy's Block Checker Event");
|
||||
HandysBlockCheckerManager.getInstance().startUpParticipantsQueue();
|
||||
_log.info("Handy's Block Checker Event is enabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,424 @@
|
||||
/*
|
||||
* 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.fantasy_isle;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Map;
|
||||
|
||||
import javolution.util.FastMap;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.GameTimeController;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.model.L2CharPosition;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.quest.Quest;
|
||||
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
|
||||
import com.l2jserver.gameserver.network.serverpackets.PlaySound;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SocialAction;
|
||||
|
||||
|
||||
/**
|
||||
* MC show script
|
||||
* @author Kerberos
|
||||
*/
|
||||
public class MC_Show extends Quest
|
||||
{
|
||||
private static int mc = 32433;
|
||||
private static int[] singers = {32431,32432};
|
||||
private static int[] circus = {32442,32443,32444,32445,32446};
|
||||
private static int[] individuals = {32439,32440,32441};
|
||||
private static int[] showstuff = {32424,32425,32426,32427,32428};
|
||||
private static boolean isStarted = false;
|
||||
private static int[] messages = {
|
||||
1800105, // How come people are not here... We are about to start the show.. Hmm
|
||||
1800082, // Ugh, I have butterflies in my stomach.. The show starts soon...
|
||||
1800083, // Thank you all for coming here tonight.
|
||||
1800084, // It is an honor to have the special show today.
|
||||
1800085, // Our Fantasy Isle is fully committed to your happiness.
|
||||
1800086, // Now I'd like to introduce the most beautiful singer in Aden. Please welcome Leyla Mira!
|
||||
1800087, // Here she comes!
|
||||
1800088, // Thank you very much, Leyla!
|
||||
// 1800089 Now we're in for a real treat.
|
||||
1800090, // Just back from their world tourÅput your hands together for the Fantasy Isle Circus!
|
||||
1800091, // Come on ~ everyone
|
||||
1800092, // Did you like it? That was so amazing.
|
||||
1800093, // Now we also invited individuals with special talents.
|
||||
1800094, // Let's welcome the first person here!
|
||||
1800095, // ;;;;;;Oh
|
||||
1800096, // Okay, now here comes the next person. Come on up please.
|
||||
1800097, // Oh, it looks like something great is going to happen, right?
|
||||
1800098, // Oh, my ;;;;
|
||||
1800099, // That's g- .. great. Now, here comes the last person.
|
||||
1800100, // Now this is the end of today's show.
|
||||
1800101, // How was it? I am not sure if you really enjoyed it.
|
||||
1800102, // Please remember that Fantasy Isle is always planning a lot of great shows for you.
|
||||
1800103, // Well, I wish I could continue all night long, but this is it for today. Thank you.
|
||||
1800104 // We love you
|
||||
};
|
||||
|
||||
private static Map<String, Object[]> talks = new FastMap<String, Object[]>();
|
||||
private static Map<String, Object[]> walks = new FastMap<String, Object[]>();
|
||||
|
||||
private void load()
|
||||
{
|
||||
talks.put("1", new Object[]{messages[1],"2",1000});
|
||||
talks.put("2", new Object[]{messages[2],"3",6000});
|
||||
talks.put("3", new Object[]{messages[3],"4",4000});
|
||||
talks.put("4", new Object[]{messages[4],"5",5000});
|
||||
talks.put("5", new Object[]{messages[5],"6",3000});
|
||||
talks.put("8", new Object[]{messages[8],"9",5000});
|
||||
talks.put("9", new Object[]{messages[9],"10",5000});
|
||||
talks.put("12", new Object[]{messages[11],"13",5000});
|
||||
talks.put("13", new Object[]{messages[12],"14",5000});
|
||||
talks.put("15", new Object[]{messages[13],"16",5000});
|
||||
talks.put("16", new Object[]{messages[14],"17",5000});
|
||||
talks.put("18", new Object[]{messages[16],"19",5000});
|
||||
talks.put("19", new Object[]{messages[17],"20",5000});
|
||||
talks.put("21", new Object[]{messages[18],"22",5000});
|
||||
talks.put("22", new Object[]{messages[19],"23",400});
|
||||
talks.put("25", new Object[]{messages[20],"26",5000});
|
||||
talks.put("26", new Object[]{messages[21],"27",5400});
|
||||
|
||||
walks.put("npc1_1" , new Object[]{-56546,-56384,-2008,"npc1_2",1200});
|
||||
walks.put("npc1_2" , new Object[]{-56597,-56384,-2008,"npc1_3",1200});
|
||||
walks.put("npc1_3" , new Object[]{-56596,-56428,-2008,"npc1_4",1200});
|
||||
walks.put("npc1_4" , new Object[]{-56593,-56474,-2008,"npc1_5",1000});
|
||||
walks.put("npc1_5" , new Object[]{-56542,-56474,-2008,"npc1_6",1000});
|
||||
walks.put("npc1_6" , new Object[]{-56493,-56473,-2008,"npc1_7",2000});
|
||||
walks.put("npc1_7" , new Object[]{-56495,-56425,-2008,"npc1_1",4000});
|
||||
walks.put("npc2_1" , new Object[]{-56550,-56291,-2008,"npc2_2",1200});
|
||||
walks.put("npc2_2" , new Object[]{-56601,-56293,-2008,"npc2_3",1200});
|
||||
walks.put("npc2_3" , new Object[]{-56603,-56247,-2008,"npc2_4",1200});
|
||||
walks.put("npc2_4" , new Object[]{-56605,-56203,-2008,"npc2_5",1000});
|
||||
walks.put("npc2_5" , new Object[]{-56553,-56202,-2008,"npc2_6",1100});
|
||||
walks.put("npc2_6" , new Object[]{-56504,-56200,-2008,"npc2_7",2000});
|
||||
walks.put("npc2_7" , new Object[]{-56503,-56243,-2008,"npc2_1",4000});
|
||||
walks.put("npc3_1" , new Object[]{-56500,-56290,-2008,"npc3_2",1200});
|
||||
walks.put("npc3_2" , new Object[]{-56551,-56313,-2008,"npc3_3",1200});
|
||||
walks.put("npc3_3" , new Object[]{-56601,-56293,-2008,"npc3_4",1200});
|
||||
walks.put("npc3_4" , new Object[]{-56651,-56294,-2008,"npc3_5",1200});
|
||||
walks.put("npc3_5" , new Object[]{-56653,-56250,-2008,"npc3_6",1200});
|
||||
walks.put("npc3_6" , new Object[]{-56654,-56204,-2008,"npc3_7",1200});
|
||||
walks.put("npc3_7" , new Object[]{-56605,-56203,-2008,"npc3_8",1200});
|
||||
walks.put("npc3_8" , new Object[]{-56554,-56202,-2008,"npc3_9",1200});
|
||||
walks.put("npc3_9" , new Object[]{-56503,-56200,-2008,"npc3_10",1200});
|
||||
walks.put("npc3_10", new Object[]{-56502,-56244,-2008,"npc3_1",900});
|
||||
walks.put("npc4_1" , new Object[]{-56495,-56381,-2008,"npc4_2",1200});
|
||||
walks.put("npc4_2" , new Object[]{-56548,-56383,-2008,"npc4_3",1200});
|
||||
walks.put("npc4_3" , new Object[]{-56597,-56383,-2008,"npc4_4",1200});
|
||||
walks.put("npc4_4" , new Object[]{-56643,-56385,-2008,"npc4_5",1200});
|
||||
walks.put("npc4_5" , new Object[]{-56639,-56436,-2008,"npc4_6",1200});
|
||||
walks.put("npc4_6" , new Object[]{-56639,-56473,-2008,"npc4_7",1200});
|
||||
walks.put("npc4_7" , new Object[]{-56589,-56473,-2008,"npc4_8",1200});
|
||||
walks.put("npc4_8" , new Object[]{-56541,-56473,-2008,"npc4_9",1200});
|
||||
walks.put("npc4_9" , new Object[]{-56496,-56473,-2008,"npc4_10",1200});
|
||||
walks.put("npc4_10", new Object[]{-56496,-56429,-2008,"npc4_1",900});
|
||||
walks.put("npc5_1" , new Object[]{-56549,-56335,-2008,"npc5_2",1000});
|
||||
walks.put("npc5_2" , new Object[]{-56599,-56337,-2008,"npc5_3",2000});
|
||||
walks.put("npc5_3" , new Object[]{-56649,-56341,-2008,"npc5_4",26000});
|
||||
walks.put("npc5_4" , new Object[]{-56600,-56341,-2008,"npc5_5",1000});
|
||||
walks.put("npc5_5" , new Object[]{-56553,-56341,-2008,"npc5_6",1000});
|
||||
walks.put("npc5_6" , new Object[]{-56508,-56331,-2008,"npc5_2",8000});
|
||||
walks.put("npc6_1" , new Object[]{-56595,-56428,-2008,"npc6_2",1000});
|
||||
walks.put("npc6_2" , new Object[]{-56596,-56383,-2008,"npc6_3",1000});
|
||||
walks.put("npc6_3" , new Object[]{-56648,-56384,-2008,"npc6_4",1000});
|
||||
walks.put("npc6_4" , new Object[]{-56645,-56429,-2008,"npc6_5",1000});
|
||||
walks.put("npc6_5" , new Object[]{-56644,-56475,-2008,"npc6_6",1000});
|
||||
walks.put("npc6_6" , new Object[]{-56595,-56473,-2008,"npc6_7",1000});
|
||||
walks.put("npc6_7" , new Object[]{-56542,-56473,-2008,"npc6_8",1000});
|
||||
walks.put("npc6_8" , new Object[]{-56492,-56472,-2008,"npc6_9",1200});
|
||||
walks.put("npc6_9" , new Object[]{-56495,-56426,-2008,"npc6_10",2000});
|
||||
walks.put("npc6_10", new Object[]{-56540,-56426,-2008,"npc6_1",3000});
|
||||
walks.put("npc7_1" , new Object[]{-56603,-56249,-2008,"npc7_2",1000});
|
||||
walks.put("npc7_2" , new Object[]{-56601,-56294,-2008,"npc7_3",1000});
|
||||
walks.put("npc7_3" , new Object[]{-56651,-56295,-2008,"npc7_4",1000});
|
||||
walks.put("npc7_4" , new Object[]{-56653,-56248,-2008,"npc7_5",1000});
|
||||
walks.put("npc7_5" , new Object[]{-56605,-56203,-2008,"npc7_6",1000});
|
||||
walks.put("npc7_6" , new Object[]{-56554,-56202,-2008,"npc7_7",1000});
|
||||
walks.put("npc7_7" , new Object[]{-56504,-56201,-2008,"npc7_8",1000});
|
||||
walks.put("npc7_8" , new Object[]{-56502,-56247,-2008,"npc7_9",1200});
|
||||
walks.put("npc7_9" , new Object[]{-56549,-56248,-2008,"npc7_10",2000});
|
||||
walks.put("npc7_10", new Object[]{-56549,-56248,-2008,"npc7_1",3000});
|
||||
walks.put("npc8_1" , new Object[]{-56493,-56426,-2008,"npc8_2",1000});
|
||||
walks.put("npc8_2" , new Object[]{-56497,-56381,-2008,"npc8_3",1200});
|
||||
walks.put("npc8_3" , new Object[]{-56544,-56381,-2008,"npc8_4",1200});
|
||||
walks.put("npc8_4" , new Object[]{-56596,-56383,-2008,"npc8_5",1200});
|
||||
walks.put("npc8_5" , new Object[]{-56594,-56428,-2008,"npc8_6",900});
|
||||
walks.put("npc8_6" , new Object[]{-56645,-56429,-2008,"npc8_7",1200});
|
||||
walks.put("npc8_7" , new Object[]{-56647,-56384,-2008,"npc8_8",1200});
|
||||
walks.put("npc8_8" , new Object[]{-56649,-56362,-2008,"npc8_9",9200});
|
||||
walks.put("npc8_9" , new Object[]{-56654,-56429,-2008,"npc8_10",1200});
|
||||
walks.put("npc8_10", new Object[]{-56644,-56474,-2008,"npc8_11",900});
|
||||
walks.put("npc8_11", new Object[]{-56593,-56473,-2008,"npc8_12",1100});
|
||||
walks.put("npc8_12", new Object[]{-56543,-56472,-2008,"npc8_13",1200});
|
||||
walks.put("npc8_13", new Object[]{-56491,-56471,-2008,"npc8_1",1200});
|
||||
walks.put("npc9_1" , new Object[]{-56505,-56246,-2008,"npc9_2",1000});
|
||||
walks.put("npc9_2" , new Object[]{-56504,-56291,-2008,"npc9_3",1200});
|
||||
walks.put("npc9_3" , new Object[]{-56550,-56291,-2008,"npc9_4",1200});
|
||||
walks.put("npc9_4" , new Object[]{-56600,-56292,-2008,"npc9_5",1200});
|
||||
walks.put("npc9_5" , new Object[]{-56603,-56248,-2008,"npc9_6",900});
|
||||
walks.put("npc9_6" , new Object[]{-56653,-56249,-2008,"npc9_7",1200});
|
||||
walks.put("npc9_7" , new Object[]{-56651,-56294,-2008,"npc9_8",1200});
|
||||
walks.put("npc9_8" , new Object[]{-56650,-56316,-2008,"npc9_9",9200});
|
||||
walks.put("npc9_9" , new Object[]{-56660,-56250,-2008,"npc9_10",1200});
|
||||
walks.put("npc9_10", new Object[]{-56656,-56205,-2008,"npc9_11",900});
|
||||
walks.put("npc9_11", new Object[]{-56606,-56204,-2008,"npc9_12",1100});
|
||||
walks.put("npc9_12", new Object[]{-56554,-56203,-2008,"npc9_13",1200});
|
||||
walks.put("npc9_13", new Object[]{-56506,-56203,-2008,"npc9_1",1200});
|
||||
walks.put("24" , new Object[]{-56730,-56340,-2008,"25",1800});
|
||||
walks.put("27" , new Object[]{-56702,-56340,-2008,"29",1800});
|
||||
}
|
||||
|
||||
public MC_Show(int id,String name,String descr)
|
||||
{
|
||||
super(id,name,descr);
|
||||
addEventId(32433, Quest.QuestEventType.ON_SPAWN);
|
||||
addEventId(32431, Quest.QuestEventType.ON_SPAWN);
|
||||
addEventId(32432, Quest.QuestEventType.ON_SPAWN);
|
||||
addEventId(32442, Quest.QuestEventType.ON_SPAWN);
|
||||
addEventId(32443, Quest.QuestEventType.ON_SPAWN);
|
||||
addEventId(32444, Quest.QuestEventType.ON_SPAWN);
|
||||
addEventId(32445, Quest.QuestEventType.ON_SPAWN);
|
||||
addEventId(32446, Quest.QuestEventType.ON_SPAWN);
|
||||
addEventId(32424, Quest.QuestEventType.ON_SPAWN);
|
||||
addEventId(32425, Quest.QuestEventType.ON_SPAWN);
|
||||
addEventId(32426, Quest.QuestEventType.ON_SPAWN);
|
||||
addEventId(32427, Quest.QuestEventType.ON_SPAWN);
|
||||
addEventId(32428, Quest.QuestEventType.ON_SPAWN);
|
||||
load();
|
||||
scheduleTimer();
|
||||
}
|
||||
|
||||
private int getGameTime()
|
||||
{
|
||||
return GameTimeController.getInstance().getGameTime();
|
||||
}
|
||||
|
||||
private void scheduleTimer()
|
||||
{
|
||||
int gameTime = getGameTime();
|
||||
int hours = (gameTime/60)%24;
|
||||
int minutes = gameTime%60;
|
||||
int hourDiff, minDiff;
|
||||
hourDiff = (20 - hours);
|
||||
if (hourDiff < 0)
|
||||
hourDiff = 24-(hourDiff*=-1);
|
||||
minDiff = (30 - minutes);
|
||||
if (minDiff < 0)
|
||||
minDiff = 60-(minDiff*=-1);
|
||||
long diff;
|
||||
hourDiff*=60*60*1000;
|
||||
minDiff*=60*1000;
|
||||
diff = hourDiff+minDiff;
|
||||
if (Config.DEBUG)
|
||||
{
|
||||
SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||
_log.info("Fantasy Isle: MC show script starting at " + format.format(System.currentTimeMillis()+diff)+ " and is scheduled each next 4 hours.");
|
||||
}
|
||||
ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new StartMCShow(), diff, 14400000L);
|
||||
|
||||
}
|
||||
|
||||
private void autoChat(L2Npc npc, int stringId, int type)
|
||||
{
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), type, npc.getNpcId(), stringId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
if (isStarted)
|
||||
{
|
||||
switch (npc.getNpcId())
|
||||
{
|
||||
case 32433:
|
||||
autoChat(npc,messages[0],1);
|
||||
startQuestTimer("1",30000, npc, null);
|
||||
break;
|
||||
case 32431:
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(-56657,-56338,-2008,33102));
|
||||
startQuestTimer("social1",6000, npc, null, true);
|
||||
startQuestTimer("7",215000, npc, null);
|
||||
break;
|
||||
case 32432:
|
||||
startQuestTimer("social1",6000, npc, null, true);
|
||||
startQuestTimer("7",215000, npc, null);
|
||||
break;
|
||||
case 32442:
|
||||
case 32443:
|
||||
case 32444:
|
||||
case 32445:
|
||||
case 32446:
|
||||
startQuestTimer("11",100000, npc, null);
|
||||
break;
|
||||
case 32424:
|
||||
case 32425:
|
||||
case 32426:
|
||||
case 32427:
|
||||
case 32428:
|
||||
startQuestTimer("social1",5500, npc, null);
|
||||
startQuestTimer("social1",12500, npc, null);
|
||||
startQuestTimer("28",19700, npc, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
@Override
|
||||
public String onAdvEvent (String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equalsIgnoreCase("Start"))
|
||||
{
|
||||
isStarted = true;
|
||||
addSpawn(mc,-56698,-56430,-2008,32768,false,0);
|
||||
}
|
||||
else if (npc != null && isStarted)
|
||||
{
|
||||
if (event.equalsIgnoreCase("6"))
|
||||
{
|
||||
autoChat(npc,messages[6],1);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(-56511,-56647,-2008,36863));
|
||||
npc.broadcastPacket(new PlaySound(1, "NS22_F", 0, 0, 0, 0, 0));
|
||||
addSpawn(singers[0],-56344,-56328,-2008,32768,false,224000);
|
||||
addSpawn(singers[1],-56552,-56245,-2008,36863,false,224000);
|
||||
addSpawn(singers[1],-56546,-56426,-2008,28672,false,224000);
|
||||
addSpawn(singers[1],-56570,-56473,-2008,28672,false,224000);
|
||||
addSpawn(singers[1],-56594,-56516,-2008,28672,false,224000);
|
||||
addSpawn(singers[1],-56580,-56203,-2008,36863,false,224000);
|
||||
addSpawn(singers[1],-56606,-56157,-2008,36863,false,224000);
|
||||
startQuestTimer("7",215000, npc, null);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("7"))
|
||||
{
|
||||
switch (npc.getNpcId())
|
||||
{
|
||||
case 32433:
|
||||
autoChat(npc,messages[7],1);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(-56698,-56430,-2008,32768));
|
||||
startQuestTimer("8",12000, npc, null);
|
||||
break;
|
||||
default:
|
||||
cancelQuestTimer("social1", npc, null);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(-56594,-56064,-2008,32768));
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (event.equalsIgnoreCase("10"))
|
||||
{
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(-56483,-56665,-2034,32768));
|
||||
npc.broadcastPacket(new PlaySound(1, "TP05_F", 0, 0, 0, 0, 0));
|
||||
startQuestTimer("npc1_1",3000, addSpawn(circus[0],-56495,-56375,-2008,32768,false,101000), null);
|
||||
startQuestTimer("npc2_1",3000, addSpawn(circus[0],-56491,-56289,-2008,32768,false,101000), null);
|
||||
startQuestTimer("npc3_1",3000, addSpawn(circus[1],-56502,-56246,-2008,32768,false,101000), null);
|
||||
startQuestTimer("npc4_1",3000, addSpawn(circus[1],-56496,-56429,-2008,32768,false,101000), null);
|
||||
startQuestTimer("npc5_1",3500, addSpawn(circus[2],-56505,-56334,-2008,32768,false,101000), null);
|
||||
startQuestTimer("npc6_1",4000, addSpawn(circus[3],-56545,-56427,-2008,32768,false,101000), null);
|
||||
startQuestTimer("npc7_1",4000, addSpawn(circus[3],-56552,-56248,-2008,32768,false,101000), null);
|
||||
startQuestTimer("npc8_1",3000, addSpawn(circus[4],-56493,-56473,-2008,32768,false,101000), null);
|
||||
startQuestTimer("npc9_1",3000, addSpawn(circus[4],-56504,-56201,-2008,32768,false,101000), null);
|
||||
startQuestTimer("11",100000, npc, null);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("11"))
|
||||
{
|
||||
switch (npc.getNpcId())
|
||||
{
|
||||
case 32433:
|
||||
autoChat(npc,messages[10],1);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(-56698,-56430,-2008,32768));
|
||||
startQuestTimer("12",5000, npc, null);
|
||||
break;
|
||||
default:
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(-56343,-56330,-2008,32768));
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (event.equalsIgnoreCase("14"))
|
||||
{
|
||||
startQuestTimer("social1",2000, addSpawn(individuals[0],-56700,-56385,-2008,32768,false,49000), null);
|
||||
startQuestTimer("15",7000, npc, null);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("17"))
|
||||
{
|
||||
autoChat(npc,messages[15],1);
|
||||
startQuestTimer("social1",2000,addSpawn(individuals[1],-56700,-56340,-2008,32768,false,32000), null);
|
||||
startQuestTimer("18",9000, npc, null);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("20"))
|
||||
{
|
||||
startQuestTimer("social1",2000, addSpawn(individuals[2],-56703,-56296,-2008,32768,false,13000), null);
|
||||
startQuestTimer("21",8000, npc, null);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("23"))
|
||||
{
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(-56702,-56340,-2008,32768));
|
||||
startQuestTimer("24",2800, npc, null);
|
||||
addSpawn(showstuff[0],-56672,-56406,-2000,32768,false,20900);
|
||||
addSpawn(showstuff[1],-56648,-56368,-2000,32768,false,20900);
|
||||
addSpawn(showstuff[2],-56608,-56338,-2000,32768,false,20900);
|
||||
addSpawn(showstuff[3],-56652,-56307,-2000,32768,false,20900);
|
||||
addSpawn(showstuff[4],-56672,-56272,-2000,32768,false,20900);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("28"))
|
||||
{
|
||||
autoChat(npc,messages[22],0);
|
||||
startQuestTimer("social1",1, npc, null);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("29"))
|
||||
{
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(-56730,-56340,-2008,32768));
|
||||
startQuestTimer("clean_npc",4100, npc, null);
|
||||
startQuestTimer("timer_check",60000, null, null, true);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("social1"))
|
||||
npc.broadcastPacket(new SocialAction(npc,1));
|
||||
else if (event.equalsIgnoreCase("clean_npc"))
|
||||
{
|
||||
isStarted = false;
|
||||
npc.deleteMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (talks.containsKey(event))
|
||||
{
|
||||
int stringId = (Integer) talks.get(event)[0];
|
||||
String nextEvent = (String) talks.get(event)[1];
|
||||
int time = (Integer) talks.get(event)[2];
|
||||
autoChat(npc,stringId,1);
|
||||
startQuestTimer(nextEvent,time, npc, null);
|
||||
}
|
||||
else if (walks.containsKey(event))
|
||||
{
|
||||
int x = (Integer) walks.get(event)[0];
|
||||
int y = (Integer) walks.get(event)[1];
|
||||
int z = (Integer) walks.get(event)[2];
|
||||
String nextEvent = (String) walks.get(event)[3];
|
||||
int time = (Integer) walks.get(event)[4];
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(x,y,z,0));
|
||||
startQuestTimer(nextEvent,time, npc, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// now call the constructor (starts up the ai)
|
||||
new MC_Show(-1,"MC_Show","fantasy_isle");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package ai.fantasy_isle;
|
||||
|
||||
import com.l2jserver.gameserver.instancemanager.QuestManager;
|
||||
|
||||
public class StartMCShow implements Runnable
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
QuestManager.getInstance().getQuest("MC_Show").notifyEvent("Start", null, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,448 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javolution.util.FastMap;
|
||||
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.datatables.NpcTable;
|
||||
import com.l2jserver.gameserver.datatables.SkillTable;
|
||||
import com.l2jserver.gameserver.idfactory.IdFactory;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2TamedBeastInstance;
|
||||
import com.l2jserver.gameserver.model.quest.QuestState;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.AbstractNpcInfo;
|
||||
import com.l2jserver.gameserver.network.serverpackets.MyTargetSelected;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SocialAction;
|
||||
import com.l2jserver.gameserver.network.serverpackets.StatusUpdate;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jserver.gameserver.skills.SkillHolder;
|
||||
import com.l2jserver.gameserver.templates.chars.L2NpcTemplate;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
/**
|
||||
* Growth-capable mobs: Polymorphing upon successful feeding.
|
||||
* @author Fulminus
|
||||
* Updated to Freya by Gigiikun
|
||||
*/
|
||||
public class BeastFarm extends L2AttackableAIScript
|
||||
{
|
||||
private static final int GOLDEN_SPICE = 15474;
|
||||
private static final int CRYSTAL_SPICE = 15475;
|
||||
private static final int SKILL_GOLDEN_SPICE = 9049;
|
||||
private static final int SKILL_CRYSTAL_SPICE = 9050;
|
||||
private static final int SKILL_BLESSED_GOLDEN_SPICE = 9051;
|
||||
private static final int SKILL_BLESSED_CRYSTAL_SPICE = 9052;
|
||||
private static final int SKILL_SGRADE_GOLDEN_SPICE = 9053;
|
||||
private static final int SKILL_SGRADE_CRYSTAL_SPICE = 9054;
|
||||
private static final int[] TAMED_BEASTS = { 18869, 18870, 18871, 18872 };
|
||||
private static final int TAME_CHANCE = 20;
|
||||
private static final int[] SPECIAL_SPICE_CHANCES = { 33, 75 };
|
||||
|
||||
// all mobs that can eat...
|
||||
private static final int[] FEEDABLE_BEASTS = {
|
||||
18873, 18874, 18875, 18876, 18877, 18878, 18879, 18880, 18881, 18882,
|
||||
18883, 18884, 18885, 18886, 18887, 18888, 18889, 18890, 18891, 18892,
|
||||
18893, 18894, 18895, 18896, 18897, 18898, 18899, 18900
|
||||
};
|
||||
|
||||
private static Map<Integer,Integer> _FeedInfo = new FastMap<Integer,Integer>();
|
||||
private static Map<Integer,GrowthCapableMob> _GrowthCapableMobs = new FastMap<Integer,GrowthCapableMob>();
|
||||
private static Map<String, SkillHolder[]> _TamedBeastsData = new FastMap<String, SkillHolder[]>();
|
||||
|
||||
// all mobs that grow by eating
|
||||
private static class GrowthCapableMob
|
||||
{
|
||||
private int _chance;
|
||||
private int _growthLevel;
|
||||
private int _tameNpcId;
|
||||
private Map<Integer,Integer> _skillSuccessNpcIdList = new FastMap<Integer,Integer>();
|
||||
|
||||
public GrowthCapableMob(int chance, int growthLevel, int tameNpcId)
|
||||
{
|
||||
_chance = chance;
|
||||
_growthLevel = growthLevel;
|
||||
_tameNpcId = tameNpcId;
|
||||
}
|
||||
|
||||
public void addNpcIdForSkillId(int skillId, int npcId)
|
||||
{
|
||||
_skillSuccessNpcIdList.put(skillId, npcId);
|
||||
}
|
||||
|
||||
public int getGrowthLevel()
|
||||
{
|
||||
return _growthLevel;
|
||||
}
|
||||
|
||||
public int getLeveledNpcId(int skillId)
|
||||
{
|
||||
if (!_skillSuccessNpcIdList.containsKey(skillId))
|
||||
return -1;
|
||||
else if (skillId == SKILL_BLESSED_GOLDEN_SPICE || skillId == SKILL_BLESSED_CRYSTAL_SPICE
|
||||
|| skillId == SKILL_SGRADE_GOLDEN_SPICE || skillId == SKILL_SGRADE_CRYSTAL_SPICE)
|
||||
{
|
||||
if (Rnd.get(100) < SPECIAL_SPICE_CHANCES[0])
|
||||
{
|
||||
if (Rnd.get(100) < SPECIAL_SPICE_CHANCES[1])
|
||||
return _skillSuccessNpcIdList.get(skillId);
|
||||
else if (skillId == SKILL_BLESSED_GOLDEN_SPICE || skillId == SKILL_SGRADE_GOLDEN_SPICE)
|
||||
return _skillSuccessNpcIdList.get(SKILL_GOLDEN_SPICE);
|
||||
else
|
||||
return _skillSuccessNpcIdList.get(SKILL_CRYSTAL_SPICE);
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
else if (_growthLevel == 2 && Rnd.get(100) < TAME_CHANCE)
|
||||
return _tameNpcId;
|
||||
else if (Rnd.get(100) < _chance)
|
||||
return _skillSuccessNpcIdList.get(skillId);
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public BeastFarm (int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
this.registerMobs(FEEDABLE_BEASTS, QuestEventType.ON_KILL, QuestEventType.ON_SKILL_SEE);
|
||||
|
||||
GrowthCapableMob temp;
|
||||
|
||||
// Kookabura
|
||||
temp = new GrowthCapableMob(100, 0, 18869);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18874);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18875);
|
||||
temp.addNpcIdForSkillId(SKILL_BLESSED_GOLDEN_SPICE, 18869);
|
||||
temp.addNpcIdForSkillId(SKILL_BLESSED_CRYSTAL_SPICE, 18869);
|
||||
temp.addNpcIdForSkillId(SKILL_SGRADE_GOLDEN_SPICE, 18878);
|
||||
temp.addNpcIdForSkillId(SKILL_SGRADE_CRYSTAL_SPICE, 18879);
|
||||
_GrowthCapableMobs.put(18873, temp);
|
||||
|
||||
temp = new GrowthCapableMob(40, 1, 18869);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18876);
|
||||
_GrowthCapableMobs.put(18874, temp);
|
||||
|
||||
temp = new GrowthCapableMob(40, 1, 18869);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18877);
|
||||
_GrowthCapableMobs.put(18875, temp);
|
||||
|
||||
temp = new GrowthCapableMob(25, 2, 18869);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18878);
|
||||
_GrowthCapableMobs.put(18876, temp);
|
||||
|
||||
temp = new GrowthCapableMob(25, 2, 18869);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18879);
|
||||
_GrowthCapableMobs.put(18877, temp);
|
||||
|
||||
// Cougar
|
||||
temp = new GrowthCapableMob(100, 0, 18870);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18881);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18882);
|
||||
temp.addNpcIdForSkillId(SKILL_BLESSED_GOLDEN_SPICE, 18870);
|
||||
temp.addNpcIdForSkillId(SKILL_BLESSED_CRYSTAL_SPICE, 18870);
|
||||
temp.addNpcIdForSkillId(SKILL_SGRADE_GOLDEN_SPICE, 18885);
|
||||
temp.addNpcIdForSkillId(SKILL_SGRADE_CRYSTAL_SPICE, 18886);
|
||||
_GrowthCapableMobs.put(18880, temp);
|
||||
|
||||
temp = new GrowthCapableMob(40, 1, 18870);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18883);
|
||||
_GrowthCapableMobs.put(18881, temp);
|
||||
|
||||
temp = new GrowthCapableMob(40, 1, 18870);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18884);
|
||||
_GrowthCapableMobs.put(18882, temp);
|
||||
|
||||
temp = new GrowthCapableMob(25, 2, 18870);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18885);
|
||||
_GrowthCapableMobs.put(18883, temp);
|
||||
|
||||
temp = new GrowthCapableMob(25, 2, 18870);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18886);
|
||||
_GrowthCapableMobs.put(18884, temp);
|
||||
|
||||
// Buffalo
|
||||
temp = new GrowthCapableMob(100, 0, 18871);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18888);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18889);
|
||||
temp.addNpcIdForSkillId(SKILL_BLESSED_GOLDEN_SPICE, 18871);
|
||||
temp.addNpcIdForSkillId(SKILL_BLESSED_CRYSTAL_SPICE, 18871);
|
||||
temp.addNpcIdForSkillId(SKILL_SGRADE_GOLDEN_SPICE, 18892);
|
||||
temp.addNpcIdForSkillId(SKILL_SGRADE_CRYSTAL_SPICE, 18893);
|
||||
_GrowthCapableMobs.put(18887, temp);
|
||||
|
||||
temp = new GrowthCapableMob(40, 1, 18871);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18890);
|
||||
_GrowthCapableMobs.put(18888, temp);
|
||||
|
||||
temp = new GrowthCapableMob(40, 1, 18871);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18891);
|
||||
_GrowthCapableMobs.put(18889, temp);
|
||||
|
||||
temp = new GrowthCapableMob(25, 2, 18871);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18892);
|
||||
_GrowthCapableMobs.put(18890, temp);
|
||||
|
||||
temp = new GrowthCapableMob(25, 2, 18871);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18893);
|
||||
_GrowthCapableMobs.put(18891, temp);
|
||||
|
||||
// Grendel
|
||||
temp = new GrowthCapableMob(100, 0, 18872);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18895);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18896);
|
||||
temp.addNpcIdForSkillId(SKILL_BLESSED_GOLDEN_SPICE, 18872);
|
||||
temp.addNpcIdForSkillId(SKILL_BLESSED_CRYSTAL_SPICE, 18872);
|
||||
temp.addNpcIdForSkillId(SKILL_SGRADE_GOLDEN_SPICE, 18899);
|
||||
temp.addNpcIdForSkillId(SKILL_SGRADE_CRYSTAL_SPICE, 18900);
|
||||
_GrowthCapableMobs.put(18894, temp);
|
||||
|
||||
temp = new GrowthCapableMob(40, 1, 18872);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18897);
|
||||
_GrowthCapableMobs.put(18895, temp);
|
||||
|
||||
temp = new GrowthCapableMob(40, 1, 18872);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18898);
|
||||
_GrowthCapableMobs.put(18896, temp);
|
||||
|
||||
temp = new GrowthCapableMob(25, 2, 18872);
|
||||
temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18899);
|
||||
_GrowthCapableMobs.put(18897, temp);
|
||||
|
||||
temp = new GrowthCapableMob(25, 2, 18872);
|
||||
temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18900);
|
||||
_GrowthCapableMobs.put(18898, temp);
|
||||
|
||||
// Tamed beasts data
|
||||
SkillHolder[] stemp = new SkillHolder[2];
|
||||
stemp[0] = new SkillHolder(6432,1);
|
||||
stemp[1] = new SkillHolder(6668,1);
|
||||
_TamedBeastsData.put("%name% of Focus", stemp);
|
||||
|
||||
stemp = new SkillHolder[2];
|
||||
stemp[0] = new SkillHolder(6433,1);
|
||||
stemp[1] = new SkillHolder(6670,1);
|
||||
_TamedBeastsData.put("%name% of Guiding", stemp);
|
||||
|
||||
stemp = new SkillHolder[2];
|
||||
stemp[0] = new SkillHolder(6434,1);
|
||||
stemp[1] = new SkillHolder(6667,1);
|
||||
_TamedBeastsData.put("%name% of Swifth", stemp);
|
||||
|
||||
stemp = new SkillHolder[1];
|
||||
stemp[0] = new SkillHolder(6671,1);
|
||||
_TamedBeastsData.put("Berserker %name%", stemp);
|
||||
|
||||
stemp = new SkillHolder[2];
|
||||
stemp[0] = new SkillHolder(6669,1);
|
||||
stemp[1] = new SkillHolder(6672,1);
|
||||
_TamedBeastsData.put("%name% of Protect", stemp);
|
||||
|
||||
stemp = new SkillHolder[2];
|
||||
stemp[0] = new SkillHolder(6431,1);
|
||||
stemp[1] = new SkillHolder(6666,1);
|
||||
_TamedBeastsData.put("%name% of Vigor", stemp);
|
||||
}
|
||||
|
||||
public void spawnNext(L2Npc npc, L2PcInstance player, int nextNpcId, int food)
|
||||
{
|
||||
// remove the feedinfo of the mob that got despawned, if any
|
||||
if (_FeedInfo.containsKey(npc.getObjectId()))
|
||||
{
|
||||
if (_FeedInfo.get(npc.getObjectId()) == player.getObjectId())
|
||||
_FeedInfo.remove(npc.getObjectId());
|
||||
}
|
||||
// despawn the old mob
|
||||
//TODO: same code? FIXED?
|
||||
/*if (_GrowthCapableMobs.get(npc.getNpcId()).getGrowthLevel() == 0)
|
||||
{
|
||||
npc.deleteMe();
|
||||
}
|
||||
else
|
||||
{*/
|
||||
npc.deleteMe();
|
||||
//}
|
||||
|
||||
// if this is finally a trained mob, then despawn any other trained mobs that the
|
||||
// player might have and initialize the Tamed Beast.
|
||||
if (Util.contains(TAMED_BEASTS,nextNpcId))
|
||||
{
|
||||
L2NpcTemplate template = NpcTable.getInstance().getTemplate(nextNpcId);
|
||||
L2TamedBeastInstance nextNpc = new L2TamedBeastInstance(IdFactory.getInstance().getNextId(), template, player, food, npc.getX(), npc.getY(), npc.getZ(), true);
|
||||
|
||||
String name = _TamedBeastsData.keySet().toArray(new String[_TamedBeastsData.keySet().size()])[Rnd.get(_TamedBeastsData.size())];
|
||||
SkillHolder[] skillList = _TamedBeastsData.get(name);
|
||||
switch(nextNpcId)
|
||||
{
|
||||
case 18869:
|
||||
name = name.replace("%name%", "Alpine Kookaburra");
|
||||
break;
|
||||
case 18870:
|
||||
name = name.replace("%name%", "Alpine Cougar");
|
||||
break;
|
||||
case 18871:
|
||||
name = name.replace("%name%", "Alpine Buffalo");
|
||||
break;
|
||||
case 18872:
|
||||
name = name.replace("%name%", "Alpine Grendel");
|
||||
break;
|
||||
}
|
||||
nextNpc.setName(name);
|
||||
nextNpc.broadcastPacket(new AbstractNpcInfo.NpcInfo(nextNpc, player));
|
||||
for(SkillHolder sh : skillList)
|
||||
nextNpc.addBeastSkill(SkillTable.getInstance().getInfo(sh.getSkillId(), sh.getSkillLvl()));
|
||||
nextNpc.setRunning();
|
||||
|
||||
QuestState st = player.getQuestState("20_BringUpWithLove");
|
||||
if (st != null && st.getInt("cond") == 1 && st.getQuestItemsCount(7185) == 0 && Rnd.get(10) == 1)
|
||||
{
|
||||
//if player has quest 20 going, give quest item
|
||||
//it's easier to hardcode it in here than to try and repeat this stuff in the quest
|
||||
st.giveItems(7185,1);
|
||||
st.set("cond","2");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// if not trained, the newly spawned mob will automatically be agro against its feeder
|
||||
// (what happened to "never bite the hand that feeds you" anyway?!)
|
||||
L2Attackable nextNpc = (L2Attackable) this.addSpawn(nextNpcId,npc);
|
||||
|
||||
// register the player in the feedinfo for the mob that just spawned
|
||||
_FeedInfo.put(nextNpc.getObjectId(),player.getObjectId());
|
||||
nextNpc.setRunning();
|
||||
nextNpc.addDamageHate(player,0,99999);
|
||||
nextNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
|
||||
player.sendPacket(new MyTargetSelected(nextNpc.getObjectId(), player.getLevel() - nextNpc.getLevel()));
|
||||
StatusUpdate su = new StatusUpdate(nextNpc);
|
||||
su.addAttribute(StatusUpdate.CUR_HP, (int) nextNpc.getCurrentHp());
|
||||
su.addAttribute(StatusUpdate.MAX_HP, nextNpc.getMaxHp());
|
||||
player.sendPacket(su);
|
||||
player.setTarget(nextNpc);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSkillSee (L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet)
|
||||
{
|
||||
// this behavior is only run when the target of skill is the passed npc (chest)
|
||||
// i.e. when the player is attempting to open the chest using a skill
|
||||
if (!Util.contains(targets,npc))
|
||||
{
|
||||
return super.onSkillSee(npc,caster,skill,targets,isPet);
|
||||
}
|
||||
// gather some values on local variables
|
||||
int npcId = npc.getNpcId();
|
||||
int skillId = skill.getId();
|
||||
// check if the npc and skills used are valid for this script. Exit if invalid.
|
||||
if (!Util.contains(FEEDABLE_BEASTS,npcId)
|
||||
|| (skillId !=SKILL_GOLDEN_SPICE && skillId != SKILL_CRYSTAL_SPICE
|
||||
&& skillId !=SKILL_BLESSED_GOLDEN_SPICE && skillId != SKILL_BLESSED_CRYSTAL_SPICE
|
||||
&& skillId !=SKILL_SGRADE_GOLDEN_SPICE && skillId != SKILL_SGRADE_CRYSTAL_SPICE))
|
||||
{
|
||||
return super.onSkillSee(npc,caster,skill,targets,isPet);
|
||||
}
|
||||
|
||||
// first gather some values on local variables
|
||||
int objectId = npc.getObjectId();
|
||||
int growthLevel = 3; // if a mob is in FEEDABLE_BEASTS but not in _GrowthCapableMobs, then it's at max growth (3)
|
||||
if (_GrowthCapableMobs.containsKey(npcId))
|
||||
{
|
||||
growthLevel = _GrowthCapableMobs.get(npcId).getGrowthLevel();
|
||||
}
|
||||
|
||||
// prevent exploit which allows 2 players to simultaneously raise the same 0-growth beast
|
||||
// If the mob is at 0th level (when it still listens to all feeders) lock it to the first feeder!
|
||||
if (growthLevel == 0 && _FeedInfo.containsKey(objectId))
|
||||
{
|
||||
return super.onSkillSee(npc,caster,skill,targets,isPet);
|
||||
}
|
||||
else
|
||||
{
|
||||
_FeedInfo.put(objectId,caster.getObjectId());
|
||||
}
|
||||
|
||||
// display the social action of the beast eating the food.
|
||||
npc.broadcastPacket(new SocialAction(npc,2));
|
||||
|
||||
int food = 0;
|
||||
if (skillId == SKILL_GOLDEN_SPICE || skillId == SKILL_BLESSED_GOLDEN_SPICE)
|
||||
{
|
||||
food = GOLDEN_SPICE;
|
||||
}
|
||||
else if (skillId == SKILL_CRYSTAL_SPICE || skillId == SKILL_BLESSED_CRYSTAL_SPICE)
|
||||
{
|
||||
food = CRYSTAL_SPICE;
|
||||
}
|
||||
|
||||
// if this pet can't grow, it's all done.
|
||||
if (_GrowthCapableMobs.containsKey(npcId))
|
||||
{
|
||||
// do nothing if this mob doesn't eat the specified food (food gets consumed but has no effect).
|
||||
int newNpcId = _GrowthCapableMobs.get(npcId).getLeveledNpcId(skillId);
|
||||
if (newNpcId == -1)
|
||||
{
|
||||
if (growthLevel == 0)
|
||||
{
|
||||
_FeedInfo.remove(objectId);
|
||||
npc.setRunning();
|
||||
((L2Attackable)npc).addDamageHate(caster,0,1);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, caster);
|
||||
}
|
||||
return super.onSkillSee(npc,caster,skill,targets,isPet);
|
||||
}
|
||||
else if (growthLevel > 0 && _FeedInfo.get(objectId) != caster.getObjectId())
|
||||
{
|
||||
// check if this is the same player as the one who raised it from growth 0.
|
||||
// if no, then do not allow a chance to raise the pet (food gets consumed but has no effect).
|
||||
return super.onSkillSee(npc,caster,skill,targets,isPet);
|
||||
}
|
||||
spawnNext(npc,caster,newNpcId,food);
|
||||
}
|
||||
else
|
||||
{
|
||||
caster.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1).addString("The beast spit out the feed instead of eating it."));
|
||||
((L2Attackable)npc).dropItem(caster, food, 1);
|
||||
}
|
||||
return super.onSkillSee(npc,caster,skill,targets,isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill (L2Npc npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
// remove the feedinfo of the mob that got killed, if any
|
||||
if (_FeedInfo.containsKey(npc.getObjectId()))
|
||||
{
|
||||
_FeedInfo.remove(npc.getObjectId());
|
||||
}
|
||||
return super.onKill(npc,killer,isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// now call the constructor (starts up the ai)
|
||||
new BeastFarm(-1,"beast_farm","ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2ChestInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
/**
|
||||
* Chest AI implementation.
|
||||
* @author Fulminus
|
||||
*/
|
||||
public class Chests extends L2AttackableAIScript
|
||||
{
|
||||
|
||||
private static final int SKILL_DELUXE_KEY = 2229;
|
||||
|
||||
//Base chance for BOX to be opened
|
||||
private static final int BASE_CHANCE = 100;
|
||||
|
||||
// Percent to decrease base chance when grade of DELUXE key not match
|
||||
private static final int LEVEL_DECREASE = 40;
|
||||
|
||||
// Chance for a chest to actually be a BOX (as opposed to being a mimic).
|
||||
private static final int IS_BOX = 40;
|
||||
|
||||
private static final int[] NPC_IDS = { 18265,18266,18267,18268,18269,18270,18271,
|
||||
18272,18273,18274,18275,18276,18277,18278,18279,18280,18281,
|
||||
18282,18283,18284,18285,18286,18287,18288,18289,18290,18291,
|
||||
18292,18293,18294,18295,18296,18297,18298,21671,21694,21717,
|
||||
21740,21763,21786,21801,21802,21803,21804,21805,21806,21807,
|
||||
21808,21809,21810,21811,21812,21813,21814,21815,21816,21817,
|
||||
21818,21819,21820,21821,21822 };
|
||||
|
||||
public Chests(int questId, String name, String descr)
|
||||
{
|
||||
// firstly, don't forget to call the parent constructor to prepare the event triggering
|
||||
// mechanisms etc.
|
||||
super(questId, name, descr);
|
||||
this.registerMobs(NPC_IDS, QuestEventType.ON_ATTACK, QuestEventType.ON_SKILL_SEE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSkillSee (L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet)
|
||||
{
|
||||
if (npc instanceof L2ChestInstance)
|
||||
{
|
||||
// this behavior is only run when the target of skill is the passed npc (chest)
|
||||
// i.e. when the player is attempting to open the chest using a skill
|
||||
if (!Util.contains(targets,npc))
|
||||
{
|
||||
return super.onSkillSee(npc,caster,skill,targets,isPet);
|
||||
}
|
||||
L2ChestInstance chest = ((L2ChestInstance)npc);
|
||||
int npcId = chest.getNpcId();
|
||||
int skillId = skill.getId();
|
||||
int skillLevel= skill.getLevel();
|
||||
|
||||
// check if the chest and skills used are valid for this script. Exit if invalid.
|
||||
if (!Util.contains(NPC_IDS,npcId))
|
||||
{
|
||||
return super.onSkillSee(npc,caster,skill,targets,isPet);
|
||||
}
|
||||
// if this has already been interacted, no further ai decisions are needed
|
||||
// if it's the first interaction, check if this is a box or mimic
|
||||
if (!chest.isInteracted())
|
||||
{
|
||||
chest.setInteracted();
|
||||
if (Rnd.get(100) < IS_BOX)
|
||||
{
|
||||
// if it's a box, either it will be successfully openned by a proper key, or instantly disappear
|
||||
if (skillId == SKILL_DELUXE_KEY)
|
||||
{
|
||||
// check the chance to open the box
|
||||
int keyLevelNeeded = chest.getLevel()/10;
|
||||
keyLevelNeeded -= skillLevel;
|
||||
if (keyLevelNeeded < 0)
|
||||
keyLevelNeeded *= -1;
|
||||
int chance = BASE_CHANCE - keyLevelNeeded * LEVEL_DECREASE;
|
||||
|
||||
// success, pretend-death with rewards: chest.reduceCurrentHp(99999999, player)
|
||||
if (Rnd.get(100) < chance)
|
||||
{
|
||||
chest.setMustRewardExpSp(false);
|
||||
chest.setSpecialDrop();
|
||||
chest.reduceCurrentHp(99999999, caster, null);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// used a skill other than chest-key, or used a chest-key but failed to open: disappear with no rewards
|
||||
chest.deleteMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
L2Character originalCaster = isPet? caster.getPet(): caster;
|
||||
chest.setRunning();
|
||||
chest.addDamageHate(originalCaster,0,999);
|
||||
chest.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, originalCaster);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onSkillSee(npc,caster,skill,targets,isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack (L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (npc instanceof L2ChestInstance)
|
||||
{
|
||||
L2ChestInstance chest = ((L2ChestInstance)npc);
|
||||
int npcId = chest.getNpcId();
|
||||
// check if the chest and skills used are valid for this script. Exit if invalid.
|
||||
if (!Util.contains(NPC_IDS, npcId))
|
||||
{
|
||||
return super.onAttack(npc,attacker,damage,isPet);
|
||||
}
|
||||
|
||||
// if this was a mimic, set the target, start the skills and become agro
|
||||
if (!chest.isInteracted())
|
||||
{
|
||||
chest.setInteracted();
|
||||
if (Rnd.get(100) < IS_BOX)
|
||||
{
|
||||
chest.deleteMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
// if this weren't a box, upon interaction start the mimic behaviors...
|
||||
// todo: perhaps a self-buff (skill id 4245) with random chance goes here?
|
||||
L2Character originalAttacker = isPet? attacker.getPet(): attacker;
|
||||
chest.setRunning();
|
||||
chest.addDamageHate(originalAttacker,0,(damage*100)/(chest.getLevel()+7));
|
||||
chest.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, originalAttacker);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc,attacker,damage,isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// now call the constructor (starts up the ai)
|
||||
new Chests(-1,"chests","ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,239 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.datatables.SkillTable;
|
||||
import com.l2jserver.gameserver.instancemanager.ZoneManager;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.L2Playable;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.zone.type.L2EffectZone;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
/**
|
||||
** @author Gnacik
|
||||
**
|
||||
** Dummy AI for spawns/respawns only for testing.
|
||||
*/
|
||||
|
||||
public class DenOfEvil extends L2AttackableAIScript
|
||||
{
|
||||
// private static final int _buffer_id = 32656;
|
||||
|
||||
private static final int[] _eye_ids = { 18812, 18813, 18814 };
|
||||
private static final int _skill_id = 6150; // others +2
|
||||
|
||||
private static final int[][] _eye_spawn =
|
||||
{
|
||||
{ 71544, -129400, -3360, 16472 },
|
||||
{ 70954, -128854, -3360, 16 },
|
||||
{ 72145, -128847, -3368, 32832 },
|
||||
{ 76147, -128372, -3144, 16152 },
|
||||
{ 71573, -128309, -3360, 49152 },
|
||||
{ 75211, -127441, -3152, 0 },
|
||||
{ 77005, -127406, -3144, 32784 },
|
||||
{ 75965, -126486, -3144, 49120 },
|
||||
{ 70972, -126429, -3016, 19208 },
|
||||
{ 69916, -125838, -3024, 2840 },
|
||||
{ 71658, -125459, -3016, 35136 },
|
||||
{ 70605, -124646, -3040, 52104 },
|
||||
{ 67283, -123237, -2912, 12376 },
|
||||
{ 68383, -122754, -2912, 27904 },
|
||||
{ 74137, -122733, -3024, 13272 },
|
||||
{ 66736, -122007, -2896, 60576 },
|
||||
{ 73289, -121769, -3024, 1024 },
|
||||
{ 67894, -121491, -2912, 43872 },
|
||||
{ 75530, -121477, -3008, 34424 },
|
||||
{ 74117, -120459, -3024, 52344 },
|
||||
{ 69608, -119855, -2534, 17251 },
|
||||
{ 71014, -119027, -2520, 31904 },
|
||||
{ 68944, -118964, -2527, 59874 },
|
||||
{ 62261, -118263, -3072, 12888 },
|
||||
{ 70300, -117942, -2528, 46208 },
|
||||
{ 74312, -117583, -2272, 15280 },
|
||||
{ 63276, -117409, -3064, 24760 },
|
||||
{ 68104, -117192, -2168, 15888 },
|
||||
{ 73758, -116945, -2216, 0 },
|
||||
{ 74944, -116858, -2220, 30892 },
|
||||
{ 61715, -116623, -3064, 59888 },
|
||||
{ 69140, -116464, -2168, 28952 },
|
||||
{ 67311, -116374, -2152, 1280 },
|
||||
{ 62459, -116370, -3064, 48624 },
|
||||
{ 74475, -116260, -2216, 47456 },
|
||||
{ 68333, -115015, -2168, 45136 },
|
||||
{ 68280, -108129, -1160, 17992 },
|
||||
{ 62983, -107259, -2384, 12552 },
|
||||
{ 67062, -107125, -1144, 64008 },
|
||||
{ 68893, -106954, -1160, 36704 },
|
||||
{ 63848, -106771, -2384, 32784 },
|
||||
{ 62372, -106514, -2384, 0 },
|
||||
{ 67838, -106143, -1160, 51232 },
|
||||
{ 62905, -106109, -2384, 51288 }
|
||||
};
|
||||
|
||||
private int getSkillIdByNpcId(int npcId)
|
||||
{
|
||||
int diff = npcId - _eye_ids[0];
|
||||
diff *= 2;
|
||||
return _skill_id + diff;
|
||||
}
|
||||
|
||||
public DenOfEvil(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
|
||||
registerMobs(_eye_ids, QuestEventType.ON_KILL, QuestEventType.ON_SPAWN);
|
||||
|
||||
spawnEyes();
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new DenOfEvil(-1, "DenOfEvil", "ai");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
if (Util.contains(_eye_ids, npc.getNpcId()))
|
||||
{
|
||||
npc.disableCoreAI(true);
|
||||
npc.setIsImmobilized(true);
|
||||
L2EffectZone zone = ZoneManager.getInstance().getZone(npc, L2EffectZone.class);
|
||||
if (zone == null)
|
||||
{
|
||||
_log.warning("NPC "+npc+" spawned outside of L2EffectZone, check your zone coords! X:"+npc.getX()+" Y:"+npc.getY()+" Z:"+npc.getZ());
|
||||
return null;
|
||||
}
|
||||
int skillId = getSkillIdByNpcId(npc.getNpcId());
|
||||
int skillLevel = zone.getSkillLevel(skillId);
|
||||
zone.addSkill(skillId, skillLevel+1);
|
||||
if (skillLevel == 3) // 3+1=4
|
||||
{
|
||||
ThreadPoolManager.getInstance().scheduleAi(new KashaDestruction(zone), 2*60*1000l);
|
||||
zone.broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.KASHA_EYE_PITCHES_TOSSES_EXPLODE));
|
||||
}
|
||||
else if (skillLevel == 2) // 2+1=3
|
||||
zone.broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.I_CAN_FEEL_ENERGY_KASHA_EYE_GETTING_STRONGER_RAPIDLY));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
if (Util.contains(_eye_ids, npc.getNpcId()))
|
||||
{
|
||||
ThreadPoolManager.getInstance().scheduleAi(new RespawnNewEye(npc.getX(), npc.getY(), npc.getZ(), npc.getHeading()), 15000);
|
||||
L2EffectZone zone = ZoneManager.getInstance().getZone(npc, L2EffectZone.class);
|
||||
if (zone == null)
|
||||
{
|
||||
_log.warning("NPC "+npc+" killed outside of L2EffectZone, check your zone coords! X:"+npc.getX()+" Y:"+npc.getY()+" Z:"+npc.getZ());
|
||||
return null;
|
||||
}
|
||||
int skillId = getSkillIdByNpcId(npc.getNpcId());
|
||||
int skillLevel = zone.getSkillLevel(skillId);
|
||||
zone.addSkill(skillId, skillLevel - 1);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void spawnEyes()
|
||||
{
|
||||
for(int[] _spawn : _eye_spawn)
|
||||
addSpawn(_eye_ids[Rnd.get(0, _eye_ids.length-1)], _spawn[0], _spawn[1], _spawn[2], _spawn[3], false, 0);
|
||||
}
|
||||
|
||||
private class RespawnNewEye implements Runnable
|
||||
{
|
||||
private int _x, _y, _z, _h;
|
||||
|
||||
public RespawnNewEye(int x, int y, int z, int h) {
|
||||
_x = x;
|
||||
_y = y;
|
||||
_z = z;
|
||||
_h = h;
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
addSpawn(_eye_ids[Rnd.get(0, _eye_ids.length-1)], _x, _y, _z, _h, false, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private class KashaDestruction implements Runnable
|
||||
{
|
||||
L2EffectZone _zone;
|
||||
|
||||
public KashaDestruction(L2EffectZone zone)
|
||||
{
|
||||
_zone = zone;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
for (int i = _skill_id; i <= _skill_id + 4; i = i + 2 )
|
||||
{
|
||||
// test 3 skills if some is lvl 4
|
||||
if (_zone.getSkillLevel(i) > 3)
|
||||
{
|
||||
destroyZone();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void destroyZone()
|
||||
{
|
||||
for (L2Character character : _zone.getCharactersInside().values())
|
||||
{
|
||||
if (character == null)
|
||||
continue;
|
||||
if (character instanceof L2Playable)
|
||||
{
|
||||
L2Skill skill = SkillTable.getInstance().getInfo(6149, 1);
|
||||
skill.getEffects(character, character); // apply effect
|
||||
}
|
||||
else
|
||||
{
|
||||
if (character.doDie(null)) // mobs die
|
||||
{
|
||||
if (character instanceof L2Npc)
|
||||
{
|
||||
// respawn eye
|
||||
L2Npc npc = (L2Npc) character;
|
||||
if (Util.contains(_eye_ids, npc.getNpcId()))
|
||||
ThreadPoolManager.getInstance().scheduleAi(new RespawnNewEye(npc.getX(), npc.getY(), npc.getZ(), npc.getHeading()), 15000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = _skill_id; i <= _skill_id + 4; i = i + 2 )
|
||||
{
|
||||
_zone.removeSkill(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,727 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javolution.util.FastMap;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.datatables.DoorTable;
|
||||
import com.l2jserver.gameserver.datatables.NpcTable;
|
||||
import com.l2jserver.gameserver.idfactory.IdFactory;
|
||||
import com.l2jserver.gameserver.instancemanager.GraciaSeedsManager;
|
||||
import com.l2jserver.gameserver.instancemanager.ZoneManager;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.quest.QuestState;
|
||||
import com.l2jserver.gameserver.model.zone.L2ZoneType;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jserver.gameserver.templates.chars.L2NpcTemplate;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
public class EnergySeeds extends L2AttackableAIScript
|
||||
{
|
||||
private static final String qn = "EnergySeeds";
|
||||
private static final String HOWTOOPPOSEEVIL = "Q692_HowtoOpposeEvil";
|
||||
private static final int HOWTOOPPOSEEVIL_CHANCE = 60;
|
||||
private static final int RATE = 1;
|
||||
private static final int RESPAWN = 480000;
|
||||
private static final int RANDOM_RESPAWN_OFFSET = 180000;
|
||||
private static Map<Integer, ESSpawn> _spawns = new FastMap<Integer, ESSpawn>();
|
||||
private static Map<L2Npc, Integer> _spawnedNpcs = new FastMap<L2Npc, Integer>().shared();
|
||||
|
||||
private static final int TEMPORARY_TELEPORTER = 32602;
|
||||
private static final int[] SEEDIDS = { 18678, 18679, 18680, 18681, 18682, 18683 };
|
||||
private static final int[][] ANNIHILATION_SUPRISE_MOB_IDS = { {22746,22747,22748,22749},
|
||||
{22754,22755,22756}, {22760,22761,22762}
|
||||
};
|
||||
|
||||
private static int[] SEED_OF_DESTRUCTION_DOORS =
|
||||
{
|
||||
12240003,12240004,12240005,12240006,12240007,12240008,
|
||||
12240009,12240010,12240011,12240012,12240013,12240014,
|
||||
12240015,12240016,12240017,12240018,12240019,12240020,
|
||||
12240021,12240022,12240023,12240024,12240025,12240026,
|
||||
12240027,12240028,12240029,12240030,12240031
|
||||
};
|
||||
private static final int SOD_ZONE = 60009;
|
||||
private static final int[] SOD_EXIT_POINT = { -248717, 250260, 4337 };
|
||||
|
||||
private enum GraciaSeeds
|
||||
{
|
||||
INFINITY,
|
||||
DESTRUCTION,
|
||||
ANNIHILATION_BISTAKON,
|
||||
ANNIHILATION_REPTILIKON,
|
||||
ANNIHILATION_COKRAKON
|
||||
}
|
||||
|
||||
private class ESSpawn
|
||||
{
|
||||
private int _spawnId;
|
||||
private GraciaSeeds _seedId;
|
||||
private int[] _npcIds;
|
||||
private int[] _spawnCoords;
|
||||
|
||||
public ESSpawn(int spawnId, GraciaSeeds seedId, int[] spawnCoords, int[] npcIds)
|
||||
{
|
||||
_spawnId = spawnId;
|
||||
_seedId = seedId;
|
||||
_spawnCoords = spawnCoords;
|
||||
_npcIds = npcIds;
|
||||
}
|
||||
|
||||
public void scheduleRespawn(long waitTime)
|
||||
{
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
// if the AI is inactive, do not spawn the NPC
|
||||
if (isSeedActive(_seedId))
|
||||
{
|
||||
//get a random NPC that should spawn at this location
|
||||
Integer spawnId = _spawnId; // the map uses "Integer", not "int"
|
||||
_spawnedNpcs.put(addSpawn(_npcIds[Rnd.get(_npcIds.length)], _spawnCoords[0], _spawnCoords[1], _spawnCoords[2], 0, false, 0), spawnId);
|
||||
}
|
||||
}
|
||||
}, waitTime);
|
||||
}
|
||||
}
|
||||
|
||||
public EnergySeeds(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
registerMobs(SEEDIDS);
|
||||
for(int i : SEEDIDS)
|
||||
addFirstTalkId(i);
|
||||
addFirstTalkId(TEMPORARY_TELEPORTER);
|
||||
addEnterZoneId(SOD_ZONE);
|
||||
addSpawnsToList();
|
||||
startAI();
|
||||
}
|
||||
|
||||
private boolean isSeedActive(GraciaSeeds seed)
|
||||
{
|
||||
switch(seed)
|
||||
{
|
||||
case INFINITY:
|
||||
return false;
|
||||
case DESTRUCTION:
|
||||
return GraciaSeedsManager.getInstance().getSoDState() == 2;
|
||||
case ANNIHILATION_BISTAKON:
|
||||
case ANNIHILATION_REPTILIKON:
|
||||
case ANNIHILATION_COKRAKON:
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSkillSee (L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet)
|
||||
{
|
||||
if (!Util.contains(targets, npc) || skill.getId() != 5780)
|
||||
return super.onSkillSee(npc, caster, skill, targets, isPet);
|
||||
|
||||
npc.deleteMe();
|
||||
|
||||
if (_spawnedNpcs.containsKey(npc) && _spawns.containsKey(_spawnedNpcs.get(npc)))
|
||||
{
|
||||
ESSpawn spawn = _spawns.get(_spawnedNpcs.get(npc));
|
||||
spawn.scheduleRespawn(RESPAWN+Rnd.get(RANDOM_RESPAWN_OFFSET));
|
||||
_spawnedNpcs.remove(npc);
|
||||
if (isSeedActive(spawn._seedId))
|
||||
{
|
||||
int itemId = 0;
|
||||
|
||||
switch(npc.getNpcId())
|
||||
{
|
||||
case 18678: //Water
|
||||
itemId = 14016;
|
||||
break;
|
||||
case 18679: //Fire
|
||||
itemId = 14015;
|
||||
break;
|
||||
case 18680: //Wind
|
||||
itemId = 14017;
|
||||
break;
|
||||
case 18681: //Earth
|
||||
itemId = 14018;
|
||||
break;
|
||||
case 18682: //Divinity
|
||||
itemId = 14020;
|
||||
break;
|
||||
case 18683: //Darkness
|
||||
itemId = 14019;
|
||||
break;
|
||||
default:
|
||||
return super.onSkillSee(npc, caster, skill, targets, isPet);
|
||||
}
|
||||
if (Rnd.get(100) < 33)
|
||||
{
|
||||
caster.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.THE_COLLECTION_HAS_SUCCEEDED));
|
||||
caster.addItem("EnergySeed", itemId, Rnd.get(RATE + 1, 2 * RATE), null, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
caster.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.THE_COLLECTION_HAS_SUCCEEDED));
|
||||
caster.addItem("EnergySeed", itemId, Rnd.get(1, RATE), null, true);
|
||||
}
|
||||
seedCollectEvent(caster, npc, spawn._seedId);
|
||||
}
|
||||
}
|
||||
|
||||
return super.onSkillSee(npc, caster, skill, targets, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent (String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equalsIgnoreCase("StartSoDAi"))
|
||||
{
|
||||
for (int doorId : SEED_OF_DESTRUCTION_DOORS)
|
||||
{
|
||||
L2DoorInstance doorInstance = DoorTable.getInstance().getDoor(doorId);
|
||||
if (doorInstance != null)
|
||||
doorInstance.openMe();
|
||||
}
|
||||
startAI(GraciaSeeds.DESTRUCTION);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("StopSoDAi"))
|
||||
{
|
||||
for (int doorId : SEED_OF_DESTRUCTION_DOORS)
|
||||
{
|
||||
L2DoorInstance doorInstance = DoorTable.getInstance().getDoor(doorId);
|
||||
if (doorInstance != null)
|
||||
doorInstance.closeMe();
|
||||
}
|
||||
for(L2Character chars : ZoneManager.getInstance().getZoneById(SOD_ZONE).getCharactersInside().values())
|
||||
if (chars instanceof L2PcInstance)
|
||||
chars.teleToLocation(SOD_EXIT_POINT[0], SOD_EXIT_POINT[1], SOD_EXIT_POINT[2]);
|
||||
stopAI(GraciaSeeds.DESTRUCTION);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("DeSpawnTask"))
|
||||
{
|
||||
if (npc.isInCombat())
|
||||
startQuestTimer("DeSpawnTask", 30000, npc, null);
|
||||
else
|
||||
npc.deleteMe();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk (L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (npc.getNpcId() == TEMPORARY_TELEPORTER)
|
||||
player.teleToLocation(SOD_EXIT_POINT[0], SOD_EXIT_POINT[1], SOD_EXIT_POINT[2]);
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
|
||||
{
|
||||
if (_spawnedNpcs.containsKey(npc) && _spawns.containsKey(_spawnedNpcs.get(npc)))
|
||||
{
|
||||
_spawns.get(_spawnedNpcs.get(npc)).scheduleRespawn(RESPAWN+Rnd.get(RANDOM_RESPAWN_OFFSET));
|
||||
_spawnedNpcs.remove(npc);
|
||||
}
|
||||
return super.onKill(npc, player, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onEnterZone(L2Character character, L2ZoneType zone)
|
||||
{
|
||||
if (character.getInstanceId() != 0)
|
||||
return super.onEnterZone(character,zone);
|
||||
|
||||
if (character instanceof L2PcInstance)
|
||||
{
|
||||
switch(zone.getId())
|
||||
{
|
||||
case SOD_ZONE:
|
||||
if (!isSeedActive(GraciaSeeds.DESTRUCTION) && !character.isGM())
|
||||
character.teleToLocation(SOD_EXIT_POINT[0], SOD_EXIT_POINT[1], SOD_EXIT_POINT[2]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return super.onEnterZone(character,zone);
|
||||
}
|
||||
|
||||
public void startAI()
|
||||
{
|
||||
// spawn all NPCs
|
||||
for (ESSpawn spawn : _spawns.values())
|
||||
if (isSeedActive(spawn._seedId))
|
||||
spawn.scheduleRespawn(0);
|
||||
}
|
||||
|
||||
public void startAI(GraciaSeeds type)
|
||||
{
|
||||
// spawn all NPCs
|
||||
for (ESSpawn spawn : _spawns.values())
|
||||
if (spawn._seedId == type)
|
||||
spawn.scheduleRespawn(0);
|
||||
}
|
||||
|
||||
public void stopAI(GraciaSeeds type)
|
||||
{
|
||||
for (L2Npc seed : _spawnedNpcs.keySet())
|
||||
if (type == _spawns.get(_spawnedNpcs.get(seed))._seedId)
|
||||
seed.deleteMe();
|
||||
}
|
||||
|
||||
public void seedCollectEvent(L2PcInstance player, L2Npc seedEnergy, GraciaSeeds seedType)
|
||||
{
|
||||
if (player == null)
|
||||
return;
|
||||
QuestState st = player.getQuestState(HOWTOOPPOSEEVIL);
|
||||
switch(seedType)
|
||||
{
|
||||
case INFINITY:
|
||||
if (st != null && st.getInt("cond") == 3)
|
||||
handleQuestDrop(st, 13798);
|
||||
break;
|
||||
case DESTRUCTION:
|
||||
if (st != null && st.getInt("cond") == 3)
|
||||
handleQuestDrop(st, 13867);
|
||||
break;
|
||||
case ANNIHILATION_BISTAKON:
|
||||
if (st != null && st.getInt("cond") == 3)
|
||||
handleQuestDrop(st, 15535);
|
||||
if (Rnd.get(100) < 50)
|
||||
{
|
||||
L2MonsterInstance mob = spawnSupriseMob(seedEnergy,ANNIHILATION_SUPRISE_MOB_IDS[0][Rnd.get(ANNIHILATION_SUPRISE_MOB_IDS[0].length)]);
|
||||
mob.setRunning();
|
||||
mob.addDamageHate(player,0,999);
|
||||
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
break;
|
||||
case ANNIHILATION_REPTILIKON:
|
||||
if (st != null && st.getInt("cond") == 3)
|
||||
handleQuestDrop(st, 15535);
|
||||
if (Rnd.get(100) < 50)
|
||||
{
|
||||
L2MonsterInstance mob = spawnSupriseMob(seedEnergy,ANNIHILATION_SUPRISE_MOB_IDS[1][Rnd.get(ANNIHILATION_SUPRISE_MOB_IDS[1].length)]);
|
||||
mob.setRunning();
|
||||
mob.addDamageHate(player,0,999);
|
||||
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
break;
|
||||
case ANNIHILATION_COKRAKON:
|
||||
if (st != null && st.getInt("cond") == 3)
|
||||
handleQuestDrop(st, 15535);
|
||||
if (Rnd.get(100) < 50)
|
||||
{
|
||||
L2MonsterInstance mob = spawnSupriseMob(seedEnergy,ANNIHILATION_SUPRISE_MOB_IDS[2][Rnd.get(ANNIHILATION_SUPRISE_MOB_IDS[2].length)]);
|
||||
mob.setRunning();
|
||||
mob.addDamageHate(player,0,999);
|
||||
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private L2MonsterInstance spawnSupriseMob(L2Npc energy, int npcId)
|
||||
{
|
||||
// Get the template of the Minion to spawn
|
||||
L2NpcTemplate supriseMobTemplate = NpcTable.getInstance().getTemplate(npcId);
|
||||
|
||||
// Create and Init the Minion and generate its Identifier
|
||||
L2MonsterInstance monster = new L2MonsterInstance(IdFactory.getInstance().getNextId(), supriseMobTemplate);
|
||||
|
||||
// Set the Minion HP, MP and Heading
|
||||
monster.setCurrentHpMp(monster.getMaxHp(), monster.getMaxMp());
|
||||
monster.setHeading(energy.getHeading());
|
||||
|
||||
//move monster to masters instance
|
||||
monster.setInstanceId(energy.getInstanceId());
|
||||
|
||||
monster.setShowSummonAnimation(true);
|
||||
|
||||
monster.spawnMe(energy.getX(), energy.getY(), energy.getZ());
|
||||
|
||||
startQuestTimer("DeSpawnTask", 30000, monster, null);
|
||||
|
||||
return monster;
|
||||
}
|
||||
|
||||
private void handleQuestDrop(QuestState st, int itemId)
|
||||
{
|
||||
double chance = HOWTOOPPOSEEVIL_CHANCE * Config.RATE_QUEST_DROP;
|
||||
int numItems = (int) (chance / 100);
|
||||
chance = chance % 100;
|
||||
if (st.getRandom(100) < chance)
|
||||
numItems++;
|
||||
if (numItems > 0)
|
||||
{
|
||||
st.giveItems(itemId,numItems);
|
||||
st.playSound("ItemSound.quest_itemget");
|
||||
}
|
||||
}
|
||||
|
||||
private void addSpawnsToList()
|
||||
{
|
||||
// Seed of Destruction
|
||||
//Temporary Teleporters
|
||||
_spawns.put(1, new ESSpawn(1, GraciaSeeds.DESTRUCTION, new int[]{-245790,220320,-12104}, new int[]{TEMPORARY_TELEPORTER}));
|
||||
_spawns.put(2, new ESSpawn(2, GraciaSeeds.DESTRUCTION, new int[]{-249770,207300,-11952}, new int[]{TEMPORARY_TELEPORTER}));
|
||||
//Energy Seeds
|
||||
_spawns.put(3, new ESSpawn(3, GraciaSeeds.DESTRUCTION, new int[]{-248360,219272,-12448}, new int[]{18678,18679,18680}));
|
||||
_spawns.put(4, new ESSpawn(4, GraciaSeeds.DESTRUCTION, new int[]{-249448,219256,-12448}, new int[]{18678,18679,18680}));
|
||||
_spawns.put(5, new ESSpawn(5, GraciaSeeds.DESTRUCTION, new int[]{-249432,220872,-12448}, new int[]{18678,18679,18680}));
|
||||
_spawns.put(6, new ESSpawn(6, GraciaSeeds.DESTRUCTION, new int[]{-248360,220888,-12448}, new int[]{18678,18679,18680}));
|
||||
|
||||
_spawns.put(7, new ESSpawn(7, GraciaSeeds.DESTRUCTION, new int[]{-250088,219256,-12448}, new int[]{18681,18682}));
|
||||
_spawns.put(8, new ESSpawn(8, GraciaSeeds.DESTRUCTION, new int[]{-250600,219272,-12448}, new int[]{18681,18682}));
|
||||
_spawns.put(9, new ESSpawn(9, GraciaSeeds.DESTRUCTION, new int[]{-250584,220904,-12448}, new int[]{18681,18682}));
|
||||
_spawns.put(10, new ESSpawn(10, GraciaSeeds.DESTRUCTION, new int[]{-250072,220888,-12448}, new int[]{18681,18682}));
|
||||
|
||||
_spawns.put(11, new ESSpawn(11, GraciaSeeds.DESTRUCTION, new int[]{-253096,217704,-12296}, new int[]{18683,18678}));
|
||||
_spawns.put(12, new ESSpawn(12, GraciaSeeds.DESTRUCTION, new int[]{-253112,217048,-12288}, new int[]{18683,18678}));
|
||||
_spawns.put(13, new ESSpawn(13, GraciaSeeds.DESTRUCTION, new int[]{-251448,217032,-12288}, new int[]{18683,18678}));
|
||||
_spawns.put(14, new ESSpawn(14, GraciaSeeds.DESTRUCTION, new int[]{-251416,217672,-12296}, new int[]{18683,18678}));
|
||||
|
||||
_spawns.put(15, new ESSpawn(15, GraciaSeeds.DESTRUCTION, new int[]{-251416,217672,-12296}, new int[]{18679,18680}));
|
||||
_spawns.put(16, new ESSpawn(16, GraciaSeeds.DESTRUCTION, new int[]{-251416,217016,-12280}, new int[]{18679,18680}));
|
||||
_spawns.put(17, new ESSpawn(17, GraciaSeeds.DESTRUCTION, new int[]{-249752,217016,-12280}, new int[]{18679,18680}));
|
||||
_spawns.put(18, new ESSpawn(18, GraciaSeeds.DESTRUCTION, new int[]{-249736,217688,-12296}, new int[]{18679,18680}));
|
||||
|
||||
_spawns.put(19, new ESSpawn(19, GraciaSeeds.DESTRUCTION, new int[]{-252472,215208,-12120}, new int[]{18681,18682}));
|
||||
_spawns.put(20, new ESSpawn(20, GraciaSeeds.DESTRUCTION, new int[]{-252552,216760,-12248}, new int[]{18681,18682}));
|
||||
_spawns.put(21, new ESSpawn(21, GraciaSeeds.DESTRUCTION, new int[]{-253160,216744,-12248}, new int[]{18681,18682}));
|
||||
_spawns.put(22, new ESSpawn(22, GraciaSeeds.DESTRUCTION, new int[]{-253128,215160,-12096}, new int[]{18681,18682}));
|
||||
|
||||
_spawns.put(23, new ESSpawn(23, GraciaSeeds.DESTRUCTION, new int[]{-250392,215208,-12120}, new int[]{18683,18678}));
|
||||
_spawns.put(24, new ESSpawn(24, GraciaSeeds.DESTRUCTION, new int[]{-250264,216744,-12248}, new int[]{18683,18678}));
|
||||
_spawns.put(25, new ESSpawn(25, GraciaSeeds.DESTRUCTION, new int[]{-249720,216744,-12248}, new int[]{18683,18678}));
|
||||
_spawns.put(26, new ESSpawn(26, GraciaSeeds.DESTRUCTION, new int[]{-249752,215128,-12096}, new int[]{18683,18678}));
|
||||
|
||||
_spawns.put(27, new ESSpawn(27, GraciaSeeds.DESTRUCTION, new int[]{-250280,216760,-12248}, new int[]{18679,18680,18681}));
|
||||
_spawns.put(28, new ESSpawn(28, GraciaSeeds.DESTRUCTION, new int[]{-250344,216152,-12248}, new int[]{18679,18680,18681}));
|
||||
_spawns.put(29, new ESSpawn(29, GraciaSeeds.DESTRUCTION, new int[]{-252504,216152,-12248}, new int[]{18679,18680,18681}));
|
||||
_spawns.put(30, new ESSpawn(30, GraciaSeeds.DESTRUCTION, new int[]{-252520,216792,-12248}, new int[]{18679,18680,18681}));
|
||||
|
||||
_spawns.put(31, new ESSpawn(31, GraciaSeeds.DESTRUCTION, new int[]{-242520,217272,-12384}, new int[]{18681,18682,18683}));
|
||||
_spawns.put(32, new ESSpawn(32, GraciaSeeds.DESTRUCTION, new int[]{-241432,217288,-12384}, new int[]{18681,18682,18683}));
|
||||
_spawns.put(33, new ESSpawn(33, GraciaSeeds.DESTRUCTION, new int[]{-241432,218936,-12384}, new int[]{18681,18682,18683}));
|
||||
_spawns.put(34, new ESSpawn(34, GraciaSeeds.DESTRUCTION, new int[]{-242536,218936,-12384}, new int[]{18681,18682,18683}));
|
||||
|
||||
_spawns.put(35, new ESSpawn(35, GraciaSeeds.DESTRUCTION, new int[]{-240808,217272,-12384}, new int[]{18678,18679}));
|
||||
_spawns.put(36, new ESSpawn(36, GraciaSeeds.DESTRUCTION, new int[]{-240280,217272,-12384}, new int[]{18678,18679}));
|
||||
_spawns.put(37, new ESSpawn(37, GraciaSeeds.DESTRUCTION, new int[]{-240280,218952,-12384}, new int[]{18678,18679}));
|
||||
_spawns.put(38, new ESSpawn(38, GraciaSeeds.DESTRUCTION, new int[]{-240792,218936,-12384}, new int[]{18678,18679}));
|
||||
|
||||
_spawns.put(39, new ESSpawn(39, GraciaSeeds.DESTRUCTION, new int[]{-239576,217240,-12640}, new int[]{18680,18681,18682}));
|
||||
_spawns.put(40, new ESSpawn(40, GraciaSeeds.DESTRUCTION, new int[]{-239560,216168,-12640}, new int[]{18680,18681,18682}));
|
||||
_spawns.put(41, new ESSpawn(41, GraciaSeeds.DESTRUCTION, new int[]{-237896,216152,-12640}, new int[]{18680,18681,18682}));
|
||||
_spawns.put(42, new ESSpawn(42, GraciaSeeds.DESTRUCTION, new int[]{-237912,217256,-12640}, new int[]{18680,18681,18682}));
|
||||
|
||||
_spawns.put(43, new ESSpawn(43, GraciaSeeds.DESTRUCTION, new int[]{-237896,215528,-12640}, new int[]{18683,18678}));
|
||||
_spawns.put(44, new ESSpawn(44, GraciaSeeds.DESTRUCTION, new int[]{-239560,215528,-12640}, new int[]{18683,18678}));
|
||||
_spawns.put(45, new ESSpawn(45, GraciaSeeds.DESTRUCTION, new int[]{-239560,214984,-12640}, new int[]{18683,18678}));
|
||||
_spawns.put(46, new ESSpawn(46, GraciaSeeds.DESTRUCTION, new int[]{-237896,215000,-12640}, new int[]{18683,18678}));
|
||||
|
||||
_spawns.put(47, new ESSpawn(47, GraciaSeeds.DESTRUCTION, new int[]{-237896,213640,-12768}, new int[]{18678,18679,18680}));
|
||||
_spawns.put(48, new ESSpawn(48, GraciaSeeds.DESTRUCTION, new int[]{-239560,213640,-12768}, new int[]{18678,18679,18680}));
|
||||
_spawns.put(49, new ESSpawn(49, GraciaSeeds.DESTRUCTION, new int[]{-239544,212552,-12768}, new int[]{18678,18679,18680}));
|
||||
_spawns.put(50, new ESSpawn(50, GraciaSeeds.DESTRUCTION, new int[]{-237912,212552,-12768}, new int[]{18678,18679,18680}));
|
||||
|
||||
_spawns.put(51, new ESSpawn(51, GraciaSeeds.DESTRUCTION, new int[]{-237912,211912,-12768}, new int[]{18681,18682}));
|
||||
_spawns.put(52, new ESSpawn(52, GraciaSeeds.DESTRUCTION, new int[]{-237912,211400,-12768}, new int[]{18681,18682}));
|
||||
_spawns.put(53, new ESSpawn(53, GraciaSeeds.DESTRUCTION, new int[]{-239560,211400,-12768}, new int[]{18681,18682}));
|
||||
_spawns.put(54, new ESSpawn(54, GraciaSeeds.DESTRUCTION, new int[]{-239560,211912,-12768}, new int[]{18681,18682}));
|
||||
|
||||
_spawns.put(55, new ESSpawn(55, GraciaSeeds.DESTRUCTION, new int[]{-241960,214536,-12512}, new int[]{18683,18678,18679}));
|
||||
_spawns.put(56, new ESSpawn(56, GraciaSeeds.DESTRUCTION, new int[]{-241976,213448,-12512}, new int[]{18683,18678,18679}));
|
||||
_spawns.put(57, new ESSpawn(57, GraciaSeeds.DESTRUCTION, new int[]{-243624,213448,-12512}, new int[]{18683,18678,18679}));
|
||||
_spawns.put(58, new ESSpawn(58, GraciaSeeds.DESTRUCTION, new int[]{-243624,214520,-12512}, new int[]{18683,18678,18679}));
|
||||
|
||||
_spawns.put(59, new ESSpawn(59, GraciaSeeds.DESTRUCTION, new int[]{-241976,212808,-12504}, new int[]{18680,18681}));
|
||||
_spawns.put(60, new ESSpawn(60, GraciaSeeds.DESTRUCTION, new int[]{-241960,212280,-12504}, new int[]{18680,18681}));
|
||||
_spawns.put(61, new ESSpawn(61, GraciaSeeds.DESTRUCTION, new int[]{-243624,212264,-12504}, new int[]{18680,18681}));
|
||||
_spawns.put(62, new ESSpawn(62, GraciaSeeds.DESTRUCTION, new int[]{-243624,212792,-12504}, new int[]{18680,18681}));
|
||||
|
||||
_spawns.put(63, new ESSpawn(63, GraciaSeeds.DESTRUCTION, new int[]{-243640,210920,-12640}, new int[]{18682,18683,18678}));
|
||||
_spawns.put(64, new ESSpawn(64, GraciaSeeds.DESTRUCTION, new int[]{-243624,209832,-12640}, new int[]{18682,18683,18678}));
|
||||
_spawns.put(65, new ESSpawn(65, GraciaSeeds.DESTRUCTION, new int[]{-241976,209832,-12640}, new int[]{18682,18683,18678}));
|
||||
_spawns.put(66, new ESSpawn(66, GraciaSeeds.DESTRUCTION, new int[]{-241976,210920,-12640}, new int[]{18682,18683,18678}));
|
||||
|
||||
_spawns.put(67, new ESSpawn(67, GraciaSeeds.DESTRUCTION, new int[]{-241976,209192,-12640}, new int[]{18679,18680}));
|
||||
_spawns.put(68, new ESSpawn(68, GraciaSeeds.DESTRUCTION, new int[]{-241976,208664,-12640}, new int[]{18679,18680}));
|
||||
_spawns.put(69, new ESSpawn(69, GraciaSeeds.DESTRUCTION, new int[]{-243624,208664,-12640}, new int[]{18679,18680}));
|
||||
_spawns.put(70, new ESSpawn(70, GraciaSeeds.DESTRUCTION, new int[]{-243624,209192,-12640}, new int[]{18679,18680}));
|
||||
|
||||
_spawns.put(71, new ESSpawn(71, GraciaSeeds.DESTRUCTION, new int[]{-241256,208664,-12896}, new int[]{18681,18682,18683}));
|
||||
_spawns.put(72, new ESSpawn(72, GraciaSeeds.DESTRUCTION, new int[]{-240168,208648,-12896}, new int[]{18681,18682,18683}));
|
||||
_spawns.put(73, new ESSpawn(73, GraciaSeeds.DESTRUCTION, new int[]{-240168,207000,-12896}, new int[]{18681,18682,18683}));
|
||||
_spawns.put(74, new ESSpawn(74, GraciaSeeds.DESTRUCTION, new int[]{-241256,207000,-12896}, new int[]{18681,18682,18683}));
|
||||
|
||||
_spawns.put(75, new ESSpawn(75, GraciaSeeds.DESTRUCTION, new int[]{-239528,208648,-12896}, new int[]{18678,18679}));
|
||||
_spawns.put(76, new ESSpawn(76, GraciaSeeds.DESTRUCTION, new int[]{-238984,208664,-12896}, new int[]{18678,18679}));
|
||||
_spawns.put(77, new ESSpawn(77, GraciaSeeds.DESTRUCTION, new int[]{-239000,207000,-12896}, new int[]{18678,18679}));
|
||||
_spawns.put(78, new ESSpawn(78, GraciaSeeds.DESTRUCTION, new int[]{-239512,207000,-12896}, new int[]{18678,18679}));
|
||||
|
||||
_spawns.put(79, new ESSpawn(79, GraciaSeeds.DESTRUCTION, new int[]{-245064,213144,-12384}, new int[]{18680,18681,18682}));
|
||||
_spawns.put(80, new ESSpawn(80, GraciaSeeds.DESTRUCTION, new int[]{-245064,212072,-12384}, new int[]{18680,18681,18682}));
|
||||
_spawns.put(81, new ESSpawn(81, GraciaSeeds.DESTRUCTION, new int[]{-246696,212072,-12384}, new int[]{18680,18681,18682}));
|
||||
_spawns.put(82, new ESSpawn(82, GraciaSeeds.DESTRUCTION, new int[]{-246696,213160,-12384}, new int[]{18680,18681,18682}));
|
||||
|
||||
_spawns.put(83, new ESSpawn(83, GraciaSeeds.DESTRUCTION, new int[]{-245064,211416,-12384}, new int[]{18683,18678}));
|
||||
_spawns.put(84, new ESSpawn(84, GraciaSeeds.DESTRUCTION, new int[]{-245048,210904,-12384}, new int[]{18683,18678}));
|
||||
_spawns.put(85, new ESSpawn(85, GraciaSeeds.DESTRUCTION, new int[]{-246712,210888,-12384}, new int[]{18683,18678}));
|
||||
_spawns.put(86, new ESSpawn(86, GraciaSeeds.DESTRUCTION, new int[]{-246712,211416,-12384}, new int[]{18683,18678}));
|
||||
|
||||
_spawns.put(87, new ESSpawn(87, GraciaSeeds.DESTRUCTION, new int[]{-245048,209544,-12512}, new int[]{18679,18680,18681}));
|
||||
_spawns.put(88, new ESSpawn(88, GraciaSeeds.DESTRUCTION, new int[]{-245064,208456,-12512}, new int[]{18679,18680,18681}));
|
||||
_spawns.put(89, new ESSpawn(89, GraciaSeeds.DESTRUCTION, new int[]{-246696,208456,-12512}, new int[]{18679,18680,18681}));
|
||||
_spawns.put(90, new ESSpawn(90, GraciaSeeds.DESTRUCTION, new int[]{-246712,209544,-12512}, new int[]{18679,18680,18681}));
|
||||
|
||||
_spawns.put(91, new ESSpawn(91, GraciaSeeds.DESTRUCTION, new int[]{-245048,207816,-12512}, new int[]{18682,18683}));
|
||||
_spawns.put(92, new ESSpawn(92, GraciaSeeds.DESTRUCTION, new int[]{-245048,207288,-12512}, new int[]{18682,18683}));
|
||||
_spawns.put(93, new ESSpawn(93, GraciaSeeds.DESTRUCTION, new int[]{-246696,207304,-12512}, new int[]{18682,18683}));
|
||||
_spawns.put(94, new ESSpawn(94, GraciaSeeds.DESTRUCTION, new int[]{-246712,207816,-12512}, new int[]{18682,18683}));
|
||||
|
||||
_spawns.put(95, new ESSpawn(95, GraciaSeeds.DESTRUCTION, new int[]{-244328,207272,-12768}, new int[]{18678,18679,18680}));
|
||||
_spawns.put(96, new ESSpawn(96, GraciaSeeds.DESTRUCTION, new int[]{-243256,207256,-12768}, new int[]{18678,18679,18680}));
|
||||
_spawns.put(97, new ESSpawn(97, GraciaSeeds.DESTRUCTION, new int[]{-243256,205624,-12768}, new int[]{18678,18679,18680}));
|
||||
_spawns.put(98, new ESSpawn(98, GraciaSeeds.DESTRUCTION, new int[]{-244328,205608,-12768}, new int[]{18678,18679,18680}));
|
||||
|
||||
_spawns.put(99, new ESSpawn(99, GraciaSeeds.DESTRUCTION, new int[]{-242616,207272,-12768}, new int[]{18681,18682}));
|
||||
_spawns.put(100, new ESSpawn(100, GraciaSeeds.DESTRUCTION, new int[]{-242104,207272,-12768}, new int[]{18681,18682}));
|
||||
_spawns.put(101, new ESSpawn(101, GraciaSeeds.DESTRUCTION, new int[]{-242088,205624,-12768}, new int[]{18681,18682}));
|
||||
_spawns.put(102, new ESSpawn(102, GraciaSeeds.DESTRUCTION, new int[]{-242600,205608,-12768}, new int[]{18681,18682}));
|
||||
|
||||
// Seed of Annihilation
|
||||
_spawns.put(103, new ESSpawn(103, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-184519,183007,-10456}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(104, new ESSpawn(104, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-184873,181445,-10488}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(105, new ESSpawn(105, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-184009,180962,-10488}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(106, new ESSpawn(106, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-185321,181641,-10448}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(107, new ESSpawn(107, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-184035,182775,-10512}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(108, new ESSpawn(108, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-185433,181935,-10424}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(109, new ESSpawn(109, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-183309,183007,-10560}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(110, new ESSpawn(110, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-184929,181886,-10488}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(111, new ESSpawn(111, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-184009,180392,-10424}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(112, new ESSpawn(112, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-183793,183239,-10488}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(113, new ESSpawn(113, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-184245,180848,-10464}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(114, new ESSpawn(114, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-182704,183761,-10528}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(115, new ESSpawn(115, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-184705,181886,-10504}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(116, new ESSpawn(116, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-184304,181076,-10488}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(117, new ESSpawn(117, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-183596,180430,-10424}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(118, new ESSpawn(118, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-184422,181038,-10480}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(119, new ESSpawn(119, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-184929,181543,-10496}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(120, new ESSpawn(120, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-184398,182891,-10472}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(121, new ESSpawn(121, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-177606,182848,-10584}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(122, new ESSpawn(122, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-178104,183224,-10560}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(123, new ESSpawn(123, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-177274,182284,-10600}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(124, new ESSpawn(124, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-177772,183224,-10560}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(125, new ESSpawn(125, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-181532,180364,-10504}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(126, new ESSpawn(126, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-181802,180276,-10496}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(127, new ESSpawn(127, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-178429,180444,-10512}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(128, new ESSpawn(128, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-177606,182190,-10600}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(129, new ESSpawn(129, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-177357,181908,-10576}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(130, new ESSpawn(130, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-178747,179534,-10408}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(131, new ESSpawn(131, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-178429,179534,-10392}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(132, new ESSpawn(132, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-178853,180094,-10472}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(133, new ESSpawn(133, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-181937,179660,-10416}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(134, new ESSpawn(134, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-180992,179572,-10416}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(135, new ESSpawn(135, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-185552,179252,-10368}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(136, new ESSpawn(136, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-184572,178913,-10400}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(137, new ESSpawn(137, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-184768,178348,-10312}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(138, new ESSpawn(138, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-184572,178574,-10352}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(139, new ESSpawn(139, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-185062,178913,-10384}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(140, new ESSpawn(140, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-181397,179484,-10416}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(141, new ESSpawn(141, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-181667,179044,-10408}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(142, new ESSpawn(142, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-185258,177896,-10240}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(143, new ESSpawn(143, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-183506,176570,-10280}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(144, new ESSpawn(144, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-183719,176804,-10240}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(145, new ESSpawn(145, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-183648,177116,-10240}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(146, new ESSpawn(146, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-183932,176492,-10240}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(147, new ESSpawn(147, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-183861,176570,-10240}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(148, new ESSpawn(148, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-183790,175946,-10240}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(149, new ESSpawn(149, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-178641,179604,-10416}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(150, new ESSpawn(150, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-178959,179814,-10432}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(151, new ESSpawn(151, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-176367,178456,-10376}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(152, new ESSpawn(152, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-175845,177172,-10264}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(153, new ESSpawn(153, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-175323,177600,-10248}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(154, new ESSpawn(154, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-174975,177172,-10216}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(155, new ESSpawn(155, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-176019,178242,-10352}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(156, new ESSpawn(156, GraciaSeeds.ANNIHILATION_BISTAKON, new int[]{-174801,178456,-10264}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
|
||||
_spawns.put(157, new ESSpawn(157, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-185648,183384,-15680}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(158, new ESSpawn(158, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-186740,180908,-15528}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(159, new ESSpawn(159, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-185297,184658,-15680}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(160, new ESSpawn(160, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-185697,181601,-15488}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(161, new ESSpawn(161, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-186684,182744,-15536}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(162, new ESSpawn(162, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-184908,183384,-15616}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(163, new ESSpawn(163, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-184994,185572,-15784}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(164, new ESSpawn(164, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-185796,182616,-15608}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(165, new ESSpawn(165, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-184970,184385,-15648}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(166, new ESSpawn(166, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-185995,180809,-15512}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(167, new ESSpawn(167, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-185352,182872,-15632}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(168, new ESSpawn(168, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-185624,184294,-15680}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(169, new ESSpawn(169, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-184486,185774,-15816}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(170, new ESSpawn(170, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-186496,184112,-15680}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(171, new ESSpawn(171, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-184232,185976,-15816}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(172, new ESSpawn(172, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-184994,185673,-15792}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(173, new ESSpawn(173, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-185733,184203,-15680}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(174, new ESSpawn(174, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-185079,184294,-15680}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(175, new ESSpawn(175, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-184803,180710,-15528}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(176, new ESSpawn(176, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-186293,180413,-15528}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(177, new ESSpawn(177, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-185352,182936,-15632}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(178, new ESSpawn(178, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-184356,180611,-15496}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(179, new ESSpawn(179, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-185375,186784,-15816}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(180, new ESSpawn(180, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-184867,186784,-15816}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(181, new ESSpawn(181, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-180553,180454,-15152}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(182, new ESSpawn(182, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-180422,180454,-15152}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(183, new ESSpawn(183, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-181863,181138,-15120}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(184, new ESSpawn(184, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-181732,180454,-15152}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(185, new ESSpawn(185, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-180684,180397,-15152}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(186, new ESSpawn(186, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-182256,180682,-15112}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(187, new ESSpawn(187, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-185492,179492,-15392}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(188, new ESSpawn(188, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-185894,178538,-15336}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(189, new ESSpawn(189, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-186028,178856,-15336}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(190, new ESSpawn(190, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-185224,179068,-15336}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(191, new ESSpawn(191, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-185492,178538,-15336}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(192, new ESSpawn(192, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-185894,178538,-15336}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(193, new ESSpawn(193, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-180619,178855,-15152}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(194, new ESSpawn(194, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-180255,177892,-15152}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(195, new ESSpawn(195, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-185804,176472,-15336}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(196, new ESSpawn(196, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-184580,176370,-15320}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(197, new ESSpawn(197, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-184308,176166,-15320}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(198, new ESSpawn(198, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-183764,177186,-15304}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(199, new ESSpawn(199, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-180801,177571,-15144}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(200, new ESSpawn(200, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-184716,176064,-15320}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(201, new ESSpawn(201, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-184444,175452,-15296}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(202, new ESSpawn(202, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-180164,177464,-15152}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(203, new ESSpawn(203, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-180164,178213,-15152}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(204, new ESSpawn(204, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-179982,178320,-15152}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(205, new ESSpawn(205, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-176925,177757,-15824}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(206, new ESSpawn(206, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-176164,179282,-15720}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(207, new ESSpawn(207, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-175692,177613,-15800}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(208, new ESSpawn(208, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-175418,178117,-15824}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(209, new ESSpawn(209, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-176103,177829,-15824}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(210, new ESSpawn(210, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-175966,177325,-15792}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(211, new ESSpawn(211, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-174778,179732,-15664}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(212, new ESSpawn(212, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-175692,178261,-15824}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(213, new ESSpawn(213, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-176038,179192,-15736}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(214, new ESSpawn(214, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-175660,179462,-15680}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(215, new ESSpawn(215, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-175912,179732,-15664}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(216, new ESSpawn(216, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-175156,180182,-15680}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(217, new ESSpawn(217, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-174240,182059,-15664}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(218, new ESSpawn(218, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-175590,181478,-15640}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(219, new ESSpawn(219, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-174510,181561,-15616}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(220, new ESSpawn(220, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-174240,182391,-15688}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(221, new ESSpawn(221, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-174105,182806,-15672}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(222, new ESSpawn(222, GraciaSeeds.ANNIHILATION_REPTILIKON, new int[]{-174645,182806,-15712}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
|
||||
_spawns.put(223, new ESSpawn(223, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-214962,182403,-10992}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(224, new ESSpawn(224, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-215019,182493,-11000}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(225, new ESSpawn(225, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-211374,180793,-11672}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(226, new ESSpawn(226, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-211198,180661,-11680}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(227, new ESSpawn(227, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-213097,178936,-12720}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(228, new ESSpawn(228, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-213517,178936,-12712}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(229, new ESSpawn(229, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-214105,179191,-12720}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(230, new ESSpawn(230, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-213769,179446,-12720}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(231, new ESSpawn(231, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-214021,179344,-12720}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(232, new ESSpawn(232, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-210582,180595,-11672}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(233, new ESSpawn(233, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-210934,180661,-11696}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(234, new ESSpawn(234, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-207058,178460,-12656}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(235, new ESSpawn(235, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-207454,179151,-11368}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(236, new ESSpawn(236, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-207422,181365,-11344}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(237, new ESSpawn(237, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-207358,180627,-11344}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(238, new ESSpawn(238, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-207230,180996,-11344}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(239, new ESSpawn(239, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-208515,184160,-11344}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(240, new ESSpawn(240, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-207613,184000,-11344}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(241, new ESSpawn(241, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-208597,183760,-11352}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(242, new ESSpawn(242, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-206710,176142,-12656}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(243, new ESSpawn(243, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-206361,178136,-11336}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(244, new ESSpawn(244, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-206178,178630,-12672}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(245, new ESSpawn(245, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-205738,178715,-12656}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(246, new ESSpawn(246, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-206442,178205,-12648}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(247, new ESSpawn(247, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-206585,178874,-11336}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(248, new ESSpawn(248, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-206073,179366,-11344}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(249, new ESSpawn(249, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-206009,178628,-11344}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(250, new ESSpawn(250, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-206155,181301,-12656}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(251, new ESSpawn(251, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-206595,181641,-12656}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(252, new ESSpawn(252, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-206507,181641,-12656}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(253, new ESSpawn(253, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-206507,181471,-12640}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(254, new ESSpawn(254, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-206974,175972,-12672}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(255, new ESSpawn(255, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-206304,175130,-11344}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(256, new ESSpawn(256, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-206886,175802,-12672}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(257, new ESSpawn(257, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-207238,175972,-12672}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(258, new ESSpawn(258, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-206386,174857,-11328}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(259, new ESSpawn(259, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-206386,175039,-11336}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(260, new ESSpawn(260, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-205976,174584,-11344}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(261, new ESSpawn(261, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-207367,184320,-11336}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(262, new ESSpawn(262, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219002,180419,-12608}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(263, new ESSpawn(263, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-218853,182790,-12592}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(264, new ESSpawn(264, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-218853,183343,-12600}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(265, new ESSpawn(265, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-218358,186247,-11344}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(266, new ESSpawn(266, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-218358,186083,-11344}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(267, new ESSpawn(267, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-217574,185796,-11352}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(268, new ESSpawn(268, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219178,181051,-12592}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(269, new ESSpawn(269, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-220171,180313,-11344}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(270, new ESSpawn(270, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219293,183738,-12592}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(271, new ESSpawn(271, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219381,182553,-12584}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(272, new ESSpawn(272, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219600,183024,-11336}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(273, new ESSpawn(273, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219940,182680,-11344}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(274, new ESSpawn(274, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219260,183884,-11344}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(275, new ESSpawn(275, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219855,183540,-11344}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(276, new ESSpawn(276, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-218946,186575,-11344}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(277, new ESSpawn(277, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219882,180103,-12592}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(278, new ESSpawn(278, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219266,179787,-12584}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(279, new ESSpawn(279, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219201,178337,-12592}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(280, new ESSpawn(280, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219716,179875,-11336}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(281, new ESSpawn(281, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219716,180021,-11328}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(282, new ESSpawn(282, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219989,179437,-11336}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(283, new ESSpawn(283, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219078,178298,-12592}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(284, new ESSpawn(284, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-218684,178954,-11328}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(285, new ESSpawn(285, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219089,178456,-11328}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(286, new ESSpawn(286, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-220266,177623,-12608}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(287, new ESSpawn(287, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219201,178025,-12592}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(288, new ESSpawn(288, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219142,177044,-12592}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(289, new ESSpawn(289, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219690,177895,-12592}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(290, new ESSpawn(290, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219754,177623,-12584}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(291, new ESSpawn(291, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-218791,177830,-12584}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(292, new ESSpawn(292, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-218904,176219,-12592}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(293, new ESSpawn(293, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-218768,176384,-12584}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(294, new ESSpawn(294, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-218774,177626,-11320}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(295, new ESSpawn(295, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-218774,177792,-11328}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(296, new ESSpawn(296, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219880,175901,-11344}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(297, new ESSpawn(297, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219210,176054,-12592}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(298, new ESSpawn(298, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219850,175991,-12608}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(299, new ESSpawn(299, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-219079,175021,-11336}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(300, new ESSpawn(300, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-218812,174229,-11344}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
_spawns.put(301, new ESSpawn(301, GraciaSeeds.ANNIHILATION_COKRAKON, new int[]{-218723,174669,-11336}, new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 }));
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new EnergySeeds(-1, qn, "instances");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.quest.Quest;
|
||||
import com.l2jserver.gameserver.model.quest.QuestState;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
public class EvasGiftBoxes extends Quest
|
||||
{
|
||||
final private static int GIFTBOX = 32342;
|
||||
|
||||
final private static int KISSOFEVA = 1073;
|
||||
|
||||
// index 0: without kiss of eva
|
||||
// index 1: with kiss of eva
|
||||
// chance,itemId,...
|
||||
final private static int[][] CHANCES = {{2,9692,1,9693},{100,9692,50,9693}};
|
||||
|
||||
final private static String qn = "EvasGiftBoxes";
|
||||
|
||||
public EvasGiftBoxes(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
addKillId(GIFTBOX);
|
||||
addSpawnId(GIFTBOX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
npc.setIsNoRndWalk(true);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill (L2Npc npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
if (npc.getNpcId() == GIFTBOX)
|
||||
{
|
||||
QuestState st = killer.getQuestState(qn);
|
||||
if (st == null)
|
||||
st = newQuestState(killer);
|
||||
int isKissOfEvaBuffed = 0;
|
||||
if (killer.getFirstEffect(KISSOFEVA) != null)
|
||||
isKissOfEvaBuffed = 1;
|
||||
for (int i = 0; i < CHANCES[isKissOfEvaBuffed].length; i += 2)
|
||||
if (Rnd.get(100) < CHANCES[isKissOfEvaBuffed][i])
|
||||
st.giveItems(CHANCES[isKissOfEvaBuffed][i+1],1);
|
||||
}
|
||||
return super.onKill(npc,killer,isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new EvasGiftBoxes(-1,qn,"ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.datatables.SkillTable;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2NpcInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
public class FairyTrees extends L2AttackableAIScript
|
||||
{
|
||||
private static final int[] mobs = { 27185, 27186, 27187, 27188 };
|
||||
|
||||
public FairyTrees(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
this.registerMobs(mobs, QuestEventType.ON_KILL);
|
||||
super.addSpawnId(27189);
|
||||
}
|
||||
|
||||
public String onKill (L2NpcInstance npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
int npcId = npc.getNpcId();
|
||||
if (Util.contains(mobs, npcId))
|
||||
{
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
L2Attackable newNpc = (L2Attackable) addSpawn(27189, npc.getX(), npc.getY(), npc.getZ(), 0, false, 30000);
|
||||
L2Character originalKiller = isPet ? killer.getPet() : killer;
|
||||
newNpc.setRunning();
|
||||
newNpc.addDamageHate(originalKiller, 0, 999);
|
||||
newNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, originalKiller);
|
||||
if (Rnd.get(1, 2) == 1)
|
||||
{
|
||||
L2Skill skill = SkillTable.getInstance().getInfo(4243, 1);
|
||||
if (skill != null && originalKiller != null)
|
||||
skill.getEffects(newNpc, originalKiller);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new FairyTrees(-1, "fairy_trees", "ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,586 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javolution.util.FastMap;
|
||||
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.datatables.NpcTable;
|
||||
import com.l2jserver.gameserver.idfactory.IdFactory;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2TamedBeastInstance;
|
||||
import com.l2jserver.gameserver.model.quest.QuestState;
|
||||
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SocialAction;
|
||||
import com.l2jserver.gameserver.templates.chars.L2NpcTemplate;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
/**
|
||||
* Growth-capable mobs: Polymorphing upon successful feeding.
|
||||
* @author Fulminus
|
||||
*/
|
||||
public class FeedableBeasts extends L2AttackableAIScript
|
||||
{
|
||||
private static final int GOLDEN_SPICE = 6643;
|
||||
private static final int CRYSTAL_SPICE = 6644;
|
||||
private static final int SKILL_GOLDEN_SPICE = 2188;
|
||||
private static final int SKILL_CRYSTAL_SPICE = 2189;
|
||||
private static final int[] TAMED_BEASTS = {16013, 16014, 16015, 16016, 16017, 16018};
|
||||
private static final int FOODSKILLDIFF = GOLDEN_SPICE - SKILL_GOLDEN_SPICE;
|
||||
|
||||
// all mobs that can eat...
|
||||
private static final int[] FEEDABLE_BEASTS = {
|
||||
21451,21452,21453,21454,21455,21456,21457,21458,21459,21460,21461,21462,21463,
|
||||
21464,21465,21466,21467,21468,21469,21470,21471,21472,21473,21474,21475,21476,
|
||||
21477,21478,21479,21480,21481,21482,21483,21484,21485,21486,21487,21488,21489,
|
||||
21490,21491,21492,21493,21494,21495,21496,21497,21498,21499,21500,21501,21502,
|
||||
21503,21504,21505,21506,21507,21824,21825,21826,21827,21828,21829,16013,16014,
|
||||
16015,16016,16017,16018
|
||||
};
|
||||
|
||||
private static final Map<Integer,Integer> MAD_COW_POLYMORPH = new FastMap<Integer,Integer>();
|
||||
static
|
||||
{
|
||||
MAD_COW_POLYMORPH.put(21824,21468);
|
||||
MAD_COW_POLYMORPH.put(21825,21469);
|
||||
MAD_COW_POLYMORPH.put(21826,21487);
|
||||
MAD_COW_POLYMORPH.put(21827,21488);
|
||||
MAD_COW_POLYMORPH.put(21828,21506);
|
||||
MAD_COW_POLYMORPH.put(21829,21507);
|
||||
}
|
||||
|
||||
//TODO: NpcString
|
||||
private static final String[][] TEXT =
|
||||
{
|
||||
{
|
||||
"What did you just do to me?","You want to tame me, huh?",
|
||||
"Do not give me this. Perhaps you will be in danger.",
|
||||
"Bah bah. What is this unpalatable thing?",
|
||||
"My belly has been complaining. This hit the spot.",
|
||||
"What is this? Can I eat it?","You don't need to worry about me.",
|
||||
"Delicious food, thanks.","I am starting to like you!","Gulp"
|
||||
},
|
||||
{
|
||||
"I do not think you have given up on the idea of taming me.",
|
||||
"That is just food to me. Perhaps I can eat your hand too.",
|
||||
"Will eating this make me fat? Ha ha","Why do you always feed me?",
|
||||
"Do not trust me. I may betray you"
|
||||
},
|
||||
{
|
||||
"Destroy","Look what you have done!",
|
||||
"Strange feeling...! Evil intentions grow in my heart...!",
|
||||
"It is happenning!","This is sad...Good is sad...!"
|
||||
}
|
||||
};
|
||||
|
||||
private static final String[] TAMED_TEXT =
|
||||
{
|
||||
"Refills! Yeah!","I am such a gluttonous beast, it is embarrassing! Ha ha",
|
||||
"Your cooperative feeling has been getting better and better.",
|
||||
"I will help you!","The weather is really good. Wanna go for a picnic?",
|
||||
"I really like you! This is tasty...",
|
||||
"If you do not have to leave this place, then I can help you.",
|
||||
"What can I help you with?","I am not here only for food!",
|
||||
"Yam, yam, yam, yam, yam!"
|
||||
};
|
||||
|
||||
private static Map<Integer,Integer> _FeedInfo = new FastMap<Integer,Integer>();
|
||||
private static Map<Integer,GrowthCapableMob> _GrowthCapableMobs = new FastMap<Integer,GrowthCapableMob>();
|
||||
|
||||
// all mobs that grow by eating
|
||||
private static class GrowthCapableMob
|
||||
{
|
||||
private int _growthLevel;
|
||||
private int _chance;
|
||||
|
||||
private Map<Integer, int[][]> _spiceToMob = new FastMap<Integer,int[][]>();
|
||||
|
||||
public GrowthCapableMob(int growthLevel, int chance)
|
||||
{
|
||||
_growthLevel = growthLevel;
|
||||
_chance = chance;
|
||||
}
|
||||
|
||||
public void addMobs(int spice, int[][] Mobs)
|
||||
{
|
||||
_spiceToMob.put(spice, Mobs);
|
||||
}
|
||||
|
||||
public Integer getMob(int spice,int mobType, int classType)
|
||||
{
|
||||
if (_spiceToMob.containsKey(spice))
|
||||
{
|
||||
return _spiceToMob.get(spice)[mobType][classType];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Integer getRandomMob(int spice)
|
||||
{
|
||||
int[][] temp;
|
||||
temp = _spiceToMob.get(spice);
|
||||
int rand = Rnd.get(temp[0].length);
|
||||
return temp[0][rand];
|
||||
}
|
||||
|
||||
public Integer getChance()
|
||||
{
|
||||
return _chance;
|
||||
}
|
||||
|
||||
public Integer getGrowthLevel()
|
||||
{
|
||||
return _growthLevel;
|
||||
}
|
||||
}
|
||||
|
||||
public FeedableBeasts (int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
this.registerMobs(FEEDABLE_BEASTS, QuestEventType.ON_KILL, QuestEventType.ON_SKILL_SEE);
|
||||
|
||||
GrowthCapableMob temp;
|
||||
|
||||
final int[][] Kookabura_0_Gold = {{21452,21453, 21454, 21455}};
|
||||
final int[][] Kookabura_0_Crystal = {{21456,21457, 21458, 21459}};
|
||||
final int[][] Kookabura_1_Gold_1= {{21460,21462}};
|
||||
final int[][] Kookabura_1_Gold_2 = {{21461,21463}};
|
||||
final int[][] Kookabura_1_Crystal_1 = {{21464,21466}};
|
||||
final int[][] Kookabura_1_Crystal_2 = {{21465,21467}};
|
||||
final int[][] Kookabura_2_1 = {{21468,21824},{16017,16018}};
|
||||
final int[][] Kookabura_2_2 = {{21469,21825},{16017,16018}};
|
||||
|
||||
final int[][] Buffalo_0_Gold = {{21471,21472, 21473, 21474}};
|
||||
final int[][] Buffalo_0_Crystal = {{21475,21476, 21477, 21478}};
|
||||
final int[][] Buffalo_1_Gold_1 = {{21479,21481}};
|
||||
final int[][] Buffalo_1_Gold_2 = {{21481,21482}};
|
||||
final int[][] Buffalo_1_Crystal_1 = {{21483,21485}};
|
||||
final int[][] Buffalo_1_Crystal_2 = {{21484,21486}};
|
||||
final int[][] Buffalo_2_1 = {{21487,21826},{16013,16014}};
|
||||
final int[][] Buffalo_2_2 = {{21488,21827},{16013,16014}};
|
||||
|
||||
final int[][] Cougar_0_Gold = {{21490,21491, 21492, 21493}};
|
||||
final int[][] Cougar_0_Crystal = {{21494,21495, 21496, 21497}};
|
||||
final int[][] Cougar_1_Gold_1 = {{21498,21500}};
|
||||
final int[][] Cougar_1_Gold_2 = {{21499,21501}};
|
||||
final int[][] Cougar_1_Crystal_1 = {{21502,21504}};
|
||||
final int[][] Cougar_1_Crystal_2 = {{21503,21505}};
|
||||
final int[][] Cougar_2_1 = {{21506,21828},{16015,16016}};
|
||||
final int[][] Cougar_2_2 = {{21507,21829},{16015,16016}};
|
||||
|
||||
// Alpen Kookabura
|
||||
temp = new GrowthCapableMob(0,100);
|
||||
temp.addMobs(GOLDEN_SPICE,Kookabura_0_Gold);
|
||||
temp.addMobs(CRYSTAL_SPICE,Kookabura_0_Crystal);
|
||||
_GrowthCapableMobs.put(21451, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1,40);
|
||||
temp.addMobs(GOLDEN_SPICE,Kookabura_1_Gold_1);
|
||||
_GrowthCapableMobs.put(21452, temp);
|
||||
_GrowthCapableMobs.put(21454, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1,40);
|
||||
temp.addMobs(GOLDEN_SPICE,Kookabura_1_Gold_2);
|
||||
_GrowthCapableMobs.put(21453, temp);
|
||||
_GrowthCapableMobs.put(21455, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1,40);
|
||||
temp.addMobs(CRYSTAL_SPICE,Kookabura_1_Crystal_1);
|
||||
_GrowthCapableMobs.put(21456, temp);
|
||||
_GrowthCapableMobs.put(21458, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1,40);
|
||||
temp.addMobs(CRYSTAL_SPICE,Kookabura_1_Crystal_2);
|
||||
_GrowthCapableMobs.put(21457, temp);
|
||||
_GrowthCapableMobs.put(21459, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2,25);
|
||||
temp.addMobs(GOLDEN_SPICE,Kookabura_2_1);
|
||||
_GrowthCapableMobs.put(21460, temp);
|
||||
_GrowthCapableMobs.put(21462, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2,25);
|
||||
temp.addMobs(GOLDEN_SPICE,Kookabura_2_2);
|
||||
_GrowthCapableMobs.put(21461, temp);
|
||||
_GrowthCapableMobs.put(21463, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2,25);
|
||||
temp.addMobs(CRYSTAL_SPICE,Kookabura_2_1);
|
||||
_GrowthCapableMobs.put(21464, temp);
|
||||
_GrowthCapableMobs.put(21466, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2,25);
|
||||
temp.addMobs(CRYSTAL_SPICE,Kookabura_2_2);
|
||||
_GrowthCapableMobs.put(21465, temp);
|
||||
_GrowthCapableMobs.put(21467, temp);
|
||||
|
||||
// Alpen Buffalo
|
||||
temp = new GrowthCapableMob(0,100);
|
||||
temp.addMobs(GOLDEN_SPICE,Buffalo_0_Gold);
|
||||
temp.addMobs(CRYSTAL_SPICE,Buffalo_0_Crystal);
|
||||
_GrowthCapableMobs.put(21470, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1,40);
|
||||
temp.addMobs(GOLDEN_SPICE,Buffalo_1_Gold_1);
|
||||
_GrowthCapableMobs.put(21471, temp);
|
||||
_GrowthCapableMobs.put(21473, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1,40);
|
||||
temp.addMobs(GOLDEN_SPICE,Buffalo_1_Gold_2);
|
||||
_GrowthCapableMobs.put(21472, temp);
|
||||
_GrowthCapableMobs.put(21474, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1,40);
|
||||
temp.addMobs(CRYSTAL_SPICE,Buffalo_1_Crystal_1);
|
||||
_GrowthCapableMobs.put(21475, temp);
|
||||
_GrowthCapableMobs.put(21477, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1,40);
|
||||
temp.addMobs(CRYSTAL_SPICE,Buffalo_1_Crystal_2);
|
||||
_GrowthCapableMobs.put(21476, temp);
|
||||
_GrowthCapableMobs.put(21478, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2,25);
|
||||
temp.addMobs(GOLDEN_SPICE,Buffalo_2_1);
|
||||
_GrowthCapableMobs.put(21479, temp);
|
||||
_GrowthCapableMobs.put(21481, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2,25);
|
||||
temp.addMobs(GOLDEN_SPICE,Buffalo_2_2);
|
||||
_GrowthCapableMobs.put(21480, temp);
|
||||
_GrowthCapableMobs.put(21482, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2,25);
|
||||
temp.addMobs(CRYSTAL_SPICE,Buffalo_2_1);
|
||||
_GrowthCapableMobs.put(21483, temp);
|
||||
_GrowthCapableMobs.put(21485, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2,25);
|
||||
temp.addMobs(CRYSTAL_SPICE,Buffalo_2_2);
|
||||
_GrowthCapableMobs.put(21484, temp);
|
||||
_GrowthCapableMobs.put(21486, temp);
|
||||
|
||||
// Alpen Cougar
|
||||
temp = new GrowthCapableMob(0,100);
|
||||
temp.addMobs(GOLDEN_SPICE,Cougar_0_Gold);
|
||||
temp.addMobs(CRYSTAL_SPICE,Cougar_0_Crystal);
|
||||
_GrowthCapableMobs.put(21489, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1,40);
|
||||
temp.addMobs(GOLDEN_SPICE,Cougar_1_Gold_1);
|
||||
_GrowthCapableMobs.put(21490, temp);
|
||||
_GrowthCapableMobs.put(21492, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1,40);
|
||||
temp.addMobs(GOLDEN_SPICE,Cougar_1_Gold_2);
|
||||
_GrowthCapableMobs.put(21491, temp);
|
||||
_GrowthCapableMobs.put(21493, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1,40);
|
||||
temp.addMobs(CRYSTAL_SPICE,Cougar_1_Crystal_1);
|
||||
_GrowthCapableMobs.put(21494, temp);
|
||||
_GrowthCapableMobs.put(21496, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1,40);
|
||||
temp.addMobs(CRYSTAL_SPICE,Cougar_1_Crystal_2);
|
||||
_GrowthCapableMobs.put(21495, temp);
|
||||
_GrowthCapableMobs.put(21497, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2,25);
|
||||
temp.addMobs(GOLDEN_SPICE,Cougar_2_1);
|
||||
_GrowthCapableMobs.put(21498, temp);
|
||||
_GrowthCapableMobs.put(21500, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2,25);
|
||||
temp.addMobs(GOLDEN_SPICE,Cougar_2_2);
|
||||
_GrowthCapableMobs.put(21499, temp);
|
||||
_GrowthCapableMobs.put(21501, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2,25);
|
||||
temp.addMobs(CRYSTAL_SPICE,Cougar_2_1);
|
||||
_GrowthCapableMobs.put(21502, temp);
|
||||
_GrowthCapableMobs.put(21504, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2,25);
|
||||
temp.addMobs(CRYSTAL_SPICE,Cougar_2_2);
|
||||
_GrowthCapableMobs.put(21503, temp);
|
||||
_GrowthCapableMobs.put(21505, temp);
|
||||
}
|
||||
|
||||
public void spawnNext(L2Npc npc, int growthLevel, L2PcInstance player, int food)
|
||||
{
|
||||
int npcId = npc.getNpcId();
|
||||
int nextNpcId = 0;
|
||||
|
||||
// find the next mob to spawn, based on the current npcId, growthlevel, and food.
|
||||
if (growthLevel == 2)
|
||||
{
|
||||
// if tamed, the mob that will spawn depends on the class type (fighter/mage) of the player!
|
||||
if (Rnd.get(2) == 0)
|
||||
{
|
||||
if (player.getClassId().isMage())
|
||||
{
|
||||
nextNpcId = _GrowthCapableMobs.get(npcId).getMob(food, 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
nextNpcId = _GrowthCapableMobs.get(npcId).getMob(food, 1, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// if not tamed, there is a small chance that have "mad cow" disease.
|
||||
// that is a stronger-than-normal animal that attacks its feeder
|
||||
if (Rnd.get(5) == 0)
|
||||
{
|
||||
nextNpcId = _GrowthCapableMobs.get(npcId).getMob(food, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
nextNpcId = _GrowthCapableMobs.get(npcId).getMob(food, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// all other levels of growth are straight-forward
|
||||
nextNpcId = _GrowthCapableMobs.get(npcId).getRandomMob(food);
|
||||
}
|
||||
|
||||
// remove the feedinfo of the mob that got despawned, if any
|
||||
if (_FeedInfo.containsKey(npc.getObjectId()))
|
||||
{
|
||||
if (_FeedInfo.get(npc.getObjectId()) == player.getObjectId())
|
||||
_FeedInfo.remove(npc.getObjectId());
|
||||
}
|
||||
// despawn the old mob
|
||||
//TODO: same code? FIXED?
|
||||
/*if (_GrowthCapableMobs.get(npcId).getGrowthLevel() == 0)
|
||||
{
|
||||
npc.deleteMe();
|
||||
}
|
||||
else
|
||||
{*/
|
||||
npc.deleteMe();
|
||||
//}
|
||||
|
||||
// if this is finally a trained mob, then despawn any other trained mobs that the
|
||||
// player might have and initialize the Tamed Beast.
|
||||
if (Util.contains(TAMED_BEASTS,nextNpcId))
|
||||
{
|
||||
if (player.getTrainedBeasts() != null && !player.getTrainedBeasts().isEmpty())
|
||||
for(L2TamedBeastInstance oldTrained : player.getTrainedBeasts())
|
||||
oldTrained.deleteMe();
|
||||
|
||||
L2NpcTemplate template = NpcTable.getInstance().getTemplate(nextNpcId);
|
||||
L2TamedBeastInstance nextNpc = new L2TamedBeastInstance(IdFactory.getInstance().getNextId(), template, player, food - FOODSKILLDIFF, npc.getX(), npc.getY(), npc.getZ());
|
||||
nextNpc.setRunning();
|
||||
|
||||
int objectId = nextNpc.getObjectId();
|
||||
|
||||
QuestState st = player.getQuestState("20_BringUpWithLove");
|
||||
if (st != null)
|
||||
{
|
||||
if (Rnd.get(100) <= 5 && st.getQuestItemsCount(7185) == 0)
|
||||
{
|
||||
//if player has quest 20 going, give quest item
|
||||
//it's easier to hardcode it in here than to try and repeat this stuff in the quest
|
||||
st.giveItems(7185,1);
|
||||
st.set("cond","2");
|
||||
}
|
||||
}
|
||||
// also, perform a rare random chat
|
||||
int rand = Rnd.get(20);
|
||||
if (rand == 0)
|
||||
{
|
||||
npc.broadcastPacket(new NpcSay(objectId,0,nextNpc.getNpcId(), player.getName()+", will you show me your hideaway?"));
|
||||
}
|
||||
else if (rand == 1)
|
||||
{
|
||||
npc.broadcastPacket(new NpcSay(objectId,0,nextNpc.getNpcId(), player.getName()+", whenever I look at spice, I think about you."));
|
||||
}
|
||||
else if (rand == 2)
|
||||
{
|
||||
npc.broadcastPacket(new NpcSay(objectId,0,nextNpc.getNpcId(), player.getName()+", you do not need to return to the village. I will give you strength"));
|
||||
}
|
||||
else if (rand == 3)
|
||||
{
|
||||
npc.broadcastPacket(new NpcSay(objectId,0,nextNpc.getNpcId(), "Thanks, "+player.getName()+". I hope I can help you"));
|
||||
}
|
||||
else if (rand == 4)
|
||||
{
|
||||
npc.broadcastPacket(new NpcSay(objectId,0,nextNpc.getNpcId(), player.getName()+", what can I do to help you?"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// if not trained, the newly spawned mob will automatically be agro against its feeder
|
||||
// (what happened to "never bite the hand that feeds you" anyway?!)
|
||||
L2Attackable nextNpc = (L2Attackable) this.addSpawn(nextNpcId,npc);
|
||||
|
||||
if (MAD_COW_POLYMORPH.containsKey(nextNpcId))
|
||||
{
|
||||
this.startQuestTimer("polymorph Mad Cow", 10000, nextNpc, player);
|
||||
}
|
||||
|
||||
// register the player in the feedinfo for the mob that just spawned
|
||||
_FeedInfo.put(nextNpc.getObjectId(),player.getObjectId());
|
||||
nextNpc.setRunning();
|
||||
nextNpc.addDamageHate(player,0,99999);
|
||||
nextNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent (String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equalsIgnoreCase("polymorph Mad Cow") && npc != null && player != null)
|
||||
{
|
||||
if( MAD_COW_POLYMORPH.containsKey(npc.getNpcId()))
|
||||
{
|
||||
// remove the feed info from the previous mob
|
||||
if (_FeedInfo.get(npc.getObjectId()) == player.getObjectId())
|
||||
{
|
||||
_FeedInfo.remove(npc.getObjectId());
|
||||
}
|
||||
// despawn the mad cow
|
||||
npc.deleteMe();
|
||||
// spawn the new mob
|
||||
L2Attackable nextNpc = (L2Attackable) this.addSpawn(MAD_COW_POLYMORPH.get(npc.getNpcId()),npc);
|
||||
|
||||
// register the player in the feedinfo for the mob that just spawned
|
||||
_FeedInfo.put(nextNpc.getObjectId(), player.getObjectId());
|
||||
nextNpc.setRunning();
|
||||
nextNpc.addDamageHate(player,0,99999);
|
||||
nextNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event,npc,player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSkillSee (L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet)
|
||||
{
|
||||
// this behavior is only run when the target of skill is the passed npc (chest)
|
||||
// i.e. when the player is attempting to open the chest using a skill
|
||||
if (!Util.contains(targets,npc))
|
||||
{
|
||||
return super.onSkillSee(npc,caster,skill,targets,isPet);
|
||||
}
|
||||
// gather some values on local variables
|
||||
int npcId = npc.getNpcId();
|
||||
int skillId = skill.getId();
|
||||
// check if the npc and skills used are valid for this script. Exit if invalid.
|
||||
if (!Util.contains(FEEDABLE_BEASTS,npcId) || (skillId !=SKILL_GOLDEN_SPICE && skillId != SKILL_CRYSTAL_SPICE))
|
||||
{
|
||||
return super.onSkillSee(npc,caster,skill,targets,isPet);
|
||||
}
|
||||
|
||||
// first gather some values on local variables
|
||||
int objectId = npc.getObjectId();
|
||||
int growthLevel = 3; // if a mob is in FEEDABLE_BEASTS but not in _GrowthCapableMobs, then it's at max growth (3)
|
||||
if (_GrowthCapableMobs.containsKey(npcId))
|
||||
{
|
||||
growthLevel = _GrowthCapableMobs.get(npcId).getGrowthLevel();
|
||||
}
|
||||
|
||||
// prevent exploit which allows 2 players to simultaneously raise the same 0-growth beast
|
||||
// If the mob is at 0th level (when it still listens to all feeders) lock it to the first feeder!
|
||||
if (growthLevel==0 && _FeedInfo.containsKey(objectId))
|
||||
{
|
||||
return super.onSkillSee(npc,caster,skill,targets,isPet);
|
||||
}
|
||||
else
|
||||
{
|
||||
_FeedInfo.put(objectId,caster.getObjectId());
|
||||
}
|
||||
|
||||
int food = 0;
|
||||
if (skillId == SKILL_GOLDEN_SPICE)
|
||||
{
|
||||
food = GOLDEN_SPICE;
|
||||
}
|
||||
else if (skillId == SKILL_CRYSTAL_SPICE)
|
||||
{
|
||||
food = CRYSTAL_SPICE;
|
||||
}
|
||||
|
||||
// display the social action of the beast eating the food.
|
||||
npc.broadcastPacket(new SocialAction(npc,2));
|
||||
|
||||
// if this pet can't grow, it's all done.
|
||||
if (_GrowthCapableMobs.containsKey(npcId))
|
||||
{
|
||||
// do nothing if this mob doesn't eat the specified food (food gets consumed but has no effect).
|
||||
if (_GrowthCapableMobs.get(npcId).getMob(food, 0, 0) == null )
|
||||
{
|
||||
return super.onSkillSee(npc,caster,skill,targets,isPet);
|
||||
}
|
||||
|
||||
// rare random talk...
|
||||
if (Rnd.get(20) == 0 )
|
||||
{
|
||||
npc.broadcastPacket(new NpcSay(objectId,0,npc.getNpcId(),TEXT[growthLevel][Rnd.get(TEXT[growthLevel].length)]));
|
||||
}
|
||||
|
||||
if (growthLevel > 0 && _FeedInfo.get(objectId) != caster.getObjectId())
|
||||
{
|
||||
// check if this is the same player as the one who raised it from growth 0.
|
||||
// if no, then do not allow a chance to raise the pet (food gets consumed but has no effect).
|
||||
return super.onSkillSee(npc,caster,skill,targets,isPet);
|
||||
}
|
||||
|
||||
// Polymorph the mob, with a certain chance, given its current growth level
|
||||
if (Rnd.get(100) < _GrowthCapableMobs.get(npcId).getChance())
|
||||
{
|
||||
this.spawnNext(npc, growthLevel,caster,food);
|
||||
}
|
||||
}
|
||||
else if (Util.contains(TAMED_BEASTS,npcId) && npc instanceof L2TamedBeastInstance)
|
||||
{
|
||||
L2TamedBeastInstance beast = ((L2TamedBeastInstance)npc);
|
||||
if (skillId == beast.getFoodType())
|
||||
{
|
||||
beast.onReceiveFood();
|
||||
beast.broadcastPacket(new NpcSay(objectId,0,npcId,TAMED_TEXT[Rnd.get(TAMED_TEXT.length)]));
|
||||
}
|
||||
}
|
||||
return super.onSkillSee(npc,caster,skill,targets,isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill (L2Npc npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
// remove the feedinfo of the mob that got killed, if any
|
||||
if (_FeedInfo.containsKey(npc.getObjectId()))
|
||||
{
|
||||
_FeedInfo.remove(npc.getObjectId());
|
||||
}
|
||||
return super.onKill(npc,killer,isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// now call the constructor (starts up the ai)
|
||||
new FeedableBeasts(-1,"feedable_beasts","ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import com.l2jserver.gameserver.GeoData;
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.clientpackets.Say2;
|
||||
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
|
||||
|
||||
public class GiantScouts extends L2AttackableAIScript
|
||||
{
|
||||
final private static int _scouts[] = { 22668, 22669 };
|
||||
|
||||
public GiantScouts(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
for (int id : _scouts)
|
||||
addAggroRangeEnterId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isPet)
|
||||
{
|
||||
L2Character target = isPet ? player.getPet() : player;
|
||||
|
||||
if(GeoData.getInstance().canSeeTarget(npc, target))
|
||||
{
|
||||
if (!npc.isInCombat() && npc.getTarget() == null)
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), Say2.SHOUT, npc.getName(), "Oh Giants, an intruder has been discovered."));
|
||||
|
||||
npc.setTarget(target);
|
||||
npc.setRunning();
|
||||
((L2Attackable) npc).addDamageHate(target, 0, 999);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
|
||||
// Notify clan
|
||||
Collection<L2Object> objs = npc.getKnownList().getKnownObjects().values();
|
||||
for(L2Object obj : objs)
|
||||
{
|
||||
if (obj != null)
|
||||
{
|
||||
if (obj instanceof L2MonsterInstance)
|
||||
{
|
||||
L2MonsterInstance monster = (L2MonsterInstance) obj;
|
||||
if (( npc.getClan() != null && monster.getClan() != null) && monster.getClan().equals(npc.getClan()) && GeoData.getInstance().canSeeTarget(npc, monster))
|
||||
{
|
||||
monster.setTarget(target);
|
||||
monster.setRunning();
|
||||
monster.addDamageHate(target, 0, 999);
|
||||
monster.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAggroRangeEnter(npc, player, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new GiantScouts(-1, "GiantScouts", "ai");
|
||||
}
|
||||
}
|
||||
+250
@@ -0,0 +1,250 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import static com.l2jserver.gameserver.ai.CtrlIntention.AI_INTENTION_ATTACK;
|
||||
|
||||
import com.l2jserver.gameserver.ai.CtrlEvent;
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.datatables.NpcTable;
|
||||
import com.l2jserver.gameserver.instancemanager.DimensionalRiftManager;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2RiftInvaderInstance;
|
||||
import com.l2jserver.gameserver.model.quest.Quest;
|
||||
import com.l2jserver.gameserver.model.quest.jython.QuestJython;
|
||||
import com.l2jserver.gameserver.templates.chars.L2NpcTemplate;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
*
|
||||
* Overarching Superclass for all mob AI
|
||||
* @author Fulminus
|
||||
*
|
||||
*/
|
||||
public class L2AttackableAIScript extends QuestJython
|
||||
{
|
||||
|
||||
/**
|
||||
* This is used to register all monsters contained in mobs for a particular script<BR>
|
||||
* <FONT COLOR=#FF0000><B> <U>Caution</U> : This method register ID for all QuestEventTypes<BR>
|
||||
* Do not use for group_template AIs</B></FONT><BR>
|
||||
* @param mobs
|
||||
* @see #registerMobs(int[], QuestEventType...)
|
||||
*/
|
||||
public void registerMobs(int[] mobs)
|
||||
{
|
||||
for (int id : mobs)
|
||||
{
|
||||
addEventId(id, QuestEventType.ON_ATTACK);
|
||||
addEventId(id, QuestEventType.ON_KILL);
|
||||
addEventId(id, QuestEventType.ON_SPAWN);
|
||||
addEventId(id, QuestEventType.ON_SPELL_FINISHED);
|
||||
addEventId(id, QuestEventType.ON_SKILL_SEE);
|
||||
addEventId(id, QuestEventType.ON_FACTION_CALL);
|
||||
addEventId(id, QuestEventType.ON_AGGRO_RANGE_ENTER);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is used to register all monsters contained in mobs for a particular script
|
||||
* event types defined in types.
|
||||
* @param mobs
|
||||
* @param types
|
||||
*/
|
||||
public void registerMobs(int[] mobs, QuestEventType... types)
|
||||
{
|
||||
for (int id : mobs)
|
||||
{
|
||||
for (QuestEventType type : types)
|
||||
{
|
||||
addEventId(id, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public L2AttackableAIScript (int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent (String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(L2Npc npc, L2PcInstance player, L2Skill skill)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSkillSee (L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet)
|
||||
{
|
||||
if (caster == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (!(npc instanceof L2Attackable))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
L2Attackable attackable = (L2Attackable)npc;
|
||||
|
||||
int skillAggroPoints = skill.getAggroPoints();
|
||||
|
||||
if (caster.getPet() != null)
|
||||
{
|
||||
if (targets.length == 1 && Util.contains(targets, caster.getPet()))
|
||||
skillAggroPoints = 0;
|
||||
}
|
||||
|
||||
if (skillAggroPoints > 0)
|
||||
{
|
||||
if ( attackable.hasAI() && (attackable.getAI().getIntention() == AI_INTENTION_ATTACK))
|
||||
{
|
||||
L2Object npcTarget = attackable.getTarget();
|
||||
for (L2Object skillTarget : targets)
|
||||
{
|
||||
if (npcTarget == skillTarget || npc == skillTarget)
|
||||
{
|
||||
L2Character originalCaster = isPet? caster.getPet(): caster;
|
||||
attackable.addDamageHate(originalCaster, 0, (skillAggroPoints*150)/(attackable.getLevel()+7));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFactionCall (L2Npc npc, L2Npc caller, L2PcInstance attacker, boolean isPet)
|
||||
{
|
||||
if(attacker == null)
|
||||
return null;
|
||||
|
||||
L2Character originalAttackTarget = (isPet? attacker.getPet(): attacker);
|
||||
if ( attacker.isInParty()
|
||||
&& attacker.getParty().isInDimensionalRift())
|
||||
{
|
||||
byte riftType = attacker.getParty().getDimensionalRift().getType();
|
||||
byte riftRoom = attacker.getParty().getDimensionalRift().getCurrentRoom();
|
||||
|
||||
if (caller instanceof L2RiftInvaderInstance
|
||||
&& !DimensionalRiftManager.getInstance().getRoom(riftType, riftRoom).checkIfInZone(npc.getX(), npc.getY(), npc.getZ()))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// By default, when a faction member calls for help, attack the caller's attacker.
|
||||
// Notify the AI with EVT_AGGRESSION
|
||||
npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, originalAttackTarget, 1);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAggroRangeEnter (L2Npc npc, L2PcInstance player, boolean isPet)
|
||||
{
|
||||
if (player == null)
|
||||
return null;
|
||||
|
||||
L2Character target = isPet ? player.getPet() : player;
|
||||
|
||||
((L2Attackable) npc).addDamageHate(target, 0, 1);
|
||||
|
||||
// Set the intention to the L2Attackable to AI_INTENTION_ACTIVE
|
||||
if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE)
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn (L2Npc npc)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack (L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if ((attacker != null) && (npc instanceof L2Attackable))
|
||||
{
|
||||
L2Attackable attackable = (L2Attackable)npc;
|
||||
|
||||
L2Character originalAttacker = isPet? attacker.getPet(): attacker;
|
||||
attackable.getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, originalAttacker);
|
||||
attackable.addDamageHate(originalAttacker, damage, (damage*100)/(attackable.getLevel()+7));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill (L2Npc npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
if (npc instanceof L2MonsterInstance)
|
||||
{
|
||||
final L2MonsterInstance mob = (L2MonsterInstance)npc;
|
||||
if (mob.getLeader() != null)
|
||||
mob.getLeader().getMinionList().onMinionDie(mob, -1);
|
||||
|
||||
if (mob.hasMinions())
|
||||
mob.getMinionList().onMasterDie(false);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
L2AttackableAIScript ai = new L2AttackableAIScript(-1,"L2AttackableAIScript","L2AttackableAIScript");
|
||||
// register all mobs here...
|
||||
for (int level =1; level<100; level++)
|
||||
{
|
||||
L2NpcTemplate[] templates = NpcTable.getInstance().getAllOfLevel(level);
|
||||
if ((templates != null) && (templates.length > 0))
|
||||
{
|
||||
for (L2NpcTemplate t: templates)
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( L2Attackable.class.isAssignableFrom(Class.forName("com.l2jserver.gameserver.model.actor.instance."+t.type+"Instance")))
|
||||
{
|
||||
ai.addEventId(t.npcId, Quest.QuestEventType.ON_ATTACK);
|
||||
ai.addEventId(t.npcId, Quest.QuestEventType.ON_KILL);
|
||||
ai.addEventId(t.npcId, Quest.QuestEventType.ON_SPAWN);
|
||||
ai.addEventId(t.npcId, Quest.QuestEventType.ON_SKILL_SEE);
|
||||
ai.addEventId(t.npcId, Quest.QuestEventType.ON_FACTION_CALL);
|
||||
ai.addEventId(t.npcId, Quest.QuestEventType.ON_AGGRO_RANGE_ENTER);
|
||||
}
|
||||
}
|
||||
catch(ClassNotFoundException ex)
|
||||
{
|
||||
_log.info("Class not found "+t.type+"Instance");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import javolution.util.FastList;
|
||||
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.datatables.SkillTable;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.L2Playable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Summon;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
|
||||
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
|
||||
import com.l2jserver.gameserver.templates.skills.L2SkillType;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
public class Monastery extends L2AttackableAIScript
|
||||
{
|
||||
static final int[] mobs1 = {22124, 22125, 22126, 22127, 22129};
|
||||
static final int[] mobs2 = {22134, 22135};
|
||||
|
||||
static final int[] messages = {
|
||||
1121006, // You cannot carry a weapon without authorization!
|
||||
10077, // $s1, why would you choose the path of darkness?!
|
||||
10078 // $s1! How dare you defy the will of Einhasad!
|
||||
};
|
||||
public Monastery(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
registerMobs(mobs1, QuestEventType.ON_AGGRO_RANGE_ENTER, QuestEventType.ON_SPAWN, QuestEventType.ON_SPELL_FINISHED);
|
||||
registerMobs(mobs2, QuestEventType.ON_SKILL_SEE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isPet)
|
||||
{
|
||||
if (Util.contains(mobs1,npc.getNpcId()) && !npc.isInCombat() && npc.getTarget() == null)
|
||||
{
|
||||
if (player.getActiveWeaponInstance() != null)
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), 0, npc.getNpcId(), messages[0]));
|
||||
switch (npc.getNpcId())
|
||||
{
|
||||
case 22124:
|
||||
case 22126:
|
||||
{
|
||||
L2Skill skill = SkillTable.getInstance().getInfo(4589,8);
|
||||
npc.doCast(skill);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
npc.setIsRunning(true);
|
||||
((L2Attackable) npc).addDamageHate(player, 0, 999);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (((L2Attackable)npc).getMostHated() == null)
|
||||
return null;
|
||||
}
|
||||
return super.onAggroRangeEnter(npc, player, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSkillSee(L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet)
|
||||
{
|
||||
if (Util.contains(mobs2,npc.getNpcId()))
|
||||
{
|
||||
if (skill.getSkillType() == L2SkillType.AGGDAMAGE && targets.length != 0)
|
||||
{
|
||||
for (L2Object obj : targets)
|
||||
{
|
||||
if (obj.equals(npc))
|
||||
{
|
||||
NpcSay packet = new NpcSay(npc.getObjectId(), 0, npc.getNpcId(), messages[Rnd.get(2)+1]);
|
||||
packet.addStringParameter(caster.getName());
|
||||
npc.broadcastPacket(packet);
|
||||
((L2Attackable) npc).addDamageHate(caster, 0, 999);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, caster);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onSkillSee(npc, caster, skill, targets, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
if (Util.contains(mobs1,npc.getNpcId()))
|
||||
{
|
||||
FastList<L2Playable> result = new FastList<L2Playable>();
|
||||
Collection<L2Object> objs = npc.getKnownList().getKnownObjects().values();
|
||||
for (L2Object obj : objs)
|
||||
{
|
||||
if (obj instanceof L2PcInstance || obj instanceof L2PetInstance)
|
||||
{
|
||||
if (Util.checkIfInRange(npc.getAggroRange(), npc, obj, true) && !((L2Character) obj).isDead())
|
||||
result.add((L2Playable) obj);
|
||||
}
|
||||
}
|
||||
if (!result.isEmpty() && result.size() != 0)
|
||||
{
|
||||
Object[] characters = result.toArray();
|
||||
for (Object obj : characters)
|
||||
{
|
||||
L2Playable target = (L2Playable) (obj instanceof L2PcInstance ? obj : ((L2Summon) obj).getOwner());
|
||||
if (target.getActiveWeaponInstance() != null && !npc.isInCombat() && npc.getTarget() == null)
|
||||
{
|
||||
npc.setTarget(target);
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), 0, npc.getNpcId(), messages[0]));
|
||||
switch (npc.getNpcId())
|
||||
{
|
||||
case 22124:
|
||||
case 22126:
|
||||
case 22127:
|
||||
{
|
||||
L2Skill skill = SkillTable.getInstance().getInfo(4589,8);
|
||||
npc.doCast(skill);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
npc.setIsRunning(true);
|
||||
((L2Attackable) npc).addDamageHate(target, 0, 999);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(L2Npc npc, L2PcInstance player, L2Skill skill)
|
||||
{
|
||||
if (Util.contains(mobs1,npc.getNpcId()) && skill.getId() == 4589)
|
||||
{
|
||||
npc.setIsRunning(true);
|
||||
((L2Attackable) npc).addDamageHate(player, 0, 999);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Monastery(-1, "Monastery", "ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
/**
|
||||
** @author Gnacik
|
||||
*/
|
||||
public class PavelArchaic extends L2AttackableAIScript
|
||||
{
|
||||
private static final int[] _mobs1 = { 22801, 22804 };
|
||||
private static final int[] _mobs2 = { 18917 };
|
||||
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (!npc.isDead() && Util.contains(_mobs2, npc.getNpcId()))
|
||||
{
|
||||
npc.doDie(attacker);
|
||||
|
||||
if (Rnd.get(100) < 40)
|
||||
{
|
||||
L2Attackable _golem1 = (L2Attackable) addSpawn(22801, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
attackPlayer(_golem1, attacker);
|
||||
|
||||
L2Attackable _golem2 = (L2Attackable) addSpawn(22804, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
attackPlayer(_golem2, attacker);
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
if (Util.contains(_mobs1, npc.getNpcId()))
|
||||
{
|
||||
L2Attackable _golem = (L2Attackable) addSpawn(npc.getNpcId() + 1, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
attackPlayer(_golem, killer);
|
||||
}
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
private void attackPlayer(L2Attackable npc, L2PcInstance player)
|
||||
{
|
||||
npc.setIsRunning(true);
|
||||
npc.addDamageHate(player, 0, 999);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
|
||||
public PavelArchaic(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
registerMobs(_mobs1, QuestEventType.ON_KILL);
|
||||
registerMobs(_mobs2, QuestEventType.ON_ATTACK);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new PavelArchaic(-1, "PavelArchaic", "ai");
|
||||
}
|
||||
}
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.datatables.SkillTable;
|
||||
import com.l2jserver.gameserver.handler.ISkillHandler;
|
||||
import com.l2jserver.gameserver.handler.SkillHandler;
|
||||
import com.l2jserver.gameserver.model.L2CharPosition;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.L2Playable;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse;
|
||||
|
||||
/**
|
||||
** @author Gnacik
|
||||
**
|
||||
*/
|
||||
public class PlainsOfLizardman extends L2AttackableAIScript
|
||||
{
|
||||
private static final int[] _MOBS = { 18864, 18865, 18866, 18868 };
|
||||
|
||||
private static final int FANTASY_MUSHROOM = 18864;
|
||||
private static final int FANTASY_MUSHROOM_SKILL = 6427;
|
||||
|
||||
private static final int RAINBOW_FROG = 18866;
|
||||
private static final int RAINBOW_FROG_SKILL = 6429;
|
||||
|
||||
private static final int STICKY_MUSHROOM = 18865;
|
||||
private static final int STICKY_MUSHROOM_SKILL = 6428;
|
||||
|
||||
private static final int ENERGY_PLANT = 18868;
|
||||
private static final int ENERGY_PLANT_SKILL = 6430;
|
||||
|
||||
public PlainsOfLizardman(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
|
||||
registerMobs(_MOBS, QuestEventType.ON_ATTACK);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new PlainsOfLizardman(-1, "PlainsOfLizardman", "ai");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent (String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (player != null && !player.isAlikeDead())
|
||||
{
|
||||
boolean isPet = false;
|
||||
if (event.endsWith("_pet") && player.getPet() != null && !player.getPet().isDead())
|
||||
isPet = true;
|
||||
|
||||
if (event.startsWith("rainbow_frog"))
|
||||
{
|
||||
triggerSkill(npc, isPet ? player.getPet() : player, RAINBOW_FROG_SKILL, 1);
|
||||
}
|
||||
else if (event.startsWith("energy_plant"))
|
||||
{
|
||||
triggerSkill(npc, isPet ? player.getPet() : player, ENERGY_PLANT_SKILL, 1);
|
||||
}
|
||||
else if (event.startsWith("sticky_mushroom"))
|
||||
{
|
||||
triggerSkill(npc, isPet ? player.getPet() : player, STICKY_MUSHROOM_SKILL, 1);
|
||||
}
|
||||
else if (event.startsWith("fantasy_mushroom"))
|
||||
{
|
||||
L2Skill skill = SkillTable.getInstance().getInfo(FANTASY_MUSHROOM_SKILL, 1);
|
||||
npc.doCast(skill);
|
||||
for(L2Character target : npc.getKnownList().getKnownCharactersInRadius(200))
|
||||
{
|
||||
if (target != null && target instanceof L2Attackable && target.getAI() != null)
|
||||
{
|
||||
skill.getEffects(npc, target);
|
||||
attackPlayer((L2Attackable) target, isPet ? player.getPet() : player);
|
||||
}
|
||||
}
|
||||
npc.doDie(player);
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event,npc,player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (npc.isDead())
|
||||
return null;
|
||||
|
||||
if (npc.getNpcId() == RAINBOW_FROG)
|
||||
{
|
||||
if (isPet)
|
||||
startQuestTimer("rainbow_frog_pet", 2000, npc, attacker);
|
||||
else
|
||||
startQuestTimer("rainbow_frog", 2000, npc, attacker);
|
||||
npc.doDie(attacker);
|
||||
}
|
||||
else if (npc.getNpcId() == STICKY_MUSHROOM)
|
||||
{
|
||||
if (isPet)
|
||||
startQuestTimer("sticky_mushroom_pet", 2000, npc, attacker);
|
||||
else
|
||||
startQuestTimer("sticky_mushroom", 2000, npc, attacker);
|
||||
npc.doDie(attacker);
|
||||
}
|
||||
else if (npc.getNpcId() == ENERGY_PLANT)
|
||||
{
|
||||
if (isPet)
|
||||
startQuestTimer("energy_plant_pet", 2000, npc, attacker);
|
||||
else
|
||||
startQuestTimer("energy_plant", 2000, npc, attacker);
|
||||
npc.doDie(attacker);
|
||||
}
|
||||
else if (npc.getNpcId() == FANTASY_MUSHROOM)
|
||||
{
|
||||
for(L2Character target : npc.getKnownList().getKnownCharactersInRadius(1000))
|
||||
{
|
||||
if (target != null && target instanceof L2Attackable && target.getAI() != null)
|
||||
{
|
||||
target.setIsRunning(true);
|
||||
target.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(npc.getX(),npc.getY(), npc.getZ(), 0 ));
|
||||
}
|
||||
}
|
||||
if (isPet)
|
||||
startQuestTimer("fantasy_mushroom_pet", 3000, npc, attacker);
|
||||
else
|
||||
startQuestTimer("fantasy_mushroom", 3000, npc, attacker);
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
private void triggerSkill(L2Character caster, L2Playable playable, int skill_id, int skill_level)
|
||||
{
|
||||
L2Character[] targets = new L2Character[1];
|
||||
targets[0] = playable;
|
||||
|
||||
L2Skill trigger = SkillTable.getInstance().getInfo(skill_id, skill_level);
|
||||
|
||||
if (trigger != null
|
||||
&& playable.isInsideRadius(caster, trigger.getCastRange(), true, false)
|
||||
&& playable.getInstanceId() == caster.getInstanceId())
|
||||
{
|
||||
playable.broadcastPacket(new MagicSkillUse(playable, playable, skill_id, skill_level, 0, 0));
|
||||
|
||||
ISkillHandler handler = SkillHandler.getInstance().getSkillHandler(trigger.getSkillType());
|
||||
if (handler != null)
|
||||
handler.useSkill(playable, trigger, targets);
|
||||
else
|
||||
trigger.useSkill(playable, targets);
|
||||
}
|
||||
}
|
||||
|
||||
private void attackPlayer(L2Attackable npc, L2Playable playable)
|
||||
{
|
||||
npc.setIsRunning(true);
|
||||
npc.addDamageHate(playable, 0, 999);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, playable);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javolution.util.FastMap;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
*
|
||||
* Angel spawns...when one of the angels in the keys dies, the other angel will spawn.
|
||||
*
|
||||
*/
|
||||
public class PolymorphingAngel extends L2AttackableAIScript
|
||||
{
|
||||
|
||||
private static final Map<Integer,Integer> ANGELSPAWNS = new FastMap<Integer,Integer>();
|
||||
static
|
||||
{
|
||||
ANGELSPAWNS.put(20830,20859);
|
||||
ANGELSPAWNS.put(21067,21068);
|
||||
ANGELSPAWNS.put(21062,21063);
|
||||
ANGELSPAWNS.put(20831,20860);
|
||||
ANGELSPAWNS.put(21070,21071);
|
||||
}
|
||||
|
||||
public PolymorphingAngel(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
int[] temp = {20830,21067,21062,20831,21070};
|
||||
this.registerMobs(temp, QuestEventType.ON_KILL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill (L2Npc npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
int npcId = npc.getNpcId();
|
||||
if (ANGELSPAWNS.containsKey(npcId))
|
||||
{
|
||||
L2Attackable newNpc = (L2Attackable) this.addSpawn(ANGELSPAWNS.get(npcId),npc);
|
||||
newNpc.setRunning();
|
||||
}
|
||||
return super.onKill(npc,killer,isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// now call the constructor (starts up the ai)
|
||||
new PolymorphingAngel(-1,"polymorphing_angel","ai");
|
||||
}
|
||||
}
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import gnu.trove.TIntObjectHashMap;
|
||||
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.clientpackets.Say2;
|
||||
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
/**
|
||||
* @author Slyce
|
||||
*/
|
||||
public class PolymorphingOnAttack extends L2AttackableAIScript
|
||||
{
|
||||
private static final TIntObjectHashMap<Integer[]> MOBSPAWNS = new TIntObjectHashMap<Integer[]>();
|
||||
static
|
||||
{
|
||||
MOBSPAWNS.put(21258,new Integer[]{21259,100,100,-1}); //Fallen Orc Shaman -> Sharp Talon Tiger (always polymorphs)
|
||||
MOBSPAWNS.put(21261,new Integer[]{21262,100,20 ,0}); //Ol Mahum Transcender 1st stage
|
||||
MOBSPAWNS.put(21262,new Integer[]{21263,100,10 ,1}); //Ol Mahum Transcender 2nd stage
|
||||
MOBSPAWNS.put(21263,new Integer[]{21264,100,5 ,2}); //Ol Mahum Transcender 3rd stage
|
||||
MOBSPAWNS.put(21265,new Integer[]{21271,100,33 ,0}); //Cave Ant Larva -> Cave Ant
|
||||
MOBSPAWNS.put(21266,new Integer[]{21269,100,100,-1}); //Cave Ant Larva -> Cave Ant (always polymorphs)
|
||||
MOBSPAWNS.put(21267,new Integer[]{21270,100,100,-1}); //Cave Ant Larva -> Cave Ant Soldier (always polymorphs)
|
||||
MOBSPAWNS.put(21271,new Integer[]{21272,66,10 ,1}); //Cave Ant -> Cave Ant Soldier
|
||||
MOBSPAWNS.put(21272,new Integer[]{21273,33 ,5 ,2}); //Cave Ant Soldier -> Cave Noble Ant
|
||||
MOBSPAWNS.put(21521,new Integer[]{21522,100,30 ,-1}); //Claws of Splendor
|
||||
MOBSPAWNS.put(21527,new Integer[]{21528,100,30 ,-1}); //Anger of Splendor
|
||||
MOBSPAWNS.put(21533,new Integer[]{21534,100,30 ,-1}); //Alliance of Splendor
|
||||
MOBSPAWNS.put(21537,new Integer[]{21538,100,30 ,-1}); //Fang of Splendor
|
||||
}
|
||||
protected static final String[][] MOBTEXTS =
|
||||
{
|
||||
new String[]{"Enough fooling around. Get ready to die!", "You idiot! I've just been toying with you!", "Now the fun starts!"},
|
||||
new String[]{"I must admit, no one makes my blood boil quite like you do!", "Now the battle begins!", "Witness my true power!"},
|
||||
new String[]{"Prepare to die!", "I'll double my strength!", "You have more skill than I thought"}
|
||||
};
|
||||
|
||||
public PolymorphingOnAttack(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
for (int id : MOBSPAWNS.keys())
|
||||
super.addAttackId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack (L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (npc.isVisible() && !npc.isDead())
|
||||
{
|
||||
final Integer[] tmp = MOBSPAWNS.get(npc.getNpcId());
|
||||
if (tmp != null)
|
||||
{
|
||||
if (npc.getCurrentHp() <= (npc.getMaxHp() * tmp[1]/100.0)&& Rnd.get(100) < tmp[2])
|
||||
{
|
||||
if (tmp[3] >= 0)
|
||||
{
|
||||
String text = MOBTEXTS[tmp[3]][Rnd.get(MOBTEXTS[tmp[3]].length)];
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(),Say2.ALL,npc.getName(),text));
|
||||
}
|
||||
npc.deleteMe();
|
||||
L2Attackable newNpc = (L2Attackable) addSpawn(tmp[0], npc.getX(), npc.getY(), npc.getZ()+10, npc.getHeading(), false, 0, true);
|
||||
L2Character originalAttacker = isPet? attacker.getPet(): attacker;
|
||||
newNpc.setRunning();
|
||||
newNpc.addDamageHate(originalAttacker,0,500);
|
||||
newNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, originalAttacker);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack (npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new PolymorphingOnAttack(-1,"polymorphing_on_attack","ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javolution.util.FastMap;
|
||||
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.datatables.SkillTable;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
|
||||
public class PrisonGuards extends L2AttackableAIScript
|
||||
{
|
||||
final private static int GUARD1 = 18367;
|
||||
final private static int GUARD2 = 18368;
|
||||
final private static int STAMP = 10013;
|
||||
final private static String[] GUARDVARS = {"1st","2nd","3rd","4th"};
|
||||
final private static String qn = "IOPRace";
|
||||
|
||||
private final static int silence = 4098;
|
||||
private final static int pertification = 4578;
|
||||
private final static int eventTimer = 5239;
|
||||
|
||||
private boolean _firstAttacked = false;
|
||||
|
||||
private Map<L2Npc,Integer> _guards = new FastMap<L2Npc, Integer>();
|
||||
|
||||
public PrisonGuards(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
int[] mob = {GUARD1, GUARD2};
|
||||
registerMobs(mob);
|
||||
|
||||
// place 1
|
||||
_guards.put(addSpawn(GUARD2,160704,184704,-3704,49152,false,0),0);
|
||||
_guards.put(addSpawn(GUARD2,160384,184704,-3704,49152,false,0),0);
|
||||
_guards.put(addSpawn(GUARD1,160528,185216,-3704,49152,false,0),0);
|
||||
// place 2
|
||||
_guards.put(addSpawn(GUARD2,135120,171856,-3704,49152,false,0),1);
|
||||
_guards.put(addSpawn(GUARD2,134768,171856,-3704,49152,false,0),1);
|
||||
_guards.put(addSpawn(GUARD1,134928,172432,-3704,49152,false,0),1);
|
||||
// place 3
|
||||
_guards.put(addSpawn(GUARD2,146880,151504,-2872,49152,false,0),2);
|
||||
_guards.put(addSpawn(GUARD2,146366,151506,-2872,49152,false,0),2);
|
||||
_guards.put(addSpawn(GUARD1,146592,151888,-2872,49152,false,0),2);
|
||||
// place 4
|
||||
_guards.put(addSpawn(GUARD2,155840,160448,-3352,0,false,0),3);
|
||||
_guards.put(addSpawn(GUARD2,155840,159936,-3352,0,false,0),3);
|
||||
_guards.put(addSpawn(GUARD1,155578,160177,-3352,0,false,0),3);
|
||||
|
||||
for (L2Npc npc : _guards.keySet())
|
||||
{
|
||||
npc.setIsNoRndWalk(true);
|
||||
npc.setIsImmobilized(true);
|
||||
if (npc.getNpcId() == GUARD1)
|
||||
{
|
||||
npc.setIsInvul(true);
|
||||
npc.disableCoreAI(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equalsIgnoreCase("Respawn"))
|
||||
{
|
||||
L2Npc newGuard = addSpawn(npc.getNpcId(), npc.getSpawn().getLocx(), npc.getSpawn().getLocy(), npc.getSpawn().getLocz(), npc.getSpawn().getHeading(), false, 0);
|
||||
newGuard.setIsNoRndWalk(true);
|
||||
newGuard.setIsImmobilized(true);
|
||||
if (npc.getNpcId() == GUARD1)
|
||||
{
|
||||
newGuard.setIsInvul(true);
|
||||
newGuard.disableCoreAI(true);
|
||||
}
|
||||
|
||||
int place = _guards.get(npc);
|
||||
_guards.remove(npc);
|
||||
_guards.put(newGuard, place);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("attackEnd"))
|
||||
{
|
||||
if (npc.getNpcId() == GUARD2)
|
||||
{
|
||||
if (npc.getX() != npc.getSpawn().getLocx() || npc.getY() != npc.getSpawn().getLocy())
|
||||
{
|
||||
npc.teleToLocation(npc.getSpawn().getLocx(), npc.getSpawn().getLocy(), npc.getSpawn().getLocz(), npc.getSpawn().getHeading(), false);
|
||||
npc.setIsImmobilized(true);
|
||||
}
|
||||
((L2Attackable) npc).getAggroList().clear();
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSkillSee(L2Npc npc, L2PcInstance player, L2Skill skill, L2Object[] targets, boolean isPet)
|
||||
{
|
||||
L2Character caster = isPet ? player.getPet() : player;
|
||||
|
||||
if (npc.getNpcId() == GUARD2)
|
||||
{
|
||||
if (_firstAttacked && caster.getFirstEffect(eventTimer) == null)
|
||||
{
|
||||
if (caster.getFirstEffect(silence) == null)
|
||||
castDebuff(npc, caster, silence, isPet, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
return super.onSkillSee(npc, player, skill, targets, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isPet)
|
||||
{
|
||||
L2Character target = isPet ? player.getPet() : player;
|
||||
|
||||
if (npc.getNpcId() == GUARD2)
|
||||
{
|
||||
if (target.getFirstEffect(eventTimer) != null)
|
||||
{
|
||||
cancelQuestTimer("attackEnd", null, null);
|
||||
startQuestTimer("attackEnd", 180000, npc, null);
|
||||
|
||||
npc.setIsImmobilized(false);
|
||||
npc.setTarget(target);
|
||||
npc.setRunning();
|
||||
((L2Attackable) npc).addDamageHate(target, 0, 999);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (npc.getX() != npc.getSpawn().getLocx() || npc.getY() != npc.getSpawn().getLocy())
|
||||
{
|
||||
npc.teleToLocation(npc.getSpawn().getLocx(), npc.getSpawn().getLocy(), npc.getSpawn().getLocz(), npc.getSpawn().getHeading(), false);
|
||||
npc.setIsImmobilized(true);
|
||||
}
|
||||
((L2Attackable) npc).getAggroList().remove(target);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return super.onAggroRangeEnter(npc, player, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance player, int damage, boolean isPet)
|
||||
{
|
||||
L2Character attacker = isPet ? player.getPet() : player;
|
||||
|
||||
_firstAttacked = true;
|
||||
|
||||
if (attacker.getFirstEffect(eventTimer) == null)
|
||||
{
|
||||
if (attacker.getFirstEffect(pertification) == null)
|
||||
castDebuff(npc, attacker, pertification, isPet, true, false);
|
||||
|
||||
npc.setTarget(null);
|
||||
((L2Attackable) npc).getAggroList().remove(attacker);
|
||||
((L2Attackable) npc).stopHating(attacker);
|
||||
((L2Attackable) npc).abortAttack();
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (npc.getNpcId() == GUARD2)
|
||||
{
|
||||
cancelQuestTimer("attackEnd", null, null);
|
||||
startQuestTimer("attackEnd", 180000, npc, null);
|
||||
|
||||
npc.setIsImmobilized(false);
|
||||
npc.setTarget(attacker);
|
||||
npc.setRunning();
|
||||
((L2Attackable) npc).addDamageHate(attacker, 0, 999);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, attacker);
|
||||
}
|
||||
else if (npc.getNpcId() == GUARD1 && Rnd.get(100) < 5)
|
||||
{
|
||||
if (player.getQuestState(qn) != null && player.getQuestState(qn).getInt(GUARDVARS[_guards.get(npc)]) != 1)
|
||||
{
|
||||
player.getQuestState(qn).set(GUARDVARS[_guards.get(npc)], "1");
|
||||
player.getQuestState(qn).giveItems(STAMP, 1);
|
||||
}
|
||||
}
|
||||
|
||||
return super.onAttack(npc, player, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
|
||||
{
|
||||
if (_guards.containsKey(npc))
|
||||
startQuestTimer("Respawn", 20000, npc, null);
|
||||
|
||||
return super.onKill(npc, player, isPet);
|
||||
}
|
||||
|
||||
private void castDebuff(L2Npc npc, L2Character player, int effectId, boolean isSummon, boolean fromAttack, boolean isSpell)
|
||||
{
|
||||
if (fromAttack)
|
||||
{
|
||||
/*
|
||||
* 1800107 It's not easy to obtain.
|
||||
* 1800108 You're out of your mind coming here...
|
||||
*/
|
||||
int msg = (npc.getNpcId() == GUARD1 ? 1800107 : 1800108);
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), 0, npc.getNpcId(), msg));
|
||||
}
|
||||
|
||||
L2Skill skill = SkillTable.getInstance().getInfo(effectId, isSpell ? 9 : 1);
|
||||
if (skill != null)
|
||||
{
|
||||
npc.setTarget(isSummon ? player.getPet() : player);
|
||||
npc.doCast(skill);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new PrisonGuards(-1, "PrisonGuards", "ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
public class SearchingMaster extends L2AttackableAIScript
|
||||
{
|
||||
private static final int[] mobs =
|
||||
{
|
||||
20965,20966,20967,20968,20969,20970,20971,20972,20973
|
||||
};
|
||||
|
||||
public SearchingMaster(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
for (int id : mobs)
|
||||
addAttackId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance player, int damage, boolean isPet)
|
||||
{
|
||||
if (player == null)
|
||||
return null;
|
||||
|
||||
npc.setIsRunning(true);
|
||||
((L2Attackable) npc).addDamageHate(player, 0, 999);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
|
||||
return super.onAttack(npc, player, damage, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new SearchingMaster(-1, "SearchingMaster", "ai");
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.SpawnTable;
|
||||
import com.l2jserver.gameserver.model.L2Spawn;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
|
||||
public class SeeThroughSilentMove extends L2AttackableAIScript
|
||||
{
|
||||
private static final int[] MOBIDS = {18001,18002,22199,22215,22216,22217,22327,22746,22747,22748,22749,22750,22751,22752,22753,22754,22755,22756,22757,22758,22759,22760,22761,22762,22763,22764,22765,22794,22795,22796,22797,22798,22799,22800,29009,29010,29011,29012,29013};
|
||||
|
||||
public SeeThroughSilentMove(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
for (L2Spawn npc : SpawnTable.getInstance().getSpawnTable())
|
||||
if (Util.contains(MOBIDS,npc.getNpcid()) && npc.getLastSpawn() != null && npc.getLastSpawn() instanceof L2Attackable)
|
||||
((L2Attackable)npc.getLastSpawn()).setSeeThroughSilentMove(true);
|
||||
for (int npcId : MOBIDS)
|
||||
this.addSpawnId(npcId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
if (npc instanceof L2Attackable)
|
||||
((L2Attackable)npc).setSeeThroughSilentMove(true);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new SeeThroughSilentMove(-1, "SeeThroughSilentMove", "ai");
|
||||
}
|
||||
}
|
||||
+246
@@ -0,0 +1,246 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Map;
|
||||
|
||||
import javolution.util.FastMap;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.SkillTable;
|
||||
import com.l2jserver.gameserver.datatables.SpawnTable;
|
||||
import com.l2jserver.gameserver.instancemanager.ZoneManager;
|
||||
import com.l2jserver.gameserver.model.L2Spawn;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.quest.Quest;
|
||||
import com.l2jserver.gameserver.model.zone.L2ZoneType;
|
||||
import com.l2jserver.gameserver.model.zone.type.L2EffectZone;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
public class SeedOfAnnihilation extends Quest
|
||||
{
|
||||
final private static String qn = "SeedOfAnnihilation";
|
||||
private static final Map<Integer, int[]> _teleportZones = new FastMap<Integer, int[]>();
|
||||
private static final int ANNIHILATION_FURNACE = 18928;
|
||||
// Strength, Agility, Wisdom
|
||||
private static final int[] ZONE_BUFFS = { 0, 6443, 6444, 6442 };
|
||||
private static final int[][] ZONE_BUFFS_LIST = { {1,2,3},{1,3,2},{2,1,3},{2,3,1},{3,2,1},{3,1,2} };
|
||||
|
||||
// 0: Bistakon, 1: Reptilikon, 2: Cokrakon
|
||||
private SeedRegion[] _regionsData = new SeedRegion[3];
|
||||
private Long _seedsNextStatusChange;
|
||||
|
||||
private static class SeedRegion
|
||||
{
|
||||
public int[] elite_mob_ids;
|
||||
public int[][] minion_lists;
|
||||
public int buff_zone;
|
||||
public int[][] af_spawns;
|
||||
public L2Npc[] af_npcs = new L2Npc[2];
|
||||
public int activeBuff = 0;
|
||||
|
||||
public SeedRegion(int[] emi, int[][] ml, int bz, int[][] as)
|
||||
{
|
||||
elite_mob_ids = emi;
|
||||
minion_lists = ml;
|
||||
buff_zone = bz;
|
||||
af_spawns = as;
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
{
|
||||
_teleportZones.put(60002, new int[]{ -213175, 182648, -10992 });
|
||||
_teleportZones.put(60003, new int[]{ -181217, 186711, -10528 });
|
||||
_teleportZones.put(60004, new int[]{ -180211, 182984, -15152 });
|
||||
_teleportZones.put(60005, new int[]{ -179275, 186802, -10720 });
|
||||
}
|
||||
|
||||
public void loadSeedRegionData()
|
||||
{
|
||||
// Bistakon data
|
||||
_regionsData[0] = new SeedRegion(new int[]{ 22750, 22751, 22752, 22753 },
|
||||
new int[][]{ { 22746, 22746, 22746 }, { 22747, 22747, 22747 },
|
||||
{ 22748, 22748, 22748 }, { 22749, 22749, 22749 } }, 60006,
|
||||
new int[][]{ {-180450,185507,-10544,11632},{-180005,185489,-10544,11632} });
|
||||
|
||||
// Reptilikon data
|
||||
_regionsData[1] = new SeedRegion(new int[]{ 22757, 22758, 22759 },
|
||||
new int[][]{ { 22754, 22755, 22756 } }, 60007,
|
||||
new int[][]{ {-179600,186998,-10704,11632},{-179295,186444,-10704,11632} });
|
||||
|
||||
// Cokrakon data
|
||||
_regionsData[2] = new SeedRegion(new int[]{ 22763, 22764, 22765 },
|
||||
new int[][]{ { 22760, 22760, 22761 }, { 22760, 22760, 22762 },
|
||||
{ 22761, 22761, 22760 }, { 22761, 22761, 22762 }, { 22762, 22762, 22760 },
|
||||
{ 22762, 22762, 22761 } }, 60008,
|
||||
new int[][]{ {-180971,186361,-10528,11632},{-180758,186739,-10528,11632} });
|
||||
int buffsNow = 0;
|
||||
String var = loadGlobalQuestVar("SeedNextStatusChange");
|
||||
if (var.equalsIgnoreCase("") || Long.parseLong(var) < System.currentTimeMillis())
|
||||
{
|
||||
buffsNow = Rnd.get(ZONE_BUFFS_LIST.length);
|
||||
saveGlobalQuestVar("SeedBuffsList", String.valueOf(buffsNow));
|
||||
_seedsNextStatusChange = getNextSeedsStatusChangeTime();
|
||||
saveGlobalQuestVar("SeedNextStatusChange", String.valueOf(_seedsNextStatusChange));
|
||||
}
|
||||
else
|
||||
{
|
||||
_seedsNextStatusChange = Long.parseLong(var);
|
||||
buffsNow = Integer.parseInt(loadGlobalQuestVar("SeedBuffsList"));
|
||||
}
|
||||
for(int i = 0; i < _regionsData.length; i++)
|
||||
_regionsData[i].activeBuff = ZONE_BUFFS_LIST[buffsNow][i];
|
||||
}
|
||||
|
||||
private Long getNextSeedsStatusChangeTime()
|
||||
{
|
||||
Calendar reenter = Calendar.getInstance();
|
||||
reenter.set(Calendar.SECOND, 0);
|
||||
reenter.set(Calendar.MINUTE, 0);
|
||||
reenter.set(Calendar.HOUR_OF_DAY, 13);
|
||||
reenter.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
|
||||
if (reenter.getTimeInMillis() <= System.currentTimeMillis())
|
||||
reenter.add(Calendar.DAY_OF_MONTH, 7);
|
||||
return reenter.getTimeInMillis();
|
||||
}
|
||||
|
||||
public SeedOfAnnihilation(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
loadSeedRegionData();
|
||||
for(int i : _teleportZones.keySet())
|
||||
addEnterZoneId(i);
|
||||
for(int i = 0; i < _regionsData.length; i++)
|
||||
for(int j = 0; j < _regionsData[i].elite_mob_ids.length; j++)
|
||||
addSpawnId(_regionsData[i].elite_mob_ids[j]);
|
||||
addStartNpc(32739);
|
||||
addTalkId(32739);
|
||||
initialMinionsSpawn();
|
||||
startEffectZonesControl();
|
||||
}
|
||||
|
||||
private void startEffectZonesControl()
|
||||
{
|
||||
for(int i = 0; i < _regionsData.length; i++)
|
||||
{
|
||||
for(int j = 0; j < _regionsData[i].af_spawns.length; j++)
|
||||
{
|
||||
_regionsData[i].af_npcs[j] = addSpawn(ANNIHILATION_FURNACE, _regionsData[i].af_spawns[j][0], _regionsData[i].af_spawns[j][1], _regionsData[i].af_spawns[j][2], _regionsData[i].af_spawns[j][3], false, 0);
|
||||
_regionsData[i].af_npcs[j].setDisplayEffect(_regionsData[i].activeBuff);
|
||||
}
|
||||
ZoneManager.getInstance().getZoneById(_regionsData[i].buff_zone, L2EffectZone.class).addSkill(ZONE_BUFFS[_regionsData[i].activeBuff], 1);
|
||||
}
|
||||
startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
|
||||
}
|
||||
|
||||
private void initialMinionsSpawn()
|
||||
{
|
||||
for (L2Spawn spawn : SpawnTable.getInstance().getSpawnTable())
|
||||
{
|
||||
if (spawn == null)
|
||||
continue;
|
||||
for(int i = 0; i < _regionsData.length; i++)
|
||||
{
|
||||
if (Util.contains(_regionsData[i].elite_mob_ids, spawn.getNpcid()))
|
||||
{
|
||||
L2MonsterInstance mob = (L2MonsterInstance) spawn.getLastSpawn();
|
||||
if (mob != null)
|
||||
spawnGroupOfMinion(mob, _regionsData[i].minion_lists[Rnd.get(_regionsData[i].minion_lists.length)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void spawnGroupOfMinion(L2MonsterInstance npc, int[] mobIds)
|
||||
{
|
||||
for (int i = 0; i < mobIds.length; i++)
|
||||
addMinion(npc, mobIds[i]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
for(int i = 0; i < _regionsData.length; i++)
|
||||
{
|
||||
if (Util.contains(_regionsData[i].elite_mob_ids, npc.getNpcId()))
|
||||
spawnGroupOfMinion((L2MonsterInstance)npc, _regionsData[i].minion_lists[Rnd.get(_regionsData[i].minion_lists.length)]);
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent (String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equalsIgnoreCase("ChangeSeedsStatus"))
|
||||
{
|
||||
int buffsNow = Rnd.get(ZONE_BUFFS_LIST.length);
|
||||
saveGlobalQuestVar("SeedBuffsList", String.valueOf(buffsNow));
|
||||
_seedsNextStatusChange = getNextSeedsStatusChangeTime();
|
||||
saveGlobalQuestVar("SeedNextStatusChange", String.valueOf(_seedsNextStatusChange));
|
||||
for(int i = 0; i < _regionsData.length; i++)
|
||||
{
|
||||
_regionsData[i].activeBuff = ZONE_BUFFS_LIST[buffsNow][i];
|
||||
|
||||
for(L2Npc af : _regionsData[i].af_npcs)
|
||||
af.setDisplayEffect(_regionsData[i].activeBuff);
|
||||
|
||||
L2EffectZone zone = ZoneManager.getInstance().getZoneById(_regionsData[i].buff_zone, L2EffectZone.class);
|
||||
zone.clearSkills();
|
||||
zone.addSkill(ZONE_BUFFS[_regionsData[i].activeBuff], 1);
|
||||
}
|
||||
startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("transform"))
|
||||
{
|
||||
if (player.getFirstEffect(6408) != null)
|
||||
npc.showChatWindow(player, 2);
|
||||
else
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(6408, 1));
|
||||
npc.doCast(SkillTable.getInstance().getInfo(6649, 1));
|
||||
npc.showChatWindow(player, 1);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill (L2Npc npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
return super.onKill(npc,killer,isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onEnterZone(L2Character character, L2ZoneType zone)
|
||||
{
|
||||
if (_teleportZones.containsKey(zone.getId()))
|
||||
{
|
||||
int[] teleLoc = _teleportZones.get(zone.getId());
|
||||
character.teleToLocation(teleLoc[0],teleLoc[1],teleLoc[2]);
|
||||
}
|
||||
return super.onEnterZone(character, zone);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new SeedOfAnnihilation(-1,qn,"ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.datatables.SkillTable;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse;
|
||||
import com.l2jserver.gameserver.util.Broadcast;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
public class StakatoNest extends L2AttackableAIScript
|
||||
{
|
||||
// List of all mobs just for register
|
||||
private static final int[] _stakato_mobs = { 18793, 18794, 18795, 18796, 18797, 18798, 22617, 22618, 22619, 22620, 22621, 22622, 22623, 22624, 22625, 22626, 22627, 22628, 22629, 22630, 22631, 22632, 22633, 25667 };
|
||||
// Coocons
|
||||
private static final int[] _cocoons = { 18793, 18794, 18795, 18796, 18797, 18798 };
|
||||
|
||||
// Cannibalistic Stakato Leader
|
||||
private static final int _stakato_leader = 22625;
|
||||
|
||||
// Spike Stakato Nurse
|
||||
private static final int _stakato_nurse = 22630;
|
||||
// Spike Stakato Nurse (Changed)
|
||||
private static final int _stakato_nurse_2 = 22631;
|
||||
// Spiked Stakato Baby
|
||||
private static final int _stakato_baby = 22632;
|
||||
// Spiked Stakato Captain
|
||||
private static final int _stakato_captain = 22629;
|
||||
|
||||
// Female Spiked Stakato
|
||||
private static final int _stakato_female = 22620;
|
||||
// Male Spiked Stakato
|
||||
private static final int _stakato_male = 22621;
|
||||
// Male Spiked Stakato (Changed)
|
||||
private static final int _stakato_male_2 = 22622;
|
||||
// Spiked Stakato Guard
|
||||
private static final int _stakato_guard = 22619;
|
||||
|
||||
// Cannibalistic Stakato Chief
|
||||
private static final int _stakato_chief = 25667;
|
||||
// Growth Accelerator
|
||||
private static final int _growth_accelerator = 2905;
|
||||
// Small Stakato Cocoon
|
||||
private static final int _small_cocoon = 14833;
|
||||
// Large Stakato Cocoon
|
||||
private static final int _large_cocoon = 14834;
|
||||
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
L2MonsterInstance _mob = (L2MonsterInstance) npc;
|
||||
|
||||
if ((_mob.getNpcId() == _stakato_leader) && (Rnd.get(1000) < 100) && (_mob.getCurrentHp() < (_mob.getMaxHp() * 0.3)))
|
||||
{
|
||||
L2MonsterInstance _follower = checkMinion(npc);
|
||||
|
||||
if (_follower != null)
|
||||
{
|
||||
double _hp = _follower.getCurrentHp();
|
||||
|
||||
if (_hp > (_follower.getMaxHp() * 0.3))
|
||||
{
|
||||
_mob.abortAttack();
|
||||
_mob.abortCast();
|
||||
_mob.setHeading(Util.calculateHeadingFrom(_mob, _follower));
|
||||
_mob.doCast(SkillTable.getInstance().getInfo(4484, 1));
|
||||
_mob.setCurrentHp(_mob.getCurrentHp() + _hp);
|
||||
_follower.doDie(_follower);
|
||||
_follower.deleteMe();
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
L2MonsterInstance _minion = checkMinion(npc);
|
||||
|
||||
if (npc.getNpcId() == _stakato_nurse && _minion != null)
|
||||
{
|
||||
Broadcast.toSelfAndKnownPlayers(npc, new MagicSkillUse(npc, 2046, 1, 1000, 0));
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
L2Npc _spawned = addSpawn(_stakato_captain, _minion, true);
|
||||
attackPlayer(killer, _spawned);
|
||||
}
|
||||
}
|
||||
else if (npc.getNpcId() == _stakato_baby)
|
||||
{
|
||||
L2MonsterInstance _leader = ((L2MonsterInstance) npc).getLeader();
|
||||
if(_leader != null && !_leader.isDead())
|
||||
{
|
||||
startQuestTimer("nurse_change", 5000, _leader, killer);
|
||||
}
|
||||
}
|
||||
else if (npc.getNpcId() == _stakato_male && _minion != null)
|
||||
{
|
||||
Broadcast.toSelfAndKnownPlayers(npc, new MagicSkillUse(npc, 2046, 1, 1000, 0));
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
L2Npc _spawned = addSpawn(_stakato_guard, _minion, true);
|
||||
attackPlayer(killer, _spawned);
|
||||
}
|
||||
}
|
||||
else if (npc.getNpcId() == _stakato_female)
|
||||
{
|
||||
L2MonsterInstance _leader = ((L2MonsterInstance) npc).getLeader();
|
||||
if(_leader != null && !_leader.isDead())
|
||||
{
|
||||
startQuestTimer("male_change", 5000, _leader, killer);
|
||||
}
|
||||
}
|
||||
else if (npc.getNpcId() == _stakato_chief)
|
||||
{
|
||||
if (killer.isInParty())
|
||||
{
|
||||
List<L2PcInstance> party = killer.getParty().getPartyMembers();
|
||||
for (L2PcInstance member : party)
|
||||
giveCocoon(member, npc);
|
||||
}
|
||||
else
|
||||
giveCocoon(killer, npc);
|
||||
}
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSkillSee(L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet)
|
||||
{
|
||||
if (Util.contains(_cocoons, npc.getNpcId()) && Util.contains(targets, npc) && skill.getId() == _growth_accelerator)
|
||||
{
|
||||
npc.doDie(caster);
|
||||
L2Npc _spawned = addSpawn(_stakato_chief, npc.getX(), npc.getY(), npc.getZ(), Util.calculateHeadingFrom(npc, caster), false, 0, true);
|
||||
attackPlayer(caster, _spawned);
|
||||
}
|
||||
return super.onSkillSee(npc, caster, skill, targets, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if ((npc == null) || (player == null))
|
||||
return null;
|
||||
if(npc.isDead())
|
||||
return null;
|
||||
|
||||
if (event.equalsIgnoreCase("nurse_change"))
|
||||
{
|
||||
npc.getSpawn().decreaseCount(npc);
|
||||
npc.deleteMe();
|
||||
L2Npc _spawned = addSpawn(_stakato_nurse_2, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0, true);
|
||||
attackPlayer(player, _spawned);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("male_change"))
|
||||
{
|
||||
npc.getSpawn().decreaseCount(npc);
|
||||
npc.deleteMe();
|
||||
L2Npc _spawned = addSpawn(_stakato_male_2, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0, true);
|
||||
attackPlayer(player, _spawned);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public StakatoNest(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
|
||||
this.registerMobs(_stakato_mobs);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new StakatoNest(-1, "StakatoNestAI", "ai");
|
||||
}
|
||||
|
||||
private L2MonsterInstance checkMinion(L2Npc npc)
|
||||
{
|
||||
L2MonsterInstance mob = (L2MonsterInstance) npc;
|
||||
if (mob.hasMinions())
|
||||
{
|
||||
List<L2MonsterInstance> _minion = mob.getMinionList().getSpawnedMinions();
|
||||
if ((_minion != null) && !_minion.isEmpty() && (_minion.get(0) != null) && !_minion.get(0).isDead())
|
||||
return _minion.get(0);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void attackPlayer(L2PcInstance player, L2Npc npc)
|
||||
{
|
||||
if (npc != null && player != null)
|
||||
{
|
||||
((L2Attackable) npc).setIsRunning(true);
|
||||
((L2Attackable) npc).addDamageHate(player, 0, 999);
|
||||
((L2Attackable) npc).getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
}
|
||||
|
||||
private void giveCocoon(L2PcInstance player, L2Npc npc)
|
||||
{
|
||||
if (Rnd.get(100) > 80)
|
||||
player.addItem("StakatoCocoon", _large_cocoon, 1, npc, true);
|
||||
else
|
||||
player.addItem("StakatoCocoon", _small_cocoon, 1, npc, true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
public class StarStones extends L2AttackableAIScript
|
||||
{
|
||||
private static final int[] mobs = {18684, 18685, 18686, 18687, 18688, 18689, 18690, 18691, 18692};
|
||||
private static final int RATE = 1;
|
||||
|
||||
public StarStones(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
this.registerMobs(mobs, QuestEventType.ON_SKILL_SEE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSkillSee (L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet)
|
||||
{
|
||||
if (Util.contains(targets, npc) && skill.getId() == 932)
|
||||
{
|
||||
int itemId = 0;
|
||||
|
||||
switch(npc.getNpcId())
|
||||
{
|
||||
case 18684:
|
||||
case 18685:
|
||||
case 18686:
|
||||
// give Red item
|
||||
itemId = 14009;
|
||||
break;
|
||||
case 18687:
|
||||
case 18688:
|
||||
case 18689:
|
||||
// give Blue item
|
||||
itemId = 14010;
|
||||
break;
|
||||
case 18690:
|
||||
case 18691:
|
||||
case 18692:
|
||||
// give Green item
|
||||
itemId = 14011;
|
||||
break;
|
||||
default:
|
||||
// unknown npc!
|
||||
return super.onSkillSee(npc, caster, skill, targets, isPet);
|
||||
}
|
||||
if (Rnd.get(100) < 33)
|
||||
{
|
||||
caster.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.THE_COLLECTION_HAS_SUCCEEDED));
|
||||
caster.addItem("StarStone", itemId, Rnd.get(RATE + 1, 2 * RATE), null, true);
|
||||
}
|
||||
else if ((skill.getLevel() == 1 && Rnd.get(100) < 15) ||
|
||||
(skill.getLevel() == 2 && Rnd.get(100) < 50) ||
|
||||
(skill.getLevel() == 3 && Rnd.get(100) < 75))
|
||||
{
|
||||
caster.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.THE_COLLECTION_HAS_SUCCEEDED));
|
||||
caster.addItem("StarStone", itemId, Rnd.get(1, RATE), null, true);
|
||||
}
|
||||
else
|
||||
caster.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.THE_COLLECTION_HAS_FAILED));
|
||||
npc.deleteMe();
|
||||
}
|
||||
return super.onSkillSee(npc, caster, skill, targets, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new StarStones(-1, "starstones", "ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
/*
|
||||
* 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_template;
|
||||
|
||||
import gnu.trove.TIntHashSet;
|
||||
import gnu.trove.TIntObjectHashMap;
|
||||
import javolution.util.FastList;
|
||||
import javolution.util.FastMap;
|
||||
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
public class SummonMinions extends L2AttackableAIScript
|
||||
{
|
||||
private static int HasSpawned;
|
||||
private static TIntHashSet myTrackingSet = new TIntHashSet(); //Used to track instances of npcs
|
||||
private FastMap<Integer, FastList<L2PcInstance>> _attackersList = new FastMap<Integer, FastList<L2PcInstance>>().shared();
|
||||
private static final TIntObjectHashMap<int[]> MINIONS = new TIntObjectHashMap<int[]>();
|
||||
|
||||
static
|
||||
{
|
||||
MINIONS.put(20767,new int[]{20768,20769,20770}); //Timak Orc Troop
|
||||
//MINIONS.put(22030,new Integer[]{22045,22047,22048}); //Ragna Orc Shaman
|
||||
//MINIONS.put(22032,new Integer[]{22036}); //Ragna Orc Warrior - summons shaman but not 22030 ><
|
||||
//MINIONS.put(22038,new Integer[]{22037}); //Ragna Orc Hero
|
||||
MINIONS.put(21524,new int[]{21525}); //Blade of Splendor
|
||||
MINIONS.put(21531,new int[]{21658}); //Punishment of Splendor
|
||||
MINIONS.put(21539,new int[]{21540}); //Wailing of Splendor
|
||||
MINIONS.put(22257,new int[]{18364,18364}); //Island Guardian
|
||||
MINIONS.put(22258,new int[]{18364,18364}); //White Sand Mirage
|
||||
MINIONS.put(22259,new int[]{18364,18364}); //Muddy Coral
|
||||
MINIONS.put(22260,new int[]{18364,18364}); //Kleopora
|
||||
MINIONS.put(22261,new int[]{18365,18365}); //Seychelles
|
||||
MINIONS.put(22262,new int[]{18365,18365}); //Naiad
|
||||
MINIONS.put(22263,new int[]{18365,18365}); //Sonneratia
|
||||
MINIONS.put(22264,new int[]{18366,18366}); //Castalia
|
||||
MINIONS.put(22265,new int[]{18366,18366}); //Chrysocolla
|
||||
MINIONS.put(22266,new int[]{18366,18366}); //Pythia
|
||||
MINIONS.put(22774,new int[]{22768,22768}); // Tanta Lizardman Summoner
|
||||
}
|
||||
|
||||
public SummonMinions(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
int[] temp =
|
||||
{
|
||||
20767, 21524, 21531, 21539, 22257, 22258, 22259, 22260, 22261, 22262, 22263, 22264, 22265, 22266, 22774
|
||||
};
|
||||
this.registerMobs(temp, QuestEventType.ON_ATTACK, QuestEventType.ON_KILL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
int npcId = npc.getNpcId();
|
||||
int npcObjId = npc.getObjectId();
|
||||
if (MINIONS.containsKey(npcId))
|
||||
{
|
||||
if (!myTrackingSet.contains(npcObjId)) //this allows to handle multiple instances of npc
|
||||
{
|
||||
synchronized (myTrackingSet)
|
||||
{
|
||||
myTrackingSet.add(npcObjId);
|
||||
}
|
||||
|
||||
HasSpawned = npcObjId;
|
||||
}
|
||||
if (HasSpawned == npcObjId)
|
||||
{
|
||||
switch (npcId)
|
||||
{
|
||||
case 22030: //mobs that summon minions only on certain hp
|
||||
case 22032:
|
||||
case 22038:
|
||||
{
|
||||
if (npc.getCurrentHp() < (npc.getMaxHp() / 2.0))
|
||||
{
|
||||
HasSpawned = 0;
|
||||
if (Rnd.get(100) < 33) //mobs that summon minions only on certain chance
|
||||
{
|
||||
int[] minions = MINIONS.get(npcId);
|
||||
for (int val : minions)
|
||||
{
|
||||
L2Attackable newNpc = (L2Attackable) this.addSpawn(val, (npc.getX() + Rnd.get(-150, 150)), (npc.getY() + Rnd.get(-150, 150)), npc.getZ(), 0, false, 0);
|
||||
newNpc.setRunning();
|
||||
newNpc.addDamageHate(attacker, 0, 999);
|
||||
newNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, attacker);
|
||||
}
|
||||
minions = null;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 22257:
|
||||
case 22258:
|
||||
case 22259:
|
||||
case 22260:
|
||||
case 22261:
|
||||
case 22262:
|
||||
case 22263:
|
||||
case 22264:
|
||||
case 22265:
|
||||
case 22266:
|
||||
{
|
||||
if (isPet)
|
||||
attacker = (attacker).getPet().getOwner();
|
||||
if (attacker.getParty() != null)
|
||||
{
|
||||
for (L2PcInstance member : attacker.getParty().getPartyMembers())
|
||||
{
|
||||
if (_attackersList.get(npcObjId) == null)
|
||||
{
|
||||
FastList<L2PcInstance> player = new FastList<L2PcInstance>();
|
||||
player.add(member);
|
||||
_attackersList.put(npcObjId,player);
|
||||
}
|
||||
else if (!_attackersList.get(npcObjId).contains(member))
|
||||
_attackersList.get(npcObjId).add(member);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_attackersList.get(npcObjId) == null)
|
||||
{
|
||||
FastList<L2PcInstance> player = new FastList<L2PcInstance>();
|
||||
player.add(attacker);
|
||||
_attackersList.put(npcObjId,player);
|
||||
}
|
||||
else if (!_attackersList.get(npcObjId).contains(attacker))
|
||||
_attackersList.get(npcObjId).add(attacker);
|
||||
}
|
||||
if ((attacker.getParty() != null && attacker.getParty().getMemberCount() > 2)||_attackersList.get(npcObjId).size() > 2) //Just to make sure..
|
||||
{
|
||||
HasSpawned = 0;
|
||||
for (int val : MINIONS.get(npcId))
|
||||
{
|
||||
L2Attackable newNpc = (L2Attackable) this.addSpawn(val, npc.getX() + Rnd.get(-150, 150), npc.getY() + Rnd.get(-150, 150), npc.getZ(), 0, false, 0);
|
||||
newNpc.setRunning();
|
||||
newNpc.addDamageHate(attacker, 0, 999);
|
||||
newNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, attacker);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: //mobs without special conditions
|
||||
{
|
||||
HasSpawned = 0;
|
||||
if (npcId != 20767)
|
||||
{
|
||||
for (int val : MINIONS.get(npcId))
|
||||
{
|
||||
L2Attackable newNpc = (L2Attackable) this.addSpawn(val, npc.getX() + Rnd.get(-150, 150), npc.getY() + Rnd.get(-150, 150), npc.getZ(), 0, false, 0);
|
||||
newNpc.setRunning();
|
||||
newNpc.addDamageHate(attacker, 0, 999);
|
||||
newNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, attacker);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int val : MINIONS.get(npcId))
|
||||
{
|
||||
this.addSpawn(val, (npc.getX() + Rnd.get(-100, 100)), (npc.getY() + Rnd.get(-100, 100)), npc.getZ(), 0, false, 0);
|
||||
}
|
||||
}
|
||||
if (npcId == 20767)
|
||||
{
|
||||
npc.broadcastPacket(new NpcSay(npcObjId, 0, npcId, 1000294)); // Come out, you children of darkness!
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
int npcId = npc.getNpcId();
|
||||
int npcObjId = npc.getObjectId();
|
||||
if (MINIONS.containsKey(npcId))
|
||||
{
|
||||
synchronized (myTrackingSet)
|
||||
{
|
||||
myTrackingSet.remove(npcObjId);
|
||||
}
|
||||
}
|
||||
if (_attackersList.get(npcObjId) != null)
|
||||
{
|
||||
_attackersList.get(npcObjId).clear();
|
||||
}
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// now call the constructor (starts up the ai)
|
||||
new SummonMinions(-1, "SummonMinions", "ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
Group Template AI:
|
||||
This folder contains AI scripts for group templates. That is, if many different mobs share the same behaviour,
|
||||
a group AI script can be created for all of them. Such group templates ought to be here.
|
||||
|
||||
Group templates can be subclassed. In other words, a group may inherit from another group. For example,
|
||||
one group template might define mobs that cast spells. Another template may then define the AI for mobs
|
||||
that cast spells AND use shots. In that case, instead of rewriting all the attack and spell-use AI, we can
|
||||
inherit from the first group template, then add the new behaviours, and split up the NPC registrations appropriately.
|
||||
|
||||
"NPC registrations" refers to the addition of NPCs in the various events of the scripts, such as onAttack, onKill, etc
|
||||
Those are done by using keywords such as "addKillId" etc. For more details on registrations, see
|
||||
"scripts/quests/documentation.txt"
|
||||
@@ -0,0 +1,911 @@
|
||||
/*
|
||||
* 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.individual;
|
||||
|
||||
import gnu.trove.TIntObjectHashMap;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
|
||||
import javolution.util.FastList;
|
||||
import ai.group_template.L2AttackableAIScript;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.GeoData;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.datatables.NpcTable;
|
||||
import com.l2jserver.gameserver.datatables.SkillTable;
|
||||
import com.l2jserver.gameserver.datatables.SpawnTable;
|
||||
import com.l2jserver.gameserver.instancemanager.GrandBossManager;
|
||||
import com.l2jserver.gameserver.model.L2CharPosition;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
import com.l2jserver.gameserver.model.L2Spawn;
|
||||
import com.l2jserver.gameserver.model.L2World;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2GrandBossInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.zone.type.L2BossZone;
|
||||
import com.l2jserver.gameserver.network.serverpackets.Earthquake;
|
||||
import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
|
||||
import com.l2jserver.gameserver.network.serverpackets.PlaySound;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SpecialCamera;
|
||||
import com.l2jserver.gameserver.templates.StatsSet;
|
||||
import com.l2jserver.gameserver.templates.chars.L2NpcTemplate;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
/**
|
||||
*
|
||||
* This class ... control for sequence of fight against Antharas.
|
||||
*
|
||||
* @version $Revision: $ $Date: $
|
||||
* @author L2J_JP SANDMAN
|
||||
*/
|
||||
public class Antharas extends L2AttackableAIScript
|
||||
{
|
||||
// config
|
||||
private static final int FWA_ACTIVITYTIMEOFANTHARAS = 120;
|
||||
//private static final int FWA_APPTIMEOFANTHARAS = 1800000;
|
||||
private static final int FWA_INACTIVITYTIME = 900000;
|
||||
private static final boolean FWA_OLDANTHARAS = false;
|
||||
private static final boolean FWA_MOVEATRANDOM = true;
|
||||
private static final boolean FWA_DOSERVEREARTHQUAKE = true;
|
||||
private static final int FWA_LIMITOFWEAK = 45;
|
||||
private static final int FWA_LIMITOFNORMAL = 63;
|
||||
|
||||
private static final int FWA_MAXMOBS = 10; // this includes Antharas itself
|
||||
private static final int FWA_INTERVALOFMOBSWEAK = 180000;
|
||||
private static final int FWA_INTERVALOFMOBSNORMAL = 150000;
|
||||
private static final int FWA_INTERVALOFMOBSSTRONG = 120000;
|
||||
private static final int FWA_PERCENTOFBEHEMOTH = 60;
|
||||
private static final int FWA_SELFDESTRUCTTIME = 15000;
|
||||
// Location of teleport cube.
|
||||
private final int _teleportCubeId = 31859;
|
||||
private final int _teleportCubeLocation[][] = { { 177615, 114941, -7709, 0 } };
|
||||
|
||||
protected List<L2Spawn> _teleportCubeSpawn = new FastList<L2Spawn>();
|
||||
protected List<L2Npc> _teleportCube = new FastList<L2Npc>();
|
||||
|
||||
// Spawn data of monsters.
|
||||
protected TIntObjectHashMap<L2Spawn> _monsterSpawn = new TIntObjectHashMap<L2Spawn>();
|
||||
|
||||
// Instance of monsters.
|
||||
protected List<L2Npc> _monsters = new FastList<L2Npc>();
|
||||
protected L2GrandBossInstance _antharas = null;
|
||||
|
||||
// monstersId
|
||||
private static final int ANTHARASOLDID = 29019;
|
||||
private static final int ANTHARASWEAKID = 29066;
|
||||
private static final int ANTHARASNORMALID = 29067;
|
||||
private static final int ANTHARASSTRONGID = 29068;
|
||||
|
||||
// Tasks.
|
||||
protected ScheduledFuture<?> _cubeSpawnTask = null;
|
||||
protected ScheduledFuture<?> _monsterSpawnTask = null;
|
||||
protected ScheduledFuture<?> _activityCheckTask = null;
|
||||
protected ScheduledFuture<?> _socialTask = null;
|
||||
protected ScheduledFuture<?> _mobiliseTask = null;
|
||||
protected ScheduledFuture<?> _mobsSpawnTask = null;
|
||||
protected ScheduledFuture<?> _selfDestructionTask = null;
|
||||
protected ScheduledFuture<?> _moveAtRandomTask = null;
|
||||
protected ScheduledFuture<?> _movieTask = null;
|
||||
|
||||
//Antharas Status Tracking :
|
||||
private static final byte DORMANT = 0; //Antharas is spawned and no one has entered yet. Entry is unlocked
|
||||
private static final byte WAITING = 1; //Antharas is spawend and someone has entered, triggering a 30 minute window for additional people to enter
|
||||
//before he unleashes his attack. Entry is unlocked
|
||||
private static final byte FIGHTING = 2; //Antharas is engaged in battle, annihilating his foes. Entry is locked
|
||||
private static final byte DEAD = 3; //Antharas has been killed. Entry is locked
|
||||
|
||||
protected static long _LastAction = 0;
|
||||
|
||||
protected static L2BossZone _Zone;
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// now call the constructor (starts up the ai)
|
||||
new Antharas(-1,"antharas","ai");
|
||||
}
|
||||
|
||||
// Boss: Antharas
|
||||
public Antharas(int id,String name,String descr)
|
||||
{
|
||||
super(id,name,descr);
|
||||
int[] mob = {ANTHARASOLDID,ANTHARASWEAKID,ANTHARASNORMALID,ANTHARASSTRONGID,29069,29070,29071,29072,29073,29074,29075,29076};
|
||||
this.registerMobs(mob);
|
||||
init();
|
||||
}
|
||||
|
||||
// Initialize
|
||||
private void init()
|
||||
{
|
||||
// Setting spawn data of monsters.
|
||||
try
|
||||
{
|
||||
_Zone = GrandBossManager.getInstance().getZone(179700,113800,-7709);
|
||||
L2NpcTemplate template1;
|
||||
L2Spawn tempSpawn;
|
||||
|
||||
// Old Antharas
|
||||
template1 = NpcTable.getInstance().getTemplate(ANTHARASOLDID);
|
||||
tempSpawn = new L2Spawn(template1);
|
||||
tempSpawn.setLocx(181323);
|
||||
tempSpawn.setLocy(114850);
|
||||
tempSpawn.setLocz(-7623);
|
||||
tempSpawn.setHeading(32542);
|
||||
tempSpawn.setAmount(1);
|
||||
tempSpawn.setRespawnDelay(FWA_ACTIVITYTIMEOFANTHARAS * 2);
|
||||
SpawnTable.getInstance().addNewSpawn(tempSpawn, false);
|
||||
_monsterSpawn.put(29019, tempSpawn);
|
||||
|
||||
// Weak Antharas
|
||||
template1 = NpcTable.getInstance().getTemplate(ANTHARASWEAKID);
|
||||
tempSpawn = new L2Spawn(template1);
|
||||
tempSpawn.setLocx(181323);
|
||||
tempSpawn.setLocy(114850);
|
||||
tempSpawn.setLocz(-7623);
|
||||
tempSpawn.setHeading(32542);
|
||||
tempSpawn.setAmount(1);
|
||||
tempSpawn.setRespawnDelay(FWA_ACTIVITYTIMEOFANTHARAS * 2);
|
||||
SpawnTable.getInstance().addNewSpawn(tempSpawn, false);
|
||||
_monsterSpawn.put(29066, tempSpawn);
|
||||
|
||||
// Normal Antharas
|
||||
template1 = NpcTable.getInstance().getTemplate(ANTHARASNORMALID);
|
||||
tempSpawn = new L2Spawn(template1);
|
||||
tempSpawn.setLocx(181323);
|
||||
tempSpawn.setLocy(114850);
|
||||
tempSpawn.setLocz(-7623);
|
||||
tempSpawn.setHeading(32542);
|
||||
tempSpawn.setAmount(1);
|
||||
tempSpawn.setRespawnDelay(FWA_ACTIVITYTIMEOFANTHARAS * 2);
|
||||
SpawnTable.getInstance().addNewSpawn(tempSpawn, false);
|
||||
_monsterSpawn.put(29067, tempSpawn);
|
||||
|
||||
// Strong Antharas
|
||||
template1 = NpcTable.getInstance().getTemplate(ANTHARASSTRONGID);
|
||||
tempSpawn = new L2Spawn(template1);
|
||||
tempSpawn.setLocx(181323);
|
||||
tempSpawn.setLocy(114850);
|
||||
tempSpawn.setLocz(-7623);
|
||||
tempSpawn.setHeading(32542);
|
||||
tempSpawn.setAmount(1);
|
||||
tempSpawn.setRespawnDelay(FWA_ACTIVITYTIMEOFANTHARAS * 2);
|
||||
SpawnTable.getInstance().addNewSpawn(tempSpawn, false);
|
||||
_monsterSpawn.put(29068, tempSpawn);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.warning(e.getMessage());
|
||||
}
|
||||
|
||||
// Setting spawn data of teleport cube.
|
||||
try
|
||||
{
|
||||
L2NpcTemplate Cube = NpcTable.getInstance().getTemplate(_teleportCubeId);
|
||||
L2Spawn spawnDat;
|
||||
for (int[] element : _teleportCubeLocation)
|
||||
{
|
||||
spawnDat = new L2Spawn(Cube);
|
||||
spawnDat.setAmount(1);
|
||||
spawnDat.setLocx(element[0]);
|
||||
spawnDat.setLocy(element[1]);
|
||||
spawnDat.setLocz(element[2]);
|
||||
spawnDat.setHeading(element[3]);
|
||||
spawnDat.setRespawnDelay(60);
|
||||
spawnDat.setLocation(0);
|
||||
SpawnTable.getInstance().addNewSpawn(spawnDat, false);
|
||||
_teleportCubeSpawn.add(spawnDat);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.warning(e.getMessage());
|
||||
}
|
||||
int status = GrandBossManager.getInstance().getBossStatus(ANTHARASOLDID);
|
||||
if (FWA_OLDANTHARAS || status == WAITING)
|
||||
{
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(ANTHARASOLDID);
|
||||
Long respawnTime = info.getLong("respawn_time");
|
||||
if (status == DEAD && respawnTime <= System.currentTimeMillis())
|
||||
{
|
||||
// the time has already expired while the server was offline. Immediately spawn antharas in his cave.
|
||||
// also, the status needs to be changed to DORMANT
|
||||
GrandBossManager.getInstance().setBossStatus(ANTHARASOLDID,DORMANT);
|
||||
status = DORMANT;
|
||||
}
|
||||
else if (status == FIGHTING)
|
||||
{
|
||||
int loc_x = info.getInteger("loc_x");
|
||||
int loc_y = info.getInteger("loc_y");
|
||||
int loc_z = info.getInteger("loc_z");
|
||||
int heading = info.getInteger("heading");
|
||||
int hp = info.getInteger("currentHP");
|
||||
int mp = info.getInteger("currentMP");
|
||||
_antharas = (L2GrandBossInstance) addSpawn(ANTHARASOLDID,loc_x,loc_y,loc_z,heading,false,0);
|
||||
GrandBossManager.getInstance().addBoss(_antharas);
|
||||
_antharas.setCurrentHpMp(hp,mp);
|
||||
_LastAction = System.currentTimeMillis();
|
||||
// Start repeating timer to check for inactivity
|
||||
_activityCheckTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new CheckActivity(), 60000, 60000);
|
||||
}
|
||||
else if (status == DEAD)
|
||||
{
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(new UnlockAntharas(ANTHARASOLDID), respawnTime - System.currentTimeMillis());
|
||||
}
|
||||
else
|
||||
{
|
||||
setAntharasSpawnTask();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int statusWeak = GrandBossManager.getInstance().getBossStatus(ANTHARASWEAKID);
|
||||
int statusNormal = GrandBossManager.getInstance().getBossStatus(ANTHARASNORMALID);
|
||||
int statusStrong = GrandBossManager.getInstance().getBossStatus(ANTHARASSTRONGID);
|
||||
int antharasId = 0;
|
||||
if (statusWeak == FIGHTING || statusWeak == DEAD)
|
||||
{
|
||||
antharasId = ANTHARASWEAKID;
|
||||
status = statusWeak;
|
||||
}
|
||||
else if (statusNormal == FIGHTING || statusNormal == DEAD)
|
||||
{
|
||||
antharasId = ANTHARASNORMALID;
|
||||
status = statusNormal;
|
||||
}
|
||||
else if (statusStrong == FIGHTING || statusStrong == DEAD)
|
||||
{
|
||||
antharasId = ANTHARASSTRONGID;
|
||||
status = statusStrong;
|
||||
}
|
||||
if (antharasId != 0 && status == FIGHTING)
|
||||
{
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(antharasId);
|
||||
int loc_x = info.getInteger("loc_x");
|
||||
int loc_y = info.getInteger("loc_y");
|
||||
int loc_z = info.getInteger("loc_z");
|
||||
int heading = info.getInteger("heading");
|
||||
int hp = info.getInteger("currentHP");
|
||||
int mp = info.getInteger("currentMP");
|
||||
_antharas = (L2GrandBossInstance) addSpawn(antharasId,loc_x,loc_y,loc_z,heading,false,0);
|
||||
GrandBossManager.getInstance().addBoss(_antharas);
|
||||
_antharas.setCurrentHpMp(hp,mp);
|
||||
_LastAction = System.currentTimeMillis();
|
||||
// Start repeating timer to check for inactivity
|
||||
_activityCheckTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new CheckActivity(), 60000, 60000);
|
||||
}
|
||||
else if (antharasId != 0 && status == DEAD)
|
||||
{
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(antharasId);
|
||||
Long respawnTime = info.getLong("respawn_time");
|
||||
if (respawnTime <= System.currentTimeMillis())
|
||||
{
|
||||
// the time has already expired while the server was offline. Immediately spawn antharas in his cave.
|
||||
// also, the status needs to be changed to DORMANT
|
||||
GrandBossManager.getInstance().setBossStatus(antharasId,DORMANT);
|
||||
status = DORMANT;
|
||||
}
|
||||
else
|
||||
{
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(new UnlockAntharas(antharasId), respawnTime - System.currentTimeMillis());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Do spawn teleport cube.
|
||||
public void spawnCube()
|
||||
{
|
||||
if (_mobsSpawnTask != null)
|
||||
{
|
||||
_mobsSpawnTask.cancel(true);
|
||||
_mobsSpawnTask = null;
|
||||
}
|
||||
if (_selfDestructionTask != null)
|
||||
{
|
||||
_selfDestructionTask.cancel(true);
|
||||
_selfDestructionTask = null;
|
||||
}
|
||||
if (_activityCheckTask != null)
|
||||
{
|
||||
_activityCheckTask.cancel(false);
|
||||
_activityCheckTask = null;
|
||||
}
|
||||
|
||||
for (L2Spawn spawnDat : _teleportCubeSpawn)
|
||||
{
|
||||
_teleportCube.add(spawnDat.doSpawn());
|
||||
}
|
||||
}
|
||||
|
||||
// Setting Antharas spawn task.
|
||||
public void setAntharasSpawnTask()
|
||||
{
|
||||
if (_monsterSpawnTask == null)
|
||||
{
|
||||
synchronized(this)
|
||||
{
|
||||
if (_monsterSpawnTask == null)
|
||||
{
|
||||
GrandBossManager.getInstance().setBossStatus(ANTHARASOLDID,WAITING);
|
||||
_monsterSpawnTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(1),Config.Antharas_Wait_Time);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void startMinionSpawns(int antharasId)
|
||||
{
|
||||
int intervalOfMobs;
|
||||
|
||||
// Interval of minions is decided by the type of Antharas
|
||||
// that invaded the lair.
|
||||
switch (antharasId)
|
||||
{
|
||||
case ANTHARASWEAKID:
|
||||
intervalOfMobs = FWA_INTERVALOFMOBSWEAK;
|
||||
break;
|
||||
case ANTHARASNORMALID:
|
||||
intervalOfMobs = FWA_INTERVALOFMOBSNORMAL;
|
||||
break;
|
||||
default:
|
||||
intervalOfMobs = FWA_INTERVALOFMOBSSTRONG;
|
||||
break;
|
||||
}
|
||||
|
||||
// Spawn mobs.
|
||||
_mobsSpawnTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new MobsSpawn(), intervalOfMobs, intervalOfMobs);
|
||||
}
|
||||
|
||||
// Do spawn Antharas.
|
||||
private class AntharasSpawn implements Runnable
|
||||
{
|
||||
private int _taskId = 0;
|
||||
private final Collection<L2Character> _players = _Zone.getCharactersInside().values();
|
||||
|
||||
public AntharasSpawn(int taskId)
|
||||
{
|
||||
_taskId = taskId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
int npcId;
|
||||
L2Spawn antharasSpawn = null;
|
||||
|
||||
switch (_taskId)
|
||||
{
|
||||
case 1: // Spawn.
|
||||
// Strength of Antharas is decided by the number of players that
|
||||
// invaded the lair.
|
||||
_monsterSpawnTask.cancel(false);
|
||||
_monsterSpawnTask = null;
|
||||
if (FWA_OLDANTHARAS)
|
||||
npcId = 29019; // old
|
||||
else if (_players.size() <= FWA_LIMITOFWEAK)
|
||||
npcId = 29066; // weak
|
||||
else if (_players.size() > FWA_LIMITOFNORMAL)
|
||||
npcId = 29068; // strong
|
||||
else
|
||||
npcId = 29067; // normal
|
||||
|
||||
// Do spawn.
|
||||
antharasSpawn = _monsterSpawn.get(npcId);
|
||||
_antharas = (L2GrandBossInstance) antharasSpawn.doSpawn();
|
||||
GrandBossManager.getInstance().addBoss(_antharas);
|
||||
|
||||
_monsters.add(_antharas);
|
||||
_antharas.setIsImmobilized(true);
|
||||
|
||||
GrandBossManager.getInstance().setBossStatus(ANTHARASOLDID,DORMANT);
|
||||
GrandBossManager.getInstance().setBossStatus(npcId,FIGHTING);
|
||||
_LastAction = System.currentTimeMillis();
|
||||
// Start repeating timer to check for inactivity
|
||||
_activityCheckTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new CheckActivity(), 60000, 60000);
|
||||
|
||||
// Setting 1st time of minions spawn task.
|
||||
if (!FWA_OLDANTHARAS)
|
||||
{
|
||||
startMinionSpawns(npcId);
|
||||
}
|
||||
|
||||
// Set next task.
|
||||
if (_socialTask != null)
|
||||
{
|
||||
_socialTask.cancel(true);
|
||||
_socialTask = null;
|
||||
}
|
||||
_socialTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(2), 16);
|
||||
break;
|
||||
case 2:
|
||||
// Set camera.
|
||||
broadcastPacket(new SpecialCamera(_antharas.getObjectId(),700,13,-19,0,20000,0,0,1,0));
|
||||
|
||||
// Set next task.
|
||||
if (_socialTask != null)
|
||||
{
|
||||
_socialTask.cancel(true);
|
||||
_socialTask = null;
|
||||
}
|
||||
_socialTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(3), 3000);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
// Do social.
|
||||
broadcastPacket(new SpecialCamera(_antharas.getObjectId(),700,13,0,6000,20000,0,0,1,0));
|
||||
// Set next task.
|
||||
if (_socialTask != null)
|
||||
{
|
||||
_socialTask.cancel(true);
|
||||
_socialTask = null;
|
||||
}
|
||||
_socialTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(4), 10000);
|
||||
break;
|
||||
case 4:
|
||||
broadcastPacket(new SpecialCamera(_antharas.getObjectId(),3700,0,-3,0,10000,0,0,1,0));
|
||||
// Set next task.
|
||||
if (_socialTask != null)
|
||||
{
|
||||
_socialTask.cancel(true);
|
||||
_socialTask = null;
|
||||
}
|
||||
_socialTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(5), 200);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
// Do social.
|
||||
broadcastPacket(new SpecialCamera(_antharas.getObjectId(),1100,0,-3,22000,30000,0,0,1,0));
|
||||
// Set next task.
|
||||
if (_socialTask != null)
|
||||
{
|
||||
_socialTask.cancel(true);
|
||||
_socialTask = null;
|
||||
}
|
||||
_socialTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(6), 10800);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
// Set camera.
|
||||
broadcastPacket(new SpecialCamera(_antharas.getObjectId(),1100,0,-3,300,7000,0,0,1,0));
|
||||
// Set next task.
|
||||
if (_socialTask != null)
|
||||
{
|
||||
_socialTask.cancel(true);
|
||||
_socialTask = null;
|
||||
}
|
||||
_socialTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(7), 1900);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
_antharas.abortCast();
|
||||
|
||||
_mobiliseTask = ThreadPoolManager.getInstance().scheduleGeneral(new SetMobilised(_antharas), 16);
|
||||
|
||||
// Move at random.
|
||||
if (FWA_MOVEATRANDOM)
|
||||
{
|
||||
L2CharPosition pos = new L2CharPosition(Rnd.get(175000,178500), Rnd.get(112400, 116000), -7707, 0);
|
||||
_moveAtRandomTask = ThreadPoolManager.getInstance().scheduleGeneral(new MoveAtRandom(_antharas, pos),500);
|
||||
}
|
||||
|
||||
if (_socialTask != null)
|
||||
{
|
||||
_socialTask.cancel(true);
|
||||
_socialTask = null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void broadcastPacket(L2GameServerPacket mov)
|
||||
{
|
||||
if (_Zone != null)
|
||||
{
|
||||
for (L2Character characters : _Zone.getCharactersInside().values())
|
||||
{
|
||||
if (characters instanceof L2PcInstance)
|
||||
characters.sendPacket(mov);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Do spawn Behemoth or Bomber.
|
||||
private class MobsSpawn implements Runnable
|
||||
{
|
||||
public MobsSpawn()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
L2NpcTemplate template1;
|
||||
L2Spawn tempSpawn;
|
||||
boolean isBehemoth = Rnd.get(100) < FWA_PERCENTOFBEHEMOTH;
|
||||
try
|
||||
{
|
||||
int mobNumber = (isBehemoth ? 2 : 3);
|
||||
// Set spawn.
|
||||
for(int i = 0; i < mobNumber; i++)
|
||||
{
|
||||
if (_monsters.size() >= FWA_MAXMOBS)
|
||||
break;
|
||||
int npcId;
|
||||
if (isBehemoth)
|
||||
npcId = 29069;
|
||||
else
|
||||
npcId = Rnd.get(29070, 29076);
|
||||
template1 = NpcTable.getInstance().getTemplate(npcId);
|
||||
tempSpawn = new L2Spawn(template1);
|
||||
// allocates it at random in the lair of Antharas.
|
||||
int tried = 0;
|
||||
boolean notFound = true;
|
||||
int x = 175000;
|
||||
int y = 112400;
|
||||
int dt = (_antharas.getX() - x) * (_antharas.getX() - x) + (_antharas.getY() - y) * (_antharas.getY() - y);
|
||||
while (tried++ < 25 && notFound)
|
||||
{
|
||||
int rx = Rnd.get(175000, 179900);
|
||||
int ry = Rnd.get(112400, 116000);
|
||||
int rdt = (_antharas.getX() - rx) * (_antharas.getX() - rx) + (_antharas.getY() - ry) * (_antharas.getY() - ry);
|
||||
if (GeoData.getInstance().canSeeTarget(_antharas.getX(), _antharas.getY(), -7704, rx, ry, -7704))
|
||||
if (rdt < dt)
|
||||
{
|
||||
x = rx;
|
||||
y = ry;
|
||||
dt = rdt;
|
||||
if (rdt <= 900000)
|
||||
notFound = false;
|
||||
}
|
||||
}
|
||||
tempSpawn.setLocx(x);
|
||||
tempSpawn.setLocy(y);
|
||||
tempSpawn.setLocz(-7704);
|
||||
tempSpawn.setHeading(0);
|
||||
tempSpawn.setAmount(1);
|
||||
tempSpawn.setRespawnDelay(FWA_ACTIVITYTIMEOFANTHARAS * 2);
|
||||
SpawnTable.getInstance().addNewSpawn(tempSpawn, false);
|
||||
// Do spawn.
|
||||
_monsters.add(tempSpawn.doSpawn());
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.warning(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAggroRangeEnter (L2Npc npc, L2PcInstance player, boolean isPet)
|
||||
{
|
||||
switch (npc.getNpcId())
|
||||
{
|
||||
case 29070:
|
||||
case 29071:
|
||||
case 29072:
|
||||
case 29073:
|
||||
case 29074:
|
||||
case 29075:
|
||||
case 29076:
|
||||
if (_selfDestructionTask == null && !npc.isDead())
|
||||
_selfDestructionTask = ThreadPoolManager.getInstance().scheduleGeneral(new SelfDestructionOfBomber(npc), FWA_SELFDESTRUCTTIME);
|
||||
break;
|
||||
}
|
||||
return super.onAggroRangeEnter(npc, player, isPet);
|
||||
}
|
||||
|
||||
// Do self destruction.
|
||||
private class SelfDestructionOfBomber implements Runnable
|
||||
{
|
||||
private final L2Npc _bomber;
|
||||
|
||||
public SelfDestructionOfBomber(L2Npc bomber)
|
||||
{
|
||||
_bomber = bomber;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
L2Skill skill = null;
|
||||
switch (_bomber.getNpcId())
|
||||
{
|
||||
case 29070:
|
||||
case 29071:
|
||||
case 29072:
|
||||
case 29073:
|
||||
case 29074:
|
||||
case 29075:
|
||||
skill = SkillTable.getInstance().getInfo(5097, 1);
|
||||
break;
|
||||
case 29076:
|
||||
skill = SkillTable.getInstance().getInfo(5094, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
_bomber.doCast(skill);
|
||||
if (_selfDestructionTask != null)
|
||||
{
|
||||
_selfDestructionTask.cancel(false);
|
||||
_selfDestructionTask = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(L2Npc npc, L2PcInstance player, L2Skill skill)
|
||||
{
|
||||
if (npc.isInvul())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else if (skill != null && (skill.getId() == 5097 || skill.getId() == 5094))
|
||||
{
|
||||
switch (npc.getNpcId())
|
||||
{
|
||||
case 29070:
|
||||
case 29071:
|
||||
case 29072:
|
||||
case 29073:
|
||||
case 29074:
|
||||
case 29075:
|
||||
case 29076:
|
||||
npc.doDie(npc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
// At end of activity time.
|
||||
private class CheckActivity implements Runnable
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
Long temp = (System.currentTimeMillis() - _LastAction);
|
||||
if (temp > FWA_INACTIVITYTIME)
|
||||
{
|
||||
GrandBossManager.getInstance().setBossStatus(_antharas.getNpcId(),DORMANT);
|
||||
setUnspawn();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Clean Antharas's lair.
|
||||
public void setUnspawn()
|
||||
{
|
||||
// Eliminate players.
|
||||
_Zone.oustAllPlayers();
|
||||
|
||||
// Not executed tasks is canceled.
|
||||
if (_cubeSpawnTask != null)
|
||||
{
|
||||
_cubeSpawnTask.cancel(true);
|
||||
_cubeSpawnTask = null;
|
||||
}
|
||||
if (_monsterSpawnTask != null)
|
||||
{
|
||||
_monsterSpawnTask.cancel(true);
|
||||
_monsterSpawnTask = null;
|
||||
}
|
||||
if (_activityCheckTask != null)
|
||||
{
|
||||
_activityCheckTask.cancel(false);
|
||||
_activityCheckTask = null;
|
||||
}
|
||||
if (_socialTask != null)
|
||||
{
|
||||
_socialTask.cancel(true);
|
||||
_socialTask = null;
|
||||
}
|
||||
if (_mobiliseTask != null)
|
||||
{
|
||||
_mobiliseTask.cancel(true);
|
||||
_mobiliseTask = null;
|
||||
}
|
||||
if (_mobsSpawnTask != null)
|
||||
{
|
||||
_mobsSpawnTask.cancel(true);
|
||||
_mobsSpawnTask = null;
|
||||
}
|
||||
if (_selfDestructionTask != null)
|
||||
{
|
||||
_selfDestructionTask.cancel(true);
|
||||
_selfDestructionTask = null;
|
||||
}
|
||||
if (_moveAtRandomTask != null)
|
||||
{
|
||||
_moveAtRandomTask.cancel(true);
|
||||
_moveAtRandomTask = null;
|
||||
}
|
||||
|
||||
// Delete monsters.
|
||||
for (L2Npc mob : _monsters)
|
||||
{
|
||||
mob.getSpawn().stopRespawn();
|
||||
mob.deleteMe();
|
||||
}
|
||||
_monsters.clear();
|
||||
|
||||
// Delete teleport cube.
|
||||
for (L2Npc cube : _teleportCube)
|
||||
{
|
||||
cube.getSpawn().stopRespawn();
|
||||
cube.deleteMe();
|
||||
}
|
||||
_teleportCube.clear();
|
||||
}
|
||||
|
||||
// Do spawn teleport cube.
|
||||
private class CubeSpawn implements Runnable
|
||||
{
|
||||
private final int _type;
|
||||
|
||||
public CubeSpawn(int type)
|
||||
{
|
||||
_type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (_type == 0)
|
||||
{
|
||||
spawnCube();
|
||||
_cubeSpawnTask = ThreadPoolManager.getInstance().scheduleGeneral(new CubeSpawn(1), 1800000);
|
||||
}
|
||||
else
|
||||
setUnspawn();
|
||||
}
|
||||
}
|
||||
|
||||
// UnLock Antharas.
|
||||
private static class UnlockAntharas implements Runnable
|
||||
{
|
||||
private final int _bossId;
|
||||
|
||||
public UnlockAntharas(int bossId)
|
||||
{
|
||||
_bossId = bossId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
GrandBossManager.getInstance().setBossStatus(_bossId,DORMANT);
|
||||
if (FWA_DOSERVEREARTHQUAKE)
|
||||
for(L2PcInstance p : L2World.getInstance().getAllPlayers().values())
|
||||
p.broadcastPacket(new Earthquake(185708,114298,-8221,20,10));
|
||||
}
|
||||
}
|
||||
|
||||
// Action is enabled the boss.
|
||||
private class SetMobilised implements Runnable
|
||||
{
|
||||
private final L2GrandBossInstance _boss;
|
||||
|
||||
public SetMobilised(L2GrandBossInstance boss)
|
||||
{
|
||||
_boss = boss;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
_boss.setIsImmobilized(false);
|
||||
|
||||
// When it is possible to act, a social action is canceled.
|
||||
if (_socialTask != null)
|
||||
{
|
||||
_socialTask.cancel(true);
|
||||
_socialTask = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Move at random on after Antharas appears.
|
||||
private static class MoveAtRandom implements Runnable
|
||||
{
|
||||
private final L2Npc _npc;
|
||||
private final L2CharPosition _pos;
|
||||
|
||||
public MoveAtRandom(L2Npc npc, L2CharPosition pos)
|
||||
{
|
||||
_npc = npc;
|
||||
_pos = pos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
_npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, _pos);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack (L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (npc.getNpcId() == 29019 || npc.getNpcId() == 29066 || npc.getNpcId() == 29067 || npc.getNpcId() == 29068)
|
||||
{
|
||||
_LastAction = System.currentTimeMillis();
|
||||
if (GrandBossManager.getInstance().getBossStatus(_antharas.getNpcId()) != FIGHTING)
|
||||
{
|
||||
_Zone.oustAllPlayers();
|
||||
}
|
||||
else if (!FWA_OLDANTHARAS && _mobsSpawnTask == null)
|
||||
{
|
||||
startMinionSpawns(npc.getNpcId());
|
||||
}
|
||||
}
|
||||
else if (npc.getNpcId() > 29069 && npc.getNpcId() < 29077 && npc.getCurrentHp() <= damage)
|
||||
{
|
||||
L2Skill skill = null;
|
||||
switch (npc.getNpcId())
|
||||
{
|
||||
case 29070:
|
||||
case 29071:
|
||||
case 29072:
|
||||
case 29073:
|
||||
case 29074:
|
||||
case 29075:
|
||||
skill = SkillTable.getInstance().getInfo(5097, 1);
|
||||
break;
|
||||
case 29076:
|
||||
skill = SkillTable.getInstance().getInfo(5094, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
npc.doCast(skill);
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill (L2Npc npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
if (npc.getNpcId() == 29019 || npc.getNpcId() == 29066 || npc.getNpcId() == 29067 || npc.getNpcId() == 29068)
|
||||
{
|
||||
npc.broadcastPacket(new PlaySound(1, "BS01_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
_cubeSpawnTask = ThreadPoolManager.getInstance().scheduleGeneral(new CubeSpawn(0), 10000);
|
||||
GrandBossManager.getInstance().setBossStatus(npc.getNpcId(),DEAD);
|
||||
long respawnTime = (long)Config.Interval_Of_Antharas_Spawn + Rnd.get(Config.Random_Of_Antharas_Spawn);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(new UnlockAntharas(npc.getNpcId()), respawnTime);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(npc.getNpcId());
|
||||
info.set("respawn_time",(System.currentTimeMillis() + respawnTime));
|
||||
GrandBossManager.getInstance().setStatsSet(npc.getNpcId(),info);
|
||||
}
|
||||
else if (npc.getNpcId() == 29069)
|
||||
{
|
||||
int countHPHerb = Rnd.get(6, 18);
|
||||
int countMPHerb = Rnd.get(6, 18);
|
||||
for (int i = 0; i < countHPHerb; i++)
|
||||
((L2MonsterInstance)npc).dropItem(killer, 8602, 1);
|
||||
for (int i = 0; i < countMPHerb; i++)
|
||||
((L2MonsterInstance)npc).dropItem(killer, 8605, 1);
|
||||
}
|
||||
if (_monsters.contains(npc))
|
||||
_monsters.remove(npc);
|
||||
return super.onKill(npc,killer,isPet);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,602 @@
|
||||
/*
|
||||
* 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.individual;
|
||||
|
||||
import static com.l2jserver.gameserver.ai.CtrlIntention.AI_INTENTION_FOLLOW;
|
||||
import static com.l2jserver.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import javolution.util.FastList;
|
||||
import ai.group_template.L2AttackableAIScript;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.GeoData;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.datatables.SkillTable;
|
||||
import com.l2jserver.gameserver.instancemanager.GrandBossManager;
|
||||
import com.l2jserver.gameserver.model.L2Effect;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.L2Playable;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2DecoyInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2GrandBossInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.quest.QuestTimer;
|
||||
import com.l2jserver.gameserver.model.zone.type.L2BossZone;
|
||||
import com.l2jserver.gameserver.network.serverpackets.Earthquake;
|
||||
import com.l2jserver.gameserver.network.serverpackets.MoveToPawn;
|
||||
import com.l2jserver.gameserver.network.serverpackets.PlaySound;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SocialAction;
|
||||
import com.l2jserver.gameserver.templates.StatsSet;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
|
||||
/**
|
||||
* Baium AI
|
||||
*
|
||||
* Note1: if the server gets rebooted while players are still fighting Baium, there is no lock, but
|
||||
* players also lose their ability to wake baium up. However, should another person
|
||||
* enter the room and wake him up, the players who had stayed inside may join the raid.
|
||||
* This can be helpful for players who became victims of a reboot (they only need 1 new player to
|
||||
* enter and wake up baium) and is not too exploitable since any player wishing to exploit it
|
||||
* would have to suffer 5 days of being parked in an empty room.
|
||||
* Note2: Neither version of Baium should be a permanent spawn. This script is fully capable of
|
||||
* spawning the statue-version when the lock expires and switching it to the mob version promptly.
|
||||
*
|
||||
* Additional notes ( source http://aleenaresron.blogspot.com/2006_08_01_archive.html ):
|
||||
* * Baium only first respawns five days after his last death. And from those five days he will
|
||||
* respawn within 1-8 hours of his last death. So, you have to know his last time of death.
|
||||
* * If by some freak chance you are the only one in Baium's chamber and NO ONE comes in
|
||||
* [ha, ha] you or someone else will have to wake Baium. There is a good chance that Baium
|
||||
* will automatically kill whoever wakes him. There are some people that have been able to
|
||||
* wake him and not die, however if you've already gone through the trouble of getting the
|
||||
* bloody fabric and camped him out and researched his spawn time, are you willing to take that
|
||||
* chance that you'll wake him and not be able to finish your quest? Doubtful.
|
||||
* [ this powerful attack vs the player who wakes him up is NOT yet implemented here]
|
||||
* * once someone starts attacking Baium no one else can port into the chamber where he is.
|
||||
* Unlike with the other raid bosses, you can just show up at any time as long as you are there
|
||||
* when they die. Not true with Baium. Once he gets attacked, the port to Baium closes. byebye,
|
||||
* see you in 5 days. If nobody attacks baium for 30 minutes, he auto-despawns and unlocks the
|
||||
* vortex
|
||||
*
|
||||
* @author Fulminus version 0.1
|
||||
*/
|
||||
public class Baium extends L2AttackableAIScript
|
||||
{
|
||||
private L2Character _target;
|
||||
private L2Skill _skill;
|
||||
private static final int STONE_BAIUM = 29025;
|
||||
private static final int ANGELIC_VORTEX = 31862;
|
||||
private static final int LIVE_BAIUM = 29020;
|
||||
private static final int ARCHANGEL = 29021;
|
||||
|
||||
//Baium status tracking
|
||||
private static final byte ASLEEP = 0; // baium is in the stone version, waiting to be woken up. Entry is unlocked
|
||||
private static final byte AWAKE = 1; // baium is awake and fighting. Entry is locked.
|
||||
private static final byte DEAD = 2; // baium has been killed and has not yet spawned. Entry is locked
|
||||
|
||||
// fixed archangel spawnloc
|
||||
private final static int ANGEL_LOCATION[][] =
|
||||
{
|
||||
{ 114239, 17168, 10080, 63544 },
|
||||
{ 115780, 15564, 10080, 13620 },
|
||||
{ 114880, 16236, 10080, 5400 },
|
||||
{ 115168, 17200, 10080, 0 },
|
||||
{ 115792, 16608, 10080, 0 },
|
||||
};
|
||||
|
||||
private long _LastAttackVsBaiumTime = 0;
|
||||
private List<L2Npc> _Minions = new ArrayList<L2Npc>(5);
|
||||
private L2BossZone _Zone;
|
||||
|
||||
public Baium (int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
|
||||
int[] mob = {LIVE_BAIUM};
|
||||
this.registerMobs(mob);
|
||||
|
||||
// Quest NPC starter initialization
|
||||
addStartNpc(STONE_BAIUM);
|
||||
addStartNpc(ANGELIC_VORTEX);
|
||||
addTalkId(STONE_BAIUM);
|
||||
addTalkId(ANGELIC_VORTEX);
|
||||
_Zone = GrandBossManager.getInstance().getZone(113100,14500,10077);
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(LIVE_BAIUM);
|
||||
int status = GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM);
|
||||
if (status == DEAD)
|
||||
{
|
||||
// load the unlock date and time for baium from DB
|
||||
long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||
if (temp > 0)
|
||||
{
|
||||
// the unlock time has not yet expired. Mark Baium as currently locked (dead). Setup a timer
|
||||
// to fire at the correct time (calculate the time between now and the unlock time,
|
||||
// setup a timer to fire after that many msec)
|
||||
startQuestTimer("baium_unlock", temp, null, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
// the time has already expired while the server was offline. Delete the saved time and
|
||||
// immediately spawn the stone-baium. Also the state need not be changed from ASLEEP
|
||||
addSpawn(STONE_BAIUM,116033,17447,10104,40188,false,0);
|
||||
GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM,ASLEEP);
|
||||
}
|
||||
}
|
||||
else if (status == AWAKE)
|
||||
{
|
||||
int loc_x = info.getInteger("loc_x");
|
||||
int loc_y = info.getInteger("loc_y");
|
||||
int loc_z = info.getInteger("loc_z");
|
||||
int heading = info.getInteger("heading");
|
||||
final int hp = info.getInteger("currentHP");
|
||||
final int mp = info.getInteger("currentMP");
|
||||
L2GrandBossInstance baium = (L2GrandBossInstance) addSpawn(LIVE_BAIUM,loc_x,loc_y,loc_z,heading,false,0);
|
||||
GrandBossManager.getInstance().addBoss(baium);
|
||||
final L2Npc _baium = baium;
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() {
|
||||
public void run()
|
||||
{
|
||||
try
|
||||
{
|
||||
_baium.setCurrentHpMp(hp,mp);
|
||||
_baium.setIsInvul(true);
|
||||
_baium.setIsImmobilized(true);
|
||||
_baium.setRunning();
|
||||
_baium.broadcastPacket(new SocialAction(_baium,2));
|
||||
startQuestTimer("baium_wakeup",15000, _baium, null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
},100L);
|
||||
}
|
||||
else
|
||||
addSpawn(STONE_BAIUM,116033,17447,10104,40188,false,0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent (String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equalsIgnoreCase("baium_unlock"))
|
||||
{
|
||||
GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM,ASLEEP);
|
||||
addSpawn(STONE_BAIUM,116033,17447,10104,40188,false,0);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("skill_range") && npc != null)
|
||||
{
|
||||
callSkillAI(npc);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("clean_player"))
|
||||
{
|
||||
_target = getRandomTarget(npc);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("baium_wakeup") && npc != null)
|
||||
{
|
||||
if (npc.getNpcId() == LIVE_BAIUM)
|
||||
{
|
||||
npc.broadcastPacket(new SocialAction(npc,1));
|
||||
npc.broadcastPacket(new Earthquake(npc.getX(), npc.getY(), npc.getZ(),40,5));
|
||||
// start monitoring baium's inactivity
|
||||
_LastAttackVsBaiumTime = System.currentTimeMillis();
|
||||
startQuestTimer("baium_despawn", 60000, npc, null, true);
|
||||
startQuestTimer("skill_range", 500, npc, null, true);
|
||||
final L2Npc baium = npc;
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() {
|
||||
public void run()
|
||||
{
|
||||
try
|
||||
{
|
||||
baium.setIsInvul(false);
|
||||
baium.setIsImmobilized(false);
|
||||
for (L2Npc minion : _Minions)
|
||||
minion.setShowSummonAnimation(false);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.log(Level.WARNING, "", e);
|
||||
}
|
||||
}
|
||||
},11100L);
|
||||
// TODO: the person who woke baium up should be knocked across the room, onto a wall, and
|
||||
// lose massive amounts of HP.
|
||||
for (int i = 0; i < ANGEL_LOCATION.length; i++)
|
||||
{
|
||||
L2Npc angel = addSpawn(ARCHANGEL, ANGEL_LOCATION[i][0], ANGEL_LOCATION[i][1], ANGEL_LOCATION[i][2], ANGEL_LOCATION[i][3], false, 0, true);
|
||||
angel.setIsInvul(true);
|
||||
_Minions.add(angel);
|
||||
}
|
||||
}
|
||||
// despawn the live baium after 30 minutes of inactivity
|
||||
// also check if the players are cheating, having pulled Baium outside his zone...
|
||||
}
|
||||
else if (event.equalsIgnoreCase("baium_despawn") && npc != null)
|
||||
{
|
||||
if (npc.getNpcId() == LIVE_BAIUM)
|
||||
{
|
||||
// just in case the zone reference has been lost (somehow...), restore the reference
|
||||
if (_Zone == null)
|
||||
_Zone = GrandBossManager.getInstance().getZone(113100,14500,10077);
|
||||
if (_LastAttackVsBaiumTime + 1800000 < System.currentTimeMillis())
|
||||
{
|
||||
npc.deleteMe(); // despawn the live-baium
|
||||
for (L2Npc minion : _Minions)
|
||||
if (minion != null)
|
||||
{
|
||||
minion.getSpawn().stopRespawn();
|
||||
minion.deleteMe();
|
||||
}
|
||||
_Minions.clear();
|
||||
addSpawn(STONE_BAIUM,116033,17447,10104,40188,false,0); // spawn stone-baium
|
||||
GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM,ASLEEP); // mark that Baium is not awake any more
|
||||
_Zone.oustAllPlayers();
|
||||
cancelQuestTimer("baium_despawn", npc, null);
|
||||
}
|
||||
else if ((_LastAttackVsBaiumTime + 300000 < System.currentTimeMillis()) && npc.getCurrentHp() < ( ( npc.getMaxHp() * 3 ) / 4.0 ))
|
||||
{
|
||||
npc.setIsCastingNow(false); //just in case
|
||||
npc.setTarget(npc);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4135,1));
|
||||
npc.setIsCastingNow(true);
|
||||
}
|
||||
else if (!_Zone.isInsideZone(npc))
|
||||
npc.teleToLocation(116033,17447,10104);
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onTalk(L2Npc npc,L2PcInstance player)
|
||||
{
|
||||
int npcId = npc.getNpcId();
|
||||
String htmltext = "";
|
||||
if (_Zone == null)
|
||||
_Zone = GrandBossManager.getInstance().getZone(113100,14500,10077);
|
||||
if (_Zone == null)
|
||||
return "<html><body>Angelic Vortex:<br>You may not enter while admin disabled this zone</body></html>";
|
||||
if (npcId == STONE_BAIUM && GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM) == ASLEEP)
|
||||
{
|
||||
if (_Zone.isPlayerAllowed(player))
|
||||
{
|
||||
// once Baium is awaken, no more people may enter until he dies, the server reboots, or
|
||||
// 30 minutes pass with no attacks made against Baium.
|
||||
GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM,AWAKE);
|
||||
npc.deleteMe();
|
||||
L2GrandBossInstance baium = (L2GrandBossInstance) addSpawn(LIVE_BAIUM, npc, true);
|
||||
GrandBossManager.getInstance().addBoss(baium);
|
||||
final L2Npc _baium = baium;
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() {
|
||||
public void run()
|
||||
{
|
||||
try
|
||||
{
|
||||
_baium.setIsInvul(true);
|
||||
_baium.setRunning();
|
||||
_baium.broadcastPacket(new SocialAction(_baium,2));
|
||||
startQuestTimer("baium_wakeup",15000, _baium, null);
|
||||
_baium.setShowSummonAnimation(false);
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
_log.log(Level.WARNING, "", e);
|
||||
}
|
||||
}
|
||||
},100L);
|
||||
}
|
||||
else
|
||||
htmltext = "Conditions are not right to wake up Baium";
|
||||
}
|
||||
else if (npcId == ANGELIC_VORTEX)
|
||||
{
|
||||
if (player.isFlying())
|
||||
{
|
||||
//print "Player "+player.getName()+" attempted to enter Baium's lair while flying!";
|
||||
return "<html><body>Angelic Vortex:<br>You may not enter while flying a wyvern</body></html>";
|
||||
}
|
||||
|
||||
if (GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM) == ASLEEP
|
||||
&& player.getQuestState("baium").getQuestItemsCount(4295) > 0) // bloody fabric
|
||||
{
|
||||
player.getQuestState("baium").takeItems(4295,1);
|
||||
// allow entry for the player for the next 30 secs (more than enough time for the TP to happen)
|
||||
// Note: this just means 30secs to get in, no limits on how long it takes before we get out.
|
||||
_Zone.allowPlayerEntry(player,30);
|
||||
player.teleToLocation(113100,14500,10077);
|
||||
}
|
||||
else
|
||||
npc.showChatWindow(player, 1);
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(L2Npc npc, L2PcInstance player, L2Skill skill)
|
||||
{
|
||||
if (npc.isInvul())
|
||||
{
|
||||
npc.getAI().setIntention(AI_INTENTION_IDLE);
|
||||
return null;
|
||||
}
|
||||
else if (npc.getNpcId() == LIVE_BAIUM && !npc.isInvul())
|
||||
{
|
||||
callSkillAI(npc);
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
npc.disableCoreAI(true);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack (L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (!_Zone.isInsideZone(attacker))
|
||||
{
|
||||
attacker.reduceCurrentHp(attacker.getCurrentHp(),attacker,false,false, null);
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
if (npc.isInvul())
|
||||
{
|
||||
npc.getAI().setIntention(AI_INTENTION_IDLE);
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
else if (npc.getNpcId() == LIVE_BAIUM && !npc.isInvul())
|
||||
{
|
||||
if (attacker.getMountType() == 1)
|
||||
{
|
||||
int sk_4258 = 0;
|
||||
L2Effect[] effects = attacker.getAllEffects();
|
||||
if (effects != null && effects.length != 0)
|
||||
{
|
||||
for (L2Effect e : effects)
|
||||
{
|
||||
if (e.getSkill().getId() == 4258)
|
||||
sk_4258 = 1;
|
||||
}
|
||||
}
|
||||
if (sk_4258 == 0)
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4258,1));
|
||||
}
|
||||
}
|
||||
// update a variable with the last action against baium
|
||||
_LastAttackVsBaiumTime = System.currentTimeMillis();
|
||||
callSkillAI(npc);
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill (L2Npc npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
cancelQuestTimer("baium_despawn", npc, null);
|
||||
npc.broadcastPacket(new PlaySound(1, "BS01_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
// spawn the "Teleportation Cubic" for 15 minutes (to allow players to exit the lair)
|
||||
addSpawn(29055,115203,16620,10078,0,false,900000); ////should we teleport everyone out if the cubic despawns??
|
||||
// "lock" baium for 5 days and 1 to 8 hours [i.e. 432,000,000 + 1*3,600,000 + random-less-than(8*3,600,000) millisecs]
|
||||
long respawnTime = (long)Config.Interval_Of_Baium_Spawn + Rnd.get(Config.Random_Of_Baium_Spawn);
|
||||
GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM,DEAD);
|
||||
startQuestTimer("baium_unlock", respawnTime, null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(LIVE_BAIUM);
|
||||
info.set("respawn_time",(System.currentTimeMillis()) + respawnTime);
|
||||
GrandBossManager.getInstance().setStatsSet(LIVE_BAIUM,info);
|
||||
for (L2Npc minion : _Minions)
|
||||
if (minion != null)
|
||||
{
|
||||
minion.getSpawn().stopRespawn();
|
||||
minion.deleteMe();
|
||||
}
|
||||
_Minions.clear();
|
||||
if (getQuestTimer("skill_range", npc, null) != null)
|
||||
getQuestTimer("skill_range", npc, null).cancel();
|
||||
return super.onKill(npc,killer,isPet);
|
||||
}
|
||||
|
||||
public L2Character getRandomTarget(L2Npc npc)
|
||||
{
|
||||
FastList<L2Character> result = FastList.newInstance();
|
||||
Collection<L2Object> objs = npc.getKnownList().getKnownObjects().values();
|
||||
{
|
||||
for (L2Object obj : objs)
|
||||
{
|
||||
if (obj instanceof L2Playable || obj instanceof L2DecoyInstance)
|
||||
{
|
||||
if (obj instanceof L2PcInstance)
|
||||
{
|
||||
if (((L2PcInstance) obj).getAppearance().getInvisible())
|
||||
continue;
|
||||
}
|
||||
|
||||
if (((L2Character) obj).getZ() < ( npc.getZ() - 100 ) && ((L2Character) obj).getZ() > ( npc.getZ() + 100 )
|
||||
|| !(GeoData.getInstance().canSeeTarget(((L2Character) obj).getX(), ((L2Character) obj).getY(), ((L2Character) obj).getZ(), npc.getX(), npc.getY(), npc.getZ())))
|
||||
continue;
|
||||
}
|
||||
if (obj instanceof L2Playable || obj instanceof L2DecoyInstance)
|
||||
{
|
||||
if (Util.checkIfInRange(9000, npc, obj, true) && !((L2Character) obj).isDead())
|
||||
result.add((L2Character) obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (result.isEmpty())
|
||||
{
|
||||
for (L2Npc minion : _Minions)
|
||||
if (minion != null)
|
||||
result.add(minion);
|
||||
}
|
||||
|
||||
if (result.isEmpty())
|
||||
{
|
||||
FastList.recycle(result);
|
||||
return null;
|
||||
}
|
||||
|
||||
Object[] characters = result.toArray();
|
||||
QuestTimer timer = getQuestTimer("clean_player", npc, null);
|
||||
if (timer != null)
|
||||
timer.cancel();
|
||||
startQuestTimer("clean_player", 20000, npc, null);
|
||||
L2Character target = (L2Character) characters[Rnd.get(characters.length)];
|
||||
FastList.recycle(result);
|
||||
return target;
|
||||
|
||||
}
|
||||
|
||||
public synchronized void callSkillAI(L2Npc npc)
|
||||
{
|
||||
if (npc.isInvul() || npc.isCastingNow()) return;
|
||||
|
||||
if (_target == null || _target.isDead() || !(_Zone.isInsideZone(_target)))
|
||||
{
|
||||
_target = getRandomTarget(npc);
|
||||
if (_target != null)
|
||||
_skill = SkillTable.getInstance().getInfo(getRandomSkill(npc),1);
|
||||
}
|
||||
|
||||
L2Character target = _target;
|
||||
L2Skill skill = _skill;
|
||||
if (skill == null)
|
||||
skill = SkillTable.getInstance().getInfo(getRandomSkill(npc),1);
|
||||
if (target == null || target.isDead() || !(_Zone.isInsideZone(target)))
|
||||
{
|
||||
npc.setIsCastingNow(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Util.checkIfInRange(skill.getCastRange(), npc, target, true))
|
||||
{
|
||||
npc.getAI().setIntention(AI_INTENTION_IDLE);
|
||||
npc.setTarget(target);
|
||||
npc.setIsCastingNow(true);
|
||||
_target = null;
|
||||
_skill = null;
|
||||
if (getDist(skill.getCastRange()) > 0)
|
||||
npc.broadcastPacket(new MoveToPawn(npc,target,getDist(skill.getCastRange())));
|
||||
try
|
||||
{
|
||||
Thread.sleep(1000);
|
||||
npc.stopMove(null);
|
||||
npc.doCast(skill);
|
||||
}
|
||||
catch (Exception e)
|
||||
{e.printStackTrace();}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.getAI().setIntention(AI_INTENTION_FOLLOW, target, null);
|
||||
npc.setIsCastingNow(false);
|
||||
}
|
||||
}
|
||||
|
||||
public int getRandomSkill(L2Npc npc)
|
||||
{
|
||||
int skill;
|
||||
if( npc.getCurrentHp() > ( ( npc.getMaxHp() * 3 ) / 4.0 ) )
|
||||
{
|
||||
if( Rnd.get(100) < 10 )
|
||||
skill = 4128;
|
||||
else if( Rnd.get(100) < 10 )
|
||||
skill = 4129;
|
||||
else
|
||||
skill = 4127;
|
||||
}
|
||||
else if( npc.getCurrentHp() > ( ( npc.getMaxHp() * 2 ) / 4.0) )
|
||||
{
|
||||
if( Rnd.get(100) < 10 )
|
||||
skill = 4131;
|
||||
else if( Rnd.get(100) < 10 )
|
||||
skill = 4128;
|
||||
else if( Rnd.get(100) < 10 )
|
||||
skill = 4129;
|
||||
else
|
||||
skill = 4127;
|
||||
}
|
||||
else if( npc.getCurrentHp() > ( ( npc.getMaxHp() * 1 ) / 4.0 ) )
|
||||
{
|
||||
if( Rnd.get(100) < 10 )
|
||||
skill = 4130;
|
||||
else if( Rnd.get(100) < 10 )
|
||||
skill = 4131;
|
||||
else if( Rnd.get(100) < 10 )
|
||||
skill = 4128;
|
||||
else if( Rnd.get(100) < 10 )
|
||||
skill = 4129;
|
||||
else
|
||||
skill = 4127;
|
||||
}
|
||||
else if( Rnd.get(100) < 10 )
|
||||
skill = 4130;
|
||||
else if( Rnd.get(100) < 10 )
|
||||
skill = 4131;
|
||||
else if( Rnd.get(100) < 10 )
|
||||
skill = 4128;
|
||||
else if( Rnd.get(100) < 10 )
|
||||
skill = 4129;
|
||||
else
|
||||
skill = 4127;
|
||||
return skill;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSkillSee (L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet)
|
||||
{
|
||||
if (npc.isInvul())
|
||||
{
|
||||
npc.getAI().setIntention(AI_INTENTION_IDLE);
|
||||
return null;
|
||||
}
|
||||
npc.setTarget(caster);
|
||||
return super.onSkillSee(npc, caster, skill, targets, isPet);
|
||||
}
|
||||
|
||||
public int getDist(int range)
|
||||
{
|
||||
int dist = 0;
|
||||
switch(range)
|
||||
{
|
||||
case -1:
|
||||
break;
|
||||
case 100:
|
||||
dist = 85;
|
||||
break;
|
||||
default:
|
||||
dist = range-85;
|
||||
break;
|
||||
}
|
||||
return dist;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// Quest class and state definition
|
||||
new Baium(-1, "baium", "ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,225 @@
|
||||
/*
|
||||
* 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.individual;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javolution.util.FastList;
|
||||
import ai.group_template.L2AttackableAIScript;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.instancemanager.GrandBossManager;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2GrandBossInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
|
||||
import com.l2jserver.gameserver.network.serverpackets.PlaySound;
|
||||
import com.l2jserver.gameserver.templates.StatsSet;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
/**
|
||||
* Core AI
|
||||
*
|
||||
* @author DrLecter Revised By Emperorc
|
||||
*/
|
||||
public class Core extends L2AttackableAIScript
|
||||
{
|
||||
private static final int CORE = 29006;
|
||||
private static final int DEATH_KNIGHT = 29007;
|
||||
private static final int DOOM_WRAITH = 29008;
|
||||
//private static final int DICOR = 29009;
|
||||
//private static final int VALIDUS = 29010;
|
||||
private static final int SUSCEPTOR = 29011;
|
||||
//private static final int PERUM = 29012;
|
||||
//private static final int PREMO = 29013;
|
||||
|
||||
//CORE Status Tracking :
|
||||
private static final byte ALIVE = 0; //Core is spawned.
|
||||
private static final byte DEAD = 1; //Core has been killed.
|
||||
|
||||
private static boolean _FirstAttacked;
|
||||
|
||||
List<L2Attackable> Minions = new FastList<L2Attackable>();
|
||||
|
||||
public Core(int id, String name, String descr)
|
||||
{
|
||||
super(id, name, descr);
|
||||
|
||||
int[] mobs =
|
||||
{
|
||||
CORE, DEATH_KNIGHT, DOOM_WRAITH, SUSCEPTOR
|
||||
};
|
||||
registerMobs(mobs);
|
||||
|
||||
_FirstAttacked = false;
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
|
||||
int status = GrandBossManager.getInstance().getBossStatus(CORE);
|
||||
if (status == DEAD)
|
||||
{
|
||||
// load the unlock date and time for Core from DB
|
||||
long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||
// if Core is locked until a certain time, mark it so and start the unlock timer
|
||||
// the unlock time has not yet expired.
|
||||
if (temp > 0)
|
||||
startQuestTimer("core_unlock", temp, null, null);
|
||||
else
|
||||
{
|
||||
// the time has already expired while the server was offline. Immediately spawn Core.
|
||||
L2GrandBossInstance core = (L2GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(CORE, ALIVE);
|
||||
this.spawnBoss(core);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
String test = loadGlobalQuestVar("Core_Attacked");
|
||||
if (test.equalsIgnoreCase("true"))
|
||||
_FirstAttacked = true;
|
||||
int loc_x = info.getInteger("loc_x");
|
||||
int loc_y = info.getInteger("loc_y");
|
||||
int loc_z = info.getInteger("loc_z");
|
||||
int heading = info.getInteger("heading");
|
||||
int hp = info.getInteger("currentHP");
|
||||
int mp = info.getInteger("currentMP");
|
||||
L2GrandBossInstance core = (L2GrandBossInstance) addSpawn(CORE, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
core.setCurrentHpMp(hp, mp);
|
||||
this.spawnBoss(core);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveGlobalData()
|
||||
{
|
||||
String val = "" + _FirstAttacked;
|
||||
saveGlobalQuestVar("Core_Attacked", val);
|
||||
}
|
||||
|
||||
public void spawnBoss(L2GrandBossInstance npc)
|
||||
{
|
||||
GrandBossManager.getInstance().addBoss(npc);
|
||||
npc.broadcastPacket(new PlaySound(1, "BS01_A", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
//Spawn minions
|
||||
L2Attackable mob;
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
int x = 16800 + i * 360;
|
||||
mob = (L2Attackable)addSpawn(DEATH_KNIGHT, x, 110000, npc.getZ(), 280 + Rnd.get(40), false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
Minions.add(mob);
|
||||
mob = (L2Attackable)addSpawn(DEATH_KNIGHT, x, 109000, npc.getZ(), 280 + Rnd.get(40), false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
Minions.add(mob);
|
||||
int x2 = 16800 + i * 600;
|
||||
mob = (L2Attackable)addSpawn(DOOM_WRAITH, x2, 109300, npc.getZ(), 280 + Rnd.get(40), false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
Minions.add(mob);
|
||||
}
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
int x = 16800 + i * 450;
|
||||
mob = (L2Attackable)addSpawn(SUSCEPTOR, x, 110300, npc.getZ(), 280 + Rnd.get(40), false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
Minions.add(mob);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equalsIgnoreCase("core_unlock"))
|
||||
{
|
||||
L2GrandBossInstance core = (L2GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(CORE, ALIVE);
|
||||
spawnBoss(core);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("spawn_minion"))
|
||||
{
|
||||
L2Attackable mob = (L2Attackable)addSpawn(npc.getNpcId(), npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
Minions.add(mob);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("despawn_minions"))
|
||||
{
|
||||
for (int i = 0; i < Minions.size(); i++)
|
||||
{
|
||||
L2Attackable mob = Minions.get(i);
|
||||
if (mob != null)
|
||||
mob.decayMe();
|
||||
}
|
||||
Minions.clear();
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (npc.getNpcId() == CORE)
|
||||
{
|
||||
if (_FirstAttacked)
|
||||
{
|
||||
if (Rnd.get(100) == 0)
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), 0, npc.getNpcId(), 1000003)); // Removing intruders.
|
||||
}
|
||||
else
|
||||
{
|
||||
_FirstAttacked = true;
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), 0, npc.getNpcId(), 1000001)); // A non-permitted target has been discovered.
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), 0, npc.getNpcId(), 1000002)); // Intruder removal system initiated.
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
int npcId = npc.getNpcId();
|
||||
if (npcId == CORE)
|
||||
{
|
||||
int objId = npc.getObjectId();
|
||||
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, objId, npc.getX(), npc.getY(), npc.getZ()));
|
||||
npc.broadcastPacket(new NpcSay(objId, 0, npcId, 1000004)); // A fatal error has occurred.
|
||||
npc.broadcastPacket(new NpcSay(objId, 0, npcId, 1000005)); // System is being shut down...
|
||||
npc.broadcastPacket(new NpcSay(objId, 0, npcId, 1000006)); // ......
|
||||
_FirstAttacked = false;
|
||||
addSpawn(31842, 16502, 110165, -6394, 0, false, 900000);
|
||||
addSpawn(31842, 18948, 110166, -6397, 0, false, 900000);
|
||||
GrandBossManager.getInstance().setBossStatus(CORE, DEAD);
|
||||
//time is 60hour +/- 23hour
|
||||
long respawnTime = (long) Config.Interval_Of_Core_Spawn + Rnd.get(Config.Random_Of_Core_Spawn);
|
||||
startQuestTimer("core_unlock", respawnTime, null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
|
||||
info.set("respawn_time", (System.currentTimeMillis() + respawnTime));
|
||||
GrandBossManager.getInstance().setStatsSet(CORE, info);
|
||||
this.startQuestTimer("despawn_minions", 20000, null, null);
|
||||
this.cancelQuestTimers("spawn_minion");
|
||||
}
|
||||
else if (GrandBossManager.getInstance().getBossStatus(CORE) == ALIVE && Minions != null && Minions.contains(npc))
|
||||
{
|
||||
Minions.remove(npc);
|
||||
startQuestTimer("spawn_minion", 60000, npc, null);
|
||||
}
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// now call the constructor (starts up the ai)
|
||||
new Core(-1, "core", "ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,227 @@
|
||||
/*
|
||||
* 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.individual;
|
||||
|
||||
|
||||
import javolution.util.FastMap;
|
||||
import javolution.util.FastSet;
|
||||
import ai.group_template.L2AttackableAIScript;
|
||||
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.datatables.NpcTable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
public class DarkWaterDragon extends L2AttackableAIScript
|
||||
{
|
||||
private static final int DRAGON = 22267;
|
||||
private static final int SHADE1 = 22268;
|
||||
private static final int SHADE2 = 22269;
|
||||
private static final int FAFURION = 18482;
|
||||
private static final int DETRACTOR1 = 22270;
|
||||
private static final int DETRACTOR2 = 22271;
|
||||
private static FastSet<Integer> secondSpawn = new FastSet<Integer>(); //Used to track if second Shades were already spawned
|
||||
private static FastSet<Integer> myTrackingSet = new FastSet<Integer>(); //Used to track instances of npcs
|
||||
private static FastMap<Integer, L2PcInstance> _idmap = new FastMap<Integer, L2PcInstance>().shared(); //Used to track instances of npcs
|
||||
|
||||
public DarkWaterDragon(int id, String name, String descr)
|
||||
{
|
||||
super(id,name,descr);
|
||||
int[] mobs = {DRAGON, SHADE1, SHADE2, FAFURION, DETRACTOR1, DETRACTOR2};
|
||||
this.registerMobs(mobs, QuestEventType.ON_KILL, QuestEventType.ON_SPAWN, QuestEventType.ON_ATTACK);
|
||||
myTrackingSet.clear();
|
||||
secondSpawn.clear();
|
||||
}
|
||||
@Override
|
||||
public String onAdvEvent (String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (npc != null)
|
||||
{
|
||||
if (event.equalsIgnoreCase("first_spawn")) //timer to start timer "1"
|
||||
{
|
||||
this.startQuestTimer("1",40000, npc, null, true); //spawns detractor every 40 seconds
|
||||
}
|
||||
else if (event.equalsIgnoreCase("second_spawn")) //timer to start timer "2"
|
||||
{
|
||||
this.startQuestTimer("2",40000, npc, null, true); //spawns detractor every 40 seconds
|
||||
}
|
||||
else if (event.equalsIgnoreCase("third_spawn")) //timer to start timer "3"
|
||||
{
|
||||
this.startQuestTimer("3",40000, npc, null, true); //spawns detractor every 40 seconds
|
||||
}
|
||||
else if (event.equalsIgnoreCase("fourth_spawn")) //timer to start timer "4"
|
||||
{
|
||||
this.startQuestTimer("4",40000, npc, null, true); //spawns detractor every 40 seconds
|
||||
}
|
||||
else if (event.equalsIgnoreCase("1")) //spawns a detractor
|
||||
{
|
||||
this.addSpawn(DETRACTOR1,(npc.getX()+100),(npc.getY()+100),npc.getZ(),0,false,40000);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("2")) //spawns a detractor
|
||||
{
|
||||
this.addSpawn(DETRACTOR2,(npc.getX()+100),(npc.getY()-100),npc.getZ(),0,false,40000);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("3")) //spawns a detractor
|
||||
{
|
||||
this.addSpawn(DETRACTOR1,(npc.getX()-100),(npc.getY()+100),npc.getZ(),0,false,40000);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("4")) //spawns a detractor
|
||||
{
|
||||
this.addSpawn(DETRACTOR2,(npc.getX()-100),(npc.getY()-100),npc.getZ(),0,false,40000);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("fafurion_despawn")) //Fafurion Kindred disappears and drops reward
|
||||
{
|
||||
this.cancelQuestTimer("fafurion_poison", npc, null);
|
||||
this.cancelQuestTimer("1", npc, null);
|
||||
this.cancelQuestTimer("2", npc, null);
|
||||
this.cancelQuestTimer("3", npc, null);
|
||||
this.cancelQuestTimer("4", npc, null);
|
||||
|
||||
myTrackingSet.remove(npc.getObjectId());
|
||||
player = _idmap.remove(npc.getObjectId());
|
||||
if(player != null) //You never know ...
|
||||
((L2Attackable)npc).doItemDrop(NpcTable.getInstance().getTemplate(18485), player);
|
||||
|
||||
npc.deleteMe();
|
||||
}
|
||||
else if (event.equalsIgnoreCase("fafurion_poison")) //Reduces Fafurions hp like it is poisoned
|
||||
{
|
||||
if (npc.getCurrentHp() <= 500)
|
||||
{
|
||||
this.cancelQuestTimer("fafurion_despawn", npc, null);
|
||||
this.cancelQuestTimer("first_spawn", npc, null);
|
||||
this.cancelQuestTimer("second_spawn", npc, null);
|
||||
this.cancelQuestTimer("third_spawn", npc, null);
|
||||
this.cancelQuestTimer("fourth_spawn", npc, null);
|
||||
this.cancelQuestTimer("1", npc, null);
|
||||
this.cancelQuestTimer("2", npc, null);
|
||||
this.cancelQuestTimer("3", npc, null);
|
||||
this.cancelQuestTimer("4", npc, null);
|
||||
myTrackingSet.remove(npc.getObjectId());
|
||||
_idmap.remove(npc.getObjectId());
|
||||
}
|
||||
npc.reduceCurrentHp(500, npc, null); //poison kills Fafurion if he is not healed
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event,npc,player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack (L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
int npcId = npc.getNpcId();
|
||||
int npcObjId = npc.getObjectId();
|
||||
if (npcId == DRAGON)
|
||||
{
|
||||
if (!myTrackingSet.contains(npcObjId)) //this allows to handle multiple instances of npc
|
||||
{
|
||||
myTrackingSet.add(npcObjId);
|
||||
//Spawn first 5 shades on first attack on Dark Water Dragon
|
||||
L2Character originalAttacker = isPet? attacker.getPet(): attacker;
|
||||
spawnShade(originalAttacker, SHADE1, npc.getX() + 100, npc.getY() + 100, npc.getZ());
|
||||
spawnShade(originalAttacker, SHADE2, npc.getX() + 100, npc.getY() - 100, npc.getZ());
|
||||
spawnShade(originalAttacker, SHADE1, npc.getX() - 100, npc.getY() + 100, npc.getZ());
|
||||
spawnShade(originalAttacker, SHADE2, npc.getX() - 100, npc.getY() - 100, npc.getZ());
|
||||
spawnShade(originalAttacker, SHADE1, npc.getX() - 150, npc.getY() + 150, npc.getZ());
|
||||
}
|
||||
else if (npc.getCurrentHp() < (npc.getMaxHp() / 2.0) && !(secondSpawn.contains(npcObjId)))
|
||||
{
|
||||
secondSpawn.add(npcObjId);
|
||||
//Spawn second 5 shades on half hp of on Dark Water Dragon
|
||||
L2Character originalAttacker = isPet? attacker.getPet(): attacker;
|
||||
spawnShade(originalAttacker, SHADE2, npc.getX() + 100, npc.getY() + 100, npc.getZ());
|
||||
spawnShade(originalAttacker, SHADE1, npc.getX() + 100, npc.getY() - 100, npc.getZ());
|
||||
spawnShade(originalAttacker, SHADE2, npc.getX() - 100, npc.getY() + 100, npc.getZ());
|
||||
spawnShade(originalAttacker, SHADE1, npc.getX() - 100, npc.getY() - 100, npc.getZ());
|
||||
spawnShade(originalAttacker, SHADE2, npc.getX() - 150, npc.getY() + 150, npc.getZ());
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill (L2Npc npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
int npcId = npc.getNpcId();
|
||||
int npcObjId = npc.getObjectId();
|
||||
if (npcId == DRAGON)
|
||||
{
|
||||
myTrackingSet.remove(npcObjId);
|
||||
secondSpawn.remove(npcObjId);
|
||||
L2Attackable faf = (L2Attackable) this.addSpawn(FAFURION,npc.getX(),npc.getY(),npc.getZ(),0,false,0); //spawns Fafurion Kindred when Dard Water Dragon is dead
|
||||
_idmap.put(faf.getObjectId(),killer);
|
||||
}
|
||||
else if (npcId == FAFURION)
|
||||
{
|
||||
this.cancelQuestTimer("fafurion_poison", npc, null);
|
||||
this.cancelQuestTimer("fafurion_despawn", npc, null);
|
||||
this.cancelQuestTimer("first_spawn", npc, null);
|
||||
this.cancelQuestTimer("second_spawn", npc, null);
|
||||
this.cancelQuestTimer("third_spawn", npc, null);
|
||||
this.cancelQuestTimer("fourth_spawn", npc, null);
|
||||
this.cancelQuestTimer("1", npc, null);
|
||||
this.cancelQuestTimer("2", npc, null);
|
||||
this.cancelQuestTimer("3", npc, null);
|
||||
this.cancelQuestTimer("4", npc, null);
|
||||
myTrackingSet.remove(npcObjId);
|
||||
_idmap.remove(npcObjId);
|
||||
}
|
||||
return super.onKill(npc,killer,isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn (L2Npc npc)
|
||||
{
|
||||
int npcId = npc.getNpcId();
|
||||
int npcObjId = npc.getObjectId();
|
||||
if (npcId == FAFURION)
|
||||
{
|
||||
if (!myTrackingSet.contains(npcObjId))
|
||||
{
|
||||
myTrackingSet.add(npcObjId);
|
||||
//Spawn 4 Detractors on spawn of Fafurion
|
||||
int x = npc.getX();
|
||||
int y = npc.getY();
|
||||
this.addSpawn(DETRACTOR2,x+100,y+100,npc.getZ(),0,false,40000);
|
||||
this.addSpawn(DETRACTOR1,x+100,y-100,npc.getZ(),0,false,40000);
|
||||
this.addSpawn(DETRACTOR2,x-100,y+100,npc.getZ(),0,false,40000);
|
||||
this.addSpawn(DETRACTOR1,x-100,y-100,npc.getZ(),0,false,40000);
|
||||
this.startQuestTimer("first_spawn",2000, npc, null); //timer to delay timer "1"
|
||||
this.startQuestTimer("second_spawn",4000, npc, null); //timer to delay timer "2"
|
||||
this.startQuestTimer("third_spawn",8000, npc, null); //timer to delay timer "3"
|
||||
this.startQuestTimer("fourth_spawn",10000, npc, null); //timer to delay timer "4"
|
||||
this.startQuestTimer("fafurion_poison",3000, npc, null, true); //Every three seconds reduces Fafurions hp like it is poisoned
|
||||
this.startQuestTimer("fafurion_despawn",120000, npc, null); //Fafurion Kindred disappears after two minutes
|
||||
}
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
public void spawnShade(L2Character attacker, int npcId, int x, int y, int z)
|
||||
{
|
||||
final L2Npc shade = addSpawn(npcId,x,y,z,0,false,0);
|
||||
shade.setRunning();
|
||||
((L2Attackable)shade).addDamageHate(attacker,0,999);
|
||||
shade.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, attacker);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// Quest class and state definition
|
||||
new DarkWaterDragon(-1,"DarkWaterDragon","ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* 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.individual;
|
||||
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.datatables.SpawnTable;
|
||||
import com.l2jserver.gameserver.model.L2CharPosition;
|
||||
import com.l2jserver.gameserver.model.L2Spawn;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.quest.Quest;
|
||||
import com.l2jserver.gameserver.network.serverpackets.PlaySound;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SocialAction;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SpecialCamera;
|
||||
|
||||
|
||||
/**
|
||||
* DrChaos AI
|
||||
* @author Kerberos
|
||||
*
|
||||
*/
|
||||
public class DrChaos extends Quest
|
||||
{
|
||||
|
||||
private static final int DOCTER_CHAOS = 32033;
|
||||
private static final int STRANGE_MACHINE = 32032;
|
||||
private static final int CHAOS_GOLEM = 25512;
|
||||
private static boolean _IsGolemSpawned;
|
||||
|
||||
public DrChaos(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
|
||||
addFirstTalkId(32033);
|
||||
_IsGolemSpawned = false;
|
||||
}
|
||||
|
||||
public L2Npc findTemplate(int npcId)
|
||||
{
|
||||
for(L2Spawn spawn : SpawnTable.getInstance().getSpawnTable())
|
||||
{
|
||||
if (spawn != null && spawn.getNpcid() == npcId)
|
||||
{
|
||||
return spawn.getLastSpawn();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent (String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equalsIgnoreCase("1"))
|
||||
{
|
||||
L2Npc machine_instance = findTemplate(STRANGE_MACHINE);
|
||||
if (machine_instance != null)
|
||||
{
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, machine_instance);
|
||||
machine_instance.broadcastPacket(new SpecialCamera(machine_instance.getObjectId(),1,-200,15,10000,20000,0,0,1,0));
|
||||
}
|
||||
else
|
||||
//print "Dr Chaos AI: problem finding Strange Machine (npcid = "+STRANGE_MACHINE+"). Error: not spawned!"
|
||||
startQuestTimer("2",2000,npc,player);
|
||||
startQuestTimer("3",10000,npc,player);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("2"))
|
||||
npc.broadcastPacket(new SocialAction(npc,3));
|
||||
else if (event.equalsIgnoreCase("3"))
|
||||
{
|
||||
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1,-150,10,3000,20000,0,0,1,0));
|
||||
startQuestTimer("4",2500,npc,player);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("4"))
|
||||
{
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(96055,-110759,-3312,0));
|
||||
startQuestTimer("5",2000,npc,player);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("5"))
|
||||
{
|
||||
player.teleToLocation(94832,-112624,-3304);
|
||||
npc.teleToLocation(-113091,-243942,-15536);
|
||||
if (!_IsGolemSpawned)
|
||||
{
|
||||
L2Npc golem = addSpawn(CHAOS_GOLEM,94640,-112496,-3336,0,false,0);
|
||||
_IsGolemSpawned = true;
|
||||
startQuestTimer("6",1000,golem,player);
|
||||
player.sendPacket(new PlaySound(1,"Rm03_A",0,0,0,0,0));
|
||||
}
|
||||
}
|
||||
else if (event.equalsIgnoreCase("6"))
|
||||
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),30,-200,20,6000,8000,0,0,1,0));
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk (L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (npc.getNpcId() == DOCTER_CHAOS)
|
||||
{
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(96323,-110914,-3328,0));
|
||||
this.startQuestTimer("1",3000,npc,player);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new DrChaos(-1,"Doctor Chaos","ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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.individual;
|
||||
|
||||
import ai.group_template.L2AttackableAIScript;
|
||||
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.model.L2CharPosition;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.quest.Quest;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
public class FleeNpc extends L2AttackableAIScript
|
||||
{
|
||||
private int[] _npcId = { 20432, 22228 ,18150,18151,18152,18153,18154,18155,18156,18157};
|
||||
|
||||
public FleeNpc(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
|
||||
for( int i = 0; i < _npcId.length; i++ )
|
||||
{
|
||||
this.addEventId(_npcId[i], Quest.QuestEventType.ON_ATTACK);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (npc.getNpcId() >= 18150 && npc.getNpcId() <= 18157)
|
||||
{
|
||||
npc.getAI().setIntention( CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition((npc.getX() + Rnd.get(-40, 40)), (npc.getY()+ Rnd.get(-40, 40)), npc.getZ(), npc.getHeading()));
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null, null);
|
||||
return null;
|
||||
}
|
||||
else if (npc.getNpcId() == 20432 || npc.getNpcId() == 22228)
|
||||
{
|
||||
if (Rnd.get(3) == 2)
|
||||
npc.getAI().setIntention( CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition((npc.getX() + Rnd.get(-200, 200)), (npc.getY()+ Rnd.get(-200, 200)), npc.getZ(), npc.getHeading()));
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null, null);
|
||||
return null;
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
// Register the new Script at the Script System
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new FleeNpc(-1, "FleeNpc", "Ai for Flee Npcs");
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* 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.individual;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import ai.group_template.L2AttackableAIScript;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.SpawnTable;
|
||||
import com.l2jserver.gameserver.model.L2Spawn;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SocialAction;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
/**
|
||||
* Dilios AI
|
||||
* @author JIV, Sephiroth, Apocalipce
|
||||
*
|
||||
*/
|
||||
public class GeneralDilios extends L2AttackableAIScript
|
||||
{
|
||||
private static final int generalId = 32549;
|
||||
private static final int guardId = 32619;
|
||||
|
||||
private L2Npc _general;
|
||||
private List<L2Npc> _guards = new ArrayList<L2Npc>();
|
||||
|
||||
private static final int[] diliosText =
|
||||
{
|
||||
1800695, // Messenger, inform the patrons of the Keucereus Alliance Base! We're gathering brave adventurers to attack Tiat's Mounted Troop that's rooted in the Seed of Destruction.
|
||||
//1800696, Messenger, inform the patrons of the Keucereus Alliance Base! The Seed of Destruction is currently secured under the flag of the Keucereus Alliance!
|
||||
//1800697, Messenger, inform the patrons of the Keucereus Alliance Base! Tiat's Mounted Troop is currently trying to retake Seed of Destruction! Commit all the available reinforcements into Seed of Destruction!
|
||||
1800698, // Messenger, inform the brothers in Kucereus' clan outpost! Brave adventurers who have challenged the Seed of Infinity are currently infiltrating the Hall of Erosion through the defensively weak Hall of Suffering!
|
||||
//1800699, Messenger, inform the brothers in Kucereus' clan outpost! Sweeping the Seed of Infinity is currently complete to the Heart of the Seed. Ekimus is being directly attacked, and the Undead remaining in the Hall of Suffering are being eradicated!
|
||||
1800700 // Messenger, inform the patrons of the Keucereus Alliance Base! The Seed of Infinity is currently secured under the flag of the Keucereus Alliance!
|
||||
//1800702 Messenger, inform the patrons of the Keucereus Alliance Base! The resurrected Undead in the Seed of Infinity are pouring into the Hall of Suffering and the Hall of Erosion!
|
||||
//1800703 Messenger, inform the brothers in Kucereus' clan outpost! Ekimus is about to be revived by the resurrected Undead in Seed of Infinity. Send all reinforcements to the Heart and the Hall of Suffering!
|
||||
};
|
||||
|
||||
public GeneralDilios(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
findNpcs();
|
||||
if (_general == null || _guards.isEmpty())
|
||||
throw new NullPointerException("Cannot find npcs!");
|
||||
startQuestTimer("command_0", 60000, null, null);
|
||||
}
|
||||
|
||||
public void findNpcs()
|
||||
{
|
||||
for (L2Spawn spawn : SpawnTable.getInstance().getSpawnTable())
|
||||
if (spawn != null)
|
||||
if (spawn.getNpcid() == generalId)
|
||||
_general = spawn.getLastSpawn();
|
||||
else if (spawn.getNpcid() == guardId)
|
||||
_guards.add(spawn.getLastSpawn());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.startsWith("command_"))
|
||||
{
|
||||
int value = Integer.parseInt(event.substring(8));
|
||||
if (value < 6)
|
||||
{
|
||||
_general.broadcastPacket(new NpcSay(_general.getObjectId(), 0, generalId, 1800704)); // Stabbing three times!
|
||||
startQuestTimer("guard_animation_0", 3400, null, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
value = -1;
|
||||
_general.broadcastPacket(new NpcSay(_general.getObjectId(), 1, generalId, diliosText[Rnd.get(diliosText.length)]));
|
||||
}
|
||||
startQuestTimer("command_"+(value+1), 60000, null, null);
|
||||
}
|
||||
else if (event.startsWith("guard_animation_"))
|
||||
{
|
||||
int value = Integer.parseInt(event.substring(16));
|
||||
for (L2Npc guard : _guards)
|
||||
{
|
||||
guard.broadcastPacket(new SocialAction(guard, 4));
|
||||
}
|
||||
if (value < 2)
|
||||
startQuestTimer("guard_animation_"+(value+1), 1500, null, null);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new GeneralDilios(-1, "GeneralDilios", "ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,237 @@
|
||||
/*
|
||||
* 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.individual;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import ai.group_template.L2AttackableAIScript;
|
||||
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.datatables.SpawnTable;
|
||||
import com.l2jserver.gameserver.model.L2CharPosition;
|
||||
import com.l2jserver.gameserver.model.L2Spawn;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
* Gordon AI
|
||||
* @author TOFIZ
|
||||
* @version $Revision: 1.1 $ $Date: 2008/08/21 $
|
||||
*/
|
||||
public class Gordon extends L2AttackableAIScript
|
||||
{
|
||||
private static final int GORDON = 29095;
|
||||
private static int _npcMoveX = 0;
|
||||
private static int _npcMoveY = 0;
|
||||
private static int _isWalkTo = 0;
|
||||
private static int _npcBlock = 0;
|
||||
private static int X = 0;
|
||||
private static int Y = 0;
|
||||
private static int Z = 0;
|
||||
private static final int[][] WALKS = {
|
||||
{141569, -45908, -2387},{142494, -45456, -2397},{142922, -44561, -2395},
|
||||
{143672, -44130, -2398},{144557, -43378, -2325},{145839, -43267, -2301},
|
||||
{147044, -43601, -2307},{148140, -43206, -2303},{148815, -43434, -2328},
|
||||
{149862, -44151, -2558},{151037, -44197, -2708},{152555, -42756, -2836},
|
||||
{154808, -39546, -3236},{155333, -39962, -3272},{156531, -41240, -3470},
|
||||
{156863, -43232, -3707},{156783, -44198, -3764},{158169, -45163, -3541},
|
||||
{158952, -45479, -3473},{160039, -46514, -3634},{160244, -47429, -3656},
|
||||
{159155, -48109, -3665},{159558, -51027, -3523},{159396, -53362, -3244},
|
||||
{160872, -56556, -2789},{160857, -59072, -2613},{160410, -59888, -2647},
|
||||
{158770, -60173, -2673},{156368, -59557, -2638},{155188, -59868, -2642},
|
||||
{154118, -60591, -2731},{153571, -61567, -2821},{153457, -62819, -2886},
|
||||
{152939, -63778, -3003},{151816, -64209, -3120},{147655, -64826, -3433},
|
||||
{145422, -64576, -3369},{144097, -64320, -3404},{140780, -61618, -3096},
|
||||
{139688, -61450, -3062},{138267, -61743, -3056},{138613, -58491, -3465},
|
||||
{138139, -57252, -3517},{139555, -56044, -3310},{139107, -54537, -3240},
|
||||
{139279, -53781, -3091},{139810, -52687, -2866},{139657, -52041, -2793},
|
||||
{139215, -51355, -2698},{139334, -50514, -2594},{139817, -49715, -2449},
|
||||
{139824, -48976, -2263},{140130, -47578, -2213},{140483, -46339, -2382},
|
||||
{141569, -45908, -2387}};
|
||||
|
||||
private static boolean _isAttacked = false;
|
||||
private static boolean _isSpawned = false;
|
||||
|
||||
public Gordon (int id, String name, String descr)
|
||||
{
|
||||
super(id,name,descr);
|
||||
int[] mobs = {GORDON};
|
||||
registerMobs(mobs, QuestEventType.ON_ATTACK, QuestEventType.ON_KILL, QuestEventType.ON_SPAWN);
|
||||
// wait 2 minutes after Start AI
|
||||
startQuestTimer("check_ai", 120000, null, null, true);
|
||||
|
||||
_isSpawned = false;
|
||||
_isAttacked = false;
|
||||
_isWalkTo = 1;
|
||||
_npcMoveX = 0;
|
||||
_npcMoveY = 0;
|
||||
_npcBlock = 0;
|
||||
}
|
||||
|
||||
public L2Npc findTemplate(int npcId)
|
||||
{
|
||||
L2Npc npc = null;
|
||||
for (L2Spawn spawn : SpawnTable.getInstance().getSpawnTable())
|
||||
{
|
||||
if (spawn != null && spawn.getNpcid() == npcId)
|
||||
{
|
||||
npc = spawn.getLastSpawn();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent (String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
X = WALKS[_isWalkTo-1][0];
|
||||
Y = WALKS[_isWalkTo-1][1];
|
||||
Z = WALKS[_isWalkTo-1][2];
|
||||
if (event.equalsIgnoreCase("time_isAttacked"))
|
||||
{
|
||||
_isAttacked = false;
|
||||
if (npc.getNpcId() == GORDON)
|
||||
{
|
||||
npc.setWalking();
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(X, Y, Z, 0));
|
||||
}
|
||||
}
|
||||
else if (event.equalsIgnoreCase("check_ai"))
|
||||
{
|
||||
cancelQuestTimer("check_ai", null, null);
|
||||
if (_isSpawned == false)
|
||||
{
|
||||
L2Npc gordon_ai = findTemplate(GORDON);
|
||||
if (gordon_ai != null)
|
||||
{
|
||||
_isSpawned = true;
|
||||
startQuestTimer("Start", 1000, gordon_ai, null, true);
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (event.equalsIgnoreCase("Start"))
|
||||
{
|
||||
if (npc != null && _isSpawned == true)
|
||||
{
|
||||
// check if player have Cursed Weapon and in radius
|
||||
if (npc.getNpcId() == GORDON)
|
||||
{
|
||||
Collection<L2PcInstance> chars = npc.getKnownList().getKnownPlayers().values();
|
||||
if (chars != null && chars.size() > 0)
|
||||
{
|
||||
for (L2PcInstance pc : chars)
|
||||
{
|
||||
if (pc.isCursedWeaponEquipped() && pc.isInsideRadius(npc,5000,false,false))
|
||||
{
|
||||
npc.setRunning();
|
||||
((L2Attackable)npc).addDamageHate(pc,0,9999);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, pc);
|
||||
_isAttacked = true;
|
||||
cancelQuestTimer("time_isAttacked",null, null);
|
||||
startQuestTimer("time_isAttacked",180000, npc, null);
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// end check
|
||||
if (_isAttacked == true)
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
if (npc.getNpcId() == GORDON && (npc.getX()-50) <= X && (npc.getX()+50) >= X && (npc.getY()-50) <= Y && (npc.getY()+50) >= Y)
|
||||
{
|
||||
_isWalkTo++;
|
||||
if (_isWalkTo > 55)
|
||||
_isWalkTo = 1;
|
||||
X = WALKS[_isWalkTo-1][0];
|
||||
Y = WALKS[_isWalkTo-1][1];
|
||||
Z = WALKS[_isWalkTo-1][2];
|
||||
npc.setWalking();
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(X, Y, Z, 0));
|
||||
}
|
||||
|
||||
// Test for unblock Npc
|
||||
if (npc.getX() != _npcMoveX && npc.getY() != _npcMoveY)
|
||||
{
|
||||
_npcMoveX = npc.getX();
|
||||
_npcMoveY = npc.getY();
|
||||
_npcBlock = 0;
|
||||
}
|
||||
else if (npc.getNpcId() == GORDON)
|
||||
{
|
||||
_npcBlock++;
|
||||
if (_npcBlock > 2)
|
||||
{
|
||||
npc.teleToLocation(X, Y, Z);
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
if (_npcBlock > 0)
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(X, Y, Z, 0));
|
||||
}
|
||||
// End Test unblock Npc
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn (L2Npc npc)
|
||||
{
|
||||
if (npc.getNpcId() == GORDON && _npcBlock == 0)
|
||||
{
|
||||
_isSpawned = true;
|
||||
_isWalkTo = 1;
|
||||
startQuestTimer("Start", 1000, npc, null, true);
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack (L2Npc npc, L2PcInstance player, int damage, boolean isPet)
|
||||
{
|
||||
if (npc.getNpcId() == GORDON)
|
||||
{
|
||||
_isAttacked = true;
|
||||
cancelQuestTimer("time_isAttacked", null, null);
|
||||
startQuestTimer("time_isAttacked", 180000, npc, null);
|
||||
if (player != null)
|
||||
{
|
||||
npc.setRunning();
|
||||
((L2Attackable)npc).addDamageHate(player, 0, 100);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, player, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill (L2Npc npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
if (npc.getNpcId() == GORDON)
|
||||
{
|
||||
cancelQuestTimer("Start", null, null);
|
||||
cancelQuestTimer("time_isAttacked", null, null);
|
||||
_isSpawned = false;
|
||||
}
|
||||
return super.onKill(npc,killer,isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Gordon(-1,"gordon","ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,443 @@
|
||||
/*
|
||||
* 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.individual;
|
||||
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import javolution.util.FastList;
|
||||
import ai.group_template.L2AttackableAIScript;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.cache.HtmCache;
|
||||
import com.l2jserver.gameserver.datatables.DoorTable;
|
||||
import com.l2jserver.gameserver.datatables.NpcTable;
|
||||
import com.l2jserver.gameserver.datatables.SpawnTable;
|
||||
import com.l2jserver.gameserver.instancemanager.GrandBossManager;
|
||||
import com.l2jserver.gameserver.model.L2ItemInstance;
|
||||
import com.l2jserver.gameserver.model.L2Spawn;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.quest.Quest;
|
||||
import com.l2jserver.gameserver.model.zone.type.L2BossZone;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jserver.gameserver.templates.chars.L2NpcTemplate;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
/**
|
||||
* Ice Fairy Sirra AI
|
||||
* @author Kerberos
|
||||
*/
|
||||
|
||||
public class IceFairySirra extends L2AttackableAIScript
|
||||
{
|
||||
private static final int STEWARD = 32029;
|
||||
private static final int SILVER_HEMOCYTE = 8057;
|
||||
private static L2BossZone _sirrasZone;
|
||||
private static L2PcInstance _player = null;
|
||||
protected FastList<L2Npc> _allMobs = new FastList<L2Npc>();
|
||||
protected Future<?> _onDeadEventTask = null;
|
||||
|
||||
public IceFairySirra(int id,String name,String descr)
|
||||
{
|
||||
super(id,name,descr);
|
||||
int[] mob = {STEWARD, 22100, 22102, 22104, 29056};
|
||||
this.registerMobs(mob);
|
||||
this.addEventId(STEWARD, Quest.QuestEventType.QUEST_START);
|
||||
this.addEventId(STEWARD, Quest.QuestEventType.ON_TALK);
|
||||
this.addEventId(STEWARD, Quest.QuestEventType.ON_FIRST_TALK);
|
||||
String test = loadGlobalQuestVar("Sirra_Respawn");
|
||||
if (!test.equalsIgnoreCase(""))
|
||||
{
|
||||
long remain = Long.parseLong(test) - System.currentTimeMillis();
|
||||
if (remain <= 0)
|
||||
init(false);
|
||||
else
|
||||
{
|
||||
init(true);
|
||||
startQuestTimer("respawn", remain, null, null);
|
||||
}
|
||||
}
|
||||
else
|
||||
init(false);
|
||||
}
|
||||
|
||||
public void init(boolean isBusy)
|
||||
{
|
||||
_sirrasZone = GrandBossManager.getInstance().getZone(105546 , -127892 , -2768);
|
||||
if (_sirrasZone == null)
|
||||
{
|
||||
_log.warning("IceFairySirraManager: Failed to load zone");
|
||||
return;
|
||||
}
|
||||
_sirrasZone.setZoneEnabled(false);
|
||||
L2Npc steward = findTemplate(STEWARD);
|
||||
if (steward != null)
|
||||
steward.setBusy(isBusy);
|
||||
openGates();
|
||||
}
|
||||
|
||||
public void cleanUp()
|
||||
{
|
||||
init(false);
|
||||
cancelQuestTimer("30MinutesRemaining",null, _player);
|
||||
cancelQuestTimer("20MinutesRemaining",null, _player);
|
||||
cancelQuestTimer("10MinutesRemaining",null, _player);
|
||||
cancelQuestTimer("End",null, _player);
|
||||
for (L2Npc mob : _allMobs)
|
||||
{
|
||||
try
|
||||
{
|
||||
mob.getSpawn().stopRespawn();
|
||||
mob.deleteMe();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.log(Level.SEVERE, "IceFairySirraManager: Failed deleting mob.", e);
|
||||
}
|
||||
}
|
||||
_allMobs.clear();
|
||||
}
|
||||
|
||||
public L2Npc findTemplate(int npcId)
|
||||
{
|
||||
L2Npc npc = null;
|
||||
for (L2Spawn spawn : SpawnTable.getInstance().getSpawnTable())
|
||||
{
|
||||
if (spawn != null && spawn.getNpcid() == npcId)
|
||||
{
|
||||
npc = spawn.getLastSpawn();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return npc;
|
||||
}
|
||||
|
||||
protected void openGates()
|
||||
{
|
||||
for (int i = 23140001; i < 23140003; i++ )
|
||||
{
|
||||
try
|
||||
{
|
||||
L2DoorInstance door = DoorTable.getInstance().getDoor(i);
|
||||
if (door != null)
|
||||
{
|
||||
door.openMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
_log.warning("IceFairySirraManager: Attempted to open undefined door. doorId: "+i);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.log(Level.SEVERE, "IceFairySirraManager: Failed closing door", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void closeGates()
|
||||
{
|
||||
for (int i = 23140001; i < 23140003; i++ )
|
||||
{
|
||||
try
|
||||
{
|
||||
L2DoorInstance door = DoorTable.getInstance().getDoor(i);
|
||||
if (door != null)
|
||||
{
|
||||
door.closeMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
_log.warning("IceFairySirraManager: Attempted to close undefined door. doorId: "+i);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.log(Level.SEVERE, "IceFairySirraManager: Failed closing door", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean checkItems (L2PcInstance player)
|
||||
{
|
||||
if (player.getParty() != null)
|
||||
{
|
||||
for (L2PcInstance pc : player.getParty().getPartyMembers())
|
||||
{
|
||||
L2ItemInstance i = pc.getInventory().getItemByItemId(SILVER_HEMOCYTE);
|
||||
if (i == null || i.getCount() < 10)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void destroyItems (L2PcInstance player)
|
||||
{
|
||||
if (player.getParty() != null)
|
||||
{
|
||||
for (L2PcInstance pc : player.getParty().getPartyMembers())
|
||||
{
|
||||
L2ItemInstance i = pc.getInventory().getItemByItemId(SILVER_HEMOCYTE);
|
||||
pc.destroyItem("Hemocytes", i.getObjectId(), 10, null, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
cleanUp();
|
||||
}
|
||||
|
||||
public void teleportInside (L2PcInstance player)
|
||||
{
|
||||
if (player.getParty() != null)
|
||||
{
|
||||
for (L2PcInstance pc : player.getParty().getPartyMembers())
|
||||
{
|
||||
pc.teleToLocation(113533,-126159,-3488,false);
|
||||
if (_sirrasZone == null)
|
||||
{
|
||||
_log.warning("IceFairySirraManager: Failed to load zone");
|
||||
cleanUp();
|
||||
return;
|
||||
}
|
||||
_sirrasZone.allowPlayerEntry(pc,2103);
|
||||
}
|
||||
}
|
||||
else
|
||||
cleanUp();
|
||||
}
|
||||
|
||||
public void screenMessage(L2PcInstance player, String text, int time)
|
||||
{
|
||||
if (player.getParty() != null)
|
||||
{
|
||||
for (L2PcInstance pc : player.getParty().getPartyMembers())
|
||||
{
|
||||
pc.sendPacket(new ExShowScreenMessage(text,time));
|
||||
}
|
||||
}
|
||||
else
|
||||
cleanUp();
|
||||
}
|
||||
|
||||
public void doSpawns()
|
||||
{
|
||||
int[][] mobs = { {29060 , 105546 , -127892 , -2768} ,
|
||||
{29056 , 102779 , -125920 , -2840},
|
||||
{22100 , 111719 , -126646 , -2992},
|
||||
{22102 , 109509 , -128946 , -3216},
|
||||
{22104 , 109680 , -125756 , -3136}};
|
||||
L2Spawn spawnDat;
|
||||
L2NpcTemplate template;
|
||||
try
|
||||
{
|
||||
for (int i = 0; i <5; i++)
|
||||
{
|
||||
template = NpcTable.getInstance().getTemplate(mobs[i][0]);
|
||||
if (template != null)
|
||||
{
|
||||
spawnDat = new L2Spawn(template);
|
||||
spawnDat.setAmount(1);
|
||||
spawnDat.setLocx(mobs[i][1]);
|
||||
spawnDat.setLocy(mobs[i][2]);
|
||||
spawnDat.setLocz(mobs[i][3]);
|
||||
spawnDat.setHeading(0);
|
||||
spawnDat.setRespawnDelay(60);
|
||||
SpawnTable.getInstance().addNewSpawn(spawnDat, false);
|
||||
_allMobs.add(spawnDat.doSpawn());
|
||||
spawnDat.stopRespawn();
|
||||
}
|
||||
else
|
||||
{
|
||||
_log.warning("IceFairySirraManager: Data missing in NPC table for ID: "+mobs[i][0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.warning("IceFairySirraManager: Spawns could not be initialized: "+ e);
|
||||
}
|
||||
}
|
||||
|
||||
public String getHtmlPath(int val)
|
||||
{
|
||||
String pom = "";
|
||||
|
||||
pom = "32029-" + val;
|
||||
if (val == 0)
|
||||
pom = "32029";
|
||||
|
||||
String temp = "data/html/default/" + pom + ".htm";
|
||||
|
||||
if (!Config.LAZY_CACHE)
|
||||
{
|
||||
// If not running lazy cache the file must be in the cache or it doesnt exist
|
||||
if (HtmCache.getInstance().contains(temp))
|
||||
return temp;
|
||||
}
|
||||
else if (HtmCache.getInstance().isLoadable(temp))
|
||||
return temp;
|
||||
|
||||
// If the file is not found, the standard message "I have nothing to say to you" is returned
|
||||
return "data/html/npcdefault.htm";
|
||||
}
|
||||
|
||||
public void sendHtml(L2Npc npc, L2PcInstance player, String filename)
|
||||
{
|
||||
NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
|
||||
html.setFile(player.getHtmlPrefix(), filename);
|
||||
html.replace("%objectId%", String.valueOf(npc.getObjectId()));
|
||||
player.sendPacket(html);
|
||||
player.sendPacket( ActionFailed.STATIC_PACKET );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk (L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (player.getQuestState("IceFairySirra") == null)
|
||||
newQuestState(player);
|
||||
player.setLastQuestNpcObject(npc.getObjectId());
|
||||
String filename = "";
|
||||
if (npc.isBusy())
|
||||
filename = getHtmlPath(10);
|
||||
else
|
||||
filename = getHtmlPath(0);
|
||||
sendHtml(npc, player, filename);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent (String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equalsIgnoreCase("check_condition"))
|
||||
{
|
||||
if (npc.isBusy())//should never happen
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
else
|
||||
{
|
||||
String filename = "";
|
||||
if (player.isInParty() && player.getParty().getPartyLeaderOID() == player.getObjectId())
|
||||
{
|
||||
if (checkItems(player) == true)
|
||||
{
|
||||
startQuestTimer("start",100000,null,player);
|
||||
_player = player;
|
||||
destroyItems(player);
|
||||
player.getInventory().addItem("Scroll",8379,3,player,null);
|
||||
npc.setBusy(true);
|
||||
screenMessage(player,"Steward: Please wait a moment.",100000);
|
||||
filename = getHtmlPath(3);
|
||||
}
|
||||
else
|
||||
{
|
||||
filename = getHtmlPath(2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
filename = getHtmlPath(1);
|
||||
}
|
||||
sendHtml(npc, player, filename);
|
||||
}
|
||||
}
|
||||
else if (event.equalsIgnoreCase("start"))
|
||||
{
|
||||
if (_sirrasZone == null)
|
||||
{
|
||||
_log.warning("IceFairySirraManager: Failed to load zone");
|
||||
cleanUp();
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
_sirrasZone.setZoneEnabled(true);
|
||||
closeGates();
|
||||
doSpawns();
|
||||
startQuestTimer("Party_Port",2000,null,player);
|
||||
startQuestTimer("End",1802000,null,player);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("Party_Port"))
|
||||
{
|
||||
teleportInside(player);
|
||||
screenMessage(player,"Steward: Please restore the Queen's appearance!",10000);
|
||||
startQuestTimer("30MinutesRemaining",300000,null,player);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("30MinutesRemaining"))
|
||||
{
|
||||
screenMessage(player,"30 minute(s) are remaining.",10000);
|
||||
startQuestTimer("20minutesremaining",600000,null,player);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("20MinutesRemaining"))
|
||||
{
|
||||
screenMessage(player,"20 minute(s) are remaining.",10000);
|
||||
startQuestTimer("10minutesremaining",600000,null,player);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("10MinutesRemaining"))
|
||||
{
|
||||
screenMessage(player,"Steward: Waste no time! Please hurry!",10000);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("End"))
|
||||
{
|
||||
screenMessage(player,"Steward: Was it indeed too much to ask.",10000);
|
||||
cleanUp();
|
||||
}
|
||||
else if (event.equalsIgnoreCase("respawn"))
|
||||
{
|
||||
cleanUp();
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill (L2Npc npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
if (npc.getNpcId() == 29056)
|
||||
{
|
||||
cancelQuestTimer("30MinutesRemaining",null, _player);
|
||||
cancelQuestTimer("20MinutesRemaining",null, _player);
|
||||
cancelQuestTimer("10MinutesRemaining",null, _player);
|
||||
cancelQuestTimer("End",null, _player);
|
||||
for (L2Npc mob : _allMobs)
|
||||
{
|
||||
try
|
||||
{
|
||||
mob.getSpawn().stopRespawn();
|
||||
mob.deleteMe();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.log(Level.SEVERE, "IceFairySirraManager: Failed deleting mob.", e);
|
||||
}
|
||||
}
|
||||
_allMobs.clear();
|
||||
init(true);
|
||||
int respawnMinDelay = 43200000 * (int)(Config.RAID_MIN_RESPAWN_MULTIPLIER);
|
||||
int respawnMaxDelay = 129600000 * (int)(Config.RAID_MAX_RESPAWN_MULTIPLIER);
|
||||
int respawn_delay = Rnd.get(respawnMinDelay,respawnMaxDelay);
|
||||
saveGlobalQuestVar("Sirra_Respawn", String.valueOf(System.currentTimeMillis()+respawn_delay));
|
||||
startQuestTimer("respawn", respawn_delay, null, null);
|
||||
screenMessage(killer,"Steward: Thank you for restoring the Queen's appearance!",10000);
|
||||
}
|
||||
return super.onKill(npc,killer,isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new IceFairySirra(-1,"IceFairySirra","ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,368 @@
|
||||
/*
|
||||
* 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.individual;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javolution.util.FastList;
|
||||
import ai.group_template.L2AttackableAIScript;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.datatables.SkillTable;
|
||||
import com.l2jserver.gameserver.instancemanager.GrandBossManager;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
import com.l2jserver.gameserver.model.L2Spawn;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2GrandBossInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.zone.type.L2BossZone;
|
||||
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
|
||||
import com.l2jserver.gameserver.network.serverpackets.PlaySound;
|
||||
import com.l2jserver.gameserver.templates.StatsSet;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
/**
|
||||
* Orfen AI
|
||||
*
|
||||
* @author Emperorc
|
||||
*
|
||||
*/
|
||||
public class Orfen extends L2AttackableAIScript
|
||||
{
|
||||
|
||||
private static final int[][] Pos =
|
||||
{
|
||||
{
|
||||
43728, 17220, -4342
|
||||
},
|
||||
{
|
||||
55024, 17368, -5412
|
||||
},
|
||||
{
|
||||
53504, 21248, -5486
|
||||
},
|
||||
{
|
||||
53248, 24576, -5262
|
||||
}
|
||||
};
|
||||
|
||||
private static final int[] Text =
|
||||
{
|
||||
1000028, // $s1. Stop kidding yourself about your own powerlessness!
|
||||
1000029, // $s1. I'll make you feel what true fear is!
|
||||
1000030, // You're really stupid to have challenged me. $s1! Get ready!
|
||||
1000031 //$s1. Do you think that's going to work?!
|
||||
};
|
||||
|
||||
private static final int ORFEN = 29014;
|
||||
//private static final int RAIKEL = 29015;
|
||||
private static final int RAIKEL_LEOS = 29016;
|
||||
//private static final int RIBA = 29017;
|
||||
private static final int RIBA_IREN = 29018;
|
||||
|
||||
private static boolean _IsTeleported;
|
||||
private static List<L2Attackable> _Minions = new FastList<L2Attackable>();
|
||||
private static L2BossZone _Zone;
|
||||
|
||||
private static final byte ALIVE = 0;
|
||||
private static final byte DEAD = 1;
|
||||
|
||||
public Orfen(int id, String name, String descr)
|
||||
{
|
||||
super(id, name, descr);
|
||||
int[] mobs =
|
||||
{
|
||||
ORFEN, RAIKEL_LEOS, RIBA_IREN
|
||||
};
|
||||
this.registerMobs(mobs);
|
||||
_IsTeleported = false;
|
||||
_Zone = GrandBossManager.getInstance().getZone(Pos[0][0], Pos[0][1], Pos[0][2]);
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
||||
int status = GrandBossManager.getInstance().getBossStatus(ORFEN);
|
||||
if (status == DEAD)
|
||||
{
|
||||
// load the unlock date and time for Orfen from DB
|
||||
long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
// if Orfen is locked until a certain time, mark it so and start the unlock timer
|
||||
// the unlock time has not yet expired.
|
||||
if (temp > 0)
|
||||
this.startQuestTimer("orfen_unlock", temp, null, null);
|
||||
else
|
||||
{
|
||||
// the time has already expired while the server was offline. Immediately spawn Orfen.
|
||||
int i = Rnd.get(10);
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int z = 0;
|
||||
if (i < 4)
|
||||
{
|
||||
x = Pos[1][0];
|
||||
y = Pos[1][1];
|
||||
z = Pos[1][2];
|
||||
}
|
||||
else if (i < 7)
|
||||
{
|
||||
x = Pos[2][0];
|
||||
y = Pos[2][1];
|
||||
z = Pos[2][2];
|
||||
}
|
||||
else
|
||||
{
|
||||
x = Pos[3][0];
|
||||
y = Pos[3][1];
|
||||
z = Pos[3][2];
|
||||
}
|
||||
L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, x, y, z, 0, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(ORFEN, ALIVE);
|
||||
this.spawnBoss(orfen);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int loc_x = info.getInteger("loc_x");
|
||||
int loc_y = info.getInteger("loc_y");
|
||||
int loc_z = info.getInteger("loc_z");
|
||||
int heading = info.getInteger("heading");
|
||||
int hp = info.getInteger("currentHP");
|
||||
int mp = info.getInteger("currentMP");
|
||||
L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
orfen.setCurrentHpMp(hp, mp);
|
||||
this.spawnBoss(orfen);
|
||||
}
|
||||
}
|
||||
|
||||
public void setSpawnPoint(L2Npc npc, int index)
|
||||
{
|
||||
((L2Attackable) npc).clearAggroList();
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null, null);
|
||||
L2Spawn spawn = npc.getSpawn();
|
||||
spawn.setLocx(Pos[index][0]);
|
||||
spawn.setLocy(Pos[index][1]);
|
||||
spawn.setLocz(Pos[index][2]);
|
||||
npc.teleToLocation(Pos[index][0], Pos[index][1], Pos[index][2]);
|
||||
}
|
||||
|
||||
public void spawnBoss(L2GrandBossInstance npc)
|
||||
{
|
||||
GrandBossManager.getInstance().addBoss(npc);
|
||||
npc.broadcastPacket(new PlaySound(1, "BS01_A", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
this.startQuestTimer("check_orfen_pos", 10000, npc, null, true);
|
||||
//Spawn minions
|
||||
int x = npc.getX();
|
||||
int y = npc.getY();
|
||||
L2Attackable mob;
|
||||
mob = (L2Attackable)addSpawn(RAIKEL_LEOS, x + 100, y + 100, npc.getZ(), 0, false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
_Minions.add(mob);
|
||||
mob = (L2Attackable)addSpawn(RAIKEL_LEOS, x + 100, y - 100, npc.getZ(), 0, false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
_Minions.add(mob);
|
||||
mob = (L2Attackable)addSpawn(RAIKEL_LEOS, x - 100, y + 100, npc.getZ(), 0, false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
_Minions.add(mob);
|
||||
mob = (L2Attackable)addSpawn(RAIKEL_LEOS, x - 100, y - 100, npc.getZ(), 0, false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
_Minions.add(mob);
|
||||
this.startQuestTimer("check_minion_loc", 10000, npc, null, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equalsIgnoreCase("orfen_unlock"))
|
||||
{
|
||||
int i = Rnd.get(10);
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int z = 0;
|
||||
if (i < 4)
|
||||
{
|
||||
x = Pos[1][0];
|
||||
y = Pos[1][1];
|
||||
z = Pos[1][2];
|
||||
}
|
||||
else if (i < 7)
|
||||
{
|
||||
x = Pos[2][0];
|
||||
y = Pos[2][1];
|
||||
z = Pos[2][2];
|
||||
}
|
||||
else
|
||||
{
|
||||
x = Pos[3][0];
|
||||
y = Pos[3][1];
|
||||
z = Pos[3][2];
|
||||
}
|
||||
L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, x, y, z, 0, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(ORFEN, ALIVE);
|
||||
this.spawnBoss(orfen);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("check_orfen_pos"))
|
||||
{
|
||||
if ((_IsTeleported && npc.getCurrentHp() > npc.getMaxHp() * 0.95) || (!_Zone.isInsideZone(npc) && !_IsTeleported))
|
||||
{
|
||||
setSpawnPoint(npc, Rnd.get(3) + 1);
|
||||
_IsTeleported = false;
|
||||
}
|
||||
else if (_IsTeleported && !_Zone.isInsideZone(npc))
|
||||
setSpawnPoint(npc, 0);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("check_minion_loc"))
|
||||
{
|
||||
for (int i = 0; i < _Minions.size(); i++)
|
||||
{
|
||||
L2Attackable mob = _Minions.get(i);
|
||||
if (!npc.isInsideRadius(mob, 3000, false, false))
|
||||
{
|
||||
mob.teleToLocation(npc.getX(), npc.getY(), npc.getZ());
|
||||
((L2Attackable) npc).clearAggroList();
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (event.equalsIgnoreCase("despawn_minions"))
|
||||
{
|
||||
for (int i = 0; i < _Minions.size(); i++)
|
||||
{
|
||||
L2Attackable mob = _Minions.get(i);
|
||||
if (mob != null)
|
||||
mob.decayMe();
|
||||
}
|
||||
_Minions.clear();
|
||||
}
|
||||
else if (event.equalsIgnoreCase("spawn_minion"))
|
||||
{
|
||||
L2Attackable mob = (L2Attackable)addSpawn(RAIKEL_LEOS, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
_Minions.add(mob);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSkillSee(L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet)
|
||||
{
|
||||
if (npc.getNpcId() == ORFEN)
|
||||
{
|
||||
L2Character originalCaster = isPet ? caster.getPet() : caster;
|
||||
if (skill.getAggroPoints() > 0 && Rnd.get(5) == 0 && npc.isInsideRadius(originalCaster, 1000, false, false))
|
||||
{
|
||||
NpcSay packet = new NpcSay(npc.getObjectId(), 0, npc.getNpcId(), Text[Rnd.get(4)]);
|
||||
packet.addStringParameter(caster.getName().toString());
|
||||
npc.broadcastPacket(packet);
|
||||
originalCaster.teleToLocation(npc.getX(), npc.getY(), npc.getZ());
|
||||
npc.setTarget(originalCaster);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4064, 1));
|
||||
}
|
||||
}
|
||||
return super.onSkillSee(npc, caster, skill, targets, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFactionCall(L2Npc npc, L2Npc caller, L2PcInstance attacker, boolean isPet)
|
||||
{
|
||||
if (caller == null || npc == null || npc.isCastingNow())
|
||||
return super.onFactionCall(npc, caller, attacker, isPet);
|
||||
int npcId = npc.getNpcId();
|
||||
int callerId = caller.getNpcId();
|
||||
if (npcId == RAIKEL_LEOS && Rnd.get(20) == 0)
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4067, 4));
|
||||
}
|
||||
else if (npcId == RIBA_IREN)
|
||||
{
|
||||
int chance = 1;
|
||||
if (callerId == ORFEN)
|
||||
chance = 9;
|
||||
if (callerId != RIBA_IREN && caller.getCurrentHp() < (caller.getMaxHp() / 2.0) && Rnd.get(10) < chance)
|
||||
{
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null, null);
|
||||
npc.setTarget(caller);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4516, 1));
|
||||
}
|
||||
}
|
||||
return super.onFactionCall(npc, caller, attacker, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
int npcId = npc.getNpcId();
|
||||
if (npcId == ORFEN)
|
||||
{
|
||||
if (!_IsTeleported && (npc.getCurrentHp() - damage) < (npc.getMaxHp() / 2))
|
||||
{
|
||||
_IsTeleported = true;
|
||||
setSpawnPoint(npc, 0);
|
||||
}
|
||||
else if (npc.isInsideRadius(attacker, 1000, false, false) && !npc.isInsideRadius(attacker, 300, false, false) && Rnd.get(10) == 0)
|
||||
{
|
||||
NpcSay packet = new NpcSay(npc.getObjectId(), 0, npcId, Text[Rnd.get(3)]);
|
||||
packet.addStringParameter(attacker.getName().toString());
|
||||
npc.broadcastPacket(packet);
|
||||
attacker.teleToLocation(npc.getX(), npc.getY(), npc.getZ());
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4064, 1));
|
||||
}
|
||||
}
|
||||
else if (npcId == RIBA_IREN)
|
||||
{
|
||||
if (!npc.isCastingNow() && (npc.getCurrentHp() - damage) < (npc.getMaxHp() / 2.0))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4516, 1));
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
if (npc.getNpcId() == ORFEN)
|
||||
{
|
||||
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
GrandBossManager.getInstance().setBossStatus(ORFEN, DEAD);
|
||||
//time is 48hour +/- 20hour
|
||||
long respawnTime = (long) Config.Interval_Of_Orfen_Spawn + Rnd.get(Config.Random_Of_Orfen_Spawn);
|
||||
this.startQuestTimer("orfen_unlock", respawnTime, null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().setStatsSet(ORFEN, info);
|
||||
this.cancelQuestTimer("check_minion_loc", npc, null);
|
||||
this.cancelQuestTimer("check_orfen_pos", npc, null);
|
||||
this.startQuestTimer("despawn_minions", 20000, null, null);
|
||||
this.cancelQuestTimers("spawn_minion");
|
||||
}
|
||||
else if (GrandBossManager.getInstance().getBossStatus(ORFEN) == ALIVE && npc.getNpcId() == RAIKEL_LEOS)
|
||||
{
|
||||
_Minions.remove(npc);
|
||||
this.startQuestTimer("spawn_minion", 360000, npc, null);
|
||||
}
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// Quest class and state definition
|
||||
new Orfen(-1, "orfen", "ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,340 @@
|
||||
/*
|
||||
* 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.individual;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javolution.util.FastList;
|
||||
|
||||
import ai.group_template.L2AttackableAIScript;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.datatables.SkillTable;
|
||||
import com.l2jserver.gameserver.instancemanager.GrandBossManager;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.L2Playable;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2GrandBossInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.zone.type.L2BossZone;
|
||||
import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse;
|
||||
import com.l2jserver.gameserver.network.serverpackets.PlaySound;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SocialAction;
|
||||
import com.l2jserver.gameserver.skills.SkillHolder;
|
||||
import com.l2jserver.gameserver.templates.StatsSet;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
/**
|
||||
* Queen Ant AI
|
||||
*
|
||||
* @author Emperorc
|
||||
*
|
||||
*/
|
||||
public class QueenAnt extends L2AttackableAIScript
|
||||
{
|
||||
|
||||
private static final int QUEEN = 29001;
|
||||
private static final int LARVA = 29002;
|
||||
private static final int NURSE = 29003;
|
||||
private static final int GUARD = 29004;
|
||||
private static final int ROYAL = 29005;
|
||||
|
||||
private static final int[] MOBS = { QUEEN, LARVA, NURSE, GUARD, ROYAL };
|
||||
|
||||
private static final int QUEEN_X = -21610;
|
||||
private static final int QUEEN_Y = 181594;
|
||||
private static final int QUEEN_Z = -5734;
|
||||
|
||||
//QUEEN Status Tracking :
|
||||
private static final byte ALIVE = 0; //Queen Ant is spawned.
|
||||
private static final byte DEAD = 1; //Queen Ant has been killed.
|
||||
|
||||
private static L2BossZone _zone;
|
||||
|
||||
private static SkillHolder HEAL1 = new SkillHolder(4020, 1);
|
||||
private static SkillHolder HEAL2 = new SkillHolder(4024, 1);
|
||||
|
||||
private L2MonsterInstance _queen = null;
|
||||
private L2MonsterInstance _larva = null;
|
||||
private List<L2MonsterInstance> _nurses = new FastList<L2MonsterInstance>(5);
|
||||
|
||||
public QueenAnt(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
|
||||
registerMobs(MOBS, QuestEventType.ON_SPAWN, QuestEventType.ON_KILL, QuestEventType.ON_AGGRO_RANGE_ENTER);
|
||||
addFactionCallId(NURSE);
|
||||
|
||||
_zone = GrandBossManager.getInstance().getZone(QUEEN_X, QUEEN_Y, QUEEN_Z);
|
||||
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
|
||||
int status = GrandBossManager.getInstance().getBossStatus(QUEEN);
|
||||
if (status == DEAD)
|
||||
{
|
||||
// load the unlock date and time for queen ant from DB
|
||||
long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
// if queen ant is locked until a certain time, mark it so and start the unlock timer
|
||||
// the unlock time has not yet expired.
|
||||
if (temp > 0)
|
||||
startQuestTimer("queen_unlock", temp, null, null);
|
||||
else
|
||||
{
|
||||
// the time has already expired while the server was offline. Immediately spawn queen ant.
|
||||
L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE);
|
||||
spawnBoss(queen);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int loc_x = info.getInteger("loc_x");
|
||||
int loc_y = info.getInteger("loc_y");
|
||||
int loc_z = info.getInteger("loc_z");
|
||||
int heading = info.getInteger("heading");
|
||||
int hp = info.getInteger("currentHP");
|
||||
int mp = info.getInteger("currentMP");
|
||||
if (!_zone.isInsideZone(loc_x, loc_y, loc_z))
|
||||
{
|
||||
loc_x = QUEEN_X;
|
||||
loc_y = QUEEN_Y;
|
||||
loc_z = QUEEN_Z;
|
||||
}
|
||||
L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
queen.setCurrentHpMp(hp, mp);
|
||||
spawnBoss(queen);
|
||||
}
|
||||
}
|
||||
|
||||
private void spawnBoss(L2GrandBossInstance npc)
|
||||
{
|
||||
GrandBossManager.getInstance().addBoss(npc);
|
||||
if (Rnd.get(100) < 33)
|
||||
_zone.movePlayersTo(-19480, 187344, -5600);
|
||||
else if (Rnd.get(100) < 50)
|
||||
_zone.movePlayersTo(-17928, 180912, -5520);
|
||||
else
|
||||
_zone.movePlayersTo(-23808, 182368, -5600);
|
||||
GrandBossManager.getInstance().addBoss(npc);
|
||||
startQuestTimer("action", 10000, npc, null, true);
|
||||
startQuestTimer("heal", 1000, null, null, true);
|
||||
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
_queen = npc;
|
||||
_larva = (L2MonsterInstance)addSpawn(LARVA, -21600, 179482, -5846, Rnd.get(360), false, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equalsIgnoreCase("heal"))
|
||||
{
|
||||
boolean notCasting;
|
||||
final boolean larvaNeedHeal = _larva != null && _larva.getCurrentHp() < _larva.getMaxHp();
|
||||
final boolean queenNeedHeal = _queen != null && _queen.getCurrentHp() < _queen.getMaxHp();
|
||||
for (L2MonsterInstance nurse : _nurses)
|
||||
{
|
||||
if (nurse == null || nurse.isDead() || nurse.isCastingNow())
|
||||
continue;
|
||||
|
||||
notCasting = nurse.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST;
|
||||
if (larvaNeedHeal)
|
||||
{
|
||||
if (nurse.getTarget() != _larva || notCasting)
|
||||
{
|
||||
nurse.setTarget(_larva);
|
||||
nurse.useMagic(Rnd.nextBoolean() ? HEAL1.getSkill() : HEAL2.getSkill());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (queenNeedHeal)
|
||||
{
|
||||
if (nurse.getLeader() == _larva) // skip larva's minions
|
||||
continue;
|
||||
|
||||
if (nurse.getTarget() != _queen || notCasting)
|
||||
{
|
||||
nurse.setTarget(_queen);
|
||||
nurse.useMagic(HEAL1.getSkill());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// if nurse not casting - remove target
|
||||
if (notCasting && nurse.getTarget() != null)
|
||||
nurse.setTarget(null);
|
||||
}
|
||||
}
|
||||
else if (event.equalsIgnoreCase("action") && npc != null)
|
||||
{
|
||||
if (Rnd.get(3) == 0)
|
||||
{
|
||||
if (Rnd.get(2) == 0)
|
||||
{
|
||||
npc.broadcastPacket(new SocialAction(npc, 3));
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.broadcastPacket(new SocialAction(npc, 4));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (event.equalsIgnoreCase("queen_unlock"))
|
||||
{
|
||||
L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE);
|
||||
spawnBoss(queen);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
final L2MonsterInstance mob = (L2MonsterInstance)npc;
|
||||
switch (npc.getNpcId())
|
||||
{
|
||||
case LARVA:
|
||||
mob.setIsImmobilized(true);
|
||||
mob.setIsMortal(false);
|
||||
mob.setIsRaidMinion(true);
|
||||
break;
|
||||
case NURSE:
|
||||
mob.disableCoreAI(true);
|
||||
mob.setIsRaidMinion(true);
|
||||
_nurses.add(mob);
|
||||
break;
|
||||
case ROYAL:
|
||||
case GUARD:
|
||||
mob.setIsRaidMinion(true);
|
||||
break;
|
||||
}
|
||||
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFactionCall(L2Npc npc, L2Npc caller, L2PcInstance attacker, boolean isPet)
|
||||
{
|
||||
if (caller == null || npc == null)
|
||||
return super.onFactionCall(npc, caller, attacker, isPet);
|
||||
|
||||
if (!npc.isCastingNow() && npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST)
|
||||
{
|
||||
if (caller.getCurrentHp() < caller.getMaxHp())
|
||||
{
|
||||
npc.setTarget(caller);
|
||||
((L2Attackable)npc).useMagic(HEAL1.getSkill());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isPet)
|
||||
{
|
||||
if (npc == null)
|
||||
return null;
|
||||
|
||||
final boolean isMage;
|
||||
final L2Playable character;
|
||||
if (isPet)
|
||||
{
|
||||
isMage = false;
|
||||
character = player.getPet();
|
||||
}
|
||||
else
|
||||
{
|
||||
isMage = player.isMageClass();
|
||||
character = player;
|
||||
}
|
||||
|
||||
if (character == null)
|
||||
return null;
|
||||
|
||||
if (!Config.RAID_DISABLE_CURSE && character.getLevel() - npc.getLevel() > 8)
|
||||
{
|
||||
L2Skill curse = null;
|
||||
if (isMage)
|
||||
{
|
||||
if (!character.isMuted() && Rnd.get(4) == 0)
|
||||
curse = SkillTable.FrequentSkill.RAID_CURSE.getSkill();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!character.isParalyzed() && Rnd.get(4) == 0)
|
||||
curse = SkillTable.FrequentSkill.RAID_CURSE2.getSkill();
|
||||
}
|
||||
|
||||
if (curse != null)
|
||||
{
|
||||
npc.broadcastPacket(new MagicSkillUse(npc, character, curse.getId(), curse.getLevel(), 300, 0));
|
||||
curse.getEffects(npc, character);
|
||||
}
|
||||
|
||||
((L2Attackable) npc).stopHating(character); // for calling again
|
||||
return null;
|
||||
}
|
||||
|
||||
return super.onAggroRangeEnter(npc, player, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
int npcId = npc.getNpcId();
|
||||
if (npcId == QUEEN)
|
||||
{
|
||||
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
GrandBossManager.getInstance().setBossStatus(QUEEN, DEAD);
|
||||
//time is 36hour +/- 17hour
|
||||
long respawnTime = (long) Config.Interval_Of_QueenAnt_Spawn + Rnd.get(Config.Random_Of_QueenAnt_Spawn);
|
||||
startQuestTimer("queen_unlock", respawnTime, null, null);
|
||||
cancelQuestTimer("action", npc, null);
|
||||
cancelQuestTimer("heal", null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
|
||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().setStatsSet(QUEEN, info);
|
||||
_nurses.clear();
|
||||
_larva.deleteMe();
|
||||
_larva = null;
|
||||
_queen = null;
|
||||
}
|
||||
else if (_queen != null && !_queen.isAlikeDead())
|
||||
{
|
||||
if (npcId == ROYAL)
|
||||
{
|
||||
L2MonsterInstance mob = (L2MonsterInstance)npc;
|
||||
if (mob.getLeader() != null)
|
||||
mob.getLeader().getMinionList().onMinionDie(mob, (280 + Rnd.get(40)) * 1000);
|
||||
}
|
||||
else if (npcId == NURSE)
|
||||
{
|
||||
L2MonsterInstance mob = (L2MonsterInstance)npc;
|
||||
_nurses.remove(mob);
|
||||
if (mob.getLeader() != null)
|
||||
mob.getLeader().getMinionList().onMinionDie(mob, 10000);
|
||||
}
|
||||
}
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// now call the constructor (starts up the ai)
|
||||
new QueenAnt(-1, "queen_ant", "ai");
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,951 @@
|
||||
/*
|
||||
* 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.individual;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import ai.group_template.L2AttackableAIScript;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.GameTimeController;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.datatables.DoorTable;
|
||||
import com.l2jserver.gameserver.datatables.SkillTable;
|
||||
import com.l2jserver.gameserver.instancemanager.GrandBossManager;
|
||||
import com.l2jserver.gameserver.model.L2Effect;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2GrandBossInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.zone.type.L2BossZone;
|
||||
import com.l2jserver.gameserver.network.serverpackets.PlaySound;
|
||||
import com.l2jserver.gameserver.templates.StatsSet;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
/**
|
||||
* Zaken AI
|
||||
*
|
||||
*/
|
||||
public class Zaken extends L2AttackableAIScript
|
||||
{
|
||||
protected static final Logger log = Logger.getLogger(Zaken.class.getName());
|
||||
|
||||
private int _1001 = 0; // used for first cancel of QuestTimer "1001"
|
||||
private int _ai0 = 0; // used for zaken coords updater
|
||||
private int _ai1 = 0; // used for X coord tracking for non-random teleporting in zaken's self teleport skill
|
||||
private int _ai2 = 0; // used for Y coord tracking for non-random teleporting in zaken's self teleport skill
|
||||
private int _ai3 = 0; // used for Z coord tracking for non-random teleporting in zaken's self teleport skill
|
||||
private int _ai4 = 0; // used for spawning minions cycles
|
||||
private int _quest0 = 0; // used for teleporting progress
|
||||
private int _quest1 = 0; // used for most hated players progress
|
||||
private int _quest2 = 0; // used for zaken HP check for teleport
|
||||
private L2PcInstance c_quest0 = null; // 1st player used for area teleport
|
||||
private L2PcInstance c_quest1 = null; // 2nd player used for area teleport
|
||||
private L2PcInstance c_quest2 = null; // 3rd player used for area teleport
|
||||
private L2PcInstance c_quest3 = null; // 4th player used for area teleport
|
||||
private L2PcInstance c_quest4 = null; // 5th player used for area teleport
|
||||
private static final int ZAKEN = 29022;
|
||||
private static final int doll_blader_b = 29023;
|
||||
private static final int vale_master_b = 29024;
|
||||
private static final int pirates_zombie_captain_b = 29026;
|
||||
private static final int pirates_zombie_b = 29027;
|
||||
private static final int[] Xcoords =
|
||||
{
|
||||
53950, 55980, 54950, 55970, 53930, 55970, 55980, 54960, 53950, 53930, 55970, 55980, 54960, 53950, 53930
|
||||
};
|
||||
private static final int[] Ycoords =
|
||||
{
|
||||
219860, 219820, 218790, 217770, 217760, 217770, 219920, 218790, 219860, 217760, 217770, 219920, 218790, 219860, 217760
|
||||
};
|
||||
private static final int[] Zcoords =
|
||||
{
|
||||
-3488, -3488, -3488, -3488, -3488, -3216, -3216, -3216, -3216, -3216, -2944, -2944, -2944, -2944, -2944
|
||||
};
|
||||
|
||||
//ZAKEN Status Tracking :
|
||||
private static final byte ALIVE = 0; //Zaken is spawned.
|
||||
private static final byte DEAD = 1; //Zaken has been killed.
|
||||
|
||||
private static L2BossZone _Zone;
|
||||
|
||||
public Zaken(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
|
||||
// Zaken doors handling
|
||||
ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (getTimeHour() == 0)
|
||||
{
|
||||
DoorTable.getInstance().getDoor(21240006).openMe();
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
try
|
||||
{
|
||||
DoorTable.getInstance().getDoor(21240006).closeMe();
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
log.warning("Cannot close door ID: 21240006 " + e);
|
||||
}
|
||||
}
|
||||
}, 300000L);
|
||||
}
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
log.warning("Cannot open door ID: 21240006 " + e);
|
||||
}
|
||||
}
|
||||
}, 2000L, 600000L);
|
||||
|
||||
int[] mobs =
|
||||
{
|
||||
ZAKEN, doll_blader_b, vale_master_b, pirates_zombie_captain_b, pirates_zombie_b
|
||||
};
|
||||
registerMobs(mobs);
|
||||
_Zone = GrandBossManager.getInstance().getZone(55312, 219168, -3223);
|
||||
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(ZAKEN);
|
||||
int status = GrandBossManager.getInstance().getBossStatus(ZAKEN);
|
||||
if (status == DEAD)
|
||||
{
|
||||
// load the unlock date and time for zaken from DB
|
||||
long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
// if zaken is locked until a certain time, mark it so and start the unlock timer
|
||||
// the unlock time has not yet expired.
|
||||
if (temp > 0)
|
||||
startQuestTimer("zaken_unlock", temp, null, null);
|
||||
else
|
||||
{
|
||||
// the time has already expired while the server was offline. Immediately spawn zaken.
|
||||
L2GrandBossInstance zaken = (L2GrandBossInstance) addSpawn(ZAKEN, 55312, 219168, -3223, 0, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(ZAKEN, ALIVE);
|
||||
spawnBoss(zaken);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int loc_x = info.getInteger("loc_x");
|
||||
int loc_y = info.getInteger("loc_y");
|
||||
int loc_z = info.getInteger("loc_z");
|
||||
int heading = info.getInteger("heading");
|
||||
int hp = info.getInteger("currentHP");
|
||||
int mp = info.getInteger("currentMP");
|
||||
L2GrandBossInstance zaken = (L2GrandBossInstance) addSpawn(ZAKEN, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
zaken.setCurrentHpMp(hp, mp);
|
||||
spawnBoss(zaken);
|
||||
}
|
||||
}
|
||||
|
||||
public void spawnBoss(L2GrandBossInstance npc)
|
||||
{
|
||||
if (npc == null)
|
||||
{
|
||||
log.warning("Zaken AI failed to load, missing Zaken in grandboss_data.sql");
|
||||
return;
|
||||
}
|
||||
GrandBossManager.getInstance().addBoss(npc);
|
||||
|
||||
npc.broadcastPacket(new PlaySound(1, "BS01_A", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
_ai0 = 0;
|
||||
_ai1 = npc.getX();
|
||||
_ai2 = npc.getY();
|
||||
_ai3 = npc.getZ();
|
||||
_quest0 = 0;
|
||||
_quest1 = 0;
|
||||
_quest2 = 3;
|
||||
if (_Zone == null)
|
||||
{
|
||||
log.warning("Zaken AI failed to load, missing zone for Zaken");
|
||||
return;
|
||||
}
|
||||
if (_Zone.isInsideZone(npc))
|
||||
{
|
||||
_ai4 = 1;
|
||||
startQuestTimer("1003", 1700, null, null, true);
|
||||
}
|
||||
_1001 = 1;
|
||||
startQuestTimer("1001", 1000, npc, null, true); //buffs,random teleports
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
int status = GrandBossManager.getInstance().getBossStatus(ZAKEN);
|
||||
if (status == DEAD && !event.equalsIgnoreCase("zaken_unlock"))
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
|
||||
if (event.equalsIgnoreCase("1001"))
|
||||
{
|
||||
if (_1001 == 1)
|
||||
{
|
||||
_1001 = 0;
|
||||
cancelQuestTimer("1001", npc, null);
|
||||
}
|
||||
int sk_4223 = 0;
|
||||
int sk_4227 = 0;
|
||||
L2Effect[] effects = npc.getAllEffects();
|
||||
if (effects != null && effects.length != 0)
|
||||
{
|
||||
for (L2Effect e : effects)
|
||||
{
|
||||
if (e.getSkill().getId() == 4227)
|
||||
{
|
||||
sk_4227 = 1;
|
||||
}
|
||||
if (e.getSkill().getId() == 4223)
|
||||
{
|
||||
sk_4223 = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (getTimeHour() < 5)
|
||||
{
|
||||
if (sk_4223 == 1) //use night face if zaken have day face
|
||||
{
|
||||
npc.setTarget(npc);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4224, 1));
|
||||
_ai1 = npc.getX();
|
||||
_ai2 = npc.getY();
|
||||
_ai3 = npc.getZ();
|
||||
}
|
||||
if (sk_4227 == 0) //use zaken regeneration
|
||||
{
|
||||
npc.setTarget(npc);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4227, 1));
|
||||
}
|
||||
if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ATTACK && _ai0 == 0)
|
||||
{
|
||||
int i0 = 0;
|
||||
int i1 = 1;
|
||||
if (((L2Attackable) npc).getMostHated() != null)
|
||||
{
|
||||
if ((((((L2Attackable) npc).getMostHated().getX() - _ai1) * (((L2Attackable) npc).getMostHated().getX() - _ai1)) + ((((L2Attackable) npc).getMostHated().getY() - _ai2) * (((L2Attackable) npc)
|
||||
.getMostHated().getY() - _ai2))) > (1500 * 1500))
|
||||
i0 = 1;
|
||||
else
|
||||
i0 = 0;
|
||||
if (i0 == 0)
|
||||
i1 = 0;
|
||||
if (_quest0 > 0)
|
||||
{
|
||||
if (c_quest0 == null)
|
||||
i0 = 0;
|
||||
else if ((((c_quest0.getX() - _ai1) * (c_quest0.getX() - _ai1)) + ((c_quest0.getY() - _ai2) * (c_quest0.getY() - _ai2))) > (1500 * 1500))
|
||||
i0 = 1;
|
||||
else
|
||||
i0 = 0;
|
||||
if (i0 == 0)
|
||||
i1 = 0;
|
||||
}
|
||||
if (_quest0 > 1)
|
||||
{
|
||||
if (c_quest1 == null)
|
||||
i0 = 0;
|
||||
else if ((((c_quest1.getX() - _ai1) * (c_quest1.getX() - _ai1)) + ((c_quest1.getY() - _ai2) * (c_quest1.getY() - _ai2))) > (1500 * 1500))
|
||||
i0 = 1;
|
||||
else
|
||||
i0 = 0;
|
||||
if (i0 == 0)
|
||||
i1 = 0;
|
||||
}
|
||||
if (_quest0 > 2)
|
||||
{
|
||||
if (c_quest2 == null)
|
||||
i0 = 0;
|
||||
else if ((((c_quest2.getX() - _ai1) * (c_quest2.getX() - _ai1)) + ((c_quest2.getY() - _ai2) * (c_quest2.getY() - _ai2))) > (1500 * 1500))
|
||||
i0 = 1;
|
||||
else
|
||||
i0 = 0;
|
||||
if (i0 == 0)
|
||||
i1 = 0;
|
||||
}
|
||||
if (_quest0 > 3)
|
||||
{
|
||||
if (c_quest3 == null)
|
||||
i0 = 0;
|
||||
else if ((((c_quest3.getX() - _ai1) * (c_quest3.getX() - _ai1)) + ((c_quest3.getY() - _ai2) * (c_quest3.getY() - _ai2))) > (1500 * 1500))
|
||||
i0 = 1;
|
||||
else
|
||||
i0 = 0;
|
||||
if (i0 == 0)
|
||||
i1 = 0;
|
||||
}
|
||||
if (_quest0 > 4)
|
||||
{
|
||||
if (c_quest4 == null)
|
||||
i0 = 0;
|
||||
else if ((((c_quest4.getX() - _ai1) * (c_quest4.getX() - _ai1)) + ((c_quest4.getY() - _ai2) * (c_quest4.getY() - _ai2))) > (1500 * 1500))
|
||||
i0 = 1;
|
||||
else
|
||||
i0 = 0;
|
||||
if (i0 == 0)
|
||||
i1 = 0;
|
||||
}
|
||||
if (i1 == 1)
|
||||
{
|
||||
_quest0 = 0;
|
||||
int i2 = Rnd.get(15);
|
||||
_ai1 = Xcoords[i2] + Rnd.get(650);
|
||||
_ai2 = Ycoords[i2] + Rnd.get(650);
|
||||
_ai3 = Zcoords[i2];
|
||||
npc.setTarget(npc);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4222, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Rnd.get(20) < 1 && _ai0 == 0)
|
||||
{
|
||||
_ai1 = npc.getX();
|
||||
_ai2 = npc.getY();
|
||||
_ai3 = npc.getZ();
|
||||
}
|
||||
L2Character c_ai0 = null;
|
||||
if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ATTACK && _quest1 == 0)
|
||||
{
|
||||
if (((L2Attackable) npc).getMostHated() != null)
|
||||
{
|
||||
c_ai0 = ((L2Attackable) npc).getMostHated();
|
||||
_quest1 = 1;
|
||||
}
|
||||
}
|
||||
else if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ATTACK && _quest1 != 0)
|
||||
{
|
||||
if (((L2Attackable) npc).getMostHated() != null)
|
||||
{
|
||||
if (c_ai0 == ((L2Attackable) npc).getMostHated())
|
||||
{
|
||||
_quest1 = (_quest1 + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
_quest1 = 1;
|
||||
c_ai0 = ((L2Attackable) npc).getMostHated();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE)
|
||||
{
|
||||
_quest1 = 0;
|
||||
}
|
||||
if (_quest1 > 5)
|
||||
{
|
||||
((L2Attackable) npc).stopHating(c_ai0);
|
||||
L2Character nextTarget = ((L2Attackable) npc).getMostHated();
|
||||
if (nextTarget != null)
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, nextTarget);
|
||||
_quest1 = 0;
|
||||
}
|
||||
}
|
||||
else if (sk_4223 == 0) //use day face if not night time
|
||||
{
|
||||
npc.setTarget(npc);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4223, 1));
|
||||
_quest2 = 3;
|
||||
}
|
||||
if (sk_4227 == 1) // when switching to day time, cancel zaken night regen
|
||||
{
|
||||
npc.setTarget(npc);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4242, 1));
|
||||
}
|
||||
if (Rnd.get(40) < 1)
|
||||
{
|
||||
int i2 = Rnd.get(15);
|
||||
_ai1 = Xcoords[i2] + Rnd.get(650);
|
||||
_ai2 = Ycoords[i2] + Rnd.get(650);
|
||||
_ai3 = Zcoords[i2];
|
||||
npc.setTarget(npc);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4222, 1));
|
||||
}
|
||||
startQuestTimer("1001", 30000, npc, null, true);
|
||||
}
|
||||
if (event.equalsIgnoreCase("1002"))
|
||||
{
|
||||
_quest0 = 0;
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4222, 1));
|
||||
_ai0 = 0;
|
||||
}
|
||||
if (event.equalsIgnoreCase("1003"))
|
||||
{
|
||||
if (_ai4 == 1)
|
||||
{
|
||||
int rr = Rnd.get(15);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, Xcoords[rr] + Rnd.get(650), Ycoords[rr] + Rnd.get(650), Zcoords[rr], Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
_ai4 = 2;
|
||||
}
|
||||
else if (_ai4 == 2)
|
||||
{
|
||||
int rr = Rnd.get(15);
|
||||
((L2Attackable)addSpawn(doll_blader_b, Xcoords[rr] + Rnd.get(650), Ycoords[rr] + Rnd.get(650), Zcoords[rr], Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
_ai4 = 3;
|
||||
}
|
||||
else if (_ai4 == 3)
|
||||
{
|
||||
((L2Attackable)addSpawn(vale_master_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(vale_master_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
_ai4 = 4;
|
||||
}
|
||||
else if (_ai4 == 4)
|
||||
{
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
_ai4 = 5;
|
||||
}
|
||||
else if (_ai4 == 5)
|
||||
{
|
||||
((L2Attackable)addSpawn(doll_blader_b, 52675, 219371, -3290, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(doll_blader_b, 52687, 219596, -3368, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(doll_blader_b, 52672, 219740, -3418, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 52857, 219992, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 52959, 219997, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(vale_master_b, 53381, 220151, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 54236, 220948, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 54885, 220144, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 55264, 219860, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 55399, 220263, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 55679, 220129, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(vale_master_b, 56276, 220783, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(vale_master_b, 57173, 220234, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 56267, 218826, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(doll_blader_b, 56294, 219482, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 56094, 219113, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(doll_blader_b, 56364, 218967, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 57113, 218079, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(doll_blader_b, 56186, 217153, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 55440, 218081, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 55202, 217940, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 55225, 218236, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 54973, 218075, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 53412, 218077, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(vale_master_b, 54226, 218797, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(vale_master_b, 54394, 219067, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 54139, 219253, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(doll_blader_b, 54262, 219480, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
_ai4 = 6;
|
||||
}
|
||||
else if (_ai4 == 6)
|
||||
{
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 53412, 218077, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(vale_master_b, 54413, 217132, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(doll_blader_b, 54841, 217132, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(doll_blader_b, 55372, 217128, -3343, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(doll_blader_b, 55893, 217122, -3488, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 56282, 217237, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(vale_master_b, 56963, 218080, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 56267, 218826, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(doll_blader_b, 56294, 219482, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 56094, 219113, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(doll_blader_b, 56364, 218967, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(vale_master_b, 56276, 220783, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(vale_master_b, 57173, 220234, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 54885, 220144, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 55264, 219860, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 55399, 220263, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 55679, 220129, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 54236, 220948, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 54464, 219095, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(vale_master_b, 54226, 218797, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(vale_master_b, 54394, 219067, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 54139, 219253, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(doll_blader_b, 54262, 219480, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 53412, 218077, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 55440, 218081, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 55202, 217940, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 55225, 218236, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 54973, 218075, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
_ai4 = 7;
|
||||
}
|
||||
else if (_ai4 == 7)
|
||||
{
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 54228, 217504, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(vale_master_b, 54181, 217168, -3216, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(doll_blader_b, 54714, 217123, -3168, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(doll_blader_b, 55298, 217127, -3073, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(doll_blader_b, 55787, 217130, -2993, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 56284, 217216, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(vale_master_b, 56963, 218080, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 56267, 218826, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(doll_blader_b, 56294, 219482, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 56094, 219113, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(doll_blader_b, 56364, 218967, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(vale_master_b, 56276, 220783, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(vale_master_b, 57173, 220234, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 54885, 220144, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 55264, 219860, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 55399, 220263, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 55679, 220129, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 54236, 220948, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 54464, 219095, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(vale_master_b, 54226, 218797, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(vale_master_b, 54394, 219067, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 54139, 219253, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(doll_blader_b, 54262, 219480, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 53412, 218077, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 54280, 217200, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 55440, 218081, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_captain_b, 55202, 217940, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 55225, 218236, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
((L2Attackable)addSpawn(pirates_zombie_b, 54973, 218075, -2944, Rnd.get(65536), false, 0)).setIsRaidMinion(true);
|
||||
_ai4 = 8;
|
||||
cancelQuestTimer("1003", null, null);
|
||||
}
|
||||
}
|
||||
|
||||
else if (event.equalsIgnoreCase("zaken_unlock"))
|
||||
{
|
||||
L2GrandBossInstance zaken = (L2GrandBossInstance) addSpawn(ZAKEN, 55312, 219168, -3223, 0, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(ZAKEN, ALIVE);
|
||||
spawnBoss(zaken);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("CreateOnePrivateEx"))
|
||||
{
|
||||
((L2Attackable)addSpawn(npc.getNpcId(), npc.getX(), npc.getY(), npc.getZ(), 0, false, 0)).setIsRaidMinion(true);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFactionCall(L2Npc npc, L2Npc caller, L2PcInstance attacker, boolean isPet)
|
||||
{
|
||||
if (caller == null || npc == null)
|
||||
return super.onFactionCall(npc, caller, attacker, isPet);
|
||||
int npcId = npc.getNpcId();
|
||||
int callerId = caller.getNpcId();
|
||||
|
||||
if (getTimeHour() < 5 && callerId != ZAKEN && npcId == ZAKEN)
|
||||
{
|
||||
int damage = 0; // well damage required :x
|
||||
if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE && _ai0 == 0 && damage < 10 && Rnd.get((30 * 15)) < 1)//todo - damage missing
|
||||
{
|
||||
_ai0 = 1;
|
||||
_ai1 = caller.getX();
|
||||
_ai2 = caller.getY();
|
||||
_ai3 = caller.getZ();
|
||||
startQuestTimer("1002", 300, caller, null);
|
||||
}
|
||||
}
|
||||
return super.onFactionCall(npc, caller, attacker, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(L2Npc npc, L2PcInstance player, L2Skill skill)
|
||||
{
|
||||
if (npc.getNpcId() == ZAKEN)
|
||||
{
|
||||
int skillId = skill.getId();
|
||||
if (skillId == 4222)
|
||||
{
|
||||
npc.teleToLocation(_ai1, _ai2, _ai3);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
}
|
||||
else if (skillId == 4216)
|
||||
{
|
||||
int i1 = Rnd.get(15);
|
||||
player.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
|
||||
((L2Attackable) npc).stopHating(player);
|
||||
L2Character nextTarget = ((L2Attackable) npc).getMostHated();
|
||||
if (nextTarget != null)
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, nextTarget);
|
||||
|
||||
}
|
||||
else if (skillId == 4217)
|
||||
{
|
||||
int i0 = 0;
|
||||
int i1 = Rnd.get(15);
|
||||
player.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
|
||||
((L2Attackable) npc).stopHating(player);
|
||||
|
||||
if (c_quest0 != null && _quest0 > 0 && c_quest0 != player && c_quest0.getZ() > (player.getZ() - 100) && c_quest0.getZ() < (player.getZ() + 100))
|
||||
{
|
||||
if ((((c_quest0.getX() - player.getX()) * (c_quest0.getX() - player.getX())) + ((c_quest0.getY() - player.getY()) * (c_quest0.getY() - player.getY()))) > (250 * 250))
|
||||
{
|
||||
i0 = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
i0 = 0;
|
||||
}
|
||||
if (i0 == 0)
|
||||
{
|
||||
i1 = Rnd.get(15);
|
||||
c_quest0.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
|
||||
((L2Attackable) npc).stopHating(c_quest0);
|
||||
}
|
||||
}
|
||||
if (c_quest1 != null && _quest0 > 1 && c_quest1 != player && c_quest1.getZ() > (player.getZ() - 100) && c_quest1.getZ() < (player.getZ() + 100))
|
||||
{
|
||||
if ((((c_quest1.getX() - player.getX()) * (c_quest1.getX() - player.getX())) + ((c_quest1.getY() - player.getY()) * (c_quest1.getY() - player.getY()))) > (250 * 250))
|
||||
{
|
||||
i0 = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
i0 = 0;
|
||||
}
|
||||
if (i0 == 0)
|
||||
{
|
||||
i1 = Rnd.get(15);
|
||||
c_quest1.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
|
||||
((L2Attackable) npc).stopHating(c_quest1);
|
||||
}
|
||||
}
|
||||
if (c_quest2 != null && _quest0 > 2 && c_quest2 != player && c_quest2.getZ() > (player.getZ() - 100) && c_quest2.getZ() < (player.getZ() + 100))
|
||||
{
|
||||
if ((((c_quest2.getX() - player.getX()) * (c_quest2.getX() - player.getX())) + ((c_quest2.getY() - player.getY()) * (c_quest2.getY() - player.getY()))) > (250 * 250))
|
||||
{
|
||||
i0 = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
i0 = 0;
|
||||
}
|
||||
if (i0 == 0)
|
||||
{
|
||||
i1 = Rnd.get(15);
|
||||
c_quest2.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
|
||||
((L2Attackable) npc).stopHating(c_quest2);
|
||||
}
|
||||
}
|
||||
if (c_quest3 != null && _quest0 > 3 && c_quest3 != player && c_quest3.getZ() > (player.getZ() - 100) && c_quest3.getZ() < (player.getZ() + 100))
|
||||
{
|
||||
if ((((c_quest3.getX() - player.getX()) * (c_quest3.getX() - player.getX())) + ((c_quest3.getY() - player.getY()) * (c_quest3.getY() - player.getY()))) > (250 * 250))
|
||||
{
|
||||
i0 = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
i0 = 0;
|
||||
}
|
||||
if (i0 == 0)
|
||||
{
|
||||
i1 = Rnd.get(15);
|
||||
c_quest3.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
|
||||
((L2Attackable) npc).stopHating(c_quest3);
|
||||
}
|
||||
}
|
||||
if (c_quest4 != null && _quest0 > 4 && c_quest4 != player && c_quest4.getZ() > (player.getZ() - 100) && c_quest4.getZ() < (player.getZ() + 100))
|
||||
{
|
||||
if ((((c_quest4.getX() - player.getX()) * (c_quest4.getX() - player.getX())) + ((c_quest4.getY() - player.getY()) * (c_quest4.getY() - player.getY()))) > (250 * 250))
|
||||
{
|
||||
i0 = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
i0 = 0;
|
||||
}
|
||||
if (i0 == 0)
|
||||
{
|
||||
i1 = Rnd.get(15);
|
||||
c_quest4.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
|
||||
((L2Attackable) npc).stopHating(c_quest4);
|
||||
}
|
||||
}
|
||||
L2Character nextTarget = ((L2Attackable) npc).getMostHated();
|
||||
if (nextTarget != null)
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, nextTarget);
|
||||
}
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
int npcId = npc.getNpcId();
|
||||
if (npcId == ZAKEN)
|
||||
{
|
||||
if (attacker.getMountType() == 1)
|
||||
{
|
||||
int sk_4258 = 0;
|
||||
L2Effect[] effects = attacker.getAllEffects();
|
||||
if (effects != null && effects.length != 0)
|
||||
{
|
||||
for (L2Effect e : effects)
|
||||
{
|
||||
if (e.getSkill().getId() == 4258)
|
||||
{
|
||||
sk_4258 = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sk_4258 == 0)
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4258, 1));
|
||||
}
|
||||
}
|
||||
L2Character originalAttacker = isPet ? attacker.getPet() : attacker;
|
||||
int hate = (int) (((damage / npc.getMaxHp()) / 0.05) * 20000);
|
||||
((L2Attackable) npc).addDamageHate(originalAttacker, 0, hate);
|
||||
if (Rnd.get(10) < 1)
|
||||
{
|
||||
int i0 = Rnd.get((15 * 15));
|
||||
if (i0 < 1)
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4216, 1));
|
||||
}
|
||||
else if (i0 < 2)
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4217, 1));
|
||||
}
|
||||
else if (i0 < 4)
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4219, 1));
|
||||
}
|
||||
else if (i0 < 8)
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4218, 1));
|
||||
}
|
||||
else if (i0 < 15)
|
||||
{
|
||||
for (L2Character character : npc.getKnownList().getKnownCharactersInRadius(100))
|
||||
{
|
||||
if (character != attacker)
|
||||
continue;
|
||||
if (attacker != ((L2Attackable) npc).getMostHated())
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4221, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Rnd.get(2) < 1)
|
||||
{
|
||||
if (attacker == ((L2Attackable) npc).getMostHated())
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4220, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (getTimeHour() < 5)
|
||||
{}
|
||||
else if (npc.getCurrentHp() < ((npc.getMaxHp() * _quest2) / 4.0))
|
||||
{
|
||||
_quest2 = (_quest2 - 1);
|
||||
int i2 = Rnd.get(15);
|
||||
_ai1 = Xcoords[i2] + Rnd.get(650);
|
||||
_ai2 = Ycoords[i2] + Rnd.get(650);
|
||||
_ai3 = Zcoords[i2];
|
||||
npc.setTarget(npc);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4222, 1));
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
|
||||
{
|
||||
int npcId = npc.getNpcId();
|
||||
if (npcId == ZAKEN)
|
||||
{
|
||||
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
GrandBossManager.getInstance().setBossStatus(ZAKEN, DEAD);
|
||||
//time is 36hour +/- 17hour
|
||||
long respawnTime = (long) Config.Interval_Of_Zaken_Spawn + Rnd.get(Config.Random_Of_Zaken_Spawn);
|
||||
startQuestTimer("zaken_unlock", respawnTime, null, null);
|
||||
cancelQuestTimer("1001", npc, null);
|
||||
cancelQuestTimer("1003", npc, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(ZAKEN);
|
||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().setStatsSet(ZAKEN, info);
|
||||
}
|
||||
else if (GrandBossManager.getInstance().getBossStatus(ZAKEN) == ALIVE)
|
||||
{
|
||||
if (npcId != ZAKEN)
|
||||
{
|
||||
startQuestTimer("CreateOnePrivateEx", ((30 + Rnd.get(60)) * 1000), npc, null);
|
||||
}
|
||||
}
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSkillSee(L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet)
|
||||
{
|
||||
int npcId = npc.getNpcId();
|
||||
if (npcId == ZAKEN)
|
||||
{
|
||||
if (skill.getAggroPoints() > 0)
|
||||
{
|
||||
((L2Attackable) npc).addDamageHate(caster, 0, (((skill.getAggroPoints() / npc.getMaxHp()) * 10) * 150));
|
||||
}
|
||||
if (Rnd.get(12) < 1)
|
||||
{
|
||||
int i0 = Rnd.get((15 * 15));
|
||||
if (i0 < 1)
|
||||
{
|
||||
npc.setTarget(caster);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4216, 1));
|
||||
}
|
||||
else if (i0 < 2)
|
||||
{
|
||||
npc.setTarget(caster);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4217, 1));
|
||||
}
|
||||
else if (i0 < 4)
|
||||
{
|
||||
npc.setTarget(caster);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4219, 1));
|
||||
}
|
||||
else if (i0 < 8)
|
||||
{
|
||||
npc.setTarget(caster);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4218, 1));
|
||||
}
|
||||
else if (i0 < 15)
|
||||
{
|
||||
for (L2Character character : npc.getKnownList().getKnownCharactersInRadius(100))
|
||||
{
|
||||
if (character != caster)
|
||||
continue;
|
||||
if (caster != ((L2Attackable) npc).getMostHated())
|
||||
{
|
||||
npc.setTarget(caster);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4221, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Rnd.get(2) < 1)
|
||||
{
|
||||
if (caster == ((L2Attackable) npc).getMostHated())
|
||||
{
|
||||
npc.setTarget(caster);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4220, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onSkillSee(npc, caster, skill, targets, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isPet)
|
||||
{
|
||||
int npcId = npc.getNpcId();
|
||||
if (npcId == ZAKEN)
|
||||
{
|
||||
if (_Zone.isInsideZone(npc))
|
||||
{
|
||||
L2Character target = isPet ? player.getPet() : player;
|
||||
((L2Attackable) npc).addDamageHate(target, 1, 200);
|
||||
}
|
||||
if (player.getZ() > (npc.getZ() - 100) && player.getZ() < (npc.getZ() + 100))
|
||||
{
|
||||
if (_quest0 < 5 && Rnd.get(3) < 1)
|
||||
{
|
||||
if (_quest0 == 0)
|
||||
{
|
||||
c_quest0 = player;
|
||||
}
|
||||
else if (_quest0 == 1)
|
||||
{
|
||||
c_quest1 = player;
|
||||
}
|
||||
else if (_quest0 == 2)
|
||||
{
|
||||
c_quest2 = player;
|
||||
}
|
||||
else if (_quest0 == 3)
|
||||
{
|
||||
c_quest3 = player;
|
||||
}
|
||||
else if (_quest0 == 4)
|
||||
{
|
||||
c_quest4 = player;
|
||||
}
|
||||
_quest0++;
|
||||
}
|
||||
if (Rnd.get(15) < 1)
|
||||
{
|
||||
int i0 = Rnd.get((15 * 15));
|
||||
if (i0 < 1)
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4216, 1));
|
||||
}
|
||||
else if (i0 < 2)
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4217, 1));
|
||||
}
|
||||
else if (i0 < 4)
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4219, 1));
|
||||
}
|
||||
else if (i0 < 8)
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4218, 1));
|
||||
}
|
||||
else if (i0 < 15)
|
||||
{
|
||||
for (L2Character character : npc.getKnownList().getKnownCharactersInRadius(100))
|
||||
{
|
||||
if (character != player)
|
||||
continue;
|
||||
if (player != ((L2Attackable) npc).getMostHated())
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4221, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Rnd.get(2) < 1)
|
||||
{
|
||||
if (player == ((L2Attackable) npc).getMostHated())
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4220, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAggroRangeEnter(npc, player, isPet);
|
||||
}
|
||||
|
||||
public int getTimeHour()
|
||||
{
|
||||
return (GameTimeController.getInstance().getGameTime() / 60) % 24;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// now call the constructor (starts up the ai)
|
||||
new Zaken(-1, "zaken", "ai");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
Individual AI:
|
||||
This folder contains AI scripts for single npc templates (one npc ID, but possibly many instances).
|
||||
That is, if a particular NPC/mob has a unique AI or something slightly different from all other generic NPCs,
|
||||
an individual AI script can be created for all occurences of that npc/mob. Such individual scripts ought to be here.
|
||||
|
||||
Individual AI scripts can be subclassed. In other words, an individual may inherit from a group or other individual.
|
||||
For example, one group template might define mobs that cast spells. A particular mob may cast spells but may also
|
||||
talk whenever it gets attacked. In that case, instead of writing all the AI for attacking and casting spells, it may
|
||||
inherit from a group template that defines AI for ALL mobs that cast spells, then add behaviours for talking onAttack.
|
||||
|
||||
"NPC registrations" refers to the addition of NPCs in the various events of the scripts, such as onAttack, onKill, etc
|
||||
Those are done by using keywords such as "addKillId" etc. For more details on registrations, see
|
||||
"scripts/quests/documentation.txt"
|
||||
@@ -0,0 +1,8 @@
|
||||
Most of the scripts found within the "scripts" folder are initialized on server start, but
|
||||
do not run anything except when triggered by a player. For scripts that need to be ran
|
||||
automatically, without any player interaction, cron can be used.
|
||||
Using the format demonstrated in the example.py script, one can setup tasks that run
|
||||
automatically at server boot. In addition, advanced users can include other classes from java
|
||||
and setup timed tasks, such as special events that have universal drops for a certain period of time.
|
||||
|
||||
The server admins can feel free to add more folders like cron and include them in their servers.
|
||||
@@ -0,0 +1,9 @@
|
||||
package cron;
|
||||
|
||||
public class example
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
System.out.println("Hello world!");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
##############################################
|
||||
### Author: Layane (andrashe@gmail.com)
|
||||
##############################################
|
||||
|
||||
print "Hi world!"
|
||||
@@ -0,0 +1,6 @@
|
||||
<html><body>Fortune-Teller Mine:<br>
|
||||
I see an image approaching before you... It is difficult to put what I saw into words.<br>
|
||||
How can I say this? Okay, listen closely:<br><br>
|
||||
<center>What you've endured will return as a benefit.</center><br><br>
|
||||
Take these words to heart. You should seriously consider the meaning...
|
||||
</body></html>
|
||||
@@ -0,0 +1,78 @@
|
||||
# Created by Kerberos
|
||||
import sys
|
||||
|
||||
from com.l2jserver.gameserver.model.quest import State
|
||||
from com.l2jserver.gameserver.model.quest import QuestState
|
||||
from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest
|
||||
|
||||
qn = "1001_FortuneTelling"
|
||||
|
||||
BODY = "<html><body>Fortune-Teller Mine:<br>I see an image approaching before you... It is difficult to put what I saw into words.<br>How can I say this? Okay, listen closely:<br><br><center>"
|
||||
END = "</center><br><br>Take these words to heart. You should seriously consider the meaning...</body></html>"
|
||||
FORTUNE = [ \
|
||||
"What you\'ve endured will return as a benefit.", \
|
||||
"The dragon now acquires an eagle\'s wings.", \
|
||||
"Be warned as you may be overwhelmed by surroundings if you lack a clear opinion.", \
|
||||
"A new trial or start may be successful as luck shadows changes.", \
|
||||
"You may feel nervous and anxious because of unfavorable situations.", \
|
||||
"You may meet the person you\'ve longed to see.", \
|
||||
"You may meet many new people but it will be difficult to find a perfect person who wins your heart.", \
|
||||
"Good fortune and opportunity may lie ahead as if one's born in a golden spoon.", \
|
||||
"Be confident and act tenaciously at all times. You may be able to accomplish to perfection during somewhat unstable situations.", \
|
||||
"There may be an occasion where you are consoled by people.", \
|
||||
"Be independent at all times.", \
|
||||
"Do not loosen up with your precautions.", \
|
||||
"Closely observe people who pass by since you may meet a precious person who can help you.", \
|
||||
"Listen to the advice that's given to you with a humble attitude.", \
|
||||
"Focus on networking with like-minded people. They may join you for a big mission in the future.", \
|
||||
"Staying busy rather than being stationary will help.", \
|
||||
"You may lose your drive and feel lost.", \
|
||||
"People around you will encourage your every task in the future.", \
|
||||
"Be kind to and care for those close to you, they may help in the future.", \
|
||||
"Your ambition and dream will come true.", \
|
||||
"Your value will shine as your potential is finally realized.", \
|
||||
"If you keep smiling without despair, people will come to trust you and offer help.", \
|
||||
"There may be a little loss, but think of it as an investment for yourself.", \
|
||||
"The difficult situations will turn to hope with unforeseen help.", \
|
||||
"Impatience may lie ahead as the situation is unfavorable.", \
|
||||
"Be responsible with your tasks but do not hesitate to ask for colleagues\' help.", \
|
||||
"You may fall in danger each time when acting upon improvisation.", \
|
||||
"A determined act after prepared research will attract people.", \
|
||||
"A rest will promise a bigger development.", \
|
||||
"You will be rewarded for your efforts and accomplishments.", \
|
||||
"There are many things to consider after encountering hindrances.", \
|
||||
"Consider other\'s situations and treat them sincerely at all times.", \
|
||||
"A comparison to others may be helpful.", \
|
||||
"Be cautious to control emotions as temptations are nearby.", \
|
||||
"Momentarily delay an important decision.", \
|
||||
"Be confident and act tenaciously at all times. You may be able to accomplish to perfection during somewhat unstable situations.", \
|
||||
"Visiting a place you\'ve never been before may bring luck.", \
|
||||
"What used to be well managed may stumble one after another.", \
|
||||
"Your steady pursuit of new information and staying ahead of others will raise your value.", \
|
||||
"Being neutral is a good way to go, but clarity may be helpful contrary to your hesitance.", \
|
||||
"Skillful evasion is needed when dealing with people who pick fights as a disaster may arise from it.", \
|
||||
"Small things make up big things so even value trivial matters.", \
|
||||
"Bigger mistakes will be on the road if you fail to correct a small mistake.", \
|
||||
"Momentarily delay an important decision.", \
|
||||
"A remedy is on its way for a serious illness."]
|
||||
|
||||
class Quest (JQuest) :
|
||||
|
||||
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
|
||||
|
||||
def onTalk (Self,npc,player):
|
||||
st = player.getQuestState(qn)
|
||||
if not st: return
|
||||
if st.getQuestItemsCount(57) < 1000 :
|
||||
htmltext="lowadena.htm"
|
||||
else :
|
||||
st.takeItems(57,1000)
|
||||
st.getRandom(45)
|
||||
htmltext=BODY+FORTUNE[st.getRandom(45)]+END
|
||||
st.exitQuest(1)
|
||||
return htmltext
|
||||
|
||||
QUEST = Quest(-1,qn,"Custom")
|
||||
|
||||
QUEST.addStartNpc(32616)
|
||||
QUEST.addTalkId(32616)
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><body>Fortune-Teller Mine:<br>
|
||||
Very well. I perceive you either cannot afford my offer or are not ready to learn your future.<br>
|
||||
No matter! Your future is still there waiting for you. Good luck!<br>
|
||||
</body></html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<html><body>Mage Notingale:<br>
|
||||
Once you have acquired transportaion, the next thing is to fight against those who are attacking us.<br>
|
||||
Our chief enemies are the monsters of the skies and the Seeds. Since you cannot possible handle either of these by yourself, you should start by gathering a party of your fellows.<br>
|
||||
<a action="bypass -h Quest 1002_Nottingale 32627-2.htm">Ask about Aerial Raid Monsters.</a><br>
|
||||
<a action="bypass -h Quest 1002_Nottingale 32627-7.htm">Ask about major hunting grounds.</a>
|
||||
</body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><body>Mage Notingale:<br>
|
||||
The following enemies have attacked us from the skies nearby:<br>
|
||||
<a action="bypass -h Quest 1002_Nottingale 32627-3.htm">Valdstone the Master Rider</a><br>
|
||||
<a action="bypass -h Quest 1002_Nottingale 32627-4.htm">Rok the King of Birds</a><br>
|
||||
<a action="bypass -h Quest 1002_Nottingale 32627-5.htm">Enira the Banshee Queen</a><br>
|
||||
<a action="bypass -h Quest 1002_Nottingale 32627-6.htm">Dius the Messenger of Destruction</a>
|
||||
</body></html>
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><body>Mage Notingale:<br>
|
||||
Valdstone the Master Rider used to be a lord of this land. He gained the power to control wild Aurabirds in exchange for yielding his territory to the Seed of Infinity.<br>
|
||||
His Elite Riders always watch our fortress. Look at the map to see where he and his minions most frequently appear.
|
||||
</body></html>
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><body>Mage Notingale:<br>
|
||||
Rok, the King of Birds, used to be the largest and most intelligent bird in Gracia. But since the Seed of Destruction and Storm Dragon Lindvior appeared, he has been in hiding.<br>
|
||||
As the power of the Seed of Destruction has waned, however, he appears to be regaining his former control over birds. When the power of the Seed of Destruction is weak, you may see Rok if you attack birds nearby. I will mark the areas on the map where he most often appears.
|
||||
</body></html>
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><body>Mage Notingale:<br>
|
||||
It is said that Enira the Banshee Queen is a subordinate of Ekimus, the ruler of the Seed of Infinity. But I believe differently. It seems as though she is keeping an eye on the Seed of Infinity.<br>
|
||||
Of course, I'm not saying Enira is on our side. She is still very much a threat. If we hope to travel the skies of Gracia unmolested, she must be defeated. I have marked the areas where she frequently appears on your map.
|
||||
</body></html>
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><body>Mage Notingale:<br>
|
||||
Dius the Messenger of Destruction is a huge Drake of the Sky. He scours the skies for Tiat, the lord of the Seed of Destruction.<br>
|
||||
Fortunately, he is normally scarce. If you apply a special <font color="LEVEL">bait for Drakes</font> to <font color="LEVEL">Baby Drake Wings</font>, however, you can lure him out. I will mark the area where he appears on your map.
|
||||
</body></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<html><body>Mage Notigale:<br>
|
||||
The following Seeds are the main sites of enemy power nearby:<br>
|
||||
<a action="bypass -h Quest 1002_Nottingale 32627-8.htm">Seed of Infinity</a><br>
|
||||
<a action="bypass -h Quest 1002_Nottingale 32627-9.htm">Seed of Destruction</a>
|
||||
</body></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<html><body>Mage Notingale:<br>
|
||||
I will mark the location of the Seed of Infinity on your map.<br>
|
||||
It is controlled by Ekimus, the lord of Eternity. His ability to control both living and dead has transformed the whole Seed of Infinity into a living organism...<br>
|
||||
General Dilios can give you more details.
|
||||
</body></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<html><body>Mage Notingale:<br>
|
||||
I will mark the location of the Seed of Destruction on your map.<br>
|
||||
It is controlled by Tiat, the lord of the Mounted Troop. The Seed is like a one huge fortress, thwarting any attempts to enter. <br>
|
||||
General Dilios can give you more details.
|
||||
</body></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<html><body>Mage Notingale:<br>
|
||||
First of all, you must acquire either an Aurabird or an Airship in order to fight against the enemies who populate our skies. Since the number of Airships is limited, I recommend you acquire an Aurabird.<br>
|
||||
To do so, go meet Engineer Lekon and do what he tells you. Even if you decide to acquire an Airship, Lekon is worth talking to.<br>
|
||||
Check your map and I will tell you his location.
|
||||
</body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><body>Gracia Survivor:<br>
|
||||
There is a place at the western end of Aden, on the shores of the Sea of Gludio, where airships depart for Gracia. It's a wharf created through ancient Giant technology and the best Aden engineers.<br>
|
||||
Since it floats in mid-air, however, there's no way to go there directly. The only way is to teleport there directly. A gatekeeper from Talking Island or Gludio Castle Village can send you there.<br>
|
||||
We are desperate for help. If you are willing, I can send you up to Gludio Airship Wharf myself. But because some items are consumed, I must charge you something. I feel almost ashamed to ask.<br>
|
||||
I only hope you will see it as a donation to Gracia. If you can't afford it, the Gatekeeper in Gludio Castle Village or Talking Island can also send you there. What would you like to do?<br>
|
||||
<a action="bypass -h Quest 1003_Survivor 32632-2.htm">Move to Gludio Airship Wharf (150,000 Adena).</a>
|
||||
</body></html>
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><body>Gracia Survivor:<br>
|
||||
I understand. But as I told you earlier, if you're short of money, you can still get to Gracia through another route.<br>
|
||||
Visit the gatekeeper in Gludio Castle Village or Talking Island, and they can send you to the Airship Wharf. I hope you will do so. We can use everyone we can!
|
||||
</body></html>
|
||||
@@ -0,0 +1,53 @@
|
||||
#made by Kerberos
|
||||
import sys
|
||||
from com.l2jserver.gameserver.model.quest import State
|
||||
from com.l2jserver.gameserver.model.quest import QuestState
|
||||
from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest
|
||||
from com.l2jserver.gameserver.network.serverpackets import RadarControl
|
||||
|
||||
qn = "1002_Nottingale"
|
||||
|
||||
class Quest (JQuest) :
|
||||
|
||||
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
|
||||
|
||||
def onAdvEvent (self,event,npc,player):
|
||||
htmltext = event
|
||||
st = player.getQuestState(qn)
|
||||
qs = player.getQuestState("10273_GoodDayToFly")
|
||||
if not qs or qs and qs.getState() != State.COMPLETED:
|
||||
player.sendPacket(RadarControl(2,2,0,0,0))
|
||||
player.sendPacket(RadarControl(0,2,-184545,243120,1581))
|
||||
htmltext = "32627.htm"
|
||||
elif event == "32627-3.htm" :
|
||||
player.sendPacket(RadarControl(2,2,0,0,0))
|
||||
player.sendPacket(RadarControl(0,2,-192361,254528,3598))
|
||||
elif event == "32627-4.htm" :
|
||||
player.sendPacket(RadarControl(2,2,0,0,0))
|
||||
player.sendPacket(RadarControl(0,2,-174600,219711,4424))
|
||||
elif event == "32627-5.htm" :
|
||||
player.sendPacket(RadarControl(2,2,0,0,0))
|
||||
player.sendPacket(RadarControl(0,2,-181989,208968,4424))
|
||||
elif event == "32627-6.htm" :
|
||||
player.sendPacket(RadarControl(2,2,0,0,0))
|
||||
player.sendPacket(RadarControl(0,2,-252898,235845,5343))
|
||||
elif event == "32627-8.htm" :
|
||||
player.sendPacket(RadarControl(2,2,0,0,0))
|
||||
player.sendPacket(RadarControl(0,2,-212819,209813,4288))
|
||||
elif event == "32627-9.htm" :
|
||||
player.sendPacket(RadarControl(2,2,0,0,0))
|
||||
player.sendPacket(RadarControl(0,2,-246899,251918,4352))
|
||||
return htmltext
|
||||
|
||||
def onFirstTalk (self,npc,player):
|
||||
st = player.getQuestState(qn)
|
||||
if not st :
|
||||
st = self.newQuestState(player)
|
||||
player.setLastQuestNpcObject(npc.getObjectId())
|
||||
npc.showChatWindow(player)
|
||||
return None
|
||||
|
||||
QUEST = Quest(-1,qn,"custom")
|
||||
QUEST.addStartNpc(32627)
|
||||
QUEST.addFirstTalkId(32627)
|
||||
QUEST.addTalkId(32627)
|
||||
@@ -0,0 +1,11 @@
|
||||
<html><body><table width=200>
|
||||
<tr><td align="center">Echo Crystals </td></tr>
|
||||
</table><br>
|
||||
<a action="bypass -h Quest 3995_echo 4410">[Create an Echo Crystal - Theme of Journey]</a><br>
|
||||
<a action="bypass -h Quest 3995_echo 4409">[Create an Echo Crystal - Theme of Battle]</a><br>
|
||||
<a action="bypass -h Quest 3995_echo 4408">[Create an Echo Crystal - Theme of Love]</a><br>
|
||||
<a action="bypass -h Quest 3995_echo 4420">[Create an Echo Crystal - Theme of Solitude]</a><br>
|
||||
<a action="bypass -h Quest 3995_echo 4421">[Create an Echo Crystal - Theme of Feast]</a><br>
|
||||
<a action="bypass -h Quest 3995_echo 4419">[Create an Echo Crystal - Theme of Comedy]</a><br>
|
||||
<a action="bypass -h Quest 3995_echo 4418">[Create an Echo Crystal - Theme of Celebration]</a>
|
||||
</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Kantabilon:<br>
|
||||
What soothing music! Ideal for a traveler such as yourself...<br>
|
||||
Here is your crystal! Enjoy!</body></html>
|
||||
@@ -0,0 +1,2 @@
|
||||
<html><body>Kantabilon:<br>
|
||||
Hi there! If you want an Echo Crystal, it'll cost you 200 adena.</body></html>
|
||||
@@ -0,0 +1,2 @@
|
||||
<html><body>Kantabilon:<br>
|
||||
How do you expect me to make a crystal if you don't bring me a score?</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Kantabilon:<br>
|
||||
Oh, how noble! It brings to mind thousands of orcs marching bravely off to war...<br>
|
||||
Your crystal is complete! Enjoy it!</body></html>
|
||||
@@ -0,0 +1,2 @@
|
||||
<html><body>Kantabilon:<br>
|
||||
If you want me to create an Echo Crystal, it'll cost you 200 adena.</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Kantabilon:<br>
|
||||
As you are well aware, I cannot make an Echo Crystal for you if you don't bring me a score!<br>
|
||||
A fellow once told me that he was able to obtain an old score by talking to a fake alchemist in Oren...</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Kantabilon:<br>
|
||||
Oh, how romantic! And melancholy at the same time... Like love, wouldn't you agree? Yes, this definitely has an Elven quality to it... Perhaps I should add a female Elven voice to the crystal?~<br>
|
||||
It is complete. Enjoy!</body></html>
|
||||
@@ -0,0 +1,2 @@
|
||||
<html><body>Kantabilon:<br>
|
||||
Well, if you want an Echo Crystal it will cost you 200 adena.</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Kantabilon:<br>
|
||||
I already told you that I cannot make an Echo Crystal for you if you don't bring me a score!<br>
|
||||
A fellow once told me that he was able to obtain an old score by talking to a fake alchemist in Oren...</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Kantabilon:<br>
|
||||
How sad! It reminds me of the feeling I get when I'm drinking alone on a rainy night... My, oh my, am I blue!<br>
|
||||
Here is your crystal. Enjoy it!</body></html>
|
||||
@@ -0,0 +1,2 @@
|
||||
<html><body>Kantabilon:<br>
|
||||
If you want an Echo Crystal it'll cost you 200 adena.</body></html>
|
||||
@@ -0,0 +1,2 @@
|
||||
<html><body>Kantabilon:<br>
|
||||
How do you expect me to make a crystal if you don't bring me a score?</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Kantabilon:<br>
|
||||
This music makes me want to get up and dance! I haven't felt this good in years! All it needs is an accordion!<br>
|
||||
Your crystal is complete. Enjoy it!</body></html>
|
||||
@@ -0,0 +1,2 @@
|
||||
<html><body>Kantabilon:<br>
|
||||
If you want me to create an Echo Crystal it'll cost you 200 adena.</body></html>
|
||||
@@ -0,0 +1,2 @@
|
||||
<html><body>Kantabilon:<br>
|
||||
How do you expect me to make an Echo Crystal if you don't bring me a score?</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Melody Maestro Kantabilon:<br>
|
||||
This is such a happy tune! I especially like the last part! It reminds me of watching a clown at the circus... <br>
|
||||
It's done! Enjoy!</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Melody Maestro Kantabilon:<br>
|
||||
Hmm...! Is there a happy occasion in the offing? My, what heartwarming music! <br>
|
||||
It's done! Enjoy!</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Octavia:<br>
|
||||
Music and travel are my two favorite things! Music makes travel twice as exciting!<br>
|
||||
Your crystal is finished! Tra la la~!</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Octavia:<br>
|
||||
I'm trying to make a living here! If you won't pay for the ingredients, who do you think will?<br>
|
||||
An Echo Crystal will cost you 200 adena.</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Octavia:<br>
|
||||
How do you expect me to make an Echo Crystal without a score? Unless you want a silent Echo Crystal~!!<br>
|
||||
Bard Swan has a lovely travel score you might like... Tra la la~ la la~!</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Octavia:<br>
|
||||
Oh, my! What a bellicose theme! I feel like marching off to war! Da dum da dum dum~!<br>
|
||||
La la~! Your crystal is finished~! Tra la la~ la la~!</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Octavia:<br>
|
||||
I'm trying to make a living here! If you won't pay for the ingredients, who do you think will?<br>
|
||||
An Echo Crystal will cost you 200 adena.</body></html>
|
||||
@@ -0,0 +1,2 @@
|
||||
<html><body>Octavia:<br>
|
||||
How can I make an Echo Crystal without a score~? Unless you want me to make a silent Echo Crystal~!!</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Octavia:<br>
|
||||
What is the taste of love? Is it sweet like honey or bitter like black beer? I'll bet it tastes like a Dion potato! Yum!<br>
|
||||
Your crystal is finished! I hope you enjoy it!</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Octavia:<br>
|
||||
I'm trying to make a living here! If you won't pay for the ingredients, do you expect me to?<br>
|
||||
An Echo Crystal will cost you 200 adena.</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Octavia:<br>
|
||||
How do you expect me to make an Echo Crystal without a score? Unless you want a silent Echo Crystal~!!<br>
|
||||
</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Octavia:<br>
|
||||
Oh, the lonely moon! My aching heart! This isn't my style at all!~<br>
|
||||
Your crystal is finished!</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Octavia:<br>
|
||||
I'm trying to make a living here! If you won't pay for the ingredients, do you expect me to?<br>
|
||||
An Echo Crystal will cost you 200 adena.</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Octavia:<br>
|
||||
How do you expect me to make an Echo Crystal without a score? Unless you a silent Echo Crystal!!<br>
|
||||
A fellow once told me that an excellent theme of solitude can be obtained from Musician Nanarin. He has quite a fondness for beards. Tra la la la la!</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Octavia:<br>
|
||||
Shake that booty! Yeah, baby! Go! Dance, you slug! You self-centered buffoon! Shake your body! Feel the beat!<br>
|
||||
Your crystal is finished!</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Octavia:<br>
|
||||
I'm trying to make a living here! If you won't pay for the ingredients, who do you think will?<br>
|
||||
An Echo Crystal will cost you 200 adena.</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Octavia:<br>
|
||||
How do you expect me to make an Echo Crystal without a score? Unless you want a silent Echo Crystal!!<br>
|
||||
Barbado has a lovely score with a theme of feast!</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Octavia:<br>
|
||||
Come out and play with me! Forget your troubles! Come on! Get happy!<br>
|
||||
It's finished! This is really my kind of music!</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Octavia:<br>
|
||||
Ah, what a touching melody! Such heart-felt sentiments. And just think, it was made especially for you!<br>
|
||||
Enjoy!</body></html>
|
||||
@@ -0,0 +1,64 @@
|
||||
# Formerly based on Elektra's script
|
||||
# updated by DrLecter for the Official L2J Datapack Project.
|
||||
# Visit http://www.l2jdp.com/forum// for more details.
|
||||
|
||||
qn = "3995_echo"
|
||||
|
||||
NPCS = [31042,31043]
|
||||
ADENA = 57
|
||||
COST = 200
|
||||
|
||||
QuestId = 3995
|
||||
QuestName = "echo"
|
||||
QuestDesc = "custom"
|
||||
|
||||
#score:[crystal,msg_ok,msg_noadena,msg_noscore]
|
||||
LIST={
|
||||
4410:[4411,"01","02","03"],
|
||||
4409:[4412,"04","05","06"],
|
||||
4408:[4413,"07","08","09"],
|
||||
4420:[4414,"10","11","12"],
|
||||
4421:[4415,"13","14","15"],
|
||||
4419:[4417,"16","05","06"],
|
||||
4418:[4416,"17","05","06"]
|
||||
}
|
||||
|
||||
|
||||
import sys
|
||||
from com.l2jserver.gameserver.model.quest import State
|
||||
from com.l2jserver.gameserver.model.quest import QuestState
|
||||
from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest
|
||||
|
||||
class Quest (JQuest) :
|
||||
|
||||
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
|
||||
|
||||
def onAdvEvent (self,event,npc,player) :
|
||||
st = player.getQuestState(qn)
|
||||
if not (st and event.isdigit()): return
|
||||
score=int(event)
|
||||
if score in LIST.keys() :
|
||||
crystal,ok,noadena,noscore=LIST[score]
|
||||
npcId = str(npc.getNpcId())
|
||||
if not st.getQuestItemsCount(score) :
|
||||
htmltext=npcId+"-"+noscore+".htm"
|
||||
elif st.getQuestItemsCount(ADENA) < COST :
|
||||
htmltext=npcId+"-"+noadena+".htm"
|
||||
else :
|
||||
st.takeItems(ADENA,COST)
|
||||
st.giveItems(crystal,1)
|
||||
htmltext=npcId+"-"+ok+".htm"
|
||||
else :
|
||||
htmltext=""
|
||||
st.exitQuest(1)
|
||||
return htmltext
|
||||
|
||||
def onTalk (Self,npc,player):
|
||||
return "1.htm"
|
||||
|
||||
|
||||
QUEST = Quest(-1,qn,QuestDesc)
|
||||
|
||||
for npc in NPCS:
|
||||
QUEST.addStartNpc(npc)
|
||||
QUEST.addTalkId(npc)
|
||||
@@ -0,0 +1,50 @@
|
||||
# Created by DrLecter
|
||||
import sys
|
||||
|
||||
from com.l2jserver.gameserver.model.quest import State
|
||||
from com.l2jserver.gameserver.model.quest import QuestState
|
||||
from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest
|
||||
|
||||
qn = "4000_ShadowWeapons"
|
||||
#NPCs that would need to figure out what to show when asked about coupons exchange
|
||||
NPC =[ 30037,30066,30070,30109,30115,30120,30174,30175,30176,30187,30191,30195, \
|
||||
30288,30289,30290,30297,30373,30462,30474,30498,30499,30500,30503,30504, \
|
||||
30505,30511,30512,30513,30595,30676,30677,30681,30685,30687,30689,30694, \
|
||||
30699,30704,30845,30847,30849,30854,30857,30862,30865,30894,30897,30900, \
|
||||
30905,30910,30913,31269,31272,31288,31314,31317,31321,31324,31326,31328, \
|
||||
31331,31334,31336,31965,31974,31276,31285,31958,31961,31996,31968,31977, \
|
||||
32092,32093,32094,32095,32096,32097,32098,32193,32196,32199,32202,32205, \
|
||||
32206,32213,32214,32221,32222,32229,32230,32233,32234 ]
|
||||
#itemId for shadow weapon coupons, it's not used more than once but increases readability
|
||||
D_COUPON,C_COUPON=[ 8869,8870 ]
|
||||
|
||||
class Quest (JQuest) :
|
||||
|
||||
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
|
||||
|
||||
def onTalk (Self,npc,player):
|
||||
st = player.getQuestState(qn)
|
||||
if not st: return
|
||||
has_d=st.getQuestItemsCount(D_COUPON)
|
||||
has_c=st.getQuestItemsCount(C_COUPON)
|
||||
if has_d or has_c :
|
||||
#let's assume character had both c & d-grade coupons, we'll confirm later
|
||||
multisell=306893003
|
||||
if not has_d :
|
||||
#if s/he had c-grade only...
|
||||
multisell=306893002
|
||||
elif not has_c :
|
||||
#or d-grade only.
|
||||
multisell=306893001
|
||||
#finally, return htm with proper multisell value in it.
|
||||
htmltext=st.showHtmlFile("exchange.htm").replace("%msid%",str(multisell))
|
||||
else :
|
||||
htmltext="exchange-no.htm"
|
||||
st.exitQuest(1)
|
||||
return htmltext
|
||||
|
||||
QUEST = Quest(-1,qn,"Custom")
|
||||
|
||||
for item in NPC:
|
||||
QUEST.addStartNpc(item)
|
||||
QUEST.addTalkId(item)
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><body>
|
||||
You don't have a Shadow weapon exchange coupon.<br>
|
||||
A shadow Weapon exchange coupon is a<font color="LEVEL"> gift received from a Grand Master, Magister or High Priest when you complete a class transfer.</font><br>
|
||||
</body></html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<html><body>
|
||||
A Shadow weapon is a special weapon that is made in cooperation between the Ivory Tower and the Black Anvil Guild. It is created by magically projecting the power of a weapon onto another catalytic object. While that means that it can only be used while the magic charge remains, it has made it possible to mass produce projectile weapons.<br>
|
||||
Its performance is no different than if you used the original weapon, except that it cannot possess the special ability to absorb souls or refine through a Stone of Life. Also, although it acts as a weapon, it is actualy in the magic category -- once opened, it cannot be passed on to someone else. Consider it an aid on your new path until you lay your hands on some real weapons.<br>
|
||||
If you have a Shadow Weapon exchange coupon, you can receive a Shadow Weapon right for you.<br>
|
||||
<a action="bypass -h npc_%objectId%_multisell %msid%">Give the shadow Weapon exchange coupon.</a>
|
||||
</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Adventurers' Guide Miss Queen:<br>
|
||||
You've already received a weapon exchange coupon for training adventurers! Do you actually think you can fool Miss Queen?<br>(Players are only allowed one trainee weapon exchange coupon per account.)
|
||||
</body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<html><body>Adventurers' Guide Miss Queen:<br>
|
||||
Here's the coupon you requested. You're now eligible to rent a weapon from the Adventurer's Guild warehouse. This coupon is non-transferable, and you are responsible for any damages or loss of weaponry.<br>You may only rent one weapon at a time, and if at any time before you reach level 25 you become unhappy with your choice, you may turn in the weapon for another coupon. Good luck!
|
||||
</body></html>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user