Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/config/CustomMods/SpecialMods.ini b/config/CustomMods/SpecialMods.ini
- new file mode 100644
- index 0000000..bcd1b62
- --- /dev/null
- +++ b/config/CustomMods/SpecialMods.ini
- @@ -0,0 +1,7 @@
- +
- +#======================================================
- +# Teleporte Free For Player Level
- +#======================================================
- +#Retail Lv 40
- +FreeTeleportUntil = 40
- +
- diff --git a/java/net/sf/l2j/Config.java b/java/net/sf/l2j/Config.java
- index 5baf858..783c70c 100644
- --- a/java/net/sf/l2j/Config.java
- +++ b/java/net/sf/l2j/Config.java
- @@ -758,6 +758,7 @@
- public static float BUFFER_BASE_MP_MAX;
- /** Enable modifying skill duration */
- public static boolean ENABLE_MODIFY_SKILL_DURATION;
- + public static int FREE_TELEPORT_UNTIL;
- /** Skill duration list */
- public static Map<Integer, Integer> SKILL_DURATION_LIST;
- @@ -2212,6 +2213,7 @@
- ANNOUNCE_GRANDBOS_KILL = Boolean.parseBoolean(Special.getProperty("AnnounceGranBossKill", "false"));
- ANNOUNCE_BOSS_ALIVE = Boolean.parseBoolean(Special.getProperty("AnnounceSpawnAllBoss", "false"));
- ENABLE_MODIFY_SKILL_DURATION = Boolean.parseBoolean(Special.getProperty("EnableModifySkillDuration", "False"));
- + FREE_TELEPORT_UNTIL = Integer.parseInt(Special.getProperty("FreeTeleportUntil", "1"));
- // Create Map only if enabled
- if (ENABLE_MODIFY_SKILL_DURATION)
- {
- diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2AdventurerInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2AdventurerInstance.java
- index a597f1b..236ba81 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2AdventurerInstance.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2AdventurerInstance.java
- @@ -77,7 +77,7 @@
- }
- @Override
- - public String getHtmlPath(int npcId, int val)
- + public String getHtmlPath(L2PcInstance player,int npcId, int val)
- {
- String pom = "";
- diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2BlacksmithInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2BlacksmithInstance.java
- index 7210e80..4adaf4d 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2BlacksmithInstance.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2BlacksmithInstance.java
- @@ -40,7 +40,7 @@
- }
- @Override
- - public String getHtmlPath(int npcId, int val)
- + public String getHtmlPath(L2PcInstance player,int npcId, int val)
- {
- String pom = "";
- if (val == 0)
- diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java
- index 6c93c78..55d7862 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java
- @@ -44,7 +44,7 @@
- }
- @Override
- - public String getHtmlPath(int npcId, int val)
- + public String getHtmlPath(L2PcInstance player,int npcId, int val)
- {
- String pom = "";
- diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2FishermanInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2FishermanInstance.java
- index 0edf1a1..c0a478f 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2FishermanInstance.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2FishermanInstance.java
- @@ -36,7 +36,7 @@
- }
- @Override
- - public String getHtmlPath(int npcId, int val)
- + public String getHtmlPath(L2PcInstance player,int npcId, int val)
- {
- String pom = "";
- diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2GuardInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2GuardInstance.java
- index 882bd50..40efd8f 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2GuardInstance.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2GuardInstance.java
- @@ -120,7 +120,7 @@
- *
- */
- @Override
- - public String getHtmlPath(int npcId, int val)
- + public String getHtmlPath(L2PcInstance player,int npcId, int val)
- {
- String pom = "";
- if (val == 0)
- diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2ManorManagerInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2ManorManagerInstance.java
- index 55aad2e..25d05dc 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2ManorManagerInstance.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2ManorManagerInstance.java
- @@ -180,7 +180,7 @@
- }
- @Override
- - public String getHtmlPath(int npcId, int val)
- + public String getHtmlPath(L2PcInstance player,int npcId, int val)
- {
- return "data/html/manormanager/manager.htm"; // Used only in parent method to return from "Territory status" to initial screen.
- }
- diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2MerchantInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2MerchantInstance.java
- index 5d55e59..04c7282 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2MerchantInstance.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2MerchantInstance.java
- @@ -47,7 +47,7 @@
- }
- @Override
- - public String getHtmlPath(int npcId, int val)
- + public String getHtmlPath(L2PcInstance player,int npcId, int val)
- {
- String pom = "";
- diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java
- index 0b059c1..bbe736c 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java
- @@ -1262,11 +1262,12 @@
- * <BR>
- * <li>L2GuardInstance : Set the pathfile to data/html/guard/12006-1.htm (npcId-page number)</li><BR>
- * <BR>
- + * @param player
- * @param npcId The Identifier of the L2NpcInstance whose text must be display
- * @param val The number of the page to display
- * @return
- */
- - public String getHtmlPath(int npcId, int val)
- + public String getHtmlPath(L2PcInstance player, int npcId, int val)
- {
- String pom = "";
- if (val == 0)
- @@ -1537,7 +1538,7 @@
- if (val == 0) // 0 - first buy lottery ticket window
- {
- - filename = (getHtmlPath(npcId, 1));
- + filename = (getHtmlPath(player, npcId, 1));
- html.setFile(filename);
- }
- else if ((val >= 1) && (val <= 21)) // 1-20 - buttons, 21 - second buy lottery ticket window
- @@ -1555,7 +1556,7 @@
- return;
- }
- - filename = (getHtmlPath(npcId, 5));
- + filename = (getHtmlPath(player, npcId, 5));
- html.setFile(filename);
- int count = 0;
- @@ -1679,17 +1680,17 @@
- iu.addModifiedItem(adenaupdate);
- player.sendPacket(iu);
- - filename = (getHtmlPath(npcId, 3));
- + filename = (getHtmlPath(player, npcId, 3));
- html.setFile(filename);
- }
- else if (val == 23) // 23 - current lottery jackpot
- {
- - filename = (getHtmlPath(npcId, 3));
- + filename = (getHtmlPath(player, npcId, 3));
- html.setFile(filename);
- }
- else if (val == 24) // 24 - Previous winning numbers/Prize claim
- {
- - filename = (getHtmlPath(npcId, 4));
- + filename = (getHtmlPath(player, npcId, 4));
- html.setFile(filename);
- int lotonumber = Lottery.getInstance().getId();
- @@ -2151,7 +2152,7 @@
- return;
- }
- // Get the text of the selected HTML file in function of the npcId and of the page number
- - filename = (getHtmlPath(npcId, val));
- + filename = (getHtmlPath(player, npcId, val));
- break;
- }
- diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2ObservationInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2ObservationInstance.java
- index 3756c49..7009387 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2ObservationInstance.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2ObservationInstance.java
- @@ -83,7 +83,7 @@
- }
- @Override
- - public String getHtmlPath(int npcId, int val)
- + public String getHtmlPath(L2PcInstance player,int npcId, int val)
- {
- String pom = "";
- if (val == 0)
- diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2OlympiadManagerInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2OlympiadManagerInstance.java
- index 7c09e4e..95be6b5 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2OlympiadManagerInstance.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2OlympiadManagerInstance.java
- @@ -230,7 +230,7 @@
- }
- else
- {
- - filename = (getHtmlPath(npcId, val));
- + filename = (getHtmlPath(player, npcId, val));
- }
- break;
- case 8690:
- @@ -244,7 +244,7 @@
- }
- else
- {
- - filename = (getHtmlPath(npcId, val));
- + filename = (getHtmlPath(player, npcId, val));
- }
- break;
- }
- diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2RaceManagerInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2RaceManagerInstance.java
- index 3b304af..d11f5c0 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2RaceManagerInstance.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2RaceManagerInstance.java
- @@ -287,7 +287,7 @@
- int npcId = getTemplate().npcId;
- String filename, search;
- NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
- - filename = getHtmlPath(npcId, 5);
- + filename = getHtmlPath(player, npcId, 5);
- html.setFile(filename);
- for (int i = 0; i < 8; i++)
- {
- @@ -306,7 +306,7 @@
- int npcId = getTemplate().npcId;
- String filename, search;
- NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
- - filename = getHtmlPath(npcId, 6);
- + filename = getHtmlPath(player, npcId, 6);
- html.setFile(filename);
- for (int i = 0; i < 8; i++)
- {
- @@ -328,7 +328,7 @@
- NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
- if (val < 10)
- {
- - filename = getHtmlPath(npcId, 2);
- + filename = getHtmlPath(player, npcId, 2);
- html.setFile(filename);
- for (int i = 0; i < 8; i++)
- {
- @@ -347,7 +347,7 @@
- else if (val < 20)
- {
- if (player.getRace(0) == 0) return;
- - filename = getHtmlPath(npcId, 3);
- + filename = getHtmlPath(player, npcId, 3);
- html.setFile(filename);
- html.replace("0place", "" + player.getRace(0));
- search = "Mob1";
- @@ -364,7 +364,7 @@
- else if (val == 20)
- {
- if (player.getRace(0) == 0 || player.getRace(1) == 0) return;
- - filename = getHtmlPath(npcId, 4);
- + filename = getHtmlPath(player, npcId, 4);
- html.setFile(filename);
- html.replace("0place", "" + player.getRace(0));
- search = "Mob1";
- diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2SepulcherNpcInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2SepulcherNpcInstance.java
- index be23e00..076a902 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2SepulcherNpcInstance.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2SepulcherNpcInstance.java
- @@ -183,7 +183,7 @@
- }
- @Override
- - public String getHtmlPath(int npcId, int val)
- + public String getHtmlPath(L2PcInstance player,int npcId, int val)
- {
- String pom = "";
- if (val == 0)
- @@ -197,7 +197,7 @@
- @Override
- public void showChatWindow(L2PcInstance player, int val)
- {
- - String filename = getHtmlPath(getNpcId(), val);
- + String filename = getHtmlPath(player, getNpcId(), val);
- NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
- html.setFile(filename);
- html.replace("%objectId%", String.valueOf(getObjectId()));
- diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2SymbolMakerInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2SymbolMakerInstance.java
- index 7eaa7e3..a2e7123 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2SymbolMakerInstance.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2SymbolMakerInstance.java
- @@ -81,7 +81,7 @@
- }
- @Override
- - public String getHtmlPath(int npcId, int val)
- + public String getHtmlPath(L2PcInstance player,int npcId, int val)
- {
- String pom = "";
- diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2TeleporterInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2TeleporterInstance.java
- index 2d4e9d5..381bec0 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2TeleporterInstance.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2TeleporterInstance.java
- @@ -89,7 +89,7 @@
- }
- @Override
- - public String getHtmlPath(int npcId, int val)
- + public String getHtmlPath(L2PcInstance player, int npcId, int val)
- {
- String pom = "";
- if (val == 0)
- @@ -100,7 +100,10 @@
- {
- pom = npcId + "-" + val;
- }
- -
- + if (player.getLevel() <= Config.FREE_TELEPORT_UNTIL)
- + {
- + return "data/html/teleporter/free/" + pom + ".htm";
- + }
- return "data/html/teleporter/" + pom + ".htm";
- }
- @@ -123,7 +126,7 @@
- }
- else if (condition == COND_CASTLE_OWNER) // Clan owns castle
- {
- - filename = getHtmlPath(getNpcId(), 0); // Owner message window
- + filename = getHtmlPath(player, getNpcId(), 0); // Owner message window
- }
- }
- else if (condition == COND_ALL_FALSE)
- @@ -169,6 +172,10 @@
- player.sendMessage("You cannot use teleporting services while in combat.");
- return;
- }
- + else if(!list.getIsForNoble() && ((Config.ALT_GAME_FREE_TELEPORT || player.getLevel() <= Config.FREE_TELEPORT_UNTIL) || player.reduceAdena("Teleport", list.getPrice(), this, true)))
- + {
- + player.teleToLocation(list.getLocX(), list.getLocY(), list.getLocZ(), true);
- + }
- else if (list.getIsForNoble() && !player.isNoble())
- {
- String filename = "data/html/teleporter/nobleteleporter-no.htm";
- diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2TrainerInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2TrainerInstance.java
- index e723d36..b51bd28 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2TrainerInstance.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2TrainerInstance.java
- @@ -33,7 +33,7 @@
- }
- @Override
- - public String getHtmlPath(int npcId, int val)
- + public String getHtmlPath(L2PcInstance player,int npcId, int val)
- {
- String pom = "";
- if (val == 0)
- diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java
- index e18b170..8e9f755 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java
- @@ -388,7 +388,7 @@
- }
- @Override
- - public String getHtmlPath(int npcId, int val)
- + public String getHtmlPath(L2PcInstance player,int npcId, int val)
- {
- String pom = "";
- diff --git a/java/net/sf/l2j/gameserver/model/actor/instance/L2WarehouseInstance.java b/java/net/sf/l2j/gameserver/model/actor/instance/L2WarehouseInstance.java
- index 5f2e366..1d09985 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/instance/L2WarehouseInstance.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/instance/L2WarehouseInstance.java
- @@ -42,7 +42,7 @@
- }
- @Override
- - public String getHtmlPath(int npcId, int val)
- + public String getHtmlPath(L2PcInstance player,int npcId, int val)
- {
- String pom = "";
- if (val == 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement