MC_Show.java 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package ai.fantasy_isle;
  16. import java.text.SimpleDateFormat;
  17. import java.util.Map;
  18. import javolution.util.FastMap;
  19. import ai.group_template.L2AttackableAIScript;
  20. import com.l2jserver.Config;
  21. import com.l2jserver.gameserver.GameTimeController;
  22. import com.l2jserver.gameserver.ThreadPoolManager;
  23. import com.l2jserver.gameserver.ai.CtrlIntention;
  24. import com.l2jserver.gameserver.model.L2CharPosition;
  25. import com.l2jserver.gameserver.model.actor.L2Npc;
  26. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  27. import com.l2jserver.gameserver.network.NpcStringId;
  28. import com.l2jserver.gameserver.network.serverpackets.NpcSay;
  29. import com.l2jserver.gameserver.network.serverpackets.PlaySound;
  30. import com.l2jserver.gameserver.network.serverpackets.SocialAction;
  31. /**
  32. * MC show script
  33. * @author Kerberos
  34. */
  35. public class MC_Show extends L2AttackableAIScript
  36. {
  37. private static int mc = 32433;
  38. private static int[] singers = {32431,32432};
  39. private static int[] circus = {32442,32443,32444,32445,32446};
  40. private static int[] individuals = {32439,32440,32441};
  41. private static int[] showstuff = {32424,32425,32426,32427,32428};
  42. private static boolean isStarted = false;
  43. private static NpcStringId[] messages = {
  44. NpcStringId.HOW_COME_PEOPLE_ARE_NOT_HERE_WE_ARE_ABOUT_TO_START_THE_SHOW_HMM,
  45. NpcStringId.UGH_I_HAVE_BUTTERFLIES_IN_MY_STOMACH_THE_SHOW_STARTS_SOON,
  46. NpcStringId.THANK_YOU_ALL_FOR_COMING_HERE_TONIGHT,
  47. NpcStringId.IT_IS_AN_HONOR_TO_HAVE_THE_SPECIAL_SHOW_TODAY,
  48. NpcStringId.FANTASY_ISLE_IS_FULLY_COMMITTED_TO_YOUR_HAPPINESS,
  49. NpcStringId.NOW_ID_LIKE_TO_INTRODUCE_THE_MOST_BEAUTIFUL_SINGER_IN_ADEN_PLEASE_WELCOMELEYLA_MIRA,
  50. NpcStringId.HERE_SHE_COMES,
  51. NpcStringId.THANK_YOU_VERY_MUCH_LEYLA,
  52. //NpcStringId.1800089 Now we're in for a real treat.
  53. NpcStringId.JUST_BACK_FROM_THEIR_WORLD_TOUR_PUT_YOUR_HANDS_TOGETHER_FOR_THE_FANTASY_ISLE_CIRCUS,
  54. NpcStringId.COME_ON_EVERYONE,
  55. NpcStringId.DID_YOU_LIKE_IT_THAT_WAS_SO_AMAZING,
  56. NpcStringId.NOW_WE_ALSO_INVITED_INDIVIDUALS_WITH_SPECIAL_TALENTS,
  57. NpcStringId.LETS_WELCOME_THE_FIRST_PERSON_HERE,
  58. NpcStringId.OH,
  59. NpcStringId.OKAY_NOW_HERE_COMES_THE_NEXT_PERSON_COME_ON_UP_PLEASE,
  60. NpcStringId.OH_IT_LOOKS_LIKE_SOMETHING_GREAT_IS_GOING_TO_HAPPEN_RIGHT,
  61. NpcStringId.OH_MY,
  62. NpcStringId.THATS_G_GREAT_NOW_HERE_COMES_THE_LAST_PERSON,
  63. NpcStringId.NOW_THIS_IS_THE_END_OF_TODAYS_SHOW,
  64. NpcStringId.HOW_WAS_IT_I_HOPE_YOU_ALL_ENJOYED_IT,
  65. NpcStringId.PLEASE_REMEMBER_THAT_FANTASY_ISLE_IS_ALWAYS_PLANNING_A_LOT_OF_GREAT_SHOWS_FOR_YOU,
  66. NpcStringId.WELL_I_WISH_I_COULD_CONTINUE_ALL_NIGHT_LONG_BUT_THIS_IS_IT_FOR_TODAY_THANK_YOU,
  67. NpcStringId.WE_LOVE_YOU
  68. };
  69. private static Map<String, Object[]> talks = new FastMap<String, Object[]>();
  70. private static Map<String, Object[]> walks = new FastMap<String, Object[]>();
  71. private void load()
  72. {
  73. talks.put("1", new Object[]{messages[1],"2",1000});
  74. talks.put("2", new Object[]{messages[2],"3",6000});
  75. talks.put("3", new Object[]{messages[3],"4",4000});
  76. talks.put("4", new Object[]{messages[4],"5",5000});
  77. talks.put("5", new Object[]{messages[5],"6",3000});
  78. talks.put("8", new Object[]{messages[8],"9",5000});
  79. talks.put("9", new Object[]{messages[9],"10",5000});
  80. talks.put("12", new Object[]{messages[11],"13",5000});
  81. talks.put("13", new Object[]{messages[12],"14",5000});
  82. talks.put("15", new Object[]{messages[13],"16",5000});
  83. talks.put("16", new Object[]{messages[14],"17",5000});
  84. talks.put("18", new Object[]{messages[16],"19",5000});
  85. talks.put("19", new Object[]{messages[17],"20",5000});
  86. talks.put("21", new Object[]{messages[18],"22",5000});
  87. talks.put("22", new Object[]{messages[19],"23",400});
  88. talks.put("25", new Object[]{messages[20],"26",5000});
  89. talks.put("26", new Object[]{messages[21],"27",5400});
  90. walks.put("npc1_1" , new Object[]{-56546,-56384,-2008,"npc1_2",1200});
  91. walks.put("npc1_2" , new Object[]{-56597,-56384,-2008,"npc1_3",1200});
  92. walks.put("npc1_3" , new Object[]{-56596,-56428,-2008,"npc1_4",1200});
  93. walks.put("npc1_4" , new Object[]{-56593,-56474,-2008,"npc1_5",1000});
  94. walks.put("npc1_5" , new Object[]{-56542,-56474,-2008,"npc1_6",1000});
  95. walks.put("npc1_6" , new Object[]{-56493,-56473,-2008,"npc1_7",2000});
  96. walks.put("npc1_7" , new Object[]{-56495,-56425,-2008,"npc1_1",4000});
  97. walks.put("npc2_1" , new Object[]{-56550,-56291,-2008,"npc2_2",1200});
  98. walks.put("npc2_2" , new Object[]{-56601,-56293,-2008,"npc2_3",1200});
  99. walks.put("npc2_3" , new Object[]{-56603,-56247,-2008,"npc2_4",1200});
  100. walks.put("npc2_4" , new Object[]{-56605,-56203,-2008,"npc2_5",1000});
  101. walks.put("npc2_5" , new Object[]{-56553,-56202,-2008,"npc2_6",1100});
  102. walks.put("npc2_6" , new Object[]{-56504,-56200,-2008,"npc2_7",2000});
  103. walks.put("npc2_7" , new Object[]{-56503,-56243,-2008,"npc2_1",4000});
  104. walks.put("npc3_1" , new Object[]{-56500,-56290,-2008,"npc3_2",1200});
  105. walks.put("npc3_2" , new Object[]{-56551,-56313,-2008,"npc3_3",1200});
  106. walks.put("npc3_3" , new Object[]{-56601,-56293,-2008,"npc3_4",1200});
  107. walks.put("npc3_4" , new Object[]{-56651,-56294,-2008,"npc3_5",1200});
  108. walks.put("npc3_5" , new Object[]{-56653,-56250,-2008,"npc3_6",1200});
  109. walks.put("npc3_6" , new Object[]{-56654,-56204,-2008,"npc3_7",1200});
  110. walks.put("npc3_7" , new Object[]{-56605,-56203,-2008,"npc3_8",1200});
  111. walks.put("npc3_8" , new Object[]{-56554,-56202,-2008,"npc3_9",1200});
  112. walks.put("npc3_9" , new Object[]{-56503,-56200,-2008,"npc3_10",1200});
  113. walks.put("npc3_10", new Object[]{-56502,-56244,-2008,"npc3_1",900});
  114. walks.put("npc4_1" , new Object[]{-56495,-56381,-2008,"npc4_2",1200});
  115. walks.put("npc4_2" , new Object[]{-56548,-56383,-2008,"npc4_3",1200});
  116. walks.put("npc4_3" , new Object[]{-56597,-56383,-2008,"npc4_4",1200});
  117. walks.put("npc4_4" , new Object[]{-56643,-56385,-2008,"npc4_5",1200});
  118. walks.put("npc4_5" , new Object[]{-56639,-56436,-2008,"npc4_6",1200});
  119. walks.put("npc4_6" , new Object[]{-56639,-56473,-2008,"npc4_7",1200});
  120. walks.put("npc4_7" , new Object[]{-56589,-56473,-2008,"npc4_8",1200});
  121. walks.put("npc4_8" , new Object[]{-56541,-56473,-2008,"npc4_9",1200});
  122. walks.put("npc4_9" , new Object[]{-56496,-56473,-2008,"npc4_10",1200});
  123. walks.put("npc4_10", new Object[]{-56496,-56429,-2008,"npc4_1",900});
  124. walks.put("npc5_1" , new Object[]{-56549,-56335,-2008,"npc5_2",1000});
  125. walks.put("npc5_2" , new Object[]{-56599,-56337,-2008,"npc5_3",2000});
  126. walks.put("npc5_3" , new Object[]{-56649,-56341,-2008,"npc5_4",26000});
  127. walks.put("npc5_4" , new Object[]{-56600,-56341,-2008,"npc5_5",1000});
  128. walks.put("npc5_5" , new Object[]{-56553,-56341,-2008,"npc5_6",1000});
  129. walks.put("npc5_6" , new Object[]{-56508,-56331,-2008,"npc5_2",8000});
  130. walks.put("npc6_1" , new Object[]{-56595,-56428,-2008,"npc6_2",1000});
  131. walks.put("npc6_2" , new Object[]{-56596,-56383,-2008,"npc6_3",1000});
  132. walks.put("npc6_3" , new Object[]{-56648,-56384,-2008,"npc6_4",1000});
  133. walks.put("npc6_4" , new Object[]{-56645,-56429,-2008,"npc6_5",1000});
  134. walks.put("npc6_5" , new Object[]{-56644,-56475,-2008,"npc6_6",1000});
  135. walks.put("npc6_6" , new Object[]{-56595,-56473,-2008,"npc6_7",1000});
  136. walks.put("npc6_7" , new Object[]{-56542,-56473,-2008,"npc6_8",1000});
  137. walks.put("npc6_8" , new Object[]{-56492,-56472,-2008,"npc6_9",1200});
  138. walks.put("npc6_9" , new Object[]{-56495,-56426,-2008,"npc6_10",2000});
  139. walks.put("npc6_10", new Object[]{-56540,-56426,-2008,"npc6_1",3000});
  140. walks.put("npc7_1" , new Object[]{-56603,-56249,-2008,"npc7_2",1000});
  141. walks.put("npc7_2" , new Object[]{-56601,-56294,-2008,"npc7_3",1000});
  142. walks.put("npc7_3" , new Object[]{-56651,-56295,-2008,"npc7_4",1000});
  143. walks.put("npc7_4" , new Object[]{-56653,-56248,-2008,"npc7_5",1000});
  144. walks.put("npc7_5" , new Object[]{-56605,-56203,-2008,"npc7_6",1000});
  145. walks.put("npc7_6" , new Object[]{-56554,-56202,-2008,"npc7_7",1000});
  146. walks.put("npc7_7" , new Object[]{-56504,-56201,-2008,"npc7_8",1000});
  147. walks.put("npc7_8" , new Object[]{-56502,-56247,-2008,"npc7_9",1200});
  148. walks.put("npc7_9" , new Object[]{-56549,-56248,-2008,"npc7_10",2000});
  149. walks.put("npc7_10", new Object[]{-56549,-56248,-2008,"npc7_1",3000});
  150. walks.put("npc8_1" , new Object[]{-56493,-56426,-2008,"npc8_2",1000});
  151. walks.put("npc8_2" , new Object[]{-56497,-56381,-2008,"npc8_3",1200});
  152. walks.put("npc8_3" , new Object[]{-56544,-56381,-2008,"npc8_4",1200});
  153. walks.put("npc8_4" , new Object[]{-56596,-56383,-2008,"npc8_5",1200});
  154. walks.put("npc8_5" , new Object[]{-56594,-56428,-2008,"npc8_6",900});
  155. walks.put("npc8_6" , new Object[]{-56645,-56429,-2008,"npc8_7",1200});
  156. walks.put("npc8_7" , new Object[]{-56647,-56384,-2008,"npc8_8",1200});
  157. walks.put("npc8_8" , new Object[]{-56649,-56362,-2008,"npc8_9",9200});
  158. walks.put("npc8_9" , new Object[]{-56654,-56429,-2008,"npc8_10",1200});
  159. walks.put("npc8_10", new Object[]{-56644,-56474,-2008,"npc8_11",900});
  160. walks.put("npc8_11", new Object[]{-56593,-56473,-2008,"npc8_12",1100});
  161. walks.put("npc8_12", new Object[]{-56543,-56472,-2008,"npc8_13",1200});
  162. walks.put("npc8_13", new Object[]{-56491,-56471,-2008,"npc8_1",1200});
  163. walks.put("npc9_1" , new Object[]{-56505,-56246,-2008,"npc9_2",1000});
  164. walks.put("npc9_2" , new Object[]{-56504,-56291,-2008,"npc9_3",1200});
  165. walks.put("npc9_3" , new Object[]{-56550,-56291,-2008,"npc9_4",1200});
  166. walks.put("npc9_4" , new Object[]{-56600,-56292,-2008,"npc9_5",1200});
  167. walks.put("npc9_5" , new Object[]{-56603,-56248,-2008,"npc9_6",900});
  168. walks.put("npc9_6" , new Object[]{-56653,-56249,-2008,"npc9_7",1200});
  169. walks.put("npc9_7" , new Object[]{-56651,-56294,-2008,"npc9_8",1200});
  170. walks.put("npc9_8" , new Object[]{-56650,-56316,-2008,"npc9_9",9200});
  171. walks.put("npc9_9" , new Object[]{-56660,-56250,-2008,"npc9_10",1200});
  172. walks.put("npc9_10", new Object[]{-56656,-56205,-2008,"npc9_11",900});
  173. walks.put("npc9_11", new Object[]{-56606,-56204,-2008,"npc9_12",1100});
  174. walks.put("npc9_12", new Object[]{-56554,-56203,-2008,"npc9_13",1200});
  175. walks.put("npc9_13", new Object[]{-56506,-56203,-2008,"npc9_1",1200});
  176. walks.put("24" , new Object[]{-56730,-56340,-2008,"25",1800});
  177. walks.put("27" , new Object[]{-56702,-56340,-2008,"29",1800});
  178. }
  179. public MC_Show(int id,String name,String descr)
  180. {
  181. super(id,name,descr);
  182. registerMobs(new int[] { 32433, 32431, 32432, 32442, 32443, 32444, 32445, 32446, 32424, 32425, 32426, 32427, 32428 }, QuestEventType.ON_SPAWN);
  183. load();
  184. scheduleTimer();
  185. }
  186. private int getGameTime()
  187. {
  188. return GameTimeController.getInstance().getGameTime();
  189. }
  190. private void scheduleTimer()
  191. {
  192. int gameTime = getGameTime();
  193. int hours = (gameTime/60)%24;
  194. int minutes = gameTime%60;
  195. int hourDiff, minDiff;
  196. hourDiff = (20 - hours);
  197. if (hourDiff < 0)
  198. hourDiff = 24-(hourDiff*=-1);
  199. minDiff = (30 - minutes);
  200. if (minDiff < 0)
  201. minDiff = 60-(minDiff*=-1);
  202. long diff;
  203. hourDiff*=60*60*1000;
  204. minDiff*=60*1000;
  205. diff = hourDiff+minDiff;
  206. if (Config.DEBUG)
  207. {
  208. SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
  209. _log.info("Fantasy Isle: MC show script starting at " + format.format(System.currentTimeMillis()+diff)+ " and is scheduled each next 4 hours.");
  210. }
  211. ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new StartMCShow(), diff, 14400000L);
  212. }
  213. private void autoChat(L2Npc npc, NpcStringId npcString, int type)
  214. {
  215. npc.broadcastPacket(new NpcSay(npc.getObjectId(), type, npc.getNpcId(), npcString));
  216. }
  217. @Override
  218. public String onSpawn(L2Npc npc)
  219. {
  220. if (isStarted)
  221. {
  222. switch (npc.getNpcId())
  223. {
  224. case 32433:
  225. autoChat(npc,messages[0],1);
  226. startQuestTimer("1",30000, npc, null);
  227. break;
  228. case 32431:
  229. npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(-56657,-56338,-2008,33102));
  230. startQuestTimer("social1",6000, npc, null, true);
  231. startQuestTimer("7",215000, npc, null);
  232. break;
  233. case 32432:
  234. startQuestTimer("social1",6000, npc, null, true);
  235. startQuestTimer("7",215000, npc, null);
  236. break;
  237. case 32442:
  238. case 32443:
  239. case 32444:
  240. case 32445:
  241. case 32446:
  242. startQuestTimer("11",100000, npc, null);
  243. break;
  244. case 32424:
  245. case 32425:
  246. case 32426:
  247. case 32427:
  248. case 32428:
  249. startQuestTimer("social1",5500, npc, null);
  250. startQuestTimer("social1",12500, npc, null);
  251. startQuestTimer("28",19700, npc, null);
  252. break;
  253. }
  254. }
  255. return super.onSpawn(npc);
  256. }
  257. @Override
  258. public String onAdvEvent (String event, L2Npc npc, L2PcInstance player)
  259. {
  260. if (event.equalsIgnoreCase("Start"))
  261. {
  262. isStarted = true;
  263. addSpawn(mc,-56698,-56430,-2008,32768,false,0);
  264. }
  265. else if (npc != null && isStarted)
  266. {
  267. if (event.equalsIgnoreCase("6"))
  268. {
  269. autoChat(npc,messages[6],1);
  270. npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(-56511,-56647,-2008,36863));
  271. npc.broadcastPacket(new PlaySound(1, "NS22_F", 0, 0, 0, 0, 0));
  272. addSpawn(singers[0],-56344,-56328,-2008,32768,false,224000);
  273. addSpawn(singers[1],-56552,-56245,-2008,36863,false,224000);
  274. addSpawn(singers[1],-56546,-56426,-2008,28672,false,224000);
  275. addSpawn(singers[1],-56570,-56473,-2008,28672,false,224000);
  276. addSpawn(singers[1],-56594,-56516,-2008,28672,false,224000);
  277. addSpawn(singers[1],-56580,-56203,-2008,36863,false,224000);
  278. addSpawn(singers[1],-56606,-56157,-2008,36863,false,224000);
  279. startQuestTimer("7",215000, npc, null);
  280. }
  281. else if (event.equalsIgnoreCase("7"))
  282. {
  283. switch (npc.getNpcId())
  284. {
  285. case 32433:
  286. autoChat(npc,messages[7],1);
  287. npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(-56698,-56430,-2008,32768));
  288. startQuestTimer("8",12000, npc, null);
  289. break;
  290. default:
  291. cancelQuestTimer("social1", npc, null);
  292. npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(-56594,-56064,-2008,32768));
  293. break;
  294. }
  295. }
  296. else if (event.equalsIgnoreCase("10"))
  297. {
  298. npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(-56483,-56665,-2034,32768));
  299. npc.broadcastPacket(new PlaySound(1, "TP05_F", 0, 0, 0, 0, 0));
  300. startQuestTimer("npc1_1",3000, addSpawn(circus[0],-56495,-56375,-2008,32768,false,101000), null);
  301. startQuestTimer("npc2_1",3000, addSpawn(circus[0],-56491,-56289,-2008,32768,false,101000), null);
  302. startQuestTimer("npc3_1",3000, addSpawn(circus[1],-56502,-56246,-2008,32768,false,101000), null);
  303. startQuestTimer("npc4_1",3000, addSpawn(circus[1],-56496,-56429,-2008,32768,false,101000), null);
  304. startQuestTimer("npc5_1",3500, addSpawn(circus[2],-56505,-56334,-2008,32768,false,101000), null);
  305. startQuestTimer("npc6_1",4000, addSpawn(circus[3],-56545,-56427,-2008,32768,false,101000), null);
  306. startQuestTimer("npc7_1",4000, addSpawn(circus[3],-56552,-56248,-2008,32768,false,101000), null);
  307. startQuestTimer("npc8_1",3000, addSpawn(circus[4],-56493,-56473,-2008,32768,false,101000), null);
  308. startQuestTimer("npc9_1",3000, addSpawn(circus[4],-56504,-56201,-2008,32768,false,101000), null);
  309. startQuestTimer("11",100000, npc, null);
  310. }
  311. else if (event.equalsIgnoreCase("11"))
  312. {
  313. switch (npc.getNpcId())
  314. {
  315. case 32433:
  316. autoChat(npc,messages[10],1);
  317. npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(-56698,-56430,-2008,32768));
  318. startQuestTimer("12",5000, npc, null);
  319. break;
  320. default:
  321. npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(-56343,-56330,-2008,32768));
  322. break;
  323. }
  324. }
  325. else if (event.equalsIgnoreCase("14"))
  326. {
  327. startQuestTimer("social1",2000, addSpawn(individuals[0],-56700,-56385,-2008,32768,false,49000), null);
  328. startQuestTimer("15",7000, npc, null);
  329. }
  330. else if (event.equalsIgnoreCase("17"))
  331. {
  332. autoChat(npc,messages[15],1);
  333. startQuestTimer("social1",2000,addSpawn(individuals[1],-56700,-56340,-2008,32768,false,32000), null);
  334. startQuestTimer("18",9000, npc, null);
  335. }
  336. else if (event.equalsIgnoreCase("20"))
  337. {
  338. startQuestTimer("social1",2000, addSpawn(individuals[2],-56703,-56296,-2008,32768,false,13000), null);
  339. startQuestTimer("21",8000, npc, null);
  340. }
  341. else if (event.equalsIgnoreCase("23"))
  342. {
  343. npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(-56702,-56340,-2008,32768));
  344. startQuestTimer("24",2800, npc, null);
  345. addSpawn(showstuff[0],-56672,-56406,-2000,32768,false,20900);
  346. addSpawn(showstuff[1],-56648,-56368,-2000,32768,false,20900);
  347. addSpawn(showstuff[2],-56608,-56338,-2000,32768,false,20900);
  348. addSpawn(showstuff[3],-56652,-56307,-2000,32768,false,20900);
  349. addSpawn(showstuff[4],-56672,-56272,-2000,32768,false,20900);
  350. }
  351. else if (event.equalsIgnoreCase("28"))
  352. {
  353. autoChat(npc,messages[22],0);
  354. startQuestTimer("social1",1, npc, null);
  355. }
  356. else if (event.equalsIgnoreCase("29"))
  357. {
  358. npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(-56730,-56340,-2008,32768));
  359. startQuestTimer("clean_npc",4100, npc, null);
  360. startQuestTimer("timer_check",60000, null, null, true);
  361. }
  362. else if (event.equalsIgnoreCase("social1"))
  363. npc.broadcastPacket(new SocialAction(npc,1));
  364. else if (event.equalsIgnoreCase("clean_npc"))
  365. {
  366. isStarted = false;
  367. npc.deleteMe();
  368. }
  369. else
  370. {
  371. if (talks.containsKey(event))
  372. {
  373. NpcStringId npcString = (NpcStringId) talks.get(event)[0];
  374. String nextEvent = (String) talks.get(event)[1];
  375. int time = (Integer) talks.get(event)[2];
  376. autoChat(npc,npcString, 1);
  377. startQuestTimer(nextEvent,time, npc, null);
  378. }
  379. else if (walks.containsKey(event))
  380. {
  381. int x = (Integer) walks.get(event)[0];
  382. int y = (Integer) walks.get(event)[1];
  383. int z = (Integer) walks.get(event)[2];
  384. String nextEvent = (String) walks.get(event)[3];
  385. int time = (Integer) walks.get(event)[4];
  386. npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(x,y,z,0));
  387. startQuestTimer(nextEvent,time, npc, null);
  388. }
  389. }
  390. }
  391. return null;
  392. }
  393. public static void main(String[] args)
  394. {
  395. // now call the constructor (starts up the ai)
  396. new MC_Show(-1,"MC_Show","fantasy_isle");
  397. }
  398. }