Advertisement
brounlimited

aCis Patch No2

Jan 2nd, 2014
1,145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 72.21 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P aCis_gameserver
  3. Index: java/net/sf/l2j/gameserver/handler/SkillHandler.java
  4. ===================================================================
  5. --- java/net/sf/l2j/gameserver/handler/SkillHandler.java    (revision 22)
  6. +++ java/net/sf/l2j/gameserver/handler/SkillHandler.java    (working copy)
  7. @@ -24,6 +24,7 @@
  8.  import net.sf.l2j.gameserver.handler.skillhandlers.CpDamPercent;
  9.  import net.sf.l2j.gameserver.handler.skillhandlers.Craft;
  10.  import net.sf.l2j.gameserver.handler.skillhandlers.Disablers;
  11. +import net.sf.l2j.gameserver.handler.skillhandlers.Disarm;
  12.  import net.sf.l2j.gameserver.handler.skillhandlers.DrainSoul;
  13.  import net.sf.l2j.gameserver.handler.skillhandlers.Dummy;
  14.  import net.sf.l2j.gameserver.handler.skillhandlers.Extractable;
  15. @@ -92,6 +93,7 @@
  16.         registerSkillHandler(new Sweep());
  17.         registerSkillHandler(new TakeCastle());
  18.         registerSkillHandler(new Unlock());
  19. +       registerSkillHandler(new Disarm());
  20.     }
  21.    
  22.     public void registerSkillHandler(ISkillHandler handler)
  23. Index: java/net/sf/l2j/gameserver/model/CharEffectList.java
  24. ===================================================================
  25. --- java/net/sf/l2j/gameserver/model/CharEffectList.java    (revision 22)
  26. +++ java/net/sf/l2j/gameserver/model/CharEffectList.java    (working copy)
  27. @@ -580,7 +580,14 @@
  28.            
  29.             effectList = _buffs;
  30.         }
  31. -      
  32. +       if (effect.getSkill().getId() >= 3080 && effect.getSkill().getId() <= 3259)
  33. +                   {
  34. +                       _owner.removeStatsByOwner(effect);
  35. +                       effectList.remove(effect);
  36. +                       effect.getShowIcon();
  37. +                      
  38. +                       return;
  39. +                   }
  40.         if ("none".equals(effect.getStackType()))
  41.         {
  42.             // Remove Func added by this effect from the L2Character Calculator
  43. @@ -692,8 +699,7 @@
  44.             }
  45.            
  46.             // Remove first buff when buff list is full
  47. -           if (!doesStack(newSkill) && !newSkill.is7Signs())
  48. -           {
  49. +           if (!doesStack(newSkill) && !newSkill.is7Signs() && !(newSkill.getId() >= 3080 && newSkill.getId() <= 3259 && newSkill.getSkillType() == L2SkillType.BUFF)){
  50.                 int effectsToRemove = getBuffCount() - _owner.getMaxBuffCount();
  51.                 if (effectsToRemove >= 0)
  52.                 {
  53. @@ -743,7 +749,14 @@
  54.                 _buffs.add(pos, newEffect);
  55.             }
  56.         }
  57. -      
  58. +       if (newEffect.getSkill().getId() >= 3080 && newEffect.getSkill().getId() <= 3259)
  59. +                   {
  60. +                       if (newEffect.setInUse(true))
  61. +                           _owner.addStatFuncs(newEffect.getStatFuncs());
  62. +                      
  63. +                       return;
  64. +                   }
  65. +                  
  66.         // Check if a stack group is defined for this effect
  67.         if ("none".equals(newEffect.getStackType()))
  68.         {
  69. Index: java/net/sf/l2j/gameserver/model/entity/SoloEvent.java
  70. ===================================================================
  71. --- java/net/sf/l2j/gameserver/model/entity/SoloEvent.java  (revision 0)
  72. +++ java/net/sf/l2j/gameserver/model/entity/SoloEvent.java  (revision 0)
  73. @@ -0,0 +1,201 @@
  74. +/*
  75. + * This program is free software: you can redistribute it and/or modify it under
  76. + * the terms of the GNU General Public License as published by the Free Software
  77. + * Foundation, either version 3 of the License, or (at your option) any later
  78. + * version.
  79. + *
  80. + * This program is distributed in the hope that it will be useful, but WITHOUT
  81. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  82. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  83. + * details.
  84. + *
  85. + * You should have received a copy of the GNU General Public License along with
  86. + * this program. If not, see <http://www.gnu.org/licenses/>.
  87. + */
  88. +package net.sf.l2j.gameserver.model.entity;
  89. +
  90. +import java.util.Vector;
  91. +
  92. +import net.sf.l2j.gameserver.ThreadPoolManager;
  93. +import net.sf.l2j.gameserver.datatables.NpcTable;
  94. +import net.sf.l2j.gameserver.datatables.SpawnTable;
  95. +import net.sf.l2j.gameserver.datatables.MapRegionTable.TeleportWhereType;
  96. +import net.sf.l2j.gameserver.model.L2Spawn;
  97. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  98. +import net.sf.l2j.gameserver.skills.AbnormalEffect;
  99. +import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate;
  100. +/**
  101. + * @author Anarchy
  102. + *
  103. + */
  104. +public class SoloEvent
  105. +{
  106. +   public static boolean full = false,
  107. +   start = false;
  108. +   public static int highLs = 0,
  109. +   topLs = 0;
  110. +   private static String playerName = null;
  111. +   public static L2PcInstance player = null;
  112. +   public static long enterTime = 0;
  113. +   private static Vector<L2Spawn> _monsters = new Vector<L2Spawn>();
  114. +   public static Vector<String> _savedPlayers = new Vector<String>();
  115. +  
  116. +   public static void getInstance()
  117. +   {
  118. +       ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()
  119. +       {
  120. +           @Override
  121. +           public void run()
  122. +           {
  123. +               if (start)
  124. +               {
  125. +                   start = false;
  126. +                   startEvent();
  127. +                   return;
  128. +               }
  129. +           }
  130. +       }, 5000, 5000);
  131. +   }
  132. +  
  133. +   private static void startEvent()
  134. +   {
  135. +       enterTime = System.currentTimeMillis();
  136. +       playerName = player.getName();
  137. +       player.teleToLocation(184133, 114298, -8221,1);
  138. +       player.startAbnormalEffect(AbnormalEffect.ROOT);
  139. +       player.setIsParalyzed(true);
  140. +       player.sendMessage("10 seconds till the monsters get spawned.");
  141. +       wait(10);
  142. +       player.stopAbnormalEffect(AbnormalEffect.ROOT);
  143. +       player.setIsParalyzed(false);
  144. +       spawnMonsters();
  145. +       player.sendMessage("The monsters were spawned. You have 2 minutes and 50 seconds to kill as many as possible.");
  146. +       wait(50);
  147. +       if (!checkPlayer())
  148. +       {
  149. +           return;
  150. +       }
  151. +       wait(30);
  152. +       if (!checkPlayer())
  153. +       {
  154. +           return;
  155. +       }
  156. +       wait(30);
  157. +       if (!checkPlayer())
  158. +       {
  159. +           return;
  160. +       }
  161. +       wait(30);
  162. +       if (!checkPlayer())
  163. +       {
  164. +           return;
  165. +       }
  166. +       wait(30);
  167. +       if (!checkPlayer())
  168. +       {
  169. +           return;
  170. +       }
  171. +       player.sendMessage("The event is over. You were rewarded and teleported back to Giran.");
  172. +       reward();
  173. +   }
  174. +  
  175. +   private static boolean checkPlayer()
  176. +   {
  177. +       if (player == null || !player.isOnline())
  178. +       {
  179. +           _savedPlayers.add(playerName);
  180. +           playerName = null;
  181. +           highLs = 0;
  182. +           topLs = 0;
  183. +           full = false;
  184. +           enterTime = 0;
  185. +           for (L2Spawn s : _monsters)
  186. +           {
  187. +               s.getLastSpawn().deleteMe();
  188. +               s.stopRespawn();
  189. +               SpawnTable.getInstance().deleteSpawn(s, false);
  190. +           }
  191. +           _monsters.clear();
  192. +           return false;
  193. +       }
  194. +      
  195. +       return true;
  196. +   }
  197. +  
  198. +   private static void reward()
  199. +   {
  200. +       player.addItem("Solo Event.", 8762, topLs, player, true);
  201. +       player.addItem("Solo Event.", 8752, highLs, player, true);
  202. +       player.teleToLocation(TeleportWhereType.Town);
  203. +       player = null;
  204. +       playerName = null;
  205. +       highLs = 0;
  206. +       topLs = 0;
  207. +       full = false;
  208. +       enterTime = 0;
  209. +       for (L2Spawn s : _monsters)
  210. +       {
  211. +           s.getLastSpawn().deleteMe();
  212. +           s.stopRespawn();
  213. +           SpawnTable.getInstance().deleteSpawn(s, false);
  214. +       }
  215. +       _monsters.clear();
  216. +   }
  217. +  
  218. +   private static void spawnMonsters()
  219. +   {
  220. +       spawnAMonster(184868, 114281, -8219);
  221. +       spawnAMonster(185044, 114442, -8219);
  222. +       spawnAMonster(184880, 114720, -8219);
  223. +       spawnAMonster(185206, 115010, -8219);
  224. +       spawnAMonster(185474, 114886, -8219);
  225. +       spawnAMonster(185789, 115153, -8219);
  226. +       spawnAMonster(186002, 115058, -8219);
  227. +       spawnAMonster(186077, 114780, -8219);
  228. +       spawnAMonster(186018, 114594, -8219);
  229. +       spawnAMonster(186503, 114608, -8219);
  230. +       spawnAMonster(186717, 115616, -8219);
  231. +       spawnAMonster(186285, 115503, -8219);
  232. +       spawnAMonster(185990, 115797, -8219);
  233. +       spawnAMonster(185698, 115763, -8219);
  234. +       spawnAMonster(185571, 115514, -8219);
  235. +       spawnAMonster(185269, 115602, -8219);
  236. +       spawnAMonster(184880, 115599, -8219);
  237. +       spawnAMonster(185027, 115063, -8219);
  238. +       spawnAMonster(185220, 114434, -8219);
  239. +       spawnAMonster(185616, 113609, -8219);
  240. +   }
  241. +  
  242. +   private static void spawnAMonster(int x, int y, int z)
  243. +   {
  244. +       L2Spawn _monster = null;
  245. +       L2NpcTemplate monster = NpcTable.getInstance().getTemplate(65527);
  246. +      
  247. +       try
  248. +       {
  249. +           _monster = new L2Spawn(monster);
  250. +           _monster.setLocx(x);
  251. +           _monster.setLocy(y);
  252. +           _monster.setLocz(z);
  253. +           _monster.setHeading(1);
  254. +           _monster.setRespawnDelay(15);
  255. +           _monster.init();
  256. +           _monster.getLastSpawn().decayMe();
  257. +           _monster.getLastSpawn().spawnMe(_monster.getLastSpawn().getX(), _monster.getLastSpawn().getY(), _monster.getLastSpawn().getZ());
  258. +           SpawnTable.getInstance().addNewSpawn(_monster, false);
  259. +           _monsters.add(_monster);
  260. +       }
  261. +       catch (Exception e)
  262. +       { }
  263. +   }
  264. +  
  265. +   private static void wait(int seconds)
  266. +   {
  267. +       try
  268. +       {
  269. +           Thread.sleep(seconds*1000);
  270. +       }
  271. +       catch (Exception e)
  272. +       { }
  273. +   }
  274. +}
  275. \ No newline at end of file
  276. Index: java/net/sf/l2j/gameserver/model/L2Clan.java
  277. ===================================================================
  278. --- java/net/sf/l2j/gameserver/model/L2Clan.java    (revision 22)
  279. +++ java/net/sf/l2j/gameserver/model/L2Clan.java    (working copy)
  280. @@ -465,6 +465,7 @@
  281.             case 1002:
  282.             case 2001:
  283.             case 2002:
  284. +              
  285.                 return 10;
  286.         }
  287.         return 0;
  288. @@ -1498,7 +1499,7 @@
  289.      * <b>This method DOESN'T update the database.</b>
  290.      * @param value : The total amount to set to _reputationScore.
  291.      */
  292. -   private void setReputationScore(int value)
  293. +   public void setReputationScore(int value)
  294.     {
  295.         // That check is used to see if it needs a refresh.
  296.         final boolean needRefresh = (_reputationScore > 0 && value <= 0) || (value > 0 && _reputationScore <= 0);
  297. @@ -2028,6 +2029,47 @@
  298.                     increaseClanLevel = true;
  299.                 }
  300.                 break;
  301. +            case 8:
  302. +                               // Upgrade to 9
  303. +                                if(getReputationScore() >= 40000 && player.getInventory().getItemByItemId(1419) != null && getMembersCount() >= 140)
  304. +                                {
  305. +                                   // itemId 1419 == Blood Mark
  306. +                                   if (player.destroyItemByItemId("ClanLvl", 1419, 50, player.getTarget(), false))
  307. +                                   {
  308. +                                       setReputationScore(getReputationScore() - 40000, true);
  309. +                                       SystemMessage cr = new SystemMessage(SystemMessageId.S1_DEDUCTED_FROM_CLAN_REP);
  310. +                                       cr.addNumber(40000);
  311. +                                       player.sendPacket(cr);
  312. +                                       cr = null;
  313. +                                       SystemMessage sm = new SystemMessage(SystemMessageId.DISSAPEARED_ITEM);
  314. +                                        sm.addItemName(1419);
  315. +                                        sm.addNumber(50);
  316. +                                       player.sendPacket(sm);
  317. +                                       increaseClanLevel = true;
  318. +                                   }
  319. +                                }
  320. +                                break;
  321. +                            case 9:
  322. +                               // Upgrade to 10
  323. +                                if(getReputationScore() >= 40000 && player.getInventory().getItemByItemId(3874) != null && getMembersCount() >= 140)
  324. +                                {
  325. +                                   // itemId 3874 == Alliance Manifesto
  326. +                                   if (player.destroyItemByItemId("ClanLvl", 3874, 5, player.getTarget(), false))
  327. +                                   {
  328. +                                       setReputationScore(getReputationScore() - 40000);
  329. +                                       SystemMessage cr = new SystemMessage(SystemMessageId.S1_DEDUCTED_FROM_CLAN_REP);
  330. +                                       cr.addNumber(40000);
  331. +                                       player.sendPacket(cr);
  332. +                                       cr = null;
  333. +                                       SystemMessage sm = new SystemMessage(SystemMessageId.ITEM_CANNOT_EXCHANGE);
  334. +                                        sm.addItemName(3874);
  335. +                                        sm.addNumber(5);
  336. +                                        player.sendPacket(sm);
  337. +                                       increaseClanLevel = true;
  338. +                                   }
  339. +                
  340. +                                }
  341. +                                break;
  342.             default:
  343.                 return false;
  344.         }
  345. Index: java/net/sf/l2j/gameserver/handler/skillhandlers/Disablers.java
  346. ===================================================================
  347. --- java/net/sf/l2j/gameserver/handler/skillhandlers/Disablers.java (revision 22)
  348. +++ java/net/sf/l2j/gameserver/handler/skillhandlers/Disablers.java (working copy)
  349. @@ -16,9 +16,13 @@
  350.  
  351. import java.util.logging.Logger;
  352.  
  353. +import javolution.util.FastList;
  354. +
  355. +import net.sf.l2j.gameserver.ThreadPoolManager;
  356. import net.sf.l2j.gameserver.ai.CtrlEvent;
  357. import net.sf.l2j.gameserver.ai.CtrlIntention;
  358. import net.sf.l2j.gameserver.ai.L2AttackableAI;
  359. +import net.sf.l2j.gameserver.datatables.SkillTable;
  360. import net.sf.l2j.gameserver.handler.ISkillHandler;
  361. import net.sf.l2j.gameserver.model.L2Effect;
  362. import net.sf.l2j.gameserver.model.L2Object;
  363. @@ -35,6 +39,7 @@
  364. import net.sf.l2j.gameserver.skills.Formulas;
  365. import net.sf.l2j.gameserver.skills.Stats;
  366. import net.sf.l2j.gameserver.templates.skills.L2SkillType;
  367. +import net.sf.l2j.util.Rnd;
  368.  
  369. /**
  370.  * This Handles Disabler skills
  371. @@ -62,7 +67,27 @@
  372.     };
  373.    
  374.     protected static final Logger _log = Logger.getLogger(Disablers.class.getName());
  375. -  
  376. +   public class Canc implements Runnable{
  377. +               L2PcInstance j;
  378. +               FastList<L2Effect> l;
  379. +              
  380. +               public Canc(L2PcInstance p,FastList<L2Effect> f){
  381. +                   j = p;
  382. +                   l = f;
  383. +               }
  384. +              
  385. +               public void run(){
  386. +                   if(l.isEmpty())
  387. +                       return;
  388. +                   for(L2Effect b : l)
  389. +                       {
  390. +                           L2Skill k = SkillTable.getInstance().getInfo(b.getSkill().getId(), b.getLevel());
  391. +                           if(k != null)
  392. +                           k.getEffects(j, j);
  393. +                       }
  394. +                   l.clear();
  395. +               }
  396. +          }
  397.     @Override
  398.     public void useSkill(L2Character activeChar, L2Skill skill, L2Object[] targets)
  399.     {
  400. @@ -335,7 +360,30 @@
  401.                     break;
  402.             }
  403.         }
  404. -      
  405. +       L2PcInstance p = null;
  406. +                                   if(activeChar instanceof L2PcInstance)
  407. +                                    p = (L2PcInstance) activeChar;
  408. +                                  
  409. +                                   if(p != null){
  410. +                                       L2Effect[] l = p.getAllEffects();
  411. +                                       int r = Rnd.get(6);
  412. +                                       if(l.length < r){}
  413. +                                           int i = 0;
  414. +                                       for(L2Effect h : l){
  415. +                                           int id = h.getSkill().getId();
  416. +                                           if(id == 4082 || id == 4515 || id == 110 || id == 111 || id == 1323 || id == 1325)
  417. +                                               continue;                                  
  418. +                                           if(i == r)
  419. +                                               break;
  420. +                                          
  421. +                                           i++;
  422. +                                           p.addRemovedBuff(h);
  423. +                                           h.exit();      
  424. +                                       }
  425. +                                       ThreadPoolManager.getInstance().scheduleGeneral(new Canc(p,p.getRemovedBuffs()), 6000);
  426. +                                   }
  427. +                                    // Cannot cancel skills 4082, 4215, 4515, 110, 111, 1323, 1325
  428. +                                  
  429.         if (skill.hasSelfEffects())
  430.         {
  431.             final L2Effect effect = activeChar.getFirstEffect(skill.getId());
  432. Index: java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java
  433. ===================================================================
  434. --- java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java    (revision 0)
  435. +++ java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java    (revision 0)
  436. @@ -0,0 +1,83 @@
  437. +package net.sf.l2j.gameserver.skills.effects;
  438. +
  439. +import net.sf.l2j.gameserver.model.L2Effect;
  440. +import net.sf.l2j.gameserver.network.SystemMessageId;
  441. +import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  442. +import net.sf.l2j.gameserver.skills.Env;
  443. +import net.sf.l2j.gameserver.templates.skills.L2EffectType;
  444. +import net.sf.l2j.gameserver.templates.skills.L2SkillType;
  445. +
  446. +
  447. +/**
  448. + * @author Lineal
  449. + */
  450. +public final class EffectDeflectBuff extends L2Effect
  451. +{
  452. +   /**
  453. +    * @param env
  454. +    * @param template
  455. +    */
  456. +   public EffectDeflectBuff(Env env, EffectTemplate template)
  457. +   {
  458. +       super(env, template);
  459. +   }
  460. +
  461. +   /*
  462. +    * (non-Javadoc)
  463. +    *
  464. +    * @see com.l2jfrozen.gameserver.model.L2Effect#getEffectType()
  465. +    */
  466. +   @Override
  467. +   public L2EffectType getEffectType()
  468. +   {
  469. +       return L2EffectType.PREVENT_BUFF;
  470. +   }
  471. +  
  472. +   /*
  473. +    * (non-Javadoc)
  474. +    *
  475. +    * @see com.l2jfrozen.gameserver.model.L2Effect#onActionTime()
  476. +    */
  477. +   @Override
  478. +   public boolean onActionTime()
  479. +   {
  480. +       // Only cont skills shouldn't end
  481. +       if(getSkill().getSkillType() != L2SkillType.CONT)
  482. +           return false;
  483. +
  484. +       double manaDam = calc();
  485. +
  486. +       if(manaDam > getEffected().getCurrentMp())
  487. +       {
  488. +           SystemMessage sm = new SystemMessage(SystemMessageId.SKILL_REMOVED_DUE_LACK_MP);
  489. +           getEffected().sendPacket(sm);
  490. +           return false;
  491. +       }
  492. +
  493. +       getEffected().reduceCurrentMp(manaDam);
  494. +       return true;
  495. +   }
  496. +  
  497. +   /*
  498. +    * (non-Javadoc)
  499. +    *
  500. +    * @see com.l2jfrozen.gameserver.model.L2Effect#onStart()
  501. +    */
  502. +   @Override
  503. +   public boolean onStart()
  504. +   {
  505. +       getEffected().setIsBuffProtected(true);
  506. +       return true;
  507. +   }
  508. +
  509. +   /*
  510. +    * (non-Javadoc)
  511. +    *
  512. +    * @see com.l2jfrozen.gameserver.model.L2Effect#onExit()
  513. +    */
  514. +   @Override
  515. +   public void onExit()
  516. +   {
  517. +       getEffected().setIsBuffProtected(false);
  518. +   }
  519. +}
  520. \ No newline at end of file
  521. Index: java/net/sf/l2j/gameserver/model/actor/L2Character.java
  522. ===================================================================
  523. --- java/net/sf/l2j/gameserver/model/actor/L2Character.java (revision 22)
  524. +++ java/net/sf/l2j/gameserver/model/actor/L2Character.java (working copy)
  525. @@ -136,6 +136,17 @@
  526.   */
  527.  public abstract class L2Character extends L2Object
  528.  {
  529. +   private boolean _isBuffProtected = false; //Protect From Debuffs
  530. +   public final void setIsBuffProtected(boolean value)
  531. +       {
  532. +           _isBuffProtected = value;
  533. +       }
  534. +      
  535. +       public boolean isBuffProtected()
  536. +       {
  537. +           return _isBuffProtected;   
  538. +       }
  539. +  
  540.     public static final Logger _log = Logger.getLogger(L2Character.class.getName());
  541.    
  542.     private Set<L2Character> _attackByList;
  543. Index: java/net/sf/l2j/gameserver/handler/itemhandlers/SoloEventTeleportationCube.java
  544. ===================================================================
  545. --- java/net/sf/l2j/gameserver/handler/itemhandlers/SoloEventTeleportationCube.java (revision 0)
  546. +++ java/net/sf/l2j/gameserver/handler/itemhandlers/SoloEventTeleportationCube.java (revision 0)
  547. @@ -0,0 +1,83 @@
  548. +/*
  549. + * This program is free software: you can redistribute it and/or modify it under
  550. + * the terms of the GNU General Public License as published by the Free Software
  551. + * Foundation, either version 3 of the License, or (at your option) any later
  552. + * version.
  553. + *
  554. + * This program is distributed in the hope that it will be useful, but WITHOUT
  555. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  556. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  557. + * details.
  558. + *
  559. + * You should have received a copy of the GNU General Public License along with
  560. + * this program. If not, see <http://www.gnu.org/licenses/>.
  561. + */
  562. +package net.sf.l2j.gameserver.handler.itemhandlers;
  563. +
  564. +import javolution.text.TextBuilder;
  565. +
  566. +import net.sf.l2j.gameserver.handler.IItemHandler;
  567. +import net.sf.l2j.gameserver.model.L2ItemInstance;
  568. +import net.sf.l2j.gameserver.model.actor.L2Playable;
  569. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  570. +import net.sf.l2j.gameserver.model.entity.SoloEvent;
  571. +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  572. +/**
  573. + * @author Anarchy
  574. + *
  575. + */
  576. +public class SoloEventTeleportationCube implements IItemHandler
  577. +{
  578. +   public void useItem(L2Playable playable, L2ItemInstance item, boolean forceUse)
  579. +   {
  580. +       if (!(playable instanceof L2PcInstance))
  581. +       {
  582. +           return;
  583. +       }
  584. +      
  585. +       L2PcInstance player = (L2PcInstance)playable;
  586. +      
  587. +       if (player.isInOlympiadMode())
  588. +       {
  589. +           player.sendMessage("You may not enter Solo Event while being in olympiad mode.");
  590. +           return;
  591. +       }
  592. +       if (player.getPvpFlag() > 0 || player.getKarma() > 0)
  593. +       {
  594. +           player.sendMessage("You may not enter Solo Event while fighting.");
  595. +           return;
  596. +       }
  597. +       if (player.getActiveTradeList() != null)
  598. +       {
  599. +           player.sendMessage("You may not enter Solo Event while trading.");
  600. +           return;
  601. +       }
  602. +       if (player.getActiveWarehouse() != null)
  603. +       {
  604. +           player.sendMessage("You may not enter Solo Event while using the warehouse.");
  605. +           return;
  606. +       }
  607. +       if (SoloEvent.player == player)
  608. +       {
  609. +           player.sendMessage("You can't use this while being in a Solo Event.");
  610. +           return;
  611. +       }
  612. +      
  613. +       NpcHtmlMessage htm = new NpcHtmlMessage(0);
  614. +       TextBuilder tb = new TextBuilder("<html><body>");
  615. +       tb.append("<center>Solo Event room is "+(SoloEvent.full ? "full." : "empty."));
  616. +       if (SoloEvent.full)
  617. +       {
  618. +           tb.append("<br1>Player inside: "+SoloEvent.player.getName());
  619. +           tb.append("<br1>Time left: "+(180-((System.currentTimeMillis()-SoloEvent.enterTime)/1000) < 60 ? 180-((System.currentTimeMillis()-SoloEvent.enterTime)/1000)+" seconds." : 3-((System.currentTimeMillis()-SoloEvent.enterTime)/1000/60)+" minutes."));
  620. +       }
  621. +       else
  622. +       {
  623. +           tb.append("<br><a action=\"bypass -h bp_enterSoloEvent\">Enter Solo Event.</a>");
  624. +       }
  625. +       tb.append("</center></body></html>");
  626. +       htm.setHtml(tb.toString());
  627. +      
  628. +       player.sendPacket(htm);
  629. +   }
  630. +}
  631. \ No newline at end of file
  632. Index: java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
  633. ===================================================================
  634. --- java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java    (revision 25)
  635. +++ java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java    (working copy)
  636. @@ -18,6 +18,7 @@
  637.  import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Online;
  638.  import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Siege;
  639.  import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Vote;
  640. +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.VoteRewardMe;
  641.  
  642.  import gnu.trove.map.hash.TIntObjectHashMap;
  643.  
  644. @@ -43,6 +44,11 @@
  645.         registerHandler(new EventJoin());
  646.         registerHandler(new Vote());
  647.         registerHandler(new Siege());
  648. +       if(Config.VOTE_BUFF_ENABLED)
  649. +                   {
  650. +                   registerHandler( new VoteRewardMe());
  651. +                   }
  652. +                  
  653.     }
  654.    
  655.     public void registerHandler(IVoicedCommandHandler handler)
  656. Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
  657. ===================================================================
  658. --- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java    (revision 22)
  659. +++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java    (working copy)
  660. @@ -17,11 +17,13 @@
  661.  import java.text.SimpleDateFormat;
  662.  import java.util.Calendar;
  663.  import java.util.Date;
  664. +import java.util.Vector;
  665.  
  666.  import net.sf.l2j.Config;
  667.  import net.sf.l2j.gameserver.Announcements;
  668.  import net.sf.l2j.gameserver.GameTimeController;
  669.  import net.sf.l2j.gameserver.SevenSigns;
  670. +import net.sf.l2j.gameserver.cache.HtmCache;
  671.  import net.sf.l2j.gameserver.datatables.AdminCommandAccessRights;
  672.  import net.sf.l2j.gameserver.datatables.GmListTable;
  673.  import net.sf.l2j.gameserver.datatables.MapRegionTable;
  674. @@ -64,7 +66,7 @@
  675.  {
  676.     long _daysleft;
  677.     SimpleDateFormat df = new SimpleDateFormat("dd MM yyyy");
  678. -  
  679. +   public static Vector<L2PcInstance> _onlineplayers = new Vector<L2PcInstance>();
  680.     @Override
  681.     protected void readImpl()
  682.     {
  683. @@ -75,13 +77,36 @@
  684.     protected void runImpl()
  685.     {
  686.         final L2PcInstance activeChar = getClient().getActiveChar();
  687. +       _onlineplayers.add(activeChar);
  688.         if (activeChar == null)
  689.         {
  690.             _log.warning("EnterWorld failed! activeChar is null...");
  691.             getClient().closeNow();
  692.             return;
  693.         }
  694. -      
  695. +
  696. +       if (Config.ALLOW_TITLE_PANEL)
  697. +       {
  698. +           StringBuilder debian = new StringBuilder();
  699. +           NpcHtmlMessage d = new NpcHtmlMessage(1);
  700. +          
  701. +           debian.append("<html><head></head>" +
  702. +                   "<body>" +
  703. +                   "<center>" +
  704. +                   "This panel, allows you to change your title.<br>" +
  705. +                   "<br>" +
  706. +                   "Option 1:<br>" +
  707. +                   "<button value=\"Normal Title\" action=\"bypass -h title1\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">" +
  708. +                   "<br>" +
  709. +                   "Option 2:<br>" +
  710. +                   "<button value=\"PvP/PK Title\" action=\"bypass -h title2\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">" +
  711. +                   "<br>" +
  712. +                   "</center></body></html>");
  713. +          
  714. +           d.setHtml(debian.toString());
  715. +           activeChar.sendPacket(d);
  716. +       }
  717. +
  718.         if (L2World.getInstance().findObject(activeChar.getObjectId()) != null)
  719.         {
  720.             if (Config.DEBUG)
  721. @@ -246,7 +271,18 @@
  722.         if (!activeChar.isGM() && (!activeChar.isInSiege() || activeChar.getSiegeState() < 2) && activeChar.isInsideZone(ZoneId.SIEGE))
  723.             activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);
  724.     }
  725. -  
  726. +   public void warnAllPlayers()
  727. +       {
  728. +           for (L2PcInstance player : _onlineplayers)
  729. +           {
  730. +               String file = "data/html/chaos/warning.htm";
  731. +               String html = HtmCache.getInstance().getHtm(file);
  732. +               NpcHtmlMessage warning = new NpcHtmlMessage(1);
  733. +               warning.setHtml(html);
  734. +              
  735. +               player.sendPacket(warning);
  736. +           }
  737. +       }
  738.         private void onEnterAio(L2PcInstance activeChar)
  739.         {
  740.             long now = Calendar.getInstance().getTimeInMillis();
  741. Index: java/net/sf/l2j/gameserver/network/serverpackets/SystemMessage.java
  742. ===================================================================
  743. --- java/net/sf/l2j/gameserver/network/serverpackets/SystemMessage.java (revision 22)
  744. +++ java/net/sf/l2j/gameserver/network/serverpackets/SystemMessage.java (working copy)
  745. @@ -110,7 +110,7 @@
  746.     private SMParam[] _params;
  747.     private int _paramIndex;
  748.    
  749. -   private SystemMessage(final SystemMessageId smId)
  750. +   public SystemMessage(final SystemMessageId smId)
  751.     {
  752.         final int paramCount = smId.getParamCount();
  753.         _smId = smId;
  754. Index: java/net/sf/l2j/gameserver/model/L2Effect.java
  755. ===================================================================
  756. --- java/net/sf/l2j/gameserver/model/L2Effect.java  (revision 22)
  757. +++ java/net/sf/l2j/gameserver/model/L2Effect.java  (working copy)
  758. @@ -389,7 +389,30 @@
  759.                     smsg.addSkillName(_skill);
  760.                     getEffected().sendPacket(smsg);
  761.                 }
  762. -              
  763. +               if (getEffected() instanceof L2PcInstance)
  764. +                                   {
  765. +                                       L2Effect firstAug = null;
  766. +                                  int activeAugs = 0;
  767. +                  
  768. +                                       for (L2Effect e : getEffected().getAllEffects())
  769. +                                       {
  770. +                                       if (e.getSkill().getId() >= 3080 && e.getSkill().getId() <= 3259 && e.getSkillType() == L2SkillType.BUFF)
  771. +                                           {
  772. +                                               if (firstAug == null)
  773. +                                               {
  774. +                                                   firstAug = e;
  775. +                                               }
  776. +                  
  777. +                                               activeAugs++;
  778. +                                           }
  779. +                                       }
  780. +                  
  781. +                                       if (activeAugs >= 3) // at 2 make an int config.
  782. +                                       {
  783. +                                           if (firstAug != null)
  784. +                                               firstAug.exit();
  785. +                                       }
  786. +                                   }
  787.                 if (_period != 0)
  788.                 {
  789.                     startEffectTask();
  790. Index: java/net/sf/l2j/gameserver/handler/itemhandlers/ScrollOfClanRepPoints.java
  791. ===================================================================
  792. --- java/net/sf/l2j/gameserver/handler/itemhandlers/ScrollOfClanRepPoints.java  (revision 0)
  793. +++ java/net/sf/l2j/gameserver/handler/itemhandlers/ScrollOfClanRepPoints.java  (revision 0)
  794. @@ -0,0 +1,60 @@
  795. +/*
  796. + * This program is free software; you can redistribute it and/or modify
  797. + * it under the terms of the GNU General Public License as published by
  798. + * the Free Software Foundation; either version 2, or (at your option)
  799. + * any later version.
  800. + *
  801. + * This program is distributed in the hope that it will be useful,
  802. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  803. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  804. + * GNU General Public License for more details.
  805. + *
  806. + * You should have received a copy of the GNU General Public License
  807. + * along with this program; if not, write to the Free Software
  808. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  809. + * 02111-1307, USA.
  810. + *
  811. + * http://www.gnu.org/copyleft/gpl.html
  812. + */
  813. +package net.sf.l2j.gameserver.handler.itemhandlers;
  814. +
  815. +import net.sf.l2j.gameserver.handler.IItemHandler;
  816. +import net.sf.l2j.gameserver.model.L2ItemInstance;
  817. +import net.sf.l2j.gameserver.model.actor.L2Playable;
  818. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  819. +
  820. +
  821. +/**
  822. + * @author Stefoulis15
  823. + **/
  824. +public class ScrollOfClanRepPoints implements IItemHandler
  825. +{
  826. +   private static final int ITEM_IDS[] = { 9190 };
  827. +
  828. +
  829. +   /* (non-Javadoc)
  830. +    * @see net.sf.l2j.gameserver.handler.IItemHandler#useItem(net.sf.l2j.gameserver.model.actor.L2Playable, net.sf.l2j.gameserver.model.L2ItemInstance, boolean)
  831. +    */
  832. +   @Override
  833. +   public void useItem(L2Playable playable, L2ItemInstance item, boolean forceUse)
  834. +   {L2PcInstance activeChar = (L2PcInstance) playable;
  835. +   if (activeChar.getClan() == null)
  836. +   {
  837. +       activeChar.sendMessage("You do not have any clan!");
  838. +       return;
  839. +   }
  840. +  
  841. +   else if (!activeChar.isClanLeader())
  842. +   {
  843. +       activeChar.sendMessage("You are not clan leader!");
  844. +       return;
  845. +   }
  846. +   activeChar.getClan().setReputationScore(1000);
  847. +   activeChar.sendMessage("Your clan's reputation score is now " + activeChar.getClan().getReputationScore() + "");
  848. +   activeChar.broadcastUserInfo();
  849. +   playable.destroyItem("Consume", item.getObjectId(), 1, null, true);
  850. +}
  851. +  
  852. +      
  853. +   }
  854. +}
  855. \ No newline at end of file
  856. Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminPledge.java
  857. ===================================================================
  858. --- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminPledge.java    (revision 22)
  859. +++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminPledge.java    (working copy)
  860. @@ -114,8 +114,8 @@
  861.                         {
  862.                             final int level = Integer.parseInt(st.nextToken());
  863.                            
  864. -                           if (level >= 0 && level < 9)
  865. -                           {
  866. +                           if (level>=0 && level <11)
  867. +                               {
  868.                                 player.getClan().changeLevel(level);
  869.                                 activeChar.sendMessage("You have set clan " + player.getClan().getName() + " to level " + level);
  870.                             }
  871. Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/PartyControlVC.java
  872. ===================================================================
  873. --- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/PartyControlVC.java    (revision 0)
  874. +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/PartyControlVC.java    (revision 0)
  875. @@ -0,0 +1 @@
  876. +
  877. Index: java/net/sf/l2j/gameserver/network/clientpackets/Logout.java
  878. ===================================================================
  879. --- java/net/sf/l2j/gameserver/network/clientpackets/Logout.java    (revision 22)
  880. +++ java/net/sf/l2j/gameserver/network/clientpackets/Logout.java    (working copy)
  881. @@ -44,7 +44,12 @@
  882.             player.sendPacket(ActionFailed.STATIC_PACKET);
  883.             return;
  884.         }
  885. -      
  886. +       EnterWorld world = new EnterWorld();
  887. +                      
  888. +               if (world._onlineplayers.contains(player) && player!=null)
  889. +               {
  890. +                   world._onlineplayers.remove(player);
  891. +               }
  892.         if (player.isLocked())
  893.         {
  894.             if (Config.DEBUG)
  895. Index: java/net/sf/l2j/gameserver/templates/skills/L2SkillType.java
  896. ===================================================================
  897. --- java/net/sf/l2j/gameserver/templates/skills/L2SkillType.java    (revision 22)
  898. +++ java/net/sf/l2j/gameserver/templates/skills/L2SkillType.java    (working copy)
  899. @@ -165,8 +165,10 @@
  900.         CAPTURE,
  901.    
  902.     // unimplemented
  903. -   NOTDONE;
  904. -  
  905. +   NOTDONE,
  906. +   //Elfo was here
  907. +   DISARM;
  908. +    
  909.     private final Class<? extends L2Skill> _class;
  910.    
  911.     public L2Skill makeSkill(StatsSet set)
  912. Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/VoteRewardMe.java
  913. ===================================================================
  914. --- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/VoteRewardMe.java  (revision 0)
  915. +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/VoteRewardMe.java  (revision 0)
  916. @@ -0,0 +1,68 @@
  917. +/*
  918. + * This program is free software: you can redistribute it and/or modify it under
  919. + * the terms of the GNU General Public License as published by the Free Software
  920. + * Foundation, either version 3 of the License, or (at your option) any later
  921. + * version.
  922. + *
  923. + * This program is distributed in the hope that it will be useful, but WITHOUT
  924. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  925. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  926. + * details.
  927. + *
  928. + * You should have received a copy of the GNU General Public License along with
  929. + * this program. If not, see <http://www.gnu.org/licenses/>.
  930. + */
  931. +package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
  932. +
  933. +import net.sf.l2j.Config;
  934. +import net.sf.l2j.gameserver.datatables.SkillTable;
  935. +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
  936. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  937. +import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
  938. +
  939. +
  940. +
  941. +/**
  942. + * @author Elfocrash
  943. + */
  944. +
  945. +public class VoteRewardMe implements IVoicedCommandHandler
  946. +{
  947. +   private static final String[] VOICED_COMMANDS =
  948. +   {
  949. +           "rewardme"
  950. +   };
  951. +
  952. +  
  953. +   @Override
  954. +   public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
  955. +   {
  956. +
  957. +           if(activeChar.isInOlympiadMode() || activeChar.getOlympiadGameId() != -1)
  958. +           {
  959. +               activeChar.sendMessage("You can't use that command inside Olympiad");
  960. +               return false;
  961. +           }
  962. +
  963. +           if(activeChar.getInventory().getItemByItemId(Config.VOTE_ITEM_ID).getCount() >= Config.VOTE_ITEM_AMOUNT)
  964. +           {
  965. +               activeChar.getInventory().destroyItemByItemId("Consume", Config.VOTE_ITEM_ID, Config.VOTE_ITEM_AMOUNT, activeChar, null);
  966. +               activeChar.sendMessage(Config.VOTE_ITEM_AMOUNT + " " + Config.VOTE_ITEM_NAME + "(s) have been consumed.");
  967. +               MagicSkillUse mgc = new MagicSkillUse(activeChar, activeChar, Config.VOTE_BUFF_ID, Config.VOTE_BUFF_LVL, 1, 0);
  968. +               SkillTable.getInstance().getInfo(Config.VOTE_BUFF_ID, Config.VOTE_BUFF_LVL).getEffects(activeChar,activeChar);
  969. +               activeChar.broadcastPacket(mgc);
  970. +               activeChar.sendMessage("You have been blessed with the effects of the Vote Buff!");
  971. +           }
  972. +           else
  973. +           {          
  974. +               activeChar.sendMessage("You don't have enough " + Config.VOTE_ITEM_NAME + "(s) in order to get rewarded!");
  975. +           }
  976. +           return true;   
  977. +   }
  978. +
  979. +   @Override
  980. +   public String[] getVoicedCommandList()
  981. +   {
  982. +       return VOICED_COMMANDS;
  983. +   }
  984. +}
  985. \ No newline at end of file
  986. Index: java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java
  987. ===================================================================
  988. --- java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java (revision 22)
  989. +++ java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java (working copy)
  990. @@ -28,6 +28,7 @@
  991.  import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminCache;
  992.  import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminCamera;
  993.  import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminChangeAccessLevel;
  994. +import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminChaos;
  995.  import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminCreateItem;
  996.  import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminCursedWeapons;
  997.  import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminDelete;
  998. @@ -133,6 +134,7 @@
  999.         registerAdminCommandHandler(new AdminUnblockIp());
  1000.         registerAdminCommandHandler(new AdminZone());
  1001.         registerAdminCommandHandler(new AdminEvents());
  1002. +       registerAdminCommandHandler(new AdminChaos());
  1003.     }
  1004.    
  1005.     public void registerAdminCommandHandler(IAdminCommandHandler handler)
  1006. Index: java/net/sf/l2j/gameserver/network/clientpackets/Say2.java
  1007. ===================================================================
  1008. --- java/net/sf/l2j/gameserver/network/clientpackets/Say2.java  (revision 22)
  1009. +++ java/net/sf/l2j/gameserver/network/clientpackets/Say2.java  (working copy)
  1010. @@ -22,9 +22,11 @@
  1011.  import net.sf.l2j.gameserver.event.EventManager;
  1012.  import net.sf.l2j.gameserver.handler.ChatHandler;
  1013.  import net.sf.l2j.gameserver.handler.IChatHandler;
  1014. +import net.sf.l2j.gameserver.model.L2World;
  1015.  import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1016.  import net.sf.l2j.gameserver.network.SystemMessageId;
  1017.  import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
  1018. +import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
  1019.  import net.sf.l2j.gameserver.util.IllegalPlayerAction;
  1020.  import net.sf.l2j.gameserver.util.Util;
  1021.  
  1022. @@ -142,6 +144,40 @@
  1023.             return;
  1024.         }
  1025.        
  1026. +       if(Config.ENABLE_DONATOR_CHAT)
  1027. +                       {
  1028. +                         if(_text.startsWith("~"))
  1029. +                         {
  1030. +                        
  1031. +                               for(L2PcInstance p:L2World.getInstance().getAllPlayers().values())
  1032. +                              {
  1033. +                                   p.sendPacket(new CreatureSay(0,15,activeChar.getName(),_text));                
  1034. +                                   return;
  1035. +                              }
  1036. +                         }
  1037. +                         else{
  1038. +                             activeChar.sendMessage("This chat can be used only by Donators of the server");
  1039. +                              
  1040. +                         }
  1041. +                       }
  1042. +                       if(Config.ENABLE_PVP_CHAT)
  1043. +                       {
  1044. +                           if(_text.startsWith("-"))
  1045. +                           {
  1046. +                               if(activeChar.getPvpKills() >= Config.PVP_CHAT_COUNT)
  1047. +                               {
  1048. +                                   for(L2PcInstance p:L2World.getInstance().getAllPlayers().values())
  1049. +                                      {
  1050. +                                           p.sendPacket(new CreatureSay(0,16,activeChar.getName(),_text));                
  1051. +                                           return;
  1052. +                                      }   
  1053. +                               }
  1054. +                               else
  1055. +                                   activeChar.sendMessage("You don't have enough pvps in order to talk to this chat");
  1056. +                           }
  1057. +                       }
  1058. +          
  1059. +          
  1060.         if (_text.isEmpty())
  1061.         {
  1062.             _log.warning(activeChar.getName() + ": sending empty text. Possible packet hack.");
  1063. @@ -196,6 +232,7 @@
  1064.             _logChat.log(record);
  1065.         }
  1066.        
  1067. +      
  1068.         _text = _text.replaceAll("\\\\n", "");
  1069.         if (EventManager.getInstance().isRegistered(activeChar) && !EventManager.getInstance().getCurrentEvent().onSay(_type, activeChar, _text))
  1070.                     {
  1071. Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
  1072. ===================================================================
  1073. --- java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 22)
  1074. +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (working copy)
  1075. @@ -18,6 +18,7 @@
  1076.  import java.util.logging.Level;
  1077.  
  1078.  import net.sf.l2j.Config;
  1079. +import net.sf.l2j.gameserver.ThreadPoolManager;
  1080.  import net.sf.l2j.gameserver.communitybbs.CommunityBoard;
  1081.  import net.sf.l2j.gameserver.datatables.AdminCommandAccessRights;
  1082.  import net.sf.l2j.gameserver.datatables.ItemTable;
  1083. @@ -47,7 +48,14 @@
  1084.     {
  1085.         _command = readS();
  1086.     }
  1087. -  
  1088. +   public class Close implements Runnable{
  1089. +       public Close(L2PcInstance playah){
  1090. +           playah.getClient().closeNow();
  1091. +       }
  1092. +       public void run(){
  1093. +          
  1094. +       }
  1095. +   }
  1096.     @Override
  1097.     protected void runImpl()
  1098.     {
  1099. @@ -93,6 +101,36 @@
  1100.                
  1101.                 ach.useAdminCommand(_command, activeChar);
  1102.             }
  1103. +           else if(_command.startsWith("title1"))
  1104. +                           {
  1105. +                               activeChar.setTitle("");
  1106. +                           }
  1107. +                           else if(_command.startsWith("title2"))
  1108. +                           {
  1109. +                               activeChar.setTitle(Config.PVP_TITLE_PREFIX + activeChar.getPvpKills() + Config.PK_TITLE_PREFIX + activeChar.getPkKills() + " ");
  1110. +                           }
  1111. +           else if (_command.startsWith("checkAns")){
  1112. +               String command1 = _command.split(" ")[0];
  1113. +               String  command2 = _command.split(" ")[1];
  1114. +               String command3 =  _command.split(" ")[2];
  1115. +               int num1 = Integer.parseInt(command2);
  1116. +               int num2 = Integer.parseInt(command3);
  1117. +               int answer = Integer.parseInt(command1);
  1118. +               if(num1 + num2 == answer){
  1119. +                   String html = "<html><title>Succesful</title><body><center>Correct answer !</center></body></html>";
  1120. +                   NpcHtmlMessage nhm = new NpcHtmlMessage(activeChar.getObjectId());
  1121. +                   nhm.setHtml(html);
  1122. +                   activeChar.sendPacket(nhm);
  1123. +                   activeChar.setPassed(true);
  1124. +               }else{
  1125. +                   String html = "<html><title>Succesful</title><body><center>Your client will close in 5 seconds</center></body></html>";
  1126. +                   NpcHtmlMessage nhm = new NpcHtmlMessage(activeChar.getObjectId());
  1127. +                   nhm.setHtml(html);
  1128. +                   activeChar.sendPacket(nhm);
  1129. +                   ThreadPoolManager.getInstance().scheduleGeneral(new Close(activeChar), 5000);
  1130. +              
  1131. +               }
  1132. +           }
  1133.             else if (_command.startsWith("event_vote"))
  1134.                             {
  1135.                                 EventManager.getInstance().addVote(activeChar, Integer.parseInt(_command.substring(11)));
  1136. Index: config/events.properties
  1137. ===================================================================
  1138. --- config/events.properties    (revision 22)
  1139. +++ config/events.properties    (working copy)
  1140. @@ -256,4 +256,38 @@
  1141.  AltFishChampionshipReward4 = 200000
  1142.  AltFishChampionshipReward5 = 100000
  1143.  
  1144. +#----------------------------------
  1145. +#Elfocrash Donator &PvP Chat Config
  1146. +#----------------------------------
  1147. +#If true donator will be able to use ~ and have their own global chat
  1148. +EnableDonatorChat = True
  1149. +#If true then players with a certain amount of pvps and more will have their global chat
  1150. +EnablePvpChat = True
  1151. +#Here set the pvp count that a player must have in order to use the chat
  1152. +PvpChatCount = 0
  1153. +
  1154.  
  1155. +# -----------------------------------------
  1156. +# Vote Buff Config  -
  1157. +# -----------------------------------------
  1158. +# By enabling this you will give the players the opportunity
  1159. +# to get rewarded with a buff that you will choose
  1160. +VoteBuffCmdEnabled = True
  1161. +# Set the item that you reward the players by their votes
  1162. +# Default 3470 - Gold Bar
  1163. +VoteItemId = 3470
  1164. +# Set the amount needed and will be consumed in order to get the buff
  1165. +VoteItemRequired = 5
  1166. +# Set the name of the item
  1167. +VoteItemName = Gold Bar
  1168. +# Set the Buff ID that you want to reward the players with
  1169. +# Default Active : Might
  1170. +VoteBuffId = 3132
  1171. +# Set the level of the buff
  1172. +VoteBuffLevel = 10
  1173. +
  1174. +ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
  1175. +
  1176. +# Title panel.
  1177. +# It gives you 2 options to choose about your title.
  1178. +AllowTitlePanel = True
  1179. \ No newline at end of file
  1180. Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Chaos.java
  1181. ===================================================================
  1182. --- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Chaos.java (revision 0)
  1183. +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Chaos.java (revision 0)
  1184. @@ -0,0 +1,67 @@
  1185. +/* This program is free software; you can redistribute it and/or modify
  1186. + * it under the terms of the GNU General Public License as published by
  1187. + * the Free Software Foundation; either version 2, or (at your option)
  1188. + * any later version.
  1189. + *
  1190. + * This program is distributed in the hope that it will be useful,
  1191. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1192. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1193. + * GNU General Public License for more details.
  1194. + *
  1195. + * You should have received a copy of the GNU General Public License
  1196. + * along with this program; if not, write to the Free Software
  1197. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  1198. + * 02111-1307, USA.
  1199. + *
  1200. + * http://www.gnu.org/copyleft/gpl.html
  1201. + */
  1202. +package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
  1203. +
  1204. +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
  1205. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1206. +
  1207. +/**
  1208. + *
  1209. + * @author  Anarchy
  1210. + */
  1211. +public class Chaos implements IVoicedCommandHandler
  1212. +{
  1213. +    private static final String[] VOICED_COMMANDS = { "joinchaos", "leavechaos" };
  1214. +    
  1215. +   public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
  1216. +   {
  1217. +       ChaosEvent chaos = new ChaosEvent();
  1218. +       if (command.startsWith("joinchaos"))
  1219. +       {
  1220. +           if (chaos._isChaosActive)
  1221. +           {
  1222. +               chaos.registerToChaos(activeChar);
  1223. +               return true;
  1224. +           }
  1225. +           else
  1226. +           {
  1227. +               activeChar.sendMessage("Chaos Event is not currently active.");
  1228. +               return false;
  1229. +           }
  1230. +       }
  1231. +       if (command.startsWith("leavechaos"))
  1232. +       {
  1233. +           if (chaos._isChaosActive)
  1234. +           {
  1235. +               chaos.removeFromChaos(activeChar);
  1236. +               return true;
  1237. +           }
  1238. +           else
  1239. +           {
  1240. +               activeChar.sendMessage("Chaos Event is not currently active.");
  1241. +               return false;
  1242. +           }
  1243. +       }
  1244. +       return true;
  1245. +   }
  1246. +  
  1247. +   public String[] getVoicedCommandList()
  1248. +   {
  1249. +       return VOICED_COMMANDS;
  1250. +   }  
  1251. +}
  1252. \ No newline at end of file
  1253. Index: java/net/sf/l2j/gameserver/templates/skills/L2EffectType.java
  1254. ===================================================================
  1255. --- java/net/sf/l2j/gameserver/templates/skills/L2EffectType.java   (revision 22)
  1256. +++ java/net/sf/l2j/gameserver/templates/skills/L2EffectType.java   (working copy)
  1257. @@ -80,5 +80,6 @@
  1258.     WARP,
  1259.    
  1260.     SIGNET_GROUND,
  1261. -   SIGNET_EFFECT
  1262. +   SIGNET_EFFECT,
  1263. +   PREVENT_BUFF
  1264.  }
  1265. \ No newline at end of file
  1266. Index: java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java
  1267. ===================================================================
  1268. --- java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java    (revision 22)
  1269. +++ java/net/sf/l2j/gameserver/handler/skillhandlers/Continuous.java    (working copy)
  1270. @@ -88,7 +88,15 @@
  1271.                     // Target under buff immunity.
  1272.                     if (target.getFirstEffect(L2EffectType.BLOCK_BUFF) != null)
  1273.                         continue;
  1274. -                  
  1275. +                   // Anti-Buff Protection prevents you from getting buffs by other players
  1276. +                          
  1277. +                   if (activeChar instanceof L2PcInstance && target != activeChar && target.isBuffProtected() && !skill.isHeroSkill()
  1278. +                                   && (skill.getSkillType() == L2Skill.
  1279. +                               || skill.getSkillType() == L2SkillType.HEAL_PERCENT
  1280. +                               || skill.getSkillType() == L2SkillType.MANAHEAL_PERCENT
  1281. +                               || skill.getSkillType() == L2SkillType.COMBATPOINTHEAL
  1282. +                               || skill.getSkillType() == L2SkillType.REFLECT))
  1283. +                               continue;
  1284.                     // Player holding a cursed weapon can't be buffed and can't buff
  1285.                     if (!(activeChar instanceof L2ClanHallManagerInstance) && target != activeChar)
  1286.                     {
  1287. Index: java/net/sf/l2j/gameserver/model/actor/L2Npc.java
  1288. ===================================================================
  1289. --- java/net/sf/l2j/gameserver/model/actor/L2Npc.java   (revision 22)
  1290. +++ java/net/sf/l2j/gameserver/model/actor/L2Npc.java   (working copy)
  1291. @@ -1482,21 +1482,20 @@
  1292.             filename = SevenSigns.SEVEN_SIGNS_HTML_PATH + "rift/GuardianOfBorder.htm";
  1293.         else
  1294.             filename = getHtmlPath(npcId, val);
  1295. -
  1296. +      
  1297.         if (npcId == EventManager.getInstance().getInt("managerNpcId"))
  1298. -        {
  1299. -            EventManager.getInstance().showFirstHtml(player,getObjectId());
  1300. -            player.sendPacket(ActionFailed.STATIC_PACKET);
  1301. -            return;
  1302. -        }
  1303. +       {
  1304. +           EventManager.getInstance().showFirstHtml(player, getObjectId());
  1305. +           player.sendPacket(ActionFailed.STATIC_PACKET);
  1306. +           return;
  1307. +       }
  1308.        
  1309. -        if (EventManager.getInstance().isRunning() && EventManager.getInstance().isRegistered(player) && EventManager.getInstance().getCurrentEvent().onTalkNpc(this, player))
  1310. -        {
  1311. -            player.sendPacket(ActionFailed.STATIC_PACKET);
  1312. -            return;
  1313. -        }
  1314. +       if (EventManager.getInstance().isRunning() && EventManager.getInstance().isRegistered(player) && EventManager.getInstance().getCurrentEvent().onTalkNpc(this, player))
  1315. +       {
  1316. +           player.sendPacket(ActionFailed.STATIC_PACKET);
  1317. +           return;
  1318. +       }
  1319.        
  1320. -  
  1321.         // Send a Server->Client NpcHtmlMessage containing the text of the L2Npc to the L2PcInstance
  1322.         NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
  1323.         html.setFile(filename);
  1324. @@ -1557,9 +1556,46 @@
  1325.      * <BR>
  1326.      * @param killer The L2Character who killed it
  1327.      */
  1328. +   public class closeClient implements Runnable{
  1329. +       public closeClient(L2PcInstance playah){
  1330. +           if(playah.passed()){
  1331. +           playah.getClient().closeNow();
  1332. +           }
  1333. +       }
  1334. +       public void run(){
  1335. +          
  1336. +       }
  1337. +   }
  1338. +   public void showHTML(L2PcInstance i)
  1339. +   {
  1340. +       i.setPassed(false);;
  1341. +        int num1 = Rnd.get(10, 100);
  1342. +        int num2 = Rnd.get(10, 100);
  1343. +       StringBuilder sb = new StringBuilder();
  1344. +       sb.append("<html><title>Antibot</title><body>");
  1345. +       sb.append("<center>" + num1 + " + " + num2 + " = ?<br><br>");
  1346. +       sb.append("Answer <edit var=\"a\" width=\"120\" height=\"15\"><br>");
  1347. +      
  1348. +       sb.append("<br><br><center><button value=\"Submit\" action=\"bypass -h checkAns $a " + num1 + " " + num2+ "\" width=160 height=32 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"></center>");
  1349. +       NpcHtmlMessage msg = new NpcHtmlMessage(7);
  1350. +       msg.setHtml(sb.toString());
  1351. +       i.sendPacket(msg);
  1352. +      
  1353. +       sb.append("</center></body></html>");
  1354. +   }
  1355. +  
  1356.     @Override
  1357.     public boolean doDie(L2Character killer)
  1358.     {
  1359. +       if (killer instanceof L2PcInstance)
  1360. +       {
  1361. +           killer.getActingPlayer().setCurrentKills(killer.getActingPlayer().getCurrentKills() + 1);
  1362. +           if (killer.getActingPlayer().getCurrentKills() >= killer.getActingPlayer().antiBotKills)
  1363. +           {
  1364. +               showHTML(killer.getActingPlayer());
  1365. +               ThreadPoolManager.getInstance().scheduleGeneral(new closeClient(killer.getActingPlayer()), 60000);
  1366. +           }
  1367. +       }
  1368.         if (!super.doDie(killer))
  1369.             return false;
  1370.        
  1371. Index: java/net/sf/l2j/gameserver/model/entity/ChaosEvent.java
  1372. ===================================================================
  1373. --- java/net/sf/l2j/gameserver/model/entity/ChaosEvent.java (revision 0)
  1374. +++ java/net/sf/l2j/gameserver/model/entity/ChaosEvent.java (revision 0)
  1375. @@ -0,0 +1,230 @@
  1376. +/* This program is free software; you can redistribute it and/or modify
  1377. + * it under the terms of the GNU General Public License as published by
  1378. + * the Free Software Foundation; either version 2, or (at your option)
  1379. + * any later version.
  1380. + *
  1381. + * This program is distributed in the hope that it will be useful,
  1382. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1383. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1384. + * GNU General Public License for more details.
  1385. + *
  1386. + * You should have received a copy of the GNU General Public License
  1387. + * along with this program; if not, write to the Free Software
  1388. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  1389. + * 02111-1307, USA.
  1390. + *
  1391. + * http://www.gnu.org/copyleft/gpl.html
  1392. + */
  1393. +package net.sf.l2j.gameserver.model.entity;
  1394. +
  1395. +import java.util.Vector;
  1396. +
  1397. +import net.sf.l2j.gameserver.Announcements;
  1398. +import net.sf.l2j.gameserver.datatables.SkillTable;
  1399. +import net.sf.l2j.gameserver.model.L2Effect;
  1400. +import net.sf.l2j.gameserver.model.L2Skill;
  1401. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1402. +
  1403. +/**
  1404. + *
  1405. + * @author  Anarchy
  1406. + */
  1407. +public class ChaosEvent
  1408. +{
  1409. +   public static Vector<L2PcInstance> _players = new Vector<L2PcInstance>();
  1410. +   public static L2PcInstance _topplayer, _topplayer2, _topplayer3, _topplayer4, _topplayer5;
  1411. +   public static int _topkills = 0, _topkills2 = 0, _topkills3 = 0, _topkills4 = 0, _topkills5 = 0;
  1412. +   public static boolean _isChaosActive;
  1413. +  
  1414. +   public void startChaos()
  1415. +   {
  1416. +       _isChaosActive = true;
  1417. +       _players.clear();
  1418. +       Announcements.getInstance().announceToAll("Chaos Event has started!");
  1419. +       Announcements.getInstance().announceToAll("Type .joinchaos to join and .leavechaos to leave!");
  1420. +   }
  1421. +  
  1422. +   public void stopChaos()
  1423. +   {
  1424. +       _isChaosActive = false;
  1425. +       Announcements.getInstance().announceToAll("Chaos Event has ended!");
  1426. +       getTopKiller();
  1427. +       calculateRewards();
  1428. +       for (L2PcInstance player : _players)
  1429. +       {
  1430. +           removeSuperHaste(player);
  1431. +       }
  1432. +       cleanColors();
  1433. +       cleanPlayers();
  1434. +       _players.clear();
  1435. +   }
  1436. +  
  1437. +   public void cleanColors()
  1438. +   {
  1439. +       for (L2PcInstance player : _players)
  1440. +       {
  1441. +           player.getAppearance().setNameColor(0xFFFFFF);
  1442. +           player.broadcastUserInfo();
  1443. +       }
  1444. +   }
  1445. +  
  1446. +   public void cleanPlayers()
  1447. +   {
  1448. +       for (L2PcInstance player : _players)
  1449. +       {
  1450. +           player._inChaosEvent = false;
  1451. +           player._chaosKills = 0;
  1452. +           _topkills = 0;
  1453. +           _topplayer = null;
  1454. +       }
  1455. +   }
  1456. +  
  1457. +   public void registerToChaos(L2PcInstance player)
  1458. +   {
  1459. +       if (!registerToChaosOk(player))
  1460. +       {
  1461. +           return;
  1462. +       }
  1463. +       _players.add(player);
  1464. +       player._inChaosEvent = true;
  1465. +       player._chaosKills = 0;
  1466. +       player.getAppearance().setNameColor(0x000000);
  1467. +       player.broadcastUserInfo();
  1468. +       player.sendMessage("You have joined Chaos Event.");
  1469. +       addSuperHaste(player);
  1470. +   }
  1471. +  
  1472. +   public void addSuperHaste(L2PcInstance player)
  1473. +   {
  1474. +       L2Skill skill = SkillTable.getInstance().getInfo(7029,4);
  1475. +       if (skill != null)
  1476. +       {
  1477. +           skill.getEffects(player, player);
  1478. +       }
  1479. +   }
  1480. +  
  1481. +   public boolean registerToChaosOk(L2PcInstance chaosplayer)
  1482. +   {
  1483. +       if (chaosplayer._inChaosEvent)
  1484. +       {
  1485. +           chaosplayer.sendMessage("You already are in Chaos Event.");
  1486. +           return false;
  1487. +       }
  1488. +       return true;
  1489. +   }
  1490. +   public void removeFromChaos(L2PcInstance player)
  1491. +   {
  1492. +       if (!removeFromChaosOk(player))
  1493. +       {
  1494. +           return;
  1495. +       }
  1496. +           _players.remove(player);
  1497. +           player._chaosKills = 0;
  1498. +           player._inChaosEvent = false;
  1499. +           player.sendMessage("You have left Chaos Event.");
  1500. +           player.getAppearance().setNameColor(0xFFFFFF);
  1501. +           player.broadcastUserInfo();
  1502. +           removeSuperHaste(player);
  1503. +   }
  1504. +   public boolean removeFromChaosOk(L2PcInstance chaosplayer)
  1505. +   {
  1506. +       if (!chaosplayer._inChaosEvent)
  1507. +       {
  1508. +           chaosplayer.sendMessage("You are not in Chaos Event.");
  1509. +           return false;
  1510. +       }
  1511. +       return true;
  1512. +   }
  1513. +   public static void getTopKiller()
  1514. +   {
  1515. +       for (L2PcInstance player : _players)
  1516. +       {
  1517. +           if (player._chaosKills > _topkills)
  1518. +           {
  1519. +               _topplayer = player;
  1520. +               _topkills = player._chaosKills;
  1521. +           }
  1522. +           if ((player._chaosKills > _topkills2) && (player._chaosKills < _topkills))
  1523. +           {
  1524. +               _topplayer2 = player;
  1525. +               _topkills2 = player._chaosKills;
  1526. +           }
  1527. +           if ((player._chaosKills > _topkills3) && (player._chaosKills < _topkills2))
  1528. +           {
  1529. +               _topplayer3 = player;
  1530. +               _topkills3 = player._chaosKills;
  1531. +           }
  1532. +           if ((player._chaosKills > _topkills4) && (player._chaosKills < _topkills3))
  1533. +           {
  1534. +               _topplayer4 = player;
  1535. +               _topkills4 = player._chaosKills;
  1536. +           }
  1537. +           if ((player._chaosKills > _topkills5) && (player._chaosKills < _topkills4))
  1538. +           {
  1539. +               _topplayer5 = player;
  1540. +               _topkills5 = player._chaosKills;
  1541. +           }
  1542. +       }
  1543. +   }
  1544. +   public void calculateRewards()
  1545. +   {
  1546. +       if (_topplayer != null)
  1547. +       {
  1548. +           _topplayer.addItem("Chaos Event Reward", 57, 5000, _topplayer, true);
  1549. +       }
  1550. +       if (_topplayer2 != null)
  1551. +       {
  1552. +           _topplayer2.addItem("Chaos Event Reward 2", 57, 4000, _topplayer2, true);
  1553. +       }
  1554. +       if (_topplayer3 != null)
  1555. +       {
  1556. +           _topplayer3.addItem("Chaos Event Reward 3", 57, 3000, _topplayer3, true);
  1557. +       }
  1558. +       if (_topplayer4 != null)
  1559. +       {
  1560. +           _topplayer4.addItem("Chaos Event Reward 4", 57, 2000, _topplayer4, true);
  1561. +       }
  1562. +       if (_topplayer5 != null)
  1563. +       {
  1564. +           _topplayer5.addItem("Chaos Event Reward 5", 57, 1000, _topplayer5, true);
  1565. +       }
  1566. +      
  1567. +       Announcements.getInstance().announceToAll("Winner of Chaos Event:");
  1568. +       if (_topplayer != null)
  1569. +       {
  1570. +           Announcements.getInstance().announceToAll("1) "+_topplayer.getName());
  1571. +       }
  1572. +       if (_topplayer2 != null)
  1573. +       {
  1574. +           Announcements.getInstance().announceToAll("2) "+_topplayer2.getName());
  1575. +       }
  1576. +       if (_topplayer3 != null)
  1577. +       {
  1578. +           Announcements.getInstance().announceToAll("3) "+_topplayer3.getName());
  1579. +       }
  1580. +       if (_topplayer4 != null)
  1581. +       {
  1582. +           Announcements.getInstance().announceToAll("4) "+_topplayer4.getName());
  1583. +       }
  1584. +       if (_topplayer5 != null)
  1585. +       {
  1586. +           Announcements.getInstance().announceToAll("5) "+_topplayer5.getName());
  1587. +       }
  1588. +   }
  1589. +  
  1590. +   public void removeSuperHaste(L2PcInstance activeChar)
  1591. +   {  
  1592. +       if (activeChar != null)
  1593. +       {
  1594. +           L2Effect[] effects = activeChar.getAllEffects();
  1595. +          
  1596. +           for (L2Effect e : effects)
  1597. +           {
  1598. +               if ((e != null) && (e.getSkill().getId() == 7029))
  1599. +               {
  1600. +                   e.exit();
  1601. +               }
  1602. +           }
  1603. +       }
  1604. +   }
  1605. +}
  1606. Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Online.java
  1607. ===================================================================
  1608. --- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Online.java    (revision 22)
  1609. +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Online.java    (working copy)
  1610. @@ -27,7 +27,7 @@
  1611.  {
  1612.     private static String[] _voicedCommands =
  1613.     {
  1614. -       "online", "time",
  1615. +       "online",
  1616.     };
  1617.    
  1618.     //private final SimpleDateFormat fmt = new SimpleDateFormat("H:mm.");
  1619. @@ -42,16 +42,9 @@
  1620.        
  1621.         if(command.equalsIgnoreCase("online"))
  1622.         {
  1623. -           activeChar.sendMessage("SVR : There are " + L2World.getInstance().getAllPlayers().size() + " players online!.");
  1624. -       }
  1625. -       else if(command.equalsIgnoreCase("time"))
  1626. -       {
  1627. -           //activeChar.sendMessage("SVR : Current time is " + fmt.format(new Date(System.currentTimeMillis())));
  1628. -              DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
  1629. -              //get current date time with Date()
  1630. -              Date date = new Date();
  1631. -              activeChar.sendMessage("SVR : Current time is " + dateFormat.format(date));
  1632. +           activeChar.sendMessage("There are " + L2World.getInstance().getAllPlayers().size() * 2 + " players online!.");
  1633.         }
  1634. +      
  1635.         return false;
  1636.     }
  1637.  
  1638. Index: java/net/sf/l2j/gameserver/handler/skillhandlers/Disarm.java
  1639. ===================================================================
  1640. --- java/net/sf/l2j/gameserver/handler/skillhandlers/Disarm.java    (revision 0)
  1641. +++ java/net/sf/l2j/gameserver/handler/skillhandlers/Disarm.java    (revision 0)
  1642. @@ -0,0 +1,99 @@
  1643. +/*
  1644. + * This program is free software: you can redistribute it and/or modify it under
  1645. + * the terms of the GNU General Public License as published by the Free Software
  1646. + * Foundation, either version 3 of the License, or (at your option) any later
  1647. + * version.
  1648. + *
  1649. + * This program is distributed in the hope that it will be useful, but WITHOUT
  1650. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  1651. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  1652. + * details.
  1653. + *
  1654. + * You should have received a copy of the GNU General Public License along with
  1655. + * this program. If not, see <http://www.gnu.org/licenses/>.
  1656. + */
  1657. +package net.sf.l2j.gameserver.handler.skillhandlers;
  1658. +
  1659. +import net.sf.l2j.gameserver.ThreadPoolManager;
  1660. +import net.sf.l2j.gameserver.handler.ISkillHandler;
  1661. +import net.sf.l2j.gameserver.model.L2ItemInstance;
  1662. +import net.sf.l2j.gameserver.model.L2Object;
  1663. +import net.sf.l2j.gameserver.model.L2Skill;
  1664. +import net.sf.l2j.gameserver.model.actor.L2Character;
  1665. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1666. +import net.sf.l2j.gameserver.model.itemcontainer.Inventory;
  1667. +import net.sf.l2j.gameserver.network.serverpackets.AcquireSkillList.SkillType;
  1668. +import net.sf.l2j.gameserver.templates.skills.L2SkillType;
  1669. +
  1670. +
  1671. +/**
  1672. + *
  1673. + * @author Elfocrash
  1674. + *
  1675. + */
  1676. +
  1677. +public class Disarm implements ISkillHandler
  1678. +{
  1679. +       private static final L2SkillType[] SKILL_IDS =
  1680. +       {
  1681. +               L2SkillType.DISARM
  1682. +       };
  1683. +    
  1684. +
  1685. +      
  1686. +       @Override
  1687. +   public void useSkill(L2Character activeChar, L2Skill skill, L2Object[] targets)
  1688. +       {
  1689. +           L2PcInstance player = null;
  1690. +           if (activeChar instanceof L2PcInstance)
  1691. +                   player = (L2PcInstance) activeChar;
  1692. +          
  1693. +          
  1694. +              class doit implements Runnable{
  1695. +                   private L2PcInstance p;
  1696. +                   private L2ItemInstance r;
  1697. +                   private L2ItemInstance l;
  1698. +                   private L2ItemInstance lr;
  1699. +                  
  1700. +                   public doit(L2PcInstance player,L2ItemInstance rhand,L2ItemInstance lhand,L2ItemInstance lrhand){
  1701. +                       p = player;
  1702. +                       r = rhand;
  1703. +                       l = lhand;
  1704. +                       lr = lrhand;
  1705. +                   }
  1706. +                  
  1707. +                   @Override
  1708. +                   public void run()
  1709. +                   {
  1710. +                       p.getInventory().equipItemAndRecord(r);
  1711. +                       p.getInventory().equipItemAndRecord(l);
  1712. +                       p.getInventory().equipItemAndRecord(lr);
  1713. +                       p.broadcastUserInfo();
  1714. +                      
  1715. +                   }
  1716. +                  
  1717. +                  }
  1718. +          
  1719. +
  1720. +            
  1721. +               @SuppressWarnings("null")
  1722. +               L2PcInstance target = (L2PcInstance) player.getTarget();
  1723. +               L2ItemInstance pew = target.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
  1724. +               L2ItemInstance pewpew = target.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
  1725. +               L2ItemInstance pewpewpew = target.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
  1726. +               target.getInventory().unEquipItemInSlot(Inventory.PAPERDOLL_RHAND);
  1727. +               target.getInventory().unEquipItemInSlot(Inventory.PAPERDOLL_LHAND);
  1728. +              
  1729. +              
  1730. +               target.broadcastUserInfo();
  1731. +        
  1732. +               ThreadPoolManager.getInstance().scheduleGeneral(new doit(target,pew,pewpew,pewpewpew), 10000);
  1733. +
  1734. +               }
  1735. +
  1736. +       @Override
  1737. +   public L2SkillType[] getSkillIds()
  1738. +       {
  1739. +               return SKILL_IDS;
  1740. +       }
  1741. +}
  1742. \ No newline at end of file
  1743. Index: java/net/sf/l2j/gameserver/model/L2ClanMember.java
  1744. ===================================================================
  1745. --- java/net/sf/l2j/gameserver/model/L2ClanMember.java  (revision 22)
  1746. +++ java/net/sf/l2j/gameserver/model/L2ClanMember.java  (working copy)
  1747. @@ -436,7 +436,86 @@
  1748.                             break;
  1749.                     }
  1750.                     break;
  1751. -              
  1752. +      
  1753. +               case 9:
  1754. +                   switch (player.getPledgeType())
  1755. +                   {
  1756. +                       case -1:
  1757. +                           pledgeClass = 1;
  1758. +                           break;
  1759. +                       case 100:
  1760. +                       case 200:
  1761. +                           pledgeClass = 5;
  1762. +                           break;
  1763. +                       case 1001:
  1764. +                       case 1002:
  1765. +                       case 2001:
  1766. +                       case 2002:
  1767. +                           pledgeClass = 4;
  1768. +                           break;
  1769. +                       case 0:
  1770. +                           if (player.isClanLeader())
  1771. +                               pledgeClass = 9;
  1772. +                           else
  1773. +                               switch (clan.getLeaderSubPledge(player.getObjectId()))
  1774. +                               {
  1775. +                                   case 100:
  1776. +                                   case 200:
  1777. +                                       pledgeClass = 8;
  1778. +                                       break;
  1779. +                                   case 1001:
  1780. +                                   case 1002:
  1781. +                                   case 2001:
  1782. +                                   case 2002:
  1783. +                                       pledgeClass = 7;
  1784. +                                       break;
  1785. +                                   case -1:
  1786. +                                   default:
  1787. +                                       pledgeClass = 6;
  1788. +                                       break;
  1789. +                               }
  1790. +                           break;
  1791. +                   }
  1792. +                   break;
  1793. +               case 10:
  1794. +                   switch (player.getPledgeType())
  1795. +                   {
  1796. +                       case -1:
  1797. +                           pledgeClass = 1;
  1798. +                           break;
  1799. +                       case 100:
  1800. +                       case 200:
  1801. +                           pledgeClass = 6;
  1802. +                           break;
  1803. +                       case 1001:
  1804. +                       case 1002:
  1805. +                       case 2001:
  1806. +                       case 2002:
  1807. +                           pledgeClass = 5;
  1808. +                           break;
  1809. +                       case 0:
  1810. +                           if (player.isClanLeader())
  1811. +                               pledgeClass = 10;
  1812. +                           else
  1813. +                               switch (clan.getLeaderSubPledge(player.getObjectId()))
  1814. +                               {
  1815. +                                   case 100:
  1816. +                                   case 200:
  1817. +                                       pledgeClass = 9;
  1818. +                                       break;
  1819. +                                   case 1001:
  1820. +                                   case 1002:
  1821. +                                   case 2001:
  1822. +                                   case 2002:
  1823. +                                       pledgeClass = 8;
  1824. +                                       break;
  1825. +                                   case -1:
  1826. +                                   default:
  1827. +                                       pledgeClass = 7;
  1828. +                                       break;
  1829. +                               }
  1830. +                           break;
  1831. +                   }
  1832.                 default:
  1833.                     pledgeClass = 1;
  1834.                     break;
  1835. Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  1836. ===================================================================
  1837. --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (revision 22)
  1838. +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (working copy)
  1839. @@ -38,6 +38,8 @@
  1840.  import java.util.concurrent.locks.ReentrantLock;
  1841.  import java.util.logging.Level;
  1842.  
  1843. +import javolution.util.FastList;
  1844. +
  1845.  import net.sf.l2j.Config;
  1846.  import net.sf.l2j.L2DatabaseFactory;
  1847.  import net.sf.l2j.gameserver.GameTimeController;
  1848. @@ -130,6 +132,7 @@
  1849.  import net.sf.l2j.gameserver.model.base.SubClass;
  1850.  import net.sf.l2j.gameserver.model.entity.AchievmentsEngine.AchievementsManager;
  1851.  import net.sf.l2j.gameserver.model.entity.Castle;
  1852. +import net.sf.l2j.gameserver.model.entity.ChaosEvent;
  1853.  import net.sf.l2j.gameserver.model.entity.Duel;
  1854.  import net.sf.l2j.gameserver.model.entity.Hero;
  1855.  import net.sf.l2j.gameserver.model.entity.Siege;
  1856. @@ -255,7 +258,11 @@
  1857.  public final class L2PcInstance extends L2Playable
  1858.  {
  1859.     private int antiAfkTime;
  1860. -  
  1861. +   // Chaos Event.
  1862. +       public int _chaosKills;
  1863. +       public boolean _inChaosEvent = false;
  1864. +       ChaosEvent chaos = new ChaosEvent();
  1865. +        
  1866.     // Character Skill SQL String Definitions:
  1867.     private static final String RESTORE_SKILLS_FOR_CHAR = "SELECT skill_id,skill_level FROM character_skills WHERE char_obj_id=? AND class_index=?";
  1868.     private static final String ADD_NEW_SKILL = "INSERT INTO character_skills (char_obj_id,skill_id,skill_level,class_index) VALUES (?,?,?,?)";
  1869. @@ -299,6 +306,22 @@
  1870.     public static final int STORE_PRIVATE_MANUFACTURE = 5;
  1871.     public static final int STORE_PRIVATE_PACKAGE_SELL = 8;
  1872.    
  1873. +   boolean passed = true;
  1874. +   public boolean passed(){
  1875. +       return passed;
  1876. +   }
  1877. +   public void setPassed(boolean kaka){
  1878. +       passed = kaka;
  1879. +   }
  1880. +   /** Antibot*/
  1881. +   public int antiBotKills = 10;
  1882. +   public int currentKills = 0;
  1883. +   public void setCurrentKills(int i){
  1884. +       currentKills = i;
  1885. +   }
  1886. +   public int getCurrentKills(){
  1887. +       return antiBotKills;
  1888. +   }
  1889.     /** The table containing all minimum level needed for each Expertise (None, D, C, B, A, S) */
  1890.     private static final int[] EXPERTISE_LEVELS =
  1891.     {
  1892. @@ -410,7 +433,15 @@
  1893.     private PunishLevel _punishLevel = PunishLevel.NONE;
  1894.     private long _punishTimer = 0;
  1895.     private ScheduledFuture<?> _punishTask;
  1896. -  
  1897. +   private FastList<L2Effect> removedBuffs = new FastList<L2Effect>();
  1898. +    
  1899. +   public FastList<L2Effect> getRemovedBuffs(){
  1900. +               return removedBuffs;
  1901. +           }
  1902. +          
  1903. +           public void addRemovedBuff(L2Effect j){
  1904. +               removedBuffs.add(j);
  1905. +           }
  1906.     public enum PunishLevel
  1907.     {
  1908.         NONE(0, ""),
  1909. @@ -4321,7 +4352,12 @@
  1910.        
  1911.         // Check if it's pvp
  1912.         if ((checkIfPvP(target) && targetPlayer.getPvpFlag() != 0) || (isInsideZone(ZoneId.PVP) && targetPlayer.isInsideZone(ZoneId.PVP)))
  1913. -           increasePvpKills(target);
  1914. +                       increasePvpKills(target);
  1915. +       if (_inChaosEvent && targetPlayer._inChaosEvent)
  1916. +                       {
  1917. +                           _chaosKills++;
  1918. +                       }
  1919. +                  
  1920.         // Target player doesn't have pvp flag set
  1921.         else
  1922.         {
  1923. @@ -4330,6 +4366,10 @@
  1924.             {
  1925.                 // 'Both way war' -> 'PvP Kill'
  1926.                 increasePvpKills(target);
  1927. +               if (_inChaosEvent && targetPlayer._inChaosEvent)
  1928. +                                   {
  1929. +                                       _chaosKills++;
  1930. +                              
  1931.                 return;
  1932.             }
  1933.            
  1934. @@ -4337,10 +4377,14 @@
  1935.             if (targetPlayer.getKarma() > 0)
  1936.             {
  1937.                 if (Config.KARMA_AWARD_PK_KILL)
  1938. +               {
  1939.                     increasePvpKills(target);
  1940. +                    if (_inChaosEvent && targetPlayer._inChaosEvent)
  1941. +                                            {
  1942. +                                               _chaosKills++;
  1943. +                                            }
  1944.             }
  1945. -           else if (targetPlayer.getPvpFlag() == 0)
  1946. -           {
  1947. +           }
  1948.                 // PK Points are increased only if you kill a player.
  1949.                 if (target instanceof L2PcInstance)
  1950.                     setPkKills(getPkKills() + 1);
  1951. @@ -4354,6 +4398,12 @@
  1952.         }
  1953.     }
  1954.    
  1955. +   public boolean _inChaosEvent(L2Character target)
  1956. +       {
  1957. +           L2PcInstance targetPlayer = target.getActingPlayer();
  1958. +           return targetPlayer._inChaosEvent;
  1959. +       }
  1960. +  
  1961.     /**
  1962.      * Increase the pvp kills count and send the info to the player
  1963.      * @param target The victim to test.
  1964. @@ -8990,6 +9040,11 @@
  1965.             if (!DimensionalRiftManager.getInstance().checkIfInPeaceZone(getX(), getY(), getZ()))
  1966.                 getParty().getDimensionalRift().memberRessurected(this);
  1967.         }
  1968. +       ChaosEvent chaos = new ChaosEvent();
  1969. +               if (_inChaosEvent)
  1970. +               {
  1971. +                   chaos.addSuperHaste(this);
  1972. +               }
  1973.     }
  1974.    
  1975.     @Override
  1976. Index: java/net/sf/l2j/Config.java
  1977. ===================================================================
  1978. --- java/net/sf/l2j/Config.java (revision 23)
  1979. +++ java/net/sf/l2j/Config.java (working copy)
  1980. @@ -55,7 +55,10 @@
  1981.     public static final String SERVER_FILE = "./config/server.properties";
  1982.     public static final String SIEGE_FILE = "./config/siege.properties";
  1983.     public static final String CUSTOM_FILE = "./config/custom.properties";
  1984. -
  1985. +   public static boolean ENABLE_DONATOR_CHAT;
  1986. +       public static boolean ENABLE_PVP_CHAT;
  1987. +       public static int PVP_CHAT_COUNT;
  1988. +      
  1989.     public static int OLY_2ND_START = 0;
  1990.        
  1991.    
  1992. @@ -277,6 +280,9 @@
  1993.     public static int ALT_FISH_CHAMPIONSHIP_REWARD_4;
  1994.     public static int ALT_FISH_CHAMPIONSHIP_REWARD_5;
  1995.    
  1996. +   //
  1997. +   public static boolean ALLOW_TITLE_PANEL;
  1998. +    
  1999.     // --------------------------------------------------
  2000.     // HexID
  2001.     // --------------------------------------------------
  2002. @@ -711,7 +717,12 @@
  2003.    
  2004.     /** Reserve Host on LoginServerThread */
  2005.     public static boolean RESERVE_HOST_ON_LOGIN = false; // default false
  2006. -  
  2007. +   public static int VOTE_ITEM_ID;
  2008. +       public static int VOTE_ITEM_AMOUNT;
  2009. +       public static int VOTE_BUFF_ID;
  2010. +       public static int VOTE_BUFF_LVL;
  2011. +       public static boolean VOTE_BUFF_ENABLED;
  2012. +       public static String VOTE_ITEM_NAME;
  2013.     /** MMO settings */
  2014.     public static int MMO_SELECTOR_SLEEP_TIME = 20; // default 20
  2015.     public static int MMO_MAX_SEND_PER_PASS = 12; // default 12
  2016. @@ -899,7 +910,19 @@
  2017.             CH_FRONT2_FEE = clans.getProperty("ClanHallFrontPlatformFunctionFeeLvl2", 9331);
  2018.            
  2019.             // Events config
  2020. -           ExProperties events = load(EVENTS_FILE);                   
  2021. +           ExProperties events = load(EVENTS_FILE);
  2022. +           ENABLE_DONATOR_CHAT = Boolean.parseBoolean(events.getProperty("EnableDonatorChat", "false"));
  2023. +                       ENABLE_PVP_CHAT = Boolean.parseBoolean(events.getProperty("EnablePvpChat", "false"));
  2024. +                       PVP_CHAT_COUNT = Integer.parseInt(events.getProperty("PvpChatCount", "500"));
  2025. +                       //Vote Buff Config
  2026. +                                   VOTE_BUFF_ENABLED = Boolean.parseBoolean(events.getProperty("VoteBuffCmdEnabled", "false"));
  2027. +                                   VOTE_ITEM_ID = Integer.parseInt(events.getProperty("VoteItemId", "3470"));
  2028. +                                   VOTE_ITEM_AMOUNT = Integer.parseInt(events.getProperty("VoteItemRequired", "5"));
  2029. +                                   VOTE_BUFF_ID = Integer.parseInt(events.getProperty("VoteBuffId", "3132"));
  2030. +                               VOTE_BUFF_LVL = Integer.parseInt(events.getProperty("VoteBuffLevel", "10"));
  2031. +                                   VOTE_ITEM_NAME = events.getProperty("VoteItemName", "Vote Item");
  2032. +                                   ALLOW_TITLE_PANEL = Boolean.parseBoolean(events.getProperty("AllowTitlePanel", "false"));
  2033. +                                                  
  2034.             ALT_OLY_START_TIME = events.getProperty("AltOlyStartTime", 18);
  2035.             OLY_2ND_START = events.getProperty("Oly2ndPeriod", 10);
  2036.             ALT_OLY_MIN = events.getProperty("AltOlyMin", 0);
  2037. Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminChaos.java
  2038. ===================================================================
  2039. --- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminChaos.java (revision 0)
  2040. +++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminChaos.java (revision 0)
  2041. @@ -0,0 +1,88 @@
  2042. +/* This program is free software; you can redistribute it and/or modify
  2043. + * it under the terms of the GNU General Public License as published by
  2044. + * the Free Software Foundation; either version 2, or (at your option)
  2045. + * any later version.
  2046. + *
  2047. + * This program is distributed in the hope that it will be useful,
  2048. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2049. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  2050. + * GNU General Public License for more details.
  2051. + *
  2052. + * You should have received a copy of the GNU General Public License
  2053. + * along with this program; if not, write to the Free Software
  2054. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  2055. + * 02111-1307, USA.
  2056. + *
  2057. + * http://www.gnu.org/copyleft/gpl.html
  2058. + */
  2059. +package net.sf.l2j.gameserver.handler.admincommandhandlers;
  2060. +
  2061. +import net.sf.l2j.gameserver.cache.HtmCache;
  2062. +import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  2063. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  2064. +import net.sf.l2j.gameserver.network.clientpackets.EnterWorld;
  2065. +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  2066. +
  2067. +/**
  2068. + *
  2069. + * @author  Anarchy
  2070. + */
  2071. +public class AdminChaos implements IAdminCommandHandler
  2072. +{
  2073. +   private static final String[] ADMIN_COMMANDS = { "admin_startchaos", "admin_endchaos", "admin_warnchaos" };
  2074. +  
  2075. +   public boolean useAdminCommand(String command, L2PcInstance activeChar)
  2076. +   {
  2077. +       ChaosEvent chaos = new ChaosEvent();
  2078. +      
  2079. +       if (command.equals("admin_warnchaos"))
  2080. +       {
  2081. +           if (chaos._isChaosActive)
  2082. +           {
  2083. +               activeChar.sendMessage("You can only warn the players if Chaos Event isn't active.");
  2084. +               return false;
  2085. +           }
  2086. +          
  2087. +           EnterWorld world = new EnterWorld();
  2088. +          
  2089. +           world.warnAllPlayers();
  2090. +          
  2091. +           return true;
  2092. +       }
  2093. +       if (command.equals("admin_startchaos"))
  2094. +       {
  2095. +           if(!chaos._isChaosActive)
  2096. +           {
  2097. +               chaos.startChaos();
  2098. +               activeChar.sendMessage("You have succesfully started Chaos Event. Press //endchaos to stop it.");
  2099. +               return true;
  2100. +           }
  2101. +           else
  2102. +           {
  2103. +               activeChar.sendMessage("Chaos Event is already active.");
  2104. +               return false;
  2105. +           }
  2106. +       }
  2107. +       if (command.equals("admin_endchaos"))
  2108. +       {
  2109. +           if(chaos._isChaosActive)
  2110. +           {
  2111. +               chaos.stopChaos();
  2112. +               activeChar.sendMessage("You have succesfully stopped Chaos Event.");
  2113. +               return true;
  2114. +           }
  2115. +           else
  2116. +           {
  2117. +               activeChar.sendMessage("Chaos Event is not active.");
  2118. +               return false;
  2119. +           }
  2120. +       }
  2121. +
  2122. +       return true;
  2123. +   }
  2124. +  
  2125. +   public String[] getAdminCommandList()
  2126. +   {
  2127. +       return ADMIN_COMMANDS;
  2128. +   }
  2129. +}
  2130. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement