JAVA 254
Party Event Guest on 3rd March 2021 07:34:57 PM
  1. diff --git a/aCis/config/events.properties b/aCis/config/events.properties
  2. index fa6fd85..75c9cab 100644
  3. --- a/aCis/config/events.properties
  4. +++ b/aCis/config/events.properties
  5. @@ -1,4 +1,38 @@
  6.  #=============================================================
  7. +#                          Party Farm Event
  8. +#=============================================================
  9. +
  10. +# Enable Zone Party Farm.
  11. +PartyFarmEnable = True
  12. +
  13. +# Times Party Farm will occur (24h format). Example : 18:00;19:00;20:00
  14. +PartyFarmTime = 16:03
  15. +
  16. +# Running Party Zone Farm.
  17. +PartyFarmRunningTime = 3
  18. +
  19. +# Party Farm Monster Id and Spawn monsters. Configure spawn locX,locY,locZ;locX,locY,locZ;
  20. +PartyFarmMonsterId = 50004
  21. +PartyFarmMonsterLoc = 81304,-14904,-1824;\
  22. +81464,-14856,-1824;\
  23. +81704,-14524,-1824;\
  24. +82184,-15224,-1856;\
  25. +82648,-15432,-1880;\
  26. +83155,-15336,-1856;\
  27. +83532,-15276,-1826;\
  28. +85222,-16135,-1824;\
  29. +84808,-15864,-1824;\
  30. +84632,-16088,-1824;\
  31. +84424,-15720,-1824;\
  32. +84088,-15528,-1824;\
  33. +83624,-15272,-1824;\
  34. +83480,-15016,-1824;\
  35. +83099,-14955,-1824;\
  36. +82680,-15000,-1832;\
  37. +82376,-15112,-1856;\
  38. +81992,-15208,-1840;\
  39. +
  40. +#=============================================================
  41.  #                          Olympiad
  42.  #=============================================================
  43.  # Olympiad start time hour, default 18 (6PM).
  44. diff --git a/aCis/data/xml/teleports.xml b/aCis/data/xml/teleports.xml
  45. index 0b69d05..aa3163c 100644
  46. --- a/aCis/data/xml/teleports.xml
  47. +++ b/aCis/data/xml/teleports.xml
  48. @@ -85,7 +85,8 @@
  49.                 <loc desc="The Heart of Antharas' Lair" type="NOBLE_HUNTING_ZONE_ADENA" priceId="57" priceCount="1000" x="154396" y="121235" z="-3808" />
  50.                 <loc desc="The Center of Dragon Valley" type="NOBLE_HUNTING_ZONE_ADENA" priceId="57" priceCount="1000" x="122824" y="110836" z="-3727" />
  51.                 <loc desc="Hardin's Private Academy" type="NOBLE_HUNTING_ZONE_ADENA" priceId="57" priceCount="1000" x="105918" y="109759" z="-3170" />
  52. -               <loc desc="Coliseum" type="NOBLE_HUNTING_ZONE_ADENA" priceId="57" priceCount="1000" x="146440" y="46723" z="-3400" />
  53. +               <loc desc="Coliseum" type="NOBLE_HUNTING_ZONE_ADENA" priceId="57" priceCount="1000" x="146440" y="46723" z="-3400" />  
  54. +               <loc desc="Party Zone" type="STANDARD" priceId="57" priceCount="10000" x="81096" y="-15437" z="-1800" isParty="true"/>
  55.         </telPosList>
  56.         <telPosList npcId="30134">
  57.                 <loc desc="The Town of Gludio" type="STANDARD" priceId="57" priceCount="10000" x="-12694" y="122776" z="-3114" castleId="1" />
  58. diff --git a/aCis/data/xml/zones/PartyZone.xml b/aCis/data/xml/zones/PartyZone.xml
  59. new file mode 100644
  60. index 0000000..3a899a1
  61. --- /dev/null
  62. +++ b/aCis/data/xml/zones/PartyZone.xml
  63. @@ -0,0 +1,13 @@
  64. +<?xml version="1.0" encoding="UTF-8"?>
  65. +<list>
  66. +       <zone id="1" shape="NPoly" minZ="-2920" maxZ="80"><!-- bandits_stronghold -->
  67. +               <stat name="reviveDelay" val="5" />
  68. +               <stat name="isFlag" val="false" />
  69. +               <node x="79028" y="-17588" />
  70. +               <node x="84640" y="-19528" />
  71. +               <node x="86952" y="-16888" />
  72. +               <node x="83636" y="-13448" />
  73. +               <node x="79196" y="-13584" />
  74. +               <spawn type="NORMAL" x="81096" y="-15437" z="-1800"/>
  75. +       </zone>
  76. +</list>
  77. \ No newline at end of file
  78. diff --git a/aCis/java/net/sf/l2j/Config.java b/aCis/java/net/sf/l2j/Config.java
  79. index cfaa253..3a5f558 100644
  80. --- a/aCis/java/net/sf/l2j/Config.java
  81. +++ b/aCis/java/net/sf/l2j/Config.java
  82. @@ -123,6 +123,13 @@
  83.         // --------------------------------------------------
  84.         // Events settings
  85.         // --------------------------------------------------
  86. +
  87. +       /** Pasrty Zone*/
  88. +       public static boolean PARTY_ZONE_ENABLE;
  89. +       public static String[] PARTY_ZONE_TIME;
  90. +       public static int PARTY_ZONE_RUNNING_TIME;
  91. +       public static List<Location> PARTY_ZONE_LOCS = new ArrayList<>();
  92. +       public static int PARTY_MONSTER_ID;
  93.        
  94.         /** Olympiad */
  95.         public static int OLY_START_TIME;
  96. @@ -916,15 +924,15 @@
  97.         {
  98.                 final ExProperties events = initProperties(EVENTS_FILE);
  99.                
  100. +               PARTY_ZONE_ENABLE = events.getProperty("PartyFarmEnable", false);
  101. +               PARTY_ZONE_TIME = events.getProperty("PartyFarmTime", "15:50").split(";");
  102. +               PARTY_ZONE_RUNNING_TIME = events.getProperty("PartyFarmRunningTime", 5);
  103. +               PARTY_MONSTER_ID = events.getProperty("PartyFarmMonsterId", 5);
  104. +               for (String value : events.getProperty("PartyFarmMonsterLoc", "0,0,0").split(";"))
  105. +               {
  106. +                       String[] ss = value.split(",");
  107. +                       PARTY_ZONE_LOCS.add(new Location(Integer.parseInt(ss[0]), Integer.parseInt(ss[1]), Integer.parseInt(ss[2])));
  108. +               }
  109.                
  110.                 OLY_START_TIME = events.getProperty("OlyStartTime", 18);
  111.                 OLY_MIN = events.getProperty("OlyMin", 0);
  112. diff --git a/aCis/java/net/sf/l2j/gameserver/GameServer.java b/aCis/java/net/sf/l2j/gameserver/GameServer.java
  113. index 5a897a1..3cabaac 100644
  114. --- a/aCis/java/net/sf/l2j/gameserver/GameServer.java
  115. +++ b/aCis/java/net/sf/l2j/gameserver/GameServer.java
  116. @@ -100,6 +100,7 @@
  117.  import net.sf.l2j.gameserver.model.boat.BoatInnadrilTour;
  118.  import net.sf.l2j.gameserver.model.boat.BoatRunePrimeval;
  119.  import net.sf.l2j.gameserver.model.boat.BoatTalkingGludin;
  120. +import net.sf.l2j.gameserver.model.entity.PartyEvent;
  121.  import net.sf.l2j.gameserver.model.entity.engine.EventManager;
  122.  import net.sf.l2j.gameserver.model.olympiad.Olympiad;
  123.  import net.sf.l2j.gameserver.model.olympiad.OlympiadGameManager;
  124. @@ -316,6 +317,7 @@
  125.                 StringUtil.printSection("Events");
  126.                 DerbyTrackManager.getInstance();
  127.                 LotteryManager.getInstance();
  128. +               PartyEvent.getInstance();
  129.                 EventManager.getInstance();
  130.                 TournamentManager.getInstance();
  131.                
  132. diff --git a/aCis/java/net/sf/l2j/gameserver/enums/ZoneId.java b/aCis/java/net/sf/l2j/gameserver/enums/ZoneId.java
  133. index fa282c1..03b7164 100644
  134. --- a/aCis/java/net/sf/l2j/gameserver/enums/ZoneId.java
  135. +++ b/aCis/java/net/sf/l2j/gameserver/enums/ZoneId.java
  136. @@ -22,7 +22,8 @@
  137.         NO_RESTART(17),
  138.         SCRIPT(18),
  139.         BOSS(19),
  140. -       MULTI(20);
  141. +       MULTI(20),
  142. +       PARTY(21);
  143.        
  144.         private final int _id;
  145.        
  146. diff --git a/aCis/java/net/sf/l2j/gameserver/model/actor/Npc.java b/aCis/java/net/sf/l2j/gameserver/model/actor/Npc.java
  147. index 4e1c12a..d9ffae4 100644
  148. --- a/aCis/java/net/sf/l2j/gameserver/model/actor/Npc.java
  149. +++ b/aCis/java/net/sf/l2j/gameserver/model/actor/Npc.java
  150. @@ -940,7 +940,14 @@
  151.                                 return;
  152.                         }
  153.                 }
  154. -
  155. +              
  156. +               // The list is for party, but player isn't party.
  157. +               if (teleport.isParty() && !player.isInParty())
  158. +               {
  159. +                       player.sendMessage("You are not currently on party.");
  160. +                       return;
  161. +               }
  162. +                                      
  163.                 if (Config.FREE_TELEPORT || teleport.getPriceCount() == 0 || player.destroyItemByItemId("InstantTeleport", teleport.getPriceId(), Config.VIP_REDUCE_PRICE > 0 && (player.isVip()) ? teleport.getPriceCount() / Config.VIP_REDUCE_PRICE : teleport.getPriceCount(), this, true))
  164.                         player.teleportTo(teleport, 20);
  165.                
  166. diff --git a/aCis/java/net/sf/l2j/gameserver/model/actor/Playable.java b/aCis/java/net/sf/l2j/gameserver/model/actor/Playable.java
  167. index f34a91e..c706707 100644
  168. --- a/aCis/java/net/sf/l2j/gameserver/model/actor/Playable.java
  169. +++ b/aCis/java/net/sf/l2j/gameserver/model/actor/Playable.java
  170. @@ -27,6 +27,7 @@
  171.  import net.sf.l2j.gameserver.model.item.kind.EtcItem;
  172.  import net.sf.l2j.gameserver.model.pledge.Clan;
  173.  import net.sf.l2j.gameserver.model.zone.type.MultiZone;
  174. +import net.sf.l2j.gameserver.model.zone.type.PartyZone;
  175.  import net.sf.l2j.gameserver.network.SystemMessageId;
  176.  import net.sf.l2j.gameserver.network.serverpackets.ExUseSharedGroupItem;
  177.  import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
  178. @@ -132,6 +133,10 @@
  179.                 final MultiZone multi = ZoneManager.getInstance().getZone(this, MultiZone.class);
  180.                 if (multi != null)
  181.                         multi.onDie(this);
  182. +
  183. +               final PartyZone party = ZoneManager.getInstance().getZone(this, PartyZone.class);
  184. +               if (party != null)
  185. +                       party.onDie(this);
  186.                
  187.                 // Notify Quest of Playable's death
  188.                 final Player actingPlayer = getActingPlayer();
  189. @@ -167,6 +172,10 @@
  190.                 final MultiZone multi = ZoneManager.getInstance().getZone(this, MultiZone.class);
  191.                 if (multi != null)
  192.                         multi.onRevive(this);
  193. +
  194. +               final PartyZone party = ZoneManager.getInstance().getZone(this, PartyZone.class);
  195. +               if (party != null)
  196. +                       party.onRevive(this);
  197.                
  198.                 // Start broadcast status
  199.                 broadcastPacket(new Revive(this));
  200. diff --git a/aCis/java/net/sf/l2j/gameserver/model/entity/PartyEvent.java b/aCis/java/net/sf/l2j/gameserver/model/entity/PartyEvent.java
  201. new file mode 100644
  202. index 0000000..f10e4ec
  203. --- /dev/null
  204. +++ b/aCis/java/net/sf/l2j/gameserver/model/entity/PartyEvent.java
  205. @@ -0,0 +1,171 @@
  206. +package net.sf.l2j.gameserver.model.entity;
  207. +
  208. +import java.util.ArrayList;
  209. +import java.util.Calendar;
  210. +import java.util.List;
  211. +
  212. +import net.sf.l2j.commons.logging.CLogger;
  213. +import net.sf.l2j.commons.pool.ThreadPool;
  214. +
  215. +import net.sf.l2j.Config;
  216. +import net.sf.l2j.gameserver.data.manager.ZoneManager;
  217. +import net.sf.l2j.gameserver.data.xml.MapRegionData.TeleportType;
  218. +import net.sf.l2j.gameserver.data.xml.NpcData;
  219. +import net.sf.l2j.gameserver.model.World;
  220. +import net.sf.l2j.gameserver.model.actor.Creature;
  221. +import net.sf.l2j.gameserver.model.actor.Npc;
  222. +import net.sf.l2j.gameserver.model.actor.Player;
  223. +import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  224. +import net.sf.l2j.gameserver.model.location.Location;
  225. +import net.sf.l2j.gameserver.model.spawn.Spawn;
  226. +import net.sf.l2j.gameserver.model.zone.type.PartyZone;
  227. +
  228. +/**
  229. + * @author Williams
  230. + *
  231. + */
  232. +public class PartyEvent implements Runnable
  233. +{
  234. +       private static final CLogger LOGGER = new CLogger(PartyEvent.class.getName());
  235. +      
  236. +       private static final PartyZone PARTY_ZONE = ZoneManager.getInstance().getZoneById(1, PartyZone.class);
  237. +      
  238. +       public enum States
  239. +       {
  240. +               AWAITING,
  241. +               ACTIVE,
  242. +               INACTIVE;
  243. +       }
  244. +      
  245. +       private States _state;
  246. +       private int _tick;
  247. +      
  248. +       private List<Npc> _monsters = new ArrayList<>();
  249. +      
  250. +       public PartyEvent()
  251. +       {
  252. +               if (Config.PARTY_ZONE_ENABLE)
  253. +               {
  254. +                       _state = States.AWAITING;
  255. +                       ThreadPool.scheduleAtFixedRate(this, 1000, 1000);
  256. +                       LOGGER.info("Party Farm: Event is active.");
  257. +               }
  258. +               else
  259. +               {
  260. +                       _state = States.INACTIVE;
  261. +                       LOGGER.info("Party Farm: Event is disabled.");
  262. +               }
  263. +       }
  264. +      
  265. +       @Override
  266. +       public void run()
  267. +       {
  268. +               if (_state == States.AWAITING)
  269. +               {
  270. +                       Calendar calendar = Calendar.getInstance();
  271. +                       int hour = calendar.get(Calendar.HOUR_OF_DAY);
  272. +                       int minute = calendar.get(Calendar.MINUTE);
  273. +                      
  274. +                       for (String time : Config.PARTY_ZONE_TIME)
  275. +                       {
  276. +                               String[] splitTime = time.split(":");
  277. +                               if (Integer.parseInt(splitTime[0]) == hour && Integer.parseInt(splitTime[1]) == minute)
  278. +                                       startEvent();
  279. +                       }
  280. +               }
  281. +               else if (_state == States.ACTIVE)
  282. +               {
  283. +                       switch (_tick)
  284. +                       {
  285. +                               case 3600: // 60 minutes left
  286. +                               case 1800: // 30 minutes left
  287. +                               case 600: // 15 minutes left
  288. +                               case 900: // 10 minutes left
  289. +                               case 300: // 5 minutes left
  290. +                               case 240: // 4 minutes left
  291. +                               case 180: // 3 minutes left
  292. +                               case 120: // 2 minutes left
  293. +                               case 60: // 1 minute left
  294. +                                       World.announceToOnlinePlayers("Party Farm: " + (_tick / 60) + " minute(s) until the Party Farm event is finished!", true);
  295. +                                       break;
  296. +                               case 30: // 30 seconds left
  297. +                               case 15: // 15 seconds left
  298. +                               case 3: // 3 seconds left
  299. +                               case 2: // 2 seconds left
  300. +                               case 1: // 1 seconds left
  301. +                                       World.announceToOnlinePlayers("Party Farm: " + _tick + " second(s) until the Party Farm event is finished!", true);
  302. +                                       break;
  303. +                       }
  304. +                      
  305. +                       if (_tick == 0)
  306. +                               endEvent();
  307. +                      
  308. +                       _tick--;
  309. +               }
  310. +       }
  311. +
  312. +       public void startEvent()
  313. +       {
  314. +               _state = States.ACTIVE;
  315. +              
  316. +               // spawn monsters
  317. +               Config.PARTY_ZONE_LOCS.forEach(loc -> spawnMonsters(Config.PARTY_MONSTER_ID, loc));
  318. +               World.announceToOnlinePlayers("Party Farm: event enabled, go to the gatekeeper to teleport.", true);
  319. +               _tick = Config.PARTY_ZONE_RUNNING_TIME * 60;
  320. +       }
  321. +      
  322. +       private Npc spawnMonsters(int npcId, Location loc)
  323. +       {
  324. +               Npc ret = null;
  325. +               final NpcTemplate template = NpcData.getInstance().getTemplate(npcId);
  326. +               try
  327. +               {
  328. +                       final Spawn spawn = new Spawn(template);
  329. +                       spawn.setLoc(loc.getX(), loc.getY(), loc.getZ(), 0);
  330. +                       spawn.setRespawnDelay(60);
  331. +                       spawn.setRespawnState(true);
  332. +                       ret = spawn.doSpawn(false);
  333. +               }
  334. +               catch (Exception e)
  335. +               {
  336. +                       LOGGER.warn("Party Farm: Unable to spawn npc with id " + npcId + ".");
  337. +               }
  338. +              
  339. +               if (ret != null)
  340. +                       _monsters.add(ret);
  341. +              
  342. +               return ret;
  343. +       }
  344. +      
  345. +       public void endEvent()
  346. +       {
  347. +               _state = States.INACTIVE;
  348. +              
  349. +               World.announceToOnlinePlayers("Party Farm: event finish, thank you for participating.", true);
  350. +              
  351. +               // Remove all participants from the zone
  352. +               for (Creature cha : PARTY_ZONE.getKnownTypeInside(Player.class))
  353. +                       cha.teleportTo(TeleportType.TOWN);
  354. +              
  355. +               // Remove all monsters from the zone
  356. +               for (Npc npc : _monsters)
  357. +               {
  358. +                       final Spawn spawn = npc.getSpawn();
  359. +                       if (spawn != null)
  360. +                               spawn.setRespawnState(false);
  361. +                      
  362. +                       npc.deleteMe();
  363. +               }
  364. +               _monsters.clear();
  365. +       }
  366. +      
  367. +       public static PartyEvent getInstance()
  368. +       {
  369. +               return SingletonHolder.INSTANCE;
  370. +       }
  371. +      
  372. +       private static class SingletonHolder
  373. +       {
  374. +               protected static final PartyEvent INSTANCE = new PartyEvent();
  375. +       }
  376. +}
  377. \ No newline at end of file
  378. diff --git a/aCis/java/net/sf/l2j/gameserver/model/location/Teleport.java b/aCis/java/net/sf/l2j/gameserver/model/location/Teleport.java
  379. index a2bafe7..5006984 100644
  380. --- a/aCis/java/net/sf/l2j/gameserver/model/location/Teleport.java
  381. +++ b/aCis/java/net/sf/l2j/gameserver/model/location/Teleport.java
  382. @@ -20,6 +20,7 @@
  383.         private final int _priceId;
  384.         private final int _priceCount;
  385.         private final int _castleId;
  386. +       private final boolean _isParty;
  387.        
  388.         public Teleport(StatSet set)
  389.         {
  390. @@ -30,6 +31,7 @@
  391.                 _priceId = set.getInteger("priceId");
  392.                 _priceCount = set.getInteger("priceCount");
  393.                 _castleId = set.getInteger("castleId", 0);
  394. +               _isParty = set.getBool("isParty", false);
  395.         }
  396.        
  397.         @Override
  398. @@ -63,6 +65,11 @@
  399.                 return _castleId;
  400.         }
  401.        
  402. +       public boolean isParty()
  403. +       {
  404. +               return _isParty;       
  405. +       }
  406. +      
  407.         /**
  408.          * In L2OFF half price teleport feature is set in 'event.ini' and is named 'CoreTime'.<br>
  409.          * However some custom/extended L2OFF packs are likely to use type "PRIMEHOURS", but it is nothing more than static data duplication.<br>
  410. diff --git a/aCis/java/net/sf/l2j/gameserver/model/zone/type/PartyZone.java b/aCis/java/net/sf/l2j/gameserver/model/zone/type/PartyZone.java
  411. new file mode 100644
  412. index 0000000..d70f578
  413. --- /dev/null
  414. +++ b/aCis/java/net/sf/l2j/gameserver/model/zone/type/PartyZone.java
  415. @@ -0,0 +1,129 @@
  416. +package net.sf.l2j.gameserver.model.zone.type;
  417. +
  418. +import net.sf.l2j.commons.pool.ThreadPool;
  419. +
  420. +import net.sf.l2j.gameserver.data.xml.MapRegionData.TeleportType;
  421. +import net.sf.l2j.gameserver.enums.SpawnType;
  422. +import net.sf.l2j.gameserver.enums.ZoneId;
  423. +import net.sf.l2j.gameserver.model.actor.Creature;
  424. +import net.sf.l2j.gameserver.model.actor.Player;
  425. +import net.sf.l2j.gameserver.model.actor.Summon;
  426. +import net.sf.l2j.gameserver.model.zone.type.subtype.SpawnZoneType;
  427. +import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;
  428. +
  429. +/**
  430. + * @author Williams
  431. + *
  432. + */
  433. +public class PartyZone extends SpawnZoneType
  434. +{
  435. +       private int _reviveDelay;
  436. +       private boolean _isFlag;
  437. +      
  438. +       public PartyZone(int id)
  439. +       {
  440. +               super(id);
  441. +       }
  442. +      
  443. +       @Override
  444. +       public void setParameter(String name, String value)
  445. +       {
  446. +               if (name.equals("reviveDelay"))
  447. +                       _reviveDelay = Integer.parseInt(value);
  448. +               else if (name.equals("isFlag"))
  449. +                       _isFlag = Boolean.parseBoolean(value);
  450. +               else
  451. +                       super.setParameter(name, value);
  452. +       }
  453. +      
  454. +       @Override
  455. +       protected void onEnter(Creature character)
  456. +       {
  457. +               character.setInsideZone(ZoneId.NO_STORE, true);
  458. +               character.setInsideZone(ZoneId.PARTY, true);
  459. +              
  460. +               if (character instanceof Player)
  461. +               {
  462. +                       final Player player = (Player) character;
  463. +                      
  464. +                       // Add Flag
  465. +                       if (_isFlag)
  466. +                       {
  467. +                               player.updatePvPFlag(1);
  468. +                               return;
  469. +                       }
  470. +                      
  471. +                       if (!player.isInParty())
  472. +                       {
  473. +                               player.sendMessage("You are not currently on party.");
  474. +                               player.teleportTo(TeleportType.TOWN);
  475. +                               return;
  476. +                       }
  477. +               }
  478. +       }
  479. +      
  480. +       @Override
  481. +       protected void onExit(Creature character)
  482. +       {
  483. +               character.setInsideZone(ZoneId.PARTY, false);
  484. +               character.setInsideZone(ZoneId.NO_STORE, false);
  485. +              
  486. +               if (character instanceof Player)
  487. +               {
  488. +                       final Player player = (Player) character;
  489. +                       if (_isFlag)
  490. +                       {
  491. +                               player.updatePvPFlag(0);
  492. +                               return;
  493. +                       }
  494. +               }
  495. +       }
  496. +      
  497. +       public void onDie(Creature character)
  498. +       {
  499. +               if (_reviveDelay > 0)
  500. +               {
  501. +                       ThreadPool.schedule(() -> respawnCharacter(character), _reviveDelay * 1000);
  502. +                       character.sendPacket(new ExShowScreenMessage("You will be revived in " + _reviveDelay + " second(s).", 5000));
  503. +               }
  504. +       }
  505. +      
  506. +       public void onRevive(Creature character)
  507. +       {
  508. +               if (_reviveDelay > 0)
  509. +               {
  510. +                       if (character instanceof Player)
  511. +                       {
  512. +                               final Player player = (Player) character;
  513. +                               final Summon pet = player.getSummon();
  514. +                               if (pet != null)
  515. +                                       pet.getStatus().setMaxHpMp();
  516. +                              
  517. +                               player.getStatus().setMaxCpHpMp();
  518. +                       }
  519. +               }
  520. +       }
  521. +      
  522. +       private void respawnCharacter(Creature character)
  523. +       {
  524. +               if (character instanceof Player)
  525. +               {
  526. +                       final Player player = (Player) character;
  527. +                       if (player.isDead())
  528. +                       {
  529. +                               player.doRevive();
  530. +                               player.teleportTo(getRndSpawn((player.getKarma() > 0) ? SpawnType.CHAOTIC : SpawnType.NORMAL), 20);
  531. +                       }
  532. +               }
  533. +       }
  534. +      
  535. +       public boolean isFlag()
  536. +       {
  537. +               return _isFlag;
  538. +       }
  539. +      
  540. +       public int getRevive()
  541. +       {
  542. +               return _reviveDelay;   
  543. +       }
  544. +}
  545. \ No newline at end of file
  546. diff --git a/aCis/java/net/sf/l2j/gameserver/network/serverpackets/Die.java b/aCis/java/net/sf/l2j/gameserver/network/serverpackets/Die.java
  547. index 6aaf651..efd1fa8 100644
  548. --- a/aCis/java/net/sf/l2j/gameserver/network/serverpackets/Die.java
  549. +++ b/aCis/java/net/sf/l2j/gameserver/network/serverpackets/Die.java
  550. @@ -10,6 +10,7 @@
  551.  import net.sf.l2j.gameserver.model.entity.engine.EventListener;
  552.  import net.sf.l2j.gameserver.model.pledge.Clan;
  553.  import net.sf.l2j.gameserver.model.zone.type.MultiZone;
  554. +import net.sf.l2j.gameserver.model.zone.type.PartyZone;
  555.  
  556.  public class Die extends L2GameServerPacket
  557.  {
  558. @@ -17,6 +18,7 @@
  559.         private final int _objectId;
  560.         private final boolean _fake;
  561.         private boolean _isReviveZone;
  562. +       private boolean _isRevivePartyZone;
  563.         private boolean _event;
  564.        
  565.         private boolean _sweepable;
  566. @@ -35,6 +37,10 @@
  567.                         _allowFixedRes = player.getAccessLevel().allowFixedRes();
  568.                         _clan = player.getClan();
  569.                        
  570. +                       final PartyZone party = ZoneManager.getInstance().getZone(player, PartyZone.class);
  571. +                       if (party != null)
  572. +                               _isRevivePartyZone = party.getRevive() != 0;
  573. +                      
  574.                         final MultiZone multi = ZoneManager.getInstance().getZone(player, MultiZone.class);
  575.                         if (multi != null)
  576.                                 _isReviveZone = multi.getReviveDelay() != 0;
  577. @@ -53,7 +59,7 @@
  578.                
  579.                 writeC(0x06);
  580.                 writeD(_objectId);
  581. -               writeD(_event ? 0x00 : _isReviveZone ? 0x00 : 0x01); // to nearest village
  582. +               writeD(_isRevivePartyZone ? 0x00 : _event ? 0x00 : _isReviveZone ? 0x00 : 0x01); // to nearest village
  583.                
  584.                 if (_clan != null)
  585.                 {
  586. diff --git a/aCis/java/net/sf/l2j/gameserver/taskmanager/PvpFlagTaskManager.java b/aCis/java/net/sf/l2j/gameserver/taskmanager/PvpFlagTaskManager.java
  587. index 7ed5619..c73dacd 100644
  588. --- a/aCis/java/net/sf/l2j/gameserver/taskmanager/PvpFlagTaskManager.java
  589. +++ b/aCis/java/net/sf/l2j/gameserver/taskmanager/PvpFlagTaskManager.java
  590. @@ -9,6 +9,7 @@
  591.  import net.sf.l2j.gameserver.model.actor.Player;
  592.  import net.sf.l2j.gameserver.model.zone.type.BossZone;
  593.  import net.sf.l2j.gameserver.model.zone.type.MultiZone;
  594. +import net.sf.l2j.gameserver.model.zone.type.PartyZone;
  595.  
  596.  /**
  597.   * Update and clear PvP flag of {@link Player}s after specified time.
  598. @@ -53,7 +54,14 @@
  599.                                 _players.remove(player);
  600.                                 continue;
  601.                         }
  602. -                      
  603. +
  604. +                       final PartyZone party = ZoneManager.getInstance().getZone(player, PartyZone.class);
  605. +                       if (party != null && party.isFlag())
  606. +                       {
  607. +                               _players.remove(player);
  608. +                               continue;
  609. +                       }
  610. +
  611.                         // Time is running out, clear PvP flag and remove from list.
  612.                         if (currentTime > timeLeft)
  613.                                 remove(player, true);

Pastebin Tech is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.