Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P aCis_gameserver
- diff --git java/net/sf/l2j/gameserver/handler/itemhandlers/custom/Vip15days.java
- index a8cb40a..7d1872d 100644
- --- java/net/sf/l2j/gameserver/handler/itemhandlers/custom/Vip15days.java
- +++ java/net/sf/l2j/gameserver/handler/itemhandlers/custom/Vip15days.java
- @@ -66,68 +66,68 @@
- if (_daysleft < 30 && _daysleft > 0)
- {
- while (_daysleft > 0)
- {
- if (calendar.get(Calendar.DATE) == 28 && calendar.get(Calendar.MONTH) == 1)
- calendar.roll(Calendar.MONTH, true);
- if (calendar.get(Calendar.DATE) == 30)
- {
- if (calendar.get(Calendar.MONTH) == 11)
- calendar.roll(Calendar.YEAR, true);
- calendar.roll(Calendar.MONTH, true);
- }
- calendar.roll(Calendar.DATE, true);
- _daysleft--;
- }
- }
- end_day = calendar.getTimeInMillis();
- VipManager.getInstance().updateVip(activeChar.getObjectId(), end_day);
- }
- else
- {
- long end_day;
- final Calendar calendar = Calendar.getInstance();
- - if (mes >= 30)
- + if (mes >= 31)
- {
- - while (mes >= 30)
- + while (mes >= 31)
- {
- if (calendar.get(Calendar.MONTH) == 11)
- calendar.roll(Calendar.YEAR, true);
- calendar.roll(Calendar.MONTH, true);
- - mes -= 30;
- + mes -= 31;
- }
- }
- - if (mes < 30 && mes > 0)
- + if (mes < 31 && mes > 0)
- {
- while (mes > 0)
- {
- if (calendar.get(Calendar.DATE) == 28 && calendar.get(Calendar.MONTH) == 1)
- calendar.roll(Calendar.MONTH, true);
- - if (calendar.get(Calendar.DATE) == 30)
- + if (calendar.get(Calendar.DATE) == 31)
- {
- if (calendar.get(Calendar.MONTH) == 11)
- calendar.roll(Calendar.YEAR, true);
- calendar.roll(Calendar.MONTH, true);
- }
- calendar.roll(Calendar.DATE, true);
- mes--;
- }
- }
- end_day = calendar.getTimeInMillis();
- VipManager.getInstance().addVip(activeChar.getObjectId(), end_day);
- }
- long _daysleft;
- final long now = Calendar.getInstance().getTimeInMillis();
- long duration = VipManager.getInstance().getVipDuration(activeChar.getObjectId());
- final long endDay = duration;
- _daysleft = ((endDay - now) / 86400000);
- if (_daysleft < 270)
- {
- //activeChar.sendPacket(new ExShowScreenMessage("Your Vip privileges ends at " + new SimpleDateFormat("dd MMM, HH:mm").format(new Date(duration)) + ".", 10000));
- activeChar.sendMessage("Your vip privileges ends at " + new SimpleDateFormat("dd MMM, HH:mm").format(new Date(duration)) + ".");
- }
- diff --git java/net/sf/l2j/gameserver/handler/itemhandlers/custom/Vip24h.java
- index fced7e6..747a4b6 100644
- --- java/net/sf/l2j/gameserver/handler/itemhandlers/custom/Vip24h.java
- +++ java/net/sf/l2j/gameserver/handler/itemhandlers/custom/Vip24h.java
- @@ -80,68 +80,68 @@
- if (_daysleft < 30 && _daysleft > 0)
- {
- while (_daysleft > 0)
- {
- if (calendar.get(Calendar.DATE) == 28 && calendar.get(Calendar.MONTH) == 1)
- calendar.roll(Calendar.MONTH, true);
- if (calendar.get(Calendar.DATE) == 30)
- {
- if (calendar.get(Calendar.MONTH) == 11)
- calendar.roll(Calendar.YEAR, true);
- calendar.roll(Calendar.MONTH, true);
- }
- calendar.roll(Calendar.DATE, true);
- _daysleft--;
- }
- }
- end_day = calendar.getTimeInMillis();
- VipManager.getInstance().updateVip(activeChar.getObjectId(), end_day);
- }
- else
- {
- long end_day;
- final Calendar calendar = Calendar.getInstance();
- - if (mes >= 30)
- + if (mes >= 31)
- {
- - while (mes >= 30)
- + while (mes >= 31)
- {
- if (calendar.get(Calendar.MONTH) == 11)
- calendar.roll(Calendar.YEAR, true);
- calendar.roll(Calendar.MONTH, true);
- - mes -= 30;
- + mes -= 31;
- }
- }
- - if (mes < 30 && mes > 0)
- + if (mes < 31 && mes > 0)
- {
- while (mes > 0)
- {
- if (calendar.get(Calendar.DATE) == 28 && calendar.get(Calendar.MONTH) == 1)
- calendar.roll(Calendar.MONTH, true);
- - if (calendar.get(Calendar.DATE) == 30)
- + if (calendar.get(Calendar.DATE) == 31)
- {
- if (calendar.get(Calendar.MONTH) == 11)
- calendar.roll(Calendar.YEAR, true);
- calendar.roll(Calendar.MONTH, true);
- }
- calendar.roll(Calendar.DATE, true);
- mes--;
- }
- }
- end_day = calendar.getTimeInMillis();
- VipManager.getInstance().addVip(activeChar.getObjectId(), end_day);
- }
- long _daysleft;
- final long now = Calendar.getInstance().getTimeInMillis();
- long duration = VipManager.getInstance().getVipDuration(activeChar.getObjectId());
- final long endDay = duration;
- _daysleft = ((endDay - now) / 86400000);
- if (_daysleft < 270)
- {
- //activeChar.sendPacket(new ExShowScreenMessage("Your Vip privileges ends at " + new SimpleDateFormat("dd MMM, HH:mm").format(new Date(duration)) + ".", 10000));
- activeChar.sendMessage("Your vip privileges ends at " + new SimpleDateFormat("dd MMM, HH:mm").format(new Date(duration)) + ".");
- }
- diff --git java/net/sf/l2j/gameserver/handler/itemhandlers/custom/Vip30days.java
- index 0f168b6..3a846a3 100644
- --- java/net/sf/l2j/gameserver/handler/itemhandlers/custom/Vip30days.java
- +++ java/net/sf/l2j/gameserver/handler/itemhandlers/custom/Vip30days.java
- @@ -66,68 +66,68 @@
- if (_daysleft < 30 && _daysleft > 0)
- {
- while (_daysleft > 0)
- {
- if (calendar.get(Calendar.DATE) == 28 && calendar.get(Calendar.MONTH) == 1)
- calendar.roll(Calendar.MONTH, true);
- if (calendar.get(Calendar.DATE) == 30)
- {
- if (calendar.get(Calendar.MONTH) == 11)
- calendar.roll(Calendar.YEAR, true);
- calendar.roll(Calendar.MONTH, true);
- }
- calendar.roll(Calendar.DATE, true);
- _daysleft--;
- }
- }
- end_day = calendar.getTimeInMillis();
- VipManager.getInstance().updateVip(activeChar.getObjectId(), end_day);
- }
- else
- {
- long end_day;
- final Calendar calendar = Calendar.getInstance();
- - if (mes >= 30)
- + if (mes >= 31)
- {
- - while (mes >= 30)
- + while (mes >= 31)
- {
- if (calendar.get(Calendar.MONTH) == 11)
- calendar.roll(Calendar.YEAR, true);
- calendar.roll(Calendar.MONTH, true);
- - mes -= 30;
- + mes -= 31;
- }
- }
- - if (mes < 30 && mes > 0)
- + if (mes < 31 && mes > 0)
- {
- while (mes > 0)
- {
- if (calendar.get(Calendar.DATE) == 28 && calendar.get(Calendar.MONTH) == 1)
- calendar.roll(Calendar.MONTH, true);
- - if (calendar.get(Calendar.DATE) == 30)
- + if (calendar.get(Calendar.DATE) == 31)
- {
- if (calendar.get(Calendar.MONTH) == 11)
- calendar.roll(Calendar.YEAR, true);
- calendar.roll(Calendar.MONTH, true);
- }
- calendar.roll(Calendar.DATE, true);
- mes--;
- }
- }
- end_day = calendar.getTimeInMillis();
- VipManager.getInstance().addVip(activeChar.getObjectId(), end_day);
- }
- long _daysleft;
- final long now = Calendar.getInstance().getTimeInMillis();
- long duration = VipManager.getInstance().getVipDuration(activeChar.getObjectId());
- final long endDay = duration;
- _daysleft = ((endDay - now) / 86400000);
- if (_daysleft < 270)
- {
- //activeChar.sendPacket(new ExShowScreenMessage("Your Vip privileges ends at " + new SimpleDateFormat("dd MMM, HH:mm").format(new Date(duration)) + ".", 10000));
- activeChar.sendMessage("Your vip privileges ends at " + new SimpleDateFormat("dd MMM, HH:mm").format(new Date(duration)) + ".");
- }
- diff --git java/net/sf/l2j/gameserver/handler/itemhandlers/custom/Vip7days.java
- index e7da521..e376a8e 100644
- --- java/net/sf/l2j/gameserver/handler/itemhandlers/custom/Vip7days.java
- +++ java/net/sf/l2j/gameserver/handler/itemhandlers/custom/Vip7days.java
- @@ -80,68 +80,68 @@
- if (_daysleft < 30 && _daysleft > 0)
- {
- while (_daysleft > 0)
- {
- if (calendar.get(Calendar.DATE) == 28 && calendar.get(Calendar.MONTH) == 1)
- calendar.roll(Calendar.MONTH, true);
- if (calendar.get(Calendar.DATE) == 30)
- {
- if (calendar.get(Calendar.MONTH) == 11)
- calendar.roll(Calendar.YEAR, true);
- calendar.roll(Calendar.MONTH, true);
- }
- calendar.roll(Calendar.DATE, true);
- _daysleft--;
- }
- }
- end_day = calendar.getTimeInMillis();
- VipManager.getInstance().updateVip(activeChar.getObjectId(), end_day);
- }
- else
- {
- long end_day;
- final Calendar calendar = Calendar.getInstance();
- - if (mes >= 30)
- + if (mes >= 31)
- {
- - while (mes >= 30)
- + while (mes >= 31)
- {
- if (calendar.get(Calendar.MONTH) == 11)
- calendar.roll(Calendar.YEAR, true);
- calendar.roll(Calendar.MONTH, true);
- - mes -= 30;
- + mes -= 31;
- }
- }
- - if (mes < 30 && mes > 0)
- + if (mes < 31 && mes > 0)
- {
- while (mes > 0)
- {
- if (calendar.get(Calendar.DATE) == 28 && calendar.get(Calendar.MONTH) == 1)
- calendar.roll(Calendar.MONTH, true);
- - if (calendar.get(Calendar.DATE) == 30)
- + if (calendar.get(Calendar.DATE) == 31)
- {
- if (calendar.get(Calendar.MONTH) == 11)
- calendar.roll(Calendar.YEAR, true);
- calendar.roll(Calendar.MONTH, true);
- }
- calendar.roll(Calendar.DATE, true);
- mes--;
- }
- }
- end_day = calendar.getTimeInMillis();
- VipManager.getInstance().addVip(activeChar.getObjectId(), end_day);
- }
- long _daysleft;
- final long now = Calendar.getInstance().getTimeInMillis();
- long duration = VipManager.getInstance().getVipDuration(activeChar.getObjectId());
- final long endDay = duration;
- _daysleft = ((endDay - now) / 86400000);
- if (_daysleft < 270)
- {
- //activeChar.sendPacket(new ExShowScreenMessage("Your Vip privileges ends at " + new SimpleDateFormat("dd MMM, HH:mm").format(new Date(duration)) + ".", 10000));
- activeChar.sendMessage("Your vip privileges ends at " + new SimpleDateFormat("dd MMM, HH:mm").format(new Date(duration)) + ".");
- }
- diff --git java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/VoicedVipFree.java
- index 919dcf7..c3e1f30 100644
- --- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/VoicedVipFree.java
- +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/VoicedVipFree.java
- @@ -85,71 +85,71 @@
- {
- while (_daysleft > 0L)
- {
- if ((calendar.get(5) == 28) && (calendar.get(2) == 1))
- {
- calendar.roll(2, true);
- }
- if (calendar.get(5) == 30)
- {
- if (calendar.get(2) == 11)
- {
- calendar.roll(1, true);
- }
- calendar.roll(2, true);
- }
- calendar.roll(5, true);
- _daysleft -= 1L;
- }
- }
- long end_day = calendar.getTimeInMillis();
- VipManager.getInstance().updateVip(activeChar.getObjectId(), end_day);
- }
- else
- {
- Calendar calendar = Calendar.getInstance();
- - if (activeChar._vip_days >= 30)
- + if (activeChar._vip_days >= 31)
- {
- - while (activeChar._vip_days >= 30)
- + while (activeChar._vip_days >= 31)
- {
- if (calendar.get(2) == 11)
- {
- calendar.roll(1, true);
- }
- calendar.roll(2, true);
- - activeChar._vip_days -= 30;
- + activeChar._vip_days -= 31;
- }
- }
- - if ((activeChar._vip_days < 30) && (activeChar._vip_days > 0))
- + if ((activeChar._vip_days < 31) && (activeChar._vip_days > 0))
- {
- while (activeChar._vip_days > 0)
- {
- if ((calendar.get(5) == 28) && (calendar.get(2) == 1))
- {
- calendar.roll(2, true);
- }
- - if (calendar.get(5) == 30)
- + if (calendar.get(5) == 31)
- {
- if (calendar.get(2) == 11)
- {
- calendar.roll(1, true);
- }
- calendar.roll(2, true);
- }
- calendar.roll(5, true);
- activeChar._vip_days -= 1;
- }
- }
- long end_day = calendar.getTimeInMillis();
- VipManager.getInstance().addVip(activeChar.getObjectId(), end_day);
- }
- long now = Calendar.getInstance().getTimeInMillis();
- long duration = VipManager.getInstance().getVipDuration(activeChar.getObjectId());
- long endDay = duration;
- long _daysleft = (endDay - now) / 86400000L;
- if (_daysleft < 270L)
- {
- //activeChar.sendPacket(new ExShowScreenMessage("Your Vip privileges ends at " + new SimpleDateFormat("dd MMM, HH:mm").format(new Date(duration)) + ".", 10000));
- activeChar.sendMessage("Your Vip privileges ends at " + new SimpleDateFormat("dd MMM, HH:mm").format(new Date(duration)) + ".");
- }
- //}
Add Comment
Please, Sign In to add comment