Advertisement
Guest User

RBEvent - Interlude

a guest
Apr 11th, 2010
1,984
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 297.60 KB | None | 0 0
  1. Index: /trunk/Game/java/net/sf/l2j/Config.java
  2. ===================================================================
  3. --- /trunk/Game/java/net/sf/l2j/Config.java (revision 679)
  4. +++ /trunk/Game/java/net/sf/l2j/Config.java (revision 681)
  5. @@ -171,10 +171,17 @@
  6. public static boolean TVT_EVENT_POTIONS_ALLOWED;
  7. public static boolean TVT_EVENT_SUMMON_BY_ITEM_ALLOWED;
  8. public static List<Integer> TVT_EVENT_DOOR_IDS = new FastList<Integer>();
  9. public static byte TVT_EVENT_MIN_LVL;
  10. public static byte TVT_EVENT_MAX_LVL;
  11. +
  12. + /** Raid Event Engine */
  13. + public static boolean RAID_SYSTEM_ENABLED;
  14. + public static int RAID_SYSTEM_MAX_EVENTS;
  15. + public static boolean RAID_SYSTEM_GIVE_BUFFS;
  16. + public static boolean RAID_SYSTEM_RESURRECT_PLAYER;
  17. + public static int RAID_SYSTEM_FIGHT_TIME;
  18.  
  19. public static boolean L2JMOD_ALLOW_WEDDING;
  20. public static int L2JMOD_WEDDING_PRICE;
  21. public static boolean L2JMOD_WEDDING_PUNISH_INFIDELITY;
  22. public static boolean L2JMOD_WEDDING_TELEPORT;
  23. @@ -2011,10 +2018,21 @@
  24. }
  25. }
  26. }
  27. }
  28. }
  29. +
  30. + RAID_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("RaidEnginesEnabled", "false"));
  31. + RAID_SYSTEM_GIVE_BUFFS = Boolean.parseBoolean(L2JModSettings.getProperty("RaidGiveBuffs", "true"));
  32. + RAID_SYSTEM_RESURRECT_PLAYER = Boolean.parseBoolean(L2JModSettings.getProperty("RaidResurrectPlayer", "true"));
  33. + RAID_SYSTEM_MAX_EVENTS = Integer.parseInt(L2JModSettings.getProperty("RaidMaxNumEvents", "3"));
  34. + RAID_SYSTEM_FIGHT_TIME = Integer.parseInt(L2JModSettings.getProperty("RaidSystemFightTime", "60"));
  35. + if (RAID_SYSTEM_MAX_EVENTS == 0)
  36. + {
  37. + RAID_SYSTEM_ENABLED = false;
  38. + System.out.println("Raid Engine[Config.load()]: Invalid config property: Max Events = 0?!");
  39. + }
  40.  
  41. }
  42. catch (Exception e)
  43. {
  44. e.printStackTrace();
  45. Index: /trunk/Game/java/net/sf/l2j/gameserver/clientpackets/DlgAnswer.java
  46. ===================================================================
  47. --- /trunk/Game/java/net/sf/l2j/gameserver/clientpackets/DlgAnswer.java (revision 253)
  48. +++ /trunk/Game/java/net/sf/l2j/gameserver/clientpackets/DlgAnswer.java (revision 681)
  49. @@ -20,10 +20,11 @@
  50.  
  51. import java.util.logging.Logger;
  52.  
  53. import net.sf.l2j.Config;
  54. import net.sf.l2j.gameserver.network.SystemMessageId;
  55. +import net.sf.l2j.gameserver.model.actor.instance.L2EventManagerInstance;
  56.  
  57. /**
  58. * @author Dezmond_snz
  59. * Format: cddd
  60. */
  61. @@ -48,13 +49,20 @@
  62. {
  63. if (Config.DEBUG)
  64. _log.fine(getType()+": Answer acepted. Message ID "+_messageId+", asnwer "+_answer+", unknown field "+_unk);
  65. if (_messageId == SystemMessageId.RESSURECTION_REQUEST.getId())
  66. getClient().getActiveChar().reviveAnswer(_answer);
  67. - else if (_messageId==614 && Config.L2JMOD_ALLOW_WEDDING)
  68. - getClient().getActiveChar().EngageAnswer(_answer);
  69. -
  70. + else if (_messageId==614 && getClient().getActiveChar().awaitingAnswer && Config.L2JMOD_ALLOW_WEDDING)
  71. + {
  72. + getClient().getActiveChar().EngageAnswer(_answer);
  73. + getClient().getActiveChar().awaitingAnswer = false;
  74. + }
  75. + else if (_messageId==614 && L2EventManagerInstance._awaitingplayers.contains(getClient().getActiveChar()))
  76. + {
  77. + getClient().getActiveChar().setRaidAnswear(_answer);
  78. + L2EventManagerInstance._awaitingplayers.remove(getClient().getActiveChar());
  79. + }
  80. }
  81.  
  82. @Override
  83. public String getType()
  84. {
  85. Index: /trunk/Game/java/net/sf/l2j/gameserver/clientpackets/RequestRestartPoint.java
  86. ===================================================================
  87. --- /trunk/Game/java/net/sf/l2j/gameserver/clientpackets/RequestRestartPoint.java (revision 636)
  88. +++ /trunk/Game/java/net/sf/l2j/gameserver/clientpackets/RequestRestartPoint.java (revision 681)
  89. @@ -24,10 +24,11 @@
  90. import net.sf.l2j.gameserver.datatables.MapRegionTable;
  91. import net.sf.l2j.gameserver.instancemanager.CastleManager;
  92. import net.sf.l2j.gameserver.instancemanager.ClanHallManager;
  93. import net.sf.l2j.gameserver.model.L2SiegeClan;
  94. import net.sf.l2j.gameserver.model.Location;
  95. +import net.sf.l2j.gameserver.model.entity.L2RaidEvent;
  96. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  97. import net.sf.l2j.gameserver.model.entity.Castle;
  98. import net.sf.l2j.gameserver.model.entity.ClanHall;
  99. import net.sf.l2j.gameserver.network.SystemMessageId;
  100. import net.sf.l2j.gameserver.serverpackets.Revive;
  101. @@ -182,10 +183,34 @@
  102. {
  103. _log.warning("Living player ["+activeChar.getName()+"] called RestartPointPacket! Ban this player!");
  104. return;
  105. }
  106.  
  107. + if (activeChar.inClanEvent || activeChar.inPartyEvent || activeChar.inSoloEvent)
  108. + {
  109. + activeChar.inClanEvent = false;
  110. + activeChar.inPartyEvent = false;
  111. + activeChar.inSoloEvent = false;
  112. + if (L2RaidEvent._eventType == 2)
  113. + {
  114. + if(L2RaidEvent._participatingPlayers.contains(activeChar))
  115. + // Clear player from Event.
  116. + L2RaidEvent._participatingPlayers.remove(activeChar);
  117. + }
  118. + if (L2RaidEvent._eventType == 3)
  119. + {
  120. + if (activeChar.getParty()!=null)
  121. + activeChar.leaveParty();
  122. + activeChar.sendMessage("You have been kicked from the party");
  123. + }
  124. + activeChar.sendMessage("You've been erased from the event!");
  125. + int num = L2RaidEvent._participatingPlayers.size();
  126. + if (num > 0 && num!=1)
  127. + num -= 1;
  128. + else
  129. + L2RaidEvent.hardFinish();
  130. + }
  131.  
  132. Castle castle = CastleManager.getInstance().getCastle(activeChar.getX(), activeChar.getY(), activeChar.getZ());
  133. if (castle != null && castle.getSiege().getIsInProgress())
  134. {
  135. //DeathFinalizer df = new DeathFinalizer(10000);
  136. Index: /trunk/Game/java/net/sf/l2j/gameserver/skills/DocumentSkill.java
  137. ===================================================================
  138. --- /trunk/Game/java/net/sf/l2j/gameserver/skills/DocumentSkill.java (revision 253)
  139. +++ /trunk/Game/java/net/sf/l2j/gameserver/skills/DocumentSkill.java (revision 682)
  140. @@ -246,90 +246,76 @@
  141. }
  142. }
  143. }
  144. for (int i=lastLvl; i < lastLvl+enchantLevels1; i++)
  145. {
  146. + _currentSkill.currentLevel = lastLvl-1;
  147. + for (n=first; n != null; n = n.getNextSibling())
  148. + {
  149. + if ("cond".equalsIgnoreCase(n.getNodeName()))
  150. + {
  151. + Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  152. + Node msg = n.getAttributes().getNamedItem("msg");
  153. + if (condition != null && msg != null)
  154. + condition.setMessage(msg.getNodeValue());
  155. + _currentSkill.currentSkills.get(i).attach(condition,false);
  156. + }
  157. + if ("for".equalsIgnoreCase(n.getNodeName()))
  158. + {
  159. + parseTemplate(n, _currentSkill.currentSkills.get(i));
  160. + }
  161. + }
  162. _currentSkill.currentLevel = i-lastLvl;
  163. - boolean found = false;
  164. for (n=first; n != null; n = n.getNextSibling())
  165. {
  166. if ("enchant1cond".equalsIgnoreCase(n.getNodeName()))
  167. {
  168. - found = true;
  169. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  170. Node msg = n.getAttributes().getNamedItem("msg");
  171. if (condition != null && msg != null)
  172. condition.setMessage(msg.getNodeValue());
  173. _currentSkill.currentSkills.get(i).attach(condition,false);
  174. }
  175. if ("enchant1for".equalsIgnoreCase(n.getNodeName()))
  176. {
  177. - found = true;
  178. parseTemplate(n, _currentSkill.currentSkills.get(i));
  179. }
  180. }
  181. - // If none found, the enchanted skill will take effects from maxLvL of norm skill
  182. - if (!found)
  183. - {
  184. - _currentSkill.currentLevel = lastLvl-1;
  185. - for (n=first; n != null; n = n.getNextSibling())
  186. - {
  187. - if ("cond".equalsIgnoreCase(n.getNodeName()))
  188. - {
  189. - Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  190. - Node msg = n.getAttributes().getNamedItem("msg");
  191. - if (condition != null && msg != null)
  192. - condition.setMessage(msg.getNodeValue());
  193. - _currentSkill.currentSkills.get(i).attach(condition,false);
  194. - }
  195. - if ("for".equalsIgnoreCase(n.getNodeName()))
  196. - {
  197. - parseTemplate(n, _currentSkill.currentSkills.get(i));
  198. - }
  199. - }
  200. - }
  201. }
  202. for (int i=lastLvl+enchantLevels1; i < lastLvl+enchantLevels1+enchantLevels2; i++)
  203. {
  204. - boolean found = false;
  205. - _currentSkill.currentLevel = i-lastLvl-enchantLevels1;
  206. + _currentSkill.currentLevel = lastLvl-1;
  207. + for (n=first; n != null; n = n.getNextSibling())
  208. + {
  209. + if ("cond".equalsIgnoreCase(n.getNodeName()))
  210. + {
  211. + Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  212. + Node msg = n.getAttributes().getNamedItem("msg");
  213. + if (condition != null && msg != null)
  214. + condition.setMessage(msg.getNodeValue());
  215. + _currentSkill.currentSkills.get(i).attach(condition,false);
  216. + }
  217. + if ("for".equalsIgnoreCase(n.getNodeName()))
  218. + {
  219. + parseTemplate(n, _currentSkill.currentSkills.get(i));
  220. + }
  221. + }
  222. + _currentSkill.currentLevel = i-lastLvl-enchantLevels1;
  223. for (n=first; n != null; n = n.getNextSibling())
  224. {
  225. if ("enchant2cond".equalsIgnoreCase(n.getNodeName()))
  226. {
  227. - found = true;
  228. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  229. Node msg = n.getAttributes().getNamedItem("msg");
  230. if (condition != null && msg != null)
  231. condition.setMessage(msg.getNodeValue());
  232. _currentSkill.currentSkills.get(i).attach(condition,false);
  233. }
  234. if ("enchant2for".equalsIgnoreCase(n.getNodeName()))
  235. {
  236. - found = true;
  237. parseTemplate(n, _currentSkill.currentSkills.get(i));
  238. }
  239. - }
  240. - // If none found, the enchanted skill will take effects from maxLvL of norm skill
  241. - if(!found)
  242. - {
  243. - _currentSkill.currentLevel = lastLvl-1;
  244. - for (n=first; n != null; n = n.getNextSibling())
  245. - {
  246. - if ("cond".equalsIgnoreCase(n.getNodeName()))
  247. - {
  248. - Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  249. - Node msg = n.getAttributes().getNamedItem("msg");
  250. - if (condition != null && msg != null)
  251. - condition.setMessage(msg.getNodeValue());
  252. - _currentSkill.currentSkills.get(i).attach(condition,false);
  253. - }
  254. - if ("for".equalsIgnoreCase(n.getNodeName()))
  255. - {
  256. - parseTemplate(n, _currentSkill.currentSkills.get(i));
  257. - }
  258. - }
  259. }
  260. }
  261. _currentSkill.skills.addAll(_currentSkill.currentSkills);
  262. }
  263. Index: /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java
  264. ===================================================================
  265. --- /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java (revision 382)
  266. +++ /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java (revision 682)
  267. @@ -31,10 +31,11 @@
  268. import net.sf.l2j.gameserver.SevenSignsFestival;
  269. import net.sf.l2j.gameserver.ThreadPoolManager;
  270. import net.sf.l2j.gameserver.ai.CtrlIntention;
  271. import net.sf.l2j.gameserver.cache.HtmCache;
  272. import net.sf.l2j.gameserver.datatables.ClanTable;
  273. +import net.sf.l2j.gameserver.datatables.BuffTemplateTable;
  274. import net.sf.l2j.gameserver.datatables.HelperBuffTable;
  275. import net.sf.l2j.gameserver.datatables.ItemTable;
  276. import net.sf.l2j.gameserver.datatables.SkillTable;
  277. import net.sf.l2j.gameserver.datatables.SpawnTable;
  278. import net.sf.l2j.gameserver.idfactory.IdFactory;
  279. @@ -122,10 +123,11 @@
  280.  
  281. /** The castle index in the array of L2Castle this L2NpcInstance belongs to */
  282. private int _castleIndex = -2;
  283.  
  284. public boolean isEventMob = false;
  285. + public boolean isPrivateEventMob = false;
  286. public boolean _isEventMobDM = false;
  287. private boolean _isInTown = false;
  288.  
  289. private int _isSpoiledBy = 0;
  290.  
  291. @@ -1021,10 +1023,14 @@
  292. player.sendPacket(new SystemMessage(SystemMessageId.SELECT_THE_ITEM_FROM_WHICH_YOU_WISH_TO_REMOVE_AUGMENTATION));
  293. player.sendPacket(new ExShowVariationCancelWindow());
  294. break;
  295. }
  296. }
  297. + else if (command.startsWith("MakeBuffs"))
  298. + {
  299. + makeBuffs(player,command.substring(9).trim());
  300. + }
  301. else if (command.startsWith("npcfind_byid"))
  302. {
  303. try
  304. {
  305. L2Spawn spawn = SpawnTable.getInstance().getTemplate(Integer.parseInt(command.substring(12).trim()));
  306. @@ -1097,10 +1103,27 @@
  307.  
  308. if (!(item instanceof L2Weapon))
  309. return null;
  310.  
  311. return (L2Weapon)item;
  312. + }
  313. +
  314. + /**
  315. + * Throws an action command to L2BufferInstance.<br>
  316. + * @param player --> Target player
  317. + * @param buffTemplate --> Name of the Buff Template to Add
  318. + */
  319. + public void makeBuffs(L2PcInstance player, String buffTemplate)
  320. + {
  321. + int _templateId = 0;
  322. +
  323. + try
  324. + {_templateId = Integer.parseInt(buffTemplate);}
  325. + catch (NumberFormatException e)
  326. + {_templateId = BuffTemplateTable.getInstance().getTemplateIdByName(buffTemplate);}
  327. + if (_templateId>0)
  328. + {L2BufferInstance.makeBuffs(player, _templateId, this,true);}
  329. }
  330.  
  331. /**
  332. * Return null (regular NPCs don't have weapons instancies).<BR><BR>
  333. */
  334. Index: /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2EventManagerInstance.java
  335. ===================================================================
  336. --- /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2EventManagerInstance.java (revision 681)
  337. +++ /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2EventManagerInstance.java (revision 681)
  338. @@ -0,0 +1,225 @@
  339. +/*
  340. + * This program is free software; you can redistribute it and/or modify
  341. + * it under the terms of the GNU General Public License as published by
  342. + * the Free Software Foundation; either version 2, or (at your option)
  343. + * any later version.
  344. + *
  345. + * This program is distributed in the hope that it will be useful,
  346. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  347. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  348. + * GNU General Public License for more details.
  349. + *
  350. + * You should have received a copy of the GNU General Public License
  351. + * along with this program; if not, write to the Free Software
  352. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  353. + * 02111-1307, USA.
  354. + *
  355. + * http://www.gnu.org/copyleft/gpl.html
  356. + */
  357. +package net.sf.l2j.gameserver.model.actor.instance;
  358. +
  359. +import java.util.List;
  360. +import java.util.StringTokenizer;
  361. +import java.util.Vector;
  362. +
  363. +import net.sf.l2j.Config;
  364. +import net.sf.l2j.gameserver.model.entity.L2EventChecks;
  365. +import net.sf.l2j.gameserver.serverpackets.ActionFailed;
  366. +import net.sf.l2j.gameserver.serverpackets.ConfirmDlg;
  367. +import net.sf.l2j.gameserver.templates.L2NpcTemplate;
  368. +
  369. +/**
  370. + * This Class manages all the Requests to join a Raid Event.
  371. + *
  372. + * @author polbat02
  373. + */
  374. +public class L2EventManagerInstance extends L2NpcInstance
  375. +{
  376. + //Local Variables Definition
  377. + //--------------------------
  378. + /** Number of Current Events */
  379. + public static int _currentEvents = 0;
  380. + /** Players from which we're waiting an answer */
  381. + public static Vector<L2PcInstance> _awaitingplayers = new Vector<L2PcInstance>();
  382. + /** Players that will finally get inside the Event */
  383. + public static Vector<L2PcInstance> _finalPlayers = new Vector<L2PcInstance>();
  384. +
  385. + public L2EventManagerInstance(int objectId, L2NpcTemplate template)
  386. + {
  387. + super(objectId, template);
  388. + }
  389. +
  390. + public void onBypassFeedback(L2PcInstance player, String command)
  391. + {
  392. + player.sendPacket(new ActionFailed());
  393. + StringTokenizer st = new StringTokenizer(command, " ");
  394. + String actualCommand = st.nextToken();
  395. + _finalPlayers = new Vector<L2PcInstance>();
  396. +
  397. + if (actualCommand.equalsIgnoreCase("iEvent"))
  398. + {
  399. + try
  400. + {
  401. + /*Type:1- Single //2- Clan //3- Party*/
  402. + int type = Integer.parseInt(st.nextToken());
  403. + /*Required Event Points needed to participate*/
  404. + int eventPoints = Integer.parseInt(st.nextToken());
  405. + /* NpcId of the Event mobs */
  406. + int npcId = Integer.parseInt(st.nextToken());
  407. + /* Number of NPcs */
  408. + int npcAm =Integer.parseInt(st.nextToken());
  409. + /* Minimum number of needed persons players to participate */
  410. + int minPeople = Integer.parseInt(st.nextToken());
  411. + /* Minimum level to participate */
  412. + int minLevel = Integer.parseInt(st.nextToken());
  413. + /* Buff List to apply */
  414. + int bufflist = Integer.parseInt(st.nextToken());
  415. + /* Level of The Prize to Hand out */
  416. + int prizeLevel = Integer.parseInt(st.nextToken());
  417. + if (player == null){return;}
  418. + this.setTarget(player);
  419. +
  420. + if (_currentEvents>=Config.RAID_SYSTEM_MAX_EVENTS)
  421. + {
  422. + player.sendMessage("There's alredy "+_currentEvents+" events in progress. " +
  423. + "Wait untill one of them ends to get into another one.");
  424. + return;
  425. + }
  426. +
  427. + if (L2EventChecks.usualChecks(player,minLevel))
  428. + _finalPlayers.add(player);
  429. + else return;
  430. + // If the player has passed the checks, then continue.
  431. + switch (type)
  432. + {
  433. + // Case Clan Events.
  434. + case 2:
  435. + {
  436. + if(player.getClan()== null)
  437. + {
  438. + player.sendMessage("You Don't have a Clan!");
  439. + return;
  440. + }
  441. + L2PcInstance[] onlineclanMembers = player.getClan().getOnlineMembers("");
  442. + for (L2PcInstance member: onlineclanMembers)
  443. + {
  444. + boolean eligible = true;
  445. + if(member == null)
  446. + continue;
  447. + if(!L2EventChecks.usualChecks(member,minLevel))
  448. + eligible = false;
  449. + if(eligible && !(_finalPlayers.contains(member)))
  450. + _finalPlayers.add(member);
  451. + }
  452. + if (_finalPlayers.size()>1 && _finalPlayers.size()>=minPeople)
  453. + {
  454. + player.setRaidParameters(player,type,eventPoints,npcId,npcAm,minPeople,bufflist,prizeLevel,this, _finalPlayers);
  455. + _awaitingplayers.add(player);
  456. + player.sendPacket(new ConfirmDlg(614," A total of "+(_finalPlayers.size())+" members of your "
  457. + +" clan are Eligible for the event. Do you want to continue?"));
  458. + }
  459. + else
  460. + {
  461. + String reason;
  462. + if(_finalPlayers.size()>1)
  463. + reason =": Only 1 Clan Member Online.";
  464. + else if(_finalPlayers.size()<minPeople)
  465. + reason =": Not enough members online to participate.";
  466. + else reason=".";
  467. + player.sendMessage("Cannot participate"+reason);
  468. + }
  469. + break;
  470. + }
  471. + // Case Party Events.
  472. + case 3:
  473. + {
  474. + if(player.getParty()== null)
  475. + {
  476. + player.sendMessage("You DON'T have a Party!");
  477. + return;
  478. + }
  479. + List<L2PcInstance> partyMembers = player.getParty().getPartyMembers();
  480. + for (L2PcInstance member: partyMembers)
  481. + {
  482. + boolean eligible = true;
  483. + if(member == null)
  484. + continue;
  485. + if(!L2EventChecks.usualChecks(member,minLevel))
  486. + eligible = false;
  487. + if(eligible && !(_finalPlayers.contains(member)))
  488. + _finalPlayers.add(member);
  489. + }
  490. + if ((_finalPlayers.size())>1 && _finalPlayers.size()>=minPeople)
  491. + {
  492. + player.setRaidParameters(player,type,eventPoints,npcId,npcAm,minPeople,bufflist,prizeLevel,this, _finalPlayers);
  493. + _awaitingplayers.add(player);
  494. + player.sendPacket(new ConfirmDlg(614," A total of "+(_finalPlayers.size())+" members of your " +
  495. + "party are Eligible for the event. Do you want to continue?"));
  496. + }
  497. + else
  498. + {
  499. + String reason;
  500. + if(_finalPlayers.size()>1)
  501. + reason =": Only 1 Party Member.";
  502. + else if(_finalPlayers.size()<minPeople)
  503. + reason =": Not enough members to participate.";
  504. + else reason=".";
  505. + player.sendMessage("Cannot participate"+reason);
  506. + }
  507. + break;
  508. + }
  509. +
  510. + default:
  511. + {
  512. + player.setRaidParameters(player,type,eventPoints,npcId,npcAm,minPeople,bufflist,prizeLevel,this, _finalPlayers);
  513. + player.setRaidAnswear(1);
  514. + }
  515. + }
  516. + return;
  517. +
  518. + }
  519. + catch (Exception e)
  520. + {
  521. + _log.warning("L2EventManagerInstance: Error while getting html command");
  522. + e.printStackTrace();
  523. + }
  524. + }
  525. + super.onBypassFeedback(player, command);
  526. + }
  527. +
  528. + public String getHtmlPath(int npcId, int val)
  529. + {
  530. + String pom = "";
  531. + if (val == 0)
  532. + {
  533. + pom = "" + npcId;
  534. + }
  535. + else
  536. + {
  537. + pom = npcId + "-" + val;
  538. + }
  539. +
  540. + return "data/html/event/" + pom + ".htm";
  541. + }
  542. +
  543. + public static boolean addEvent()
  544. + {
  545. + if (_currentEvents>=Config.RAID_SYSTEM_MAX_EVENTS)
  546. + return false;
  547. + else
  548. + {
  549. + _currentEvents += 1;
  550. + return true;
  551. + }
  552. + }
  553. +
  554. + public static boolean removeEvent()
  555. + {
  556. + if(_currentEvents>0)
  557. + {
  558. + _currentEvents-=1;
  559. + return true;
  560. + }
  561. + else return false;
  562. + }
  563. +}
  564. Index: /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  565. ===================================================================
  566. --- /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 679)
  567. +++ /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 681)
  568. @@ -19,10 +19,11 @@
  569. package net.sf.l2j.gameserver.model.actor.instance;
  570.  
  571. import java.sql.PreparedStatement;
  572. import java.sql.ResultSet;
  573. import java.util.Calendar;
  574. +import java.util.Vector;
  575. import java.util.Collection;
  576. import java.util.Date;
  577. import java.util.LinkedList;
  578. import java.util.List;
  579. import java.util.Map;
  580. @@ -92,10 +93,12 @@
  581. import net.sf.l2j.gameserver.model.entity.DM;
  582. import net.sf.l2j.gameserver.model.L2DropData;
  583. import net.sf.l2j.gameserver.model.L2Effect;
  584. import net.sf.l2j.gameserver.model.L2Fishing;
  585. import net.sf.l2j.gameserver.model.L2HennaInstance;
  586. +import net.sf.l2j.gameserver.model.entity.L2EventChecks;
  587. +import net.sf.l2j.gameserver.model.entity.L2RaidEvent;
  588. import net.sf.l2j.gameserver.model.L2ItemInstance;
  589. import net.sf.l2j.gameserver.model.L2Macro;
  590. import net.sf.l2j.gameserver.model.L2ManufactureList;
  591. import net.sf.l2j.gameserver.model.L2Object;
  592. import net.sf.l2j.gameserver.model.L2Party;
  593. @@ -215,12 +218,12 @@
  594.  
  595. private static final String ADD_SKILL_SAVE = "INSERT INTO character_skills_save (char_obj_id,skill_id,skill_level,effect_count,effect_cur_time,reuse_delay,restore_type,class_index,buff_index) VALUES (?,?,?,?,?,?,?,?,?)";
  596. private static final String RESTORE_SKILL_SAVE = "SELECT skill_id,skill_level,effect_count,effect_cur_time, reuse_delay FROM character_skills_save WHERE char_obj_id=? AND class_index=? AND restore_type=? ORDER BY buff_index ASC";
  597. private static final String DELETE_SKILL_SAVE = "DELETE FROM character_skills_save WHERE char_obj_id=? AND class_index=?";
  598.  
  599. - private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,str=?,con=?,dex=?,_int=?,men=?,wit=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,maxload=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,in_jail=?,jail_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,donator=? WHERE obj_id=?";
  600. - private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,donator FROM characters WHERE obj_id=?";
  601. + private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,str=?,con=?,dex=?,_int=?,men=?,wit=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,maxload=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,in_jail=?,jail_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,donator=?, event_points=? WHERE obj_id=?";
  602. + private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,donator,event_points FROM characters WHERE obj_id=?";
  603. private static final String RESTORE_CHAR_SUBCLASSES = "SELECT class_id,exp,sp,level,class_index FROM character_subclasses WHERE char_obj_id=? ORDER BY class_index ASC";
  604. private static final String ADD_CHAR_SUBCLASS = "INSERT INTO character_subclasses (char_obj_id,class_id,exp,sp,level,class_index) VALUES (?,?,?,?,?,?)";
  605. private static final String UPDATE_CHAR_SUBCLASS = "UPDATE character_subclasses SET exp=?,sp=?,level=?,class_id=? WHERE char_obj_id=? AND class_index =?";
  606. private static final String DELETE_CHAR_SUBCLASS = "DELETE FROM character_subclasses WHERE char_obj_id=? AND class_index=?";
  607.  
  608. @@ -4251,10 +4254,15 @@
  609.  
  610. if (killer instanceof L2PcInstance)
  611. pk = (L2PcInstance) killer;
  612.  
  613. TvTEvent.onKill(killer, this);
  614. +
  615. + if (Config.RAID_SYSTEM_RESURRECT_PLAYER &&(inSoloEvent||inPartyEvent||inClanEvent))
  616. + {
  617. + L2RaidEvent.onPlayerDeath(this);
  618. + }
  619.  
  620. if (atEvent && pk != null)
  621. {
  622. pk.kills.add(getName());
  623. }
  624. @@ -5713,10 +5721,11 @@
  625. player.setPkKills(rset.getInt("pkkills"));
  626. player.setOnlineTime(rset.getLong("onlinetime"));
  627. player.setNewbie(rset.getInt("newbie")==1);
  628. player.setNoble(rset.getInt("nobless")==1);
  629. player.setdonator(rset.getInt("donator")==1);
  630. + player.setEventPoints(rset.getInt("event_points"));
  631.  
  632. player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time"));
  633. if (player.getClanJoinExpiryTime() < System.currentTimeMillis())
  634. {
  635. player.setClanJoinExpiryTime(0);
  636. @@ -6178,11 +6187,12 @@
  637. statement.setLong(53, getClanJoinExpiryTime());
  638. statement.setLong(54, getClanCreateExpiryTime());
  639. statement.setString(55, getName());
  640. statement.setLong(56, getDeathPenaltyBuffLevel());
  641. statement.setInt(57, isdonator() ? 1 : 0);
  642. - statement.setInt(58, getObjectId());
  643. + statement.setInt(58, getEventPoints());
  644. + statement.setInt(59, getObjectId());
  645.  
  646. statement.execute();
  647. statement.close();
  648. }
  649. catch (Exception e) { _log.warning("Could not store char base data: "+ e); }
  650. @@ -10724,6 +10734,83 @@
  651.  
  652. public void systemSendMessage(SystemMessageId id)
  653. {
  654. sendPacket(new SystemMessage(id));
  655. }
  656. +
  657. + /** Raid Event Parameters */
  658. + public boolean inClanEvent = false;
  659. + public boolean inPartyEvent = false;
  660. + public boolean inSoloEvent = false;
  661. + public boolean awaitingAnswer = false;
  662. + private int _event_points;
  663. + public static int eventType;
  664. + public static int eventPointsRequired;
  665. + public static int eventNpcId;
  666. + public static int eventNpcAmmount;
  667. + public static int eventMinPlayers;
  668. + public static int eventBufflist;
  669. + public static int eventRewardLevel;
  670. + public static L2Object eventEffector;
  671. + public static Vector<L2PcInstance> eventParticipatingPlayers;
  672. +
  673. + /** Raid Event Related Voids */
  674. + public void setEventPoints(int points)
  675. + {
  676. + _event_points = points;
  677. + }
  678. + public int getEventPoints()
  679. + {
  680. + return _event_points;
  681. + }
  682. +
  683. + /**
  684. + * Set Raid Event Parameters, this is needed to keep track of events while waiting for an answear from the Clan Leader.
  685. + * @param player
  686. + * @param type
  687. + * @param points
  688. + * @param npcId
  689. + * @param npcAm
  690. + * @param minPeople
  691. + * @param bufflist
  692. + * @param rewardLevel
  693. + * @param effector
  694. + * @param participatingPlayers
  695. + */
  696. + public void setRaidParameters(L2PcInstance player,int type,int points,int npcId,
  697. + int npcAm,int minPeople,int bufflist,int rewardLevel,L2Object effector,
  698. + Vector<L2PcInstance> participatingPlayers)
  699. + {
  700. + eventType = type;
  701. + eventPointsRequired = points;
  702. + eventNpcId = npcId;
  703. + eventNpcAmmount = npcAm;
  704. + eventMinPlayers = minPeople;
  705. + eventBufflist = bufflist;
  706. + eventRewardLevel = rewardLevel;
  707. + eventEffector = effector;
  708. + eventParticipatingPlayers = participatingPlayers;
  709. + }
  710. +
  711. + public void setRaidAnswear(int answer)
  712. + {
  713. + if (this == null)
  714. + return;
  715. + if(answer == 1)
  716. + {
  717. + if(L2EventChecks.checkPlayer(this,eventType,eventPointsRequired,eventMinPlayers,eventParticipatingPlayers))
  718. + {
  719. + L2RaidEvent event;
  720. + event = new L2RaidEvent(this,eventType,eventPointsRequired,eventNpcId,eventNpcAmmount,eventBufflist,eventRewardLevel,eventEffector,eventParticipatingPlayers);
  721. + sendMessage("You've choosen to continue the event with "+eventParticipatingPlayers+ "online Member/s.");
  722. + try
  723. + {Thread.sleep(5000);}
  724. + catch (InterruptedException e)
  725. + {e.printStackTrace();}
  726. + event.init();
  727. + }
  728. + }
  729. + else if (answer == 0)
  730. + sendMessage("You don't want to continue with the Event.");
  731. + else return;
  732. + }
  733. }
  734. Index: /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2BufferInstance.java
  735. ===================================================================
  736. --- /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2BufferInstance.java (revision 681)
  737. +++ /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2BufferInstance.java (revision 681)
  738. @@ -0,0 +1,160 @@
  739. +/* This program is free software; you can redistribute it and/or modify
  740. + * it under the terms of the GNU General Public License as published by
  741. + * the Free Software Foundation; either version 2, or (at your option)
  742. + * any later version.
  743. + *
  744. + * This program is distributed in the hope that it will be useful,
  745. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  746. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  747. + * GNU General Public License for more details.
  748. + *
  749. + * You should have received a copy of the GNU General Public License
  750. + * along with this program; if not, write to the Free Software
  751. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  752. + * 02111-1307, USA.
  753. + *
  754. + * http://www.gnu.org/copyleft/gpl.html
  755. + */
  756. +package net.sf.l2j.gameserver.model.actor.instance;
  757. +
  758. +import java.util.logging.Logger;
  759. +
  760. +import javolution.util.FastList;
  761. +
  762. +import net.sf.l2j.Config;
  763. +import net.sf.l2j.gameserver.datatables.BuffTemplateTable;
  764. +import net.sf.l2j.gameserver.model.L2Character;
  765. +import net.sf.l2j.gameserver.model.L2Effect;
  766. +import net.sf.l2j.gameserver.model.L2Object;
  767. +import net.sf.l2j.gameserver.model.L2Skill.SkillTargetType;
  768. +import net.sf.l2j.gameserver.model.L2Skill;
  769. +import net.sf.l2j.gameserver.model.L2Skill.SkillType;
  770. +import net.sf.l2j.gameserver.network.SystemMessageId;
  771. +import net.sf.l2j.gameserver.serverpackets.MagicSkillUser;
  772. +import net.sf.l2j.gameserver.serverpackets.SystemMessage;
  773. +import net.sf.l2j.gameserver.templates.L2BuffTemplate;
  774. +
  775. +public class L2BufferInstance
  776. +{
  777. + static L2PcInstance selfBuffer;
  778. + static L2NpcInstance npcBuffer;
  779. +
  780. + /**
  781. + * Apply Buffs onto a player.
  782. + * @param player
  783. + * @param _templateId
  784. + * @param efector
  785. + * @param paymentRequired
  786. + */
  787. + public static void makeBuffs(L2PcInstance player, int _templateId, L2Object efector,boolean paymentRequired)
  788. + {
  789. + if (player == null)
  790. + return;
  791. + getbufferType(efector).setTarget(player);
  792. +
  793. + FastList<L2BuffTemplate> _templateBuffs = new FastList<L2BuffTemplate>();
  794. + _templateBuffs = BuffTemplateTable.getInstance().getBuffTemplate(_templateId);
  795. +
  796. + if (_templateBuffs == null || _templateBuffs.size() == 0)
  797. + return;
  798. +
  799. + int _priceTotal = 0;
  800. + int _pricePoints =0;
  801. +
  802. + for (L2BuffTemplate _buff:_templateBuffs)
  803. + {
  804. + if (paymentRequired)
  805. + {
  806. + if(!_buff.checkPrice(player))
  807. + {
  808. + player.sendMessage("Not enough Adena");
  809. + return;
  810. + }
  811. + if(!_buff.checkPoints(player))
  812. + {
  813. + player.sendMessage("Not enough Event Points");
  814. + return;
  815. + }
  816. + }
  817. +
  818. + getbufferType(efector).setTarget(player);
  819. +
  820. + if ( _buff.checkPlayer(player) && _buff.checkPrice(player))
  821. + {
  822. + if (player.getInventory().getAdena() >= (_priceTotal + _buff.getAdenaPrice())
  823. + && player.getEventPoints()>=_buff.getPointsPrice())
  824. + {
  825. + _priceTotal+=_buff.getAdenaPrice();
  826. + _pricePoints+=_buff.getPointsPrice();
  827. + if (_buff.forceCast() || (_buff.getSkill()) == null)
  828. + {
  829. + // regeneration ^^
  830. +
  831. + player.setCurrentHpMp(player.getMaxHp()+5000, player.getMaxMp()+5000);
  832. + /*
  833. + * Mensaje informativo al cliente sobre los buffs dados.
  834. + */
  835. + SystemMessage sm = new SystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
  836. + sm.addSkillName(_buff.getSkill().getId());
  837. + player.sendPacket(sm);
  838. + sm = null;
  839. + if (_buff.getSkill().getTargetType() == SkillTargetType.TARGET_SELF)
  840. + {
  841. + // Ignora el tiempo de casteo del skill, hay unos 100ms de animacion de casteo
  842. + MagicSkillUser msu = new MagicSkillUser(player, player, _buff.getSkill().getId(), _buff.getSkill().getLevel(), 100, 0);
  843. + player.broadcastPacket(msu);
  844. +
  845. + for (L2Effect effect : _buff.getSkill().getEffectsSelf(player))
  846. + {
  847. + player.addEffect(effect);
  848. + }
  849. + // newbie summons
  850. + if (_buff.getSkill().getSkillType() == SkillType.SUMMON)
  851. + {
  852. + player.doCast(_buff.getSkill());
  853. + }
  854. + }
  855. + else
  856. + { // Ignora el tiempo de casteo del skill, hay unos 5ms de animacion de casteo
  857. + MagicSkillUser msu = new MagicSkillUser(getbufferType(efector), player, _buff.getSkill().getId(), _buff.getSkill().getLevel(), 5, 0);
  858. + player.broadcastPacket(msu);
  859. + }
  860. +
  861. + for (L2Effect effect : _buff.getSkill().getEffects(getbufferType(efector), player))
  862. + {
  863. + player.addEffect(effect);
  864. + }
  865. + try{
  866. + Thread.sleep(50);
  867. + }catch (Exception e) {}
  868. + }
  869. + }
  870. + }
  871. + }
  872. + if (paymentRequired &&(_pricePoints>0 ||_priceTotal>0))
  873. + {
  874. + if(_pricePoints>0)
  875. + {
  876. + int previousPoints = player.getEventPoints();
  877. + player.setEventPoints(player.getEventPoints()-_pricePoints);
  878. + player.sendMessage("You had "+previousPoints+" Event Points, and now you have "+ player.getEventPoints()+" Event Points.");
  879. + }
  880. + if (_priceTotal>0)
  881. + player.reduceAdena("NpcBuffer", _priceTotal, player.getLastFolkNPC(), true);
  882. + }
  883. + }
  884. + private static L2Character getbufferType(L2Object efector)
  885. + {
  886. + if (efector instanceof L2PcInstance)
  887. + {
  888. + selfBuffer = ((L2PcInstance)efector);
  889. + efector = selfBuffer;
  890. + }
  891. + if (efector instanceof L2NpcInstance)
  892. + {
  893. + npcBuffer = ((L2NpcInstance)efector);
  894. + efector = npcBuffer;
  895. + }
  896. + return (L2Character) efector;
  897. + }
  898. + static Logger _log = Logger.getLogger(Config.class.getName());
  899. +}
  900. Index: /trunk/Game/java/net/sf/l2j/gameserver/model/L2Attackable.java
  901. ===================================================================
  902. --- /trunk/Game/java/net/sf/l2j/gameserver/model/L2Attackable.java (revision 253)
  903. +++ /trunk/Game/java/net/sf/l2j/gameserver/model/L2Attackable.java (revision 681)
  904. @@ -34,10 +34,11 @@
  905. import net.sf.l2j.gameserver.ai.L2SiegeGuardAI;
  906. import net.sf.l2j.gameserver.clientpackets.Say2;
  907. import net.sf.l2j.gameserver.datatables.EventDroplist;
  908. import net.sf.l2j.gameserver.datatables.ItemTable;
  909. import net.sf.l2j.gameserver.datatables.EventDroplist.DateDrop;
  910. +import net.sf.l2j.gameserver.model.entity.L2RaidEvent;
  911. import net.sf.l2j.gameserver.instancemanager.CursedWeaponsManager;
  912. import net.sf.l2j.gameserver.model.actor.instance.L2BossInstance;
  913. import net.sf.l2j.gameserver.model.actor.instance.L2DoorInstance;
  914. import net.sf.l2j.gameserver.model.actor.instance.L2FolkInstance;
  915. import net.sf.l2j.gameserver.model.actor.instance.L2MinionInstance;
  916. @@ -623,10 +624,22 @@
  917.  
  918. // Check for an over-hit enabled strike
  919. if (attacker instanceof L2PcInstance)
  920. {
  921. L2PcInstance player = (L2PcInstance)attacker;
  922. +
  923. + if (this.isPrivateEventMob)
  924. + {
  925. + L2RaidEvent.expHandOut();
  926. + exp = L2RaidEvent.exp;
  927. + sp = L2RaidEvent.sp;
  928. + if (L2RaidEvent.checkPossibleReward())
  929. + {
  930. + L2RaidEvent.chooseReward(player);
  931. + }
  932. + this.deleteMe();
  933. + }
  934. if (isOverhit() && attacker == getOverhitAttacker())
  935. {
  936. player.sendPacket(new SystemMessage(SystemMessageId.OVER_HIT));
  937. exp += calculateOverhitExp(exp);
  938. }
  939. @@ -739,10 +752,21 @@
  940. // Check for an over-hit enabled strike
  941. // (When in party, the over-hit exp bonus is given to the whole party and splitted proportionally through the party members)
  942. if (attacker instanceof L2PcInstance)
  943. {
  944. L2PcInstance player = (L2PcInstance)attacker;
  945. + if (this.isPrivateEventMob)
  946. + {
  947. + L2RaidEvent.expHandOut();
  948. + exp = L2RaidEvent.exp;
  949. + sp = L2RaidEvent.sp;
  950. + if (L2RaidEvent.checkPossibleReward())
  951. + {
  952. + L2RaidEvent.chooseReward(player);
  953. + }
  954. + this.deleteMe();
  955. + }
  956. if (isOverhit() && attacker == getOverhitAttacker())
  957. {
  958. player.sendPacket(new SystemMessage(SystemMessageId.OVER_HIT));
  959. exp += calculateOverhitExp(exp);
  960. }
  961. Index: /trunk/Game/java/net/sf/l2j/gameserver/model/entity/L2EventChecks.java
  962. ===================================================================
  963. --- /trunk/Game/java/net/sf/l2j/gameserver/model/entity/L2EventChecks.java (revision 681)
  964. +++ /trunk/Game/java/net/sf/l2j/gameserver/model/entity/L2EventChecks.java (revision 681)
  965. @@ -0,0 +1,179 @@
  966. +package net.sf.l2j.gameserver.model.entity;
  967. +
  968. +import java.util.Vector;
  969. +
  970. +import net.sf.l2j.gameserver.model.L2Effect;
  971. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  972. +
  973. +
  974. +public class L2EventChecks
  975. +{
  976. + /**
  977. + * CheckIfOtherEvent --> Checks if the player is already inscribed in another event.
  978. + */
  979. + private static boolean checkIfOtherEvent (L2PcInstance player)
  980. + {
  981. + if (player.inSoloEvent||player.inPartyEvent||player.inClanEvent)
  982. + {
  983. + player.sendMessage("You're alredy registered in another event.");
  984. + return true;
  985. + }
  986. + return false;
  987. + }
  988. +
  989. + /**
  990. + * Check if Player/Clan/Party is eligible for Event.<br>
  991. + * Documentation can be found in the method.<br>
  992. + * @param player --> Basic Player Taking the action.
  993. + * @param eventType --> Type of Event to check.
  994. + * @param points --> Minimum Event Points Required to participate.
  995. + * @param minPeople --> Minimum allowed People Required to participate.
  996. + * @return --> True for Eligible Players and False for UnEligible Players.
  997. + */
  998. + public static boolean checkPlayer(L2PcInstance player,int eventType,int points, int minPeople, Vector<L2PcInstance>_eventPlayers)
  999. + {
  1000. + int eventPoints = 0;
  1001. + //Let's avoid NPEs
  1002. + if (player == null)
  1003. + return false;
  1004. + //If there's not enough clan members online to fill the MinPeople requirement
  1005. + //return false.
  1006. + if (_eventPlayers.size()<=minPeople && eventType == (2|3))
  1007. + {
  1008. + //Notify to the requester.
  1009. + player.sendMessage("Not enough "+eType(eventType)+" members of the connected at this mommtent, try again later.");
  1010. + return false;
  1011. + }
  1012. + for (L2PcInstance member : _eventPlayers)
  1013. + {
  1014. + /*
  1015. + * In case of finding a disconnected player, we will continue the for statement.
  1016. + */
  1017. + if (member == null)
  1018. + continue;
  1019. + //Let's check if any of the members is in another Event.
  1020. + if(checkIfOtherEvent(member))
  1021. + {
  1022. + /* If this is the case, we will notify the request instance about the inconvenience produced.
  1023. + * We will also return a false.*/
  1024. + String badRequestor = member.getName();
  1025. + notifyBadRequestor(player,badRequestor,2,_eventPlayers);
  1026. + return false;
  1027. + }
  1028. +
  1029. + // TODO: Add a Check asking members of the clan/party (ONLY) ACTUALLY WANT TO PARTICIPATE or not.
  1030. +
  1031. + /* Let's count all the points for every one of the event members, only in the case that
  1032. + * the request instance and the Clan Members are from the same clan */
  1033. + switch(eventType)
  1034. + {
  1035. + case 2:
  1036. + {
  1037. + if(_eventPlayers.contains(player) && member.getClan().getName().equals(player.getClan().getName()))
  1038. + eventPoints +=member.getEventPoints();
  1039. + break;
  1040. + }
  1041. + case 3:
  1042. + {
  1043. + //Let's add the points of each member to the Party General Clan Score.
  1044. + eventPoints += member.getEventPoints();
  1045. + break;
  1046. + }
  1047. + default:
  1048. + {
  1049. + eventPoints = member.getEventPoints();
  1050. + break;
  1051. + }
  1052. + }
  1053. + }
  1054. + /* If the addition of all the points is bigger than the requested points, we will accept
  1055. + * the Participation of this clan in the event */
  1056. + if (eventPoints>=points)
  1057. + {
  1058. + for (L2PcInstance member : _eventPlayers)
  1059. + {
  1060. + // Deletion of all the Buffs from all the Clan members
  1061. + for (L2Effect effect : member.getAllEffects())
  1062. + {
  1063. + if (effect != null)
  1064. + effect.exit();
  1065. + }
  1066. + }
  1067. + return true;
  1068. + }
  1069. + //Else The Clan doesn't have enough event points to participate.
  1070. + else if (eventType != 1)
  1071. + {
  1072. + player.sendMessage("The totality of your "+eType(eventType)+" members don't have enough Event Points to participate.");
  1073. + return false;
  1074. + }
  1075. + else
  1076. + {
  1077. + player.sendMessage("Not enough Event Points to participate into the Event.");
  1078. + return false;
  1079. + }
  1080. + }
  1081. + /**
  1082. + * notifyOfBadRequestor --> Tell the members of the Clan/Party that the player is already inscribed in another event.
  1083. + */
  1084. + private static void notifyBadRequestor(L2PcInstance player, String badRequestor, int type, Vector<L2PcInstance>_eventPlayers)
  1085. + {
  1086. + if (type == 2)
  1087. + {
  1088. + for (L2PcInstance member : _eventPlayers)
  1089. + {
  1090. + member.sendMessage("You can't access the event while "+badRequestor+ "is singed up for another event.");
  1091. + }
  1092. + }
  1093. + if (type ==3)
  1094. + {
  1095. + for (L2PcInstance member : _eventPlayers)
  1096. + {
  1097. + member.sendMessage("You can't access the event while "+badRequestor+ "is singed up for another event.");
  1098. + }
  1099. + }
  1100. + }
  1101. +
  1102. + public static boolean usualChecks(L2PcInstance player, int minLevel)
  1103. + {
  1104. + if(player.getLevel()<minLevel)
  1105. + {
  1106. + player.sendMessage("The minimum level to participate in this Event is "+minLevel+". You cannot participate.");
  1107. + return false;
  1108. + }
  1109. + if (player.inClanEvent || player.inPartyEvent || player.inSoloEvent)
  1110. + {
  1111. + player.sendMessage("You're alredy registered in another Event.");
  1112. + return false;
  1113. + }
  1114. + if (player.isCursedWeaponEquiped())
  1115. + {
  1116. + player.sendMessage("You can Not register while Having a Cursed Weapon.");
  1117. + return false;
  1118. + }
  1119. + if (player.isInStoreMode())
  1120. + {
  1121. + player.sendMessage("Cannot Participate while in Store Mode.");
  1122. + return false;
  1123. + }
  1124. + if (player.isInJail())
  1125. + {
  1126. + player.sendMessage("Cannot Participate while in Jail.");
  1127. + return false;
  1128. + }
  1129. + return true;
  1130. + }
  1131. +
  1132. + public static String eType(int type)
  1133. + {
  1134. + String sType;
  1135. + if(type == 1)
  1136. + sType ="Single";
  1137. + else if(type == 2)
  1138. + sType ="Clan";
  1139. + else if(type == 3)
  1140. + sType="Party";
  1141. + else sType="error ocurred while getting type of Event.";
  1142. + return sType;
  1143. + }
  1144. +}
  1145. Index: /trunk/Game/java/net/sf/l2j/gameserver/model/entity/L2RaidEvent.java
  1146. ===================================================================
  1147. --- /trunk/Game/java/net/sf/l2j/gameserver/model/entity/L2RaidEvent.java (revision 681)
  1148. +++ /trunk/Game/java/net/sf/l2j/gameserver/model/entity/L2RaidEvent.java (revision 681)
  1149. @@ -0,0 +1,1047 @@
  1150. +/*
  1151. + * This program is free software; you can redistribute it and/or modify
  1152. + * it under the terms of the GNU General Public License as published by
  1153. + * the Free Software Foundation; either version 2, or (at your option)
  1154. + * any later version.
  1155. + *
  1156. + * This program is distributed in the hope that it will be useful,
  1157. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1158. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1159. + * GNU General Public License for more details.
  1160. + *
  1161. + * You should have received a copy of the GNU General Public License
  1162. + * along with this program; if not, write to the Free Software
  1163. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  1164. + * 02111-1307, USA.
  1165. + *
  1166. + * http://www.gnu.org/copyleft/gpl.html
  1167. + */
  1168. +package net.sf.l2j.gameserver.model.entity;
  1169. +
  1170. +import java.sql.Connection;
  1171. +import java.sql.PreparedStatement;
  1172. +import java.sql.ResultSet;
  1173. +import java.util.Vector;
  1174. +import java.util.logging.Logger;
  1175. +
  1176. +import javolution.text.TextBuilder;
  1177. +import net.sf.l2j.Config;
  1178. +import net.sf.l2j.L2DatabaseFactory;
  1179. +import net.sf.l2j.gameserver.datatables.ItemTable;
  1180. +import net.sf.l2j.gameserver.datatables.NpcTable;
  1181. +import net.sf.l2j.gameserver.datatables.SpawnTable;
  1182. +import net.sf.l2j.gameserver.instancemanager.RaidBossSpawnManager;
  1183. +import net.sf.l2j.gameserver.model.L2Object;
  1184. +import net.sf.l2j.gameserver.model.L2Spawn;
  1185. +import net.sf.l2j.gameserver.model.PcInventory;
  1186. +import net.sf.l2j.gameserver.model.actor.instance.L2BufferInstance;
  1187. +import net.sf.l2j.gameserver.model.actor.instance.L2EventManagerInstance;
  1188. +import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;
  1189. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1190. +import net.sf.l2j.gameserver.network.SystemMessageId;
  1191. +import net.sf.l2j.gameserver.serverpackets.ItemList;
  1192. +import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;
  1193. +import net.sf.l2j.gameserver.serverpackets.StatusUpdate;
  1194. +import net.sf.l2j.gameserver.serverpackets.SystemMessage;
  1195. +import net.sf.l2j.gameserver.templates.L2NpcTemplate;
  1196. +
  1197. +/**
  1198. + * This Class implements and Manages All Raid Events.<br>
  1199. + *
  1200. + * @author polbat02
  1201. + */
  1202. +public class L2RaidEvent
  1203. +{
  1204. + //Local Variables Definition
  1205. + //--------------------------
  1206. + protected static final Logger _log = Logger.getLogger(L2RaidEvent.class.getName());
  1207. + /**
  1208. + * Definition of the Event Mob Spawn
  1209. + */
  1210. +
  1211. + private static L2PcInstance _player;
  1212. + private static L2Spawn _npcSpawn = null;
  1213. + /**
  1214. + * Definition of the Spawn as a L2NpcInstance
  1215. + */
  1216. + private static L2NpcInstance _lastNpcSpawn = null;
  1217. + /**
  1218. + * Custom Management of Experience upon NPC death.
  1219. + */
  1220. + public static int exp = 0;
  1221. + /**
  1222. + * Custom Management of SP upon NPC death.
  1223. + */
  1224. + public static int sp = 0;
  1225. +
  1226. + /**
  1227. + * <b>Event Type:</b><br>
  1228. + * 1- Solo Event (Single player)<br>
  1229. + * 2- Clan Event<br>
  1230. + * 3- Party Event<br>
  1231. + */
  1232. + public static int _eventType;
  1233. + /**
  1234. + * Number Of Event Mobs.
  1235. + */
  1236. + private static int _eventMobs = 0;
  1237. + /**
  1238. + * Reward Level: According to this reward level the players will be
  1239. + * congratulated with different prizes.
  1240. + */
  1241. + private static int _rewardLevel;
  1242. + /**
  1243. + * Transport Locations
  1244. + */
  1245. + private static int _locX,_locY,_locZ,_pX,_pY,_pZ;
  1246. +
  1247. + /**
  1248. + * NPC spawn positions
  1249. + */
  1250. + private static int _npcX,_npcY,_npcZ;
  1251. +
  1252. + /**
  1253. + * DataBase Prize Parameters
  1254. + */
  1255. + private static int _first_id,_first_ammount,_second_id,_second_ammount,_event_ammount;
  1256. +
  1257. + /** Event points Required*/
  1258. + private static int _points;
  1259. +
  1260. + /** NPC ID */
  1261. + private static int _npcId;
  1262. +
  1263. + /** NPC Ammount */
  1264. + private static int _npcAm;
  1265. +
  1266. + /** BuffList */
  1267. + private static int _bufflist;
  1268. +
  1269. + /** BUFFER */
  1270. + private static L2Object _effector;
  1271. +
  1272. + /**
  1273. + * Vector Created to add Single/Party/Clan Players onto the event.
  1274. + * TODO: Use this vector also to add another kind of event --> free Event with any player that may want to participate.
  1275. + */
  1276. + public static Vector<L2PcInstance> _participatingPlayers = new Vector<L2PcInstance>();
  1277. +
  1278. + /**
  1279. + * Players from whom we're waiting for an answer in order to know it they want to join the event.
  1280. + */
  1281. + public static Vector<L2PcInstance> _awaitingplayers = new Vector<L2PcInstance>();
  1282. + /**
  1283. + * Vector Created to track all the Event Mobs and Delete them if needed.
  1284. + */
  1285. + public static Vector<L2NpcInstance> _eventMobList = new Vector<L2NpcInstance>();
  1286. +
  1287. + /** The state of the Event<br> */
  1288. + private static EventState _state = EventState.INACTIVE;
  1289. +
  1290. + enum EventState
  1291. + {
  1292. + INACTIVE,
  1293. + STARTING,
  1294. + STARTED,
  1295. + PARTICIPATING,
  1296. + REWARDING,
  1297. + INACTIVATING
  1298. + }
  1299. +
  1300. + /**
  1301. + * CONSTRUCTOR:<br>
  1302. + * This is the start of the Event, defined from HTM files.<br>
  1303. + * Documentation can be found in the method.<br>
  1304. + * @param player --> Player taking the action on the Event Manager.
  1305. + * @param type --> Type of Event: 1: Single Event || 2: Clan Event || 3: Party Event
  1306. + * @param points --> Event Points Required to start event.
  1307. + * @param npcId --> Id of the Event Raid/Mob
  1308. + * @param npcAm --> Amount of Mobs
  1309. + * @param minPeople --> Minimum People required to run event (Only functional on Clan and Party Events)
  1310. + * @param bufflist --> BuffList to apply to the player. Defined in the SQL table buff_templates
  1311. + * @param rewardLevel --> Reward level to apply upon player's victory.
  1312. + * @param effector --> Effector of the Buffs (Previously defined in L2EventMAnagerInstance.java)
  1313. + * @param participatingPlayers --> Players Enrolled in the Event.
  1314. + */
  1315. + public L2RaidEvent(L2PcInstance player,int type,int points,int npcId,int npcAm,int bufflist,
  1316. + int rewardLevel,L2Object effector,Vector<L2PcInstance> participatingPlayers)
  1317. + {
  1318. + // Define the actual coordinates of the Player.
  1319. + _player = player;
  1320. + _pX = player.getClientX();
  1321. + _pY = player.getClientY();
  1322. + _pZ = player.getClientZ();
  1323. + _eventType = type;
  1324. + _points = points;
  1325. + _npcId = npcId;
  1326. + _npcAm = npcAm;
  1327. + _bufflist = bufflist;
  1328. + _rewardLevel = rewardLevel;
  1329. + _effector = effector;
  1330. + _participatingPlayers = participatingPlayers;
  1331. + }
  1332. +
  1333. + /** Event Initialization given the Constructor defined variables.*/
  1334. + public void init()
  1335. + {
  1336. + setState(EventState.STARTING);
  1337. + //Increase the number of Current Events.
  1338. + if(!L2EventManagerInstance.addEvent())
  1339. + return;
  1340. + //Set the coordinates for the Event.
  1341. + if (setCoords(_player));
  1342. + else{L2EventManagerInstance.removeEvent();
  1343. + return;}
  1344. + _log.warning("RaidEngine [setCoords]: Players: "+_locX+", "+_locY+", "+_locZ);
  1345. + //Set Player inEvent
  1346. + setInEvent(_player);
  1347. + //Initialize event.
  1348. + startEvent(_player, _npcId, _npcAm);
  1349. + //Call the Function required to buff the player.
  1350. + buffEventMembers(_player,_points, _bufflist,_effector);
  1351. + return;
  1352. + }
  1353. +
  1354. + /**
  1355. + * Sets the spawn positions for the players in each event
  1356. + */
  1357. + private static boolean setCoords(L2PcInstance player)
  1358. + {
  1359. + int _ce = L2EventManagerInstance._currentEvents;
  1360. + if (_ce == 0 || (_ce>Config.RAID_SYSTEM_MAX_EVENTS))
  1361. + {
  1362. + String reason = null;
  1363. + if (_ce == 0)
  1364. + reason = "Current Events = 0.";
  1365. + else if(_ce>Config.RAID_SYSTEM_MAX_EVENTS)
  1366. + reason = "Too many Events going on";
  1367. + player.sendMessage("Raid Engines [setCoords()]: Error while setting spawn positions for players and Monsters. Reason: "+reason);
  1368. + return false;
  1369. + }
  1370. + else
  1371. + {
  1372. + loadSpawns(_ce);
  1373. + return true;
  1374. + }
  1375. + }
  1376. +
  1377. + /**
  1378. + * We will set the player/party Member in an Event Status.<br>
  1379. + * This way we will also make sure they don't enroll in any other event.<br>
  1380. + * @param player --> Player to set in an Event Status
  1381. + * @param type --> Type of event to be set In.
  1382. + */
  1383. + private synchronized void setInEvent(L2PcInstance player)
  1384. + {
  1385. + // Check if the type of event is defined.
  1386. + if (_eventType != 1 && _eventType != 2 && _eventType != 3)
  1387. + {
  1388. + player.sendMessage("Debug: Error in The event type [Function: setInEvent]");
  1389. + _log.warning("Event Manager: Error! Event not defined! [Function setInEvent]");
  1390. + return;
  1391. + }
  1392. + for (L2PcInstance member: _participatingPlayers)
  1393. + {
  1394. + if (member == null)
  1395. + continue;
  1396. + switch(_eventType){
  1397. + case 1:{member.inSoloEvent = true;
  1398. + break;}
  1399. + case 2:{member.inClanEvent = true;
  1400. + break;}
  1401. + case 3:{member.inPartyEvent = true;
  1402. + break;}
  1403. + default:return;}
  1404. + member.sendMessage("Event Manager: You are now enroled in a "+L2EventChecks.eType(_eventType)+" Type of Event.");
  1405. + }
  1406. + }
  1407. +
  1408. + /**
  1409. + * <b>Let's Apply the Buffs to the Event Members</b>
  1410. + * <li> We don't need to check if the player can or can not have access to the buffing state since it has
  1411. + * previously been checked.
  1412. + * <li> We assign a value of previousEventPoints to notify the player.
  1413. + * <li> Apply the buffs.
  1414. + * <li> Notify the player once he/she has gotten the Buffs.
  1415. + * <br>More Documentation can Be found inside the method's code.<br>
  1416. + * We will apply the buffs previous to the Event following the parameters:
  1417. + * @param player --> Player participating in the Event.
  1418. + * @param eventPoints --> Event points to be deduced once the buffing takes place.
  1419. + * @param buffList --> Buff list from where the buffs will be taken.
  1420. + * @param efector --> Eefector taking the action (in this case NPC).
  1421. + * @param eventType --> Type of Event.
  1422. + */
  1423. + private synchronized static void buffEventMembers(L2PcInstance player, int eventPoints, int buffList, L2Object efector)
  1424. + {
  1425. + /* Check if the event type has been defined.
  1426. + * Once the event is fully functional this checks will be taken out */
  1427. + if (_eventType!=1&&_eventType!=2&&_eventType!=3)
  1428. + {
  1429. + player.sendMessage("Debug: Error in The event type [Function: bufEventMembers]");
  1430. + _log.warning("Se corta la funcion de entrega de buffs.");
  1431. + return;
  1432. + }
  1433. + //Single event --> Direct Buffing.
  1434. + if (_eventType == 1)
  1435. + {
  1436. + int previousPoints =player.getEventPoints();
  1437. + if (Config.RAID_SYSTEM_GIVE_BUFFS)
  1438. + L2BufferInstance.makeBuffs(player,buffList,efector,false);
  1439. + player.setEventPoints(player.getEventPoints()-eventPoints);
  1440. + player.sendMessage("Event Manager: "+eventPoints+" Event Points have Been used. " +
  1441. + "You had "+previousPoints+" and now you have "+player.getEventPoints()+ "Event Points.");
  1442. + }
  1443. + // Clan Event: Let's buff all the clan members...
  1444. + // TODO: Check if the distance of other clan members is important upon member buffing.
  1445. + if (_eventType == 2)
  1446. + {
  1447. + // Define HOW many players are online at this very moment.
  1448. + int cmCount = _participatingPlayers.size();
  1449. + // Define the individual Event Points Price for every player.
  1450. + int individualPrice = eventPoints/cmCount;
  1451. + // Round up the price
  1452. + //individualPrice = Math.round(individualPrice);
  1453. + //Start the Buffing.
  1454. + for (L2PcInstance member: _participatingPlayers)
  1455. + {
  1456. + // Define the previous points for each member of the clan.
  1457. + int previousPoints;
  1458. + if (member == null)
  1459. + continue;
  1460. + // Apply the Buffs if allowed
  1461. + if (Config.RAID_SYSTEM_GIVE_BUFFS)
  1462. + L2BufferInstance.makeBuffs(member,buffList,efector,false);
  1463. + /*
  1464. + * In this case we will generate an HTML to notify the member of the action taken.
  1465. + * 1. In the first case, we will check if the subject has enough Event Points as to pay the Buffs,
  1466. + * and enroll into the event.
  1467. + * 2. If that's not the case we will proceed into the first IF:
  1468. + * 2a. The even points will be replaced by 0 since the player doesn't have enough event points
  1469. + * to pay the normal quota.
  1470. + * 2b. We will notify him of this situation. We will also deduce the missing points
  1471. + * from other Clan Members. (Sharing is good right? xD)
  1472. + * 3. If 1 is Affirmative we will proceed onto the second IF:
  1473. + * 3a. Deduction of event points = to what's needed to participate in the event/online
  1474. + * clan members.
  1475. + * 3b. Notify this situation and inform the player of the amount of points that he/she has at
  1476. + * this very moment.
  1477. + */
  1478. + if (individualPrice>member.getEventPoints())
  1479. + {
  1480. + previousPoints = member.getEventPoints();
  1481. + member.setEventPoints(0);
  1482. + NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  1483. + TextBuilder replyMSG = new TextBuilder("<html><body>");
  1484. + replyMSG.append("<tr><td>A total of "+eventPoints+" points have been deduced from your party TOTAL Event Point Score.</td></tr><br>");
  1485. + replyMSG.append("<tr><td>You didn't have enough Event Points, so we've used all of your points.</td></tr><br>");
  1486. + replyMSG.append("<tr><td>You had "+previousPoints+", and we needed "+individualPrice+" points.</td></tr><br><br><br>");
  1487. + replyMSG.append("<tr><td>Developed by: polbat02 for the L2J community.</td></tr>");
  1488. + replyMSG.append("</body></html>");
  1489. + adminReply.setHtml(replyMSG.toString());
  1490. + member.sendPacket(adminReply);
  1491. + }
  1492. + else
  1493. + {
  1494. + previousPoints = member.getEventPoints();
  1495. + member.setEventPoints(member.getEventPoints()-individualPrice);
  1496. + NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  1497. + TextBuilder replyMSG = new TextBuilder("<html><body>");
  1498. + replyMSG.append("<tr><td>A total of "+eventPoints+" points have been deduced from your party TOTAL Event Point Score.</td></tr><br>");
  1499. + replyMSG.append("<tr><td>You had "+previousPoints+", and now you have "+(previousPoints-individualPrice)+" points.</td></tr><br><br><br>");
  1500. + replyMSG.append("<tr><td>Developed by: polbat02 for the L2J community.</td></tr>");
  1501. + replyMSG.append("</body></html>");
  1502. + adminReply.setHtml(replyMSG.toString());
  1503. + member.sendPacket(adminReply);
  1504. + }
  1505. + }
  1506. + }
  1507. + // Party Event --> The same action as in Clan Events Will be taken.
  1508. + if (_eventType == 3)
  1509. + {
  1510. + int pmCount = player.getParty().getMemberCount();
  1511. + int individualPrice = eventPoints/pmCount;
  1512. + //individualPrice = Math.round(individualPrice);
  1513. + for (L2PcInstance member: _participatingPlayers)
  1514. + {
  1515. + if (member == null)
  1516. + continue;
  1517. + if (Config.RAID_SYSTEM_GIVE_BUFFS)
  1518. + L2BufferInstance.makeBuffs(member,buffList,efector,false);
  1519. + member.inPartyEvent = true;
  1520. + if (individualPrice>member.getEventPoints())
  1521. + {
  1522. + int previousPoints = member.getEventPoints();
  1523. + member.setEventPoints(0);
  1524. + NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  1525. + TextBuilder replyMSG = new TextBuilder("<html><body>");
  1526. + replyMSG.append("<tr><td>A total of "+eventPoints+" points have been deduced from your party TOTAL Event Point Score.</td></tr><br>");
  1527. + replyMSG.append("<tr><td>You didn't have enough Event Points, so we've used all of your points.</td></tr><br>");
  1528. + replyMSG.append("<tr><td>You had "+previousPoints+", and we needed "+individualPrice+" points.</td></tr><br><br><br>");
  1529. + replyMSG.append("<tr><td>Developed by: Polbat02 //Dragonlance Server.</td></tr>");
  1530. + replyMSG.append("</body></html>");
  1531. + adminReply.setHtml(replyMSG.toString());
  1532. + member.sendPacket(adminReply);
  1533. + }
  1534. + else
  1535. + {
  1536. + int previousPoints = member.getEventPoints();
  1537. + member.setEventPoints(member.getEventPoints()-individualPrice);
  1538. + NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  1539. + TextBuilder replyMSG = new TextBuilder("<html><body>");
  1540. + replyMSG.append("<tr><td>A total of "+eventPoints+" points have been deduced from your party TOTAL Event Point Score.</td></tr><br>");
  1541. + replyMSG.append("<tr><td>You had "+previousPoints+", and now you have "+(previousPoints-individualPrice)+" points.</td></tr><br><br><br>");
  1542. + replyMSG.append("<tr><td>Developed by: Polbat02 //Dragonlance Server.</td></tr>");
  1543. + replyMSG.append("</body></html>");
  1544. + adminReply.setHtml(replyMSG.toString());
  1545. + member.sendPacket(adminReply);
  1546. + }
  1547. + }
  1548. + }
  1549. + }
  1550. +
  1551. + /**
  1552. + * <b>Starting of the Event</b><br>
  1553. + * This method checks it the total amount of events in process is > than the allowed and acts
  1554. + * according to that and the parameters given.<br>
  1555. + * In case X events are already taking place, the void returns and won't let us continue with the
  1556. + * event.<br>
  1557. + * This check is not needed since we already check this in L2EventManagerInstance.java, but i'll
  1558. + * leave it in here for now since this is a very early stage of developing for now.<br>
  1559. + * More documentation can be found in the Method.<br>
  1560. + * @param player --> Player taking the action.
  1561. + * @param npcId --> Event Monster ID.
  1562. + * @param ammount --> Amount of Event Monsters
  1563. + * @param type --> type of Event.
  1564. + */
  1565. + private static void startEvent(L2PcInstance player, int npcId, int ammount)
  1566. + {
  1567. + if (player == null)
  1568. + return;
  1569. + int currentEvents = L2EventManagerInstance._currentEvents;
  1570. + if (currentEvents>=Config.RAID_SYSTEM_MAX_EVENTS)
  1571. + return;
  1572. + if (currentEvents == 0)
  1573. + return;
  1574. + setState(EventState.STARTED);
  1575. + // Teleport Player or Members depending on the Event Type.
  1576. + doTeleport(player,_locX,_locY,_locZ,10,false);
  1577. + // Spawn The NPC Monster for the Event.
  1578. + spawnMonster(npcId,60,ammount,_npcX,_npcY,_npcZ);
  1579. + }
  1580. +
  1581. + /**
  1582. + * Teleport the event participants to where the event is going to take place<br>
  1583. + * A function has been created to make it easier for us to teleport the players
  1584. + * every time we need them to teleport.<br>
  1585. + * Added suport for different kind of events.
  1586. + * @param player --> Player being teleported.
  1587. + * @param cox --> Coord X
  1588. + * @param coy --> Coord Y
  1589. + * @param coz --> Coord Z
  1590. + * @param delay --> Delay to be teleported in
  1591. + * @param removeBuffs --> Boolean to removeBuffs uponTeleport or not.
  1592. + */
  1593. + private static void doTeleport(L2PcInstance player,int cox,int coy,int coz,int delay,boolean removeBuffs)
  1594. + {
  1595. + for (L2PcInstance member: _participatingPlayers)
  1596. + {
  1597. + new L2EventTeleporter(member,cox,coy,coz,delay,removeBuffs);
  1598. + member.sendMessage("You will be teleported in 10 Seconds.");
  1599. + }
  1600. + }
  1601. +
  1602. + /**
  1603. + * Spawning function of Event Monsters.<br>
  1604. + * Added Support for multiple spawns and for each one of them being defined as Event Mob.
  1605. + * @param monsterId --> Npc Id
  1606. + * @param respawnTime --> Respawn Delay (in most cases this will be 0 as we're gonna
  1607. + * cut the respawning of the Mobs upon death).
  1608. + * @param mobCount --> MobCount to be spawned.
  1609. + * @param locX --> Coordinate X for the mob to be spawned in.
  1610. + * @param locY --> Coordinate Y for the mob to be spawned in.
  1611. + * @param locZ --> Coordinate Z for the mob to be spawned in.
  1612. + */
  1613. + private static void spawnMonster(int monsterId, int respawnDelay, int mobCount,int locX,int locY, int locZ)
  1614. + {
  1615. + L2NpcTemplate template;
  1616. + int monsterTemplate = monsterId;
  1617. + template = NpcTable.getInstance().getTemplate(monsterTemplate);
  1618. + if (template == null)
  1619. + return;
  1620. + _eventMobs = mobCount;
  1621. + // Support for multiple spawns.
  1622. + if (mobCount>1)
  1623. + {
  1624. + int n = 1;
  1625. + while (n<=mobCount)
  1626. + {
  1627. + try
  1628. + {
  1629. + L2Spawn spawn = new L2Spawn(template);
  1630. + // TODO: Add support for different spawning zones.
  1631. + spawn.setLocx(locX);
  1632. + spawn.setLocy(locY);
  1633. + spawn.setLocz(locZ);
  1634. + spawn.setAmount(1);
  1635. + spawn.setHeading(0);
  1636. + spawn.setRespawnDelay(respawnDelay);
  1637. + if (RaidBossSpawnManager.getInstance().getValidTemplate(spawn.getNpcid()) != null)
  1638. + RaidBossSpawnManager.getInstance().addNewSpawn(spawn, 0, template.getStatsSet().getDouble("baseHpMax"), template.getStatsSet().getDouble("baseMpMax"), false);
  1639. + else
  1640. + SpawnTable.getInstance().addNewSpawn(spawn, false);
  1641. + spawn.init();
  1642. + /* Define the properties of every spawn.
  1643. + * TODO: Change the Mob statistics according on Event Participants and Server Rates.
  1644. + */
  1645. + _lastNpcSpawn = spawn.getLastSpawn();
  1646. + _npcSpawn = spawn;
  1647. + _lastNpcSpawn.isPrivateEventMob=true;
  1648. + _lastNpcSpawn.setChampion(false);
  1649. + _lastNpcSpawn.setTitle("Event Monster");
  1650. + // Stop the Respawn of the Mob.
  1651. + _npcSpawn.stopRespawn();
  1652. + _eventMobList.add(_lastNpcSpawn);
  1653. + n++;
  1654. + }
  1655. + catch (Exception e)
  1656. + {
  1657. + _log.warning("L2EventManager: Exception Upon MULTIPLE NPC SPAWN.");
  1658. + e.printStackTrace();
  1659. + }
  1660. + }
  1661. + setState(EventState.PARTICIPATING);
  1662. + }
  1663. + else
  1664. + {
  1665. + try
  1666. + {
  1667. + L2Spawn spawn = new L2Spawn(template);
  1668. + spawn.setLocx(locX);
  1669. + spawn.setLocy(locY);
  1670. + spawn.setLocz(locZ);
  1671. + spawn.setAmount(1);
  1672. + spawn.setHeading(0);
  1673. + spawn.setRespawnDelay(respawnDelay);
  1674. + if (RaidBossSpawnManager.getInstance().getValidTemplate(spawn.getNpcid()) != null)
  1675. + RaidBossSpawnManager.getInstance().addNewSpawn(spawn, 0, template.getStatsSet().getDouble("baseHpMax"), template.getStatsSet().getDouble("baseMpMax"), false);
  1676. + else
  1677. + SpawnTable.getInstance().addNewSpawn(spawn, false);
  1678. + spawn.init();
  1679. + _lastNpcSpawn = spawn.getLastSpawn();
  1680. + _npcSpawn = spawn;
  1681. + _lastNpcSpawn.isPrivateEventMob=true;
  1682. + _lastNpcSpawn.setChampion(false);
  1683. + _lastNpcSpawn.setTitle("Event Monster");
  1684. + _npcSpawn.stopRespawn();
  1685. + _eventMobList.add(_lastNpcSpawn);
  1686. + }
  1687. + catch (Exception e)
  1688. + {
  1689. + _log.warning("L2EventManager: Exception Upon SINGLE NPC SPAWN.");
  1690. + e.printStackTrace();
  1691. + }
  1692. + setState(EventState.PARTICIPATING);
  1693. + }
  1694. + new RaidFightManager();
  1695. + }
  1696. +
  1697. + /**
  1698. + * Delete the mob from the Event.
  1699. + */
  1700. + private static void unSpawnNPC()
  1701. + {
  1702. + try
  1703. + {
  1704. + _lastNpcSpawn.deleteMe();
  1705. + _npcSpawn.stopRespawn();
  1706. + _npcSpawn = null;
  1707. + _lastNpcSpawn = null;
  1708. + }
  1709. + catch(Exception e)
  1710. + {
  1711. + _log.warning("L2EventManager: Eception Upon NPC UNSPAWN.");
  1712. + }
  1713. + }
  1714. + /**
  1715. + * Function launched at every player death (if he/she's enrolled in any Raid event)
  1716. + * @param player
  1717. + */
  1718. + public static void onPlayerDeath(L2PcInstance player)
  1719. + {
  1720. + /*
  1721. + * TODO: Add support for:
  1722. + * - Configurable Death rebirth system including:
  1723. + * - Automatic respawn (Done)
  1724. + * - Track deaths for player.
  1725. + * - doRevive? (Done)
  1726. + */
  1727. + new L2EventTeleporter(player,_locX,_locY,_locZ,0,false);
  1728. + player.setTarget(null);
  1729. + player.breakAttack();
  1730. + player.breakCast();
  1731. + player.doRevive();
  1732. + }
  1733. +
  1734. + /**
  1735. + * This is the place where we define all the actions that take place after one Event Mob dies.
  1736. + * a. Check if that was the last event mob of this instance.
  1737. + * b. If not, decrease the number by one.
  1738. + * c. Else return true.
  1739. + */
  1740. + public static boolean checkPossibleReward()
  1741. + {
  1742. + if (_eventMobs == 0)
  1743. + return false;
  1744. + if (_eventMobs<1)
  1745. + {
  1746. + _eventMobs = 0;
  1747. + return false;
  1748. + }
  1749. + if (_eventMobs>1)
  1750. + {
  1751. + _eventMobs = _eventMobs -1;
  1752. + return false;
  1753. + }
  1754. + setState(EventState.REWARDING);
  1755. + return true;
  1756. + }
  1757. + /**
  1758. + * This void picks the rewards and launches the hand out system.
  1759. + * It also Ends the event.
  1760. + * Added database support for this.
  1761. + * @param player --> Player taking the action.
  1762. + */
  1763. + public static void chooseReward(L2PcInstance player)
  1764. + {
  1765. + if (_eventMobs == 1)
  1766. + _eventMobs =0;
  1767. + else return;
  1768. + loadData(_rewardLevel);
  1769. + //Case Single Event
  1770. + if (_eventType == 1)
  1771. + {
  1772. + //Hand Out Items
  1773. + handOutItems(player,_first_id,_first_ammount,_second_id,_second_ammount,_event_ammount);
  1774. + //Genearal Clean-Up of the Event.
  1775. + unSpawnNPC();
  1776. + clearFromEvent(player);
  1777. + //Teleport back to previous-event location.
  1778. + doTeleport(player,_pX,_pY,_pZ,10,true);
  1779. + if (L2EventManagerInstance._currentEvents!=0)
  1780. + L2EventManagerInstance._currentEvents=L2EventManagerInstance._currentEvents-1;
  1781. + }
  1782. + //Case Clan Event
  1783. + if (_eventType == 2)
  1784. + {
  1785. + for (L2PcInstance member: _participatingPlayers)
  1786. + {
  1787. + if (member == null)
  1788. + continue;
  1789. + handOutItems(member,_first_id,_first_ammount,_second_id,_second_ammount,_event_ammount);
  1790. + doTeleport(member,_pX,_pY,_pZ,10,true);
  1791. + }
  1792. + unSpawnNPC();
  1793. + clearFromEvent(player);
  1794. + if (L2EventManagerInstance._currentEvents!=0)
  1795. + L2EventManagerInstance._currentEvents=L2EventManagerInstance._currentEvents-1;
  1796. + }
  1797. + //Case Party Event.
  1798. + if (_eventType == 3)
  1799. + {
  1800. + if(player.getParty() != null)
  1801. + {
  1802. + for (L2PcInstance member: _participatingPlayers)
  1803. + {
  1804. + handOutItems(member,_first_id,_first_ammount,_second_id,_second_ammount,_event_ammount);
  1805. + doTeleport(member,_pX,_pY,_pZ,10,true);
  1806. + }
  1807. + }
  1808. + else
  1809. + {
  1810. + player.sendMessage("You don't have a party anymore?! Well then the rewards go for you only.");
  1811. + //Hand Out Items
  1812. + handOutItems(player,_first_id,_first_ammount,_second_id,_second_ammount,_event_ammount);
  1813. + //General Clean-Up of the Event.
  1814. + unSpawnNPC();
  1815. + clearFromEvent(player);
  1816. + //Teleport back to previous-event location.
  1817. + doTeleport(player,_pX,_pY,_pZ,10,true);
  1818. + if (L2EventManagerInstance._currentEvents!=0)
  1819. + L2EventManagerInstance._currentEvents=L2EventManagerInstance._currentEvents-1;
  1820. + return;
  1821. + }
  1822. + unSpawnNPC();
  1823. + clearFromEvent(player);
  1824. + if (L2EventManagerInstance._currentEvents!=0)
  1825. + L2EventManagerInstance._currentEvents=L2EventManagerInstance._currentEvents-1;
  1826. + }
  1827. + return;
  1828. + }
  1829. +
  1830. + /**
  1831. + * Custom Definition of the Experience.
  1832. + * TODO: Add custom definitions of Experience for different prize lists.
  1833. + */
  1834. + public static void expHandOut()
  1835. + {
  1836. + exp += exp;
  1837. + sp +=sp;
  1838. + }
  1839. +
  1840. + /**
  1841. + * Clean the eventStatus from the players.
  1842. + */
  1843. + private synchronized static void clearFromEvent(L2PcInstance player)
  1844. + {
  1845. + setState(EventState.INACTIVATING);
  1846. + if (_eventType !=1 && _eventType!=2 &&_eventType!=3)
  1847. + return;
  1848. + if (_eventType == 1)
  1849. + {
  1850. + player.inSoloEvent = false;
  1851. + }
  1852. + if (_eventType == 2)
  1853. + {
  1854. + if (_participatingPlayers.size()!=0)
  1855. + {
  1856. + for (L2PcInstance member: _participatingPlayers)
  1857. + {
  1858. + if (member == null)
  1859. + continue;
  1860. + member.inClanEvent = false;
  1861. + }
  1862. + //Clear Clan Members from event.
  1863. + if(_participatingPlayers.size()!=0)
  1864. + _participatingPlayers.clear();
  1865. + }
  1866. + }
  1867. + if (_eventType == 3)
  1868. + {
  1869. + if(player.getParty()!=null)
  1870. + {
  1871. + player.inPartyEvent = false;
  1872. + for (L2PcInstance member: _participatingPlayers)
  1873. + {
  1874. + if (member == null)
  1875. + continue;
  1876. + member.inPartyEvent = false;
  1877. + }
  1878. + }
  1879. + else
  1880. + player.inPartyEvent = false;
  1881. + }
  1882. + setState(EventState.INACTIVE);
  1883. + }
  1884. +
  1885. + /**
  1886. + * Function with which we will hand out event Items.
  1887. + * @param player
  1888. + * @param item1
  1889. + * @param ammount1
  1890. + * @param item2
  1891. + * @param ammount2
  1892. + * @param eventPoints
  1893. + */
  1894. + private static void handOutItems(L2PcInstance player, int item1, int ammount1, int item2, int ammount2, int eventPoints)
  1895. + {
  1896. + boolean hasItem1 = false;
  1897. + boolean hasItem2 = false;
  1898. + boolean hasEventPoints = false;
  1899. + if (item1 == 0 && item2 == 0 && eventPoints == 0)
  1900. + return;
  1901. + if (item1 != 0)
  1902. + hasItem1 = true;
  1903. + if (item2 != 0)
  1904. + hasItem2 = true;
  1905. + if (eventPoints != 0)
  1906. + hasEventPoints = true;
  1907. + PcInventory inv = player.getInventory();
  1908. + if (hasItem1)
  1909. + {
  1910. + if (item1 == 57)
  1911. + {
  1912. + inv.addAdena("Event - Adena",ammount1,player,player);
  1913. + SystemMessage smAdena;
  1914. + smAdena = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
  1915. + smAdena.addItemName(57);
  1916. + smAdena.addNumber(ammount1);
  1917. + player.sendPacket(smAdena);
  1918. + }
  1919. + else
  1920. + {
  1921. + if (ItemTable.getInstance().createDummyItem(item1).isStackable())
  1922. + inv.addItem("Event", item1, ammount1, player, player);
  1923. + else
  1924. + {
  1925. + for (int i=0;i<=ammount1-1;i++)
  1926. + inv.addItem("Event", item1, ammount1, player, player);
  1927. + }
  1928. + SystemMessage smItem;
  1929. + smItem = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
  1930. + smItem.addItemName(item1);
  1931. + smItem.addNumber(ammount1);
  1932. + player.sendPacket(smItem);
  1933. + }
  1934. + }
  1935. + if (hasItem2)
  1936. + {
  1937. + if (item2 == 57)
  1938. + {
  1939. + inv.addAdena("Event - Adena",ammount2,player,player);
  1940. + SystemMessage smAdena;
  1941. + smAdena = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
  1942. + smAdena.addItemName(57);
  1943. + smAdena.addNumber(ammount2);
  1944. + player.sendPacket(smAdena);
  1945. + }
  1946. + else
  1947. + {
  1948. + if (ItemTable.getInstance().createDummyItem(item2).isStackable())
  1949. + inv.addItem("Event", item2, ammount2, player, player);
  1950. + else
  1951. + {
  1952. + for (int i=0;i<=ammount2-1;i++)
  1953. + inv.addItem("Event", item2, ammount2, player, player);
  1954. + }
  1955. + SystemMessage smItem;
  1956. + smItem = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
  1957. + smItem.addItemName(item2);
  1958. + smItem.addNumber(ammount2);
  1959. + player.sendPacket(smItem);
  1960. + }
  1961. + }
  1962. + if (hasEventPoints)
  1963. + {
  1964. + player.setEventPoints(player.getEventPoints()+eventPoints);
  1965. + SystemMessage smp;
  1966. + smp = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
  1967. + smp.addString("Event Points ");
  1968. + smp.addNumber(2);
  1969. + player.sendPacket(smp);
  1970. + }
  1971. + StatusUpdate su = new StatusUpdate(player.getObjectId());
  1972. + su.addAttribute(StatusUpdate.CUR_LOAD, player.getCurrentLoad());
  1973. + player.sendPacket(su);
  1974. + player.sendPacket(new ItemList(player, true));
  1975. + NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  1976. + TextBuilder replyMSG = new TextBuilder("<html><body>");
  1977. + replyMSG.append("<tr><td>You won the event!</td></tr><br>");
  1978. + replyMSG.append("<tr><td>You have Earned:</td></tr><br>");
  1979. + if (hasItem1)
  1980. + {
  1981. + String item1name =ItemTable.getInstance().createDummyItem(item1).getItemName();
  1982. + replyMSG.append("<tr><td>- "+ammount1+" "+item1name+".</td></tr><br>");
  1983. + }
  1984. + if (hasItem2)
  1985. + {
  1986. + String item2name =ItemTable.getInstance().createDummyItem(item2).getItemName();
  1987. + replyMSG.append("<tr><td>- "+ammount2+" "+item2name+".</td></tr><br>");
  1988. + }
  1989. + if (hasEventPoints)
  1990. + {
  1991. + replyMSG.append("<tr><td>- "+eventPoints+" Event Points.</td></tr><br>");
  1992. + }
  1993. + replyMSG.append("<br><tr><td>Congratulations!!</td></tr><br><br><br>");
  1994. + replyMSG.append("<tr><td>Developed by: Polbat02.</td></tr>");
  1995. + replyMSG.append("</body></html>");
  1996. + adminReply.setHtml(replyMSG.toString());
  1997. + player.sendPacket(adminReply);
  1998. + }
  1999. + /**
  2000. + * Hard Finish Event (Case every Body dies)
  2001. + */
  2002. + public static void hardFinish()
  2003. + {
  2004. + for (L2NpcInstance eventMob: _eventMobList)
  2005. + {
  2006. + eventMob.decayMe();
  2007. + eventMob.deleteMe();
  2008. + L2EventManagerInstance._currentEvents -= 1;
  2009. + }
  2010. + _log.warning("Raid Engines: All the Members from the Event are now dead or Have Left The event. Event Finished.");
  2011. + }
  2012. + /**
  2013. + * Load Data of the prizes for each event.
  2014. + * Added DataBase support for this.
  2015. + * @param prizePackage
  2016. + */
  2017. + private static void loadData(int prizePackage)
  2018. + {
  2019. + Connection con;
  2020. + try
  2021. + {
  2022. + con = L2DatabaseFactory.getInstance().getConnection();
  2023. + PreparedStatement statement = con.prepareStatement("SELECT first_prize_id, first_prize_ammount, second_prize_id, second_prize_ammount, event_points_ammount FROM raid_prizes WHERE `prize_package_id` = '"+prizePackage+"'");
  2024. + ResultSet rset = statement.executeQuery();
  2025. + while(rset.next())
  2026. + {
  2027. + _first_id = rset.getInt("first_prize_id");
  2028. + _first_ammount = rset.getInt("first_prize_ammount");
  2029. + _second_id = rset.getInt("second_prize_id");
  2030. + _second_ammount = rset.getInt("second_prize_ammount");
  2031. + _event_ammount = rset.getInt("event_points_ammount");
  2032. + }
  2033. + rset.close();
  2034. + statement.close();
  2035. + con.close();
  2036. + }
  2037. + catch (Exception e)
  2038. + {
  2039. + _log.severe("Error While loading Raids prizes." + e);
  2040. + }
  2041. + }
  2042. +
  2043. + /**
  2044. + * Sets the Event state<br><br>
  2045. + * @param state<br>
  2046. + */
  2047. + private static void setState(EventState state)
  2048. + {
  2049. + synchronized (_state)
  2050. + {
  2051. + _state = state;
  2052. + }
  2053. + }
  2054. +
  2055. + /**
  2056. + * Is Event inactive?<br><br>
  2057. + * @return boolean<br>
  2058. + */
  2059. + public static boolean isInactive()
  2060. + {
  2061. + boolean isInactive;
  2062. +
  2063. + synchronized (_state)
  2064. + {
  2065. + isInactive = _state == EventState.INACTIVE;
  2066. + }
  2067. +
  2068. + return isInactive;
  2069. + }
  2070. +
  2071. + /**
  2072. + * Is Event in inactivating?<br><br>
  2073. + * @return boolean<br>
  2074. + */
  2075. + public static boolean isInactivating()
  2076. + {
  2077. + boolean isInactivating;
  2078. +
  2079. + synchronized (_state)
  2080. + {
  2081. + isInactivating = _state == EventState.INACTIVATING;
  2082. + }
  2083. +
  2084. + return isInactivating;
  2085. + }
  2086. +
  2087. + /**
  2088. + * Is Event in participation?<br><br>
  2089. + * @return boolean<br>
  2090. + */
  2091. + public static boolean isParticipating()
  2092. + {
  2093. + boolean isParticipating;
  2094. +
  2095. + synchronized (_state)
  2096. + {
  2097. + isParticipating = _state == EventState.PARTICIPATING;
  2098. + }
  2099. +
  2100. + return isParticipating;
  2101. + }
  2102. +
  2103. + /**
  2104. + * Is Event starting?<br><br>
  2105. + * @return boolean<br>
  2106. + */
  2107. + public static boolean isStarting()
  2108. + {
  2109. + boolean isStarting;
  2110. +
  2111. + synchronized (_state)
  2112. + {
  2113. + isStarting = _state == EventState.STARTING;
  2114. + }
  2115. +
  2116. + return isStarting;
  2117. + }
  2118. +
  2119. + /**
  2120. + * Is Event started?<br><br>
  2121. + * @return boolean<br>
  2122. + */
  2123. + public static boolean isStarted()
  2124. + {
  2125. + boolean isStarted;
  2126. +
  2127. + synchronized (_state)
  2128. + {
  2129. + isStarted = _state == EventState.STARTED;
  2130. + }
  2131. +
  2132. + return isStarted;
  2133. + }
  2134. +
  2135. + /**
  2136. + * Is Event rewarding?<br><br>
  2137. + * @return boolean<br>
  2138. + */
  2139. + public static boolean isRewarding()
  2140. + {
  2141. + boolean isRewarding;
  2142. +
  2143. + synchronized (_state)
  2144. + {
  2145. + isRewarding = _state == EventState.REWARDING;
  2146. + }
  2147. +
  2148. + return isRewarding;
  2149. + }
  2150. +
  2151. + /**
  2152. + * Send a SystemMessage to all participated players<br>
  2153. + * 1. Send the message to all players of team number one<br>
  2154. + * 2. Send the message to all players of team number two<br><br>
  2155. + *
  2156. + * @param message<br>
  2157. + */
  2158. + public static void sysMsgToAllParticipants(String message)
  2159. + {
  2160. + for (L2PcInstance player : _participatingPlayers)
  2161. + {
  2162. + if (player != null)
  2163. + player.sendMessage(message);
  2164. + }
  2165. + }
  2166. +
  2167. +
  2168. + private static void loadSpawns(int eventNum)
  2169. + {
  2170. + Connection con;
  2171. + try
  2172. + {
  2173. + con = L2DatabaseFactory.getInstance().getConnection();
  2174. + PreparedStatement statement = con.prepareStatement
  2175. + ("SELECT raid_locX, raid_locY, raid_locZ, player_locX, player_locY, player_locZ " +
  2176. + "FROM raid_event_spawnlist WHERE `id` = '"+eventNum+"'");
  2177. + ResultSet rset = statement.executeQuery();
  2178. + while(rset.next())
  2179. + {
  2180. + _npcX = rset.getInt("raid_locX");
  2181. + _npcY = rset.getInt("raid_locY");
  2182. + _npcZ = rset.getInt("raid_locZ");
  2183. + _locX = rset.getInt("player_locX");
  2184. + _locY = rset.getInt("player_locY");
  2185. + _locZ = rset.getInt("player_locZ");
  2186. + }
  2187. + rset.close();
  2188. + statement.close();
  2189. + con.close();
  2190. + }
  2191. + catch (Exception e)
  2192. + {
  2193. + _log.severe("Error While loading Raids Spawn Positions." + e);
  2194. + }
  2195. + }
  2196. +}
  2197. Index: /trunk/Game/java/net/sf/l2j/gameserver/model/entity/L2EventTeleporter.java
  2198. ===================================================================
  2199. --- /trunk/Game/java/net/sf/l2j/gameserver/model/entity/L2EventTeleporter.java (revision 681)
  2200. +++ /trunk/Game/java/net/sf/l2j/gameserver/model/entity/L2EventTeleporter.java (revision 681)
  2201. @@ -0,0 +1,91 @@
  2202. +/*
  2203. + * This program is free software; you can redistribute it and/or modify
  2204. + * it under the terms of the GNU General Public License as published by
  2205. + * the Free Software Foundation; either version 2, or (at your option)
  2206. + * any later version.
  2207. + *
  2208. + * This program is distributed in the hope that it will be useful,
  2209. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2210. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2211. + * GNU General Public License for more details.
  2212. + *
  2213. + * You should have received a copy of the GNU General Public License
  2214. + * along with this program; if not, write to the Free Software
  2215. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  2216. + * 02111-1307, USA.
  2217. + *
  2218. + * http://www.gnu.org/copyleft/gpl.html
  2219. + */
  2220. +package net.sf.l2j.gameserver.model.entity;
  2221. +
  2222. +import net.sf.l2j.gameserver.ThreadPoolManager;
  2223. +import net.sf.l2j.gameserver.datatables.SkillTable;
  2224. +import net.sf.l2j.gameserver.model.L2Effect;
  2225. +import net.sf.l2j.gameserver.model.L2Summon;
  2226. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2227. +import net.sf.l2j.gameserver.serverpackets.Ride;
  2228. +
  2229. +public class L2EventTeleporter implements Runnable
  2230. +{
  2231. + private L2PcInstance _player = null;
  2232. + private int _coordinateX = 0;
  2233. + private int _coordinateY = 0;
  2234. + private int _coordinateZ = 0;
  2235. + boolean _removeBuffs;
  2236. +
  2237. + /**
  2238. + * Manages all Teleports done within a Raid Event.
  2239. + * @param player --> Player being teleported
  2240. + * @param coordinateX --> CX
  2241. + * @param coordinateY --> CY
  2242. + * @param coordinateZ --> CZ
  2243. + * @param delay --> Delay to do the actual teleport.
  2244. + * @param removeBuffs --> Boolean to allow removal of buffs.
  2245. + */
  2246. + public L2EventTeleporter(L2PcInstance player, int coordinateX, int coordinateY, int coordinateZ , int delay, boolean removeBuffs)
  2247. + {
  2248. + _player = player;
  2249. + _coordinateX = coordinateX;
  2250. + _coordinateY = coordinateY;
  2251. + _coordinateZ = coordinateZ;
  2252. + _removeBuffs = removeBuffs;
  2253. + //Espera para hacer el teleport
  2254. + long _delay = delay * 1000L;
  2255. + if (delay == 0)
  2256. + _delay = 0;
  2257. + ThreadPoolManager.getInstance().scheduleGeneral(this, _delay);
  2258. + }
  2259. +
  2260. + public void run()
  2261. + {
  2262. + if (_player == null)
  2263. + return;
  2264. +
  2265. + if (_player.isMounted())
  2266. + {
  2267. + if (_player.isFlying())
  2268. + _player.removeSkill(SkillTable.getInstance().getInfo(4289, 1));
  2269. + Ride dismount = new Ride(_player.getObjectId(), Ride.ACTION_DISMOUNT, 0);
  2270. + _player.broadcastPacket(dismount);
  2271. + _player.setMountType(0);
  2272. + _player.setMountObjectID(0);
  2273. + }
  2274. + L2Summon summon = _player.getPet();
  2275. + if (_removeBuffs && summon != null)
  2276. + summon.unSummon(_player);
  2277. + if (_removeBuffs)
  2278. + {
  2279. + for (L2Effect effect : _player.getAllEffects())
  2280. + {
  2281. + if (effect != null)
  2282. + effect.exit();
  2283. + }
  2284. + }
  2285. + _player.setCurrentCp(_player.getMaxCp()+5000);
  2286. + _player.setCurrentHp(_player.getMaxHp()+5000);
  2287. + _player.setCurrentMp(_player.getMaxMp()+5000);
  2288. + _player.teleToLocation(_coordinateX, _coordinateY, _coordinateZ, false);
  2289. + _player.broadcastStatusUpdate();
  2290. + _player.broadcastUserInfo();
  2291. + }
  2292. +}
  2293. Index: /trunk/Game/java/net/sf/l2j/gameserver/model/entity/RaidFightManager.java
  2294. ===================================================================
  2295. --- /trunk/Game/java/net/sf/l2j/gameserver/model/entity/RaidFightManager.java (revision 681)
  2296. +++ /trunk/Game/java/net/sf/l2j/gameserver/model/entity/RaidFightManager.java (revision 681)
  2297. @@ -0,0 +1,85 @@
  2298. +package net.sf.l2j.gameserver.model.entity;
  2299. +
  2300. +import java.util.logging.Logger;
  2301. +
  2302. +import net.sf.l2j.Config;
  2303. +import net.sf.l2j.gameserver.Announcements;
  2304. +import net.sf.l2j.gameserver.model.actor.instance.L2EventManagerInstance;
  2305. +import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;
  2306. +
  2307. +public class RaidFightManager
  2308. +{
  2309. + protected static final Logger _log = Logger.getLogger(RaidFightManager.class.getName());
  2310. + /**
  2311. + * The task method to handle cycles of the event<br><br>
  2312. + *
  2313. + * @see java.lang.Runnable#run()<br>
  2314. + */
  2315. + public void run()
  2316. + {
  2317. + //TODO: Add initial breaks. And check performance
  2318. + for (;;)
  2319. + {
  2320. + waiter(Config.RAID_SYSTEM_FIGHT_TIME * 60); // in configuration given as minutes
  2321. + for (L2NpcInstance eventMob: L2RaidEvent._eventMobList)
  2322. + {
  2323. + eventMob.decayMe();
  2324. + eventMob.deleteMe();
  2325. + L2EventManagerInstance._currentEvents -= 1;
  2326. + }
  2327. + _log.warning("Raid Engines: All the Members from the Event are now dead or Have Left The event. Event Finished.");
  2328. + break;
  2329. + }
  2330. + }
  2331. +
  2332. + void waiter(int seconds)
  2333. + {
  2334. + while (seconds > 1)
  2335. + {
  2336. + seconds--; // here because we don't want to see two time announce at the same time
  2337. +
  2338. + if (L2RaidEvent.isParticipating())
  2339. + {
  2340. + switch (seconds)
  2341. + {
  2342. + case 3600: // 1 hour left
  2343. + L2RaidEvent.sysMsgToAllParticipants("You have One our left to kill the Raid Boss.");
  2344. +
  2345. + break;
  2346. + case 1800: // 30 minutes left
  2347. + case 900: // 15 minutes left
  2348. + case 600: // 10 minutes left
  2349. + case 300: // 5 minutes left
  2350. + case 240: // 4 minutes left
  2351. + case 180: // 3 minutes left
  2352. + case 120: // 2 minutes left
  2353. + case 60: // 1 minute left
  2354. + Announcements.getInstance().announceToAll("L2Raid Event: " + seconds / 60 + " minute(s) untill Boss Disapears!");
  2355. + break;
  2356. + case 30: // 30 seconds left
  2357. + case 15: // 15 seconds left
  2358. + case 10: // 10 seconds left
  2359. + case 5: // 5 seconds left
  2360. + case 4: // 4 seconds left
  2361. + case 3: // 3 seconds left
  2362. + case 2: // 2 seconds left
  2363. + case 1: // 1 seconds left
  2364. + Announcements.getInstance().announceToAll("L2Raid Event: " + seconds + " second(s) untill Boss Disapears!");
  2365. + break;
  2366. + }
  2367. + }
  2368. +
  2369. + long oneSecWaitStart = System.currentTimeMillis();
  2370. +
  2371. + while (oneSecWaitStart + 1000L > System.currentTimeMillis())
  2372. + {
  2373. + try
  2374. + {
  2375. + Thread.sleep(1);
  2376. + }
  2377. + catch (InterruptedException ie)
  2378. + {}
  2379. + }
  2380. + }
  2381. + }
  2382. +}
  2383. Index: /trunk/Game/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Wedding.java
  2384. ===================================================================
  2385. --- /trunk/Game/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Wedding.java (revision 679)
  2386. +++ /trunk/Game/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Wedding.java (revision 681)
  2387. @@ -209,10 +209,11 @@
  2388. return false;
  2389. }
  2390.  
  2391. ptarget.setEngageRequest(true, activeChar.getObjectId());
  2392. //ptarget.sendMessage("Player "+activeChar.getName()+" wants to engage with you.");
  2393. + activeChar.awaitingAnswer = true;
  2394. ptarget.sendPacket(new ConfirmDlg(614,activeChar.getName()+" asking you to engage. Do you want to start a new relationship?"));
  2395. return true;
  2396. }
  2397.  
  2398. public boolean GoToLove(L2PcInstance activeChar)
  2399. Index: /trunk/Game/java/net/sf/l2j/gameserver/handler/usercommandhandlers/Escape.java
  2400. ===================================================================
  2401. --- /trunk/Game/java/net/sf/l2j/gameserver/handler/usercommandhandlers/Escape.java (revision 679)
  2402. +++ /trunk/Game/java/net/sf/l2j/gameserver/handler/usercommandhandlers/Escape.java (revision 681)
  2403. @@ -71,10 +71,16 @@
  2404. if (activeChar.isInJail())
  2405. {
  2406. activeChar.sendMessage("You can not escape from jail.");
  2407. return false;
  2408. }
  2409. +
  2410. + if (activeChar.inClanEvent || activeChar.inPartyEvent || activeChar.inSoloEvent)
  2411. + {
  2412. + activeChar.sendPacket(SystemMessage.sendString("You can't escape while in Event."));
  2413. + return false;
  2414. + }
  2415.  
  2416. SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
  2417. sm.addString("After " + unstuckTimer/60000 + " min. you be returned to near village.");
  2418.  
  2419. activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
  2420. Index: /trunk/Game/java/net/sf/l2j/gameserver/GameServer.java
  2421. ===================================================================
  2422. --- /trunk/Game/java/net/sf/l2j/gameserver/GameServer.java (revision 679)
  2423. +++ /trunk/Game/java/net/sf/l2j/gameserver/GameServer.java (revision 681)
  2424. @@ -20,10 +20,11 @@
  2425. import net.sf.l2j.gameserver.datatables.ArmorSetsTable;
  2426. import net.sf.l2j.gameserver.datatables.AugmentationData;
  2427. import net.sf.l2j.gameserver.datatables.CharNameTable;
  2428. import net.sf.l2j.gameserver.datatables.CharTemplateTable;
  2429. import net.sf.l2j.gameserver.datatables.ClanTable;
  2430. +import net.sf.l2j.gameserver.datatables.BuffTemplateTable;
  2431. import net.sf.l2j.gameserver.datatables.DoorTable;
  2432. import net.sf.l2j.gameserver.datatables.EventDroplist;
  2433. import net.sf.l2j.gameserver.datatables.ExtractableItemsData;
  2434. import net.sf.l2j.gameserver.datatables.FishTable;
  2435. import net.sf.l2j.gameserver.datatables.HelperBuffTable;
  2436. @@ -365,10 +366,12 @@
  2437. {
  2438. throw new Exception("Could not initialize the Henna Tree Table");
  2439. }
  2440.  
  2441. _helperBuffTable = HelperBuffTable.getInstance();
  2442. +
  2443. + BuffTemplateTable.getInstance();
  2444.  
  2445. if (!_helperBuffTable.isInitialized())
  2446. {
  2447. throw new Exception("Could not initialize the Helper Buff Table");
  2448. }
  2449. Index: /trunk/Game/java/net/sf/l2j/gameserver/templates/L2BuffTemplate.java
  2450. ===================================================================
  2451. --- /trunk/Game/java/net/sf/l2j/gameserver/templates/L2BuffTemplate.java (revision 681)
  2452. +++ /trunk/Game/java/net/sf/l2j/gameserver/templates/L2BuffTemplate.java (revision 681)
  2453. @@ -0,0 +1,249 @@
  2454. +package net.sf.l2j.gameserver.templates;
  2455. +
  2456. +import net.sf.l2j.gameserver.datatables.SkillTable;
  2457. +import net.sf.l2j.gameserver.model.L2Skill;
  2458. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2459. +import net.sf.l2j.gameserver.model.base.Race;
  2460. +
  2461. +/**
  2462. + * This class represents a Buff Template
  2463. + *
  2464. + * @author: polbat02
  2465. + */
  2466. +
  2467. +public class L2BuffTemplate
  2468. +{
  2469. + /** Id of buff template */
  2470. + private int _templateId;
  2471. +
  2472. + /** Name of the buff template */
  2473. + private String _templateName;
  2474. +
  2475. + /** Identifier of the skill (buff) to cast */
  2476. + private int _skillId;
  2477. +
  2478. + /** Order of the skill in template */
  2479. + private int _skillOrder;
  2480. +
  2481. + private L2Skill _skill;
  2482. +
  2483. + /** Level of the skill (buff) to cast */
  2484. + private int _skillLevel;
  2485. +
  2486. + /** Force cast, even if same effect present */
  2487. + private boolean _forceCast;
  2488. +
  2489. + /** Condition that player must have to obtain this buff */
  2490. + /** Min player level */
  2491. + private int _minLevel;
  2492. +
  2493. + /** Max player level */
  2494. + private int _maxLevel;
  2495. +
  2496. + /** Player's faction */
  2497. + private int _faction;
  2498. +
  2499. + /** Players's race */
  2500. + private int _race;
  2501. +
  2502. + /** Magus/Fighter class of the player */
  2503. + private int _class;
  2504. +
  2505. + /** Adena price */
  2506. + private int _adena;
  2507. +
  2508. + /** Faction points price */
  2509. + private int _points;
  2510. +
  2511. + /**
  2512. + * Constructor of L2BuffTemplat.<BR><BR>
  2513. + */
  2514. + public L2BuffTemplate(StatsSet set)
  2515. + {
  2516. + _templateId = set.getInteger("id");
  2517. + _templateName = set.getString("name");
  2518. + _skillId = set.getInteger("skillId");
  2519. + _skillLevel = set.getInteger("skillLevel");
  2520. + _skillOrder = set.getInteger("skillOrder");
  2521. +
  2522. + if (_skillLevel == 0)
  2523. + _skillLevel = SkillTable.getInstance().getMaxLevel(_skillId,_skillLevel);
  2524. +
  2525. + _skill = SkillTable.getInstance().getInfo(_skillId,_skillLevel);
  2526. +
  2527. + _forceCast = (set.getInteger("forceCast") == 1);
  2528. + _minLevel = set.getInteger("minLevel");
  2529. + _maxLevel = set.getInteger("maxLevel");
  2530. + _race = set.getInteger("race");
  2531. + _class = set.getInteger("class");
  2532. + _faction = set.getInteger("faction");
  2533. + _adena = set.getInteger("adena");
  2534. + _points = set.getInteger("points");
  2535. + }
  2536. +
  2537. + /**
  2538. + * @return Returns the Id of the buff template
  2539. + */
  2540. + public int getId()
  2541. + {
  2542. + return _templateId;
  2543. + }
  2544. +
  2545. + /**
  2546. + * @return Returns the Name of the buff template
  2547. + */
  2548. + public String getName()
  2549. + {
  2550. + return _templateName;
  2551. + }
  2552. +
  2553. + /**
  2554. + * @return Returns the Id of the buff that the L2PcInstance will receive
  2555. + */
  2556. + public int getSkillId()
  2557. + {
  2558. + return _skillId;
  2559. + }
  2560. +
  2561. + /**
  2562. + * @return Returns the Id of the buff that the L2PcInstance will receive
  2563. + */
  2564. + public int getSkillOrder()
  2565. + {
  2566. + return _skillOrder;
  2567. + }
  2568. +
  2569. + /**
  2570. + * @return Returns the Level of the buff that the L2PcInstance will receive
  2571. + */
  2572. + public int getSkillLevel()
  2573. + {
  2574. + return _skillLevel;
  2575. + }
  2576. +
  2577. + /**
  2578. + * @return Returns the Skill that the L2PcInstance will receive
  2579. + */
  2580. + public L2Skill getSkill()
  2581. + {
  2582. + return _skill;
  2583. + }
  2584. +
  2585. + /**
  2586. + * @return Returns the L2PcInstance minimum level to receive buff
  2587. + */
  2588. + public int getMinLevel()
  2589. + {
  2590. + return _minLevel;
  2591. + }
  2592. +
  2593. + /**
  2594. + * @return Returns the L2PcInstance maximum level to receive buff
  2595. + */
  2596. + public int getMaxLevel()
  2597. + {
  2598. + return _maxLevel;
  2599. + }
  2600. +
  2601. + /**
  2602. + * @return Returns the requirement faction to receive buff
  2603. + */
  2604. + public int getFaction()
  2605. + {
  2606. + return _faction;
  2607. + }
  2608. +
  2609. + /**
  2610. + * @return Returns the price for buff in Adena
  2611. + */
  2612. + public int getAdenaPrice()
  2613. + {
  2614. + return _adena;
  2615. + }
  2616. +
  2617. + /**
  2618. + * @return Returns the price for buff in Event Points
  2619. + */
  2620. + public int getPointsPrice()
  2621. + {
  2622. + return _points;
  2623. + }
  2624. +
  2625. + /**
  2626. + * @return Is cast animation will be shown
  2627. + */
  2628. + public boolean forceCast()
  2629. + {
  2630. + return _forceCast;
  2631. + }
  2632. +
  2633. + /**
  2634. + * @return Returns the result of level check
  2635. + */
  2636. + public boolean checkLevel(L2PcInstance player)
  2637. + {
  2638. + return ((_minLevel == 0 || player.getLevel()>=_minLevel) && (_maxLevel == 0 || player.getLevel()<=_maxLevel));
  2639. + }
  2640. +
  2641. + /**
  2642. + * @return Returns the result of race check
  2643. + */
  2644. + public boolean checkRace(L2PcInstance player)
  2645. + {
  2646. + boolean cond = false;
  2647. + if (_race == 0 || _race == 31) return true;
  2648. + if ((player.getRace() == Race.human) && (_race & 16) != 0) cond=true;
  2649. + if ((player.getRace() == Race.elf) && (_race & 8) != 0) cond=true;
  2650. + if ((player.getRace() == Race.darkelf) && (_race & 4) != 0) cond=true;
  2651. + if ((player.getRace() == Race.orc) && (_race & 2) != 0) cond=true;
  2652. + if ((player.getRace() == Race.dwarf) && (_race & 1) != 0) cond=true;
  2653. + return cond;
  2654. + }
  2655. +
  2656. + /**
  2657. + * @return Returns the result of Magus/Fighter class check
  2658. + */
  2659. + public boolean checkClass(L2PcInstance player)
  2660. + {
  2661. + return ((_class == 0 || _class == 3) || (_class == 1 && !player.isMageClass()) || (_class == 2 && player.isMageClass()));
  2662. + }
  2663. +
  2664. + /**
  2665. + * @return Returns the result of faction check
  2666. + */
  2667. + public boolean checkFaction(L2PcInstance player)
  2668. + {
  2669. + return true;
  2670. + //return ((_faction == 0 ||player.getFaction = _faction)
  2671. + }
  2672. +
  2673. + /**
  2674. + * @return Returns the result of price check
  2675. + */
  2676. + public boolean checkPrice(L2PcInstance player)
  2677. + {
  2678. + return ((_adena == 0 || player.getInventory().getAdena()>=_adena) && (_points == 0 || (player.getEventPoints()>=_points)));
  2679. + }
  2680. + /**
  2681. + * @return Returns the result of a the Event Point check
  2682. + */
  2683. + public boolean checkPoints(L2PcInstance player)
  2684. + {
  2685. + if (player.getEventPoints()>=_points)
  2686. + return true;
  2687. + return false;
  2688. + }
  2689. +
  2690. + /**
  2691. + * @return Returns the result of all player related conditions check
  2692. + */
  2693. + public boolean checkPlayer(L2PcInstance player)
  2694. + {
  2695. + return
  2696. + (checkLevel(player)
  2697. + && checkRace(player)
  2698. + && checkClass(player)
  2699. + && checkFaction(player));
  2700. + }
  2701. +
  2702. +}
  2703. Index: /trunk/Game/java/net/sf/l2j/gameserver/datatables/BuffTemplateTable.java
  2704. ===================================================================
  2705. --- /trunk/Game/java/net/sf/l2j/gameserver/datatables/BuffTemplateTable.java (revision 681)
  2706. +++ /trunk/Game/java/net/sf/l2j/gameserver/datatables/BuffTemplateTable.java (revision 681)
  2707. @@ -0,0 +1,191 @@
  2708. +package net.sf.l2j.gameserver.datatables;
  2709. +
  2710. +import java.sql.PreparedStatement;
  2711. +import java.sql.ResultSet;
  2712. +
  2713. +import javolution.util.FastList;
  2714. +import net.sf.l2j.L2DatabaseFactory;
  2715. +import net.sf.l2j.gameserver.templates.L2BuffTemplate;
  2716. +import net.sf.l2j.gameserver.templates.StatsSet;
  2717. +
  2718. +import org.apache.commons.logging.Log;
  2719. +import org.apache.commons.logging.LogFactory;
  2720. +
  2721. +public class BuffTemplateTable
  2722. +{
  2723. + private final static Log _log = LogFactory.getLog(BuffTemplateTable.class.getName());
  2724. +
  2725. + private static BuffTemplateTable _instance;
  2726. +
  2727. + /** This table contains all the Buff Templates */
  2728. + private FastList<L2BuffTemplate> _buffs;
  2729. +
  2730. +
  2731. + public static BuffTemplateTable getInstance()
  2732. + {
  2733. + if (_instance == null)
  2734. + {
  2735. + _instance = new BuffTemplateTable();
  2736. + }
  2737. + return _instance;
  2738. + }
  2739. +
  2740. + /**
  2741. + * Creates and charges all the Buff templates from the SQL Table buff_templates
  2742. + */
  2743. + public BuffTemplateTable()
  2744. + {
  2745. + _buffs = new FastList<L2BuffTemplate>();
  2746. + ReloadBuffTemplates();
  2747. + }
  2748. +
  2749. + /**
  2750. + * Reads and charges all the Buff templates from the SQL table
  2751. + */
  2752. + public void ReloadBuffTemplates()
  2753. + {
  2754. + _buffs.clear();
  2755. +
  2756. + java.sql.Connection con = null;
  2757. + try
  2758. + {
  2759. + try
  2760. + {
  2761. + con = L2DatabaseFactory.getInstance().getConnection();
  2762. + PreparedStatement statement = con.prepareStatement("SELECT * FROM buff_templates ORDER BY id, skill_order");
  2763. + ResultSet rset = statement.executeQuery();
  2764. +
  2765. + int _buffTemplates = 0;
  2766. + int templateId = -1;
  2767. +
  2768. + while (rset.next())
  2769. + {
  2770. + StatsSet Buff = new StatsSet();
  2771. +
  2772. + if (templateId != rset.getInt("id")) _buffTemplates++;
  2773. + templateId = rset.getInt("id");
  2774. +
  2775. + Buff.set("id", templateId);
  2776. + Buff.set("name", rset.getString("name"));
  2777. + Buff.set("skillId", rset.getInt("skill_id"));
  2778. + Buff.set("skillLevel", rset.getInt("skill_level"));
  2779. + Buff.set("skillOrder", rset.getInt("skill_order"));
  2780. + Buff.set("forceCast", rset.getInt("skill_force"));
  2781. + Buff.set("minLevel", rset.getInt("char_min_level"));
  2782. + Buff.set("maxLevel", rset.getInt("char_max_level"));
  2783. + Buff.set("race", rset.getInt("char_race"));
  2784. + Buff.set("class", rset.getInt("char_class"));
  2785. + Buff.set("faction", rset.getInt("char_faction"));
  2786. + Buff.set("adena", rset.getInt("price_adena"));
  2787. + Buff.set("points", rset.getInt("price_points"));
  2788. +
  2789. + // Add this buff to the Table.
  2790. + L2BuffTemplate template = new L2BuffTemplate(Buff);
  2791. + if (template.getSkill() == null)
  2792. + {
  2793. + _log.warn("Error while loading buff template Id " + template.getId() + " skill Id " + template.getSkillId());
  2794. + }
  2795. + else
  2796. + _buffs.add(template);
  2797. + }
  2798. +
  2799. + _log.info("BuffTemplateTable: Loaded " + _buffTemplates + " Buff Templates.");
  2800. +
  2801. + rset.close();
  2802. + statement.close();
  2803. + }
  2804. + catch (Exception e)
  2805. + {
  2806. + _log.warn("Error while loading buff templates "+e.getMessage());
  2807. + }
  2808. +
  2809. + }
  2810. + finally
  2811. + {
  2812. + try { con.close(); } catch (Exception e) {}
  2813. + }
  2814. + }
  2815. +
  2816. + /**
  2817. + * @return Returns the buffs of template by template Id
  2818. + */
  2819. + public FastList<L2BuffTemplate> getBuffTemplate(int Id)
  2820. + {
  2821. + FastList<L2BuffTemplate> _templateBuffs = new FastList<L2BuffTemplate>();
  2822. +
  2823. + for(L2BuffTemplate _bt: _buffs)
  2824. + {
  2825. + if (_bt.getId()== Id)
  2826. + {
  2827. + _templateBuffs.add(_bt);
  2828. + }
  2829. + }
  2830. +
  2831. + return _templateBuffs;
  2832. + }
  2833. +
  2834. + /**
  2835. + * @return Returns the template Id by template Name
  2836. + */
  2837. + public int getTemplateIdByName(String _name)
  2838. + {
  2839. +
  2840. + int _id = 0;
  2841. +
  2842. + for(L2BuffTemplate _bt: _buffs)
  2843. + {
  2844. + if (_bt.getName().equals(_name))
  2845. + {
  2846. + _id = _bt.getId();
  2847. + break;
  2848. + }
  2849. + }
  2850. +
  2851. + return _id;
  2852. + }
  2853. +
  2854. + /**
  2855. + * @return Returns the lowest char level for Buff template
  2856. + */
  2857. + public int getLowestLevel(int Id)
  2858. + {
  2859. + int _lowestLevel = 255;
  2860. +
  2861. + for(L2BuffTemplate _bt: _buffs)
  2862. + {
  2863. + if ((_bt.getId()== Id) && (_lowestLevel>_bt.getMinLevel()))
  2864. + {
  2865. + _lowestLevel = _bt.getMinLevel();
  2866. + }
  2867. + }
  2868. +
  2869. + return _lowestLevel;
  2870. + }
  2871. +
  2872. + /**
  2873. + * @return Returns the highest char level for Buff template
  2874. + */
  2875. + public int getHighestLevel(int Id)
  2876. + {
  2877. + int _highestLevel = 0;
  2878. +
  2879. + for(L2BuffTemplate _bt: _buffs)
  2880. + {
  2881. + if ((_bt.getId()== Id) && (_highestLevel<_bt.getMaxLevel()))
  2882. + {
  2883. + _highestLevel = _bt.getMaxLevel();
  2884. + }
  2885. + }
  2886. +
  2887. + return _highestLevel;
  2888. + }
  2889. +
  2890. + /**
  2891. + * @return Returns the buff templates list
  2892. + */
  2893. + public FastList<L2BuffTemplate> getBuffTemplateTable()
  2894. + {
  2895. + return _buffs;
  2896. + }
  2897. +
  2898. +}
  2899. Index: /trunk/Game/config/Modifications.properties
  2900. ===================================================================
  2901. --- /trunk/Game/config/Modifications.properties (revision 679)
  2902. +++ /trunk/Game/config/Modifications.properties (revision 681)
  2903. @@ -283,5 +283,25 @@
  2904. # When event starts, the participants lose/keep their effects. (debuffing, etc.)
  2905. DMOnStartRemoveAllEffects=true
  2906.  
  2907. # Allow to unsummon the participants' pets, when event starts.
  2908. DMOnStartUnsummonPet=true
  2909. +
  2910. +#------------------------------------#
  2911. +# DeathMatch Event #
  2912. +#------------------------------------#
  2913. +# Enable Raid Engines
  2914. +RaidEnginesEnabled = false
  2915. +
  2916. +# Max number of raid events taking place at the same time
  2917. +# The number has to be equal or smaller than the number of spawns
  2918. +# defined in the table: raid_event_spawnlist !?!
  2919. +RaidMaxNumEvents = 2
  2920. +
  2921. +# Maximum Fighting time in minutes.
  2922. +RaidSystemFightTime = 60
  2923. +
  2924. +# Give Buffs when Event Start !??
  2925. +RaidGiveBuffs = true
  2926. +
  2927. +# Resurrect Player upon death automatically !??
  2928. +RaidResurrectPlayer = true
  2929.  
  2930. Index: /trunk/Data/sql/raid_prizes.sql
  2931. ===================================================================
  2932. --- /trunk/Data/sql/raid_prizes.sql (revision 683)
  2933. +++ /trunk/Data/sql/raid_prizes.sql (revision 683)
  2934. @@ -0,0 +1,28 @@
  2935. +SET FOREIGN_KEY_CHECKS=0;
  2936. +-- ----------------------------
  2937. +-- Table structure for raid_prizes
  2938. +-- ----------------------------
  2939. +CREATE TABLE `raid_prizes` (
  2940. + `prize_package_id` int(11) NOT NULL,
  2941. + `first_prize_id` int(11) NOT NULL,
  2942. + `first_prize_ammount` int(11) NOT NULL,
  2943. + `second_prize_id` int(11) NOT NULL,
  2944. + `second_prize_ammount` int(11) NOT NULL,
  2945. + `event_points_ammount` int(11) NOT NULL,
  2946. + PRIMARY KEY (`prize_package_id`)
  2947. +) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  2948. +
  2949. +-- ----------------------------
  2950. +-- Records
  2951. +-- ----------------------------
  2952. +INSERT INTO `raid_prizes` VALUES ('1', '3470', '15', '6393', '20', '3');
  2953. +INSERT INTO `raid_prizes` VALUES ('2', '3470', '25', '6393', '35', '4');
  2954. +INSERT INTO `raid_prizes` VALUES ('3', '3470', '40', '6393', '40', '5');
  2955. +INSERT INTO `raid_prizes` VALUES ('4', '3470', '50', '6393', '50', '10');
  2956. +INSERT INTO `raid_prizes` VALUES ('5', '3470', '75', '6393', '75', '15');
  2957. +INSERT INTO `raid_prizes` VALUES ('6', '3470', '150', '6393', '150', '20');
  2958. +INSERT INTO `raid_prizes` VALUES ('7', '3470', '3', '6393', '10', '1');
  2959. +INSERT INTO `raid_prizes` VALUES ('8', '3470', '6', '6393', '15', '2');
  2960. +INSERT INTO `raid_prizes` VALUES ('9', '3470', '8', '6393', '18', '2');
  2961. +INSERT INTO `raid_prizes` VALUES ('10', '3470', '20', '6393', '30', '3');
  2962. +INSERT INTO `raid_prizes` VALUES ('11', '3470', '30', '6393', '40', '5');
  2963. Index: /trunk/Data/sql/characters.sql
  2964. ===================================================================
  2965. --- /trunk/Data/sql/characters.sql (revision 379)
  2966. +++ /trunk/Data/sql/characters.sql (revision 683)
  2967. @@ -79,8 +79,9 @@
  2968. varka_ketra_ally int(1) NOT NULL DEFAULT 0,
  2969. clan_join_expiry_time DECIMAL(20,0) NOT NULL DEFAULT 0,
  2970. clan_create_expiry_time DECIMAL(20,0) NOT NULL DEFAULT 0,
  2971. death_penalty_level int(2) NOT NULL DEFAULT 0,
  2972. donator varchar(5) NOT NULL default 0,
  2973. + `event_points` DECIMAL( 11,0 )default NUL;
  2974. PRIMARY KEY (obj_Id),
  2975. KEY `clanid` (`clanid`)
  2976. ) ;
  2977. Index: /trunk/Data/sql/npc.sql
  2978. ===================================================================
  2979. --- /trunk/Data/sql/npc.sql (revision 256)
  2980. +++ /trunk/Data/sql/npc.sql (revision 683)
  2981. @@ -6603,10 +6603,12 @@
  2982.  
  2983. INSERT INTO `npc` VALUES
  2984. (50007,31324,'Andromeda',1,'Wedding Manager',1,'NPC.a_casino_FDarkElf',8.00,23.00,70,'female','L2WeddingManager',40,3862,1493,11.85,2.78,40,43,30,21,20,10,0,0,1314,470,780,382,278,0,333,316,0,0,55,132,NULL,0,1,0,'LAST_HIT'),
  2985. (70010,31606,'Catrina',1,'TvT Event Manager',1,'Monster2.queen_of_cat',8.00,15.00,70,'female','L2TvTEventNpc',40,3862,1493,11.85,2.78,40,43,30,21,20,10,0,0,1314,470,780,382,278,0,333,0,0,0,28,132,NULL,0,0,0,'LAST_HIT');
  2986.  
  2987. +INSERT INTO `npc` VALUES (12901,30598,'Event Manager',1,'Raid Event',1,'NPC.a_casino_MHuman',8.00,23.00,70,male,L2EventManager,40,3862,1493,3.95,2.78,40,43,30,21,20,10,0,0,1314,470,780,382,278,0,333,0,0,0,55,120,NILL,0,1,0,'LAST_HIT');
  2988. +
  2989. UPDATE `npc` SET `type` = 'L2NpcWalker' WHERE `id` IN (31358,31359,31360,31361,31362,31363,31357,31356,31364,31365,32070,32072);
  2990.  
  2991. -- Try lowering walkspeed of walking NPC since seems to walk faster than retail
  2992. UPDATE `npc` SET `runspd` = '45', `walkspd` = '45' WHERE `id` = '31360';
  2993. UPDATE `npc` SET `runspd` = '45', `walkspd` = '45' WHERE `id` = '31362';
  2994. Index: /trunk/Data/sql/buff_templates.sql
  2995. ===================================================================
  2996. --- /trunk/Data/sql/buff_templates.sql (revision 683)
  2997. +++ /trunk/Data/sql/buff_templates.sql (revision 683)
  2998. @@ -0,0 +1,209 @@
  2999. +-- ----------------------------
  3000. +-- Table structure for buff_templates
  3001. +-- ----------------------------
  3002. +CREATE TABLE `buff_templates` (
  3003. + `id` int(11) unsigned NOT NULL,
  3004. + `name` varchar(35) NOT NULL default '',
  3005. + `skill_id` int(10) unsigned NOT NULL,
  3006. + `skill_name` varchar(35) default NULL,
  3007. + `skill_level` int(10) unsigned NOT NULL default '1',
  3008. + `skill_force` int(1) NOT NULL default '1',
  3009. + `skill_order` int(10) unsigned NOT NULL,
  3010. + `char_min_level` int(10) unsigned NOT NULL default '0',
  3011. + `char_max_level` int(10) unsigned NOT NULL default '0',
  3012. + `char_race` int(1) unsigned NOT NULL default '0',
  3013. + `char_class` int(1) NOT NULL default '0',
  3014. + `char_faction` int(10) unsigned NOT NULL default '0',
  3015. + `price_adena` int(10) unsigned NOT NULL default '0',
  3016. + `price_points` int(10) unsigned NOT NULL default '0',
  3017. + PRIMARY KEY (`id`,`name`,`skill_order`)
  3018. +) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  3019. +
  3020. +-- ----------------------------
  3021. +-- Records
  3022. +-- ----------------------------
  3023. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1033', 'Resist Poison', '3', '1', '1', '1', '40', '0', '0', '0', '0', '0');
  3024. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1032', 'Invigor', '3', '0', '2', '1', '40', '0', '0', '0', '0', '0');
  3025. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1040', 'Shield', '3', '0', '3', '1', '40', '0', '0', '0', '0', '0');
  3026. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1035', 'Mental Shield', '4', '0', '4', '1', '40', '0', '0', '0', '0', '0');
  3027. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1259', 'Resist Shock', '4', '0', '5', '1', '40', '0', '0', '0', '0', '0');
  3028. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1204', 'Wind Walk', '2', '0', '6', '1', '40', '0', '0', '0', '0', '0');
  3029. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1257', 'Decrease Weight', '3', '0', '7', '1', '40', '0', '0', '0', '0', '0');
  3030. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1045', 'Bless the Body', '6', '0', '8', '1', '40', '0', '0', '0', '0', '0');
  3031. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1078', 'Concentration', '6', '0', '9', '1', '40', '0', '0', '0', '0', '0');
  3032. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1303', 'Wild Magic', '2', '0', '10', '1', '40', '0', '2', '0', '0', '0');
  3033. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1048', 'Bless the Soul', '6', '0', '11', '1', '40', '0', '2', '0', '0', '0');
  3034. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1085', 'Acumen', '3', '0', '12', '1', '40', '0', '2', '0', '0', '0');
  3035. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1059', 'Empower', '3', '0', '13', '1', '40', '0', '2', '0', '0', '0');
  3036. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1010', 'Soul Shield', '3', '0', '14', '1', '40', '0', '2', '0', '0', '0');
  3037. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1068', 'Might', '3', '0', '15', '1', '40', '0', '1', '0', '0', '0');
  3038. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1086', 'Haste', '2', '0', '16', '1', '40', '0', '1', '0', '0', '0');
  3039. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1077', 'Focus', '3', '0', '17', '1', '40', '0', '1', '0', '0', '0');
  3040. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1242', 'Death Whisper', '3', '0', '18', '1', '40', '0', '1', '0', '0', '0');
  3041. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1268', 'Vampiric Rage', '4', '0', '19', '1', '40', '0', '1', '0', '0', '0');
  3042. +INSERT INTO `buff_templates` VALUES ('2', 'ResistBuffs', '1033', 'Resist Poison', '3', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3043. +INSERT INTO `buff_templates` VALUES ('2', 'ResistBuffs', '1032', 'Invigor', '3', '0', '2', '1', '80', '0', '0', '0', '200000', '0');
  3044. +INSERT INTO `buff_templates` VALUES ('2', 'ResistBuffs', '1352', 'Elemental Protection', '1', '0', '3', '1', '80', '0', '0', '0', '200000', '0');
  3045. +INSERT INTO `buff_templates` VALUES ('2', 'ResistBuffs', '1392', 'Holy Resistance', '3', '0', '4', '1', '80', '0', '0', '0', '200000', '0');
  3046. +INSERT INTO `buff_templates` VALUES ('2', 'ResistBuffs', '1393', 'Unholy Resistance', '3', '0', '5', '1', '80', '0', '0', '0', '200000', '0');
  3047. +INSERT INTO `buff_templates` VALUES ('2', 'ResistBuffs', '1035', 'Mental Shield', '4', '0', '6', '1', '80', '0', '0', '0', '200000', '0');
  3048. +INSERT INTO `buff_templates` VALUES ('2', 'ResistBuffs', '1259', 'Resist Shock', '4', '0', '7', '1', '80', '0', '0', '0', '200000', '0');
  3049. +INSERT INTO `buff_templates` VALUES ('2', 'ResistBuffs', '1354', 'Arcane Protection', '1', '0', '8', '1', '80', '0', '0', '0', '200000', '0');
  3050. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1204', 'Wind Walk', '2', '0', '1', '1', '80', '0', '0', '0', '250000', '0');
  3051. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1257', 'Decrease Weight', '3', '0', '2', '1', '80', '0', '0', '0', '100000', '0');
  3052. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1073', 'Kiss of Eva', '2', '0', '3', '1', '80', '0', '0', '0', '20000', '0');
  3053. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1040', 'Shield', '3', '0', '4', '1', '80', '0', '0', '0', '150000', '0');
  3054. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1068', 'Might', '3', '0', '5', '1', '80', '0', '1', '0', '200000', '0');
  3055. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1086', 'Haste', '2', '0', '6', '1', '80', '0', '1', '0', '250000', '0');
  3056. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1077', 'Focus', '3', '0', '7', '1', '80', '0', '1', '0', '250000', '0');
  3057. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1242', 'Death Whisper', '3', '0', '8', '1', '80', '0', '1', '0', '250000', '0');
  3058. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1045', 'Bless the Body', '6', '0', '9', '1', '80', '0', '0', '0', '250000', '0');
  3059. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1044', 'Regeneration', '3', '0', '10', '1', '80', '0', '0', '0', '100000', '0');
  3060. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1240', 'Guidance', '3', '0', '11', '1', '80', '0', '1', '0', '150000', '0');
  3061. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1087', 'Agility', '3', '0', '12', '1', '80', '0', '1', '0', '150000', '0');
  3062. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1010', 'Soul Shield', '3', '0', '13', '1', '80', '0', '1', '0', '150000', '0');
  3063. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1036', 'Magic Barrier', '2', '0', '14', '1', '80', '0', '1', '0', '100000', '0');
  3064. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1243', 'Bless Shield', '6', '0', '15', '1', '80', '0', '1', '0', '100000', '0');
  3065. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1268', 'Vampiric Rage', '4', '0', '16', '1', '80', '0', '1', '0', '200000', '0');
  3066. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1303', 'Wild Magic', '2', '0', '17', '1', '80', '0', '2', '0', '250000', '0');
  3067. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1048', 'Bless the Soul', '6', '0', '18', '1', '80', '0', '2', '0', '250000', '0');
  3068. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1078', 'Concentration', '6', '0', '19', '1', '80', '0', '2', '0', '200000', '0');
  3069. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1085', 'Acumen', '3', '0', '20', '1', '80', '0', '2', '0', '250000', '0');
  3070. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1059', 'Empower', '3', '0', '21', '1', '80', '0', '2', '0', '250000', '0');
  3071. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1062', 'Berserker Spirit', '2', '0', '22', '1', '80', '0', '0', '0', '200000', '0');
  3072. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '275', 'Dance of Fury', '1', '0', '23', '1', '80', '0', '1', '0', '1000000', '0');
  3073. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '274', 'Dance of Fire', '1', '0', '24', '1', '80', '0', '1', '0', '1000000', '0');
  3074. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '271', 'Dance of Warrior', '1', '0', '25', '1', '80', '0', '1', '0', '1000000', '0');
  3075. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '264', 'Song of Earth', '1', '0', '26', '1', '80', '0', '0', '0', '750000', '0');
  3076. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '269', 'Song of Hunter', '1', '0', '27', '1', '80', '0', '1', '0', '1000000', '0');
  3077. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '267', 'Song of Warding', '1', '0', '28', '1', '80', '0', '0', '0', '750000', '0');
  3078. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '276', 'Dance of Concentration', '1', '0', '29', '1', '80', '0', '2', '0', '1000000', '0');
  3079. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '273', 'Dance of Mystic', '1', '0', '30', '1', '80', '0', '2', '0', '1000000', '0');
  3080. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '311', 'Dance of Protection', '1', '0', '31', '1', '80', '0', '0', '0', '750000', '0');
  3081. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '265', 'Song of Life', '1', '0', '32', '1', '80', '0', '0', '0', '750000', '0');
  3082. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '363', 'Song of Meditation', '1', '0', '33', '1', '80', '0', '2', '0', '1000000', '0');
  3083. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '349', 'Song of Renewal', '1', '0', '34', '1', '80', '0', '2', '0', '1000000', '0');
  3084. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1040', 'Shield', '3', '0', '1', '1', '80', '0', '0', '0', '150000', '0');
  3085. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1036', 'Magic Barrier', '2', '0', '2', '1', '80', '0', '0', '0', '200000', '0');
  3086. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1045', 'Bless the Body', '6', '0', '3', '1', '80', '0', '0', '0', '250000', '0');
  3087. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1048', 'Bless the Soul', '6', '0', '4', '1', '80', '0', '0', '0', '250000', '0');
  3088. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1243', 'Bless Shield', '6', '0', '5', '1', '80', '0', '0', '0', '100000', '0');
  3089. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1352', 'Elemental Protection', '1', '0', '6', '1', '80', '0', '0', '0', '100000', '0');
  3090. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1204', 'Wind Walk', '2', '0', '7', '1', '80', '0', '0', '0', '250000', '0');
  3091. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1062', 'Berserker Spirit', '2', '0', '8', '1', '80', '0', '0', '0', '200000', '0');
  3092. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1032', 'Invigor', '3', '0', '9', '1', '80', '0', '0', '0', '100000', '0');
  3093. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1035', 'Mental Shield', '4', '0', '10', '1', '80', '0', '0', '0', '150000', '0');
  3094. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1259', 'Resist Shock', '4', '0', '11', '1', '80', '0', '0', '0', '150000', '0');
  3095. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1044', 'Regeneration', '3', '0', '12', '1', '80', '0', '0', '0', '100000', '0');
  3096. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1068', 'Might', '3', '0', '13', '1', '80', '0', '1', '0', '200000', '0');
  3097. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1086', 'Haste', '2', '0', '14', '1', '80', '0', '1', '0', '250000', '0');
  3098. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1077', 'Focus', '3', '0', '15', '1', '80', '0', '1', '0', '250000', '0');
  3099. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1242', 'Death Whisper', '3', '0', '16', '1', '80', '0', '1', '0', '250000', '0');
  3100. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1268', 'Vampiric Rage', '4', '0', '17', '1', '80', '0', '1', '0', '200000', '0');
  3101. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1087', 'Agility', '3', '0', '18', '1', '80', '0', '1', '0', '150000', '0');
  3102. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1240', 'Guidance', '3', '0', '19', '1', '80', '0', '1', '0', '150000', '0');
  3103. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1059', 'Empower', '3', '0', '20', '1', '80', '0', '2', '0', '250000', '0');
  3104. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1078', 'Concentration', '6', '0', '21', '1', '80', '0', '2', '0', '200000', '0');
  3105. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1085', 'Acumen', '3', '0', '22', '1', '80', '0', '2', '0', '250000', '0');
  3106. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '364', 'Song of Champion', '1', '0', '1', '1', '80', '0', '0', '0', '750000', '0');
  3107. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '264', 'Song of Earth', '1', '0', '2', '1', '80', '0', '0', '0', '750000', '0');
  3108. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '306', 'Song of Flame Guard', '1', '0', '3', '1', '80', '0', '0', '0', '750000', '0');
  3109. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '308', 'Song of Storm Guard', '1', '0', '4', '1', '80', '0', '0', '0', '750000', '0');
  3110. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '270', 'Song of Invocation', '1', '0', '5', '1', '80', '0', '0', '0', '750000', '0');
  3111. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '265', 'Song of Life', '1', '0', '6', '1', '80', '0', '0', '0', '750000', '0');
  3112. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '349', 'Sonf of Renewal', '1', '0', '7', '1', '80', '0', '0', '0', '750000', '0');
  3113. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '267', 'Song of Warding', '1', '0', '8', '1', '80', '0', '0', '0', '750000', '0');
  3114. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '266', 'Song of Water', '1', '0', '9', '1', '80', '0', '0', '0', '750000', '0');
  3115. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '268', 'Song of Wind', '1', '0', '10', '1', '80', '0', '0', '0', '750000', '0');
  3116. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '305', 'Song of Vengance', '1', '0', '11', '1', '80', '0', '1', '0', '1000000', '0');
  3117. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '269', 'Song of Hunter', '1', '0', '12', '1', '80', '0', '1', '0', '1000000', '0');
  3118. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '363', 'Song of Meditation', '1', '0', '13', '1', '80', '0', '2', '0', '1000000', '0');
  3119. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '307', 'Dance of Aqua Guard', '1', '0', '1', '1', '80', '0', '0', '0', '750000', '0');
  3120. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '309', 'Dance of Earth Guard', '1', '0', '2', '1', '80', '0', '0', '0', '750000', '0');
  3121. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '311', 'Dance of Protection', '1', '0', '3', '1', '80', '0', '0', '0', '750000', '0');
  3122. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '274', 'Dance of Fire', '1', '0', '4', '1', '80', '0', '1', '0', '1000000', '0');
  3123. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '275', 'Dance of Fury', '1', '0', '5', '1', '80', '0', '1', '0', '1000000', '0');
  3124. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '272', 'Dance of Inspiration', '1', '0', '6', '1', '80', '0', '1', '0', '1000000', '0');
  3125. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '277', 'Dance of Light', '1', '0', '7', '1', '80', '0', '1', '0', '1000000', '0');
  3126. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '310', 'Dance of Vampire', '1', '0', '8', '1', '80', '0', '1', '0', '1000000', '0');
  3127. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '271', 'Dance of Warrior', '1', '0', '9', '1', '80', '0', '1', '0', '1000000', '0');
  3128. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '276', 'Dance of Concentration', '1', '0', '10', '1', '80', '0', '2', '0', '1000000', '0');
  3129. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '273', 'Dance of Mystic', '1', '0', '11', '1', '80', '0', '2', '0', '1000000', '0');
  3130. +INSERT INTO `buff_templates` VALUES ('7', 'WindWalk', '1204', 'Wind Walk', '2', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3131. +INSERT INTO `buff_templates` VALUES ('8', 'DWeight', '1257', 'Decrease Weight', '1', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3132. +INSERT INTO `buff_templates` VALUES ('9', 'Shield', '1040', 'Shield', '3', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3133. +INSERT INTO `buff_templates` VALUES ('10', 'Might', '1068', 'Might', '3', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3134. +INSERT INTO `buff_templates` VALUES ('11', 'MShield', '1035', 'Mental Shield', '4', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3135. +INSERT INTO `buff_templates` VALUES ('12', 'BTB', '1045', 'Bless the Body', '6', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3136. +INSERT INTO `buff_templates` VALUES ('13', 'BTS', '1048', 'Bless the Soul', '6', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3137. +INSERT INTO `buff_templates` VALUES ('14', 'MBarrier', '1036', 'Magic Barrier', '2', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3138. +INSERT INTO `buff_templates` VALUES ('15', 'RShock', '1259', 'Resist Shock', '4', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3139. +INSERT INTO `buff_templates` VALUES ('16', 'Concentration', '1078', 'Concentration', '6', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3140. +INSERT INTO `buff_templates` VALUES ('17', 'BerserkerSpirit', '1062', 'Berserker Spirit', '2', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3141. +INSERT INTO `buff_templates` VALUES ('18', 'BTShield', '1243', 'Bless Shield', '6', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3142. +INSERT INTO `buff_templates` VALUES ('19', 'VRage', '1268', 'Vampiric Rage', '4', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3143. +INSERT INTO `buff_templates` VALUES ('20', 'Acumen', '1085', 'Acumen', '3', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3144. +INSERT INTO `buff_templates` VALUES ('21', 'Empower', '1059', 'Empower', '3', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3145. +INSERT INTO `buff_templates` VALUES ('22', 'Haste', '1086', 'Haste', '2', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3146. +INSERT INTO `buff_templates` VALUES ('23', 'Guidance', '1240', 'Guidance', '3', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3147. +INSERT INTO `buff_templates` VALUES ('24', 'Focus', '1077', 'Focus', '3', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3148. +INSERT INTO `buff_templates` VALUES ('25', 'DeathWhisper', '1242', 'Death Whisper', '3', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  3149. +INSERT INTO `buff_templates` VALUES ('26', 'DWarrior', '271', 'Dance of Warrior', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3150. +INSERT INTO `buff_templates` VALUES ('27', 'DInspiration', '272', 'Dance of Inspiration', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3151. +INSERT INTO `buff_templates` VALUES ('28', 'DMystic', '273', 'Dance of Mystic', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3152. +INSERT INTO `buff_templates` VALUES ('29', 'DFire', '274', 'Dance of Fire', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3153. +INSERT INTO `buff_templates` VALUES ('30', 'DFury', '275', 'Dance of Fury', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3154. +INSERT INTO `buff_templates` VALUES ('31', 'DConecntration', '276', 'Dance of Concentration', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3155. +INSERT INTO `buff_templates` VALUES ('32', 'DLight', '277', 'Dance of Light', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3156. +INSERT INTO `buff_templates` VALUES ('33', 'DAqua', '307', 'Dance of Aqua Guard', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3157. +INSERT INTO `buff_templates` VALUES ('34', 'DEarth', '309', 'Dance of Earth Guard', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3158. +INSERT INTO `buff_templates` VALUES ('35', 'DVampire', '310', 'Dance of Vampire', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3159. +INSERT INTO `buff_templates` VALUES ('36', 'DProtection', '311', 'Dance of Protection', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3160. +INSERT INTO `buff_templates` VALUES ('37', 'SEarth', '264', 'Song of Earth', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3161. +INSERT INTO `buff_templates` VALUES ('38', 'SLife', '265', 'Song of Life', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3162. +INSERT INTO `buff_templates` VALUES ('39', 'SWater', '266', 'Song of Water', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3163. +INSERT INTO `buff_templates` VALUES ('40', 'SWarding', '267', 'Song of Warding', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3164. +INSERT INTO `buff_templates` VALUES ('41', 'SWind', '268', 'Song of Wind', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3165. +INSERT INTO `buff_templates` VALUES ('42', 'SHunter', '269', 'Song of Hunter', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3166. +INSERT INTO `buff_templates` VALUES ('43', 'SInvocation', '270', 'Song of Invocation', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3167. +INSERT INTO `buff_templates` VALUES ('44', 'SVengance', '305', 'Song of Vengance', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3168. +INSERT INTO `buff_templates` VALUES ('45', 'SFlameGuard', '306', 'Song of Flame Guard', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3169. +INSERT INTO `buff_templates` VALUES ('46', 'SStormGuard', '308', 'Song of Storm Guard', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3170. +INSERT INTO `buff_templates` VALUES ('47', 'SRenewal', '349', 'Song of Renewal', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3171. +INSERT INTO `buff_templates` VALUES ('48', 'SChampion', '364', 'Song of Champion', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  3172. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1204', 'Wind Walk', '2', '0', '1', '1', '80', '0', '0', '0', '0', '0');
  3173. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1257', 'Decrease Weight', '3', '0', '2', '1', '80', '0', '0', '0', '0', '0');
  3174. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1045', 'Bless The Body', '6', '0', '3', '1', '80', '0', '0', '0', '0', '0');
  3175. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1048', 'Bess The Soul', '6', '1', '4', '1', '80', '0', '0', '0', '0', '0');
  3176. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1085', 'Acumen', '3', '1', '5', '1', '80', '0', '0', '0', '0', '0');
  3177. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1059', 'Empower', '3', '1', '6', '1', '80', '0', '0', '0', '0', '0');
  3178. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1068', 'Might', '3', '1', '7', '1', '80', '0', '0', '0', '0', '0');
  3179. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1086', 'Haste', '2', '1', '8', '1', '80', '0', '0', '0', '0', '0');
  3180. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1268', 'Vampiric Rage', '4', '1', '9', '1', '80', '0', '0', '0', '0', '0');
  3181. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1040', 'Shield', '3', '1', '10', '1', '80', '0', '0', '0', '0', '0');
  3182. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1036', 'Magic Barrier', '2', '1', '11', '1', '80', '0', '0', '0', '0', '0');
  3183. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1035', 'Mental Shield', '4', '1', '12', '1', '80', '0', '0', '0', '0', '0');
  3184. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1204', 'Wind Walk', '1', '1', '1', '1', '80', '0', '0', '0', '0', '0');
  3185. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1257', 'Decrease Weight', '2', '1', '2', '1', '80', '0', '0', '0', '0', '0');
  3186. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1045', 'Bless The Body', '3', '1', '3', '1', '80', '0', '0', '0', '0', '0');
  3187. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1048', 'Bess The Soul', '3', '1', '4', '1', '80', '0', '0', '0', '0', '0');
  3188. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1085', 'Acumen', '2', '1', '5', '1', '80', '0', '0', '0', '0', '0');
  3189. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1059', 'Empower', '1', '1', '6', '1', '80', '0', '0', '0', '0', '0');
  3190. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1068', 'Might', '2', '1', '7', '1', '80', '0', '0', '0', '0', '0');
  3191. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1086', 'Haste', '1', '1', '8', '1', '80', '0', '0', '0', '0', '0');
  3192. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1268', 'Vampiric Rage', '2', '1', '9', '1', '80', '0', '0', '0', '0', '0');
  3193. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1040', 'Shield', '2', '1', '10', '1', '80', '0', '0', '0', '0', '0');
  3194. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1036', 'Magic Barrier', '1', '1', '11', '1', '80', '0', '0', '0', '0', '0');
  3195. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1035', 'Mental Shield', '2', '1', '12', '1', '80', '0', '0', '0', '0', '0');
  3196. +INSERT INTO `buff_templates` VALUES ('51', 'SongOfVitality', '304', 'Song of Vitality', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  3197. +INSERT INTO `buff_templates` VALUES ('52', 'POF', '1356', 'Prophecy of Fire', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  3198. +INSERT INTO `buff_templates` VALUES ('53', 'GMight', '1388', 'Greater Might', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  3199. +INSERT INTO `buff_templates` VALUES ('54', 'GShield', '1389', 'Greater Shield', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  3200. +INSERT INTO `buff_templates` VALUES ('55', 'ChOV', '1363', 'Chant of Victory', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  3201. +INSERT INTO `buff_templates` VALUES ('56', 'ChOS', '1362', 'Chant of Spirit', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  3202. +INSERT INTO `buff_templates` VALUES ('57', 'ChOF', '1002', 'Chant of Flame', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  3203. +INSERT INTO `buff_templates` VALUES ('58', 'SirensDance', '365', 'Siren\'s Dance', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  3204. +INSERT INTO `buff_templates` VALUES ('59', 'WildMagic', '1303', 'Wild Magic', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  3205. +INSERT INTO `buff_templates` VALUES ('60', 'POW', '1355', 'Prophecy of Water', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  3206. +INSERT INTO `buff_templates` VALUES ('61', 'GiftOfQueen', '4700', 'Gift Of Queen', '1', '1', '1', '1', '80', '0', '0', '0', '0', '3');
  3207. +INSERT INTO `buff_templates` VALUES ('62', 'BlessingofQueen', '4699', 'Blessing of Queen', '1', '1', '1', '1', '80', '0', '0', '0', '0', '3');
  3208. Index: /trunk/Data/sql/raid_events_spawnlist.sql
  3209. ===================================================================
  3210. --- /trunk/Data/sql/raid_events_spawnlist.sql (revision 683)
  3211. +++ /trunk/Data/sql/raid_events_spawnlist.sql (revision 683)
  3212. @@ -0,0 +1,24 @@
  3213. +SET FOREIGN_KEY_CHECKS=0;
  3214. +-- ----------------------------
  3215. +-- Table structure for raid_events_spawnlist
  3216. +-- ----------------------------
  3217. +CREATE TABLE `raid_event_spawnlist` (
  3218. + `id` int(11) NOT NULL auto_increment,
  3219. + `location` varchar(40) NOT NULL default '',
  3220. + `raid_locX` int(9) NOT NULL,
  3221. + `raid_locY` int(9) NOT NULL,
  3222. + `raid_locZ` int(9) NOT NULL,
  3223. + `player_locX` int(9) NOT NULL,
  3224. + `player_locY` int(9) NOT NULL,
  3225. + `player_locZ` int(9) NOT NULL,
  3226. + PRIMARY KEY (`id`)
  3227. +) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  3228. +
  3229. +-- ----------------------------
  3230. +-- Records
  3231. +-- ----------------------------
  3232. +INSERT INTO `raid_event_spawnlist` VALUES ('1', 'Test', '-93287', '-251026', '-3336', '-94347', '-251026', '-3136');
  3233. +INSERT INTO `raid_event_spawnlist` VALUES ('2', 'Test', '-87131', '-257755', '-3336', '-88020', '-257755', '-3136');
  3234. +INSERT INTO `raid_event_spawnlist` VALUES ('3', 'Test', '174167', '-75329', '-5107', '174085', '-76703', '-5007');
  3235. +INSERT INTO `raid_event_spawnlist` VALUES ('4', 'Test', '174252', '-88483', '-5139', '174242', '-86548', '-5007');
  3236. +INSERT INTO `raid_event_spawnlist` VALUES ('5', 'Test', '174091', '-82305', '-5123', '174103', '-80650', '-5007');
  3237. Index: /trunk/Data/data/html/event/12901-1.htm
  3238. ===================================================================
  3239. --- /trunk/Data/data/html/event/12901-1.htm (revision 683)
  3240. +++ /trunk/Data/data/html/event/12901-1.htm (revision 683)
  3241. @@ -0,0 +1,16 @@
  3242. +<html><title>FizBan Event Manager</title><body>
  3243. +<br><br>
  3244. +<img src="L2UI_CH3.onscrmsg_pattern01_1" width=300 height=32 align=left>
  3245. +<br>
  3246. +<table width=255><tr><td valign=top width=255>
  3247. +<center>Clan Events</center><br><br>
  3248. +In this section you can select the mob type that you'd like to fight against.
  3249. +<br>
  3250. +Tell me, against which kind of mob would you like to fight against?
  3251. +<br>
  3252. +<br><a action="bypass -h npc_%objectId%_Chat 4">Group of Mobs</a>
  3253. +<br><a action="bypass -h npc_%objectId%_Chat 5">Grand Bosses</a>
  3254. +</td></tr></table>
  3255. +<br><br><br>
  3256. +<img src="L2UI_CH3.onscrmsg_pattern01_2" width=300 height=32 align=left>
  3257. +</body></html>
  3258. Index: /trunk/Data/data/html/event/12901-10.htm
  3259. ===================================================================
  3260. --- /trunk/Data/data/html/event/12901-10.htm (revision 683)
  3261. +++ /trunk/Data/data/html/event/12901-10.htm (revision 683)
  3262. @@ -0,0 +1,4 @@
  3263. +<html>
  3264. +<body>
  3265. +</body>
  3266. +</html>
  3267. Index: /trunk/Data/data/html/event/12901-11.htm
  3268. ===================================================================
  3269. --- /trunk/Data/data/html/event/12901-11.htm (revision 683)
  3270. +++ /trunk/Data/data/html/event/12901-11.htm (revision 683)
  3271. @@ -0,0 +1,4 @@
  3272. +<html>
  3273. +<body>
  3274. +</body>
  3275. +</html>
  3276. Index: /trunk/Data/data/html/event/12901-2.htm
  3277. ===================================================================
  3278. --- /trunk/Data/data/html/event/12901-2.htm (revision 683)
  3279. +++ /trunk/Data/data/html/event/12901-2.htm (revision 683)
  3280. @@ -0,0 +1,15 @@
  3281. +<html><title>FizBan Event Manager</title><body>
  3282. +<br><br>
  3283. +<img src="L2UI_CH3.onscrmsg_pattern01_1" width=300 height=32 align=left>
  3284. +<br>
  3285. +<table width=255><tr><td valign=top width=255>
  3286. +<center>Party Events</center><br><br>
  3287. +In this section you can select the mob type that you'd like to fight against.
  3288. +<br>
  3289. +Tell me, against which kind of mob would you like to fight against?
  3290. +<br>
  3291. +<br><a action="bypass -h npc_%objectId%_Chat 7">Grand Bosses</a>
  3292. +</td></tr></table>
  3293. +<br><br><br>
  3294. +<img src="L2UI_CH3.onscrmsg_pattern01_2" width=300 height=32 align=left>
  3295. +</body></html>
  3296. Index: /trunk/Data/data/html/event/12901-3.htm
  3297. ===================================================================
  3298. --- /trunk/Data/data/html/event/12901-3.htm (revision 683)
  3299. +++ /trunk/Data/data/html/event/12901-3.htm (revision 683)
  3300. @@ -0,0 +1,15 @@
  3301. +<html><title>FizBan Event Manager</title><body>
  3302. +<br><br>
  3303. +<img src="L2UI_CH3.onscrmsg_pattern01_1" width=300 height=32 align=left>
  3304. +<br>
  3305. +<table width=255><tr><td valign=top width=255>
  3306. +<center>Clan Events</center>
  3307. +In this section you can select the mob against whom you'd like to fight.
  3308. +<br>
  3309. +Tell me, against which of this mobs would you like to fight against?
  3310. +
  3311. +<br><a action="bypass -h npc_%objectId%_iEvent 1 1 21380 4 1 3 1">Tepra Scarab</a>
  3312. +</td></tr></table>
  3313. +<br><br><br>
  3314. +<img src="L2UI_CH3.onscrmsg_pattern01_2" width=300 height=32 align=left>
  3315. +</body></html>
  3316. Index: /trunk/Data/data/html/event/12901.htm
  3317. ===================================================================
  3318. --- /trunk/Data/data/html/event/12901.htm (revision 683)
  3319. +++ /trunk/Data/data/html/event/12901.htm (revision 683)
  3320. @@ -0,0 +1,18 @@
  3321. +<html><title>FizBan Event Manager</title><body>
  3322. +<br><br>
  3323. +<img src="L2UI_CH3.onscrmsg_pattern01_1" width=300 height=32 align=left>
  3324. +<br>
  3325. +<table width=255><tr><td valign=top width=255><br>
  3326. +Welcome Traveler. Are you up for a BIG fight?! If so, I can help you quite a bit!
  3327. +<br>
  3328. +I can set up a fully customized event for you!
  3329. +<br>
  3330. +Wich kind of Event would you like to try?<br>
  3331. +IMPORTANT: This feature is still undergoing tests and may be buggy!If you freeze after a teleport please restart Lineage 2 by pressing ctrl+alt+del and ending lineage 2.Start the client again and your good to go!<br>
  3332. +IMPORTANT2: If you die during the event and you go back to town you will be kicked out of the raid event!<br>
  3333. +<br><a action="bypass -h npc_%objectId%_Chat 1">Clan Events</a>
  3334. +<br><a action="bypass -h npc_%objectId%_Chat 2">Party Events</a>
  3335. +</td></tr></table>
  3336. +<br><br><br>
  3337. +<img src="L2UI_CH3.onscrmsg_pattern01_2" width=300 height=32 align=left>
  3338. +</body></html>
  3339. Index: /trunk/Data/data/html/event/12901-4.htm
  3340. ===================================================================
  3341. --- /trunk/Data/data/html/event/12901-4.htm (revision 683)
  3342. +++ /trunk/Data/data/html/event/12901-4.htm (revision 683)
  3343. @@ -0,0 +1,18 @@
  3344. +<html><title>FizBan Event Manager</title><body>
  3345. +<br><br>
  3346. +<img src="L2UI_CH3.onscrmsg_pattern01_1" width=300 height=32 align=left>
  3347. +<br>
  3348. +<table width=255><tr><td valign=top width=255>
  3349. +<center>Clan Events</center>
  3350. +In this section you can select the raid you like to do.
  3351. +<br>
  3352. +Tell me, against which of these mobs would you like to fight against?<br>
  3353. +The price is given to every participant.You will also receive several event points depending on the difficulty of the raid. These can be used at the npc buffer to get full buffs!
  3354. +For these mobs a minimum of 4 players is required.<br>
  3355. +<br><a action="bypass -h npc_%objectId%_iEvent 2 0 22062 30 4 30 3 1">30x difficulty 3x mobs - 3Gb </a>
  3356. +<br><a action="bypass -h npc_%objectId%_iEvent 2 0 22062 40 4 30 3 2">40x difficulty 3x mobs - 6Gb </a>
  3357. +<br><a action="bypass -h npc_%objectId%_iEvent 2 0 22062 50 4 30 3 5">50x difficulty 3x mobs - 8Gb </a>
  3358. +</td></tr></table>
  3359. +<br><br><br>
  3360. +<img src="L2UI_CH3.onscrmsg_pattern01_2" width=300 height=32 align=left>
  3361. +</body></html>
  3362. Index: /trunk/Data/data/html/event/12901-5.htm
  3363. ===================================================================
  3364. --- /trunk/Data/data/html/event/12901-5.htm (revision 683)
  3365. +++ /trunk/Data/data/html/event/12901-5.htm (revision 683)
  3366. @@ -0,0 +1,21 @@
  3367. +<html><title>FizBan Event Manager</title><body>
  3368. +<br><br>
  3369. +<img src="L2UI_CH3.onscrmsg_pattern01_1" width=300 height=32 align=left>
  3370. +<br>
  3371. +<table width=255><tr><td valign=top width=255>
  3372. +<center>Clan Events</center>
  3373. +In this section you can select the raid you like to do.
  3374. +<br>
  3375. +Tell me, against which of these mobs would you like to fight against?<br>
  3376. +The price is given to every participant.You will also receive several event points depending on the difficulty of the raid. These can be used at the npc buffer to get full buffs!
  3377. +For these bosses a minimum of 8 players is required.<br>
  3378. +<br><a action="bypass -h npc_%objectId%_iEvent 2 0 25234 2 8 30 3 1">2x Ancient Dragon - 15Gb </a>
  3379. +<br><a action="bypass -h npc_%objectId%_iEvent 2 0 25125 2 8 30 3 2">2x Tiger King - 25Gb </a>
  3380. +<br><a action="bypass -h npc_%objectId%_iEvent 2 0 25126 2 8 30 3 3">2x Longhorn - 40Gb </a>
  3381. +<br><a action="bypass -h npc_%objectId%_iEvent 2 0 29020 2 8 30 3 4">2x Baium - 50Gb </a>
  3382. +<br><a action="bypass -h npc_%objectId%_iEvent 2 0 29019 1 8 30 3 5">1x Antharas - 75Gb </a>
  3383. +<br><a action="bypass -h npc_%objectId%_iEvent 2 0 29028 1 8 30 3 6">1x Valakas - 150Gb </a>
  3384. +</td></tr></table>
  3385. +<br><br><br>
  3386. +<img src="L2UI_CH3.onscrmsg_pattern01_2" width=300 height=32 align=left>
  3387. +</body></html>
  3388. Index: /trunk/Data/data/html/event/12901-6.htm
  3389. ===================================================================
  3390. --- /trunk/Data/data/html/event/12901-6.htm (revision 683)
  3391. +++ /trunk/Data/data/html/event/12901-6.htm (revision 683)
  3392. @@ -0,0 +1,16 @@
  3393. +<html><title>FizBan Event Manager</title><body>
  3394. +<br><br>
  3395. +<img src="L2UI_CH3.onscrmsg_pattern01_1" width=300 height=32 align=left>
  3396. +<br>
  3397. +<table width=255><tr><td valign=top width=255>
  3398. +<center>Clan Events</center>
  3399. +In this section you can select the mob against whom you'd like to fight.
  3400. +<br>
  3401. +Tell me, against which of this mobs would you like to fight against?
  3402. +<br>
  3403. +Others Will soon be aviable, this is only for testing purposes.
  3404. +<br><a action="bypass -h npc_%objectId%_iEvent 1 1 21380 4 1 3 1">Tepra Scarab [Testing]</a>
  3405. +</td></tr></table>
  3406. +<br><br><br>
  3407. +<img src="L2UI_CH3.onscrmsg_pattern01_2" width=300 height=32 align=left>
  3408. +</body></html>
  3409. Index: /trunk/Data/data/html/event/12901-7.htm
  3410. ===================================================================
  3411. --- /trunk/Data/data/html/event/12901-7.htm (revision 683)
  3412. +++ /trunk/Data/data/html/event/12901-7.htm (revision 683)
  3413. @@ -0,0 +1,19 @@
  3414. +<html><title>FizBan Event Manager</title><body>
  3415. +<br><br>
  3416. +<img src="L2UI_CH3.onscrmsg_pattern01_1" width=300 height=32 align=left>
  3417. +<br>
  3418. +<table width=255><tr><td valign=top width=255>
  3419. +<center>Party Events</center>
  3420. +In this section you can select the raid you like to do.
  3421. +<br>
  3422. +Tell me, against which of these mobs would you like to fight against?<br>
  3423. +The price is given to every participant.You will also receive several event points depending on the difficulty of the raid. These can be used at the npc buffer to get full buffs!
  3424. +For these bosses a minimum of 3 players is required to be online.<br>
  3425. +<br><a action="bypass -h npc_%objectId%_iEvent 3 0 29001 1 3 30 3 1">1x Ant Queen - 15Gb</a>
  3426. +<br><a action="bypass -h npc_%objectId%_iEvent 3 0 29014 1 3 30 3 1">1x Orfen - 15Gb</a>
  3427. +<br><a action="bypass -h npc_%objectId%_iEvent 3 0 29022 1 3 30 3 10">1x Zaken - 20Gb</a>
  3428. +<br><a action="bypass -h npc_%objectId%_iEvent 3 0 29020 1 3 30 3 11">1x Baium - 30Gb</a>
  3429. +</td></tr></table>
  3430. +<br><br><br>
  3431. +<img src="L2UI_CH3.onscrmsg_pattern01_2" width=300 height=32 align=left>
  3432. +</body></html>
  3433. Index: /trunk/Game/java/net/sf/l2j/Config.java
  3434. ===================================================================
  3435. --- /trunk/Game/java/net/sf/l2j/Config.java (revision 679)
  3436. +++ /trunk/Game/java/net/sf/l2j/Config.java (revision 681)
  3437. @@ -171,10 +171,17 @@
  3438. public static boolean TVT_EVENT_POTIONS_ALLOWED;
  3439. public static boolean TVT_EVENT_SUMMON_BY_ITEM_ALLOWED;
  3440. public static List<Integer> TVT_EVENT_DOOR_IDS = new FastList<Integer>();
  3441. public static byte TVT_EVENT_MIN_LVL;
  3442. public static byte TVT_EVENT_MAX_LVL;
  3443. +
  3444. + /** Raid Event Engine */
  3445. + public static boolean RAID_SYSTEM_ENABLED;
  3446. + public static int RAID_SYSTEM_MAX_EVENTS;
  3447. + public static boolean RAID_SYSTEM_GIVE_BUFFS;
  3448. + public static boolean RAID_SYSTEM_RESURRECT_PLAYER;
  3449. + public static int RAID_SYSTEM_FIGHT_TIME;
  3450.  
  3451. public static boolean L2JMOD_ALLOW_WEDDING;
  3452. public static int L2JMOD_WEDDING_PRICE;
  3453. public static boolean L2JMOD_WEDDING_PUNISH_INFIDELITY;
  3454. public static boolean L2JMOD_WEDDING_TELEPORT;
  3455. @@ -2011,10 +2018,21 @@
  3456. }
  3457. }
  3458. }
  3459. }
  3460. }
  3461. +
  3462. + RAID_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("RaidEnginesEnabled", "false"));
  3463. + RAID_SYSTEM_GIVE_BUFFS = Boolean.parseBoolean(L2JModSettings.getProperty("RaidGiveBuffs", "true"));
  3464. + RAID_SYSTEM_RESURRECT_PLAYER = Boolean.parseBoolean(L2JModSettings.getProperty("RaidResurrectPlayer", "true"));
  3465. + RAID_SYSTEM_MAX_EVENTS = Integer.parseInt(L2JModSettings.getProperty("RaidMaxNumEvents", "3"));
  3466. + RAID_SYSTEM_FIGHT_TIME = Integer.parseInt(L2JModSettings.getProperty("RaidSystemFightTime", "60"));
  3467. + if (RAID_SYSTEM_MAX_EVENTS == 0)
  3468. + {
  3469. + RAID_SYSTEM_ENABLED = false;
  3470. + System.out.println("Raid Engine[Config.load()]: Invalid config property: Max Events = 0?!");
  3471. + }
  3472.  
  3473. }
  3474. catch (Exception e)
  3475. {
  3476. e.printStackTrace();
  3477. Index: /trunk/Game/java/net/sf/l2j/gameserver/clientpackets/DlgAnswer.java
  3478. ===================================================================
  3479. --- /trunk/Game/java/net/sf/l2j/gameserver/clientpackets/DlgAnswer.java (revision 253)
  3480. +++ /trunk/Game/java/net/sf/l2j/gameserver/clientpackets/DlgAnswer.java (revision 681)
  3481. @@ -20,10 +20,11 @@
  3482.  
  3483. import java.util.logging.Logger;
  3484.  
  3485. import net.sf.l2j.Config;
  3486. import net.sf.l2j.gameserver.network.SystemMessageId;
  3487. +import net.sf.l2j.gameserver.model.actor.instance.L2EventManagerInstance;
  3488.  
  3489. /**
  3490. * @author Dezmond_snz
  3491. * Format: cddd
  3492. */
  3493. @@ -48,13 +49,20 @@
  3494. {
  3495. if (Config.DEBUG)
  3496. _log.fine(getType()+": Answer acepted. Message ID "+_messageId+", asnwer "+_answer+", unknown field "+_unk);
  3497. if (_messageId == SystemMessageId.RESSURECTION_REQUEST.getId())
  3498. getClient().getActiveChar().reviveAnswer(_answer);
  3499. - else if (_messageId==614 && Config.L2JMOD_ALLOW_WEDDING)
  3500. - getClient().getActiveChar().EngageAnswer(_answer);
  3501. -
  3502. + else if (_messageId==614 && getClient().getActiveChar().awaitingAnswer && Config.L2JMOD_ALLOW_WEDDING)
  3503. + {
  3504. + getClient().getActiveChar().EngageAnswer(_answer);
  3505. + getClient().getActiveChar().awaitingAnswer = false;
  3506. + }
  3507. + else if (_messageId==614 && L2EventManagerInstance._awaitingplayers.contains(getClient().getActiveChar()))
  3508. + {
  3509. + getClient().getActiveChar().setRaidAnswear(_answer);
  3510. + L2EventManagerInstance._awaitingplayers.remove(getClient().getActiveChar());
  3511. + }
  3512. }
  3513.  
  3514. @Override
  3515. public String getType()
  3516. {
  3517. Index: /trunk/Game/java/net/sf/l2j/gameserver/clientpackets/RequestRestartPoint.java
  3518. ===================================================================
  3519. --- /trunk/Game/java/net/sf/l2j/gameserver/clientpackets/RequestRestartPoint.java (revision 636)
  3520. +++ /trunk/Game/java/net/sf/l2j/gameserver/clientpackets/RequestRestartPoint.java (revision 681)
  3521. @@ -24,10 +24,11 @@
  3522. import net.sf.l2j.gameserver.datatables.MapRegionTable;
  3523. import net.sf.l2j.gameserver.instancemanager.CastleManager;
  3524. import net.sf.l2j.gameserver.instancemanager.ClanHallManager;
  3525. import net.sf.l2j.gameserver.model.L2SiegeClan;
  3526. import net.sf.l2j.gameserver.model.Location;
  3527. +import net.sf.l2j.gameserver.model.entity.L2RaidEvent;
  3528. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  3529. import net.sf.l2j.gameserver.model.entity.Castle;
  3530. import net.sf.l2j.gameserver.model.entity.ClanHall;
  3531. import net.sf.l2j.gameserver.network.SystemMessageId;
  3532. import net.sf.l2j.gameserver.serverpackets.Revive;
  3533. @@ -182,10 +183,34 @@
  3534. {
  3535. _log.warning("Living player ["+activeChar.getName()+"] called RestartPointPacket! Ban this player!");
  3536. return;
  3537. }
  3538.  
  3539. + if (activeChar.inClanEvent || activeChar.inPartyEvent || activeChar.inSoloEvent)
  3540. + {
  3541. + activeChar.inClanEvent = false;
  3542. + activeChar.inPartyEvent = false;
  3543. + activeChar.inSoloEvent = false;
  3544. + if (L2RaidEvent._eventType == 2)
  3545. + {
  3546. + if(L2RaidEvent._participatingPlayers.contains(activeChar))
  3547. + // Clear player from Event.
  3548. + L2RaidEvent._participatingPlayers.remove(activeChar);
  3549. + }
  3550. + if (L2RaidEvent._eventType == 3)
  3551. + {
  3552. + if (activeChar.getParty()!=null)
  3553. + activeChar.leaveParty();
  3554. + activeChar.sendMessage("You have been kicked from the party");
  3555. + }
  3556. + activeChar.sendMessage("You've been erased from the event!");
  3557. + int num = L2RaidEvent._participatingPlayers.size();
  3558. + if (num > 0 && num!=1)
  3559. + num -= 1;
  3560. + else
  3561. + L2RaidEvent.hardFinish();
  3562. + }
  3563.  
  3564. Castle castle = CastleManager.getInstance().getCastle(activeChar.getX(), activeChar.getY(), activeChar.getZ());
  3565. if (castle != null && castle.getSiege().getIsInProgress())
  3566. {
  3567. //DeathFinalizer df = new DeathFinalizer(10000);
  3568. Index: /trunk/Game/java/net/sf/l2j/gameserver/skills/DocumentSkill.java
  3569. ===================================================================
  3570. --- /trunk/Game/java/net/sf/l2j/gameserver/skills/DocumentSkill.java (revision 253)
  3571. +++ /trunk/Game/java/net/sf/l2j/gameserver/skills/DocumentSkill.java (revision 682)
  3572. @@ -246,90 +246,76 @@
  3573. }
  3574. }
  3575. }
  3576. for (int i=lastLvl; i < lastLvl+enchantLevels1; i++)
  3577. {
  3578. + _currentSkill.currentLevel = lastLvl-1;
  3579. + for (n=first; n != null; n = n.getNextSibling())
  3580. + {
  3581. + if ("cond".equalsIgnoreCase(n.getNodeName()))
  3582. + {
  3583. + Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  3584. + Node msg = n.getAttributes().getNamedItem("msg");
  3585. + if (condition != null && msg != null)
  3586. + condition.setMessage(msg.getNodeValue());
  3587. + _currentSkill.currentSkills.get(i).attach(condition,false);
  3588. + }
  3589. + if ("for".equalsIgnoreCase(n.getNodeName()))
  3590. + {
  3591. + parseTemplate(n, _currentSkill.currentSkills.get(i));
  3592. + }
  3593. + }
  3594. _currentSkill.currentLevel = i-lastLvl;
  3595. - boolean found = false;
  3596. for (n=first; n != null; n = n.getNextSibling())
  3597. {
  3598. if ("enchant1cond".equalsIgnoreCase(n.getNodeName()))
  3599. {
  3600. - found = true;
  3601. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  3602. Node msg = n.getAttributes().getNamedItem("msg");
  3603. if (condition != null && msg != null)
  3604. condition.setMessage(msg.getNodeValue());
  3605. _currentSkill.currentSkills.get(i).attach(condition,false);
  3606. }
  3607. if ("enchant1for".equalsIgnoreCase(n.getNodeName()))
  3608. {
  3609. - found = true;
  3610. parseTemplate(n, _currentSkill.currentSkills.get(i));
  3611. }
  3612. }
  3613. - // If none found, the enchanted skill will take effects from maxLvL of norm skill
  3614. - if (!found)
  3615. - {
  3616. - _currentSkill.currentLevel = lastLvl-1;
  3617. - for (n=first; n != null; n = n.getNextSibling())
  3618. - {
  3619. - if ("cond".equalsIgnoreCase(n.getNodeName()))
  3620. - {
  3621. - Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  3622. - Node msg = n.getAttributes().getNamedItem("msg");
  3623. - if (condition != null && msg != null)
  3624. - condition.setMessage(msg.getNodeValue());
  3625. - _currentSkill.currentSkills.get(i).attach(condition,false);
  3626. - }
  3627. - if ("for".equalsIgnoreCase(n.getNodeName()))
  3628. - {
  3629. - parseTemplate(n, _currentSkill.currentSkills.get(i));
  3630. - }
  3631. - }
  3632. - }
  3633. }
  3634. for (int i=lastLvl+enchantLevels1; i < lastLvl+enchantLevels1+enchantLevels2; i++)
  3635. {
  3636. - boolean found = false;
  3637. - _currentSkill.currentLevel = i-lastLvl-enchantLevels1;
  3638. + _currentSkill.currentLevel = lastLvl-1;
  3639. + for (n=first; n != null; n = n.getNextSibling())
  3640. + {
  3641. + if ("cond".equalsIgnoreCase(n.getNodeName()))
  3642. + {
  3643. + Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  3644. + Node msg = n.getAttributes().getNamedItem("msg");
  3645. + if (condition != null && msg != null)
  3646. + condition.setMessage(msg.getNodeValue());
  3647. + _currentSkill.currentSkills.get(i).attach(condition,false);
  3648. + }
  3649. + if ("for".equalsIgnoreCase(n.getNodeName()))
  3650. + {
  3651. + parseTemplate(n, _currentSkill.currentSkills.get(i));
  3652. + }
  3653. + }
  3654. + _currentSkill.currentLevel = i-lastLvl-enchantLevels1;
  3655. for (n=first; n != null; n = n.getNextSibling())
  3656. {
  3657. if ("enchant2cond".equalsIgnoreCase(n.getNodeName()))
  3658. {
  3659. - found = true;
  3660. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  3661. Node msg = n.getAttributes().getNamedItem("msg");
  3662. if (condition != null && msg != null)
  3663. condition.setMessage(msg.getNodeValue());
  3664. _currentSkill.currentSkills.get(i).attach(condition,false);
  3665. }
  3666. if ("enchant2for".equalsIgnoreCase(n.getNodeName()))
  3667. {
  3668. - found = true;
  3669. parseTemplate(n, _currentSkill.currentSkills.get(i));
  3670. }
  3671. - }
  3672. - // If none found, the enchanted skill will take effects from maxLvL of norm skill
  3673. - if(!found)
  3674. - {
  3675. - _currentSkill.currentLevel = lastLvl-1;
  3676. - for (n=first; n != null; n = n.getNextSibling())
  3677. - {
  3678. - if ("cond".equalsIgnoreCase(n.getNodeName()))
  3679. - {
  3680. - Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  3681. - Node msg = n.getAttributes().getNamedItem("msg");
  3682. - if (condition != null && msg != null)
  3683. - condition.setMessage(msg.getNodeValue());
  3684. - _currentSkill.currentSkills.get(i).attach(condition,false);
  3685. - }
  3686. - if ("for".equalsIgnoreCase(n.getNodeName()))
  3687. - {
  3688. - parseTemplate(n, _currentSkill.currentSkills.get(i));
  3689. - }
  3690. - }
  3691. }
  3692. }
  3693. _currentSkill.skills.addAll(_currentSkill.currentSkills);
  3694. }
  3695. Index: /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java
  3696. ===================================================================
  3697. --- /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java (revision 382)
  3698. +++ /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java (revision 682)
  3699. @@ -31,10 +31,11 @@
  3700. import net.sf.l2j.gameserver.SevenSignsFestival;
  3701. import net.sf.l2j.gameserver.ThreadPoolManager;
  3702. import net.sf.l2j.gameserver.ai.CtrlIntention;
  3703. import net.sf.l2j.gameserver.cache.HtmCache;
  3704. import net.sf.l2j.gameserver.datatables.ClanTable;
  3705. +import net.sf.l2j.gameserver.datatables.BuffTemplateTable;
  3706. import net.sf.l2j.gameserver.datatables.HelperBuffTable;
  3707. import net.sf.l2j.gameserver.datatables.ItemTable;
  3708. import net.sf.l2j.gameserver.datatables.SkillTable;
  3709. import net.sf.l2j.gameserver.datatables.SpawnTable;
  3710. import net.sf.l2j.gameserver.idfactory.IdFactory;
  3711. @@ -122,10 +123,11 @@
  3712.  
  3713. /** The castle index in the array of L2Castle this L2NpcInstance belongs to */
  3714. private int _castleIndex = -2;
  3715.  
  3716. public boolean isEventMob = false;
  3717. + public boolean isPrivateEventMob = false;
  3718. public boolean _isEventMobDM = false;
  3719. private boolean _isInTown = false;
  3720.  
  3721. private int _isSpoiledBy = 0;
  3722.  
  3723. @@ -1021,10 +1023,14 @@
  3724. player.sendPacket(new SystemMessage(SystemMessageId.SELECT_THE_ITEM_FROM_WHICH_YOU_WISH_TO_REMOVE_AUGMENTATION));
  3725. player.sendPacket(new ExShowVariationCancelWindow());
  3726. break;
  3727. }
  3728. }
  3729. + else if (command.startsWith("MakeBuffs"))
  3730. + {
  3731. + makeBuffs(player,command.substring(9).trim());
  3732. + }
  3733. else if (command.startsWith("npcfind_byid"))
  3734. {
  3735. try
  3736. {
  3737. L2Spawn spawn = SpawnTable.getInstance().getTemplate(Integer.parseInt(command.substring(12).trim()));
  3738. @@ -1097,10 +1103,27 @@
  3739.  
  3740. if (!(item instanceof L2Weapon))
  3741. return null;
  3742.  
  3743. return (L2Weapon)item;
  3744. + }
  3745. +
  3746. + /**
  3747. + * Throws an action command to L2BufferInstance.<br>
  3748. + * @param player --> Target player
  3749. + * @param buffTemplate --> Name of the Buff Template to Add
  3750. + */
  3751. + public void makeBuffs(L2PcInstance player, String buffTemplate)
  3752. + {
  3753. + int _templateId = 0;
  3754. +
  3755. + try
  3756. + {_templateId = Integer.parseInt(buffTemplate);}
  3757. + catch (NumberFormatException e)
  3758. + {_templateId = BuffTemplateTable.getInstance().getTemplateIdByName(buffTemplate);}
  3759. + if (_templateId>0)
  3760. + {L2BufferInstance.makeBuffs(player, _templateId, this,true);}
  3761. }
  3762.  
  3763. /**
  3764. * Return null (regular NPCs don't have weapons instancies).<BR><BR>
  3765. */
  3766. Index: /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2EventManagerInstance.java
  3767. ===================================================================
  3768. --- /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2EventManagerInstance.java (revision 681)
  3769. +++ /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2EventManagerInstance.java (revision 681)
  3770. @@ -0,0 +1,225 @@
  3771. +/*
  3772. + * This program is free software; you can redistribute it and/or modify
  3773. + * it under the terms of the GNU General Public License as published by
  3774. + * the Free Software Foundation; either version 2, or (at your option)
  3775. + * any later version.
  3776. + *
  3777. + * This program is distributed in the hope that it will be useful,
  3778. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  3779. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  3780. + * GNU General Public License for more details.
  3781. + *
  3782. + * You should have received a copy of the GNU General Public License
  3783. + * along with this program; if not, write to the Free Software
  3784. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  3785. + * 02111-1307, USA.
  3786. + *
  3787. + * http://www.gnu.org/copyleft/gpl.html
  3788. + */
  3789. +package net.sf.l2j.gameserver.model.actor.instance;
  3790. +
  3791. +import java.util.List;
  3792. +import java.util.StringTokenizer;
  3793. +import java.util.Vector;
  3794. +
  3795. +import net.sf.l2j.Config;
  3796. +import net.sf.l2j.gameserver.model.entity.L2EventChecks;
  3797. +import net.sf.l2j.gameserver.serverpackets.ActionFailed;
  3798. +import net.sf.l2j.gameserver.serverpackets.ConfirmDlg;
  3799. +import net.sf.l2j.gameserver.templates.L2NpcTemplate;
  3800. +
  3801. +/**
  3802. + * This Class manages all the Requests to join a Raid Event.
  3803. + *
  3804. + * @author polbat02
  3805. + */
  3806. +public class L2EventManagerInstance extends L2NpcInstance
  3807. +{
  3808. + //Local Variables Definition
  3809. + //--------------------------
  3810. + /** Number of Current Events */
  3811. + public static int _currentEvents = 0;
  3812. + /** Players from which we're waiting an answer */
  3813. + public static Vector<L2PcInstance> _awaitingplayers = new Vector<L2PcInstance>();
  3814. + /** Players that will finally get inside the Event */
  3815. + public static Vector<L2PcInstance> _finalPlayers = new Vector<L2PcInstance>();
  3816. +
  3817. + public L2EventManagerInstance(int objectId, L2NpcTemplate template)
  3818. + {
  3819. + super(objectId, template);
  3820. + }
  3821. +
  3822. + public void onBypassFeedback(L2PcInstance player, String command)
  3823. + {
  3824. + player.sendPacket(new ActionFailed());
  3825. + StringTokenizer st = new StringTokenizer(command, " ");
  3826. + String actualCommand = st.nextToken();
  3827. + _finalPlayers = new Vector<L2PcInstance>();
  3828. +
  3829. + if (actualCommand.equalsIgnoreCase("iEvent"))
  3830. + {
  3831. + try
  3832. + {
  3833. + /*Type:1- Single //2- Clan //3- Party*/
  3834. + int type = Integer.parseInt(st.nextToken());
  3835. + /*Required Event Points needed to participate*/
  3836. + int eventPoints = Integer.parseInt(st.nextToken());
  3837. + /* NpcId of the Event mobs */
  3838. + int npcId = Integer.parseInt(st.nextToken());
  3839. + /* Number of NPcs */
  3840. + int npcAm =Integer.parseInt(st.nextToken());
  3841. + /* Minimum number of needed persons players to participate */
  3842. + int minPeople = Integer.parseInt(st.nextToken());
  3843. + /* Minimum level to participate */
  3844. + int minLevel = Integer.parseInt(st.nextToken());
  3845. + /* Buff List to apply */
  3846. + int bufflist = Integer.parseInt(st.nextToken());
  3847. + /* Level of The Prize to Hand out */
  3848. + int prizeLevel = Integer.parseInt(st.nextToken());
  3849. + if (player == null){return;}
  3850. + this.setTarget(player);
  3851. +
  3852. + if (_currentEvents>=Config.RAID_SYSTEM_MAX_EVENTS)
  3853. + {
  3854. + player.sendMessage("There's alredy "+_currentEvents+" events in progress. " +
  3855. + "Wait untill one of them ends to get into another one.");
  3856. + return;
  3857. + }
  3858. +
  3859. + if (L2EventChecks.usualChecks(player,minLevel))
  3860. + _finalPlayers.add(player);
  3861. + else return;
  3862. + // If the player has passed the checks, then continue.
  3863. + switch (type)
  3864. + {
  3865. + // Case Clan Events.
  3866. + case 2:
  3867. + {
  3868. + if(player.getClan()== null)
  3869. + {
  3870. + player.sendMessage("You Don't have a Clan!");
  3871. + return;
  3872. + }
  3873. + L2PcInstance[] onlineclanMembers = player.getClan().getOnlineMembers("");
  3874. + for (L2PcInstance member: onlineclanMembers)
  3875. + {
  3876. + boolean eligible = true;
  3877. + if(member == null)
  3878. + continue;
  3879. + if(!L2EventChecks.usualChecks(member,minLevel))
  3880. + eligible = false;
  3881. + if(eligible && !(_finalPlayers.contains(member)))
  3882. + _finalPlayers.add(member);
  3883. + }
  3884. + if (_finalPlayers.size()>1 && _finalPlayers.size()>=minPeople)
  3885. + {
  3886. + player.setRaidParameters(player,type,eventPoints,npcId,npcAm,minPeople,bufflist,prizeLevel,this, _finalPlayers);
  3887. + _awaitingplayers.add(player);
  3888. + player.sendPacket(new ConfirmDlg(614," A total of "+(_finalPlayers.size())+" members of your "
  3889. + +" clan are Eligible for the event. Do you want to continue?"));
  3890. + }
  3891. + else
  3892. + {
  3893. + String reason;
  3894. + if(_finalPlayers.size()>1)
  3895. + reason =": Only 1 Clan Member Online.";
  3896. + else if(_finalPlayers.size()<minPeople)
  3897. + reason =": Not enough members online to participate.";
  3898. + else reason=".";
  3899. + player.sendMessage("Cannot participate"+reason);
  3900. + }
  3901. + break;
  3902. + }
  3903. + // Case Party Events.
  3904. + case 3:
  3905. + {
  3906. + if(player.getParty()== null)
  3907. + {
  3908. + player.sendMessage("You DON'T have a Party!");
  3909. + return;
  3910. + }
  3911. + List<L2PcInstance> partyMembers = player.getParty().getPartyMembers();
  3912. + for (L2PcInstance member: partyMembers)
  3913. + {
  3914. + boolean eligible = true;
  3915. + if(member == null)
  3916. + continue;
  3917. + if(!L2EventChecks.usualChecks(member,minLevel))
  3918. + eligible = false;
  3919. + if(eligible && !(_finalPlayers.contains(member)))
  3920. + _finalPlayers.add(member);
  3921. + }
  3922. + if ((_finalPlayers.size())>1 && _finalPlayers.size()>=minPeople)
  3923. + {
  3924. + player.setRaidParameters(player,type,eventPoints,npcId,npcAm,minPeople,bufflist,prizeLevel,this, _finalPlayers);
  3925. + _awaitingplayers.add(player);
  3926. + player.sendPacket(new ConfirmDlg(614," A total of "+(_finalPlayers.size())+" members of your " +
  3927. + "party are Eligible for the event. Do you want to continue?"));
  3928. + }
  3929. + else
  3930. + {
  3931. + String reason;
  3932. + if(_finalPlayers.size()>1)
  3933. + reason =": Only 1 Party Member.";
  3934. + else if(_finalPlayers.size()<minPeople)
  3935. + reason =": Not enough members to participate.";
  3936. + else reason=".";
  3937. + player.sendMessage("Cannot participate"+reason);
  3938. + }
  3939. + break;
  3940. + }
  3941. +
  3942. + default:
  3943. + {
  3944. + player.setRaidParameters(player,type,eventPoints,npcId,npcAm,minPeople,bufflist,prizeLevel,this, _finalPlayers);
  3945. + player.setRaidAnswear(1);
  3946. + }
  3947. + }
  3948. + return;
  3949. +
  3950. + }
  3951. + catch (Exception e)
  3952. + {
  3953. + _log.warning("L2EventManagerInstance: Error while getting html command");
  3954. + e.printStackTrace();
  3955. + }
  3956. + }
  3957. + super.onBypassFeedback(player, command);
  3958. + }
  3959. +
  3960. + public String getHtmlPath(int npcId, int val)
  3961. + {
  3962. + String pom = "";
  3963. + if (val == 0)
  3964. + {
  3965. + pom = "" + npcId;
  3966. + }
  3967. + else
  3968. + {
  3969. + pom = npcId + "-" + val;
  3970. + }
  3971. +
  3972. + return "data/html/event/" + pom + ".htm";
  3973. + }
  3974. +
  3975. + public static boolean addEvent()
  3976. + {
  3977. + if (_currentEvents>=Config.RAID_SYSTEM_MAX_EVENTS)
  3978. + return false;
  3979. + else
  3980. + {
  3981. + _currentEvents += 1;
  3982. + return true;
  3983. + }
  3984. + }
  3985. +
  3986. + public static boolean removeEvent()
  3987. + {
  3988. + if(_currentEvents>0)
  3989. + {
  3990. + _currentEvents-=1;
  3991. + return true;
  3992. + }
  3993. + else return false;
  3994. + }
  3995. +}
  3996. Index: /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  3997. ===================================================================
  3998. --- /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 679)
  3999. +++ /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 681)
  4000. @@ -19,10 +19,11 @@
  4001. package net.sf.l2j.gameserver.model.actor.instance;
  4002.  
  4003. import java.sql.PreparedStatement;
  4004. import java.sql.ResultSet;
  4005. import java.util.Calendar;
  4006. +import java.util.Vector;
  4007. import java.util.Collection;
  4008. import java.util.Date;
  4009. import java.util.LinkedList;
  4010. import java.util.List;
  4011. import java.util.Map;
  4012. @@ -92,10 +93,12 @@
  4013. import net.sf.l2j.gameserver.model.entity.DM;
  4014. import net.sf.l2j.gameserver.model.L2DropData;
  4015. import net.sf.l2j.gameserver.model.L2Effect;
  4016. import net.sf.l2j.gameserver.model.L2Fishing;
  4017. import net.sf.l2j.gameserver.model.L2HennaInstance;
  4018. +import net.sf.l2j.gameserver.model.entity.L2EventChecks;
  4019. +import net.sf.l2j.gameserver.model.entity.L2RaidEvent;
  4020. import net.sf.l2j.gameserver.model.L2ItemInstance;
  4021. import net.sf.l2j.gameserver.model.L2Macro;
  4022. import net.sf.l2j.gameserver.model.L2ManufactureList;
  4023. import net.sf.l2j.gameserver.model.L2Object;
  4024. import net.sf.l2j.gameserver.model.L2Party;
  4025. @@ -215,12 +218,12 @@
  4026.  
  4027. private static final String ADD_SKILL_SAVE = "INSERT INTO character_skills_save (char_obj_id,skill_id,skill_level,effect_count,effect_cur_time,reuse_delay,restore_type,class_index,buff_index) VALUES (?,?,?,?,?,?,?,?,?)";
  4028. private static final String RESTORE_SKILL_SAVE = "SELECT skill_id,skill_level,effect_count,effect_cur_time, reuse_delay FROM character_skills_save WHERE char_obj_id=? AND class_index=? AND restore_type=? ORDER BY buff_index ASC";
  4029. private static final String DELETE_SKILL_SAVE = "DELETE FROM character_skills_save WHERE char_obj_id=? AND class_index=?";
  4030.  
  4031. - private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,str=?,con=?,dex=?,_int=?,men=?,wit=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,maxload=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,in_jail=?,jail_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,donator=? WHERE obj_id=?";
  4032. - private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,donator FROM characters WHERE obj_id=?";
  4033. + private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,str=?,con=?,dex=?,_int=?,men=?,wit=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,maxload=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,in_jail=?,jail_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,donator=?, event_points=? WHERE obj_id=?";
  4034. + private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,donator,event_points FROM characters WHERE obj_id=?";
  4035. private static final String RESTORE_CHAR_SUBCLASSES = "SELECT class_id,exp,sp,level,class_index FROM character_subclasses WHERE char_obj_id=? ORDER BY class_index ASC";
  4036. private static final String ADD_CHAR_SUBCLASS = "INSERT INTO character_subclasses (char_obj_id,class_id,exp,sp,level,class_index) VALUES (?,?,?,?,?,?)";
  4037. private static final String UPDATE_CHAR_SUBCLASS = "UPDATE character_subclasses SET exp=?,sp=?,level=?,class_id=? WHERE char_obj_id=? AND class_index =?";
  4038. private static final String DELETE_CHAR_SUBCLASS = "DELETE FROM character_subclasses WHERE char_obj_id=? AND class_index=?";
  4039.  
  4040. @@ -4251,10 +4254,15 @@
  4041.  
  4042. if (killer instanceof L2PcInstance)
  4043. pk = (L2PcInstance) killer;
  4044.  
  4045. TvTEvent.onKill(killer, this);
  4046. +
  4047. + if (Config.RAID_SYSTEM_RESURRECT_PLAYER &&(inSoloEvent||inPartyEvent||inClanEvent))
  4048. + {
  4049. + L2RaidEvent.onPlayerDeath(this);
  4050. + }
  4051.  
  4052. if (atEvent && pk != null)
  4053. {
  4054. pk.kills.add(getName());
  4055. }
  4056. @@ -5713,10 +5721,11 @@
  4057. player.setPkKills(rset.getInt("pkkills"));
  4058. player.setOnlineTime(rset.getLong("onlinetime"));
  4059. player.setNewbie(rset.getInt("newbie")==1);
  4060. player.setNoble(rset.getInt("nobless")==1);
  4061. player.setdonator(rset.getInt("donator")==1);
  4062. + player.setEventPoints(rset.getInt("event_points"));
  4063.  
  4064. player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time"));
  4065. if (player.getClanJoinExpiryTime() < System.currentTimeMillis())
  4066. {
  4067. player.setClanJoinExpiryTime(0);
  4068. @@ -6178,11 +6187,12 @@
  4069. statement.setLong(53, getClanJoinExpiryTime());
  4070. statement.setLong(54, getClanCreateExpiryTime());
  4071. statement.setString(55, getName());
  4072. statement.setLong(56, getDeathPenaltyBuffLevel());
  4073. statement.setInt(57, isdonator() ? 1 : 0);
  4074. - statement.setInt(58, getObjectId());
  4075. + statement.setInt(58, getEventPoints());
  4076. + statement.setInt(59, getObjectId());
  4077.  
  4078. statement.execute();
  4079. statement.close();
  4080. }
  4081. catch (Exception e) { _log.warning("Could not store char base data: "+ e); }
  4082. @@ -10724,6 +10734,83 @@
  4083.  
  4084. public void systemSendMessage(SystemMessageId id)
  4085. {
  4086. sendPacket(new SystemMessage(id));
  4087. }
  4088. +
  4089. + /** Raid Event Parameters */
  4090. + public boolean inClanEvent = false;
  4091. + public boolean inPartyEvent = false;
  4092. + public boolean inSoloEvent = false;
  4093. + public boolean awaitingAnswer = false;
  4094. + private int _event_points;
  4095. + public static int eventType;
  4096. + public static int eventPointsRequired;
  4097. + public static int eventNpcId;
  4098. + public static int eventNpcAmmount;
  4099. + public static int eventMinPlayers;
  4100. + public static int eventBufflist;
  4101. + public static int eventRewardLevel;
  4102. + public static L2Object eventEffector;
  4103. + public static Vector<L2PcInstance> eventParticipatingPlayers;
  4104. +
  4105. + /** Raid Event Related Voids */
  4106. + public void setEventPoints(int points)
  4107. + {
  4108. + _event_points = points;
  4109. + }
  4110. + public int getEventPoints()
  4111. + {
  4112. + return _event_points;
  4113. + }
  4114. +
  4115. + /**
  4116. + * Set Raid Event Parameters, this is needed to keep track of events while waiting for an answear from the Clan Leader.
  4117. + * @param player
  4118. + * @param type
  4119. + * @param points
  4120. + * @param npcId
  4121. + * @param npcAm
  4122. + * @param minPeople
  4123. + * @param bufflist
  4124. + * @param rewardLevel
  4125. + * @param effector
  4126. + * @param participatingPlayers
  4127. + */
  4128. + public void setRaidParameters(L2PcInstance player,int type,int points,int npcId,
  4129. + int npcAm,int minPeople,int bufflist,int rewardLevel,L2Object effector,
  4130. + Vector<L2PcInstance> participatingPlayers)
  4131. + {
  4132. + eventType = type;
  4133. + eventPointsRequired = points;
  4134. + eventNpcId = npcId;
  4135. + eventNpcAmmount = npcAm;
  4136. + eventMinPlayers = minPeople;
  4137. + eventBufflist = bufflist;
  4138. + eventRewardLevel = rewardLevel;
  4139. + eventEffector = effector;
  4140. + eventParticipatingPlayers = participatingPlayers;
  4141. + }
  4142. +
  4143. + public void setRaidAnswear(int answer)
  4144. + {
  4145. + if (this == null)
  4146. + return;
  4147. + if(answer == 1)
  4148. + {
  4149. + if(L2EventChecks.checkPlayer(this,eventType,eventPointsRequired,eventMinPlayers,eventParticipatingPlayers))
  4150. + {
  4151. + L2RaidEvent event;
  4152. + event = new L2RaidEvent(this,eventType,eventPointsRequired,eventNpcId,eventNpcAmmount,eventBufflist,eventRewardLevel,eventEffector,eventParticipatingPlayers);
  4153. + sendMessage("You've choosen to continue the event with "+eventParticipatingPlayers+ "online Member/s.");
  4154. + try
  4155. + {Thread.sleep(5000);}
  4156. + catch (InterruptedException e)
  4157. + {e.printStackTrace();}
  4158. + event.init();
  4159. + }
  4160. + }
  4161. + else if (answer == 0)
  4162. + sendMessage("You don't want to continue with the Event.");
  4163. + else return;
  4164. + }
  4165. }
  4166. Index: /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2BufferInstance.java
  4167. ===================================================================
  4168. --- /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2BufferInstance.java (revision 681)
  4169. +++ /trunk/Game/java/net/sf/l2j/gameserver/model/actor/instance/L2BufferInstance.java (revision 681)
  4170. @@ -0,0 +1,160 @@
  4171. +/* This program is free software; you can redistribute it and/or modify
  4172. + * it under the terms of the GNU General Public License as published by
  4173. + * the Free Software Foundation; either version 2, or (at your option)
  4174. + * any later version.
  4175. + *
  4176. + * This program is distributed in the hope that it will be useful,
  4177. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  4178. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  4179. + * GNU General Public License for more details.
  4180. + *
  4181. + * You should have received a copy of the GNU General Public License
  4182. + * along with this program; if not, write to the Free Software
  4183. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  4184. + * 02111-1307, USA.
  4185. + *
  4186. + * http://www.gnu.org/copyleft/gpl.html
  4187. + */
  4188. +package net.sf.l2j.gameserver.model.actor.instance;
  4189. +
  4190. +import java.util.logging.Logger;
  4191. +
  4192. +import javolution.util.FastList;
  4193. +
  4194. +import net.sf.l2j.Config;
  4195. +import net.sf.l2j.gameserver.datatables.BuffTemplateTable;
  4196. +import net.sf.l2j.gameserver.model.L2Character;
  4197. +import net.sf.l2j.gameserver.model.L2Effect;
  4198. +import net.sf.l2j.gameserver.model.L2Object;
  4199. +import net.sf.l2j.gameserver.model.L2Skill.SkillTargetType;
  4200. +import net.sf.l2j.gameserver.model.L2Skill;
  4201. +import net.sf.l2j.gameserver.model.L2Skill.SkillType;
  4202. +import net.sf.l2j.gameserver.network.SystemMessageId;
  4203. +import net.sf.l2j.gameserver.serverpackets.MagicSkillUser;
  4204. +import net.sf.l2j.gameserver.serverpackets.SystemMessage;
  4205. +import net.sf.l2j.gameserver.templates.L2BuffTemplate;
  4206. +
  4207. +public class L2BufferInstance
  4208. +{
  4209. + static L2PcInstance selfBuffer;
  4210. + static L2NpcInstance npcBuffer;
  4211. +
  4212. + /**
  4213. + * Apply Buffs onto a player.
  4214. + * @param player
  4215. + * @param _templateId
  4216. + * @param efector
  4217. + * @param paymentRequired
  4218. + */
  4219. + public static void makeBuffs(L2PcInstance player, int _templateId, L2Object efector,boolean paymentRequired)
  4220. + {
  4221. + if (player == null)
  4222. + return;
  4223. + getbufferType(efector).setTarget(player);
  4224. +
  4225. + FastList<L2BuffTemplate> _templateBuffs = new FastList<L2BuffTemplate>();
  4226. + _templateBuffs = BuffTemplateTable.getInstance().getBuffTemplate(_templateId);
  4227. +
  4228. + if (_templateBuffs == null || _templateBuffs.size() == 0)
  4229. + return;
  4230. +
  4231. + int _priceTotal = 0;
  4232. + int _pricePoints =0;
  4233. +
  4234. + for (L2BuffTemplate _buff:_templateBuffs)
  4235. + {
  4236. + if (paymentRequired)
  4237. + {
  4238. + if(!_buff.checkPrice(player))
  4239. + {
  4240. + player.sendMessage("Not enough Adena");
  4241. + return;
  4242. + }
  4243. + if(!_buff.checkPoints(player))
  4244. + {
  4245. + player.sendMessage("Not enough Event Points");
  4246. + return;
  4247. + }
  4248. + }
  4249. +
  4250. + getbufferType(efector).setTarget(player);
  4251. +
  4252. + if ( _buff.checkPlayer(player) && _buff.checkPrice(player))
  4253. + {
  4254. + if (player.getInventory().getAdena() >= (_priceTotal + _buff.getAdenaPrice())
  4255. + && player.getEventPoints()>=_buff.getPointsPrice())
  4256. + {
  4257. + _priceTotal+=_buff.getAdenaPrice();
  4258. + _pricePoints+=_buff.getPointsPrice();
  4259. + if (_buff.forceCast() || (_buff.getSkill()) == null)
  4260. + {
  4261. + // regeneration ^^
  4262. +
  4263. + player.setCurrentHpMp(player.getMaxHp()+5000, player.getMaxMp()+5000);
  4264. + /*
  4265. + * Mensaje informativo al cliente sobre los buffs dados.
  4266. + */
  4267. + SystemMessage sm = new SystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
  4268. + sm.addSkillName(_buff.getSkill().getId());
  4269. + player.sendPacket(sm);
  4270. + sm = null;
  4271. + if (_buff.getSkill().getTargetType() == SkillTargetType.TARGET_SELF)
  4272. + {
  4273. + // Ignora el tiempo de casteo del skill, hay unos 100ms de animacion de casteo
  4274. + MagicSkillUser msu = new MagicSkillUser(player, player, _buff.getSkill().getId(), _buff.getSkill().getLevel(), 100, 0);
  4275. + player.broadcastPacket(msu);
  4276. +
  4277. + for (L2Effect effect : _buff.getSkill().getEffectsSelf(player))
  4278. + {
  4279. + player.addEffect(effect);
  4280. + }
  4281. + // newbie summons
  4282. + if (_buff.getSkill().getSkillType() == SkillType.SUMMON)
  4283. + {
  4284. + player.doCast(_buff.getSkill());
  4285. + }
  4286. + }
  4287. + else
  4288. + { // Ignora el tiempo de casteo del skill, hay unos 5ms de animacion de casteo
  4289. + MagicSkillUser msu = new MagicSkillUser(getbufferType(efector), player, _buff.getSkill().getId(), _buff.getSkill().getLevel(), 5, 0);
  4290. + player.broadcastPacket(msu);
  4291. + }
  4292. +
  4293. + for (L2Effect effect : _buff.getSkill().getEffects(getbufferType(efector), player))
  4294. + {
  4295. + player.addEffect(effect);
  4296. + }
  4297. + try{
  4298. + Thread.sleep(50);
  4299. + }catch (Exception e) {}
  4300. + }
  4301. + }
  4302. + }
  4303. + }
  4304. + if (paymentRequired &&(_pricePoints>0 ||_priceTotal>0))
  4305. + {
  4306. + if(_pricePoints>0)
  4307. + {
  4308. + int previousPoints = player.getEventPoints();
  4309. + player.setEventPoints(player.getEventPoints()-_pricePoints);
  4310. + player.sendMessage("You had "+previousPoints+" Event Points, and now you have "+ player.getEventPoints()+" Event Points.");
  4311. + }
  4312. + if (_priceTotal>0)
  4313. + player.reduceAdena("NpcBuffer", _priceTotal, player.getLastFolkNPC(), true);
  4314. + }
  4315. + }
  4316. + private static L2Character getbufferType(L2Object efector)
  4317. + {
  4318. + if (efector instanceof L2PcInstance)
  4319. + {
  4320. + selfBuffer = ((L2PcInstance)efector);
  4321. + efector = selfBuffer;
  4322. + }
  4323. + if (efector instanceof L2NpcInstance)
  4324. + {
  4325. + npcBuffer = ((L2NpcInstance)efector);
  4326. + efector = npcBuffer;
  4327. + }
  4328. + return (L2Character) efector;
  4329. + }
  4330. + static Logger _log = Logger.getLogger(Config.class.getName());
  4331. +}
  4332. Index: /trunk/Game/java/net/sf/l2j/gameserver/model/L2Attackable.java
  4333. ===================================================================
  4334. --- /trunk/Game/java/net/sf/l2j/gameserver/model/L2Attackable.java (revision 253)
  4335. +++ /trunk/Game/java/net/sf/l2j/gameserver/model/L2Attackable.java (revision 681)
  4336. @@ -34,10 +34,11 @@
  4337. import net.sf.l2j.gameserver.ai.L2SiegeGuardAI;
  4338. import net.sf.l2j.gameserver.clientpackets.Say2;
  4339. import net.sf.l2j.gameserver.datatables.EventDroplist;
  4340. import net.sf.l2j.gameserver.datatables.ItemTable;
  4341. import net.sf.l2j.gameserver.datatables.EventDroplist.DateDrop;
  4342. +import net.sf.l2j.gameserver.model.entity.L2RaidEvent;
  4343. import net.sf.l2j.gameserver.instancemanager.CursedWeaponsManager;
  4344. import net.sf.l2j.gameserver.model.actor.instance.L2BossInstance;
  4345. import net.sf.l2j.gameserver.model.actor.instance.L2DoorInstance;
  4346. import net.sf.l2j.gameserver.model.actor.instance.L2FolkInstance;
  4347. import net.sf.l2j.gameserver.model.actor.instance.L2MinionInstance;
  4348. @@ -623,10 +624,22 @@
  4349.  
  4350. // Check for an over-hit enabled strike
  4351. if (attacker instanceof L2PcInstance)
  4352. {
  4353. L2PcInstance player = (L2PcInstance)attacker;
  4354. +
  4355. + if (this.isPrivateEventMob)
  4356. + {
  4357. + L2RaidEvent.expHandOut();
  4358. + exp = L2RaidEvent.exp;
  4359. + sp = L2RaidEvent.sp;
  4360. + if (L2RaidEvent.checkPossibleReward())
  4361. + {
  4362. + L2RaidEvent.chooseReward(player);
  4363. + }
  4364. + this.deleteMe();
  4365. + }
  4366. if (isOverhit() && attacker == getOverhitAttacker())
  4367. {
  4368. player.sendPacket(new SystemMessage(SystemMessageId.OVER_HIT));
  4369. exp += calculateOverhitExp(exp);
  4370. }
  4371. @@ -739,10 +752,21 @@
  4372. // Check for an over-hit enabled strike
  4373. // (When in party, the over-hit exp bonus is given to the whole party and splitted proportionally through the party members)
  4374. if (attacker instanceof L2PcInstance)
  4375. {
  4376. L2PcInstance player = (L2PcInstance)attacker;
  4377. + if (this.isPrivateEventMob)
  4378. + {
  4379. + L2RaidEvent.expHandOut();
  4380. + exp = L2RaidEvent.exp;
  4381. + sp = L2RaidEvent.sp;
  4382. + if (L2RaidEvent.checkPossibleReward())
  4383. + {
  4384. + L2RaidEvent.chooseReward(player);
  4385. + }
  4386. + this.deleteMe();
  4387. + }
  4388. if (isOverhit() && attacker == getOverhitAttacker())
  4389. {
  4390. player.sendPacket(new SystemMessage(SystemMessageId.OVER_HIT));
  4391. exp += calculateOverhitExp(exp);
  4392. }
  4393. Index: /trunk/Game/java/net/sf/l2j/gameserver/model/entity/L2EventChecks.java
  4394. ===================================================================
  4395. --- /trunk/Game/java/net/sf/l2j/gameserver/model/entity/L2EventChecks.java (revision 681)
  4396. +++ /trunk/Game/java/net/sf/l2j/gameserver/model/entity/L2EventChecks.java (revision 681)
  4397. @@ -0,0 +1,179 @@
  4398. +package net.sf.l2j.gameserver.model.entity;
  4399. +
  4400. +import java.util.Vector;
  4401. +
  4402. +import net.sf.l2j.gameserver.model.L2Effect;
  4403. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  4404. +
  4405. +
  4406. +public class L2EventChecks
  4407. +{
  4408. + /**
  4409. + * CheckIfOtherEvent --> Checks if the player is already inscribed in another event.
  4410. + */
  4411. + private static boolean checkIfOtherEvent (L2PcInstance player)
  4412. + {
  4413. + if (player.inSoloEvent||player.inPartyEvent||player.inClanEvent)
  4414. + {
  4415. + player.sendMessage("You're alredy registered in another event.");
  4416. + return true;
  4417. + }
  4418. + return false;
  4419. + }
  4420. +
  4421. + /**
  4422. + * Check if Player/Clan/Party is eligible for Event.<br>
  4423. + * Documentation can be found in the method.<br>
  4424. + * @param player --> Basic Player Taking the action.
  4425. + * @param eventType --> Type of Event to check.
  4426. + * @param points --> Minimum Event Points Required to participate.
  4427. + * @param minPeople --> Minimum allowed People Required to participate.
  4428. + * @return --> True for Eligible Players and False for UnEligible Players.
  4429. + */
  4430. + public static boolean checkPlayer(L2PcInstance player,int eventType,int points, int minPeople, Vector<L2PcInstance>_eventPlayers)
  4431. + {
  4432. + int eventPoints = 0;
  4433. + //Let's avoid NPEs
  4434. + if (player == null)
  4435. + return false;
  4436. + //If there's not enough clan members online to fill the MinPeople requirement
  4437. + //return false.
  4438. + if (_eventPlayers.size()<=minPeople && eventType == (2|3))
  4439. + {
  4440. + //Notify to the requester.
  4441. + player.sendMessage("Not enough "+eType(eventType)+" members of the connected at this mommtent, try again later.");
  4442. + return false;
  4443. + }
  4444. + for (L2PcInstance member : _eventPlayers)
  4445. + {
  4446. + /*
  4447. + * In case of finding a disconnected player, we will continue the for statement.
  4448. + */
  4449. + if (member == null)
  4450. + continue;
  4451. + //Let's check if any of the members is in another Event.
  4452. + if(checkIfOtherEvent(member))
  4453. + {
  4454. + /* If this is the case, we will notify the request instance about the inconvenience produced.
  4455. + * We will also return a false.*/
  4456. + String badRequestor = member.getName();
  4457. + notifyBadRequestor(player,badRequestor,2,_eventPlayers);
  4458. + return false;
  4459. + }
  4460. +
  4461. + // TODO: Add a Check asking members of the clan/party (ONLY) ACTUALLY WANT TO PARTICIPATE or not.
  4462. +
  4463. + /* Let's count all the points for every one of the event members, only in the case that
  4464. + * the request instance and the Clan Members are from the same clan */
  4465. + switch(eventType)
  4466. + {
  4467. + case 2:
  4468. + {
  4469. + if(_eventPlayers.contains(player) && member.getClan().getName().equals(player.getClan().getName()))
  4470. + eventPoints +=member.getEventPoints();
  4471. + break;
  4472. + }
  4473. + case 3:
  4474. + {
  4475. + //Let's add the points of each member to the Party General Clan Score.
  4476. + eventPoints += member.getEventPoints();
  4477. + break;
  4478. + }
  4479. + default:
  4480. + {
  4481. + eventPoints = member.getEventPoints();
  4482. + break;
  4483. + }
  4484. + }
  4485. + }
  4486. + /* If the addition of all the points is bigger than the requested points, we will accept
  4487. + * the Participation of this clan in the event */
  4488. + if (eventPoints>=points)
  4489. + {
  4490. + for (L2PcInstance member : _eventPlayers)
  4491. + {
  4492. + // Deletion of all the Buffs from all the Clan members
  4493. + for (L2Effect effect : member.getAllEffects())
  4494. + {
  4495. + if (effect != null)
  4496. + effect.exit();
  4497. + }
  4498. + }
  4499. + return true;
  4500. + }
  4501. + //Else The Clan doesn't have enough event points to participate.
  4502. + else if (eventType != 1)
  4503. + {
  4504. + player.sendMessage("The totality of your "+eType(eventType)+" members don't have enough Event Points to participate.");
  4505. + return false;
  4506. + }
  4507. + else
  4508. + {
  4509. + player.sendMessage("Not enough Event Points to participate into the Event.");
  4510. + return false;
  4511. + }
  4512. + }
  4513. + /**
  4514. + * notifyOfBadRequestor --> Tell the members of the Clan/Party that the player is already inscribed in another event.
  4515. + */
  4516. + private static void notifyBadRequestor(L2PcInstance player, String badRequestor, int type, Vector<L2PcInstance>_eventPlayers)
  4517. + {
  4518. + if (type == 2)
  4519. + {
  4520. + for (L2PcInstance member : _eventPlayers)
  4521. + {
  4522. + member.sendMessage("You can't access the event while "+badRequestor+ "is singed up for another event.");
  4523. + }
  4524. + }
  4525. + if (type ==3)
  4526. + {
  4527. + for (L2PcInstance member : _eventPlayers)
  4528. + {
  4529. + member.sendMessage("You can't access the event while "+badRequestor+ "is singed up for another event.");
  4530. + }
  4531. + }
  4532. + }
  4533. +
  4534. + public static boolean usualChecks(L2PcInstance player, int minLevel)
  4535. + {
  4536. + if(player.getLevel()<minLevel)
  4537. + {
  4538. + player.sendMessage("The minimum level to participate in this Event is "+minLevel+". You cannot participate.");
  4539. + return false;
  4540. + }
  4541. + if (player.inClanEvent || player.inPartyEvent || player.inSoloEvent)
  4542. + {
  4543. + player.sendMessage("You're alredy registered in another Event.");
  4544. + return false;
  4545. + }
  4546. + if (player.isCursedWeaponEquiped())
  4547. + {
  4548. + player.sendMessage("You can Not register while Having a Cursed Weapon.");
  4549. + return false;
  4550. + }
  4551. + if (player.isInStoreMode())
  4552. + {
  4553. + player.sendMessage("Cannot Participate while in Store Mode.");
  4554. + return false;
  4555. + }
  4556. + if (player.isInJail())
  4557. + {
  4558. + player.sendMessage("Cannot Participate while in Jail.");
  4559. + return false;
  4560. + }
  4561. + return true;
  4562. + }
  4563. +
  4564. + public static String eType(int type)
  4565. + {
  4566. + String sType;
  4567. + if(type == 1)
  4568. + sType ="Single";
  4569. + else if(type == 2)
  4570. + sType ="Clan";
  4571. + else if(type == 3)
  4572. + sType="Party";
  4573. + else sType="error ocurred while getting type of Event.";
  4574. + return sType;
  4575. + }
  4576. +}
  4577. Index: /trunk/Game/java/net/sf/l2j/gameserver/model/entity/L2RaidEvent.java
  4578. ===================================================================
  4579. --- /trunk/Game/java/net/sf/l2j/gameserver/model/entity/L2RaidEvent.java (revision 681)
  4580. +++ /trunk/Game/java/net/sf/l2j/gameserver/model/entity/L2RaidEvent.java (revision 681)
  4581. @@ -0,0 +1,1047 @@
  4582. +/*
  4583. + * This program is free software; you can redistribute it and/or modify
  4584. + * it under the terms of the GNU General Public License as published by
  4585. + * the Free Software Foundation; either version 2, or (at your option)
  4586. + * any later version.
  4587. + *
  4588. + * This program is distributed in the hope that it will be useful,
  4589. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  4590. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  4591. + * GNU General Public License for more details.
  4592. + *
  4593. + * You should have received a copy of the GNU General Public License
  4594. + * along with this program; if not, write to the Free Software
  4595. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  4596. + * 02111-1307, USA.
  4597. + *
  4598. + * http://www.gnu.org/copyleft/gpl.html
  4599. + */
  4600. +package net.sf.l2j.gameserver.model.entity;
  4601. +
  4602. +import java.sql.Connection;
  4603. +import java.sql.PreparedStatement;
  4604. +import java.sql.ResultSet;
  4605. +import java.util.Vector;
  4606. +import java.util.logging.Logger;
  4607. +
  4608. +import javolution.text.TextBuilder;
  4609. +import net.sf.l2j.Config;
  4610. +import net.sf.l2j.L2DatabaseFactory;
  4611. +import net.sf.l2j.gameserver.datatables.ItemTable;
  4612. +import net.sf.l2j.gameserver.datatables.NpcTable;
  4613. +import net.sf.l2j.gameserver.datatables.SpawnTable;
  4614. +import net.sf.l2j.gameserver.instancemanager.RaidBossSpawnManager;
  4615. +import net.sf.l2j.gameserver.model.L2Object;
  4616. +import net.sf.l2j.gameserver.model.L2Spawn;
  4617. +import net.sf.l2j.gameserver.model.PcInventory;
  4618. +import net.sf.l2j.gameserver.model.actor.instance.L2BufferInstance;
  4619. +import net.sf.l2j.gameserver.model.actor.instance.L2EventManagerInstance;
  4620. +import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;
  4621. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  4622. +import net.sf.l2j.gameserver.network.SystemMessageId;
  4623. +import net.sf.l2j.gameserver.serverpackets.ItemList;
  4624. +import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;
  4625. +import net.sf.l2j.gameserver.serverpackets.StatusUpdate;
  4626. +import net.sf.l2j.gameserver.serverpackets.SystemMessage;
  4627. +import net.sf.l2j.gameserver.templates.L2NpcTemplate;
  4628. +
  4629. +/**
  4630. + * This Class implements and Manages All Raid Events.<br>
  4631. + *
  4632. + * @author polbat02
  4633. + */
  4634. +public class L2RaidEvent
  4635. +{
  4636. + //Local Variables Definition
  4637. + //--------------------------
  4638. + protected static final Logger _log = Logger.getLogger(L2RaidEvent.class.getName());
  4639. + /**
  4640. + * Definition of the Event Mob Spawn
  4641. + */
  4642. +
  4643. + private static L2PcInstance _player;
  4644. + private static L2Spawn _npcSpawn = null;
  4645. + /**
  4646. + * Definition of the Spawn as a L2NpcInstance
  4647. + */
  4648. + private static L2NpcInstance _lastNpcSpawn = null;
  4649. + /**
  4650. + * Custom Management of Experience upon NPC death.
  4651. + */
  4652. + public static int exp = 0;
  4653. + /**
  4654. + * Custom Management of SP upon NPC death.
  4655. + */
  4656. + public static int sp = 0;
  4657. +
  4658. + /**
  4659. + * <b>Event Type:</b><br>
  4660. + * 1- Solo Event (Single player)<br>
  4661. + * 2- Clan Event<br>
  4662. + * 3- Party Event<br>
  4663. + */
  4664. + public static int _eventType;
  4665. + /**
  4666. + * Number Of Event Mobs.
  4667. + */
  4668. + private static int _eventMobs = 0;
  4669. + /**
  4670. + * Reward Level: According to this reward level the players will be
  4671. + * congratulated with different prizes.
  4672. + */
  4673. + private static int _rewardLevel;
  4674. + /**
  4675. + * Transport Locations
  4676. + */
  4677. + private static int _locX,_locY,_locZ,_pX,_pY,_pZ;
  4678. +
  4679. + /**
  4680. + * NPC spawn positions
  4681. + */
  4682. + private static int _npcX,_npcY,_npcZ;
  4683. +
  4684. + /**
  4685. + * DataBase Prize Parameters
  4686. + */
  4687. + private static int _first_id,_first_ammount,_second_id,_second_ammount,_event_ammount;
  4688. +
  4689. + /** Event points Required*/
  4690. + private static int _points;
  4691. +
  4692. + /** NPC ID */
  4693. + private static int _npcId;
  4694. +
  4695. + /** NPC Ammount */
  4696. + private static int _npcAm;
  4697. +
  4698. + /** BuffList */
  4699. + private static int _bufflist;
  4700. +
  4701. + /** BUFFER */
  4702. + private static L2Object _effector;
  4703. +
  4704. + /**
  4705. + * Vector Created to add Single/Party/Clan Players onto the event.
  4706. + * TODO: Use this vector also to add another kind of event --> free Event with any player that may want to participate.
  4707. + */
  4708. + public static Vector<L2PcInstance> _participatingPlayers = new Vector<L2PcInstance>();
  4709. +
  4710. + /**
  4711. + * Players from whom we're waiting for an answer in order to know it they want to join the event.
  4712. + */
  4713. + public static Vector<L2PcInstance> _awaitingplayers = new Vector<L2PcInstance>();
  4714. + /**
  4715. + * Vector Created to track all the Event Mobs and Delete them if needed.
  4716. + */
  4717. + public static Vector<L2NpcInstance> _eventMobList = new Vector<L2NpcInstance>();
  4718. +
  4719. + /** The state of the Event<br> */
  4720. + private static EventState _state = EventState.INACTIVE;
  4721. +
  4722. + enum EventState
  4723. + {
  4724. + INACTIVE,
  4725. + STARTING,
  4726. + STARTED,
  4727. + PARTICIPATING,
  4728. + REWARDING,
  4729. + INACTIVATING
  4730. + }
  4731. +
  4732. + /**
  4733. + * CONSTRUCTOR:<br>
  4734. + * This is the start of the Event, defined from HTM files.<br>
  4735. + * Documentation can be found in the method.<br>
  4736. + * @param player --> Player taking the action on the Event Manager.
  4737. + * @param type --> Type of Event: 1: Single Event || 2: Clan Event || 3: Party Event
  4738. + * @param points --> Event Points Required to start event.
  4739. + * @param npcId --> Id of the Event Raid/Mob
  4740. + * @param npcAm --> Amount of Mobs
  4741. + * @param minPeople --> Minimum People required to run event (Only functional on Clan and Party Events)
  4742. + * @param bufflist --> BuffList to apply to the player. Defined in the SQL table buff_templates
  4743. + * @param rewardLevel --> Reward level to apply upon player's victory.
  4744. + * @param effector --> Effector of the Buffs (Previously defined in L2EventMAnagerInstance.java)
  4745. + * @param participatingPlayers --> Players Enrolled in the Event.
  4746. + */
  4747. + public L2RaidEvent(L2PcInstance player,int type,int points,int npcId,int npcAm,int bufflist,
  4748. + int rewardLevel,L2Object effector,Vector<L2PcInstance> participatingPlayers)
  4749. + {
  4750. + // Define the actual coordinates of the Player.
  4751. + _player = player;
  4752. + _pX = player.getClientX();
  4753. + _pY = player.getClientY();
  4754. + _pZ = player.getClientZ();
  4755. + _eventType = type;
  4756. + _points = points;
  4757. + _npcId = npcId;
  4758. + _npcAm = npcAm;
  4759. + _bufflist = bufflist;
  4760. + _rewardLevel = rewardLevel;
  4761. + _effector = effector;
  4762. + _participatingPlayers = participatingPlayers;
  4763. + }
  4764. +
  4765. + /** Event Initialization given the Constructor defined variables.*/
  4766. + public void init()
  4767. + {
  4768. + setState(EventState.STARTING);
  4769. + //Increase the number of Current Events.
  4770. + if(!L2EventManagerInstance.addEvent())
  4771. + return;
  4772. + //Set the coordinates for the Event.
  4773. + if (setCoords(_player));
  4774. + else{L2EventManagerInstance.removeEvent();
  4775. + return;}
  4776. + _log.warning("RaidEngine [setCoords]: Players: "+_locX+", "+_locY+", "+_locZ);
  4777. + //Set Player inEvent
  4778. + setInEvent(_player);
  4779. + //Initialize event.
  4780. + startEvent(_player, _npcId, _npcAm);
  4781. + //Call the Function required to buff the player.
  4782. + buffEventMembers(_player,_points, _bufflist,_effector);
  4783. + return;
  4784. + }
  4785. +
  4786. + /**
  4787. + * Sets the spawn positions for the players in each event
  4788. + */
  4789. + private static boolean setCoords(L2PcInstance player)
  4790. + {
  4791. + int _ce = L2EventManagerInstance._currentEvents;
  4792. + if (_ce == 0 || (_ce>Config.RAID_SYSTEM_MAX_EVENTS))
  4793. + {
  4794. + String reason = null;
  4795. + if (_ce == 0)
  4796. + reason = "Current Events = 0.";
  4797. + else if(_ce>Config.RAID_SYSTEM_MAX_EVENTS)
  4798. + reason = "Too many Events going on";
  4799. + player.sendMessage("Raid Engines [setCoords()]: Error while setting spawn positions for players and Monsters. Reason: "+reason);
  4800. + return false;
  4801. + }
  4802. + else
  4803. + {
  4804. + loadSpawns(_ce);
  4805. + return true;
  4806. + }
  4807. + }
  4808. +
  4809. + /**
  4810. + * We will set the player/party Member in an Event Status.<br>
  4811. + * This way we will also make sure they don't enroll in any other event.<br>
  4812. + * @param player --> Player to set in an Event Status
  4813. + * @param type --> Type of event to be set In.
  4814. + */
  4815. + private synchronized void setInEvent(L2PcInstance player)
  4816. + {
  4817. + // Check if the type of event is defined.
  4818. + if (_eventType != 1 && _eventType != 2 && _eventType != 3)
  4819. + {
  4820. + player.sendMessage("Debug: Error in The event type [Function: setInEvent]");
  4821. + _log.warning("Event Manager: Error! Event not defined! [Function setInEvent]");
  4822. + return;
  4823. + }
  4824. + for (L2PcInstance member: _participatingPlayers)
  4825. + {
  4826. + if (member == null)
  4827. + continue;
  4828. + switch(_eventType){
  4829. + case 1:{member.inSoloEvent = true;
  4830. + break;}
  4831. + case 2:{member.inClanEvent = true;
  4832. + break;}
  4833. + case 3:{member.inPartyEvent = true;
  4834. + break;}
  4835. + default:return;}
  4836. + member.sendMessage("Event Manager: You are now enroled in a "+L2EventChecks.eType(_eventType)+" Type of Event.");
  4837. + }
  4838. + }
  4839. +
  4840. + /**
  4841. + * <b>Let's Apply the Buffs to the Event Members</b>
  4842. + * <li> We don't need to check if the player can or can not have access to the buffing state since it has
  4843. + * previously been checked.
  4844. + * <li> We assign a value of previousEventPoints to notify the player.
  4845. + * <li> Apply the buffs.
  4846. + * <li> Notify the player once he/she has gotten the Buffs.
  4847. + * <br>More Documentation can Be found inside the method's code.<br>
  4848. + * We will apply the buffs previous to the Event following the parameters:
  4849. + * @param player --> Player participating in the Event.
  4850. + * @param eventPoints --> Event points to be deduced once the buffing takes place.
  4851. + * @param buffList --> Buff list from where the buffs will be taken.
  4852. + * @param efector --> Eefector taking the action (in this case NPC).
  4853. + * @param eventType --> Type of Event.
  4854. + */
  4855. + private synchronized static void buffEventMembers(L2PcInstance player, int eventPoints, int buffList, L2Object efector)
  4856. + {
  4857. + /* Check if the event type has been defined.
  4858. + * Once the event is fully functional this checks will be taken out */
  4859. + if (_eventType!=1&&_eventType!=2&&_eventType!=3)
  4860. + {
  4861. + player.sendMessage("Debug: Error in The event type [Function: bufEventMembers]");
  4862. + _log.warning("Se corta la funcion de entrega de buffs.");
  4863. + return;
  4864. + }
  4865. + //Single event --> Direct Buffing.
  4866. + if (_eventType == 1)
  4867. + {
  4868. + int previousPoints =player.getEventPoints();
  4869. + if (Config.RAID_SYSTEM_GIVE_BUFFS)
  4870. + L2BufferInstance.makeBuffs(player,buffList,efector,false);
  4871. + player.setEventPoints(player.getEventPoints()-eventPoints);
  4872. + player.sendMessage("Event Manager: "+eventPoints+" Event Points have Been used. " +
  4873. + "You had "+previousPoints+" and now you have "+player.getEventPoints()+ "Event Points.");
  4874. + }
  4875. + // Clan Event: Let's buff all the clan members...
  4876. + // TODO: Check if the distance of other clan members is important upon member buffing.
  4877. + if (_eventType == 2)
  4878. + {
  4879. + // Define HOW many players are online at this very moment.
  4880. + int cmCount = _participatingPlayers.size();
  4881. + // Define the individual Event Points Price for every player.
  4882. + int individualPrice = eventPoints/cmCount;
  4883. + // Round up the price
  4884. + //individualPrice = Math.round(individualPrice);
  4885. + //Start the Buffing.
  4886. + for (L2PcInstance member: _participatingPlayers)
  4887. + {
  4888. + // Define the previous points for each member of the clan.
  4889. + int previousPoints;
  4890. + if (member == null)
  4891. + continue;
  4892. + // Apply the Buffs if allowed
  4893. + if (Config.RAID_SYSTEM_GIVE_BUFFS)
  4894. + L2BufferInstance.makeBuffs(member,buffList,efector,false);
  4895. + /*
  4896. + * In this case we will generate an HTML to notify the member of the action taken.
  4897. + * 1. In the first case, we will check if the subject has enough Event Points as to pay the Buffs,
  4898. + * and enroll into the event.
  4899. + * 2. If that's not the case we will proceed into the first IF:
  4900. + * 2a. The even points will be replaced by 0 since the player doesn't have enough event points
  4901. + * to pay the normal quota.
  4902. + * 2b. We will notify him of this situation. We will also deduce the missing points
  4903. + * from other Clan Members. (Sharing is good right? xD)
  4904. + * 3. If 1 is Affirmative we will proceed onto the second IF:
  4905. + * 3a. Deduction of event points = to what's needed to participate in the event/online
  4906. + * clan members.
  4907. + * 3b. Notify this situation and inform the player of the amount of points that he/she has at
  4908. + * this very moment.
  4909. + */
  4910. + if (individualPrice>member.getEventPoints())
  4911. + {
  4912. + previousPoints = member.getEventPoints();
  4913. + member.setEventPoints(0);
  4914. + NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  4915. + TextBuilder replyMSG = new TextBuilder("<html><body>");
  4916. + replyMSG.append("<tr><td>A total of "+eventPoints+" points have been deduced from your party TOTAL Event Point Score.</td></tr><br>");
  4917. + replyMSG.append("<tr><td>You didn't have enough Event Points, so we've used all of your points.</td></tr><br>");
  4918. + replyMSG.append("<tr><td>You had "+previousPoints+", and we needed "+individualPrice+" points.</td></tr><br><br><br>");
  4919. + replyMSG.append("<tr><td>Developed by: polbat02 for the L2J community.</td></tr>");
  4920. + replyMSG.append("</body></html>");
  4921. + adminReply.setHtml(replyMSG.toString());
  4922. + member.sendPacket(adminReply);
  4923. + }
  4924. + else
  4925. + {
  4926. + previousPoints = member.getEventPoints();
  4927. + member.setEventPoints(member.getEventPoints()-individualPrice);
  4928. + NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  4929. + TextBuilder replyMSG = new TextBuilder("<html><body>");
  4930. + replyMSG.append("<tr><td>A total of "+eventPoints+" points have been deduced from your party TOTAL Event Point Score.</td></tr><br>");
  4931. + replyMSG.append("<tr><td>You had "+previousPoints+", and now you have "+(previousPoints-individualPrice)+" points.</td></tr><br><br><br>");
  4932. + replyMSG.append("<tr><td>Developed by: polbat02 for the L2J community.</td></tr>");
  4933. + replyMSG.append("</body></html>");
  4934. + adminReply.setHtml(replyMSG.toString());
  4935. + member.sendPacket(adminReply);
  4936. + }
  4937. + }
  4938. + }
  4939. + // Party Event --> The same action as in Clan Events Will be taken.
  4940. + if (_eventType == 3)
  4941. + {
  4942. + int pmCount = player.getParty().getMemberCount();
  4943. + int individualPrice = eventPoints/pmCount;
  4944. + //individualPrice = Math.round(individualPrice);
  4945. + for (L2PcInstance member: _participatingPlayers)
  4946. + {
  4947. + if (member == null)
  4948. + continue;
  4949. + if (Config.RAID_SYSTEM_GIVE_BUFFS)
  4950. + L2BufferInstance.makeBuffs(member,buffList,efector,false);
  4951. + member.inPartyEvent = true;
  4952. + if (individualPrice>member.getEventPoints())
  4953. + {
  4954. + int previousPoints = member.getEventPoints();
  4955. + member.setEventPoints(0);
  4956. + NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  4957. + TextBuilder replyMSG = new TextBuilder("<html><body>");
  4958. + replyMSG.append("<tr><td>A total of "+eventPoints+" points have been deduced from your party TOTAL Event Point Score.</td></tr><br>");
  4959. + replyMSG.append("<tr><td>You didn't have enough Event Points, so we've used all of your points.</td></tr><br>");
  4960. + replyMSG.append("<tr><td>You had "+previousPoints+", and we needed "+individualPrice+" points.</td></tr><br><br><br>");
  4961. + replyMSG.append("<tr><td>Developed by: Polbat02 //Dragonlance Server.</td></tr>");
  4962. + replyMSG.append("</body></html>");
  4963. + adminReply.setHtml(replyMSG.toString());
  4964. + member.sendPacket(adminReply);
  4965. + }
  4966. + else
  4967. + {
  4968. + int previousPoints = member.getEventPoints();
  4969. + member.setEventPoints(member.getEventPoints()-individualPrice);
  4970. + NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  4971. + TextBuilder replyMSG = new TextBuilder("<html><body>");
  4972. + replyMSG.append("<tr><td>A total of "+eventPoints+" points have been deduced from your party TOTAL Event Point Score.</td></tr><br>");
  4973. + replyMSG.append("<tr><td>You had "+previousPoints+", and now you have "+(previousPoints-individualPrice)+" points.</td></tr><br><br><br>");
  4974. + replyMSG.append("<tr><td>Developed by: Polbat02 //Dragonlance Server.</td></tr>");
  4975. + replyMSG.append("</body></html>");
  4976. + adminReply.setHtml(replyMSG.toString());
  4977. + member.sendPacket(adminReply);
  4978. + }
  4979. + }
  4980. + }
  4981. + }
  4982. +
  4983. + /**
  4984. + * <b>Starting of the Event</b><br>
  4985. + * This method checks it the total amount of events in process is > than the allowed and acts
  4986. + * according to that and the parameters given.<br>
  4987. + * In case X events are already taking place, the void returns and won't let us continue with the
  4988. + * event.<br>
  4989. + * This check is not needed since we already check this in L2EventManagerInstance.java, but i'll
  4990. + * leave it in here for now since this is a very early stage of developing for now.<br>
  4991. + * More documentation can be found in the Method.<br>
  4992. + * @param player --> Player taking the action.
  4993. + * @param npcId --> Event Monster ID.
  4994. + * @param ammount --> Amount of Event Monsters
  4995. + * @param type --> type of Event.
  4996. + */
  4997. + private static void startEvent(L2PcInstance player, int npcId, int ammount)
  4998. + {
  4999. + if (player == null)
  5000. + return;
  5001. + int currentEvents = L2EventManagerInstance._currentEvents;
  5002. + if (currentEvents>=Config.RAID_SYSTEM_MAX_EVENTS)
  5003. + return;
  5004. + if (currentEvents == 0)
  5005. + return;
  5006. + setState(EventState.STARTED);
  5007. + // Teleport Player or Members depending on the Event Type.
  5008. + doTeleport(player,_locX,_locY,_locZ,10,false);
  5009. + // Spawn The NPC Monster for the Event.
  5010. + spawnMonster(npcId,60,ammount,_npcX,_npcY,_npcZ);
  5011. + }
  5012. +
  5013. + /**
  5014. + * Teleport the event participants to where the event is going to take place<br>
  5015. + * A function has been created to make it easier for us to teleport the players
  5016. + * every time we need them to teleport.<br>
  5017. + * Added suport for different kind of events.
  5018. + * @param player --> Player being teleported.
  5019. + * @param cox --> Coord X
  5020. + * @param coy --> Coord Y
  5021. + * @param coz --> Coord Z
  5022. + * @param delay --> Delay to be teleported in
  5023. + * @param removeBuffs --> Boolean to removeBuffs uponTeleport or not.
  5024. + */
  5025. + private static void doTeleport(L2PcInstance player,int cox,int coy,int coz,int delay,boolean removeBuffs)
  5026. + {
  5027. + for (L2PcInstance member: _participatingPlayers)
  5028. + {
  5029. + new L2EventTeleporter(member,cox,coy,coz,delay,removeBuffs);
  5030. + member.sendMessage("You will be teleported in 10 Seconds.");
  5031. + }
  5032. + }
  5033. +
  5034. + /**
  5035. + * Spawning function of Event Monsters.<br>
  5036. + * Added Support for multiple spawns and for each one of them being defined as Event Mob.
  5037. + * @param monsterId --> Npc Id
  5038. + * @param respawnTime --> Respawn Delay (in most cases this will be 0 as we're gonna
  5039. + * cut the respawning of the Mobs upon death).
  5040. + * @param mobCount --> MobCount to be spawned.
  5041. + * @param locX --> Coordinate X for the mob to be spawned in.
  5042. + * @param locY --> Coordinate Y for the mob to be spawned in.
  5043. + * @param locZ --> Coordinate Z for the mob to be spawned in.
  5044. + */
  5045. + private static void spawnMonster(int monsterId, int respawnDelay, int mobCount,int locX,int locY, int locZ)
  5046. + {
  5047. + L2NpcTemplate template;
  5048. + int monsterTemplate = monsterId;
  5049. + template = NpcTable.getInstance().getTemplate(monsterTemplate);
  5050. + if (template == null)
  5051. + return;
  5052. + _eventMobs = mobCount;
  5053. + // Support for multiple spawns.
  5054. + if (mobCount>1)
  5055. + {
  5056. + int n = 1;
  5057. + while (n<=mobCount)
  5058. + {
  5059. + try
  5060. + {
  5061. + L2Spawn spawn = new L2Spawn(template);
  5062. + // TODO: Add support for different spawning zones.
  5063. + spawn.setLocx(locX);
  5064. + spawn.setLocy(locY);
  5065. + spawn.setLocz(locZ);
  5066. + spawn.setAmount(1);
  5067. + spawn.setHeading(0);
  5068. + spawn.setRespawnDelay(respawnDelay);
  5069. + if (RaidBossSpawnManager.getInstance().getValidTemplate(spawn.getNpcid()) != null)
  5070. + RaidBossSpawnManager.getInstance().addNewSpawn(spawn, 0, template.getStatsSet().getDouble("baseHpMax"), template.getStatsSet().getDouble("baseMpMax"), false);
  5071. + else
  5072. + SpawnTable.getInstance().addNewSpawn(spawn, false);
  5073. + spawn.init();
  5074. + /* Define the properties of every spawn.
  5075. + * TODO: Change the Mob statistics according on Event Participants and Server Rates.
  5076. + */
  5077. + _lastNpcSpawn = spawn.getLastSpawn();
  5078. + _npcSpawn = spawn;
  5079. + _lastNpcSpawn.isPrivateEventMob=true;
  5080. + _lastNpcSpawn.setChampion(false);
  5081. + _lastNpcSpawn.setTitle("Event Monster");
  5082. + // Stop the Respawn of the Mob.
  5083. + _npcSpawn.stopRespawn();
  5084. + _eventMobList.add(_lastNpcSpawn);
  5085. + n++;
  5086. + }
  5087. + catch (Exception e)
  5088. + {
  5089. + _log.warning("L2EventManager: Exception Upon MULTIPLE NPC SPAWN.");
  5090. + e.printStackTrace();
  5091. + }
  5092. + }
  5093. + setState(EventState.PARTICIPATING);
  5094. + }
  5095. + else
  5096. + {
  5097. + try
  5098. + {
  5099. + L2Spawn spawn = new L2Spawn(template);
  5100. + spawn.setLocx(locX);
  5101. + spawn.setLocy(locY);
  5102. + spawn.setLocz(locZ);
  5103. + spawn.setAmount(1);
  5104. + spawn.setHeading(0);
  5105. + spawn.setRespawnDelay(respawnDelay);
  5106. + if (RaidBossSpawnManager.getInstance().getValidTemplate(spawn.getNpcid()) != null)
  5107. + RaidBossSpawnManager.getInstance().addNewSpawn(spawn, 0, template.getStatsSet().getDouble("baseHpMax"), template.getStatsSet().getDouble("baseMpMax"), false);
  5108. + else
  5109. + SpawnTable.getInstance().addNewSpawn(spawn, false);
  5110. + spawn.init();
  5111. + _lastNpcSpawn = spawn.getLastSpawn();
  5112. + _npcSpawn = spawn;
  5113. + _lastNpcSpawn.isPrivateEventMob=true;
  5114. + _lastNpcSpawn.setChampion(false);
  5115. + _lastNpcSpawn.setTitle("Event Monster");
  5116. + _npcSpawn.stopRespawn();
  5117. + _eventMobList.add(_lastNpcSpawn);
  5118. + }
  5119. + catch (Exception e)
  5120. + {
  5121. + _log.warning("L2EventManager: Exception Upon SINGLE NPC SPAWN.");
  5122. + e.printStackTrace();
  5123. + }
  5124. + setState(EventState.PARTICIPATING);
  5125. + }
  5126. + new RaidFightManager();
  5127. + }
  5128. +
  5129. + /**
  5130. + * Delete the mob from the Event.
  5131. + */
  5132. + private static void unSpawnNPC()
  5133. + {
  5134. + try
  5135. + {
  5136. + _lastNpcSpawn.deleteMe();
  5137. + _npcSpawn.stopRespawn();
  5138. + _npcSpawn = null;
  5139. + _lastNpcSpawn = null;
  5140. + }
  5141. + catch(Exception e)
  5142. + {
  5143. + _log.warning("L2EventManager: Eception Upon NPC UNSPAWN.");
  5144. + }
  5145. + }
  5146. + /**
  5147. + * Function launched at every player death (if he/she's enrolled in any Raid event)
  5148. + * @param player
  5149. + */
  5150. + public static void onPlayerDeath(L2PcInstance player)
  5151. + {
  5152. + /*
  5153. + * TODO: Add support for:
  5154. + * - Configurable Death rebirth system including:
  5155. + * - Automatic respawn (Done)
  5156. + * - Track deaths for player.
  5157. + * - doRevive? (Done)
  5158. + */
  5159. + new L2EventTeleporter(player,_locX,_locY,_locZ,0,false);
  5160. + player.setTarget(null);
  5161. + player.breakAttack();
  5162. + player.breakCast();
  5163. + player.doRevive();
  5164. + }
  5165. +
  5166. + /**
  5167. + * This is the place where we define all the actions that take place after one Event Mob dies.
  5168. + * a. Check if that was the last event mob of this instance.
  5169. + * b. If not, decrease the number by one.
  5170. + * c. Else return true.
  5171. + */
  5172. + public static boolean checkPossibleReward()
  5173. + {
  5174. + if (_eventMobs == 0)
  5175. + return false;
  5176. + if (_eventMobs<1)
  5177. + {
  5178. + _eventMobs = 0;
  5179. + return false;
  5180. + }
  5181. + if (_eventMobs>1)
  5182. + {
  5183. + _eventMobs = _eventMobs -1;
  5184. + return false;
  5185. + }
  5186. + setState(EventState.REWARDING);
  5187. + return true;
  5188. + }
  5189. + /**
  5190. + * This void picks the rewards and launches the hand out system.
  5191. + * It also Ends the event.
  5192. + * Added database support for this.
  5193. + * @param player --> Player taking the action.
  5194. + */
  5195. + public static void chooseReward(L2PcInstance player)
  5196. + {
  5197. + if (_eventMobs == 1)
  5198. + _eventMobs =0;
  5199. + else return;
  5200. + loadData(_rewardLevel);
  5201. + //Case Single Event
  5202. + if (_eventType == 1)
  5203. + {
  5204. + //Hand Out Items
  5205. + handOutItems(player,_first_id,_first_ammount,_second_id,_second_ammount,_event_ammount);
  5206. + //Genearal Clean-Up of the Event.
  5207. + unSpawnNPC();
  5208. + clearFromEvent(player);
  5209. + //Teleport back to previous-event location.
  5210. + doTeleport(player,_pX,_pY,_pZ,10,true);
  5211. + if (L2EventManagerInstance._currentEvents!=0)
  5212. + L2EventManagerInstance._currentEvents=L2EventManagerInstance._currentEvents-1;
  5213. + }
  5214. + //Case Clan Event
  5215. + if (_eventType == 2)
  5216. + {
  5217. + for (L2PcInstance member: _participatingPlayers)
  5218. + {
  5219. + if (member == null)
  5220. + continue;
  5221. + handOutItems(member,_first_id,_first_ammount,_second_id,_second_ammount,_event_ammount);
  5222. + doTeleport(member,_pX,_pY,_pZ,10,true);
  5223. + }
  5224. + unSpawnNPC();
  5225. + clearFromEvent(player);
  5226. + if (L2EventManagerInstance._currentEvents!=0)
  5227. + L2EventManagerInstance._currentEvents=L2EventManagerInstance._currentEvents-1;
  5228. + }
  5229. + //Case Party Event.
  5230. + if (_eventType == 3)
  5231. + {
  5232. + if(player.getParty() != null)
  5233. + {
  5234. + for (L2PcInstance member: _participatingPlayers)
  5235. + {
  5236. + handOutItems(member,_first_id,_first_ammount,_second_id,_second_ammount,_event_ammount);
  5237. + doTeleport(member,_pX,_pY,_pZ,10,true);
  5238. + }
  5239. + }
  5240. + else
  5241. + {
  5242. + player.sendMessage("You don't have a party anymore?! Well then the rewards go for you only.");
  5243. + //Hand Out Items
  5244. + handOutItems(player,_first_id,_first_ammount,_second_id,_second_ammount,_event_ammount);
  5245. + //General Clean-Up of the Event.
  5246. + unSpawnNPC();
  5247. + clearFromEvent(player);
  5248. + //Teleport back to previous-event location.
  5249. + doTeleport(player,_pX,_pY,_pZ,10,true);
  5250. + if (L2EventManagerInstance._currentEvents!=0)
  5251. + L2EventManagerInstance._currentEvents=L2EventManagerInstance._currentEvents-1;
  5252. + return;
  5253. + }
  5254. + unSpawnNPC();
  5255. + clearFromEvent(player);
  5256. + if (L2EventManagerInstance._currentEvents!=0)
  5257. + L2EventManagerInstance._currentEvents=L2EventManagerInstance._currentEvents-1;
  5258. + }
  5259. + return;
  5260. + }
  5261. +
  5262. + /**
  5263. + * Custom Definition of the Experience.
  5264. + * TODO: Add custom definitions of Experience for different prize lists.
  5265. + */
  5266. + public static void expHandOut()
  5267. + {
  5268. + exp += exp;
  5269. + sp +=sp;
  5270. + }
  5271. +
  5272. + /**
  5273. + * Clean the eventStatus from the players.
  5274. + */
  5275. + private synchronized static void clearFromEvent(L2PcInstance player)
  5276. + {
  5277. + setState(EventState.INACTIVATING);
  5278. + if (_eventType !=1 && _eventType!=2 &&_eventType!=3)
  5279. + return;
  5280. + if (_eventType == 1)
  5281. + {
  5282. + player.inSoloEvent = false;
  5283. + }
  5284. + if (_eventType == 2)
  5285. + {
  5286. + if (_participatingPlayers.size()!=0)
  5287. + {
  5288. + for (L2PcInstance member: _participatingPlayers)
  5289. + {
  5290. + if (member == null)
  5291. + continue;
  5292. + member.inClanEvent = false;
  5293. + }
  5294. + //Clear Clan Members from event.
  5295. + if(_participatingPlayers.size()!=0)
  5296. + _participatingPlayers.clear();
  5297. + }
  5298. + }
  5299. + if (_eventType == 3)
  5300. + {
  5301. + if(player.getParty()!=null)
  5302. + {
  5303. + player.inPartyEvent = false;
  5304. + for (L2PcInstance member: _participatingPlayers)
  5305. + {
  5306. + if (member == null)
  5307. + continue;
  5308. + member.inPartyEvent = false;
  5309. + }
  5310. + }
  5311. + else
  5312. + player.inPartyEvent = false;
  5313. + }
  5314. + setState(EventState.INACTIVE);
  5315. + }
  5316. +
  5317. + /**
  5318. + * Function with which we will hand out event Items.
  5319. + * @param player
  5320. + * @param item1
  5321. + * @param ammount1
  5322. + * @param item2
  5323. + * @param ammount2
  5324. + * @param eventPoints
  5325. + */
  5326. + private static void handOutItems(L2PcInstance player, int item1, int ammount1, int item2, int ammount2, int eventPoints)
  5327. + {
  5328. + boolean hasItem1 = false;
  5329. + boolean hasItem2 = false;
  5330. + boolean hasEventPoints = false;
  5331. + if (item1 == 0 && item2 == 0 && eventPoints == 0)
  5332. + return;
  5333. + if (item1 != 0)
  5334. + hasItem1 = true;
  5335. + if (item2 != 0)
  5336. + hasItem2 = true;
  5337. + if (eventPoints != 0)
  5338. + hasEventPoints = true;
  5339. + PcInventory inv = player.getInventory();
  5340. + if (hasItem1)
  5341. + {
  5342. + if (item1 == 57)
  5343. + {
  5344. + inv.addAdena("Event - Adena",ammount1,player,player);
  5345. + SystemMessage smAdena;
  5346. + smAdena = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
  5347. + smAdena.addItemName(57);
  5348. + smAdena.addNumber(ammount1);
  5349. + player.sendPacket(smAdena);
  5350. + }
  5351. + else
  5352. + {
  5353. + if (ItemTable.getInstance().createDummyItem(item1).isStackable())
  5354. + inv.addItem("Event", item1, ammount1, player, player);
  5355. + else
  5356. + {
  5357. + for (int i=0;i<=ammount1-1;i++)
  5358. + inv.addItem("Event", item1, ammount1, player, player);
  5359. + }
  5360. + SystemMessage smItem;
  5361. + smItem = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
  5362. + smItem.addItemName(item1);
  5363. + smItem.addNumber(ammount1);
  5364. + player.sendPacket(smItem);
  5365. + }
  5366. + }
  5367. + if (hasItem2)
  5368. + {
  5369. + if (item2 == 57)
  5370. + {
  5371. + inv.addAdena("Event - Adena",ammount2,player,player);
  5372. + SystemMessage smAdena;
  5373. + smAdena = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
  5374. + smAdena.addItemName(57);
  5375. + smAdena.addNumber(ammount2);
  5376. + player.sendPacket(smAdena);
  5377. + }
  5378. + else
  5379. + {
  5380. + if (ItemTable.getInstance().createDummyItem(item2).isStackable())
  5381. + inv.addItem("Event", item2, ammount2, player, player);
  5382. + else
  5383. + {
  5384. + for (int i=0;i<=ammount2-1;i++)
  5385. + inv.addItem("Event", item2, ammount2, player, player);
  5386. + }
  5387. + SystemMessage smItem;
  5388. + smItem = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
  5389. + smItem.addItemName(item2);
  5390. + smItem.addNumber(ammount2);
  5391. + player.sendPacket(smItem);
  5392. + }
  5393. + }
  5394. + if (hasEventPoints)
  5395. + {
  5396. + player.setEventPoints(player.getEventPoints()+eventPoints);
  5397. + SystemMessage smp;
  5398. + smp = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
  5399. + smp.addString("Event Points ");
  5400. + smp.addNumber(2);
  5401. + player.sendPacket(smp);
  5402. + }
  5403. + StatusUpdate su = new StatusUpdate(player.getObjectId());
  5404. + su.addAttribute(StatusUpdate.CUR_LOAD, player.getCurrentLoad());
  5405. + player.sendPacket(su);
  5406. + player.sendPacket(new ItemList(player, true));
  5407. + NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  5408. + TextBuilder replyMSG = new TextBuilder("<html><body>");
  5409. + replyMSG.append("<tr><td>You won the event!</td></tr><br>");
  5410. + replyMSG.append("<tr><td>You have Earned:</td></tr><br>");
  5411. + if (hasItem1)
  5412. + {
  5413. + String item1name =ItemTable.getInstance().createDummyItem(item1).getItemName();
  5414. + replyMSG.append("<tr><td>- "+ammount1+" "+item1name+".</td></tr><br>");
  5415. + }
  5416. + if (hasItem2)
  5417. + {
  5418. + String item2name =ItemTable.getInstance().createDummyItem(item2).getItemName();
  5419. + replyMSG.append("<tr><td>- "+ammount2+" "+item2name+".</td></tr><br>");
  5420. + }
  5421. + if (hasEventPoints)
  5422. + {
  5423. + replyMSG.append("<tr><td>- "+eventPoints+" Event Points.</td></tr><br>");
  5424. + }
  5425. + replyMSG.append("<br><tr><td>Congratulations!!</td></tr><br><br><br>");
  5426. + replyMSG.append("<tr><td>Developed by: Polbat02.</td></tr>");
  5427. + replyMSG.append("</body></html>");
  5428. + adminReply.setHtml(replyMSG.toString());
  5429. + player.sendPacket(adminReply);
  5430. + }
  5431. + /**
  5432. + * Hard Finish Event (Case every Body dies)
  5433. + */
  5434. + public static void hardFinish()
  5435. + {
  5436. + for (L2NpcInstance eventMob: _eventMobList)
  5437. + {
  5438. + eventMob.decayMe();
  5439. + eventMob.deleteMe();
  5440. + L2EventManagerInstance._currentEvents -= 1;
  5441. + }
  5442. + _log.warning("Raid Engines: All the Members from the Event are now dead or Have Left The event. Event Finished.");
  5443. + }
  5444. + /**
  5445. + * Load Data of the prizes for each event.
  5446. + * Added DataBase support for this.
  5447. + * @param prizePackage
  5448. + */
  5449. + private static void loadData(int prizePackage)
  5450. + {
  5451. + Connection con;
  5452. + try
  5453. + {
  5454. + con = L2DatabaseFactory.getInstance().getConnection();
  5455. + PreparedStatement statement = con.prepareStatement("SELECT first_prize_id, first_prize_ammount, second_prize_id, second_prize_ammount, event_points_ammount FROM raid_prizes WHERE `prize_package_id` = '"+prizePackage+"'");
  5456. + ResultSet rset = statement.executeQuery();
  5457. + while(rset.next())
  5458. + {
  5459. + _first_id = rset.getInt("first_prize_id");
  5460. + _first_ammount = rset.getInt("first_prize_ammount");
  5461. + _second_id = rset.getInt("second_prize_id");
  5462. + _second_ammount = rset.getInt("second_prize_ammount");
  5463. + _event_ammount = rset.getInt("event_points_ammount");
  5464. + }
  5465. + rset.close();
  5466. + statement.close();
  5467. + con.close();
  5468. + }
  5469. + catch (Exception e)
  5470. + {
  5471. + _log.severe("Error While loading Raids prizes." + e);
  5472. + }
  5473. + }
  5474. +
  5475. + /**
  5476. + * Sets the Event state<br><br>
  5477. + * @param state<br>
  5478. + */
  5479. + private static void setState(EventState state)
  5480. + {
  5481. + synchronized (_state)
  5482. + {
  5483. + _state = state;
  5484. + }
  5485. + }
  5486. +
  5487. + /**
  5488. + * Is Event inactive?<br><br>
  5489. + * @return boolean<br>
  5490. + */
  5491. + public static boolean isInactive()
  5492. + {
  5493. + boolean isInactive;
  5494. +
  5495. + synchronized (_state)
  5496. + {
  5497. + isInactive = _state == EventState.INACTIVE;
  5498. + }
  5499. +
  5500. + return isInactive;
  5501. + }
  5502. +
  5503. + /**
  5504. + * Is Event in inactivating?<br><br>
  5505. + * @return boolean<br>
  5506. + */
  5507. + public static boolean isInactivating()
  5508. + {
  5509. + boolean isInactivating;
  5510. +
  5511. + synchronized (_state)
  5512. + {
  5513. + isInactivating = _state == EventState.INACTIVATING;
  5514. + }
  5515. +
  5516. + return isInactivating;
  5517. + }
  5518. +
  5519. + /**
  5520. + * Is Event in participation?<br><br>
  5521. + * @return boolean<br>
  5522. + */
  5523. + public static boolean isParticipating()
  5524. + {
  5525. + boolean isParticipating;
  5526. +
  5527. + synchronized (_state)
  5528. + {
  5529. + isParticipating = _state == EventState.PARTICIPATING;
  5530. + }
  5531. +
  5532. + return isParticipating;
  5533. + }
  5534. +
  5535. + /**
  5536. + * Is Event starting?<br><br>
  5537. + * @return boolean<br>
  5538. + */
  5539. + public static boolean isStarting()
  5540. + {
  5541. + boolean isStarting;
  5542. +
  5543. + synchronized (_state)
  5544. + {
  5545. + isStarting = _state == EventState.STARTING;
  5546. + }
  5547. +
  5548. + return isStarting;
  5549. + }
  5550. +
  5551. + /**
  5552. + * Is Event started?<br><br>
  5553. + * @return boolean<br>
  5554. + */
  5555. + public static boolean isStarted()
  5556. + {
  5557. + boolean isStarted;
  5558. +
  5559. + synchronized (_state)
  5560. + {
  5561. + isStarted = _state == EventState.STARTED;
  5562. + }
  5563. +
  5564. + return isStarted;
  5565. + }
  5566. +
  5567. + /**
  5568. + * Is Event rewarding?<br><br>
  5569. + * @return boolean<br>
  5570. + */
  5571. + public static boolean isRewarding()
  5572. + {
  5573. + boolean isRewarding;
  5574. +
  5575. + synchronized (_state)
  5576. + {
  5577. + isRewarding = _state == EventState.REWARDING;
  5578. + }
  5579. +
  5580. + return isRewarding;
  5581. + }
  5582. +
  5583. + /**
  5584. + * Send a SystemMessage to all participated players<br>
  5585. + * 1. Send the message to all players of team number one<br>
  5586. + * 2. Send the message to all players of team number two<br><br>
  5587. + *
  5588. + * @param message<br>
  5589. + */
  5590. + public static void sysMsgToAllParticipants(String message)
  5591. + {
  5592. + for (L2PcInstance player : _participatingPlayers)
  5593. + {
  5594. + if (player != null)
  5595. + player.sendMessage(message);
  5596. + }
  5597. + }
  5598. +
  5599. +
  5600. + private static void loadSpawns(int eventNum)
  5601. + {
  5602. + Connection con;
  5603. + try
  5604. + {
  5605. + con = L2DatabaseFactory.getInstance().getConnection();
  5606. + PreparedStatement statement = con.prepareStatement
  5607. + ("SELECT raid_locX, raid_locY, raid_locZ, player_locX, player_locY, player_locZ " +
  5608. + "FROM raid_event_spawnlist WHERE `id` = '"+eventNum+"'");
  5609. + ResultSet rset = statement.executeQuery();
  5610. + while(rset.next())
  5611. + {
  5612. + _npcX = rset.getInt("raid_locX");
  5613. + _npcY = rset.getInt("raid_locY");
  5614. + _npcZ = rset.getInt("raid_locZ");
  5615. + _locX = rset.getInt("player_locX");
  5616. + _locY = rset.getInt("player_locY");
  5617. + _locZ = rset.getInt("player_locZ");
  5618. + }
  5619. + rset.close();
  5620. + statement.close();
  5621. + con.close();
  5622. + }
  5623. + catch (Exception e)
  5624. + {
  5625. + _log.severe("Error While loading Raids Spawn Positions." + e);
  5626. + }
  5627. + }
  5628. +}
  5629. Index: /trunk/Game/java/net/sf/l2j/gameserver/model/entity/L2EventTeleporter.java
  5630. ===================================================================
  5631. --- /trunk/Game/java/net/sf/l2j/gameserver/model/entity/L2EventTeleporter.java (revision 681)
  5632. +++ /trunk/Game/java/net/sf/l2j/gameserver/model/entity/L2EventTeleporter.java (revision 681)
  5633. @@ -0,0 +1,91 @@
  5634. +/*
  5635. + * This program is free software; you can redistribute it and/or modify
  5636. + * it under the terms of the GNU General Public License as published by
  5637. + * the Free Software Foundation; either version 2, or (at your option)
  5638. + * any later version.
  5639. + *
  5640. + * This program is distributed in the hope that it will be useful,
  5641. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  5642. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  5643. + * GNU General Public License for more details.
  5644. + *
  5645. + * You should have received a copy of the GNU General Public License
  5646. + * along with this program; if not, write to the Free Software
  5647. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  5648. + * 02111-1307, USA.
  5649. + *
  5650. + * http://www.gnu.org/copyleft/gpl.html
  5651. + */
  5652. +package net.sf.l2j.gameserver.model.entity;
  5653. +
  5654. +import net.sf.l2j.gameserver.ThreadPoolManager;
  5655. +import net.sf.l2j.gameserver.datatables.SkillTable;
  5656. +import net.sf.l2j.gameserver.model.L2Effect;
  5657. +import net.sf.l2j.gameserver.model.L2Summon;
  5658. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  5659. +import net.sf.l2j.gameserver.serverpackets.Ride;
  5660. +
  5661. +public class L2EventTeleporter implements Runnable
  5662. +{
  5663. + private L2PcInstance _player = null;
  5664. + private int _coordinateX = 0;
  5665. + private int _coordinateY = 0;
  5666. + private int _coordinateZ = 0;
  5667. + boolean _removeBuffs;
  5668. +
  5669. + /**
  5670. + * Manages all Teleports done within a Raid Event.
  5671. + * @param player --> Player being teleported
  5672. + * @param coordinateX --> CX
  5673. + * @param coordinateY --> CY
  5674. + * @param coordinateZ --> CZ
  5675. + * @param delay --> Delay to do the actual teleport.
  5676. + * @param removeBuffs --> Boolean to allow removal of buffs.
  5677. + */
  5678. + public L2EventTeleporter(L2PcInstance player, int coordinateX, int coordinateY, int coordinateZ , int delay, boolean removeBuffs)
  5679. + {
  5680. + _player = player;
  5681. + _coordinateX = coordinateX;
  5682. + _coordinateY = coordinateY;
  5683. + _coordinateZ = coordinateZ;
  5684. + _removeBuffs = removeBuffs;
  5685. + //Espera para hacer el teleport
  5686. + long _delay = delay * 1000L;
  5687. + if (delay == 0)
  5688. + _delay = 0;
  5689. + ThreadPoolManager.getInstance().scheduleGeneral(this, _delay);
  5690. + }
  5691. +
  5692. + public void run()
  5693. + {
  5694. + if (_player == null)
  5695. + return;
  5696. +
  5697. + if (_player.isMounted())
  5698. + {
  5699. + if (_player.isFlying())
  5700. + _player.removeSkill(SkillTable.getInstance().getInfo(4289, 1));
  5701. + Ride dismount = new Ride(_player.getObjectId(), Ride.ACTION_DISMOUNT, 0);
  5702. + _player.broadcastPacket(dismount);
  5703. + _player.setMountType(0);
  5704. + _player.setMountObjectID(0);
  5705. + }
  5706. + L2Summon summon = _player.getPet();
  5707. + if (_removeBuffs && summon != null)
  5708. + summon.unSummon(_player);
  5709. + if (_removeBuffs)
  5710. + {
  5711. + for (L2Effect effect : _player.getAllEffects())
  5712. + {
  5713. + if (effect != null)
  5714. + effect.exit();
  5715. + }
  5716. + }
  5717. + _player.setCurrentCp(_player.getMaxCp()+5000);
  5718. + _player.setCurrentHp(_player.getMaxHp()+5000);
  5719. + _player.setCurrentMp(_player.getMaxMp()+5000);
  5720. + _player.teleToLocation(_coordinateX, _coordinateY, _coordinateZ, false);
  5721. + _player.broadcastStatusUpdate();
  5722. + _player.broadcastUserInfo();
  5723. + }
  5724. +}
  5725. Index: /trunk/Game/java/net/sf/l2j/gameserver/model/entity/RaidFightManager.java
  5726. ===================================================================
  5727. --- /trunk/Game/java/net/sf/l2j/gameserver/model/entity/RaidFightManager.java (revision 681)
  5728. +++ /trunk/Game/java/net/sf/l2j/gameserver/model/entity/RaidFightManager.java (revision 681)
  5729. @@ -0,0 +1,85 @@
  5730. +package net.sf.l2j.gameserver.model.entity;
  5731. +
  5732. +import java.util.logging.Logger;
  5733. +
  5734. +import net.sf.l2j.Config;
  5735. +import net.sf.l2j.gameserver.Announcements;
  5736. +import net.sf.l2j.gameserver.model.actor.instance.L2EventManagerInstance;
  5737. +import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;
  5738. +
  5739. +public class RaidFightManager
  5740. +{
  5741. + protected static final Logger _log = Logger.getLogger(RaidFightManager.class.getName());
  5742. + /**
  5743. + * The task method to handle cycles of the event<br><br>
  5744. + *
  5745. + * @see java.lang.Runnable#run()<br>
  5746. + */
  5747. + public void run()
  5748. + {
  5749. + //TODO: Add initial breaks. And check performance
  5750. + for (;;)
  5751. + {
  5752. + waiter(Config.RAID_SYSTEM_FIGHT_TIME * 60); // in configuration given as minutes
  5753. + for (L2NpcInstance eventMob: L2RaidEvent._eventMobList)
  5754. + {
  5755. + eventMob.decayMe();
  5756. + eventMob.deleteMe();
  5757. + L2EventManagerInstance._currentEvents -= 1;
  5758. + }
  5759. + _log.warning("Raid Engines: All the Members from the Event are now dead or Have Left The event. Event Finished.");
  5760. + break;
  5761. + }
  5762. + }
  5763. +
  5764. + void waiter(int seconds)
  5765. + {
  5766. + while (seconds > 1)
  5767. + {
  5768. + seconds--; // here because we don't want to see two time announce at the same time
  5769. +
  5770. + if (L2RaidEvent.isParticipating())
  5771. + {
  5772. + switch (seconds)
  5773. + {
  5774. + case 3600: // 1 hour left
  5775. + L2RaidEvent.sysMsgToAllParticipants("You have One our left to kill the Raid Boss.");
  5776. +
  5777. + break;
  5778. + case 1800: // 30 minutes left
  5779. + case 900: // 15 minutes left
  5780. + case 600: // 10 minutes left
  5781. + case 300: // 5 minutes left
  5782. + case 240: // 4 minutes left
  5783. + case 180: // 3 minutes left
  5784. + case 120: // 2 minutes left
  5785. + case 60: // 1 minute left
  5786. + Announcements.getInstance().announceToAll("L2Raid Event: " + seconds / 60 + " minute(s) untill Boss Disapears!");
  5787. + break;
  5788. + case 30: // 30 seconds left
  5789. + case 15: // 15 seconds left
  5790. + case 10: // 10 seconds left
  5791. + case 5: // 5 seconds left
  5792. + case 4: // 4 seconds left
  5793. + case 3: // 3 seconds left
  5794. + case 2: // 2 seconds left
  5795. + case 1: // 1 seconds left
  5796. + Announcements.getInstance().announceToAll("L2Raid Event: " + seconds + " second(s) untill Boss Disapears!");
  5797. + break;
  5798. + }
  5799. + }
  5800. +
  5801. + long oneSecWaitStart = System.currentTimeMillis();
  5802. +
  5803. + while (oneSecWaitStart + 1000L > System.currentTimeMillis())
  5804. + {
  5805. + try
  5806. + {
  5807. + Thread.sleep(1);
  5808. + }
  5809. + catch (InterruptedException ie)
  5810. + {}
  5811. + }
  5812. + }
  5813. + }
  5814. +}
  5815. Index: /trunk/Game/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Wedding.java
  5816. ===================================================================
  5817. --- /trunk/Game/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Wedding.java (revision 679)
  5818. +++ /trunk/Game/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Wedding.java (revision 681)
  5819. @@ -209,10 +209,11 @@
  5820. return false;
  5821. }
  5822.  
  5823. ptarget.setEngageRequest(true, activeChar.getObjectId());
  5824. //ptarget.sendMessage("Player "+activeChar.getName()+" wants to engage with you.");
  5825. + activeChar.awaitingAnswer = true;
  5826. ptarget.sendPacket(new ConfirmDlg(614,activeChar.getName()+" asking you to engage. Do you want to start a new relationship?"));
  5827. return true;
  5828. }
  5829.  
  5830. public boolean GoToLove(L2PcInstance activeChar)
  5831. Index: /trunk/Game/java/net/sf/l2j/gameserver/handler/usercommandhandlers/Escape.java
  5832. ===================================================================
  5833. --- /trunk/Game/java/net/sf/l2j/gameserver/handler/usercommandhandlers/Escape.java (revision 679)
  5834. +++ /trunk/Game/java/net/sf/l2j/gameserver/handler/usercommandhandlers/Escape.java (revision 681)
  5835. @@ -71,10 +71,16 @@
  5836. if (activeChar.isInJail())
  5837. {
  5838. activeChar.sendMessage("You can not escape from jail.");
  5839. return false;
  5840. }
  5841. +
  5842. + if (activeChar.inClanEvent || activeChar.inPartyEvent || activeChar.inSoloEvent)
  5843. + {
  5844. + activeChar.sendPacket(SystemMessage.sendString("You can't escape while in Event."));
  5845. + return false;
  5846. + }
  5847.  
  5848. SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
  5849. sm.addString("After " + unstuckTimer/60000 + " min. you be returned to near village.");
  5850.  
  5851. activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
  5852. Index: /trunk/Game/java/net/sf/l2j/gameserver/GameServer.java
  5853. ===================================================================
  5854. --- /trunk/Game/java/net/sf/l2j/gameserver/GameServer.java (revision 679)
  5855. +++ /trunk/Game/java/net/sf/l2j/gameserver/GameServer.java (revision 681)
  5856. @@ -20,10 +20,11 @@
  5857. import net.sf.l2j.gameserver.datatables.ArmorSetsTable;
  5858. import net.sf.l2j.gameserver.datatables.AugmentationData;
  5859. import net.sf.l2j.gameserver.datatables.CharNameTable;
  5860. import net.sf.l2j.gameserver.datatables.CharTemplateTable;
  5861. import net.sf.l2j.gameserver.datatables.ClanTable;
  5862. +import net.sf.l2j.gameserver.datatables.BuffTemplateTable;
  5863. import net.sf.l2j.gameserver.datatables.DoorTable;
  5864. import net.sf.l2j.gameserver.datatables.EventDroplist;
  5865. import net.sf.l2j.gameserver.datatables.ExtractableItemsData;
  5866. import net.sf.l2j.gameserver.datatables.FishTable;
  5867. import net.sf.l2j.gameserver.datatables.HelperBuffTable;
  5868. @@ -365,10 +366,12 @@
  5869. {
  5870. throw new Exception("Could not initialize the Henna Tree Table");
  5871. }
  5872.  
  5873. _helperBuffTable = HelperBuffTable.getInstance();
  5874. +
  5875. + BuffTemplateTable.getInstance();
  5876.  
  5877. if (!_helperBuffTable.isInitialized())
  5878. {
  5879. throw new Exception("Could not initialize the Helper Buff Table");
  5880. }
  5881. Index: /trunk/Game/java/net/sf/l2j/gameserver/templates/L2BuffTemplate.java
  5882. ===================================================================
  5883. --- /trunk/Game/java/net/sf/l2j/gameserver/templates/L2BuffTemplate.java (revision 681)
  5884. +++ /trunk/Game/java/net/sf/l2j/gameserver/templates/L2BuffTemplate.java (revision 681)
  5885. @@ -0,0 +1,249 @@
  5886. +package net.sf.l2j.gameserver.templates;
  5887. +
  5888. +import net.sf.l2j.gameserver.datatables.SkillTable;
  5889. +import net.sf.l2j.gameserver.model.L2Skill;
  5890. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  5891. +import net.sf.l2j.gameserver.model.base.Race;
  5892. +
  5893. +/**
  5894. + * This class represents a Buff Template
  5895. + *
  5896. + * @author: polbat02
  5897. + */
  5898. +
  5899. +public class L2BuffTemplate
  5900. +{
  5901. + /** Id of buff template */
  5902. + private int _templateId;
  5903. +
  5904. + /** Name of the buff template */
  5905. + private String _templateName;
  5906. +
  5907. + /** Identifier of the skill (buff) to cast */
  5908. + private int _skillId;
  5909. +
  5910. + /** Order of the skill in template */
  5911. + private int _skillOrder;
  5912. +
  5913. + private L2Skill _skill;
  5914. +
  5915. + /** Level of the skill (buff) to cast */
  5916. + private int _skillLevel;
  5917. +
  5918. + /** Force cast, even if same effect present */
  5919. + private boolean _forceCast;
  5920. +
  5921. + /** Condition that player must have to obtain this buff */
  5922. + /** Min player level */
  5923. + private int _minLevel;
  5924. +
  5925. + /** Max player level */
  5926. + private int _maxLevel;
  5927. +
  5928. + /** Player's faction */
  5929. + private int _faction;
  5930. +
  5931. + /** Players's race */
  5932. + private int _race;
  5933. +
  5934. + /** Magus/Fighter class of the player */
  5935. + private int _class;
  5936. +
  5937. + /** Adena price */
  5938. + private int _adena;
  5939. +
  5940. + /** Faction points price */
  5941. + private int _points;
  5942. +
  5943. + /**
  5944. + * Constructor of L2BuffTemplat.<BR><BR>
  5945. + */
  5946. + public L2BuffTemplate(StatsSet set)
  5947. + {
  5948. + _templateId = set.getInteger("id");
  5949. + _templateName = set.getString("name");
  5950. + _skillId = set.getInteger("skillId");
  5951. + _skillLevel = set.getInteger("skillLevel");
  5952. + _skillOrder = set.getInteger("skillOrder");
  5953. +
  5954. + if (_skillLevel == 0)
  5955. + _skillLevel = SkillTable.getInstance().getMaxLevel(_skillId,_skillLevel);
  5956. +
  5957. + _skill = SkillTable.getInstance().getInfo(_skillId,_skillLevel);
  5958. +
  5959. + _forceCast = (set.getInteger("forceCast") == 1);
  5960. + _minLevel = set.getInteger("minLevel");
  5961. + _maxLevel = set.getInteger("maxLevel");
  5962. + _race = set.getInteger("race");
  5963. + _class = set.getInteger("class");
  5964. + _faction = set.getInteger("faction");
  5965. + _adena = set.getInteger("adena");
  5966. + _points = set.getInteger("points");
  5967. + }
  5968. +
  5969. + /**
  5970. + * @return Returns the Id of the buff template
  5971. + */
  5972. + public int getId()
  5973. + {
  5974. + return _templateId;
  5975. + }
  5976. +
  5977. + /**
  5978. + * @return Returns the Name of the buff template
  5979. + */
  5980. + public String getName()
  5981. + {
  5982. + return _templateName;
  5983. + }
  5984. +
  5985. + /**
  5986. + * @return Returns the Id of the buff that the L2PcInstance will receive
  5987. + */
  5988. + public int getSkillId()
  5989. + {
  5990. + return _skillId;
  5991. + }
  5992. +
  5993. + /**
  5994. + * @return Returns the Id of the buff that the L2PcInstance will receive
  5995. + */
  5996. + public int getSkillOrder()
  5997. + {
  5998. + return _skillOrder;
  5999. + }
  6000. +
  6001. + /**
  6002. + * @return Returns the Level of the buff that the L2PcInstance will receive
  6003. + */
  6004. + public int getSkillLevel()
  6005. + {
  6006. + return _skillLevel;
  6007. + }
  6008. +
  6009. + /**
  6010. + * @return Returns the Skill that the L2PcInstance will receive
  6011. + */
  6012. + public L2Skill getSkill()
  6013. + {
  6014. + return _skill;
  6015. + }
  6016. +
  6017. + /**
  6018. + * @return Returns the L2PcInstance minimum level to receive buff
  6019. + */
  6020. + public int getMinLevel()
  6021. + {
  6022. + return _minLevel;
  6023. + }
  6024. +
  6025. + /**
  6026. + * @return Returns the L2PcInstance maximum level to receive buff
  6027. + */
  6028. + public int getMaxLevel()
  6029. + {
  6030. + return _maxLevel;
  6031. + }
  6032. +
  6033. + /**
  6034. + * @return Returns the requirement faction to receive buff
  6035. + */
  6036. + public int getFaction()
  6037. + {
  6038. + return _faction;
  6039. + }
  6040. +
  6041. + /**
  6042. + * @return Returns the price for buff in Adena
  6043. + */
  6044. + public int getAdenaPrice()
  6045. + {
  6046. + return _adena;
  6047. + }
  6048. +
  6049. + /**
  6050. + * @return Returns the price for buff in Event Points
  6051. + */
  6052. + public int getPointsPrice()
  6053. + {
  6054. + return _points;
  6055. + }
  6056. +
  6057. + /**
  6058. + * @return Is cast animation will be shown
  6059. + */
  6060. + public boolean forceCast()
  6061. + {
  6062. + return _forceCast;
  6063. + }
  6064. +
  6065. + /**
  6066. + * @return Returns the result of level check
  6067. + */
  6068. + public boolean checkLevel(L2PcInstance player)
  6069. + {
  6070. + return ((_minLevel == 0 || player.getLevel()>=_minLevel) && (_maxLevel == 0 || player.getLevel()<=_maxLevel));
  6071. + }
  6072. +
  6073. + /**
  6074. + * @return Returns the result of race check
  6075. + */
  6076. + public boolean checkRace(L2PcInstance player)
  6077. + {
  6078. + boolean cond = false;
  6079. + if (_race == 0 || _race == 31) return true;
  6080. + if ((player.getRace() == Race.human) && (_race & 16) != 0) cond=true;
  6081. + if ((player.getRace() == Race.elf) && (_race & 8) != 0) cond=true;
  6082. + if ((player.getRace() == Race.darkelf) && (_race & 4) != 0) cond=true;
  6083. + if ((player.getRace() == Race.orc) && (_race & 2) != 0) cond=true;
  6084. + if ((player.getRace() == Race.dwarf) && (_race & 1) != 0) cond=true;
  6085. + return cond;
  6086. + }
  6087. +
  6088. + /**
  6089. + * @return Returns the result of Magus/Fighter class check
  6090. + */
  6091. + public boolean checkClass(L2PcInstance player)
  6092. + {
  6093. + return ((_class == 0 || _class == 3) || (_class == 1 && !player.isMageClass()) || (_class == 2 && player.isMageClass()));
  6094. + }
  6095. +
  6096. + /**
  6097. + * @return Returns the result of faction check
  6098. + */
  6099. + public boolean checkFaction(L2PcInstance player)
  6100. + {
  6101. + return true;
  6102. + //return ((_faction == 0 ||player.getFaction = _faction)
  6103. + }
  6104. +
  6105. + /**
  6106. + * @return Returns the result of price check
  6107. + */
  6108. + public boolean checkPrice(L2PcInstance player)
  6109. + {
  6110. + return ((_adena == 0 || player.getInventory().getAdena()>=_adena) && (_points == 0 || (player.getEventPoints()>=_points)));
  6111. + }
  6112. + /**
  6113. + * @return Returns the result of a the Event Point check
  6114. + */
  6115. + public boolean checkPoints(L2PcInstance player)
  6116. + {
  6117. + if (player.getEventPoints()>=_points)
  6118. + return true;
  6119. + return false;
  6120. + }
  6121. +
  6122. + /**
  6123. + * @return Returns the result of all player related conditions check
  6124. + */
  6125. + public boolean checkPlayer(L2PcInstance player)
  6126. + {
  6127. + return
  6128. + (checkLevel(player)
  6129. + && checkRace(player)
  6130. + && checkClass(player)
  6131. + && checkFaction(player));
  6132. + }
  6133. +
  6134. +}
  6135. Index: /trunk/Game/java/net/sf/l2j/gameserver/datatables/BuffTemplateTable.java
  6136. ===================================================================
  6137. --- /trunk/Game/java/net/sf/l2j/gameserver/datatables/BuffTemplateTable.java (revision 681)
  6138. +++ /trunk/Game/java/net/sf/l2j/gameserver/datatables/BuffTemplateTable.java (revision 681)
  6139. @@ -0,0 +1,191 @@
  6140. +package net.sf.l2j.gameserver.datatables;
  6141. +
  6142. +import java.sql.PreparedStatement;
  6143. +import java.sql.ResultSet;
  6144. +
  6145. +import javolution.util.FastList;
  6146. +import net.sf.l2j.L2DatabaseFactory;
  6147. +import net.sf.l2j.gameserver.templates.L2BuffTemplate;
  6148. +import net.sf.l2j.gameserver.templates.StatsSet;
  6149. +
  6150. +import org.apache.commons.logging.Log;
  6151. +import org.apache.commons.logging.LogFactory;
  6152. +
  6153. +public class BuffTemplateTable
  6154. +{
  6155. + private final static Log _log = LogFactory.getLog(BuffTemplateTable.class.getName());
  6156. +
  6157. + private static BuffTemplateTable _instance;
  6158. +
  6159. + /** This table contains all the Buff Templates */
  6160. + private FastList<L2BuffTemplate> _buffs;
  6161. +
  6162. +
  6163. + public static BuffTemplateTable getInstance()
  6164. + {
  6165. + if (_instance == null)
  6166. + {
  6167. + _instance = new BuffTemplateTable();
  6168. + }
  6169. + return _instance;
  6170. + }
  6171. +
  6172. + /**
  6173. + * Creates and charges all the Buff templates from the SQL Table buff_templates
  6174. + */
  6175. + public BuffTemplateTable()
  6176. + {
  6177. + _buffs = new FastList<L2BuffTemplate>();
  6178. + ReloadBuffTemplates();
  6179. + }
  6180. +
  6181. + /**
  6182. + * Reads and charges all the Buff templates from the SQL table
  6183. + */
  6184. + public void ReloadBuffTemplates()
  6185. + {
  6186. + _buffs.clear();
  6187. +
  6188. + java.sql.Connection con = null;
  6189. + try
  6190. + {
  6191. + try
  6192. + {
  6193. + con = L2DatabaseFactory.getInstance().getConnection();
  6194. + PreparedStatement statement = con.prepareStatement("SELECT * FROM buff_templates ORDER BY id, skill_order");
  6195. + ResultSet rset = statement.executeQuery();
  6196. +
  6197. + int _buffTemplates = 0;
  6198. + int templateId = -1;
  6199. +
  6200. + while (rset.next())
  6201. + {
  6202. + StatsSet Buff = new StatsSet();
  6203. +
  6204. + if (templateId != rset.getInt("id")) _buffTemplates++;
  6205. + templateId = rset.getInt("id");
  6206. +
  6207. + Buff.set("id", templateId);
  6208. + Buff.set("name", rset.getString("name"));
  6209. + Buff.set("skillId", rset.getInt("skill_id"));
  6210. + Buff.set("skillLevel", rset.getInt("skill_level"));
  6211. + Buff.set("skillOrder", rset.getInt("skill_order"));
  6212. + Buff.set("forceCast", rset.getInt("skill_force"));
  6213. + Buff.set("minLevel", rset.getInt("char_min_level"));
  6214. + Buff.set("maxLevel", rset.getInt("char_max_level"));
  6215. + Buff.set("race", rset.getInt("char_race"));
  6216. + Buff.set("class", rset.getInt("char_class"));
  6217. + Buff.set("faction", rset.getInt("char_faction"));
  6218. + Buff.set("adena", rset.getInt("price_adena"));
  6219. + Buff.set("points", rset.getInt("price_points"));
  6220. +
  6221. + // Add this buff to the Table.
  6222. + L2BuffTemplate template = new L2BuffTemplate(Buff);
  6223. + if (template.getSkill() == null)
  6224. + {
  6225. + _log.warn("Error while loading buff template Id " + template.getId() + " skill Id " + template.getSkillId());
  6226. + }
  6227. + else
  6228. + _buffs.add(template);
  6229. + }
  6230. +
  6231. + _log.info("BuffTemplateTable: Loaded " + _buffTemplates + " Buff Templates.");
  6232. +
  6233. + rset.close();
  6234. + statement.close();
  6235. + }
  6236. + catch (Exception e)
  6237. + {
  6238. + _log.warn("Error while loading buff templates "+e.getMessage());
  6239. + }
  6240. +
  6241. + }
  6242. + finally
  6243. + {
  6244. + try { con.close(); } catch (Exception e) {}
  6245. + }
  6246. + }
  6247. +
  6248. + /**
  6249. + * @return Returns the buffs of template by template Id
  6250. + */
  6251. + public FastList<L2BuffTemplate> getBuffTemplate(int Id)
  6252. + {
  6253. + FastList<L2BuffTemplate> _templateBuffs = new FastList<L2BuffTemplate>();
  6254. +
  6255. + for(L2BuffTemplate _bt: _buffs)
  6256. + {
  6257. + if (_bt.getId()== Id)
  6258. + {
  6259. + _templateBuffs.add(_bt);
  6260. + }
  6261. + }
  6262. +
  6263. + return _templateBuffs;
  6264. + }
  6265. +
  6266. + /**
  6267. + * @return Returns the template Id by template Name
  6268. + */
  6269. + public int getTemplateIdByName(String _name)
  6270. + {
  6271. +
  6272. + int _id = 0;
  6273. +
  6274. + for(L2BuffTemplate _bt: _buffs)
  6275. + {
  6276. + if (_bt.getName().equals(_name))
  6277. + {
  6278. + _id = _bt.getId();
  6279. + break;
  6280. + }
  6281. + }
  6282. +
  6283. + return _id;
  6284. + }
  6285. +
  6286. + /**
  6287. + * @return Returns the lowest char level for Buff template
  6288. + */
  6289. + public int getLowestLevel(int Id)
  6290. + {
  6291. + int _lowestLevel = 255;
  6292. +
  6293. + for(L2BuffTemplate _bt: _buffs)
  6294. + {
  6295. + if ((_bt.getId()== Id) && (_lowestLevel>_bt.getMinLevel()))
  6296. + {
  6297. + _lowestLevel = _bt.getMinLevel();
  6298. + }
  6299. + }
  6300. +
  6301. + return _lowestLevel;
  6302. + }
  6303. +
  6304. + /**
  6305. + * @return Returns the highest char level for Buff template
  6306. + */
  6307. + public int getHighestLevel(int Id)
  6308. + {
  6309. + int _highestLevel = 0;
  6310. +
  6311. + for(L2BuffTemplate _bt: _buffs)
  6312. + {
  6313. + if ((_bt.getId()== Id) && (_highestLevel<_bt.getMaxLevel()))
  6314. + {
  6315. + _highestLevel = _bt.getMaxLevel();
  6316. + }
  6317. + }
  6318. +
  6319. + return _highestLevel;
  6320. + }
  6321. +
  6322. + /**
  6323. + * @return Returns the buff templates list
  6324. + */
  6325. + public FastList<L2BuffTemplate> getBuffTemplateTable()
  6326. + {
  6327. + return _buffs;
  6328. + }
  6329. +
  6330. +}
  6331. Index: /trunk/Game/config/Modifications.properties
  6332. ===================================================================
  6333. --- /trunk/Game/config/Modifications.properties (revision 679)
  6334. +++ /trunk/Game/config/Modifications.properties (revision 681)
  6335. @@ -283,5 +283,25 @@
  6336. # When event starts, the participants lose/keep their effects. (debuffing, etc.)
  6337. DMOnStartRemoveAllEffects=true
  6338.  
  6339. # Allow to unsummon the participants' pets, when event starts.
  6340. DMOnStartUnsummonPet=true
  6341. +
  6342. +#------------------------------------#
  6343. +# DeathMatch Event #
  6344. +#------------------------------------#
  6345. +# Enable Raid Engines
  6346. +RaidEnginesEnabled = false
  6347. +
  6348. +# Max number of raid events taking place at the same time
  6349. +# The number has to be equal or smaller than the number of spawns
  6350. +# defined in the table: raid_event_spawnlist !?!
  6351. +RaidMaxNumEvents = 2
  6352. +
  6353. +# Maximum Fighting time in minutes.
  6354. +RaidSystemFightTime = 60
  6355. +
  6356. +# Give Buffs when Event Start !??
  6357. +RaidGiveBuffs = true
  6358. +
  6359. +# Resurrect Player upon death automatically !??
  6360. +RaidResurrectPlayer = true
  6361.  
  6362. Index: /trunk/Data/sql/raid_prizes.sql
  6363. ===================================================================
  6364. --- /trunk/Data/sql/raid_prizes.sql (revision 683)
  6365. +++ /trunk/Data/sql/raid_prizes.sql (revision 683)
  6366. @@ -0,0 +1,28 @@
  6367. +SET FOREIGN_KEY_CHECKS=0;
  6368. +-- ----------------------------
  6369. +-- Table structure for raid_prizes
  6370. +-- ----------------------------
  6371. +CREATE TABLE `raid_prizes` (
  6372. + `prize_package_id` int(11) NOT NULL,
  6373. + `first_prize_id` int(11) NOT NULL,
  6374. + `first_prize_ammount` int(11) NOT NULL,
  6375. + `second_prize_id` int(11) NOT NULL,
  6376. + `second_prize_ammount` int(11) NOT NULL,
  6377. + `event_points_ammount` int(11) NOT NULL,
  6378. + PRIMARY KEY (`prize_package_id`)
  6379. +) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  6380. +
  6381. +-- ----------------------------
  6382. +-- Records
  6383. +-- ----------------------------
  6384. +INSERT INTO `raid_prizes` VALUES ('1', '3470', '15', '6393', '20', '3');
  6385. +INSERT INTO `raid_prizes` VALUES ('2', '3470', '25', '6393', '35', '4');
  6386. +INSERT INTO `raid_prizes` VALUES ('3', '3470', '40', '6393', '40', '5');
  6387. +INSERT INTO `raid_prizes` VALUES ('4', '3470', '50', '6393', '50', '10');
  6388. +INSERT INTO `raid_prizes` VALUES ('5', '3470', '75', '6393', '75', '15');
  6389. +INSERT INTO `raid_prizes` VALUES ('6', '3470', '150', '6393', '150', '20');
  6390. +INSERT INTO `raid_prizes` VALUES ('7', '3470', '3', '6393', '10', '1');
  6391. +INSERT INTO `raid_prizes` VALUES ('8', '3470', '6', '6393', '15', '2');
  6392. +INSERT INTO `raid_prizes` VALUES ('9', '3470', '8', '6393', '18', '2');
  6393. +INSERT INTO `raid_prizes` VALUES ('10', '3470', '20', '6393', '30', '3');
  6394. +INSERT INTO `raid_prizes` VALUES ('11', '3470', '30', '6393', '40', '5');
  6395. Index: /trunk/Data/sql/characters.sql
  6396. ===================================================================
  6397. --- /trunk/Data/sql/characters.sql (revision 379)
  6398. +++ /trunk/Data/sql/characters.sql (revision 683)
  6399. @@ -79,8 +79,9 @@
  6400. varka_ketra_ally int(1) NOT NULL DEFAULT 0,
  6401. clan_join_expiry_time DECIMAL(20,0) NOT NULL DEFAULT 0,
  6402. clan_create_expiry_time DECIMAL(20,0) NOT NULL DEFAULT 0,
  6403. death_penalty_level int(2) NOT NULL DEFAULT 0,
  6404. donator varchar(5) NOT NULL default 0,
  6405. + `event_points` DECIMAL( 11,0 )default NUL;
  6406. PRIMARY KEY (obj_Id),
  6407. KEY `clanid` (`clanid`)
  6408. ) ;
  6409. Index: /trunk/Data/sql/npc.sql
  6410. ===================================================================
  6411. --- /trunk/Data/sql/npc.sql (revision 256)
  6412. +++ /trunk/Data/sql/npc.sql (revision 683)
  6413. @@ -6603,10 +6603,12 @@
  6414.  
  6415. INSERT INTO `npc` VALUES
  6416. (50007,31324,'Andromeda',1,'Wedding Manager',1,'NPC.a_casino_FDarkElf',8.00,23.00,70,'female','L2WeddingManager',40,3862,1493,11.85,2.78,40,43,30,21,20,10,0,0,1314,470,780,382,278,0,333,316,0,0,55,132,NULL,0,1,0,'LAST_HIT'),
  6417. (70010,31606,'Catrina',1,'TvT Event Manager',1,'Monster2.queen_of_cat',8.00,15.00,70,'female','L2TvTEventNpc',40,3862,1493,11.85,2.78,40,43,30,21,20,10,0,0,1314,470,780,382,278,0,333,0,0,0,28,132,NULL,0,0,0,'LAST_HIT');
  6418.  
  6419. +INSERT INTO `npc` VALUES (12901,30598,'Event Manager',1,'Raid Event',1,'NPC.a_casino_MHuman',8.00,23.00,70,male,L2EventManager,40,3862,1493,3.95,2.78,40,43,30,21,20,10,0,0,1314,470,780,382,278,0,333,0,0,0,55,120,NILL,0,1,0,'LAST_HIT');
  6420. +
  6421. UPDATE `npc` SET `type` = 'L2NpcWalker' WHERE `id` IN (31358,31359,31360,31361,31362,31363,31357,31356,31364,31365,32070,32072);
  6422.  
  6423. -- Try lowering walkspeed of walking NPC since seems to walk faster than retail
  6424. UPDATE `npc` SET `runspd` = '45', `walkspd` = '45' WHERE `id` = '31360';
  6425. UPDATE `npc` SET `runspd` = '45', `walkspd` = '45' WHERE `id` = '31362';
  6426. Index: /trunk/Data/sql/buff_templates.sql
  6427. ===================================================================
  6428. --- /trunk/Data/sql/buff_templates.sql (revision 683)
  6429. +++ /trunk/Data/sql/buff_templates.sql (revision 683)
  6430. @@ -0,0 +1,209 @@
  6431. +-- ----------------------------
  6432. +-- Table structure for buff_templates
  6433. +-- ----------------------------
  6434. +CREATE TABLE `buff_templates` (
  6435. + `id` int(11) unsigned NOT NULL,
  6436. + `name` varchar(35) NOT NULL default '',
  6437. + `skill_id` int(10) unsigned NOT NULL,
  6438. + `skill_name` varchar(35) default NULL,
  6439. + `skill_level` int(10) unsigned NOT NULL default '1',
  6440. + `skill_force` int(1) NOT NULL default '1',
  6441. + `skill_order` int(10) unsigned NOT NULL,
  6442. + `char_min_level` int(10) unsigned NOT NULL default '0',
  6443. + `char_max_level` int(10) unsigned NOT NULL default '0',
  6444. + `char_race` int(1) unsigned NOT NULL default '0',
  6445. + `char_class` int(1) NOT NULL default '0',
  6446. + `char_faction` int(10) unsigned NOT NULL default '0',
  6447. + `price_adena` int(10) unsigned NOT NULL default '0',
  6448. + `price_points` int(10) unsigned NOT NULL default '0',
  6449. + PRIMARY KEY (`id`,`name`,`skill_order`)
  6450. +) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  6451. +
  6452. +-- ----------------------------
  6453. +-- Records
  6454. +-- ----------------------------
  6455. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1033', 'Resist Poison', '3', '1', '1', '1', '40', '0', '0', '0', '0', '0');
  6456. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1032', 'Invigor', '3', '0', '2', '1', '40', '0', '0', '0', '0', '0');
  6457. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1040', 'Shield', '3', '0', '3', '1', '40', '0', '0', '0', '0', '0');
  6458. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1035', 'Mental Shield', '4', '0', '4', '1', '40', '0', '0', '0', '0', '0');
  6459. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1259', 'Resist Shock', '4', '0', '5', '1', '40', '0', '0', '0', '0', '0');
  6460. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1204', 'Wind Walk', '2', '0', '6', '1', '40', '0', '0', '0', '0', '0');
  6461. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1257', 'Decrease Weight', '3', '0', '7', '1', '40', '0', '0', '0', '0', '0');
  6462. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1045', 'Bless the Body', '6', '0', '8', '1', '40', '0', '0', '0', '0', '0');
  6463. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1078', 'Concentration', '6', '0', '9', '1', '40', '0', '0', '0', '0', '0');
  6464. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1303', 'Wild Magic', '2', '0', '10', '1', '40', '0', '2', '0', '0', '0');
  6465. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1048', 'Bless the Soul', '6', '0', '11', '1', '40', '0', '2', '0', '0', '0');
  6466. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1085', 'Acumen', '3', '0', '12', '1', '40', '0', '2', '0', '0', '0');
  6467. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1059', 'Empower', '3', '0', '13', '1', '40', '0', '2', '0', '0', '0');
  6468. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1010', 'Soul Shield', '3', '0', '14', '1', '40', '0', '2', '0', '0', '0');
  6469. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1068', 'Might', '3', '0', '15', '1', '40', '0', '1', '0', '0', '0');
  6470. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1086', 'Haste', '2', '0', '16', '1', '40', '0', '1', '0', '0', '0');
  6471. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1077', 'Focus', '3', '0', '17', '1', '40', '0', '1', '0', '0', '0');
  6472. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1242', 'Death Whisper', '3', '0', '18', '1', '40', '0', '1', '0', '0', '0');
  6473. +INSERT INTO `buff_templates` VALUES ('1', 'Newbie', '1268', 'Vampiric Rage', '4', '0', '19', '1', '40', '0', '1', '0', '0', '0');
  6474. +INSERT INTO `buff_templates` VALUES ('2', 'ResistBuffs', '1033', 'Resist Poison', '3', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6475. +INSERT INTO `buff_templates` VALUES ('2', 'ResistBuffs', '1032', 'Invigor', '3', '0', '2', '1', '80', '0', '0', '0', '200000', '0');
  6476. +INSERT INTO `buff_templates` VALUES ('2', 'ResistBuffs', '1352', 'Elemental Protection', '1', '0', '3', '1', '80', '0', '0', '0', '200000', '0');
  6477. +INSERT INTO `buff_templates` VALUES ('2', 'ResistBuffs', '1392', 'Holy Resistance', '3', '0', '4', '1', '80', '0', '0', '0', '200000', '0');
  6478. +INSERT INTO `buff_templates` VALUES ('2', 'ResistBuffs', '1393', 'Unholy Resistance', '3', '0', '5', '1', '80', '0', '0', '0', '200000', '0');
  6479. +INSERT INTO `buff_templates` VALUES ('2', 'ResistBuffs', '1035', 'Mental Shield', '4', '0', '6', '1', '80', '0', '0', '0', '200000', '0');
  6480. +INSERT INTO `buff_templates` VALUES ('2', 'ResistBuffs', '1259', 'Resist Shock', '4', '0', '7', '1', '80', '0', '0', '0', '200000', '0');
  6481. +INSERT INTO `buff_templates` VALUES ('2', 'ResistBuffs', '1354', 'Arcane Protection', '1', '0', '8', '1', '80', '0', '0', '0', '200000', '0');
  6482. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1204', 'Wind Walk', '2', '0', '1', '1', '80', '0', '0', '0', '250000', '0');
  6483. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1257', 'Decrease Weight', '3', '0', '2', '1', '80', '0', '0', '0', '100000', '0');
  6484. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1073', 'Kiss of Eva', '2', '0', '3', '1', '80', '0', '0', '0', '20000', '0');
  6485. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1040', 'Shield', '3', '0', '4', '1', '80', '0', '0', '0', '150000', '0');
  6486. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1068', 'Might', '3', '0', '5', '1', '80', '0', '1', '0', '200000', '0');
  6487. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1086', 'Haste', '2', '0', '6', '1', '80', '0', '1', '0', '250000', '0');
  6488. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1077', 'Focus', '3', '0', '7', '1', '80', '0', '1', '0', '250000', '0');
  6489. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1242', 'Death Whisper', '3', '0', '8', '1', '80', '0', '1', '0', '250000', '0');
  6490. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1045', 'Bless the Body', '6', '0', '9', '1', '80', '0', '0', '0', '250000', '0');
  6491. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1044', 'Regeneration', '3', '0', '10', '1', '80', '0', '0', '0', '100000', '0');
  6492. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1240', 'Guidance', '3', '0', '11', '1', '80', '0', '1', '0', '150000', '0');
  6493. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1087', 'Agility', '3', '0', '12', '1', '80', '0', '1', '0', '150000', '0');
  6494. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1010', 'Soul Shield', '3', '0', '13', '1', '80', '0', '1', '0', '150000', '0');
  6495. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1036', 'Magic Barrier', '2', '0', '14', '1', '80', '0', '1', '0', '100000', '0');
  6496. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1243', 'Bless Shield', '6', '0', '15', '1', '80', '0', '1', '0', '100000', '0');
  6497. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1268', 'Vampiric Rage', '4', '0', '16', '1', '80', '0', '1', '0', '200000', '0');
  6498. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1303', 'Wild Magic', '2', '0', '17', '1', '80', '0', '2', '0', '250000', '0');
  6499. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1048', 'Bless the Soul', '6', '0', '18', '1', '80', '0', '2', '0', '250000', '0');
  6500. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1078', 'Concentration', '6', '0', '19', '1', '80', '0', '2', '0', '200000', '0');
  6501. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1085', 'Acumen', '3', '0', '20', '1', '80', '0', '2', '0', '250000', '0');
  6502. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1059', 'Empower', '3', '0', '21', '1', '80', '0', '2', '0', '250000', '0');
  6503. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '1062', 'Berserker Spirit', '2', '0', '22', '1', '80', '0', '0', '0', '200000', '0');
  6504. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '275', 'Dance of Fury', '1', '0', '23', '1', '80', '0', '1', '0', '1000000', '0');
  6505. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '274', 'Dance of Fire', '1', '0', '24', '1', '80', '0', '1', '0', '1000000', '0');
  6506. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '271', 'Dance of Warrior', '1', '0', '25', '1', '80', '0', '1', '0', '1000000', '0');
  6507. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '264', 'Song of Earth', '1', '0', '26', '1', '80', '0', '0', '0', '750000', '0');
  6508. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '269', 'Song of Hunter', '1', '0', '27', '1', '80', '0', '1', '0', '1000000', '0');
  6509. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '267', 'Song of Warding', '1', '0', '28', '1', '80', '0', '0', '0', '750000', '0');
  6510. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '276', 'Dance of Concentration', '1', '0', '29', '1', '80', '0', '2', '0', '1000000', '0');
  6511. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '273', 'Dance of Mystic', '1', '0', '30', '1', '80', '0', '2', '0', '1000000', '0');
  6512. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '311', 'Dance of Protection', '1', '0', '31', '1', '80', '0', '0', '0', '750000', '0');
  6513. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '265', 'Song of Life', '1', '0', '32', '1', '80', '0', '0', '0', '750000', '0');
  6514. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '363', 'Song of Meditation', '1', '0', '33', '1', '80', '0', '2', '0', '1000000', '0');
  6515. +INSERT INTO `buff_templates` VALUES ('3', 'DeluxeBuffs', '349', 'Song of Renewal', '1', '0', '34', '1', '80', '0', '2', '0', '1000000', '0');
  6516. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1040', 'Shield', '3', '0', '1', '1', '80', '0', '0', '0', '150000', '0');
  6517. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1036', 'Magic Barrier', '2', '0', '2', '1', '80', '0', '0', '0', '200000', '0');
  6518. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1045', 'Bless the Body', '6', '0', '3', '1', '80', '0', '0', '0', '250000', '0');
  6519. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1048', 'Bless the Soul', '6', '0', '4', '1', '80', '0', '0', '0', '250000', '0');
  6520. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1243', 'Bless Shield', '6', '0', '5', '1', '80', '0', '0', '0', '100000', '0');
  6521. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1352', 'Elemental Protection', '1', '0', '6', '1', '80', '0', '0', '0', '100000', '0');
  6522. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1204', 'Wind Walk', '2', '0', '7', '1', '80', '0', '0', '0', '250000', '0');
  6523. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1062', 'Berserker Spirit', '2', '0', '8', '1', '80', '0', '0', '0', '200000', '0');
  6524. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1032', 'Invigor', '3', '0', '9', '1', '80', '0', '0', '0', '100000', '0');
  6525. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1035', 'Mental Shield', '4', '0', '10', '1', '80', '0', '0', '0', '150000', '0');
  6526. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1259', 'Resist Shock', '4', '0', '11', '1', '80', '0', '0', '0', '150000', '0');
  6527. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1044', 'Regeneration', '3', '0', '12', '1', '80', '0', '0', '0', '100000', '0');
  6528. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1068', 'Might', '3', '0', '13', '1', '80', '0', '1', '0', '200000', '0');
  6529. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1086', 'Haste', '2', '0', '14', '1', '80', '0', '1', '0', '250000', '0');
  6530. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1077', 'Focus', '3', '0', '15', '1', '80', '0', '1', '0', '250000', '0');
  6531. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1242', 'Death Whisper', '3', '0', '16', '1', '80', '0', '1', '0', '250000', '0');
  6532. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1268', 'Vampiric Rage', '4', '0', '17', '1', '80', '0', '1', '0', '200000', '0');
  6533. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1087', 'Agility', '3', '0', '18', '1', '80', '0', '1', '0', '150000', '0');
  6534. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1240', 'Guidance', '3', '0', '19', '1', '80', '0', '1', '0', '150000', '0');
  6535. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1059', 'Empower', '3', '0', '20', '1', '80', '0', '2', '0', '250000', '0');
  6536. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1078', 'Concentration', '6', '0', '21', '1', '80', '0', '2', '0', '200000', '0');
  6537. +INSERT INTO `buff_templates` VALUES ('4', 'Prophet', '1085', 'Acumen', '3', '0', '22', '1', '80', '0', '2', '0', '250000', '0');
  6538. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '364', 'Song of Champion', '1', '0', '1', '1', '80', '0', '0', '0', '750000', '0');
  6539. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '264', 'Song of Earth', '1', '0', '2', '1', '80', '0', '0', '0', '750000', '0');
  6540. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '306', 'Song of Flame Guard', '1', '0', '3', '1', '80', '0', '0', '0', '750000', '0');
  6541. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '308', 'Song of Storm Guard', '1', '0', '4', '1', '80', '0', '0', '0', '750000', '0');
  6542. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '270', 'Song of Invocation', '1', '0', '5', '1', '80', '0', '0', '0', '750000', '0');
  6543. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '265', 'Song of Life', '1', '0', '6', '1', '80', '0', '0', '0', '750000', '0');
  6544. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '349', 'Sonf of Renewal', '1', '0', '7', '1', '80', '0', '0', '0', '750000', '0');
  6545. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '267', 'Song of Warding', '1', '0', '8', '1', '80', '0', '0', '0', '750000', '0');
  6546. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '266', 'Song of Water', '1', '0', '9', '1', '80', '0', '0', '0', '750000', '0');
  6547. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '268', 'Song of Wind', '1', '0', '10', '1', '80', '0', '0', '0', '750000', '0');
  6548. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '305', 'Song of Vengance', '1', '0', '11', '1', '80', '0', '1', '0', '1000000', '0');
  6549. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '269', 'Song of Hunter', '1', '0', '12', '1', '80', '0', '1', '0', '1000000', '0');
  6550. +INSERT INTO `buff_templates` VALUES ('5', 'Songs', '363', 'Song of Meditation', '1', '0', '13', '1', '80', '0', '2', '0', '1000000', '0');
  6551. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '307', 'Dance of Aqua Guard', '1', '0', '1', '1', '80', '0', '0', '0', '750000', '0');
  6552. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '309', 'Dance of Earth Guard', '1', '0', '2', '1', '80', '0', '0', '0', '750000', '0');
  6553. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '311', 'Dance of Protection', '1', '0', '3', '1', '80', '0', '0', '0', '750000', '0');
  6554. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '274', 'Dance of Fire', '1', '0', '4', '1', '80', '0', '1', '0', '1000000', '0');
  6555. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '275', 'Dance of Fury', '1', '0', '5', '1', '80', '0', '1', '0', '1000000', '0');
  6556. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '272', 'Dance of Inspiration', '1', '0', '6', '1', '80', '0', '1', '0', '1000000', '0');
  6557. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '277', 'Dance of Light', '1', '0', '7', '1', '80', '0', '1', '0', '1000000', '0');
  6558. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '310', 'Dance of Vampire', '1', '0', '8', '1', '80', '0', '1', '0', '1000000', '0');
  6559. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '271', 'Dance of Warrior', '1', '0', '9', '1', '80', '0', '1', '0', '1000000', '0');
  6560. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '276', 'Dance of Concentration', '1', '0', '10', '1', '80', '0', '2', '0', '1000000', '0');
  6561. +INSERT INTO `buff_templates` VALUES ('6', 'Dances', '273', 'Dance of Mystic', '1', '0', '11', '1', '80', '0', '2', '0', '1000000', '0');
  6562. +INSERT INTO `buff_templates` VALUES ('7', 'WindWalk', '1204', 'Wind Walk', '2', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6563. +INSERT INTO `buff_templates` VALUES ('8', 'DWeight', '1257', 'Decrease Weight', '1', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6564. +INSERT INTO `buff_templates` VALUES ('9', 'Shield', '1040', 'Shield', '3', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6565. +INSERT INTO `buff_templates` VALUES ('10', 'Might', '1068', 'Might', '3', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6566. +INSERT INTO `buff_templates` VALUES ('11', 'MShield', '1035', 'Mental Shield', '4', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6567. +INSERT INTO `buff_templates` VALUES ('12', 'BTB', '1045', 'Bless the Body', '6', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6568. +INSERT INTO `buff_templates` VALUES ('13', 'BTS', '1048', 'Bless the Soul', '6', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6569. +INSERT INTO `buff_templates` VALUES ('14', 'MBarrier', '1036', 'Magic Barrier', '2', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6570. +INSERT INTO `buff_templates` VALUES ('15', 'RShock', '1259', 'Resist Shock', '4', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6571. +INSERT INTO `buff_templates` VALUES ('16', 'Concentration', '1078', 'Concentration', '6', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6572. +INSERT INTO `buff_templates` VALUES ('17', 'BerserkerSpirit', '1062', 'Berserker Spirit', '2', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6573. +INSERT INTO `buff_templates` VALUES ('18', 'BTShield', '1243', 'Bless Shield', '6', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6574. +INSERT INTO `buff_templates` VALUES ('19', 'VRage', '1268', 'Vampiric Rage', '4', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6575. +INSERT INTO `buff_templates` VALUES ('20', 'Acumen', '1085', 'Acumen', '3', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6576. +INSERT INTO `buff_templates` VALUES ('21', 'Empower', '1059', 'Empower', '3', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6577. +INSERT INTO `buff_templates` VALUES ('22', 'Haste', '1086', 'Haste', '2', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6578. +INSERT INTO `buff_templates` VALUES ('23', 'Guidance', '1240', 'Guidance', '3', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6579. +INSERT INTO `buff_templates` VALUES ('24', 'Focus', '1077', 'Focus', '3', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6580. +INSERT INTO `buff_templates` VALUES ('25', 'DeathWhisper', '1242', 'Death Whisper', '3', '0', '1', '1', '80', '0', '0', '0', '200000', '0');
  6581. +INSERT INTO `buff_templates` VALUES ('26', 'DWarrior', '271', 'Dance of Warrior', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6582. +INSERT INTO `buff_templates` VALUES ('27', 'DInspiration', '272', 'Dance of Inspiration', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6583. +INSERT INTO `buff_templates` VALUES ('28', 'DMystic', '273', 'Dance of Mystic', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6584. +INSERT INTO `buff_templates` VALUES ('29', 'DFire', '274', 'Dance of Fire', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6585. +INSERT INTO `buff_templates` VALUES ('30', 'DFury', '275', 'Dance of Fury', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6586. +INSERT INTO `buff_templates` VALUES ('31', 'DConecntration', '276', 'Dance of Concentration', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6587. +INSERT INTO `buff_templates` VALUES ('32', 'DLight', '277', 'Dance of Light', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6588. +INSERT INTO `buff_templates` VALUES ('33', 'DAqua', '307', 'Dance of Aqua Guard', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6589. +INSERT INTO `buff_templates` VALUES ('34', 'DEarth', '309', 'Dance of Earth Guard', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6590. +INSERT INTO `buff_templates` VALUES ('35', 'DVampire', '310', 'Dance of Vampire', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6591. +INSERT INTO `buff_templates` VALUES ('36', 'DProtection', '311', 'Dance of Protection', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6592. +INSERT INTO `buff_templates` VALUES ('37', 'SEarth', '264', 'Song of Earth', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6593. +INSERT INTO `buff_templates` VALUES ('38', 'SLife', '265', 'Song of Life', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6594. +INSERT INTO `buff_templates` VALUES ('39', 'SWater', '266', 'Song of Water', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6595. +INSERT INTO `buff_templates` VALUES ('40', 'SWarding', '267', 'Song of Warding', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6596. +INSERT INTO `buff_templates` VALUES ('41', 'SWind', '268', 'Song of Wind', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6597. +INSERT INTO `buff_templates` VALUES ('42', 'SHunter', '269', 'Song of Hunter', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6598. +INSERT INTO `buff_templates` VALUES ('43', 'SInvocation', '270', 'Song of Invocation', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6599. +INSERT INTO `buff_templates` VALUES ('44', 'SVengance', '305', 'Song of Vengance', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6600. +INSERT INTO `buff_templates` VALUES ('45', 'SFlameGuard', '306', 'Song of Flame Guard', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6601. +INSERT INTO `buff_templates` VALUES ('46', 'SStormGuard', '308', 'Song of Storm Guard', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6602. +INSERT INTO `buff_templates` VALUES ('47', 'SRenewal', '349', 'Song of Renewal', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6603. +INSERT INTO `buff_templates` VALUES ('48', 'SChampion', '364', 'Song of Champion', '1', '0', '1', '1', '80', '0', '0', '0', '1000000', '0');
  6604. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1204', 'Wind Walk', '2', '0', '1', '1', '80', '0', '0', '0', '0', '0');
  6605. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1257', 'Decrease Weight', '3', '0', '2', '1', '80', '0', '0', '0', '0', '0');
  6606. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1045', 'Bless The Body', '6', '0', '3', '1', '80', '0', '0', '0', '0', '0');
  6607. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1048', 'Bess The Soul', '6', '1', '4', '1', '80', '0', '0', '0', '0', '0');
  6608. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1085', 'Acumen', '3', '1', '5', '1', '80', '0', '0', '0', '0', '0');
  6609. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1059', 'Empower', '3', '1', '6', '1', '80', '0', '0', '0', '0', '0');
  6610. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1068', 'Might', '3', '1', '7', '1', '80', '0', '0', '0', '0', '0');
  6611. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1086', 'Haste', '2', '1', '8', '1', '80', '0', '0', '0', '0', '0');
  6612. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1268', 'Vampiric Rage', '4', '1', '9', '1', '80', '0', '0', '0', '0', '0');
  6613. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1040', 'Shield', '3', '1', '10', '1', '80', '0', '0', '0', '0', '0');
  6614. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1036', 'Magic Barrier', '2', '1', '11', '1', '80', '0', '0', '0', '0', '0');
  6615. +INSERT INTO `buff_templates` VALUES ('49', 'Event1', '1035', 'Mental Shield', '4', '1', '12', '1', '80', '0', '0', '0', '0', '0');
  6616. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1204', 'Wind Walk', '1', '1', '1', '1', '80', '0', '0', '0', '0', '0');
  6617. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1257', 'Decrease Weight', '2', '1', '2', '1', '80', '0', '0', '0', '0', '0');
  6618. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1045', 'Bless The Body', '3', '1', '3', '1', '80', '0', '0', '0', '0', '0');
  6619. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1048', 'Bess The Soul', '3', '1', '4', '1', '80', '0', '0', '0', '0', '0');
  6620. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1085', 'Acumen', '2', '1', '5', '1', '80', '0', '0', '0', '0', '0');
  6621. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1059', 'Empower', '1', '1', '6', '1', '80', '0', '0', '0', '0', '0');
  6622. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1068', 'Might', '2', '1', '7', '1', '80', '0', '0', '0', '0', '0');
  6623. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1086', 'Haste', '1', '1', '8', '1', '80', '0', '0', '0', '0', '0');
  6624. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1268', 'Vampiric Rage', '2', '1', '9', '1', '80', '0', '0', '0', '0', '0');
  6625. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1040', 'Shield', '2', '1', '10', '1', '80', '0', '0', '0', '0', '0');
  6626. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1036', 'Magic Barrier', '1', '1', '11', '1', '80', '0', '0', '0', '0', '0');
  6627. +INSERT INTO `buff_templates` VALUES ('50', 'Event2', '1035', 'Mental Shield', '2', '1', '12', '1', '80', '0', '0', '0', '0', '0');
  6628. +INSERT INTO `buff_templates` VALUES ('51', 'SongOfVitality', '304', 'Song of Vitality', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  6629. +INSERT INTO `buff_templates` VALUES ('52', 'POF', '1356', 'Prophecy of Fire', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  6630. +INSERT INTO `buff_templates` VALUES ('53', 'GMight', '1388', 'Greater Might', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  6631. +INSERT INTO `buff_templates` VALUES ('54', 'GShield', '1389', 'Greater Shield', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  6632. +INSERT INTO `buff_templates` VALUES ('55', 'ChOV', '1363', 'Chant of Victory', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  6633. +INSERT INTO `buff_templates` VALUES ('56', 'ChOS', '1362', 'Chant of Spirit', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  6634. +INSERT INTO `buff_templates` VALUES ('57', 'ChOF', '1002', 'Chant of Flame', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  6635. +INSERT INTO `buff_templates` VALUES ('58', 'SirensDance', '365', 'Siren\'s Dance', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  6636. +INSERT INTO `buff_templates` VALUES ('59', 'WildMagic', '1303', 'Wild Magic', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  6637. +INSERT INTO `buff_templates` VALUES ('60', 'POW', '1355', 'Prophecy of Water', '1', '1', '1', '1', '80', '0', '0', '0', '0', '2');
  6638. +INSERT INTO `buff_templates` VALUES ('61', 'GiftOfQueen', '4700', 'Gift Of Queen', '1', '1', '1', '1', '80', '0', '0', '0', '0', '3');
  6639. +INSERT INTO `buff_templates` VALUES ('62', 'BlessingofQueen', '4699', 'Blessing of Queen', '1', '1', '1', '1', '80', '0', '0', '0', '0', '3');
  6640. Index: /trunk/Data/sql/raid_events_spawnlist.sql
  6641. ===================================================================
  6642. --- /trunk/Data/sql/raid_events_spawnlist.sql (revision 683)
  6643. +++ /trunk/Data/sql/raid_events_spawnlist.sql (revision 683)
  6644. @@ -0,0 +1,24 @@
  6645. +SET FOREIGN_KEY_CHECKS=0;
  6646. +-- ----------------------------
  6647. +-- Table structure for raid_events_spawnlist
  6648. +-- ----------------------------
  6649. +CREATE TABLE `raid_event_spawnlist` (
  6650. + `id` int(11) NOT NULL auto_increment,
  6651. + `location` varchar(40) NOT NULL default '',
  6652. + `raid_locX` int(9) NOT NULL,
  6653. + `raid_locY` int(9) NOT NULL,
  6654. + `raid_locZ` int(9) NOT NULL,
  6655. + `player_locX` int(9) NOT NULL,
  6656. + `player_locY` int(9) NOT NULL,
  6657. + `player_locZ` int(9) NOT NULL,
  6658. + PRIMARY KEY (`id`)
  6659. +) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  6660. +
  6661. +-- ----------------------------
  6662. +-- Records
  6663. +-- ----------------------------
  6664. +INSERT INTO `raid_event_spawnlist` VALUES ('1', 'Test', '-93287', '-251026', '-3336', '-94347', '-251026', '-3136');
  6665. +INSERT INTO `raid_event_spawnlist` VALUES ('2', 'Test', '-87131', '-257755', '-3336', '-88020', '-257755', '-3136');
  6666. +INSERT INTO `raid_event_spawnlist` VALUES ('3', 'Test', '174167', '-75329', '-5107', '174085', '-76703', '-5007');
  6667. +INSERT INTO `raid_event_spawnlist` VALUES ('4', 'Test', '174252', '-88483', '-5139', '174242', '-86548', '-5007');
  6668. +INSERT INTO `raid_event_spawnlist` VALUES ('5', 'Test', '174091', '-82305', '-5123', '174103', '-80650', '-5007');
  6669. Index: /trunk/Data/data/html/event/12901-1.htm
  6670. ===================================================================
  6671. --- /trunk/Data/data/html/event/12901-1.htm (revision 683)
  6672. +++ /trunk/Data/data/html/event/12901-1.htm (revision 683)
  6673. @@ -0,0 +1,16 @@
  6674. +<html><title>FizBan Event Manager</title><body>
  6675. +<br><br>
  6676. +<img src="L2UI_CH3.onscrmsg_pattern01_1" width=300 height=32 align=left>
  6677. +<br>
  6678. +<table width=255><tr><td valign=top width=255>
  6679. +<center>Clan Events</center><br><br>
  6680. +In this section you can select the mob type that you'd like to fight against.
  6681. +<br>
  6682. +Tell me, against which kind of mob would you like to fight against?
  6683. +<br>
  6684. +<br><a action="bypass -h npc_%objectId%_Chat 4">Group of Mobs</a>
  6685. +<br><a action="bypass -h npc_%objectId%_Chat 5">Grand Bosses</a>
  6686. +</td></tr></table>
  6687. +<br><br><br>
  6688. +<img src="L2UI_CH3.onscrmsg_pattern01_2" width=300 height=32 align=left>
  6689. +</body></html>
  6690. Index: /trunk/Data/data/html/event/12901-10.htm
  6691. ===================================================================
  6692. --- /trunk/Data/data/html/event/12901-10.htm (revision 683)
  6693. +++ /trunk/Data/data/html/event/12901-10.htm (revision 683)
  6694. @@ -0,0 +1,4 @@
  6695. +<html>
  6696. +<body>
  6697. +</body>
  6698. +</html>
  6699. Index: /trunk/Data/data/html/event/12901-11.htm
  6700. ===================================================================
  6701. --- /trunk/Data/data/html/event/12901-11.htm (revision 683)
  6702. +++ /trunk/Data/data/html/event/12901-11.htm (revision 683)
  6703. @@ -0,0 +1,4 @@
  6704. +<html>
  6705. +<body>
  6706. +</body>
  6707. +</html>
  6708. Index: /trunk/Data/data/html/event/12901-2.htm
  6709. ===================================================================
  6710. --- /trunk/Data/data/html/event/12901-2.htm (revision 683)
  6711. +++ /trunk/Data/data/html/event/12901-2.htm (revision 683)
  6712. @@ -0,0 +1,15 @@
  6713. +<html><title>FizBan Event Manager</title><body>
  6714. +<br><br>
  6715. +<img src="L2UI_CH3.onscrmsg_pattern01_1" width=300 height=32 align=left>
  6716. +<br>
  6717. +<table width=255><tr><td valign=top width=255>
  6718. +<center>Party Events</center><br><br>
  6719. +In this section you can select the mob type that you'd like to fight against.
  6720. +<br>
  6721. +Tell me, against which kind of mob would you like to fight against?
  6722. +<br>
  6723. +<br><a action="bypass -h npc_%objectId%_Chat 7">Grand Bosses</a>
  6724. +</td></tr></table>
  6725. +<br><br><br>
  6726. +<img src="L2UI_CH3.onscrmsg_pattern01_2" width=300 height=32 align=left>
  6727. +</body></html>
  6728. Index: /trunk/Data/data/html/event/12901-3.htm
  6729. ===================================================================
  6730. --- /trunk/Data/data/html/event/12901-3.htm (revision 683)
  6731. +++ /trunk/Data/data/html/event/12901-3.htm (revision 683)
  6732. @@ -0,0 +1,15 @@
  6733. +<html><title>FizBan Event Manager</title><body>
  6734. +<br><br>
  6735. +<img src="L2UI_CH3.onscrmsg_pattern01_1" width=300 height=32 align=left>
  6736. +<br>
  6737. +<table width=255><tr><td valign=top width=255>
  6738. +<center>Clan Events</center>
  6739. +In this section you can select the mob against whom you'd like to fight.
  6740. +<br>
  6741. +Tell me, against which of this mobs would you like to fight against?
  6742. +
  6743. +<br><a action="bypass -h npc_%objectId%_iEvent 1 1 21380 4 1 3 1">Tepra Scarab</a>
  6744. +</td></tr></table>
  6745. +<br><br><br>
  6746. +<img src="L2UI_CH3.onscrmsg_pattern01_2" width=300 height=32 align=left>
  6747. +</body></html>
  6748. Index: /trunk/Data/data/html/event/12901.htm
  6749. ===================================================================
  6750. --- /trunk/Data/data/html/event/12901.htm (revision 683)
  6751. +++ /trunk/Data/data/html/event/12901.htm (revision 683)
  6752. @@ -0,0 +1,18 @@
  6753. +<html><title>FizBan Event Manager</title><body>
  6754. +<br><br>
  6755. +<img src="L2UI_CH3.onscrmsg_pattern01_1" width=300 height=32 align=left>
  6756. +<br>
  6757. +<table width=255><tr><td valign=top width=255><br>
  6758. +Welcome Traveler. Are you up for a BIG fight?! If so, I can help you quite a bit!
  6759. +<br>
  6760. +I can set up a fully customized event for you!
  6761. +<br>
  6762. +Wich kind of Event would you like to try?<br>
  6763. +IMPORTANT: This feature is still undergoing tests and may be buggy!If you freeze after a teleport please restart Lineage 2 by pressing ctrl+alt+del and ending lineage 2.Start the client again and your good to go!<br>
  6764. +IMPORTANT2: If you die during the event and you go back to town you will be kicked out of the raid event!<br>
  6765. +<br><a action="bypass -h npc_%objectId%_Chat 1">Clan Events</a>
  6766. +<br><a action="bypass -h npc_%objectId%_Chat 2">Party Events</a>
  6767. +</td></tr></table>
  6768. +<br><br><br>
  6769. +<img src="L2UI_CH3.onscrmsg_pattern01_2" width=300 height=32 align=left>
  6770. +</body></html>
  6771. Index: /trunk/Data/data/html/event/12901-4.htm
  6772. ===================================================================
  6773. --- /trunk/Data/data/html/event/12901-4.htm (revision 683)
  6774. +++ /trunk/Data/data/html/event/12901-4.htm (revision 683)
  6775. @@ -0,0 +1,18 @@
  6776. +<html><title>FizBan Event Manager</title><body>
  6777. +<br><br>
  6778. +<img src="L2UI_CH3.onscrmsg_pattern01_1" width=300 height=32 align=left>
  6779. +<br>
  6780. +<table width=255><tr><td valign=top width=255>
  6781. +<center>Clan Events</center>
  6782. +In this section you can select the raid you like to do.
  6783. +<br>
  6784. +Tell me, against which of these mobs would you like to fight against?<br>
  6785. +The price is given to every participant.You will also receive several event points depending on the difficulty of the raid. These can be used at the npc buffer to get full buffs!
  6786. +For these mobs a minimum of 4 players is required.<br>
  6787. +<br><a action="bypass -h npc_%objectId%_iEvent 2 0 22062 30 4 30 3 1">30x difficulty 3x mobs - 3Gb </a>
  6788. +<br><a action="bypass -h npc_%objectId%_iEvent 2 0 22062 40 4 30 3 2">40x difficulty 3x mobs - 6Gb </a>
  6789. +<br><a action="bypass -h npc_%objectId%_iEvent 2 0 22062 50 4 30 3 5">50x difficulty 3x mobs - 8Gb </a>
  6790. +</td></tr></table>
  6791. +<br><br><br>
  6792. +<img src="L2UI_CH3.onscrmsg_pattern01_2" width=300 height=32 align=left>
  6793. +</body></html>
  6794. Index: /trunk/Data/data/html/event/12901-5.htm
  6795. ===================================================================
  6796. --- /trunk/Data/data/html/event/12901-5.htm (revision 683)
  6797. +++ /trunk/Data/data/html/event/12901-5.htm (revision 683)
  6798. @@ -0,0 +1,21 @@
  6799. +<html><title>FizBan Event Manager</title><body>
  6800. +<br><br>
  6801. +<img src="L2UI_CH3.onscrmsg_pattern01_1" width=300 height=32 align=left>
  6802. +<br>
  6803. +<table width=255><tr><td valign=top width=255>
  6804. +<center>Clan Events</center>
  6805. +In this section you can select the raid you like to do.
  6806. +<br>
  6807. +Tell me, against which of these mobs would you like to fight against?<br>
  6808. +The price is given to every participant.You will also receive several event points depending on the difficulty of the raid. These can be used at the npc buffer to get full buffs!
  6809. +For these bosses a minimum of 8 players is required.<br>
  6810. +<br><a action="bypass -h npc_%objectId%_iEvent 2 0 25234 2 8 30 3 1">2x Ancient Dragon - 15Gb </a>
  6811. +<br><a action="bypass -h npc_%objectId%_iEvent 2 0 25125 2 8 30 3 2">2x Tiger King - 25Gb </a>
  6812. +<br><a action="bypass -h npc_%objectId%_iEvent 2 0 25126 2 8 30 3 3">2x Longhorn - 40Gb </a>
  6813. +<br><a action="bypass -h npc_%objectId%_iEvent 2 0 29020 2 8 30 3 4">2x Baium - 50Gb </a>
  6814. +<br><a action="bypass -h npc_%objectId%_iEvent 2 0 29019 1 8 30 3 5">1x Antharas - 75Gb </a>
  6815. +<br><a action="bypass -h npc_%objectId%_iEvent 2 0 29028 1 8 30 3 6">1x Valakas - 150Gb </a>
  6816. +</td></tr></table>
  6817. +<br><br><br>
  6818. +<img src="L2UI_CH3.onscrmsg_pattern01_2" width=300 height=32 align=left>
  6819. +</body></html>
  6820. Index: /trunk/Data/data/html/event/12901-6.htm
  6821. ===================================================================
  6822. --- /trunk/Data/data/html/event/12901-6.htm (revision 683)
  6823. +++ /trunk/Data/data/html/event/12901-6.htm (revision 683)
  6824. @@ -0,0 +1,16 @@
  6825. +<html><title>FizBan Event Manager</title><body>
  6826. +<br><br>
  6827. +<img src="L2UI_CH3.onscrmsg_pattern01_1" width=300 height=32 align=left>
  6828. +<br>
  6829. +<table width=255><tr><td valign=top width=255>
  6830. +<center>Clan Events</center>
  6831. +In this section you can select the mob against whom you'd like to fight.
  6832. +<br>
  6833. +Tell me, against which of this mobs would you like to fight against?
  6834. +<br>
  6835. +Others Will soon be aviable, this is only for testing purposes.
  6836. +<br><a action="bypass -h npc_%objectId%_iEvent 1 1 21380 4 1 3 1">Tepra Scarab [Testing]</a>
  6837. +</td></tr></table>
  6838. +<br><br><br>
  6839. +<img src="L2UI_CH3.onscrmsg_pattern01_2" width=300 height=32 align=left>
  6840. +</body></html>
  6841. Index: /trunk/Data/data/html/event/12901-7.htm
  6842. ===================================================================
  6843. --- /trunk/Data/data/html/event/12901-7.htm (revision 683)
  6844. +++ /trunk/Data/data/html/event/12901-7.htm (revision 683)
  6845. @@ -0,0 +1,19 @@
  6846. +<html><title>FizBan Event Manager</title><body>
  6847. +<br><br>
  6848. +<img src="L2UI_CH3.onscrmsg_pattern01_1" width=300 height=32 align=left>
  6849. +<br>
  6850. +<table width=255><tr><td valign=top width=255>
  6851. +<center>Party Events</center>
  6852. +In this section you can select the raid you like to do.
  6853. +<br>
  6854. +Tell me, against which of these mobs would you like to fight against?<br>
  6855. +The price is given to every participant.You will also receive several event points depending on the difficulty of the raid. These can be used at the npc buffer to get full buffs!
  6856. +For these bosses a minimum of 3 players is required to be online.<br>
  6857. +<br><a action="bypass -h npc_%objectId%_iEvent 3 0 29001 1 3 30 3 1">1x Ant Queen - 15Gb</a>
  6858. +<br><a action="bypass -h npc_%objectId%_iEvent 3 0 29014 1 3 30 3 1">1x Orfen - 15Gb</a>
  6859. +<br><a action="bypass -h npc_%objectId%_iEvent 3 0 29022 1 3 30 3 10">1x Zaken - 20Gb</a>
  6860. +<br><a action="bypass -h npc_%objectId%_iEvent 3 0 29020 1 3 30 3 11">1x Baium - 30Gb</a>
  6861. +</td></tr></table>
  6862. +<br><br><br>
  6863. +<img src="L2UI_CH3.onscrmsg_pattern01_2" width=300 height=32 align=left>
  6864. +</body></html>
  6865. Index: /trunk/Data/tools/database_installer.bat
  6866. ===================================================================
  6867. --- /trunk/Data/tools/database_installer.bat (revision 505)
  6868. +++ /trunk/Data/tools/database_installer.bat (revision 684)
  6869. @@ -579,10 +579,13 @@
  6870. random_spawn.sql
  6871. random_spawn_loc.sql
  6872. seven_signs.sql
  6873. seven_signs_festival.sql
  6874. seven_signs_status.sql
  6875. +buff_templates.sql
  6876. +raid_events_spawnlist.sql
  6877. +raid_prizes.sql
  6878. siege_clans.sql
  6879. skill_learn.sql
  6880. skill_spellbooks.sql
  6881. skill_trees.sql
  6882. spawnlist.sql
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement