Advertisement
Guest User

Untitled

a guest
Aug 18th, 2013
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 20.60 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2J_Server
  3. Index: java/com/l2jserver/gameserver/model/entity/PkHunterEvent.java
  4. ===================================================================
  5. --- java/com/l2jserver/gameserver/model/entity/PkHunterEvent.java   (revision 0)
  6. +++ java/com/l2jserver/gameserver/model/entity/PkHunterEvent.java   (revision 0)
  7. @@ -0,0 +1,71 @@
  8. +/*
  9. + * This program is free software: you can redistribute it and/or modify it under
  10. + * the terms of the GNU General Public License as published by the Free Software
  11. + * Foundation, either version 3 of the License, or (at your option) any later
  12. + * version.
  13. + *
  14. + * This program is distributed in the hope that it will be useful, but WITHOUT
  15. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  16. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  17. + * details.
  18. + *
  19. + * You should have received a copy of the GNU General Public License along with
  20. + * this program. If not, see <http://www.gnu.org/licenses/>.
  21. + */
  22. +package com.l2jserver.gameserver.model.entity;
  23. +
  24. +import com.l2jserver.gameserver.model.actor.L2Character;
  25. +
  26. +/**
  27. + *
  28. + * @author Wyatt
  29. + *
  30. + */
  31. +
  32. +public class PkHunterEvent
  33. +{
  34. +   private static boolean isActive = false;
  35. +   private static String PkName = "";
  36. +   private static int[] PkLocation = {0,0,0};
  37. +  
  38. +   public static boolean isActive()
  39. +   {
  40. +       return isActive;
  41. +   }
  42. +  
  43. +   public static String getPkName()
  44. +   {
  45. +       return PkName;
  46. +   }
  47. +  
  48. +   public static void setPkName(String name)
  49. +   {
  50. +       PkName = name;
  51. +   }
  52. +  
  53. +   public static void setActive(Boolean active)
  54. +   {
  55. +       isActive = active;
  56. +   }
  57. +  
  58. +   public static void setPkLocation(int x, int y, int z)
  59. +   {
  60. +       PkLocation[0] = x;
  61. +       PkLocation[1] = y;
  62. +       PkLocation[2] = z;
  63. +   }
  64. +  
  65. +   public static int[] getPkLocation()
  66. +   {
  67. +       return PkLocation;
  68. +   }
  69. +  
  70. +   public static boolean isPk(L2Character pk)
  71. +   {
  72. +       if(pk.getName().equals(getPkName()))
  73. +       {
  74. +           return true;
  75. +       }
  76. +       return false;
  77. +   }
  78. +}
  79. Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
  80. ===================================================================
  81. --- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java    (revision 5822)
  82. +++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java    (working copy)
  83. @@ -160,6 +160,7 @@
  84.  import com.l2jserver.gameserver.model.entity.Hero;
  85.  import com.l2jserver.gameserver.model.entity.Instance;
  86.  import com.l2jserver.gameserver.model.entity.L2Event;
  87. +import com.l2jserver.gameserver.model.entity.PkHunterEventConditions;
  88.  import com.l2jserver.gameserver.model.entity.Siege;
  89.  import com.l2jserver.gameserver.model.entity.TvTEvent;
  90.  import com.l2jserver.gameserver.model.fishing.L2Fish;
  91. @@ -5507,6 +5532,7 @@
  92.             L2PcInstance pk = killer.getActingPlayer();
  93.            
  94.             TvTEvent.onKill(killer, this);
  95. +           PkHunterEventConditions.checkDie(killer, this);
  96.            
  97.             if (L2Event.isParticipant(pk) && pk != null)
  98.                 pk.getEventStatus().kills.add(this);
  99. @@ -5673,6 +5703,11 @@
  100.         )
  101.             return;
  102.        
  103. +       if(PkHunterEvent.isPk(killer) && !Config.DROP_PKHUNTEREVENT)
  104. +       {
  105. +           return;
  106. +       }
  107. +      
  108.         if ((!isInsideZone(ZONE_PVP) || pk == null) && (!isGM() || Config.KARMA_DROP_GM))
  109.         {
  110.             boolean isKarmaDrop = false;
  111. @@ -5914,6 +5997,7 @@
  112.                 && AntiFeedManager.getInstance().check(this, target))
  113.             setPkKills(getPkKills() + 1);
  114.        
  115. +       PkHunterEventConditions.checkPk(this, target);
  116.         // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
  117.         sendPacket(new UserInfo(this));
  118.         sendPacket(new ExBrExtraUserInfo(this));
  119. Index: java/com/l2jserver/gameserver/network/clientpackets/Logout.java
  120. ===================================================================
  121. --- java/com/l2jserver/gameserver/network/clientpackets/Logout.java (revision 5822)
  122. +++ java/com/l2jserver/gameserver/network/clientpackets/Logout.java (working copy)
  123. @@ -23,6 +23,7 @@
  124.  import com.l2jserver.gameserver.model.L2Party;
  125.  import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  126.  import com.l2jserver.gameserver.model.entity.L2Event;
  127. +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
  128.  import com.l2jserver.gameserver.network.SystemMessageId;
  129.  import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
  130.  import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
  131. @@ -59,6 +60,13 @@
  132.             return;
  133.         }
  134.        
  135. +       if (PkHunterEvent.isPk(player))
  136. +       {
  137. +           player.sendPacket(ActionFailed.STATIC_PACKET);
  138. +           player.sendMessage("You can't logout while in event.");
  139. +           return;
  140. +       }
  141. +      
  142.         if (player.isLocked())
  143.         {
  144.             _log.warning("Player " + player.getName() + " tried to logout during class change.");
  145. Index: java/com/l2jserver/gameserver/network/clientpackets/RequestRestartPoint.java
  146. ===================================================================
  147. --- java/com/l2jserver/gameserver/network/clientpackets/RequestRestartPoint.java    (revision 5822)
  148. +++ java/com/l2jserver/gameserver/network/clientpackets/RequestRestartPoint.java    (working copy)
  149. @@ -28,6 +28,7 @@
  150.  import com.l2jserver.gameserver.model.entity.Castle;
  151.  import com.l2jserver.gameserver.model.entity.ClanHall;
  152.  import com.l2jserver.gameserver.model.entity.Fort;
  153. +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
  154.  import com.l2jserver.gameserver.model.entity.TvTEvent;
  155.  import com.l2jserver.gameserver.model.entity.clanhall.SiegableHall;
  156.  
  157. @@ -76,6 +77,10 @@
  158.         if (TvTEvent.isStarted() && TvTEvent.isPlayerParticipant(activeChar.getObjectId()))
  159.             return;
  160.        
  161. +       if (PkHunterEvent.isPk(activeChar))
  162. +       {
  163. +           return;
  164. +       }
  165.         //SystemMessage sm2 = SystemMessage.getSystemMessage(SystemMessage.S1_S2);
  166.         //sm2.addString("type:"+requestedPointType);
  167.         //activeChar.sendPacket(sm2);
  168. Index: java/com/l2jserver/gameserver/model/olympiad/OlympiadManager.java
  169. ===================================================================
  170. --- java/com/l2jserver/gameserver/model/olympiad/OlympiadManager.java   (revision 5822)
  171. +++ java/com/l2jserver/gameserver/model/olympiad/OlympiadManager.java   (working copy)
  172. @@ -28,6 +28,7 @@
  173.  import com.l2jserver.gameserver.model.L2World;
  174.  import com.l2jserver.gameserver.model.StatsSet;
  175.  import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  176. +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
  177.  import com.l2jserver.gameserver.model.entity.TvTEvent;
  178.  import com.l2jserver.gameserver.network.SystemMessageId;
  179.  import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
  180. @@ -456,6 +457,12 @@
  181.             return false;
  182.         }
  183.        
  184. +       if (PkHunterEvent.isPk(player))
  185. +       {
  186. +           player.sendMessage("You can't participate in Olympiads while in event.");
  187. +           return false;
  188. +       }
  189. +      
  190.         final int charId = noble.getObjectId();
  191.         if (TvTEvent.isPlayerParticipant(charId))
  192.         {
  193. Index: java/com/l2jserver/gameserver/model/skills/l2skills/L2SkillTeleport.java
  194. ===================================================================
  195. --- java/com/l2jserver/gameserver/model/skills/l2skills/L2SkillTeleport.java    (revision 5822)
  196. +++ java/com/l2jserver/gameserver/model/skills/l2skills/L2SkillTeleport.java    (working copy)
  197. @@ -23,6 +23,7 @@
  198.  import com.l2jserver.gameserver.model.StatsSet;
  199.  import com.l2jserver.gameserver.model.actor.L2Character;
  200.  import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  201. +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
  202.  import com.l2jserver.gameserver.model.entity.TvTEvent;
  203.  import com.l2jserver.gameserver.model.skills.L2Skill;
  204.  import com.l2jserver.gameserver.model.skills.L2SkillType;
  205. @@ -63,6 +64,12 @@
  206.                 return;
  207.             }
  208.            
  209. +           if (PkHunterEvent.isPk(activeChar))
  210. +           {
  211. +               activeChar.sendMessage("You can't use escape skills while in event.");
  212. +               return;
  213. +           }
  214. +          
  215.             if (activeChar.isAfraid())
  216.             {
  217.                 activeChar.sendPacket(ActionFailed.STATIC_PACKET);
  218. Index: java/com/l2jserver/Config.java
  219. ===================================================================
  220. --- java/com/l2jserver/Config.java  (revision 5822)
  221. +++ java/com/l2jserver/Config.java  (working copy)
  222. @@ -765,6 +765,9 @@
  223.     public static int L2JMOD_DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
  224.     public static TIntIntHashMap L2JMOD_DUALBOX_CHECK_WHITELIST;
  225.     public static boolean L2JMOD_ALLOW_CHANGE_PASSWORD;
  226. +   public static boolean ENABLE_PKHUNTEREVENT;
  227. +   public static boolean DROP_PKHUNTEREVENT;
  228. +   public static int PKHUNTEREVENT_CHANCE;
  229. +   public static List<int[]> PKHUNTEREVENT_REWARD;
  230.    
  231.     // --------------------------------------------------
  232.     // NPC Settings
  233. @@ -2728,6 +2731,34 @@
  234.                     }
  235.                 }
  236.                 L2JMOD_ALLOW_CHANGE_PASSWORD = Boolean.parseBoolean(L2JModSettings.getProperty("AllowChangePassword", "False"));
  237. +               ENABLE_PKHUNTEREVENT = Boolean.parseBoolean(L2JModSettings.getProperty("EnablePKHunterEvent", "True"));
  238. +               DROP_PKHUNTEREVENT = Boolean.parseBoolean(L2JModSettings.getProperty("PKHunterEventDrop", "False"));
  239. +               PKHUNTEREVENT_CHANCE = Integer.parseInt(L2JModSettings.getProperty("PKHunterEventChance", "20"));
  240. +              
  241. +               if(PKHUNTEREVENT_CHANCE < 1)
  242. +               {
  243. +                   PKHUNTEREVENT_CHANCE = 1;
  244. +               }
  245. +               PKHUNTEREVENT_REWARD = new ArrayList<>();
  246. +               propertySplit = L2JModSettings.getProperty("PKHunterEventRewards", "14720,5;14721,2").split(";");
  247. +              
  248. +               for (String reward : propertySplit)
  249. +               {
  250. +                   String[] rewardSplit = reward.split(",");
  251. +                   if (rewardSplit.length != 2)
  252. +                       _log.warning(StringUtil.concat("PkHunterEvent: invalid config property ->PkHunterEventRewards \"", reward, "\""));
  253. +                   else
  254. +                   {
  255. +                       try
  256. +                       {
  257. +                           PKHUNTEREVENT_REWARD.add(new int[]{Integer.parseInt(rewardSplit[0]), Integer.parseInt(rewardSplit[1])});
  258. +                       }
  259. +                       catch (NumberFormatException nfe)
  260. +                       {
  261. +                           if (!reward.isEmpty())
  262. +                               _log.warning(StringUtil.concat("PkHunterEvent: invalid config property -> PkHunterEventRewards \"", reward, "\""));
  263. +                       }
  264. +                   }
  265. +               }
  266.             }
  267.             catch (Exception e)
  268.             {
  269. Index: java/com/l2jserver/gameserver/network/clientpackets/RequestRestart.java
  270. ===================================================================
  271. --- java/com/l2jserver/gameserver/network/clientpackets/RequestRestart.java (revision 5822)
  272. +++ java/com/l2jserver/gameserver/network/clientpackets/RequestRestart.java (working copy)
  273. @@ -26,9 +26,11 @@
  274.  import com.l2jserver.gameserver.instancemanager.AntiFeedManager;
  275.  import com.l2jserver.gameserver.model.L2Party;
  276.  import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  277. +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
  278.  import com.l2jserver.gameserver.network.L2GameClient;
  279.  import com.l2jserver.gameserver.network.L2GameClient.GameClientState;
  280.  import com.l2jserver.gameserver.network.SystemMessageId;
  281. +import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
  282.  import com.l2jserver.gameserver.network.serverpackets.CharSelectionInfo;
  283.  import com.l2jserver.gameserver.network.serverpackets.RestartResponse;
  284.  import com.l2jserver.gameserver.scripting.scriptengine.listeners.player.PlayerDespawnListener;
  285. @@ -65,6 +67,13 @@
  286.             return;
  287.         }
  288.        
  289. +       if (PkHunterEvent.isPk(player))
  290. +       {
  291. +           player.sendPacket(ActionFailed.STATIC_PACKET);
  292. +           sendPacket(RestartResponse.valueOf(false));
  293. +           return;
  294. +       }
  295. +      
  296.         if (player.isLocked())
  297.         {
  298.             _log.warning("Player " + player.getName() + " tried to restart during class change.");
  299. Index: java/com/l2jserver/gameserver/model/entity/PkHunterEventConditions.java
  300. ===================================================================
  301. --- java/com/l2jserver/gameserver/model/entity/PkHunterEventConditions.java (revision 0)
  302. +++ java/com/l2jserver/gameserver/model/entity/PkHunterEventConditions.java (revision 0)
  303. @@ -0,0 +1,136 @@
  304. +/*
  305. + * This program is free software: you can redistribute it and/or modify it under
  306. + * the terms of the GNU General Public License as published by the Free Software
  307. + * Foundation, either version 3 of the License, or (at your option) any later
  308. + * version.
  309. + *
  310. + * This program is distributed in the hope that it will be useful, but WITHOUT
  311. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  312. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  313. + * details.
  314. + *
  315. + * You should have received a copy of the GNU General Public License along with
  316. + * this program. If not, see <http://www.gnu.org/licenses/>.
  317. + */
  318. +package com.l2jserver.gameserver.model.entity;
  319. +
  320. +import com.l2jserver.Config;
  321. +import com.l2jserver.gameserver.Announcements;
  322. +import com.l2jserver.gameserver.ThreadPoolManager;
  323. +import com.l2jserver.gameserver.datatables.ItemTable;
  324. +import com.l2jserver.gameserver.model.L2Object;
  325. +import com.l2jserver.gameserver.model.actor.L2Character;
  326. +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  327. +import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
  328. +import com.l2jserver.gameserver.network.SystemMessageId;
  329. +import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
  330. +import com.l2jserver.util.Rnd;
  331. +
  332. +/**
  333. + *
  334. + * @author Wyatt
  335. + *
  336. + */
  337. +
  338. +public class PkHunterEventConditions
  339. +{
  340. +   public static void checkFinishByMobs(L2PcInstance killer)
  341. +   {
  342. +       if (PkHunterEvent.isPk(killer) && Config.ENABLE_PKHUNTEREVENT)
  343. +       {
  344. +           if(killer.getKarma() == 0)
  345. +           {
  346. +               Announcements.getInstance().announceToAll("PkHunter Event ended. "+killer.getName()+" has survived.", true);
  347. +               PkHunterEvent.setPkName("");
  348. +               PkHunterEvent.setActive(false);
  349. +               killer.setTeam(0);
  350. +           }
  351. +       }
  352. +   }
  353. +  
  354. +   public static void checkDie(L2Object killer, final L2PcInstance killed)
  355. +   {
  356. +       if(PkHunterEvent.isPk(killed) && Config.ENABLE_PKHUNTEREVENT)
  357. +       {
  358. +           if(killer instanceof L2PcInstance)
  359. +           {
  360. +               L2PcInstance kr = ((L2PcInstance)killer);
  361. +               SystemMessage systemMessage = null;
  362. +              
  363. +               for (int[] reward : Config.PKHUNTEREVENT_REWARD)
  364. +               {
  365. +                   PcInventory inv = kr.getInventory();
  366. +                  
  367. +                   if (ItemTable.getInstance().createDummyItem(reward[0]).isStackable())
  368. +                   {
  369. +                       inv.addItem("PKHunter Event", reward[0], reward[1], kr, kr);
  370. +                      
  371. +                       if (reward[1] > 1)
  372. +                       {
  373. +                           systemMessage = SystemMessage.getSystemMessage(SystemMessageId.EARNED_S2_S1_S);
  374. +                           systemMessage.addItemName(reward[0]);
  375. +                           systemMessage.addItemNumber(reward[1]);
  376. +                       }
  377. +                       else
  378. +                       {
  379. +                           systemMessage = SystemMessage.getSystemMessage(SystemMessageId.EARNED_ITEM_S1);
  380. +                           systemMessage.addItemName(reward[0]);
  381. +                       }
  382. +                       kr.sendPacket(systemMessage);
  383. +                   }
  384. +                   else
  385. +                   {
  386. +                       for (int i = 0; i < reward[1]; ++i)
  387. +                       {
  388. +                           inv.addItem("PkHunter Event", reward[0], 1, kr, kr);
  389. +                           systemMessage = SystemMessage.getSystemMessage(SystemMessageId.EARNED_ITEM_S1);
  390. +                           systemMessage.addItemName(reward[0]);
  391. +                           kr.sendPacket(systemMessage);
  392. +                       }
  393. +                   }
  394. +               }
  395. +           }
  396. +           Announcements.getInstance().announceToAll("Pk Hunting Event: Event ended. "+killer.getName()+" killed the Pk.", true); 
  397. +           killed.setTeam(0);
  398. +           PkHunterEvent.setActive(false);
  399. +           PkHunterEvent.setPkName("");
  400. +          
  401. +           ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
  402. +           {
  403. +               @Override
  404. +               public void run()
  405. +               {
  406. +                   killed.setKarma(0);    
  407. +               }
  408. +           },100);    
  409. +       }
  410. +   }
  411. +  
  412. +   public static void checkPk(L2PcInstance killer, L2Character target)
  413. +   {
  414. +       if (Config.ENABLE_PKHUNTEREVENT && !PkHunterEvent.isActive())
  415. +       {
  416. +           switch(Rnd.get(1, Config.PKHUNTEREVENT_CHANCE))
  417. +           {
  418. +               case 1:
  419. +                   Announcements.getInstance().announceToAll("PkHunter Event started: "+killer.getName()+" is the PK, write .gopk to teleport where the pk was done.", true);
  420. +                   killer.setKarma(900000);
  421. +                   killer.setTeam(2);
  422. +                   PkHunterEvent.setActive(true);
  423. +                   PkHunterEvent.setPkName(killer.getName());
  424. +                   PkHunterEvent.setPkLocation(killer.getX(), killer.getY(), killer.getZ());
  425. +                   break;
  426. +           }      
  427. +       }  
  428. +   }
  429. +  
  430. +   public static void endCoward(L2PcInstance activeChar)
  431. +   {
  432. +       PkHunterEvent.setActive(false);
  433. +       PkHunterEvent.setPkName("");
  434. +       Announcements.getInstance().announceToAll("PkHunter Event ended.", true);
  435. +       activeChar.setKarma(10000);
  436. +       activeChar.sendMessage("You karma updated to 10.000 due to be a coward, PkHunter Event ended.");   
  437. +   }
  438. +      
  439. +}
  440. Index: dist/game/config/l2jmods.properties
  441. ===================================================================
  442. --- dist/game/config/l2jmods.properties (revision 5822)
  443. +++ dist/game/config/l2jmods.properties (working copy)
  444. @@ -461,4 +461,18 @@
  445.  # ---------------------------------------------------------------------------
  446.  # Enables .changepassword voiced command which allows the players to change their account's password ingame.
  447. # Default: False
  448. -AllowChangePassword = False
  449. \ No newline at end of file
  450. +AllowChangePassword = False
  451. +
  452. +# ---------------------------------------------------------------------------
  453. +# PkHunter - Event      
  454. +# ---------------------------------------------------------------------------
  455. +# Enable/Disable PkHunter Event, Default: True
  456. +EnablePKHunterEvent = True
  457. +
  458. +# Chance to start the event when someone gets PK. The probability will be 1/20 if its default.
  459. +# Default: 20
  460. +PKHunterEventChance = 20
  461. +
  462. +# Reward for winner.
  463. +# Example: PKHunterEventRewards = itemId,amount;itemId,amount;itemId,amount
  464. +PKHunterEventRewards = 14720,5;14721,2
  465. +
  466. +# Enable/Disable if the PK of the event will have chances to drop or not, Default: False
  467. +PKHunterEventDrop = False
  468. \ No newline at end of file
  469. Index: java/com/l2jserver/gameserver/model/skills/l2skills/L2SkillMount.java
  470. ===================================================================
  471. --- java/com/l2jserver/gameserver/model/skills/l2skills/L2SkillMount.java   (revision 5822)
  472. +++ java/com/l2jserver/gameserver/model/skills/l2skills/L2SkillMount.java   (working copy)
  473. @@ -18,6 +18,7 @@
  474. import com.l2jserver.gameserver.model.StatsSet;
  475. import com.l2jserver.gameserver.model.actor.L2Character;
  476. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  477. +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
  478. import com.l2jserver.gameserver.model.entity.TvTEvent;
  479. import com.l2jserver.gameserver.model.skills.L2Skill;
  480. import com.l2jserver.gameserver.network.SystemMessageId;
  481. @@ -54,6 +55,12 @@
  482.             return;
  483.         }
  484.        
  485. +       if (PkHunterEvent.isPk(activePlayer))
  486. +       {
  487. +           activePlayer.sendMessage("You can't mount while in event.");
  488. +           return;
  489. +       }
  490. +      
  491.         // Dismount Action
  492.         if (_npcId == 0)
  493.         {
  494. Index: java/com/l2jserver/gameserver/model/actor/L2Attackable.java
  495. ===================================================================
  496. --- java/com/l2jserver/gameserver/model/actor/L2Attackable.java (revision 5822)
  497. +++ java/com/l2jserver/gameserver/model/actor/L2Attackable.java (working copy)
  498. @@ -52,6 +52,7 @@
  499. import com.l2jserver.gameserver.model.actor.knownlist.AttackableKnownList;
  500. import com.l2jserver.gameserver.model.actor.status.AttackableStatus;
  501. import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
  502. +import com.l2jserver.gameserver.model.entity.PkHunterEventConditions;
  503. import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
  504. import com.l2jserver.gameserver.model.items.L2Item;
  505. import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
  506. @@ -540,6 +541,8 @@
  507.            
  508.             if (player != null)
  509.             {
  510. +               PkHunterEventConditions.checkFinishByMobs(player);
  511. +              
  512.                 if (getTemplate().getEventQuests(Quest.QuestEventType.ON_KILL) != null)
  513.                 {
  514.                     for (Quest quest : getTemplate().getEventQuests(Quest.QuestEventType.ON_KILL))
  515. Index: java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java
  516. ===================================================================
  517. --- java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java (revision 5822)
  518. +++ java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java (working copy)
  519. @@ -53,6 +53,8 @@
  520. import com.l2jserver.gameserver.model.entity.Fort;
  521. import com.l2jserver.gameserver.model.entity.FortSiege;
  522. import com.l2jserver.gameserver.model.entity.L2Event;
  523. +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
  524. +import com.l2jserver.gameserver.model.entity.PkHunterEventConditions;
  525. import com.l2jserver.gameserver.model.entity.Siege;
  526. import com.l2jserver.gameserver.model.entity.TvTEvent;
  527. import com.l2jserver.gameserver.model.entity.clanhall.AuctionableHall;
  528. @@ -218,6 +220,13 @@
  529.                 SkillTreesData.getInstance().addSkills(activeChar, true);
  530.             }
  531.         }
  532. +       else
  533. +       {
  534. +           if (activeChar.getKarma() >= 500000 && !activeChar.isCursedWeaponEquipped() && PkHunterEvent.isActive() && Config.ENABLE_PKHUNTEREVENT)
  535. +           {
  536. +                   PkHunterEventConditions.endCoward(activeChar);     
  537. +           }  
  538. +       }
  539.        
  540.         // Set dead status if applies
  541.         if (activeChar.getCurrentHp() < 0.5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement